From 02be99f377380899bec56269a2df23566de8b12b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 10 Jun 2020 17:05:13 +0200
Subject: [PATCH 001/217] InDetTrigTrackSlimmer: Use
 ITrackSlimmingTool::slimCopy().

Change TrigTrackSlimmer to use the slimCopy() method of ITrackSlimmingTool
rather than slim.

Avoids thread-safety issues.
---
 .../InDetTrigTrackSlimmer/src/TrigTrackSlimmer.cxx          | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigTrackSlimmer/src/TrigTrackSlimmer.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigTrackSlimmer/src/TrigTrackSlimmer.cxx
index d33b3aeae045..e476a170f608 100644
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigTrackSlimmer/src/TrigTrackSlimmer.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigTrackSlimmer/src/TrigTrackSlimmer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetTrigTrackSlimmer/TrigTrackSlimmer.h"
@@ -101,8 +101,8 @@ namespace InDet
           // FIXME: const_cast
 	  m_sumTool->updateTrack(*const_cast<Trk::Track*>(*it));
 	}
-	Trk::Track* slimmed = m_trackSlimmingTool->slim(**it);
-	slimmedTracks->push_back(slimmed);
+        std::unique_ptr<Trk::Track> slimmed = m_trackSlimmingTool->slimCopy(**it);
+	slimmedTracks->push_back(std::move(slimmed));
       }
       
     } 
-- 
GitLab


From 571aa78ddae7529b0cea0395640147781633470e Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 1 Jul 2020 01:30:37 +0100
Subject: [PATCH 002/217] Cleanup TrackInfo

---
 .../TrkEvent/TrkTrack/TrkTrack/TrackInfo.h    | 486 ++++++++----------
 .../TrkEvent/TrkTrack/TrkTrack/TrackInfo.icc  | 109 ++++
 Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx  | 409 ++++++++-------
 3 files changed, 532 insertions(+), 472 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.icc

diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
index 36bfb76048e0..3c778d8d7fc0 100755
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
@@ -5,10 +5,10 @@
 #ifndef TRKTRACK_TRACKINFO_H
 #define TRKTRACK_TRACKINFO_H
 
-#include <vector>
+#include <bitset>
 #include <iostream>
 #include <string>
-#include <bitset>
+#include <vector>
 
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 
@@ -16,15 +16,14 @@ class MsgStream;
 class TrackCnv_p4;
 class TrackParticleBaseCnv_p1;
 
-namespace Trk
-{
+namespace Trk {
 
 /**
- * @brief Contains information about the 'fitter' of this track. 
- *  Additionally there is some information about how the e.g. 
+ * @brief Contains information about the 'fitter' of this track.
+ *  Additionally there is some information about how the e.g.
  *  fit was configured. Also the information on the properties
  *  of the  track fit is stored.
- * 
+ *
  * @author Kirill.Prokofiev@cern.ch
  * @author edward.moyse@cern.ch
  */
@@ -32,445 +31,374 @@ namespace Trk
 class TrackInfo
 {
 public:
-
-  /** 
-   * enums to identify who created this track and whic propertis does it have. 
+  /**
+   * enums to identify who created this track and what propertis does it have.
    * N.B If you update this, don't forget to update the dump method!
    */
   enum TrackFitter
   {
-    /**Track fitter not defined.*/  					
-    Unknown			   = 0, 			         
+    /**Track fitter not defined.*/
+    Unknown = 0,
 
-    /**tracks produced by iPat*/						
-    iPatTrackFitter		   = 1, 			         
+    /**tracks produced by iPat*/
+    iPatTrackFitter = 1,
 
-    /**tracks produced by xKalman*/     				         
-    xKalman			   = 2, 			         
+    /**tracks produced by xKalman*/
+    xKalman = 2,
 
-    /**tracks produced by the Kalman Fitter*/       		         
-    KalmanFitter		   = 3, 			         
+    /**tracks produced by the Kalman Fitter*/
+    KalmanFitter = 3,
 
-    /**Tracks from Gaussian Sum Filter*/     			         
-    GaussianSumFilter 	   = 4, 			         
+    /**Tracks from Gaussian Sum Filter*/
+    GaussianSumFilter = 4,
 
-    /**Track's from Thijs' global chi^2 fitter*/      		         
-    GlobalChi2Fitter  	   = 5, 			         
+    /**Track's from Thijs' global chi^2 fitter*/
+    GlobalChi2Fitter = 5,
 
-    /**Fast Kalman filter from HLT with simplified material effects*/        
-    DistributedKalmanFilter	   = 6, 			         
+    /**Fast Kalman filter from HLT with simplified material effects*/
+    DistributedKalmanFilter = 6,
 
-    /**Adpative track fitter with fuzzy hit assignment*/      	         
+    /**Adpative track fitter with fuzzy hit assignment*/
     DeterministicAnnealingFilter = 7,
 
-    /** Kalman DNA Fitter*/      
-    KalmanDNAFitter	           = 8,		              		
+    /** Kalman DNA Fitter*/
+    KalmanDNAFitter = 8,
 
     /** Track produced with Muonboy's internal fitter.*/
-    MuonboyFitter                = 9,						         
+    MuonboyFitter = 9,
 
-    /**maximum number of enums*/     				         
-    NumberOfTrackFitters	   = 10				         
+    /**maximum number of enums*/
+    NumberOfTrackFitters = 10
   };
 
   enum TrackProperties
   {
 
-    /** A brem fit was performed on this track*/       
-    BremFit		     = 1, 	
+    /** A brem fit was performed on this track*/
+    BremFit = 1,
 
     /** A brem fit was performed on this track and this fit was successful*/
-    BremFitSuccessful       = 2,
+    BremFitSuccessful = 2,
 
-    /** A straight track*/      	 
-    StraightTrack	     = 3,	 
+    /** A straight track*/
+    StraightTrack = 3,
 
-    /** A slimmed track*/      
-    SlimmedTrack	     = 4,
+    /** A slimmed track*/
+    SlimmedTrack = 4,
 
-    /** A track with a kink or a hard scatter*/                	 
-    HardScatterOrKink       = 5,
+    /** A track with a kink or a hard scatter*/
+    HardScatterOrKink = 5,
 
-    /** A LowPt track */               	 
-    LowPtTrack 	     = 6,
+    /** A LowPt track */
+    LowPtTrack = 6,
 
-    /**maximum number of enums*/        
-    NumberOfTrackProperties = 7 
+    /**maximum number of enums*/
+    NumberOfTrackProperties = 7
   };
 
   enum TrackPatternRecoInfo
-  {    
-    /**  Tracks from SiSPSeedFinder */             
-    SiSPSeededFinder             = 0,
+  {
+    /**  Tracks from SiSPSeedFinder */
+    SiSPSeededFinder = 0,
 
-    /**  Tracks from SiCTBTracking */                 
-    SiCTBTracking                = 1,
+    /**  Tracks from SiCTBTracking */
+    SiCTBTracking = 1,
 
-    /**  Tracks with InDetAmbiguitySolver used */            
-    InDetAmbiguitySolver         = 2,
+    /**  Tracks with InDetAmbiguitySolver used */
+    InDetAmbiguitySolver = 2,
 
-    /**  Tracks with InDetExtensionProcessor used */       
-    InDetExtensionProcessor      = 3,
+    /**  Tracks with InDetExtensionProcessor used */
+    InDetExtensionProcessor = 3,
 
-    /**  Tracks from TRT Seeded Track finder */       
-    TRTSeededTrackFinder         = 4,
+    /**  Tracks from TRT Seeded Track finder */
+    TRTSeededTrackFinder = 4,
 
-    /**  Tracks from MuonBoy */     
-    Muonboy                      = 5,
+    /**  Tracks from MuonBoy */
+    Muonboy = 5,
 
     /**  Tracks from MuGirl not refitted with iPat */
-    MuGirlUnrefitted             = 6,
+    MuGirlUnrefitted = 6,
 
     /**  Tracks produced by STACO */
-    STACO                        = 7,
+    STACO = 7,
 
     /**  Tracks produced by StacoLowpt */
-    StacoLowPt                   = 8, 
+    StacoLowPt = 8,
 
-    /**  Tracks produced by MuTag */	
-    MuTag                        = 9,
+    /**  Tracks produced by MuTag */
+    MuTag = 9,
 
     /**  Tracks produced by Moore */
-    MooreToTrackTool             = 10,  
+    MooreToTrackTool = 10,
 
     /**  TrigInDetTracks produced by TrigIDSCAN, running at trigger LVL2*/
-    TrigIDSCAN                   = 11, 
+    TrigIDSCAN = 11,
 
     /**  TrigInDetTracks produced by TrigSiTrack, running at trigger LVL2*/
-    TrigSiTrack                  = 12, 
+    TrigSiTrack = 12,
 
     /**  TrigInDetTracks produced by TrigTRTxK, running at trigger LVL2*/
-    TrigTRTxK                    = 13,
+    TrigTRTxK = 13,
 
     /**  TrigInDetTracks produced by TrigTRTLUT, running at trigger LVL2*/
-    TrigTRTLUT                   = 14,
+    TrigTRTLUT = 14,
 
     /**  Track from FATRAS*/
-    Fatras                       = 15,
+    Fatras = 15,
 
-    /**  Added because of compilation problems*/     
-    iPatLegacyCnv                = 16,
+    /**  Added because of compilation problems*/
+    iPatLegacyCnv = 16,
 
-    /**  Added because of compilation problems*/     
-    xKalmanLegacyCnv             = 17,
+    /**  Added because of compilation problems*/
+    xKalmanLegacyCnv = 17,
 
-    /**  Added because of compilation problems*/     
+    /**  Added because of compilation problems*/
     SimpleAmbiguityProcessorTool = 18,
 
-    /**  Added because of compilation problems*/    
-    InDetAmbiTrackSelectionTool  = 19,
+    /**  Added because of compilation problems*/
+    InDetAmbiTrackSelectionTool = 19,
 
-    /**  TRT Standalone */	  
-    TRTStandalone                = 20,
+    /**  TRT Standalone */
+    TRTStandalone = 20,
 
-    /**  MuidStandalone */     
-    MuidStandAlone               = 21,
+    /**  MuidStandalone */
+    MuidStandAlone = 21,
 
     /**  TRTSeededSingleSpTrackFinder */
     TRTSeededSingleSpTrackFinder = 22,
 
     /**  Back compatibility with old type of ESD */
-    MooreLegacyCnv               = 23,
+    MooreLegacyCnv = 23,
 
-    /**  Back compatibility with older ESD versions */     
-    MuidComb                     = 24,
+    /**  Back compatibility with older ESD versions */
+    MuidComb = 24,
 
-    /**  Moore (MoMu) */ 
-    Moore                        = 25,    
+    /**  Moore (MoMu) */
+    Moore = 25,
 
-    /**  MuidCombined */     
-    MuidCombined	          = 26,
+    /**  MuidCombined */
+    MuidCombined = 26,
 
-    /**  MuidVertexAssociator */     
-    MuidVertexAssociator         = 27,
+    /**  MuidVertexAssociator */
+    MuidVertexAssociator = 27,
 
-    /**  MuGirl */     
-    MuGirl                       = 28,
+    /**  MuGirl */
+    MuGirl = 28,
 
-    /**  iPatRec */     
-    iPatRec                      = 29,
+    /**  iPatRec */
+    iPatRec = 29,
 
-    /**  MuGirlLowBeta */     
-    MuGirlLowBeta                = 30,
+    /**  MuGirlLowBeta */
+    MuGirlLowBeta = 30,
 
-    /**  Fatras Simulation */     
-    FatrasSimulation             = 31,     
+    /**  Fatras Simulation */
+    FatrasSimulation = 31,
 
-    /** Track which has its hits behind it, e.g. a downward moving cosmic track which through the upper hemisphere of ATLAS will have a beamline perigee pointing 
-      down, but many/all of its hits will be above. A downward moving cosmic track which is reconstructed across all of ATLAS could also have this flag set (i.e. 
-      it does not mean that hits are ONLY behind the perigee.
-      @warning This enum is the subject of some controversy and may be removed in the future. It would be safer to examine 
-      the track and determine this for yourself (especially as not all Track builders are currently filling this flag). EJWM.
+    /** Track which has its hits behind it, e.g. a downward moving cosmic track
+      which through the upper hemisphere of ATLAS will have a beamline perigee
+      pointing down, but many/all of its hits will be above. A downward moving
+      cosmic track which is reconstructed across all of ATLAS could also have
+      this flag set (i.e. it does not mean that hits are ONLY behind the
+      perigee.
+      @warning This enum is the subject of some controversy and may be removed
+      in the future. It would be safer to examine the track and determine this
+      for yourself (especially as not all Track builders are currently filling
+      this flag). EJWM.
       */
-    ReverseOrderedTrack         = 32,
-
-    /** Track which (physically) does not intersect the ID or Calo. i.e. not a partially reconstructed IP track, but a cosmic or beam halo track.
-      @warning This enum is the subject of some controversy and may be removed in the future. It would be safer to examine
-      the track and determine this for yourself (especially as not all Track builders are currently filling this flag). EJWM.
+    ReverseOrderedTrack = 32,
+
+    /** Track which (physically) does not intersect the ID or Calo. i.e. not a
+      partially reconstructed IP track, but a cosmic or beam halo track.
+      @warning This enum is the subject of some controversy and may be removed
+      in the future. It would be safer to examine the track and determine this
+      for yourself (especially as not all Track builders are currently filling
+      this flag). EJWM.
       */
-    MuonNotHittingTileVolume    = 33,
+    MuonNotHittingTileVolume = 33,
 
     /**
      * Entries allowing to distinguish different seed makers
-     */     
-    SiSpacePointsSeedMaker_Cosmic          = 34,
-    SiSpacePointsSeedMaker_HeavyIon        = 35,
-    SiSpacePointsSeedMaker_LowMomentum     = 36,
-    SiSpacePointsSeedMaker_BeamGas         = 37,
+     */
+    SiSpacePointsSeedMaker_Cosmic = 34,
+    SiSpacePointsSeedMaker_HeavyIon = 35,
+    SiSpacePointsSeedMaker_LowMomentum = 36,
+    SiSpacePointsSeedMaker_BeamGas = 37,
     SiSpacePointsSeedMaker_VeryLowMomentum = 38,
 
     /** Muons found by the ID seeded muon recovery */
-    MuidMuonRecoveryTool        = 39,
+    MuidMuonRecoveryTool = 39,
 
-    /** Standalone muon that was obtained by refitting a combined muon using the calorimeter information of the combined and the muon measurements */
-    MuidStandaloneRefit         = 40,
+    /** Standalone muon that was obtained by refitting a combined muon using the
+       calorimeter information of the combined and the muon measurements */
+    MuidStandaloneRefit = 40,
 
     /** A track in a CaloROI */
-    TrackInCaloROI              = 41,    
+    TrackInCaloROI = 41,
 
     /**
      * Entries allowing to distinguish different seed makers
-     */     
-    SiSpacePointsSeedMaker_ForwardTracks       = 42,
+     */
+    SiSpacePointsSeedMaker_ForwardTracks = 42,
 
     /**  L2Star strategies */
-    strategyA                                  = 43,
-    strategyB                                  = 44,
-    strategyC                                  = 45,
-
+    strategyA = 43,
+    strategyB = 44,
+    strategyC = 45,
 
     /**   for tracks from FTK */
-    FTK                                        = 46,
+    FTK = 46,
 
     /**  for tracks seeded by the FastTrackFinder */
-    FastTrackFinderSeed                        = 47,
+    FastTrackFinderSeed = 47,
 
-    /**    for tracks processed by the trigger version of the SiSPSeededFinder */
-    SiSPSeededFinderSimple                     = 48,
+    /**    for tracks processed by the trigger version of the SiSPSeededFinder
+     */
+    SiSPSeededFinderSimple = 48,
 
     /**  Large d0 for displaced vertex searches */
-    SiSpacePointsSeedMaker_LargeD0             = 49,
+    SiSpacePointsSeedMaker_LargeD0 = 49,
 
     /** SLHCConversion Track flag */
     SiSpacePointsSeedMaker_SLHCConversionTracks = 50,
 
     /** Pseudo-tracking flag */
-    Pseudotracking				= 51,
+    Pseudotracking = 51,
 
-
-    /**  Maximum number of enums */   
-    NumberOfTrackRecoInfo                      = 52
+    /**  Maximum number of enums */
+    NumberOfTrackRecoInfo = 52
   };
 
-  TrackInfo (); //!<needed by POOL. DO NOT USE YOURSELF! 
-
-  /** 	           
-   * Constructor     
-   */	           
-  TrackInfo( const TrackFitter fitter, const ParticleHypothesis partHyp);
-
-  TrackInfo( const TrackFitter fitter,
-             const ParticleHypothesis partHyp,
-             const std::bitset<NumberOfTrackProperties>& properties,
-             const std::bitset<NumberOfTrackRecoInfo>& patternRecognition);
-
-  TrackInfo( const TrackInfo& ); //!< copy constructor
-
-  TrackInfo &operator= (const TrackInfo &); //!< assignment operator
-
-  virtual ~TrackInfo (); //!< destructor
+  /**
+   * Non default Constructors
+   */
+  TrackInfo(const TrackFitter fitter, const ParticleHypothesis partHyp);
+  TrackInfo(const TrackFitter fitter,
+            const ParticleHypothesis partHyp,
+            const std::bitset<NumberOfTrackProperties>& properties,
+            const std::bitset<NumberOfTrackRecoInfo>& patternRecognition);
 
-  virtual TrackInfo* clone() const;
+  /**
+   * Rule of 6 : default ctor, copy/move ctor
+   * copy/move assignement
+   */
+  TrackInfo() = default;
+  TrackInfo(const TrackInfo&) = default;
+  TrackInfo(TrackInfo&&) = default;
+  TrackInfo& operator=(const TrackInfo&) = default;
+  TrackInfo& operator=(TrackInfo&&) = default;
+  ~TrackInfo() = default;
 
-  //Various set methods
+  TrackInfo* clone() const;
+  // Various set methods
 
   /**
    * Methods setting the properties of track
    */
-  void setTrackProperties(const TrackProperties& properties) ;
+  void setTrackProperties(const TrackProperties& properties);
 
   /**
    * Method setting the pattern recognition algorithm
    */
-  void setPatternRecognitionInfo(const TrackPatternRecoInfo& patternReco) ;
+  void setPatternRecognitionInfo(const TrackPatternRecoInfo& patternReco);
 
   /**
    * Method for re-setting a track fitter
    */
-  void setTrackFitter(const TrackFitter& fitter) ;
+  void setTrackFitter(const TrackFitter& fitter);
 
   /**
    *  Method re-setting the ParticleHypothesis
-   */  
+   */
   void setParticleHypothesis(const ParticleHypothesis& hypothesis);
 
   /**
-   * Access methods for track fitter 
+   * Access methods for track fitter
    */
   const TrackFitter& trackFitter() const;
 
   /**
-   * Access methods for track properties 
-   */   
+   * Access methods for track properties
+   */
   bool trackProperties(const TrackProperties& property) const;
 
   /**
    * Access method for pattern recognition algorithm
    */
-  bool  patternRecoInfo(const TrackPatternRecoInfo& pattern) const;
+  bool patternRecoInfo(const TrackPatternRecoInfo& pattern) const;
 
   /**
-   * Method merging pattern recognition and track properties 
+   * Method merging pattern recognition and track properties
    * information from different Track infos.
    */
   void addPatternRecoAndProperties(const TrackInfo&);
 
   /**
-   * A method adding just pattern recognition info without 
+   * A method adding just pattern recognition info without
    * adding the actual properties
    */
   void addPatternReco(const TrackInfo&);
 
-  /** 							          
-   * Returns a string with the name of the fitter of this track     
-   * (i.e. corresponding to the enum reurned by fitter() )          
-   */							          
+  /**
+   * Returns a string with the name of the fitter of this track
+   * (i.e. corresponding to the enum reurned by fitter() )
+   */
   std::string dumpInfo() const;
 
   std::string dumpBitsProperties() const;
 
-  std::string dumpBitsPatternRecoInfo() const; 
+  std::string dumpBitsPatternRecoInfo() const;
 
-  /** 							     
-   * Returns the particle hypothesis used for Track fitting     
-   */							     
+  /**
+   * Returns the particle hypothesis used for Track fitting
+   */
   ParticleHypothesis particleHypothesis() const;
 
-  const  std::bitset<NumberOfTrackProperties>&   properties() const;
-  const  std::bitset<NumberOfTrackRecoInfo>&     patternRecognition() const;
+  const std::bitset<NumberOfTrackProperties>& properties() const;
+  const std::bitset<NumberOfTrackRecoInfo>& patternRecognition() const;
 
 private:
   friend class ::TrackCnv_p4;
   friend class ::TrackParticleBaseCnv_p1;
 
-  /** 									     	 
-   * This is an enum, which stores the identity of where the track was created 	 
-   */									     	 
-  TrackFitter         m_fitter;
-
   /**
-   * This is an enum, which stores the particle hypothesis (if any)    
-   * used for the track fitting					     
-   */								      
-  ParticleHypothesis  m_particleHypo;   
-
-  /**						      
-   * A bitset providing information on the properties    
-   * of the track.				      			      
-   */						        
-  std::bitset<NumberOfTrackProperties>     m_properties;
-
-  /**						      
-   * A bitset providing information on the 
-   *  actual pattern recognition algotithm  			      
-   */						        
-  std::bitset<NumberOfTrackRecoInfo>     m_patternRecognition;  
-
-};//end of class definitions
-
-/** 
- * Overload of << operator for MsgStream for debug output 
- */ 
-MsgStream& operator << ( MsgStream& sl, const TrackInfo& track);
-
-/** 
- * Overload of << operator for std::ostream for debug output
- */ 
-std::ostream& operator << ( std::ostream& sl, const TrackInfo& track);
-
-//set methods  
-inline void Trk::TrackInfo::setTrackProperties(const TrackProperties& property) 
-{
-  //   std::cout<<"Set track properties "<<std::endl;
-  m_properties.set(property);
-  if(property == BremFitSuccessful && m_particleHypo == undefined ) { m_particleHypo = electron;}
-}
-
-inline void Trk::TrackInfo::setPatternRecognitionInfo(const TrackPatternRecoInfo& patternReco) 
-{
-  m_patternRecognition.set(patternReco);
-}
-
-inline void Trk::TrackInfo::setTrackFitter(const TrackFitter& fitter) 
-{
-  m_fitter = (fitter < NumberOfTrackFitters)? fitter : Unknown;  
-}
-
-inline void Trk::TrackInfo::setParticleHypothesis(const ParticleHypothesis& hypothesis) 
-{
-  m_particleHypo = hypothesis;
-}
-
-//access methods
-inline const Trk::TrackInfo::TrackFitter& Trk::TrackInfo::trackFitter() const
-{
-  return m_fitter;
-}
-
-inline Trk::ParticleHypothesis  Trk::TrackInfo::particleHypothesis() const
-{
-  return m_particleHypo;
-}
-
-inline bool Trk::TrackInfo::trackProperties(const TrackProperties& property) const
-{
-  return m_properties.test(property);
-}
-
-inline bool Trk::TrackInfo::patternRecoInfo(const TrackPatternRecoInfo& pattern) const
-{
-  return m_patternRecognition.test(pattern);
-}
-
-inline TrackInfo * TrackInfo::clone()const
-{
-  return new TrackInfo(*this);
-}
+   * This is an enum, which stores the identity of where the track was created
+   */
+  TrackFitter m_fitter = Unknown;
 
-inline std::string TrackInfo::dumpBitsProperties() const
-{
-  return m_properties.to_string <char, std::char_traits<char>, std::allocator<char> >();
-}
+  /**
+   * This is an enum, which stores the particle hypothesis (if any)
+   * used for the track fitting
+   */
+  ParticleHypothesis m_particleHypo = undefined;
 
-inline std::string TrackInfo::dumpBitsPatternRecoInfo() const
-{
-  return m_patternRecognition.to_string <char, std::char_traits<char>, std::allocator<char> >();
-} 
+  /**
+   * A bitset providing information on the properties
+   * of the track.
+   */
+  std::bitset<NumberOfTrackProperties> m_properties;
 
-inline const  std::bitset<TrackInfo::NumberOfTrackProperties>&   TrackInfo::properties() const
-{
-  return m_properties;
-}
+  /**
+   * A bitset providing information on the
+   *  actual pattern recognition algotithm
+   */
+  std::bitset<NumberOfTrackRecoInfo> m_patternRecognition;
 
-inline const  std::bitset<TrackInfo::NumberOfTrackRecoInfo>&     TrackInfo::patternRecognition() const
-{
-  return m_patternRecognition;
-}
+}; // end of class definitions
 
-inline void TrackInfo::addPatternRecoAndProperties(const TrackInfo& rhs) 
-{
-//merging information by means of bitwise "or"
-  addPatternReco(rhs);
-  m_properties = m_properties | rhs.m_properties;
-}
+/**
+ * Overload of << operator for MsgStream for debug output
+ */
+MsgStream&
+operator<<(MsgStream& sl, const TrackInfo& track);
 
-inline void TrackInfo::addPatternReco(const TrackInfo& rhs) 
-{
-//merging information by means of bitwise "or"
-  m_patternRecognition = m_patternRecognition | rhs.m_patternRecognition;
-}
+/**
+ * Overload of << operator for std::ostream for debug output
+ */
+std::ostream&
+operator<<(std::ostream& sl, const TrackInfo& track);
 
-}//end of namespace Trk
+} // end of namespace Trk
 
+#include "TrkTrack/TrackInfo.icc"
 #endif
 
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.icc b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.icc
new file mode 100644
index 000000000000..22084b64b88f
--- /dev/null
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.icc
@@ -0,0 +1,109 @@
+/*
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+ */
+
+namespace Trk {
+// set methods
+inline void
+Trk::TrackInfo::setTrackProperties(const TrackProperties& property)
+{
+  //   std::cout<<"Set track properties "<<std::endl;
+  m_properties.set(property);
+  if (property == BremFitSuccessful && m_particleHypo == undefined) {
+    m_particleHypo = electron;
+  }
+}
+
+inline void
+Trk::TrackInfo::setPatternRecognitionInfo(
+  const TrackPatternRecoInfo& patternReco)
+{
+  m_patternRecognition.set(patternReco);
+}
+
+inline void
+Trk::TrackInfo::setTrackFitter(const TrackFitter& fitter)
+{
+  m_fitter = (fitter < NumberOfTrackFitters) ? fitter : Unknown;
+}
+
+inline void
+Trk::TrackInfo::setParticleHypothesis(const ParticleHypothesis& hypothesis)
+{
+  m_particleHypo = hypothesis;
+}
+
+// access methods
+inline const Trk::TrackInfo::TrackFitter&
+Trk::TrackInfo::trackFitter() const
+{
+  return m_fitter;
+}
+
+inline Trk::ParticleHypothesis
+Trk::TrackInfo::particleHypothesis() const
+{
+  return m_particleHypo;
+}
+
+inline bool
+Trk::TrackInfo::trackProperties(const TrackProperties& property) const
+{
+  return m_properties.test(property);
+}
+
+inline bool
+Trk::TrackInfo::patternRecoInfo(const TrackPatternRecoInfo& pattern) const
+{
+  return m_patternRecognition.test(pattern);
+}
+
+inline TrackInfo*
+TrackInfo::clone() const
+{
+  return new TrackInfo(*this);
+}
+
+inline std::string
+TrackInfo::dumpBitsProperties() const
+{
+  return m_properties
+    .to_string<char, std::char_traits<char>, std::allocator<char>>();
+}
+
+inline std::string
+TrackInfo::dumpBitsPatternRecoInfo() const
+{
+  return m_patternRecognition
+    .to_string<char, std::char_traits<char>, std::allocator<char>>();
+}
+
+inline const std::bitset<TrackInfo::NumberOfTrackProperties>&
+TrackInfo::properties() const
+{
+  return m_properties;
+}
+
+inline const std::bitset<TrackInfo::NumberOfTrackRecoInfo>&
+TrackInfo::patternRecognition() const
+{
+  return m_patternRecognition;
+}
+
+inline void
+TrackInfo::addPatternRecoAndProperties(const TrackInfo& rhs)
+{
+  // merging information by means of bitwise "or"
+  addPatternReco(rhs);
+  m_properties = m_properties | rhs.m_properties;
+}
+
+inline void
+TrackInfo::addPatternReco(const TrackInfo& rhs)
+{
+  // merging information by means of bitwise "or"
+  m_patternRecognition = m_patternRecognition | rhs.m_patternRecognition;
+}
+
+} // end of namespace Trk
+
diff --git a/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx b/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
index 71b3a2c57da2..b1264e963390 100644
--- a/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
+++ b/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrkTrack/TrackInfo.h"
@@ -7,208 +7,231 @@
 #include <iostream>
 #include <sstream>
 
-
-
-Trk::TrackInfo::TrackInfo():m_fitter(Unknown), m_particleHypo(undefined)  
-{ 
-  m_properties.reset();
-}    
-
-Trk::TrackInfo::TrackInfo( const TrackFitter fitter, const ParticleHypothesis partHyp)
-    :m_fitter(fitter), m_particleHypo(partHyp)
-{
- if( m_particleHypo == undefined )
- {							       
-  switch( m_fitter ) //switch on fitter of type TrackFitter (ok)
-  {  				       
-   case GaussianSumFilter:	 //GaussianSumFilter of type TrackFitter (ok, =4)       		  
-     m_particleHypo = electron;	        		  
-   break;			        		  
-  /** The following cases all fall through to Muonboy/GlobalChi2Fitter; is this intentional? 
-    * Coverity bug 12476 : the enum types were mixed; I've commented out the original code
-    * but the enums should be checked  and made consistent with code here
-    * should use C++11 scoped enums to protect against this kind of error (sroe)						       
-   		  
-   case STACO: // STACO of type TrackPatternRecoInfo (not ok!), = 7 = DeterministicAnnealingFilter     	       
-   case MuGirlUnrefitted:	// type TrackPatternRecoInfo (not ok!), = 6 = DistributedKalmanFilter  		  
-   case Muonboy:		      // type TrackPatternRecoInfo (not ok!), = 5 = GlobalChi2Fitter   
-   **/
-   case DeterministicAnnealingFilter:
-   case DistributedKalmanFilter:
-   case GlobalChi2Fitter:
-     m_particleHypo = muon;	        		  
-   break;			        		  
-   				      	   		  
-   default:			        	       
-     m_particleHypo = pion;	        		  
-  }//end of switch operator				       	       
- }//end of particle hypothesis check			       
- m_properties.reset();
- m_patternRecognition.reset(); 
-}//end of main constructor definitions
-
-
-Trk::TrackInfo::TrackInfo( const TrackFitter fitter,
-                           const ParticleHypothesis partHyp,
-                           const std::bitset<NumberOfTrackProperties>& properties,
-                           const std::bitset<NumberOfTrackRecoInfo>& patternRecognition)
-  : TrackInfo (fitter, partHyp)
+Trk::TrackInfo::TrackInfo(const TrackFitter fitter, const ParticleHypothesis partHyp)
+  : m_fitter(fitter)
+  , m_particleHypo(partHyp)
+  , m_properties{}
+  , m_patternRecognition{}
 {
-  m_properties = properties;
-  m_patternRecognition = patternRecognition;
-}
-
-Trk::TrackInfo::TrackInfo (const TrackInfo& rhs)
-    :
-    m_fitter(rhs.m_fitter),
-    m_particleHypo(rhs.m_particleHypo), 
-    m_properties(rhs.m_properties), 
-    m_patternRecognition(rhs.m_patternRecognition) 
-{
-    //sroe: removed duplicated code
+  if (m_particleHypo == undefined) {
+    switch (m_fitter) // switch on fitter of type TrackFitter (ok)
+    {
+      case GaussianSumFilter: // GaussianSumFilter of type TrackFitter (ok, =4)
+        m_particleHypo = electron;
+        break;
+      case DeterministicAnnealingFilter:
+      case DistributedKalmanFilter:
+      case GlobalChi2Fitter:
+        m_particleHypo = muon;
+        break;
+      default:
+        m_particleHypo = pion;
+    } // end of switch operator
+  }   // end of particle hypothesis check
 }
 
-Trk::TrackInfo& 
-Trk::TrackInfo::operator= (const TrackInfo& rhs)
+Trk::TrackInfo::TrackInfo(const TrackFitter fitter,
+                          const ParticleHypothesis partHyp,
+                          const std::bitset<NumberOfTrackProperties>& properties,
+                          const std::bitset<NumberOfTrackRecoInfo>& patternRecognition)
+  : TrackInfo(fitter, partHyp)
 {
-    if (this!=&rhs){
-      //set the fitter to be that of the TrackInfo being copied.
-      m_fitter  	         = rhs.m_fitter;	        
-      m_particleHypo	     = rhs.m_particleHypo;        
-      m_properties	       = rhs.m_properties;   
-      m_patternRecognition = rhs.m_patternRecognition;  
-    }
-    return *this;
+  m_properties = properties;
+  m_patternRecognition = patternRecognition;
 }
 
-Trk::TrackInfo::~TrackInfo()
-= default;
-
-std::string Trk::TrackInfo::dumpInfo() const
+std::string
+Trk::TrackInfo::dumpInfo() const
 {
-    std::stringstream authorInfo;
-    authorInfo<<"The Fitter of this track is: ";
-    
-    switch ( m_fitter )
-    {
-     case Trk::TrackInfo::Unknown: authorInfo<<"Unknown";    
-     break; 		     
-        
-     case Trk::TrackInfo::iPatTrackFitter: authorInfo<<"iPatTrackFitter";   
-     break;		        
-     
-     case Trk::TrackInfo::xKalman: authorInfo<<"xKalman";   
-     break;
-      		         
-     case Trk::TrackInfo::KalmanFitter: authorInfo<<"KalmanFitter";
-     break;  		   		    
-     				   		   
-     case Trk::TrackInfo::GaussianSumFilter: authorInfo<<"GaussianSumFilter"; 
-     break;
-      		         
-     case Trk::TrackInfo::GlobalChi2Fitter: authorInfo<<"GlobalChi2Fitter";   	   		    
-     break;
-
-     case Trk::TrackInfo::DistributedKalmanFilter: authorInfo<<"DistributedKalmanFilter";	   		    
-     break;
-         
-     case Trk::TrackInfo::DeterministicAnnealingFilter: authorInfo<<"DeterministicAnnealingFilter"; 											    
-     break;
-
-     case Trk::TrackInfo::MuonboyFitter: authorInfo<<"MuonboyFitter";                                                                
-     break;     
-
-    default: authorInfo<<"Fitter not recognized " << m_fitter;
-    }
-   
-//adding properties, but checking first 
-// that they are there at all   
-    if(m_properties.any())
-    { 
-     authorInfo<< (m_properties.test(Trk::TrackInfo::BremFit) ? " + BremFit": "");
-     authorInfo<< (m_properties.test(Trk::TrackInfo::BremFitSuccessful) ? " + BremFitSuccess": "");
-     authorInfo<< (m_properties.test(Trk::TrackInfo::StraightTrack) ? " + StraightTrack": "");
-     authorInfo<< (m_properties.test(Trk::TrackInfo::SlimmedTrack) ? " + SlimmedTrack": "");
-     authorInfo<< (m_properties.test(Trk::TrackInfo::HardScatterOrKink) ? " + HardScatterOrKink": "");
-     authorInfo<< (m_properties.test(Trk::TrackInfo::LowPtTrack) ? " + LowPtTrack": "");
-    }//end of adding track properties
-    
-//adding a pattern recognition structure
-    if(m_patternRecognition.any())
-    {
-//     std::cout<<"calling the pattern reco dump"<<std::endl;
-     authorInfo<<"; The Pattern Recognition Agorithms used: ";
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSPSeededFinder)	     	      ? "SiSPSeedFinder; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiCTBTracking)	     	      ? "SiCTBTracking; ": "");
-//      std::cout<<"3d line pattern reco dump"<<std::endl;
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::InDetAmbiguitySolver)   	      ? "InDetAmbiguitySolver; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::InDetExtensionProcessor)	      ? "InDetExtensionProcessor; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TRTSeededTrackFinder)   	      ? "TRTSeededTrackFinder; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::Muonboy)		     	      ? "Muonboy; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuGirlUnrefitted)       	      ? "MuGirlUnrefitted; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::STACO)		     	      ? "STACO; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::StacoLowPt)	     	      ? "StacoLowPt; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuTag)		     	      ? "MuTag; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MooreToTrackTool)       	      ? "MooreToTrackTool; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TrigIDSCAN)	     	      ? "TrigIDSCAN; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TrigSiTrack)	     	      ? "TrigSiTrack; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TrigTRTxK) 	     	      ? "TrigTRTxK; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TrigTRTLUT)	     	      ? "TrigTRTLUT; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::Fatras)		     	      ? "Fatras; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::iPatLegacyCnv)	     	      ? "iPatLegacyCnv; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::xKalmanLegacyCnv)	     	      ? "xKalmanLegacyCnv; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SimpleAmbiguityProcessorTool)    ? "SimpleAmbiguityProcessorTool; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::InDetAmbiTrackSelectionTool)     ? "InDetAmbiTrackSelectionTool; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TRTStandalone)                   ? "TRTStandalone; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidStandAlone)		      ? "MuidStandAlone; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TRTSeededSingleSpTrackFinder)    ? "TRTSeededSingleSpTrackFinder; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MooreLegacyCnv )		      ? "MooreLegacyCnv; ": "");     
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidComb)   		      ? "MuidComb; ": "");    
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::Moore)		              ? "Moore; ": "");		   
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidCombined)		      ? "MuidCombined; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidVertexAssociator)	      ? "MuidVertexAssociator; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuGirl)			      ? "MuGirl; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::iPatRec)			      ? "iPatRec; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuGirlLowBeta)		      ? "MuGirlLowBeta; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::FatrasSimulation)                ? "FatrasSimulation; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuonNotHittingTileVolume)        ? "MuonNotHittingTileVolume; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::ReverseOrderedTrack)             ? "ReverseOrderedTrack; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_Cosmic)  		       ? "SiSpacePointsSeedMaker_Cosmic; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_HeavyIon)  		       ? "SiSpacePointsSeedMaker_HeavyIon; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_LowMomentum)  	       ? "SiSpacePointsSeedMaker_LowMomentum; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_BeamGas)	               ? "SiSpacePointsSeedMaker_BeamGas; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_VeryLowMomentum)  	       ? "SiSpacePointsSeedMaker_VeryLowMomentum; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_SLHCConversionTracks)                 ? "SiSpacePointsSeedMaker_SLHCConversionTracks; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_LargeD0)  	       ? "SiSpacePointsSeedMaker_LargeD0; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::Pseudotracking		)  	       ? "Pseudotracking; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidMuonRecoveryTool)  	       ? "MuidMuonRecoveryTool; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::MuidStandaloneRefit)  	       ? "MuidStandaloneRefit; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::TrackInCaloROI)  	               ? "TrackInCaloROI; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks)  	        ? "SiSpacePointsSeedMaker_ForwardTracks; ": ""); 
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::strategyA)  	       ? "strategyA; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::strategyB)  	       ? "strategyB; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::strategyC)  	       ? "strategyC; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::FTK)  	       ? "FTK; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::FastTrackFinderSeed)  	       ? "FastTrackFinderSeed; ": "");
-     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::SiSPSeededFinderSimple)  	               ? "SiSPSeededFinderSimple; ": "");
-
-     
-     
-//     authorInfo<< (m_patternRecognition.test(Trk::TrackInfo::NumberOfTrackRecoInfo)   ? "NumberOfTrackRecoInfo; ": "");
- //    std::cout<<"end of the pattern reco dump"<<std::endl;
-    }//end of adding pattern recognition properties
-    return authorInfo.str();
-}//end of dump method
-
-std::ostream& Trk::operator << ( std::ostream& sl, const Trk::TrackInfo& info)
+  std::stringstream authorInfo;
+  authorInfo << "The Fitter of this track is: ";
+
+  switch (m_fitter) {
+    case Trk::TrackInfo::Unknown:
+      authorInfo << "Unknown";
+      break;
+
+    case Trk::TrackInfo::iPatTrackFitter:
+      authorInfo << "iPatTrackFitter";
+      break;
+
+    case Trk::TrackInfo::xKalman:
+      authorInfo << "xKalman";
+      break;
+
+    case Trk::TrackInfo::KalmanFitter:
+      authorInfo << "KalmanFitter";
+      break;
+
+    case Trk::TrackInfo::GaussianSumFilter:
+      authorInfo << "GaussianSumFilter";
+      break;
+
+    case Trk::TrackInfo::GlobalChi2Fitter:
+      authorInfo << "GlobalChi2Fitter";
+      break;
+
+    case Trk::TrackInfo::DistributedKalmanFilter:
+      authorInfo << "DistributedKalmanFilter";
+      break;
+
+    case Trk::TrackInfo::DeterministicAnnealingFilter:
+      authorInfo << "DeterministicAnnealingFilter";
+      break;
+
+    case Trk::TrackInfo::MuonboyFitter:
+      authorInfo << "MuonboyFitter";
+      break;
+
+    default:
+      authorInfo << "Fitter not recognized " << m_fitter;
+  }
+
+  // adding properties, but checking first
+  // that they are there at all
+  if (m_properties.any()) {
+    authorInfo << (m_properties.test(Trk::TrackInfo::BremFit) ? " + BremFit" : "");
+    authorInfo << (m_properties.test(Trk::TrackInfo::BremFitSuccessful) ? " + BremFitSuccess" : "");
+    authorInfo << (m_properties.test(Trk::TrackInfo::StraightTrack) ? " + StraightTrack" : "");
+    authorInfo << (m_properties.test(Trk::TrackInfo::SlimmedTrack) ? " + SlimmedTrack" : "");
+    authorInfo << (m_properties.test(Trk::TrackInfo::HardScatterOrKink) ? " + HardScatterOrKink"
+                                                                        : "");
+    authorInfo << (m_properties.test(Trk::TrackInfo::LowPtTrack) ? " + LowPtTrack" : "");
+  } // end of adding track properties
+
+  // adding a pattern recognition structure
+  if (m_patternRecognition.any()) {
+    //     std::cout<<"calling the pattern reco dump"<<std::endl;
+    authorInfo << "; The Pattern Recognition Agorithms used: ";
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSPSeededFinder) ? "SiSPSeedFinder; "
+                                                                               : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiCTBTracking) ? "SiCTBTracking; "
+                                                                            : "");
+    //      std::cout<<"3d line pattern reco dump"<<std::endl;
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::InDetAmbiguitySolver)
+                     ? "InDetAmbiguitySolver; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::InDetExtensionProcessor)
+                     ? "InDetExtensionProcessor; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TRTSeededTrackFinder)
+                     ? "TRTSeededTrackFinder; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::Muonboy) ? "Muonboy; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuGirlUnrefitted)
+                     ? "MuGirlUnrefitted; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::STACO) ? "STACO; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::StacoLowPt) ? "StacoLowPt; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuTag) ? "MuTag; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MooreToTrackTool)
+                     ? "MooreToTrackTool; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TrigIDSCAN) ? "TrigIDSCAN; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TrigSiTrack) ? "TrigSiTrack; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TrigTRTxK) ? "TrigTRTxK; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TrigTRTLUT) ? "TrigTRTLUT; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::Fatras) ? "Fatras; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::iPatLegacyCnv) ? "iPatLegacyCnv; "
+                                                                            : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::xKalmanLegacyCnv)
+                     ? "xKalmanLegacyCnv; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SimpleAmbiguityProcessorTool)
+                     ? "SimpleAmbiguityProcessorTool; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::InDetAmbiTrackSelectionTool)
+                     ? "InDetAmbiTrackSelectionTool; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TRTStandalone) ? "TRTStandalone; "
+                                                                            : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidStandAlone) ? "MuidStandAlone; "
+                                                                             : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TRTSeededSingleSpTrackFinder)
+                     ? "TRTSeededSingleSpTrackFinder; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MooreLegacyCnv) ? "MooreLegacyCnv; "
+                                                                             : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidComb) ? "MuidComb; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::Moore) ? "Moore; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidCombined) ? "MuidCombined; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidVertexAssociator)
+                     ? "MuidVertexAssociator; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuGirl) ? "MuGirl; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::iPatRec) ? "iPatRec; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuGirlLowBeta) ? "MuGirlLowBeta; "
+                                                                            : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::FatrasSimulation)
+                     ? "FatrasSimulation; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuonNotHittingTileVolume)
+                     ? "MuonNotHittingTileVolume; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::ReverseOrderedTrack)
+                     ? "ReverseOrderedTrack; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_Cosmic)
+                     ? "SiSpacePointsSeedMaker_Cosmic; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_HeavyIon)
+                     ? "SiSpacePointsSeedMaker_HeavyIon; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_LowMomentum)
+                     ? "SiSpacePointsSeedMaker_LowMomentum; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_BeamGas)
+                     ? "SiSpacePointsSeedMaker_BeamGas; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_VeryLowMomentum)
+                     ? "SiSpacePointsSeedMaker_VeryLowMomentum; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(
+                     Trk::TrackInfo::SiSpacePointsSeedMaker_SLHCConversionTracks)
+                     ? "SiSpacePointsSeedMaker_SLHCConversionTracks; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_LargeD0)
+                     ? "SiSpacePointsSeedMaker_LargeD0; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::Pseudotracking) ? "Pseudotracking; "
+                                                                             : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidMuonRecoveryTool)
+                     ? "MuidMuonRecoveryTool; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::MuidStandaloneRefit)
+                     ? "MuidStandaloneRefit; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::TrackInCaloROI) ? "TrackInCaloROI; "
+                                                                             : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks)
+                     ? "SiSpacePointsSeedMaker_ForwardTracks; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::strategyA) ? "strategyA; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::strategyB) ? "strategyB; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::strategyC) ? "strategyC; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::FTK) ? "FTK; " : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::FastTrackFinderSeed)
+                     ? "FastTrackFinderSeed; "
+                     : "");
+    authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSPSeededFinderSimple)
+                     ? "SiSPSeededFinderSimple; "
+                     : "");
+
+  } // end of adding pattern recognition properties
+  return authorInfo.str();
+} // end of dump method
+
+std::ostream&
+Trk::operator<<(std::ostream& sl, const Trk::TrackInfo& info)
 {
-    sl <<info.dumpInfo()<<std::endl;
-    return sl;
+  sl << info.dumpInfo() << std::endl;
+  return sl;
 }
 
-MsgStream& Trk::operator << ( MsgStream& sl, const Trk::TrackInfo& info)
+MsgStream&
+Trk::operator<<(MsgStream& sl, const Trk::TrackInfo& info)
 {
-    sl <<info.dumpInfo()<<endmsg;
-    return sl;
+  sl << info.dumpInfo() << endmsg;
+  return sl;
 }
 
-- 
GitLab


From 19577ca0ab91e751ce279aa900f3d4e87345b716 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 1 Jul 2020 23:02:08 +0100
Subject: [PATCH 003/217] TrackStateOnSurface : Add enum to separate
 Single,Multi,Align cases

---
 .../TrkAlignEvent/TrkAlignEvent/AlignTSOS.h   |  3 +
 .../MultiComponentStateOnSurface.h            | 18 ++---
 .../MultiComponentStateOnSurface.icc          | 24 ++++++
 .../TrkTrack/TrkTrack/TrackStateOnSurface.h   | 79 +++++-------------
 .../TrkTrack/TrkTrack/TrackStateOnSurface.icc | 81 +++++++++++++++++++
 .../src/GaussianSumFitter.cxx                 | 25 +++---
 6 files changed, 147 insertions(+), 83 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.icc
 create mode 100644 Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.icc

diff --git a/Tracking/TrkAlignment/TrkAlignEvent/TrkAlignEvent/AlignTSOS.h b/Tracking/TrkAlignment/TrkAlignEvent/TrkAlignEvent/AlignTSOS.h
index 57353b7eab55..7f902f783cda 100644
--- a/Tracking/TrkAlignment/TrkAlignEvent/TrkAlignEvent/AlignTSOS.h
+++ b/Tracking/TrkAlignment/TrkAlignEvent/TrkAlignEvent/AlignTSOS.h
@@ -147,6 +147,9 @@ namespace Trk {
     /** setter for the derivatives w.r.t. the vertex */
     void setDerivativesVtx(std::vector<Amg::VectorX> * derivs) { m_derivativesVtx = derivs; }
 
+    virtual TrackStateOnSurface::Variety variety() const override final {
+      return TrackStateOnSurface::Align;
+    }
    private:
     // private methods
     AlignTSOS();  // don't use this one
diff --git a/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h b/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h
index c386d1919d18..09b2c1624d5a 100755
--- a/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h
+++ b/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /*******************************************************************************
@@ -101,6 +101,9 @@ public:
 
   /** Clone method for deep copy of MultiComponentStateOnSurface - overidden from base class */
   virtual TrackStateOnSurface* clone() const override final;
+  
+  /** This is Multi, since we MultiComponent */
+  virtual TrackStateOnSurface::Variety variety() const override final;
 
   /** Method to return a pointer to the multi-component state */
   const MultiComponentState* components() const;
@@ -123,16 +126,5 @@ operator<<(std::ostream&, const MultiComponentStateOnSurface&);
 
 } // end of Trk namespace
 
-inline const Trk::MultiComponentState*
-Trk::MultiComponentStateOnSurface::components() const
-{
-  return m_multiComponentState;
-}
-
-inline double
-Trk::MultiComponentStateOnSurface::mixtureModeQoverP() const
-{
-  return m_mixtureModeQoverP;
-}
-
+#include "TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.icc"
 #endif
diff --git a/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.icc b/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.icc
new file mode 100644
index 000000000000..9d01daac5147
--- /dev/null
+++ b/Tracking/TrkEvent/TrkMultiComponentStateOnSurface/TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.icc
@@ -0,0 +1,24 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+inline const Trk::MultiComponentState*
+Trk::MultiComponentStateOnSurface::components() const
+{
+  return m_multiComponentState;
+}
+
+inline double
+Trk::MultiComponentStateOnSurface::mixtureModeQoverP() const
+{
+  return m_mixtureModeQoverP;
+}
+
+inline Trk::TrackStateOnSurface::Variety
+Trk::MultiComponentStateOnSurface::variety() const 
+{
+  return Trk::TrackStateOnSurface::MultiComponent;
+}
+
+
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h
index 3fa36525aeda..6f18d6a5a490 100755
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h
@@ -20,7 +20,6 @@ email                : edward.moyse@cern.ch
 #include "CxxUtils/checker_macros.h"
 
 class MsgStream;
-
 class TrackCollectionCnv;
 class TrackStateOnSurfaceCnv_p3;
 
@@ -154,7 +153,13 @@ namespace Trk
                  */
 
             };
-    
+
+            enum Variety
+            {
+              SingleComponent = 0,
+              MultiComponent = 1,
+              Align = 2
+            };
             /**
              * Default ctor for POOL. Do not use!
              */
@@ -265,6 +270,11 @@ namespace Trk
              */
             bool type( const TrackStateOnSurfaceType& type ) const;
 
+            /** Use this method to find if this is a Signle,Multi or Align
+             * TrackStateOnsurface
+             */
+            virtual Trk::TrackStateOnSurface::Variety variety() const;
+
             /**
              * Use this method to set persistification hints.
              * @throw logic_error if the type is not a persistification flag.
@@ -295,26 +305,24 @@ namespace Trk
             const std::bitset<NumberOfTrackStateOnSurfaceTypes>& types() const;
             
             const Trk::Surface& surface() const;
-
-            bool isSane() const; //!< Used to perform sanity checks on this object (i.e. all consistuents are on the same surface). Returns 'true' if it seems okay.
-            
+            //!< Used to perform sanity checks on this object (i.e. all consistuents are on the same surface). Returns 'true' if it seems okay.
+            bool isSane() const;             
         private:
 
-	    /** DO NOT USE THIS CONSTRUCTOR */
+            /** DO NOT USE THIS CONSTRUCTOR */
             TrackStateOnSurface (const MeasurementBase *meas, 
                                  const TrackParameters *trackParameter, 
                                  const FitQualityOnSurface *fitQoS, const MaterialEffectsBase *materialEffects, 
                                  const TrackStateOnSurfaceType type);
-
-
             /** set sensible default flags*/
             void setFlags();
+           
             const FitQualityOnSurface      *m_fitQualityOnSurface;
             const TrackParameters          *m_trackParameters;
             const MeasurementBase          *m_measurementOnTrack;
             const MaterialEffectsBase      *m_materialEffectsOnTrack;
             const AlignmentEffectsOnTrack  *m_alignmentEffectsOnTrack;
-            std::bitset<NumberOfTrackStateOnSurfaceTypes>                    m_typeFlags;
+            std::bitset<NumberOfTrackStateOnSurfaceTypes> m_typeFlags;
     };
 
     /**Overload of << operator for MsgStream for debug output*/ 
@@ -324,57 +332,6 @@ namespace Trk
     std::ostream& operator << ( std::ostream& sl, const TrackStateOnSurface& tsos);
 }
 
-inline Trk::TrackStateOnSurface* Trk::TrackStateOnSurface::clone() const
-{
-    return new TrackStateOnSurface(*this) ;
-}
-
-inline const Trk::FitQualityOnSurface* Trk::TrackStateOnSurface::fitQualityOnSurface() const
-{
-    return m_fitQualityOnSurface;
-}
-
-
-inline const Trk::TrackParameters* Trk::TrackStateOnSurface::trackParameters() const
-{ 
-    return m_trackParameters;
-}
-
-inline const Trk::MeasurementBase* Trk::TrackStateOnSurface::measurementOnTrack() const
-{
-    return m_measurementOnTrack;
-}
-
-inline const Trk::MaterialEffectsBase *Trk::TrackStateOnSurface::materialEffectsOnTrack() const
-{
-    return m_materialEffectsOnTrack;
-}
-
-inline const Trk::AlignmentEffectsOnTrack *Trk::TrackStateOnSurface::alignmentEffectsOnTrack() const
-{
-    return m_alignmentEffectsOnTrack;
-}
-
-
-inline bool Trk::TrackStateOnSurface::type( const TrackStateOnSurfaceType& type ) const
-{
-    if (type==NumberOfTrackStateOnSurfaceTypes || type==Unknown) { return false;}
-    return m_typeFlags.test(type);
-}
-
-inline void Trk::TrackStateOnSurface::setFlags()
-{
-    if (m_measurementOnTrack) { m_typeFlags.set(Measurement,true); }
-    if (m_materialEffectsOnTrack) { m_typeFlags.set(InertMaterial,true); }
-    if (m_alignmentEffectsOnTrack) { m_typeFlags.set(Alignment,true); }
-    if (m_trackParameters) { m_typeFlags.set(Parameter,true); }
-    if (m_fitQualityOnSurface) { m_typeFlags.set(FitQuality,true); }
-}
-
-inline const std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>& 
-Trk::TrackStateOnSurface::types() const
-{
-    return m_typeFlags;
-}
+#include "TrkTrack/TrackStateOnSurface.icc"
 
 #endif
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.icc b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.icc
new file mode 100644
index 000000000000..2fcefac3b033
--- /dev/null
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.icc
@@ -0,0 +1,81 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+inline Trk::TrackStateOnSurface*
+Trk::TrackStateOnSurface::clone() const
+{
+  return new TrackStateOnSurface(*this);
+}
+
+inline const Trk::FitQualityOnSurface*
+Trk::TrackStateOnSurface::fitQualityOnSurface() const
+{
+  return m_fitQualityOnSurface;
+}
+
+inline const Trk::TrackParameters*
+Trk::TrackStateOnSurface::trackParameters() const
+{
+  return m_trackParameters;
+}
+
+inline const Trk::MeasurementBase*
+Trk::TrackStateOnSurface::measurementOnTrack() const
+{
+  return m_measurementOnTrack;
+}
+
+inline const Trk::MaterialEffectsBase*
+Trk::TrackStateOnSurface::materialEffectsOnTrack() const
+{
+  return m_materialEffectsOnTrack;
+}
+
+inline const Trk::AlignmentEffectsOnTrack*
+Trk::TrackStateOnSurface::alignmentEffectsOnTrack() const
+{
+  return m_alignmentEffectsOnTrack;
+}
+
+inline bool
+Trk::TrackStateOnSurface::type(const TrackStateOnSurfaceType& type) const
+{
+  if (type == NumberOfTrackStateOnSurfaceTypes || type == Unknown) {
+    return false;
+  }
+  return m_typeFlags.test(type);
+}
+
+inline Trk::TrackStateOnSurface::Variety
+Trk::TrackStateOnSurface::variety() const
+{
+  return Trk::TrackStateOnSurface::SingleComponent;
+}
+
+
+inline void
+Trk::TrackStateOnSurface::setFlags()
+{
+  if (m_measurementOnTrack) {
+    m_typeFlags.set(Measurement, true);
+  }
+  if (m_materialEffectsOnTrack) {
+    m_typeFlags.set(InertMaterial, true);
+  }
+  if (m_alignmentEffectsOnTrack) {
+    m_typeFlags.set(Alignment, true);
+  }
+  if (m_trackParameters) {
+    m_typeFlags.set(Parameter, true);
+  }
+  if (m_fitQualityOnSurface) {
+    m_typeFlags.set(FitQuality, true);
+  }
+}
+
+inline const std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>&
+Trk::TrackStateOnSurface::types() const
+{
+  return m_typeFlags;
+}
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
index 84097f46c88a..618c26e733a1 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
@@ -707,18 +707,25 @@ Trk::GaussianSumFitter::makePerigee(
   const Trk::TrackStateOnSurface* stateOnSurfaceNearestOrigin =
     smoothedTrajectory->back();
   const Trk::MultiComponentStateOnSurface*
+    multiComponentStateOnSurfaceNearestOrigin = nullptr;
+
+  if (stateOnSurfaceNearestOrigin->variety() ==
+        Trk::TrackStateOnSurface::MultiComponent) {
+
     multiComponentStateOnSurfaceNearestOrigin =
-      dynamic_cast<const Trk::MultiComponentStateOnSurface*>(
+      static_cast<const Trk::MultiComponentStateOnSurface*>(
         stateOnSurfaceNearestOrigin);
+  }
 
-  const Trk::MultiComponentState* multiComponentState = nullptr;
-  if (!multiComponentStateOnSurfaceNearestOrigin) {
-    // we need to make a dummy multicomponent surface
-    Trk::ComponentParameters dummyComponent(
-      stateOnSurfaceNearestOrigin->trackParameters()->clone(), 1.);
-    auto tmp_multiComponentState = std::make_unique<Trk::MultiComponentState>();
-    tmp_multiComponentState->push_back(std::move(dummyComponent));
-    multiComponentState = tmp_multiComponentState.release();
+    const Trk::MultiComponentState* multiComponentState = nullptr;
+    if (!multiComponentStateOnSurfaceNearestOrigin) {
+      // we need to make a dummy multicomponent surface
+      Trk::ComponentParameters dummyComponent(
+        stateOnSurfaceNearestOrigin->trackParameters()->clone(), 1.);
+      auto tmp_multiComponentState =
+        std::make_unique<Trk::MultiComponentState>();
+      tmp_multiComponentState->push_back(std::move(dummyComponent));
+      multiComponentState = tmp_multiComponentState.release();
   } else {
     multiComponentState =
       multiComponentStateOnSurfaceNearestOrigin->components();
-- 
GitLab


From b4facc49a228a07a440a32b12e21bb765f3c419b Mon Sep 17 00:00:00 2001
From: Xiaozhong Huang <xiaozhong.huang@cern.ch>
Date: Thu, 2 Jul 2020 10:14:38 +0800
Subject: [PATCH 004/217] tauRec: skip mc_event_number in comparison for MT ART

---
 Reconstruction/tauRec/test/test_tau_standalone_multithread.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh b/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh
index bdbdb141cffb..6e2de893c517 100755
--- a/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh
+++ b/Reconstruction/tauRec/test/test_tau_standalone_multithread.sh
@@ -18,7 +18,7 @@ athena.py --threads 4 --evtMax ${NEVENTS}  tauRec/tau_standalone_ESDtoAOD.py >>
 echo "art-result: $? Reconstrution"
 
 # compare the AOD file
-art.py compare ref --entries ${NEVENTS} --mode semi-detailed --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1
+art.py compare ref --entries ${NEVENTS} --mode semi-detailed --excluded-vars=mc_event_number --order-trees --diff-root AOD.pool.root ${REF_DIR}/AOD.pool.root >> AOD_diff_root.log 2>&1
 echo "art-result: $? diff-root"
 
 # run the physics validation
-- 
GitLab


From a8b1c272a580fd5d23dc8fe810fb1fb3dda7f11e Mon Sep 17 00:00:00 2001
From: Xiaozhong Huang <xiaozhong.huang@cern.ch>
Date: Thu, 2 Jul 2020 17:55:41 +0800
Subject: [PATCH 005/217] PanTau: add PanTau in AnalysisBase

---
 Projects/AnalysisBase/package_filters.txt     |  1 +
 .../PanTau/PanTauAlgs/CMakeLists.txt          | 61 +++----------------
 .../PanTauAlgs/Root/PanTauProcessor.cxx       | 10 +--
 .../PanTauAlgs/Root/Tool_DetailsArranger.cxx  |  6 +-
 .../Root/Tool_TauConstituentGetter.cxx        |  2 +-
 5 files changed, 18 insertions(+), 62 deletions(-)

diff --git a/Projects/AnalysisBase/package_filters.txt b/Projects/AnalysisBase/package_filters.txt
index 24425facbbee..f9ad356958d7 100644
--- a/Projects/AnalysisBase/package_filters.txt
+++ b/Projects/AnalysisBase/package_filters.txt
@@ -116,6 +116,7 @@
 + Reconstruction/egamma/egammaMVACalib
 + Reconstruction/egamma/egammaRecEvent
 + Reconstruction/tauRecTools
++ Reconstruction/PanTau/PanTauAlgs
 + Tools/ART
 + Tools/DirectIOART
 + Tools/PathResolver
diff --git a/Reconstruction/PanTau/PanTauAlgs/CMakeLists.txt b/Reconstruction/PanTau/PanTauAlgs/CMakeLists.txt
index 6b3274d8b73b..45991fa453bc 100644
--- a/Reconstruction/PanTau/PanTauAlgs/CMakeLists.txt
+++ b/Reconstruction/PanTau/PanTauAlgs/CMakeLists.txt
@@ -5,54 +5,12 @@
 # Declare the package name:
 atlas_subdir( PanTauAlgs )
 
-# Declare the package's dependencies:
-set( extra_deps_public )
-set( extra_deps_private )
-
-if( XAOD_ANALYSIS )
-  set( extra_deps_public
-    Control/AthToolSupport/AsgTools/AsgTools
-    )
-else()
-  set( extra_deps_public
-    GaudiKernel
-    Control/AthenaBaseComps
-    Event/NavFourMom
-    Event/xAOD/xAODPFlow
-    )
-  set( extra_deps_private
-    Calorimeter/CaloEvent
-    Control/AthenaKernel
-    Control/StoreGate
-    DetectorDescription/GeoPrimitives
-    Event/FourMom
-    Event/FourMomUtils
-    Reconstruction/eflowEvent
-    Reconstruction/MVAUtils
-    Reconstruction/tauEvent
-    Tracking/TrkEvent/VxVertex
-    Tracking/TrkVertexFitter/TrkVertexFitterInterfaces
-    )
-endif()
-
-atlas_depends_on_subdirs( PUBLIC
-  ${extra_deps_public}
-  Event/xAOD/xAODTau
-  Event/xAOD/xAODParticleEvent
-  PRIVATE
-  ${extra_deps_private}
-  Event/xAOD/xAODTracking
-  Reconstruction/Particle
-  Reconstruction/tauRecTools
-  Tools/PathResolver
-  )
-
 # External dependencies:
 if( NOT XAOD_ANALYSIS )
   find_package( CLHEP )
 endif()
 find_package( Eigen )
-find_package( ROOT COMPONENTS MathCore MathMore Matrix Core Tree Hist RIO pthread Minuit Minuit2 Physics HistPainter Rint )
+find_package( ROOT COMPONENTS MathMore Matrix Core Tree Hist RIO pthread Minuit Minuit2 Physics HistPainter Rint )
 
 atlas_add_root_dictionary( PanTauAlgs PanTauAlgsCintDict
   ROOT_HEADERS
@@ -70,7 +28,14 @@ atlas_add_root_dictionary( PanTauAlgs PanTauAlgsCintDict
   EXTERNAL_PACKAGES ROOT
   )
 
-# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake
+if ( XAOD_STANDALONE )
+  atlas_add_library( PanTauAlgs
+    PanTauAlgs/*.h Root/*.cxx ${PanTauAlgsCintDict}
+    PUBLIC_HEADERS PanTauAlgs
+    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
+    LINK_LIBRARIES ${ROOT_LIBRARIES} xAODTau xAODTracking AsgTools tauRecToolsLib xAODParticleEvent MVAUtils PathResolver
+    )
+endif()
 
 # Component(s) in the package:
 if( NOT XAOD_STANDALONE )
@@ -80,16 +45,8 @@ if( NOT XAOD_STANDALONE )
     src/components/*.cxx ${PanTauAlgsCintDict}
     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps NavFourMom xAODPFlow xAODTau xAODParticleEvent GaudiKernel CaloEvent AthenaKernel StoreGateLib SGtests GeoPrimitives FourMom FourMomUtils xAODTracking Particle eflowEvent MVAUtils tauEvent tauRecToolsLib PathResolver VxVertex TrkVertexFitterInterfaces )
-else()
-  atlas_add_library( PanTauAlgs
-    PanTauAlgs/*.h Root/*.cxx ${PanTauAlgsCintDict}
-    PUBLIC_HEADERS PanTauAlgs
-    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-    LINK_LIBRARIES ${ROOT_LIBRARIES} xAODTau xAODTracking AsgTools tauRecToolsLib xAODParticleEvent MVAUtils PathResolver
-    )
 endif()
 
-
 # Install files from the package:
 atlas_install_headers( PanTauAlgs )
 atlas_install_runtime( data/weights/* )
diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/PanTauProcessor.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/PanTauProcessor.cxx
index 48aac77eed2f..053aa4e06470 100644
--- a/Reconstruction/PanTau/PanTauAlgs/Root/PanTauProcessor.cxx
+++ b/Reconstruction/PanTau/PanTauAlgs/Root/PanTauProcessor.cxx
@@ -35,11 +35,11 @@ PanTau::PanTauProcessor::PanTauProcessor(const std::string& name)
         
     //Initialise members for tools
     m_Tool_InformationStore("PanTau::Tool_InformationStore/Tool_InformationStore"),
-    m_Tool_TauConstituentGetter(this,"PanTau::Tool_TauConstituentGetter/Tool_TauConstituentGetter"),
-    m_Tool_TauConstituentSelector(this,"PanTau::Tool_TauConstituentSelector/Tool_TauConstituentSelector"),
-    m_Tool_FeatureExtractor(this,"PanTau::Tool_FeatureExtractor/Tool_FeatureExtractor"),
-    m_Tool_DecayModeDeterminator(this,"PanTau::Tool_DecayModeDeterminator/Tool_DecayModeDeterminator"),
-    m_Tool_DetailsArranger(this,"PanTau::Tool_DetailsArranger/Tool_DetailsArranger")
+    m_Tool_TauConstituentGetter("PanTau::Tool_TauConstituentGetter/Tool_TauConstituentGetter", this),
+    m_Tool_TauConstituentSelector("PanTau::Tool_TauConstituentSelector/Tool_TauConstituentSelector", this),
+    m_Tool_FeatureExtractor("PanTau::Tool_FeatureExtractor/Tool_FeatureExtractor", this),
+    m_Tool_DecayModeDeterminator("PanTau::Tool_DecayModeDeterminator/Tool_DecayModeDeterminator", this),
+    m_Tool_DetailsArranger("PanTau::Tool_DetailsArranger/Tool_DetailsArranger", this)
 {
     
     //Connect python variables to member functions...
diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_DetailsArranger.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_DetailsArranger.cxx
index 0558061f2947..1e774a77737c 100644
--- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_DetailsArranger.cxx
+++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_DetailsArranger.cxx
@@ -471,10 +471,8 @@ StatusCode PanTau::Tool_DetailsArranger::arrangePFOLinks(PanTau::PanTauSeed2* in
       static SG::AuxElement::Accessor<std::vector< ElementLink< xAOD::PFOContainer > > > accPi0PFOLinks("pi0PFOLinks");
       accPi0PFOLinks(*p) = pfo_link_vector;
 
-      //ElementLink< xAOD::IParticleContainer > linkToPi0;
-      //linkToPi0.toContainedElement(pi0Container, dynamic_cast<xAOD::IParticle*> (p));
-      ElementLink< xAOD::ParticleContainer > linkToPi0;
-      linkToPi0.toContainedElement(pi0Container, p);
+      ElementLink< xAOD::IParticleContainer > linkToPi0;
+      linkToPi0.toContainedElement(pi0Container, dynamic_cast<xAOD::IParticle*> (p));
 
       tauJet->addPi0Link(linkToPi0);
     }
diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentGetter.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentGetter.cxx
index f603d21aaf1f..d7e341733441 100644
--- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentGetter.cxx
+++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentGetter.cxx
@@ -23,7 +23,7 @@ PanTau::Tool_TauConstituentGetter::Tool_TauConstituentGetter(
     const std::string& name ) :
         asg::AsgTool(name),
         m_Tool_InformationStore("PanTau::Tool_InformationStore/Tool_InformationStore"),
-        m_Tool_InputConverter(this,"PanTau::Tool_InputConverter/Tool_InputConverter")
+        m_Tool_InputConverter("PanTau::Tool_InputConverter/Tool_InputConverter", this)
 {
     declareProperty("Tool_InformationStore",    m_Tool_InformationStore,   "Link to tool with all information");
     declareProperty("Tool_InputConverter",      m_Tool_InputConverter,     "Link to tool to convert into TauConstituents");
-- 
GitLab


From da2694e5109b1a6f4613d9fe34c0669d423997ab Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Wed, 1 Jul 2020 16:51:31 +0200
Subject: [PATCH 006/217] Migrate to HepMC3 BeamEffects

---
 Simulation/BeamEffects/src/BeamEffectsAlg.cxx | 29 ++++++++++
 .../src/GenEventBeamEffectBooster.cxx         | 10 ++--
 .../src/GenEventBeamEffectBooster.h           |  4 +-
 .../BeamEffects/src/GenEventRotator.cxx       | 10 ++--
 Simulation/BeamEffects/src/GenEventRotator.h  |  4 +-
 .../src/GenEventValidityChecker.cxx           |  7 ++-
 .../src/GenEventVertexPositioner.cxx          | 13 +++--
 .../src/ZeroLifetimePositioner.cxx            | 53 ++++++++++++++++++-
 .../BeamEffects/test/BeamEffectsAlg_test.cxx  | 33 ++++--------
 9 files changed, 118 insertions(+), 45 deletions(-)

diff --git a/Simulation/BeamEffects/src/BeamEffectsAlg.cxx b/Simulation/BeamEffects/src/BeamEffectsAlg.cxx
index 20cbfadca832..e732905cc04a 100644
--- a/Simulation/BeamEffects/src/BeamEffectsAlg.cxx
+++ b/Simulation/BeamEffects/src/BeamEffectsAlg.cxx
@@ -82,6 +82,34 @@ namespace Simulation
   StatusCode BeamEffectsAlg::patchSignalProcessVertex(HepMC::GenEvent& ge) const
   {
     //Ensure that we have a valid signal_process_vertex
+#ifdef HEPMC3
+    if( !HepMC::signal_process_vertex(ge) ) {
+      if(m_ISFRun) {
+        ATH_MSG_DEBUG("No signal_process_vertex found - creating a dummy GenVertex.");
+        HepMC::FourVector signalPos( 0.0, 0.0, 0.0, 0.0);
+        HepMC::GenVertexPtr signalVertex = HepMC::newGenVertexPtr( signalPos );
+        // ge will now take ownership of the signal process vertex
+        HepMC::set_signal_process_vertex(ge, signalVertex );
+      }
+      else {
+        if (!ge.vertices_empty()) {
+          ATH_MSG_DEBUG("No signal_process_vertex found - using the first GenVertex in the event.");
+          HepMC::GenVertexPtr signalVertex = ge.vertices().front();
+          HepMC::set_signal_process_vertex(ge,signalVertex );
+        }
+      }
+      if( !HepMC::signal_process_vertex(ge) ) { // Insanity check
+        if (!ge.vertices().empty()) {
+          ATH_MSG_ERROR("Failed to set signal_process_vertex for GenEvent!!");
+          return StatusCode::FAILURE;
+        }
+        ATH_MSG_WARNING("No signal_process_vertex found. Empty GenEvent!");
+      }
+    }
+    else {
+      ATH_MSG_DEBUG("signal_process_vertex set by Generator.");
+    }
+#else    
     if( !ge.signal_process_vertex() ) {
       if(m_ISFRun) {
         ATH_MSG_DEBUG("No signal_process_vertex found - creating a dummy GenVertex.");
@@ -108,6 +136,7 @@ namespace Simulation
     else {
       ATH_MSG_DEBUG("signal_process_vertex set by Generator.");
     }
+#endif
     return StatusCode::SUCCESS;
   }
 
diff --git a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.cxx b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.cxx
index 58978e8435a6..d98fcc7a8d1e 100644
--- a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.cxx
+++ b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -186,15 +186,13 @@ namespace Simulation
     CLHEP::HepLorentzRotation transform = CLHEP::HepLorentzRotation();
     ATH_CHECK( initializeGenEvent(transform) );
 
-    auto particleIter = ge.particles_begin();
-    auto particleIterEnd = ge.particles_end();
-    for(  ; particleIter != particleIterEnd; ++particleIter) {
-      this->boostParticle(*particleIter, transform);
+    for( auto particleIter: ge) {
+      this->boostParticle(particleIter, transform);
     }
     return StatusCode::SUCCESS;
   }
 
-  void GenEventBeamEffectBooster::boostParticle(HepMC::GenParticle* p,
+  void GenEventBeamEffectBooster::boostParticle(HepMC::GenParticlePtr p,
                                                 const CLHEP::HepLorentzRotation& transform) const
   {
     // Apply the same transformation for EVERY HepMC::GenParticle
diff --git a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
index 49060bd70c39..c42f15a6e19f 100644
--- a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
+++ b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -57,7 +57,7 @@ namespace Simulation {
     /** calculate the transformations that we want to apply to the particles in the current GenEvent */
     StatusCode initializeGenEvent(CLHEP::HepLorentzRotation& transform) const;
     /** apply boost to individual GenParticles */
-    void boostParticle(HepMC::GenParticle* p, const CLHEP::HepLorentzRotation& transform) const;
+    void boostParticle(HepMC::GenParticlePtr  p, const CLHEP::HepLorentzRotation& transform) const;
 
     ServiceHandle<IAthRNGSvc>       m_rndGenSvc;
     ATHRNG::RNGWrapper*             m_randomEngine;             //!< Slot-local RNG
diff --git a/Simulation/BeamEffects/src/GenEventRotator.cxx b/Simulation/BeamEffects/src/GenEventRotator.cxx
index 94732e8f2c11..6ac18f1c3196 100644
--- a/Simulation/BeamEffects/src/GenEventRotator.cxx
+++ b/Simulation/BeamEffects/src/GenEventRotator.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -83,15 +83,13 @@ namespace Simulation
     CLHEP::HepLorentzRotation transform = CLHEP::HepLorentzRotation();
     ATH_CHECK( initializeGenEvent(transform) );
 
-    auto particleIter = ge.particles_begin();
-    auto particleIterEnd = ge.particles_end();
-    for( ; particleIter != particleIterEnd; ++particleIter) {
-      rotateParticle(*particleIter, transform);
+    for(auto particleIter:  ge) {
+      rotateParticle(particleIter, transform);
     }
     return StatusCode::SUCCESS;
   }
 
-  void GenEventRotator::rotateParticle(HepMC::GenParticle* p,
+  void GenEventRotator::rotateParticle(HepMC::GenParticlePtr p,
                                        const CLHEP::HepLorentzRotation& transform) const
   {
     // Apply the same transformation for EVERY HepMC::GenParticle
diff --git a/Simulation/BeamEffects/src/GenEventRotator.h b/Simulation/BeamEffects/src/GenEventRotator.h
index a1f71c056f84..0039316aaef5 100644
--- a/Simulation/BeamEffects/src/GenEventRotator.h
+++ b/Simulation/BeamEffects/src/GenEventRotator.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ namespace Simulation {
     /** calculate the transformations that we want to apply to the particles in the current GenEvent */
     StatusCode initializeGenEvent(CLHEP::HepLorentzRotation& transform) const;
     /** apply rotations to individual GenParticles */
-    void rotateParticle(HepMC::GenParticle* p, const CLHEP::HepLorentzRotation& transform) const;
+    void rotateParticle(HepMC::GenParticlePtr p, const CLHEP::HepLorentzRotation& transform) const;
 
     double m_xangle; /** rotation about x-axis (degrees) */
     double m_yangle; /** rotation about y-axis (degrees) */
diff --git a/Simulation/BeamEffects/src/GenEventValidityChecker.cxx b/Simulation/BeamEffects/src/GenEventValidityChecker.cxx
index 767b2f025e82..36815751dc81 100644
--- a/Simulation/BeamEffects/src/GenEventValidityChecker.cxx
+++ b/Simulation/BeamEffects/src/GenEventValidityChecker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -50,8 +50,13 @@ namespace Simulation
     bool allOK = true;
 
     // loop over the vertices in the GenEvent
+#ifdef HEPMC3
+    auto vtxIt  = ge.vertices().begin();
+    auto vtxEnd = ge.vertices().end();
+#else
     auto vtxIt  = ge.vertices_begin();
     auto vtxEnd = ge.vertices_end();
+#endif
     for( ; vtxIt != vtxEnd; ++vtxIt) {
       // for quick access:
       const HepMC::FourVector &curPos = (*vtxIt)->position();
diff --git a/Simulation/BeamEffects/src/GenEventVertexPositioner.cxx b/Simulation/BeamEffects/src/GenEventVertexPositioner.cxx
index 137ce080e370..12d487c56f91 100644
--- a/Simulation/BeamEffects/src/GenEventVertexPositioner.cxx
+++ b/Simulation/BeamEffects/src/GenEventVertexPositioner.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -55,7 +55,7 @@ namespace Simulation
   StatusCode GenEventVertexPositioner::manipulate(HepMC::GenEvent& ge) const
   {
     // Grab signal_process_vertex pointer
-    const HepMC::GenVertex *signalProcVtx(ge.signal_process_vertex());
+    auto signalProcVtx=HepMC::signal_process_vertex(&ge);
     if(!signalProcVtx) {
       ATH_MSG_ERROR("Expected GenEvent::signal_process_vertex() to already have been set at this point!");
       return StatusCode::FAILURE;
@@ -82,8 +82,13 @@ namespace Simulation
 
       // loop over the vertices in the event, they are in respect with another
       //   (code from Simulation/Fatras/FatrasAlgs/McEventPreProcessing.cxx)
+#ifdef HEPMC3
+      auto vtxIt    = ge.vertices().begin();
+      auto vtxItEnd = ge.vertices().end();
+#else
       auto vtxIt    = ge.vertices_begin();
       auto vtxItEnd = ge.vertices_end();
+#endif
       for( ; vtxIt != vtxItEnd; ++vtxIt) {
         // quick access:
         auto curVtx = (*vtxIt);
@@ -106,10 +111,10 @@ namespace Simulation
 
       // Do the same for the signal process vertex if still required.
       if (modifySigVtx) {
-        const HepMC::FourVector &curPos = ge.signal_process_vertex()->position();
+        const HepMC::FourVector &curPos = HepMC::signal_process_vertex(&ge)->position();
         CLHEP::HepLorentzVector newPos( curPos.x(), curPos.y(), curPos.z(), curPos.t() );
         newPos += (*curShift);
-        ge.signal_process_vertex()->set_position( newPos);
+        (HepMC::signal_process_vertex(&ge))->set_position( HepMC::FourVector(newPos.x(),newPos.y(),newPos.z(),newPos.t()) );
       }
 
       // memory cleanup
diff --git a/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx b/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx
index 227f709ddea7..ac3074d1f58b 100644
--- a/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx
+++ b/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // class header include
@@ -65,6 +65,56 @@ StatusCode Simulation::ZeroLifetimePositioner::removeWorkaround(HepMC::GenEvent&
 StatusCode Simulation::ZeroLifetimePositioner::manipulate(HepMC::GenEvent& ge, bool applyPatch, bool removePatch) const
 {
   // loop over the vertices in the event
+#ifdef HEPMC3
+
+  const auto pdgCodesBegin = m_pdgCodesToCheck.begin();
+  const auto pdgCodesEnd = m_pdgCodesToCheck.end();
+  for (auto curVtx: ge.vertices()) {
+    if (curVtx->particles_in().size()!=1 || curVtx->particles_out().size()!=1) { continue; }
+    const int pdgIn=curVtx->particles_in().front()->pdg_id();
+    const int pdgOut=curVtx->particles_out().front()->pdg_id();
+    if (pdgIn!=-pdgOut ||
+        std::find(pdgCodesBegin, pdgCodesEnd, std::abs(pdgIn))== pdgCodesEnd) {
+      continue;
+    }
+    HepMC::GenVertexPtr nextVtx = curVtx->particles_out().front()->end_vertex();
+    if(!nextVtx) { continue; }
+    ATH_MSG_DEBUG("Found a vertex to correct with incoming PDG code = " << pdgIn);
+    ATH_MSG_VERBOSE("Next Vertex:");
+    if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) {
+      nextVtx->print();
+    }
+    const HepMC::FourVector &nextVec = nextVtx->position();
+    const CLHEP::HepLorentzVector nextPos( nextVec.x(), nextVec.y(), nextVec.z(), nextVec.t() );
+    ATH_MSG_VERBOSE("Current Vertex:");
+    if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) {
+      curVtx->print();
+    }
+    if (applyPatch) {
+      HepMC::GenVertexPtr prevVtx = curVtx->particles_in().front()->production_vertex();
+      ATH_MSG_VERBOSE("Previous Vertex:");
+      if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) {
+        prevVtx->print();
+      }
+      const HepMC::FourVector &prevVec = prevVtx->position();
+      const CLHEP::HepLorentzVector prevPos( prevVec.x(), prevVec.y(), prevVec.z(), prevVec.t() );
+      CLHEP::HepLorentzVector newPos = 0.5*(prevPos+nextPos);
+      curVtx->set_position(newPos);
+      ATH_MSG_DEBUG("Revised current Vertex");
+      if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) {
+        curVtx->print();
+      }
+    }
+    if (removePatch) {
+      CLHEP::HepLorentzVector newPos = nextPos;
+      curVtx->set_position(newPos);
+      ATH_MSG_DEBUG("Revised current Vertex");
+      if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) {
+        curVtx->print();
+      }
+    }
+  }
+#else
   HepMC::GenEvent::vertex_iterator vtxIt = ge.vertices_begin();
   const HepMC::GenEvent::vertex_iterator vtxItEnd = ge.vertices_end();
   const auto pdgCodesBegin = m_pdgCodesToCheck.begin();
@@ -116,6 +166,7 @@ StatusCode Simulation::ZeroLifetimePositioner::manipulate(HepMC::GenEvent& ge, b
       }
     }
   }
+#endif
 
   return StatusCode::SUCCESS;
 }
diff --git a/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx b/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx
index 29648675fd51..a6f12833eb2e 100644
--- a/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx
+++ b/Simulation/BeamEffects/test/BeamEffectsAlg_test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -13,12 +13,8 @@
 // Framework
 #include "TestTools/initGaudi.h"
 
-// ATLAS C++
-
 // Google Test
 #include "gtest/gtest.h"
-// Google Mock
-// #include "gmock/gmock.h"
 
 // HepMC includes
 #include "AtlasHepMC/GenEvent.h"
@@ -73,15 +69,6 @@ namespace SimTesting {
       return m_alg->patchSignalProcessVertex(std::forward<Args>(args)...);
     }
 
-    // template<typename... Args>
-    // StatusCode setupReadHandleKeyVector(Args&&... args) const {
-    //   return m_alg->setupReadHandleKeyVector(std::forward<Args>(args)...);
-    // }
-
-    // template<typename... Args>
-    // void mergeCollections(Args&&... args) const {
-    //   m_alg->mergeCollections(std::forward<Args>(args)...);
-    // }
     Simulation::BeamEffectsAlg* m_alg{};
     StoreGateSvc* m_sg{};
   };   // BeamEffectsAlg_test fixture
@@ -113,7 +100,7 @@ namespace SimTesting {
   TEST_F(BeamEffectsAlg_test, signal_process_vertex_exists) {
     HepMC::GenEvent ge;
     CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0);
-    HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
+    HepMC::GenVertexPtr  myVertex = HepMC::newGenVertexPtr( myPos, -1 );
     ge.set_signal_process_vertex( myVertex );
     ASSERT_TRUE( patchSignalProcessVertex(ge).isSuccess() );
     ASSERT_TRUE( ge.signal_process_vertex()==myVertex );
@@ -122,7 +109,7 @@ namespace SimTesting {
   TEST_F(BeamEffectsAlg_test, add_signal_process_vertex_atlasG4) {
     HepMC::GenEvent ge;
     CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0);
-    HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
+    HepMC::GenVertexPtr  myVertex = HepMC::newGenVertexPtr( myPos, -1 );
     ge.add_vertex( myVertex );
     ASSERT_TRUE( ge.signal_process_vertex()==nullptr );
     ASSERT_TRUE( m_alg->setProperty( "ISFRun", false).isSuccess()  );
@@ -134,8 +121,8 @@ namespace SimTesting {
   TEST_F(BeamEffectsAlg_test, add_signal_process_vertex_isfG4) {
     HepMC::GenEvent ge;
     CLHEP::HepLorentzVector myPos( 1.0, 1.0, 1.0, 1.0);
-    HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
-    HepMC::GenVertex *dummyVertex = new HepMC::GenVertex();
+    HepMC::GenVertexPtr  myVertex = HepMC::newGenVertexPtr( myPos, -1 );
+    HepMC::GenVertexPtr  dummyVertex = HepMC::newGenVertexPtr();
     ge.add_vertex( myVertex );
     ASSERT_TRUE( ge.signal_process_vertex()==nullptr );
     ASSERT_TRUE( m_alg->setProperty( "ISFRun", true).isSuccess()  );
@@ -155,18 +142,18 @@ namespace SimTesting {
     inputTestDataHandle->push_back(new HepMC::GenEvent());
     HepMC::GenEvent& ge = *(inputTestDataHandle->at(0));
     CLHEP::HepLorentzVector myPos( 0.0, 0.0, 0.0, 0.0);
-    HepMC::GenVertex *myVertex = new HepMC::GenVertex( myPos, -1 );
+    HepMC::GenVertexPtr  myVertex = HepMC::newGenVertexPtr( myPos, -1 );
     HepMC::FourVector fourMomentum1( 0.0, 0.0, 1.0, 1.0*CLHEP::TeV);
-    HepMC::GenParticle* inParticle1 = new HepMC::GenParticle(fourMomentum1, 2, 10);
+    HepMC::GenParticlePtr  inParticle1 = HepMC::newGenParticlePtr(fourMomentum1, 2, 10);
     myVertex->add_particle_in(inParticle1);
     HepMC::FourVector fourMomentum2( 0.0, 0.0, -1.0, 1.0*CLHEP::TeV);
-    HepMC::GenParticle* inParticle2 = new HepMC::GenParticle(fourMomentum2, -2, 10);
+    HepMC::GenParticlePtr  inParticle2 = HepMC::newGenParticlePtr(fourMomentum2, -2, 10);
     myVertex->add_particle_in(inParticle2);
     HepMC::FourVector fourMomentum3( 0.0, 1.0, 0.0, 1.0*CLHEP::TeV);
-    HepMC::GenParticle* inParticle3 = new HepMC::GenParticle(fourMomentum3, 2, 10);
+    HepMC::GenParticlePtr  inParticle3 = HepMC::newGenParticlePtr(fourMomentum3, 2, 10);
     myVertex->add_particle_out(inParticle3);
     HepMC::FourVector fourMomentum4( 0.0, -1.0, 0.0, 1.0*CLHEP::TeV);
-    HepMC::GenParticle* inParticle4 = new HepMC::GenParticle(fourMomentum4, -2, 10);
+    HepMC::GenParticlePtr  inParticle4 = HepMC::newGenParticlePtr(fourMomentum4, -2, 10);
     myVertex->add_particle_out(inParticle4);
     ge.add_vertex( myVertex );
     ge.set_signal_process_vertex( myVertex );
-- 
GitLab


From 73547bf7495b041517df59147169411a6a35a77b Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Thu, 2 Jul 2020 18:41:12 +0100
Subject: [PATCH 007/217] Also allow to tell the type of the surface used by
 the parameters without inspecting a ptr

---
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h    | 3 +++
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc  | 7 +++++++
 .../TrkSurfaces/TrkSurfaces/CylinderSurface.h            | 3 +++
 .../TrkSurfaces/TrkSurfaces/CylinderSurface.icc          | 8 ++++++++
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h    | 3 +++
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.icc  | 9 ++++++++-
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h | 4 ++++
 .../TrkSurfaces/TrkSurfaces/PerigeeSurface.icc           | 7 +++++++
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h   | 3 +++
 .../TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.icc | 8 ++++++++
 .../TrkSurfaces/TrkSurfaces/StraightLineSurface.h        | 3 +++
 .../TrkSurfaces/TrkSurfaces/StraightLineSurface.icc      | 7 +++++++
 Tracking/TrkEvent/TrkNeutralParameters/CMakeLists.txt    | 9 ++++++---
 .../ut_TrkNeutralParameters_testConstExprMethods.ref     | 7 +++++++
 .../test/{testChargeDefinition.cxx => testConstExpr.cxx} | 5 +++--
 Tracking/TrkEvent/TrkParameters/CMakeLists.txt           | 7 +++++--
 .../share/ut_TrkParameters_testConstExprMethods.ref      | 7 +++++++
 .../test/{testChargeDefinition.cxx => testConstExpr.cxx} | 5 +++--
 .../TrkParametersBase/CurvilinearParametersT.h           | 3 +++
 .../TrkParametersBase/CurvilinearParametersT.icc         | 9 +++++++++
 .../TrkParametersBase/TrkParametersBase/ParametersBase.h | 4 ++++
 .../TrkParametersBase/TrkParametersBase/ParametersT.h    | 3 +++
 .../TrkParametersBase/TrkParametersBase/ParametersT.icc  | 8 ++++++++
 23 files changed, 122 insertions(+), 10 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkNeutralParameters/share/ut_TrkNeutralParameters_testConstExprMethods.ref
 rename Tracking/TrkEvent/TrkNeutralParameters/test/{testChargeDefinition.cxx => testConstExpr.cxx} (84%)
 create mode 100644 Tracking/TrkEvent/TrkParameters/share/ut_TrkParameters_testConstExprMethods.ref
 rename Tracking/TrkEvent/TrkParameters/test/{testChargeDefinition.cxx => testConstExpr.cxx} (83%)

diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
index 7a1a97798f73..bd0f4c03658f 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.h
@@ -142,6 +142,9 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type static constexpr */
+  static constexpr SurfaceType staticType() ;
+
   /** Return the measurement frame - this is needed for alignment, in particular
     for StraightLine and Perigee Surface
     - the default implementation is the the RotationMatrix3D of the transform */
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
index b4ef19066a71..442da77d2e7b 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/ConeSurface.icc
@@ -11,6 +11,13 @@ ConeSurface::type() const
   return Surface::Cone;
 }
 
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+ConeSurface::staticType()
+{
+  return Surface::Cone;
+}
+
 /** Use the Surface as a ParametersBase constructor, from local parameters -
  * charged */
 inline ParametersT<5, Charged, ConeSurface>*
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
index 746347b99258..6ea73c4219e2 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.h
@@ -167,6 +167,9 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type static constexpr */
+  static constexpr SurfaceType staticType() ;
+
   /** Returns a global reference point:
      For the Cylinder this is @f$ (R*cos(\phi), R*sin(\phi),0)*transform() @f$
      Where  @f$ \phi @f$ denotes the averagePhi() of the cylinderBounds.
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
index cb3c2c65db54..70d71810390f 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/CylinderSurface.icc
@@ -11,6 +11,14 @@ CylinderSurface::type() const
   return Surface::Cylinder;
 }
 
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+CylinderSurface::staticType()
+{
+  return Surface::Cylinder;
+}
+
+
 /** Use the Surface as a ParametersBase constructor, from local parameters -
  * charged */
 inline ParametersT<5, Charged, CylinderSurface>*
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
index f6f19171ec3c..11ad7d68cea9 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.h
@@ -162,6 +162,9 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type */
+  static constexpr SurfaceType staticType();
+
   /** Returns a global reference point:
      For the Disc this is @f$ (R*cos(\phi), R*sin(\phi),0)*transform() @f$
      Where  @f$ r,  \phi @f$ denote the r(), averagePhi() of the Bounds.
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.icc
index 6a7102af8d53..8449298c6fd6 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscSurface.icc
@@ -10,7 +10,14 @@ DiscSurface::type() const
   return Surface::Disc;
 }
 
-/** Use the Surface as a ParametersBase constructor, from local parameters -
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+DiscSurface::staticType()
+{
+  return Surface::Disc;
+}
+
+/* Use the Surface as a ParametersBase constructor, from local parameters -
  * charged */
 inline ParametersT<5, Charged, DiscSurface>*
 DiscSurface::createTrackParameters(double l1,
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
index af54ae7a6930..837fb9f87381 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.h
@@ -128,6 +128,10 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type static constexpr */
+  static constexpr SurfaceType staticType() ;
+
+
   /**Return method for transfromation, overwrites the transform() form base
    * class*/
   virtual const Amg::Transform3D& transform() const override;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
index b99a5a947410..1ec96a413a9d 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PerigeeSurface.icc
@@ -88,6 +88,13 @@ PerigeeSurface::type() const
   return Surface::Perigee;
 }
 
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+PerigeeSurface::staticType()
+{
+  return Surface::Perigee;
+}
+
 inline PerigeeSurface*
 PerigeeSurface::clone() const
 {
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
index 654769b334bc..c41e1fca790c 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.h
@@ -143,6 +143,9 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type static constexpr */
+  static constexpr SurfaceType staticType() ;
+
   /** Use the Surface as a ParametersBase constructor, from local parameters -
    * charged */
   virtual ParametersT<5, Charged, PlaneSurface>* createTrackParameters(
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.icc
index 0a11027762d4..5c6de97bc6c2 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/PlaneSurface.icc
@@ -9,6 +9,14 @@ PlaneSurface::type() const
 {
   return Surface::Plane;
 }
+
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+PlaneSurface::staticType()
+{
+  return Surface::Plane;
+}
+
 /** Use the Surface as a ParametersBase constructor, from local parameters -
  * charged */
 inline ParametersT<5, Charged, PlaneSurface>*
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
index 186d74f18d8c..9e8d4919ce2a 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.h
@@ -145,6 +145,9 @@ public:
   /** Return the surface type */
   virtual SurfaceType type() const override final;
 
+  /** Return the surface type static constexpr */
+  static constexpr SurfaceType staticType() ;
+
   /** Specified for StraightLineSurface: LocalToGlobal method without dynamic
    * memory allocation */
   virtual void localToGlobal(const Amg::Vector2D& locp,
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
index d95d5980fecc..7887b07f5c41 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/StraightLineSurface.icc
@@ -10,6 +10,13 @@ StraightLineSurface::type() const
   return Surface::Line;
 }
 
+/** Return the surface type static constexpr */
+inline constexpr Surface::SurfaceType
+StraightLineSurface::staticType()
+{
+  return Surface::Line;
+}
+
 /** Use the Surface as a ParametersBase constructor, from local parameters -
  * charged */
 inline ParametersT<5, Charged, StraightLineSurface>*
diff --git a/Tracking/TrkEvent/TrkNeutralParameters/CMakeLists.txt b/Tracking/TrkEvent/TrkNeutralParameters/CMakeLists.txt
index 23cfe73a8a04..841d3bb0949c 100644
--- a/Tracking/TrkEvent/TrkNeutralParameters/CMakeLists.txt
+++ b/Tracking/TrkEvent/TrkNeutralParameters/CMakeLists.txt
@@ -15,7 +15,10 @@ atlas_add_library( TrkNeutralParameters
                    PUBLIC_HEADERS TrkNeutralParameters
                    LINK_LIBRARIES TrkSurfaces TrkParametersBase )
 
- #Executables for tests
-atlas_add_executable( TrkNeutralParameters_testConstexprMethods
-                      test/testChargeDefinition.cxx 
+#Executables for tests
+atlas_add_executable( TrkNeutralParameters_testConstExprMethods
+                      test/testConstExpr.cxx 
                       LINK_LIBRARIES TrkNeutralParameters)
+#Executables for tests
+atlas_add_test( ut_TrkNeutralParameters_testConstExprMethods
+	        SCRIPT TrkNeutralParameters_testConstExprMethods)
diff --git a/Tracking/TrkEvent/TrkNeutralParameters/share/ut_TrkNeutralParameters_testConstExprMethods.ref b/Tracking/TrkEvent/TrkNeutralParameters/share/ut_TrkNeutralParameters_testConstExprMethods.ref
new file mode 100644
index 000000000000..1993dc574151
--- /dev/null
+++ b/Tracking/TrkEvent/TrkNeutralParameters/share/ut_TrkNeutralParameters_testConstExprMethods.ref
@@ -0,0 +1,7 @@
+Dimensions: 5 isCharged: 0 SurfaceType: 4
+Dimensions: 5 isCharged: 0 SurfaceType: 0
+Dimensions: 5 isCharged: 0 SurfaceType: 1
+Dimensions: 5 isCharged: 0 SurfaceType: 2
+Dimensions: 5 isCharged: 0 SurfaceType: 3
+Dimensions: 5 isCharged: 0 SurfaceType: 4
+Dimensions: 5 isCharged: 0 SurfaceType: 5
diff --git a/Tracking/TrkEvent/TrkNeutralParameters/test/testChargeDefinition.cxx b/Tracking/TrkEvent/TrkNeutralParameters/test/testConstExpr.cxx
similarity index 84%
rename from Tracking/TrkEvent/TrkNeutralParameters/test/testChargeDefinition.cxx
rename to Tracking/TrkEvent/TrkNeutralParameters/test/testConstExpr.cxx
index 87f48e1f756e..3f97528b3311 100644
--- a/Tracking/TrkEvent/TrkNeutralParameters/test/testChargeDefinition.cxx
+++ b/Tracking/TrkEvent/TrkNeutralParameters/test/testConstExpr.cxx
@@ -20,6 +20,7 @@ main()
   params.emplace_back(std::make_unique<Trk::NeutralAtaStraightLine>());
 
   for (const auto& i : params) {
-    std::cout << "Dimensions: " << i->dim << " isCharged: "<< i->isCharged() << '\n';
-  }
+     std::cout << "Dimensions: " << i->dim << " isCharged: " << i->isCharged()
+              << " SurfaceType: " << i->surfaceType() << '\n';
   }
+}
diff --git a/Tracking/TrkEvent/TrkParameters/CMakeLists.txt b/Tracking/TrkEvent/TrkParameters/CMakeLists.txt
index 0c0647798aca..2e676e8c6a30 100644
--- a/Tracking/TrkEvent/TrkParameters/CMakeLists.txt
+++ b/Tracking/TrkEvent/TrkParameters/CMakeLists.txt
@@ -29,6 +29,9 @@ atlas_add_dictionary( TrkParametersDict
 
 
 #Executables for tests
-atlas_add_executable( TrkParameters_testConstexprMethods
-                      test/testChargeDefinition.cxx 
+atlas_add_executable( TrkParameters_testConstExprMethods
+	              test/testConstExpr.cxx 
 		      LINK_LIBRARIES TrkParameters)
+#Executables for tests
+atlas_add_test( ut_TrkParameters_testConstExprMethods
+	        SCRIPT TrkParameters_testConstExprMethods)
diff --git a/Tracking/TrkEvent/TrkParameters/share/ut_TrkParameters_testConstExprMethods.ref b/Tracking/TrkEvent/TrkParameters/share/ut_TrkParameters_testConstExprMethods.ref
new file mode 100644
index 000000000000..132dae1133a3
--- /dev/null
+++ b/Tracking/TrkEvent/TrkParameters/share/ut_TrkParameters_testConstExprMethods.ref
@@ -0,0 +1,7 @@
+Dimensions: 5 isCharged: 1 SurfaceType: 4
+Dimensions: 5 isCharged: 1 SurfaceType: 0
+Dimensions: 5 isCharged: 1 SurfaceType: 1
+Dimensions: 5 isCharged: 1 SurfaceType: 2
+Dimensions: 5 isCharged: 1 SurfaceType: 3
+Dimensions: 5 isCharged: 1 SurfaceType: 4
+Dimensions: 5 isCharged: 1 SurfaceType: 5
diff --git a/Tracking/TrkEvent/TrkParameters/test/testChargeDefinition.cxx b/Tracking/TrkEvent/TrkParameters/test/testConstExpr.cxx
similarity index 83%
rename from Tracking/TrkEvent/TrkParameters/test/testChargeDefinition.cxx
rename to Tracking/TrkEvent/TrkParameters/test/testConstExpr.cxx
index 1522ec269906..e8bf0f20b53b 100644
--- a/Tracking/TrkEvent/TrkParameters/test/testChargeDefinition.cxx
+++ b/Tracking/TrkEvent/TrkParameters/test/testConstExpr.cxx
@@ -20,6 +20,7 @@ main()
   params.emplace_back(std::make_unique<Trk::AtaStraightLine>());
 
   for (const auto& i : params) {
-    std::cout << "Dimensions: " << i->dim << " isCharged: "<< i->isCharged() << '\n';
-  }
+    std::cout << "Dimensions: " << i->dim << " isCharged: " << i->isCharged()
+              << " SurfaceType: " << i->surfaceType() << '\n';
   }
+}
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
index cade2ed2dcfb..580e7eed736a 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
@@ -115,6 +115,9 @@ public:
   /** Return the ParametersType enum */
   virtual ParametersType type() const override final;
 
+  /** Return the Surface Type (check SurfaceType enums)*/
+  virtual int surfaceType() const override final;
+
   /** Return the measurementFrame of the parameters */
   virtual Amg::RotationMatrix3D measurementFrame() const override final;
 
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
index 24d55e4bdab0..ca7c8b4c262b 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
@@ -249,6 +249,15 @@ CurvilinearParametersT<DIM, T, S>::type() const
   return Trk::Curvilinear;
 }
 
+/** Return the Surface Type (check SurfaceType enums)*/
+template<int DIM, class T, class S>
+int
+CurvilinearParametersT<DIM, T, S>::surfaceType() const
+{
+  return S::staticType();
+}
+
+
 // Surface return (with on demand construction)
 template<int DIM, class T, class S>
 Amg::RotationMatrix3D
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
index c053965aa67a..b34f143af332 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
@@ -142,6 +142,10 @@ public:
   /** Return the ParametersType enum */
   virtual ParametersType type() const = 0;
 
+  /** Return the ParametersType enum */
+  virtual int surfaceType() const = 0;
+
+ 
   /** Dumps relevant information about the track parameters into the ostream */
   virtual MsgStream& dump(MsgStream& out) const;
   virtual std::ostream& dump(std::ostream& out) const;
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
index 380fc70cd3cc..34954d7bde69 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
@@ -119,6 +119,9 @@ public:
   /** Return the ParametersType enum */
   virtual ParametersType type() const override final;
 
+  /** Return the Surface Type (check SurfaceType enums)*/
+  virtual int surfaceType() const override final;
+
   /** Return the measurementFrame of the parameters */
   virtual Amg::RotationMatrix3D measurementFrame() const override final;
 
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
index c6651c2d245b..fe889d533025 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
@@ -254,6 +254,14 @@ ParametersT<DIM, T, S>::type() const
   return Trk::AtaSurface;
 }
 
+/** Return the Surface Type (check SurfaceType enums)*/
+template<int DIM, class T, class S>
+int
+ParametersT<DIM, T, S>::surfaceType() const
+{
+  return S::staticType();
+}
+
 // return the measurementFrame
 template<int DIM, class T, class S>
 Amg::RotationMatrix3D
-- 
GitLab


From f749e76863a4f31107449d8556634104322dbada Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 3 Jul 2020 07:38:23 +0200
Subject: [PATCH 008/217] Add ATLAS_CHECK_THREAD_SAFETY to
 InDetPerformanceMonitoring package. Add ATLAS_NOT_THREAD_SAFE to classes and
 methods which use static variables or const_cast or mutable memeber variables
 without protection.

---
 .../InDetPerformanceMonitoring/CMakeLists.txt |  5 ++--
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../IDPerfMonEoverP.h                         |  4 ++-
 .../IDPerfMonZmumu.h                          |  3 +-
 .../InDetPerformanceMonitoring/MuonSelector.h |  3 +-
 .../PerfMonServices.h                         |  6 ++--
 .../InDetPerformanceMonitoring/ZmumuEvent.h   |  6 ++--
 .../src/EventAnalysis.cxx                     |  8 ++++--
 .../src/IDPerfMonZmumu.cxx                    |  4 +--
 .../src/IDPerfMuonRefitter.cxx                |  7 +++--
 .../src/TRT_Electron_Monitoring_Tool.cxx      | 28 +++++++++----------
 11 files changed, 44 insertions(+), 31 deletions(-)
 create mode 100644 InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/CMakeLists.txt
index ea7d73ffbf34..1c693e7fa75e 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/CMakeLists.txt
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/CMakeLists.txt
@@ -10,6 +10,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/AthenaMonitoring
+                          Control/CxxUtils
                           Control/StoreGate
                           Event/xAOD/xAODCaloEvent
                           Event/xAOD/xAODEgamma
@@ -57,13 +58,13 @@ atlas_add_library( InDetPerformanceMonitoringLib
                    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS 
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel xAODCaloEvent xAODEgamma xAODJet xAODMissingET xAODMuon xAODTracking xAODTruth GaudiKernel GeneratorObjects InDetReadoutGeometry TRT_ReadoutGeometry InDetRIO_OnTrack JetInterface ITrackToVertex egammaEvent LWHists TrkParameters TrkParticleBase TrkTrack AthenaMonitoringLib StoreGateLib SGtests ElectronPhotonSelectorToolsLib TrkVertexAnalysisUtilsLib TrigDecisionToolLib
+                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel xAODCaloEvent xAODEgamma xAODJet xAODMissingET xAODMuon xAODTracking xAODTruth GaudiKernel GeneratorObjects InDetReadoutGeometry TRT_ReadoutGeometry InDetRIO_OnTrack JetInterface ITrackToVertex egammaEvent LWHists TrkParameters TrkParticleBase TrkTrack AthenaMonitoringLib CxxUtils StoreGateLib SGtests ElectronPhotonSelectorToolsLib TrkVertexAnalysisUtilsLib TrigDecisionToolLib
                    PRIVATE_LINK_LIBRARIES AtlasHepMCLib IdDictDetDescr xAODEventInfo EventPrimitives InDetIdentifier InDetPrepRawData TrkEventPrimitives TrkTrackSummary TrkTruthData TrkV0Vertex )
 
 atlas_add_component( InDetPerformanceMonitoring
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel AthenaMonitoringLib StoreGateLib SGtests xAODCaloEvent xAODEgamma xAODJet xAODMissingET xAODMuon xAODTracking xAODTruth GaudiKernel GeneratorObjects InDetReadoutGeometry TRT_ReadoutGeometry InDetRIO_OnTrack ElectronPhotonSelectorToolsLib JetInterface ITrackToVertex egammaEvent LWHists TrkParameters TrkParticleBase TrkTrack IdDictDetDescr xAODEventInfo EventPrimitives InDetIdentifier InDetPrepRawData TrkEventPrimitives TrkTrackSummary TrkTruthData TrkV0Vertex TrkVertexAnalysisUtilsLib TrigDecisionToolLib InDetPerformanceMonitoringLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel AthenaMonitoringLib CxxUtils StoreGateLib SGtests xAODCaloEvent xAODEgamma xAODJet xAODMissingET xAODMuon xAODTracking xAODTruth GaudiKernel GeneratorObjects InDetReadoutGeometry TRT_ReadoutGeometry InDetRIO_OnTrack ElectronPhotonSelectorToolsLib JetInterface ITrackToVertex egammaEvent LWHists TrkParameters TrkParticleBase TrkTrack IdDictDetDescr xAODEventInfo EventPrimitives InDetIdentifier InDetPrepRawData TrkEventPrimitives TrkTrackSummary TrkTruthData TrkV0Vertex TrkVertexAnalysisUtilsLib TrigDecisionToolLib InDetPerformanceMonitoringLib )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..71695c03d9f2
--- /dev/null
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetMonitoring/InDetPerformanceMonitoring
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonEoverP.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonEoverP.h
index 06d98ff9872a..05f494e5d426 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonEoverP.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonEoverP.h
@@ -52,6 +52,8 @@ CREATED:  July 2011
 
 #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <map>
 #include <vector>
 
@@ -78,7 +80,7 @@ namespace Trk{
 typedef std::pair<const xAOD::Vertex* , int> VxPos;
 
 
-class IDPerfMonEoverP : public AthAlgorithm
+class ATLAS_NOT_THREAD_SAFE IDPerfMonEoverP : public AthAlgorithm // Many mutable member variables are used without protection.
 {
  public:
 
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
index 7582ed4088b2..012b4e59a317 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/IDPerfMonZmumu.h
@@ -16,11 +16,12 @@
 
 #include "StoreGate/ReadHandle.h"
 #include "xAODEventInfo/EventInfo.h"
+#include "CxxUtils/checker_macros.h"
 
 class TTree; 
 class IegammaTrkRefitterTool;
 
-class IDPerfMonZmumu : public AthAlgorithm
+class ATLAS_NOT_THREAD_SAFE IDPerfMonZmumu : public AthAlgorithm // Thread unsafe ZmumuEvent class is used.
 {
  public:
   // Constructors & destructors
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h
index 4b3b7287f911..0652975895f8 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/MuonSelector.h
@@ -9,6 +9,7 @@
 // Include files...
 //==============================================================================
 #include "InDetPerformanceMonitoring/EventAnalysis.h"
+#include "CxxUtils/checker_macros.h"
 #include "xAODMuon/Muon.h"
 #include "xAODTracking/Vertex.h"
 #include "xAODTracking/VertexContainer.h"
@@ -20,7 +21,7 @@
 //==============================================================================
 //class Muon;
 
-class MuonSelector : public EventAnalysis
+class ATLAS_NOT_THREAD_SAFE MuonSelector : public EventAnalysis // static member variable is used.
 {
  public:
   MuonSelector();
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h
index 779d8ec649fa..561f1b810272 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/PerfMonServices.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -13,9 +13,11 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "StoreGate/StoreGate.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class IAtRndmGenSvc;
 
-class PerfMonServices
+class ATLAS_NOT_THREAD_SAFE PerfMonServices // static variables are used.
 {
  public:
   // Constructors and Destructors.
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ZmumuEvent.h b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ZmumuEvent.h
index e490cf311368..3c84fd8d4c9a 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ZmumuEvent.h
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/InDetPerformanceMonitoring/ZmumuEvent.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef IDPERFMON_ZMUMUEVENT_H
@@ -14,6 +14,8 @@
 #include "InDetPerformanceMonitoring/EventAnalysis.h"
 #include "InDetPerformanceMonitoring/PerfMonServices.h"
 
+#include "CxxUtils/checker_macros.h"
+
 //==============================================================================
 // Forward class declarations...
 //==============================================================================
@@ -22,7 +24,7 @@ class TrackParticle;
 //==============================================================================
 // Class declaration...
 //==============================================================================
-class ZmumuEvent : public EventAnalysis
+class ATLAS_NOT_THREAD_SAFE ZmumuEvent : public EventAnalysis // Thread unsafe MuonSelector class is used.
 {
  public:
   ZmumuEvent();
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx
index a1037ddf209a..3e9daef44fba 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/EventAnalysis.cxx
@@ -2,6 +2,7 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "InDetPerformanceMonitoring/EventAnalysis.h"
 #include "InDetPerformanceMonitoring/PerfMonServices.h"
 #include "TH1.h"
@@ -12,7 +13,8 @@
 
 namespace{
   template <class HistoArrayType>
-  void registerHistogramType(const HistoArrayType & h, const std::string &sampleName, const std::string & suffix){
+  void registerHistogramType ATLAS_NOT_THREAD_SAFE // Thread unsafe PerfMonServices class is used.
+    (const HistoArrayType & h, const std::string &sampleName, const std::string & suffix){
     unsigned int u = 1;
     const std::string titleRoot{"/ESD/" + sampleName + suffix};
     for ( auto & thisHisto:h ){
@@ -38,7 +40,7 @@ EventAnalysis::~EventAnalysis()
 //=============================================================================
 // Public Accessors
 //=============================================================================
-void EventAnalysis::Init()
+void EventAnalysis::Init ATLAS_NOT_THREAD_SAFE () // Thread unsafe Register method is used.
 {
   // This must be called by an inheriting class in order to book
   //  & register histograms.
@@ -63,7 +65,7 @@ void EventAnalysis::BookHistograms()
 //=============================================================================
 // Private Accessors
 //=============================================================================
-void EventAnalysis::Register()
+void EventAnalysis::Register ATLAS_NOT_THREAD_SAFE () // Thread unsafe registerHistogramType fuction is used.
 {
   // Register histograms in monitoring tool
   registerHistogramType(m_x1DHistograms, m_xSampleName, "/1dhisto_");
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
index f8387747a3c0..f8c31c9d977f 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //==================================================================================
@@ -639,7 +639,7 @@ StatusCode IDPerfMonZmumu::FillTruthParameters(const xAOD::TrackParticle* trackP
 }
 
 
-const xAOD::TruthParticle* IDPerfMonZmumu::getTruthParticle( const xAOD::IParticle& p ) {
+const xAOD::TruthParticle* IDPerfMonZmumu::getTruthParticle ATLAS_NOT_THREAD_SAFE ( const xAOD::IParticle& p ) { // static variable is used.
   /// A convenience type declaration
   typedef ElementLink< xAOD::TruthParticleContainer > Link_t;
   /// A static accessor for the information
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx
index 2105a4b087e6..ffd736a4f0c4 100755
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMuonRefitter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -21,6 +21,7 @@
 #include "TrkTrack/TrackCollection.h"
 
 // ATLAS headers
+#include "CxxUtils/checker_macros.h"
 #include "GaudiKernel/IInterface.h"
 
 
@@ -49,7 +50,7 @@ IDPerfMuonRefitter::~IDPerfMuonRefitter()
 {}
 
 
-StatusCode IDPerfMuonRefitter::initialize()
+StatusCode IDPerfMuonRefitter::initialize ATLAS_NOT_THREAD_SAFE () // Thread unsafe PerfMonServices class is used.
 {
   // Setup the services
   ISvcLocator* pxServiceLocator = serviceLocator();
@@ -80,7 +81,7 @@ StatusCode IDPerfMuonRefitter::initialize()
 
 
 
-StatusCode IDPerfMuonRefitter::execute()
+StatusCode IDPerfMuonRefitter::execute ATLAS_NOT_THREAD_SAFE () // Thread unsafe PerfMonServices class is used.
 {
   const xAOD::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<xAOD::MuonContainer>( m_container );
   if (!pxMuonContainer){
diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx
index 6687093facfe..7c813aed3081 100644
--- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/TRT_Electron_Monitoring_Tool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // **********************************************************************
@@ -17,7 +17,7 @@
 #include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
 #include "TrkParticleBase/LinkToTrackParticleBase.h"
 #include "TrkTrack/TrackStateOnSurface.h"
-
+#include "CxxUtils/checker_macros.h"
 
 namespace{
 constexpr float electron_mass = 0.511 * Gaudi::Units::MeV;
@@ -219,7 +219,7 @@ bookPCandHistograms( MonGroup& monGroup, lw_partcand_hists_t &hists, const std::
 
 StatusCode
 TRT_Electron_Monitoring_Tool::
-fillHistograms()
+fillHistograms ATLAS_NOT_THREAD_SAFE () // Thread unsafe loopOverXyz methods are used.
 {
    ATH_MSG_DEBUG("Filling TRT Electron Monitor Histograms");
   m_tBarrelA.N = 0;
@@ -249,7 +249,7 @@ fillHistograms()
 
 void
 TRT_Electron_Monitoring_Tool::
-loopOverConversions(std::vector<Trk::Track*> &v_usedTrks)
+loopOverConversions ATLAS_NOT_THREAD_SAFE (std::vector<Trk::Track*> &v_usedTrks) // const_cast is used.
 {
    ATH_MSG_DEBUG( "Entering loopOverConversions." );
 
@@ -270,7 +270,7 @@ loopOverConversions(std::vector<Trk::Track*> &v_usedTrks)
 	  const xAOD::TrackParticle* trkTag = *tp_elem;
 	  if(!trkTag) continue;
 	  i++;
-	  v_usedTrks.push_back( (Trk::Track*)trkTag->track() );
+	  v_usedTrks.push_back( const_cast<Trk::Track*>(trkTag->track()) );
 
 	  if(!m_doElectronMon) continue;
 	  //Vertex cuts
@@ -300,7 +300,7 @@ loopOverConversions(std::vector<Trk::Track*> &v_usedTrks)
 
 void
 TRT_Electron_Monitoring_Tool::
-loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks)
+loopOverRecElectrons ATLAS_NOT_THREAD_SAFE (std::vector<Trk::Track*> &v_usedTrks) // const_cast is used.
 {
    ATH_MSG_DEBUG( "Entering loopOverRecElectrons." );
   if(!m_doRecElectrons) return;
@@ -314,7 +314,7 @@ loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks)
       const Trk::Track *trk = trkP->track();
       const bool matched = (std::find(v_usedTrks.begin(), v_usedTrks.end(), trk) != v_usedTrks.end());
       if(matched) continue;
-      v_usedTrks.push_back( (Trk::Track*)trk );
+      v_usedTrks.push_back( const_cast<Trk::Track*>(trk) );
       m_tEl.N++;
       if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, electron_mass, PCAND_EL )){
 	      ATH_MSG_DEBUG( "fillStructHistograms failed!" );
@@ -329,7 +329,7 @@ loopOverRecElectrons(std::vector<Trk::Track*> &v_usedTrks)
 }//loopOverRecElectrons
 
 void
-TRT_Electron_Monitoring_Tool::loopOverMuons(std::vector<Trk::Track*> &v_usedTrks)
+TRT_Electron_Monitoring_Tool::loopOverMuons ATLAS_NOT_THREAD_SAFE (std::vector<Trk::Track*> &v_usedTrks) // const_cast is used.
 {
    ATH_MSG_DEBUG( "Entering loopOverMuons." );
   if(!m_doMuonMon) return;
@@ -342,7 +342,7 @@ TRT_Electron_Monitoring_Tool::loopOverMuons(std::vector<Trk::Track*> &v_usedTrks
       const xAOD::TrackParticle* trkP = p_Muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
       if(!trkP) continue;
       const Trk::Track *trk = trkP->track();
-      v_usedTrks.push_back( (Trk::Track*)trk );
+      v_usedTrks.push_back( const_cast<Trk::Track*>(trk) );
       m_tMu.N++;
       if(!fillAllHistograms( (xAOD::TrackParticle*)trkP, muon_mass, PCAND_MU )){
 	      ATH_MSG_DEBUG( "fillStructHistograms failed!" );
@@ -357,7 +357,7 @@ TRT_Electron_Monitoring_Tool::loopOverMuons(std::vector<Trk::Track*> &v_usedTrks
 }//loopOverMuons
 
 void
-TRT_Electron_Monitoring_Tool::loopOverTracks(std::vector<Trk::Track*> &v_usedTrks)
+TRT_Electron_Monitoring_Tool::loopOverTracks ATLAS_NOT_THREAD_SAFE (std::vector<Trk::Track*> &v_usedTrks) // const_cast is used.
 {
    ATH_MSG_DEBUG( "Entering loopOverTracks." );
   if(!m_doTracksMon) return;
@@ -365,10 +365,10 @@ TRT_Electron_Monitoring_Tool::loopOverTracks(std::vector<Trk::Track*> &v_usedTrk
   {
    for(const auto* tp : *m_trkpCollection)
     {
-      fillAllHistograms((xAOD::TrackParticle*)tp);
-      if(!pionQualityCuts((xAOD::TrackParticle*)tp,v_usedTrks)) continue;
+      fillAllHistograms(const_cast<xAOD::TrackParticle*>(tp));
+      if(!pionQualityCuts(const_cast<xAOD::TrackParticle*>(tp),v_usedTrks)) continue;
       m_tPi.N++;
-      if(!fillAllHistograms((xAOD::TrackParticle*)tp, pion_mass, PCAND_PI ))
+      if(!fillAllHistograms(const_cast<xAOD::TrackParticle*>(tp), pion_mass, PCAND_PI ))
       {
 	     ATH_MSG_DEBUG( "fillStructHistograms failed!" );
       }
@@ -476,7 +476,7 @@ TRT_Electron_Monitoring_Tool::pionQualityCuts(xAOD::TrackParticle *trkP,std::vec
 
 bool
 TRT_Electron_Monitoring_Tool::
-fillAllHistograms(xAOD::TrackParticle *trkP, float mass, int PCand){
+fillAllHistograms ATLAS_NOT_THREAD_SAFE (xAOD::TrackParticle *trkP, float mass, int PCand){ // CLHEP::HepLorentzVector::isLightlike() uses a static variable.
   uint8_t dummy(255);
   int nPix = trkP->summaryValue(dummy,xAOD::numberOfPixelHits)?dummy:-1;
   int nSCT = trkP->summaryValue(dummy,xAOD::numberOfSCTHits)?dummy:-1;
-- 
GitLab


From 45681a7bf41020d75cc10056b1ebc16b94a5780d Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 12:07:40 +0200
Subject: [PATCH 009/217] TrigInDetTrackFitter: Package cleanup

- delete unused `ITrigL2TrackFittingTool` interface
- delete unused `TrigL2FastExtrapolationTool`
- delete unused python module
- cmake cleanup
- move all headers to src directory
---
 .../TrigInDetTrackFitter/CMakeLists.txt       |  32 +-
 .../ITrigL2FastExtrapolationTool.h            |  38 --
 .../ITrigL2TrackFittingTool.h                 |  37 --
 .../TrigL2FastExtrapolationTool.h             |  38 --
 .../TrigInDetTrackFitter/doc/packagedoc.h     |  40 --
 .../python/TrigInDetTrackFitter_Config.py     | 106 ----
 .../src/TrigDkfTrackMakerTool.cxx             |   2 +-
 .../TrigDkfTrackMakerTool.h                   |   0
 .../src/TrigInDetBremDetectionTool.cxx        |   2 +-
 .../TrigInDetBremDetectionTool.h              |   0
 .../src/TrigInDetTrackFitter.cxx              |   2 +-
 .../TrigInDetTrackFitter.h                    |   0
 .../src/TrigL2FastExtrapolationTool.cxx       | 530 ------------------
 .../src/TrigL2ResidualCalculator.cxx          |   2 +-
 .../TrigL2ResidualCalculator.h                |   0
 .../TrigInDetTrackFitter_entries.cxx          |  12 +-
 16 files changed, 9 insertions(+), 832 deletions(-)
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2TrackFittingTool.h
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/doc/packagedoc.h
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
 rename Trigger/TrigTools/TrigInDetTrackFitter/{TrigInDetTrackFitter => src}/TrigDkfTrackMakerTool.h (100%)
 rename Trigger/TrigTools/TrigInDetTrackFitter/{TrigInDetTrackFitter => src}/TrigInDetBremDetectionTool.h (100%)
 mode change 100755 => 100644 Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx
 rename Trigger/TrigTools/TrigInDetTrackFitter/{TrigInDetTrackFitter => src}/TrigInDetTrackFitter.h (100%)
 mode change 100755 => 100644
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2FastExtrapolationTool.cxx
 rename Trigger/TrigTools/TrigInDetTrackFitter/{TrigInDetTrackFitter => src}/TrigL2ResidualCalculator.h (100%)

diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt b/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt
index 52ac0b5daafe..db7bb728f829 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt
@@ -1,40 +1,10 @@
-################################################################################
-# Package: TrigInDetTrackFitter
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetTrackFitter )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          MagneticField/MagFieldInterfaces
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkExtrapolation/TrkExInterfaces
-                          Tracking/TrkFitter/TrkDistributedKalmanFilter
-                          Tracking/TrkFitter/TrkFitterInterfaces
-                          Tracking/TrkTools/TrkToolInterfaces
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          PRIVATE
-                          DetectorDescription/AtlasDetDescr
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkPrepRawData
-                          Tracking/TrkEvent/TrkRIO_OnTrack
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # Component(s) in the package:
 atlas_add_component( TrigInDetTrackFitter
                      src/*.cxx
                      src/components/*.cxx
                      LINK_LIBRARIES AthenaBaseComps AtlasDetDescr GaudiKernel InDetIdentifier InDetPrepRawData InDetRIO_OnTrack MagFieldInterfaces StoreGateLib TrigInDetEvent TrigInDetToolInterfacesLib TrkDistributedKalmanFilterLib TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack TrkSurfaces TrkToolInterfaces TrkTrack )
-
-# Install files from the package:
-atlas_install_headers( TrigInDetTrackFitter )
-atlas_install_python_modules( python/*.py )
-
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h
deleted file mode 100644
index 906b53eff120..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __ITRIG_L2_FAST_EXTRAPOLATION_TOOL_H__
-#define __ITRIG_L2_FAST_EXTRAPOLATION_TOOL_H__
-
-#include "GaudiKernel/IAlgTool.h"
-#include <vector>
-
-namespace Trk {
-    class TrkPlanarSurface;
-    class TrkTrackState;
-}
-
-static const InterfaceID IID_ITrigL2FastExtrapolationTool("ITrigL2FastExtrapolationTool",1,0);
-
-
-  /** @class ITrigL2FastExtrapolationTool
-
-      provides the abstract interface for a track extrapolation tool used by TrigInDetTrackFitter
-
-      @author D.Emeliyanov <http://consult.cern.ch/xwho>
-  */
-
-  class ITrigL2FastExtrapolationTool : virtual public IAlgTool {
-
-  public:
-    /** other standard AlgTool methods */
-
-    static const InterfaceID& interfaceID ()   //!< the Tool's interface
-      {  return IID_ITrigL2FastExtrapolationTool; }  	
-    virtual Trk::TrkTrackState* extrapolate(Trk::TrkTrackState*,
-					    Trk::TrkPlanarSurface*,
-					    Trk::TrkPlanarSurface*, bool) = 0;
-  };
-
-#endif
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2TrackFittingTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2TrackFittingTool.h
deleted file mode 100644
index 01f66862c081..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/ITrigL2TrackFittingTool.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __ITRIG_L2_TRACK_FITTING_TOOL_H__
-#define __ITRIG_L2_TRACK_FITTING_TOOL_H__
-
-#include "GaudiKernel/IAlgTool.h"
-#include <vector>
-
-namespace Trk {
-    class TrkBaseNode;
-    class TrkTrackState;
-}
-
-static const InterfaceID IID_ITrigL2TrackFittingTool("ITrigL2TrackFittingTool",1,0);
-
-
-  /** @class ITrigL2TrackFittingTool
-
-      provides the abstract interface for track fitting tools used by TrigInDetTrackFitter
-
-      @author D.Emeliyanov <http://consult.cern.ch/xwho>
-  */
-
-  class ITrigL2TrackFittingTool : virtual public IAlgTool { 
-
-  public:
-    /** other standard AlgTool methods */
-
-    static const InterfaceID& interfaceID ()   //!< the Tool's interface
-      {  return IID_ITrigL2TrackFittingTool; }  	
-
-    virtual Trk::TrkTrackState* fit(Trk::TrkTrackState*, std::vector<Trk::TrkBaseNode*>&, bool) = 0;
-  };
-
-#endif
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h
deleted file mode 100644
index 47bbc0e07ae1..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __TRIG_L2_FAST_EXTRAPOLATION_TOOL_H__
-#define __TRIG_L2_FAST_EXTRAPOLATION_TOOL_H__
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-
-#include "TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h"
-
-namespace Trk {	
-  class TrkTrackState;      
-  class TrkPlanarSurface;
-}
-namespace MagField {	
-	class IMagFieldSvc;
-}
-
-class TrigL2FastExtrapolationTool: public AthAlgTool, virtual public ITrigL2FastExtrapolationTool
-{
- public:
-  TrigL2FastExtrapolationTool( const std::string&, const std::string&, const IInterface* );
-  virtual ~TrigL2FastExtrapolationTool(){};
-  virtual StatusCode initialize();
-  virtual StatusCode finalize  ();
-  Trk::TrkTrackState* extrapolate(Trk::TrkTrackState*, 
-				  Trk::TrkPlanarSurface*,
-				  Trk::TrkPlanarSurface*, bool smooth=false);
-private:
-  void matrixInversion5x5(double a[5][5]);
-  void getMagneticField(double[3],double*);
-  ServiceHandle<MagField::IMagFieldSvc> m_MagFieldSvc;
-};
-
-#endif
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/doc/packagedoc.h b/Trigger/TrigTools/TrigInDetTrackFitter/doc/packagedoc.h
deleted file mode 100644
index c2fefbff0d64..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/doc/packagedoc.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-
-@page TrigInDetTrackFitter_page TrigInDetTrackFitter Package
-
-This package contains implementations of various track fitting tools for the LVL ID 
-tracking. All these tools are based on the same abstract interface: ITrigInDetTrackFitter.  
-
-@author Dmitry.Emeliyanov@cern.ch
-
-@section TrigInDetTrackFitter_TrigInDetTrackFitIntro Introduction
-
-The list of track fitting tools is below:
-
-   - TrigInDetTrackFitter - a default track fitter for TrigIDSCAN
-   - TrigInDetPerigeeFitter - a fast fitter which estimates only track perigee parameters and 
-uses TrigSiSpacePoints directly, i.e. without dissolving them into clusters. 
-   - TrigInDetKarimakiFitter - a track fitter for TrigSiTrack
-   - TrigInDetSctKFitter - an old fitter based on Sijin QIAN's code
-
-@section TrigInDetTrackFitter_TrigInDetTrackFitOverview Overview
-
-The fitting tools make use of the following abstract interface 
-
-   - ITrigInDetTrackFitter
-
-This interface contains method 
-
-void fit(TrigInDetTrackCollection* recoTracks )
-
-where recoTracks is a collection (vector) of TrigInDetTrack tracks. A track fitter updates parameters 
-of the input tracks so that no new tracks are created. 
-
-*/  
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py b/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
deleted file mode 100644
index 465eeb1a1dca..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/python/TrigInDetTrackFitter_Config.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
-
-
-from TrkExTools.TrkExToolsConf import Trk__Extrapolator
-
-class ConfiguredTrigL2_Extrapolator(Trk__Extrapolator) :
-    __slots__ = []
-    def __init__(self, name = 'ConfiguredTrigL2_Extrapolator') :
-        Trk__Extrapolator.__init__(self, name)
-        from AthenaCommon.AppMgr import ToolSvc
-        from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc
-
-        from InDetRecExample.TrackingCommon import createAndAddCondAlg, getRIO_OnTrackErrorScalingCondAlg
-        createAndAddCondAlg(getRIO_OnTrackErrorScalingCondAlg,'RIO_OnTrackErrorScalingCondAlg')
-        
-        from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator
-        TrigL2_StepPropagator = Trk__STEP_Propagator(name = 'TrigL2_StepPropagator')
-        ToolSvc += TrigL2_StepPropagator
-        from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator
-        TrigL2_RKPropagator = Trk__RungeKuttaPropagator(name = 'TrigL2_RKPropagator')
-        ToolSvc += TrigL2_RKPropagator
-        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
-        if InDetTrigFlags.propagatorType() is "STEP":
-            TrigL2_Propagator = TrigL2_StepPropagator
-        else:
-            TrigL2_Propagator = TrigL2_RKPropagator
-        
-        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-        AtlasTrackingGeometrySvc  = svcMgr.AtlasTrackingGeometrySvc
-        from TrkExTools.TrkExToolsConf import Trk__Navigator
-        TrigL2_Navigator = Trk__Navigator(name = 'TrigL2_Navigator',TrackingGeometrySvc = AtlasTrackingGeometrySvc)
-        ToolSvc += TrigL2_Navigator
-        from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator
-        TrigL2_MaterialUpdator = Trk__MaterialEffectsUpdator(name = "TrigL2_MaterialEffectsUpdator")
-        ToolSvc += TrigL2_MaterialUpdator
-        TrigL2_SubPropagators = []
-        TrigL2_SubUpdators = []
-        TrigL2_SubPropagators += [ TrigL2_Propagator.name() ]
-        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
-        TrigL2_SubPropagators += [ TrigL2_Propagator.name() ]
-        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
-        TrigL2_SubPropagators += [ TrigL2_StepPropagator.name() ]
-        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
-        self.Propagators             = [ TrigL2_RKPropagator, TrigL2_StepPropagator]
-        self.MaterialEffectsUpdators = [ TrigL2_MaterialUpdator ]
-        self.Navigator               = TrigL2_Navigator
-        self.SubPropagators          = TrigL2_SubPropagators
-        self.SubMEUpdators           = TrigL2_SubUpdators
-        #self.DoCaloDynamic           = False #Obsolete
-
-
-
-
-from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator
-
-class ConfiguredTrigL2_InDetRotCreator(Trk__RIO_OnTrackCreator) :
-    __slots__ = []
-    def __init__(self, name = 'ConfiguredTrigL2_InDetRotCreator') :
-        Trk__RIO_OnTrackCreator.__init__(self,name)
-        from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool
-        from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool
-        from InDetTrigRecExample.InDetTrigConditionsAccess import PixelConditionsSetup
-        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
-        
-        # SiLorentzAngleTool
-        from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup
-        sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup()
-
-        if InDetTrigFlags.doCommissioning() :
-            myL2_SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool("TrigL2_SCT_ClusterOnTrackTool",
-                                                                        CorrectionStrategy = 0,
-                                                                        ErrorStrategy      = 0,
-                                                                        LorentzAngleTool   = sctLorentzAngleToolSetup.SCTLorentzAngleTool)
-            myL2_PixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("TrigL2_PixelClusterOnTrackTool",
-                                                                          ErrorStrategy = 0,
-                                                                          LorentzAngleTool = ToolSvc.InDetTrigPixelLorentzAngleTool)
-
-        else:
-            myL2_SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool("TrigL2_SCT_ClusterOnTrackTool",
-                                                                        CorrectionStrategy = 0,
-                                                                        ErrorStrategy      = 2,
-                                                                        LorentzAngleTool   = sctLorentzAngleToolSetup.SCTLorentzAngleTool)
-            myL2_PixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("TrigL2_PixelClusterOnTrackTool",
-                                                                          ErrorStrategy = 1,
-                                                                          LorentzAngleTool = ToolSvc.InDetTrigPixelLorentzAngleTool)
-
-                    
-        from AthenaCommon.AppMgr import ToolSvc
-        ToolSvc += myL2_PixelClusterOnTrackTool
-        ToolSvc += myL2_SCT_ClusterOnTrackTool        
-        self.Mode='indet'
-        self.ToolPixelCluster = myL2_PixelClusterOnTrackTool
-        self.ToolSCT_Cluster = myL2_SCT_ClusterOnTrackTool
-
-
-
-        
-
-
-
-
-
-
-
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx
index 3568612e0a86..19a99547021b 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx
@@ -23,7 +23,7 @@
 #include "InDetRIO_OnTrack/PixelClusterOnTrack.h"
 
 #include "TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h"
-#include "TrigInDetTrackFitter/TrigDkfTrackMakerTool.h"
+#include "TrigDkfTrackMakerTool.h"
 #include "TrkSurfaces/Surface.h"
 #include "TrkSurfaces/TrapezoidBounds.h"
 #include "AthenaBaseComps/AthMsgStreamMacros.h"
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.h
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h
rename to Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.h
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
index 0a5f25dacc99..52ec78b7d221 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
@@ -15,7 +15,7 @@
 #include "TrkDistributedKalmanFilter/TrkFilteringNodes.h"
 #include "TrkDistributedKalmanFilter/TrkTrackState.h"
 #include "TrkDistributedKalmanFilter/TrkPlanarSurface.h"
-#include "TrigInDetTrackFitter/TrigInDetBremDetectionTool.h"
+#include "TrigInDetBremDetectionTool.h"
 #include "AthenaBaseComps/AthMsgStreamMacros.h"
 #include <cmath>
 #include <cstring>
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigInDetBremDetectionTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigInDetBremDetectionTool.h
rename to Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx
old mode 100755
new mode 100644
index b866fe0d2ffa..64b117ebe1e2
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx
@@ -36,7 +36,7 @@
 #include "TrkDistributedKalmanFilter/TrkPlanarSurface.h"
 
 #include "TrigInDetToolInterfaces/ITrigInDetTrackFitter.h"
-#include "TrigInDetTrackFitter/TrigInDetTrackFitter.h"
+#include "TrigInDetTrackFitter.h"
 #include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
 #include "AthenaBaseComps/AthMsgStreamMacros.h"
 #include "AthenaBaseComps/AthCheckMacros.h"
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigInDetTrackFitter.h b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigInDetTrackFitter.h
rename to Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.h
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2FastExtrapolationTool.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2FastExtrapolationTool.cxx
deleted file mode 100644
index 8e46e03e02b9..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2FastExtrapolationTool.cxx
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// TrigL2FastExtrapolationTool tool
-// -------------------------------
-// ATLAS Collaboration
-//
-// 01.09.2005 Package created
-//
-// Author: Dmitry Emeliyanov, RAL
-// e-mail: D.Emeliyanov@rl.ac.uk
-//
-////////////////////////////////////////////////////////////////////////////////
-
-#include <cmath>
-#include <iostream>
-#include "TrkDistributedKalmanFilter/TrkTrackState.h"
-#include "TrkDistributedKalmanFilter/TrkPlanarSurface.h"
-#include "MagFieldInterfaces/IMagFieldSvc.h"
-#include "AthenaBaseComps/AthMsgStreamMacros.h"
-
-#include "TrigInDetTrackFitter/ITrigL2FastExtrapolationTool.h"
-#include "TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h"
-#include "GaudiKernel/SystemOfUnits.h"
-
-TrigL2FastExtrapolationTool::TrigL2FastExtrapolationTool(const std::string& t, 
-					   const std::string& n,
-					   const IInterface*  p ): 
-  AthAlgTool(t,n,p),
-  m_MagFieldSvc("AtlasFieldSvc",this->name())
-{
-  declareInterface< ITrigL2FastExtrapolationTool >( this );
-}
-
-StatusCode TrigL2FastExtrapolationTool::initialize()
-{
-  StatusCode sc = AthAlgTool::initialize();
-  MsgStream athenaLog(msgSvc(), name());
-   
-	ATH_MSG_INFO("Using Athena magnetic field service");
-	sc = m_MagFieldSvc.retrieve();
-	if(sc.isFailure()) 
-	{
-		ATH_MSG_ERROR("Unable to retrieve Athena MagFieldService");
-		return StatusCode::FAILURE;
-	}
-  ATH_MSG_INFO("TrigL2FastExtrapolationTool initialized ");
-  return sc;
-}
-
-StatusCode TrigL2FastExtrapolationTool::finalize()
-{
-  StatusCode sc = AthAlgTool::finalize(); 
-  return sc;
-}
-
-
-void TrigL2FastExtrapolationTool::getMagneticField(double r[3],double* B)
-{
-  B[0]=0.0;B[1]=0.0;B[2]=0.0;
-	double field[3];
-	m_MagFieldSvc->getField(r,field);//field is returned in kT
-	for(int i=0;i<3;i++) B[i]=field[i]/Gaudi::Units::kilogauss;//convert to kG
-}
-
-Trk::TrkTrackState* TrigL2FastExtrapolationTool::extrapolate(Trk::TrkTrackState* pTS, 
-							     Trk::TrkPlanarSurface* pSB,
-							     Trk::TrkPlanarSurface* pSE,
-							     bool smooth)
-{
-  const double C=0.02999975;
-  const double minStep=30.0;
-	  
-  double sint,cost,sinf,cosf;
-  double gP[3],gPi[3],lP[3],gV[3],a,b,c,s,J0[7][5],Rf[5],descr,CQ,Ac,Av,Cc;
-  double V[3],P[3],M[3][3],AG[5][5],D[4],J[5][5],Jm[7][7],Gf[5][5],
-    J1[5][7],gB[3],gBi[3],gBf[3],dBds[3],Buf[5][7],DVx,DVy,DVz;
-  int i,j,m,nStep,nStepMax;
-  double sl,ds,path=0.0;
-
-
-  bool samePlane=false;
-
-  if(pSB!=NULL)
-    {   
-      double diff=0.0;
-      for(i=0;i<4;i++) diff+=fabs(pSE->getPar(i)-pSB->getPar(i));
-      if(diff<1e-5) {
-	samePlane=true;	
-	//(m_fitStats[m_algorithmId]).m_fitErrors[0]++;
-	//std::cout<<"Starting plane and target plane are the same !"<<std::endl;
-      }
-    }
-
-  if(!samePlane) {
-
-    //m_numericalJacobian(pTS,pSB,pSE,J);
-
-    sint=sin(pTS->getTrackState(3));cosf=cos(pTS->getTrackState(2));
-    sinf=sin(pTS->getTrackState(2));cost=cos(pTS->getTrackState(3));
-    gV[0]=sint*cosf;gV[1]=sint*sinf;gV[2]=cost;CQ=C*pTS->getTrackState(4);
-
-    memset(&J0[0][0],0,sizeof(J0));
-    
-    if(pSB!=NULL)
-      {
-	double L[3][3];
-	lP[0]=pTS->getTrackState(0);lP[1]=pTS->getTrackState(1);lP[2]=0.0;
-	pSB->transformPointToGlobal(lP,gP);
-	for(i=0;i<3;i++) for(j=0;j<3;j++) L[i][j]=pSB->getInvRotMatrix(i,j);
-	
-	J0[0][0]=L[0][0];J0[0][1]=L[0][1];
-	J0[1][0]=L[1][0];J0[1][1]=L[1][1];
-	J0[2][0]=L[2][0];J0[2][1]=L[2][1];
-	J0[3][2]=-sinf*sint;J0[3][3]=cosf*cost;
-	J0[4][2]= cosf*sint;J0[4][3]=sinf*cost;
-	J0[5][3]=-sint;
-	J0[6][4]=1.0;
-      }
-    else
-      {
-	gP[0]=-pTS->getTrackState(0)*sinf;
-	gP[1]= pTS->getTrackState(0)*cosf;
-	gP[2]= pTS->getTrackState(1);
-	J0[0][0]=-sinf;J0[0][2]=-pTS->getTrackState(0)*cosf;
-	J0[1][0]= cosf;J0[1][2]=-pTS->getTrackState(0)*sinf;
-	J0[2][1]=1.0;
-	J0[3][2]=-sinf*sint;J0[3][3]=cosf*cost;
-	J0[4][2]= cosf*sint;J0[4][3]=sinf*cost;
-	J0[5][3]=-sint;
-	J0[6][4]=1.0;
-      }
-    for(i=0;i<4;i++) D[i]=pSE->getPar(i);
-    for(i=0;i<3;i++) gPi[i]=gP[i];
-    
-    getMagneticField(gP,gB);
-    
-    for(i=0;i<3;i++) gBi[i]=gB[i];
-    
-    c=D[0]*gP[0]+D[1]*gP[1]+D[2]*gP[2]+D[3];
-    b=D[0]*gV[0]+D[1]*gV[1]+D[2]*gV[2];
-    a=0.5*CQ*(gB[0]*(D[1]*gV[2]-D[2]*gV[1])+
-	      gB[1]*(D[2]*gV[0]-D[0]*gV[2])+
-	      gB[2]*(D[0]*gV[1]-D[1]*gV[0]));
-    
-    descr=b*b-4.0*a*c;
-    
-    if(descr<0.0) 
-      {
-	//      printf("D<0 - extrapolation failed\n");
-	return NULL;
-      }
-    
-    bool useExpansion=true;
-    double ratio = 4*a*c/(b*b);
-    
-    if(fabs(ratio)>0.1) 
-      useExpansion = false;
-    
-    if(useExpansion) {
-      sl=-c/b;
-      sl=sl*(1-a*sl/b);
-    }
-    else {
-      int signb = (b<0.0)?-1:1;
-      sl = (-b+signb*sqrt(descr))/(2*a);
-    }
-    
-    if(fabs(sl)<minStep) nStepMax=1;
-    else
-      {
-	nStepMax=(int)(fabs(sl)/minStep)+1;
-      }
-    if((nStepMax<0)||(nStepMax>1000))
-      {
-	return NULL;
-      } 
-    Av=sl*CQ;
-    Ac=0.5*sl*Av;
-    DVx=gV[1]*gB[2]-gV[2]*gB[1];
-    DVy=gV[2]*gB[0]-gV[0]*gB[2];
-    DVz=gV[0]*gB[1]-gV[1]*gB[0];
-    
-    P[0]=gP[0]+gV[0]*sl+Ac*DVx;
-    P[1]=gP[1]+gV[1]*sl+Ac*DVy;
-    P[2]=gP[2]+gV[2]*sl+Ac*DVz;
-    V[0]=gV[0]+Av*DVx;
-    V[1]=gV[1]+Av*DVy;
-    V[2]=gV[2]+Av*DVz;
-  
-    getMagneticField(P,gB);
-    
-    for(i=0;i<3;i++) gBf[i]=gB[i];
-    for(i=0;i<3;i++)
-      {
-	dBds[i]=(gBf[i]-gBi[i])/sl;
-	gB[i]=gBi[i];
-      }
-    nStep=nStepMax;path=0.0;
-    while(nStep>0)
-      {
-	c=D[0]*gP[0]+D[1]*gP[1]+D[2]*gP[2]+D[3];
-	b=D[0]*gV[0]+D[1]*gV[1]+D[2]*gV[2];
-	a=0.5*CQ*(gB[0]*(D[1]*gV[2]-D[2]*gV[1])+
-		  gB[1]*(D[2]*gV[0]-D[0]*gV[2])+
-		  gB[2]*(D[0]*gV[1]-D[1]*gV[0]));
-	
-	ratio = 4*a*c/(b*b);
-	if(fabs(ratio)>0.1) 
-	  useExpansion = false;
-	else useExpansion = true;
-	
-	if(useExpansion) {
-	  sl=-c/b;
-	  sl=sl*(1-a*sl/b);
-	}
-	else {
-	  descr=b*b-4.0*a*c;
-	  if(descr<0.0) 
-	    {
-	      // printf("D<0 - extrapolation failed\n");
-	      return NULL;
-	    }
-	  int signb = (b<0.0)?-1:1;
-	  sl = (-b+signb*sqrt(descr))/(2*a);
-	}
-	
-	ds=sl/nStep;path+=ds;
-	Av=ds*CQ;
-	Ac=0.5*ds*Av;
-	DVx=gV[1]*gB[2]-gV[2]*gB[1];
-	DVy=gV[2]*gB[0]-gV[0]*gB[2];
-	DVz=gV[0]*gB[1]-gV[1]*gB[0];
-	
-	P[0]=gP[0]+gV[0]*ds+Ac*DVx;
-	P[1]=gP[1]+gV[1]*ds+Ac*DVy;
-	P[2]=gP[2]+gV[2]*ds+Ac*DVz;
-	V[0]=gV[0]+Av*DVx;
-	V[1]=gV[1]+Av*DVy;
-	V[2]=gV[2]+Av*DVz;
-	for(i=0;i<3;i++) 
-	  {
-	    gV[i]=V[i];gP[i]=P[i];
-	  }
-	for(i=0;i<3;i++) gB[i]+=dBds[i]*ds;
-	nStep--;
-      }
-    pSE->transformPointToLocal(gP,lP);
-    Rf[0]=lP[0];Rf[1]=lP[1];
-    Rf[2]=atan2(V[1],V[0]);
-
-    if(fabs(V[2])>1.0) return NULL;
-
-    Rf[3]=acos(V[2]);
-    Rf[4]=pTS->getTrackState(4);
-
-    gV[0]=sint*cosf;gV[1]=sint*sinf;gV[2]=cost;
-
-    for(i=0;i<4;i++) D[i]=pSE->getPar(i);
-    for(i=0;i<3;i++) gP[i]=gPi[i];
-    
-    for(i=0;i<3;i++)
-      {
-	gB[i]=0.5*(gBi[i]+gBf[i]);
-      }
-    
-    c=D[0]*gP[0]+D[1]*gP[1]+D[2]*gP[2]+D[3];
-    b=D[0]*gV[0]+D[1]*gV[1]+D[2]*gV[2];
-    a=CQ*(gB[0]*(D[1]*gV[2]-D[2]*gV[1])+
-	  gB[1]*(D[2]*gV[0]-D[0]*gV[2])+
-	  gB[2]*(D[0]*gV[1]-D[1]*gV[0]));
-    
-  ratio = 4*a*c/(b*b);
-  if(fabs(ratio)>0.1) 
-    useExpansion = false;
-  else useExpansion = true;
-
-  if(useExpansion) {
-    s=-c/b;
-    s=s*(1-a*sl/b);
-  }
-  else {
-    descr=b*b-4.0*a*c;
-    if(descr<0.0) 
-      {
-	// printf("D<0 - extrapolation failed\n");
-	return NULL;
-      }
-    int signb = (b<0.0)?-1:1;
-    s = (-b+signb*sqrt(descr))/(2*a);
-  }
-
-  Av=s*CQ;
-  Ac=0.5*s*Av;
-  Cc=0.5*s*s*C;
-
-  DVx=gV[1]*gB[2]-gV[2]*gB[1];
-  DVy=gV[2]*gB[0]-gV[0]*gB[2];
-  DVz=gV[0]*gB[1]-gV[1]*gB[0];
-
-  P[0]=gP[0]+gV[0]*s+Ac*DVx;
-  P[1]=gP[1]+gV[1]*s+Ac*DVy;
-  P[2]=gP[2]+gV[2]*s+Ac*DVz;
-
-  V[0]=gV[0]+Av*DVx;V[1]=gV[1]+Av*DVy;V[2]=gV[2]+Av*DVz;
-
-  pSE->transformPointToLocal(P,lP);
-  
-  memset(&Jm[0][0],0,sizeof(Jm));
-
-  for(i=0;i<3;i++) for(j=0;j<3;j++) M[i][j]=pSE->getRotMatrix(i,j);
-  
-  double coeff[3], dadVx,dadVy,dadVz,dadQ,dsdx,dsdy,dsdz,dsdVx,dsdVy,dsdVz,dsdQ;
-  coeff[0]=-c*c/(b*b*b);
-  coeff[1]=c*(1.0+3.0*c*a/(b*b))/(b*b);
-  coeff[2]=-(1.0+2.0*c*a/(b*b))/b;
-
-  dadVx=0.5*CQ*(-D[1]*gB[2]+D[2]*gB[1]);
-  dadVy=0.5*CQ*( D[0]*gB[2]-D[2]*gB[0]);
-  dadVz=0.5*CQ*(-D[0]*gB[1]+D[1]*gB[0]);
-  dadQ=0.5*C*(D[0]*DVx+D[1]*DVy+D[2]*DVz);
-  
-  dsdx=coeff[2]*D[0];
-  dsdy=coeff[2]*D[1];
-  dsdz=coeff[2]*D[2];
-  dsdVx=coeff[0]*dadVx+coeff[1]*D[0];
-  dsdVy=coeff[0]*dadVy+coeff[1]*D[1];
-  dsdVz=coeff[0]*dadVz+coeff[1]*D[2];
-  dsdQ=coeff[0]*dadQ;
-
-  Jm[0][0]=1.0+V[0]*dsdx;
-  Jm[0][1]=    V[0]*dsdy;
-  Jm[0][2]=    V[0]*dsdz;
-  
-  Jm[0][3]=  s+V[0]*dsdVx;
-  Jm[0][4]=    V[0]*dsdVy+Ac*gB[2];
-  Jm[0][5]=    V[0]*dsdVz-Ac*gB[1];
-  Jm[0][6]=    V[0]*dsdQ+Cc*DVx;
-
-  Jm[1][0]=    V[1]*dsdx;
-  Jm[1][1]=1.0+V[1]*dsdy;
-  Jm[1][2]=    V[1]*dsdz;
-
-  Jm[1][3]=    V[1]*dsdVx-Ac*gB[2];
-  Jm[1][4]=  s+V[1]*dsdVy;
-  Jm[1][5]=    V[1]*dsdVz+Ac*gB[0];
-  Jm[1][6]=    V[1]*dsdQ+Cc*DVy;
-  
-  Jm[2][0]=    V[2]*dsdx;
-  Jm[2][1]=    V[2]*dsdy;
-  Jm[2][2]=1.0+V[2]*dsdz;
-  Jm[2][3]=    V[2]*dsdVx+Ac*gB[1];
-  Jm[2][4]=    V[2]*dsdVy-Ac*gB[0];
-  Jm[2][5]=  s+V[2]*dsdVz;
-  Jm[2][6]=    V[2]*dsdQ+Cc*DVz;
-
-  Jm[3][0]=dsdx*CQ*DVx;
-  Jm[3][1]=dsdy*CQ*DVx;
-  Jm[3][2]=dsdz*CQ*DVx;
-  
-  Jm[3][3]=1.0+dsdVx*CQ*DVx;
-  Jm[3][4]=CQ*(dsdVy*DVx+s*gB[2]);
-  Jm[3][5]=CQ*(dsdVz*DVx-s*gB[1]);
-  
-  Jm[3][6]=(CQ*dsdQ+C*s)*DVx;
-  
-  Jm[4][0]=dsdx*CQ*DVy;
-  Jm[4][1]=dsdy*CQ*DVy;
-  Jm[4][2]=dsdz*CQ*DVy;
-
-  Jm[4][3]=CQ*(dsdVx*DVy-s*gB[2]);
-  Jm[4][4]=1.0+dsdVy*CQ*DVy;
-  Jm[4][5]=CQ*(dsdVz*DVy+s*gB[0]);
-  
-  Jm[4][6]=(CQ*dsdQ+C*s)*DVy;
-  
-  Jm[5][0]=dsdx*CQ*DVz;
-  Jm[5][1]=dsdy*CQ*DVz;
-  Jm[5][2]=dsdz*CQ*DVz;
-  Jm[5][3]=CQ*(dsdVx*DVz+s*gB[1]);
-  Jm[5][4]=CQ*(dsdVy*DVz-s*gB[0]);
-  Jm[5][5]=1.0+dsdVz*CQ*DVz;
-  Jm[5][6]=(CQ*dsdQ+C*s)*DVz;
-  
-  Jm[6][6]=1.0;
-  
-  memset(&J1[0][0],0,sizeof(J1));
-
-  J1[0][0]=M[0][0];J1[0][1]=M[0][1];J1[0][2]=M[0][2];
-  J1[1][0]=M[1][0];J1[1][1]=M[1][1];J1[1][2]=M[1][2];
-  J1[2][3]=-V[1]/(V[0]*V[0]+V[1]*V[1]);
-  J1[2][4]= V[0]/(V[0]*V[0]+V[1]*V[1]);
-  J1[3][5]=-1.0/sqrt(1-V[2]*V[2]);
-  J1[4][6]=1.0;
-
-  for(i=0;i<7;i++)
-    {
-      for(j=0;j<2;j++)
-	Buf[j][i]=J1[j][0]*Jm[0][i]+J1[j][1]*Jm[1][i]+J1[j][2]*Jm[2][i];
-      Buf[2][i]=J1[2][3]*Jm[3][i]+J1[2][4]*Jm[4][i];
-      Buf[3][i]=J1[3][5]*Jm[5][i];
-      Buf[4][i]=Jm[6][i];
-    }
-  
-   if(pSB!=NULL)
-     {
-       for(i=0;i<5;i++)
-	 {
-	   J[i][0]=Buf[i][0]*J0[0][0]+Buf[i][1]*J0[1][0]+Buf[i][2]*J0[2][0];
-	   J[i][1]=Buf[i][0]*J0[0][1]+Buf[i][1]*J0[1][1]+Buf[i][2]*J0[2][1];
-	   J[i][2]=Buf[i][3]*J0[3][2]+Buf[i][4]*J0[4][2];
-	   J[i][3]=Buf[i][3]*J0[3][3]+Buf[i][4]*J0[4][3]+Buf[i][5]*J0[5][3];
-	   J[i][4]=Buf[i][6];
-	 }
-     }
-   else
-     {      
-       for(i=0;i<5;i++)
-	 {
-	   J[i][0]=Buf[i][0]*J0[0][0]+Buf[i][1]*J0[1][0];
-	   J[i][1]=Buf[i][2];
-	   J[i][2]=Buf[i][0]*J0[0][2]+Buf[i][1]*J0[1][2]+Buf[i][3]*J0[3][2]+Buf[i][4]*J0[4][2];
-	   J[i][3]=Buf[i][3]*J0[3][3]+Buf[i][4]*J0[4][3]+Buf[i][5]*J0[5][3];
-	   J[i][4]=Buf[i][6];
-	 }
-     }
-  }
-  else {
-    Rf[0]=pTS->getTrackState(0);
-    Rf[1]=pTS->getTrackState(1);	
-    Rf[2]=pTS->getTrackState(2);
-    Rf[3]=pTS->getTrackState(3);
-    Rf[4]=pTS->getTrackState(4);
-    memset(&J[0][0],0,sizeof(J));
-    for(i=0;i<5;i++) J[i][i]=1.0;
-  }
-
-  for(i=0;i<5;i++) for(j=0;j<5;j++)
-    {
-      AG[i][j]=0.0;for(m=0;m<5;m++) AG[i][j]+=J[i][m]*pTS->getTrackCovariance(m,j);
-    }
-  for(i=0;i<5;i++) for(j=i;j<5;j++)
-    {
-      Gf[i][j]=0.0;
-      for(m=0;m<5;m++) Gf[i][j]+=AG[i][m]*J[j][m];
-      Gf[j][i]=Gf[i][j];
-    }
-
-  Trk::TrkTrackState* pTE=new Trk::TrkTrackState(pTS);
-
-  pTE->setTrackState(Rf);
-  pTE->setTrackCovariance(Gf);
-  pTE->attachToSurface(pSE);
-  pTE->applyMaterialEffects();
-
-  if(smooth)
-    {
-      double A[5][5],Gi[5][5];
-      for(i=0;i<5;i++) for(j=0;j<5;j++)
-	{
-	  Gi[i][j]=pTE->getTrackCovariance(i,j);
-	}
-      matrixInversion5x5(Gi);
-      for(i=0;i<5;i++) for(j=0;j<5;j++)
-	{
-	  A[i][j]=0.0;
-	  for(m=0;m<5;m++) A[i][j]+=AG[m][i]*Gi[m][j];
-	}
-      pTE->setPreviousState(pTS);
-      pTE->setSmootherGain(A);
-    }
-
-  return pTE;
-}
-
-void TrigL2FastExtrapolationTool::matrixInversion5x5(double a[5][5])
-{
-  /**** 5x5 matrix inversion by Gaussian elimination ****/
-  int i,j,k,l;
-  double factor;
-  double temp[5];
-  double b[5][5];
-  // Set b to I
-
-  memset(&b[0][0],0,sizeof(b));
-  b[0][0]=1.0;b[1][1]=1.0;b[2][2]=1.0;b[3][3]=1.0;b[4][4]=1.0;
-  
-  for(i=0;i<5;i++)
-    {
-      for(j=i+1;j<5;j++)
-	if (fabs(a[i][i])<fabs(a[j][i]))
-	  {
-	    for(l=0;l<5;l++) temp[l]=a[i][l];
-	    for(l=0;l<5;l++) a[i][l]=a[j][l];
-	    for(l=0;l<5;l++) a[j][l]=temp[l];
-	    for(l=0;l<5;l++) temp[l]=b[i][l];
-	    for(l=0;l<5;l++) b[i][l]=b[j][l];
-	    for(l=0;l<5;l++) b[j][l]=temp[l];
-	  }
-      factor=a[i][i];
-      for(j=4;j>-1;j--) 
-	{
-	  b[i][j]/=factor;a[i][j]/=factor;
-	}
-      for(j=i+1;j<5;j++) 
-	{
-	  factor=-a[j][i];
-	  for(k=0;k<5;k++)
-	    {
-	      a[j][k]+=a[i][k]*factor;b[j][k]+=b[i][k]*factor;
-	    }
-	}
-    } 
-  for(i=4;i>0;i--)
-    {
-      for(j=i-1;j>-1;j--)
-	{
-	  factor=-a[j][i];
-	  for(k=0;k<5;k++)
-	    {
-	      a[j][k]+=a[i][k]*factor;b[j][k]+=b[i][k]*factor;
-	    }
-	}
-    }
-  for(i=0;i<5;i++) for(j=0;j<5;j++) a[i][j]=b[i][j];
-}
-
-
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.cxx
index ea5926827f4d..335c67e71b8d 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.cxx
@@ -39,7 +39,7 @@
 
 //#include "TrigInDetToolInterfaces/ITrigL2ResidualCalculator.h"
 #include "TrigInDetToolInterfaces/TrigL2HitResidual.h"
-#include "TrigInDetTrackFitter/TrigL2ResidualCalculator.h"
+#include "TrigL2ResidualCalculator.h"
 
 TrigL2ResidualCalculator::TrigL2ResidualCalculator(const std::string& t, 
 					   const std::string& n,
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2ResidualCalculator.h b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.h
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigL2ResidualCalculator.h
rename to Trigger/TrigTools/TrigInDetTrackFitter/src/TrigL2ResidualCalculator.h
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
index 5287a96f6695..d3cd7735a22a 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
@@ -1,13 +1,9 @@
-#include "TrigInDetTrackFitter/TrigInDetTrackFitter.h"
-#include "TrigInDetTrackFitter/TrigInDetBremDetectionTool.h"
-#include "TrigInDetTrackFitter/TrigDkfTrackMakerTool.h"
-#include "TrigInDetTrackFitter/TrigL2ResidualCalculator.h"
-#include "TrigInDetTrackFitter/TrigL2FastExtrapolationTool.h"
-
+#include "../TrigInDetTrackFitter.h"
+#include "../TrigInDetBremDetectionTool.h"
+#include "../TrigDkfTrackMakerTool.h"
+#include "../TrigL2ResidualCalculator.h"
 
 DECLARE_COMPONENT( TrigInDetTrackFitter )
 DECLARE_COMPONENT( TrigInDetBremDetectionTool )
 DECLARE_COMPONENT( TrigDkfTrackMakerTool )
 DECLARE_COMPONENT( TrigL2ResidualCalculator )
-DECLARE_COMPONENT( TrigL2FastExtrapolationTool )
-
-- 
GitLab


From d400fe466971393bc920c0f03e02903a4278c759 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 13:11:27 +0200
Subject: [PATCH 010/217] TrigInDetMonitoringTools: Package cleanup

- move header to src/
- remove unused library
- fix name of component library
- tidy link dependencies
- enable flake8
---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  0
 .../TrigInDetMonitoringTools/CMakeLists.txt   | 37 +++++--------------
 .../src/TrigInDetTrackMonitoringTool.cxx      |  2 +-
 .../TrigInDetTrackMonitoringTool.h            |  0
 .../TrigInDetVxInJetTool_entries.cxx          |  2 +-
 5 files changed, 11 insertions(+), 30 deletions(-)
 rename Trigger/TrigTools/TrigInDetMonitoringTools/{TrigInDetMonitoringTools => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 rename Trigger/TrigTools/TrigInDetMonitoringTools/{TrigInDetMonitoringTools => src}/TrigInDetTrackMonitoringTool.h (100%)
 mode change 100755 => 100644

diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/TrigInDetMonitoringTools/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigInDetMonitoringTools/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigInDetMonitoringTools/TrigInDetMonitoringTools/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigInDetMonitoringTools/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/CMakeLists.txt b/Trigger/TrigTools/TrigInDetMonitoringTools/CMakeLists.txt
index e0e494ef7a14..f69dac53647f 100644
--- a/Trigger/TrigTools/TrigInDetMonitoringTools/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetMonitoringTools/CMakeLists.txt
@@ -1,35 +1,16 @@
-################################################################################
-# Package: TrigInDetMonitoringTools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetMonitoringTools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Control/AthenaMonitoringKernel
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTrackingCnv
-                          PRIVATE
-                          PhysicsAnalysis/AnalysisCommon/AnalysisUtils
-                           )
-
-atlas_add_library( TrigInDetTrackMonitoringToolLib
-    src/*.cxx
-    PUBLIC_HEADERS TrigInDetMonitoringTools
-    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-    LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps  GaudiKernel AthenaMonitoringKernelLib xAODTracking xAODTrackingCnvLib 
-)
-
-atlas_add_component(
-    TrigInDetTrackMonitoringTool
-    src/components/*.cxx
-    LINK_LIBRARIES TrigInDetTrackMonitoringToolLib 
-)
+# External package dependencies:
+find_package( ROOT COMPONENTS MathCore )
 
+# Component(s) in this package:
+atlas_add_component( TrigInDetMonitoringTools
+   src/*.cxx src/components/*.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringKernelLib xAODTrackingCnvLib )
 
 # Install files from the package:
-atlas_install_headers( TrigInDetMonitoringTools )
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.cxx b/Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.cxx
index 474abd4220a5..c6a4d806c552 100755
--- a/Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.cxx
+++ b/Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "TMath.h"
-#include "TrigInDetMonitoringTools/TrigInDetTrackMonitoringTool.h"
+#include "TrigInDetTrackMonitoringTool.h"
 #include<iostream>
 
 //#include "TrigInterfaces/Algo.h"
diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/TrigInDetMonitoringTools/TrigInDetTrackMonitoringTool.h b/Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigInDetMonitoringTools/TrigInDetMonitoringTools/TrigInDetTrackMonitoringTool.h
rename to Trigger/TrigTools/TrigInDetMonitoringTools/src/TrigInDetTrackMonitoringTool.h
diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/src/components/TrigInDetVxInJetTool_entries.cxx b/Trigger/TrigTools/TrigInDetMonitoringTools/src/components/TrigInDetVxInJetTool_entries.cxx
index b96b98b1bac6..82b230125396 100644
--- a/Trigger/TrigTools/TrigInDetMonitoringTools/src/components/TrigInDetVxInJetTool_entries.cxx
+++ b/Trigger/TrigTools/TrigInDetMonitoringTools/src/components/TrigInDetVxInJetTool_entries.cxx
@@ -1,3 +1,3 @@
-#include "TrigInDetMonitoringTools/TrigInDetTrackMonitoringTool.h"
+#include "../TrigInDetTrackMonitoringTool.h"
 
 DECLARE_COMPONENT( TrigInDetTrackMonitoringTool )
-- 
GitLab


From 6473645a3cc60ac0f6d9eee3cdc6132485b8449c Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 14:32:47 +0200
Subject: [PATCH 011/217] TrigMuonToolInterfaces: Add missing interface library

---
 .../TrigMuonToolInterfaces/CMakeLists.txt     | 31 +++++--------------
 1 file changed, 7 insertions(+), 24 deletions(-)

diff --git a/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt b/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
index a21a9bb021f2..621fcdb2e905 100644
--- a/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
@@ -1,28 +1,11 @@
-################################################################################
-# Package: TrigMuonToolInterfaces
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMuonToolInterfaces )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthContainers
-                          Control/AthLinks
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODMuon
-			  Event/xAOD/xAODTrigMuon
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern
-                          MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment
-                          Reconstruction/MuonIdentification/MuonCombinedEvent
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/TrkSegment
-                          Tracking/TrkEvent/TrkTrack
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigSteeringEvent )
-
-# Install files from the package:
-atlas_install_headers( TrigMuonToolInterfaces )
-
+# Component(s) in the package:
+atlas_add_library( TrigMuonToolInterfaces
+                   TrigMuonToolInterfaces/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS TrigMuonToolInterfaces
+                   LINK_LIBRARIES GaudiKernel MuonCombinedEvent MuonPattern TrigMuonEvent TrigSteeringEvent TrkSegment TrkTrack xAODMuon xAODTracking )
-- 
GitLab


From b902e10b1cad0cb489c594cdebb1b1c8c2e1513f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 15:29:03 +0200
Subject: [PATCH 012/217] Move ITrigMuonRoITool from TrigMuonRoITools to
 TrigMuonToolInterfaces

---
 .../TrigGenericAlgs/CMakeLists.txt            |  2 +-
 .../TrigGenericAlgs/DetectorTimingAlgo.h      |  2 +-
 .../TrigGenericAlgs/L1CorrelationAlgo.h       |  2 +-
 .../TrigAlgorithms/TrigmuRoI/CMakeLists.txt   |  2 +-
 .../TrigmuRoI/TrigmuRoI/TrigmuRoI.h           |  2 +-
 .../TrigmuRoI/src/TrigmuRoIMT.h               |  2 +-
 .../TrigMuonHypo/CMakeLists.txt               |  2 +-
 .../TrigMuonHypo/TrigMuonHypo/MufastOTRHypo.h |  2 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  0
 .../TrigTools/TrigMuonRoITools/CMakeLists.txt | 21 ++-----------------
 .../TrigMuonRoITools/src/TrigMuonRoITool.h    |  2 +-
 .../ITrigMuonRoITool.h                        |  0
 12 files changed, 11 insertions(+), 28 deletions(-)
 rename Trigger/TrigTools/TrigMuonRoITools/{TrigMuonRoITools => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 rename Trigger/TrigTools/{TrigMuonRoITools/TrigMuonRoITools => TrigMuonToolInterfaces/TrigMuonToolInterfaces}/ITrigMuonRoITool.h (100%)

diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt
index 3f57f658d924..0dd90057e7f0 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt
@@ -16,7 +16,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigMuonEvent
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigT1/TrigT1Interfaces
-                          Trigger/TrigTools/TrigMuonRoITools
+                          Trigger/TrigTools/TrigMuonToolInterfaces
                           PRIVATE
                           Control/AthenaKernel
                           Control/AthenaMonitoring
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h
index af995feda4ac..e1102d79b411 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h
@@ -23,7 +23,7 @@
 #include <map>
 #include <stdint.h>
 #include "TrigT1Interfaces/RecMuonRoiSvc.h"
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 #include "TrigConfInterfaces/ITrigConfigSvc.h"
 #include "xAODTrigL1Calo/TriggerTowerContainer.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h
index 4f0bc2b4939f..bc7f108cce19 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h
@@ -25,7 +25,7 @@
 
 /// for muon tests
 #include "TrigT1Interfaces/RecMuonRoiSvc.h"
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 #include "TrigConfInterfaces/ITrigConfigSvc.h"
 
 #include "xAODTrigger/TrigComposite.h"
diff --git a/Trigger/TrigAlgorithms/TrigmuRoI/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigmuRoI/CMakeLists.txt
index f5910d0a6482..a7786893966f 100644
--- a/Trigger/TrigAlgorithms/TrigmuRoI/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigmuRoI/CMakeLists.txt
@@ -7,7 +7,7 @@ atlas_subdir( TrigmuRoI )
 atlas_add_component( TrigmuRoI
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib CxxUtils GaudiKernel TrigInterfacesLib TrigMuonRoIToolsLib TrigNavigationLib TrigSteeringEvent TrigT1Interfaces TrigT1Result )
+                     LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib CxxUtils GaudiKernel TrigInterfacesLib TrigMuonToolInterfaces TrigNavigationLib TrigSteeringEvent TrigT1Interfaces TrigT1Result )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/TrigmuRoI.h b/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/TrigmuRoI.h
index b0d012a24450..c160196af350 100644
--- a/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/TrigmuRoI.h
+++ b/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/TrigmuRoI.h
@@ -13,7 +13,7 @@
 
 #include "TrigT1Interfaces/RecMuonRoiSvc.h"
 
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 
 #include <string>
 #include <stdint.h>
diff --git a/Trigger/TrigAlgorithms/TrigmuRoI/src/TrigmuRoIMT.h b/Trigger/TrigAlgorithms/TrigmuRoI/src/TrigmuRoIMT.h
index f361ca1c7f70..7b308dfcf32a 100644
--- a/Trigger/TrigAlgorithms/TrigmuRoI/src/TrigmuRoIMT.h
+++ b/Trigger/TrigAlgorithms/TrigmuRoI/src/TrigmuRoIMT.h
@@ -6,7 +6,7 @@
 #define TRIGMUROI_TRIGMUROIMT_H
 
 #include "TrigT1Interfaces/RecMuonRoiSvc.h"
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
 
 #include "AthenaBaseComps/AthAlgorithm.h"
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
index 21c71f73dfb0..b8cf20759da0 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
@@ -15,7 +15,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigSteeringEvent
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigTools/TrigMuonBackExtrapolator
-                          Trigger/TrigTools/TrigMuonRoITools
+                          Trigger/TrigTools/TrigMuonToolInterfaces
 			  Trigger/TrigSteer/DecisionHandling
 			  Control/AthViews
                           LumiBlock/LumiBlockData
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MufastOTRHypo.h b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MufastOTRHypo.h
index 0808a72d7c1f..5c2633cebb2b 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MufastOTRHypo.h
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MufastOTRHypo.h
@@ -7,7 +7,7 @@
 
 #include <string>
 #include "TrigInterfaces/HypoAlgo.h"
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 
 class StoreGateSvc;
 class TriggerElement;
diff --git a/Trigger/TrigTools/TrigMuonRoITools/TrigMuonRoITools/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigMuonRoITools/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigMuonRoITools/TrigMuonRoITools/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigMuonRoITools/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigMuonRoITools/CMakeLists.txt b/Trigger/TrigTools/TrigMuonRoITools/CMakeLists.txt
index edfb950b78a1..c03808a81eb2 100644
--- a/Trigger/TrigTools/TrigMuonRoITools/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigMuonRoITools/CMakeLists.txt
@@ -1,30 +1,13 @@
-################################################################################
-# Package: TrigMuonRoITools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMuonRoITools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Event/ByteStreamCnvSvcBase
-                          Event/EventInfo
-                          Trigger/TrigT1/TrigT1Result )
-
 # Component(s) in the package:
-atlas_add_library( TrigMuonRoIToolsLib
-                   TrigMuonRoITools/*.h
-                   INTERFACE
-                   PUBLIC_HEADERS TrigMuonRoITools
-                   LINK_LIBRARIES GaudiKernel )
-
 atlas_add_component( TrigMuonRoITools
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps ByteStreamCnvSvcBaseLib GaudiKernel TrigT1Result TrigMuonRoIToolsLib )
+                     LINK_LIBRARIES AthenaBaseComps ByteStreamCnvSvcBaseLib GaudiKernel TrigMuonToolInterfaces TrigT1Result )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.h b/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.h
index 05c3d0b6eb43..a12e8275b1f1 100644
--- a/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.h
+++ b/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.h
@@ -5,7 +5,7 @@
 #ifndef TRIGMUONROITOOLS_TRIGMUONROITOOL_H
 #define TRIGMUONROITOOLS_TRIGMUONROITOOL_H
 
-#include "TrigMuonRoITools/ITrigMuonRoITool.h"
+#include "TrigMuonToolInterfaces/ITrigMuonRoITool.h"
 #include "TrigT1Result/MuCTPIRoI.h"
 
 #include "GaudiKernel/ServiceHandle.h"
diff --git a/Trigger/TrigTools/TrigMuonRoITools/TrigMuonRoITools/ITrigMuonRoITool.h b/Trigger/TrigTools/TrigMuonToolInterfaces/TrigMuonToolInterfaces/ITrigMuonRoITool.h
similarity index 100%
rename from Trigger/TrigTools/TrigMuonRoITools/TrigMuonRoITools/ITrigMuonRoITool.h
rename to Trigger/TrigTools/TrigMuonToolInterfaces/TrigMuonToolInterfaces/ITrigMuonRoITool.h
-- 
GitLab


From 216522087d2fb24bbb1d033ad11117607f70ddc4 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 16:03:34 +0200
Subject: [PATCH 013/217] Move ITrigMuonBackExtrapolator from
 TrigMuonBackExtrapolator to TrigMuonToolInterfaces

---
 .../TrigL2MuonSA/CMakeLists.txt               |  2 +-
 .../TrigL2MuonSA/src/MuFastDataPreparator.h   |  2 +-
 .../TrigL2MuonSA/src/MuFastStationFitter.h    |  2 +-
 .../src/MuFastTrackExtrapolator.h             |  2 +-
 .../TrigL2MuonSA/src/RpcRoadDefiner.h         |  2 +-
 .../TrigL2MuonSA/src/TgcRoadDefiner.h         |  2 +-
 .../TrigMuonHypo/CMakeLists.txt               |  1 -
 .../TrigMuonHypo/MucombStauHypo.h             |  2 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  0
 .../TrigMuonBackExtrapolator/CMakeLists.txt   | 20 ++-----------------
 .../src/TrigMuonBackExtrapolator.h            |  2 +-
 .../TrigMuonToolInterfaces/CMakeLists.txt     |  2 +-
 .../ITrigMuonBackExtrapolator.h               |  0
 13 files changed, 11 insertions(+), 28 deletions(-)
 rename Trigger/TrigTools/TrigMuonBackExtrapolator/{TrigMuonBackExtrapolator => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 rename Trigger/TrigTools/{TrigMuonBackExtrapolator/TrigMuonBackExtrapolator => TrigMuonToolInterfaces/TrigMuonToolInterfaces}/ITrigMuonBackExtrapolator.h (100%)

diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
index 442266569a9c..8e9152de3d3a 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
@@ -14,7 +14,7 @@ atlas_add_library( TrigL2MuonSALib
                    src/*.cxx
                    PUBLIC_HEADERS TrigL2MuonSA
                    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringKernelLib ByteStreamCnvSvcBaseLib CscClusterizationLib GaudiKernel GeoPrimitives Identifier MdtCalibSvcLib MuonCablingData MuonCnvToolInterfacesLib MuonIdHelpersLib MuonPrepRawData MuonRDO MuonRecToolInterfaces MuonTGC_CablingLib RPC_CondCablingLib RegionSelectorLib StoreGateLib TrigInterfacesLib TrigMuonBackExtrapolatorLib TrigSteeringEvent TrigT1Interfaces TrigT1RPCRecRoiSvcLib TrigTimeAlgsLib xAODEventInfo xAODTrigMuon xAODTrigger
+                   LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringKernelLib ByteStreamCnvSvcBaseLib CscClusterizationLib GaudiKernel GeoPrimitives Identifier MdtCalibSvcLib MuonCablingData MuonCnvToolInterfacesLib MuonIdHelpersLib MuonPrepRawData MuonRDO MuonRecToolInterfaces MuonTGC_CablingLib RPC_CondCablingLib RegionSelectorLib StoreGateLib TrigInterfacesLib TrigMuonToolInterfaces TrigSteeringEvent TrigT1Interfaces TrigT1RPCRecRoiSvcLib TrigTimeAlgsLib xAODEventInfo xAODTrigMuon xAODTrigger
                    PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GSL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} AthenaInterprocess CxxUtils EventInfo GeoModelUtilities MuonCalibEvent MuonReadoutGeometry PathResolver )
 
 atlas_add_component( TrigL2MuonSA
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.h
index e9e4186e6410..b1ff162d2c1c 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastDataPreparator.h
@@ -30,7 +30,7 @@
 #include "CscDataPreparator.h"
 #include "CscData.h"
 
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 #include "PtEndcapLUTSvc.h"
 
 #include "RPC_CondCabling/RpcCablingCondData.h"
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.h
index 4ace53a5c1b6..5139c26aad50 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastStationFitter.h
@@ -17,7 +17,7 @@
 #include "TrackData.h"
 #include "MuonRoad.h"
 #include "PtEndcapLUT.h"
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 #include "AlphaBetaEstimate.h"
 #include "PtFromAlphaBeta.h"
 
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h
index ff43f25571c1..7e54a8d3006f 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h
@@ -11,7 +11,7 @@
 
 #include "TrackData.h"
 
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 
 namespace TrigL2MuonSA {
   
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h
index 6aafa67f10d6..3c603fce18c6 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h
@@ -9,7 +9,7 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 #include "RpcData.h"
 #include "RpcPatFinder.h"
 #include "MuonRoad.h"
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h
index 3e7bd92542a5..8fd29389e198 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h
@@ -9,7 +9,7 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 #include "PtEndcapLUTSvc.h"
 #include "PtEndcapLUT.h"
 #include "TgcFit.h"
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
index b8cf20759da0..6fa29bc86464 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/CMakeLists.txt
@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigMuonEvent
                           Trigger/TrigEvent/TrigSteeringEvent
                           Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigMuonBackExtrapolator
                           Trigger/TrigTools/TrigMuonToolInterfaces
 			  Trigger/TrigSteer/DecisionHandling
 			  Control/AthViews
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MucombStauHypo.h b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MucombStauHypo.h
index cfb1dc5e7e85..b9c332f6ca10 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MucombStauHypo.h
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/MucombStauHypo.h
@@ -8,7 +8,7 @@
 #include <string>
 #include "TrigInterfaces/HypoAlgo.h"
 
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 
 class StoreGateSvc;
 class TriggerElement;
diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/TrigMuonBackExtrapolator/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigMuonBackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigMuonBackExtrapolator/TrigMuonBackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigMuonBackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt b/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
index 04a4c5bdd25c..841849221e2c 100644
--- a/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
@@ -1,29 +1,13 @@
-################################################################################
-# Package: TrigMuonBackExtrapolator
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMuonBackExtrapolator )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Event/xAOD/xAODTrigMuon
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent )
-
 # Component(s) in the package:
-atlas_add_library( TrigMuonBackExtrapolatorLib
-                   TrigMuonBackExtrapolator/*.h
-                   INTERFACE
-                   PUBLIC_HEADERS TrigMuonBackExtrapolator
-                   LINK_LIBRARIES GaudiKernel TrigInDetEvent TrigMuonEvent xAODTrigMuon )
-
 atlas_add_component( TrigMuonBackExtrapolator
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps TrigMuonBackExtrapolatorLib )
+                     LINK_LIBRARIES AthenaBaseComps TrigMuonToolInterfaces )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/src/TrigMuonBackExtrapolator.h b/Trigger/TrigTools/TrigMuonBackExtrapolator/src/TrigMuonBackExtrapolator.h
index 43d81c03bbf3..13c0b7855daf 100644
--- a/Trigger/TrigTools/TrigMuonBackExtrapolator/src/TrigMuonBackExtrapolator.h
+++ b/Trigger/TrigTools/TrigMuonBackExtrapolator/src/TrigMuonBackExtrapolator.h
@@ -7,7 +7,7 @@
 
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h"
+#include "TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h"
 
 
 
diff --git a/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt b/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
index 621fcdb2e905..658e04d8a345 100644
--- a/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigMuonToolInterfaces/CMakeLists.txt
@@ -8,4 +8,4 @@ atlas_add_library( TrigMuonToolInterfaces
                    TrigMuonToolInterfaces/*.h
                    INTERFACE
                    PUBLIC_HEADERS TrigMuonToolInterfaces
-                   LINK_LIBRARIES GaudiKernel MuonCombinedEvent MuonPattern TrigMuonEvent TrigSteeringEvent TrkSegment TrkTrack xAODMuon xAODTracking )
+                   LINK_LIBRARIES GaudiKernel MuonCombinedEvent MuonPattern TrigInDetEvent TrigMuonEvent TrigSteeringEvent TrkSegment TrkTrack xAODMuon xAODTracking xAODTrigMuon )
diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h b/Trigger/TrigTools/TrigMuonToolInterfaces/TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h
similarity index 100%
rename from Trigger/TrigTools/TrigMuonBackExtrapolator/TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h
rename to Trigger/TrigTools/TrigMuonToolInterfaces/TrigMuonToolInterfaces/ITrigMuonBackExtrapolator.h
-- 
GitLab


From 88186d63665909ff4a3f50012219b6bd2bdb2a6e Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Fri, 3 Jul 2020 16:04:48 +0200
Subject: [PATCH 014/217] TrigMuonBackExtrapolator: enable flake8 and fix code

---
 Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt  | 2 +-
 .../python/TrigMuonBackExtrapolatorConfig.py               | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt b/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
index 841849221e2c..7e7cddc048cb 100644
--- a/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigMuonBackExtrapolator/CMakeLists.txt
@@ -10,4 +10,4 @@ atlas_add_component( TrigMuonBackExtrapolator
                      LINK_LIBRARIES AthenaBaseComps TrigMuonToolInterfaces )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigTools/TrigMuonBackExtrapolator/python/TrigMuonBackExtrapolatorConfig.py b/Trigger/TrigTools/TrigMuonBackExtrapolator/python/TrigMuonBackExtrapolatorConfig.py
index f6722a06f3e0..2ebac4bc55f9 100755
--- a/Trigger/TrigTools/TrigMuonBackExtrapolator/python/TrigMuonBackExtrapolatorConfig.py
+++ b/Trigger/TrigTools/TrigMuonBackExtrapolator/python/TrigMuonBackExtrapolatorConfig.py
@@ -1,9 +1,6 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigMuonBackExtrapolator.TrigMuonBackExtrapolatorConf import *
-from AthenaCommon.GlobalFlags import globalflags
-from AthenaCommon.AppMgr import ServiceMgr
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+from TrigMuonBackExtrapolator.TrigMuonBackExtrapolatorConf import TrigMuonBackExtrapolator
 
 class MuonBackExtrapolatorForAlignedDet (TrigMuonBackExtrapolator):
 
-- 
GitLab


From 6531310016268d2ef5dbb7232f47a6aa62632e6b Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 17:03:00 +0200
Subject: [PATCH 015/217] Remove unused interface

---
 .../IEnergyDepositionTool/CMakeLists.txt      | 18 ------
 .../IEnergyDepositionTool.h                   | 57 -------------------
 .../IEnergyDepositionTool/doc/packagedoc.h    | 27 ---------
 3 files changed, 102 deletions(-)
 delete mode 100644 Reconstruction/RecoTools/IEnergyDepositionTool/CMakeLists.txt
 delete mode 100755 Reconstruction/RecoTools/IEnergyDepositionTool/IEnergyDepositionTool/IEnergyDepositionTool.h
 delete mode 100644 Reconstruction/RecoTools/IEnergyDepositionTool/doc/packagedoc.h

diff --git a/Reconstruction/RecoTools/IEnergyDepositionTool/CMakeLists.txt b/Reconstruction/RecoTools/IEnergyDepositionTool/CMakeLists.txt
deleted file mode 100644
index bd3edc98256f..000000000000
--- a/Reconstruction/RecoTools/IEnergyDepositionTool/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Package: IEnergyDepositionTool
-################################################################################
-
-# Declare the package name:
-atlas_subdir( IEnergyDepositionTool )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloIdentifier
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkMaterialOnTrack
-                          Tracking/TrkEvent/TrkParameters )
-
-# Install files from the package:
-atlas_install_headers( IEnergyDepositionTool )
-
diff --git a/Reconstruction/RecoTools/IEnergyDepositionTool/IEnergyDepositionTool/IEnergyDepositionTool.h b/Reconstruction/RecoTools/IEnergyDepositionTool/IEnergyDepositionTool/IEnergyDepositionTool.h
deleted file mode 100755
index 58efc3bfc174..000000000000
--- a/Reconstruction/RecoTools/IEnergyDepositionTool/IEnergyDepositionTool/IEnergyDepositionTool.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-///////////////////////////////////////////////////////////////////
-// IEnergyDepositionTool.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-#ifndef RECOTOOLS_IENERGYDEPOSITIONTOOL_H
-#define RECOTOOLS_IENERGYDEPOSITIONTOOL_H
-
-// Gaudi
-#include "GaudiKernel/IAlgTool.h"
-// Trk
-#include "TrkEventPrimitives/ParticleHypothesis.h"
-#include "TrkMaterialOnTrack/MaterialEffectsOnTrack.h"
-#include "TrkParameters/TrackParameters.h"
-// Calo
-#include "CaloIdentifier/CaloCell_ID.h"
-// STL
-#include <utility>
-
-/** Interface ID for IEnergyDepositionTool*/  
-static const InterfaceID IID_IEnergyDepositionTool("IEnergyDepositionTool", 1, 0);
-  
-  /**@class IEnergyDepositionTool
-     
-     Interface class IEnergyDepositionTool. 
-
-     This is a simple interface
-     for different tools that may perform measurements of energy
-     deposited by tracks in the calorimeters. Only one method
-     is specified to not constrain any further the functionality
-     of the tools implementing this interface.
-     
-     @author David.Lopez@cern.ch
-    */
-
-class IEnergyDepositionTool : virtual public IAlgTool {
-      
- public:
-  /**Virtual destructor*/
-  virtual ~IEnergyDepositionTool(){}
-       
-  /** AlgTool and IAlgTool interface methods */
-  static const InterfaceID& interfaceID() { return IID_IEnergyDepositionTool; }
-
-  /** Returns the measurement (result.first) and the noise RMS
-   (result.second)
-  */
-  virtual std::pair<double,double> measurement(CaloCell_ID::CaloSample id, 
-					       const Trk::TrackParameters& parm) = 0;
-
-};
-
-
-#endif // RECOTOOLS_IENERGYDEPOSITIONTOOL_H
diff --git a/Reconstruction/RecoTools/IEnergyDepositionTool/doc/packagedoc.h b/Reconstruction/RecoTools/IEnergyDepositionTool/doc/packagedoc.h
deleted file mode 100644
index 7a71cd5dc40c..000000000000
--- a/Reconstruction/RecoTools/IEnergyDepositionTool/doc/packagedoc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-@page IEnergyDepositionTool_page IEnergyDepositionTool Package
-
-This package contains a simple interface for tools that measure
-energy depositions in the calorimeter around a track.
-
-@author David.Lopez@cern.ch
-
-@section IEnergyDepositionTool_IntroductionIEnergyDepositionTool Introduction
-
-Measuring energy depositions around a track has several applications.
-This package contains an interface to perform this measurement.
-The interface is simplified as much as possible to make it easy for
-different existing tools to adjust to it.
-
-@section IEnergyDepositionTool_OverviewIEnergyDepositionTool Class Overview
-This package contains a single interface IAlgTool:
-  - <b> IEnergyDepositionTool<\b>. Simple interface to measure
-  energy depositions in the calorimeter around an input track.
-
-@section IEnergyDepositionTool_ExtrasIEnergyDepositionTool Extra Pages
-
-*/
-- 
GitLab


From 3bb19291d7ede40b615e0526079da466f2e279a8 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 18:28:57 +0200
Subject: [PATCH 016/217] Remove UserAnalysisEvent

---
 .../UserAnalysisEvent/CMakeLists.txt          | 13 --------
 .../UserAnalysisEvent/UserAnalysisEventDict.h | 31 -------------------
 .../UserAnalysisEvent/selection.xml           |  7 -----
 3 files changed, 51 deletions(-)
 delete mode 100644 PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/CMakeLists.txt
 delete mode 100755 PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/UserAnalysisEventDict.h
 delete mode 100755 PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/selection.xml

diff --git a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/CMakeLists.txt
deleted file mode 100644
index 08ea8f1f4ece..000000000000
--- a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Package: UserAnalysisEvent
-################################################################################
-
-# Declare the package name:
-atlas_subdir( UserAnalysisEvent )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
-# Install files from the package:
-atlas_install_headers( UserAnalysisEvent )
-
diff --git a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/UserAnalysisEventDict.h b/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/UserAnalysisEventDict.h
deleted file mode 100755
index bfecd64d501d..000000000000
--- a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/UserAnalysisEventDict.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef USERANALYSISEVENT_PARTICLEEVENTDICT_H
-#define USERANALYSISEVENT_PARTICLEEVENTDICT_H
-
-#include "TObject.h"
-#include "TRef.h"
-#include "TRefArray.h"
-#include "TLorentzVector.h"
-#include "TMap.h"
-#include "TPoints3D.h"
-#include "TMatrixFSym.h"
-#include "TMatrix.h"
-#include "TVector3.h"
-#include "TVector2.h"
-#include "TVector.h"
-
-namespace UserAnalysisEventDict {
-
-  struct temp {
-
- };
-
-
-} // end UserAnalysisEventDict namespace
-
-#endif // USERANALYSISEVENT_PARTICLEEVENTDICT_H
-
-
diff --git a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/selection.xml b/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/selection.xml
deleted file mode 100755
index 1e882cb8c61c..000000000000
--- a/PhysicsAnalysis/AnalysisCommon/UserAnalysisEvent/UserAnalysisEvent/selection.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<lcgdict>
-
-
-</lcgdict>
-
-
-
-- 
GitLab


From bfe4a2992203281a9b563dd94d347965f47c268d Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 18:41:30 +0200
Subject: [PATCH 017/217] Remove InvisibleHiggs packages: not used in the
 release

---
 .../InvisibleHiggsVBF/CMakeLists.txt          |    7 -
 .../InvisibleHiggsZH/CMakeLists.txt           |    7 -
 .../InvisibleHiggsZH/run/EVmva.C              | 2202 ----------------
 .../InvisibleHiggsZH/run/Instructions.txt     |    3 -
 .../InvisibleHiggsZH/run/Makefile             |  207 --
 .../InvisibleHiggsZH/run/TMVA/Makefile        |  207 --
 .../InvisibleHiggsZH/run/TMVA/TMVAnalysis.C   |  430 ----
 .../run/TMVA/TMVApplication.C                 |  497 ----
 .../InvisibleHiggsZH/run/TMVA/cuts.C          |  346 ---
 .../InvisibleHiggsZH/run/TMVA/optimisation.C  |  330 ---
 .../InvisibleHiggsZH/run/TMVA/selection.C     | 1532 ------------
 .../InvisibleHiggsZH/run/TMVA/setupNewRoot.sh |    6 -
 .../InvisibleHiggsZH/run/normalisation.C      | 2227 -----------------
 .../share/HZanalysis-dataset.py               | 2061 ---------------
 .../InvisibleHiggsZH/share/HZanalysis.py      |  329 ---
 15 files changed, 10391 deletions(-)
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsVBF/CMakeLists.txt
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/CMakeLists.txt
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/EVmva.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Instructions.txt
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Makefile
 delete mode 100755 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/Makefile
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVAnalysis.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVApplication.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/cuts.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/optimisation.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/selection.C
 delete mode 100755 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/setupNewRoot.sh
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/normalisation.C
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis-dataset.py
 delete mode 100644 PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis.py

diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsVBF/CMakeLists.txt b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsVBF/CMakeLists.txt
deleted file mode 100644
index 8da33a0dffcb..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsVBF/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Package: InvisibleHiggsVBF
-################################################################################
-
-# Declare the package name:
-atlas_subdir( InvisibleHiggsVBF )
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/CMakeLists.txt b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/CMakeLists.txt
deleted file mode 100644
index e00adf844eb1..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Package: InvisibleHiggsZH
-################################################################################
-
-# Declare the package name:
-atlas_subdir( InvisibleHiggsZH )
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/EVmva.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/EVmva.C
deleted file mode 100644
index db23f7bd3fdb..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/EVmva.C
+++ /dev/null
@@ -1,2202 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// program used to select the variables needed for the Boosted Tree analysis
-// - reads in the events after using EV as a ntuple dumper
-// - applies all preselection cuts to select events with 2 leptons from a Z and large missing pt
-
-using namespace std;
-
-#define CHAIN
-
-#include <fstream>
-using std::ofstream;
-
-/******************* Include files for C++ **************************/
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <string.h>
-#include <vector>
-#include <list>  
-#include <stdlib.h>
-
-/******************* Include files for ROOT *************************/
-#include "TROOT.h"
-#include "TApplication.h"
-#include "TCanvas.h"
-#include "TPaveText.h"
-#include "TLine.h"
-#include "TPaveLabel.h"
-#include "TNtuple.h"
-#include "TH1.h"
-#include "THStack.h"
-#include "TPad.h"
-#include "TFile.h"
-#include "TLegend.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TGraph.h"
-#include "TFrame.h"
-#include "TAttFill.h"
-#include "Random.h"
-#include "TRandom3.h"
-#include "TLatex.h"
-
-// - - - Initiates the GUI interface of ROOT - - -
-using std::string;
-using std::setprecision;
-extern void InitGui();
-
-//============================================================================
-
-int main(int argc, char **argv)
-{
-// execute rootlogon.C to get ATLAS style setup.
-#include "rootlogon.C"
-
-  VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
-
-//   void ATLAS_LABEL(Double_t x,Double_t y,Color_t color=1) {
-
-    TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize); 
-//     l.SetNDC();
-//     l.SetTextFont(72);
-//     l.SetTextColor(color);
-//     l.DrawLatex(x,y,"ATLAS");
-//   }
-
-  TROOT root("","", initfuncs);
-  
-  TApplication theApp("App", &argc, argv);
-//   gROOT->Reset();
-//   gROOT->SetStyle("ATLAS");
-//   gROOT->ForceStyle();   
-  
-  // bool EF_passed = true;
-  
-   int seed = 47;
-   //   srand ( time(0) ); // for a random seed
-   srand(seed);  // for a fixed start
-
-  double zmm[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double zee[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double zmm0[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double zee0[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double zmm1[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double zee1[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  
-  int counter = 0;
-  int typeNumber = 0;
-  int ntype = 8;
-  const int ndatasets = 1;
-  
-  double generated[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  
-  const string eventType[15] = {("HZ120"),("ZZ"),("ttbar"),("WWenuenu"),("WWenumunu"),("WWmunuenu"),("WWmunumunu"),("ZZtautaununu"),("ZZlltautau"),("ZW+"),("ZW-"),("Zeel"),("Zeeb"),("Zmml"),("Zmmb") }; 
-  
-//   //  mH = 110 GeV
-//      double sigmaBR[15] = {0.0614, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//      double filterEff[15] = {0.470, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-
-//   //  mH = 120 GeV
-      double sigmaBR[15] = {0.0464, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-      double filterEff[15] = {0.496, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-
-// mH = 130 GeV
-//      double sigmaBR[15] = { 0.0359, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//      double filterEff[15] = {0.754, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-
-// //   // mH = 140 GeV
-//      double sigmaBR[15] = { 0.0275, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//      double filterEff[15] = {0.759, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-  
-// //   // mH = 150 GeV
-//      double sigmaBR[15] = { 0.0218, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//      double filterEff[15] = {0.564, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-  
-// //   // mH = 200 GeV
-//      double sigmaBR[15] = { 0.0068, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//      double filterEff[15] = {0.646, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-  
-// //   // mH = 250 GeV
-//       double sigmaBR[15] = { 0.00293, 0.398, 7.36, 1.350, 1.327, 1.327, 1.305, 0.1995,  0.067, 0.4275, 0.2675, 1452.6556, 99.8886, 1452.7175, 99.80114}; 
-//       double filterEff[15] = {0.701, 0.292, 0.0113, 0.0898, 0.000634, 0.000623, 0.0893, 0.0516, 0.714, 1.0, 1.0, 0.0000528,0.0016551,0.000052,0.0016118};
-  
-  int found[15];
-  double Total[15];
-  double TotalUM[15] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double weight[15]; 
-  double totalRejected[15];
-  int nrec[15];
-  double passed[15];
-  int sanity[15];
-  
-  double reject_MET[15] ;
-  double reject_nlep[15] ;
-  double reject_trigger[15] ;
-  double reject_mZ[15] ;
-  double reject_leppid[15] ;
-  double reject_btag[15] ;
-  
-  string histName1 = ("ptlep1");
-  string histName2 = ("ptlep2");
-  string histName3 = ("cosll2D");
-  string histName4 = ("cosll3D");
-  string histName5 = ("MET");
-  string histName6 = ("mt");
-  string histName7 = ("cosMETPtlep");
-  string histName8 = ("mZll");
-  string histName9 = ("cosphi");
-  string histName10 = ("cosJetPtmiss");
-  string histName11 = ("cone1");
-  string histName12 = ("cone2");
-  string histName13 = ("ejet1");
-  string histName14 = ("ejet2");
-  string histName15 = ("ejet3");
-  string histName16 = ("njet");
-  string histName17 = ("nel");
-  string histName18 = ("nmu");
-  string histName19 = ("nlep");
-  string histName20 = ("lepid");
-   
-  int doublepair[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-  
-  double lumi = 30000.0;
-  double TotalBgnd = 0.;
-  
-  int L1XET100[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-  
-  const unsigned int XC1=0, YC1=0, XC2=800, YC2=800;
-  const double G=0.004;
-  
-  TCanvas* c1 = new TCanvas("c1","variables set 1", XC1, YC1, XC2, YC2);
-  c1->cd();
-  c1->SetFillColor(30);
-  c1->GetFrame()->SetFillColor(10);
-  c1->GetFrame()->SetBorderSize(6);
-  c1->GetFrame()->SetBorderMode(-1);
-  TPad* pad11= new TPad("pad11", "Pad11",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad12= new TPad("pad12", "Pad12",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad13= new TPad("pad13", "Pad13",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad14= new TPad("pad14", "Pad14",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad11->SetFillColor(10); pad11->Draw();
-  pad12->SetFillColor(10); pad12->Draw();   
-  pad13->SetFillColor(10); pad13->Draw();
-  pad14->SetFillColor(10); pad14->Draw();
-
-  TCanvas* c2 = new TCanvas("c2","variables set 2", XC1, YC1, XC2, YC2);
-  c2->cd();
-  c2->SetFillColor(10);
-  c2->GetFrame()->SetFillColor(10);
-  c2->GetFrame()->SetBorderSize(6);
-  c2->GetFrame()->SetBorderMode(-1);
-  TPad* pad21= new TPad("pad21", "Pad21",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad22= new TPad("pad22", "Pad22",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad23= new TPad("pad23", "Pad23",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad24= new TPad("pad24", "Pad24",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad21->SetFillColor(10); pad21->Draw();
-  pad22->SetFillColor(10); pad22->Draw();   
-  pad23->SetFillColor(10); pad23->Draw();
-  pad24->SetFillColor(10); pad24->Draw();
-  
-  TCanvas* c3 = new TCanvas("c3","variables set 3", XC1, YC1, XC2, YC2);
-  c3->cd();
-  c3->SetFillColor(10);
-  c3->GetFrame()->SetFillColor(10);
-  c3->GetFrame()->SetBorderSize(6);
-  c3->GetFrame()->SetBorderMode(-1);
-  TPad* pad31= new TPad("pad31", "Pad31",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad32= new TPad("pad32", "Pad32",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad33= new TPad("pad33", "Pad33",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad34= new TPad("pad34", "Pad34",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad31->SetFillColor(10); pad31->Draw();
-  pad32->SetFillColor(10); pad32->Draw();   
-  pad33->SetFillColor(10); pad33->Draw();
-  pad34->SetFillColor(10); pad34->Draw();
-  
-  TCanvas* c4 = new TCanvas("c4","variables set 4", XC1, YC1, XC2, YC2);
-  c4->cd();
-  c4->SetFillColor(10);
-  c4->GetFrame()->SetFillColor(10);
-  c4->GetFrame()->SetBorderSize(6);
-  c4->GetFrame()->SetBorderMode(-1);
-  TPad* pad41= new TPad("pad41", "Pad41",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad42= new TPad("pad42", "Pad42",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad43= new TPad("pad43", "Pad43",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad44= new TPad("pad44", "Pad44",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad41->SetFillColor(10); pad41->Draw();
-  pad42->SetFillColor(10); pad42->Draw();   
-  pad43->SetFillColor(10); pad43->Draw();
-  pad44->SetFillColor(10); pad44->Draw();
-  
-  TCanvas* c5 = new TCanvas("c5","variables set 5", XC1, YC1, XC2, YC2);
-  c5->cd();
-  c5->SetFillColor(10);
-  c5->GetFrame()->SetFillColor(10);
-  c5->GetFrame()->SetBorderSize(6);
-  c5->GetFrame()->SetBorderMode(-1);
-  TPad* pad51= new TPad("pad51", "Pad51",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad52= new TPad("pad52", "Pad52",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad53= new TPad("pad53", "Pad53",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad54= new TPad("pad54", "Pad54",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad51->SetFillColor(10); pad51->Draw();
-  pad52->SetFillColor(10); pad52->Draw();   
-  pad53->SetFillColor(10); pad53->Draw();
-  pad54->SetFillColor(10); pad54->Draw();
-  
-  TCanvas* c6 = new TCanvas("c6","variables set 6", XC1, YC1, XC2, YC2);
-  c6->cd();
-  c6->SetFillColor(10);
-  c6->GetFrame()->SetFillColor(10);
-  c6->GetFrame()->SetBorderSize(6);
-  c6->GetFrame()->SetBorderMode(-1);
-  TPad* pad61= new TPad("pad61", "Pad21",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad62= new TPad("pad62", "Pad22",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad63= new TPad("pad63", "Pad23",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad64= new TPad("pad64", "Pad24",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad61->SetFillColor(10); pad61->Draw();
-  pad62->SetFillColor(10); pad62->Draw();   
-  pad63->SetFillColor(10); pad63->Draw();
-  pad64->SetFillColor(10); pad64->Draw();
-
-  // -----------------------------------------------------------
-  //      - - -  Creating stacks - - -  
-  // -----------------------------------------------------------
-  
-  THStack hs1("hs1","pt_lepton 1");
-  THStack hs2("hs2","pt_lepton 2");
-  THStack hs3("hs3","cosll2D");
-  THStack hs4("hs4","cosll3D");
-  THStack hs5("hs5","MET");
-  THStack hs6("hs6","mt");
-  THStack hs7("hs7","cosMETPtlep");
-  THStack hs8("hs8","mZll");
-  THStack hs9("hs9","cos Phi");
-  THStack hs10("hs10","cosJetMET");
-  THStack hs11("hs11","cone1");
-  THStack hs12("hs12","cone2");
-  THStack hs13("hs13","ejet1");
-  THStack hs14("hs14","ejet2");
-  THStack hs15("hs15","ejet3");
-  THStack hs16("hs16","njet");
-  THStack hs17("hs17","nel");
-  THStack hs18("hs18","nmu");
-  THStack hs19("hs19","nlep");
-  THStack hs20("hs20","lepid");
-
-//   THStack hs1("hs1","");
-//   THStack hs2("hs2","");
-//   THStack hs3("hs3","");
-//   THStack hs4("hs4","");
-//   THStack hs5("hs5","");
-//   THStack hs6("hs6","");
-//   THStack hs7("hs7","");
-//   THStack hs8("hs8","");
-//   THStack hs9("hs9","");
-//   THStack hs10("hs10","");
-//   THStack hs11("hs11","");
-//   THStack hs12("hs12","");
-//   THStack hs13("hs13","");
-//   THStack hs14("hs14","");
-//   THStack hs15("hs15","");
-//   THStack hs16("hs16","");
-//   THStack hs17("hs17","");
-//   THStack hs18("hs18","");
-//   THStack hs19("hs19","");
-//   THStack hs20("hs20","");
-
-  // -----------------------------------------------------------
-  //      - - -  Creating many histograms - - -  
-  // -----------------------------------------------------------
-  TH1F* hgauss1= new TH1F("gaussian", "MET before ", 100, 90., 300.);
-  TH1F* hgauss2= new TH1F("gaussian", "MET after", 100, 90., 300.);
-
-  TH1F* hptlep1[ntype];
-  TH1F* hptlep2[ntype];
-  TH1F* hcosll2D[ntype];
-  TH1F* hcosll3D[ntype];
-  TH1F* hMET[ntype];
-  TH1F* hmt[ntype];
-  TH1F* hcosMETPtlep[ntype];
-  TH1F* hmZll[ntype];
-  TH1F* hcosphi[ntype];
-  TH1F* hcosJetMET[ntype];
-  TH1F* hcone1[ntype];
-  TH1F* hcone2[ntype];
-  TH1F* hejet1[ntype];
-  TH1F* hejet2[ntype];
-  TH1F* hejet3[ntype];
-  TH1F* hnjet[ntype];
-  TH1F* hnel[ntype];
-  TH1F* hnmu[ntype];
-  TH1F* hnlep[ntype];
-  TH1F* hlepid[ntype];
-  
-  string ka[8] = {"0", "1", "2", "3", "4", "5", "6", "7"};
-  
-  for (int m=0; m<ntype; m++) {
-    histName1.insert(6,ka[m]);
-    histName2.insert(6,ka[m]);
-    histName3.insert(7,ka[m]);
-    histName4.insert(7,ka[m]);
-    histName5.insert(3,ka[m]);
-    histName6.insert(2,ka[m]);
-    histName7.insert(11,ka[m]);
-    histName8.insert(4,ka[m]);
-    histName9.insert(6,ka[m]);
-    histName10.insert(9,ka[m]);
-    histName11.insert(5,ka[m]);
-    histName12.insert(5,ka[m]);
-    histName13.insert(5,ka[m]);
-    histName14.insert(5,ka[m]);
-    histName15.insert(5,ka[m]);
-    histName16.insert(4,ka[m]);
-    histName17.insert(3,ka[m]);
-    histName18.insert(3,ka[m]);
-    histName19.insert(4,ka[m]);
-    histName20.insert(5,ka[m]);
-    
-    hptlep1[m] = new TH1F(histName1.c_str(), "; p_T^{lepton @#1} ;@# of entries", 50, 0, 300.0);
-    hptlep2[m] = new TH1F(histName2.c_str(), ";p_T^{lepton @#2} ;@# of entries", 50, 0, 100.0);
-    hcosll2D[m] = new TH1F(histName3.c_str(), ";#cos_{ll} (xy plane);@# of entries", 50, -1.1, 1.1);
-    hcosll3D[m] = new TH1F(histName4.c_str(), ";#cos_{ll};@# of entries", 50, -1.1, 1.1);
-    hMET[m] = new TH1F(histName5.c_str(), ";p_{T} missing per event;@# of entries", 50, 50, 500);
-    hmt[m] = new TH1F(histName6.c_str(), ";m_T;@# of entries", 50, 0, 700.0);
-    hcosMETPtlep[m] = new TH1F(histName7.c_str(), ";#cos MET-Ptlep;@# of entries", 50, -1.1, 1.1);
-    hmZll[m] = new TH1F(histName8.c_str(), ";M_{Z #rightarrow ll};@# of entries", 50, 71.19, 111.19);
-    hcosphi[m] = new TH1F(histName9.c_str(), ";#cos #phi;@# of entries", 50, -1.1, 1.1);
-    hcosJetMET[m] = new TH1F(histName16.c_str(), ";#cos #phi (between p_{T} miss and jet;@# of entries", 50, -1.0, 1.2);
-    hcone1[m] = new TH1F(histName11.c_str(), ";electron isolation cone 0.10 ;@# of entries", 50, 0.0, 300.0);
-    hcone2[m] = new TH1F(histName12.c_str(), ";muon isolation cone 0.10 ;@# of entries", 50, 0.0, 300.0);
-    hejet1[m] = new TH1F(histName13.c_str(), ";energy jet @#1 ;@# of entries", 50, 0, 300.0);
-    hejet2[m] = new TH1F(histName14.c_str(), ";energy jet @#2 ;@# of entries", 50, 0, 300.0);
-    hejet3[m] = new TH1F(histName15.c_str(), ";energy jet @#3 ;@# of entries", 50, 0, 300.0);
-    hnjet[m] = new TH1F(histName10.c_str(), ";@# jets ;@# of entries", 11, 0, 10);
-    hnel[m] = new TH1F(histName17.c_str(), ";@#electrons ;@# of entries", 6, 0, 5);
-    hnmu[m] = new TH1F(histName18.c_str(), ";@# muons ;@# of entries", 6, 0, 5);
-    hnlep[m] = new TH1F(histName19.c_str(), ";@# leptons ;@# of entries", 11, 0, 10);
-    hlepid[m] = new TH1F(histName20.c_str(), ";lepton ID ;@# of entries", 26, 0, 25);
-   
-    hptlep1[m]->SetTitle("p_{T} lepton @# 1");
-    hptlep2[m]->SetTitle("p_{T} lepton @# 1");
-    hcosll2D[m]->SetTitle("#cos l l in 2D");
-    hcosll3D[m]->SetTitle("#cos l l in 3D");
-    hMET[m]->SetTitle("Missing E_{T}");
-    hmt[m]->SetTitle("transverse mass");
-    hcosMETPtlep[m]->SetTitle("");
-    hmZll[m]->SetTitle("Z mass");
-    hcosphi[m]->SetTitle("#cos #phi");
-    hcosJetMET[m]->SetTitle("#cos jet-MET");
-    hcone1[m]->SetTitle("E cone lepton @# 1");
-    hcone2[m]->SetTitle("E cone lepton @# 2");
-    hejet1[m]->SetTitle("energy jet @#1");
-    hejet2[m]->SetTitle("energy jet @#2");
-    hejet3[m]->SetTitle("energy jet @#3");
-    hnjet[m]->SetTitle("@# jets");
-    hnel[m]->SetTitle("@# electrons");
-    hnmu[m]->SetTitle("@# muons");
-    hnlep[m]->SetTitle("@# leptons");
-    hlepid[m]->SetTitle("lepton ID");
-    
-    hptlep1[m]->SetTitle("@# of entries");
-    hptlep2[m]->SetTitle("@# of entries");
-    hcosll2D[m]->SetTitle("@# of entries");
-    hcosll3D[m]->SetTitle("@# of entries");
-    hMET[m]->SetTitle("@# of entries");
-    hmt[m]->SetTitle("@# of entries");
-    hcosMETPtlep[m]->SetTitle("@# of entries");
-    hmZll[m]->SetTitle("@# of entries");
-    hcosphi[m]->SetTitle("@# of entries");
-    hcosJetMET[m]->SetTitle("@# of entries");
-    hcone1[m]->SetTitle("@# of entries");
-    hcone2[m]->SetTitle("@# of entries");
-    hejet1[m]->SetTitle("@# of entries");
-    hejet2[m]->SetTitle("@# of entries");
-    hejet3[m]->SetTitle("@# of entries");
-    hnjet[m]->SetTitle("@# of entries");
-    hnel[m]->SetTitle("@# of entries");
-    hnmu[m]->SetTitle("@# of entries");
-    hnlep[m]->SetTitle("@# of entries");
-    hlepid[m]->SetTitle("@# of entries");
-
-//     hptlep1[m]->GetXaxis()->SetTitle("p_{T} lepton @# 1");
-//     hptlep2[m]->GetXaxis()->SetTitle("p_{T} lepton @# 1");
-//     hcosll2D[m]->GetXaxis()->SetTitle("#cos l l in 2D");
-//     hcosll3D[m]->GetXaxis()->SetTitle("#cos l l in 3D");
-//     hMET[m]->GetXaxis()->SetTitle("Missing E_{T}");
-//     hmt[m]->GetXaxis()->SetTitle("transverse mass");
-//     hcosMETPtlep[m]->GetXaxis()->SetTitle("");
-//     hmZll[m]->GetXaxis()->SetTitle("Z mass");
-//     hcosphi[m]->GetXaxis()->SetTitle("#cos #phi");
-//     hcosJetMET[m]->GetXaxis()->SetTitle("#cos jet-MET");
-//     hcone1[m]->GetXaxis()->SetTitle("E cone lepton @# 1");
-//     hcone2[m]->GetXaxis()->SetTitle("E cone lepton @# 2");
-//     hejet1[m]->GetXaxis()->SetTitle("energy jet @#1");
-//     hejet2[m]->GetXaxis()->SetTitle("energy jet @#2");
-//     hejet3[m]->GetXaxis()->SetTitle("energy jet @#3");
-//     hnjet[m]->GetXaxis()->SetTitle("@# jets");
-//     hnel[m]->GetXaxis()->SetTitle("@# electrons");
-//     hnmu[m]->GetXaxis()->SetTitle("@# muons");
-//     hnlep[m]->GetXaxis()->SetTitle("@# leptons");
-//     hlepid[m]->GetXaxis()->SetTitle("lepton ID");
-    
-//     hptlep1[m]->GetYaxis()->SetTitle("@# of entries");
-//     hptlep2[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcosll2D[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcosll3D[m]->GetYaxis()->SetTitle("@# of entries");
-//     hMET[m]->GetYaxis()->SetTitle("@# of entries");
-//     hmt[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcosMETPtlep[m]->GetYaxis()->SetTitle("@# of entries");
-//     hmZll[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcosphi[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcosJetMET[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcone1[m]->GetYaxis()->SetTitle("@# of entries");
-//     hcone2[m]->GetYaxis()->SetTitle("@# of entries");
-//     hejet1[m]->GetYaxis()->SetTitle("@# of entries");
-//     hejet2[m]->GetYaxis()->SetTitle("@# of entries");
-//     hejet3[m]->GetYaxis()->SetTitle("@# of entries");
-//     hnjet[m]->GetYaxis()->SetTitle("@# of entries");
-//     hnel[m]->GetYaxis()->SetTitle("@# of entries");
-//     hnmu[m]->GetYaxis()->SetTitle("@# of entries");
-//     hnlep[m]->GetYaxis()->SetTitle("@# of entries");
-//     hlepid[m]->GetYaxis()->SetTitle("@# of entries");
- 
-    Color_t color = kWhite;
-    if (m==0) color = kRed;
-    if (m==1) color = kYellow;
-    if (m==2) color = kBlue;
-    if (m==3) color = kGreen;
-    if (m==4) color = kBlack;
-    if (m==5) color = kWhite;
-    if (m==6) color = kMagenta;
-    if (m==7) color = kBlack;
-
-//     int style = 0;
-//     if (m==0) style = 3001;
-//     if (m==1) style = 3006;
-//     if (m==2) style = 3017;
-//     if (m==3) style = 3004;
-//     if (m==4) style = 3005;
-    
-    hptlep1[m]->SetFillColor(color);
-    hptlep2[m]->SetFillColor(color);
-    hcosll2D[m]->SetFillColor(color);
-    hcosll3D[m]->SetFillColor(color);
-    hMET[m]->SetFillColor(color);     
-    hmt[m]->SetFillColor(color);     
-    hcosMETPtlep[m]->SetFillColor(color);     
-    hmZll[m]->SetFillColor(color);    
-    hcosphi[m]->SetFillColor(color);     
-    hcosJetMET[m]->SetFillColor(color);     
-    hcone1[m]->SetFillColor(color);
-    hcone2[m]->SetFillColor(color);
-    hejet1[m]->SetFillColor(color);
-    hejet2[m]->SetFillColor(color);
-    hejet3[m]->SetFillColor(color);
-    hnjet[m]->SetFillColor(color);
-    hnel[m]->SetFillColor(color);
-    hnmu[m]->SetFillColor(color);
-    hnlep[m]->SetFillColor(color);
-    hlepid[m]->SetFillColor(color);
-
-//     hptlep1[m]->SetFillStyle(style);
-//     hptlep2[m]->SetFillStyle(style);
-//     hcosll2D[m]->SetFillStyle(style);
-//     hcosll3D[m]->SetFillStyle(style);
-//     hMET[m]->SetFillStyle(style);     
-//     hmt[m]->SetFillStyle(style);     
-//     hcosMETPtlep[m]->SetFillStyle(style);     
-//     hmZll[m]->SetFillStyle(style);    
-//     hcosphi[m]->SetFillStyle(style);     
-//     hcosJetMET[m]->SetFillStyle(style);     
-//     hcone1[m]->SetFillStyle(style);
-//     hcone2[m]->SetFillStyle(style);
-//     hejet1[m]->SetFillStyle(style);
-//     hejet2[m]->SetFillStyle(style);
-//     hejet3[m]->SetFillStyle(style);
-//     hnjet[m]->SetFillStyle(style);
-  }
-  
-  // variables of the ntuples are being declared below.  
-  
-  // cuts for AOD 
-  const double eptmin  = 10.0;
-  const double mptmin  = 10.0;
-  const double etamin   = 2.5;
-  const int    nlepcut  = 2;
-  const double METcut   = 90.0;
-  const double mZcut    = 20.;
-  const double mZ0      = 91.190;
-  
-  double modulus =0.;
-  double cosll2D = 0.;
-  double cosll3D = 0.;
-  double cosPhi = 0.;
-  double cosptlepMET = 0.;
-  double mt = 0.;
-  double pt2l = 0.;
-  double PX = 0.;
-  double PY = 0.;
-  double PT = 0.;
-  
-  double ptZ0 = 0.;
-  double eta1 = 0.;
-  double Cone1 = 0.;
-  double pt1 = 0.;
-  double px1 = 0.;
-  double py1 = 0.;
-  double pz1 = 0.;
-  double eta2 = 0.;
-  double Cone2 = 0.;
-  double px2 = 0.;
-  double py2 = 0.;
-  double pz2 = 0.;
-  double pt2 = 0.;
-  double cosjetmet = 0.;
-  
-  const double mass_e = 0.00051099892;
-  const double mass_mu = 0.105658369;
-  
-  int nb=0;
-  double portion;
-  bool last_rec=0;
-  
-  // open output file to save the cutflow results
-  ofstream outClientFile( "cutflow.dat", ios::out );
-  
-  // exit program if unable to open file
-  if ( !outClientFile ) {
-    cerr << "File could not be opened" << endl;
-    exit (1);
-  } // end if
-  
-  // create a new ROOT file
-  TFile f("preselection-HZ120-10jun.root","recreate");
-  
-  // create two TTree, one for signal, one for background
-  TTree treeS("TreeS","preselected signal events");
-  TTree treeB("TreeB","preselected background events");
-  
-  int njet;
-  int nlep = 0;
-  int nel = 0;;
-  int nmu = 0;
-  float ejet1 = 0.0;
-  float ejet2 = 0.0;
-  float ejet3 = 0.0;
-  float ptlep1;
-  float ptlep2;
-  float cone1;
-  float cone2;
-  float massZ;
-  float cosJetMET = 0.;
-  float cosll2d;
-  float cosll3d;
-  float mT;
-  float MET;
-  float cosMETptlep;
-  float cosphi;
-  
-  int lepID;
-  
-  int runnum;
-  int evtnum;
-  int type;
-  float w;
-  
-  // create one branch for each variable
-  
-  treeS.Branch("njet",&njet,"njet/I");	         
-  treeS.Branch("ejet1",&ejet1,"ejet1/F");	         
-  treeS.Branch("ejet2",&ejet2,"ejet2/F");	         
-  treeS.Branch("ejet3",&ejet3,"ejet3/F");	         
-  treeS.Branch("ptlep1",&ptlep1,"ptlep1/F");	         
-  treeS.Branch("ptlep2",&ptlep2,"ptlep2/F");	         
-  treeS.Branch("cone1",&cone1,"cone1/F");	         
-  treeS.Branch("cone2",&cone2,"cone2/F");	         
-  treeS.Branch("nel",&nel,"nel/I");	         
-  treeS.Branch("nmu",&nmu,"nmu/I");	         
-  treeS.Branch("nlep",&nlep,"nlep/I");	         
-  treeS.Branch("lepID",&lepID,"lepID/I");	         
-  treeS.Branch("massZ",&massZ,"massZ/F");	         
-  treeS.Branch("cosll2d",&cosll2d,"cosll2d/F");	         
-  treeS.Branch("cosll3d",&cosll3d,"cosll3d/F");	         
-  treeS.Branch("mT",&mT,"mT/F");	         
-  treeS.Branch("MET",&MET,"MET/F");	         
-  treeS.Branch("cosMETptlep",&cosMETptlep,"cosMETptlep/F");	         
-  treeS.Branch("cosJetMET",&cosJetMET,"cosJetMET/F");	         
-  treeS.Branch("cosphi",&cosphi,"cosphi/F");	         
-  treeS.Branch("runnum",&runnum,"runnum/I");
-  treeS.Branch("evtnum",&evtnum,"evtnum/I");
-  treeS.Branch("type",&type,"type/I");
-  treeS.Branch("w",&w,"w/F");
-  
-  treeB.Branch("njet",&njet,"njet/I");	         
-  treeB.Branch("ejet1",&ejet1,"ejet1/F");	         
-  treeB.Branch("ejet2",&ejet2,"ejet2/F");	         
-  treeB.Branch("ejet3",&ejet3,"ejet3/F");	         
-  treeB.Branch("ptlep1",&ptlep1,"ptlep1/F");	         
-  treeB.Branch("ptlep2",&ptlep2,"ptlep2/F");	         
-  treeB.Branch("cone1",&cone1,"cone1/F");	         
-  treeB.Branch("cone2",&cone2,"cone2/F");	         
-  treeB.Branch("nel",&nel,"nel/I");	         
-  treeB.Branch("nmu",&nmu,"nmu/I");	         
-  treeB.Branch("nlep",&nlep,"nlep/I");	         
-  treeB.Branch("lepID",&lepID,"lepID/I");	         
-  treeB.Branch("massZ",&massZ,"massZ/F");	         
-  treeB.Branch("cosll2d",&cosll2d,"cosll2d/F");	         
-  treeB.Branch("cosll3d",&cosll3d,"cosll3d/F");	         
-  treeB.Branch("mT",&mT,"mT/F");	         
-  treeB.Branch("MET",&MET,"MET/F");	         
-  treeB.Branch("cosMETptlep",&cosMETptlep,"cosMETptlep/F");	         
-  treeB.Branch("cosJetMET",&cosJetMET,"cosJetMET/F");	         
-  treeB.Branch("cosphi",&cosphi,"cosphi/F");	         
-  treeB.Branch("runnum",&runnum,"runnum/I");
-  treeB.Branch("evtnum",&evtnum,"evtnum/I");
-  treeB.Branch("type",&type,"type/I");
-  treeB.Branch("w",&w,"w/F");
-  
-  
-  // -----------------------------------------------------------
-  // ----------- loop over the various datasets ----------
-  // -----------------------------------------------------------
-  for (int n=0; n<ndatasets; n++) {
-    reject_MET[n] =0.;
-    reject_nlep[n] =0.;
-    reject_trigger[n] =0.;
-    reject_leppid[n] =0.;
-    reject_mZ[n] =0.;
-    reject_btag[n] =0.;
-    totalRejected[n] =0.;
-    sanity[n]=0;
-  }
-  
-  // loop over all datasets
-  for (int n=0; n<ndatasets; n++) {
-
-    found[n]=0;
-    TRandom * random = new TRandom3(seed);
-
-    
-    /***************** Getting file/tree from disk *********************/
-    // We define chain, which is basically a tree to add root files with the
-    // same tree name.  If you have two or more files, keep adding in the 
-    // nfchain variable.
-    
-    TChain *chain=0;
-    
-#ifdef CHAIN
-    //     chain = new TChain("EVCands");
-    chain = new TChain("EV0");
-    int nfchain=0;
-    
-// // //     //    ZZllll sample - 50k filtered events
-// // //          if (n==1) {
-// // //            sigmaBR[1] = 0.0670; 
-// // //            filterEff[1] = 0.219;
-// // //            typeNumber = 10;
-// // //            nfchain += chain->Add("/data/ntuples/ZZ4l_ntuple.root");}
-    
-//     // ChL SUSY sample - 35k
-//          if (n==1) {
-//            typeNumber = 1;
-//            nfchain += chain->Add("/data/ntuples/ChL_ntuple.root");}
-    
-    
-    // HZ110 sample - 50k filtered events
-    if (n==0 && eventType[0] == "HZ110") {
-      typeNumber = 0;
-      nfchain += chain->Add("/data/ntuples/mh110_ntuple.root");}
-
-    // HZ120 sample - 50k filtered events - filtered with multilepton filter
-    if (n==0 && eventType[0] == "HZ120") {
-      typeNumber = 0;
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00001.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00002.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00003.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00004.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00005.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00006.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00007.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00008.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00009.root");
-      nfchain += chain->Add("/data/HZ/user.PaulineGagnon.EV-HZinv-HZinv-006387_tid10758-2.AANT0._00010.root");}
-    
-    // HZ130 sample - 50k filtered events
-     if (n==0 && eventType[0] == "HZ130") {
-       typeNumber = 0;
-       nfchain += chain->Add("/data/ntuples/HZ130_ntuple.root");}
-    
-    // HZ140 sample - 50k filtered events
-     if (n==0 && eventType[0] == "HZ140") {
-       typeNumber = 0;
-       nfchain += chain->Add("/data/ntuples/HZ140_ntuple.root");}
-        
-    // HZ150 sample - 50k filtered events
-    if (n==0 && eventType[0] == "HZ150") {
-      typeNumber = 0;
-      nfchain += chain->Add("/data/ntuples/mh150_ntuple.root");}
-
-    // HZ200 sample - 50k filtered events
-    if (n==0 && eventType[0] == "HZ200") {
-      typeNumber = 0;
-      nfchain += chain->Add("/data/ntuples/mh200_ntuple.root");}
-
-    // HZ250 sample - 50k filtered events
-    if (n==0 && eventType[0] == "HZ250") {
-      typeNumber = 0;
-      nfchain += chain->Add("/data/ntuples/mh250_ntuple.root");}
-
-//     //ZZllnunu sample - 50k filtered events
-//     if (n==1) {
-//       typeNumber = 1;
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00001.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00002.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00003.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00004.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00005.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00006.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00007.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00008.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00009.root");
-//       nfchain += chain->Add("/data/ZZ/user.PaulineGagnon.EV-HZinv-ZZllnunu_006388_tid10759-2.AANT0._00010.root");}
-    
-    // ttbar sample - 120k filtered events
-     if (n==2) {
-      typeNumber = 2;
-      //                      nfchain += chain->Add("tt_ntuple_METref.root");} 
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00001.root.1");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00002.root.1");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00003.root");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00004.root");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00005.root");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00006.root");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00007.root");
-      nfchain += chain->Add("/data/ttbar/user.PaulineGagnon.EV-HZinv-ttblnublnu_006811_tid010042-2.AANT0._00008.root");
-      nfchain += chain->Add("/data/ntuples/tt6811_ntuple.root");}
-    
-   // WW sample - 35k, 200, 200, 35k
-    if (n==3) {
-      typeNumber = 3;
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00001.root.1");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00002.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00003.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00004.root.1");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00005.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00006.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00007.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enuenu_006807_tid10040-2.AANT0._00008.root");}
-
-    if (n==4) {
-      typeNumber = 3;
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_enumunu_006807_tid10764-2.AANT0._00001.root");}
-    
-    if (n==5) {
-      typeNumber = 3;
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munuenu_006809_tid010765-2.AANT0._00001.root");}
-    
-    if (n==6) {
-      typeNumber = 3;
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00001.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00002.root.1");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00003.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00004.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00005.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00006.root");
-      nfchain += chain->Add("/data/WW/user.PaulineGagnon.EV-HZinv-WpWm_munumunu_006810_tid009813-2.AANT0._00007.root");}
-    
-    // ZZtautaununu sample - 35k
-    if (n==7) {
-      typeNumber = 4;
-      nfchain += chain->Add("/data/ntuples/ZZtautaununu_ntuple.root");}
-    
-    // ZZlltautau sample - 35k
-         if (n==8) {
-           typeNumber = 5;
-           nfchain += chain->Add("/data/ntuples/ZZlltautau_ntuple.root");}
-    
-    // ZW+ sample - 50k
-         if (n==9) {
-           typeNumber = 6;
-           nfchain += chain->Add("/data/ntuples/WpZ_ntuple.root");}
-    
-    // ZW- sample - 50k
-         if (n==10) {
-           typeNumber = 6;
-           nfchain += chain->Add("/data/ntuples/WmZ_ntuple.root");}
-    
-     // Zincl sample -  run 6389 
-         if (n==11) {
-           typeNumber = 7;
-	   nfchain += chain->Add("/data/ntuples/Zee-ljets_ntuple.root");}
-
-     // Zincl sample -  run 6390 
-         if (n==12) {
-           typeNumber = 7;
-	 nfchain += chain->Add("/data/ntuples/Zee-bjets_ntuple.root");
-	 nfchain += chain->Add("/data/ntuples/Zee-bjets-2_ntuple.root");}
-
-     // Zincl sample -  run 6595 
-         if (n==13) {
-           typeNumber = 7;
-	   nfchain += chain->Add("/data/ntuples/Zmm-ljets_ntuple.root");}
-
-     // Zincl sample -  run 6596
-         if (n==14) {
-           typeNumber = 7;
-	   nfchain += chain->Add("/data/ntuples/Zmm-bjets_ntuple.root");
-	   nfchain += chain->Add("/data/ntuples/Zmm-bjets-2_ntuple.root");}
-    
-    int EVEventAndInstance;  EVEventAndInstance = 0;
-    int EVRunNumber;    EVRunNumber = 0;
-    
-    double MET_RefFinal_ex;  MET_RefFinal_ex = 0.0;
-    double MET_RefFinal_ey;  MET_RefFinal_ey = 0.0;
-    double MET_RefFinal_et;  MET_RefFinal_et = 0.0;
-    
-    //   double MissingEx;  MissingEx = 0.0;
-    //   double MissingEy;  MissingEy = 0.0;
-    //   double MissingEt;  MissingEt = 0.0;
-    
-    //   double MET_Truth_ex;  MET_Truth_ex = 0.0;
-    //   double MET_Truth_ey;  MET_Truth_ey = 0.0;
-    double MET_Truth_et;  MET_Truth_et = 0.0;
-    
-    int El_N;  El_N = 0;
-    std::vector<double> * El_px;  El_px = new std::vector<double>();
-    std::vector<double> * El_py;  El_py = new std::vector<double>();
-    std::vector<double> * El_pz;  El_pz = new std::vector<double>();
-    std::vector<double> * El_p_T; El_p_T = new std::vector<double>();
-    std::vector<double> * El_eta; El_eta = new std::vector<double>();
-    std::vector<int> * El_isEM;   El_isEM = new std::vector<int>();
-    std::vector<int> * El_author; El_author = new std::vector<int>();
-    std::vector<double> * El_pdgId; El_pdgId = new std::vector<double>();
-    std::vector<double> * El_trEtCone10; El_trEtCone10 = new std::vector<double>();
-    
-    int TEl_N;  TEl_N = 0;
-    std::vector<double> * TEl_p_T; TEl_p_T = new std::vector<double>();
-    std::vector<double> * TEl_eta; TEl_eta = new std::vector<double>();
-    
-    int Mu_N;  Mu_N = 0;
-    std::vector<double> * Mu_px;  Mu_px = new std::vector<double>();
-    std::vector<double> * Mu_py;  Mu_py = new std::vector<double>();
-    std::vector<double> * Mu_pz;  Mu_pz = new std::vector<double>();
-    std::vector<double> * Mu_p_T; Mu_p_T = new std::vector<double>();
-    std::vector<double> * Mu_eta; Mu_eta = new std::vector<double>();
-    std::vector<int>    * Mu_isCombinedMuon; Mu_isCombinedMuon = new std::vector<int>();
-    std::vector<int>    * Mu_bestMatch; Mu_bestMatch = new std::vector<int>();
-    std::vector<double> * Mu_pdgId; Mu_pdgId = new std::vector<double>();
-    std::vector<double> * Mu_trEtCone10; Mu_trEtCone10 = new std::vector<double>();
-    
-    int TMu_N;  TMu_N = 0;
-    std::vector<double> * TMu_p_T; TMu_p_T = new std::vector<double>();
-    std::vector<double> * TMu_eta; TMu_eta = new std::vector<double>();
-    
-    int Jet_N;  Jet_N = 0;
-    std::vector<double> * Jet_eta;  Jet_eta = new std::vector<double>();
-    std::vector<double> * Jet_E;    Jet_E = new std::vector<double>();
-    std::vector<double> * Jet_px;   Jet_px = new std::vector<double>();
-    std::vector<double> * Jet_py;   Jet_py= new std::vector<double>();
-    std::vector<double> * Jet_pz;   Jet_pz= new std::vector<double>();
-    std::vector<double> * Jet_p_T;  Jet_p_T= new std::vector<double>();
-    
-    std::vector<int> * Jet_BTagged;  Jet_BTagged= new std::vector<int>();
-    
-    // extract the trigger info
-    bool PassedL1; PassedL1 = false;
-    bool PassedL2; PassedL2 = false;
-    bool PassedEF; PassedEF= false;
-    bool PassedTrigger; PassedTrigger= false;
-    
-    bool PassedL1_EM25I; PassedL1_EM25I= false;
-    bool PassedL1_2EM15I; PassedL1_2EM15I= false;
-    
-    bool PassedL1_MU06; PassedL1_MU06= false;
-    bool PassedL1_MU08; PassedL1_MU08= false;
-    bool PassedL1_MU10; PassedL1_MU10= false;
-    bool PassedL1_MU11; PassedL1_MU11= false;
-    bool PassedL1_MU20; PassedL1_MU20= false;
-    bool PassedL1_MU40; PassedL1_MU40= false;
-    bool PassedL1_2MU06; PassedL1_2MU06= false;
-    
-    bool PassedL1_XE100; PassedL1_XE100= false;
-    bool PassedL1_XE50; PassedL1_XE50= false;
-    
-    bool PassedL2_e25i; PassedL2_e25i= false;
-    bool PassedL2_mu6; PassedL2_mu6= false;
-    bool PassedL2_mu6l; PassedL2_mu6l= false;
-    bool PassedL2_mu20i; PassedL2_mu20i= false;
-    
-    bool PassedEF_e10; PassedEF_e10= false;
-    bool PassedEF_e15iEF_e15i; PassedEF_e15iEF_e15i= false;
-    bool PassedEF_e25i; PassedEF_e25i= false;
-    bool PassedEF_mu6; PassedEF_mu6= false;
-    bool PassedEF_mu6l; PassedEF_mu6l= false;
-    bool PassedEF_mu20i; PassedEF_mu20i= false;
-    
-    double TrigEFMissingET_et; TrigEFMissingET_et = 0.0;
-    
-    int Z_N;  Z_N = 0;
-    std::vector<int> * Z_Zee;  Z_Zee = new std::vector<int>();
-    std::vector<int> * Z_Zmm;  Z_Zmm = new std::vector<int>();
-    std::vector<double> * Z_m;    Z_m = new std::vector<double>();
-    std::vector<double> * Z_E;    Z_E = new std::vector<double>();
-    std::vector<double> * Z_p_T;  Z_p_T = new std::vector<double>();
-    std::vector<double> * Z_px;   Z_px = new std::vector<double>();
-    std::vector<double> * Z_py;   Z_py = new std::vector<double>();
-    std::vector<double> * Z_eta;  Z_eta = new std::vector<double>();
-    
-    chain->SetBranchAddress("EVEventAndInstance",  &EVEventAndInstance);
-    chain->SetBranchAddress("EVRunNumber", &EVRunNumber);
-    
-    //   chain->SetBranchAddress("MissingEx", &MissingEx);
-    //   chain->SetBranchAddress("MissingEy", &MissingEy);
-    //   chain->SetBranchAddress("MissingEt", &MissingEt);
-    
-    chain->SetBranchAddress("MET_RefFinal_ex", &MET_RefFinal_ex);
-    chain->SetBranchAddress("MET_RefFinal_ey", &MET_RefFinal_ey);
-    chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-    
-    chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-    
-    //   chain->SetBranchAddress("MET_Truth_ex", &MET_Truth_ex);
-    //   chain->SetBranchAddress("MET_Truth_ey", &MET_Truth_ey);
-    chain->SetBranchAddress("MET_Truth_et", &MET_Truth_et);
-    
-    chain->SetBranchAddress("El_N",&El_N);
-    chain->SetBranchAddress("El_px",&El_px);
-    chain->SetBranchAddress("El_py",&El_py);
-    chain->SetBranchAddress("El_pz",&El_pz);
-    chain->SetBranchAddress("El_p_T",&El_p_T);
-    chain->SetBranchAddress("El_eta",&El_eta);
-    chain->SetBranchAddress("El_pdgId",&El_pdgId);
-    chain->SetBranchAddress("El_isEM",&El_isEM);
-    chain->SetBranchAddress("El_author",&El_author);
-    chain->SetBranchAddress("El_trEtCone10",&El_trEtCone10);
-    
-    chain->SetBranchAddress("TEl_N",&TEl_N);
-    chain->SetBranchAddress("TEl_p_T",&TEl_p_T);
-    chain->SetBranchAddress("TEl_eta",&TEl_eta);
-    
-    chain->SetBranchAddress("Mu_N",&Mu_N);
-    chain->SetBranchAddress("Mu_px",&Mu_px);
-    chain->SetBranchAddress("Mu_py",&Mu_py);
-    chain->SetBranchAddress("Mu_pz",&Mu_pz);
-    chain->SetBranchAddress("Mu_p_T",&Mu_p_T);
-    chain->SetBranchAddress("Mu_eta",&Mu_eta);
-    chain->SetBranchAddress("Mu_pdgId",&Mu_pdgId);
-    chain->SetBranchAddress("Mu_isCombinedMuon",&Mu_isCombinedMuon);
-    chain->SetBranchAddress("Mu_bestMatch",&Mu_bestMatch);
-    chain->SetBranchAddress("Mu_trEtCone10",&Mu_trEtCone10);
-    
-    chain->SetBranchAddress("TMu_N",&TMu_N);
-    chain->SetBranchAddress("TMu_p_T",&TMu_p_T);
-    chain->SetBranchAddress("TMu_eta",&TMu_eta);
-    
-    chain->SetBranchAddress("Jet_N",&Jet_N);
-    chain->SetBranchAddress("Jet_eta",&Jet_eta);
-    chain->SetBranchAddress("Jet_E",&Jet_E);
-    chain->SetBranchAddress("Jet_px",&Jet_px);
-    chain->SetBranchAddress("Jet_py",&Jet_py);
-    chain->SetBranchAddress("Jet_pz",&Jet_pz);
-    chain->SetBranchAddress("Jet_p_T",&Jet_p_T);
-    chain->SetBranchAddress("Jet_BTagged",&Jet_BTagged);
-    
-    chain->SetBranchAddress("PassedL1",&PassedL1);
-    chain->SetBranchAddress("PassedL2",&PassedL2);
-    chain->SetBranchAddress("PassedEF",&PassedEF);
-    chain->SetBranchAddress("PassedTrigger",&PassedTrigger);
-    
-    chain->SetBranchAddress("PassedL1_EM25I",&PassedL1_EM25I);
-    chain->SetBranchAddress("PassedL1_2EM15I",&PassedL1_2EM15I);
-    
-    chain->SetBranchAddress("PassedL1_MU06",&PassedL1_MU06);
-    chain->SetBranchAddress("PassedL1_MU08",&PassedL1_MU08);
-    chain->SetBranchAddress("PassedL1_MU10",&PassedL1_MU10);
-    chain->SetBranchAddress("PassedL1_MU11",&PassedL1_MU11);
-    chain->SetBranchAddress("PassedL1_MU20",&PassedL1_MU20);
-    chain->SetBranchAddress("PassedL1_MU40",&PassedL1_MU40);
-    chain->SetBranchAddress("PassedL1_2MU06",&PassedL1_2MU06);
-    
-    chain->SetBranchAddress("PassedL1_XE100",&PassedL1_XE100);
-    chain->SetBranchAddress("PassedL1_XE50",&PassedL1_XE50);
-    
-    chain->SetBranchAddress("PassedL2_e25i",&PassedL2_e25i);
-    chain->SetBranchAddress("PassedL2_mu6",&PassedL2_mu6);
-    chain->SetBranchAddress("PassedL2_mu6l",&PassedL2_mu6l);
-    chain->SetBranchAddress("PassedL2_mu20i",&PassedL2_mu20i);
-    
-    chain->SetBranchAddress("PassedEF_e10",&PassedEF_e10);
-    chain->SetBranchAddress("PassedEF_e15iEF_e15i",&PassedEF_e15iEF_e15i);
-    chain->SetBranchAddress("PassedEF_e25i",&PassedEF_e25i);
-    chain->SetBranchAddress("PassedEF_mu6",&PassedEF_mu6);
-    chain->SetBranchAddress("PassedEF_mu6l",&PassedEF_mu6l);
-    chain->SetBranchAddress("PassedEF_mu20i",&PassedEF_mu20i);
-    
-    chain->SetBranchAddress("TrigEFMissingET_et",&TrigEFMissingET_et);
-    
-    chain->SetBranchAddress("Z_N",&Z_N);
-    chain->SetBranchAddress("Z_Zee",&Z_Zee);
-    chain->SetBranchAddress("Z_Zmm",&Z_Zmm);
-    
-    int nrecords = static_cast<int>(0.5 + chain->GetEntries());
-    
-    int nticker  = static_cast<int>(0.5 + nrecords/20.0);
-    
-    nrec[n] = nrecords;
-    
-    // The above is to find the number of events or entries
-#endif // CHAIN 
-    
-    if (n == 0) {
-      outClientFile << "      " <<  endl;
-      outClientFile << "MET cut > " << METcut << endl;
-      outClientFile << "pt cuts for leptons: e > " << eptmin << " and mu > " << mptmin <<" GeV with eta < " << etamin << endl;
-      outClientFile << "nlep strictly equal to " << nlepcut << endl; //" and njet less or equal to " << njetcut << endl;	 	   
-      outClientFile << "mZ within " << mZcut << " GeV of on-shell mass " << endl;
-      outClientFile << endl;	  
-    }
-    
-    double mZ = 0.;
-    
-    // evaluate the weight for this type of events
-    generated[n] = nrec[n]/filterEff[n]; 
-    cout << n << " generated: " << generated[n] << " nrec: " << nrec[n] << endl;
-    weight[n] = (sigmaBR[n] * lumi)/generated[n];
-
-    // ============  Starting the main loop over the events  ===============
-    for (int i=0; i<nrec[n]; i++) {  
-      
-      if(div(i, nticker).rem == 0 || i >= nrec[n]-1) 
-	{ 
-	  portion=static_cast<float>(i) / static_cast<float>(nrec[n]-1);
-	  printf("Done %4.1f percent of reading the NTuple  ", portion*100.0);
-	  cout.flush();   cout << char(13);  
-	}
-      
-      last_rec=(i>=nrec[n]-1); 
-      
-      if(!last_rec)  {
-#ifdef CHAIN
-	nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-	nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-      }
-      
-      // Reading the i-th (current) record:
-      
-#ifdef CHAIN
-      nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-      nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-      
-      int accepted_e = 0;
-      double Zmasse[25];
-      int elep1[25];
-      int elep2[25];
-      
-      int accepted_m = 0;
-      double Zmassm[25];
-      int mlep1[25];
-      int mlep2[25];
-      
-      int bestj = 0;
-      int bestk = 0;
-      int bestid = 0;
-      
-      //loop over all electrons and count the good ones
-
-      nel = 0;
-      for(int j=0; j<El_N; j++) {
-	if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-	  nel++;
-	}}
-      
-      //loop over all pairs of muons and only select the good ones
-      nmu = 0;
-      for(int j=0; j<Mu_N; j++) {
-	if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-	  nmu++;
-	}}
-      
-      // store the total number of good leptons
-      nlep = nel + nmu;
-      
-      MET_RefFinal_ex /=1000.;
-      MET_RefFinal_ey /=1000.; 
-      MET_RefFinal_et /=1000.;
-      
-      MET_Truth_et /=1000.;
-
-// unsmeared electrons
-      for(int j=0; j<El_N; j++) {
-	(*El_px)[j] /= 1000.;
-	(*El_py)[j] /= 1000.;
-	(*El_pz)[j] /= 1000.;
-	(*El_p_T)[j] /= 1000.;
-	(*El_trEtCone10)[j] /= 1000.;
-      }
-
-// unsmeared muons
-      for(int j=0; j<Mu_N; j++) {
-	(*Mu_px)[j] /= 1000.;
-	(*Mu_py)[j] /= 1000.;
-	(*Mu_pz)[j] /= 1000.;
-	(*Mu_p_T)[j] /= 1000.;
-	(*Mu_trEtCone10)[j] /= 1000.;
-      }
-
-// unsmeared jets
-      for(int j=0; j<Jet_N; j++) {
-	(*Jet_px)[j] /= 1000.;
-	(*Jet_py)[j] /= 1000.;
-	(*Jet_pz)[j] /= 1000.;
-	(*Jet_p_T)[j] /= 1000.;
-	(*Jet_E)[j] /= 1000.;
-      }
-
-   for(int j=0; j<El_N; j++) {
-     (*TEl_p_T)[j] /= 1000.;
-   }
-   for(int j=0; j<Mu_N; j++) {
-     (*TMu_p_T)[j] /= 1000.;
-   }
-      
-   if (!PassedEF_e15iEF_e15i && !PassedEF_e25i && !PassedEF_mu6 && !PassedEF_mu6l && !PassedEF_mu20i && !PassedL1_XE100) {
-     reject_trigger[n]++;}
-   if (PassedEF_e15iEF_e15i || PassedEF_e25i || PassedEF_mu6 || PassedEF_mu6l || PassedEF_mu20i || PassedL1_XE100) {
-     
-     if (!PassedEF_e15iEF_e15i && !PassedEF_e25i && !PassedEF_mu6 && !PassedEF_mu6l && !PassedEF_mu20i) L1XET100[n]++;
-     
-	// count Zee and Zmm before and after the MET cut
-	for(int j=0; j<Z_N; j++) {
-	  if ((*Z_Zee)[j] == 1) zee0[n]++;
-	  if ((*Z_Zmm)[j] == 1) zmm0[n]++;
-	}
-	hMET[typeNumber]->Fill(MET_RefFinal_et,weight[n]);
-	if (MET_RefFinal_et < METcut) reject_MET[n]++;
-	if (MET_RefFinal_et >= METcut) {
-	  
-	  for(int j=0; j<Z_N; j++) {
-	    if ((*Z_Zee)[j] == 1) zee1[n]++;
-	    if ((*Z_Zmm)[j] == 1) zmm1[n]++;
-	  }
-	  
-	  int twoelectrons=0;
-	  //loop over all pairs of electrons 
-	  for(int j=0; j<El_N-1; j++) {
-	    if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-	      for(int k=j+1; k<El_N; k++) {
-		if (fabs((*El_eta)[k]) <= etamin && (*El_p_T)[k] > eptmin && ((*El_isEM)[k]&0x7)==0) {
-		  
-		  //lepid cut
-		  //	       if((*El_pdgId)[j] != -(*El_pdgId)[k]) {cout << "electron id: " << (*El_pdgId)[j] << "\t" << (*El_pdgId)[k] << endl;}
-		  if((*El_pdgId)[j] == -(*El_pdgId)[k]) {
-		    twoelectrons=1;
-		    
-		    px1 = (*El_px)[j];
-		    py1 = (*El_py)[j];
-		    pz1 = (*El_pz)[j];
-		    pt1 = (*El_p_T)[j];
-		    eta1 = (*El_eta)[j];
-		    px2 = (*El_px)[k];
-		    py2 = (*El_py)[k];
-		    pz2 = (*El_pz)[k];
-		    pt2 = (*El_p_T)[k];
-		    eta2 = (*El_eta)[k];
-		    
-		    // calculate the Z invariant mass 
-		    double px = px1+px2;
-		    double py = py1+py2;
-		    double pz = pz1+pz2;
-		    double pZ = px*px +py*py +pz*pz;
-		    double ml = mass_e;
-		    double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-		    double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-		    double eZ = sqrt(e1) + sqrt(e2);
-		    mZ = eZ*eZ - pZ;
-		    if (mZ > 0.0) {mZ = sqrt(mZ);}
-		    else {mZ = -1.0;}
-// 		    if (typeNumber == 6 && counter < 10) cout << "mZ = " << mZ << endl;
-// 		    if (typeNumber == 6) counter++;
-		    
-		    //count the number of accepted pairs
-		    //		 cout << "reconstructed mZ = " << mZ << endl;
-		    if (abs(mZ - mZ0) <= mZcut) {
-		      
-		      if (accepted_e > 24) {cout << " too many accepted_e pairs, stop!!! accepted_e = " << accepted_e << endl;exit(-1);}
-		      Zmasse[accepted_e] = mZ;
-		      elep1[accepted_e]  = j;
-		      elep2[accepted_e]  = k;
-		      accepted_e++;}
-		    
-		  } //  end-if on lepid
-		} // end if acceptance criteria for second electron
-	      } // end of for-loop on second electron
-	    } // end if acceptance criteria for first electron
-	  } // end of for-loop on first electron
-	  
-	  
-	  //loop over all pairs of muons 
-	  int twomuons = 0;
-	  for(int j=0; j<Mu_N-1; j++) {
-	    if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-	      for(int k=j+1; k<Mu_N; k++) {
-		if (fabs((*Mu_eta)[k]) <= etamin && (*Mu_p_T)[k] > mptmin && (*Mu_isCombinedMuon)[k] == 1 && (*Mu_bestMatch)[k] == 1) {
-		  
-		  //lepid cut
-		  if((*Mu_pdgId)[j] == -(*Mu_pdgId)[k]) {
-		    twomuons = 1;
-		    px1 =  (*Mu_px)[j];
-		    py1 =  (*Mu_py)[j];
-		    pz1 =  (*Mu_pz)[j];
-		    pt1 =  (*Mu_p_T)[j];
-		    eta1 = (*Mu_eta)[j];
-		    px2 =  (*Mu_px)[k];
-		    py2 =  (*Mu_py)[k];
-		    pz2 =  (*Mu_pz)[k];
-		    pt2 =  (*Mu_p_T)[k];
-		    eta2 = (*Mu_eta)[k];
-		    
-		    // calculate the Z invariant mass 
-		    double px = px1+px2;
-		    double py = py1+py2;
-		    double pz = pz1+pz2;
-		    double pZ = px*px +py*py +pz*pz;
-		    double ml = mass_mu;
-		    double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-		    double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-		    double eZ = sqrt(e1) + sqrt(e2);
-		    mZ = eZ*eZ - pZ;
-		    if (mZ > 0.0) {mZ = sqrt(mZ);}
-		    else {mZ = -1.0;}
-
-// add a Breit-Wigner distribution to ZW events
-		    if (typeNumber == 6) {
-		      double mZmean = mZ;
-		      double mZwidth = 2.4952;
-		      mZ = random->BreitWigner(mZmean, mZwidth);
-		      //		      if (counter < 10) cout << "mZ = " << mZ << endl;
-		      counter++;
-		    }
-		    
-		    //count the number of accepted_m pairs
-		    //		 cout << "reconstructed mZ = " << mZ << endl;
-		    if (abs(mZ - mZ0) <= mZcut) {
-		      
-		      if (accepted_m > 24) {cout << " too many accepted_m pairs, stop!!! accepted_m = " << accepted_m << endl;exit(-1);}
-		      Zmassm[accepted_m] = mZ;
-		      mlep1[accepted_m]  = j;
-		      mlep2[accepted_m]  = k;
-		      accepted_m++;}
-		    
-		  } //  end-if on lepid
-		} // end if acceptance criteria for second muon
-	      } // end of for-loop on second muon
-	    } // end if acceptance criteria for first muon
-	  } // end of for-loop on first muon
-	  
-	  //	   cout << "found " << electrons << " good electrons and  " << nmu << " good muons  "<< endl;
-	  
-	  // sanity check: make sure we count only one per event
-	  sanity[n]++;
-	  
-	  // nlepcut
-	  if ((twoelectrons == 0 && twomuons == 0) || nlep != 2) {
-	    reject_nlep[n]++;}
-	  
-	  if ((twoelectrons == 1 || twomuons == 1) && nlep == 2) {
-	    if (twoelectrons == 1 && twomuons == 1) doublepair[n]++;
-	    
-	    //         afterNlep[n]++;
-	    
-	    // continue only when a good pair has been found
-	    if (accepted_m == 0 && accepted_e == 0 ) {reject_mZ[n]++;;}
-	    if (accepted_m+accepted_e > 0) {
-	      if (nlep == 1) cout << "nlep == 1 and nmu = " << nmu << " nmel :" << nel << " accepted_mu = " << accepted_m << endl;  
-	      
-	      
-	      //	   afterMz[n]++;
-	      //retain only the best pair
-
-	      mZ=0.;
-	      for (int m=0; m<accepted_e; m++) {
-		mZ = (( abs(mZ0 - mZ) < abs(mZ0 - Zmasse[m])) ? mZ : Zmasse[m]);
-		if (mZ == Zmasse[m]) {bestj = elep1[m]; bestk = elep2[m]; bestid=11;}
-	      }
-	      for (int m=0; m<accepted_m; m++) {
-		mZ = (( abs(mZ0 - mZ) < abs(mZ0 - Zmassm[m])) ? mZ : Zmassm[m]);
-		if (mZ == Zmassm[m]) {bestj = mlep1[m]; bestk = mlep2[m]; bestid=13;}
-	      }
-	      
-	      // apply an anti-btag on events containing a jet
-
-	      int btagOK=1;
-	      for(int l=0; l<Jet_N; l++) {
-		//	     cout << (*Jet_BTagged)[l] << endl;
-		if ((*Jet_BTagged)[l] == 1) {
-		  //   	       cout << "(*Jet_BTagged)[l]: " << (*Jet_BTagged)[l] << endl;
-		  btagOK=0;}
-	      }
-	      
-	      if (btagOK == 0) {reject_btag[n]++;}
-	      if (btagOK == 1) {
-		
-		// count how many ee and mm pairs are found	 
-		if (bestid == 11) zee[n]++;
-		if (bestid == 13) zmm[n]++;
-		
-		// done with selection
-		found[n]++;
-		
-// do the smearing here for systematics error
-
-// 		double new_MET_ex = MET_RefFinal_ex;
-// 		double new_MET_ey = MET_RefFinal_ey;
-// 		double new_MET_et = MET_RefFinal_et;
-// 		double old_MET_et = MET_RefFinal_et;
-      
-
-// // add 0.73% gaussian smearing to ptlep for electrons and readjust MET
-// // gaussian distribution
-// 		double mean = 1.0;
-// 		double sigma = 0.0073;
-// 		double gaussian = random->Gaus(mean, sigma);
-// // 		for(int j=0; j<El_N; j++) {
-// 		  gaussian = random->Gaus(mean, sigma);
-// 		  double new_px = (*El_px)[j] * gaussian;
-// //       	cout << "pxlep before: " << (*El_px)[j] << " pxlep after: " << new_px << " % delta px: " << 100.0*((*El_px)[j] - new_px)/(*El_px)[j] << endl;
-// 		  new_MET_ex = new_MET_ex + (*El_px)[j] - new_px;
-// 		  (*El_px)[j] = new_px;
-
-// 		  gaussian = random->Gaus(mean, sigma);
-// 		  double new_py = (*El_py)[j] * gaussian;
-// //       	cout << "pylep before: " << (*El_py)[j] << " pylep after: " << new_py << " % delta py: " << 100.0*((*El_py)[j] - new_py)/(*El_py)[j] << endl;
-// 		  new_MET_ey = new_MET_ey + (*El_py)[j] - new_py;
-// 		  (*El_py)[j] = new_py;
-
-// 		  gaussian = random->Gaus(mean, sigma);
-// 		  (*El_pz)[j] *= gaussian;
-
-// 		  (*El_p_T)[j] = sqrt((new_px*new_px)+(new_py*new_py));
-// 		}
-
-// 		if (El_N > 0) {
-// 		  new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 		  MET_RefFinal_ex = new_MET_ex;
-// 		  MET_RefFinal_ey = new_MET_ey;
-// 		  MET_RefFinal_et = new_MET_et;
-// 		  hgauss1->Fill(old_MET_et);
-// 		  hgauss2->Fill(new_MET_et);
-// 		}
-
-// add 0.5% scaling factor to the electron energy scale
-
-// 		for(int j=0; j<El_N; j++) {
-// 		  double new_px = (*El_px)[j]*1.005;
-// //       	cout << "pxlep before: " << (*El_px)[j] << " pxlep after: " << new_px << " % delta px: " << 100.0*((*El_px)[j] - new_px)/(*El_px)[j] << endl;
-// 		  new_MET_ex = new_MET_ex + (*El_px)[j] - new_px;
-// 		  (*El_px)[j] = new_px;
-
-// 		  double new_py = (*El_py)[j]*1.005;
-// //       	cout << "pylep before: " << (*El_py)[j] << " pylep after: " << new_py << " % delta py: " << 100.0*((*El_py)[j] - new_py)/(*El_py)[j] << endl;
-// 		  new_MET_ey = new_MET_ey + (*El_py)[j] - new_py;
-// 		  (*El_py)[j] = new_py;
-
-// 		  (*El_pz)[j] *= 1.005;
-
-// 		  double new_pt = sqrt((new_px*new_px)+(new_py*new_py));
-// 		  double delta = 100.0*((*El_p_T)[j] - new_pt)/(*El_p_T)[j];
-// 		  (*El_p_T)[j] = new_pt;
-// 		}
-
-// 		if (El_N > 0) {
-// 		  new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 		  MET_RefFinal_ex = new_MET_ex;
-// 		  MET_RefFinal_ey = new_MET_ey;
-// 		  MET_RefFinal_et = new_MET_et;
-// 		  hgauss1->Fill(old_MET_et);
-// 		  hgauss2->Fill(new_MET_et);
-// 		}
-
-
-// add smearing to ptlep for muons according to special formula
-// sigma = 0.011*pT + 0.00017*pT^2 added in quadrature
-  
-//      mean = 1.0;
-//       for(int j=0; j<Mu_N; j++) {
-// 	sigma = sqrt(0.011*(*Mu_p_T)[j]*0.011*(*Mu_p_T)[j] + 0.00017*0.00017*(*Mu_p_T)[j]*(*Mu_p_T)[j]*(*Mu_p_T)[j]*(*Mu_p_T)[j]);
-
-//         if ((*Mu_p_T)[j] > 0.0) sigma /= (*Mu_p_T)[j];
-//         if ((*Mu_p_T)[j] <= 0.0) sigma = 0.0;
-// 	gaussian = random->Gaus(mean, sigma);
-// 	//	cout << sigma << "\t" << (*Mu_p_T)[j] << "\t" << gaussian << endl;
-// 	new_MET_ex = new_MET_ex + (*Mu_px)[j];
-// 	(*Mu_px)[j] *= gaussian;
-// 	new_MET_ex = new_MET_ex - (*Mu_px)[j];
-
-// 	gaussian = random->Gaus(mean, sigma);
-// 	new_MET_ey = new_MET_ey + (*Mu_py)[j];
-// 	(*Mu_py)[j] *= gaussian;
-// 	new_MET_ey = new_MET_ey - (*Mu_py)[j];
-
-// 	gaussian = random->Gaus(mean, sigma);
-// 	(*Mu_pz)[j] *= gaussian;
-
-// 	(*Mu_p_T)[j] = sqrt((*Mu_px)[j]*(*Mu_px)[j]+(*Mu_py)[j]*(*Mu_py)[j]);
-//       }
-
-//       if (Mu_N > 0) {
-// 	new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 	MET_RefFinal_ex = new_MET_ex;
-// 	MET_RefFinal_ey = new_MET_ey;
-// 	MET_RefFinal_et = new_MET_et;
-// 	hgauss1->Fill(old_MET_et);
-// 	hgauss2->Fill(new_MET_et);
-//       }
-
-// scaling factor of 1% on the muon energy scale
-// 		for(int j=0; j<Mu_N; j++) {
-// 		  double new_px = (*Mu_px)[j]*0.99;
-// //       	cout << "pxlep before: " << (*Mu_px)[j] << " pxlep after: " << new_px << " % delta px: " << 100.0*((*Mu_px)[j] - new_px)/(*Mu_px)[j] << endl;
-// 		  new_MET_ex = new_MET_ex + (*Mu_px)[j] - new_px;
-// 		  (*Mu_px)[j] = new_px;
-
-// 		  double new_py = (*Mu_py)[j]*0.99;
-// //       	cout << "pylep before: " << (*Mu_py)[j] << " pylep after: " << new_py << " % delta py: " << 100.0*((*Mu_py)[j] - new_py)/(*Mu_py)[j] << endl;
-// 		  new_MET_ey = new_MET_ey + (*Mu_py)[j] - new_py;
-// 		  (*Mu_py)[j] = new_py;
-
-// 		  (*Mu_pz)[j] *= 0.99;
-
-// 		  double new_pt = sqrt((new_px*new_px)+(new_py*new_py));
-// 		  double delta = 100.0*((*Mu_p_T)[j] - new_pt)/(*Mu_p_T)[j];
-// 		  (*Mu_p_T)[j] = new_pt;
-// 		}
-
-// 		if (Mu_N > 0) {
-// 		  new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 		  MET_RefFinal_ex = new_MET_ex;
-// 		  MET_RefFinal_ey = new_MET_ey;
-// 		  MET_RefFinal_et = new_MET_et;
-// 		  hgauss1->Fill(old_MET_et);
-// 		  hgauss2->Fill(new_MET_et);
-// 		}
-
-// add 7% or 15% scaling factor to the jet energy scale - Higgs group approach
-
-// 		for(int j=0; j<Jet_N; j++) {
-// 		  double new_px = 0.0;
-// 		  double new_py = 0.0;
-// 		  double new_pz = 0.0;
-// // 		  new_MET_ex = new_MET_ex + 0.05*(*Jet_px)[j];
-// // 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_px = (*Jet_px)[j]*0.93;
-// // 		  if (fabs((*Jet_eta)[j]) <  3.2) new_px = (*Jet_px)[j]*0.85;
-// // 		  (*Jet_px)[j] = new_px;
-
-// // 		  new_MET_ey = new_MET_ey + 0.05*(*Jet_py)[j];
-// // 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_py = (*Jet_py)[j]*0.93;
-// // 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_py = (*Jet_py)[j]*0.85;
-// // 		  (*Jet_py)[j] = new_py;
-
-// // 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_pz = (*Jet_pz)[j]*0.93;
-// // 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_pz = (*Jet_pz)[j]*0.85;
-// // 		  (*Jet_pz)[j] = new_pz;
-
-// 		  new_MET_ex = new_MET_ex - 0.05*(*Jet_px)[j];
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_px = (*Jet_px)[j]*1.07;
-// 		  if (fabs((*Jet_eta)[j]) <  3.2) new_px = (*Jet_px)[j]*1.15;
-// 		  (*Jet_px)[j] = new_px;
-
-// 		  new_MET_ey = new_MET_ey - 0.05*(*Jet_py)[j];
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_py = (*Jet_py)[j]*1.07;
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_py = (*Jet_py)[j]*1.15;
-// 		  (*Jet_py)[j] = new_py;
-
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_pz = (*Jet_pz)[j]*1.07;
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) new_pz = (*Jet_pz)[j]*1.15;
-// 		  (*Jet_pz)[j] = new_pz;
-
-// 		  double new_pt = sqrt((new_px*new_px)+(new_py*new_py));
-// 		  double delta = 100.0*((*Jet_p_T)[j] - new_pt)/(*Jet_p_T)[j];
-// 		  (*Jet_p_T)[j] = new_pt;
-//  		}
-
-// 		if (Jet_N > 0) {
-// 		  new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 		  //		  cout << new_MET_et << "\t " << new_MET_ex << "\t " << new_MET_ey << endl;
-// 		  MET_RefFinal_ex = new_MET_ex;
-// 		  MET_RefFinal_ey = new_MET_ey;
-// 		  MET_RefFinal_et = new_MET_et;
-// 		  hgauss1->Fill(old_MET_et);
-// 		  hgauss2->Fill(new_MET_et);
-// 		}
-
-// jet energy resolution: add gaussian smearing to jets and readjust MET
-// gaussian distribution 
-// May 5, 2008: use the same correction factor in x, y, and z , not two independant ones
-// 		double mean = 1.0;
-// 		double sigma = 0.0;
-// 		double gaussian = 1.0;
-
-// 		for(int j=0; j<Jet_N; j++) {
-// 		  if (fabs((*Jet_eta)[j]) <= 3.2) sigma = (0.45 * sqrt((*Jet_E)[j]))/(*Jet_E)[j];
-// 		  if (fabs((*Jet_eta)[j]) > 3.2)  sigma = (0.63 * sqrt((*Jet_E)[j]))/(*Jet_E)[j];
-// 		  gaussian = random->Gaus(mean, sigma);
-
-// 		  //		  cout << (*Jet_E)[j] << "\t" << sigma << "\t" << gaussian << endl;
-
-// 		  double new_px = (*Jet_px)[j] * gaussian;
-// //        	cout << "Jet px before: " << (*Jet_px)[j] << " jet px after: " << new_px << " % delta px: " << 100.0*((*Jet_px)[j] - new_px)/(*Jet_px)[j] << endl;
-// 		  new_MET_ex = new_MET_ex + (*Jet_px)[j] - new_px;
-// 		  (*Jet_px)[j] = new_px;
-
-// 		  //		  gaussian = random->Gaus(mean, sigma);
-// 		  double new_py = (*Jet_py)[j] * gaussian;
-// //        	cout << "Jet py before: " << (*Jet_py)[j] << " jet py after: " << new_py << " % delta py: " << 100.0*((*Jet_py)[j] - new_py)/(*Jet_py)[j] << endl;
-// 		  new_MET_ey = new_MET_ey + (*Jet_py)[j] - new_py;
-// 		  (*Jet_py)[j] = new_py;
-
-// 		  //		  gaussian = random->Gaus(mean, sigma);
-// 		  (*Jet_pz)[j] *= gaussian;
-
-// 		  (*Jet_p_T)[j] = sqrt((new_px*new_px)+(new_py*new_py));
-// 		}
-
-// 		if (Jet_N > 0) {
-// 		  new_MET_et = sqrt(new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey);
-// 		  MET_RefFinal_ex = new_MET_ex;
-// 		  MET_RefFinal_ey = new_MET_ey;
-// 		  MET_RefFinal_et = new_MET_et;
-// 		  hgauss1->Fill(old_MET_et);
-// 		  hgauss2->Fill(new_MET_et);
-// 		}
-
-		px1  = -999.;
-		py1  = -999.;
-		pz1  = -999.;
-		pt1  = -999.;
-		eta1 = -999.;
-		Cone1= -999.;
-		px2  = -999.;
-		py2  = -999.;
-		pz2  = -999.;
-		pt2  = -999.;
-		eta2 = -999.;
-		Cone2= -999.;
-		
-		// reload info on the best pair of leptons
-		if (abs(bestid) == 11) {
-		  px1  = (*El_px)[bestj];
-		  py1  = (*El_py)[bestj];
-		  pz1  = (*El_pz)[bestj];
-		  pt1  = (*El_p_T)[bestj];
-		  eta1 = (*El_eta)[bestj];
-		  Cone1= float((*El_trEtCone10)[bestj]);
-		  px2  = (*El_px)[bestk];
-		  py2  = (*El_py)[bestk];
-		  pz2  = (*El_pz)[bestk];
-		  pt2  = (*El_p_T)[bestk];
-		  eta2 = (*El_eta)[bestk];
-		  Cone2= float((*El_trEtCone10)[bestk]);
-		}
-		if (abs(bestid) == 13) {
-		  px1  = (*Mu_px)[bestj];
-		  py1  = (*Mu_py)[bestj];
-		  pz1  = (*Mu_pz)[bestj];
-		  pt1  = (*Mu_p_T)[bestj];
-		  eta1 = (*Mu_eta)[bestj];
-		  Cone1= float((*Mu_trEtCone10)[bestj]);
-		  px2  = (*Mu_px)[bestk];
-		  py2  = (*Mu_py)[bestk];
-		  pz2  = (*Mu_pz)[bestk];
-		  pt2  = (*Mu_p_T)[bestk];
-		  eta2 = (*Mu_eta)[bestk];
-		  Cone2= float((*Mu_trEtCone10)[bestk]);
-		}
-		// calculate a few more variables for likelihood function for the best lepton pair
-		double px = px1+px2;
-		double py = py1+py2;
-		modulus = sqrt(px1*px1 + py1*py1 + pz1*pz1) * sqrt(px2*px2 + py2*py2 + pz2*pz2);
-		cosll3D = (px1*px2 +py1*py2 + pz1*pz2)/ modulus;
-		if (abs(cosll3D) > 1.0 ) {cout << "cosll3d > 1: " << "\t " << cosll3D << "\t " << px1 << "\t " 
-					       << pz1 << "\t " << py1 << "\t " << px2 << "\t " << py2 << "\t " << pz2 << "\t " << modulus << endl;}
-		modulus = sqrt(px1*px1 + py1*py1) * sqrt(px2*px2 + py2*py2);
-		cosll2D = (px1*px2 + py1*py2)/ modulus;
-		if (abs(cosll2D) > 1.0 ) {cout << "cosll2d > 1: " << "\t " << cosll2D << "\t " << px1 << "\t " 
-					       << py1 << "\t " << px2 << "\t " << py2 << "\t " << modulus << endl;}
-		pt2l    = sqrt(px*px + py*py);
-		
-		// calculate the angle between MET_RefFinal_Et and PtZ 
-		cosPhi  = (px*MET_RefFinal_ex + py*MET_RefFinal_ey)/(pt2l*MET_RefFinal_et);
-		
-		// calculate the transverse mass
-		mt      = sqrt(2.0*pt2l*MET_RefFinal_et*(1.0-cosPhi));
-		
-		// calculate cosJetMET: cosine between promptest jet and MET direction in transverse plane
-		cosjetmet = 1.1;
-		if (Jet_N > 0) cosjetmet = ((*Jet_px)[0]*MET_RefFinal_ex + (*Jet_py)[0]*MET_RefFinal_ey)/((*Jet_p_T)[0]*MET_RefFinal_et);
-		
-		// select the promptest lepton for this last variable
-		if (pt1 >= pt2)  {PX=px1; PY=py1; PT=pt1;}
-		if (pt1 <  pt2)  {PX=px2; PY=py2; PT=pt2;}
-		
-		cosptlepMET = (PX*MET_RefFinal_ex +PY*MET_RefFinal_ey)/ (PT * MET_RefFinal_et);
-		
-		// fill the jet info
-		ejet1 = -99.99;
-		ejet2 = -99.99;
-		ejet3 = -99.99;
-		
-		njet = Jet_N;
-		// add info on the 3 most energetic jets
-		if (njet > 0) ejet1 = (*Jet_E)[0];
-		if (njet > 1) ejet2 = (*Jet_E)[1];
-		if (njet > 2) ejet3 = (*Jet_E)[2];
-		
-		ptlep1 = float(pt1);
-		ptlep2 = float(pt2);
-		cone1 = float(Cone1);
-		cone2 = float(Cone2);
-		lepID = abs(bestid);
-		ptZ0 = pt2l;
-		massZ = float(mZ);
-		cosll2d = float(cosll2D);
-		cosll3d = float(cosll3D);
-		cosJetMET = float(cosjetmet);
-		mT = float(mt);
-		MET = float(MET_RefFinal_et);
-		cosMETptlep = float(cosptlepMET);
-		cosphi = float(cosPhi);
-		
-		runnum = EVRunNumber;
-		evtnum  = EVEventAndInstance;
-		type   = typeNumber;
-		w      = float(weight[n]);
-		
-		// fill the preselection tree from the values calculated above
-		if (n == 0 ) treeS.Fill();
-		if (n != 0 ) treeB.Fill();
-		
-		//	      if (typeNumber == 6) cout << " got here 7 " << endl;
-		// fill the histograms
-		hptlep1[typeNumber]->Fill(pt1,weight[n]);
-		hptlep2[typeNumber]->Fill(pt2,weight[n]);
-		hcosll2D[typeNumber]->Fill(cosll2D,weight[n]);
-		hcosll3D[typeNumber]->Fill(cosll3D,weight[n]);
-		//		hMET[typeNumber]->Fill(MET,weight[n]);
-		hmt[typeNumber]->Fill(mt,weight[n]);
-		hcosMETPtlep[typeNumber]->Fill(cosMETptlep,weight[n]);
-		hmZll[typeNumber]->Fill(massZ,weight[n]);
-		hcosphi[typeNumber]->Fill(cosphi,weight[n]);
-		hnjet[typeNumber]->Fill(njet,weight[n]);
-		hcone1[typeNumber]->Fill(Cone1,weight[n]);
-		hcone2[typeNumber]->Fill(Cone2,weight[n]);
-		hejet1[typeNumber]->Fill(ejet1,weight[n]);
-		hejet2[typeNumber]->Fill(ejet2,weight[n]);
-		hejet3[typeNumber]->Fill(ejet3,weight[n]);
-		hcosJetMET[typeNumber]->Fill(cosjetmet,weight[n]);
-		hnel[typeNumber]->Fill(nel,weight[n]);
-		hnmu[typeNumber]->Fill(nmu,weight[n]);
-		hnlep[typeNumber]->Fill(nlep,weight[n]);
-		hlepid[typeNumber]->Fill(lepID,weight[n]);
-
-// 		hptlep1[typeNumber]->Fill(pt1);
-// 		hptlep2[typeNumber]->Fill(pt2);
-// 		hcosll2D[typeNumber]->Fill(cosll2D);
-// 		hcosll3D[typeNumber]->Fill(cosll3D);
-// 		hMET[typeNumber]->Fill(MET);
-// 		hmt[typeNumber]->Fill(mt);
-// 		hcosMETPtlep[typeNumber]->Fill(cosMETptlep);
-// 		hmZll[typeNumber]->Fill(massZ);
-// 		hcosphi[typeNumber]->Fill(cosphi);
-// 		hnjet[typeNumber]->Fill(njet);
-// 		hcone1[typeNumber]->Fill(Cone1);
-// 		hcone2[typeNumber]->Fill(Cone2);
-// 		hejet1[typeNumber]->Fill(ejet1);
-// 		hejet2[typeNumber]->Fill(ejet2);
-// 		hejet3[typeNumber]->Fill(ejet3);
-// 		hcosJetMET[typeNumber]->Fill(cosjetmet);
-
-	      } // end if on btag
-	    } // end if on mZ
-	  } // end if on nlep > nlepcut
-	} // end on METcut
-      } // end on trigger cut
-      
-    } // end of for loop over events   
-    delete random;
-  } //end loop over ndatasets
-  
-  double cut0[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut1[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut2[8]= {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut3[8]= {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut4[8]= {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut5[8]= {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  double cut6[8]= {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-  
-  for (int n=0; n<ndatasets; n++) {
-    
-    if (n==0) typeNumber=0;
-    if (n==1) typeNumber=1;
-    if (n==2) typeNumber=2;
-    if (n >= 3 && n <=6 ) typeNumber=3;
-    if (n==7) typeNumber=4;
-    if (n==8) typeNumber=5;
-    if (n==9 || n==10) typeNumber=6;
-    if (n==11) typeNumber=7;
-    if (n==12) typeNumber=7;
-    if (n==13) typeNumber=7;
-    if (n==14) typeNumber=7;
-
-    outClientFile << "              " << endl;
-    outClientFile << "Cut flow for: " << eventType[n] << endl;
-    outClientFile << "-----------------------------------------------------------" << endl;
-    outClientFile << nrec[n] << " records found in the chain. "<< endl;
-    
-    cout << endl;
-    cout << "METcut " << METcut << endl;
-    cout << "pt cuts for leptons: e > " << eptmin << " and mu: " << mptmin << " GeV and eta < " << etamin << endl;	  
-    cout << "nlep strictly equal to "<< nlepcut << " of the same flavor" << endl; 
-    cout << "mZ within " <<  mZcut << " GeV of on-shell mass " << endl;
-    cout << "total # of selected events in file: \t" << found[n] << endl;	  
-    cout << endl;
-    cout << "Cut flow for: " << eventType[n] << endl;
-    cout << "-----------------------------------------------------------" << endl;
-    cout << nrec[n] << " records found in the chain. "<< endl;
-    cout << endl;
-    
-    passed[n] = nrec[n];
-    totalRejected[n] = (reject_MET[n] + reject_nlep[n] + reject_trigger[n]  + reject_mZ[n] + reject_btag[n]); 
-    
-    int places = 2;
-    cout <<fixed;                 
-    cout.precision(places);
-    
-    cout << "  " << endl;
-    cout << "pairs of electrons before MET cut: " << int(zee0[n]) << " muons: " << int(zmm0[n]) << endl;
-    if (zmm0[n] > 0) cout << " ratio: " << zee0[n]/zmm0[n] << endl;
-    cout << "pairs of electrons after MET cut:  " << int(zee1[n]) << " muons: " << int(zmm1[n]) << endl;
-    if (zmm1[n] > 0) cout << " ratio: " << zee1[n]/zmm1[n] << endl;
-    cout << "accepted pairs of electrons: " << int(zee[n]) << " muons: " << int(zmm[n]) << endl;
-    double denom = (( zee[n] > zmm[n]) ? zee[n] : zmm[n]);
-    double fraction = (( zee[n] < zmm[n]) ? zee[n]/zmm[n] : zmm[n]/zee[n]);
-    
-    double error = sqrt(fraction*(1.0-fraction)/denom);
-    cout << "ratio e/mu: " << 100.0*fraction << " +/- " << 100.0*error <<" %" <<endl;
-    cout << "  " << endl;
-    
-    outClientFile << "  " << endl;
-    outClientFile << "pairs of electrons before MET cut: " << int(zee0[n]) << " muons: " << int(zmm0[n]) << " ratio: " << zee0[n]/zmm0[n] << endl;
-    outClientFile << "pairs of electrons after MET cut:  " << int(zee1[n]) << " muons: " << int(zmm1[n]) << " ratio: " << zee1[n]/zmm1[n] << endl;
-    outClientFile << "accepted pairs of electrons: " << zee[n] << " muons: " << zmm[n] << endl;
-    outClientFile << "ratio e/mu: " << 100.0*fraction << " +/- " << 100.0*error <<" %" <<endl;
-    outClientFile << "  " << endl;
-    
-    cout << "L1XET100 only events: " << L1XET100[n] << endl;
-    cout << "double pair: " << doublepair[n]<< endl;
-    cout << " " << endl;
-    
-    outClientFile << "L1XET100 only events: " << L1XET100[n] << endl;
-    outClientFile << "double pair: " << doublepair[n]<< endl;
-    outClientFile << " " << endl;
-    
-    //  cout << "before trigger: " << beforeTrigger[n]<< endl;
-    //  cout << "after trigger: " << afterTrigger[n]<< endl;
-    //  cout << "after MET: " << afterMET[n]<< endl;
-    //  cout << "after nlep: " << afterNlep[n]<< endl;
-    //  cout << "after MZ: " << afterMz[n]<< endl;
-    //  cout << " " << endl;
-    
-    //cout << "     ************ trigger is turned off *****************************                    " <<   endl;
-    cout << "                         " <<   endl;
-    cout << "                         " << " cross-section              raw #                 percentage"    <<   endl;
-    cout << "cross-section*BR in fb   " << 1000.*sigmaBR[n]   <<"\t" << generated[n] <<"\t" <<  100.*(generated[n]/generated[n])<< "%" << endl;
-    cut0[typeNumber] += 1000.*sigmaBR[n]; 
-    cout << "xs after filter:         " << filterEff[n]*1000.*sigmaBR[n] <<"\t" << passed[n]  <<"\t" <<  100.*(passed[n]/generated[n])<< "%" << endl;
-    cut1[typeNumber] += filterEff[n]*1000.*sigmaBR[n]; 
-    float temp = passed[n];
-    passed[n] = (passed[n] - reject_trigger[n]);
-    cout << "xs after trigger:        " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    cut2[typeNumber] += 1000.*sigmaBR[n]*passed[n]/generated[n];
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_MET[n]);
-    cout << "xs after MET cut         " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    cut3[typeNumber] += 1000.*sigmaBR[n]*passed[n]/generated[n];
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_nlep[n]);
-    cout << "xs after nlep cut:       " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    cut4[typeNumber] += 1000.*sigmaBR[n]*passed[n]/generated[n];
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_mZ[n]);
-    cout << "xs after mZ cut:         " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    cut5[typeNumber] += 1000.*sigmaBR[n]*passed[n]/generated[n];
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_btag[n]);
-    cout << "xs after b-tag cut:      " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    cut6[typeNumber] += 1000.*sigmaBR[n]*passed[n]/generated[n];
-    Total[n] = passed[n]*filterEff[n]; 
-    cout << endl;
-    cout << "Total rejected (reweighted):  " << lumi*sigmaBR[n] - 1000.*sigmaBR[n]*passed[n]/generated[n] << " out of " << generated[n]*filterEff[n] << endl;
-    cout << "Total rejected (raw)       :  " << generated[n] - passed[n] << " out of " << generated[n]<< endl;
-    cout << "Fraction retained          :  " << 100.*(passed[n]/generated[n]) << "% " << endl;
-    places = 5;
-    cout.precision(places);
-    cout << endl;
-    cout << "Events weight of " << weight[n] << endl;
-    cout << " "<< endl;
-    cout <<fixed;                 
-    places = 2;
-    cout.precision(places);
-    
-    // cout << "sanity check: # of events found before lepton cuts: " << sanity[n] << endl;
-    // cout << endl;
-    passed[n] = nrec[n];
-    
-    outClientFile << "                         " <<   endl;
-    outClientFile << "                         " << " cross-section              raw #                 percentage"    <<   endl;
-    outClientFile << "cross-section*BR in fb   " << 1000.*sigmaBR[n]   <<"\t" << generated[n] <<"\t" <<  100.*(generated[n]/generated[n])<< "%" << endl;
-    outClientFile << "xs after filter:         " << filterEff[n]*1000.*sigmaBR[n] <<"\t" << passed[n]  <<"\t" <<  100.*(passed[n]/generated[n])<< "%" << endl;
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_trigger[n]);
-    outClientFile << "xs after trigger:        " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_MET[n]);
-    outClientFile << "xs after MET cut         " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_nlep[n]);
-    outClientFile << "xs after nlep cut:       " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_mZ[n]);
-    outClientFile << "xs after mZ cut:         " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    temp = passed[n];
-    passed[n] = (passed[n] - reject_btag[n]);
-    outClientFile << "xs after b-tag cut:      " << 1000.*sigmaBR[n]*passed[n]/generated[n] <<"\t" << passed[n] <<"\t" <<  100.*(passed[n]/generated[n])<<"\t" << "%; rel. eff: " <<  100.*(passed[n]/temp)<< "%" << endl;
-    Total[n] = passed[n]*filterEff[n]; 
-    outClientFile << endl;
-    outClientFile << "Total rejected (reweighted):  " << lumi*sigmaBR[n] - 1000.*sigmaBR[n]*passed[n]/generated[n] << " out of " << generated[n]*filterEff[n] << endl;
-    outClientFile << "Total rejected (raw)       :  " << generated[n] - passed[n] << " out of " << generated[n]<< endl;
-    outClientFile << "Fraction retained          :  " << 100.*(passed[n]/generated[n]) << "% " << endl;
-    places = 5;
-    outClientFile.precision(places);
-    outClientFile << endl;
-    outClientFile << "Events weight of " << weight[n] << endl;
-    outClientFile << " "<< endl;
-    outClientFile <<fixed;                 
-    places = 2;
-    outClientFile.precision(places);
-    
-    if (n != 0) TotalBgnd += Total[n]; 
-    
-    //end second loop over ndatasets of events
-  }
-  
-  //    h_MET_final->Write();
-  //    h_MET_ref->Write();
-  
-  // check what the tree looks like
-  // treeS.Print();
-  // treeB.Print();
-  
-  double fraction = 0.0;
-  for (int n=0; n<ndatasets; n++) {fraction +=TotalUM[n];}
-  cout << fraction << endl;
-  fraction = 100.0*fraction/(Total[0]+TotalBgnd);
-  // get info on S/sqrt(B)
-  double SoverB = Total[0]/sqrt(TotalBgnd);
-  cout << "*************************************************************************** " << endl;
-  cout << "Number of files used         = " << ndatasets  << endl;
-  for(int n=0; n<ndatasets; n++) { cout << "\t" << eventType[n] << "\t " << passed[n] << endl;}
-  cout << "Total preselected signal     = " << Total[0]  << endl;
-  cout << "Total preselected background = " << TotalBgnd << endl;
-  cout << "Signal over sqrt(B)          = " << SoverB << endl;
-  cout << "*************************************************************************** " << endl;
-  
-  SoverB = Total[0]/sqrt(TotalBgnd);
-  outClientFile << "*************************************************************************** " << endl;
-  outClientFile << "Number of files used         = " << ndatasets  << endl;
-  for(int n=0; n<ndatasets; n++) { outClientFile << "\t" << eventType[n] << "\t " << passed[n] << endl;}
-  outClientFile << "*************************************************************************** " << endl;
-  outClientFile << "Total preselected signal     = " << Total[0]  << endl;
-  outClientFile << "Total preselected background = " << TotalBgnd << endl;
-  outClientFile << "Signal over sqrt(B)          = " << SoverB << endl;
-  outClientFile << "*************************************************************************** " << endl;
-  
-  int places = 2;
-  cout <<fixed;                 
-  cout.precision(places);
-  
-  hs1.SetMinimum(1);
-  hs2.SetMinimum(1);
-  hs3.SetMinimum(1);
-  hs4.SetMinimum(1);
-  hs5.SetMinimum(1);
-  hs6.SetMinimum(1);
-  hs7.SetMinimum(1);
-  hs8.SetMinimum(1);
-  hs9.SetMinimum(1);
-  hs10.SetMinimum(1);
-  hs11.SetMinimum(1);
-  hs12.SetMinimum(1);
-  hs13.SetMinimum(1);
-  hs14.SetMinimum(1);
-  hs15.SetMinimum(1);
-  hs16.SetMinimum(1);
-  hs17.SetMinimum(1);
-  hs18.SetMinimum(1);
-  hs19.SetMinimum(1);
-  hs20.SetMinimum(1);
-  
-  TLegend *leg1 = new TLegend(0.6, 0.6, 0.9, 0.95);
-  TLegend *leg2 = new TLegend(0.6, 0.6, 0.9, 0.95);
-  TLegend *leg3 = new TLegend(0.6, 0.6, 0.9, 0.95);
-  TLegend *leg4 = new TLegend(0.65, 0.6, 0.9, 0.95);
-  TLegend *leg5 = new TLegend(0.65, 0.6, 0.9, 0.95);
-  
-//     c6->cd();
-//     pad61->cd(); 
-//     hgauss1->Draw();
-//     pad62->cd(); 
-//     hgauss2->Draw();
-
-  for (int m=0; m<ntype; m++) {
-
-    c1->cd();
-    hs17.Add(hnel[m]);
-    pad13->cd(); 
-    hs17.Draw("");
-    hs17.Draw("");
-    if (m==0) {leg1->AddEntry(hnel[m], "  HZ", "f"); }
-    //    if (m==1) {leg1->AddEntry(hnel[m], "  ChL #rightarrow ZW #rightarrow l l l #nu", "f"); }
-    if (m==1) {leg1->AddEntry(hnel[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg1->AddEntry(hnel[m], "  t#bar t", "f");} 
-    if (m==3) {leg1->AddEntry(hnel[m], "  WW", "f"); }
-//     if (m==4) {leg1->AddEntry(hnel[m], "  ZZ #rightarrow #tau #tau #nu #nu", "f"); }
-    if (m==5) {leg1->AddEntry(hnel[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg1->AddEntry(hnel[m], "  ZW", "f"); }
-    if (m==7) {leg1->AddEntry(hnel[m], "  Z + jets", "f");} 
-    leg1->Draw();
-
-    hs18.Add(hnmu[m]);
-    pad14->cd(); 
-    hs18.Draw("");
-    hs18.Draw("");
-
-    hs19.Add(hnlep[m]);
-    pad11->cd(); 
-    hs19.Draw("");
-    hs19.Draw("");
-
-    hs20.Add(hlepid[m]);
-    pad12->cd(); 
-    hs20.Draw("");
-    hs20.Draw("");
-
-    c3->cd();
-    hs1.Add(hptlep1[m]);
-    pad33->cd(); 
-    //   pad33->SetLogy(1);
-    hs1.Draw("");
-    hs1.Draw("");
-    if (m==0) {leg3->AddEntry(hptlep1[m], "  HZ", "f"); }
-    //    if (m==1) {leg3->AddEntry(hptlep1[m], "  ChL #rightarrow ZW #rightarrow l l l #nu", "f"); }
-    if (m==1) {leg3->AddEntry(hptlep1[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg3->AddEntry(hptlep1[m], "  t#bar t", "f");} 
-    if (m==3) {leg3->AddEntry(hptlep1[m], "  WW", "f"); }
-//     if (m==4) {leg3->AddEntry(hptlep1[m], "  ZZ #rightarrow #tau #tau #nu #nu", "f"); }
-    if (m==5) {leg3->AddEntry(hptlep1[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg3->AddEntry(hptlep1[m], "  ZW", "f"); }
-    if (m==7) {leg3->AddEntry(hptlep1[m], "  Z + jets", "f");} 
-    leg3->Draw();
-    
-    hs2.Add(hptlep2[m]);
-    pad34->cd(); 
-    //   pad34->SetLogy(1);
-    hs2.Draw("");
-    hs2.Draw("");
-    
-    hs3.Add(hcosll2D[m]);
-    pad31->cd(); 
-    //     pad31->SetLogy(1);
-    hs3.Draw("");
-    hs3.Draw("");
-    
-    hs4.Add(hcosll3D[m]);
-    pad32->cd(); 
-    //     pad32->SetLogy(1);
-    hs4.Draw("");
-    hs4.Draw("");
-    
-    c2->cd();
-    hs5.Add(hMET[m]);
-    pad23->cd(); 
-    //      pad23->SetLogy(1);
-    hs5.Draw("");
-    hs5.Draw("");
-    if (m==0) {leg2->AddEntry(hMET[m], "  HZ", "f"); }
-    //    if (m==1) {leg2->AddEntry(hMET[m], "  ChL #rightarrow ZW #rightarrow l l l #nu", "f"); }
-    if (m==1) {leg2->AddEntry(hMET[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg2->AddEntry(hMET[m], "  t#bar t", "f");} 
-    if (m==3) {leg2->AddEntry(hMET[m], "  WW", "f"); }
-//     if (m==4) {leg2->AddEntry(hMET[m], "  ZZ #rightarrow #tau #tau #nu #nu", "f"); }
-    if (m==5) {leg2->AddEntry(hMET[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg2->AddEntry(hMET[m], "  ZW", "f"); }
-    if (m==7) {leg2->AddEntry(hMET[m], "  Z + jets", "f");} 
-    leg2->Draw();
-    
-    hs6.Add(hmt[m]);
-    pad24->cd(); 
-    //    pad24->SetLogy(1);
-    hs6.Draw("");
-    hs6.Draw("");
-    
-    hs7.Add(hcosMETPtlep[m]);
-    pad21->cd(); 
-    //    pad21->SetLogy(1);
-    hs7.Draw("");
-    hs7.Draw("");
-    
-    hs8.Add(hmZll[m]);
-    pad22->cd(); 
-    //    pad22->SetLogy(1);
-    hs8.Draw("");
-    hs8.Draw("");
-    
-    c4->cd();
-    hs9.Add(hcosphi[m]);
-    pad43->cd(); 
-    pad43->SetLogy(1);
-    hs9.Draw("");
-    hs9.Draw("");
-    if (m==0) {leg4->AddEntry(hcosphi[m], "  HZ", "f"); }
-    //    if (m==1) {leg4->AddEntry(hcosphi[m], "  ChL #rightarrow ZW #rightarrow l l l #nu", "f"); }
-    if (m==1) {leg4->AddEntry(hcosphi[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg4->AddEntry(hcosphi[m], "  t#bar t", "f");} 
-    if (m==3) {leg4->AddEntry(hcosphi[m], "  WW", "f"); }
-//     if (m==4) {leg4->AddEntry(hcosphi[m], "  ZZ #rightarrow #tau #tau #nu #nu", "f"); }
-    if (m==5) {leg4->AddEntry(hcosphi[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg4->AddEntry(hcosphi[m], "  ZW", "f"); }
-    if (m==7) {leg4->AddEntry(hcosphi[m], "  Z + jets", "f");} 
-    leg4->Draw();
-    
-    hs10.Add(hcosJetMET[m]);
-    pad44->cd(); 
-    pad44->SetLogy(1);
-    hs10.Draw("");
-    hs10.Draw("");
-    
-    hs11.Add(hcone1[m]);
-    pad41->cd(); 
-    pad41->SetLogy(1);
-    hs11.Draw("");
-    hs11.Draw("");
-    
-    hs12.Add(hcone2[m]);
-    pad42->cd(); 
-    pad42->SetLogy(1);
-    hs12.Draw("");
-    hs12.Draw("");
-    
-    c5->cd();
-    hs13.Add(hejet1[m]);
-    pad53->cd(); 
-    //   pad53->SetLogy(1);
-    hs13.Draw("");
-    hs13.Draw("");
-    
-    hs14.Add(hejet2[m]);
-    pad54->cd(); 
-    //    pad54->SetLogy(1);
-    hs14.Draw("");
-    hs14.Draw("");
-    
-    hs15.Add(hejet3[m]);
-    pad51->cd(); 
-    //    pad51->SetLogy(1);
-    hs15.Draw("");
-    hs15.Draw("");
-    
-    hs16.Add(hnjet[m]);
-    pad52->cd(); 
-    //    pad52->SetLogy(1);
-    hs16.Draw("");
-    hs16.Draw("");
-    if (m==0) {leg5->AddEntry(hnjet[m], "  HZ", "f"); }
-    //    if (m==1) {leg5->AddEntry(hnjet[m], "  ChL #rightarrow ZW #rightarrow l l l #nu", "f"); }
-    if (m==1) {leg5->AddEntry(hnjet[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg5->AddEntry(hnjet[m], "  t#bar t", "f");} 
-    if (m==3) {leg5->AddEntry(hnjet[m], "  WW", "f"); }
-//     if (m==4) {leg5->AddEntry(hnjet[m], "  ZZ #rightarrow #tau #tau #nu #nu", "f"); }
-    if (m==5) {leg5->AddEntry(hnjet[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg5->AddEntry(hnjet[m], "  ZW", "f"); }
-    if (m==7) {leg5->AddEntry(hnjet[m], "  Z + jets", "f");} 
-    leg5->Draw();
-
- } //end loop over all types of events
-  
-  for (int m=0; m<ntype; m++) {
-    cout << "                          " << endl;
-    cout << "combined cutflow for type " << m << endl;
-    cout << "cross-section*BR in fb    " << cut0[m] << endl;
-    cout << "xs after filter:          " << cut1[m] << endl;
-    cout << "xs after trigger:         " << cut2[m] << endl;
-    cout << "xs after MET cut          " << cut3[m] << endl;
-    cout << "xs after nlep cut:        " << cut4[m] << endl;
-    cout << "xs after mZ cut:          " << cut5[m] << endl;
-    cout << "xs after b-tag cut:       " << cut6[m] << endl;
-  }
-
-    cout <<fixed;                 
-    places = 1;
-    cout.precision(places);
-
-    cout << "                          " << endl;
-    cout << "$\sigma$*BR in fb    &        " << cut0[0] << " & " << cut0[1] << " & " << cut0[2] << " & " << cut0[3] << " & " << cut0[4] << " & " << cut0[5] << " & " << cut0[6] << " & " << cut0[7] << " \\ " << endl;
-    cout << "$\sigma$ after filter:          & " << cut1[0] << " & " << cut1[1] << " & " << cut1[2] << " & " << cut1[3] << " & " << cut1[4] << " & " << cut1[5] << " & " << cut1[6] << " & " << cut1[7] << " \\ " << endl;
-    cout << "$\sigma$ after trigger:         & " << cut2[0] << " & " << cut2[1] << " & " << cut2[2] << " & " << cut2[3] << " & " << cut2[4] << " & " << cut2[5] << " & " << cut2[6] << " & " << cut2[7] << " \\ " << endl;
-    cout << "$\sigma$ after MET cut          & " << cut3[0] << " & " << cut3[1] << " & " << cut3[2] << " & " << cut3[3] << " & " << cut3[4] << " & " << cut3[5] << " & " << cut3[6] << " & " << cut3[7] << " \\ " << endl;
-    cout << "$\sigma$ after nlep cut:        & " << cut4[0] << " & " << cut4[1] << " & " << cut4[2] << " & " << cut4[3] << " & " << cut4[4] << " & " << cut4[5] << " & " << cut4[6] << " & " << cut4[7] << " \\ " << endl;
-    cout << "$\sigma$ after mZ cut:          & " << cut5[0] << " & " << cut5[1] << " & " << cut5[2] << " & " << cut5[3] << " & " << cut5[4] << " & " << cut5[5] << " & " << cut5[6] << " & " << cut5[7] << " \\ " << endl;
-    cout << "$\sigma$ after b-tag cut:       & " << cut6[0] << " & " << cut6[1] << " & " << cut6[2] << " & " << cut6[3] << " & " << cut6[4] << " & " << cut6[5] << " & " << cut6[6] << " & " << cut6[7] << " \\ " << endl;
-
-  for (int m=0; m<ntype; m++) {
-    outClientFile << "                          " << endl;
-    outClientFile << "combined cutflow for type " << m << endl;
-    outClientFile << "cross-section*BR in fb    " << cut0[m] << endl;
-    outClientFile << "xs after filter:          " << cut1[m] << endl;
-    outClientFile << "xs after trigger:         " << cut2[m] << endl;
-    outClientFile << "xs after MET cut          " << cut3[m] << endl;
-    outClientFile << "xs after nlep cut:        " << cut4[m] << endl;
-    outClientFile << "xs after mZ cut:          " << cut5[m] << endl;
-    outClientFile << "xs after b-tag cut:       " << cut6[m] << endl;
-  }
-
-    outClientFile <<fixed;                 
-    places = 1;
-    outClientFile.precision(places);
-
-    outClientFile << "                          " << endl;
-    outClientFile << "$\sigma$*BR in fb    &        " << cut0[0] << " & " << cut0[1] << " & " << cut0[2] << " & " << cut0[3] << " & " << cut0[4] << " & " << cut0[5] << " & " << cut0[6] << " & " << cut0[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after filter:          & " << cut1[0] << " & " << cut1[1] << " & " << cut1[2] << " & " << cut1[3] << " & " << cut1[4] << " & " << cut1[5] << " & " << cut1[6] << " & " << cut1[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after trigger:         & " << cut2[0] << " & " << cut2[1] << " & " << cut2[2] << " & " << cut2[3] << " & " << cut2[4] << " & " << cut2[5] << " & " << cut2[6] << " & " << cut2[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after MET cut          & " << cut3[0] << " & " << cut3[1] << " & " << cut3[2] << " & " << cut3[3] << " & " << cut3[4] << " & " << cut3[5] << " & " << cut3[6] << " & " << cut3[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after nlep cut:        & " << cut4[0] << " & " << cut4[1] << " & " << cut4[2] << " & " << cut4[3] << " & " << cut4[4] << " & " << cut4[5] << " & " << cut4[6] << " & " << cut4[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after mZ cut:          & " << cut5[0] << " & " << cut5[1] << " & " << cut5[2] << " & " << cut5[3] << " & " << cut5[4] << " & " << cut5[5] << " & " << cut5[6] << " & " << cut5[7] << " \\ " << endl;
-    outClientFile << "$\sigma$ after b-tag cut:       & " << cut6[0] << " & " << cut6[1] << " & " << cut6[2] << " & " << cut6[3] << " & " << cut6[4] << " & " << cut6[5] << " & " << cut6[6] << " & " << cut6[7] << " \\ " << endl;
-
-  f.Write();   // write to the file histograms and trees
-  
-  cout << " " << endl;
-  cout << "All done!" << endl;
-  
-  theApp.Run();                            // concluding ROOT requirements.
-  
-  return 0;
-} //  End of main(...)
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Instructions.txt b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Instructions.txt
deleted file mode 100644
index d2a5299bd46d..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Instructions.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-To run the ZH code for the ZH-> invisible analysis, follow the instructions given in my website:
-
-http://pauline.web.cern.ch/pauline/RunningAthena.html
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Makefile b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Makefile
deleted file mode 100644
index 1f5f1562fae3..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-SRC           = EVmva
-ARCH          = linux
-CXX           =
-ObjSuf        = o
-SrcSuf        = C
-ExeSuf        = exe
-DllSuf        = so
-OutPutOpt     = -o 
-
-EVENTLIB      = $(EVENTSO)
-
-ROOTCFLAGS   := $(shell root-config --cflags)
-ROOTLIBS     := $(shell root-config --libs)
-ROOTGLIBS    := $(shell root-config --glibs)
-
-
-
-ifeq ($(ARCH),solaris)
-# Solaris CC
-CXX           = /opt/SUNWspro/bin/CC
-CXXFLAGS      = -O -KPIC
-LD            = /opt/SUNWspro/bin/CC
-LDFLAGS       = -O
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),solarisCC5)
-# Solaris CC 5.0
-CXX           = CC
-CXXFLAGS      = -O -KPIC -D__SunOS_5_6 -library=iostream,no%Cstd
-LD            = CC
-LDFLAGS       = -O -library=iostream,no%Cstd -o
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),solarisegcs)
-# Solaris egcs
-CXX           = g++
-CXXFLAGS      = -O -fPIC
-LD            = CC
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),solarisx86)
-# Solaris CC on Intel
-CXX           = CC
-CXXFLAGS      = -O -KPIC
-LD            = CC
-LDFLAGS       = -O
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),sgicc)
-# SGI
-CXX           = CC -n32  -I/usr/include/CC.sgi
-CXXFLAGS      = -O
-LD            = CC -n32  -I/usr/include/CC.sgi
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgiegcs)
-# SGI 6.x with EGCS
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgin32egcs)
-# SGI 6.x with EGCS for n32 ABI
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -L/usr/lib32 -Wl,-woff,134
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgigcc)
-# SGI with GCC
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgikcc)
-# SGI with KCC
-CXX           = KCC -n32 --no_exceptions
-CXXFLAGS      = -O
-LD            = KCC -n32 --no_exceptions
-LDFLAGS       = -O
-SOFLAGS       =
-endif
-
-
-ifeq ($(ARCH),linux)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-
-ifeq ($(ARCH),linuxdeb2)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxsuse6)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxSLC4)
-# Linux with gcc 3.2.3.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -L/usr/lib64
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxegcs)
-# Linux with egcs (>= RedHat 5.2)
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxkcc)
-# Linux with the KAI compiler
-CXX           = KCC
-CXXFLAGS      = -fPIC +K0
-LD            = KCC
-LDFLAGS       = -O
-SOFLAGS       =
-endif
-
-
-
-ifeq ($(CXX),)
-$(error $(ARCH) invalid architecture)
-endif
-
-CXXFLAGS     += $(ROOTCFLAGS)
-LIBS          = $(ROOTLIBS) $(SYSLIBS)
-GLIBS         = $(ROOTGLIBS) $(SYSLIBS)
-
-#------------------------------------------------------------------------------
-EO       = $(SRC).$(ObjSuf) 
-#LIBO     = $(SRC1).$(ObjSuf)
-ES       = $(SRC).$(SrcSuf)
-E        = $(SRC).$(ExeSuf)
-
-
-OBJS          = $(EO)  
-
-PROGRAMS      = $(E) 
-
-#------------------------------------------------------------------------------
-
-.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
-
-all:            $(LIBO) $(PROGRAMS)
-
-#$(LIBO):   $(SRC1).$(SrcSuf) 
-#		@echo "Compiling $(SRC1).$(SrcSuf)"
-#		$(CXX) -Wall -c  $(SRC1).$(SrcSuf)
-#		@echo "$@ done"
-
-$(E):      $(EO)    
-		$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
-		@echo "$@ done"
-		@echo "Starting the executable"
-		./$@
-
-clean:
-		@rm -f $(OBJS) core
-
-distclean:      clean
-		@rm -f $(PROGRAMS) $(EVENTSO) $(EVENTLIB) *Dict.* *.def *.exp \
-		   *.root *.ps .def so_locations
-
-.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
-
-###
-
-.$(SrcSuf).$(ObjSuf):
-	$(CXX) $(CXXFLAGS) -c $<
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/Makefile b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/Makefile
deleted file mode 100755
index f174c4d41350..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-SRC           = cuts
-ARCH          = linux
-CXX           =
-ObjSuf        = o
-SrcSuf        = C
-ExeSuf        = exe
-DllSuf        = so
-OutPutOpt     = -o 
-
-EVENTLIB      = $(EVENTSO)
-
-ROOTCFLAGS   := $(shell root-config --cflags)
-ROOTLIBS     := $(shell root-config --libs)
-ROOTGLIBS    := $(shell root-config --glibs)
-
-
-
-ifeq ($(ARCH),solaris)
-# Solaris CC
-CXX           = /opt/SUNWspro/bin/CC
-CXXFLAGS      = -O -KPIC
-LD            = /opt/SUNWspro/bin/CC
-LDFLAGS       = -O
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),solarisCC5)
-# Solaris CC 5.0
-CXX           = CC
-CXXFLAGS      = -O -KPIC -D__SunOS_5_6 -library=iostream,no%Cstd
-LD            = CC
-LDFLAGS       = -O -library=iostream,no%Cstd -o
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),solarisegcs)
-# Solaris egcs
-CXX           = g++
-CXXFLAGS      = -O -fPIC
-LD            = CC
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),solarisx86)
-# Solaris CC on Intel
-CXX           = CC
-CXXFLAGS      = -O -KPIC
-LD            = CC
-LDFLAGS       = -O
-SOFLAGS       = -G
-endif
-
-ifeq ($(ARCH),sgicc)
-# SGI
-CXX           = CC -n32  -I/usr/include/CC.sgi
-CXXFLAGS      = -O
-LD            = CC -n32  -I/usr/include/CC.sgi
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgiegcs)
-# SGI 6.x with EGCS
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgin32egcs)
-# SGI 6.x with EGCS for n32 ABI
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -L/usr/lib32 -Wl,-woff,134
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgigcc)
-# SGI with GCC
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),sgikcc)
-# SGI with KCC
-CXX           = KCC -n32 --no_exceptions
-CXXFLAGS      = -O
-LD            = KCC -n32 --no_exceptions
-LDFLAGS       = -O
-SOFLAGS       =
-endif
-
-
-ifeq ($(ARCH),linux)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-
-ifeq ($(ARCH),linuxdeb2)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxsuse6)
-# Linux with gcc 2.7.2.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxSLC4)
-# Linux with gcc 3.2.3.x
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O -L/usr/lib64
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxegcs)
-# Linux with egcs (>= RedHat 5.2)
-CXX           = g++
-CXXFLAGS      = -O -Wall -fPIC
-LD            = g++
-LDFLAGS       = -O
-SOFLAGS       = -shared
-endif
-
-ifeq ($(ARCH),linuxkcc)
-# Linux with the KAI compiler
-CXX           = KCC
-CXXFLAGS      = -fPIC +K0
-LD            = KCC
-LDFLAGS       = -O
-SOFLAGS       =
-endif
-
-
-
-ifeq ($(CXX),)
-$(error $(ARCH) invalid architecture)
-endif
-
-CXXFLAGS     += $(ROOTCFLAGS)
-LIBS          = $(ROOTLIBS) $(SYSLIBS)
-GLIBS         = $(ROOTGLIBS) $(SYSLIBS)
-
-#------------------------------------------------------------------------------
-EO       = $(SRC).$(ObjSuf) 
-#LIBO     = $(SRC1).$(ObjSuf)
-ES       = $(SRC).$(SrcSuf)
-E        = $(SRC).$(ExeSuf)
-
-
-OBJS          = $(EO)  
-
-PROGRAMS      = $(E) 
-
-#------------------------------------------------------------------------------
-
-.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
-
-all:            $(LIBO) $(PROGRAMS)
-
-#$(LIBO):   $(SRC1).$(SrcSuf) 
-#		@echo "Compiling $(SRC1).$(SrcSuf)"
-#		$(CXX) -Wall -c  $(SRC1).$(SrcSuf)
-#		@echo "$@ done"
-
-$(E):      $(EO)    
-		$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
-		@echo "$@ done"
-		@echo "Starting the executable"
-		./$@
-
-clean:
-		@rm -f $(OBJS) core
-
-distclean:      clean
-		@rm -f $(PROGRAMS) $(EVENTSO) $(EVENTLIB) *Dict.* *.def *.exp \
-		   *.root *.ps .def so_locations
-
-.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
-
-###
-
-.$(SrcSuf).$(ObjSuf):
-	$(CXX) $(CXXFLAGS) -c $<
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVAnalysis.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVAnalysis.C
deleted file mode 100644
index 41af7ea2ce12..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVAnalysis.C
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// @(#)root/tmva $Id: TMVAnalysis.C,v 1.1.1.1 2008-06-18 09:03:36 pgagnon Exp $
-/**********************************************************************************
- * Project   : TMVA - a Root-integrated toolkit for multivariate data analysis    *
- * Package   : TMVA                                                               *
- * Root Macro: TMVAnalysis                                                        *
- *                                                                                *
- * This macro provides examples for the training and testing of all the           *
- * TMVA classifiers.                                                              *
- *                                                                                *
- * As input data is used a toy-MC sample consisting of four Gaussian-distributed  *
- * and linearly correlated input variables.                                       *
- *                                                                                *
- * The methods to be used can be switched on and off by means of booleans, or     *
- * via the prompt command, for example:                                           *
- *                                                                                *
- *    root -l TMVAnalysis.C\(\"Fisher,Likelihood\"\)                              *
- *                                                                                *
- * (note that the backslashes are mandatory)                                      *
- *                                                                                *
- * The output file "TMVA.root" can be analysed with the use of dedicated          *
- * macros (simply say: root -l <macro.C>), which can be conveniently              *
- * invoked through a GUI that will appear at the end of the run of this macro.    *
- **********************************************************************************/
-
-#include <iostream>
-
-#include "TCut.h"
-#include "TFile.h"
-#include "TSystem.h"
-#include "TTree.h"
-// requires links
-// #include "TMVA/Factory.h"
-// #include "TMVA/Tools.h"
-// #include "TMVA/Config.h"
-
-#include "TMVAGui.C"
-   
-// ---------------------------------------------------------------
-// choose MVA methods to be trained + tested
-Bool_t Use_Cuts            = 0;
-Bool_t Use_CutsD           = 0;
-Bool_t Use_CutsGA          = 0; // was 1
-// ---
-Bool_t Use_Likelihood      = 0; // was 1;
-Bool_t Use_LikelihoodD     = 0; // the "D" extension indicates decorrelated input variables (see option strings)
-Bool_t Use_LikelihoodPCA   = 0; // the "PCA" extension indicates PCA-transformed input variables (see option strings)
-Bool_t Use_LikelihoodKDE   = 0;
-Bool_t Use_LikelihoodMIX   = 0;
-// ---
-Bool_t Use_PDERS           = 0; // was 1;
-Bool_t Use_PDERSD          = 0;
-Bool_t Use_PDERSPCA        = 0;
-Bool_t Use_KNN             = 0; // was 1;
-// ---
-Bool_t Use_HMatrix         = 0; // was 1;
-Bool_t Use_Fisher          = 0; // was 1;
-// ---
-Bool_t Use_FDA_GA          = 0;
-Bool_t Use_FDA_MC          = 0;
-Bool_t Use_FDA_SA          = 0;
-Bool_t Use_FDA_MT          = 0; // was 1;
-Bool_t Use_FDA_GAMT        = 0;
-Bool_t Use_FDA_MCMT        = 0;
-// ---
-Bool_t Use_MLP             = 0; // was 1; // this is the recommended ANN
-Bool_t Use_CFMlpANN        = 0; 
-Bool_t Use_TMlpANN         = 0; 
-// ---
-Bool_t Use_BDT             = 1;
-Bool_t Use_BDTD            = 0;
-// ---
-Bool_t Use_RuleFitTMVA     = 0;
-Bool_t Use_RuleFitJF       = 0;
-// ---
-Bool_t Use_SVM_Gauss       = 0; // was 1;
-Bool_t Use_SVM_Poly        = 0;
-Bool_t Use_SVM_Lin         = 0;
-// ---------------------------------------------------------------
-
-// read input data file with ascii format (otherwise ROOT) ?
-Bool_t ReadDataFromAsciiIFormat = kFALSE;
-
-void TMVAnalysis( TString myMethodList = "" ) 
-{
-   // explicit loading of the shared libTMVA is done in TMVAlogon.C, defined in .rootrc
-   // if you use your private .rootrc, or run from a different directory, please copy the 
-   // corresponding lines from .rootrc
-
-   // methods to be processed can be given as an argument; use format:
-   //
-   // mylinux~> root -l TMVAnalysis.C\(\"myMethod1,myMethod2,myMethod3\"\)
-   //
-   TList* mlist = TMVA::Tools::ParseFormatLine( myMethodList, " :," );
-
-   if (mlist->GetSize()>0) {
-      Use_CutsGA = Use_CutsD = Use_Cuts
-         = Use_LikelihoodKDE = Use_LikelihoodMIX = Use_LikelihoodPCA = Use_LikelihoodD = Use_Likelihood
-         = Use_PDERSPCA = Use_PDERSD = Use_PDERS 
-         = Use_KNN
-         = Use_MLP = Use_CFMlpANN = Use_TMlpANN
-         = Use_HMatrix = Use_Fisher = Use_BDTD = Use_BDT
-         = Use_RuleFitTMVA = Use_RuleFitJF
-         = Use_SVM_Gauss = Use_SVM_Poly = Use_SVM_Lin 
-         = Use_FDA_GA = Use_FDA_MC = Use_FDA_SA = Use_FDA_MT = Use_FDA_GAMT = Use_FDA_MCMT 
-         = 0;
-
-      if (mlist->FindObject( "Cuts"          ) != 0) Use_Cuts          = 1; 
-      if (mlist->FindObject( "CutsD"         ) != 0) Use_CutsD         = 1; 
-      if (mlist->FindObject( "CutsGA"        ) != 0) Use_CutsGA        = 1; 
-      if (mlist->FindObject( "Likelihood"    ) != 0) Use_Likelihood    = 1; 
-      if (mlist->FindObject( "LikelihoodD"   ) != 0) Use_LikelihoodD   = 1; 
-      if (mlist->FindObject( "LikelihoodPCA" ) != 0) Use_LikelihoodPCA = 1; 
-      if (mlist->FindObject( "LikelihoodKDE" ) != 0) Use_LikelihoodKDE = 1; 
-      if (mlist->FindObject( "LikelihoodMIX" ) != 0) Use_LikelihoodMIX = 1; 
-      if (mlist->FindObject( "PDERSPCA"      ) != 0) Use_PDERSPCA      = 1; 
-      if (mlist->FindObject( "PDERSD"        ) != 0) Use_PDERSD        = 1; 
-      if (mlist->FindObject( "PDERS"         ) != 0) Use_PDERS         = 1; 
-      if (mlist->FindObject( "KNN"           ) != 0) Use_KNN           = 1; 
-      if (mlist->FindObject( "HMatrix"       ) != 0) Use_HMatrix       = 1; 
-      if (mlist->FindObject( "Fisher"        ) != 0) Use_Fisher        = 1; 
-      if (mlist->FindObject( "MLP"           ) != 0) Use_MLP           = 1; 
-      if (mlist->FindObject( "CFMlpANN"      ) != 0) Use_CFMlpANN      = 1; 
-      if (mlist->FindObject( "TMlpANN"       ) != 0) Use_TMlpANN       = 1; 
-      if (mlist->FindObject( "BDTD"          ) != 0) Use_BDTD          = 1; 
-      if (mlist->FindObject( "BDT"           ) != 0) Use_BDT           = 1; 
-      if (mlist->FindObject( "RuleFitJF"     ) != 0) Use_RuleFitJF     = 1; 
-      if (mlist->FindObject( "RuleFitTMVA"   ) != 0) Use_RuleFitTMVA   = 1; 
-      if (mlist->FindObject( "SVM_Gauss"     ) != 0) Use_SVM_Gauss     = 1; 
-      if (mlist->FindObject( "SVM_Poly"      ) != 0) Use_SVM_Poly      = 1; 
-      if (mlist->FindObject( "SVM_Lin"       ) != 0) Use_SVM_Lin       = 1; 
-      if (mlist->FindObject( "FDA_MC"        ) != 0) Use_FDA_MC        = 1; 
-      if (mlist->FindObject( "FDA_GA"        ) != 0) Use_FDA_GA        = 1; 
-      if (mlist->FindObject( "FDA_SA"        ) != 0) Use_FDA_SA        = 1; 
-      if (mlist->FindObject( "FDA_MT"        ) != 0) Use_FDA_MT        = 1; 
-      if (mlist->FindObject( "FDA_GAMT"      ) != 0) Use_FDA_GAMT      = 1; 
-      if (mlist->FindObject( "FDA_MCMT"      ) != 0) Use_FDA_MCMT      = 1; 
-
-      delete mlist;
-   }
-  
-   std::cout << "Start Test TMVAnalysis" << std::endl
-             << "======================" << std::endl
-             << std::endl;
-   std::cout << "Testing all standard methods may take about 10 minutes of running..." << std::endl;
-
-   // Create a new root output file.
-   TString outfileName( "TMVA.root" );
-   TFile* outputFile = TFile::Open( outfileName, "RECREATE" );
-
-   // Create the factory object. Later you can choose the methods
-   // whose performance you'd like to investigate. The factory will
-   // then run the performance analysis for you.
-   //
-   // The first argument is the base of the name of all the
-   // weightfiles in the directory weight/ 
-   //
-   // The second argument is the output file for the training results
-   TMVA::Factory *factory = new TMVA::Factory( "TMVAnalysis", outputFile, Form("!V:%sColor", gROOT->IsBatch()?"!":"") );
-
-   // if you wish to modify default settings 
-   // (please check "src/Config.h" to see all available global options)
-   //    (TMVA::gConfig().GetVariablePlotting()).fTimesRMS = 8.0;
-   //    (TMVA::gConfig().GetIONames()).fWeightFileDir = "myWeightDirectory";
-
-      // load the signal and background event samples from ROOT trees
-//      TFile *input(0);
-//       TString fname = "/data/TMVA/preselection-HZ140-all-Zincl.root";
-//       //TString fname = "~/TMVA/examples/data/normalisation.root";
-//       input = TFile::Open( fname );
-//       if (!input) {
-//          std::cout << "ERROR: could not open data file" << std::endl;
-//          exit(1);
-//       }
-//       TTree *signal     = (TTree*)input->Get("TreeS");
-//       TTree *background = (TTree*)input->Get("TreeB");
-
-      int nfchains=0;
-      int nfchainb=0;
-      TChain* signal = new TChain("TreeS");
-      TChain* background = new TChain("TreeB");
-      nfchains += signal->Add("/data/TMVA/preselection-HZ250-10jun.root");
-
-      //            nfchainb += background->Add("/data/TMVA/preselection-tt.root");
-      //              nfchainb += background->Add("/data/TMVA/preselection-WW.root");
-      //          nfchainb += background->Add("/data/TMVA/preselection-lt.root");
-      //        nfchainb += background->Add("/data/TMVA/preselection-ZW.root");
-       nfchainb += background->Add("/data/TMVA/preselection-Zi.root");
-
-      // global event weights (see below for setting event-wise weights)
-      Float_t w; 
-      Float_t signalWeight;
-      Float_t backgroundWeight;
-
-      signal->SetBranchAddress("w",&w);
-      signal->GetEntry(0,1);
-      signalWeight = w;
-
-      background->SetBranchAddress("w",&w);
-      background->GetEntry(0,1);
-      backgroundWeight = w;
-
-//       cout << " " << endl;
-//       cout << " " << endl;
-//       cout << "***************************************************************************************" << endl;
-//       cout << "Signal weight is: " << signalWeight << " and background weight is: " << backgroundWeight << " for file: " << fname << endl;
-//       cout << "***************************************************************************************" << endl;
-//       cout << " " << endl;
-      cout << " " << endl;
-      factory->AddSignalTree    ( signal,     signalWeight );
-      factory->AddBackgroundTree( background, backgroundWeight );
-    
-   // Define the input variables that shall be used for the MVA training
-   // note that you may also use variable expressions, such as: "3*var1/var2*abs(var3)"
-   // [all types of expressions that can also be parsed by TTree::Draw( "expression" )]
-      factory->AddVariable("njet", 'I');
-      factory->AddVariable("ejet1", 'F');
-      factory->AddVariable("ejet2", 'F');
-      factory->AddVariable("ejet3", 'F');
-      factory->AddVariable("ptlep1", 'F');
-      factory->AddVariable("ptlep2", 'F');
-      factory->AddVariable("cone1", 'F');
-      factory->AddVariable("cone2", 'F');
-//       factory->AddVariable("nel", 'I');
-//       factory->AddVariable("nmu", 'I');
-//       factory->AddVariable("nlep", 'I');
-//       factory->AddVariable("lepID", 'I');
-      factory->AddVariable("massZ", 'F');
-      factory->AddVariable("cosll2d", 'F');
-      factory->AddVariable("cosll3d", 'F');
-      factory->AddVariable("mT", 'F');
-      factory->AddVariable("MET", 'F');
-      factory->AddVariable("cosMETptlep", 'F');
-      factory->AddVariable("cosJetMET", 'F');
-      factory->AddVariable("cosphi", 'F');
-
-//PG    factory->AddVariable("var1+var2", 'F');
-//    factory->AddVariable("var1-var2", 'F');
-//    factory->AddVariable("var3", 'F');
-//    factory->AddVariable("var4", 'F');
-
-   // This would set individual event weights (the variables defined in the 
-   // expression need to exist in the original TTree)
-   factory->SetWeightExpression("w");
-   cout << "weight: " << w << endl;
-
-   // Apply additional cuts on the signal and background sample. 
-   TCut mycut = ""; // for example: TCut mycut = "abs(var1)<0.5 && abs(var2-0.5)<1";
-
-   // tell the factory to use all remaining events in the trees after training for testing:
-   //PG   factory->PrepareTrainingAndTestTree( mycut, "NSigTrain=3000:NBkgTrain=3000:SplitMode=Random:NormMode=NumEvents:!V" );  
-
-   factory->PrepareTrainingAndTestTree( mycut, "NSigTrain=0:NBkgTrain=0:SplitMode=Alternate:NormMode=None" );  
-
-// For systematic studies, switch to Random mode instead of Alternate
-   //   factory->PrepareTrainingAndTestTree( mycut, "NSigTrain=1357:NBkgTrain=2926:SplitMode=Alternate:NormMode=None" );  //WW
-   //      factory->PrepareTrainingAndTestTree( mycut, "NSigTrain=1357:NBkgTrain=2956:SplitMode=Alternate:NormMode=None" );  //tt
-//    factory->PrepareTrainingAndTestTree( mycut, "NSigTrain=0:NBkgTrain=0:SplitMode=Random:NormMode=None" );  
-//    cout << " &&&&&&&&&&&&&&&& Switched to Random instead of Alternate mode for systematic studies  &&&&&&&&&&&&&&&&&&&&&&&&" << endl;
-   // If no numbers of events are given, half of the events in the tree are used for training, and 
-   // the other half for testing:
-   //   factory->PrepareTrainingAndTestTree( mycut, "SplitMode=random:!V" );  
-   // To also specify the number of testing events, use:
-   //   factory->PrepareTrainingAndTestTree( mycut, 
-   //                                        "NSigTrain=3000:NBkgTrain=3000:NSigTest=3000:NBkgTest=3000:SplitMode=Random:!V" );  
-
-   // ---- Book MVA methods
-   //
-   // please lookup the various method configuration options in the corresponding cxx files, eg:
-   // src/MethoCuts.cxx, etc.
-   // it is possible to preset ranges in the option string in which the cut optimisation should be done:
-   // "...:CutRangeMin[2]=-1:CutRangeMax[2]=1"...", where [2] is the third input variable
-
-   // Cut optimisation
-   if (Use_Cuts) 
-     factory->BookMethod( TMVA::Types::kCuts, "Cuts", 
-                          "!H:!V:FitMethod=MC:EffSel:SampleSize=200000:VarProp=FSmart" );
-
-   if (Use_CutsD) 
-     factory->BookMethod( TMVA::Types::kCuts, "CutsD", 
-                          "!H:!V:FitMethod=MC:EffSel:SampleSize=200000:VarProp=FSmart:VarTransform=Decorrelate" );
-
-   if (Use_CutsGA)
-     factory->BookMethod( TMVA::Types::kCuts, "CutsGA",
-                         "!H:!V:FitMethod=GA:EffSel:Steps=30:Cycles=3:PopSize=100:SC_steps=10:SC_rate=5:SC_factor=0.95:VarProp=FSmart" );
-   
-   // Likelihood
-   if (Use_Likelihood) 
-      factory->BookMethod( TMVA::Types::kLikelihood, "Likelihood", 
-                           "!H:!V:!TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=100:NSmoothBkg[0]=10:NSmoothBkg[1]=100:NSmooth=10:NAvEvtPerBin=50" ); 
-
-   // test the decorrelated likelihood
-   if (Use_LikelihoodD) 
-      factory->BookMethod( TMVA::Types::kLikelihood, "LikelihoodD", 
-                           "!H:!V:!TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=100:NSmoothBkg[0]=10:NSmooth=5:NAvEvtPerBin=50:VarTransform=Decorrelate" ); 
-
-   if (Use_LikelihoodPCA) 
-      factory->BookMethod( TMVA::Types::kLikelihood, "LikelihoodPCA", 
-                           "!H:!V:!TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=100:NSmoothBkg[0]=10:NSmooth=5:NAvEvtPerBin=50:VarTransform=PCA" ); 
- 
-   // test the new kernel density estimator
-   if (Use_LikelihoodKDE) 
-      factory->BookMethod( TMVA::Types::kLikelihood, "LikelihoodKDE", 
-                           "!H:!V:!TransformOutput:PDFInterpol=KDE:KDEtype=Gauss:KDEiter=Nonadaptive:KDEborder=None:NAvEvtPerBin=50" ); 
-
-   // test the mixed splines and kernel density estimator (depending on which variable)
-   if (Use_LikelihoodMIX) 
-      factory->BookMethod( TMVA::Types::kLikelihood, "LikelihoodMIX", 
-                           "!H:!V:!TransformOutput:PDFInterpol[0]=KDE:PDFInterpol[1]=KDE:PDFInterpol[2]=Spline2:PDFInterpol[3]=Spline2:KDEtype=Gauss:KDEiter=Nonadaptive:KDEborder=None:NAvEvtPerBin=50" ); 
-
-   // PDE - RS method
-   if (Use_PDERS)
-      factory->BookMethod( TMVA::Types::kPDERS, "PDERS", 
-                           "!H:!V:VolumeRangeMode=Adaptive:KernelEstimator=Gauss:GaussSigma=0.3:NEventsMin=400:NEventsMax=600:InitialScale=0.99" );
-   
-   if (Use_PDERSD) 
-      factory->BookMethod( TMVA::Types::kPDERS, "PDERSD", 
-                           "!H:!V:VolumeRangeMode=Adaptive:KernelEstimator=Gauss:GaussSigma=0.3:NEventsMin=400:NEventsMax=600:InitialScale=0.99:VarTransform=Decorrelate" );
-
-   if (Use_PDERSPCA) 
-      factory->BookMethod( TMVA::Types::kPDERS, "PDERSPCA", 
-                           "!H:!V:VolumeRangeMode=Adaptive:KernelEstimator=Gauss:GaussSigma=0.3:NEventsMin=400:NEventsMax=600:InitialScale=0.99:VarTransform=PCA" );
-  
-   // K-Nearest Neighbour classifier (KNN)
-   if (Use_KNN)
-      factory->BookMethod( TMVA::Types::kKNN, "KNN", 
-                           "nkNN=40:TreeOptDepth=6:ScaleFrac=0.8:!UseKernel:!Trim" );  
-
-   // H-Matrix (chi2-squared) method
-   if (Use_HMatrix)
-      factory->BookMethod( TMVA::Types::kHMatrix, "HMatrix", "!H:!V" ); 
-
-   // Fisher discriminant
-   if (Use_Fisher)
-      factory->BookMethod( TMVA::Types::kFisher, "Fisher", 
-                           "H:!V:!Normalise:CreateMVAPdfs:Fisher:NbinsMVAPdf=50:NsmoothMVAPdf=1" );    
-
-   // Function discrimination analysis (FDA) -- test of various fitters - the recommended one is Minuit or GA
-   if (Use_FDA_MC) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_MC",
-                          "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MC:SampleSize=100000:Sigma=0.1" );
-   
-   if (Use_FDA_GA) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_GA",
-                           "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=GA:PopSize=100:Cycles=3:Steps=20:Trim=True:SaveBestGen=0" );
-
-   if (Use_FDA_SA) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_SA",
-                           "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=SA:MaxCalls=50000:TemperatureGradient=0.7:InitialTemperature=2000000:MinTemperature=500:Eps=1e-04:NFunLoops=5:NEps=4" );
-
-   if (Use_FDA_MT) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_MT",
-                           "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=2:UseImprove:UseMinos:SetBatch" );
-
-   if (Use_FDA_GAMT) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_GAMT",
-                           "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=GA:Converger=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=0:!UseImprove:!UseMinos:SetBatch:Cycles=1:PopSize=5:Steps=5:Trim" );
-
-   if (Use_FDA_MCMT) 
-      factory->BookMethod( TMVA::Types::kFDA, "FDA_MCMT",
-                           "H:!V:Formula=(0)+(1)*x0+(2)*x1+(3)*x2+(4)*x3:ParRanges=(-1,1);(-10,10);(-10,10);(-10,10);(-10,10):FitMethod=MC:Converger=MINUIT:ErrorLevel=1:PrintLevel=-1:FitStrategy=0:!UseImprove:!UseMinos:SetBatch:SampleSize=20" );
-
-   // TMVA ANN: MLP (recommended ANN) -- all ANNs in TMVA are Multilayer Perceptrons
-   if (Use_MLP)
-      factory->BookMethod( TMVA::Types::kMLP, "MLP", "Normalise:H:!V:NCycles=200:HiddenLayers=N+1,N:TestRate=5" );
-
-   // CF(Clermont-Ferrand)ANN
-   if (Use_CFMlpANN)
-      factory->BookMethod( TMVA::Types::kCFMlpANN, "CFMlpANN", "!H:!V:NCycles=500:HiddenLayers=N+1,N"  ); // n_cycles:#nodes:#nodes:...  
-  
-   // Tmlp(Root)ANN
-   if (Use_TMlpANN)
-      factory->BookMethod( TMVA::Types::kTMlpANN, "TMlpANN", "!H:!V:NCycles=200:HiddenLayers=N+1,N"  ); // n_cycles:#nodes:#nodes:...
-  
-   // Support Vector Machines using three different Kernel types (Gauss, polynomial and linear)
-   if (Use_SVM_Gauss)
-      factory->BookMethod( TMVA::Types::kSVM, "SVM_Gauss", "Sigma=2:C=1:Tol=0.001:Kernel=Gauss" );
-
-   if (Use_SVM_Poly)
-      factory->BookMethod( TMVA::Types::kSVM, "SVM_Poly", "Order=4:Theta=1:C=0.1:Tol=0.001:Kernel=Polynomial" );
-
-   if (Use_SVM_Lin)
-      factory->BookMethod( TMVA::Types::kSVM, "SVM_Lin", "!H:!V:Kernel=Linear:C=1:Tol=0.001" );  
-
-   // Boosted Decision Trees (second one with decorrelation)
-   if (Use_BDT)
-      factory->BookMethod( TMVA::Types::kBDT, "BDT", 
-                           "!H:!V:NTrees=400:BoostType=AdaBoost:SeparationType=GiniIndex:nCuts=20:PruneMethod=CostComplexity:PruneStrength=4.5" );
-   if (Use_BDTD)
-      factory->BookMethod( TMVA::Types::kBDT, "BDTD", 
-                           "!H:!V:NTrees=400:BoostType=AdaBoost:SeparationType=GiniIndex:nCuts=20:PruneMethod=CostComplexity:PruneStrength=4.5:VarTransform=Decorrelate" );
-
-   // RuleFit -- TMVA implementation of Friedman's method
-   if (Use_RuleFitTMVA)
-      factory->BookMethod( TMVA::Types::kRuleFit, "RuleFitTMVA",
-                           "H:!V:RuleFitModule=RFTMVA:Model=ModRuleLinear:MinImp=0.001:RuleMinDist=0.001:NTrees=20:fEventsMin=0.01:fEventsMax=0.5:GDTau=-1.0:GDTauPrec=0.01:GDStep=0.01:GDNSteps=10000:GDErrScale=1.02" );
-
-   // Friedman's RuleFit method, implementation by J. Friedman
-   if (Use_RuleFitJF)
-      factory->BookMethod( TMVA::Types::kRuleFit, "RuleFitJF",
-                           "!V:RuleFitModule=RFFriedman:Model=ModRuleLinear:GDStep=0.01:GDNSteps=10000:GDErrScale=1.1:RFNendnodes=4" );
-
-   // ---- Now you can tell the factory to train, test, and evaluate the MVAs
-
-   // Train MVAs using the set of training events
-   factory->TrainAllMethods();
-
-   // ---- Evaluate all MVAs using the set of test events
-   factory->TestAllMethods();
-
-   // ----- Evaluate and compare performance of all configured MVAs
-   factory->EvaluateAllMethods();    
-
-   // --------------------------------------------------------------
-   
-   // Save the output
-   outputFile->Close();
-
-   std::cout << "==> wrote root file TMVA.root" << std::endl;
-   std::cout << "==> TMVAnalysis is done!" << std::endl;      
-
-   // Clean up
-   delete factory;
-
-   // Launch the GUI for the root macros
-   if (!gROOT->IsBatch()) TMVAGui( outfileName );
-}
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVApplication.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVApplication.C
deleted file mode 100644
index 366ec79fdf3d..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/TMVApplication.C
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//**********************************************************************************
- * Project   : TMVA - a Root-integrated toolkit for multivariate data analysis    *
- * Package   : TMVA                                                               *
- * Exectuable: TMVApplication                                                     *
- *                                                                                *
- * This exectutable provides a simple example on how to use the trained MVAs      *
- * within a C++ analysis module                                                   *
- *                                                                                *
- * ------------------------------------------------------------------------------ *
- * see also the alternative (slightly faster) way to retrieve the MVA values in   *
- * examples/TMVApplicationAlternative.cxx                                         *
- * ------------------------------------------------------------------------------ *
- **********************************************************************************/
-
-// ---------------------------------------------------------------
-// choose MVA methods to be trained + tested
-Bool_t Use_Cuts            = 0;
-Bool_t Use_CutsD           = 0;
-Bool_t Use_CutsGA          = 0;
-Bool_t Use_Likelihood      = 0;
-Bool_t Use_LikelihoodD     = 0; // the "D" extension indicates decorrelated input variables (see option strings)
-Bool_t Use_LikelihoodPCA   = 0; // the "PCA" extension indicates PCA-transformed input variables (see option strings)
-Bool_t Use_PDERS           = 0;
-Bool_t Use_PDERSD          = 0;
-Bool_t Use_PDERSPCA        = 0;
-Bool_t Use_KNN             = 0;
-Bool_t Use_HMatrix         = 0;
-Bool_t Use_Fisher          = 0;
-Bool_t Use_FDA_GA          = 0;
-Bool_t Use_FDA_MT          = 0;
-Bool_t Use_MLP             = 0; // this is the recommended ANN
-Bool_t Use_CFMlpANN        = 0; 
-Bool_t Use_TMlpANN         = 0; 
-Bool_t Use_SVM_Gauss       = 0;
-Bool_t Use_SVM_Poly        = 0;
-Bool_t Use_SVM_Lin         = 0;
-Bool_t Use_BDT             = 1;
-Bool_t Use_BDTD            = 0;
-Bool_t Use_RuleFit         = 0;
-
-// ---------------------------------------------------------------
-
-void TMVApplication( TString myMethodList = "" ) {
-  cout << endl;
-  cout << "==> start TMVApplication" << endl;
-
-  if (myMethodList != "") {
-      Use_CutsGA = Use_CutsD = Use_Cuts
-      = Use_LikelihoodPCA = Use_LikelihoodD = Use_Likelihood
-      = Use_PDERSPCA = Use_PDERSD = Use_PDERS 
-      = Use_KNN
-      = Use_MLP = Use_CFMlpANN = Use_TMlpANN
-      = Use_HMatrix = Use_Fisher = Use_BDTD = Use_BDT = Use_RuleFit 
-      = Use_SVM_Gauss = Use_SVM_Poly = Use_SVM_Lin
-      = Use_FDA_GA = Use_FDA_MT
-         = 0;
-
-    TList* mlist = TMVA::Tools::ParseFormatLine( myMethodList, " :," );
-
-//     if (mlist->FindObject( "Cuts"          ) != 0) Use_Cuts          = 1; 
-//     if (mlist->FindObject( "CutsD"         ) != 0) Use_CutsD         = 1; 
-//     if (mlist->FindObject( "CutsGA"        ) != 0) Use_CutsGA        = 1; 
-    if (mlist->FindObject( "Likelihood"    ) != 0) Use_Likelihood    = 1; 
-    if (mlist->FindObject( "LikelihoodD"   ) != 0) Use_LikelihoodD   = 1; 
-    if (mlist->FindObject( "LikelihoodPCA" ) != 0) Use_LikelihoodPCA = 1; 
-    if (mlist->FindObject( "PDERS"         ) != 0) Use_PDERS         = 1; 
-    if (mlist->FindObject( "PDERSD"        ) != 0) Use_PDERSD        = 1; 
-    if (mlist->FindObject( "PDERSPCA"      ) != 0) Use_PDERSPCA      = 1; 
-    if (mlist->FindObject( "KNN"           ) != 0) Use_KNN           = 1; 
-    if (mlist->FindObject( "HMatrix"       ) != 0) Use_HMatrix       = 1; 
-    if (mlist->FindObject( "Fisher"        ) != 0) Use_Fisher        = 1; 
-    if (mlist->FindObject( "MLP"           ) != 0) Use_MLP           = 1; 
-    if (mlist->FindObject( "CFMlpANN"      ) != 0) Use_CFMlpANN      = 1; 
-    if (mlist->FindObject( "TMlpANN"       ) != 0) Use_TMlpANN       = 1; 
-    if (mlist->FindObject( "BDTD"          ) != 0) Use_BDTD          = 1; 
-    if (mlist->FindObject( "BDT"           ) != 0) Use_BDT           = 1; 
-    if (mlist->FindObject( "RuleFit"       ) != 0) Use_RuleFit       = 1; 
-    if (mlist->FindObject( "SVM_Gauss"     ) != 0) Use_SVM_Gauss     = 1; 
-    if (mlist->FindObject( "SVM_Poly"      ) != 0) Use_SVM_Poly      = 1; 
-    if (mlist->FindObject( "SVM_Lin"       ) != 0) Use_SVM_Lin       = 1; 
-    if (mlist->FindObject( "FDA_MT"        ) != 0) Use_FDA_MT        = 1; 
-    if (mlist->FindObject( "FDA_GA"        ) != 0) Use_FDA_GA        = 1; 
-
-    delete mlist;
-  }
-
-// enter the number of different types of events and the # of background weight files used
-  Int_t const ntype = 8;
-  Int_t const nbgndw = 7;
-
-// give the desired names and cut values for the backgrounds  
-  string suffix[7] = {("HZ130-ZZ"), ("HZ250-tt"), ("HZ250-WW"), ("HZ130-tn"), ("HZ250-lt"), ("HZ250-ZW"), ("HZ250-Zi")}; 
-  float cutValue[7] = {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0};  // 
-  float cutProduct = -1.0;
- 
-  Int_t seen[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-  Float_t weight[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  //   Float_t preselected[8] = {18799., 13650., 5911., 5852., 65., 1220., 9191., 104.};  // preselection for 120 GeV 28may
-  //    Float_t preselected[8] = {2674., 13650., 5911., 5852., 65., 1220., 9191., 104.};  //  preselection for 130 GeV
-  //  Float_t preselected[8] = { 2972, 13650., 5911., 5852., 65., 1220., 9191., 104.};  //  preselection for 140 GeV
-  float mvaCuts[nbgndw], mvaCutsD[nbgndw], mvaLk[nbgndw], mvaLkD[nbgndw], mvaLkPCA[nbgndw], mvaPD[nbgndw], mvaPDD[nbgndw];
-  float mvaPDP[nbgndw], mvaPDPCA[nbgndw], mvaHm[nbgndw], mvaFi[nbgndw], mvaNn[nbgndw], ;
-  float mvaNn[nbgndw], mvaNnC[nbgndw], mvaNnT[nbgndw], mvaBdt[nbgndw], mvaBdtD[nbgndw], mvaRf[nbgndw];
-
-// create a set of variables and declare them to the reader
-// - the variable names must corresponds in name and type to 
-// those given in the weight file(s) that you use
- 
-// read the TMVA weights of several different types of background 
-
-  Int_t njet, nel, nmu, nlep, lepID;
-  Float_t ejet1, ejet2, ejet3, ptlep1, ptlep2, cone1, cone2, massZ;
-  Float_t cosll2d, cosll3d, mT, MET, cosMETptlep, cosJetMET, cosphi;
-
-  TMVA::Reader *reader[nbgndw];
-
-  for (int i=0; i<nbgndw; i++) {
-
-
-// create the TMVA_Reader objects
-//
-    reader[i]= new TMVA::Reader();    
-  
-    reader[i]->AddVariable( "njet", &njet);
-    reader[i]->AddVariable( "ejet1", &ejet1);
-    reader[i]->AddVariable( "ejet2", &ejet2);
-    reader[i]->AddVariable( "ejet3", &ejet3);
-    reader[i]->AddVariable( "ptlep1", &ptlep1);
-    reader[i]->AddVariable( "ptlep2", &ptlep2);
-    reader[i]->AddVariable( "cone1", &cone1);
-    reader[i]->AddVariable( "cone2", &cone2);
-    reader[i]->AddVariable( "massZ", &massZ);
-    reader[i]->AddVariable( "cosll2d", &cosll2d);
-    reader[i]->AddVariable( "cosll3d", &cosll3d);
-    reader[i]->AddVariable( "mT", &mT);
-    reader[i]->AddVariable( "MET", &MET);
-    reader[i]->AddVariable( "cosMETptlep", &cosMETptlep);
-    reader[i]->AddVariable( "cosJetMET", &cosJetMET);
-    reader[i]->AddVariable( "cosphi", &cosphi);
-
-//// book the MVA methods
-
-    string dir    = "weights/";
-//   string prefix = "MVAnalysis";
-
-//     if (Use_Cuts)          reader[i]->BookMVA( "Cuts method",          dir + suffix[i] + "_Cuts.weights.txt" );
-//     if (Use_CutsD)         reader[i]->BookMVA( "CutsD method",         dir + suffix[i] + "_CutsD.weights.txt" );
-//     if (Use_CutsGA)        reader[i]->BookMVA( "CutsGA method",        dir + suffix[i] + "_CutsGA.weights.txt" );
-    if (Use_Likelihood)    reader[i]->BookMVA( "Likelihood method",    dir + suffix[i] + "_Likelihood.weights.txt" );
-    if (Use_LikelihoodD)   reader[i]->BookMVA( "LikelihoodD method",   dir + suffix[i] + "_LikelihoodD.weights.txt" );
-    if (Use_LikelihoodPCA) reader[i]->BookMVA( "LikelihoodPCA method", dir + suffix[i] + "_LikelihoodPCA.weights.txt" );
-    if (Use_PDERS)         reader[i]->BookMVA( "PDERS method",         dir + suffix[i] + "_PDERS.weights.txt" );
-    if (Use_PDERSD)        reader[i]->BookMVA( "PDERSD method",        dir + suffix[i] + "_PDERSD.weights.txt" );
-    if (Use_PDERSPCA)      reader[i]->BookMVA( "PDERSPCA method",      dir + suffix[i] + "_PDERSPCA.weights.txt" );
-    if (Use_KNN)           reader[i]->BookMVA( "KNN method",           dir + suffix[i] + "_KNN.weights.txt" );
-    if (Use_HMatrix)       reader[i]->BookMVA( "HMatrix method",       dir + suffix[i] + "_HMatrix.weights.txt" );
-    if (Use_Fisher)        reader[i]->BookMVA( "Fisher method",        dir + suffix[i] + "_Fisher.weights.txt" );
-    if (Use_MLP)           reader[i]->BookMVA( "MLP method",           dir + suffix[i] + "_MLP.weights.txt" );
-    if (Use_CFMlpANN)      reader[i]->BookMVA( "CFMlpANN method",      dir + suffix[i] + "_CFMlpANN.weights.txt" );
-    if (Use_TMlpANN)       reader[i]->BookMVA( "TMlpANN method",       dir + suffix[i] + "_TMlpANN.weights.txt" );
-    if (Use_BDT)           reader[i]->BookMVA( "BDT method",           dir + suffix[i] + "_BDT.weights.txt" );
-    if (Use_BDTD)          reader[i]->BookMVA( "BDTD method",          dir + suffix[i] + "_BDTD.weights.txt" );
-    if (Use_RuleFit)       reader[i]->BookMVA( "RuleFit method",       dir + suffix[i] + "_RuleFitTMVA.weights.txt" );
-    if (Use_SVM_Gauss)     reader[i]->BookMVA( "SVM_Gauss method",     dir + suffix[i] + "_SVM_Gauss.weights.txt" );
-    if (Use_SVM_Poly)      reader[i]->BookMVA( "SVM_Poly method",      dir + suffix[i] + "_SVM_Poly.weights.txt" );
-    if (Use_SVM_Lin)       reader[i]->BookMVA( "SVM_Lin method",       dir + suffix[i] + "_SVM_Lin.weights.txt" );
-    if (Use_FDA_MT)        reader[i]->BookMVA( "FDA_MT method",        dir + suffix[i] + "_FDA_MT.weights.txt" );
-    if (Use_FDA_GA)        reader[i]->BookMVA( "FDA_GA method",        dir + suffix[i] + "_FDA_GA.weights.txt" );
-
-// end loop over the different types of background weight files
-     }
-// book output histograms
-  UInt_t nbin = 100;
-  TH1F *histLk, *histLkD, *histLkPCA, *histPD, *histPDD, *histPDPCA, *histKNN, *histHm, *histFi;
-  TH1F *histNn, *histNnC, *histNnT, *histBdt, *histBdtD, *histRf;
-  TH1F *histSVMG, *histSVMP, *histSVML;
-  TH1F *histFDAMT, *histFDAGA;
-
-  if (Use_Likelihood)    histLk    = new TH1F( "MVA_Likelihood",    "MVA_Likelihood",    nbin,  0, 1 );
-  if (Use_LikelihoodD)   histLkD   = new TH1F( "MVA_LikelihoodD",   "MVA_LikelihoodD",   nbin,  0.000001, 0.9999 );
-  if (Use_LikelihoodPCA) histLkPCA = new TH1F( "MVA_LikelihoodPCA", "MVA_LikelihoodPCA", nbin,  0, 1 );
-  if (Use_PDERS)         histPD    = new TH1F( "MVA_PDERS",         "MVA_PDERS",         nbin,  0, 1 );
-  if (Use_PDERSD)        histPDD   = new TH1F( "MVA_PDERSD",        "MVA_PDERSD",        nbin,  0, 1 );
-  if (Use_PDERSPCA)      histPDPCA = new TH1F( "MVA_PDERSPCA",      "MVA_PDERSPCA",      nbin,  0, 1 );
-  if (Use_KNN)           histKNN   = new TH1F( "MVA_KNN",           "MVA_KNN",           nbin,  0, 1 );
-  if (Use_HMatrix)       histHm    = new TH1F( "MVA_HMatrix",       "MVA_HMatrix",       nbin, -0.95, 1.55 );
-  if (Use_Fisher)        histFi    = new TH1F( "MVA_Fisher",        "MVA_Fisher",        nbin, -4, 4 );
-  if (Use_MLP)           histNn    = new TH1F( "MVA_MLP",           "MVA_MLP",           nbin, -0.25, 1.5 );
-  if (Use_CFMlpANN)      histNnC   = new TH1F( "MVA_CFMlpANN",      "MVA_CFMlpANN",      nbin,  0, 1 );
-  if (Use_TMlpANN)       histNnT   = new TH1F( "MVA_TMlpANN",       "MVA_TMlpANN",       nbin, -1.3, 1.3 );
-  if (Use_BDT)           histBdt   = new TH1F( "MVA_BDT",           "MVA_BDT",           nbin, -0.8, 0.8 );
-  if (Use_BDTD)          histBdtD  = new TH1F( "MVA_BDTD",          "MVA_BDTD",          nbin, -0.4, 0.6 );
-  if (Use_RuleFit)       histRf    = new TH1F( "MVA_RuleFitTMVA",   "MVA_RuleFitTMVA",   nbin, -2.0, 2.0 );
-  if (Use_SVM_Gauss)     histSVMG  = new TH1F( "MVA_SVM_Gauss",     "MVA_SVM_Gauss",     nbin, 0.0, 1.0 );
-  if (Use_SVM_Poly)      histSVMP  = new TH1F( "MVA_SVM_Poly",      "MVA_SVM_Poly",      nbin, 0.0, 1.0 );
-  if (Use_SVM_Lin)       histSVML  = new TH1F( "MVA_SVM_Lin",       "MVA_SVM_Lin",       nbin, 0.0, 1.0 );
-  if (Use_FDA_MT)        histFDAMT = new TH1F( "MVA_FDA_MT",        "MVA_FDA_MT",        nbin, -2.0, 3.0 );
-  if (Use_FDA_GA)        histFDAGA = new TH1F( "MVA_FDA_GA",        "MVA_FDA_GA",        nbin, -2.0, 3.0 );
-
-// book examsple histogram for probability (the other methods are done similarly)
-  TH1F *probHistFi, *rarityHistFi;
-  if (Use_Fisher) {
-    probHistFi   = new TH1F( "PROBA_MVA_Fisher",  "PROBA_MVA_Fisher",  nbin, 0, 1 );
-    rarityHistFi = new TH1F( "RARITY_MVA_Fisher", "RARITY_MVA_Fisher", nbin, 0, 1 );
-  }
-
-// open a new ROOT output file
-  TFile final("/data/TMVA/final/final.root", "recreate");
-
-// create a new tree to save additional info
-
-  Float_t bdtZZ = 0.0;
-  Float_t bdttt = 0.0;
-  Float_t bdtWW = 0.0;
-  Float_t bdttn = 0.0;
-  Float_t bdtlt = 0.0;
-  Float_t bdtZW = 0.0;
-  Float_t bdtZi = 0.0;
-
-  Int_t runnum;
-  Int_t evtnum, type;
-  Float_t w;
-
-  TTree finalTree ("finalTree", "TMVA weights");
-  finalTree.Branch("runnum",&runnum,"runnum/I");	         
-  finalTree.Branch("evtnum",&evtnum,"evtnum/I");	         
-  finalTree.Branch("type",&type,"type/I");	         
-  finalTree.Branch("bdtZZ",&bdtZZ,"bdtZZ/F");	         
-  finalTree.Branch("bdttt",&bdttt,"bdttt/F");	         
-  finalTree.Branch("bdtWW",&bdtWW,"bdtWW/F");	         
-  finalTree.Branch("bdttn",&bdttn,"bdttn/F");	         
-  finalTree.Branch("bdtlt",&bdtlt,"bdtlt/F");	         
-  finalTree.Branch("bdtZW",&bdtZW,"bdtZW/F");	         
-  finalTree.Branch("bdtZi",&bdtZi,"bdtZi/F");	         
-  finalTree.Branch("mT",&mT,"mT/F");	         
-  finalTree.Branch("massZ",&massZ,"massZ/F");	         
-  finalTree.Branch("cosll2d",&cosll2d,"cosll2d/F");	         
-  finalTree.Branch("cosll3d",&cosll3d,"cosll3d/F");	         
-  finalTree.Branch("cosMETptlep",&cosMETptlep,"cosMETptlep/F");	         
-  finalTree.Branch("cosphi",&cosphi,"cosphi/F");	         
-  finalTree.Branch("MET",&MET,"MET/F");	         
-  finalTree.Branch("w",&w,"w/F");	         
-
-// declare all these trees to be friends
-//   finalTree.AddFriend("TreeS",fname);
-//   finalTree.AddFriend("TreeB",fname);
-
- // book output histograms
-   UInt_t nbin = 100;
-	TH1F *histLk, *histLkD, *histLkPCA, *histPD, *histPDD, *histPDPCA, *histHm, *histFi;
-   TH1F *histNn, *histNnC, *histNnT, *histBdt, *histBdtD, *histRf;
-   if (Use_Likelihood)    histLk    = new TH1F( "MVA_Likelihood",    "MVA_Likelihood",    nbin,  0, 1 );
-   if (Use_LikelihoodD)   histLkD   = new TH1F( "MVA_LikelihoodD",   "MVA_LikelihoodD",   nbin,  0.000001, 0.9999 );
-   if (Use_LikelihoodPCA) histLkPCA = new TH1F( "MVA_LikelihoodPCA", "MVA_LikelihoodPCA", nbin,  0, 1 );
-   if (Use_PDERS)         histPD    = new TH1F( "MVA_PDERS",         "MVA_PDERS",         nbin,  0, 1 );
-   if (Use_PDERSD)        histPDD   = new TH1F( "MVA_PDERSD",        "MVA_PDERSD",        nbin,  0, 1 );
-   if (Use_PDERSPCA)      histPDPCA = new TH1F( "MVA_PDERSPCA",      "MVA_PDERSPCA",      nbin,  0, 1 );
-   if (Use_HMatrix)       histHm    = new TH1F( "MVA_HMatrix",       "MVA_HMatrix",       nbin, -0.95, 1.55 );
-   if (Use_Fisher)        histFi    = new TH1F( "MVA_Fisher",        "MVA_Fisher",        nbin, -4, 4 );
-   if (Use_MLP)           histNn    = new TH1F( "MVA_MLP",           "MVA_MLP",           nbin, -0.25, 1.5 );
-   if (Use_CFMlpANN)      histNnC   = new TH1F( "MVA_CFMlpANN",      "MVA_CFMlpANN",      nbin,  0, 1 );
-   if (Use_TMlpANN)       histNnT   = new TH1F( "MVA_TMlpANN",       "MVA_TMlpANN",       nbin, -1, 1 );
-   if (Use_BDT)           histBdt   = new TH1F( "MVA_BDT",           "MVA_BDT",           nbin, -0.4, 0.6 );
-   if (Use_BDTD)          histBdtD  = new TH1F( "MVA_BDTD",          "MVA_BDTD",          nbin, -0.4, 0.6 );
-   if (Use_RuleFit)       histRf    = new TH1F( "MVA_RuleFit",       "MVA_RuleFit",       nbin, -1.3, 1.3 );
-
-   // 
-   //
-   // prepare the tree
-   // - here the variable names have to corresponds to your tree
-   // - you can use the same variables as above which is slightly faster,
-   //   but of course you can use different ones and copy the values inside the event loop
-   //
-
-//    TFile *input(0);
-//    cout << "--- accessing data file: " << fname << endl;
-//    input = TFile::Open( fname );
-
-//    TTree* theTree = (TTree*)input->Get("TreeS");
-
-//   TTree* theTree;
-//    for (int choice=0; choice<2; choice++) {
-//     if (choice == 0)  theTree = (TTree*)input->Get("TreeS");
-//     if (choice == 1)  theTree = (TTree*)input->Get("TreeB");
-
-   int nfchain=0;
-   TChain* theTree = 0;
-   for (int choice=0; choice<2; choice++) {
-     //    if (theTree) delete theTree;
-     if (choice == 0)  theTree = new TChain("TreeS");
-     if (choice == 1)  theTree = new TChain("TreeB");
-
-     nfchain += theTree->Add("/data/TMVA/preselection-HZ250-10jun.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-ZZ.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-tt.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-WW.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-tn.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-lt.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-ZW.root");
-     nfchain += theTree->Add("/data/TMVA/preselection-Zi.root");
-
-    theTree->SetBranchAddress( "njet", &njet );
-    theTree->SetBranchAddress( "ejet1", &ejet1 );
-    theTree->SetBranchAddress( "ejet2", &ejet2 );
-    theTree->SetBranchAddress( "ejet3", &ejet3 );
-    theTree->SetBranchAddress( "ptlep1", &ptlep1 );
-    theTree->SetBranchAddress( "ptlep2", &ptlep2 );
-    theTree->SetBranchAddress( "cone1", &cone1 );
-    theTree->SetBranchAddress( "cone2", &cone2 );
-    theTree->SetBranchAddress( "nel", &nel );
-    theTree->SetBranchAddress( "nmu", &nmu );
-    theTree->SetBranchAddress( "nlep", &nlep );
-    theTree->SetBranchAddress( "lepID", &lepID );
-    theTree->SetBranchAddress( "massZ", &massZ );
-    theTree->SetBranchAddress( "cosll2d", &cosll2d );
-    theTree->SetBranchAddress( "cosll3d", &cosll3d );
-    theTree->SetBranchAddress( "mT", &mT );
-    theTree->SetBranchAddress( "MET", &MET );
-    theTree->SetBranchAddress( "cosMETptlep", &cosMETptlep);
-    theTree->SetBranchAddress( "cosJetMET", &cosJetMET);
-    theTree->SetBranchAddress( "cosphi", &cosphi );
-    theTree->SetBranchAddress( "runnum", &runnum );
-    theTree->SetBranchAddress( "evtnum", &evtnum );
-    theTree->SetBranchAddress( "type", &type );
-    theTree->SetBranchAddress( "w", &w );
-
-// efficiency calculator for cut method
-    int    nSelCuts = 0;
-    float effS     = 0.7;
-
-    cout << "--- processing: " << theTree->GetEntries() << " events" << endl; 
-
-    TStopwatch sw;
-    sw.Start();
-
-// loop over all events
-    int counter = 0;
-    cout << "Found " << theTree->GetEntries() << " for choice = " << choice << endl;
-    for (Long64_t ievt=0; ievt<theTree->GetEntries();ievt++) {
-
-      theTree->GetEntry(ievt);
-
-// store the weight for each event type
-      weight[type] = w;
-      //      cout << "weight: " << w <<endl;
-      
-      if (ievt == 0) cout << "--- ... processing the first event " << endl;
-      if (ievt%1000 == 0) cout << "--- ... processing event: " << ievt << endl;
-      if (ievt==theTree->GetEntries()-1) cout << "--- ... processed last event: " << ievt << endl;
-
-// only retain half the events, namely the even events to avoid reusing the same events as for training
-      seen[type]++;
-      if ((seen[type] % 2) == 0) {
-	counter++;    //
-
-// now extract the value of tmva for each background type for this event
-	for (int i=0; i<nbgndw; i++) {
-
-// 
-// return the MVAs and fill to histograms
-// 
-// 	  if (Use_Cuts) {
-// // Cuts is a special case: give the desired signal efficienciy
-// 	    Bool_t passed = reader[i]->EvaluateMVA( "Cuts method", effS );
-// 	    if (passed) nSelCuts++;
-// 	  }
-// 	  if (Use_CutsD) {
-// // Cuts is a special case: give the desired signal efficienciy
-// 	    Bool_t passed = reader[i]->EvaluateMVA( "CutsD method", effS );
-// 	    if (passed) nSelCutsD++;
-// 	  }
-// 	  if (Use_CutsGA) {
-// // Cuts is a special case: give the desired signal efficienciy
-// 	    Bool_t passed = reader[i]->EvaluateMVA( "CutsGA method", effS );
-// 	    if (passed) nSelCutsGA++;
-// 	  }
-
-	  if (Use_Likelihood   )   histLk    ->Fill( reader[i]->EvaluateMVA( "Likelihood method"    ) );
-	  if (Use_LikelihoodD  )   histLkD   ->Fill( reader[i]->EvaluateMVA( "LikelihoodD method"   ) );
-	  if (Use_LikelihoodPCA)   histLkPCA ->Fill( reader[i]->EvaluateMVA( "LikelihoodPCA method" ) );
-	  if (Use_PDERS        )   histPD    ->Fill( reader[i]->EvaluateMVA( "PDERS method"         ) );
-	  if (Use_PDERSD       )   histPDD   ->Fill( reader[i]->EvaluateMVA( "PDERSD method"        ) );
-	  if (Use_PDERSPCA     )   histPDPCA ->Fill( reader[i]->EvaluateMVA( "PDERSPCA method"      ) );
-	  if (Use_KNN          )   histKNN   ->Fill( reader[i]->EvaluateMVA( "KNN method"           ) );
-	  if (Use_HMatrix      )   histHm    ->Fill( reader[i]->EvaluateMVA( "HMatrix method"       ) );
-	  if (Use_Fisher       )   histFi    ->Fill( reader[i]->EvaluateMVA( "Fisher method"        ) );
-	  if (Use_MLP          )   histNn    ->Fill( reader[i]->EvaluateMVA( "MLP method"           ) );
-	  if (Use_CFMlpANN     )   histNnC   ->Fill( reader[i]->EvaluateMVA( "CFMlpANN method"      ) );
-	  if (Use_TMlpANN      )   histNnT   ->Fill( reader[i]->EvaluateMVA( "TMlpANN method"       ) );
-	  if (Use_BDT          )   histBdt   ->Fill( reader[i]->EvaluateMVA( "BDT method"           ) );
-	  if (Use_BDTD         )   histBdtD  ->Fill( reader[i]->EvaluateMVA( "BDTD method"          ) );
-	  if (Use_RuleFit      )   histRf    ->Fill( reader[i]->EvaluateMVA( "RuleFit method"       ) );
-	  if (Use_SVM_Gauss    )   histSVMG  ->Fill( reader[i]->EvaluateMVA( "SVM_Gauss method"     ) );
-	  if (Use_SVM_Poly     )   histSVMP  ->Fill( reader[i]->EvaluateMVA( "SVM_Poly method"      ) );
-	  if (Use_SVM_Lin      )   histSVML  ->Fill( reader[i]->EvaluateMVA( "SVM_Lin method"       ) );
-	  if (Use_FDA_MT       )   histFDAMT ->Fill( reader[i]->EvaluateMVA( "FDA_MT method"        ) );
-	  if (Use_FDA_GA       )   histFDAGA ->Fill( reader[i]->EvaluateMVA( "FDA_GA method"        ) );
-	  
-      // retrieve probability instead of MVA output
-	  if (Use_Fisher       )   {
-	    probHistFi  ->Fill( reader[i]->GetProba ( "Fisher method" ) );
-	    rarityHistFi->Fill( reader[i]->GetRarity( "Fisher method" ) );
-	  }
-
-// 	  if (Use_Cuts         )   mvaCuts[i] = reader[i]->EvaluateMVA( "Cuts method"          );
-// 	  if (Use_CutsD        )   mvaCutsD[i]= reader[i]->EvaluateMVA( "CutsD method"         );
-// 	  if (Use_Likelihood   )   mvaLk[i]   = reader[i]->EvaluateMVA( "Likelihood method"    );
-// 	  if (Use_LikelihoodD  )   mvaLkD[i]  = reader[i]->EvaluateMVA( "LikelihoodD method"   );
-// 	  if (Use_LikelihoodPCA)   mvaLkPCA[i]= reader[i]->EvaluateMVA( "LikelihoodPCA method" );
-// 	  if (Use_PDERS        )   mvaPD[i]   = reader[i]->EvaluateMVA( "PDERS method"         );
-// 	  if (Use_PDERSD       )   mvaPDD[i]  = reader[i]->EvaluateMVA( "PDERSD method"        );
-// 	  if (Use_PDERSPCA     )   mvaPDPCA[i]= reader[i]->EvaluateMVA( "PDERSPCA method"      );
-// 	  if (Use_HMatrix      )   mvaHm[i]   = reader[i]->EvaluateMVA( "HMatrix method"       );
-// 	  if (Use_Fisher       )   mvaFi[i]   = reader[i]->EvaluateMVA( "Fisher method"        );
-// 	  if (Use_MLP          )   mvaNn[i]   = reader[i]->EvaluateMVA( "MLP method"           );
-// 	  if (Use_CFMlpANN     )   mvaNnC[i]  = reader[i]->EvaluateMVA( "CFMlpANN method"      );
-// 	  if (Use_TMlpANN      )   mvaNnT[i]  = reader[i]->EvaluateMVA( "TMlpANN method"       );
-	  if (Use_BDT          )   mvaBdt[i]  = reader[i]->EvaluateMVA( "BDT method"           );        
-// 	  if (Use_BDTD         )   mvaBdtD[i] = reader[i]->EvaluateMVA( "BDTD method"          );        
-// 	  if (Use_RuleFit      )   mvaRf [i]  = reader[i]->EvaluateMVA( "RuleFit method"       );        
-
-	  if (i == 0) bdtZZ = mvaBdt[i];
-	  if (i == 1) bdttt = mvaBdt[i];
-	  if (i == 2) bdtWW = mvaBdt[i];
-	  if (i == 3) bdttn = mvaBdt[i];
-	  if (i == 4) bdtlt = mvaBdt[i];
-	  if (i == 5) bdtZW = mvaBdt[i];
-	  if (i == 6) bdtZi = mvaBdt[i];
-// 
-// end loop on background types to extract each separate BDT value
-//  
-	}
-// if using the product of the output variables, apply the cut here:
-//	cout << type << "\t" << bdtZZ << "\t" << bdttt << "\t" << bdtWW << "\t" << w << endl;
-	finalTree.Fill();  
- 
-// end loop on reading only the second half of events
-      }
-// end loop on reading all events
-    } 
-    sw.Stop();
-
-// get elapsed time
-//     if (Use_Cuts)   cout << "--- efficiency for Cuts method  : " << float(nSelCuts)/theTree->GetEntries()
-//                         << " (for a required signal efficiency of " << effS << ")" << endl;
-//     if (Use_CutsD)  cout << "--- efficiency for CutsD method : " << float(nSelCutsD)/theTree->GetEntries()
-//                         << " (for a required signal efficiency of " << effS << ")" << endl;
-//     if (Use_CutsGA) cout << "--- efficiency for CutsGA method: " << float(nSelCutsGA)/theTree->GetEntries()
-//                         << " (for a required signal efficiency of " << effS << ")" << endl;
-    cout << "--- end of event loop" << endl;
-  
-//end loop on choice of reading signal or backgrounds
-   }
-
-//
-// write histograms
-//
-   finalTree.Print();
-   //   finalTree.Close();
-   final.Write();
-   //   final.Close();
-
-   TFile *target  = new TFile( "TMVApp.root","RECREATE" );
-   if (Use_Likelihood   )   histLk    ->Write();
-   if (Use_LikelihoodD  )   histLkD   ->Write();
-   if (Use_LikelihoodPCA)   histLkPCA ->Write();
-   if (Use_PDERS        )   histPD    ->Write();
-   if (Use_PDERSD       )   histPDD   ->Write();
-   if (Use_PDERSPCA     )   histPDPCA ->Write();
-   if (Use_KNN          )   histKNN   ->Write();
-   if (Use_HMatrix      )   histHm    ->Write();
-   if (Use_Fisher       )   histFi    ->Write();
-   if (Use_MLP          )   histNn    ->Write();
-   if (Use_CFMlpANN     )   histNnC   ->Write();
-   if (Use_TMlpANN      )   histNnT   ->Write();
-   if (Use_BDT          )   histBdt   ->Write();
-   if (Use_BDTD         )   histBdtD  ->Write();
-   if (Use_RuleFit      )   histRf    ->Write();
-   if (Use_SVM_Gauss    )   histSVMG  ->Write();
-   if (Use_SVM_Poly     )   histSVMP  ->Write();
-   if (Use_SVM_Lin      )   histSVML  ->Write();
-   if (Use_FDA_MT       )   histFDAMT ->Write();
-   if (Use_FDA_GA       )   histFDAGA ->Write();
-
-   if (Use_Fisher       ) { probHistFi->Write(); rarityHistFi->Write(); }
-   target->Close();
-
-   cout << "--- created root file: \"TMVApp.root\" containing the MVA output histograms" << endl;
-
-   for (int j=0; j<nbgndw; j++) {delete reader[j];}
-   cout << "==> TMVApplication is done!" << endl << endl;
-} 
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/cuts.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/cuts.C
deleted file mode 100644
index a3a14d9d826d..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/cuts.C
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// program used to apply the final selection based on the chosen TMVA output variable. (previously called stack.C)
-// 
-// *************    Written by Pauline Gagnon - 14 mars6 may 2008  *********************
-// 
-using namespace std;
-
-#define CHAIN
-
-#include <fstream>
-using std::ofstream;
-
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <string.h>
-#include <vector>
-#include <list>  
-#include <stdlib.h>
-// Regular include files to make ROOT work with our C++ program
-#include "TROOT.h"
-#include "TApplication.h"
-#include "TCanvas.h"
-#include "TPaveText.h"
-#include "TLine.h"
-#include "TPaveLabel.h"
-#include "TNtuple.h"
-#include "TH1.h"
-#include "THStack.h"
-#include "TPad.h"
-#include "TFile.h"
-#include "TLegend.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TGraph.h"
-#include "TFrame.h"
-
-// - - - Initiates the GUI interface of ROOT - - -
-using std::string;
-using std::setprecision;
-Int_t places = 2;
-extern void InitGui();
-
-//============================================================================
-
-int main(int argc, char **argv)
-{
-  // execute rootlogon.C to get ATLAS style setup.
-#include "rootlogon.C"
-
-  // initialization of all counters for statistics
-
-  // enter the number of different types of events and the # of background weight files used
-  Int_t const ntype = 8;
-  Int_t const nvar = 8;
-
-  // open output file to save the cutflow results
-  ofstream outClientFile( "cuts.dat", ios::out );
-
-  // exit program if unable to open file
-  if ( !outClientFile ) {
-    cerr << "File could not be opened" << endl;
-    exit (1);
-  } // end if
-  
-  VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
-  TROOT root("","", initfuncs);
-
-  TApplication theApp("App", &argc, argv);
-  gROOT->Reset();
-  gROOT->SetStyle("ATLAS");
-  gROOT->ForceStyle();
-
-  Int_t nb=0;
-  bool last_rec=0;
-
-  float minValue[8] = {61.19, -1.0, -1.0, -1.0, 0.0, -1.0, -1.0, 0.0};  // 
-  float maxValue[8] = {121.19, 1.0,  1.0,  1.0, 700.0, 1.0,  1.0, 50.0};  // 
-
-  //              - - - Getting tree from the disk - - - 
-
-  // We define the chain, which is basically a tree to add root files with the same tree name.
-  // If you have two or more files, just keep going as nfchain += chain->Add("filename.root")
-
-  float massZ;
-  float cosJetMET = 0.;
-  float cosll2d;
-  float cosll3d;
-  float mT;
-  float cosMETptlep;
-  float cosphi;
-  float cone1;
-  //  float ptlep2;
-  
-  int runnum;
-  int evtnum;
-  int type;
-  float w;
-  const float massZ0 = 91.190;
-
-#ifdef CHAIN
-
-  TChain* chain = new TChain("TreeB");
-  Int_t nfchain=0;
-  
-  nfchain += chain->Add("/data/TMVA/preselection-HZ130-TreeB-4jun.root");
-  nfchain += chain->Add("/data/TMVA/preselection-ZZ.root");
-  nfchain += chain->Add("/data/TMVA/preselection-tt.root");
-  nfchain += chain->Add("/data/TMVA/preselection-WW.root");
-  nfchain += chain->Add("/data/TMVA/preselection-tn.root");
-  nfchain += chain->Add("/data/TMVA/preselection-lt.root");
-  nfchain += chain->Add("/data/TMVA/preselection-ZW.root");
-  nfchain += chain->Add("/data/TMVA/preselection-Zi.root");
-
-  chain->SetBranchAddress( "massZ", &massZ );
-  chain->SetBranchAddress( "cosll2d", &cosll2d );
-  chain->SetBranchAddress( "cosll3d", &cosll3d );
-  chain->SetBranchAddress( "mT", &mT );
-  chain->SetBranchAddress( "cosMETptlep", &cosMETptlep);
-  chain->SetBranchAddress( "cosJetMET", &cosJetMET);
-  chain->SetBranchAddress( "cosphi", &cosphi );
-  chain->SetBranchAddress( "cone1", &cone1 );
-  chain->SetBranchAddress( "runnum", &runnum );
-  chain->SetBranchAddress( "evtnum", &evtnum );
-  chain->SetBranchAddress( "type", &type );
-  chain->SetBranchAddress( "w", &w );
-  //  chain->SetBranchAddress( "ptlep2", &ptlep2 );
-
-  Int_t nrec = static_cast<int>(0.5 + chain->GetEntries());
-  cout << nrec << " records found in the chain. "<< endl;
-
-  // The above is to find the number of events or entries
-
-#endif // CHAIN 
-
-  Float_t bestSoverB = 0.0;
-  
-  // ============  Loop over each variable 
-  for (int t=0; t<nvar; t++) {
-        if (t == 1) {   
-    //    if (t >= 0) {   
-
-      string varType[8]  = {("massZ"), ("cosll2d"), ("cosll3d"), ("cosphi"), ("mT"),("cosjetmet"),("cosmetptlep"), ("cone1")}; 
-      //      string varType[7]  = {("massZ"), ("cosll2d"), ("cosll3d"), ("cosphi"), ("mT"),("cosjetmet"),("cosmetptlep")}; 
-      
-      cout << "*********************************************************************" << endl;
-      cout << " variable being scanned: " << varType[t] << " between " << minValue[t] << " and " << maxValue[t] << endl;
-      cout << "*********************************************************************" << endl;
-      
-      outClientFile << "*********************************************************************" << endl;
-      outClientFile << " variable being scanned: " << varType[t] << " between " << minValue[t] << " and " << maxValue[t] << endl;
-      outClientFile << "*********************************************************************" << endl;
-      
-      // ============  Loop over the cut values for the each background type
-      Float_t SoverB;
-      Float_t bestxi2[8] = {1000.,1000.,1000.,1000.,1000.,1000.,1000.,1000.};
-      Float_t bestcut[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-
-      Float_t xi2;
-      Float_t cut = -1.0;
-      Float_t ncut = 100.0;
-      for (float c=0.0; c<ncut; c++) {
-	
-	//	float CutValue[8] = {50.0, -1.0, -1.0, 1.0, 0.0, -1.0, 1.0, -0.1};  // starting point 
-
-	//         float CutValue[7] = {12.0, -1.0, -1.0, -0.98, 399.0, -1.0, 1.0};  // cross-check
-	 //         float CutValue[7] = {50.0, -1.0, -1.0, 1.0, 0.0, -1.0, 1.0};  // starting point 
-         float CutValue[7] = {12.0, -1.0, -1.0, -0.98, 399.0, -0.96, 1.0};  // with only halft the events - 3 jun
-	//	float CutValue[7] = {12.0, -0.76, -1.0, -0.86, 378.0, -1.0, -0.72};  // final cuts
-
-	Float_t weight[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	
-	Float_t variable[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t selected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t rejected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t Total[8]  =     {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t TotalBgnd = 0.0;
-	
-	float NSignal = 0.0;
-	float NBgnd = 0.0;
-	
-	int passed[8] = {0,0,0,0,0,0,0,0};
-	float failed[8][8] = {
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
-	};
-
-	if (t>0 && t !=3 && t !=6) {
-	  float increment=(maxValue[t]-minValue[t])/ncut;
-	  cut = minValue[t] + c*increment;
-	  CutValue[t] = cut;
-	}
-
-	if (t ==3 || t ==6) {
-	  float increment=(maxValue[t]-minValue[t])/ncut;
-	  cut = maxValue[t] - c*increment;
-	  CutValue[t] = cut;
-	}
-
-	if (t==0) {
-	  float increment=(maxValue[t]-massZ0)/ncut;
-	  cut = (c+1.0)*increment;
-	  CutValue[t] = cut;
-	}
-
-	// ============  Starting the main loop over the events  ===============
-	
-	for (Int_t i=0; i<nrec; i++) {        
-	  
-	  last_rec=(i>=nrec-1); 
-	  
-	  if(!last_rec)
-	    {
-#ifdef CHAIN
-	      nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-	      nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-	    }
-	  // Reading the i-th (current) record:
-	  
-#ifdef CHAIN
-	  nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-	  nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-	  
-// only take every other event, rejecting the half of events used in training
-	  if ((i%2) != 0) {
-
-	    // store the weight for each event type
-	    weight[type] = w;
-	  
-	    variable[0] = massZ;
-	    variable[1] = cosll2d;
-	    variable[2] = cosll3d;
-	    variable[3] = cosphi;
-	    variable[4] = mT;
-	    variable[5] = cosJetMET;
-	    variable[6] = cosMETptlep;
-	    variable[7] = cone1;
-	  
-	    int success = 1;
-	  
-	    for (int i = 0; i < nvar; i++) {
-	      passed[i] = 0;
-	    
-	      if (i > 0 && i != 3 && i != 6 && i != 7 && variable[i] > CutValue[i]) {passed[i] = 1;}
-	      if ((i == 3 || i == 6 || i == 7) && variable[i] < CutValue[i]) {passed[i] = 1;}
-	      if (i == 0 && abs(variable[i] - massZ0) < CutValue[i]) {passed[i] = 1;}
-	      success *= passed[i];
-	      if (passed[i] == 0.0) failed[type][i] += 2.0;
-	    }
-	  
-	    // count how many events pass all selections; count each event as 2 since only half the events are used
-	    if (success == 1) {
-	      Total[type] += 2.0*weight[type];
-	      selected[type] += 2.0;
-	      if (type == 0) NSignal += 2.0;
-	      if (type >  0) NBgnd += 2.0;
-	    }
-	  
-	    if (success == 0) {
-	      rejected[type] += 2.0;
-	    }
-	  
-	  } // end of if loop keeping only every other event; reject half the events used in the training
-	} // end of for loop over events   
-	
-	for (int type=1; type<ntype; type++) {
-	  TotalBgnd += Total[type];
-	  //	  cout << "Total[type]: " << Total[type] << endl;
-	}
-	
-	// get info on S/sqrt(B) and display it after doubling the numbers since only half of the events were used
-	// use reweighted number
-	
-	SoverB = 0.0;
-	xi2 = 0.0;
-       	if (TotalBgnd > 0.0) SoverB = Total[0]/sqrt(TotalBgnd);  //optimize S/sqrt(all backgrounds)
-	//       	if (Total[0] > 0.0) xi2 = 100.0*2.33*sqrt(0.072*TotalBgnd*0.072*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2
-       	if (Total[0] > 0.0) xi2 = 100.0*1.64*sqrt(0.072*TotalBgnd*0.072*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2
-        if (xi2 < bestxi2[t] && xi2 != 0.0) {
-	  bestxi2[t] = xi2;
-	  bestcut[t] = c;
-	}
-
-	if (SoverB > bestSoverB) {
-	  bestSoverB = SoverB;
-	}
-	
-	places = 2;
-	cout <<fixed;                 
-	cout.precision(places); 
-	outClientFile <<fixed;                 
-	outClientFile.precision(places);
-	
-	cout << "cut value " << cut << " SoverB: " << SoverB << " xi2: " << xi2 << endl;
-	cout << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-	cout << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-	     << Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-
-	outClientFile << "cut value " << cut << " SoverB: " << SoverB << " xi2: " << xi2 << endl;
-	outClientFile << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-	outClientFile << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-		      << Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-      } // end of for loop over cut value
-      
-      float bestcutvalue;
-      if (t>0 && t !=3 && t !=6)  bestcutvalue = minValue[t] + bestcut[t]*((maxValue[t]-minValue[t])/ncut);
-      if (t == 3 || t ==6)  bestcutvalue = maxValue[t] - bestcut[t]*((maxValue[t]-minValue[t])/ncut);
-      if (t==0) bestcutvalue = (bestcut[t]+1.0)*((maxValue[t]-massZ0)/ncut);
-
-      cout << "****************************************************************************" << endl;
-      cout << " variable " << varType[t] << " best xi = " << bestxi2[t] << " for a cut at " << bestcutvalue << " (c = " << bestcut[t] << ")"<< endl;
-      cout << "****************************************************************************" << endl;
-
-      outClientFile << "****************************************************************************" << endl;
-      outClientFile << " variable " << varType[t] << " best xi = " << bestxi2[t] << " for a cut at " << bestcutvalue << " (c = " << bestcut[t] << ")"<< endl;
-      outClientFile << "****************************************************************************" << endl;
-
-    } //end if on excluding variables that have already been fixed
-  } // end of for loop over all variables
-  
-  // done with statistics; display the histograms
-  
-  
-  cout << endl;
-  cout << "All done!" << endl;
-  
-  theApp.Run();                            // concluding ROOT requirements.
-  
-  return 0;
-} //  End of main(...)
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/optimisation.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/optimisation.C
deleted file mode 100644
index fd3ba11352b5..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/optimisation.C
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// program used to find the optimal cut position for each variable
-// 
-// *************    Written by Pauline Gagnon - 31 Jan 2008  *********************
-// based on selection.C
-// now only counting 1.0 for each event - May 28, 2008
-// 
-
-using namespace std;
-
-#define CHAIN
-
-#include <fstream>
-using std::ofstream;
-
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <string.h>
-#include <vector>
-#include <list>  
-#include <stdlib.h>
-// Regular include files to make ROOT work with our C++ program
-#include "TROOT.h"
-#include "TApplication.h"
-#include "TCanvas.h"
-#include "TPaveText.h"
-#include "TLine.h"
-#include "TPaveLabel.h"
-#include "TNtuple.h"
-#include "TH1.h"
-#include "THStack.h"
-#include "TPad.h"
-#include "TFile.h"
-#include "TLegend.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TGraph.h"
-#include "TFrame.h"
-
-// - - - Initiates the GUI interface of ROOT - - -
-using std::string;
-using std::setprecision;
-Int_t places = 2;
-extern void InitGui();
-
-//============================================================================
-
-int main(int argc, char **argv)
-{
-  // execute rootlogon.C to get ATLAS style setup.
-#include "rootlogon.C"
-  
-  // enter the number of different types of events and the # of background weight files used
-  Int_t const ntype = 8;
-  Int_t const nbgndw = 7;
-  
-  // open output file to save the cutflow results
-  ofstream outClientFile( "optimisation.dat", ios::out );
-  
-  // exit program if unable to open file
-  if ( !outClientFile ) {
-    cerr << "File could not be opened" << endl;
-    exit (1);
-  } // end if
-  
-  VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
-  TROOT root("","", initfuncs);
-  
-  TApplication theApp("App", &argc, argv);
-  gROOT->Reset();
-  gROOT->SetStyle("ATLAS");
-  gROOT->ForceStyle();
-  
-  
-  Float_t bdtZZ = 0.0;
-  Float_t bdttt = 0.0;
-  Float_t bdtWW = 0.0;
-  Float_t bdttn = 0.0;
-  Float_t bdtlt = 0.0;
-  Float_t bdtZW = 0.0;
-  Float_t bdtZi = 0.0;
-  Float_t w = 0.0;
-  
-  Int_t runnum;
-  Int_t evtnum, type;
-  
-  Int_t nb=0;
-  float portion;
-  bool last_rec=0;
-  
-  //              - - - Getting tree from the disk - - - 
-  
-  // We define the chain, which is basically a tree to add root files with the same tree name.
-  // If you have two or more files, just keep going as nfchain += chain->Add("filename.root")
-  
-#ifdef CHAIN
-  
-  TChain* chain = new TChain("finalTree");
-  Int_t nfchain=0;
-  
-  nfchain += chain->Add("/data/TMVA/final/final.root");
-  
-  
-  chain->SetBranchAddress("runnum", &runnum);
-  chain->SetBranchAddress("evtnum", &evtnum);
-  chain->SetBranchAddress("type",  &type);   
-  chain->SetBranchAddress("bdtZZ", &bdtZZ);
-  chain->SetBranchAddress("bdttt", &bdttt);
-  chain->SetBranchAddress("bdtWW", &bdtWW);
-  chain->SetBranchAddress("bdttn", &bdttn);
-  chain->SetBranchAddress("bdtlt", &bdtlt);
-  chain->SetBranchAddress("bdtZW", &bdtZW);
-  chain->SetBranchAddress("bdtZi", &bdtZi);
-  chain->SetBranchAddress("w", &w);
-  
-  Int_t nrec = static_cast<int>(0.5 + chain->GetEntries());
-  Int_t nticker= static_cast<int>(0.5 + nrec/20.0);
-  cout << nrec << " records found in the chain. "<< endl;
-  
-  // The above is to find the number of events or entries
-  
-#endif // CHAIN 
-  
-  // ============  Loop over each background type except ZZ->llnunu
-  for (int t=1; t<nbgndw; t++) {
-
-  // reject types already evaluated and type 0 (ZZ) and 3 (tautaununu)
-    if (t != 3 && t !=5 && t !=1 && t !=2) {   
-      // && t !=5 && t !=2 && t !=6 && t !=1
-      //      if (t != 3 && t !=5 && t !=4 && t !=2) {   
-      //      if (t !=3 && t !=2 && t !=4) {   
-      string eventType[8]  = {("HZ"), ("ZZ"), ("tt"), ("WW"), ("ZZtautaununu"),("ZZlltautau"),("ZW"),("Zincl")}; 
-      
-      cout << "*********************************************************************" << endl;
-      cout << " background type being scanned: " << eventType[t+1] << endl;
-      cout << "*********************************************************************" << endl;
-      
-      outClientFile << "*********************************************************************" << endl;
-      outClientFile << " background type being scanned: " << eventType[t+1] << endl;
-      outClientFile << "*********************************************************************" << endl;
-      
-      // ============  Loop over the cut values for the each background type
-      Float_t SoverB;
-      Float_t bestxi2[7] = {1000.,1000.,1000.,1000.,1000.,1000.,1000.};
-      Float_t bestcut[7] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-
-      Float_t xi2;
-      Double_t cut = -1.0;
-      Double_t ncut = 100.0;
-      for (double c=0.0; c<ncut; c++) {
-	
-	// initialization of all counters for statistics
-	//	         float minCutValue[7] = {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0};  // starting point
-	//	         float minCutValue[7] = {-1.0, 0.72, 0.58, -1.0, 0.74, 0.72, 0.68};  // HZ120 -eff - 0.496 - 10 juin 99% CL
-
-	//	         float minCutValue[7] = {-1.0, 0.66, 0.30, -1.0, 0.72, 0.24, 0.56};  // HZ110 - 10 June 95% CL
-	//	         float minCutValue[7] = {-1.0, 0.72, 0.58, -1.0, 0.74, 0.72, 0.68};  // HZ120 -eff - 0.496 - 10 juin 95% CL
-	//               float minCutValue[7] = {-1.0, -1.0, 0.64, -1.0, -1.0, 0.44, -1.0};  // HZ150 - 10 June 95% CL
-	//               float minCutValue[7] = {-1.0, 0.50, 0.44, -1.0, 0.64, 0.46, -1.0};  // 
-	         float minCutValue[7] = {-1.0, 0.72, 0.34, -1.0, -1.0, 0.62, -1.0};  // HZ250 - 10 June 95% CL
-
-	// float minCutValue[7] = {-1.0, 0.84, 0.74, -1.0, 0.68, 0.44, 0.62};  // HZ120 with half the event - 3 june
-        // float minCutValue[7] = {-1.0, 0.52, -0.08, -1.0, 0.42, 0.20, 0.62};  // HZ130 with half the event - 3 june
-	// float minCutValue[7] = {-1.0, 0.62, 0.38, -1.0, 0.66, 0.24, 0.58};  // HZ140 with half the event - 3 june
-
-//         float minCutValue[7] = {-1.0, 0.72, 0.58, -1.0, 0.74, 0.72, 0.68};  // HZ120 with half the event
-//	   float minCutValue[7] = {-1.0, 0.60, 0.38, -1.0, 0.66, 0.14, 0.62};  // HZ130 with half the event
-//         float minCutValue[7] = {-1.0, -1.0, -1.0, -1.0, 0.48, 0.32, 0.72};  // HZ140 with half the event
-
-	//	   float minCutValue[7] = {-1.0, 0.70, 0.68, -1.0, 0.78, 0.84, 0.66};  // HZ120 - xi2
-	//         float minCutValue[7] = {-1.0, -1.0, 0.70, -1.0, 0.66, 0.16, 0.60};  // HZ130 - xi2
-	//         float minCutValue[7] = {-1.0, 0.66, 0.12, -1.0, 0.62, 0.32, 0.56};  // HZ140 - xi2
-
-	Float_t weight[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	
-	Float_t mvaBdt[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t selected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t rejected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t Total[8]  =     {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-	Float_t TotalBgnd = 0.0;
-	
-	float NSignal = 0.0;
-	float NBgnd = 0.0;
-	
-	int passed[8] = {0,0,0,0,0,0,0,0};
-	float failed[8][7] = {
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-	  {0.0,0.0,0.0,0.0,0.0,0.0,0.0}
-	};
-	
-	if (ncut == 100.0) cut=-1.0+c*0.02;
-	if (ncut == 50.0)  cut=0.0+c*0.02;
-	minCutValue[t] = cut;
-	// ============  Starting the main loop over the events  ===============
-	
-	for (Int_t i=0; i<nrec; i++) {        
-	  
-	  last_rec=(i>=nrec-1); 
-	  
-	  if(!last_rec)
-	    {
-#ifdef CHAIN
-	      nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-	      nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-	    }
-	  // Reading the i-th (current) record:
-	  
-#ifdef CHAIN
-	  nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-	  nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-	  
-	  // only take every other event, rejecting the half of events used in training
-	  if ((i%2) != 0) {
-   
-	    // store the weight for each event type
-	    weight[type] = w;
-	  
-	  
-	    mvaBdt[0] = bdtZZ;
-	    mvaBdt[1] = bdttt;
-	    mvaBdt[2] = bdtWW;
-	    mvaBdt[3] = bdttn;
-	    mvaBdt[4] = bdtlt;
-	    mvaBdt[5] = bdtZW;
-	    mvaBdt[6] = bdtZi;
-	  
-	    int success = 1;
-	  
-	    for (int i = 0; i < nbgndw; i++) {
-	      passed[i] = 0;
-	    
-	      if (mvaBdt[i] > minCutValue[i]) {passed[i] = 1;}
-	      success *= passed[i];
-	      if (passed[i] == 0.0) failed[type][i] += 2.0;
-	    }
-	  
-	    // count how many events pass all selections; count each event as 2 since only half the events are used
-	    if (success == 1) {
-	      Total[type] += 2.0*weight[type];
-	      selected[type] += 2.0;
-	      if (type == 0) NSignal += 2.0;
-	      if (type >  0) NBgnd += 2.0;
-	    }
-	  
-	    if (success == 0) {
-	      rejected[type] += 2.0;
-	    }
-	  
-	  } // end of if loop keeping only every other event; reject half the events used in the training
-	} // end of for loop over events   
-	
-	for (int type=1; type<ntype; type++) {
-	  TotalBgnd += Total[type];
-	  //	  cout << "Total[type]: " << Total[type] << endl;
-	}
-	
-	// get info on S/sqrt(B) and display it after doubling the numbers since only half of the events were used
-	// use reweighted number
-	
-	SoverB = 0.0;
-	xi2 = 0.0;
-       	if (TotalBgnd > 0.0) SoverB = Total[0]/sqrt(TotalBgnd);  //optimize S/sqrt(all backgrounds)
-	//       	if (Total[0] > 0.0) xi2 = 100.0*2.33*sqrt(0.071*TotalBgnd*0.071*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2 @ 99% CL
-       	if (Total[0] > 0.0) xi2 = 100.0*1.64*sqrt(0.071*TotalBgnd*0.071*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2 @ 95% CL
-	//	if (Total[6] > 0.0) SoverB = Total[0]/sqrt(Total[6]);   //optimize S/sqrt(ZW background only)
-	//	if (Total[1] > 0.0) SoverB = Total[6]/Total[1];   //optimize error on ZZ:  ZW/ZZ 
-        if (xi2 < bestxi2[t] && xi2 != 0.0) {
-	  bestxi2[t] = xi2;
-	  bestcut[t] = c;
-	}
-	
-	places = 2;
-	cout <<fixed;                 
-	cout.precision(places); 
-	outClientFile <<fixed;                 
-	outClientFile.precision(places);
-	
-	cout << "cut value " << cut << " SoverB: " << SoverB << " xi2: " << xi2 << endl;
-	cout << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-	cout << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-	     << Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-
-	outClientFile << "cut value " << cut << " SoverB: " << SoverB << " xi2: " << xi2 << endl;
-	outClientFile << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-	outClientFile << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-		      << Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-      } // end of for loop over cut value
-      
-      float bestcutvalue;
-      bestcutvalue = -1.0 + bestcut[t]*(2.0/ncut);
-
-      cout << "****************************************************************************" << endl;
-      cout << " background type " << eventType[t+1] << " best xi = " << bestxi2[t] << " for a cut at " << bestcutvalue << endl;
-      cout << "****************************************************************************" << endl;
-
-      outClientFile << "****************************************************************************" << endl;
-      outClientFile << " background type " << eventType[t+1] << " best xi = " << bestxi2[t] << " for a cut at " << bestcutvalue << " (c = " << bestcut[t] << ")"<< endl;
-      outClientFile << "****************************************************************************" << endl;
-
-
-    } //end if on excluding ZZ->tautaununu
-  } // end of for loop over background types
-  
-  // done with statistics; display the histograms
-  
-  
-  cout << endl;
-  cout << "All done!" << endl;
-  
-  theApp.Run();                            // concluding ROOT requirements.
-  
-  return 0;
-} //  End of main(...)
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/selection.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/selection.C
deleted file mode 100644
index 95fab858da4b..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/selection.C
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// program used to apply the final selection based on the chosen TMVA output variable. (previously called stack.C)
-// 
-// *************    Written by Pauline Gagnon - 14 mars 2007  *********************
-// updated on nov 21 2007
-// 
-// first, one must run TMVAnalysis.C (root .L TMVAnalysis.C) to obtain the weights for a specific method
-// this will read the preselected events from preselection-6types.root tree
-// second, run TMVApplication.C (root .L TMVApplication.C) to read in the weights 
-// reads in the TMVA weights obtained for several backgrounds separately from final.root tree
-// display the distribution of the TMVA output variable to determine the best place to set the cuts.
-// 
-
-using namespace std;
-
-#define CHAIN
-
-#include <fstream>
-using std::ofstream;
-
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <string.h>
-#include <vector>
-#include <list>  
-#include <stdlib.h>
-// Regular include files to make ROOT work with our C++ program
-#include "TROOT.h"
-#include "TApplication.h"
-#include "TCanvas.h"
-#include "TPaveText.h"
-#include "TLine.h"
-#include "TPaveLabel.h"
-#include "TNtuple.h"
-#include "TH1.h"
-#include "THStack.h"
-#include "TPad.h"
-#include "TFile.h"
-#include "TLegend.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TGraph.h"
-#include "TFrame.h"
-
-// - - - Initiates the GUI interface of ROOT - - -
-using std::string;
-using std::setprecision;
-Int_t places = 2;
-extern void InitGui();
-
-//============================================================================
-
-int main(int argc, char **argv)
-{
-  // execute rootlogon.C to get ATLAS style setup.
-#include "rootlogon.C"
-
-
-   // initialization of all counters for statistics
-
-  // enter the number of different types of events and the # of background weight files used
-  Int_t const ntype = 8;
-  Int_t const nbgndw = 7;
-  Float_t mvaBdt[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-
-  // give the desired cut value
-  string suffix[8] = {("HZ-ZZ"), ("HZ-tt"), ("HZ-WW"), ("HZ-ZZtautaununu"), ("HZ-ZZlltautau"), ("HZ-ZW"), ("HZ-incl")}; 
-
-  //           float minCutValue[7] = {-1.0, 0.84, 0.74, -1.0, 0.68, 0.44, 0.62};  // HZ120 with half the event - 3 june
-
-  //  float minCutValue[7] = {-1.0, 0.66, 0.30, -1.0, 0.72, 0.24, 0.56};  // HZ110 - 10 June 95% CL
-  //  float minCutValue[7] = {-1.0, 0.72, 0.58, -1.0, 0.74, 0.72, 0.68};  // HZ120 -eff - 0.496 - 10 juin 95% CL
-  //  float minCutValue[7] = {-1.0, 0.52, -0.08, -1.0, 0.42, 0.20, 0.62}; // HZ130 with half the event - 3 june
-    float minCutValue[7] = {-1.0, 0.62, 0.38, -1.0, 0.66, 0.24, 0.58};  // HZ140 with half the event - 3 june
-  //  float minCutValue[7] = {-1.0, -1.0, 0.64, -1.0, -1.0, 0.44, -1.0};  // HZ150 - 10 June 95% CL
-  //  float minCutValue[7] = {-1.0, 0.50, 0.44, -1.0, 0.64, 0.46, -1.0};  // HZ200 - 10 June 95% CL
-  //  float minCutValue[7] = {-1.0, 0.72, 0.34, -1.0, -1.0, 0.62, -1.0};  // HZ250 - 10 June 95% CL
-
-	// float minCutValue[7] = {-1.0, 0.84, 0.74, -1.0, 0.68, 0.44, 0.62};  // HZ120 with half the event - 3 june
-
-  Float_t weight[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-
-  // Float_t preselected[8] = {3574., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 110 GeV
-  // Float_t preselected[8] = {18799., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 120 GeV
-  // Float_t preselected[8] = {2674., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 130 GeV
-   Float_t preselected[8] = {2972., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 140 GeV
-  // Float_t preselected[8] = {4333., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 150 GeV
-  // Float_t preselected[8] = {4957., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 200 GeV
-  // Float_t preselected[8] = {5415., 13427., 3955., 5555., 56., 636., 3832., 663.};  // standard preselection cuts mH = 250 GeV
-
-  Float_t selected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  Float_t rejected[8] =   {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  Float_t efficiency[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  Float_t rejection[8] =  {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  Float_t Total[8]  =     {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-  Float_t TotalBgnd = 0.0;
-
-  string eventType[8]  = {("HZ"), ("ZZ"), ("tt"), ("WW"), ("ZZtautaununu"),("ZZlltautau"),("ZW"),("Zincl")}; 
-
-  float NSignal = 0.0;
-  float NBgnd = 0.0;
-
-  int passed[7] = {0,0,0,0,0,0,0};
-  float failed[8][7] = {
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0},
-    {0.0,0.0,0.0,0.0,0.0,0.0,0.0}
-  };
-
-  // open output file to save the cutflow results
-  ofstream outClientFile( "stats.dat", ios::out );
-
-  // exit program if unable to open file
-  if ( !outClientFile ) {
-    cerr << "File could not be opened" << endl;
-    exit (1);
-  } // end if
-
-  VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
-  TROOT root("","", initfuncs);
-
-  TApplication theApp("App", &argc, argv);
-  gROOT->Reset();
-  gROOT->SetStyle("ATLAS");
-  gROOT->ForceStyle();
-
-  // initialisation: setup all the histograms, stacks, pads, canvases
-  //----------------------------------------------------------------
-  //     - - - Creating canvases with several pads - - -
-  //-------------------------------------------------------------
-
-  const unsigned int XC1=0, YC1=0, XC2=800, YC2=800;
-  const double G=0.004;
-  
-  TCanvas* c3 = new TCanvas("c3","variables set 3", XC1, YC1, XC2, YC2);
-  c3->cd();
-  c3->SetFillColor(10);
-  c3->GetFrame()->SetFillColor(10);
-  c3->GetFrame()->SetBorderSize(6);
-  c3->GetFrame()->SetBorderMode(-1);
-  TPad* pad31= new TPad("pad31", "Pad31",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad32= new TPad("pad32", "Pad32",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad33= new TPad("pad33", "Pad33",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad34= new TPad("pad34", "Pad34",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad31->SetFillColor(10); pad31->Draw();
-  pad32->SetFillColor(10); pad32->Draw();   
-  pad33->SetFillColor(10); pad33->Draw();
-  pad34->SetFillColor(10); pad34->Draw();
-
-  TCanvas* c4 = new TCanvas("c4","variables set 4", XC1, YC1, XC2, YC2);
-  c4->cd();
-  c4->SetFillColor(10);
-  c4->GetFrame()->SetFillColor(10);
-  c4->GetFrame()->SetBorderSize(6);
-  c4->GetFrame()->SetBorderMode(-1);
-  TPad* pad41= new TPad("pad41", "Pad41",       G,     G,       0.5-G,   0.5-G);
-  TPad* pad42= new TPad("pad42", "Pad42",   0.5+G,     G,       1.0-G,   0.5-G);
-  TPad* pad43= new TPad("pad43", "Pad43",       G, 0.5+G,       0.5-G,   1.0-G);
-  TPad* pad44= new TPad("pad44", "Pad44",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-  pad41->SetFillColor(10); pad41->Draw();
-  pad42->SetFillColor(10); pad42->Draw();   
-  pad43->SetFillColor(10); pad43->Draw();
-  pad44->SetFillColor(10); pad44->Draw();
-
-  string histName1 = ("ptlep1");
-  string histName2 = ("ptlep2");
-  string histName3 = ("cosll2D");
-  string histName4 = ("cosll3D");
-  string histName5 = ("MET");
-  string histName6 = ("mt");
-  string histName7 = ("cosMETPtlep");
-  string histName8 = ("mZll");
-  string histName9 = ("cosphi");
-  string histName10 = ("cosJetPtmiss");
-  string histName11 = ("cone1");
-  string histName12 = ("cone2");
-  string histName13 = ("ejet1");
-  string histName14 = ("ejet2");
-  string histName15 = ("ejet3");
-  string histName16 = ("njet");
-  string histName17 = ("nel");
-  string histName18 = ("nmu");
-  string histName19 = ("nlep");
-  string histName20 = ("lepid");
-
-  TH1F* hptlep1[ntype];
-  TH1F* hptlep2[ntype];
-  TH1F* hcosll2D[ntype];
-  TH1F* hcosll3D[ntype];
-  TH1F* hMET[ntype];
-  TH1F* hmt[ntype];
-  TH1F* hcosMETPtlep[ntype];
-  TH1F* hmZll[ntype];
-  TH1F* hcosphi[ntype];
-  TH1F* hcosJetMET[ntype];
-  TH1F* hcone1[ntype];
-  TH1F* hcone2[ntype];
-  TH1F* hejet1[ntype];
-  TH1F* hejet2[ntype];
-  TH1F* hejet3[ntype];
-  TH1F* hnjet[ntype];
-  TH1F* hnel[ntype];
-  TH1F* hnmu[ntype];
-  TH1F* hnlep[ntype];
-  TH1F* hlepid[ntype];
-
-  string ka[8] = {"0", "1", "2", "3", "4", "5", "6", "7"};
-  
-  for (int m=0; m<ntype; m++) {
-    histName1.insert(6,ka[m]);
-    histName2.insert(6,ka[m]);
-    histName3.insert(7,ka[m]);
-    histName4.insert(7,ka[m]);
-    histName5.insert(3,ka[m]);
-    histName6.insert(2,ka[m]);
-    histName7.insert(11,ka[m]);
-    histName8.insert(4,ka[m]);
-    histName9.insert(6,ka[m]);
-    histName10.insert(9,ka[m]);
-    histName11.insert(5,ka[m]);
-    histName12.insert(5,ka[m]);
-    histName13.insert(5,ka[m]);
-    histName14.insert(5,ka[m]);
-    histName15.insert(5,ka[m]);
-    histName16.insert(4,ka[m]);
-    histName17.insert(3,ka[m]);
-    histName18.insert(3,ka[m]);
-    histName19.insert(4,ka[m]);
-    histName20.insert(5,ka[m]);
-    
-    hptlep1[m] = new TH1F(histName1.c_str(), "; p_T^{lepton @#1} ;@# of entries", 50, 0, 300.0);
-    hptlep2[m] = new TH1F(histName2.c_str(), ";p_T^{lepton @#2} ;@# of entries", 50, 0, 100.0);
-    hcosll2D[m] = new TH1F(histName3.c_str(), ";#cos_{ll} (xy plane);@# of entries", 50, -1.1, 1.1);
-    hcosll3D[m] = new TH1F(histName4.c_str(), ";#cos_{ll};@# of entries", 50, -1.1, 1.1);
-    hMET[m] = new TH1F(histName5.c_str(), ";p_{T} missing per event;@# of entries", 50, 50, 500);
-    hmt[m] = new TH1F(histName6.c_str(), ";m_T;@# of entries", 50, 0, 700.0);
-    hcosMETPtlep[m] = new TH1F(histName7.c_str(), ";#cos MET-Ptlep;@# of entries", 50, -1.1, 1.1);
-    hmZll[m] = new TH1F(histName8.c_str(), ";M_{Z #rightarrow ll};@# of entries", 50, 71.19, 111.19);
-    hcosphi[m] = new TH1F(histName9.c_str(), ";#cos #phi;@# of entries", 50, -1.1, 1.1);
-    hcosJetMET[m] = new TH1F(histName16.c_str(), ";#cos #phi (between p_{T} miss and jet;@# of entries", 50, -1.0, 1.2);
-    hcone1[m] = new TH1F(histName11.c_str(), ";electron isolation cone 0.10 ;@# of entries", 50, 0.0, 50.0);
-    hcone2[m] = new TH1F(histName12.c_str(), ";muon isolation cone 0.10 ;@# of entries", 50, 0.0, 300.0);
-    hejet1[m] = new TH1F(histName13.c_str(), ";energy jet @#1 ;@# of entries", 50, 0, 300.0);
-    hejet2[m] = new TH1F(histName14.c_str(), ";energy jet @#2 ;@# of entries", 50, 0, 300.0);
-    hejet3[m] = new TH1F(histName15.c_str(), ";energy jet @#3 ;@# of entries", 50, 0, 300.0);
-    hnjet[m] = new TH1F(histName10.c_str(), ";@# jets ;@# of entries", 11, 0, 10);
-    hnel[m] = new TH1F(histName17.c_str(), ";@#electrons ;@# of entries", 6, 0, 5);
-    hnmu[m] = new TH1F(histName18.c_str(), ";@# muons ;@# of entries", 6, 0, 5);
-    hnlep[m] = new TH1F(histName19.c_str(), ";@# leptons ;@# of entries", 11, 0, 10);
-    hlepid[m] = new TH1F(histName20.c_str(), ";lepton ID ;@# of entries", 26, 0, 25);
-   
-    hptlep1[m]->SetTitle("p_{T} lepton @# 1");
-    hptlep2[m]->SetTitle("p_{T} lepton @# 1");
-    hcosll2D[m]->SetTitle("#cos l l in 2D");
-    hcosll3D[m]->SetTitle("#cos l l in 3D");
-    hMET[m]->SetTitle("Missing E_{T}");
-    hmt[m]->SetTitle("transverse mass");
-    hcosMETPtlep[m]->SetTitle("");
-    hmZll[m]->SetTitle("Z mass");
-    hcosphi[m]->SetTitle("#cos #phi");
-    hcosJetMET[m]->SetTitle("#cos jet-MET");
-    hcone1[m]->SetTitle("E cone lepton @# 1");
-    hcone2[m]->SetTitle("E cone lepton @# 2");
-    hejet1[m]->SetTitle("energy jet @#1");
-    hejet2[m]->SetTitle("energy jet @#2");
-    hejet3[m]->SetTitle("energy jet @#3");
-    hnjet[m]->SetTitle("@# jets");
-    hnel[m]->SetTitle("@# electrons");
-    hnmu[m]->SetTitle("@# muons");
-    hnlep[m]->SetTitle("@# leptons");
-    hlepid[m]->SetTitle("lepton ID");
-    
-    hptlep1[m]->SetTitle("@# of entries");
-    hptlep2[m]->SetTitle("@# of entries");
-    hcosll2D[m]->SetTitle("@# of entries");
-    hcosll3D[m]->SetTitle("@# of entries");
-    hMET[m]->SetTitle("@# of entries");
-    hmt[m]->SetTitle("@# of entries");
-    hcosMETPtlep[m]->SetTitle("@# of entries");
-    hmZll[m]->SetTitle("@# of entries");
-    hcosphi[m]->SetTitle("@# of entries");
-    hcosJetMET[m]->SetTitle("@# of entries");
-    hcone1[m]->SetTitle("@# of entries");
-    hcone2[m]->SetTitle("@# of entries");
-    hejet1[m]->SetTitle("@# of entries");
-    hejet2[m]->SetTitle("@# of entries");
-    hejet3[m]->SetTitle("@# of entries");
-    hnjet[m]->SetTitle("@# of entries");
-    hnel[m]->SetTitle("@# of entries");
-    hnmu[m]->SetTitle("@# of entries");
-    hnlep[m]->SetTitle("@# of entries");
-    hlepid[m]->SetTitle("@# of entries");
-
-    Color_t color = kWhite;
-    if (m==0) color = kRed;
-    if (m==1) color = kYellow;
-    if (m==2) color = kBlue;
-    if (m==3) color = kGreen;
-    if (m==4) color = kBlack;
-    if (m==5) color = kWhite;
-    if (m==6) color = kMagenta;
-    if (m==7) color = kBlack;
-
-    hptlep1[m]->SetFillColor(color);
-    hptlep2[m]->SetFillColor(color);
-    hcosll2D[m]->SetFillColor(color);
-    hcosll3D[m]->SetFillColor(color);
-    hMET[m]->SetFillColor(color);     
-    hmt[m]->SetFillColor(color);     
-    hcosMETPtlep[m]->SetFillColor(color);     
-    hmZll[m]->SetFillColor(color);    
-    hcosphi[m]->SetFillColor(color);     
-    hcosJetMET[m]->SetFillColor(color);     
-    hcone1[m]->SetFillColor(color);
-    hcone2[m]->SetFillColor(color);
-    hejet1[m]->SetFillColor(color);
-    hejet2[m]->SetFillColor(color);
-    hejet3[m]->SetFillColor(color);
-    hnjet[m]->SetFillColor(color);
-    hnel[m]->SetFillColor(color);
-    hnmu[m]->SetFillColor(color);
-    hnlep[m]->SetFillColor(color);
-    hlepid[m]->SetFillColor(color);
-  }
-
-  TCanvas* c1 = new TCanvas("c1","BDT output value before cuts", XC1, YC1, XC2, YC2);
-  c1->cd();
-  c1->SetFillColor(10);
-  c1->GetFrame()->SetFillColor(10);
-  c1->GetFrame()->SetBorderSize(6);
-  c1->GetFrame()->SetBorderMode(-1);
-  TPad* pad11= new TPad("pad11", "Pad11",  G,       G,       1.0-G,  0.17-G);
-  TPad* pad12= new TPad("pad12", "Pad12",  G,  0.17+G,       1.0-G,  0.33-G);
-  TPad* pad13= new TPad("pad13", "Pad13",  G,  0.33+G,       1.0-G,  0.50-G);
-  TPad* pad14= new TPad("pad14", "Pad14",  G,  0.50+G,       1.0-G,  0.67-G);
-  TPad* pad15= new TPad("pad15", "Pad15",  G,  0.67+G,       1.0-G,  0.83-G);
-  TPad* pad16= new TPad("pad16", "Pad16",  G,  0.83+G,       1.0-G,  1.0-G);
-  pad11->SetFillColor(10); pad11->Draw();
-  pad12->SetFillColor(10); pad12->Draw();   
-  pad13->SetFillColor(10); pad13->Draw();
-  pad14->SetFillColor(10); pad14->Draw();
-  pad15->SetFillColor(10); pad15->Draw();
-  pad16->SetFillColor(10); pad16->Draw();
-
-//   TCanvas* c2 = new TCanvas("c2","BDT output value after cuts", XC1, YC1, XC2, YC2);
-//   c2->cd();
-//   c2->SetFillColor(10);
-//   c2->GetFrame()->SetFillColor(10);
-//   c2->GetFrame()->SetBorderSize(6);
-//   c2->GetFrame()->SetBorderMode(-1);
-//   TPad* pad21= new TPad("pad21", "Pad21",  G,       G,       1.0-G,  0.17-G);
-//   TPad* pad22= new TPad("pad22", "Pad22",  G,  0.17+G,       1.0-G,  0.33-G);
-//   TPad* pad23= new TPad("pad23", "Pad23",  G,  0.33+G,       1.0-G,  0.50-G);
-//   TPad* pad24= new TPad("pad24", "Pad24",  G,  0.50+G,       1.0-G,  0.67-G);
-//   TPad* pad25= new TPad("pad25", "Pad25",  G,  0.67+G,       1.0-G,  0.83-G);
-//   TPad* pad26= new TPad("pad26", "Pad26",  G,  0.83+G,       1.0-G,  1.0-G);
-//   pad21->SetFillColor(10); pad21->Draw();
-//   pad22->SetFillColor(10); pad22->Draw();   
-//   pad23->SetFillColor(10); pad23->Draw();
-//   pad24->SetFillColor(10); pad24->Draw();
-//   pad25->SetFillColor(10); pad25->Draw();
-//   pad26->SetFillColor(10); pad26->Draw();
-
-  // -----------------------------------------------------------
-  //      - - -  Creating three stacks - - -  
-  // -----------------------------------------------------------
-  THStack hs1("hs1","ZZ BDT output"); 
-  THStack hs2("hs2","tt BDT output");
-  THStack hs3("hs3","WW BDT output");
-  THStack hs4("hs4","ZZ #rightarrow #tau #tau #nu #nu BDT output");
-  THStack hs5("hs5","ZZ #rightarrow l l #tau #tau BDT output");
-  THStack hs6("hs6","ZW BDT output");
-  THStack hs7("hs7","Zincl BDT output");
-
-  THStack hs11("hs11","ZZ BDT output");
-  THStack hs12("hs12","tt BDT output");
-  THStack hs13("hs13","WW BDT output");
-  // THStack hs14("hs14","tautaununu");
-  THStack hs15("hs15","lltautau BDT output");
-  THStack hs16("hs16","ZW BDT output");
-  THStack hs17("hs17","Zincl BDT output");
-
-  THStack hs21("hs21"," BDT input"); 
-  THStack hs22("hs22"," BDT input");
-  THStack hs23("hs23"," BDT input");
-  THStack hs24("hs24"," BDT input");
-  THStack hs25("hs25"," BDT input");
-  THStack hs26("hs26"," BDT input");
-  THStack hs27("hs27"," BDT input");
-  THStack hs28("hs28"," BDT input");
-
-
-  // -----------------------------------------------------------
-  //      - - -  Creating many histograms - - -  
-  // -----------------------------------------------------------
-  TLegend *leg11 = new TLegend(0.1, 0.3, 0.25, 1.0);
-  TLegend *leg1 = new TLegend(0.6, 0.6, 0.9, 0.95);
-  TLegend *leg3 = new TLegend(0.6, 0.6, 0.9, 0.95);
-  TLegend *leg4 = new TLegend(0.6, 0.6, 0.9, 0.95);
-
-  // //create some histograms
-  // TH1F* hbdtZZ0 = new TH1F("hbdtZZ0", "BDT ZZ for signal", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ1 = new TH1F("hbdtZZ1", "BDT ZZ for ZZ", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ2 = new TH1F("hbdtZZ2", "BDT ZZ for ttbar", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ3 = new TH1F("hbdtZZ3", "BDT ZZ for WW", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ4 = new TH1F("hbdtZZ4", "BDT ZZ for ZZtautaununu", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ5 = new TH1F("hbdtZZ5", "BDT ZZ for ZZlltautau", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ6 = new TH1F("hbdtZZ6", "BDT ZZ for ZW", 100, -2.0, 1.0);
-
-  TH1F* hbdtZZ0 = new TH1F("hbdtZZ0", ";BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ1 = new TH1F("hbdtZZ1", ";BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ2 = new TH1F("hbdtZZ2", ";BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ3 = new TH1F("hbdtZZ3", ";BDT ZZ", 100, -2.0, 1.0);
-  // TH1F* hbdtZZ4 = new TH1F("hbdtZZ4", ";BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ5 = new TH1F("hbdtZZ5", ";BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ6 = new TH1F("hbdtZZ6", ".BDT ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZZ7 = new TH1F("hbdtZZ7", ".BDT ZZ", 100, -2.0, 1.0);
-
-  TH1F* hbdttt0 = new TH1F("hbdttt0", "BDT tt for signal", 100, -2.0, 1.0);
-  TH1F* hbdttt1 = new TH1F("hbdttt1", "BDT tt for ZZ", 100, -2.0, 1.0);
-  TH1F* hbdttt2 = new TH1F("hbdttt2", "BDT tt for ttbar", 100, -2.0, 1.0);
-  TH1F* hbdttt3 = new TH1F("hbdttt3", "BDT tt for WW", 100, -2.0, 1.0);
-  // TH1F* hbdttt4 = new TH1F("hbdttt4", "BDT tt for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdttt5 = new TH1F("hbdttt5", "BDT tt for ZZlltautau", 100, -2.0, 1.0);
-  TH1F* hbdttt6 = new TH1F("hbdttt6", "BDT tt for ZW", 100, -2.0, 1.0);
-  TH1F* hbdttt7 = new TH1F("hbdttt7", "BDT tt for Zincl", 100, -2.0, 1.0);
-
-  TH1F* hbdtWW0 = new TH1F("hbdtWW0", "BDT WW for signal", 100, -2.0, 1.0);
-  TH1F* hbdtWW1 = new TH1F("hbdtWW1", "BDT WW for ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtWW2 = new TH1F("hbdtWW2", "BDT WW for ttbar", 100, -2.0, 1.0);
-  TH1F* hbdtWW3 = new TH1F("hbdtWW3", "BDT WW for WW", 100, -2.0, 1.0);
-  // TH1F* hbdtWW4 = new TH1F("hbdtWW4", "BDT WW for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtWW5 = new TH1F("hbdtWW5", "BDT WW for ZZlltautau", 100, -2.0, 1.0);
-  TH1F* hbdtWW6 = new TH1F("hbdtWW6", "BDT WW for ZW", 100, -2.0, 1.0);
-  TH1F* hbdtWW7 = new TH1F("hbdtWW7", "BDT WW for Zincl", 100, -2.0, 1.0);
-
-  // TH1F* hbdttn0 = new TH1F("hbdttn0", "BDT ZZtautaununu for signal", 100, -2.0, 1.0);
-  // TH1F* hbdttn1 = new TH1F("hbdttn1", "BDT ZZtautaununu for ZZ", 100, -2.0, 1.0);
-  // TH1F* hbdttn2 = new TH1F("hbdttn2", "BDT ZZtautaununu for ttbar", 100, -2.0, 1.0);
-  // TH1F* hbdttn3 = new TH1F("hbdttn3", "BDT ZZtautaununu for WW", 100, -2.0, 1.0);
-  // TH1F* hbdttn4 = new TH1F("hbdttn4", "BDT ZZtautaununu for ZZtautaununu", 100, -2.0, 1.0);
-  // TH1F* hbdttn5 = new TH1F("hbdttn5", "BDT ZZtautaununu for ZZlltautau", 100, -2.0, 1.0);
-  // TH1F* hbdttn6 = new TH1F("hbdttn6", "BDT ZZtautaununu for ZW", 100, -2.0, 1.0);
-  // TH1F* hbdttn7 = new TH1F("hbdttn7", "BDT ZZtautaununu for Zincl", 100, -2.0, 1.0);
-
-  TH1F* hbdtlt0 = new TH1F("hbdtlt0", "BDT ZZlltautau for signal", 100, -2.0, 1.0);
-  TH1F* hbdtlt1 = new TH1F("hbdtlt1", "BDT ZZlltautau for ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtlt2 = new TH1F("hbdtlt2", "BDT ZZlltautau for ttbar", 100, -2.0, 1.0);
-  TH1F* hbdtlt3 = new TH1F("hbdtlt3", "BDT ZZlltautau for WW", 100, -2.0, 1.0);
-  // TH1F* hbdtlt4 = new TH1F("hbdtlt4", "BDT ZZlltautau for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtlt5 = new TH1F("hbdtlt5", "BDT ZZlltautau for ZZlltautau", 100, -2.0, 1.0);
-  TH1F* hbdtlt6 = new TH1F("hbdtlt6", "BDT ZZlltautau for ZW", 100, -2.0, 1.0);
-  TH1F* hbdtlt7 = new TH1F("hbdtlt7", "BDT ZZlltautau for Zincl", 100, -2.0, 1.0);
-
-  TH1F* hbdtZW0 = new TH1F("hbdtZW0", "BDT ZW for signal", 100, -2.0, 1.0);
-  TH1F* hbdtZW1 = new TH1F("hbdtZW1", "BDT ZW for ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZW2 = new TH1F("hbdtZW2", "BDT ZW for ttbar", 100, -2.0, 1.0);
-  TH1F* hbdtZW3 = new TH1F("hbdtZW3", "BDT ZW for WW", 100, -2.0, 1.0);
-  // TH1F* hbdtZW4 = new TH1F("hbdtZW4", "BDT ZW for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtZW5 = new TH1F("hbdtZW5", "BDT ZW for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtZW6 = new TH1F("hbdtZW6", "BDT ZW for ZW", 100, -2.0, 1.0);
-  TH1F* hbdtZW7 = new TH1F("hbdtZW7", "BDT ZW for Zincl", 100, -2.0, 1.0);
-
-  TH1F* hbdtZi0 = new TH1F("hbdtZi0", "BDT Zi for signal", 100, -2.0, 1.0);
-  TH1F* hbdtZi1 = new TH1F("hbdtZi1", "BDT Zi for ZZ", 100, -2.0, 1.0);
-  TH1F* hbdtZi2 = new TH1F("hbdtZi2", "BDT Zi for ttbar", 100, -2.0, 1.0);
-  TH1F* hbdtZi3 = new TH1F("hbdtZi3", "BDT Zi for WW", 100, -2.0, 1.0);
-  // TH1F* hbdtZi4 = new TH1F("hbdtZi4", "BDT Zi for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtZi5 = new TH1F("hbdtZi5", "BDT Zi for ZZtautaununu", 100, -2.0, 1.0);
-  TH1F* hbdtZi6 = new TH1F("hbdtZi6", "BDT Zi for ZW", 100, -2.0, 1.0);
-  TH1F* hbdtZi7 = new TH1F("hbdtZi7", "BDT Zi for Zincl", 100, -2.0, 1.0);
-
-
-  TH1F* h2bdtZZ0 = new TH1F("h2bdtZZ0", "BDT ZZ for signal", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ1 = new TH1F("h2bdtZZ1", "BDT ZZ for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ2 = new TH1F("h2bdtZZ2", "BDT ZZ for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ3 = new TH1F("h2bdtZZ3", "BDT ZZ for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdtZZ4 = new TH1F("h2bdtZZ4", "BDT ZZ for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ5 = new TH1F("h2bdtZZ5", "BDT ZZ for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ6 = new TH1F("h2bdtZZ6", "BDT ZZ for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdtZZ7 = new TH1F("h2bdtZZ7", "BDT ZZ for Zincl", 100, -1.0, 1.0);
-
-  TH1F* h2bdttt0 = new TH1F("h2bdttt0", "BDT tt for signal", 100, -1.0, 1.0);
-  TH1F* h2bdttt1 = new TH1F("h2bdttt1", "BDT tt for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdttt2 = new TH1F("h2bdttt2", "BDT tt for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdttt3 = new TH1F("h2bdttt3", "BDT tt for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdttt4 = new TH1F("h2bdttt4", "BDT tt for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdttt5 = new TH1F("h2bdttt5", "BDT tt for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdttt6 = new TH1F("h2bdttt6", "BDT tt for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdttt7 = new TH1F("h2bdttt7", "BDT tt for Zincl", 100, -1.0, 1.0);
-
-  TH1F* h2bdtWW0 = new TH1F("h2bdtWW0", "BDT WW for signal", 100, -1.0, 1.0);
-  TH1F* h2bdtWW1 = new TH1F("h2bdtWW1", "BDT WW for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdtWW2 = new TH1F("h2bdtWW2", "BDT WW for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdtWW3 = new TH1F("h2bdtWW3", "BDT WW for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdtWW4 = new TH1F("h2bdtWW4", "BDT WW for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdtWW5 = new TH1F("h2bdtWW5", "BDT WW for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdtWW6 = new TH1F("h2bdtWW6", "BDT WW for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdtWW7 = new TH1F("h2bdtWW7", "BDT WW for Zincl", 100, -1.0, 1.0);
-
-  // TH1F* h2bdttn0 = new TH1F("h2bdttn0", "BDT tn for signal", 100, -1.0, 1.0);
-  // TH1F* h2bdttn1 = new TH1F("h2bdttn1", "BDT tn for ZZ", 100, -1.0, 1.0);
-  // TH1F* h2bdttn2 = new TH1F("h2bdttn2", "BDT tn for ttbar", 100, -1.0, 1.0);
-  // TH1F* h2bdttn3 = new TH1F("h2bdttn3", "BDT tn for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdttn4 = new TH1F("h2bdttn4", "BDT tn for ZZtautaununu", 100, -1.0, 1.0);
-  // TH1F* h2bdttn5 = new TH1F("h2bdttn5", "BDT tn for ZZlltautau", 100, -1.0, 1.0);
-  // TH1F* h2bdttn6 = new TH1F("h2bdttn6", "BDT tn for ZW", 100, -1.0, 1.0);
-  // TH1F* h2bdttn7 = new TH1F("h2bdttn7", "BDT tn for Zincl", 100, -1.0, 1.0);
-
-  TH1F* h2bdtlt0 = new TH1F("h2bdtlt0", "BDT lt for signal", 100, -1.0, 1.0);
-  TH1F* h2bdtlt1 = new TH1F("h2bdtlt1", "BDT lt for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdtlt2 = new TH1F("h2bdtlt2", "BDT lt for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdtlt3 = new TH1F("h2bdtlt3", "BDT lt for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdtlt4 = new TH1F("h2bdtlt4", "BDT lt for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdtlt5 = new TH1F("h2bdtlt5", "BDT lt for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdtlt6 = new TH1F("h2bdtlt6", "BDT lt for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdtlt7 = new TH1F("h2bdtlt7", "BDT lt for Zincl", 100, -1.0, 1.0);
-
-  TH1F* h2bdtZW0 = new TH1F("h2bdtZW0", "BDT ZW for signal", 100, -1.0, 1.0);
-  TH1F* h2bdtZW1 = new TH1F("h2bdtZW1", "BDT ZW for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdtZW2 = new TH1F("h2bdtZW2", "BDT ZW for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdtZW3 = new TH1F("h2bdtZW3", "BDT ZW for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdtZW4 = new TH1F("h2bdtZW4", "BDT ZW for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdtZW5 = new TH1F("h2bdtZW5", "BDT ZW for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdtZW6 = new TH1F("h2bdtZW6", "BDT ZW for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdtZW7 = new TH1F("h2bdtZW7", "BDT ZW for Zincl", 100, -1.0, 1.0);
-
-  TH1F* h2bdtZi0 = new TH1F("h2bdtZi0", "BDT Zi for signal", 100, -1.0, 1.0);
-  TH1F* h2bdtZi1 = new TH1F("h2bdtZi1", "BDT Zi for ZZ", 100, -1.0, 1.0);
-  TH1F* h2bdtZi2 = new TH1F("h2bdtZi2", "BDT Zi for ttbar", 100, -1.0, 1.0);
-  TH1F* h2bdtZi3 = new TH1F("h2bdtZi3", "BDT Zi for WW", 100, -1.0, 1.0);
-  // TH1F* h2bdtZi4 = new TH1F("h2bdtZi4", "BDT Zi for ZZtautaununu", 100, -1.0, 1.0);
-  TH1F* h2bdtZi5 = new TH1F("h2bdtZi5", "BDT Zi for ZZlltautau", 100, -1.0, 1.0);
-  TH1F* h2bdtZi6 = new TH1F("h2bdtZi6", "BDT Zi for ZW", 100, -1.0, 1.0);
-  TH1F* h2bdtZi7 = new TH1F("h2bdtZi7", "BDT Zi for Zincl", 100, -1.0, 1.0);
-
-  hbdtZZ0->SetFillColor(kRed);
-  hbdttt0->SetFillColor(kRed);
-  hbdtWW0->SetFillColor(kRed);
-  //  hbdttn0->SetFillColor(kRed);
-  hbdtlt0->SetFillColor(kRed);
-  hbdtZW0->SetFillColor(kRed);
-  hbdtZi0->SetFillColor(kRed);
-
-  hbdtZZ1->SetFillColor(kYellow);
-  hbdttt1->SetFillColor(kYellow);
-  hbdtWW1->SetFillColor(kYellow);
-  //  hbdttn1->SetFillColor(kYellow);
-  hbdtlt1->SetFillColor(kYellow);
-  hbdtZW1->SetFillColor(kYellow);
-  hbdtZi1->SetFillColor(kYellow);
-
-  hbdtZZ2->SetFillColor(kBlue);
-  hbdttt2->SetFillColor(kBlue);
-  hbdtWW2->SetFillColor(kBlue);
-  //  hbdttn2->SetFillColor(kBlue);
-  hbdtlt2->SetFillColor(kBlue);
-  hbdtZW2->SetFillColor(kBlue);
-  hbdtZi2->SetFillColor(kBlue);
-
-  hbdtZZ3->SetFillColor(kGreen);
-  hbdttt3->SetFillColor(kGreen);
-  hbdtWW3->SetFillColor(kGreen);
-  //  hbdttn3->SetFillColor(kGreen);
-  hbdtlt3->SetFillColor(kGreen);
-  hbdtZW3->SetFillColor(kGreen);
-  hbdtZi3->SetFillColor(kGreen);
-
-  // hbdtZZ4->SetFillColor(kBlack);
-  // hbdttt4->SetFillColor(kBlack);
-  // hbdtWW4->SetFillColor(kBlack);
-  // hbdttn4->SetFillColor(kBlack);
-  // hbdtlt4->SetFillColor(kBlack);
-  // hbdtZW4->SetFillColor(kBlack);
-  // hbdtZi4->SetFillColor(kBlack);
-
-  hbdtZZ5->SetFillColor(kWhite);
-  hbdttt5->SetFillColor(kWhite);
-  hbdtWW5->SetFillColor(kWhite);
-  hbdtZW5->SetFillColor(kWhite);
-  hbdtZi5->SetFillColor(kWhite);
-  //  hbdttn5->SetFillColor(kWhite);
-  hbdtlt5->SetFillColor(kWhite);
-
-  hbdtZZ6->SetFillColor(kMagenta);
-  hbdttt6->SetFillColor(kMagenta);
-  hbdtWW6->SetFillColor(kMagenta);
-  hbdtZW6->SetFillColor(kMagenta);
-  hbdtZi6->SetFillColor(kMagenta);
-  //  hbdttn6->SetFillColor(kMagenta);
-  hbdtlt6->SetFillColor(kMagenta);
-
-  hbdtZZ7->SetFillColor(kBlack);
-  hbdttt7->SetFillColor(kBlack);
-  hbdtWW7->SetFillColor(kBlack);
-  hbdtZW7->SetFillColor(kBlack);
-  hbdtZi7->SetFillColor(kBlack);
-  //  hbdttn7->SetFillColor(kBlack);
-  hbdtlt7->SetFillColor(kBlack);
- 
-  h2bdtZZ0->SetFillColor(kRed);
-  h2bdttt0->SetFillColor(kRed);
-  h2bdtWW0->SetFillColor(kRed);
-  //  h2bdttn0->SetFillColor(kRed);
-  h2bdtlt0->SetFillColor(kRed);
-  h2bdtZW0->SetFillColor(kRed);
-  h2bdtZi0->SetFillColor(kRed);
- 
-  h2bdtZZ1->SetFillColor(kYellow);
-  h2bdttt1->SetFillColor(kYellow);
-  h2bdtWW1->SetFillColor(kYellow);
-  //  h2bdttn1->SetFillColor(kYellow);
-  h2bdtlt1->SetFillColor(kYellow);
-  h2bdtZW1->SetFillColor(kYellow);
-  h2bdtZi1->SetFillColor(kYellow);
-
-  h2bdtZZ2->SetFillColor(kBlue);
-  h2bdttt2->SetFillColor(kBlue);
-  h2bdtWW2->SetFillColor(kBlue);
-  //  h2bdttn2->SetFillColor(kBlue);
-  h2bdtlt2->SetFillColor(kBlue);
-  h2bdtZW2->SetFillColor(kBlue);
-  h2bdtZi2->SetFillColor(kBlue);
-
-  h2bdtZZ3->SetFillColor(kGreen);
-  h2bdttt3->SetFillColor(kGreen);
-  h2bdtWW3->SetFillColor(kGreen);
-  //  h2bdttn3->SetFillColor(kGreen);
-  h2bdtlt3->SetFillColor(kGreen);
-  h2bdtZW3->SetFillColor(kGreen);
-  h2bdtZi3->SetFillColor(kGreen);
-
-  // h2bdtZZ4->SetFillColor(kBlack);
-  // h2bdttt4->SetFillColor(kBlack);
-  // h2bdtWW4->SetFillColor(kBlack);
-  // h2bdttn4->SetFillColor(kBlack);
-  // h2bdtlt4->SetFillColor(kBlack);
-  // h2bdtZW4->SetFillColor(kBlack);
-  // h2bdtZi4->SetFillColor(kBlack);
-
-  h2bdtZZ5->SetFillColor(kWhite);
-  h2bdttt5->SetFillColor(kWhite);
-  h2bdtWW5->SetFillColor(kWhite);
-  //  h2bdttn5->SetFillColor(kWhite);
-  h2bdtlt5->SetFillColor(kWhite);
-  h2bdtZW5->SetFillColor(kWhite);
-  h2bdtZi5->SetFillColor(kWhite);
-
-  h2bdtZZ6->SetFillColor(kMagenta);
-  h2bdttt6->SetFillColor(kMagenta);
-  h2bdtWW6->SetFillColor(kMagenta);
-  //  h2bdttn6->SetFillColor(kMagenta);
-  h2bdtlt6->SetFillColor(kMagenta);
-  h2bdtZW6->SetFillColor(kMagenta);
-  h2bdtZi6->SetFillColor(kMagenta);
-
-  h2bdtZZ7->SetFillColor(kBlack);
-  h2bdttt7->SetFillColor(kBlack);
-  h2bdtWW7->SetFillColor(kBlack);
-  //  h2bdttn7->SetFillColor(kBlack);
-  h2bdtlt7->SetFillColor(kBlack);
-  h2bdtZW7->SetFillColor(kBlack);
-  h2bdtZi7->SetFillColor(kBlack);
-
-  Float_t bdtZZ = 0.0;
-  Float_t bdttt = 0.0;
-  Float_t bdtWW = 0.0;
-  Float_t bdttn = 0.0;
-  Float_t bdtlt = 0.0;
-  Float_t bdtZW = 0.0;
-  Float_t bdtZi = 0.0;
-  Float_t w = 0.0;
-
-  Int_t runnum;
-  Int_t evtnum, type;
-
-  //  int lepID, nel, nmu, nlep;
-  //  float ejet1, ejet2, ejet3, ptlep1, ptlep2, cone1, cone2;
-
-  float massZ;
-  float cosJetMET;
-  float cosll2d;
-  float cosll3d;
-  float mT;
-  float MET;
-  float cosMETptlep;
-  float cosphi;
-
-  Int_t nb=0;
-  float portion;
-  bool last_rec=0;
-
-  //              - - - Getting tree from the disk - - - 
-
-  // We define the chain, which is basically a tree to add root files with the same tree name.
-  // If you have two or more files, just keep going as nfchain += chain->Add("filename.root")
-
-#ifdef CHAIN
-
-  TChain* chain = new TChain("finalTree");
-  Int_t nfchain=0;
-
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ110.root");
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ120.root");
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ130-3jun.root");
-    nfchain += chain->Add("/data/TMVA/final/final-HZ140-3jun.root");
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ150.root");
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ200.root");
-  //  nfchain += chain->Add("/data/TMVA/final/final-HZ250.root");
-
-  chain->SetBranchAddress("runnum", &runnum);
-  chain->SetBranchAddress("evtnum", &evtnum);
-  chain->SetBranchAddress("type",  &type);   
-  chain->SetBranchAddress("bdtZZ", &bdtZZ);
-  chain->SetBranchAddress("bdttt", &bdttt);
-  chain->SetBranchAddress("bdtWW", &bdtWW);
-  chain->SetBranchAddress("bdttn", &bdttn);
-  chain->SetBranchAddress("bdtlt", &bdtlt);
-  chain->SetBranchAddress("bdtZW", &bdtZW);
-  chain->SetBranchAddress("bdtZi", &bdtZi);
-  chain->SetBranchAddress("massZ",&massZ);	         
-  chain->SetBranchAddress("cosll2d",&cosll2d);	         
-  chain->SetBranchAddress("cosll3d",&cosll3d);	         
-  chain->SetBranchAddress("cosphi",&cosphi);	         
-  chain->SetBranchAddress("mT",&mT);	         
-  chain->SetBranchAddress("MET",&MET);	         
-  chain->SetBranchAddress("cosMETptlep",&cosMETptlep);	         
-  chain->SetBranchAddress("cosJetMET",&cosJetMET);	         
-  chain->SetBranchAddress("w", &w);
-
-//     chain->SetBranchAddress( "njet", &njet );
-//     chain->SetBranchAddress( "ejet1", &ejet1 );
-//     chain->SetBranchAddress( "ejet2", &ejet2 );
-//     chain->SetBranchAddress( "ejet3", &ejet3 );
-//     chain->SetBranchAddress( "ptlep1", &ptlep1 );
-//     chain->SetBranchAddress( "ptlep2", &ptlep2 );
-//     chain->SetBranchAddress( "cone1", &cone1 );
-//     chain->SetBranchAddress( "cone2", &cone2 );
-//     chain->SetBranchAddress( "nel", &nel );
-//     chain->SetBranchAddress( "nmu", &nmu );
-//     chain->SetBranchAddress( "nlep", &nlep );
-//     chain->SetBranchAddress( "lepID", &lepID );
-//     chain->SetBranchAddress( "massZ", &massZ );
-//     chain->SetBranchAddress( "cosll2d", &cosll2d );
-//     chain->SetBranchAddress( "cosll3d", &cosll3d );
-//     chain->SetBranchAddress( "mT", &mT );
-//     chain->SetBranchAddress( "MET", &MET );
-//     chain->SetBranchAddress( "cosMETptlep", &cosMETptlep);
-//     chain->SetBranchAddress( "cosJetMET", &cosJetMET);
-//     chain->SetBranchAddress( "cosphi", &cosphi );
-//     chain->SetBranchAddress( "runnum", &runnum );
-//     chain->SetBranchAddress( "evtnum", &evtnum );
-//     chain->SetBranchAddress( "type", &type );
-//     chain->SetBranchAddress( "w", &w );
-
-  // Arrays in general have their address at the beginning, so no need for "&"
-
-  Int_t nrec = static_cast<int>(0.5 + chain->GetEntries());
-  Int_t nticker= static_cast<int>(0.5 + nrec/20.0);
-  cout << nrec << " records found in the chain. "<< endl;
-
-  // The above is to find the number of events or entries
-
-#endif // CHAIN 
-
-  // ============  Starting the main loop over the events  ===============
-
-  for (Int_t i=0; i<nrec; i++) {        
-    if(div(i, nticker).rem == 0 || i >= nrec-1) // this section is just for fun
-      { 
-	portion=static_cast<float>(i) / static_cast<float>(nrec-1);
-	printf("Done %4.1f percent of reading the NTuple  ", portion*100.0);
-	cout.flush();   cout << char(13);  
-      }
-
-    last_rec=(i>=nrec-1); 
-
-    if(!last_rec)
-      {
-#ifdef CHAIN
-	nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-	nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-      }
-    // Reading the i-th (current) record:
-
-#ifdef CHAIN
-    nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-    nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-
-    // only take every other event, rejecting the half of events used in training
-    if ((i%2) != 0) {
-
-      // store the weight for each event type
-      weight[type] = w;
-
-      if (type == 0) {
-	hbdtZZ0->Fill(bdtZZ,weight[type]);  
-	hbdttt0->Fill(bdttt,weight[type]);  
-	hbdtWW0->Fill(bdtWW,weight[type]);  
-	//  hbdttn0->Fill(bdttn,weight[type]);  
-	hbdtlt0->Fill(bdtlt,weight[type]);  
-	hbdtZW0->Fill(bdtZW,weight[type]);  
-	hbdtZi0->Fill(bdtZi,weight[type]);  
-      }
-
-      if (type ==  1) {
-	hbdtZZ1->Fill(bdtZZ,weight[type]);  
-	hbdttt1->Fill(bdttt,weight[type]);  
-	hbdtWW1->Fill(bdtWW,weight[type]);  
-	//  hbdttn1->Fill(bdttn,weight[type]);  
-	hbdtlt1->Fill(bdtlt,weight[type]);  
-	hbdtZW1->Fill(bdtZW,weight[type]);  
-	hbdtZi1->Fill(bdtZi,weight[type]);  
-      }
-
-      if (type ==  2) {
-	hbdtZZ2->Fill(bdtZZ,weight[type]);  
-	hbdttt2->Fill(bdttt,weight[type]);  
-	hbdtWW2->Fill(bdtWW,weight[type]);  
-	//  hbdttn2->Fill(bdttn,weight[type]);  
-	hbdtlt2->Fill(bdtlt,weight[type]);  
-	hbdtZW2->Fill(bdtZW,weight[type]);  
-	hbdtZi2->Fill(bdtZi,weight[type]);  
-      }
-
-      if (type ==  3) {
-	hbdtZZ3->Fill(bdtZZ,weight[type]);  
-	hbdttt3->Fill(bdttt,weight[type]);  
-	hbdtWW3->Fill(bdtWW,weight[type]);  
-	//  hbdttn3->Fill(bdttn,weight[type]);  
-	hbdtlt3->Fill(bdtlt,weight[type]);  
-	hbdtZW3->Fill(bdtZW,weight[type]);  
-	hbdtZi3->Fill(bdtZi,weight[type]);  
-      }
-
-      //  if (type ==  4) {
-      //    hbdtZZ4->Fill(bdtZZ,weight[type]);  
-      //    hbdttt4->Fill(bdttt,weight[type]);  
-      //    hbdtWW4->Fill(bdtWW,weight[type]);  
-      //    hbdttn4->Fill(bdttn,weight[type]);  
-      //    hbdtlt4->Fill(bdtlt,weight[type]);  
-      //    hbdtZW4->Fill(bdtZW,weight[type]);  
-      //    hbdtZi4->Fill(bdtZi,weight[type]);  
-      //  }
-
-      if (type == 5) {
-	hbdtZZ5->Fill(bdtZZ,weight[type]);  
-	hbdttt5->Fill(bdttt,weight[type]);  
-	hbdtWW5->Fill(bdtWW,weight[type]);  
-	//  hbdttn5->Fill(bdttn,weight[type]);  
-	hbdtlt5->Fill(bdtlt,weight[type]);  
-	hbdtZW5->Fill(bdtZW,weight[type]);  
-	hbdtZi5->Fill(bdtZi,weight[type]);  
-      }
-
-      if (type == 6) {
-	hbdtZZ6->Fill(bdtZZ,weight[type]);  
-	hbdttt6->Fill(bdttt,weight[type]);  
-	hbdtWW6->Fill(bdtWW,weight[type]);  
-	//  hbdttn6->Fill(bdttn,weight[type]);  
-	hbdtlt6->Fill(bdtlt,weight[type]);  
-	hbdtZW6->Fill(bdtZW,weight[type]);  
-	hbdtZi6->Fill(bdtZi,weight[type]);  
-      }
-
-      if (type == 7) {
-	hbdtZZ7->Fill(bdtZZ,weight[type]);  
-	hbdttt7->Fill(bdttt,weight[type]);  
-	hbdtWW7->Fill(bdtWW,weight[type]);  
-	//  hbdttn7->Fill(bdttn,weight[type]);  
-	hbdtlt7->Fill(bdtlt,weight[type]);  
-	hbdtZW7->Fill(bdtZW,weight[type]);  
-	hbdtZi7->Fill(bdtZi,weight[type]);  
-      }
-
-      if (bdtZZ > minCutValue[0] && bdttt > minCutValue[1] && bdtWW > minCutValue[2] && bdttn > minCutValue[3] && bdtlt > minCutValue[4] 
-	  && bdtZW > minCutValue[5] && bdtZi > minCutValue[6]){
-
-	if (type == 0) {
-	  h2bdtZZ0->Fill(bdtZZ,weight[type]);  
-	  h2bdttt0->Fill(bdttt,weight[type]);  
-	  h2bdtWW0->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn0->Fill(bdttn,weight[type]);  
-	  h2bdtlt0->Fill(bdtlt,weight[type]);  
-	  h2bdtZW0->Fill(bdtZW,weight[type]);  
-	  h2bdtZi0->Fill(bdtZi,weight[type]);  
-	}
-
-	if (type == 1) {
-	  h2bdtZZ1->Fill(bdtZZ,weight[type]);  
-	  h2bdttt1->Fill(bdttt,weight[type]);  
-	  h2bdtWW1->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn1->Fill(bdttn,weight[type]);  
-	  h2bdtlt1->Fill(bdtlt,weight[type]);  
-	  h2bdtZW1->Fill(bdtZW,weight[type]);  
-	  h2bdtZi1->Fill(bdtZi,weight[type]);  
-	}
-
-	if (type == 2) {
-	  h2bdtZZ2->Fill(bdtZZ,weight[type]);  
-	  h2bdttt2->Fill(bdttt,weight[type]);  
-	  h2bdtWW2->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn2->Fill(bdttn,weight[type]);  
-	  h2bdtlt2->Fill(bdtlt,weight[type]);  
-	  h2bdtZW2->Fill(bdtZW,weight[type]);  
-	  h2bdtZi2->Fill(bdtZi,weight[type]);  
-	}
-
-	if (type == 3) {
-	  h2bdtZZ3->Fill(bdtZZ,weight[type]);  
-	  h2bdttt3->Fill(bdttt,weight[type]);  
-	  h2bdtWW3->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn3->Fill(bdttn,weight[type]);  
-	  h2bdtlt3->Fill(bdtlt,weight[type]);  
-	  h2bdtZW3->Fill(bdtZW,weight[type]);  
-	  h2bdtZi3->Fill(bdtZi,weight[type]);  
-	}
-
-	//    if (type == 4) {
-	//      h2bdtZZ4->Fill(bdtZZ,weight[type]);  
-	//      h2bdttt4->Fill(bdttt,weight[type]);  
-	//      h2bdtWW4->Fill(bdtWW,weight[type]);  
-	//      h2bdttn4->Fill(bdttn,weight[type]);  
-	//      h2bdtlt4->Fill(bdtlt,weight[type]);  
-	//      h2bdtZW4->Fill(bdtZW,weight[type]);  
-	//      h2bdtZi4->Fill(bdtZi,weight[type]);  
-	//    }
-	if (type == 5) {
-	  h2bdtZZ5->Fill(bdtZZ,weight[type]);  
-	  h2bdttt5->Fill(bdttt,weight[type]);  
-	  h2bdtWW5->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn5->Fill(bdttn,weight[type]);  
-	  h2bdtlt5->Fill(bdtlt,weight[type]);  
-	  h2bdtZW5->Fill(bdtZW,weight[type]);  
-	  h2bdtZi5->Fill(bdtZi,weight[type]);  
-	}
-	if (type == 6) {
-	  h2bdtZZ6->Fill(bdtZZ,weight[type]);  
-	  h2bdttt6->Fill(bdttt,weight[type]);  
-	  h2bdtWW6->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn6->Fill(bdttn,weight[type]);  
-	  h2bdtlt6->Fill(bdtlt,weight[type]);  
-	  h2bdtZW6->Fill(bdtZW,weight[type]);  
-	  h2bdtZi6->Fill(bdtZi,weight[type]);  
-	}
-	if (type == 7) {
-	  h2bdtZZ7->Fill(bdtZZ,weight[type]);  
-	  h2bdttt7->Fill(bdttt,weight[type]);  
-	  h2bdtWW7->Fill(bdtWW,weight[type]);  
-	  //  h2bdttn7->Fill(bdttn,weight[type]);  
-	  h2bdtlt7->Fill(bdtlt,weight[type]);  
-	  h2bdtZW7->Fill(bdtZW,weight[type]);  
-	  h2bdtZi7->Fill(bdtZi,weight[type]);  
-	}
-
-	// fill in the input variables after cuts
-	hcosll2D[type]->Fill(cosll2d,weight[type]);
-	hmt[type]->Fill(mT,weight[type]);
-	hmZll[type]->Fill(massZ,weight[type]);
-	hcosphi[type]->Fill(cosphi,weight[type]);
-
-	hcosll3D[type]->Fill(cosll3d,weight[type]);
-	hMET[type]->Fill(MET,weight[type]);
-	hcosMETPtlep[type]->Fill(cosMETptlep,weight[type]);
-	hcosJetMET[type]->Fill(cosJetMET,weight[type]);
-      } // end if on cut values for each set of weights
-
-      mvaBdt[0] = bdtZZ;
-      mvaBdt[1] = bdttt;
-      mvaBdt[2] = bdtWW;
-      mvaBdt[3] = bdttn;
-      mvaBdt[4] = bdtlt;
-      mvaBdt[5] = bdtZW;
-      mvaBdt[6] = bdtZi;
-
-      int success = 1;
-     
-      for (int i = 0; i < nbgndw; i++) {
-	passed[i] = 0;
-	//   if (mvaBdt[i] > minCutValue[i]  && mvaBdt[i] < maxCutValue[i]) {passed[i] = 1;}
-	if (mvaBdt[i] > minCutValue[i]) {passed[i] = 1;}
-	success *= passed[i];
-	if (passed[i] == 0.0) failed[type][i] += 2.0;
-      }
-  
-      // count how many events pass all selections; count each event as 2 since only half the events are used
-      if (success == 1) {
-	Total[type] += 2.0*weight[type];
-	selected[type] += 2.0;
-	if (type == 0) NSignal += 2.0;
-	if (type >  0) NBgnd += 2.0;
-      }
- 
-      if (success == 0) {
-	rejected[type] += 2.0;
-      }
- 
-    } // end of if loop keeping only every other event; reject half the events used in the training
-  } // end of for loop over events   
-
-  places = 1;
-  cout <<fixed;                 
-  cout.precision(places);
-   
-  // print out the cut values used for each background
-  cout << " " << endl;	  
-  outClientFile << " " << endl;	  
-
-  places = 2;
-  cout <<fixed;                 
-  cout.precision(places);
-
-  // loop over all types of events to get the efficiencies; 
-
-  for (int type=1; type<ntype; type++) {
-    TotalBgnd += Total[type];
-    //    PTotalBgnd += PTotal[type];
-    //    STotalBgnd += STotal[type];
-  }
-
-  for (int type=0; type<ntype; type++) {
-
-    if (preselected[type]>0) {
-      efficiency[type] =  selected[type]/preselected[type];
-    }
-
-    else {cout << "preselected = 0 for type " << type << endl;}
-
-    //   cout << efficiency[type] << "\t" <<selected[type] << "\t" << preselected[type] << endl;
-    rejection[type] = 1.0 - efficiency[type];
-
-    places = 1;
-    cout <<fixed;                 
-    cout.precision(places); 
-    outClientFile <<fixed;                 
-    outClientFile.precision(places);
-
-    cout << "Type of event: " << eventType[type] << endl;	  
-    cout << "# events preselected: " << preselected[type] << ", # selected: " << selected[type] 
-	 << " with efficiency in % " << 100.0*efficiency[type] << endl;
-    cout << "# events selected after reweighting: " << Total[type] << endl;	  
-    cout << "   " << endl;	  
-  }
-
-  // get info on S/sqrt(B) and display it after doubling the numbers since only half of the events were used
-  // use reweighted number
- 
-  float TotalBgnd0 = 0.0;
-  for (int j=1; j<ntype; j++) {TotalBgnd0 += weight[j]*preselected[j];}
-
-  Float_t xi2;
-  //  if (Total[0] > 0.0) xi2 = 100.0*2.33*sqrt(0.071*TotalBgnd*0.071*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2 - 99% CL
-  if (Total[0] > 0.0) xi2 = 100.0*1.64*sqrt(0.071*TotalBgnd*0.071*TotalBgnd+TotalBgnd)/Total[0];  //optimize xi2 - 95% CL
-  Float_t sigmaB = sqrt(0.071*TotalBgnd*0.071*TotalBgnd+TotalBgnd);
-  Float_t SoverB = Total[0]/sqrt(TotalBgnd);
-  //  Float_t SoverB0 = weight[0]*preselected[0]/sqrt(TotalBgnd0);
-  Float_t SoverSB = Total[0]/sqrt(TotalBgnd+Total[0]);
-  //  Float_t SoverSB0 = weight[0]*preselected[0]/sqrt(TotalBgnd0+weight[0]*preselected[0]);
-  cout << " " << endl;
-
-  cout << "Number of files used         = " << ntype  << endl;
-  for(int type=0; type<ntype; type++) { cout << "\t" << eventType[type] << endl;}
-
-  places = 2;
-  cout <<fixed;                 
-  cout.precision(places); 
-  outClientFile <<fixed;                 
-  outClientFile.precision(places);
-
-  for (int j=0; j<nbgndw; j++) {
-    cout << "set min cut value against " << suffix[j] << " background: " << minCutValue[j] << endl;
-    //   cout << "set max cut value against " << suffix[j] << " background: " << maxCutValue[j] << endl;
-    outClientFile << "set min cut value against " << suffix[j] << " background: " << minCutValue[j] << endl;
-    //   outClientFile << "set max cut value against " << suffix[j] << " background: " << maxCutValue[j] << endl;
-  }
-
-  places = 2;
-  cout <<fixed;                 
-  cout.precision(places); 
-  outClientFile <<fixed;                 
-  outClientFile.precision(places);
-  //  float null = 0.0;
-
-  cout << "*************************************************************************** " << endl;
-  cout << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-  cout << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-       << Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-  cout << "*    Total raw samples               = " << selected[0] << "\t" << selected[1] << "\t" 
-       << selected[2] << "\t" << selected[3] << "\t" << selected[4] << "\t" << selected[5] << "\t" << selected[6] << "\t" << selected[7] << endl;
-  cout << "*    xi2:                                  = " << xi2 << endl;
-  cout << "*    sigmaB                                = " << sigmaB << endl;
-  cout << "*    Signal over sqrt(B) @ 30fb-1          = " << SoverB << endl;
-  cout << "*    Signal over sqrt(S+B) @ 30fb-1        = " << SoverSB << endl;
-  cout << "* " << endl;
-  cout << "*    Total preselected signal @ 30fb-1     = " << weight[0]*preselected[0]  << endl;
-  cout << "*    Total preselected background @ 30fb-1 = " << TotalBgnd0 << "\t" << weight[1]*preselected[1] << "\t" 
-       << weight[2]*preselected[2] << "\t" <<weight[3]*preselected[3] << "\t" << weight[4]*preselected[4] << "\t" << weight[5]*preselected[5] 
-       << "\t" << weight[6]*preselected[6] << "\t" << weight[7]*preselected[7] << endl;
-  cout << "*    Total raw preselected samples         = " << preselected[0] << "\t" << preselected[1] << "\t" << preselected[2] << "\t" 
-       <<preselected[3] << "\t" << preselected[4] << "\t" << preselected[5] << "\t" << preselected[7] << "\t" << preselected[7] << endl;
-  cout << "*************************************************************************** " << endl;
-
-  cout << "*************************************************************************** " << endl;
-  cout << "*    Total x-section in fb-1 with cuts = " << Total[0]/30.  << endl;
-  cout << "*    Total background @ x-section in fb-1       = " << TotalBgnd/30. << "\t" << Total[1]/30. << "\t" 
-       << Total[2]/30. << "\t" << Total[3]/30. << "\t" << Total[4]/30. << "\t" << Total[5]/30. << "\t" << Total[6]/30. << "\t" << Total[7]/30. << endl;
-  cout << "*************************************************************************** " << endl;
-
-  outClientFile << "*************************************************************************** " << endl;
-  outClientFile << "*    Total signal @ 30fb-1 with cuts = " << Total[0]  << endl;
-  outClientFile << "*    Total background @ 30fb-1       = " << TotalBgnd << "\t" << Total[1] << "\t" 
-		<< Total[2] << "\t" << Total[3] << "\t" << Total[4] << "\t" << Total[5] << "\t" << Total[6] << "\t" << Total[7] << endl;
-  outClientFile << "*    Total raw samples               = " << selected[0] << "\t" << selected[1] << "\t" 
-		<< selected[2] << "\t" << selected[3] << "\t" << selected[4] << "\t" << selected[5] << "\t" << selected[6] << "\t" << selected[7] << endl;
-  outClientFile << "*    xi2:                            = " << xi2 << endl;
-  outClientFile << "*    sigmaB                          = " << sigmaB << endl;
-  outClientFile << "*    Signal over sqrt(B) @ 30fb-1    = " << SoverB << endl;
-  outClientFile << "*    Signal over sqrt(S+B) @ 30fb-1  = " << SoverSB << endl;
-  outClientFile << "* " << endl;
-  outClientFile << "*    Total preselected signal @ 30fb-1     = " << weight[0]*preselected[0]  << endl;
-  outClientFile << "*    Total preselected background @ 30fb-1 = " << TotalBgnd0 << "\t" << weight[1]*preselected[1] << "\t" 
-		<< weight[2]*preselected[2] << "\t" <<weight[3]*preselected[3] << "\t" << weight[4]*preselected[4] << "\t" << weight[5]*preselected[5] 
-		<< "\t" << weight[6]*preselected[6] << "\t" << weight[7]*preselected[7] << endl;
-  outClientFile << "*    Total raw preselected samples         = " << preselected[0] << "\t" << preselected[1] << "\t" 
-		<< preselected[2] << "\t" <<preselected[3] << "\t" << preselected[4] << "\t" << preselected[5] << "\t" << preselected[6] << "\t" << preselected[7] << endl;
-  outClientFile << "*************************************************************************** " << endl;
-
-  outClientFile << "*************************************************************************** " << endl;
-  outClientFile << "*    Total x-section in fb-1 with cuts = " << Total[0]/30.  << endl;
-  outClientFile << "*    Total background @ x-section in fb-1       = " << TotalBgnd/30. << "\t" << Total[1]/30. << "\t" 
-		<< Total[2]/30. << "\t" << Total[3]/30. << "\t" << Total[4]/30. << "\t" << Total[5]/30. << "\t" << Total[6]/30. << "\t" << Total[7]/30. << endl;
-  outClientFile << "*************************************************************************** " << endl;
- 
-  outClientFile << endl;
-
-  // done with statistics; display the histograms
-
-  hs1.SetMinimum(0.01); 
-  hs2.SetMinimum(0.01); 
-  hs3.SetMinimum(0.01); 
-  hs4.SetMinimum(0.01); 
-
-  hs5.SetMinimum(0.01); 
-  hs6.SetMinimum(0.01); 
-  hs7.SetMinimum(0.01); 
-
-  hs21.SetMinimum(0.01); 
-  hs22.SetMinimum(0.01); 
-  hs23.SetMinimum(0.01); 
-  hs24.SetMinimum(0.01); 
-
-  hs25.SetMinimum(0.01); 
-  hs26.SetMinimum(0.01); 
-  hs27.SetMinimum(0.01); 
-  hs28.SetMinimum(0.01); 
-
-  hs11.SetMinimum(0.01); 
-  hs12.SetMinimum(0.01); 
-  hs13.SetMinimum(0.01); 
-  hs15.SetMinimum(0.01); 
-  hs16.SetMinimum(0.01); 
-  hs17.SetMinimum(0.01); 
-
-
-  c1->cd();
-  hs11.Add(hbdtZZ0);
-  pad16->cd();
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ0, "HZ", "f"); 
-  hs11.Add(hbdtZZ1);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ1, "ZZ #rightarrow l l #nu #nu", "f"); 
-  hs11.Add(hbdtZZ2);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ2,  "t#bar t", "f"); 
-  hs11.Add(hbdtZZ3);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ3,"WW", "f");
-  leg11->Draw();
-  //    hs11.Add(hbdtZZ4);
-  //    hs11.Draw();
-  //    leg11->AddEntry(hbdtZZ4,"ZZ #rightarrow #tau #tau #nu #nu", "f");
-  //    leg11->Draw();
-  hs11.Add(hbdtZZ5);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ5,"ZZ #rightarrow l l #tau #tau", "f");
-  leg11->Draw();
-  hs11.Add(hbdtZZ6);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ6,"ZW", "f");
-  leg11->Draw();
-  hs11.Add(hbdtZZ7);
-  hs11.Draw();
-  leg11->AddEntry(hbdtZZ7,"Z+jets", "f");
-  leg11->Draw();
-
-  hs12.Add(hbdttt0);
-  pad15->cd();
-  hs12.Draw();
-  hs12.Add(hbdttt1);
-  hs12.Draw();
-  hs12.Add(hbdttt2);
-  hs12.Draw();
-  hs12.Add(hbdttt3);
-  hs12.Draw();
-  //    hs12.Add(hbdttt4);
-  //    hs12.Draw();
-  hs12.Add(hbdttt5);
-  hs12.Draw();
-  hs12.Add(hbdttt6);
-  hs12.Draw();
-  hs12.Add(hbdttt7);
-  hs12.Draw();
-
-  TLine* line1 = new TLine(minCutValue[1],0.0,minCutValue[1],34.0);
-  line1->SetLineColor(1);
-  line1->SetLineWidth(2);
-  line1->SetLineStyle(2);
-  line1->Draw();
-
-  hs13.Add(hbdtWW0);
-  pad14->cd();
-  hs13.Draw();
-  hs13.Add(hbdtWW1);
-  hs13.Draw();
-  hs13.Add(hbdtWW2);
-  hs13.Draw();
-  hs13.Add(hbdtWW3);
-  hs13.Draw();
-  //    hs13.Add(hbdtWW4);
-  //    hs13.Draw();
-  hs13.Add(hbdtWW5);
-  hs13.Draw();
-  hs13.Add(hbdtWW6);
-  hs13.Draw();
-  hs13.Add(hbdtWW7);
-  hs13.Draw();
-
-  TLine* line2 = new TLine(minCutValue[2],0.0,minCutValue[2],34.0);
-  line2->SetLineColor(1);
-  line2->SetLineWidth(2);
-  line2->SetLineStyle(2);
-  line2->Draw();
-
-  hs15.Add(hbdtlt0);
-  pad13->cd();
-  hs15.Draw();
-  hs15.Add(hbdtlt1);
-  hs15.Draw();
-  hs15.Add(hbdtlt2);
-  hs15.Draw();
-  hs15.Add(hbdtlt3);
-  hs15.Draw();
-  //    hs15.Add(hbdtlt4);
-  //    hs15.Draw();
-  hs15.Add(hbdtlt5);
-  hs15.Draw();
-  hs15.Add(hbdtlt6);
-  hs15.Draw();
-  hs15.Add(hbdtlt7);
-  hs15.Draw();
-
-  TLine* line4 = new TLine(minCutValue[4],0.0,minCutValue[4],42.0);
-  line4->SetLineColor(1);
-  line4->SetLineWidth(2);
-  line4->SetLineStyle(2);
-  line4->Draw();
-
-  hs16.Add(hbdtZW0);
-  pad12->cd();
-  hs16.Draw();
-  hs16.Add(hbdtZW1);
-  hs16.Draw();
-  hs16.Add(hbdtZW2);
-  hs16.Draw();
-  hs16.Add(hbdtZW3);
-  hs16.Draw();
-  //    hs16.Add(hbdtZW4);
-  //    hs16.Draw();
-  hs16.Add(hbdtZW5);
-  hs16.Draw();
-  hs16.Add(hbdtZW6);
-  hs16.Draw();
-  hs16.Add(hbdtZW7);
-  hs16.Draw();
-
-  TLine* line5 = new TLine(minCutValue[5],0.0,minCutValue[5],32.0);
-  line5->SetLineColor(1);
-  line5->SetLineWidth(2);
-  line5->SetLineStyle(2);
-  line5->Draw();
-
-  hs17.Add(hbdtZi0);
-  pad11->cd();
-  hs17.Draw();
-  hs17.Add(hbdtZi1);
-  hs17.Draw();
-  hs17.Add(hbdtZi2);
-  hs17.Draw();
-  hs17.Add(hbdtZi3);
-  hs17.Draw();
-  //    hs17.Add(hbdtZi4);
-  //    hs17.Draw();
-  hs17.Add(hbdtZi5);
-  hs17.Draw();
-  hs17.Add(hbdtZi6);
-  hs17.Draw();
-  hs17.Add(hbdtZi7);
-  hs17.Draw();
-
-  TLine* line6 = new TLine(minCutValue[6],0.0,minCutValue[6],52.0);
-  line6->SetLineColor(1);
-  line6->SetLineWidth(2);
-  line6->SetLineStyle(2);
-  line6->Draw();
-
-  //==========================================
-
-
-  for (int m=0; m<ntype; m++) {
-    c3->cd();
-    hs21.Add(hmt[m]);
-    pad33->cd(); 
-    hs21.Draw("");
-    hs21.Draw("");
-    if (m==0) {leg3->AddEntry(hmt[m], "  HZ", "f"); }
-    if (m==1) {leg3->AddEntry(hmt[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg3->AddEntry(hmt[m], "  t#bar t", "f");} 
-    if (m==3) {leg3->AddEntry(hmt[m], "  WW", "f"); }
-    if (m==5) {leg3->AddEntry(hmt[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg3->AddEntry(hmt[m], "  ZW", "f"); }
-    if (m==7) {leg3->AddEntry(hmt[m], "  Z + jets", "f");} 
-    leg3->Draw();
-    
-    hs22.Add(hmZll[m]);
-    pad34->cd(); 
-    hs22.Draw("");
-    hs22.Draw("");
-    
-    hs23.Add(hcosll2D[m]);
-    pad31->cd(); 
-    //    pad31->SetLogy(1);
-    hs23.Draw("");
-    hs23.Draw("");
-    
-    hs24.Add(hcosphi[m]);
-    pad32->cd(); 
-    pad32->SetLogy(1);
-    hs24.Draw("");
-    hs24.Draw("");
-
-    c4->cd();
-    hs25.Add(hMET[m]);
-    pad43->cd(); 
-    hs25.Draw("");
-    hs25.Draw("");
-    if (m==0) {leg4->AddEntry(hMET[m], "  HZ", "f"); }
-    if (m==1) {leg4->AddEntry(hMET[m], "  ZZ #rightarrow l l #nu #nu", "f"); }
-    if (m==2) {leg4->AddEntry(hMET[m], "  t#bar t", "f");} 
-    if (m==3) {leg4->AddEntry(hMET[m], "  WW", "f"); }
-    if (m==5) {leg4->AddEntry(hMET[m], "  ZZ #rightarrow l l #tau #tau", "f"); }
-    if (m==6) {leg4->AddEntry(hMET[m], "  ZW", "f"); }
-    if (m==7) {leg4->AddEntry(hMET[m], "  Z + jets", "f");} 
-    leg4->Draw();
-    
-    hs26.Add(hcosll3D[m]);
-    pad44->cd(); 
-    hs26.Draw("");
-    hs26.Draw("");
-    
-//     hs27.Add(hcosJetMET[m]);
-//     pad41->cd(); 
-//     pad41->SetLogy(1);
-//     hs27.Draw("");
-//     hs27.Draw("");
-    
-    hs28.Add(hcosMETPtlep[m]);
-    pad42->cd(); 
-    pad42->SetLogy(1);
-    hs28.Draw("");
-    hs28.Draw("");
-
-//      c2->cd();
-//      hs1.Add(h2bdtZZ0);
-//      pad26->cd();
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ0, "HZ", "f"); 
-//      hs1.Add(h2bdtZZ1);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ1, "ZZ #rightarrow l l #nu #nu", "f"); 
-//      hs1.Add(h2bdtZZ2);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ2,  "t#bar t", "f"); 
-//      hs1.Add(h2bdtZZ3);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ3,"WW", "f");
-//      leg1->Draw();
-//    //   hs1.Add(h2bdtZZ4);
-//   //    hs1.Draw();
-//   //    leg1->AddEntry(h2bdtZZ4,"ZZ #rightarrow #tau #tau #nu #nu", "f");
-//      leg1->Draw();
-//      hs1.Add(h2bdtZZ5);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ5,"ZZ #rightarrow l l #tau #tau", "f");
-//      leg1->Draw();
-//      hs1.Add(h2bdtZZ6);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ6,"ZW", "f");
-//      leg1->Draw();
-//      hs1.Add(h2bdtZZ7);
-//      hs1.Draw();
-//      leg1->AddEntry(h2bdtZZ7,"Zincl", "f");
-//      leg1->Draw();
-
-//      hs2.Add(h2bdttt0);
-//      pad25->cd();
-//      hs2.Draw();
-//      hs2.Add(h2bdttt1);
-//      hs2.Draw();
-//      hs2.Add(h2bdttt2);
-//      hs2.Draw();
-//      hs2.Add(h2bdttt3);
-//      hs2.Draw();
-//   //    hs2.Add(h2bdttt4);
-//   //    hs2.Draw();
-//      hs2.Add(h2bdttt5);
-//      hs2.Draw();
-//      hs2.Add(h2bdttt6);
-//      hs2.Draw();
-//      hs2.Add(h2bdttt7);
-//      hs2.Draw();
-
-//      hs3.Add(h2bdtWW0);
-//      pad24->cd();
-//      hs3.Draw();
-//      hs3.Add(h2bdtWW1);
-//      hs3.Draw();
-//      hs3.Add(h2bdtWW2);
-//      hs3.Draw();
-//      hs3.Add(h2bdtWW3);
-//      hs3.Draw();
-//   //    hs3.Add(h2bdtWW4);
-//   //    hs3.Draw();
-//      hs3.Add(h2bdtWW5);
-//      hs3.Draw();
-//      hs3.Add(h2bdtWW6);
-//      hs3.Draw();
-//      hs3.Add(h2bdtWW7);
-//      hs3.Draw();
-
-//      hs5.Add(h2bdtlt0);
-//      pad23->cd();
-//      hs5.Draw();
-//      hs5.Add(h2bdtlt1);
-//      hs5.Draw();
-//      hs5.Add(h2bdtlt2);
-//      hs5.Draw();
-//      hs5.Add(h2bdtlt3);
-//      hs5.Draw();
-//   //    hs5.Add(h2bdtlt4);
-//   //    hs5.Draw();
-//      hs5.Add(h2bdtlt5);
-//      hs5.Draw();
-//      hs5.Add(h2bdtlt6);
-//      hs5.Draw();
-//      hs5.Add(h2bdtlt7);
-//      hs5.Draw();
-
-//      hs6.Add(h2bdtZW0);
-//      pad22->cd();
-//      hs6.Draw();
-//      hs6.Add(h2bdtZW1);
-//      hs6.Draw();
-//      hs6.Add(h2bdtZW2);
-//      hs6.Draw();
-//      hs6.Add(h2bdtZW3);
-//      hs6.Draw();
-//   //    hs6.Add(h2bdtZW4);
-//   //    hs6.Draw();
-//      hs6.Add(h2bdtZW5);
-//      hs6.Draw();
-//      hs6.Add(h2bdtZW6);
-//      hs6.Draw();
-//      hs6.Add(h2bdtZW7);
-//      hs6.Draw();
-
-//      hs7.Add(h2bdtZi0);
-//      pad21->cd();
-//      hs7.Draw();
-//      hs7.Add(h2bdtZi1);
-//      hs7.Draw();
-//      hs7.Add(h2bdtZi2);
-//      hs7.Draw();
-//      hs7.Add(h2bdtZi3);
-//      hs7.Draw();
-//   //    hs7.Add(h2bdtZi4);
-//   //    hs7.Draw();
-//      hs7.Add(h2bdtZi5);
-//      hs7.Draw();
-//      hs7.Add(h2bdtZi6);
-//      hs7.Draw();
-//      hs7.Add(h2bdtZi7);
-//      hs7.Draw();
-
-  //==========================================
-
-
-  }
-    
-  cout << endl;
-  cout << "All done!" << endl;
-
-  theApp.Run();                            // concluding ROOT requirements.
-
-  return 0;
-} //  End of main(...)
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/setupNewRoot.sh b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/setupNewRoot.sh
deleted file mode 100755
index 9324e7155b5a..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/TMVA/setupNewRoot.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Set ROOTSYS to the newer ROOT directory
-# For example (at CERN): /afs/cern.ch/sw/lcg/external/root/5.15.02/slc3_gcc323/root/ 
-export ROOTSYS=/afs/cern.ch/sw/lcg/external/root/5.17.02/slc4_amd64_gcc34/root
-export PATH=$ROOTSYS/bin/:$PATH
-export LD_LIBRARY_PATH=${ROOTSYS}/lib:$LD_LIBRARY_PATH
-export PYTHONPATH=${ROOTSYS}/lib:$PYTHONPATH
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/normalisation.C b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/normalisation.C
deleted file mode 100644
index 18cad2fbf86b..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/run/normalisation.C
+++ /dev/null
@@ -1,2227 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// program adapted from EVmva.C to select the variables needed for the Boosted Tree analysis for the normalisation
-// - reads in the events after using EV as a ntuple dumper
-// - applies all preselection cuts to select events with 4 leptons from two Z 
-// - turns two leptons into invisible neutrinos
-// - recalculates the missing energy adding the 2 missing electrons
-// - apply the missing energy cut
-// - apply the anti b-tag rejection cut
-
-using namespace std;
-
-#define CHAIN
-
-#include <fstream>
-using std::ofstream;
-
-/******************* Include files for C++ **************************/
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <string.h>
-#include <vector>
-#include <list>  
-#include <stdlib.h>
-#include <time.h>
-
-/******************* Include files for ROOT *************************/
-#include "TROOT.h"
-#include "TApplication.h"
-#include "TCanvas.h"
-#include "TPaveText.h"
-#include "TLine.h"
-#include "TPaveLabel.h"
-#include "TNtuple.h"
-#include "TH1.h"
-#include "THStack.h"
-#include "TPad.h"
-#include "TFile.h"
-#include "TLegend.h"
-#include "TChain.h"
-#include "TStyle.h"
-#include "TGraph.h"
-#include "TFrame.h"
-#include "TAttFill.h"
-#include "Random.h"
-#include "TRandom3.h"
-
-// - - - Initiates the GUI interface of ROOT - - -
-using std::string;
-using std::setprecision;
-extern void InitGui();
-
-//============================================================================
-
-int main(int argc, char **argv)
- {
-
-VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
-TROOT root("","", initfuncs);
-
-TApplication theApp("App", &argc, argv);
-gROOT->Reset();
-
-   // bool EF_passed = true;
-
-   double generated = 0.0;
-
-   string eventType = ("ZZllll"); 
-   double sigmaBR = 0.1509; 
-   double filterEff = 0.219;
-
-   int found =0;
-   double Total = 0.0;
-   double weight = 0.0; 
-   double totalRejected = 0.0;
-   int nrec = 0;
-   double passed = 0.0;
-
-   double reject_MET  = 0.0;
-   double reject_nlep  = 0.0;
-   double reject_trigger  = 0.0;
-   double reject_AODtrigger  = 0.0;
-   double reject_masse  = 0.0;
-   double reject_massm  = 0.0;
-   double reject_2Z  = 0.0;
-   double reject_leppid  = 0.0;
-   double reject_btag  = 0.0;
-   float epair = 0.0; 
-   float mpair = 0.0; 
-   int seed = 77;
-   //   srand ( time(0) ); // for a random seed
-   srand(seed);  // for a fixed start
-
- string histName1 = ("ptlep1");
- string histName2 = ("ptlep2");
- string histName3 = ("cosll2D");
- string histName4 = ("cosll3D");
-  
- string histName5 = ("MET");
- string histName6 = ("mt");
- string histName7 = ("cosMETPtlep");
-
- string histName8 = ("mZ");
- string histName9 = ("cosphi");
- string histName10 = ("cosJetPtmiss");
- string histName11 = ("cone1");
- string histName12 = ("cone2");
- string histName13 = ("ejet1");
- string histName14 = ("ejet2");
- string histName15 = ("ejet3");
- string histName16 = ("njet");
-
- string histName17 = ("nel");
- string histName18 = ("nmu");
- string histName19 = ("nlep");
- string histName20 = ("lepid");
-
- double lumi = 30000.0;
-
-// open output file to save the cutflow results
-ofstream outClientFile( "normalisation.dat", ios::out );
-
-// exit program if unable to open file
- if ( !outClientFile ) {
-   cerr << "File could not be opened" << endl;
-   exit (1);
- } // end if
-
-const unsigned int XC1=0, YC1=0, XC2=800, YC2=800;
-const double G=0.004;
-
-TCanvas* c1 = new TCanvas("c1","pvariables set 1", XC1, YC1, XC2, YC2);
-c1->cd();
-c1->SetFillColor(30);
-c1->GetFrame()->SetFillColor(10);
-c1->GetFrame()->SetBorderSize(6);
-c1->GetFrame()->SetBorderMode(-1);
-TPad* pad11= new TPad("pad11", "Pad11",       G,     G,       0.5-G,   0.5-G);
-TPad* pad12= new TPad("pad12", "Pad12",   0.5+G,     G,       1.0-G,   0.5-G);
-TPad* pad13= new TPad("pad13", "Pad13",       G, 0.5+G,       0.5-G,   1.0-G);
-TPad* pad14= new TPad("pad14", "Pad14",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-pad11->SetFillColor(10); pad11->SetGrid(); pad11->Draw();
-pad12->SetFillColor(10); pad12->SetGrid(); pad12->Draw();   
-pad13->SetFillColor(10); pad13->SetGrid(); pad13->Draw();
-pad14->SetFillColor(10); pad14->SetGrid(); pad14->Draw();
-
-TCanvas* c2 = new TCanvas("c2","variables set 2", XC1, YC1, XC2, YC2);
-c2->cd();
-c2->SetFillColor(10);
-c2->GetFrame()->SetFillColor(10);
-c2->GetFrame()->SetBorderSize(6);
-c2->GetFrame()->SetBorderMode(-1);
-TPad* pad21= new TPad("pad21", "Pad21",       G,     G,       0.5-G,   0.5-G);
-TPad* pad22= new TPad("pad22", "Pad22",   0.5+G,     G,       1.0-G,   0.5-G);
-TPad* pad23= new TPad("pad23", "Pad23",       G, 0.5+G,       0.5-G,   1.0-G);
-TPad* pad24= new TPad("pad24", "Pad24",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-pad21->SetFillColor(10); pad21->SetGrid(); pad21->Draw();
-pad22->SetFillColor(10); pad22->SetGrid(); pad22->Draw();   
-pad23->SetFillColor(10); pad23->SetGrid(); pad23->Draw();
-pad24->SetFillColor(10); pad24->SetGrid(); pad24->Draw();
-
-TCanvas* c3 = new TCanvas("c3","variables set 3", XC1, YC1, XC2, YC2);
-c3->cd();
-c3->SetFillColor(10);
-c3->GetFrame()->SetFillColor(10);
-c3->GetFrame()->SetBorderSize(6);
-c3->GetFrame()->SetBorderMode(-1);
-TPad* pad31= new TPad("pad31", "Pad31",       G,     G,       0.5-G,   0.5-G);
-TPad* pad32= new TPad("pad32", "Pad32",   0.5+G,     G,       1.0-G,   0.5-G);
-TPad* pad33= new TPad("pad33", "Pad33",       G, 0.5+G,       0.5-G,   1.0-G);
-TPad* pad34= new TPad("pad34", "Pad34",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-pad31->SetFillColor(10); pad31->SetGrid(); pad31->Draw();
-pad32->SetFillColor(10); pad32->SetGrid(); pad32->Draw();   
-pad33->SetFillColor(10); pad33->SetGrid(); pad33->Draw();
-pad34->SetFillColor(10); pad34->SetGrid(); pad34->Draw();
-
-TCanvas* c4 = new TCanvas("c4","variables set 4", XC1, YC1, XC2, YC2);
-c4->cd();
-c4->SetFillColor(10);
-c4->GetFrame()->SetFillColor(10);
-c4->GetFrame()->SetBorderSize(6);
-c4->GetFrame()->SetBorderMode(-1);
-TPad* pad41= new TPad("pad41", "Pad41",       G,     G,       0.5-G,   0.5-G);
-TPad* pad42= new TPad("pad42", "Pad42",   0.5+G,     G,       1.0-G,   0.5-G);
-TPad* pad43= new TPad("pad43", "Pad43",       G, 0.5+G,       0.5-G,   1.0-G);
-TPad* pad44= new TPad("pad44", "Pad44",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-pad41->SetFillColor(10); pad41->SetGrid(); pad41->Draw();
-pad42->SetFillColor(10); pad42->SetGrid(); pad42->Draw();   
-pad43->SetFillColor(10); pad43->SetGrid(); pad43->Draw();
-pad44->SetFillColor(10); pad44->SetGrid(); pad44->Draw();
-
-TCanvas* c5 = new TCanvas("c5","variables set 5", XC1, YC1, XC2, YC2);
-c5->cd();
-c5->SetFillColor(10);
-c5->GetFrame()->SetFillColor(10);
-c5->GetFrame()->SetBorderSize(6);
-c5->GetFrame()->SetBorderMode(-1);
-TPad* pad51= new TPad("pad51", "Pad51",       G,     G,       0.5-G,   0.5-G);
-TPad* pad52= new TPad("pad52", "Pad52",   0.5+G,     G,       1.0-G,   0.5-G);
-TPad* pad53= new TPad("pad53", "Pad53",       G, 0.5+G,       0.5-G,   1.0-G);
-TPad* pad54= new TPad("pad54", "Pad54",   0.5+G, 0.5+G,       1.0-G,   1.0-G);
-pad51->SetFillColor(10); pad51->SetGrid(); pad51->Draw();
-pad52->SetFillColor(10); pad52->SetGrid(); pad52->Draw();   
-pad53->SetFillColor(10); pad53->SetGrid(); pad53->Draw();
-pad54->SetFillColor(10); pad54->SetGrid(); pad54->Draw();
-
-// -----------------------------------------------------------
-//      - - -  Creating stacks - - -  
-// -----------------------------------------------------------
-  
-THStack hs1("hs1","pt_lepton 1");
-THStack hs2("hs2","pt_lepton 2");
-THStack hs3("hs3","cosll2D");
-THStack hs4("hs4","cosll3D");
-THStack hs5("hs5","MET");
-THStack hs6("hs6","mt");
-THStack hs7("hs7","cosMETPtlep");
-THStack hs8("hs8","mZll");
-THStack hs9("hs9","cos Phi");
-THStack hs10("hs10","cosJetMET");
-THStack hs11("hs11","cone1");
-THStack hs12("hs12","cone2");
-THStack hs13("hs13","ejet1");
-THStack hs14("hs14","ejet2");
-THStack hs15("hs15","ejet3");
-THStack hs16("hs16","njet");
-THStack hs17("hs17","nel");
-THStack hs18("hs18","nmu");
-THStack hs19("hs19","nlep");
-THStack hs20("hs20","lepid");
-
-// // -----------------------------------------------------------
-// //      - - -  Creating many histograms - - -  
-// // -----------------------------------------------------------
- TH1F* hptlep1;
- TH1F* hptlep2;
- TH1F* hcosll2D;
- TH1F* hcosll3D;
- TH1F* hMET;
- TH1F* hmt;
- TH1F* hcosMETPtlep;
- TH1F* hmZll;
-//  TH1F* hmZ1;
-//  TH1F* hmZ2;
- TH1F* hcosphi;
- TH1F* hcosJetMET;
- TH1F* hcone1;
- TH1F* hcone2;
- TH1F* hejet1;
- TH1F* hejet2;
- TH1F* hejet3;
- TH1F* hnjet;
- TH1F* hnel;
- TH1F* hnmu;
- TH1F* hnlep;
- TH1F* hlepid;
-
-// variables of the ntuples are being declared below.  
-
- // cuts for AOD 
- const double eptmin2  = 15.0;
- const double mptmin2  = 10.0;
- const double eptmin1  = 25.0;
- const double mptmin1  = 20.0;
- const double eptmin  =  10.0;  
- const double mptmin  =  10.0;  
- const double etamin   = 2.5;
- const int    nlepcut  = 2;
- const double METcut   = 90.0;
- double mZcut    = 30.0;  
- const double mZ0      = 91.190;
-
- double modulus =0.;
- double cosll2D = 0.;
- double cosll3D = 0.;
- double cosPhi = 0.;
- double cosptlepMET = 0.;
- double mt = 0.;
- double pt2l = 0.;
- double PX = 0.;
- double PY = 0.;
- double PT = 0.;
-
- double ptZ0 = 0.;
- double eta1 = 0.;
- double Cone1 = 0.;
- double pt1 = 0.;
- double px1 = 0.;
- double py1 = 0.;
- double pz1 = 0.;
- double eta2 = 0.;
- double Cone2 = 0.;
- double px2 = 0.;
- double py2 = 0.;
- double pz2 = 0.;
- double pt2 = 0.;
- double cosjetmet = 0.;
- 
- const double mass_e = 0.00051099892;
- const double mass_mu = 0.105658369;
-     
- int nb=0;
- double portion;
- bool last_rec=0;
- 
-// create a new ROOT file
- TFile f("normalisation.root","recreate");
-
-// create one TTree
- TTree treeS("TreeS","preselected signal events");
- TTree treeB("TreeB","preselected background events");
-
- int njet;
- int nlep = 0;
- int nel = 0;;
- int nmu = 0;
- float ejet1 = 0.0;
- float ejet2 = 0.0;
- float ejet3 = 0.0;
- float ptlep1;
- float ptlep2;
- float cone1;
- float cone2;
- float massZ;
- float cosll2d;
- float cosll3d;
- float mT;
- float MET;
- float cosJetMET = 0.;
- float cosMETptlep;
- float cosphi;
-
- int lepID;
-
- int runnum;
- int evtnum;
- int type;
- float w;
-
-// create one branch for each variable
-
- treeS.Branch("njet",&njet,"njet/I");	         
- treeS.Branch("ejet1",&ejet1,"ejet1/F");	         
- treeS.Branch("ejet2",&ejet2,"ejet2/F");	         
- treeS.Branch("ejet3",&ejet3,"ejet3/F");	         
- treeS.Branch("ptlep1",&ptlep1,"ptlep1/F");	         
- treeS.Branch("ptlep2",&ptlep2,"ptlep2/F");	         
- treeS.Branch("cone1",&cone1,"cone1/F");	         
- treeS.Branch("cone2",&cone2,"cone2/F");	         
- treeS.Branch("nel",&nel,"nel/I");	         
- treeS.Branch("nmu",&nmu,"nmu/I");	         
- treeS.Branch("nlep",&nlep,"nlep/I");	         
- treeS.Branch("lepID",&lepID,"lepID/I");	         
- treeS.Branch("massZ",&massZ,"massZ/F");	         
- treeS.Branch("cosll2d",&cosll2d,"cosll2d/F");	         
- treeS.Branch("cosll3d",&cosll3d,"cosll3d/F");	         
- treeS.Branch("mT",&mT,"mT/F");	         
- treeS.Branch("MET",&MET,"MET/F");	         
- treeS.Branch("cosMETptlep",&cosMETptlep,"cosMETptlep/F");	         
- treeS.Branch("cosJetMET",&cosJetMET,"cosJetMET/F");	         
- treeS.Branch("cosphi",&cosphi,"cosphi/F");	         
- treeS.Branch("runnum",&runnum,"runnum/I");
- treeS.Branch("evtnum",&evtnum,"evtnum/I");
- treeS.Branch("type",&type,"type/I");
- treeS.Branch("w",&w,"w/F");
-
- treeB.Branch("njet",&njet,"njet/I");	         
- treeB.Branch("ejet1",&ejet1,"ejet1/F");	         
- treeB.Branch("ejet2",&ejet2,"ejet2/F");	         
- treeB.Branch("ejet3",&ejet3,"ejet3/F");	         
- treeB.Branch("ptlep1",&ptlep1,"ptlep1/F");	         
- treeB.Branch("ptlep2",&ptlep2,"ptlep2/F");	         
- treeB.Branch("cone1",&cone1,"cone1/F");	         
- treeB.Branch("cone2",&cone2,"cone2/F");	         
- treeB.Branch("nel",&nel,"nel/I");	         
- treeB.Branch("nmu",&nmu,"nmu/I");	         
- treeB.Branch("nlep",&nlep,"nlep/I");	         
- treeB.Branch("lepID",&lepID,"lepID/I");	         
- treeB.Branch("massZ",&massZ,"massZ/F");	         
- treeB.Branch("cosll2d",&cosll2d,"cosll2d/F");	         
- treeB.Branch("cosll3d",&cosll3d,"cosll3d/F");	         
- treeB.Branch("mT",&mT,"mT/F");	         
- treeB.Branch("MET",&MET,"MET/F");	         
- treeB.Branch("cosMETptlep",&cosMETptlep,"cosMETptlep/F");	         
- treeB.Branch("cosJetMET",&cosJetMET,"cosJetMET/F");	         
- treeB.Branch("cosphi",&cosphi,"cosphi/F");	         
- treeB.Branch("runnum",&runnum,"runnum/I");
- treeB.Branch("evtnum",&evtnum,"evtnum/I");
- treeB.Branch("type",&type,"type/I");
- treeB.Branch("w",&w,"w/F");
-
- reject_MET =0.;
- reject_nlep =0.;
- reject_trigger =0.;
- reject_AODtrigger =0.;
- reject_leppid =0.;
- reject_2Z =0.;
- reject_btag =0.;
- totalRejected =0.;
- 
- found=0;
-
- hptlep1 = new TH1F("ptlep1", "p_T^{lepton 1} ", 50, 0, 300.0);
- hptlep2 = new TH1F("ptlep2", "p_T^{lepton 2} ", 50, 0, 100.0);
- hcosll2D = new TH1F("cosll2D", "cos_{ll} (xy plane)", 50, -1.1, 1.1);
- hcosll3D = new TH1F("cosll3D", "cos_{ll}", 50, -1.1, 1.1);
- hMET = new TH1F("MET", "p_{T} missing per event ", 50, 50, 500);
- hmt = new TH1F("mT", "m_T ", 50, 0, 700.0);
- hcosMETPtlep = new TH1F("cosMETptlep", "cos MET-Ptlep ", 50, -1.1, 1.1);
- hmZll = new TH1F("mZ", "M_{Z #rightarrow ll} 1", 50, 71.19, 111.19);
-//  hmZ2 = new TH1F("mZ2", "M_{Z #rightarrow ll} 2", 50, 51.19, 131.19);
- hcosphi = new TH1F("cosphi", "cos #phi ", 50, -1.1, 1.1);
- hcosJetMET = new TH1F("cosJetMET", "cos #phi (between p_{T} miss and jet", 50, -1.0, 1.2);
- hcone1 = new TH1F("cone1", "electron isolation cone 0.10 ", 50, 0.0, 50.0);
- hcone2 = new TH1F("cone2", "muon isolation cone 0.10 ", 50, 0.0, 300.0);
- hejet1 = new TH1F("ejet1", "energy jet 1 ", 50, 0, 300.0);
- hejet2 = new TH1F("ejet2", "energy jet 2 ", 50, 0, 300.0);
- hejet3 = new TH1F("ejet3", "energy jet 3 ", 50, 0, 300.0);
- hnjet = new TH1F("njet", "njet ", 11, 0, 10);
- hnel = new TH1F("nel", "nel ", 6, 0, 5);
- hnmu = new TH1F("nmu", "nmu ", 6, 0, 5);
- hnlep = new TH1F("nlep", "nlep ", 11, 0, 10);
- hlepid = new TH1F("lepid", "lepid ", 26, -0, 25);
-
- Color_t color = kYellow;
-
- hptlep1->SetFillColor(color);
- hptlep2->SetFillColor(color);
- hcosll2D->SetFillColor(color);
- hcosll3D->SetFillColor(color);
- hMET->SetFillColor(color);     
- hmt->SetFillColor(color);     
- hcosMETPtlep->SetFillColor(color);     
- hmZll->SetFillColor(color);    
- hcosphi->SetFillColor(color);     
- hcosJetMET->SetFillColor(color);     
- hcone1->SetFillColor(color);
- hcone2->SetFillColor(color);
- hejet1->SetFillColor(color);
- hejet2->SetFillColor(color);
- hejet3->SetFillColor(color);
- hnjet->SetFillColor(color);
- hnel->SetFillColor(color);
- hnmu->SetFillColor(color);
- hnlep->SetFillColor(color);
- hlepid->SetFillColor(color);
-
-  /***************** Getting file/tree from disk *********************/
-  // We define chain, which is basically a tree to add root files with the
-  // same tree name.  If you have two or more files, keep adding in the 
-  // nfchain variable.
-
-  TChain *chain=0;
-
-#ifdef CHAIN
-  //     chain = new TChain("EVCands");
-     chain = new TChain("EV0");
-     int nfchain=0;
-
-// ZZ->llll sample - 50k filtered events with multilepton filter
-    int typeNumber = 1;
-    nfchain += chain->Add("/data/ntuples/ZZ4l_ntuple.root");
-     
-  int EVEventAndInstance;  EVEventAndInstance = 0;
-  int EVRunNumber;    EVRunNumber = 0;
-
-  double MET_RefFinal_ex;  MET_RefFinal_ex = 0.0;
-  double MET_RefFinal_ey;  MET_RefFinal_ey = 0.0;
-  double MET_RefFinal_et;  MET_RefFinal_et = 0.0;
-
-  double MET_Truth_ex;  MET_Truth_ex = 0.0;
-  double MET_Truth_ey;  MET_Truth_ey = 0.0;
-  double MET_Truth_et;  MET_Truth_et = 0.0;
-  
-  int El_N;  El_N = 0;
-  std::vector<double> * El_px;  El_px = new std::vector<double>();
-  std::vector<double> * El_py;  El_py = new std::vector<double>();
-  std::vector<double> * El_pz;  El_pz = new std::vector<double>();
-  std::vector<double> * El_p_T; El_p_T = new std::vector<double>();
-  std::vector<double> * El_eta; El_eta = new std::vector<double>();
-  std::vector<int> * El_isEM;   El_isEM = new std::vector<int>();
-  std::vector<int> * El_author; El_author = new std::vector<int>();
-  std::vector<double> * El_pdgId; El_pdgId = new std::vector<double>();
-  std::vector<double> * El_trEtCone10; El_trEtCone10 = new std::vector<double>();
-
-  int TEl_N;  TEl_N = 0;
-  std::vector<double> * TEl_p_T; TEl_p_T = new std::vector<double>();
-  std::vector<double> * TEl_eta; TEl_eta = new std::vector<double>();
-
-  int Mu_N;  Mu_N = 0;
-  std::vector<double> * Mu_px;  Mu_px = new std::vector<double>();
-  std::vector<double> * Mu_py;  Mu_py = new std::vector<double>();
-  std::vector<double> * Mu_pz;  Mu_pz = new std::vector<double>();
-  std::vector<double> * Mu_p_T; Mu_p_T = new std::vector<double>();
-  std::vector<double> * Mu_eta; Mu_eta = new std::vector<double>();
-  std::vector<int>    * Mu_isCombinedMuon; Mu_isCombinedMuon = new std::vector<int>();
-  std::vector<int>    * Mu_bestMatch; Mu_bestMatch = new std::vector<int>();
-  std::vector<double> * Mu_pdgId; Mu_pdgId = new std::vector<double>();
-  std::vector<double> * Mu_trEtCone10; Mu_trEtCone10 = new std::vector<double>();
-
-  int TMu_N;  TMu_N = 0;
-  std::vector<double> * TMu_p_T; TMu_p_T = new std::vector<double>();
-  std::vector<double> * TMu_eta; TMu_eta = new std::vector<double>();
-
-  int Jet_N;  Jet_N = 0;
-  std::vector<double> * Jet_eta;  Jet_eta = new std::vector<double>();
-  std::vector<double> * Jet_E;    Jet_E = new std::vector<double>();
-  std::vector<double> * Jet_px;   Jet_px = new std::vector<double>();
-  std::vector<double> * Jet_py;   Jet_py= new std::vector<double>();
-  std::vector<double> * Jet_p_T;  Jet_p_T= new std::vector<double>();
-
-  std::vector<int> * Jet_BTagged;  Jet_BTagged= new std::vector<int>();
-
-// extract the trigger info
-  bool PassedL1; PassedL1 = false;
-  bool PassedL2; PassedL2 = false;
-  bool PassedEF; PassedEF= false;
-  bool PassedTrigger; PassedTrigger= false;
-  
-  bool PassedL1_EM25I; PassedL1_EM25I= false;
-  bool PassedL1_2EM15I; PassedL1_2EM15I= false;
-
-  bool PassedL1_MU06; PassedL1_MU06= false;
-  bool PassedL1_MU08; PassedL1_MU08= false;
-  bool PassedL1_MU10; PassedL1_MU10= false;
-  bool PassedL1_MU11; PassedL1_MU11= false;
-  bool PassedL1_MU20; PassedL1_MU20= false;
-  bool PassedL1_MU40; PassedL1_MU40= false;
-  bool PassedL1_2MU06; PassedL1_2MU06= false;
-
-  bool PassedL1_XE100; PassedL1_XE100= false;
-  bool PassedL1_XE50; PassedL1_XE50= false;
-
-  bool PassedL2_e25i; PassedL2_e25i= false;
-  bool PassedL2_mu6; PassedL2_mu6= false;
-  bool PassedL2_mu6l; PassedL2_mu6l= false;
-  bool PassedL2_mu20i; PassedL2_mu20i= false;
-
-  bool PassedEF_e10; PassedEF_e10= false;
-  bool PassedEF_e15iEF_e15i; PassedEF_e15iEF_e15i= false;
-  bool PassedEF_e25i; PassedEF_e25i= false;
-  bool PassedEF_mu6; PassedEF_mu6= false;
-  bool PassedEF_mu6l; PassedEF_mu6l= false;
-  bool PassedEF_mu20i; PassedEF_mu20i= false;
-
-  double TrigEFMissingET_et; TrigEFMissingET_et = 0.0;
- 
-  int Z_N;  Z_N = 0;
-  std::vector<int> * Z_Zee;  Z_Zee = new std::vector<int>();
-  std::vector<int> * Z_Zmm;  Z_Zmm = new std::vector<int>();
-  std::vector<double> * Z_m;    Z_m = new std::vector<double>();
-  std::vector<double> * Z_E;    Z_E = new std::vector<double>();
-  std::vector<double> * Z_p_T;  Z_p_T = new std::vector<double>();
-  std::vector<double> * Z_px;   Z_px = new std::vector<double>();
-  std::vector<double> * Z_py;   Z_py = new std::vector<double>();
-  std::vector<double> * Z_eta;  Z_eta = new std::vector<double>();
-
-  chain->SetBranchAddress("EVEventAndInstance",  &EVEventAndInstance);
-  chain->SetBranchAddress("EVRunNumber", &EVRunNumber);
-
-  chain->SetBranchAddress("MET_RefFinal_ex", &MET_RefFinal_ex);
-  chain->SetBranchAddress("MET_RefFinal_ey", &MET_RefFinal_ey);
-  chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-
-  chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-
-  chain->SetBranchAddress("MET_Truth_ex", &MET_Truth_ex);
-  chain->SetBranchAddress("MET_Truth_ey", &MET_Truth_ey);
-  chain->SetBranchAddress("MET_Truth_et", &MET_Truth_et);
-
-  chain->SetBranchAddress("El_N",&El_N);
-  chain->SetBranchAddress("El_px",&El_px);
-  chain->SetBranchAddress("El_py",&El_py);
-  chain->SetBranchAddress("El_pz",&El_pz);
-  chain->SetBranchAddress("El_p_T",&El_p_T);
-  chain->SetBranchAddress("El_eta",&El_eta);
-  chain->SetBranchAddress("El_pdgId",&El_pdgId);
-  chain->SetBranchAddress("El_isEM",&El_isEM);
-  chain->SetBranchAddress("El_author",&El_author);
-  chain->SetBranchAddress("El_trEtCone10",&El_trEtCone10);
-
-  chain->SetBranchAddress("TEl_N",&TEl_N);
-  chain->SetBranchAddress("TEl_p_T",&TEl_p_T);
-  chain->SetBranchAddress("TEl_eta",&TEl_eta);
-
-  chain->SetBranchAddress("Mu_N",&Mu_N);
-  chain->SetBranchAddress("Mu_px",&Mu_px);
-  chain->SetBranchAddress("Mu_py",&Mu_py);
-  chain->SetBranchAddress("Mu_pz",&Mu_pz);
-  chain->SetBranchAddress("Mu_p_T",&Mu_p_T);
-  chain->SetBranchAddress("Mu_eta",&Mu_eta);
-  chain->SetBranchAddress("Mu_pdgId",&Mu_pdgId);
-  chain->SetBranchAddress("Mu_isCombinedMuon",&Mu_isCombinedMuon);
-  chain->SetBranchAddress("Mu_bestMatch",&Mu_bestMatch);
-  chain->SetBranchAddress("Mu_trEtCone10",&Mu_trEtCone10);
-
-  chain->SetBranchAddress("TMu_N",&TMu_N);
-  chain->SetBranchAddress("TMu_p_T",&TMu_p_T);
-  chain->SetBranchAddress("TMu_eta",&TMu_eta);
-
-  chain->SetBranchAddress("Jet_N",&Jet_N);
-  chain->SetBranchAddress("Jet_eta",&Jet_eta);
-  chain->SetBranchAddress("Jet_E",&Jet_E);
-  chain->SetBranchAddress("Jet_px",&Jet_px);
-  chain->SetBranchAddress("Jet_py",&Jet_py);
-  chain->SetBranchAddress("Jet_p_T",&Jet_p_T);
-  chain->SetBranchAddress("Jet_BTagged",&Jet_BTagged);
-
-  chain->SetBranchAddress("PassedL1",&PassedL1);
-  chain->SetBranchAddress("PassedL2",&PassedL2);
-  chain->SetBranchAddress("PassedEF",&PassedEF);
-  chain->SetBranchAddress("PassedTrigger",&PassedTrigger);
-  
-  chain->SetBranchAddress("PassedL1_EM25I",&PassedL1_EM25I);
-  chain->SetBranchAddress("PassedL1_2EM15I",&PassedL1_2EM15I);
-
-  chain->SetBranchAddress("PassedL1_MU06",&PassedL1_MU06);
-  chain->SetBranchAddress("PassedL1_MU08",&PassedL1_MU08);
-  chain->SetBranchAddress("PassedL1_MU10",&PassedL1_MU10);
-  chain->SetBranchAddress("PassedL1_MU11",&PassedL1_MU11);
-  chain->SetBranchAddress("PassedL1_MU20",&PassedL1_MU20);
-  chain->SetBranchAddress("PassedL1_MU40",&PassedL1_MU40);
-  chain->SetBranchAddress("PassedL1_2MU06",&PassedL1_2MU06);
-
-  chain->SetBranchAddress("PassedL1_XE100",&PassedL1_XE100);
-  chain->SetBranchAddress("PassedL1_XE50",&PassedL1_XE50);
-
-  chain->SetBranchAddress("PassedL2_e25i",&PassedL2_e25i);
-  chain->SetBranchAddress("PassedL2_mu6",&PassedL2_mu6);
-  chain->SetBranchAddress("PassedL2_mu6l",&PassedL2_mu6l);
-  chain->SetBranchAddress("PassedL2_mu20i",&PassedL2_mu20i);
-
-  chain->SetBranchAddress("PassedEF_e10",&PassedEF_e10);
-  chain->SetBranchAddress("PassedEF_e15iEF_e15i",&PassedEF_e15iEF_e15i);
-  chain->SetBranchAddress("PassedEF_e25i",&PassedEF_e25i);
-  chain->SetBranchAddress("PassedEF_mu6",&PassedEF_mu6);
-  chain->SetBranchAddress("PassedEF_mu6l",&PassedEF_mu6l);
-  chain->SetBranchAddress("PassedEF_mu20i",&PassedEF_mu20i);
-
-  chain->SetBranchAddress("TrigEFMissingET_et",&TrigEFMissingET_et);
-
-  chain->SetBranchAddress("Z_N",&Z_N);
-  chain->SetBranchAddress("Z_Zee",&Z_Zee);
-  chain->SetBranchAddress("Z_Zmm",&Z_Zmm);
-
-int nrecords = static_cast<int>(0.5 + chain->GetEntries());
-
-int nticker  = static_cast<int>(0.5 + nrecords/20.0);
-
-nrec = nrecords;
-
-// The above is to find the number of events or entries
-#endif // CHAIN 
-
-outClientFile << "      " <<  endl;
-outClientFile << "MET cut > " << METcut << endl;
-outClientFile << "pt cuts for leptons: e > " << eptmin << " and mu > " << mptmin <<" GeV with eta < " << etamin << endl;
-outClientFile << "pt cuts for AOD trigger: 1e > " << eptmin1 << " and 2e > " << eptmin2 <<" GeV with eta < " << etamin << endl;
-outClientFile << "pt cuts for AOD trigger: 1m > " << mptmin1 << " and 2m > " << mptmin2 <<" GeV with eta < " << etamin << endl;
-outClientFile << "nlep strictly equal to " << nlepcut << endl; //" and njet less or equal to " << njetcut << endl;	 	   
-outClientFile << "mZ within " << mZcut << " GeV of on-shell mass " << endl;
-outClientFile << endl;	  
-
-double mZ  = 0.0;
-double mZ1 = 0.0;
-double mZ2 = 0.0;
-
-// evaluate the weight for this type of events
-generated = nrec/filterEff; 
- cout << " generated: " << generated << " nrec: " << nrec << endl;
-weight = (sigmaBR * lumi)/generated;
-
-// =====================================================================
-// ============  Starting the main loop over the events  ===============
-// =====================================================================
-
- for (int i=0; i<nrec; i++) {  
-
-   if(div(i, nticker).rem == 0 || i >= nrec-1) 
-     { 
-       portion=static_cast<float>(i) / static_cast<float>(nrec-1);
-       printf("Done %4.1f percent of reading the NTuple  ", portion*100.0);
-       cout.flush();   cout << char(13);  
-     }
-
-   last_rec=(i>=nrec-1); 
-
-   if(!last_rec)  {
-#ifdef CHAIN
-     nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-     nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-  }
-   
- // Reading the i-th (current) record:
-
-#ifdef CHAIN
-   nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-   nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-
-   int accepted_e = 0;
-   double Zmasse[25];
-   int elep1[25];
-   int elep2[25];
-
-   int accepted_m = 0;
-   double Zmassm[25];
-   int mlep1[25];
-   int mlep2[25];
-
-   int bestj = 0;
-   int bestk = 0;
-   int bestid = 0;
-
-   int best1j = 0;
-   int best1k = 0;
-   int best1id = 0;
-   int best2j = 0;
-   int best2k = 0;
-   int best2id = 0;
-   int invlep1 = 0;
-   int invlep2 = 0;
-   int invid = 0;
-
-   MET_RefFinal_ex /=1000.;
-   MET_RefFinal_ey /=1000.; 
-   MET_RefFinal_et /=1000.;
-
-   MET_Truth_et /=1000.;
-
-   for(int j=0; j<El_N; j++) {
-     (*El_px)[j] /= 1000.;
-     (*El_py)[j] /= 1000.;
-     (*El_pz)[j] /= 1000.;
-     (*El_p_T)[j] /= 1000.;
-     (*El_trEtCone10)[j] /= 1000.;
-   }
-   for(int j=0; j<Mu_N; j++) {
-     (*Mu_px)[j] /= 1000.;
-     (*Mu_py)[j] /= 1000.;
-     (*Mu_pz)[j] /= 1000.;
-     (*Mu_p_T)[j] /= 1000.;
-     (*Mu_trEtCone10)[j] /= 1000.;
-   }
-
-   for(int j=0; j<El_N; j++) {
-     (*TEl_p_T)[j] /= 1000.;
-   }
-   for(int j=0; j<Mu_N; j++) {
-     (*TMu_p_T)[j] /= 1000.;
-   }
-
-// apply the trigger selection
-   if (!PassedEF_e15iEF_e15i && !PassedEF_e25i && !PassedEF_mu6 && !PassedEF_mu6l && !PassedEF_mu20i && !PassedL1_XE100) {
-     reject_trigger++;}
-   if (PassedEF_e15iEF_e15i || PassedEF_e25i || PassedEF_mu6 || PassedEF_mu6l || PassedEF_mu20i || PassedL1_XE100) {
-     
-//first loop over all pairs of electrons which have pt > 7 GeV
-     if (El_N >= 2) epair++;
-     if (El_N >= 4) epair++;
-     for(int j=0; j<El_N-1; j++) {
-       if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > 7.0 && ((*El_isEM)[j]&0x7)==0) {
-	 for(int k=j+1; k<El_N; k++) {
-	   if (fabs((*El_eta)[k]) <= etamin && (*El_p_T)[k] >= 7.0 && ((*El_isEM)[k]&0x7)==0) {
-//lepid cut
-//	       if((*El_pdgId)[j] != -(*El_pdgId)[k]) {cout << "electron id: " << (*El_pdgId)[j] << "\t" << (*El_pdgId)[k] << endl;}
-	     if((*El_pdgId)[j] == -(*El_pdgId)[k]) {
-
-	       px1 = (*El_px)[j];
-	       py1 = (*El_py)[j];
-	       pz1 = (*El_pz)[j];
-	       pt1 = (*El_p_T)[j];
-	       eta1 = (*El_eta)[j];
-	       px2 = (*El_px)[k];
-	       py2 = (*El_py)[k];
-	       pz2 = (*El_pz)[k];
-	       pt2 = (*El_p_T)[k];
-	       eta2 = (*El_eta)[k];
-
-// calculate the Z invariant mass 
-	       double px = px1+px2;
-	       double py = py1+py2;
-	       double pz = pz1+pz2;
-	       double pZ = px*px +py*py +pz*pz;
-	       double ml = mass_e;
-	       double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-	       double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-	       double eZ = sqrt(e1) + sqrt(e2);
-	       mZ = eZ*eZ - pZ;
-	       if (mZ > 0.0) {mZ = sqrt(mZ);}
-	       else {mZ = -1.0;}
-
- //count the number of accepted pairs
-	       if (abs(mZ - mZ0) > mZcut) reject_masse++;
-	       if (abs(mZ - mZ0) <= mZcut) {
-
-		 if (accepted_e > 24) {cout << " too many accepted_e pairs, stop!!! accepted_e = " << accepted_e << endl;exit(-1);}
-		 Zmasse[accepted_e] = mZ;
-		 elep1[accepted_e]  = j;
-		 elep2[accepted_e]  = k;
-		 accepted_e++;}
-	       
-	     } //  first end-if on lepid
-	   } // first end if acceptance criteria for second electron
-	 } // first end of for-loop on second electron
-       } // first end if acceptance criteria for first electron
-     } // first end of for-loop on first electron
-
-     if (Mu_N >= 2) epair++;
-     if (Mu_N >= 4) epair++;
-// next step: first loop over all pairs of muons 
-     for(int j=0; j<Mu_N-1; j++) {
-       if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > 7.0 && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-	 for(int k=j+1; k<Mu_N; k++) {
-
-	   if (fabs((*Mu_eta)[k]) <= etamin && (*Mu_p_T)[k] >= 7.0 && (*Mu_isCombinedMuon)[k] == 1 && (*Mu_bestMatch)[k] == 1) {
-	     
-//lepid cut
-	     if((*Mu_pdgId)[j] == -(*Mu_pdgId)[k]) {
-	       px1 =  (*Mu_px)[j];
-	       py1 =  (*Mu_py)[j];
-	       pz1 =  (*Mu_pz)[j];
-	       pt1 =  (*Mu_p_T)[j];
-	       eta1 = (*Mu_eta)[j];
-	       px2 =  (*Mu_px)[k];
-	       py2 =  (*Mu_py)[k];
-	       pz2 =  (*Mu_pz)[k];
-	       pt2 =  (*Mu_p_T)[k];
-	       eta2 = (*Mu_eta)[k];
-
-// calculate the Z invariant mass 
-	       double px = px1+px2;
-	       double py = py1+py2;
-	       double pz = pz1+pz2;
-	       double pZ = px*px +py*py +pz*pz;
-	       double ml = mass_mu;
-	       double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-	       double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-	       double eZ = sqrt(e1) + sqrt(e2);
-	       mZ = eZ*eZ - pZ;
-	       if (mZ > 0.0) {mZ = sqrt(mZ);}
-	       else {mZ = -1.0;}
-
-//count the number of accepted_m pairs
-		 //		 cout << "reconstructed mZ = " << mZ << endl;
-	       if (abs(mZ - mZ0) > mZcut) reject_massm++;
-	       if (abs(mZ - mZ0) <= mZcut) {
-		 
-		 if (accepted_m > 24) {cout << " too many accepted_m pairs, stop!!! accepted_m = " << accepted_m << endl;exit(-1);}
-		 Zmassm[accepted_m] = mZ;
-		 mlep1[accepted_m]  = j;
-		 mlep2[accepted_m]  = k;
-		 accepted_m++;}
-	       
-	     } //  first end-if on lepid for muons
-	   } // first end if acceptance criteria for second muon
-	 } // first end of for-loop on second muon
-       } // first end if acceptance criteria for first muon
-     } // first end of for-loop on first muon
-
-// check to see if two Z are found:
-//       cout << "accepted_e: " << accepted_e << " accepted_m: " << accepted_m << endl;
-     if (accepted_m + accepted_e < 2 ) {reject_2Z++;;}
-     if (accepted_m + accepted_e >= 2 ) {
-
-//loop over all accepted pairs and retain only the two best ones
-//   for (int n = 0; n < accepted_e + accepted_m; n++) {
-       mZ =0.0;
-       mZ1=0.0;
-       mZ2=0.0;
-       for (int m=0; m<accepted_e; m++) {
-	 mZ1 = (( abs(mZ0 - mZ1) < abs(mZ0 - Zmasse[m])) ? mZ1 : Zmasse[m]);
-	 if (mZ1 == Zmasse[m]) {best1j = elep1[m]; best1k = elep2[m]; best1id=11;}
-       }
-       for (int m=0; m<accepted_m; m++) {
-	 mZ1 = (( abs(mZ0 - mZ1) < abs(mZ0 - Zmassm[m])) ? mZ1 : Zmassm[m]);
-	 if (mZ1 == Zmassm[m]) {best1j = mlep1[m]; best1k = mlep2[m]; best1id=13;}
-       }
-       
-       for (int m=0; m<accepted_e; m++) {
-	 if ((best1id == 11 && (best1j != elep1[m] || best1k != elep2[m])) || best1id ==13) {
-	   mZ2 = (( abs(mZ0 - mZ2) < abs(mZ0 - Zmasse[m])) ? mZ2 : Zmasse[m]);
-	   if (mZ2 == Zmasse[m]) {best2j = elep1[m]; best2k = elep2[m]; best2id=11;}
-	 }
-       }
-       for (int m=0; m<accepted_m; m++) {
-	 if ((best1id == 13 && (best1j != mlep1[m] || best1k != mlep2[m])) || best1id ==11) {
-	   mZ2 = (( abs(mZ0 - mZ2) < abs(mZ0 - Zmassm[m])) ? mZ2 : Zmassm[m]);
-	   if (mZ2 == Zmassm[m]) {best2j = mlep1[m]; best2k = mlep2[m]; best2id=13;}
-	 }
-       }
-//       cout << "mZ1: " << mZ1 << " mZ2: " << mZ2 << endl;
-//        hmZ1->Fill(mZ1);
-//        hmZ2->Fill(mZ2);
-
-// pick randomly one Z and declare the two leptons invisible
-       runnum = EVRunNumber;
-       evtnum  = EVEventAndInstance/100;
-
-  /* generate random number between 1 and 100: */
-       int dice = rand() % 100 + 1;
-   //   cout << "dice : " << dice << " for event # " << evtnum << "\t" << runnum << endl;
-       if (dice <= 50) {
-	 bestid  = best2id;
-	 bestj   = best2j;
-	 bestk   = best2k;
-         mZ      = mZ2;
-	 invlep1 = best1j;
-	 invlep2 = best1k;
-	 invid   = best1id;
-  }
-       if (dice > 50) {
-	 bestid  = best1id;
-	 bestj   = best1j;
-	 bestk   = best1k;
-         mZ      = mZ1;
-	 invlep1 = best2j;
-	 invlep2 = best2k;
-	 invid   = best2id;
-       }
-
-       if (invlep1 == invlep2) cout << "wo les moteurs!" << dice << "\t" << best1id << "\t" << best2id << endl;
-
-// check if the remaining Z passes the original selection cuts on momentum
-       bool ok = true;
-       if (bestid == 11) {
-   	 if ((*El_p_T)[bestj] < eptmin || (*El_p_T)[bestk] < eptmin) {
-	   ok = false;  
-	   reject_nlep++;}
-       }
-       if (bestid == 13) {
-	 if ((*Mu_p_T)[bestj] < mptmin || (*Mu_p_T)[bestk] < mptmin) {
-	   ok = false;  
-	   reject_nlep++;}
-       }
-
-//second loop over all electrons to count the good ones
-	 nel = 0;
-	 for(int j=0; j<El_N; j++) {
-	   if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-//  	     cout << "j for electrons: " << j << " invid: " << invid << " invlep1: " << invlep1 << " invlep2: " << invlep2 << endl;
-	     if (invid == 13 || (invid == 11 && (j != invlep1 && j != invlep2))) {
-//  	       cout << " this electron got accepted in event: " << evtnum << endl;
-	       nel++;
-	     }
-	   }
-	 }
-
-// 	 if (nel == 3) {
-// 	   for(int j=0; j<El_N; j++) {
-// 	     if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-// 	       if (invid == 13 || (invid == 11 && (j != invlep1 && j != invlep2))) {
-// 		 cout << "nel == 3 in event: " << evtnum << " El_N = : " << El_N << " j for electrons: " << j << " invid: " << invid                               << " invlep1: " << invlep1 << " invlep2: " << invlep2 << endl;
-// 	       }
-// 	     }
-// 	   }
-// 	 }
-// second loop over all muons to select the good ones after removing the leptons declared invisible
-	 nmu = 0;
-	 for(int j=0; j<Mu_N; j++) {
-	   if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-//	  cout << "j for muons: " << j << " invid: " << invid << " invlep1: " << invlep1 << " invlep2: " << invlep2 << endl;
-	     if (invid == 11 || (invid == 13 && (j != invlep1 && j != invlep2))) {
-//	    cout << " this muon got accepted" << endl;
-	       nmu++;
-	     }
-	   }
-	 }
-
-// 	 if (nmu == 3) {
-// 	   for(int j=0; j<Mu_N; j++) {
-// 	     if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-// 	       if (invid == 11 || (invid == 13 && (j != invlep1 && j != invlep2))) {
-// 		 cout << "Nmu == 3 in event: " << evtnum << " Mu_N = : " << Mu_N << " j for muons: " << j << " invid: " << invid << " invlep1: " <<                invlep1 << " invlep2: " << invlep2 << endl;
-// 		 nmu++;
-// 	       }
-// 	     }
-// 	   }
-// 	 }
-// store the total number of good leptons
-	 nlep = nel + nmu;
-
-	 if (nlep < 2) reject_nlep++;
-	 if (ok && nlep >= 2) {
-
-// apply the trigger cuts at the AOD level; reset the counters for the trigger 
-	 int etrigger1 = 0;
-	 int etrigger2 = 0;
-	 int mtrigger1 = 0;
-	 int mtrigger2 = 0;
-
-//check the trigger requirements for leptons at AOD level
-	 for(int j=0;j<El_N;j++){
-	   if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin1) etrigger1++;
-	   if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin2) etrigger2++;
-	 }
-
-	 for(int j=0;j<Mu_N;j++){
-	   if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin1) mtrigger1++;
-	   if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin2) mtrigger2++;
-	 }
-
-//apply the MET cut after re-evaluating it:
-	   double new_MET_ex = 0.0;
-	   double new_MET_ey = 0.0;
-	   double new_MET_et = 0.0;
-
-	   if (invid == 11) {
-	   if ((*El_px)[invlep1] == 0.0) cout << "(*El_px)[invlep1] =0: invlep1 = " << invlep1 << "\t" << invid << endl;
-	   if ((*El_py)[invlep1] == 0.0) cout << "(*El_py)[invlep1] =0: invlep1 = " << invlep1 << "\t" << invid << endl;
-	   if ((*El_px)[invlep2] == 0.0) cout << "(*El_px)[invlep2] =0: invlep2 = " << invlep2 << "\t" << invid << endl;
-	   if ((*El_py)[invlep2] == 0.0) cout << "(*El_py)[invlep2] =0: invlep2 = " << invlep2 << "\t" << invid << endl;
-	   }
-	   if (invid == 13) {
-	   if ((*Mu_px)[invlep1] == 0.0) cout << "(*Mu_px)[invlep1] =0: invlep1 = " << invlep1 << "\t" << invid << endl;
-	   if ((*Mu_py)[invlep1] == 0.0) cout << "(*Mu_py)[invlep1] =0: invlep1 = " << invlep1 << "\t" << invid << endl;
-	   if ((*Mu_px)[invlep2] == 0.0) cout << "(*Mu_px)[invlep2] =0: invlep2 = " << invlep2 << "\t" << invid << endl;
-	   if ((*Mu_py)[invlep2] == 0.0) cout << "(*Mu_py)[invlep2] =0: invlep2 = " << invlep2 << "\t" << invid << endl;
-	   }
-
-	   if (invid == 11) {
-	     new_MET_ex = MET_RefFinal_ex + (*El_px)[invlep1] + (*El_px)[invlep2];
-	     new_MET_ey = MET_RefFinal_ey + (*El_py)[invlep1] + (*El_py)[invlep2];
-	     new_MET_et = new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey;
-	     if (new_MET_et <= 0.0) cout << new_MET_ex << "\t" << new_MET_ey << "\t" << new_MET_et << endl;
-	     new_MET_et = sqrt(new_MET_et);
-	     MET_RefFinal_et = new_MET_et;
-	 }
-	   if (invid == 13) {
-	     new_MET_ex = MET_RefFinal_ex + (*Mu_px)[invlep1] + (*Mu_px)[invlep2];
-	     new_MET_ey = MET_RefFinal_ey + (*Mu_py)[invlep1] + (*Mu_py)[invlep2];
-	     new_MET_et = new_MET_ex*new_MET_ex + new_MET_ey*new_MET_ey;
-	     if (new_MET_et <= 0.0) cout << new_MET_ex << "\t" << new_MET_ey << "\t" << new_MET_et << endl;
-	     new_MET_et = sqrt(new_MET_et);
-	     MET_RefFinal_et = new_MET_et;
-	   }
-
-//	   cout << "MET_RefFinal_et: " << MET_RefFinal_et << " new_MET_et: " << new_MET_et << " difference: " <<  new_MET_et - MET_RefFinal_et << endl;
-
-           hMET->Fill(new_MET_et,weight);
-	   if (MET_RefFinal_et < METcut) reject_MET++;
-	   if (MET_RefFinal_et >= METcut) {
-
-// apply the trigger cuts, including the MET trigger:
-	 if (etrigger1 < 1  && etrigger2  < 2  && mtrigger1 < 1   && mtrigger2  < 2 && new_MET_et < METcut ) {
-	   reject_AODtrigger++;}
-	 if (etrigger1 >= 1 || etrigger2 >= 2  || mtrigger1 >= 1  || mtrigger2  >= 2 || new_MET_et >= METcut ) {
-
-// apply an anti-btag on events containing a jet
-	     int btagOK=1;
-	     for(int l=0; l<Jet_N; l++) {
-	       if ((*Jet_BTagged)[l] == 1) {
-		 btagOK=0;}
-	     }
-	   
-	     if (btagOK == 0) {reject_btag++;}
-	     if (btagOK == 1) {
-	     
-// done with selection
-	       found++;
-
-	       px1  = -999.;
-	       py1  = -999.;
-	       pz1  = -999.;
-	       pt1  = -999.;
-	       eta1 = -999.;
-	       Cone1= -999.;
-	       px2  = -999.;
-	       py2  = -999.;
-	       pz2  = -999.;
-	       pt2  = -999.;
-	       eta2 = -999.;
-	       Cone2= -999.;
-
-// reload info on the best pair of leptons
-	       if (abs(bestid) == 11 ) {
-		 px1  = (*El_px)[bestj];
-		 py1  = (*El_py)[bestj];
-		 pz1  = (*El_pz)[bestj];
-		 pt1  = (*El_p_T)[bestj];
-		 eta1 = (*El_eta)[bestj];
-		 Cone1= float((*El_trEtCone10)[bestj]);
-		 px2  = (*El_px)[bestk];
-		 py2  = (*El_py)[bestk];
-		 pz2  = (*El_pz)[bestk];
-		 pt2  = (*El_p_T)[bestk];
-		 eta2 = (*El_eta)[bestk];
-		 Cone2= float((*El_trEtCone10)[bestk]);
-	       }
-	       if (abs(bestid) == 13) {
-		 px1  = (*Mu_px)[bestj];
-		 py1  = (*Mu_py)[bestj];
-		 pz1  = (*Mu_pz)[bestj];
-		 pt1  = (*Mu_p_T)[bestj];
-		 eta1 = (*Mu_eta)[bestj];
-		 Cone1= float((*Mu_trEtCone10)[bestj]);
-		 px2  = (*Mu_px)[bestk];
-		 py2  = (*Mu_py)[bestk];
-		 pz2  = (*Mu_pz)[bestk];
-		 pt2  = (*Mu_p_T)[bestk];
-		 eta2 = (*Mu_eta)[bestk];
-		 Cone2= float((*Mu_trEtCone10)[bestk]);
-	       }
-// calculate a few more variables for likelihood function for the best lepton pair
-	       double px = px1+px2;
-	       double py = py1+py2;
-	       modulus = sqrt(px1*px1 + py1*py1 + pz1*pz1) * sqrt(px2*px2 + py2*py2 + pz2*pz2);
-	       cosll3D = (px1*px2 +py1*py2 + pz1*pz2)/ modulus;
-	       if (abs(cosll3D) > 1.0 ) {cout << "cosll3d > 1: " << "\t " << cosll3D << "\t " << px1 << "\t " 
-					      << pz1 << "\t " << py1 << "\t " << px2 << "\t " << py2 << "\t " << pz2 << "\t " << modulus << endl;}
-	       modulus = sqrt(px1*px1 + py1*py1) * sqrt(px2*px2 + py2*py2);
-	       cosll2D = (px1*px2 + py1*py2)/ modulus;
-	       if (abs(cosll2D) > 1.0 ) {cout << "cosll2d > 1: " << "\t " << cosll2D << "\t " << px1 << "\t " 
-					      << py1 << "\t " << px2 << "\t " << py2 << "\t " << modulus << endl;}
-	       pt2l    = sqrt(px*px + py*py);
-	       
-// calculate the angle between MET_RefFinal_Et and PtZ 
-	       cosPhi  = (px*new_MET_ex + py*new_MET_ey)/(pt2l*new_MET_et);
-
-// calculate the transverse mass
-	       mt      = sqrt(2.0*pt2l*new_MET_et*(1.0-cosPhi));
-
-// calculate cosJetMET: cosine between promptest jet and MET direction in transverse plane
-	       cosjetmet = 1.1;
-	       if (Jet_N > 0) cosjetmet = float(((*Jet_px)[0]*new_MET_ex + (*Jet_py)[0]*new_MET_ey)/((*Jet_p_T)[0]*new_MET_et));
-		   
-// select the promptest lepton for this last variable
-	       if (pt1 >= pt2)  {PX=px1; PY=py1; PT=pt1;}
-	       if (pt1 <  pt2)  {PX=px2; PY=py2; PT=pt2;}
-	     
-	       cosptlepMET = (PX*new_MET_ex +PY*new_MET_ey)/ (PT * new_MET_et);
-
-// fill the jet info
-	       ejet1 = -99.99;
-	       ejet2 = -99.99;
-	       ejet3 = -99.99;
-	       
-	       njet = Jet_N;
-// add info on the 3 most energetic jets
-	       if (njet > 0) ejet1 = (*Jet_E)[0]/1000.;
-	       if (njet > 1) ejet2 = (*Jet_E)[1]/1000.;
-	       if (njet > 2) ejet3 = (*Jet_E)[2]/1000.;
-	       
-	       ptlep1 = float(pt1);
-	       ptlep2 = float(pt2);
-	       cone1 = float(Cone1);
-	       cone2 = float(Cone2);
-	       lepID = abs(bestid);
-	       ptZ0 = pt2l;
-	       massZ = float(mZ);
-	       cosll2d = float(cosll2D);
-	       cosll3d = float(cosll3D);
-	       cosJetMET = float(cosjetmet);
-	       mT = float(mt);
-	       MET = float(new_MET_et);
-	       cosMETptlep = float(cosptlepMET);
-	       cosphi = float(cosPhi);
-	       
-	       runnum = EVRunNumber;
-	       evtnum  = EVEventAndInstance/100;
-	       w      = float(weight);
-	     
-// // fill the preselection tree from the values calculated above
-	       type = typeNumber;
-	       treeB.Fill();
-
-// fill the histograms
-	       hptlep1->Fill(pt1,weight);
-	       hptlep2->Fill(pt2,weight);
-	       hcosll2D->Fill(cosll2D,weight);
-	       hcosll3D->Fill(cosll3D,weight);
-	       //	       hMET->Fill(MET,weight);
-	       hmt->Fill(mt,weight);
-	       hcosMETPtlep->Fill(cosMETptlep,weight);
-	       hmZll->Fill(massZ,weight);
-	       hcosphi->Fill(cosphi,weight);
-	       hnjet->Fill(njet,weight);
-	       hcone1->Fill(cone1,weight);
-	       hcone2->Fill(cone2,weight);
-	       hejet1->Fill(ejet1,weight);
-	       hejet2->Fill(ejet2,weight);
-	       hejet3->Fill(ejet3,weight);
-	       hcosJetMET->Fill(cosJetMET,weight);
-	       hnel->Fill(nel,weight);
-	       hnmu->Fill(nmu,weight);
-	       hnlep->Fill(nlep,weight);
-	       hlepid->Fill(lepID,weight);
-
-	     
-	     } // end if on btag
-	   } // end on METcut
-	 } // end if on "trigger cuts" at AOD level
-       } // end if on nlep > nlepcut
-     } // end if on finding 2 Z
-   } // end on trigger cut   
- } // end of for loop over events   
-  
-outClientFile << "              " << endl;
-outClientFile << "Cut flow for: " << eventType << endl;
-outClientFile << "-----------------------------------------------------------" << endl;
-outClientFile << nrec << " records found in the chain. "<< endl;
-       
-cout << endl;
-cout << "METcut " << METcut << endl;
-cout << "pt cuts for leptons: e > " << eptmin << " and mu: " << mptmin << " GeV and eta < " << etamin << endl;	  
-cout << "nlep strictly equal to "<< nlepcut << " of the same flavor" << endl; 
-cout << "mZ within " <<  mZcut << " GeV of on-shell mass " << endl;
-cout << "total # of selected events in file: \t" << found << endl;	  
-cout << endl;
-cout << "Cut flow for: " << eventType << endl;
- cout << "-----------------------------------------------------------" << endl;
-cout << nrec << " records found in the chain. "<< endl;
-cout << endl;
-
-passed = nrec;
-totalRejected = (reject_MET + reject_nlep + reject_trigger  + reject_AODtrigger  + reject_2Z  + reject_btag); 
-
-int places = 2;
-cout <<fixed;                 
-cout.precision(places);
-
- cout << "  " << endl;
- outClientFile << "  " << endl;
-
- cout << "epair " << "\t" << "reject_masse" << "\t" << "mpair" << "\t" << "reject_massm" << endl; 
- cout << epair  << "\t" << reject_masse << "\t" << mpair << "\t" << reject_massm << endl; 
-
-cout << "                                   " <<   endl;
-cout << "                                   " << " reweighted \t"   << "raw # \t"   << "\t  percentage"    <<   endl;
-cout << "Events at 30 fb-1                  " << lumi*sigmaBR   <<"\t" << generated <<"\t" <<  100.*(generated/generated)<< "%" << endl;
-cout << "Events after filter:               " << weight*passed <<"\t" << passed  <<"\t" <<  100.*(passed/generated)<< "%" << endl;
-float temp = passed;
-passed = (passed - reject_trigger);
-cout << "Events after trigger:              " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_2Z);
-cout << "Events after 2Z cut:               " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_nlep);
-cout << "Events after 2 high pt lepton cut: " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_MET);
-cout << "Events after MET cut               " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_AODtrigger);
-cout << "Events after AOD trigger cut       " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_btag);
-cout << "Events after b-tag cut:            " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-Total = passed*weight; 
-cout << endl;
-cout << "Total rejected (reweighted):  " << lumi*sigmaBR - weight*passed << " out of " << generated*weight << endl;
-cout << "Total rejected (raw)       :  " << generated - passed << " out of " << generated<< endl;
-cout << "Fraction retained          :  " << 100.*(passed/generated) << "% " << endl;
-places = 5;
-cout.precision(places);
-cout << endl;
-cout << "Events weight of " << weight << endl;
-cout << " "<< endl;
-cout <<fixed;                 
-places = 2;
-cout.precision(places);
-
-passed = nrec;
-
-outClientFile << "                         " <<   endl;
-outClientFile <<fixed;                 
-outClientFile.precision(places);
-outClientFile << "                         " << " reweighted \t"   << "raw # \t"   << "\t  percentage"    <<   endl;
-outClientFile << "Events at 30 fb-1         " << lumi*sigmaBR   <<"\t" << generated <<"\t" <<  100.*(generated/generated)<< "%" << endl;
-outClientFile << "Events after filter:      " << weight*passed <<"\t" << passed      <<"\t" <<  100.*(passed/generated)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_trigger);
-outClientFile << "Events after trigger:              " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_2Z);
-outClientFile << "Events after 2Z cut:               " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_nlep);
-outClientFile << "Events after 2 high pt lepton cut: " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_MET);
-outClientFile << "Events after MET cut               " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_AODtrigger);
-outClientFile << "Events after AOD trigger cut       " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-temp = passed;
-passed = (passed - reject_btag);
-outClientFile << "Events after b-tag cut:            " << weight*passed <<"\t" << passed <<"\t" <<  100.*(passed/generated)<< "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-Total = passed*weight; 
-outClientFile << endl;
-outClientFile << "Total rejected (reweighted):  " << lumi*sigmaBR - weight*passed << " out of " << generated*weight << endl;
-outClientFile << "Total rejected (raw)       :  " << generated - passed << " out of " << generated<< endl;
-outClientFile << "Fraction retained          :  " << 100.*(passed/generated) << "% " << endl;
-places = 5;
-outClientFile.precision(places);
-outClientFile << endl;
-outClientFile << "Events weight of " << weight << endl;
-outClientFile << " "<< endl;
-outClientFile <<fixed;                 
-places = 2;
-outClientFile.precision(places);
-
-hs1.SetMinimum(1);
-hs2.SetMinimum(1);
-hs3.SetMinimum(1);
-hs4.SetMinimum(1);
-hs5.SetMinimum(1);
-hs6.SetMinimum(1);
-hs7.SetMinimum(1);
-hs8.SetMinimum(1);
-hs9.SetMinimum(1);
-hs10.SetMinimum(1);
-hs11.SetMinimum(1);
-hs12.SetMinimum(1);
-hs13.SetMinimum(1);
-hs14.SetMinimum(1);
-hs15.SetMinimum(1);
-hs16.SetMinimum(1);
-
-TLegend *leg1 = new TLegend(0.6, 0.6, 0.9, 0.95);
-TLegend *leg2 = new TLegend(0.6, 0.6, 0.9, 0.95);
-TLegend *leg3 = new TLegend(0.6, 0.6, 0.9, 0.95);
-TLegend *leg4 = new TLegend(0.65, 0.6, 0.9, 0.95);
-TLegend *leg5 = new TLegend(0.65, 0.6, 0.9, 0.95);
-
-   c3->cd();
-   hs1.Add(hptlep1);
-   pad33->cd(); 
-   //   pad33->SetLogy(1);
-   hs1.Draw();
-   hs1.Draw();
-   leg3->AddEntry(hptlep1, "  ZZ #rightarrow l l l l", "f"); 
-   leg3->Draw();
-
-   hs2.Add(hptlep2);
-   pad34->cd(); 
-   //  pad34->SetLogy(1);
-   hs2.Draw();
-   hs2.Draw();
-
-   hs3.Add(hcosll2D);
-   pad31->cd(); 
-   //   pad31->SetLogy(1);
-   hs3.Draw();
-   hs3.Draw();
-
-   hs4.Add(hcosll3D);
-   pad32->cd(); 
-   //   pad32->SetLogy(1);
-   hs4.Draw();
-   hs4.Draw();
-
-   c2->cd();
-   hs5.Add(hMET);
-   pad23->cd(); 
-   //   pad24->SetLogy(1);
-   hs5.Draw();
-   hs5.Draw();
-   leg2->AddEntry(hptlep1, "  ZZ #rightarrow l l l l", "f"); 
-   leg2->Draw();
-
-   hs6.Add(hmt);
-   pad24->cd(); 
-   //   pad24->SetLogy(1);
-   hs6.Draw();
-   hs6.Draw();
-
-   hs7.Add(hcosMETPtlep);
-   pad21->cd(); 
-   //   pad21->SetLogy(1);
-   hs7.Draw();
-   hs7.Draw();
-
-   hs8.Add(hmZll);
-   pad22->cd(); 
-   //   pad22->SetLogy(1);
-   hs8.Draw();
-   hs8.Draw();
-
-   c4->cd();
-   hs9.Add(hcosphi);
-   pad43->cd(); 
-   //   pad43->SetLogy(1);
-   hs9.Draw();
-   hs9.Draw();
-   leg4->AddEntry(hptlep1, "  ZZ #rightarrow l l l l", "f"); 
-   leg4->Draw();
-
-   hs10.Add(hcosJetMET);
-   pad44->cd(); 
-   //   pad44->SetLogy(1);
-   hs10.Draw();
-   hs10.Draw();
-
-   hs11.Add(hcone1);
-   pad41->cd(); 
-   //   pad41->SetLogy(1);
-   hs11.Draw();
-   hs11.Draw();
-
-   hs12.Add(hcone2);
-   pad42->cd(); 
-   //   pad42->SetLogy(1);
-   hs12.Draw();
-   hs12.Draw();
-
-   c5->cd();
-   hs13.Add(hejet1);
-   pad53->cd(); 
-   //   pad53->SetLogy(1);
-   hs13.Draw();
-   hs13.Draw();
-
-   hs14.Add(hejet2);
-   pad54->cd(); 
-   //   pad54->SetLogy(1);
-   hs14.Draw();
-   hs14.Draw();
-
-   hs15.Add(hejet3);
-   pad51->cd(); 
-   //   pad51->SetLogy(1);
-   hs15.Draw();
-   hs15.Draw();
-
-   hs16.Add(hnjet);
-   pad52->cd(); 
-   //   pad52->SetLogy(1);
-   hs16.Draw();
-   hs16.Draw();
-   leg5->AddEntry(hptlep1, "  ZZ #rightarrow l l l l", "f"); 
-   leg5->Draw();
-
-   c1->cd();
-   hs17.Add(hnel);
-   pad13->cd(); 
-   hs17.Draw();
-   hs17.Draw();
-   leg1->AddEntry(hptlep1, "  ZZ #rightarrow l l l l", "f"); 
-   leg1->Draw();
-
-   hs18.Add(hnmu);
-   pad14->cd(); 
-   hs18.Draw();
-   hs18.Draw();
-
-   hs19.Add(hnlep);
-   pad11->cd(); 
-   hs19.Draw();
-   hs19.Draw();
-
-   hs20.Add(hlepid);
-   pad12->cd(); 
-   hs20.Draw();
-   hs20.Draw();
-
-   //----------------------------------
-   //insert EVmva.C here
-
-   srand(seed);  // for a fixed start
-
-  int counter = 0;
-  typeNumber = 0;
-  generated = 0.0;
-  
-  eventType = ("HZ130");
-  sigmaBR = 0.0359;
-  filterEff = 0.754;
-  
-// mH = 130 GeV
-  sigmaBR = 0.0359;
-  filterEff = 0.754;
-
-  lumi = 30000.0;
-  
-  // cuts for AOD 
-  mZcut    = 20.;
-  
-  modulus =0.;
-  cosll2D = 0.;
-  cosll3D = 0.;
-  cosPhi = 0.;
-  cosptlepMET = 0.;
-  mt = 0.;
-  pt2l = 0.;
-  PX = 0.;
-  PY = 0.;
-  PT = 0.;
-  
-  ptZ0 = 0.;
-  eta1 = 0.;
-  Cone1 = 0.;
-  pt1 = 0.;
-  px1 = 0.;
-  py1 = 0.;
-  pz1 = 0.;
-  eta2 = 0.;
-  Cone2 = 0.;
-  px2 = 0.;
-  py2 = 0.;
-  pz2 = 0.;
-  pt2 = 0.;
-  cosjetmet = 0.;
-  
-  nb=0;
-  last_rec=0;
-  
-  nlep = 0;
-  nel = 0;;
-  nmu = 0;
-  ejet1 = 0.0;
-  ejet2 = 0.0;
-  ejet3 = 0.0;
-  
-  
-  // -----------------------------------------------------------
-  // ----------- loop over the various datasets ----------
-  // -----------------------------------------------------------
-    reject_MET =0.;
-    reject_nlep =0.;
-    reject_trigger =0.;
-    reject_leppid =0.;
-    double reject_mZ =0.;
-    reject_btag =0.;
-    totalRejected =0.;
-  
-  // loop over all datasets
-    found=0;
-    TRandom * random = new TRandom3(seed);
-
-    
-    /***************** Getting file/tree from disk *********************/
-    // We define chain, which is basically a tree to add root files with the
-    // same tree name.  If you have two or more files, keep adding in the 
-    // nfchain variable.
-    
-    chain=0;
-    
-#ifdef CHAIN
-    chain = new TChain("EV0");
-    nfchain=0;
-    
-    // HZ130 sample - 50k filtered events
-       nfchain += chain->Add("/data/ntuples/HZ130_ntuple.root");
-    
-    
-       EVEventAndInstance = 0;
-       EVRunNumber = 0;
-    
-       MET_RefFinal_ex = 0.0;
-       MET_RefFinal_ey = 0.0;
-       MET_RefFinal_et = 0.0;
-    
-       MET_Truth_et = 0.0;
-    
-       El_N = 0;
-       TEl_N = 0;
-       Mu_N = 0;
-       TMu_N = 0;
-       Jet_N = 0;
- 
-    // extract the trigger info
-       PassedL1 = false;
-       PassedL2 = false;
-       PassedEF= false;
-       PassedTrigger= false;
-       PassedL1_EM25I= false;
-       PassedL1_2EM15I= false;
-    
-       PassedL1_MU06= false;
-       PassedL1_MU08= false;
-       PassedL1_MU10= false;
-       PassedL1_MU11= false;
-       PassedL1_MU20= false;
-       PassedL1_MU40= false;
-       PassedL1_2MU06= false;
-    
-       PassedL1_XE100= false;
-       PassedL1_XE50= false;
-    
-       PassedL2_e25i= false;
-       PassedL2_mu6= false;
-       PassedL2_mu6l= false;
-       PassedL2_mu20i= false;
-    
-       PassedEF_e10= false;
-       PassedEF_e15iEF_e15i= false;
-       PassedEF_e25i= false;
-       PassedEF_mu6= false;
-       PassedEF_mu6l= false;
-       PassedEF_mu20i= false;
-    
-       TrigEFMissingET_et = 0.0;
-    
-       Z_N = 0;
-    
-    chain->SetBranchAddress("EVEventAndInstance",  &EVEventAndInstance);
-    chain->SetBranchAddress("EVRunNumber", &EVRunNumber);
-    
-    chain->SetBranchAddress("MET_RefFinal_ex", &MET_RefFinal_ex);
-    chain->SetBranchAddress("MET_RefFinal_ey", &MET_RefFinal_ey);
-    chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-    
-    chain->SetBranchAddress("MET_RefFinal_et", &MET_RefFinal_et);
-    
-    chain->SetBranchAddress("MET_Truth_et", &MET_Truth_et);
-    
-    chain->SetBranchAddress("El_N",&El_N);
-    chain->SetBranchAddress("El_px",&El_px);
-    chain->SetBranchAddress("El_py",&El_py);
-    chain->SetBranchAddress("El_pz",&El_pz);
-    chain->SetBranchAddress("El_p_T",&El_p_T);
-    chain->SetBranchAddress("El_eta",&El_eta);
-    chain->SetBranchAddress("El_pdgId",&El_pdgId);
-    chain->SetBranchAddress("El_isEM",&El_isEM);
-    chain->SetBranchAddress("El_author",&El_author);
-    chain->SetBranchAddress("El_trEtCone10",&El_trEtCone10);
-    
-    chain->SetBranchAddress("TEl_N",&TEl_N);
-    chain->SetBranchAddress("TEl_p_T",&TEl_p_T);
-    chain->SetBranchAddress("TEl_eta",&TEl_eta);
-    
-    chain->SetBranchAddress("Mu_N",&Mu_N);
-    chain->SetBranchAddress("Mu_px",&Mu_px);
-    chain->SetBranchAddress("Mu_py",&Mu_py);
-    chain->SetBranchAddress("Mu_pz",&Mu_pz);
-    chain->SetBranchAddress("Mu_p_T",&Mu_p_T);
-    chain->SetBranchAddress("Mu_eta",&Mu_eta);
-    chain->SetBranchAddress("Mu_pdgId",&Mu_pdgId);
-    chain->SetBranchAddress("Mu_isCombinedMuon",&Mu_isCombinedMuon);
-    chain->SetBranchAddress("Mu_bestMatch",&Mu_bestMatch);
-    chain->SetBranchAddress("Mu_trEtCone10",&Mu_trEtCone10);
-    
-    chain->SetBranchAddress("TMu_N",&TMu_N);
-    chain->SetBranchAddress("TMu_p_T",&TMu_p_T);
-    chain->SetBranchAddress("TMu_eta",&TMu_eta);
-    
-    chain->SetBranchAddress("Jet_N",&Jet_N);
-    chain->SetBranchAddress("Jet_eta",&Jet_eta);
-    chain->SetBranchAddress("Jet_E",&Jet_E);
-    chain->SetBranchAddress("Jet_px",&Jet_px);
-    chain->SetBranchAddress("Jet_py",&Jet_py);
-    chain->SetBranchAddress("Jet_p_T",&Jet_p_T);
-    chain->SetBranchAddress("Jet_BTagged",&Jet_BTagged);
-    
-    chain->SetBranchAddress("PassedL1",&PassedL1);
-    chain->SetBranchAddress("PassedL2",&PassedL2);
-    chain->SetBranchAddress("PassedEF",&PassedEF);
-    chain->SetBranchAddress("PassedTrigger",&PassedTrigger);
-    
-    chain->SetBranchAddress("PassedL1_EM25I",&PassedL1_EM25I);
-    chain->SetBranchAddress("PassedL1_2EM15I",&PassedL1_2EM15I);
-    
-    chain->SetBranchAddress("PassedL1_MU06",&PassedL1_MU06);
-    chain->SetBranchAddress("PassedL1_MU08",&PassedL1_MU08);
-    chain->SetBranchAddress("PassedL1_MU10",&PassedL1_MU10);
-    chain->SetBranchAddress("PassedL1_MU11",&PassedL1_MU11);
-    chain->SetBranchAddress("PassedL1_MU20",&PassedL1_MU20);
-    chain->SetBranchAddress("PassedL1_MU40",&PassedL1_MU40);
-    chain->SetBranchAddress("PassedL1_2MU06",&PassedL1_2MU06);
-    
-    chain->SetBranchAddress("PassedL1_XE100",&PassedL1_XE100);
-    chain->SetBranchAddress("PassedL1_XE50",&PassedL1_XE50);
-    
-    chain->SetBranchAddress("PassedL2_e25i",&PassedL2_e25i);
-    chain->SetBranchAddress("PassedL2_mu6",&PassedL2_mu6);
-    chain->SetBranchAddress("PassedL2_mu6l",&PassedL2_mu6l);
-    chain->SetBranchAddress("PassedL2_mu20i",&PassedL2_mu20i);
-    
-    chain->SetBranchAddress("PassedEF_e10",&PassedEF_e10);
-    chain->SetBranchAddress("PassedEF_e15iEF_e15i",&PassedEF_e15iEF_e15i);
-    chain->SetBranchAddress("PassedEF_e25i",&PassedEF_e25i);
-    chain->SetBranchAddress("PassedEF_mu6",&PassedEF_mu6);
-    chain->SetBranchAddress("PassedEF_mu6l",&PassedEF_mu6l);
-    chain->SetBranchAddress("PassedEF_mu20i",&PassedEF_mu20i);
-    
-    chain->SetBranchAddress("TrigEFMissingET_et",&TrigEFMissingET_et);
-    
-    chain->SetBranchAddress("Z_N",&Z_N);
-    chain->SetBranchAddress("Z_Zee",&Z_Zee);
-    chain->SetBranchAddress("Z_Zmm",&Z_Zmm);
-
-    nrecords = static_cast<int>(0.5 + chain->GetEntries());
-    
-    nticker  = static_cast<int>(0.5 + nrecords/20.0);
-    
-    nrec = nrecords;
-    
-    // The above is to find the number of events or entries
-#endif // CHAIN 
-    
-      outClientFile << "      " <<  endl;
-      outClientFile << "MET cut > " << METcut << endl;
-      outClientFile << "pt cuts for leptons: e > " << eptmin << " and mu > " << mptmin <<" GeV with eta < " << etamin << endl;
-      outClientFile << "nlep strictly equal to " << nlepcut << endl; //" and njet less or equal to " << njetcut << endl;	 	   
-      outClientFile << "mZ within " << mZcut << " GeV of on-shell mass " << endl;
-      outClientFile << endl;	  
-    
-    mZ = 0.;
-    
-    // evaluate the weight for this type of events
-    generated = nrec/filterEff; 
-    cout << eventType << " generated: " << generated << " nrec: " << nrec << endl;
-    weight = (sigmaBR * lumi)/generated;
-
-    // ============  Starting the main loop over the events  ===============
-
-    for (int i=0; i<nrec; i++) {  
-      
-      if(div(i, nticker).rem == 0 || i >= nrec-1) 
-	{ 
-	  portion=static_cast<float>(i) / static_cast<float>(nrec-1);
-	  printf("Done %4.1f percent of reading the NTuple  ", portion*100.0);
-	  cout.flush();   cout << char(13);  
-	}
-      
-      last_rec=(i>=nrec-1); 
-      
-      if(!last_rec)  {
-#ifdef CHAIN
-	nb += chain->GetEvent(i+1); // Getting one event at a time
-#else   /* Not CHAIN */ 
-	nb += readtree->GetEvent(i+1);
-#endif   /* CHAIN */ // The next record has been read for comparison
-      }
-      
-      // Reading the i-th (current) record:
-      
-#ifdef CHAIN
-      nb += chain->GetEvent(i); 
-#else   /* Not CHAIN */ 
-      nb += readtree->GetEvent(i);
-#endif   /* CHAIN */
-      
-      int accepted_e = 0;
-      double Zmasse[25];
-      int elep1[25];
-      int elep2[25];
-      
-      int accepted_m = 0;
-      double Zmassm[25];
-      int mlep1[25];
-      int mlep2[25];
-      
-      int bestj = 0;
-      int bestk = 0;
-      int bestid = 0;
-
-      //loop over all electrons and count the good ones
-
-      nel = 0;
-      for(int j=0; j<El_N; j++) {
-	if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-	  nel++;
-	}}
-      
-      //loop over all pairs of muons and only select the good ones
-      nmu = 0;
-      for(int j=0; j<Mu_N; j++) {
-	if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-	  nmu++;
-	}}
-      
-      // store the total number of good leptons
-      nlep = nel + nmu;
-      
-      MET_RefFinal_ex /=1000.;
-      MET_RefFinal_ey /=1000.; 
-      MET_RefFinal_et /=1000.;
-      
-      MET_Truth_et /=1000.;
-
-// unsmeared electrons
-      for(int j=0; j<El_N; j++) {
-	(*El_px)[j] /= 1000.;
-	(*El_py)[j] /= 1000.;
-	(*El_pz)[j] /= 1000.;
-	(*El_p_T)[j] /= 1000.;
-	(*El_trEtCone10)[j] /= 1000.;
-      }
-
-// unsmeared muons
-      for(int j=0; j<Mu_N; j++) {
-	(*Mu_px)[j] /= 1000.;
-	(*Mu_py)[j] /= 1000.;
-	(*Mu_pz)[j] /= 1000.;
-	(*Mu_p_T)[j] /= 1000.;
-	(*Mu_trEtCone10)[j] /= 1000.;
-      }
-
-// unsmeared jets
-      for(int j=0; j<Jet_N; j++) {
-	(*Jet_px)[j] /= 1000.;
-	(*Jet_py)[j] /= 1000.;
-	(*Jet_p_T)[j] /= 1000.;
-	(*Jet_E)[j] /= 1000.;
-      }
-
-   for(int j=0; j<El_N; j++) {
-     (*TEl_p_T)[j] /= 1000.;
-   }
-   for(int j=0; j<Mu_N; j++) {
-     (*TMu_p_T)[j] /= 1000.;
-   }
-      
-   if (!PassedEF_e15iEF_e15i && !PassedEF_e25i && !PassedEF_mu6 && !PassedEF_mu6l && !PassedEF_mu20i && !PassedL1_XE100) {
-     reject_trigger++;}
-   if (PassedEF_e15iEF_e15i || PassedEF_e25i || PassedEF_mu6 || PassedEF_mu6l || PassedEF_mu20i || PassedL1_XE100) {
-     
-	if (MET_RefFinal_et < METcut) reject_MET++;
-	if (MET_RefFinal_et >= METcut) {
-	  
-	  int twoelectrons=0;
-	  //loop over all pairs of electrons 
-	  for(int j=0; j<El_N-1; j++) {
-	    if (fabs((*El_eta)[j]) <= etamin && (*El_p_T)[j] > eptmin && ((*El_isEM)[j]&0x7)==0) {
-	      for(int k=j+1; k<El_N; k++) {
-		if (fabs((*El_eta)[k]) <= etamin && (*El_p_T)[k] > eptmin && ((*El_isEM)[k]&0x7)==0) {
-		  	
-	  //lepid cut
-		  //	       if((*El_pdgId)[j] != -(*El_pdgId)[k]) {cout << "electron id: " << (*El_pdgId)[j] << "\t" << (*El_pdgId)[k] << endl;}
-		  if((*El_pdgId)[j] == -(*El_pdgId)[k]) {
-		    twoelectrons=1;
-		    
-		    px1 = (*El_px)[j];
-		    py1 = (*El_py)[j];
-		    pz1 = (*El_pz)[j];
-		    pt1 = (*El_p_T)[j];
-		    eta1 = (*El_eta)[j];
-		    px2 = (*El_px)[k];
-		    py2 = (*El_py)[k];
-		    pz2 = (*El_pz)[k];
-		    pt2 = (*El_p_T)[k];
-		    eta2 = (*El_eta)[k];
-		    
-		    // calculate the Z invariant mass 
-		    double px = px1+px2;
-		    double py = py1+py2;
-		    double pz = pz1+pz2;
-		    double pZ = px*px +py*py +pz*pz;
-		    double ml = mass_e;
-		    double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-		    double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-		    double eZ = sqrt(e1) + sqrt(e2);
-		    mZ = eZ*eZ - pZ;
-		    if (mZ > 0.0) {mZ = sqrt(mZ);}
-		    else {mZ = -1.0;}
-// 		    if (typeNumber == 6 && counter < 10) cout << "mZ = " << mZ << endl;
-// 		    if (typeNumber == 6) counter++;
-		    
-		    //count the number of accepted pairs
-		    //		 cout << "reconstructed mZ = " << mZ << endl;
-		    if (abs(mZ - mZ0) <= mZcut) {
-		      
-		      if (accepted_e > 24) {cout << " too many accepted_e pairs, stop!!! accepted_e = " << accepted_e << endl;exit(-1);}
-		      Zmasse[accepted_e] = mZ;
-		      elep1[accepted_e]  = j;
-		      elep2[accepted_e]  = k;
-		      accepted_e++;}
-		    
-		  } //  end-if on lepid
-		} // end if acceptance criteria for second electron
-	      } // end of for-loop on second electron
-	    } // end if acceptance criteria for first electron
-	  } // end of for-loop on first electron
-	  
-	  
-	  //loop over all pairs of muons 
-	  int twomuons = 0;
-	  for(int j=0; j<Mu_N-1; j++) {
-	    if (fabs((*Mu_eta)[j]) <= etamin && (*Mu_p_T)[j] > mptmin && (*Mu_isCombinedMuon)[j] == 1 && (*Mu_bestMatch)[j] == 1) {
-	      for(int k=j+1; k<Mu_N; k++) {
-		if (fabs((*Mu_eta)[k]) <= etamin && (*Mu_p_T)[k] > mptmin && (*Mu_isCombinedMuon)[k] == 1 && (*Mu_bestMatch)[k] == 1) {
-		  
-		  //lepid cut
-		  if((*Mu_pdgId)[j] == -(*Mu_pdgId)[k]) {
-		    twomuons = 1;
-		    px1 =  (*Mu_px)[j];
-		    py1 =  (*Mu_py)[j];
-		    pz1 =  (*Mu_pz)[j];
-		    pt1 =  (*Mu_p_T)[j];
-		    eta1 = (*Mu_eta)[j];
-		    px2 =  (*Mu_px)[k];
-		    py2 =  (*Mu_py)[k];
-		    pz2 =  (*Mu_pz)[k];
-		    pt2 =  (*Mu_p_T)[k];
-		    eta2 = (*Mu_eta)[k];
-		    
-		    // calculate the Z invariant mass 
-		    double px = px1+px2;
-		    double py = py1+py2;
-		    double pz = pz1+pz2;
-		    double pZ = px*px +py*py +pz*pz;
-		    double ml = mass_mu;
-		    double e1 = ml*ml + px1*px1 +py1*py1 +pz1*pz1;
-		    double e2 = ml*ml + px2*px2 +py2*py2 +pz2*pz2;
-		    double eZ = sqrt(e1) + sqrt(e2);
-		    mZ = eZ*eZ - pZ;
-		    if (mZ > 0.0) {mZ = sqrt(mZ);}
-		    else {mZ = -1.0;}
-
-// add a Breit-Wigner distribution to ZW events
-
-		    if (typeNumber == 6) {
-		      double mZmean = mZ;
-		      double mZwidth = 2.4952;
-		      mZ = random->BreitWigner(mZmean, mZwidth);
-		      //		      if (counter < 10) cout << "mZ = " << mZ << endl;
-		      counter++;
-		    }
-		    
-		    //count the number of accepted_m pairs
-		    //		 cout << "reconstructed mZ = " << mZ << endl;
-		    if (abs(mZ - mZ0) <= mZcut) {
-		      
-		      if (accepted_m > 24) {cout << " too many accepted_m pairs, stop!!! accepted_m = " << accepted_m << endl;exit(-1);}
-		      Zmassm[accepted_m] = mZ;
-		      mlep1[accepted_m]  = j;
-		      mlep2[accepted_m]  = k;
-		      accepted_m++;}
-		    
-		  } //  end-if on lepid
-		} // end if acceptance criteria for second muon
-	      } // end of for-loop on second muon
-	    } // end if acceptance criteria for first muon
-	  } // end of for-loop on first muon
-	  
-	  //	   cout << "found " << electrons << " good electrons and  " << nmu << " good muons  "<< endl;
-	  
-	  // nlepcut
-	  if ((twoelectrons == 0 && twomuons == 0) || nlep != 2) {
-	    reject_nlep++;}
-	  
-	  if ((twoelectrons == 1 || twomuons == 1) && nlep == 2) {
-	    
-	    //         afterNlep++;
-	    
-	    // continue only when a good pair has been found
-	    if (accepted_m == 0 && accepted_e == 0 ) {reject_mZ++;;}
-	    if (accepted_m+accepted_e > 0) {
-	      if (nlep == 1) cout << "nlep == 1 and nmu = " << nmu << " nmel :" << nel << " accepted_mu = " << accepted_m << endl;  
-	      
-	      
-	      //	   afterMz++;
-	      //retain only the best pair
-	      mZ=0.;
-	      for (int m=0; m<accepted_e; m++) {
-		mZ = (( abs(mZ0 - mZ) < abs(mZ0 - Zmasse[m])) ? mZ : Zmasse[m]);
-		if (mZ == Zmasse[m]) {bestj = elep1[m]; bestk = elep2[m]; bestid=11;}
-	      }
-	      for (int m=0; m<accepted_m; m++) {
-		mZ = (( abs(mZ0 - mZ) < abs(mZ0 - Zmassm[m])) ? mZ : Zmassm[m]);
-		if (mZ == Zmassm[m]) {bestj = mlep1[m]; bestk = mlep2[m]; bestid=13;}
-	      }
-	      
-	      // apply an anti-btag on events containing a jet
-
-	      int btagOK=1;
-	      for(int l=0; l<Jet_N; l++) {
-		//	     cout << (*Jet_BTagged)[l] << endl;
-		if ((*Jet_BTagged)[l] == 1) {
-		  //   	       cout << "(*Jet_BTagged)[l]: " << (*Jet_BTagged)[l] << endl;
-		  btagOK=0;}
-	      }
-	      
-	      if (btagOK == 0) {reject_btag++;}
-	      if (btagOK == 1) {
-		
-		// done with selection
-		found++;
-		
-		px1  = -999.;
-		py1  = -999.;
-		pz1  = -999.;
-		pt1  = -999.;
-		eta1 = -999.;
-		Cone1= -999.;
-		px2  = -999.;
-		py2  = -999.;
-		pz2  = -999.;
-		pt2  = -999.;
-		eta2 = -999.;
-		Cone2= -999.;
-		
-		// reload info on the best pair of leptons
-		if (abs(bestid) == 11) {
-		  px1  = (*El_px)[bestj];
-		  py1  = (*El_py)[bestj];
-		  pz1  = (*El_pz)[bestj];
-		  pt1  = (*El_p_T)[bestj];
-		  eta1 = (*El_eta)[bestj];
-		  Cone1= float((*El_trEtCone10)[bestj]);
-		  px2  = (*El_px)[bestk];
-		  py2  = (*El_py)[bestk];
-		  pz2  = (*El_pz)[bestk];
-		  pt2  = (*El_p_T)[bestk];
-		  eta2 = (*El_eta)[bestk];
-		  Cone2= float((*El_trEtCone10)[bestk]);
-		}
-		if (abs(bestid) == 13) {
-		  px1  = (*Mu_px)[bestj];
-		  py1  = (*Mu_py)[bestj];
-		  pz1  = (*Mu_pz)[bestj];
-		  pt1  = (*Mu_p_T)[bestj];
-		  eta1 = (*Mu_eta)[bestj];
-		  Cone1= float((*Mu_trEtCone10)[bestj]);
-		  px2  = (*Mu_px)[bestk];
-		  py2  = (*Mu_py)[bestk];
-		  pz2  = (*Mu_pz)[bestk];
-		  pt2  = (*Mu_p_T)[bestk];
-		  eta2 = (*Mu_eta)[bestk];
-		  Cone2= float((*Mu_trEtCone10)[bestk]);
-		}
-		// calculate a few more variables for likelihood function for the best lepton pair
-		double px = px1+px2;
-		double py = py1+py2;
-		modulus = sqrt(px1*px1 + py1*py1 + pz1*pz1) * sqrt(px2*px2 + py2*py2 + pz2*pz2);
-		cosll3D = (px1*px2 +py1*py2 + pz1*pz2)/ modulus;
-		if (abs(cosll3D) > 1.0 ) {cout << "cosll3d > 1: " << "\t " << cosll3D << "\t " << px1 << "\t " 
-					       << pz1 << "\t " << py1 << "\t " << px2 << "\t " << py2 << "\t " << pz2 << "\t " << modulus << endl;}
-		modulus = sqrt(px1*px1 + py1*py1) * sqrt(px2*px2 + py2*py2);
-		cosll2D = (px1*px2 + py1*py2)/ modulus;
-		if (abs(cosll2D) > 1.0 ) {cout << "cosll2d > 1: " << "\t " << cosll2D << "\t " << px1 << "\t " 
-					       << py1 << "\t " << px2 << "\t " << py2 << "\t " << modulus << endl;}
-		pt2l    = sqrt(px*px + py*py);
-		
-		// calculate the angle between MET_RefFinal_Et and PtZ 
-		cosPhi  = (px*MET_RefFinal_ex + py*MET_RefFinal_ey)/(pt2l*MET_RefFinal_et);
-		
-		// calculate the transverse mass
-		mt      = sqrt(2.0*pt2l*MET_RefFinal_et*(1.0-cosPhi));
-		
-		// calculate cosJetMET: cosine between promptest jet and MET direction in transverse plane
-		cosjetmet = 1.1;
-		if (Jet_N > 0) cosjetmet = ((*Jet_px)[0]*MET_RefFinal_ex + (*Jet_py)[0]*MET_RefFinal_ey)/((*Jet_p_T)[0]*MET_RefFinal_et);
-		
-		// select the promptest lepton for this last variable
-		if (pt1 >= pt2)  {PX=px1; PY=py1; PT=pt1;}
-		if (pt1 <  pt2)  {PX=px2; PY=py2; PT=pt2;}
-		
-		cosptlepMET = (PX*MET_RefFinal_ex +PY*MET_RefFinal_ey)/ (PT * MET_RefFinal_et);
-		
-		// fill the jet info
-		ejet1 = -99.99;
-		ejet2 = -99.99;
-		ejet3 = -99.99;
-		
-		njet = Jet_N;
-		// add info on the 3 most energetic jets
-		if (njet > 0) ejet1 = (*Jet_E)[0];
-		if (njet > 1) ejet2 = (*Jet_E)[1];
-		if (njet > 2) ejet3 = (*Jet_E)[2];
-		
-		ptlep1 = float(pt1);
-		ptlep2 = float(pt2);
-		cone1 = float(Cone1);
-		cone2 = float(Cone2);
-		lepID = abs(bestid);
-		ptZ0 = pt2l;
-		massZ = float(mZ);
-		cosll2d = float(cosll2D);
-		cosll3d = float(cosll3D);
-		cosJetMET = float(cosjetmet);
-		mT = float(mt);
-		MET = float(MET_RefFinal_et);
-		cosMETptlep = float(cosptlepMET);
-		cosphi = float(cosPhi);
-		
-		runnum = EVRunNumber;
-		evtnum  = EVEventAndInstance;
-		type   = typeNumber;
-		w      = float(weight);
-		
-		// fill the preselection tree from the values calculated above
-		treeS.Fill();
-		
-	      } // end if on btag
-	    } // end if on mZ
-	  } // end if on nlep > nlepcut
-	} // end on METcut
-      } // end on trigger cut
-      
-    } // end of for loop over events   
-    delete random;
-  
-  double cut0 = 0.0;
-  double cut1 = 0.0;
-  double cut2= 0.0;
-  double cut3= 0.0;
-  double cut4= 0.0;
-  double cut5= 0.0;
-  double cut6= 0.0;
-  
-    outClientFile << "              " << endl;
-    outClientFile << "Cut flow for: " << eventType << endl;
-    outClientFile << "-----------------------------------------------------------" << endl;
-    outClientFile << nrec << " records found in the chain. "<< endl;
-    
-    cout << endl;
-    cout << "METcut " << METcut << endl;
-    cout << "pt cuts for leptons: e > " << eptmin << " and mu: " << mptmin << " GeV and eta < " << etamin << endl;	  
-    cout << "nlep strictly equal to "<< nlepcut << " of the same flavor" << endl; 
-    cout << "mZ within " <<  mZcut << " GeV of on-shell mass " << endl;
-    cout << "total # of selected events in file: \t" << found << endl;	  
-    cout << endl;
-    cout << "Cut flow for: " << eventType << endl;
-    cout << "-----------------------------------------------------------" << endl;
-    cout << nrec << " records found in the chain. "<< endl;
-    cout << endl;
-    
-    passed = nrec;
-    totalRejected = (reject_MET + reject_nlep + reject_trigger  + reject_mZ + reject_btag); 
-    
-    places = 2;
-    cout <<fixed;                 
-    cout.precision(places);
-    
-    cout << "                         " <<   endl;
-    cout << "                         " << " cross-section              raw #                 percentage"    <<   endl;
-    cout << "cross-section*BR in fb   " << 1000.*sigmaBR   <<"\t" << generated <<"\t" <<  100.*(generated/generated)<< "%" << endl;
-    cut0 += 1000.*sigmaBR; 
-    cout << "xs after filter:         " << filterEff*1000.*sigmaBR <<"\t" << passed  <<"\t" <<  100.*(passed/generated)<< "%" << endl;
-    cut1 += filterEff*1000.*sigmaBR; 
-    temp = passed;
-    passed = (passed - reject_trigger);
-    cout << "xs after trigger:        " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    cut2 += 1000.*sigmaBR*passed/generated;
-    temp = passed;
-    passed = (passed - reject_MET);
-    cout << "xs after MET cut         " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    cut3 += 1000.*sigmaBR*passed/generated;
-    temp = passed;
-    passed = (passed - reject_nlep);
-    cout << "xs after nlep cut:       " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    cut4 += 1000.*sigmaBR*passed/generated;
-    temp = passed;
-    passed = (passed - reject_mZ);
-    cout << "xs after mZ cut:         " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    cut5 += 1000.*sigmaBR*passed/generated;
-    temp = passed;
-    passed = (passed - reject_btag);
-    cout << "xs after b-tag cut:      " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    cut6 += 1000.*sigmaBR*passed/generated;
-    Total = passed*filterEff; 
-    cout << endl;
-    cout << "Total rejected (reweighted):  " << lumi*sigmaBR - 1000.*sigmaBR*passed/generated << " out of " << generated*filterEff << endl;
-    cout << "Total rejected (raw)       :  " << generated - passed << " out of " << generated<< endl;
-    cout << "Fraction retained          :  " << 100.*(passed/generated) << "% " << endl;
-    places = 5;
-    cout.precision(places);
-    cout << endl;
-    cout << "Events weight of " << weight << endl;
-    cout << " "<< endl;
-    cout <<fixed;                 
-    places = 2;
-    cout.precision(places);
-    
-    passed = nrec;
-    
-    outClientFile << "                         " <<   endl;
-    outClientFile << "                         " << " cross-section              raw #                 percentage"    <<   endl;
-    outClientFile << "cross-section*BR in fb   " << 1000.*sigmaBR   <<"\t" << generated <<"\t" <<  100.*(generated/generated)<< "%" << endl;
-    outClientFile << "xs after filter:         " << filterEff*1000.*sigmaBR <<"\t" << passed  <<"\t" <<  100.*(passed/generated)<< "%" << endl;
-    temp = passed;
-    passed = (passed - reject_trigger);
-    outClientFile << "xs after trigger:        " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    temp = passed;
-    passed = (passed - reject_MET);
-    outClientFile << "xs after MET cut         " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    temp = passed;
-    passed = (passed - reject_nlep);
-    outClientFile << "xs after nlep cut:       " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    temp = passed;
-    passed = (passed - reject_mZ);
-    outClientFile << "xs after mZ cut:         " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    temp = passed;
-    passed = (passed - reject_btag);
-    outClientFile << "xs after b-tag cut:      " << 1000.*sigmaBR*passed/generated <<"\t" << passed <<"\t" <<  100.*(passed/generated)<<"\t" << "%; rel. eff: " <<  100.*(passed/temp)<< "%" << endl;
-    Total = passed*filterEff; 
-    outClientFile << endl;
-    outClientFile << "Total rejected (reweighted):  " << lumi*sigmaBR - 1000.*sigmaBR*passed/generated << " out of " << generated*filterEff << endl;
-    outClientFile << "Total rejected (raw)       :  " << generated - passed << " out of " << generated<< endl;
-    outClientFile << "Fraction retained          :  " << 100.*(passed/generated) << "% " << endl;
-    places = 5;
-    outClientFile.precision(places);
-    outClientFile << endl;
-    outClientFile << "Events weight of " << weight << endl;
-    outClientFile << " "<< endl;
-    outClientFile <<fixed;                 
-    places = 2;
-    outClientFile.precision(places);
-    
-  // check what the tree looks like
-  treeS.Print();
-  treeB.Print();
-  
-
-  f.Write();   // write to the file histograms and trees
-  
-  cout << " " << endl;
-  cout << "All done!" << endl;
-  
-  theApp.Run();                            // concluding ROOT requirements.
-  
-//---------------------------------- end insertion of EVmva.C
-
-
-   f.Write();   // write to the file histograms and trees
-
-cout << " " << endl;
-cout << "All done!" << endl;
-
-  theApp.Run();                            // concluding ROOT requirements.
-
-
-return 0;
-} //  End of main(...)
-
-
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis-dataset.py b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis-dataset.py
deleted file mode 100644
index 78cff0eca8a0..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis-dataset.py
+++ /dev/null
@@ -1,2061 +0,0 @@
-EventSelector = Service( "EventSelector" )
-
-done = False
-
-
-if mode=="mh110" :
-    print "running on signal with mH = 110 GeV"
-    EventSelector.InputCollections = [
-    '/data/signal/mh110/AOD.020494._00001.pool.root',
-    '/data/signal/mh110/AOD.020494._00002.pool.root',
-    '/data/signal/mh110/AOD.020494._00003.pool.root',
-    '/data/signal/mh110/AOD.020494._00004.pool.root',
-    '/data/signal/mh110/AOD.020494._00005.pool.root',
-    '/data/signal/mh110/AOD.020494._00006.pool.root',
-    '/data/signal/mh110/AOD.020494._00007.pool.root',
-    '/data/signal/mh110/AOD.020494._00008.pool.root',
-    '/data/signal/mh110/AOD.020494._00009.pool.root',
-    '/data/signal/mh110/AOD.020494._00010.pool.root',
-    '/data/signal/mh110/AOD.020494._00011.pool.root',
-    '/data/signal/mh110/AOD.020494._00012.pool.root',
-    '/data/signal/mh110/AOD.020494._00013.pool.root',
-    '/data/signal/mh110/AOD.020494._00014.pool.root',
-    '/data/signal/mh110/AOD.020494._00015.pool.root',
-    '/data/signal/mh110/AOD.020494._00016.pool.root',
-    '/data/signal/mh110/AOD.020494._00017.pool.root',
-    '/data/signal/mh110/AOD.020494._00018.pool.root',
-    '/data/signal/mh110/AOD.020494._00019.pool.root',
-    '/data/signal/mh110/AOD.020494._00020.pool.root',
-    '/data/signal/mh110/AOD.020494._00021.pool.root',
-    '/data/signal/mh110/AOD.020494._00022.pool.root',
-    '/data/signal/mh110/AOD.020494._00023.pool.root',
-    '/data/signal/mh110/AOD.020494._00024.pool.root',
-    '/data/signal/mh110/AOD.020494._00025.pool.root',
-    '/data/signal/mh110/AOD.020494._00026.pool.root',
-    '/data/signal/mh110/AOD.020494._00027.pool.root',
-    '/data/signal/mh110/AOD.020494._00028.pool.root',
-    '/data/signal/mh110/AOD.020494._00029.pool.root',
-    '/data/signal/mh110/AOD.020494._00030.pool.root',
-    '/data/signal/mh110/AOD.020494._00031.pool.root',
-    '/data/signal/mh110/AOD.020494._00032.pool.root',
-    '/data/signal/mh110/AOD.020494._00033.pool.root',
-    '/data/signal/mh110/AOD.020494._00034.pool.root',
-    '/data/signal/mh110/AOD.020494._00035.pool.root',
-    '/data/signal/mh110/AOD.020494._00036.pool.root',
-    '/data/signal/mh110/AOD.020494._00037.pool.root',
-    '/data/signal/mh110/AOD.020494._00038.pool.root',
-    '/data/signal/mh110/AOD.020494._00039.pool.root',
-    '/data/signal/mh110/AOD.020494._00040.pool.root']
-    done = True
-
-if mode=="mh150" :
-    print "running on signal with mH = 150 GeV"
-    EventSelector.InputCollections = [
-    '/data/signal/mh150/AOD.020491._00001.pool.root',
-    '/data/signal/mh150/AOD.020491._00002.pool.root',
-    '/data/signal/mh150/AOD.020491._00003.pool.root',
-    '/data/signal/mh150/AOD.020491._00004.pool.root',
-    '/data/signal/mh150/AOD.020491._00005.pool.root',
-    '/data/signal/mh150/AOD.020491._00006.pool.root',
-    '/data/signal/mh150/AOD.020491._00007.pool.root',
-    '/data/signal/mh150/AOD.020491._00008.pool.root',
-    '/data/signal/mh150/AOD.020491._00009.pool.root',
-    '/data/signal/mh150/AOD.020491._00010.pool.root',
-    '/data/signal/mh150/AOD.020491._00011.pool.root',
-    '/data/signal/mh150/AOD.020491._00012.pool.root',
-    '/data/signal/mh150/AOD.020491._00013.pool.root',
-    '/data/signal/mh150/AOD.020491._00014.pool.root',
-    '/data/signal/mh150/AOD.020491._00015.pool.root',
-    '/data/signal/mh150/AOD.020491._00016.pool.root',
-    '/data/signal/mh150/AOD.020491._00017.pool.root',
-    '/data/signal/mh150/AOD.020491._00018.pool.root',
-    '/data/signal/mh150/AOD.020491._00019.pool.root',
-    '/data/signal/mh150/AOD.020491._00020.pool.root',
-    '/data/signal/mh150/AOD.020491._00021.pool.root',
-    '/data/signal/mh150/AOD.020491._00022.pool.root',
-    '/data/signal/mh150/AOD.020491._00023.pool.root',
-    '/data/signal/mh150/AOD.020491._00024.pool.root',
-    '/data/signal/mh150/AOD.020491._00025.pool.root',
-    '/data/signal/mh150/AOD.020491._00026.pool.root',
-    '/data/signal/mh150/AOD.020491._00027.pool.root',
-    '/data/signal/mh150/AOD.020491._00028.pool.root',
-    '/data/signal/mh150/AOD.020491._00029.pool.root',
-    '/data/signal/mh150/AOD.020491._00030.pool.root',
-    '/data/signal/mh150/AOD.020491._00031.pool.root',
-    '/data/signal/mh150/AOD.020491._00032.pool.root',
-    '/data/signal/mh150/AOD.020491._00033.pool.root',
-    '/data/signal/mh150/AOD.020491._00034.pool.root',
-    '/data/signal/mh150/AOD.020491._00035.pool.root',
-    '/data/signal/mh150/AOD.020491._00036.pool.root',
-    '/data/signal/mh150/AOD.020491._00037.pool.root',
-    '/data/signal/mh150/AOD.020491._00038.pool.root',
-    '/data/signal/mh150/AOD.020491._00039.pool.root',
-    '/data/signal/mh150/AOD.020491._00040.pool.root']
-    done = True
-
-if mode=="mh200" :
-    print "running on signal with mH = 200 GeV"
-    EventSelector.InputCollections = [
-    '/data/signal/mh200/AOD.020492._00001.pool.root',
-    '/data/signal/mh200/AOD.020492._00002.pool.root',
-    '/data/signal/mh200/AOD.020492._00003.pool.root',
-    '/data/signal/mh200/AOD.020492._00004.pool.root',
-    '/data/signal/mh200/AOD.020492._00005.pool.root',
-    '/data/signal/mh200/AOD.020492._00006.pool.root',
-    '/data/signal/mh200/AOD.020492._00007.pool.root',
-    '/data/signal/mh200/AOD.020492._00008.pool.root',
-    '/data/signal/mh200/AOD.020492._00009.pool.root',
-    '/data/signal/mh200/AOD.020492._00010.pool.root',
-    '/data/signal/mh200/AOD.020492._00011.pool.root',
-    '/data/signal/mh200/AOD.020492._00012.pool.root',
-    '/data/signal/mh200/AOD.020492._00013.pool.root',
-    '/data/signal/mh200/AOD.020492._00014.pool.root',
-    '/data/signal/mh200/AOD.020492._00015.pool.root',
-    '/data/signal/mh200/AOD.020492._00016.pool.root',
-    '/data/signal/mh200/AOD.020492._00017.pool.root',
-    '/data/signal/mh200/AOD.020492._00018.pool.root',
-    '/data/signal/mh200/AOD.020492._00019.pool.root',
-    '/data/signal/mh200/AOD.020492._00020.pool.root',
-    '/data/signal/mh200/AOD.020492._00021.pool.root',
-    '/data/signal/mh200/AOD.020492._00022.pool.root',
-    '/data/signal/mh200/AOD.020492._00023.pool.root',
-    '/data/signal/mh200/AOD.020492._00024.pool.root',
-    '/data/signal/mh200/AOD.020492._00025.pool.root',
-    '/data/signal/mh200/AOD.020492._00026.pool.root',
-    '/data/signal/mh200/AOD.020492._00027.pool.root',
-    '/data/signal/mh200/AOD.020492._00028.pool.root',
-    '/data/signal/mh200/AOD.020492._00029.pool.root',
-    '/data/signal/mh200/AOD.020492._00030.pool.root',
-    '/data/signal/mh200/AOD.020492._00031.pool.root',
-    '/data/signal/mh200/AOD.020492._00032.pool.root',
-    '/data/signal/mh200/AOD.020492._00033.pool.root',
-    '/data/signal/mh200/AOD.020492._00034.pool.root',
-    '/data/signal/mh200/AOD.020492._00035.pool.root',
-    '/data/signal/mh200/AOD.020492._00036.pool.root',
-    '/data/signal/mh200/AOD.020492._00037.pool.root',
-    '/data/signal/mh200/AOD.020492._00038.pool.root',
-    '/data/signal/mh200/AOD.020492._00039.pool.root',
-    '/data/signal/mh200/AOD.020492._00040.pool.root']
-    done = True
-
-if mode=="mh250" :
-    print "running on signal with mH = 250 GeV"
-    EventSelector.InputCollections = [
-    '/data/signal/mh250/AOD.020493._00001.pool.root',
-    '/data/signal/mh250/AOD.020493._00002.pool.root',
-    '/data/signal/mh250/AOD.020493._00003.pool.root',
-    '/data/signal/mh250/AOD.020493._00004.pool.root',
-    '/data/signal/mh250/AOD.020493._00005.pool.root',
-    '/data/signal/mh250/AOD.020493._00006.pool.root',
-    '/data/signal/mh250/AOD.020493._00007.pool.root',
-    '/data/signal/mh250/AOD.020493._00008.pool.root',
-    '/data/signal/mh250/AOD.020493._00009.pool.root',
-    '/data/signal/mh250/AOD.020493._00010.pool.root',
-    '/data/signal/mh250/AOD.020493._00011.pool.root',
-    '/data/signal/mh250/AOD.020493._00012.pool.root',
-    '/data/signal/mh250/AOD.020493._00013.pool.root',
-    '/data/signal/mh250/AOD.020493._00014.pool.root',
-    '/data/signal/mh250/AOD.020493._00015.pool.root',
-    '/data/signal/mh250/AOD.020493._00016.pool.root',
-    '/data/signal/mh250/AOD.020493._00017.pool.root',
-    '/data/signal/mh250/AOD.020493._00018.pool.root',
-    '/data/signal/mh250/AOD.020493._00019.pool.root',
-    '/data/signal/mh250/AOD.020493._00020.pool.root',
-    '/data/signal/mh250/AOD.020493._00021.pool.root',
-    '/data/signal/mh250/AOD.020493._00022.pool.root',
-    '/data/signal/mh250/AOD.020493._00023.pool.root',
-    '/data/signal/mh250/AOD.020493._00024.pool.root',
-    '/data/signal/mh250/AOD.020493._00025.pool.root',
-    '/data/signal/mh250/AOD.020493._00026.pool.root',
-    '/data/signal/mh250/AOD.020493._00027.pool.root',
-    '/data/signal/mh250/AOD.020493._00028.pool.root',
-    '/data/signal/mh250/AOD.020493._00029.pool.root',
-    '/data/signal/mh250/AOD.020493._00030.pool.root',
-    '/data/signal/mh250/AOD.020493._00031.pool.root',
-    '/data/signal/mh250/AOD.020493._00032.pool.root',
-    '/data/signal/mh250/AOD.020493._00033.pool.root',
-    '/data/signal/mh250/AOD.020493._00034.pool.root',
-    '/data/signal/mh250/AOD.020493._00035.pool.root',
-    '/data/signal/mh250/AOD.020493._00036.pool.root',
-    '/data/signal/mh250/AOD.020493._00037.pool.root',
-    '/data/signal/mh250/AOD.020493._00038.pool.root',
-    '/data/signal/mh250/AOD.020493._00039.pool.root',
-    '/data/signal/mh250/AOD.020493._00040.pool.root']
-    done = True
-
-
-if mode=="test" :
-    print "running a test"
-    EventSelector.InputCollections = ['/data/ttbar/AOD.017065._00413.pool.root.1']
-    done = True
-
-if mode=="Zee-ljets" :
-    print "running on Zee-ljets"
-    EventSelector.InputCollections = ['/data/Zincl/aod_6389.pool.root']
-    done = True
-
-if mode=="Zmm-ljets" :
-    print "running on Zmm-ljets"
-    EventSelector.InputCollections = ['/data/Zincl/aod_6595.pool.root']
-    done = True
-
-if mode=="Zee-bjets" :
-    print "running on Zee-bjets"
-    EventSelector.InputCollections = [
-        '/data/Zincl/aod_6390_1-10.pool.root',
-        '/data/Zincl/aod_6390_11-20.pool.root',
-        '/data/Zincl/aod_6390_21-30.pool.root',
-        '/data/Zincl/aod_6390_31-40.pool.root',
-        '/data/Zincl/aod_6390_41-50.pool.root',
-        '/data/Zincl/aod_6390_51-60.pool.root',
-        '/data/Zincl/aod_6390_61-70.pool.root',
-        '/data/Zincl/aod_6390_71-80.pool.root',
-        '/data/Zincl/aod_6390_81-90.pool.root',
-        '/data/Zincl/aod_6390_91-100.pool.root',
-        '/data/Zincl/aod_6390_101-110.pool.root',
-        '/data/Zincl/aod_6390_111-120.pool.root',
-        '/data/Zincl/aod_6390_121-130.pool.root',
-        '/data/Zincl/aod_6390_131-140.pool.root',
-        '/data/Zincl/aod_6390_141-150.pool.root',
-        '/data/Zincl/aod_6390_151-160.pool.root',
-        '/data/Zincl/aod_6390_171-180.pool.root',
-        '/data/Zincl/aod_6390_181-190.pool.root',
-        '/data/Zincl/aod_6390_191-200.pool.root']
-    done = True
-
-if mode=="Zee-bjets-2" :
-    print "running on Zee-bjets - second set"
-    EventSelector.InputCollections = [
-        '/data/Zincl/aod_6390_201-210.pool.root',
-        '/data/Zincl/aod_6390_211-220.pool.root',
-        '/data/Zincl/aod_6390_221-230.pool.root',
-        '/data/Zincl/aod_6390_231-240.pool.root',
-        '/data/Zincl/aod_6390_241-250.pool.root',
-        '/data/Zincl/aod_6390_251-260.pool.root',
-        '/data/Zincl/aod_6390_261-270.pool.root',
-        '/data/Zincl/aod_6390_271-280.pool.root',
-        '/data/Zincl/aod_6390_291-300.pool.root',
-        '/data/Zincl/aod_6390_301-310.pool.root',
-        '/data/Zincl/aod_6390_311-320.pool.root',
-        '/data/Zincl/aod_6390_321-330.pool.root',
-        '/data/Zincl/aod_6390_331-340.pool.root',
-        '/data/Zincl/aod_6390_341-350.pool.root',
-        '/data/Zincl/aod_6390_351-360.pool.root',
-        '/data/Zincl/aod_6390_361-370.pool.root',
-        '/data/Zincl/aod_6390_371-380.pool.root',
-        '/data/Zincl/aod_6390_381-390.pool.root',
-        '/data/Zincl/aod_6390_391-400.pool.root',
-        '/data/Zincl/aod_6390_401-410.pool.root',
-        '/data/Zincl/aod_6390_411-420.pool.root',
-        '/data/Zincl/aod_6390_421-430.pool.root',
-        '/data/Zincl/aod_6390_431-440.pool.root',
-        '/data/Zincl/aod_6390_441-450.pool.root',
-        '/data/Zincl/aod_6390_451-460.pool.root',
-        '/data/Zincl/aod_6390_461-470.pool.root',
-        '/data/Zincl/aod_6390_471-480.pool.root',
-        '/data/Zincl/aod_6390_491-500.pool.root',
-        '/data/Zincl/aod_6390_501-510.pool.root',
-        '/data/Zincl/aod_6390_511-520.pool.root',
-        '/data/Zincl/aod_6390_521-530.pool.root',
-        '/data/Zincl/aod_6390_531-540.pool.root',
-        '/data/Zincl/aod_6390_541-550.pool.root',
-        '/data/Zincl/aod_6390_551-560.pool.root']
-    done = True
-
-if mode=="Zmm-bjets" :
-    print "running on Zmm-bjets"
-    EventSelector.InputCollections = [
-        '/data/Zincl/aod_6596_1-10.pool.root',
-        '/data/Zincl/aod_6596_11-20.pool.root',
-        '/data/Zincl/aod_6596_21-30.pool.root',
-        '/data/Zincl/aod_6596_31-40.pool.root',
-        '/data/Zincl/aod_6596_41-50.pool.root',
-        '/data/Zincl/aod_6596_51-60.pool.root',
-        '/data/Zincl/aod_6596_61-70.pool.root',
-        '/data/Zincl/aod_6596_71-80.pool.root',
-        '/data/Zincl/aod_6596_81-90.pool.root',
-        '/data/Zincl/aod_6596_91-100.pool.root',
-        '/data/Zincl/aod_6596_101-110.pool.root',
-        '/data/Zincl/aod_6596_111-120.pool.root',
-        '/data/Zincl/aod_6596_121-130.pool.root',
-        '/data/Zincl/aod_6596_131-140.pool.root',
-        '/data/Zincl/aod_6596_141-150.pool.root',
-        '/data/Zincl/aod_6596_151-160.pool.root',
-        '/data/Zincl/aod_6596_161-170.pool.root',
-        '/data/Zincl/aod_6596_171-180.pool.root']
-    done = True
-
-if mode=="Zmm-bjets-2" :
-    print "running on Zmm-bjets - second set"
-    EventSelector.InputCollections = [
-        '/data/Zincl/aod_6596_181-190.pool.root',
-        '/data/Zincl/aod_6596_191-200.pool.root',
-        '/data/Zincl/aod_6596_201-210.pool.root',
-        '/data/Zincl/aod_6596_211-220.pool.root',
-        '/data/Zincl/aod_6596_221-230.pool.root',
-        '/data/Zincl/aod_6596_231-240.pool.root',
-        '/data/Zincl/aod_6596_241-250.pool.root',
-        '/data/Zincl/aod_6596_251-260.pool.root',
-        '/data/Zincl/aod_6596_261-270.pool.root',
-        '/data/Zincl/aod_6596_271-280.pool.root',
-        '/data/Zincl/aod_6596_281-290.pool.root',
-        '/data/Zincl/aod_6596_291-300.pool.root',
-        '/data/Zincl/aod_6596_301-310.pool.root',
-        '/data/Zincl/aod_6596_311-320.pool.root',
-        '/data/Zincl/aod_6596_321-330.pool.root',
-        '/data/Zincl/aod_6596_331-340.pool.root',
-        '/data/Zincl/aod_6596_341-350.pool.root',
-        '/data/Zincl/aod_6596_351-360.pool.root',
-        '/data/Zincl/aod_6596_361-370.pool.root',
-        '/data/Zincl/aod_6596_371-380.pool.root',
-        '/data/Zincl/aod_6596_381-390.pool.root',
-        '/data/Zincl/aod_6596_391-400.pool.root',
-        '/data/Zincl/aod_6596_401-410.pool.root',
-        '/data/Zincl/aod_6596_411-420.pool.root',
-        '/data/Zincl/aod_6596_421-430.pool.root',
-        '/data/Zincl/aod_6596_431-440.pool.root',
-        '/data/Zincl/aod_6596_441-450.pool.root',
-        '/data/Zincl/aod_6596_451-460.pool.root',
-        '/data/Zincl/aod_6596_461-470.pool.root',
-        '/data/Zincl/aod_6596_471-480.pool.root',
-        '/data/Zincl/aod_6596_481-490.pool.root',
-        '/data/Zincl/aod_6596_491-500.pool.root']
-    done = True
-
-
-if mode=="HZ140" :
-    print "running on HZ140 data"
-    EventSelector.InputCollections = [
-        '/data/HZ/AOD.013873._00001.pool.root.15',
-        '/data/HZ/AOD.013873._00002.pool.root.13',
-        '/data/HZ/AOD.013873._00003.pool.root.17',
-        '/data/HZ/AOD.013873._00004.pool.root.13',
-        '/data/HZ/AOD.013873._00005.pool.root.16',
-        '/data/HZ/AOD.013873._00006.pool.root.15',
-        '/data/HZ/AOD.013873._00007.pool.root.15',
-        '/data/HZ/AOD.013873._00008.pool.root.13',
-        '/data/HZ/AOD.013873._00010.pool.root.15',
-        '/data/HZ/AOD.013873._00011.pool.root.4',
-        '/data/HZ/AOD.013873._00012.pool.root.3',
-        '/data/HZ/AOD.013873._00013.pool.root.4',
-        '/data/HZ/AOD.013873._00014.pool.root.3',
-        '/data/HZ/AOD.013873._00015.pool.root.3',
-        '/data/HZ/AOD.013873._00016.pool.root.3',
-        '/data/HZ/AOD.013873._00017.pool.root.2',
-        '/data/HZ/AOD.013873._00018.pool.root.1',
-        '/data/HZ/AOD.013873._00019.pool.root.2',
-        '/data/HZ/AOD.013873._00020.pool.root.2',
-        '/data/HZ/AOD.013873._00021.pool.root.6',
-        '/data/HZ/AOD.013873._00022.pool.root.2',
-        '/data/HZ/AOD.013873._00023.pool.root.1',
-        '/data/HZ/AOD.013873._00024.pool.root.3',
-        '/data/HZ/AOD.013873._00025.pool.root.3',
-        '/data/HZ/AOD.013873._00026.pool.root.4',
-        '/data/HZ/AOD.013873._00027.pool.root.4',
-        '/data/HZ/AOD.013873._00028.pool.root.4',
-        '/data/HZ/AOD.013873._00029.pool.root.2',
-        '/data/HZ/AOD.013873._00030.pool.root.3',
-        '/data/HZ/AOD.013873._00031.pool.root.2',
-        '/data/HZ/AOD.013873._00032.pool.root.1',
-        '/data/HZ/AOD.013873._00033.pool.root.3',
-        '/data/HZ/AOD.013873._00034.pool.root.3',
-        '/data/HZ/AOD.013873._00035.pool.root.1',
-        '/data/HZ/AOD.013873._00036.pool.root.4',
-        '/data/HZ/AOD.013873._00037.pool.root.4',
-        '/data/HZ/AOD.013873._00038.pool.root.2',
-        '/data/HZ/AOD.013873._00039.pool.root.2',
-        '/data/HZ/AOD.013873._00040.pool.root.4']
-    done = True
-
-if mode=="HZ130" :
-    print "running on HZ130 data"
-    EventSelector.InputCollections = [
-        '/data/HZ/AOD.012260._00001.pool.root',  
-        '/data/HZ/AOD.012260._00002.pool.root',  
-        '/data/HZ/AOD.012260._00003.pool.root',  
-        '/data/HZ/AOD.012260._00004.pool.root',  
-        '/data/HZ/AOD.012260._00005.pool.root',  
-        '/data/HZ/AOD.012260._00006.pool.root',  
-        '/data/HZ/AOD.012260._00007.pool.root',  
-        '/data/HZ/AOD.012260._00008.pool.root',  
-        '/data/HZ/AOD.012260._00009.pool.root',  
-        '/data/HZ/AOD.012260._00010.pool.root',  
-        '/data/HZ/AOD.012260._00011.pool.root',  
-        '/data/HZ/AOD.012260._00012.pool.root',  
-        '/data/HZ/AOD.012260._00013.pool.root',  
-        '/data/HZ/AOD.012260._00014.pool.root',  
-        '/data/HZ/AOD.012260._00015.pool.root',  
-        '/data/HZ/AOD.012260._00016.pool.root',  
-        '/data/HZ/AOD.012260._00017.pool.root',  
-        '/data/HZ/AOD.012260._00018.pool.root',  
-        '/data/HZ/AOD.012260._00019.pool.root',  
-        '/data/HZ/AOD.012260._00020.pool.root',  
-        '/data/HZ/AOD.012260._00021.pool.root',  
-        '/data/HZ/AOD.012260._00022.pool.root',  
-        '/data/HZ/AOD.012260._00023.pool.root',  
-        '/data/HZ/AOD.012260._00024.pool.root',  
-        '/data/HZ/AOD.012260._00025.pool.root',  
-        '/data/HZ/AOD.012260._00026.pool.root',  
-        '/data/HZ/AOD.012260._00027.pool.root',  
-        '/data/HZ/AOD.012260._00028.pool.root',  
-        '/data/HZ/AOD.012260._00029.pool.root',  
-        '/data/HZ/AOD.012260._00030.pool.root',  
-        '/data/HZ/AOD.012260._00031.pool.root',  
-        '/data/HZ/AOD.012260._00032.pool.root',  
-        '/data/HZ/AOD.012260._00033.pool.root',  
-        '/data/HZ/AOD.012260._00034.pool.root',  
-        '/data/HZ/AOD.012260._00035.pool.root',  
-        '/data/HZ/AOD.012260._00036.pool.root',  
-        '/data/HZ/AOD.012260._00037.pool.root',  
-        '/data/HZ/AOD.012260._00038.pool.root',  
-        '/data/HZ/AOD.012260._00039.pool.root',  
-        '/data/HZ/AOD.012260._00040.pool.root']
-    done = True
-
-if mode=="HZ" :
-    print "running on HZ data"
-    EventSelector.InputCollections = ['/data/HZ/AOD.010758._00040.pool.root.1',
-                                      '/data/HZ/AOD.010758._00040.pool.root.1',
-                                      '/data/HZ/AOD.010758._00046.pool.root.1',
-                                      '/data/HZ/AOD.010758._00069.pool.root.1',
-                                      '/data/HZ/AOD.010758._00083.pool.root.1',
-                                      '/data/HZ/AOD.010758._00091.pool.root.1',
-                                      '/data/HZ/AOD.010758._00095.pool.root.1',
-                                      '/data/HZ/AOD.010758._00101.pool.root.1',
-                                      '/data/HZ/AOD.010758._00141.pool.root.1',
-                                      '/data/HZ/AOD.010758._00147.pool.root.1']
-    done = True
-
-if mode=="ZZ" :
-    print "running on ZZ data"
-    EventSelector.InputCollections = [
-        '/data/ZZ/AOD.010759._00001.pool.root.1',
-        '/data/ZZ/AOD.010759._00001.pool.root.1',  
-        '/data/ZZ/AOD.010759._00002.pool.root.1',
-        '/data/ZZ/AOD.010759._00003.pool.root.1',
-        '/data/ZZ/AOD.010759._00004.pool.root.1',
-        '/data/ZZ/AOD.010759._00007.pool.root.1',
-        '/data/ZZ/AOD.010759._00017.pool.root.1',
-        '/data/ZZ/AOD.010759._00019.pool.root.1',
-        '/data/ZZ/AOD.010759._00021.pool.root.1',  
-        '/data/ZZ/AOD.010759._00024.pool.root.1',
-        '/data/ZZ/AOD.010759._00026.pool.root.1',
-        '/data/ZZ/AOD.010759._00040.pool.root.1',
-        '/data/ZZ/AOD.010759._00050.pool.root.1',
-        '/data/ZZ/AOD.010759._00053.pool.root.1',
-        '/data/ZZ/AOD.010759._00058.pool.root.1', 
-        '/data/ZZ/AOD.010759._00062.pool.root.1']
-    done = True
-
-if mode=="ZZ4l" :
-    print "running on full ZZ4l data"
-    EventSelector.InputCollections = [
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00401.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00402.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00403.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00404.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00405.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00406.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00407.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00408.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00409.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00410.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00411.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00412.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00413.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00414.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00415.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00416.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00417.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00418.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00419.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00420.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00421.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00422.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00423.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00424.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00425.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00426.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00427.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00428.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00429.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00430.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00431.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00432.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00433.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00434.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00435.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00436.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00437.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00438.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00439.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00440.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00441.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00442.pool.root.2',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00443.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00444.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00445.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00446.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00447.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00448.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00449.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00450.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00451.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00452.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00453.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00454.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00455.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00456.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00457.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00458.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00460.pool.root.2',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00464.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00465.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00467.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00469.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00470.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00471.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00474.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00476.pool.root.3',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00480.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00481.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00482.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00483.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00484.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00486.pool.root.2',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00493.pool.root.5',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00496.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00497.pool.root.5',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00498.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00500.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00501.pool.root.3',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00505.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00506.pool.root.4',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00508.pool.root.1',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00511.pool.root.2',
-        '/data/ZZ4l/trig1_misal1_csc11_V1.005980.Pythiazz4l.recon.AOD.v12000601_tid009802._00519.pool.root.4']
-    done = True
-    
-if mode=="tt" :
-    print "running on tt data"
-    EventSelector.InputCollections = [
-        '/data/ttbar/trig1_misal1_mc12.006811.T1_McAtNlo_Jimmy.recon.AOD.v12000604_tid010042._00001.pool.root.1',
-        '/data/ttbar/trig1_misal1_mc12.006811.T1_McAtNlo_Jimmy.recon.AOD.v12000604_tid010042._00002.pool.root.1',
-        '/data/ttbar/trig1_misal1_mc12.006811.T1_McAtNlo_Jimmy.recon.AOD.v12000604_tid010042._00003.pool.root.1',
-        '/data/ttbar/trig1_misal1_mc12.006811.T1_McAtNlo_Jimmy.recon.AOD.v12000604_tid010042._00004.pool.root.1']
-    done = True
-
-if mode=="tt6811" :
-    print "running on new tt data run 6811"
-    EventSelector.InputCollections = [
-        '/data/ttbar/AOD.017065._00162.pool.root.1',
-        '/data/ttbar/AOD.017065._00163.pool.root.1',
-        '/data/ttbar/AOD.017065._00164.pool.root.1',
-        '/data/ttbar/AOD.017065._00165.pool.root.1',
-        '/data/ttbar/AOD.017065._00166.pool.root.1',
-        '/data/ttbar/AOD.017065._00167.pool.root.1',
-        '/data/ttbar/AOD.017065._00169.pool.root.1',
-        '/data/ttbar/AOD.017065._00170.pool.root.1',
-        '/data/ttbar/AOD.017065._00171.pool.root.1',
-        '/data/ttbar/AOD.017065._00172.pool.root.1',
-        '/data/ttbar/AOD.017065._00173.pool.root.1',
-        '/data/ttbar/AOD.017065._00174.pool.root.1',
-        '/data/ttbar/AOD.017065._00175.pool.root.1',
-        '/data/ttbar/AOD.017065._00176.pool.root.1',
-        '/data/ttbar/AOD.017065._00177.pool.root.1',
-        '/data/ttbar/AOD.017065._00178.pool.root.1',
-        '/data/ttbar/AOD.017065._00179.pool.root.1',
-        '/data/ttbar/AOD.017065._00180.pool.root.1',
-        '/data/ttbar/AOD.017065._00181.pool.root.1',
-        '/data/ttbar/AOD.017065._00182.pool.root.1',
-        '/data/ttbar/AOD.017065._00183.pool.root.1',
-        '/data/ttbar/AOD.017065._00184.pool.root.1',
-        '/data/ttbar/AOD.017065._00185.pool.root.1',
-        '/data/ttbar/AOD.017065._00186.pool.root.1',
-        '/data/ttbar/AOD.017065._00188.pool.root.1',
-        '/data/ttbar/AOD.017065._00189.pool.root.1',
-        '/data/ttbar/AOD.017065._00190.pool.root.1',
-        '/data/ttbar/AOD.017065._00192.pool.root.1',
-        '/data/ttbar/AOD.017065._00193.pool.root.1',
-        '/data/ttbar/AOD.017065._00194.pool.root.1',
-        '/data/ttbar/AOD.017065._00195.pool.root.1',
-        '/data/ttbar/AOD.017065._00197.pool.root.1',
-        '/data/ttbar/AOD.017065._00198.pool.root.1',
-        '/data/ttbar/AOD.017065._00199.pool.root.1',
-        '/data/ttbar/AOD.017065._00200.pool.root.1',
-        '/data/ttbar/AOD.017065._00201.pool.root.1',
-        '/data/ttbar/AOD.017065._00202.pool.root.1',
-        '/data/ttbar/AOD.017065._00203.pool.root.1',
-        '/data/ttbar/AOD.017065._00204.pool.root.1',
-        '/data/ttbar/AOD.017065._00205.pool.root.1',
-        '/data/ttbar/AOD.017065._00206.pool.root.1',
-        '/data/ttbar/AOD.017065._00207.pool.root.1',
-        '/data/ttbar/AOD.017065._00210.pool.root.1',
-        '/data/ttbar/AOD.017065._00211.pool.root.1',
-        '/data/ttbar/AOD.017065._00212.pool.root.1',
-        '/data/ttbar/AOD.017065._00213.pool.root.1',
-        '/data/ttbar/AOD.017065._00214.pool.root.1',
-        '/data/ttbar/AOD.017065._00215.pool.root.1',
-        '/data/ttbar/AOD.017065._00216.pool.root.1',
-        '/data/ttbar/AOD.017065._00217.pool.root.1',
-        '/data/ttbar/AOD.017065._00218.pool.root.1',
-        '/data/ttbar/AOD.017065._00220.pool.root.1',
-        '/data/ttbar/AOD.017065._00221.pool.root.1',
-        '/data/ttbar/AOD.017065._00223.pool.root.1',
-        '/data/ttbar/AOD.017065._00224.pool.root.1',
-        '/data/ttbar/AOD.017065._00227.pool.root.1',
-        '/data/ttbar/AOD.017065._00228.pool.root.1',
-        '/data/ttbar/AOD.017065._00229.pool.root.1',
-        '/data/ttbar/AOD.017065._00230.pool.root.1',
-        '/data/ttbar/AOD.017065._00232.pool.root.1',
-        '/data/ttbar/AOD.017065._00233.pool.root.1',
-        '/data/ttbar/AOD.017065._00234.pool.root.1',
-        '/data/ttbar/AOD.017065._00235.pool.root.1',
-        '/data/ttbar/AOD.017065._00236.pool.root.1',
-        '/data/ttbar/AOD.017065._00237.pool.root.1',
-        '/data/ttbar/AOD.017065._00238.pool.root.1',
-        '/data/ttbar/AOD.017065._00239.pool.root.1',
-        '/data/ttbar/AOD.017065._00240.pool.root.1',
-        '/data/ttbar/AOD.017065._00241.pool.root.1',
-        '/data/ttbar/AOD.017065._00242.pool.root.1',
-        '/data/ttbar/AOD.017065._00243.pool.root.1',
-        '/data/ttbar/AOD.017065._00244.pool.root.1',
-        '/data/ttbar/AOD.017065._00245.pool.root.1',
-        '/data/ttbar/AOD.017065._00246.pool.root.1',
-        '/data/ttbar/AOD.017065._00247.pool.root.1',
-        '/data/ttbar/AOD.017065._00248.pool.root.1',
-        '/data/ttbar/AOD.017065._00249.pool.root.1',
-        '/data/ttbar/AOD.017065._00251.pool.root.1',
-        '/data/ttbar/AOD.017065._00252.pool.root.1',
-        '/data/ttbar/AOD.017065._00253.pool.root.1',
-        '/data/ttbar/AOD.017065._00254.pool.root.1',
-        '/data/ttbar/AOD.017065._00255.pool.root.1',
-        '/data/ttbar/AOD.017065._00256.pool.root.1',
-        '/data/ttbar/AOD.017065._00257.pool.root.1',
-        '/data/ttbar/AOD.017065._00258.pool.root.1',
-        '/data/ttbar/AOD.017065._00259.pool.root.1',
-        '/data/ttbar/AOD.017065._00260.pool.root.1',
-        '/data/ttbar/AOD.017065._00261.pool.root.1',
-        '/data/ttbar/AOD.017065._00262.pool.root.1',
-        '/data/ttbar/AOD.017065._00263.pool.root.1',
-        '/data/ttbar/AOD.017065._00264.pool.root.1',
-        '/data/ttbar/AOD.017065._00265.pool.root.1',
-        '/data/ttbar/AOD.017065._00266.pool.root.1',
-        '/data/ttbar/AOD.017065._00267.pool.root.1',
-        '/data/ttbar/AOD.017065._00268.pool.root.1',
-        '/data/ttbar/AOD.017065._00269.pool.root.1',
-        '/data/ttbar/AOD.017065._00270.pool.root.1',
-        '/data/ttbar/AOD.017065._00273.pool.root.2',
-        '/data/ttbar/AOD.017065._00274.pool.root.2',
-        '/data/ttbar/AOD.017065._00275.pool.root.2',
-        '/data/ttbar/AOD.017065._00276.pool.root.2',
-        '/data/ttbar/AOD.017065._00277.pool.root.2',
-        '/data/ttbar/AOD.017065._00278.pool.root.2',
-        '/data/ttbar/AOD.017065._00279.pool.root.2',
-        '/data/ttbar/AOD.017065._00280.pool.root.2',
-        '/data/ttbar/AOD.017065._00282.pool.root.1',
-        '/data/ttbar/AOD.017065._00283.pool.root.1',
-        '/data/ttbar/AOD.017065._00284.pool.root.1',
-        '/data/ttbar/AOD.017065._00285.pool.root.1',
-        '/data/ttbar/AOD.017065._00286.pool.root.2',
-        '/data/ttbar/AOD.017065._00287.pool.root.2',
-        '/data/ttbar/AOD.017065._00289.pool.root.2',
-        '/data/ttbar/AOD.017065._00290.pool.root.1',
-        '/data/ttbar/AOD.017065._00291.pool.root.1',
-        '/data/ttbar/AOD.017065._00292.pool.root.1',
-        '/data/ttbar/AOD.017065._00294.pool.root.1',
-        '/data/ttbar/AOD.017065._00295.pool.root.1',
-        '/data/ttbar/AOD.017065._00299.pool.root.1',
-        '/data/ttbar/AOD.017065._00300.pool.root.1',
-        '/data/ttbar/AOD.017065._00301.pool.root.1',
-        '/data/ttbar/AOD.017065._00302.pool.root.1',
-        '/data/ttbar/AOD.017065._00303.pool.root.1',
-        '/data/ttbar/AOD.017065._00304.pool.root.1',
-        '/data/ttbar/AOD.017065._00305.pool.root.1',
-        '/data/ttbar/AOD.017065._00307.pool.root.1',
-        '/data/ttbar/AOD.017065._00308.pool.root.1',
-        '/data/ttbar/AOD.017065._00309.pool.root.1',
-        '/data/ttbar/AOD.017065._00310.pool.root.1',
-        '/data/ttbar/AOD.017065._00312.pool.root.1',
-        '/data/ttbar/AOD.017065._00313.pool.root.1',
-        '/data/ttbar/AOD.017065._00314.pool.root.2',
-        '/data/ttbar/AOD.017065._00318.pool.root.1',
-        '/data/ttbar/AOD.017065._00319.pool.root.1',
-        '/data/ttbar/AOD.017065._00320.pool.root.1',
-        '/data/ttbar/AOD.017065._00321.pool.root.1',
-        '/data/ttbar/AOD.017065._00322.pool.root.1',
-        '/data/ttbar/AOD.017065._00323.pool.root.1',
-        '/data/ttbar/AOD.017065._00324.pool.root.1',
-        '/data/ttbar/AOD.017065._00325.pool.root.1',
-        '/data/ttbar/AOD.017065._00326.pool.root.1',
-        '/data/ttbar/AOD.017065._00327.pool.root.1',
-        '/data/ttbar/AOD.017065._00330.pool.root.1',
-        '/data/ttbar/AOD.017065._00331.pool.root.1',
-        '/data/ttbar/AOD.017065._00332.pool.root.1',
-        '/data/ttbar/AOD.017065._00333.pool.root.1',
-        '/data/ttbar/AOD.017065._00334.pool.root.1',
-        '/data/ttbar/AOD.017065._00335.pool.root.1',
-        '/data/ttbar/AOD.017065._00336.pool.root.1',
-        '/data/ttbar/AOD.017065._00337.pool.root.1',
-        '/data/ttbar/AOD.017065._00338.pool.root.1',
-        '/data/ttbar/AOD.017065._00339.pool.root.1',
-        '/data/ttbar/AOD.017065._00341.pool.root.1',
-        '/data/ttbar/AOD.017065._00342.pool.root.1',
-        '/data/ttbar/AOD.017065._00343.pool.root.1',
-        '/data/ttbar/AOD.017065._00344.pool.root.1',
-        '/data/ttbar/AOD.017065._00345.pool.root.1',
-        '/data/ttbar/AOD.017065._00346.pool.root.1',
-        '/data/ttbar/AOD.017065._00347.pool.root.1',
-        '/data/ttbar/AOD.017065._00348.pool.root.1',
-        '/data/ttbar/AOD.017065._00349.pool.root.1',
-        '/data/ttbar/AOD.017065._00350.pool.root.1',
-        '/data/ttbar/AOD.017065._00351.pool.root.1',
-        '/data/ttbar/AOD.017065._00353.pool.root.1',
-        '/data/ttbar/AOD.017065._00354.pool.root.1',
-        '/data/ttbar/AOD.017065._00355.pool.root.1',
-        '/data/ttbar/AOD.017065._00356.pool.root.1',
-        '/data/ttbar/AOD.017065._00358.pool.root.1',
-        '/data/ttbar/AOD.017065._00359.pool.root.1',
-        '/data/ttbar/AOD.017065._00360.pool.root.1',
-        '/data/ttbar/AOD.017065._00361.pool.root.1',
-        '/data/ttbar/AOD.017065._00362.pool.root.1',
-        '/data/ttbar/AOD.017065._00363.pool.root.1',
-        '/data/ttbar/AOD.017065._00366.pool.root.1',
-        '/data/ttbar/AOD.017065._00367.pool.root.1',
-        '/data/ttbar/AOD.017065._00368.pool.root.1',
-        '/data/ttbar/AOD.017065._00370.pool.root.1',
-        '/data/ttbar/AOD.017065._00371.pool.root.1',
-        '/data/ttbar/AOD.017065._00372.pool.root.1',
-        '/data/ttbar/AOD.017065._00373.pool.root.1',
-        '/data/ttbar/AOD.017065._00374.pool.root.1',
-        '/data/ttbar/AOD.017065._00376.pool.root.1',
-        '/data/ttbar/AOD.017065._00377.pool.root.1',
-        '/data/ttbar/AOD.017065._00379.pool.root.1',
-        '/data/ttbar/AOD.017065._00380.pool.root.1',
-        '/data/ttbar/AOD.017065._00381.pool.root.1',
-        '/data/ttbar/AOD.017065._00382.pool.root.1',
-        '/data/ttbar/AOD.017065._00383.pool.root.1',
-        '/data/ttbar/AOD.017065._00386.pool.root.1',
-        '/data/ttbar/AOD.017065._00387.pool.root.1',
-        '/data/ttbar/AOD.017065._00388.pool.root.1',
-        '/data/ttbar/AOD.017065._00389.pool.root.1',
-        '/data/ttbar/AOD.017065._00390.pool.root.1',
-        '/data/ttbar/AOD.017065._00391.pool.root.1',
-        '/data/ttbar/AOD.017065._00393.pool.root.1',
-        '/data/ttbar/AOD.017065._00394.pool.root.1',
-        '/data/ttbar/AOD.017065._00395.pool.root.1',
-        '/data/ttbar/AOD.017065._00396.pool.root.1',
-        '/data/ttbar/AOD.017065._00397.pool.root.1',
-        '/data/ttbar/AOD.017065._00400.pool.root.1',
-        '/data/ttbar/AOD.017065._00401.pool.root.1',
-        '/data/ttbar/AOD.017065._00402.pool.root.1',
-        '/data/ttbar/AOD.017065._00403.pool.root.1',
-        '/data/ttbar/AOD.017065._00404.pool.root.1',
-        '/data/ttbar/AOD.017065._00406.pool.root.1',
-        '/data/ttbar/AOD.017065._00407.pool.root.1',
-        '/data/ttbar/AOD.017065._00408.pool.root.1',
-        '/data/ttbar/AOD.017065._00410.pool.root.1',
-        '/data/ttbar/AOD.017065._00411.pool.root.1',
-        '/data/ttbar/AOD.017065._00412.pool.root.1',
-        '/data/ttbar/AOD.017065._00413.pool.root.1',
-        '/data/ttbar/AOD.017065._00415.pool.root.2',
-        '/data/ttbar/AOD.017065._00416.pool.root.1',
-        '/data/ttbar/AOD.017065._00417.pool.root.1',
-        '/data/ttbar/AOD.017065._00418.pool.root.1',
-        '/data/ttbar/AOD.017065._00419.pool.root.2',
-        '/data/ttbar/AOD.017065._00420.pool.root.1',
-        '/data/ttbar/AOD.017065._00421.pool.root.1',
-        '/data/ttbar/AOD.017065._00422.pool.root.1',
-        '/data/ttbar/AOD.017065._00423.pool.root.1',
-        '/data/ttbar/AOD.017065._00424.pool.root.1',
-        '/data/ttbar/AOD.017065._00425.pool.root.1',
-        '/data/ttbar/AOD.017065._00426.pool.root.1',
-        '/data/ttbar/AOD.017065._00427.pool.root.1',
-        '/data/ttbar/AOD.017065._00429.pool.root.2',
-        '/data/ttbar/AOD.017065._00430.pool.root.3',
-        '/data/ttbar/AOD.017065._00433.pool.root.2',
-        '/data/ttbar/AOD.017065._00435.pool.root.2',
-        '/data/ttbar/AOD.017065._00436.pool.root.2',
-        '/data/ttbar/AOD.017065._00437.pool.root.3',
-        '/data/ttbar/AOD.017065._00438.pool.root.1',
-        '/data/ttbar/AOD.017065._00439.pool.root.1',
-        '/data/ttbar/AOD.017065._00440.pool.root.1',
-        '/data/ttbar/AOD.017065._00441.pool.root.1',
-        '/data/ttbar/AOD.017065._00442.pool.root.1',
-        '/data/ttbar/AOD.017065._00443.pool.root.2',
-        '/data/ttbar/AOD.017065._00444.pool.root.1',
-        '/data/ttbar/AOD.017065._00445.pool.root.1',
-        '/data/ttbar/AOD.017065._00446.pool.root.1',
-        '/data/ttbar/AOD.017065._00447.pool.root.1',
-        '/data/ttbar/AOD.017065._00448.pool.root.1',
-        '/data/ttbar/AOD.017065._00449.pool.root.1',
-        '/data/ttbar/AOD.017065._00451.pool.root.1',
-        '/data/ttbar/AOD.017065._00452.pool.root.1',
-        '/data/ttbar/AOD.017065._00453.pool.root.1',
-        '/data/ttbar/AOD.017065._00457.pool.root.1',
-        '/data/ttbar/AOD.017065._00458.pool.root.1',
-        '/data/ttbar/AOD.017065._00459.pool.root.1',
-        '/data/ttbar/AOD.017065._00462.pool.root.1',
-        '/data/ttbar/AOD.017065._00463.pool.root.1',
-        '/data/ttbar/AOD.017065._00464.pool.root.1',
-        '/data/ttbar/AOD.017065._00465.pool.root.1',
-        '/data/ttbar/AOD.017065._00466.pool.root.1',
-        '/data/ttbar/AOD.017065._00468.pool.root.1',
-        '/data/ttbar/AOD.017065._00469.pool.root.1',
-        '/data/ttbar/AOD.017065._00471.pool.root.1',
-        '/data/ttbar/AOD.017065._00472.pool.root.1',
-        '/data/ttbar/AOD.017065._00474.pool.root.1',
-        '/data/ttbar/AOD.017065._00478.pool.root.1',
-        '/data/ttbar/AOD.017065._00480.pool.root.2']
-    done = True
-
-if mode=="WpZ" :
-    print "running on WpZ data run 5941"
-    EventSelector.InputCollections = [
-         '/data/ZW/AOD.014459._00201.pool.root.1',
-         '/data/ZW/AOD.014459._00202.pool.root.1',
-         '/data/ZW/AOD.014459._00203.pool.root.1',
-         '/data/ZW/AOD.014459._00204.pool.root.1',
-         '/data/ZW/AOD.014459._00205.pool.root.1',
-         '/data/ZW/AOD.014459._00206.pool.root.1',
-         '/data/ZW/AOD.014459._00207.pool.root.1',
-         '/data/ZW/AOD.014459._00208.pool.root.1',
-         '/data/ZW/AOD.014459._00209.pool.root.1',
-         '/data/ZW/AOD.014459._00210.pool.root.1',
-         '/data/ZW/AOD.014459._00211.pool.root.1',
-         '/data/ZW/AOD.014459._00212.pool.root.1',
-         '/data/ZW/AOD.014459._00213.pool.root.1',
-         '/data/ZW/AOD.014459._00214.pool.root.1',
-         '/data/ZW/AOD.014459._00215.pool.root.1',
-         '/data/ZW/AOD.014459._00216.pool.root.1',
-         '/data/ZW/AOD.014459._00217.pool.root.1',
-         '/data/ZW/AOD.014459._00218.pool.root.1',
-         '/data/ZW/AOD.014459._00219.pool.root.1',
-         '/data/ZW/AOD.014459._00220.pool.root.1',
-         '/data/ZW/AOD.014459._00221.pool.root.1',
-         '/data/ZW/AOD.014459._00222.pool.root.1',
-         '/data/ZW/AOD.014459._00223.pool.root.1',
-         '/data/ZW/AOD.014459._00224.pool.root.1',
-         '/data/ZW/AOD.014459._00225.pool.root.1',
-         '/data/ZW/AOD.014459._00226.pool.root.1',
-         '/data/ZW/AOD.014459._00227.pool.root.1',
-         '/data/ZW/AOD.014459._00228.pool.root.1',
-         '/data/ZW/AOD.014459._00229.pool.root.1',
-         '/data/ZW/AOD.014459._00230.pool.root.1',
-         '/data/ZW/AOD.014459._00231.pool.root.1',
-         '/data/ZW/AOD.014459._00233.pool.root.1',
-         '/data/ZW/AOD.014459._00234.pool.root.1',
-         '/data/ZW/AOD.014459._00235.pool.root.1',
-         '/data/ZW/AOD.014459._00236.pool.root.1',
-         '/data/ZW/AOD.014459._00237.pool.root.1',
-         '/data/ZW/AOD.014459._00238.pool.root.1',
-         '/data/ZW/AOD.014459._00239.pool.root.1',
-         '/data/ZW/AOD.014459._00240.pool.root.1',
-         '/data/ZW/AOD.014459._00241.pool.root.1',
-         '/data/ZW/AOD.014459._00242.pool.root.1',
-         '/data/ZW/AOD.014459._00243.pool.root.1',
-         '/data/ZW/AOD.014459._00244.pool.root.1',
-         '/data/ZW/AOD.014459._00245.pool.root.1',
-         '/data/ZW/AOD.014459._00246.pool.root.1',
-         '/data/ZW/AOD.014459._00247.pool.root.1',
-         '/data/ZW/AOD.014459._00248.pool.root.1',
-         '/data/ZW/AOD.014459._00249.pool.root.1',
-         '/data/ZW/AOD.014459._00250.pool.root.1',
-         '/data/ZW/AOD.014459._00251.pool.root.1',
-         '/data/ZW/AOD.014459._00252.pool.root.1',
-         '/data/ZW/AOD.014459._00253.pool.root.1',
-         '/data/ZW/AOD.014459._00254.pool.root.1',
-         '/data/ZW/AOD.014459._00255.pool.root.1',
-         '/data/ZW/AOD.014459._00256.pool.root.1',
-         '/data/ZW/AOD.014459._00258.pool.root.1',
-         '/data/ZW/AOD.014459._00259.pool.root.1',
-         '/data/ZW/AOD.014459._00260.pool.root.1',
-         '/data/ZW/AOD.014459._00261.pool.root.1',
-         '/data/ZW/AOD.014459._00262.pool.root.1',
-         '/data/ZW/AOD.014459._00263.pool.root.1',
-         '/data/ZW/AOD.014459._00264.pool.root.1',
-         '/data/ZW/AOD.014459._00265.pool.root.1',
-         '/data/ZW/AOD.014459._00266.pool.root.1',
-         '/data/ZW/AOD.014459._00267.pool.root.1',
-         '/data/ZW/AOD.014459._00268.pool.root.1',
-         '/data/ZW/AOD.014459._00269.pool.root.1',
-         '/data/ZW/AOD.014459._00270.pool.root.1',
-         '/data/ZW/AOD.014459._00271.pool.root.1',
-         '/data/ZW/AOD.014459._00272.pool.root.1',
-         '/data/ZW/AOD.014459._00273.pool.root.1',
-         '/data/ZW/AOD.014459._00274.pool.root.1',
-         '/data/ZW/AOD.014459._00275.pool.root.1',
-         '/data/ZW/AOD.014459._00277.pool.root.1',
-         '/data/ZW/AOD.014459._00278.pool.root.1',
-         '/data/ZW/AOD.014459._00279.pool.root.1',
-         '/data/ZW/AOD.014459._00280.pool.root.1',
-         '/data/ZW/AOD.014459._00281.pool.root.1',
-         '/data/ZW/AOD.014459._00282.pool.root.1',
-         '/data/ZW/AOD.014459._00283.pool.root.1',
-         '/data/ZW/AOD.014459._00284.pool.root.1',
-         '/data/ZW/AOD.014459._00285.pool.root.1',
-         '/data/ZW/AOD.014459._00286.pool.root.1',
-         '/data/ZW/AOD.014459._00287.pool.root.1',
-         '/data/ZW/AOD.014459._00288.pool.root.1',
-         '/data/ZW/AOD.014459._00289.pool.root.1',
-         '/data/ZW/AOD.014459._00290.pool.root.1',
-         '/data/ZW/AOD.014459._00291.pool.root.1',
-         '/data/ZW/AOD.014459._00292.pool.root.1',
-         '/data/ZW/AOD.014459._00293.pool.root.1',
-         '/data/ZW/AOD.014459._00294.pool.root.1',
-         '/data/ZW/AOD.014459._00295.pool.root.1',
-         '/data/ZW/AOD.014459._00296.pool.root.1',
-         '/data/ZW/AOD.014459._00297.pool.root.1',
-         '/data/ZW/AOD.014459._00298.pool.root.1',
-         '/data/ZW/AOD.014459._00299.pool.root.1',
-         '/data/ZW/AOD.014459._00300.pool.root.1',
-         '/data/ZW/AOD.014459._00301.pool.root.1',
-         '/data/ZW/AOD.014459._00302.pool.root.1',
-         '/data/ZW/AOD.014459._00303.pool.root.1',
-         '/data/ZW/AOD.014459._00304.pool.root.1',
-         '/data/ZW/AOD.014459._00305.pool.root.1',
-         '/data/ZW/AOD.014459._00306.pool.root.1',
-         '/data/ZW/AOD.014459._00308.pool.root.1',
-         '/data/ZW/AOD.014459._00309.pool.root.1',
-         '/data/ZW/AOD.014459._00310.pool.root.1',
-         '/data/ZW/AOD.014459._00311.pool.root.1',
-         '/data/ZW/AOD.014459._00312.pool.root.1',
-         '/data/ZW/AOD.014459._00313.pool.root.1',
-         '/data/ZW/AOD.014459._00314.pool.root.1',
-         '/data/ZW/AOD.014459._00315.pool.root.1',
-         '/data/ZW/AOD.014459._00316.pool.root.1',
-         '/data/ZW/AOD.014459._00317.pool.root.1',
-         '/data/ZW/AOD.014459._00318.pool.root.1',
-         '/data/ZW/AOD.014459._00319.pool.root.1',
-         '/data/ZW/AOD.014459._00320.pool.root.1',
-         '/data/ZW/AOD.014459._00321.pool.root.1',
-         '/data/ZW/AOD.014459._00322.pool.root.1',
-         '/data/ZW/AOD.014459._00323.pool.root.1',
-         '/data/ZW/AOD.014459._00324.pool.root.1',
-         '/data/ZW/AOD.014459._00325.pool.root.1',
-         '/data/ZW/AOD.014459._00326.pool.root.1',
-         '/data/ZW/AOD.014459._00327.pool.root.1',
-         '/data/ZW/AOD.014459._00328.pool.root.1',
-         '/data/ZW/AOD.014459._00329.pool.root.1',
-         '/data/ZW/AOD.014459._00330.pool.root.1',
-         '/data/ZW/AOD.014459._00331.pool.root.1',
-         '/data/ZW/AOD.014459._00332.pool.root.1',
-         '/data/ZW/AOD.014459._00333.pool.root.1',
-         '/data/ZW/AOD.014459._00334.pool.root.1',
-         '/data/ZW/AOD.014459._00335.pool.root.1',
-         '/data/ZW/AOD.014459._00336.pool.root.1',
-         '/data/ZW/AOD.014459._00337.pool.root.1',
-         '/data/ZW/AOD.014459._00338.pool.root.1',
-         '/data/ZW/AOD.014459._00339.pool.root.1',
-         '/data/ZW/AOD.014459._00340.pool.root.1',
-         '/data/ZW/AOD.014459._00341.pool.root.1',
-         '/data/ZW/AOD.014459._00342.pool.root.1',
-         '/data/ZW/AOD.014459._00343.pool.root.1',
-         '/data/ZW/AOD.014459._00344.pool.root.1',
-         '/data/ZW/AOD.014459._00345.pool.root.1',
-         '/data/ZW/AOD.014459._00346.pool.root.1',
-         '/data/ZW/AOD.014459._00347.pool.root.1',
-         '/data/ZW/AOD.014459._00348.pool.root.1',
-         '/data/ZW/AOD.014459._00349.pool.root.1',
-         '/data/ZW/AOD.014459._00350.pool.root.1',
-         '/data/ZW/AOD.014459._00351.pool.root.1',
-         '/data/ZW/AOD.014459._00352.pool.root.1',
-         '/data/ZW/AOD.014459._00353.pool.root.1',
-         '/data/ZW/AOD.014459._00354.pool.root.1',
-         '/data/ZW/AOD.014459._00355.pool.root.1',
-         '/data/ZW/AOD.014459._00356.pool.root.1',
-         '/data/ZW/AOD.014459._00357.pool.root.1',
-         '/data/ZW/AOD.014459._00358.pool.root.1',
-         '/data/ZW/AOD.014459._00359.pool.root.1',
-         '/data/ZW/AOD.014459._00360.pool.root.1',
-         '/data/ZW/AOD.014459._00361.pool.root.1',
-         '/data/ZW/AOD.014459._00363.pool.root.1',
-         '/data/ZW/AOD.014459._00364.pool.root.1',
-         '/data/ZW/AOD.014459._00365.pool.root.1',
-         '/data/ZW/AOD.014459._00366.pool.root.1',
-         '/data/ZW/AOD.014459._00367.pool.root.1',
-         '/data/ZW/AOD.014459._00368.pool.root.1',
-         '/data/ZW/AOD.014459._00369.pool.root.1',
-         '/data/ZW/AOD.014459._00370.pool.root.1',
-         '/data/ZW/AOD.014459._00371.pool.root.1',
-         '/data/ZW/AOD.014459._00372.pool.root.1',
-         '/data/ZW/AOD.014459._00373.pool.root.1',
-         '/data/ZW/AOD.014459._00374.pool.root.1',
-         '/data/ZW/AOD.014459._00375.pool.root.1',
-         '/data/ZW/AOD.014459._00376.pool.root.1',
-         '/data/ZW/AOD.014459._00377.pool.root.1',
-         '/data/ZW/AOD.014459._00378.pool.root.1',
-         '/data/ZW/AOD.014459._00379.pool.root.1',
-         '/data/ZW/AOD.014459._00380.pool.root.1',
-         '/data/ZW/AOD.014459._00381.pool.root.1',
-         '/data/ZW/AOD.014459._00382.pool.root.1',
-         '/data/ZW/AOD.014459._00383.pool.root.1',
-         '/data/ZW/AOD.014459._00384.pool.root.1',
-         '/data/ZW/AOD.014459._00385.pool.root.1',
-         '/data/ZW/AOD.014459._00386.pool.root.1',
-         '/data/ZW/AOD.014459._00387.pool.root.1',
-         '/data/ZW/AOD.014459._00388.pool.root.1',
-         '/data/ZW/AOD.014459._00389.pool.root.1',
-         '/data/ZW/AOD.014459._00390.pool.root.1',
-         '/data/ZW/AOD.014459._00391.pool.root.1',
-         '/data/ZW/AOD.014459._00392.pool.root.1',
-         '/data/ZW/AOD.014459._00393.pool.root.1',
-         '/data/ZW/AOD.014459._00394.pool.root.1',
-         '/data/ZW/AOD.014459._00395.pool.root.1',
-         '/data/ZW/AOD.014459._00396.pool.root.1',
-         '/data/ZW/AOD.014459._00397.pool.root.1',
-         '/data/ZW/AOD.014459._00398.pool.root.1',
-         '/data/ZW/AOD.014459._00399.pool.root.1',
-         '/data/ZW/AOD.014459._00400.pool.root.1',
-         '/data/ZW/AOD.014459._00401.pool.root.1',
-         '/data/ZW/AOD.014459._00402.pool.root.1',
-         '/data/ZW/AOD.014459._00403.pool.root.1',
-         '/data/ZW/AOD.014459._00404.pool.root.1',
-         '/data/ZW/AOD.014459._00405.pool.root.2',
-         '/data/ZW/AOD.014459._00406.pool.root.1',
-         '/data/ZW/AOD.014459._00407.pool.root.1',
-         '/data/ZW/AOD.014459._00408.pool.root.1',
-         '/data/ZW/AOD.014459._00409.pool.root.1',
-         '/data/ZW/AOD.014459._00410.pool.root.1',
-         '/data/ZW/AOD.014459._00411.pool.root.1',
-         '/data/ZW/AOD.014459._00412.pool.root.1',
-         '/data/ZW/AOD.014459._00413.pool.root.1',
-         '/data/ZW/AOD.014459._00414.pool.root.1',
-         '/data/ZW/AOD.014459._00415.pool.root.1',
-         '/data/ZW/AOD.014459._00416.pool.root.2',
-         '/data/ZW/AOD.014459._00417.pool.root.1',
-         '/data/ZW/AOD.014459._00418.pool.root.1',
-         '/data/ZW/AOD.014459._00419.pool.root.1',
-         '/data/ZW/AOD.014459._00420.pool.root.1',
-         '/data/ZW/AOD.014459._00421.pool.root.1',
-         '/data/ZW/AOD.014459._00422.pool.root.1',
-         '/data/ZW/AOD.014459._00423.pool.root.1',
-         '/data/ZW/AOD.014459._00424.pool.root.1',
-         '/data/ZW/AOD.014459._00425.pool.root.1',
-         '/data/ZW/AOD.014459._00426.pool.root.1',
-         '/data/ZW/AOD.014459._00427.pool.root.1',
-         '/data/ZW/AOD.014459._00428.pool.root.1',
-         '/data/ZW/AOD.014459._00429.pool.root.1',
-         '/data/ZW/AOD.014459._00430.pool.root.1',
-         '/data/ZW/AOD.014459._00431.pool.root.1',
-         '/data/ZW/AOD.014459._00432.pool.root.1',
-         '/data/ZW/AOD.014459._00433.pool.root.1',
-         '/data/ZW/AOD.014459._00434.pool.root.1',
-         '/data/ZW/AOD.014459._00435.pool.root.1',
-         '/data/ZW/AOD.014459._00436.pool.root.1',
-         '/data/ZW/AOD.014459._00437.pool.root.1',
-         '/data/ZW/AOD.014459._00438.pool.root.1',
-         '/data/ZW/AOD.014459._00439.pool.root.1',
-         '/data/ZW/AOD.014459._00440.pool.root.1',
-         '/data/ZW/AOD.014459._00441.pool.root.1',
-         '/data/ZW/AOD.014459._00442.pool.root.1',
-         '/data/ZW/AOD.014459._00443.pool.root.1',
-         '/data/ZW/AOD.014459._00444.pool.root.1',
-         '/data/ZW/AOD.014459._00445.pool.root.1',
-         '/data/ZW/AOD.014459._00446.pool.root.1',
-         '/data/ZW/AOD.014459._00447.pool.root.1',
-         '/data/ZW/AOD.014459._00448.pool.root.1',
-         '/data/ZW/AOD.014459._00449.pool.root.1',
-         '/data/ZW/AOD.014459._00450.pool.root.1',
-         '/data/ZW/AOD.014459._00451.pool.root.1',
-         '/data/ZW/AOD.014459._00452.pool.root.1',
-         '/data/ZW/AOD.014459._00453.pool.root.1',
-         '/data/ZW/AOD.014459._00454.pool.root.1',
-         '/data/ZW/AOD.014459._00455.pool.root.1',
-         '/data/ZW/AOD.014459._00456.pool.root.1',
-         '/data/ZW/AOD.014459._00457.pool.root.1',
-         '/data/ZW/AOD.014459._00458.pool.root.1',
-         '/data/ZW/AOD.014459._00459.pool.root.1',
-         '/data/ZW/AOD.014459._00460.pool.root.1',
-         '/data/ZW/AOD.014459._00461.pool.root.1',
-         '/data/ZW/AOD.014459._00462.pool.root.1',
-         '/data/ZW/AOD.014459._00463.pool.root.1',
-         '/data/ZW/AOD.014459._00464.pool.root.1',
-         '/data/ZW/AOD.014459._00465.pool.root.1',
-         '/data/ZW/AOD.014459._00466.pool.root.1',
-         '/data/ZW/AOD.014459._00467.pool.root.1',
-         '/data/ZW/AOD.014459._00468.pool.root.1',
-         '/data/ZW/AOD.014459._00469.pool.root.1',
-         '/data/ZW/AOD.014459._00470.pool.root.1',
-         '/data/ZW/AOD.014459._00471.pool.root.1',
-         '/data/ZW/AOD.014459._00472.pool.root.1',
-         '/data/ZW/AOD.014459._00473.pool.root.1',
-         '/data/ZW/AOD.014459._00474.pool.root.1',
-         '/data/ZW/AOD.014459._00475.pool.root.1',
-         '/data/ZW/AOD.014459._00476.pool.root.1',
-         '/data/ZW/AOD.014459._00477.pool.root.1',
-         '/data/ZW/AOD.014459._00478.pool.root.1',
-         '/data/ZW/AOD.014459._00479.pool.root.1',
-         '/data/ZW/AOD.014459._00480.pool.root.1',
-         '/data/ZW/AOD.014459._00481.pool.root.1',
-         '/data/ZW/AOD.014459._00482.pool.root.1',
-         '/data/ZW/AOD.014459._00483.pool.root.1',
-         '/data/ZW/AOD.014459._00484.pool.root.1',
-         '/data/ZW/AOD.014459._00485.pool.root.1',
-         '/data/ZW/AOD.014459._00486.pool.root.1',
-         '/data/ZW/AOD.014459._00487.pool.root.1',
-         '/data/ZW/AOD.014459._00488.pool.root.1',
-         '/data/ZW/AOD.014459._00489.pool.root.1',
-         '/data/ZW/AOD.014459._00490.pool.root.1',
-         '/data/ZW/AOD.014459._00491.pool.root.1',
-         '/data/ZW/AOD.014459._00492.pool.root.1',
-         '/data/ZW/AOD.014459._00493.pool.root.1',
-         '/data/ZW/AOD.014459._00494.pool.root.1',
-         '/data/ZW/AOD.014459._00495.pool.root.1',
-         '/data/ZW/AOD.014459._00496.pool.root.1',
-         '/data/ZW/AOD.014459._00497.pool.root.1',
-         '/data/ZW/AOD.014459._00498.pool.root.1',
-         '/data/ZW/AOD.014459._00499.pool.root.1',
-         '/data/ZW/AOD.014459._00500.pool.root.1',
-         '/data/ZW/AOD.014459._00501.pool.root.1',
-         '/data/ZW/AOD.014459._00502.pool.root.1',
-         '/data/ZW/AOD.014459._00503.pool.root.1',
-         '/data/ZW/AOD.014459._00504.pool.root.1',
-         '/data/ZW/AOD.014459._00505.pool.root.1',
-         '/data/ZW/AOD.014459._00506.pool.root.1',
-         '/data/ZW/AOD.014459._00507.pool.root.1',
-         '/data/ZW/AOD.014459._00508.pool.root.1',
-         '/data/ZW/AOD.014459._00509.pool.root.1',
-         '/data/ZW/AOD.014459._00510.pool.root.1',
-         '/data/ZW/AOD.014459._00511.pool.root.1',
-         '/data/ZW/AOD.014459._00512.pool.root.1',
-         '/data/ZW/AOD.014459._00513.pool.root.1',
-         '/data/ZW/AOD.014459._00514.pool.root.1',
-         '/data/ZW/AOD.014459._00515.pool.root.1',
-         '/data/ZW/AOD.014459._00516.pool.root.1',
-         '/data/ZW/AOD.014459._00517.pool.root.1',
-         '/data/ZW/AOD.014459._00518.pool.root.1',
-         '/data/ZW/AOD.014459._00519.pool.root.1',
-         '/data/ZW/AOD.014459._00520.pool.root.1',
-         '/data/ZW/AOD.014459._00521.pool.root.1',
-         '/data/ZW/AOD.014459._00522.pool.root.1',
-         '/data/ZW/AOD.014459._00523.pool.root.1',
-         '/data/ZW/AOD.014459._00524.pool.root.1',
-         '/data/ZW/AOD.014459._00525.pool.root.1',
-         '/data/ZW/AOD.014459._00526.pool.root.1',
-         '/data/ZW/AOD.014459._00527.pool.root.1',
-         '/data/ZW/AOD.014459._00528.pool.root.1',
-         '/data/ZW/AOD.014459._00529.pool.root.1',
-         '/data/ZW/AOD.014459._00530.pool.root.1',
-         '/data/ZW/AOD.014459._00531.pool.root.1',
-         '/data/ZW/AOD.014459._00532.pool.root.1',
-         '/data/ZW/AOD.014459._00533.pool.root.1',
-         '/data/ZW/AOD.014459._00534.pool.root.1',
-         '/data/ZW/AOD.014459._00535.pool.root.1',
-         '/data/ZW/AOD.014459._00536.pool.root.1',
-         '/data/ZW/AOD.014459._00537.pool.root.1',
-         '/data/ZW/AOD.014459._00538.pool.root.1',
-         '/data/ZW/AOD.014459._00539.pool.root.1',
-         '/data/ZW/AOD.014459._00540.pool.root.1',
-         '/data/ZW/AOD.014459._00541.pool.root.1',
-         '/data/ZW/AOD.014459._00542.pool.root.1',
-         '/data/ZW/AOD.014459._00543.pool.root.1',
-         '/data/ZW/AOD.014459._00544.pool.root.1',
-         '/data/ZW/AOD.014459._00545.pool.root.1',
-         '/data/ZW/AOD.014459._00546.pool.root.1',
-         '/data/ZW/AOD.014459._00547.pool.root.1',
-         '/data/ZW/AOD.014459._00548.pool.root.1',
-         '/data/ZW/AOD.014459._00549.pool.root.1',
-         '/data/ZW/AOD.014459._00550.pool.root.1',
-         '/data/ZW/AOD.014459._00551.pool.root.2',
-         '/data/ZW/AOD.014459._00552.pool.root.2',
-         '/data/ZW/AOD.014459._00553.pool.root.2',
-         '/data/ZW/AOD.014459._00554.pool.root.2',
-         '/data/ZW/AOD.014459._00555.pool.root.2',
-         '/data/ZW/AOD.014459._00556.pool.root.2',
-         '/data/ZW/AOD.014459._00557.pool.root.2',
-         '/data/ZW/AOD.014459._00558.pool.root.1',
-         '/data/ZW/AOD.014459._00559.pool.root.1',
-         '/data/ZW/AOD.014459._00560.pool.root.1',
-         '/data/ZW/AOD.014459._00561.pool.root.1',
-         '/data/ZW/AOD.014459._00562.pool.root.1',
-         '/data/ZW/AOD.014459._00563.pool.root.1',
-         '/data/ZW/AOD.014459._00564.pool.root.1',
-         '/data/ZW/AOD.014459._00565.pool.root.1',
-         '/data/ZW/AOD.014459._00566.pool.root.1',
-         '/data/ZW/AOD.014459._00567.pool.root.1',
-         '/data/ZW/AOD.014459._00568.pool.root.1',
-         '/data/ZW/AOD.014459._00569.pool.root.1',
-         '/data/ZW/AOD.014459._00570.pool.root.1',
-         '/data/ZW/AOD.014459._00571.pool.root.1',
-         '/data/ZW/AOD.014459._00572.pool.root.1',
-         '/data/ZW/AOD.014459._00573.pool.root.1',
-         '/data/ZW/AOD.014459._00574.pool.root.1',
-         '/data/ZW/AOD.014459._00575.pool.root.1',
-         '/data/ZW/AOD.014459._00576.pool.root.2',
-         '/data/ZW/AOD.014459._00577.pool.root.4',
-         '/data/ZW/AOD.014459._00578.pool.root.4',
-         '/data/ZW/AOD.014459._00579.pool.root.3',
-         '/data/ZW/AOD.014459._00580.pool.root.4',
-         '/data/ZW/AOD.014459._00581.pool.root.4',
-         '/data/ZW/AOD.014459._00582.pool.root.4',
-         '/data/ZW/AOD.014459._00583.pool.root.4',
-         '/data/ZW/AOD.014459._00584.pool.root.4',
-         '/data/ZW/AOD.014459._00585.pool.root.4',
-         '/data/ZW/AOD.014459._00587.pool.root.4',
-         '/data/ZW/AOD.014459._00588.pool.root.4',
-         '/data/ZW/AOD.014459._00589.pool.root.4',
-         '/data/ZW/AOD.014459._00590.pool.root.4',
-         '/data/ZW/AOD.014459._00591.pool.root.4',
-         '/data/ZW/AOD.014459._00592.pool.root.4',
-         '/data/ZW/AOD.014459._00593.pool.root.1',
-         '/data/ZW/AOD.014459._00594.pool.root.1',
-         '/data/ZW/AOD.014459._00595.pool.root.1',
-         '/data/ZW/AOD.014459._00596.pool.root.1',
-         '/data/ZW/AOD.014459._00597.pool.root.1',
-         '/data/ZW/AOD.014459._00598.pool.root.1',
-         '/data/ZW/AOD.014459._00599.pool.root.1',
-         '/data/ZW/AOD.014459._00600.pool.root.1']
-    done = True
-
-if mode=="WmZ" :
-    print "running on WmZ data run 5971"
-    EventSelector.InputCollections = [
-         '/data/ZW/AOD.014461._00201.pool.root.1',
-         '/data/ZW/AOD.014461._00202.pool.root.1',
-         '/data/ZW/AOD.014461._00203.pool.root.1',
-         '/data/ZW/AOD.014461._00204.pool.root.1',
-         '/data/ZW/AOD.014461._00205.pool.root.1',
-         '/data/ZW/AOD.014461._00206.pool.root.1',
-         '/data/ZW/AOD.014461._00207.pool.root.1',
-         '/data/ZW/AOD.014461._00208.pool.root.1',
-         '/data/ZW/AOD.014461._00209.pool.root.1',
-         '/data/ZW/AOD.014461._00210.pool.root.1',
-         '/data/ZW/AOD.014461._00211.pool.root.1',
-         '/data/ZW/AOD.014461._00212.pool.root.1',
-         '/data/ZW/AOD.014461._00213.pool.root.1',
-         '/data/ZW/AOD.014461._00214.pool.root.1',
-         '/data/ZW/AOD.014461._00215.pool.root.1',
-         '/data/ZW/AOD.014461._00216.pool.root.1',
-         '/data/ZW/AOD.014461._00217.pool.root.1',
-         '/data/ZW/AOD.014461._00218.pool.root.1',
-         '/data/ZW/AOD.014461._00219.pool.root.1',
-         '/data/ZW/AOD.014461._00220.pool.root.1',
-         '/data/ZW/AOD.014461._00221.pool.root.1',
-         '/data/ZW/AOD.014461._00222.pool.root.1',
-         '/data/ZW/AOD.014461._00223.pool.root.1',
-         '/data/ZW/AOD.014461._00224.pool.root.1',
-         '/data/ZW/AOD.014461._00225.pool.root.1',
-         '/data/ZW/AOD.014461._00226.pool.root.1',
-         '/data/ZW/AOD.014461._00227.pool.root.1',
-         '/data/ZW/AOD.014461._00228.pool.root.1',
-         '/data/ZW/AOD.014461._00229.pool.root.1',
-         '/data/ZW/AOD.014461._00230.pool.root.1',
-         '/data/ZW/AOD.014461._00231.pool.root.1',
-         '/data/ZW/AOD.014461._00232.pool.root.1',
-         '/data/ZW/AOD.014461._00233.pool.root.1',
-         '/data/ZW/AOD.014461._00234.pool.root.1',
-         '/data/ZW/AOD.014461._00235.pool.root.1',
-         '/data/ZW/AOD.014461._00236.pool.root.1',
-         '/data/ZW/AOD.014461._00237.pool.root.1',
-         '/data/ZW/AOD.014461._00238.pool.root.1',
-         '/data/ZW/AOD.014461._00239.pool.root.1',
-         '/data/ZW/AOD.014461._00240.pool.root.1',
-         '/data/ZW/AOD.014461._00241.pool.root.1',
-         '/data/ZW/AOD.014461._00242.pool.root.1',
-         '/data/ZW/AOD.014461._00243.pool.root.1',
-         '/data/ZW/AOD.014461._00244.pool.root.1',
-         '/data/ZW/AOD.014461._00245.pool.root.1',
-         '/data/ZW/AOD.014461._00246.pool.root.1',
-         '/data/ZW/AOD.014461._00247.pool.root.1',
-         '/data/ZW/AOD.014461._00248.pool.root.1',
-         '/data/ZW/AOD.014461._00249.pool.root.1',
-         '/data/ZW/AOD.014461._00250.pool.root.1',
-         '/data/ZW/AOD.014461._00251.pool.root.1',
-         '/data/ZW/AOD.014461._00252.pool.root.1',
-         '/data/ZW/AOD.014461._00253.pool.root.3',
-         '/data/ZW/AOD.014461._00254.pool.root.1',
-         '/data/ZW/AOD.014461._00255.pool.root.1',
-         '/data/ZW/AOD.014461._00256.pool.root.1',
-         '/data/ZW/AOD.014461._00257.pool.root.1',
-         '/data/ZW/AOD.014461._00258.pool.root.1',
-         '/data/ZW/AOD.014461._00259.pool.root.1',
-         '/data/ZW/AOD.014461._00260.pool.root.1',
-         '/data/ZW/AOD.014461._00261.pool.root.1',
-         '/data/ZW/AOD.014461._00262.pool.root.1',
-         '/data/ZW/AOD.014461._00263.pool.root.1',
-         '/data/ZW/AOD.014461._00264.pool.root.1',
-         '/data/ZW/AOD.014461._00265.pool.root.1',
-         '/data/ZW/AOD.014461._00266.pool.root.1',
-         '/data/ZW/AOD.014461._00267.pool.root.1',
-         '/data/ZW/AOD.014461._00268.pool.root.1',
-         '/data/ZW/AOD.014461._00269.pool.root.1',
-         '/data/ZW/AOD.014461._00270.pool.root.1',
-         '/data/ZW/AOD.014461._00271.pool.root.1',
-         '/data/ZW/AOD.014461._00272.pool.root.1',
-         '/data/ZW/AOD.014461._00273.pool.root.1',
-         '/data/ZW/AOD.014461._00274.pool.root.1',
-         '/data/ZW/AOD.014461._00275.pool.root.1',
-         '/data/ZW/AOD.014461._00276.pool.root.1',
-         '/data/ZW/AOD.014461._00277.pool.root.1',
-         '/data/ZW/AOD.014461._00278.pool.root.1',
-         '/data/ZW/AOD.014461._00279.pool.root.1',
-         '/data/ZW/AOD.014461._00280.pool.root.1',
-         '/data/ZW/AOD.014461._00281.pool.root.1',
-         '/data/ZW/AOD.014461._00282.pool.root.1',
-         '/data/ZW/AOD.014461._00283.pool.root.1',
-         '/data/ZW/AOD.014461._00284.pool.root.1',
-         '/data/ZW/AOD.014461._00285.pool.root.1',
-         '/data/ZW/AOD.014461._00286.pool.root.1',
-         '/data/ZW/AOD.014461._00287.pool.root.1',
-         '/data/ZW/AOD.014461._00288.pool.root.1',
-         '/data/ZW/AOD.014461._00289.pool.root.1',
-         '/data/ZW/AOD.014461._00290.pool.root.1',
-         '/data/ZW/AOD.014461._00291.pool.root.1',
-         '/data/ZW/AOD.014461._00292.pool.root.1',
-         '/data/ZW/AOD.014461._00293.pool.root.1',
-         '/data/ZW/AOD.014461._00294.pool.root.1',
-         '/data/ZW/AOD.014461._00295.pool.root.1',
-         '/data/ZW/AOD.014461._00296.pool.root.1',
-         '/data/ZW/AOD.014461._00297.pool.root.1',
-         '/data/ZW/AOD.014461._00298.pool.root.1',
-         '/data/ZW/AOD.014461._00299.pool.root.1',
-         '/data/ZW/AOD.014461._00300.pool.root.1',
-         '/data/ZW/AOD.014461._00301.pool.root.1',
-         '/data/ZW/AOD.014461._00302.pool.root.1',
-         '/data/ZW/AOD.014461._00303.pool.root.1',
-         '/data/ZW/AOD.014461._00304.pool.root.1',
-         '/data/ZW/AOD.014461._00305.pool.root.1',
-         '/data/ZW/AOD.014461._00306.pool.root.1',
-         '/data/ZW/AOD.014461._00307.pool.root.1',
-         '/data/ZW/AOD.014461._00308.pool.root.1',
-         '/data/ZW/AOD.014461._00309.pool.root.1',
-         '/data/ZW/AOD.014461._00310.pool.root.1',
-         '/data/ZW/AOD.014461._00311.pool.root.1',
-         '/data/ZW/AOD.014461._00312.pool.root.1',
-         '/data/ZW/AOD.014461._00313.pool.root.1',
-         '/data/ZW/AOD.014461._00314.pool.root.1',
-         '/data/ZW/AOD.014461._00315.pool.root.1',
-         '/data/ZW/AOD.014461._00316.pool.root.1',
-         '/data/ZW/AOD.014461._00317.pool.root.1',
-         '/data/ZW/AOD.014461._00318.pool.root.1',
-         '/data/ZW/AOD.014461._00319.pool.root.1',
-         '/data/ZW/AOD.014461._00320.pool.root.1',
-         '/data/ZW/AOD.014461._00321.pool.root.1',
-         '/data/ZW/AOD.014461._00322.pool.root.1',
-         '/data/ZW/AOD.014461._00323.pool.root.1',
-         '/data/ZW/AOD.014461._00324.pool.root.1',
-         '/data/ZW/AOD.014461._00325.pool.root.1',
-         '/data/ZW/AOD.014461._00326.pool.root.1',
-         '/data/ZW/AOD.014461._00327.pool.root.1',
-         '/data/ZW/AOD.014461._00328.pool.root.1',
-         '/data/ZW/AOD.014461._00329.pool.root.1',
-         '/data/ZW/AOD.014461._00330.pool.root.1',
-         '/data/ZW/AOD.014461._00331.pool.root.1',
-         '/data/ZW/AOD.014461._00332.pool.root.1',
-         '/data/ZW/AOD.014461._00333.pool.root.1',
-         '/data/ZW/AOD.014461._00334.pool.root.1',
-         '/data/ZW/AOD.014461._00335.pool.root.1',
-         '/data/ZW/AOD.014461._00336.pool.root.1',
-         '/data/ZW/AOD.014461._00337.pool.root.1',
-         '/data/ZW/AOD.014461._00338.pool.root.1',
-         '/data/ZW/AOD.014461._00339.pool.root.1',
-         '/data/ZW/AOD.014461._00340.pool.root.1',
-         '/data/ZW/AOD.014461._00341.pool.root.1',
-         '/data/ZW/AOD.014461._00342.pool.root.1',
-         '/data/ZW/AOD.014461._00344.pool.root.1',
-         '/data/ZW/AOD.014461._00345.pool.root.1',
-         '/data/ZW/AOD.014461._00346.pool.root.1',
-         '/data/ZW/AOD.014461._00347.pool.root.1',
-         '/data/ZW/AOD.014461._00348.pool.root.1',
-         '/data/ZW/AOD.014461._00349.pool.root.1',
-         '/data/ZW/AOD.014461._00350.pool.root.1',
-         '/data/ZW/AOD.014461._00351.pool.root.1',
-         '/data/ZW/AOD.014461._00352.pool.root.1',
-         '/data/ZW/AOD.014461._00353.pool.root.1',
-         '/data/ZW/AOD.014461._00354.pool.root.1',
-         '/data/ZW/AOD.014461._00355.pool.root.1',
-         '/data/ZW/AOD.014461._00356.pool.root.1',
-         '/data/ZW/AOD.014461._00357.pool.root.1',
-         '/data/ZW/AOD.014461._00358.pool.root.1',
-         '/data/ZW/AOD.014461._00359.pool.root.1',
-         '/data/ZW/AOD.014461._00360.pool.root.1',
-         '/data/ZW/AOD.014461._00361.pool.root.1',
-         '/data/ZW/AOD.014461._00362.pool.root.1',
-         '/data/ZW/AOD.014461._00363.pool.root.1',
-         '/data/ZW/AOD.014461._00364.pool.root.1',
-         '/data/ZW/AOD.014461._00365.pool.root.1',
-         '/data/ZW/AOD.014461._00366.pool.root.1',
-         '/data/ZW/AOD.014461._00367.pool.root.1',
-         '/data/ZW/AOD.014461._00368.pool.root.1',
-         '/data/ZW/AOD.014461._00369.pool.root.1',
-         '/data/ZW/AOD.014461._00370.pool.root.1',
-         '/data/ZW/AOD.014461._00371.pool.root.1',
-         '/data/ZW/AOD.014461._00372.pool.root.1',
-         '/data/ZW/AOD.014461._00373.pool.root.1',
-         '/data/ZW/AOD.014461._00374.pool.root.1',
-         '/data/ZW/AOD.014461._00375.pool.root.1',
-         '/data/ZW/AOD.014461._00376.pool.root.1',
-         '/data/ZW/AOD.014461._00377.pool.root.1',
-         '/data/ZW/AOD.014461._00378.pool.root.1',
-         '/data/ZW/AOD.014461._00379.pool.root.1',
-         '/data/ZW/AOD.014461._00380.pool.root.1',
-         '/data/ZW/AOD.014461._00381.pool.root.1',
-         '/data/ZW/AOD.014461._00382.pool.root.1',
-         '/data/ZW/AOD.014461._00383.pool.root.1',
-         '/data/ZW/AOD.014461._00384.pool.root.1',
-         '/data/ZW/AOD.014461._00385.pool.root.1',
-         '/data/ZW/AOD.014461._00386.pool.root.1',
-         '/data/ZW/AOD.014461._00387.pool.root.1',
-         '/data/ZW/AOD.014461._00388.pool.root.1',
-         '/data/ZW/AOD.014461._00389.pool.root.1',
-         '/data/ZW/AOD.014461._00390.pool.root.1',
-         '/data/ZW/AOD.014461._00391.pool.root.1',
-         '/data/ZW/AOD.014461._00392.pool.root.1',
-         '/data/ZW/AOD.014461._00393.pool.root.1',
-         '/data/ZW/AOD.014461._00394.pool.root.1',
-         '/data/ZW/AOD.014461._00395.pool.root.1',
-         '/data/ZW/AOD.014461._00396.pool.root.1',
-         '/data/ZW/AOD.014461._00397.pool.root.1',
-         '/data/ZW/AOD.014461._00398.pool.root.1',
-         '/data/ZW/AOD.014461._00399.pool.root.1',
-         '/data/ZW/AOD.014461._00400.pool.root.1',
-         '/data/ZW/AOD.014461._00401.pool.root.1',
-         '/data/ZW/AOD.014461._00402.pool.root.1',
-         '/data/ZW/AOD.014461._00403.pool.root.1',
-         '/data/ZW/AOD.014461._00404.pool.root.1',
-         '/data/ZW/AOD.014461._00405.pool.root.1',
-         '/data/ZW/AOD.014461._00406.pool.root.1',
-         '/data/ZW/AOD.014461._00407.pool.root.1',
-         '/data/ZW/AOD.014461._00408.pool.root.1',
-         '/data/ZW/AOD.014461._00409.pool.root.1',
-         '/data/ZW/AOD.014461._00410.pool.root.1',
-         '/data/ZW/AOD.014461._00411.pool.root.1',
-         '/data/ZW/AOD.014461._00412.pool.root.1',
-         '/data/ZW/AOD.014461._00413.pool.root.1',
-         '/data/ZW/AOD.014461._00414.pool.root.1',
-         '/data/ZW/AOD.014461._00415.pool.root.1',
-         '/data/ZW/AOD.014461._00416.pool.root.1',
-         '/data/ZW/AOD.014461._00417.pool.root.1',
-         '/data/ZW/AOD.014461._00418.pool.root.1',
-         '/data/ZW/AOD.014461._00419.pool.root.1',
-         '/data/ZW/AOD.014461._00420.pool.root.1',
-         '/data/ZW/AOD.014461._00421.pool.root.1',
-         '/data/ZW/AOD.014461._00422.pool.root.1',
-         '/data/ZW/AOD.014461._00423.pool.root.1',
-         '/data/ZW/AOD.014461._00424.pool.root.1',
-         '/data/ZW/AOD.014461._00425.pool.root.1',
-         '/data/ZW/AOD.014461._00426.pool.root.1',
-         '/data/ZW/AOD.014461._00427.pool.root.1',
-         '/data/ZW/AOD.014461._00428.pool.root.1',
-         '/data/ZW/AOD.014461._00429.pool.root.1',
-         '/data/ZW/AOD.014461._00430.pool.root.1',
-         '/data/ZW/AOD.014461._00431.pool.root.1',
-         '/data/ZW/AOD.014461._00432.pool.root.1',
-         '/data/ZW/AOD.014461._00434.pool.root.1',
-         '/data/ZW/AOD.014461._00435.pool.root.1',
-         '/data/ZW/AOD.014461._00436.pool.root.1',
-         '/data/ZW/AOD.014461._00437.pool.root.3',
-         '/data/ZW/AOD.014461._00438.pool.root.3',
-         '/data/ZW/AOD.014461._00439.pool.root.3',
-         '/data/ZW/AOD.014461._00440.pool.root.3',
-         '/data/ZW/AOD.014461._00441.pool.root.3',
-         '/data/ZW/AOD.014461._00442.pool.root.3',
-         '/data/ZW/AOD.014461._00443.pool.root.3',
-         '/data/ZW/AOD.014461._00444.pool.root.3',
-         '/data/ZW/AOD.014461._00445.pool.root.3',
-         '/data/ZW/AOD.014461._00446.pool.root.3',
-         '/data/ZW/AOD.014461._00447.pool.root.3',
-         '/data/ZW/AOD.014461._00448.pool.root.3',
-         '/data/ZW/AOD.014461._00449.pool.root.3',
-         '/data/ZW/AOD.014461._00450.pool.root.3',
-         '/data/ZW/AOD.014461._00451.pool.root.3',
-         '/data/ZW/AOD.014461._00452.pool.root.3',
-         '/data/ZW/AOD.014461._00453.pool.root.3',
-         '/data/ZW/AOD.014461._00454.pool.root.3',
-         '/data/ZW/AOD.014461._00455.pool.root.3',
-         '/data/ZW/AOD.014461._00456.pool.root.3',
-         '/data/ZW/AOD.014461._00457.pool.root.3',
-         '/data/ZW/AOD.014461._00458.pool.root.3',
-         '/data/ZW/AOD.014461._00459.pool.root.3',
-         '/data/ZW/AOD.014461._00460.pool.root.3',
-         '/data/ZW/AOD.014461._00461.pool.root.3',
-         '/data/ZW/AOD.014461._00462.pool.root.3',
-         '/data/ZW/AOD.014461._00463.pool.root.3',
-         '/data/ZW/AOD.014461._00464.pool.root.3',
-         '/data/ZW/AOD.014461._00465.pool.root.1',
-         '/data/ZW/AOD.014461._00466.pool.root.1',
-         '/data/ZW/AOD.014461._00467.pool.root.1',
-         '/data/ZW/AOD.014461._00468.pool.root.1',
-         '/data/ZW/AOD.014461._00469.pool.root.1',
-         '/data/ZW/AOD.014461._00470.pool.root.1',
-         '/data/ZW/AOD.014461._00471.pool.root.1',
-         '/data/ZW/AOD.014461._00472.pool.root.1',
-         '/data/ZW/AOD.014461._00473.pool.root.1',
-         '/data/ZW/AOD.014461._00474.pool.root.1',
-         '/data/ZW/AOD.014461._00475.pool.root.1',
-         '/data/ZW/AOD.014461._00476.pool.root.1',
-         '/data/ZW/AOD.014461._00477.pool.root.1',
-         '/data/ZW/AOD.014461._00478.pool.root.1',
-         '/data/ZW/AOD.014461._00479.pool.root.1',
-         '/data/ZW/AOD.014461._00480.pool.root.1',
-         '/data/ZW/AOD.014461._00481.pool.root.1',
-         '/data/ZW/AOD.014461._00482.pool.root.1',
-         '/data/ZW/AOD.014461._00483.pool.root.3',
-         '/data/ZW/AOD.014461._00484.pool.root.3',
-         '/data/ZW/AOD.014461._00485.pool.root.3',
-         '/data/ZW/AOD.014461._00486.pool.root.3',
-         '/data/ZW/AOD.014461._00487.pool.root.3',
-         '/data/ZW/AOD.014461._00488.pool.root.3',
-         '/data/ZW/AOD.014461._00489.pool.root.3',
-         '/data/ZW/AOD.014461._00490.pool.root.3',
-         '/data/ZW/AOD.014461._00491.pool.root.3',
-         '/data/ZW/AOD.014461._00492.pool.root.3',
-         '/data/ZW/AOD.014461._00493.pool.root.3',
-         '/data/ZW/AOD.014461._00494.pool.root.3',
-         '/data/ZW/AOD.014461._00495.pool.root.3',
-         '/data/ZW/AOD.014461._00496.pool.root.3',
-         '/data/ZW/AOD.014461._00497.pool.root.3',
-         '/data/ZW/AOD.014461._00498.pool.root.3',
-         '/data/ZW/AOD.014461._00499.pool.root.4',
-         '/data/ZW/AOD.014461._00500.pool.root.4',
-         '/data/ZW/AOD.014461._00501.pool.root.4',
-         '/data/ZW/AOD.014461._00502.pool.root.4',
-         '/data/ZW/AOD.014461._00503.pool.root.1',
-         '/data/ZW/AOD.014461._00504.pool.root.1',
-         '/data/ZW/AOD.014461._00505.pool.root.1',
-         '/data/ZW/AOD.014461._00506.pool.root.1',
-         '/data/ZW/AOD.014461._00507.pool.root.1',
-         '/data/ZW/AOD.014461._00508.pool.root.1',
-         '/data/ZW/AOD.014461._00509.pool.root.1',
-         '/data/ZW/AOD.014461._00510.pool.root.1',
-         '/data/ZW/AOD.014461._00511.pool.root.1',
-         '/data/ZW/AOD.014461._00512.pool.root.1',
-         '/data/ZW/AOD.014461._00513.pool.root.1',
-         '/data/ZW/AOD.014461._00514.pool.root.1',
-         '/data/ZW/AOD.014461._00515.pool.root.1',
-         '/data/ZW/AOD.014461._00516.pool.root.1',
-         '/data/ZW/AOD.014461._00517.pool.root.1',
-         '/data/ZW/AOD.014461._00518.pool.root.1',
-         '/data/ZW/AOD.014461._00519.pool.root.1',
-         '/data/ZW/AOD.014461._00520.pool.root.1',
-         '/data/ZW/AOD.014461._00521.pool.root.1',
-         '/data/ZW/AOD.014461._00522.pool.root.1',
-         '/data/ZW/AOD.014461._00523.pool.root.1',
-         '/data/ZW/AOD.014461._00524.pool.root.1',
-         '/data/ZW/AOD.014461._00525.pool.root.1',
-         '/data/ZW/AOD.014461._00526.pool.root.2',
-         '/data/ZW/AOD.014461._00527.pool.root.2',
-         '/data/ZW/AOD.014461._00528.pool.root.2',
-         '/data/ZW/AOD.014461._00529.pool.root.2',
-         '/data/ZW/AOD.014461._00530.pool.root.2',
-         '/data/ZW/AOD.014461._00531.pool.root.2',
-         '/data/ZW/AOD.014461._00532.pool.root.2',
-         '/data/ZW/AOD.014461._00533.pool.root.2',
-         '/data/ZW/AOD.014461._00534.pool.root.2',
-         '/data/ZW/AOD.014461._00535.pool.root.2',
-         '/data/ZW/AOD.014461._00536.pool.root.2',
-         '/data/ZW/AOD.014461._00537.pool.root.2',
-         '/data/ZW/AOD.014461._00538.pool.root.2',
-         '/data/ZW/AOD.014461._00539.pool.root.2',
-         '/data/ZW/AOD.014461._00540.pool.root.2',
-         '/data/ZW/AOD.014461._00541.pool.root.2',
-         '/data/ZW/AOD.014461._00542.pool.root.3',
-         '/data/ZW/AOD.014461._00543.pool.root.4',
-         '/data/ZW/AOD.014461._00544.pool.root.4',
-         '/data/ZW/AOD.014461._00545.pool.root.4',
-         '/data/ZW/AOD.014461._00546.pool.root.2',
-         '/data/ZW/AOD.014461._00547.pool.root.2',
-         '/data/ZW/AOD.014461._00548.pool.root.2',
-         '/data/ZW/AOD.014461._00549.pool.root.2',
-         '/data/ZW/AOD.014461._00550.pool.root.2',
-         '/data/ZW/AOD.014461._00551.pool.root.2',
-         '/data/ZW/AOD.014461._00552.pool.root.2',
-         '/data/ZW/AOD.014461._00553.pool.root.2',
-         '/data/ZW/AOD.014461._00554.pool.root.4',
-         '/data/ZW/AOD.014461._00555.pool.root.4',
-         '/data/ZW/AOD.014461._00556.pool.root.4',
-         '/data/ZW/AOD.014461._00557.pool.root.4',
-         '/data/ZW/AOD.014461._00558.pool.root.2',
-         '/data/ZW/AOD.014461._00559.pool.root.2',
-         '/data/ZW/AOD.014461._00560.pool.root.2',
-         '/data/ZW/AOD.014461._00561.pool.root.2',
-         '/data/ZW/AOD.014461._00562.pool.root.2',
-         '/data/ZW/AOD.014461._00563.pool.root.4',
-         '/data/ZW/AOD.014461._00564.pool.root.4',
-         '/data/ZW/AOD.014461._00565.pool.root.4',
-         '/data/ZW/AOD.014461._00566.pool.root.3',
-         '/data/ZW/AOD.014461._00567.pool.root.2',
-         '/data/ZW/AOD.014461._00568.pool.root.2',
-         '/data/ZW/AOD.014461._00569.pool.root.2',
-         '/data/ZW/AOD.014461._00570.pool.root.2',
-         '/data/ZW/AOD.014461._00571.pool.root.2',
-         '/data/ZW/AOD.014461._00572.pool.root.2',
-         '/data/ZW/AOD.014461._00573.pool.root.2',
-         '/data/ZW/AOD.014461._00574.pool.root.4',
-         '/data/ZW/AOD.014461._00575.pool.root.4',
-         '/data/ZW/AOD.014461._00576.pool.root.4',
-         '/data/ZW/AOD.014461._00577.pool.root.4',
-         '/data/ZW/AOD.014461._00578.pool.root.1',
-         '/data/ZW/AOD.014461._00579.pool.root.1',
-         '/data/ZW/AOD.014461._00580.pool.root.1',
-         '/data/ZW/AOD.014461._00581.pool.root.1',
-         '/data/ZW/AOD.014461._00582.pool.root.1',
-         '/data/ZW/AOD.014461._00583.pool.root.1',
-         '/data/ZW/AOD.014461._00584.pool.root.1',
-         '/data/ZW/AOD.014461._00585.pool.root.1',
-         '/data/ZW/AOD.014461._00586.pool.root.1',
-         '/data/ZW/AOD.014461._00587.pool.root.1',
-         '/data/ZW/AOD.014461._00588.pool.root.1',
-         '/data/ZW/AOD.014461._00589.pool.root.1',
-         '/data/ZW/AOD.014461._00590.pool.root.1',
-         '/data/ZW/AOD.014461._00591.pool.root.1',
-         '/data/ZW/AOD.014461._00592.pool.root.2',
-         '/data/ZW/AOD.014461._00593.pool.root.1',
-         '/data/ZW/AOD.014461._00594.pool.root.1',
-         '/data/ZW/AOD.014461._00595.pool.root.1',
-         '/data/ZW/AOD.014461._00596.pool.root.1',
-         '/data/ZW/AOD.014461._00597.pool.root.1',
-         '/data/ZW/AOD.014461._00598.pool.root.1',
-         '/data/ZW/AOD.014461._00599.pool.root.1',
-         '/data/ZW/AOD.014461._00600.pool.root.1']
-    done = True
-
-if mode=="WW" :
-    print "running on tt data"
-    EventSelector.InputCollections = [
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00002.pool.root.3',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00003.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00004.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00005.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00006.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00007.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00008.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00009.pool.root.1',
-        '/data/WW/trig1_misal1_mc12.006807.McAtNlo0310_JIMMY_WpWm_enuenu.recon.AOD.v12000604_tid010040._00010.pool.root.1']
-    done = True
-
-
-if mode=="ZZtautaununu" :
-    print "running on ZZtautaununu data"
-    EventSelector.InputCollections = [
-        '/data/ZZtautaununu/AOD.014343._00001.pool.root.2',  
-        '/data/ZZtautaununu/AOD.014343._00002.pool.root.2',  
-        '/data/ZZtautaununu/AOD.014343._00003.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00004.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00005.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00006.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00007.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00008.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00009.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00010.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00011.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00012.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00013.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00014.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00015.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00016.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00017.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00018.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00019.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00020.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00021.pool.root.2',  
-        '/data/ZZtautaununu/AOD.014343._00022.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00023.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00024.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00025.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00026.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00027.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00028.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00029.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00030.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00031.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00032.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00033.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00034.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00035.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00036.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00037.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00038.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00039.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00040.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00041.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00042.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00043.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00044.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00045.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00046.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00047.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00048.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00049.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00050.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00051.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00052.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00053.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00054.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00055.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00056.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00057.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00058.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00059.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00060.pool.root.2',  
-        '/data/ZZtautaununu/AOD.014343._00061.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00062.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00063.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00064.pool.root.2',  
-        '/data/ZZtautaununu/AOD.014343._00065.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00066.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00067.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00068.pool.root.1',  
-        '/data/ZZtautaununu/AOD.014343._00069.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00070.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00071.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00072.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00073.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00074.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00075.pool.root.7',
-        '/data/ZZtautaununu/AOD.014343._00076.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00077.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00078.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00079.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00080.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00081.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00082.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00083.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00084.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00085.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00086.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00087.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00088.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00089.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00090.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00091.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00092.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00093.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00095.pool.root.4',
-        '/data/ZZtautaununu/AOD.014343._00096.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00097.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00098.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00099.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00100.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00101.pool.root.4',
-        '/data/ZZtautaununu/AOD.014343._00102.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00103.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00104.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00105.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00106.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00107.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00108.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00109.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00110.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00111.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00112.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00113.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00114.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00115.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00116.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00117.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00118.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00119.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00120.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00121.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00122.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00123.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00124.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00125.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00126.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00127.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00128.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00129.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00130.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00131.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00132.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00133.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00134.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00135.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00136.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00137.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00138.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00139.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00140.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00141.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00142.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00143.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00144.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00145.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00146.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00147.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00148.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00149.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00150.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00151.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00152.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00153.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00154.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00155.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00156.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00157.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00158.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00159.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00160.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00161.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00162.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00163.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00164.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00165.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00166.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00167.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00168.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00169.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00170.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00171.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00172.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00173.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00174.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00175.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00176.pool.root.3',
-        '/data/ZZtautaununu/AOD.014343._00177.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00178.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00179.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00180.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00181.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00182.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00183.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00184.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00185.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00186.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00187.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00188.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00189.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00190.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00191.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00192.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00193.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00194.pool.root.2',
-        '/data/ZZtautaununu/AOD.014343._00195.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00196.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00197.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00198.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00199.pool.root.1',
-        '/data/ZZtautaununu/AOD.014343._00200.pool.root.1']
-    done = True
-    
-if mode=="ZZlltautau" :
-    print "running on ZZlltautau data"
-    EventSelector.InputCollections = [
-        '/data/ZZlltautau/AOD.014345._00001.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00002.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00003.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00004.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00005.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00006.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00007.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00008.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00009.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00010.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00011.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00012.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00013.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00014.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00015.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00016.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00017.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00018.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00019.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00020.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00021.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00022.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00023.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00024.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00025.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00026.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00027.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00028.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00029.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00030.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00031.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00032.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00033.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00034.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00035.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00036.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00037.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00038.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00039.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00040.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00041.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00042.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00043.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00044.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00045.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00046.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00047.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00048.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00049.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00050.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00051.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00052.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00053.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00054.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00055.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00056.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00059.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00060.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00061.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00062.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00063.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00064.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00065.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00066.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00067.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00068.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00069.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00070.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00071.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00072.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00073.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00074.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00075.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00076.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00077.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00078.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00079.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00080.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00081.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00082.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00083.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00084.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00085.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00086.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00087.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00088.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00089.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00090.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00091.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00092.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00093.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00094.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00095.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00096.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00097.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00098.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00099.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00100.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00101.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00102.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00103.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00104.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00105.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00106.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00107.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00108.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00109.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00110.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00111.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00112.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00113.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00114.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00115.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00116.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00118.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00119.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00120.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00121.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00122.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00123.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00124.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00125.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00126.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00127.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00128.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00129.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00130.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00131.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00132.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00133.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00134.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00135.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00136.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00137.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00138.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00139.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00140.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00141.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00142.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00143.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00144.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00145.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00146.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00147.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00148.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00149.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00150.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00151.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00152.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00153.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00154.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00155.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00156.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00157.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00158.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00159.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00160.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00161.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00162.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00163.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00164.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00165.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00166.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00167.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00168.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00169.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00170.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00171.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00172.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00173.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00174.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00175.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00176.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00177.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00178.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00179.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00180.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00181.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00182.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00183.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00184.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00185.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00186.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00187.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00188.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00189.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00190.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00191.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00192.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00193.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00194.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00195.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00196.pool.root.1',
-        '/data/ZZlltautau/AOD.014345._00197.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00198.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00199.pool.root.2',
-        '/data/ZZlltautau/AOD.014345._00200.pool.root.1']
-    done = True
-    
-if mode=="ChL" :
-    print "running on ChL data"
-    EventSelector.InputCollections = [
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00001.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00002.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00003.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00004.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00005.pool.root.3',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00006.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00007.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00008.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00009.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00010.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00011.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00012.pool.root.2',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00013.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00014.pool.root.3',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00015.pool.root.3',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00016.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00017.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00018.pool.root.1',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00019.pool.root.3',
-        '/data/ChL/trig1_misal1_mc12.005673.PythiaWZFusionChL1150lnll.recon.AOD.v12000604_tid010096._00020.pool.root.3']
-    done = True
-
-if (done==False) :
-    print "ERROR mode set incorrectly = ",mode
diff --git a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis.py b/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis.py
deleted file mode 100644
index 583d1702978a..000000000000
--- a/PhysicsAnalysis/HiggsPhys/InvisibleHiggs/InvisibleHiggsZH/share/HZanalysis.py
+++ /dev/null
@@ -1,329 +0,0 @@
-## setup ####################################
-# include EventView environment, always necessary to use EventView tools
-include("EventViewConfiguration/EventViewFullInclude_jobOptions.py")
-include( "TrigEventAthenaPool/TrigEventAthenaPool_joboptions.py" )
-include( "TrigSteeringTestAthenaPool/TrigSteeringTestAthenaPool_joboptions.py" )
-
-# import modules to use, necessary since we'll use python modules in these packages
-from EventViewConfiguration import *
-from TopView import *
-
-# Load TopView library, necessary because we'll use tools in TopView library
-theApp.Dlls += ["TopView"]
-theApp.Dlls+= ['TrackIsolationTools'];
-#theApp.Dlls += ["HighPtView"]
-theApp.EvtMax = -1
-
-# you can skip events by using the following
-# EventSelector.SkipEvents = 10
-
-# the top sequencer which manages algorithms
-theJob = AlgSequence()
-
-# load library from EventViewTrigger and prepare trigger objects
-include("HighPtView/TriggerPrep_jobOptions.py")
-
-# define EventView looper and schedule to theJob
-# top EventView looper which manages EV toools
-RecoLooper = EVMultipleOutputToolLooper("RecoLooper")
-
-# add EV looper to theJob 
-theJob += RecoLooper
-
-# name the EventView container created by this looper, useful when matching
-RecoLooper.EventViewCollectionOutputName="RecoView"
-
-## Insertion of Objects ############################
-## from HighPtView import *
-## RecoLooper += HighPtSingleInserters("Inserters")
-
-# insert Muon
-RecoLooper += anEVTool("EVMuonInserter/MuonInserter") 
-RecoLooper.MuonInserter.setProperties(
-##  ContainerKey = "MuidMuonCollection",
-  ContainerKey = "StacoMuonCollection",
-  etCut =  10*GeV, ## default was 20
-  requireCombinedMuon=True,
-  onlyHighPt=False,                 ## Ignore low-pt algorithm
-  useIsolation=False,               ## switch for isolation
-  useChi2=False,                    ## chi2
-  useMatchChi2=False,               ## chi2
-  requireBestMatch=True,           ## require best match between spectrometer and ID  
-#  DoPreselection=False,
-InsertedLabels=["Muon", "Lepton"]
-)
-
-# insert Electron
-RecoLooper += anEVTool("EVElectronInserter/ElectronInserter") 
-RecoLooper.ElectronInserter.setProperties(
-  ContainerKey = "ElectronCollection",
-  etCut = 15*GeV,  ## default was 20
-  onlyEgamma = True,
-  authorCut = False,
-  useTRT = False,
-  useNN = False,
-  useIsolation = False,
-  useIsEM = False,
-##  isEMMasks=[0x3FF],  ## medium cuts
-  isEMMasks=[0x7],      ## loose cuts
-  InsertedLabels=["Electron", "Lepton"]
-)
-
-# insert photons
-RecoLooper += anEVTool("EVPhotonInserter/PhotonInserter") 
-RecoLooper.PhotonInserter.setProperties(
-    ContainerKey="PhotonCollection",
-    etCut=10*GeV,
-    useIsEM = False,
-    isEMMasks= [0xFF],
-    useIsolation=False
-    )
-
-## insert tau
-RecoLooper += anEVTool("EVTauJetInserter/TauJetInserter") 
-RecoLooper.TauJetInserter.setProperties(
-    ContainerKey="TauJetCollection",
-    etCut=20*GeV,
-    LikelihoodCut3p=2.,
-    LikelihoodCut1p=2.,
-    HadronicEnergyFraction=0.0,
-    MultiTrackMassCut=999*GeV,
-    RequireChargeToBeOne=False,
-    InsertedLabels=["Tau"]
-)
-
-# insert ParticleJet - use cone04 jets 
-RecoLooper += anEVTool("EVParticleJetInserter/PJetInserter")
-RecoLooper["PJetInserter"].setProperties(
-  ContainerKey="ConeTowerParticleJets",
-  etCut=20*GeV,
-  deltaRCut=.4, # cone size
-  InsertedLabels=["Jet"]
-)
-
-# label JetTag
-RecoLooper += anEVTool("EVParticleJetInserter/BJetSelector") # tool name / instance name
-# This inserter doesn't "insert" rather, uses selector mode to label b-tagged objects
-RecoLooper.BJetSelector.setProperties(       
-  etCut=20*GeV,
-  useWeight=True,
-  weightCut=4.5,
-  SelectorMode=True,
-  SelectedLabels=["BTagged"],
-  SelectorLabel="Jet",
-)
-
-# insert truth for electrons
-RecoLooper += anEVTool("EVTruthParticleInserter/TrElectronInserter") 
-RecoLooper.TrElectronInserter.setProperties(
-  ContainerKey = "SpclMC",
-  noOverlapCheck = True,
-  pdgCode=[11],
-  etCut = 5*GeV,  ## 
-  InsertedLabels=["TrEl"]
-)
-
-# insert truth for Muon
-RecoLooper += anEVTool("EVTruthParticleInserter/TrMuonInserter") 
-RecoLooper.TrMuonInserter.setProperties(
-  ContainerKey = "SpclMC",
-  noOverlapCheck = True,
-  pdgCode=[13],
-  etCut = 5*GeV,  ## 
-  InsertedLabels=["TrMu"]
-)
-
-# insert missing et to UserData
-RecoLooper += anEVTool("EVMissingEtUserData/MissEt"),
-RecoLooper.MissEt.MissingETKeys = ["MET_RefFinal"]
-RecoLooper.MissEt.MissingETTruthKeys = ["MET_Truth"]
-
-## combinatorics #################################
-RecoLooper+=anEVTool("EVSimpleCombo/ZeeMaker")
-RecoLooper.ZeeMaker.setProperty( {
-  "Labels":["Electron" ],  # select objects by labels
-  "OutputLabel" : "Zee",  # label for the reconstructed Z
-  "DaughterLabel" : "ZDaughter",  # label for the daughters
-  "Charge" : 0,   # required charge of the Z
-  "PDGID"  : 23,
-  "LowMass" : 66.19*GeV,   # mass window lower limit
-  "HighMass" : 116.19*GeV,  # mass window higher limit
-  "NDaughters":2,  # number of objects to combine
-  "PassOnNoCombo" : True, # pass on EV even if there's no Z?
-})
-
-RecoLooper+=anEVTool("EVSimpleCombo/ZmmMaker")
-RecoLooper.ZmmMaker.setProperty( {
-  "Labels":["Muon" ],  # select objects by labels
-  "OutputLabel" : "Zmm",  # label for the reconstructed Z
-  "DaughterLabel" : "ZDaughter",  # label for the daughters
-  "Charge" : 0,   # required charge of the Z
-  "PDGID"  : 23,
-  "LowMass" : 66.19*GeV,   # mass window lower limit
-  "HighMass" : 116.19*GeV,  # mass window higher limit
-  "NDaughters":2,  # number of objects to combine
-  "PassOnNoCombo" : True, # pass on EV even if there's no Z?
-})
-
-# Setup trigger
-## TriggerLevels=[ "L1", "L2", "EF",
-##               "Muon", "E/Gamma", "Electron", "Photon", "Tau",
-##               "Jet", "MissingEt" ]
-## TriggerLevels=[ "EF",
-##                "Muon", "E/Gamma", "Electron", "Jet", "MissingEt" ]
-
-TriggerLevels=[ "EF",
-               "Muon", "Electron"]
-
-## theApp.Dlls += ["EventViewTrigger"]
-## RecoLooper.EventViewTools += ["EVTriggerDecisionUserData","EVEFTriggerUserData"]
-## RecoLooper.EVTriggerDecisionUserData.TriggerDecisionKey="MyTriggerDecision"
-## RecoLooper.EVTriggerDecisionUserData.TriggerNames=["EF_e25i","EF_e15iEF_e15i","EF_mu6","EF_mu20i","EF_met10"]
-## RecoLooper.EVTriggerDecisionUserData.CopyAllSignatures=True
-## EVUserDataDumpInfAll(RecoLooper,Prefix="Trigger_",Labels=[],SelectLabels=["Trigger"])
-
-## TriggerPrepLooper= EVMultipleOutputToolLooper("TriggerPrepLooper")
-## TriggerPrepLooper.EventViewCollectionOutputName="DummyTriggerView"
-## theJob += TriggerPrepLooper
-## TriggerPrepLooper += L1TriggerPreparators("L1TrigPrep",TriggerLevels)
-## TriggerPrepLooper += L2TriggerPreparators("L2TrigPrep",TriggerLevels)
-## TriggerPrepLooper += EFTriggerPreparators("EFTrigPrep",TriggerLevels)
-
-## #
-# Object info Calculators ###########################
-# for electrons
-RecoLooper+=anEVTool("EVUDFinalStateLooper/ElectronLooper")
-RecoLooper.ElectronLooper.setProperties(
-  Prefix="El_",
-  Labels=["Electron"] #specify objects to loop over by label
-)
-RecoLooper += ElectronUDInfo("El_Info",
-                           Level=["FullStandardAOD","TriggerMatch","TruthMatch"])
-#RecoLooper.ElectronLooper += anEVTool("EVUDKinCalc/ElecKin")
-RecoLooper.ElectronLooper += anEVTool("EVUDTrackBasedEtCone/ElTrackEtCone")
-RecoLooper.ElectronLooper.ElTrackEtCone.setProperties(
-      DeltaRVec=[0.01,0.1,0.2,0.3,0.4,0.5,0.6]
-)
-
-# for Muons
-RecoLooper+=anEVTool("EVUDFinalStateLooper/MuonLooper")
-RecoLooper.MuonLooper.setProperties(
-  Prefix="Mu_",
-  Labels=["Muon"] #specify objects to loop over by label
-)
-RecoLooper += MuonUDInfo("Mu_Info",
-                           Level=["FullStandardAOD","TriggerMatch","TruthMatch"])
-#RecoLooper.MuonLooper += anEVTool("EVUDKinCalc/ElecKin")
-RecoLooper.MuonLooper += anEVTool("EVUDTrackBasedEtCone/MuTrackEtCone")
-RecoLooper.MuonLooper.MuTrackEtCone.setProperties(
-      DeltaRVec=[0.01,0.1,0.2,0.3,0.4,0.5,0.6]
-)
-
-
-# for TauJet
-RecoLooper+=anEVTool("EVUDFinalStateLooper/TauJetLooper")
-RecoLooper.TauJetLooper.setProperties(
-  Prefix="Tau_",
-  Labels=["Tau"] #specify objects to loop over by label
-)
-RecoLooper.TauJetLooper += anEVTool("EVUDKinCalc/ElecKin")
-
-# for particle jets
-RecoLooper+=anEVTool("EVUDFinalStateLooper/PJetLooper")
-RecoLooper.PJetLooper.setProperties(
-  Prefix="Jet_",
-  Labels=["Jet"]
-)
-
-RecoLooper.PJetLooper += [ anEVTool("EVUDKinCalc/PJetKin"), 
-                           anEVTool("EVUDParticleJetAll"), 
-                           anEVTool("EVUDLabelCalc/BTagLabel") ]
-RecoLooper.PJetLooper.BTagLabel.Labels=["BTagged"]
-
-# for true electrons
-RecoLooper+=anEVTool("EVUDFinalStateLooper/TrueElectronLooper")
-RecoLooper.TrueElectronLooper.setProperties(
-  Prefix="TEl_",
-  Labels=["TrEl"]
-)
-
-RecoLooper.TrueElectronLooper += anEVTool("EVUDKinCalc/TElKinCalc")
-RecoLooper.TrueElectronLooper += anEVTool("EVUDTruthParticleAll/TPAlle")
-
-RecoLooper.TrueElectronLooper.TPAlle.setProperties(
-  TreeInfo = True,
-)    
-
-
-# for true muons
-RecoLooper+=anEVTool("EVUDFinalStateLooper/TrueMuonLooper")
-RecoLooper.TrueMuonLooper.setProperties(
-  Prefix="TMu_",
-  Labels=["TrMu"]
-)
-RecoLooper.TrueMuonLooper += anEVTool("EVUDKinCalc/TMuKinCalc")
-RecoLooper.TrueMuonLooper += anEVTool("EVUDTruthParticleAll/TPAllm")
-RecoLooper.TrueMuonLooper.TPAllm.setProperties(
-  TreeInfo = True,
-)    
-
-RecoLooper += [anEVTool("EVTriggerDecisionUserData/EVTriggerDecision")]
-
-RecoLooper.EVTriggerDecision.setProperties(TriggerDecisionKey="MyTriggerDecision",
-                                           CopyAllSignatures=True,
-                                           #TriggerNames=["E25i"]
-                                           )
-
-RecoLooper += [anEVTool( "ManT::EVL1MissingEtUserData/L1MissingEtUserData" )]
-
-RecoLooper += [anEVTool( "ManT::EVHLTMissingEtUserData/HLTMissingEtUserData" )]
-        
-RecoLooper.HLTMissingEtUserData.setProperties(ObjectKey="TrigEFMissingET",
-                                              Level="EF")
-
-# for Z's
-RecoLooper+=anEVTool("EVUDInferredObjectLooper/ZLooper") #Inferred object looper for Z
-RecoLooper.ZLooper.setProperties(
-  Prefix="Z_",
-  Labels=["Zee","Zmm"]
-)
-RecoLooper.ZLooper += anEVTool("EVUDKinCalc/ZKin")
-RecoLooper.ZLooper += anEVTool("EVUDLabelCalc/ZLabel")
-RecoLooper.ZLooper.ZLabel.Labels=["Zee","Zmm"]
-
-#RecoLooper+=EVScreenDump("RecoScreenDumper", printUD=True, printUDVals=True)
-#RecoLooper+=EVScreenDump("RecoScreenDumper", printUD=False, printUDVals=False)
-#--------------------------------------------------------------------
-# UserData to AANtuple
-#--------------------------------------------------------------------
-if not 'mode' in dir():
-    mode='test'
-
-filename = mode
-filename+="_ntuple.root"
-#--------------------------------------------------------------------
-RecoLooper += AANtupleFromUserData("RecoAADumper", filename, sequencer=theJob, EventTree=True, CandTree=True, Prefix="EV")
-print theJob
-
-## to submit the job:
-## athena -c "mode='HZ'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee HZ-test.log   to append
-## athena -c "mode='test'" HZanalysis.py HZanalysis-dataset.py >&! test.log
-## athena -c "mode='HZ'" HZanalysis.py HZanalysis-dataset.py >&! HZ-test.log
-## athena -c "mode='ZZ4l'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee ZZ4l.log
-## athena -c "mode='tt6811'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee tt6811.log
-## athena -c "mode='WpZ'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee WpZ.log
-## athena -c "mode='ZZtautaununu'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee ZZtautaununu.log
-## athena -c "mode='WmZ'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee WmZ.log
-## athena -c "mode='ZZlltautau'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee ZZlltautau.log
-## athena -c "mode='HZ140'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee HZ140.log
-## athena -c "mode='ChL'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee ChL.log
-## athena -c "mode='Zee-ljets'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zee-ljets.log
-## athena -c "mode='Zee-bjets'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zee-bjets.log
-## athena -c "mode='Zmm-ljets'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zmm-ljets.log
-## athena -c "mode='Zmm-bjets'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zmm-bjets.log
-## athena -c "mode='Zee-bjets-2'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zee-bjets-2.log
-## athena -c "mode='Zmm-bjets-2'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee Zmm-bjets-2.log
-## athena -c "mode='mh110'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee mh110.log
-## athena -c "mode='mh150'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee mh150.log
-## athena -c "mode='mh200'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee mh200.log
-## athena -c "mode='mh250'" HZanalysis.py HZanalysis-dataset.py 2>&1 | tee mh250.log
-- 
GitLab


From 4a98ddd54b8967f3a2599c5a3fe1cbed8014d7b9 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 18:44:01 +0200
Subject: [PATCH 018/217] Remove MuonCalibDbScripts: trivial CMakeLists.txt

---
 .../MuonCalibDbScripts/CMakeLists.txt         |   7 -
 .../MuonCalib/MuonCalibDbScripts/doc/README   |  29 -
 .../doc/calibration_schema_v1.0.pdf           | Bin 96396 -> 0 bytes
 .../share/create_schema.sql                   |  45 --
 .../MuonCalibDbScripts/share/create_user.sql  |  16 -
 .../MuonCalib/MuonCalibDbScripts/share/do_all |  25 -
 .../share/drop_all_schema_objects_11.sql      |  45 --
 .../share/load_data/mdt_head.ctl              |   8 -
 .../share/load_data/mdt_head.dat              |   6 -
 .../share/load_data/mdt_rt.ctl                |  29 -
 .../share/load_data/mdt_rt.dat                | 646 ------------------
 .../share/load_data/mdt_rt_map_r.ctl          | 111 ---
 .../share/load_data/mdt_rt_map_s.ctl          | 110 ---
 .../share/load_data/mdt_rt_map_t.ctl          | 111 ---
 .../share/load_data/mdt_tube.ctl              |  57 --
 .../share/mdt_head_table.sql                  |  25 -
 .../share/mdt_head_trigger.sql                |  19 -
 .../share/mdt_rt_cheby_table.sql              |  67 --
 .../share/mdt_rt_cheby_trigger.sql            |  21 -
 .../share/mdt_rt_map_r_table.sql              | 120 ----
 .../share/mdt_rt_map_r_trigger.sql            |  21 -
 .../share/mdt_rt_map_s_table.sql              | 118 ----
 .../share/mdt_rt_map_s_trigger.sql            |  21 -
 .../share/mdt_rt_map_t_table.sql              | 121 ----
 .../share/mdt_rt_map_t_trigger.sql            |  21 -
 .../MuonCalibDbScripts/share/mdt_rt_table.sql |  35 -
 .../share/mdt_rt_trigger.sql                  |  21 -
 .../share/mdt_tube_table.sql                  |  67 --
 .../share/mdt_tube_trigger.sql                |  21 -
 .../share/sequence_mdt_head.sql               |  10 -
 .../share/sequence_mdt_rt.sql                 |  10 -
 .../share/sequence_mdt_rt_cheby.sql           |  10 -
 .../share/sequence_mdt_rt_map_r.sql           |  10 -
 .../share/sequence_mdt_rt_map_s.sql           |  10 -
 .../share/sequence_mdt_rt_map_t.sql           |  10 -
 .../share/sequence_mdt_tube.sql               |  10 -
 .../MuonCalibDbScripts/share/sites_table.sql  |  11 -
 .../share/view_allTub_rootFile_last10Cal.sql  |  19 -
 ...view_allTub_rootFile_last10Cal_ordered.sql |  19 -
 Projects/Athena/package_filters.txt           |   1 -
 40 files changed, 2063 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/CMakeLists.txt
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/README
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/calibration_schema_v1.0.pdf
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_schema.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_user.sql
 delete mode 100755 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/do_all
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/drop_all_schema_objects_11.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.dat
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.dat
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_r.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_s.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_t.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_tube.ctl
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_trigger.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_head.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_cheby.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_r.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_s.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_t.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_tube.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sites_table.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal.sql
 delete mode 100644 MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal_ordered.sql

diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/CMakeLists.txt b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/CMakeLists.txt
deleted file mode 100644
index 17b976ed0ac4..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Package: MuonCalibDbScripts
-################################################################################
-
-# Declare the package name:
-atlas_subdir( MuonCalibDbScripts )
-
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/README b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/README
deleted file mode 100644
index 3bf79b325792..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/README
+++ /dev/null
@@ -1,29 +0,0 @@
-With these scripts you can create a new user account, create all objects of the calibration schema and delete them and load data into the tables of the schema (except MDT_RT_CHEBY table, there are no example of data file). 
-If you want create a new account use the CREATE_USER.sql script as it follows:
-
-sqlplus sys/PASSWD @create_user.sql <user_name> <site_name> (2 characters like MU,MI,RM...) <user_password> <user_default_tablespace> <user_default_temporary_tablespace>
-
-if you want to use your account, please check if it has all privileges listed in the create_user.sql script.
-About the schema, you find scripts to create any object, and you can create the whole schema running:
-
-sqlplus <USER>/<PASSWORD> @create_schema.sql <USER> <SITE INITIAL> <PASSWORD> <TABLESPACE>
-
-The log file will be in create_schema_spool.log. 
-To delete all the objects in the schema run:
-
-sqlplus <USER>/<PASSWORD> @drop_all_schema_objects_11.sql <USER>
-
-To load data in the tables use the SQL-Loader utility with control files and data files in the load_data directory. Run the sqlldr command from the ATLAS_MDT_Calibration_DB_1.1 directory, for example to load data into MDT_HEAD table run:
-
-sqlldr <USER>/<PASSWORD> control=load_data/mdt_head.ctl
-
-the log file of the loading will be mdt_head.log.
-
-Then, the do_all script performs the following actions:
-
-- creates all the new objects
-- loads data into any table (except MDT_RT_CHECBY)
-
-then it does not drop the objects, to use it run:
-
-./do_all <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/calibration_schema_v1.0.pdf b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/doc/calibration_schema_v1.0.pdf
deleted file mode 100644
index b7c4f42fd3587e359bab5f525f952e1d78575ff8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 96396
zcmce;bzB@-*DZ`o0tA;}4MBp_hP%5v!QI_GI0Sb|a6*9K5<EBr5AGH;Xb8c{Z8CYE
znRjNs``o|2?jKNf>eN2_?6ub3r>d)=RT7h60kT3cX*V{<CNUoYK>&7ugRwP$kB?2x
z%HGV#*~;6@6aZwC18{SIxjEPr0YC_wIDnIzlY^5@0RU!GgB<{}bF)bSbOBu48~_lM
zQ%^tu)6Cu!W(E`Rj~C`6PiHgpUn7CpF(0x2egQcEzqSDO|I-EpLc#xN1A&46XoIkG
z|Dz2G`lme(4)%Za<A(mDABdd``uBdYN&RCC5Eth^&IJQO|L6yXfc{|*%)to@^uz1V
z`GPqiTz_waaB}~nAC!~pALDXxLOK6_E+^+dec^&a|1kzP^dGSYvO_o^f3pV!LV$mt
z2MEjw`un&bF!w)V1%d!M|BfYuo%0_UK_Ni)zuSXC!2jR@6at0(BQER@?E6nlU7d}r
zY|Wf8AHj&M3ga*U0%B8gHgkuum7SZ5O~t{%6##_!1W;j<wl{YG0Aaj(*cQ{}gNT8}
zg+Wj#l!Jp?LR1_K77-N(aznu|kJ&k(AWi{3umn^>L_(AsD9iyCfj~G!B-n)^Fq|d0
z#KeRlP;r3=1w3+bHF9?SgX}P()6$A7N?<<vUwXiN1bG-1CX@%cnb}*oS^|Ka>}(QN
zwytK*Y!bFcu4ZCpCJv@%Y|;QA%xyUUkPF173IMW$1q57Noz0BwV0v0GHZ(Lu$#=mh
z$H3UQAVwm=7Q%ks_vvHTN2kENM*M*t{c*gIc(aZ4x{c~i=Sp3{QF+IVr~c(gGy@Z`
z7u=K;Mj@}z5=w~zjY&~ndQfM0P|i9=H*VkKR@6B{Q^*&nt?5!{U06_Oao+C7yI|CG
zfg1jGJplRnP9Smc0Yck|Ac-h(+~fAZr`@9;(;FzhU;!H7<~u)XWg--k1YNQT1;WE2
zK4PuFd<07izuo?wAbw%+M*!r_T#ZbPT#aC}`-O#)k%gHH0H!AxE^1zmW^AIcgSHM9
zY!3(IjEv1}T>vn)095`=H$WI`e}_}l*}+l7!Bh9a76&Y?!IY#2JJZ?B-u1UlQ3rch
z*q)2-gFXQ&fCoB0{P|@Q0D=kSVei-Y0PruD01w#*)(C#ck}7&I7P-O@0<g2mo0(b}
z{bMv0GZzOpXA{^Y9+dMxvv~0SFCIS}`D6YPFn?e?P*Vc}9u)b|UkwD~!|zQn4Ex`k
z5EvOAHU$J=oOUo#HFMQvgC%k{H8W3FJvMPqS4q_e$6&@JRe=D|Lr`FS|1#)<`9B6#
zbu)H-i0wmw+1bR*TuflV7}>i%IOC!V{^hqGn~0H%*+UDPjDobBs3eo9k*$@nvlWYo
zgRLo>nuEH%)dNWZpg({Uw}<Un*;}wlo5JF2<?6*E^#_0tCjR2Z!_5BXg|nO4FQ^}S
zJ~-oS<>>0*3;_M1PB|kNS5ZqNX8<=lo2Heit0fFOjt47HSlW2_c^Ln%Z_q=E{>z(#
zodW>n00N*eSUF&rLbx76$^qtt{lEhC%NDE^1O{+%LI504STC3bC=727Ski@ZfB_I#
zB7<;4VaLD#C^r!1$sZ#?IJy27CNZi19VQ7Y=ilB#IN1IZB26oMVS5*=|Lp%~_J4`f
zgO7iU)4!wjixhuzL;62x{S~NR1pd>D{{qy5-M=~T{{_?^DfK@<0bz6fjTD$243p7A
z^d9B|f<E8^f`S0xhsgfM?+*<B`uh)TK^$B#bRN$8pZ7yShC(1PY``#iLw_L&dB6*X
zBL@t>2g?tAAuvwDsvdv?!U5pm00E#dJ#oM=gq0P*Lw^VtY#&xkpfK#YxPP4iYx$p1
zVCVnx7FLI0oPmu3v;6BXtQE`-+vj}X5)=S}@d;M=U>5(_=H&jPKdf5(I{wfH4B-ZV
zVT=L8MD@!C%tOux&tWrwz}N(avFgup|6jIXG5kB&|KS|0hWv+a?0*9N|3J52BK`yI
z-z5nI;`*18^k)H*id0jow(kL8EMGl}<97>mOlcOAnsyr;x0x<n=5|ymM2Qy-yY&l_
zc*kS-{mtEh#hL8Il2=+_hcY`q9r5eN5LvB3z>=dg#Z&Z|jJkrSBjwLdn2#E1*O#t<
zLW`jLH%YSjm`7oGO+@r-m8J>VIiNFupa6KX66nAAN+1ZX=;Ow~<(7DV*&7^Bg8PJS
zLLAfH5dmJU7x^4g3yNs(u{X-UdH5$k8ejbBMHisnIN@t$ELrb~8+Dkk5k*%}zFa1g
zR<pkTsa$N{kzcf49fLcrzsNYk%-!oi5>~nJ=j`Yn{Y&Zkm6U$V!qv=90{{d;*d7v>
zf{~rsuT1%m6aYJ@3ai?#CYEdp4$gK)w!iwr%Dov(2Y=-J2LqaBRu-1708Vz;Qoz>8
z!Ua}vey3(v01FKDUuTIt)EgEEHyFSI<c3v*2mWzGVMR{(A&0}x{@qW)$j-{v>-q1L
z%>b*Sj#7Wv=Kw+3w0>{1K*7L2lk}gdmrWX0bFEB-?JaC!h3?O!1bUFy-&n%=Us=*-
z-v_{0@_H2ao<~Tkh!scW9L5q#sFjDnZ<e(F!4g-C96yeZ?}}|6=$E9(V8fS#Ua}v;
zVlcW0EOzn|3|~v5mQFD9AdGDo8Q`(D<si6{Zys|u(Jic-lP&T(J-$t0PCRolKicZI
zFb`wtb9gaMkDZIJl}+5i_w_QL2uVLQ;L8U|ByA^`VJyPg63oOOU=jKdOZEE&)OT=g
zcR3c{G~Hegr_s4<L`&w)QSBF6f<7%2l)5sIzNr|NNXDE6tLgT}pLyythH06n_4^|c
z!x78aG5#w_9uneTNy7C9djH{w^j{?Vf1?NFAtR{#LjE^BApbA)fR(S`^nk66{(q#$
zp9?WXC3)EOqoNYP+{o6&jLpIE_r|YE_n);2o2u~dc2#)*J1aZrFI4+;iS#=madSfd
z3)Sj0_2MSE@cqUr2MU5Y`exk^kg!$4-=zvyNkKNu>O}I+T@hZpat;Qr%^u5Vf1cSp
z=)tfoR4CP_%(-zp8rc*i!mh|#V}3%h!~KM6xDsKFs$1~3AO5*!o;icMkw0FQBYDp&
zP@iWy+o{bx6u@R)$u_z&@-4bCK>X@07AmuXi26&eD=&)=7;n~rr%O5*oWM_4qlKcO
zqp{gz-{$9Sfr1iAYS&$Z6i0Wr%f>zON+ZXpwS;Z`ZQV%EdHXsq3*R~#SG*hOBId!r
zJ?}xjDtJSy^_GZDe{^-2=fsNwz**$xq4p?hJGqEBYXM19wD{u)zK}?ZC<(!m`KMDE
zEPCP*6`zuTeS4Mk=kw$>??$`@uIfqn2zV9oQdbDTO>r4Z^g?f6FVkA3DocQ!$&E;G
z@SJX2J9m=tCswb@f_agU-&j`iCKkTc<><F1QRhoZO2CTBT*7DScT+&t{~{j!mBPkn
z>$6NK0vk=0I>xX(>Sp|MTrxRF$Zp=k#%3QR;Ddm*;UuC&;n%r#o?`X{(Gp$NwBF)d
zdyRfibhAh`f2ziq??n)U{!yy*aF>im7w1A_JH3k8V)u7wjD`4<XA)DvA0qM)M>-md
zqm1#DYkE+U3z-5px04_^wjy@-hJ694^R!oQS6G2t1CmLL3y^1wk6br|dPP)eK}O>0
z_Z_96#Q-iT{V^iN7l%YIR;PIogFV?7Rtb(>ZeF2}D0+EffAphbX8pz=N{P(C&CAVo
zBu(42Vy_YNxG&>PMP}PG!}<#HvR0*G#h~}L`iV7+1zdSA>u_=#OmthU#Mc%1w(e&4
zp4SE&M_Qj%vo1L6l8eePitVT2R>jNDXZB&5WIA?48oAvks`bi;Orvr=hi@tH;(26T
ztZ>W<v`~9o9)e16D6~1^wNg(X|3oS{Da}RJ+Wo#~Jy?e2Gy2Ph$r;ro9XVx8-NsL!
zZ7K`2jNX%k$5`Cy48zw%Y~WKlam9*^))`b6-B#43u(vV$Yrb{oH`J{^M!NYBV@#G*
z$O9y*ft(%G3&<9hv^Qm&fs8D;odX79-!1S&LEU>AmEGa`ySg96Td2}AYLWDL>G(5n
z3|JRZ+g>j?D}63pj<ps?k9&<QF-aWqrj=d`t87CU{Ra7En=b1H;-EgkTxLb9$oBk}
z?OU?motjB3z_fSydmSIv>z0c+cYOb?yeL#&C%XzcyV4?FmEz&ITE>rU5`N&pscZ>d
zWJR>_22S}?9IGK2JZnZzh?fr`d`A0&NS>d$Ogxk=Tu1}U@G=Ju5zbgP-|*jR@1IvN
z|C1A7#q6Kg&3|2_v}(#LE(&3{oiX{oko9a?ZLwFTRf^BW<*z$JFCBnK{fzR~S&r%6
z&%#6AX@<&^;gFWv6MSR7J>p{$MVkhqk_OHP#|^b1il7A;_%8aW;#22I16QA=1J~nn
zdwI^sF1x|K9|9U~(va{(-nFfhL8tjfXv|Aw7zj`5+si9HSN4YM8wQ0^U0E8kwpQ<q
zw`wojzbr)BK^aZx`PrM^!<W$131YDK2pelzFg-%pK5g^>M+>6fX5}()NYv~I3yReX
zM>>}bT{FUAzNUgyz*V%DSfTPGXcatbQj?x7ZOCR}%3_v0erZawEplRK1eO54WmE+1
zciE%x176hHp?P0*8QJr_tX1pW!ZVB#>xB?#<!wB^jmt0CR5OlQ!AduAhUTNUb>SR6
z@~G9(N4_;r$Keo2S5)=<l2+#Z+8o7mCDpA3%g{Odj4yUgjyJu`YtEosolG^tH6d_d
zn%&6Gl_r$GV#v8E9ctE6<>i1xpmi3(*!<({Z9lb06~&E_`deoeFkF8Va1*?e9#<<3
z<gY%XngA+I<#rDS#_Gg;T&#RMn_>Us<q<Z2`y_wiE<!!0x|U4QRD{Nb>^$aHoOyzI
zJV~>gblS*W;4<W`Zm$ulieka>v|og3ysucW{<d;PE*FuCtFidc!u>4AwoC14BfJvA
zO?plrX0puX@Nwt#Wv+xBJwe6TC-jq(gZ=~Nef@F$+?IPdmiY0Un;(sc*bWLg7%5Fo
zSDqDF4D3u&kKp&vuANNAg<BO1H;t)SS0?UKw@HbLCTKae*H@5CYpGJ}+dj8fVlg4e
zM4*llnD_0JUXvAY#Fo<D-fT(aU%2G<j7aefE>8;aAB>3odLEp_ynj{NgltwXBZ~6^
zemi<U?-czheaw?sm2f=C!iYk%o#&zn>rp+CuT(0l`@Vmjg(FyQw$klz#ex<#t-11z
zmRE+=@*cw-8j_QlG5@4HC$}*R3AoPqQN6HTsqDtgkVPe%9=r5|zr?M@y0lCwHwQP7
z9-{yYZ&GFabz)-^MubA*5QkiJ*ER8M;}Lnc-Ezr`Mxs3>NhBPn`u$>GB{v4Q7lpIh
z!an6MHD8hPzV;m&Qmb=zEzGG*9h$Bb_iIB>6zqsJL*QT@l^e74K1Q{t(mf70bs2@c
zu??P2{lwSy<~B}GgYT$j#qhxTv<B*)#n(_&FBX;SiE|u}KLc;xx}{oh5c#DMrto{5
zqUL{7_`_A$|5{*jvxEMN!k08{946WE?^X;Z;u`9RI}YJQ79PXr+cLtV%a?p=kYm|5
zv2M;g{n`{;``&3`ghWoncQ12*|6<)`tV#BHUUH4U`;3o#==up@#Z=Intw!$0`nh-<
zF6|oJp#^GNArH&a9v*~iz>zvq{27MDI5s^31;~@#vMvr!me||l!^I)({Tn~Wz%E3P
zjLKury5kNYE&7%pEiq1W&WQJvMJ*NHsOlEDNf9ZAXz~pACdmy=forQ(;0i9Y6?Jk!
zv;KvVEY|{hVwjwGro=Oi7-Iq&9hR&?<^1=CuM_dwKl}Qxgcv(=%J5^kEkbh$FRWss
zvE?kSo3~PC<e92Mic_K)2x-JMPfW)jG3E9ade^3--X(`f<0V{q3o=|xu%6K>Kpa{6
z(NPmeqSULi*TjU!4SKz>r4!V$>|e0EwG5qXl)p<S4M*BT7EDW>!T07vwJsz3RHp4I
z8}`nVn&-JaV@a=g8ChP-X}ovgos*MyEe|Qtti0F<w}Q=iEh-HRk+kT&5no`|mr3Wh
zk?+vJpmu$TcBnez$l*){eIkxc$}W95Ler)WZKTjaw6XT^SQMyS4UJSW)J-aWWP;tM
z3!PeZhM*#KUEQC@ZK<)ulRzm4kE&=6DJ$^1b$ii1+Ou5D$4V*4S`P4!m;*bbd#pZw
zl(&p>kCW_HQpQ|Q{Dj({N2P1ifVj5Cc|QghJl6u3vk1RIQ%pi@Cq~sAi)et7-nql7
zfWhM)Dg*f>;t-sk%du=;%JBv~F11U7xa>->m81kh&I83@*JxF1?i;vEkvd>q==u7G
zA1u`ExDAM<GcMf`SK3&&54S;iR58TrYw2rT%joS>(>o3#?~Q%I7EOz+$jum>vc~TY
zIs6velxt!!@avQ0x68(RxPTgx!xE}d2P}^rM4tAg%!}QOVaC{K36yv@7c7$t2>XOP
z#I;spK9MvKK80RKz$@flptj846ezANW$zWKU(KiSS0Q_H^^n!yuSPDraav-#n(#Rd
zRS26!AAH`w9MtUq&aP9NKA&bZ_Gr<q)!~8Do$0n;(Xm$?SJ(caA%o9)_^ME4(7ty$
zb1)zJNvB6teQ!{AqFt*i_v45R#9kS=mET>&GwrOCttcEz-sV+iS#N%VQ|5B0GMltv
zq3e)rs+bp6=Jm*{8A+T;xTNW;($DoGTjI!j2Y3`XEACRNf0Oc`H?aPvShIuwi<A#E
z^%NJ`@%@fr3wSWj*s20?rrH#>n=ya@@$)CO^JfIFWtfVBq;Jk!VkakfSZL6!*iM8P
zX}Ja3FP1iw;6G9J8__tu{LD`6s2wgi(l}#b;wgj(wgC>imLuY(D?GlJ*P#!=zMsCW
z8AH3k2qiM{3_&_dGY?Wi028K%6Ly{;)H>u3S^_C83VhpjC_=IFUWgl#L~CkL!9D*Z
z38#97;F5eyjYBqBNP?S!tm2<@B%(Y_V1+^(9fPIRj6sm;T~w$g!}4?;sHdbm!kG0X
zibG^0cFvc?nXJI=5m9VS>t{QxfchYoY)QExv8F6kefclocbH|z<aiPQVh9F9@xY55
zcYb38CXL`(6h6jlov9<N5vQoTQ5jY<aKZ<LSCjLMXRcjU#f91i@9>WCFna3JQ3J@(
z3I+pI9@!RIelo3pu~SfFhau@Tz&P{KsVnK4`65bue8G6V6koPP=oz`vBS~}ON6guV
zG^x9+Az5U8r|B}oXdfmhig6TkXVz$OSkmq5HhWw|KA7L6ODpVZ^p=>oFYve2Z6%hh
zlCRWtOXazIEhRhWv72mZt>T16EInnh^q=GGZ<lnGE3u}d!%e$~8r*=0s!Ih&LfK!d
z?i8Hn=R4<reT;tf0u6&*R^Qg$OcwDwngqc-mS!6Sr$#%&Q@dE*Ohj$TcIMMdi#=x9
z*$e*++@~EzE92eI6>GVPyK-EcA2R?GM4&E+JAR61-!HBQ=+O)@ktK%iSOYifnhi99
zmny(z!SB~bN*KbE)l~wcHZ?H>HlEVw=D(l#IlxG%y;Wtor=gXg6%<Fbvcj3-q6|3=
z+~wBCu+>3-hABN@o+=|NR?CCCCuC<?UGh}ogGx`|eCY0MjqH0w+Z)RO$~{|L*&}j(
zj<;ya7rP1eUHU4remN#TX}||9-K$y?>}ZVs5<$%jH6FD%nyd``q|-k(hT9wjnvQ6;
z6741rFBW$A%hY51KVnEv9oiBW9nngupz}jS55$$1;c76Amlw-So=lq)*IY=&;4-Hh
z_bOPHuMjs*g$ZBG__bh>kiIz|ZRtMyk&;&!;HNyO9v>P}!uH+r=FIf92yv8cd-fN9
zv@rP3g?(>(DD+yRqj@z&YP}jp{n*7X%vZX#SR>iD5utH~&88`=#s1GjPi#gKkdBDL
z2g=qGEp1(<yE|!Lb|7HDJ((}*`8O^9c`x|4mN_~8?E|a7F1)8S^&A#{YxxWtrsW1J
zTmrenp6l_<!@NxFf+`SlI^gbSOKcL0)9zEEALn6f`*ZC(OD<24z;x8O8S5mSA?)NC
zS0oFpCTHgdp+LU;1nn+G2F*IgT7pV+s@s?{95?yLk#8H02;1Tawk?TOnG-Vl5SUEq
zPRPY~3NDkpX1S34P55@PyOyYW4_va*xTxat5LoyO!y>U-`PpvR7nkZu;Vaiv1Ta$u
zbF|b_wR-Qm`ZuC>b8Ubg@0Z<mFST?Wf4o}B+hROkie`9?Vl)wTur>NQKL2pRByfXy
z<XSa8Ik%MhLO`KB%va;)I~xu_FLUpC9xYFD{&{)&Y9)ukLgluW#rdfptL8f&VtR&|
z+=J)|!?}stnZj_b%nu<ym0T(4alO4-)5&=)o0hM{Ce?n>Uz-+Q&N5Lc3oLqwv3xk9
z+MlV4#C?TJ`6w1ANR6u`+@U30o;1dYs_9V{2WrCtzV1(Rs^T3k!+sK(S_82e5e`+v
z?r1uvE}?PMkqk4*=qq)}krxrc$BJB?iQl$&d6f1)2|W$B2XI>{^s`($a$j54Gfud&
zQz)+L$4X9~e)Jcez$|~PC7Y(nSzvSaISthNF1MzUcB*oj?W6K~J?==f-%gWos-ck^
zGVhQHCSsaT1d@eF7-LJry|{nlMUlKJZbL}iFh>1TCQOCVPUQ)<eBopG>gL)b<^=T|
z1ZBz^6@oq#<$mN~)zQ-cJPZJl5cNq_4P;ydIiOV!e!b3!x>235YO)lY=4At4X2RNO
zpzyL3r7OeRy~jH!&jvm+@Fe42TUOP7VO$S<&w6`$C%eAZBb+8kfsXWeskL;W^`^Jt
zq@_3GsCsgLh1a~ST(^8Cb@r$O(@^_VNV1q-4wYWUvZFIidgi;C##IfP46<BW?idzw
zOhAkqXiXm!&&8Ak-*f$SP@SGIo}%F-ye24Vgn8_4`o@(m(8AQcRr-qnkg7@zhlnhU
z8uT@Qi$QD^nHa92u?X-l;`#L{;{RIHa&dA0mqOU{ARZxX-yO}%Q|9T}8v))J#srZh
zHMN9@NdYke&>E5^3ZrA;{q50}ob@P8HD2Kf!rad3%F*yBMP~^1QE%-E%e6qnoseM|
zoj@;sFQ<j*PtDu+7r@vi$+pW1`YPk4XZn1*IA_D}ye?gC7nyO~(K}y7T1R%86Shbd
zqv+-@g%dn?3nZb-Y{wuQd|Cr~tXz|M<F1D+Uj3yIS%XE2QMSZ5p;_q#&N6ybN|RXD
zd9!16-CFr3;n0`77G?*ezGlLgVT3ld`psI(1L`*)U*g8Jv6%3(*U3fAQ|m4tcRQ9B
zEZ<`RkX{;&sO=)hqdhI{ugX2*rBh_R6+&1I`?!UDj*3ZVL))Tm(zs)~pISic^F+<0
z&FM^1l%$==i^b#2baAZ$yBt|uEQX4AUGR3Ek9bSca(cWq-Y!D(NmV)9Cym~P7^P|@
z*XWb?WEK4c8m(urGy#{K^!&}`IBQ;X7c@$LQRYHT(i-FTi%R_23BU<~4w#gp1=#g_
zpN(5FpQkySX(_KI$QmwqCu9^vcQ;W|_c+LYly0-EY=3NaC;{gU%6d@3tLxc@OCYVm
zbpakdIzB$5+D-HH^*zVPq;|DiZ7$S`>T9!adGwbn0o+cUxP1Gdy;9w`SFJdj7TVzG
zhIW_Dm*&guvvV?<_wA4(v<WgYt$bqyGm+lzse0p}$Os-{^%%MSy_jr4yMr1(r}us8
zP=96&8!wY1&nMvykfq@J3SN=6`PDd6hQ2IO^6AA97do~#kgK;CX55YBMd{3+O;-SH
zF_t%-mWmW%t;KGk{pkvErYCG9Daqv8`LQOaD6;b`DjU=|61?uCrFFG5W5rp812bjs
zDJ>lpmr5LBh9!hHPBDMpVTHk$n#Bahuxk-W_ysagnk;JZwety5##So+@Id(?(IZ^@
zs8qMIevY3)qrVC})~Hz70OKw&?b!j+1_;S)cj?8(33A`d(i@X>9*8qJM^|#x4`0#w
znRC+fVL&_QC;Fo#Y8quyue7X2)6C-B^srz{$HJpx|Hm#H9QE`I@)Plpa7E5kjgnrv
z7S57K%Wt!uU@l3O5;-zp5Eaw()OKj~0EQ^Y_Sj90wA<wt2(t<7Rg4n95^}6=b#XEW
zg%EEG2@In&#Ow~4O#A4T*F}_luXK=**X2EaxaX9LS=jP#>ix&F8eE+JO}%w#ze-=&
z@fE>~h0hy(r<`SU_3~o8kuu0G^$I16pHr>OaLp$D?_)PjLui6O6ukgQWph@>jd{iT
z8MBan&TFGo%768_+tYFq-q(*jyU%G@VD2~=&!&kIFNtP-3mc)ai8S1Q_3kpoM6e29
z77dz=97$V>edE<phL1Nw!(VPHHj?IqD3~X0O_VmT-JEX5=`t+!5=2HTmj5*xBcOrO
zrV=RjbY+oEry`RzWvyr^R`QubB)bUKGo6T!C7;P-k=6~Paf3%yUOvMLU~`gt?%Y@T
zIZUzb+>5L56#-S7uHT~DV{^~A_*9vMq<m?rdavOu6}dh}W*bwg`WO5=U**Ae#J&ix
zfgN*Mw6Qc3y9^E?uW(tk<LcjoN|a*md>xd%&1;LLv7*V%LB%Uy%&ONAV(5}4Y`6VY
zU870ExRs@aPF?8=5`2;hO)3_hsWeyS+>EfJ%&qnG8S4UDlLt~8>F00E3%@$7xKRM5
ziHq_z;OjqT_sP-fDIiB%vE-;*;mcN~h)g(|5~Yg@9g@kqzDWtFa^dYoXzyfh#fj-Z
z!I(<!;IdXvQI`J6EHSiW-b33{r`a>1ccxsic^5ZhBS~a+MceVS$(~BHcL_<|I3u|N
zcNu{mZQqHLJqTG_@qEPlYE6ySdtmlhr&*|*U5|>7gJa|p{atsm7SzrX{b}bCiIM&O
z=vSAa5*gE<6}yo%Luh<F)W9he6)x~qM^RV8%et{V{OPjUGC?6XEpv4#hReO0z&!JQ
z%$^dHoq-_9{HWK<U&=MU4v=SCQ7+JR^rXIilj`pO#_Ods;CWSTv%db<p5l=E1@Vz@
zsXh$T-^`}UclC3Dy?~E_nQKD|m3?!EoP8gq!X;J^3aB$xPkGpD^uJC7iO+u>qz;`H
zVE+6eAd`G0m!?#b;ov}`jk~}5We8>`09HQ?Rx|7(*@6I)R4Y#I;re9<lx0hkXNpNq
z{Q@PHICSoXu)Eccy1v9nZrm<-;dZkz9iXw>qp#NplEtCQ^0`8*_O--7QA6DXvh9^A
z!nZ_-xlTT{QoP&3X}AN`#a{uNsXQePKYwy{i#?HY6Ke;Xh3<wpo%rXAdu`&fP+S|J
z2S>cj4N65ZyTW(mm{9Nb|CSf97rA5i)P1YoqrbTA5_-$@5sof8=lQ>B_8%Wpa={*;
z`oG^NKG0mWpA^FO8`HdWVp%skUSUCdhh4^?Qkuy6q(odJs17s#T{2S74tR5<SDU`G
zSW2qI?_COc+}MlJVQo-G@x9G)(*<ZfvSSaJX=8z#dg*^mYa-YFsNdR+Ib?F3%LE@o
zZbR^bb+GDqC_xb{&z<+yg6Psz3iz!^u-8I9tT+05L4fW}Y60UcBbUjp`CX?R<9?xv
zbl-Zg^%<06*p$`XXc8C0dhYvEQXzoZrxKdLUHMFH&!_m6g2~f^B`-?`2Bm>KQ9{lN
z8Ef`LpAPGo5vh{AvX!5G=?tk@X^k~dOKswCFs|a0wEZ%9xoyO;;!a~ZIzP&Hd`|dD
zhHmo8vmv5Q`ts`+%+Hzx#tAZ(AtY0siGzoSo<Epn8gfU40EaGZ5vs*8Rd%X$h>W>`
zNJ3}8+a#ne_3@@Nl$saBi!A%4cLN)&jHquvSN#yqXQD!w+PkC=gv1Y&NLw9!v)|37
z!d{O1>aa?B*hPM<VThA?yiUg&o)Sj+BUxG)bF)?W+!w5cz?;w%3<0wnMd80fA8*VA
zb2F?UCtdVv6LSbTp=)3=+VqQs|JWBG`%02pe_8<NfL`K-hA8o*my(;L7$LJV$DDiZ
z!jMY33G}YReIc$uSt>PF{7GH=8~;dM71{T?Ev1io(vkw4!l4PKOS^-kcI|QTKmuOO
zTsZeVZ=i5h>JsOKj>)3pm96NBtaIp=i_$w2%Es)umW_RkDmCGI8;lP$!JQM1o~}W6
z@)e&4%3d1v=pN#SygPSJJ$Bd@#i^X}<B#bs6~czn`_I2Wc?`n!2mqEo3NI5R4(s;3
za{;u^@bc1Zawrj~cD=t+h0kpu-ep8r!b}9Hg|XAZ?VfsZGo}#=KN|2;5t3Pa<HTDO
zXjwmzQztZzpqF@8h<uOAvX;A@fWMX{{-_5U)PXV=O})ltJL*zc6FME42seu(gMfzw
z&xnGL<Vj_vvQT}?S#=*vqZOCuh*wSAhb{5sJ~>I5QK|?HUx8K%QCq)+;|FxJ<{gTw
z{9>J@#}yY<l^g1p4W|*kRrc`kn1RL0-4RUehI>E61;G~=j>l%Y9*h0&eMU<}+iPj~
zoZ#<r9Cy*o@dAD}LWQ(CgJKBqoW$~@pwrai@Yotw)dI-mN(XcItVFym1t)D^(qN@_
zzB7m7-(>ser{=$}GJzlv=--|%`2E-<?BOj=*u%Gfz3S{qL03}MCJZ|s>U#>07=gkr
zW@>Qs43G=2tu`g0hS2pKfeHmzJ5iyFF@}aZ+R~&fFjoqR6Wd8x=_!u#R2Tw*8CkqW
zvo5Nd5_Ww;Lx`8rUf%1>YMavH?PYJbueUqxJ_^eo?Jn>La7wVJ2A(XXR%>{9Spip!
zWSHQlKGrkqwxsh7>cV}G0kS0H(dT8fR%3P@K;R;dyFzg$Bn`aP;Di+6ghFv~Qiv-I
zXmH`yNYUUDM>lI4Z#O=tqkYsEenNQ49^@-OLI5|koNhN9ol29<?FqrH9fQwJA*5Za
zg0J2XfGf{o=LKiJ223GvF{izs^A9BKj@<^i);A!2+=3VKWWjd|)tME{hWpq{0Y}c$
zfRaHRMWV!CrA;cwH`S{op(mzNEoG1)AR>|M=u9$=pG3HZjiesTNRz+C%x6!5Bg7#+
zofv|Ro$(BdYCzkOzb-RxH;uS>A91@!>v2~gF`5wm8Up%{W=0f9W;Ka$i}|?C*lnyh
z(c>TYhr<LCF+U#Twi&Qa?gfE-@qXwGopK?CPky&f&swbQ_XypQ^7t+T^2SIEP$Zx-
zmX@xiPwctDlfqw;@K8fl!4Ct8^9M4eI*J1!iVgA6*4^`uv?KEym^JYGVk0*t#hsKf
zZ8_!Ci{fuR4?NL{pn+<kxe^m^@GalGNC=@E-KnDW6~^G9eENLJGwLXLF^)1u+(`2A
z6%Yra=wZnfjzLmFUKfrx*2itCW&}DQ#u~*MC8e^FsJUl$#hS`^C1``F*<*3~%(&dL
z%$SR#gcg#6A(rDV7m{CHY*PIppGzQ|NdqZ`>U+l9m)P+7VU}=mn!SVANXhjtxMmh4
zc+0NkHN+(j#>I0u`D319;v8ImX1R{rm(V4CJ87t4`040qpg%g+5>oes2BSYm3WuHa
zM-FYkm=BR#Zqdr@^>>-H3uwSHnMg0ePjgZ$Pus$}lb%*eM?r^+AAUSct{>$Ei&Ae*
z_YR}^NzSRHb(KkdgOZ&;MZ2RCBq5eB;vSGR)jl?#6<D87y%1<?w`uH+u`PIYa!not
z|8fq+yh*xmn^2zI+-X6!Lt;9;xH_wha+c9*Yci=tPks>-4<%}1o3rhE)3Us}{+rM<
zkuPCBImjIWuWz@rCXJ*<Z=lwSM-!acpX|zpUzPdZ@n0R*LiN7I@p%>fNGyHT$3sTJ
zbgN>;nd~m&lL*qN7R$$di9MW)4tdi+l~~cABoz{EXNOEyJx+(k>j88>;vf_LE_O()
zgl(Fgiy=K1A`0iKX?cboorm{=rZH`?sQcX*cYcYWuN|*86Iix)av4Pzs{9V+G5Wre
z8_(lbP<9bE6u%mc7@me%ba;l^FvZK3H5;tA>KWBcIYiC`p|_b@2s$Mp@O+0~9!us&
z;^~(mkeQ-om@x||6QbDnX?(p%Ks;GstN-*?bjV+ZvNMfu*Ub8H_9(y2%CYL4@RLar
z?S0ESjfmp*LHAE3-uHZzua?ip&VcO(=KD!%UXh3QGaCv9E}AEsJVUQ5rp2fA1W{iZ
zw0VNJ?)1)|iC&qcK1sb)d8bhPOjgqbBTkg0!Xe7!+vB0UScNk=e%^c;N23?pJ7hl<
z2QD?q@+RfT5bsTubS?QwroPAu69`o7MoZ~ySu}h*MbuZxT&X#k8)1-7i{_@=WPKB!
zRG$qYx{hu!mcPpJwYCy|q9(be7Oi<t`fBcV*z#BfJGH|T0amv!{<6!J`rRN587vPp
zsv{i%!kx)(8J2|4QH<bVnPka(EJ=e&@-}|8<L^tEtKY|ehPqnSJG@ipPK3NrY40~G
z|KM?^VO%ZyWiqVQ#^ilofxVy1H?zCX=fHlJFdKKP%(hQg2{eiZnjh@yK_pM>EGZ(%
zyl}LnpSv)9F#N$M+4%A*nf7u&NL0DrFj`psjrwa@1LFYK&n5PigBi8K$mO#38ck_<
zL;XCyidnKMd??wNvJLw`?u$m#XVF#op<tC~Z{ux)J}>^HP2BHz78wi&qBE*{NjNTN
zPtB?D_9rhft#LIpoIfb%2+2Q+<sLDp&?X>C=w=LE?RM)G()u$>gOG;3w>{=0w%2OB
zoR#;yjs@-S4`*7mUvC!JQ~<kjXGSh?t^3>Qslu(2&jyDoD{K}g(s(TTr6=!jk_jkv
zSt(un8!2=;BGcRMlGj+=$fxJb(>v&+1XO18vu<ScoMVVqrwy=EC!Vj|P{}6Nt-0=X
z+Fk8PIuCc~o8Zan?cH0JWXhfS5VMV?IbG(c9UVQ5daueo1ufljP#I`w$qeCbWVy2*
zjInK2hds-)l;XFMJF%eeKt7H9e(cC&Zn4~X(#Sf5j%1aGLLl8kbMAQIA~yS*iI20@
z((G+tw@q7a@WfSO?O9iPs@`g<?sL1ZQ)Q19e#lNZbrOTWVkG03o3N}k4ie_VKNaRk
z%6K<@bj@Uu+i$lWiBp9I$TruF5xKxe!xO(ndlO>b2Yj11IvQIC^^KJR5QfNFzClPB
zM}dZ1Cq=v6@8U$z9a}%+3i!skcQ<*=ge_%xRE_&as3(nvaUr<&nV2#f`P+qHa+s)h
zldl2>cB3`9E83OkT1@A{tu?Z9urUl$lMl6tzZo&lwtWArrHnoT_3|6cOUzbk8E}td
ziL7MW$h@P#yr5K=9b-^<T-i*Lf#0x}2Y(icQgiI3uNv&;X+$+vxVB<khH}0yl+;Jy
zS6ZRqrD0}1`W8jw@WeB-SXq;JYpf!kmJ+i*_QGG;(P=2L%k8?PrrO;}d(|V=yNwl<
zdm%4K%)UCPz@cwouoLlv?i4EK{ZLtr3Mt`}OY)O<x2_-toedX_N~mJ*FdEVU<`(aa
zA5=H8$;fxI-(<ZMcBev?6A5F68GR<D50B!`yB-AfIC!!6Bb<IG@?|=UW>~W9UR6|G
zZBrDX;`}^#no~h|&*?dfvSTE6VW?7OPHEHLieL%bnP<t2U@WD%Z7`F`(1KiQb4s=m
zd&)p2VN1HLSw@X1yE`i|g+*3M%4mR4JF%!|NX)$`xq{Y}g=%6>=lKN&<MO`S&+EIR
zvViU3D}f!a(X;HGo7Rq;xUY4H4C+gO_={qN@6Jr2-+!(Oe(U&h`G^3wZ_cK`9FOx;
zM}=wp<z$x6%*F>>9Y&urkgBbg+}V-x_hHh>OLDWln=ISnv^VvK^Cqcp4G&JFyR?g%
z4!s2@DaU}yK9d|Dcr^S(_U&9t^!Ak~H#kK1<mWDl^oVR1DxNdwiRJ>H(KOkDSD!|=
zN^*LfjyxsAo;K4KNJL(V$>!^|s#1~%+m`!lKVi*dw>8Q~?|8h&M_@LbkBr%6pD~ug
z=Ky+5O=by!uy!CXM!jesKM#Y_Re?_Z+c#p3I@VttQ&qa=b}NToYf%|15o9nOKR=jb
z`neH_=F6ptw_-{c{%k+OaX}3LqUOzc3i~88nrzVhQ2Yoh=0a}BD;rBW4+|Gn+@|Ye
z0>5@8A@<15(L0O6>^bM1T50UN%6K?NA#eC-<sM_8R&!uDHe1;V33})JstgK6yw9{f
zK<@qWAr-?Ke49nL40_NoN;FmH=zOT<g_n6m&d7nqP;#jL^)jee`1?L6WTtTrN23Q-
zFJ`wg9bxK%X1y>e#4VJ@&90=R1##%pwW|Nc8!0JPPkte`MhEbOU6YD%JHs&(=G0D&
zK)qeXfDZ9nl@=LlHnS?<HAZ?;eSdNLk`+h6M)yy9wsi@PDfg(nVUCPH@oM<1#w1NB
zA}96gpv1RT7e6A52LoB6FDV-R=I&e+LUqn`mwGuGOVOi9l1cTCh7Z=Pu+^MQ+}}tG
z*^sIF=q+a3hL;u^r-2|6cMegX)XXo&lu=a1U*wz+Pe1$ck@|LMeXyWC@yelb(6MaI
zH+foNXYL8AeFG6OKe6U<fzgMYd=CyjfubLUKam!V(U=XX=H;z?Mk5Ow;P*Njz>l1a
z>e0_+2B>vPB1)3;WJ!~Ks^mc39J@YJcT(Zq{+O+RjQL#jZjym0Uu*+nBX+oUV`cGx
z;InQo+EqJ2(|IvaJFq6cT|O`%;d<pcG5+o6&@`M;sxY`$aEc#Mlu*@#e-NzKZt&I#
zRj?sMqlXBmx$QV3n>2_9*UF{z;vF2!Nt(WL{t&aRI+J}d6H@%T>Is+KbhsH<chnVY
z8TO1O3!d*dhm351gGz;;Q%8@~O0hr({o`BzftC5kT}kDsMLVoZu|1lRb+oQ@FOsvO
z4-K$nt9e|70@9}JldGyXR05F=eD!jqzLVOB7U87M(ii*Dn^2@L;No&nNL`Qu)G(w7
z{H;Y&IZf-JWW2{bi=VR;>1w{?AUW)?hAf$=%H~TGa9yS-HSXZ&%q6Sif7(wTP}MGv
zXYNZL3?3?HflE2g%?X-k;gCw8o-D!1q`V+!qQw%|;e)cu5!v^dPFz+oRo;jTm5-(N
z>h_cqn{)d{PIK6^#t+k==E->yn4sCbpVENCf`ePn8Qo43?$i8n*!9VXVAoz6=d;B4
zd%iou@0U5{Chy6AB>f0T5j*Tma||UU0Z#?p$KHmNuojhNjm~O^9n|@%ie!$lp}8=B
zWtcx0TbW9Bdp=_g9=p8pIxRDE5v%OlduJmPb6zjWqV`R8d8@F-?&W(w1`d~=st~M=
zv%b3iS&R>D<;Nc+u%D-0cDpbK^FkC}ea|dBveDi@OPqTLkMK+n{vLfv@iaff#QR{x
z$d5!%V(_hwt!^SYTfa8>%sNHV9)z=z$2@(H^|iX2MiN*heyl8|e#g0iX*GScuv>B{
zO95CJz^T;p+F_jMqldEKJI~Skg<5}(#w3b&D+&2K*|_xj6qB~3WNw?jrjL7WOcL|w
z9ZuEK+~p=v##O!g-@nD5zL<G0Lk$uo`!1f}amH$3#6EqPykj+0!AV=rG{BtdMf-ET
zH%^esfP$Y9>q&87=R0A+LbTq^g@DeE<KC`3_06~Nr9n5JQzlbH+$+KUqdEQBPW}}N
zSl>%tF%9;PPR?}eh55tnUOm}rKZv55(%li87FJi<ipDd;NYEvnU0l48+{BeyeX@J{
zOfll?8-<TWS~RCRPw~i6h_m!lS>0DAo2Zfk7Sd}a8*X23KHs6%8PMe(S~=DbF%0Q_
z<$afdFCvuQ-brb?as@sb16ecc5bIG&y~h1uGmu4~uM3p3D)7{gaa&}1VS|vK+{Vi^
zZ9>~PN4sa?)<o~)WG|s!vKBFedDyN+_T<eWoE;%v^BybT0-1DROf9La5*Kx1S<Aa7
z@^atA-5Tdf#{|i3s&CpXl$GHM+YF^@CA^q<mYE)ikNd48?N#cIajjofEsvNCH#nM8
z=HJ)2tA7e<*0wyx6dS*txZw?xRLG(vOE`bM;L92-+N`$Py1pX7C-BqhCLW{S?=!dj
z1d(VMr|4Yk*uY0Pl(ajL<1NaGO^Q+ky3`X2WUmhVsrMMfgv51Y<D%a|Ee+?k>=>wE
z<3k(?6fVelrN=?~>c{i<zPXpPv5pw7_B*l{FJju@=;n=Lw#vSbNAN5V5RJR(5n;W;
z^yJf{LVG;zXtRdD2B+?V`#l<=4vr`g%@giuJOD2cPJB6!i$4s3{i6aLk|~3VFs|T;
z?Gppdv?LlEO`p{OYiX_wcr*q698zf=A=HeHHRdn18#7y&6VO;=1=1&<4d<gARBymH
zI>tF6%?C7$KO(C@`AdUOIf;38n1>}zUg2;OJu|bL+nCOz!6wa9e!)$wI1iop*{~3k
zAp3QCeTFr8!ZgsNu{%^PeGRy@E}esw+9AW&meZ@uYbV>!kwW`y*?QmPC1r+c`fJM5
zEGW7&4&p)TV}#YHGhK@;n~l}w69Fx1_VicfXJyJF*<MvCj4Te$)&W8UBHZ3f1_oM-
zmIW=dw5<ka4&w4bke0bFUoo!&2V>-X&+8wgshVHBTfSAu79_*IJSD~zXE3w*a<Cye
z6D>hUUI~OF)~Tb?sqW+Vhy+*MG_1GsruP*USWYAl=<S??6w@wm2OsYMwFm%H#gpwe
zopXMjrXcKf>m7UT_w5nWsc?;5>(>vuS8zBq0?!jLZ?MI5olbAe-^qJuSDpCP!@hs2
zUY0*4qlsr{_bM}LhOgW%xrNROAT0WRh9-*c-MhX^|EXLRU?0cCz>g)~mLbte!D}~j
zkL@?B$Js7p{5!+1moap1yFcz))><D?;?P=ZkC54RP~PlJeY-zXyDO=nQ#wcL6@bvX
z6?;%}r_Q8j7DW5lit0UUh*QQC>f$%A^^mh(9hHqhM|l}TWa2tMxM3#<<mL4-c2}@h
z;67^id&(wm<6Y&ml&{D1#COWo_^9t?-m2vX$;W(&)}A(#=PFrL6?vPJJSMMy>`_%V
zV<}ip`Vb0m|6E#+iaP7B$S%=#`D&;8ty#Dy;NaliX6#sJ%FljoZhK!{(&a02**EuB
zOCXoC7FD)vt^lX`H<M+r!}W8f)Y3W6_xF|uufO=UjP9&@gZET6H%5;u`Hnig_lGA`
zQx!8Gr(!JcI}VYqI+UefoN8U95}*>gzPM*D>x5LgC#bk8wYZKERcM=h53tWlv3Qec
zH*o#gyKv*wLc)u4ha_#9mEXr?d4(a4t;4CtY43YN`06}lAq~iR61=04BY1f>L=u^k
zQ?5UA-GiD({)~`}vZKRDY@_an`Rp4<>B|Y^ese`1yQ2pA-Z6ax$d}&iLRs0%;ED;I
zB98GO<wku@!a%;l73gs%DK4?F42RUyd)66yl)X&yU4#g-NxtL_7bypu^KnGe$~@^B
z<v{uD$-1vc-K1N(k$LF37MR~DWKV8cZgKR3IZuv1ww!Q&5Z>rS9a>}IdXl!T`XQzR
z4Z{@e>Zx?_&&7$!+$==tO!x6__P~?(juvALj`VO63(@7mR_QY{(IKi`dWh9;p!_WS
z;os2>aU1CN;PRIXnS5m#*PK1c(u%fxnVFk0<@rbWv#vu`qg&>aPE^xT&y3)iL&U3y
zpRN&Akv&~cOONj5(uZeSXYhQg(P@22aQk%Tqr)1B*5k1*9<3*&Yuv+|5|&-rWn^ht
zCoh<^Ms0)A3`tvGUF@tQd*U>79V_1>n*TJL3rdeF`Q|Rh(S3~Vhpt@FTW!uq5@JZ-
zico1hqQ=cwFT{I`uHWy&q;V#18LU@D`gJZgW%(I<tk_oNj9O(tP+QfL`$sqHcAlub
zn{Z?ySg`wVKk3a4FxEf&oCx>^wz(q-gmiQ(U!n<wsX9I#{m6aLT;_4wue8avpZ&`6
zwfOt!@yJZQl6U*>c<7OCB2OHV?8ZJK8;4|xy<EiZ!>L@+QO-Nhk8SmC<zb89JM)GV
z3^Ub1HL?!VHxIQGSx-;Hq@eD(_Gn<@k=3?Z_vb3)&{eyVZkNuCSSi*Yl8l{q2eI=M
z*h>mVjr7~~oCW)j1P_v4<M}yz;@ne#3d|MFd}{llthrcYpo<B?#+`AE5rM`nPXp3X
za>*t<kMOc|EB_8^Mki#}-o7+yU!q&QicWc_!?3R(a+U(el<tYBm!B`kV2Rzw?ChK%
zFLgcgNB6jv@<3ttaQyms(_TD63^G2+yD#3WDeEd0=aZSxli-;sl{nx>laY?SH%8Nw
zF6;q}yja^nN)$Pw4|eJxlTaB9?s;{yJv%6B%2geY<M#p87(-lw?pY+X3zH!ANsn!K
zL0^?Xvy~~v6}tZ9pk-p{rfs4u1>NSLm>5WTRG9lo6L3S{(j(xw`grtOp-D4Cdpkp!
z=WcN|lcU~L#%aQ|acJ+k@033KUc#-zwtP0b|5CSh0T?VXU;b<hr&|^E35b@Swx^#2
z)0@2A5zX|2X=5BHE6&Q!Sy`Db%}fyCULY_|Ib`Y1jrbfLx?nIFn^}u$xu7oZBbStJ
zDe%R@Tq#XXJ6yGxrLa}4^Hfz~URFDeSP{?Uy*!%qb1h~|VZC?L3ZEk4n$ue<cy_;W
zPZ&I>TA|`C-GF^l6+b7i8;Pu1+1W1QRi;>v(9^9?kJrC)L@EwJG}1Z}<=NC<DAe|D
z5D;^PuoZi-2cL-Bcn(*+3<E6$GwI4Ht;;HwCo|pE;uoJ5C@XC~LP@I?-eZ<`uc^Bt
zQgIqoXBKsD)@pt=Dr4S52avOX4njQf*gc!RS_kw{3V+v_lwT8V@6pPPkBfyj=|*$%
zBYYfZCLT@BsAPCv6ve1o!hVe8qtTouEihUqnL!2SR;4sE-WHhelHK|yF5ou(uDt!F
zxw+ww-u@`cFAS4&z63$m{ui3aW^YwTbThgR6v*c866%{pOlp)?kGsXEP9VvQ%(4|`
z!CNBg@bI5(ls1(^q<dary0f1kQ)@5}ZGCZ4)*RnaL;TYIMWu+KFKjHt`Q24Yb^K#}
z3RKelkNI;igo~UxNRPmp#sQ<nQS)5~`f@p%8l|nRGBuG!uRHgcjU|jiZAf#;)wh{A
zwPMr~hM%%k5+Y2+5H+z=qT{8?MzrRKUa3);N0hEJ<6sKx@1P>bOe^;=U~;<QXRzo;
zd*7zT4=1F%YM38v4uuFY)49E=#E_rfhA&dqOsQ22yvyFFhL>nv=2eK?p#}kUh`qR@
z^OO6c6j_aNn{lu!jTz0@Uo$$V9Hdl-A50RobG)%pUd4@jp`ud}VJ+EQSe{e(4NomH
z2zjprz+Hv9yti$s9m=OY0Iarz(<3Xg8h@VV`Esd=%n1!Y2k@e9MdQE#NJUFTDbIOi
zU$e-jisy!U$FhDMWjJ8}WTx47+G{EN#S4;TewlXd9v)F`%Qs_hWrA>3R5a2vf_xN>
zr08ObsCccuCo{djY)RorW#FZy=JpL;8JGH!ta0n*KvdGBjO85U9ORQ3^ip{@OZO1&
z{N?l`p@ASm1O(VOUJ!x^rF-R+<wWGljNOAy5u=lJVi@`kXT+Jjy!^M{V_mo2uD{IF
zlDWl}_#*w0#!Dqa>RODDO_QJosVROFnT$=ziN7Cnj`(t=`^yPG!)}sOPFI-9N4Y7D
zDaW)rS~6BuX7X*;N@QI-LjNHG!n9bQj!_=ubGoz2C+mad0&6=?ALT+9pO*K+vo+XF
zQI+D?a(%}pIt_ekZ`8er6N8{d%A8wODH$~Flfn5~v2@B)oHvUYf6z<IefsTaAN{9q
zD5_t`PHi^|upRV99h`_sJ@E;E1rbSJ(=;Twz;A)C)ILfA7j@7)??t_v;55~<oo)j>
zF0y^35zw)oh*I#05KDBaqR{~2_|T-$sHhmI)M#2MQJ%*EDsu_(<VZ^*gitNVWAV*R
zU&R96KO?Y4KD<ot{8mEFL(TZPy4$i-r1Ii>htDYHX(CnzFlp7dWp#eJ#iGNZ<Cxdg
zjWbn(_Cw|sMr7%#uc+F~3+(H9Q)}1$l5MQu4}hO;yx#Hci5jH=eHb2R#hS;MYYzQT
zNf*gG9r7a1pts$USKe&5l{*^e<4N8biJQ;my<R1VJ1mrc+1cEVeRrjfaes7cX{{m=
zN{{OLD&ohC=i>DBc~<|)l9~0q(~bwjSMSDa()85)q+oYBn%g(AF(jA?QQH}aD8<Os
z_2e<lc~s-ohv-LM$UF^FjKZ2bJBDcOjRhP?CZg)(6;|?J1=WjqmiMj%3b&~{co!r2
zm$=K6NheDBazC(?TSA^DVwWWt<R`qcq3w^SR#BMoyq37a-RXJulhwFn*7TXecj1EF
zO*NGt1;bQH1NfjMJ_SF@#PXG`55e&pxo0(*BW<|c{Z%UW!#1<IWu@W;<Qof3cH>#h
zeN#R)pF_XOscYY|7~2`&pf~8HS~85CEbDnECa2!Z_te4uRSVl<v^V1N?IsX_TaVVJ
z9?&CBJ+>hnXUd{Zk-rdKzuZ)=T%bh%^W~=orLo*tzC5h_90~iKxx?MBgZdQGrf4KP
zdtXhFcMe6xNvB8@j6Xz(zK(D)SN&1Q{0wgZ0?M(?z4!kt&$9EOH&E+<uabF`mfF%&
z#@%%hgkn|7w0|J&>)(v&p45?d`{spHHR?oK$4;}DUOsEe=OPu^CbD@70prH+oPZ!C
zzKmS`u2gq00=hdQida7W*qxu)YOnjN^Ih{VjRVn!rldT<ce&AwV(+v64|DezBulp_
z>bh-Xwr$(SY}>YN+qP|Y&$eybwmI8A{jI(BUFV$G_x`^BGNK|Xt7>FMWyToKoBras
zg_=!duWa!@cUjq5?9FmrLYU$Nq*Q!R>w&8gZtp1jTu%I*Z+Xg|?jW+lyJuI1h*{yi
z3*UNPi2J}ZO&ag(*`_LNv08)grUW@YISAqID;?#^!7_;z4mPjd0}4B?(}qbr<R=O7
zMIlOw%8TG))d^}9jCE4NT)A#a6ZhPX@H`<f$dyspWJq(rRq~g86uy_?(<~3IO;h84
zH;#0bIn~LcZv?MUprFZJ?0X4uXv6*Pjy#Yf+-%`>k*BIvcRGG?oz>PN(Z~@BKpnyU
z>+oJXT-ed$|6q%^dD0GH(v;6M>N+>o9-bt2h&WvG?8Zij5u^ogZiMmcwkBl)jY0VX
z@oXQA@;97_yh+5u=!18Va9wQOX;0ZhwP>Afq@#T2kPEC~Um><<<R*Vedg+NDBeJ1a
z3rDQuVB|v=$OBU7m_Uv;so{>`a0AVu-}HJP!mAW@yQHgn$pUVax5J;gD}sAMr;brC
z-MCL{Bk(oj2gxx)^?o1fa#GFcFLMPN&-z@^6pXEVqpr(-AHp+Br%<s(vwa^QNjQux
zV+ZltVT96A`IyhBM-kNo%bbQ1$l*8kh;A4nI?K=JHB9+v(4>an+3`n$dii3|D^$}G
z+JSbm(G`%uo0x=+x+lynIuO+>ZEMwNf;083<gCuUnx}}<&wn{1HnFb<&p9}4CltwN
zIaa4q^9gCJbF!yPU0|0PXHGP!gm&6F=E@n`Zh41aWlpb->u2q8G`BiYIje07Hm5Z6
zO^(YH5@QqQII>(18`7?ik;r6c7&wf0O47Xa_Fc+!BrjmE{q48f{fy5QW4;&5m3{T3
zmbfQ9H6j#VNuQ?@6GJf?!dpY`I%k?fa_e!|;7FiqWB5_nGsP0ZsZ?884?;hfyt}CG
z1sNSQ4Emu@i-!$zGQz_hfNtD%Az08Vc~s)RmT`^ZvENj|FC-V$$kc$5?i%Zg6TVrS
zWzf9q%7YO*+3d*|&^>DgSq*1ca4*aXIl?TInPi&bi4=VT>XyZL?{ClhDB72yS2R@s
z<iEfXj4!1+-WD{L?B#2+owG4(x|C3XLS`_~wjHgfG#cjqI&QL}yn;JKla%B{*PSS+
zN=LY}4v{~hHFSX=q~jS>sm%x8H`x*!RNh5z<EA%0Gb9EMJjyXzb0oR`;b*x|4^=&o
zT6m0%$d^$BHUBWqRZYwy>)_Fyb5?DQVGq5=T<-vXw*3hHk}vi79g;t2qHT1;c(G}l
zT^e=rL3dmGfp(EvZ6f7w!H+aTc89HRdhd#NgnsOsgArxBrKiPrVxP@>4<S-66s5|!
z(=@)fd{T9jg0EOza#KAFMbm|?R(PMGBRYUt5}6(IUR79ww~?$<GfswlbI7D<c*>m^
z1;@G4G<dApxF%?Hwpz{VcxlAj5kcSrw30FYrSW!Hd2Ks3)%bisUTfX_!zC-SH96TT
zAy27wcRSo?RdW}@x?Tb<mqrWKewUalp-`IT!jCaI{HieKa4>JV9xfH#^%LtOy+E}p
zvMHbQOkmA8S#lTgXa})RxX2#dt1Z%<!tWSRsPT(CNXy)Qu8tGX<#`Xk<Qv4)YZL*?
z#=`to`{-m@+}iiNwrX>1+7zX!82nS0D`hGpK^8d#qm<ZYK;shk`fZ!F=<JBlAddPP
z&Kan%ZpFDVMm*pe-u5V7)qwt8jfqbWcneR!QPUW^%Z52TKD3-mKiNKten&dPJ!+e5
zh%V$!*L+VQsSHZm;GK3@`)9-P3{87YCgHo6e{JyN9dCP&GzoD6*FUP4dN=|f>GR-p
zf@m(#hvT=FLDv)Ph_)!}fp7gs#7>#|<PI6VTC^zQhPxJ1;3Y9?QPu-~gE$5S0en35
zn_Vz_e*>Q%(kn`j?#y3Ywq3+mKuR}wg`<%uSzpsED+8RZ!3MK_CC2E}&uM}-;@GJ9
z&8D6#mzzJfn(v8$XUM-21})L4GSp+eqEYTB>xWR6?cN!}J{hb^BkvzFW2LGUPPw89
z6P^u^8UMf^Zz|OR2@P6IYX-8{fd~zGaN}3B9@E89r_9Z4a9sy5iIwOlDa*PfSjnm+
z;2g5vN1O18Xnqr`GORx}gm{8-Se>X*#hH92f5}C{SQ3%G^^`~lpv#CPFwTcc-LI3Z
zkBkB(NRBtzCiX3>euzx+<Gr(N4~#ts;Bnr`1Uq%*UjSq?T~QAQ1{0&5bvkm1@o<#X
z>54{ww$mY`$Ya$GT!%`37Z!FOWUzk&#GD{uPojgM5DROX*4eMDVX8(I5RRAoMQF4r
zGa#^`s#<EIRySXFMMH7ZZfaImdp25FW><U8(E9A$zP^t{%5Jxv<apAyaot{6mSvsT
zj<a<uGN@>F-&IG1qi&a_RrFiBfzqu#2UMTj!sPTLyG>4t-p2KT+u>dJX}=(U`El84
z4!uCPthPh4C9x>A)>Os!-;8TWw}SQb{jp1?P+e_@>FJ%ZgQV>TWrsi6rOxtSu#14V
zNAd~4+XE@(nV!VkMaK>%vO|aK6JQ5;*T=KG4(5Tm4$-bfcH!r>3bn39ZSFOZiz_X#
zgldZ`EU<*k)FZM2psP}yV+nGuO*vTZwNL}4(g&qJxizjuN$E9E1A$ie0GvFzb*D!=
z?tQ++8JP-EzonTB!ia-iQ1`$Ll?}GtwS0jpvFlB}1(gaBr$;0$V{8h(ivvB_bsP<<
zqX!ciAV-HJ(qnhS2cGYP9l(bTsVL*@M?i<k?ZZch0M6rk2<)B(_ZTRhh4v7H7Yn|g
zg>4svA{I)BsG@T6pPq$u5(|o%1w_i@85H6&gSN(p(-5Mv6OgnMgf@el%A;Tg1ZNJB
z-8D1=fz1b8R4u-Me$1ow0&&h`T@1*O1FjHasT~NFLp9g~E(1!=M^Xxcs!$Tj=kEL?
z@tSk^tW*vr$N@GH0Bg_-H75sFfR7|0L=om^H;piiA;E|a^@|+P1j1hrB7h$Pz;~G%
zZU~(k>US@^lpY8yOt2Z~E#3$8ckj+ET4!L(ZOLup`bEEOQJ29jNvGex#~3Ddmw?;v
z-46b`KR4?J9`&x<4&0^^!o9vx(@ydCBC<`dGwPhwi}r73w3<HK+sX(t0xe}knLQ}2
z5M8x5)7C))H1$iMtWZa4mz0C)UUPO(vOThw_yd{R2m2R)cwd+phi)Ruf^xewU^x4N
zK(BLP>SnyBKAlzI4t=ysqca@p?3wuubq_47V45s5Ci2mP#<n=%Of`>x4Sc9GrPkM;
zg{86^vOa8;%AWNP%I(aqRR|t|rc!bP*KdPzg_uaIPoj`at52hdTy2R<hhEK?nRKU5
z1^zi6C_B4uaYASQIVAARNtsOPnXpPKZ$b1inM(WFZkwPk2)&B?6M`rxt154cp)N?h
z^7}QQ6P48>=)=8{(>eSp4sba36&;~B5)o3bJmk1G1kU^#b=T2W$4ZL0DOAVfS;eu6
zVG~p}=&BQ!B`k}U<|)mK8wE9JX%c@lUeOTXr}cfY`@EKU%tO~hHnV01i8s|$lF7?+
zi?QTFvH83bg)Ua9#M{>!uWEib83pis^3XGJn?8C`pBy?+;2sk?2yi|kvl59Hv)`K>
z{CU5q9JqxLO<DP5_eedMQm9-lKP0^n1PE0d_^Sp2h#<g=kUe=xfVXRN8PRVqYMumK
z3HYM-d7d`U9?6xWog&@h%6ZhY`psb7qTJ%Hd0g|BM#*&wngpsI`d-)KhSvGQpZy2L
z?(athA<|=W&%$Il;AHp#V-AqrGU#$(_vaBu?KR@GHQ=y&0yT!ZnSop9!ww2qnt{@q
zLCTl`PVMoKkAPD{vxWgu2@7F_1&EPPxsrn-#(?hk%=69f%<Il`wT0Ujv&~zcB|j*5
z5V&5qJxIMNz6rGxZKc?VvlU}GfXhnoiStR26&=jO&oi8rISF%8<0SkozH(4)5!WoH
znKv;P*u$AV#EcCF95+CF6XL58)jb97+EY9Q<;e#x5_CNU(<T5-Ab@P=H$4U6Bo<_;
zb&Tc<sz89o<3}xnNzNlw+AT>6ea?q?@rR7cyE`$lqeg=+`Y!5l_)RB{Rt!DwewO8=
z!by~!A~S}%O(4yxTr17EW{u3!VI4pviFY$KKhnndIMbExp=UBM*(#-|XM&+GRl;^}
zVKP@&GxvsmW42}Mv}$J9OTGf(UE~^s%Pt6wdHwe^JZB>(6<0BhY;IvAaWDO<4Ig+&
z#iQ8`&Qt0Y^c^QZ#{)K7JqH8VFzu2JlRIOLO=}t%eSgxf?a}Fv=Ck993l`S4i>2vi
zMqQPrW9vpoG^1rhhnI1wt&2Yw;kdb7s<WzVW=LDex%qbf8^Vg-=YyVgoL92{-(;}W
z_p{Hg&xh`(Z4W$K+fPMLx~|f$&>V}K64z&!g^u;aM-<!o9HW~8*Ob@n%kcJV=|!$}
z<OjHI5T5OA8C$Xg>nnQ?EZeN@_3L>}cWn>P)aCi>Ma`d{CWci8fr!t7LA^oF@C)cu
zZHaoc`SQhbsfwb;!-CmCD`N(Sg_e>_(ik<Jhz_B3{93#up(9~r8uU(Dz`S6CV6=G(
zb!1)pkUocDo6Q}QT8c*0vDH12W6T<gtqcnv16tar!=#4HXm{KKK@4umOWa~yJ^`s?
znC+laKcc~(J!bHYfJ)FzOl4>rY-~KMakypdzNZWsQM*@(>0yC8fpUQo5`he&G6U3;
zM85!lLLz<_?mN0$wqGxnV2LU!3osgxeM(w2e}B<z9y4F15CrCj2`rc#lDI@gM^DhH
z%o5P9^mt3uu#&V0itbbr5pcAeCTRucWX+SvE|icRnGc)%tf{ew9J7+mVV%;m#!R)m
zTK%1#LfgbD9WgQWx673sY6tCQ8_P&S!Rpyb*26=@%A=}NY-_=ocz~!U*z7N*2cwrK
z<2)=Q$<y~okzza964A)`@b_wY&MbQc{Z|(o7gwUSOS7ecOQKa`%bFDuW_{)*t7UU}
z_}K7rk@R4Z09{G85!u-6l}uWCHOgXPX+RDNJYt_>pGTYmf>1s#RB<%fox*uvU|2nx
zd{8si$F?Ko?+9{o1y0+SuAApi_nr6c%yio!d$;9v{1x^WIN59bZ&yIs%dlJxz%R+Z
zoS$=(C63>paB=`BYtx^8Ed(8#l#Om?vP@`PS&4$)0a@t-v?bRPa@NlD#K?l#O~8YK
zldD`Sk4(S*ZYukN{fbw4@;c!%`)%d%Gx}oAp!rML+bB&qQQluAno@#3?R;!@?yFmn
zH#ak{F!W7<2NShfDA<&=$g3t&q8gqWIq5>U-TV9Z*{cX0PcF7DX8f2Q=kiuTg@UUp
zd$wu(!F_o@e<-$GU_uq;XYkqLUrR?G-H`pyaNy57gmGZVq-Z*$t83YMmz$&B$u68X
z@4Mvi?cLW~UP`v|4Pb5A=NRG~9^9B9<7%emc)7*0Uz{%i+ipEXIMBfcXEDMVClYMK
zbwtsLEobQ7sDucgC`sPA@x&nbnq+I*+;*1q$(LsX_lJpUJUEt-H`z9}mX>6AtfHC5
ze=qi=n%PqzhroCH@I}2|ZubU4;qiF?wJ~BC-14(=#}35&0%8jJLLQm!2zp&0vilrQ
zM1`B07u<Pp2k^5h6<642=m4ryz~+|PpR|$qR6bU5_OxPz<g`!|7aret<v`$&YZTI<
zD%9t~zDkr63e8^tF652^KNB2zxfcu?dyuo$jEbN^UviRDL&`{bG|v=@@`YYacmvF;
zU<NV6f4=wBkv)~6KInoHy&-}XnMexJG|$N%HP#5dPYyFJ)Kgpks1n1W+ZLm#f!vxs
zko6*#CHAT2yRhLlqJj|ZPe>o5MM;_eO;3;%S_aWmRRPO|vL2690L!Aqsq+wpyVEh@
z1S~w-YG<2?W=zv{eS)#Adh>OL3d=wVC2F&oja56GCNuT`uW1sKBXk3q#0Z$A$B<Uj
zRK9to!j~s$EYpI1$e9f$>q5G<Ra%VYsz`cUvkvR@`4fhT{fyB0Tj7MENwPj>vlffC
zR?p#i%^rQ1#<T&Dq*blSQbmn5rVQAz9-zq{$o35b`p3e%4vKA4$geM-FG>f9k~=sm
zx1Mj4r0?MGP+fKxluJ2499n(8S9Ae=z8W6b*(`j;)zGk0J>l!G>#pMU^3izRJZ)5(
zt9v}%o}r_rK)xP#zWNj9&pa<b${X{7lTXrK09Ibhq5r9-$Mm19oZ|nST>QV|wEyH3
z|KF2~|5YpfACrsB|9>kk{;S3N?~>rZqrF1n!vB2se@c2ksOe|xKi$Tk+~~i0f&ZW7
zUR6ydO-4pm?H?1R$wbeptxfmyj*9M%KR@k1QS6_7u%fe_ot3fmKRro$I#~xJV~3xv
zFZqAxVkzhpj7`mdg3j*b0zbKTV~U?3v9Rh-zxk(3_&<bf|5dpBKln4lPnPw6YK#6q
zs)OmLtIPg>s19XFxkT|_*L-NE>@fJ4y$JE|rw9nMep(TnVG{gmzwrn83FC|s?8foK
zM+rFD3Gv+!0O1kt_~pQUP>25y>d;0=&YlBBMd<`fSJ(fxn`E@P;%rjZ+|bt6zVY1p
z?CSY`?gE1V;0G=Oq=tAlsrh?1SJERIPXI95XPNHu^Z_)+1pw12Po0G`fn*^G8w*_9
zg$*FZ#-$_3;BAN&@FtJ-&8vWp>iJM?iVCm@3{VzVV30r<c>i?`>gP-7p+k{6u>LpE
z(h&(D{S>n{EfQ$3(!vHnjlv4qri%FP!M|{>%o`2h>H!@v6O^zL53rYw|Efw&r9ci#
zZ+-5wW9|`!mn!8TO;`e)-vt6-(=wl*TA&Bmx*jE1mwX?h>5sSYfio-se`<umsFCWV
z-(~nTr(S)0DnEuhgTN4@q46*|qJ00Tu@MuBMwkFX2Bs3hZZ&gl+N&FYI*2kAP=Jt;
z3_1vzY5(J_$1ejpizE{O^h9r(FaQI500uu`;!`_CCo}E~`Yf5P+L;_s?MOP5tIvtE
zi3iSXG?4Q=t&$CJ<JDhItD|-3Ac1p#%`;MWT1I?>SIlfLB?zmrk$j<1`w9ib9Z3TR
z!S*4DCq>{hXo)Fcj1xQ%M5*_}UQp;#;)E9b9Z_nL#HYAqQ2O>q?hOpsnWZ0?QIts#
zfm*9TAVW<c#-RA4i<m&=I@t*!=@Ldv#NB{+tpS;pTI-0r%v}NKei`czLAigBN2G!?
zXGjJ)W$-xpC0ZY75lZXNU!BF!#?WFBII7h8ORZ~_aSi>c^C#M8aF_S89H->nNHGDW
zDG4iMiV>%Tatw(aLmawa#jXob3XwD2feHXu!zh51(?TT@LXewt>F(?bbP##WysVgP
zjfeKJeam3UEKrL!)`Y=jjcS^cEgrbsUEJ!Li$%kmvpUC?@XEB~R_-+$=MwtJdFM6p
z)hz6pDo?J#JOAqBh>D_k9im+?^J=VmdHKMj=d*c!^sPYTJ+z6_koBs+Tn_G@9IidA
zX4bTdPjZ?Mb;u+o1zU3>=A6AhL76J|?Qg2Q^!2b_v6;Bw7*3Cm<_ZV|v6qgLSeTr$
z)@YAPct{1Ds`yB`!}^gPROV<3iXK~&oY6?35@yx5Z{_zMnigK25htNz(NDb4pSPSx
zQ*5P#ahvd#i#eOcHtgv;^4X}mpKqS~9j2BZhdmBQOPrFHjG0*UYRq>NMO||1us9Io
zX2bh;5)c7Qp(V3M!y#fJysCtVv~>;0wL^j%ZV%f-r(GNMpmm9DhGK$okXekxdB|XZ
zvqJtfy)^#Qc6FNqHo1VMEe*dJdN!=tlBpULhb9JoX|tr4heX=_NDoq|D#k@QzYHi^
z><R!NOacqbgV{;yT=0|WL$;J6+};O%<f*j~lLN7DDO9z8qzA4ihS$`FUrM%;k@75Y
zr64Z)i%ZrP>g0`LGdc8UK20pM-#r=Jd)gY{NyCiB{YOMc8De|kL{`)al)1UBLl%=|
z4j&!Jfh!R7ht#!l+AE2wu916ZLnqJdI`Ug<pGB$W)!upzULa|WR%`s*Ud&s3e7}9=
zyX5DXk!i!6aiu)0EI)>cp2o-^nhKHj)-Uz9C%5F;{g<j4=MO&l;hu3s&Y2X$Sv=yV
zKvu<~5?w;&7xn@=iN7D5_sOw0j)@D8T|@`0rOjHD`k6AV9yk(nF3TDy<k#U$2i|`x
zOM^C5aS{`0bU|(CO`NeFc{`+HyIDS3C&TY)IAptG%uy1M&d@`4n!LET|HP)NP!?m?
zOhZv9<9=dcdrCY1eN^h&a&;7#2<%0hH*WeeUQQPKyD>k`6LUcFnc1>0sa2TEimHWU
z3y<fBCzs#}FR^kTtKMC`QEdE0`HU!#Q&;1*VPQ<jY_-6N#PdejimAG%<Fx(ZUZaD0
zK%scM<UKOb6hITg0=f)a11ug`H)iPZSyDO!gT_GDu6d#>QGtE)m(Q3${1MxMfpV*2
z<+~IN*@jK*etujkGAG3dD{1?Uj->o6lb8X4|1Al<I-i6&HFI2=vFuwW3aM^2WGW*m
zcf05VMf3w46shKm0F=|KhJQ$RS_*~t;a-$H^DASKGLR<s`~;QR2fT*O#c9*)&m0d!
z^D!k4kj2gmK7s3%Cz4B;AZKd*$9Q`T4zRhSYZm=PBw_VS)73m6yw!W(W9BW#hAh-}
z{7SsE)z06iK{-*Z^@qQ@<&rfH$R1#kgp8R(o_r>f31~T#T(#A=n`SjbE0$IVqf|ea
z!iz{0fbd9%!HldoiR0PYME0<h;GV;cz|xWGPpSzFrY*)=6kRz&O){5GQ9Yfq*o-PW
zH<gv`wV!K0GGRmcx*cZf)+jM^gfJBP8UlO^Y#Uh-&$%RN$al(;w{aPq6El~Jhlwvh
zf9c-3xOl$V<})MCnh%GU6y4M)H-vE$yAkArQ5lF?fN4~pzP^!b%f|%%v2CWC0b2tw
zh-qDgNWKfCpBRxYf+|0)frgwJ4UKFZ6IYWM0h*8mh0b5hOp+-8Ofk~g_XaVnWZS~9
zRqveb?0eyc4nd3@*B+^ce=w1lVmvSsxo8gGDT5aNDb7T;R66rJG_3n2$q+L$_)~J{
zEq+Q83R!4xVm^W=vY$8R<UK_jn@>x^UQ%7xqn4R%lec}rQF8vG;$_({)D|4x82vD%
zNOXBKOeRL{r8n+Q7<uivGp~4zw7xaXQp3qL+&R(1y4L(Y0#KRl1n2_FF*Q-B(#4He
zdc}%72GU4*Od%#@gZQPJyuH@g{Eibiqdr_le5lt|<?XWue3f&r&rK#gKhgL2G<@$f
zE%WeQ+JC~bejy_T2K4f|^2>>kLuKDpq^FC2XcHae3igD9#fwEWyiVU>;m=Wg#rVjL
zI2#D;3JvU1BIz#fmsc?-jqium$P+l(aik!+b*gC6L|JV}Z9`K?0{{9Nn>L%wSK!-U
zI7>qJgO`%oy|~$;46!-Icvz4GMUZlXd?I{l3i*hj*$sbUO6dqcF-3fQ>7S`*ls$p~
zCzRiJ<UqK;`9Xvl@*JQG97=hgS8iNmzb~&l8<@BnnC{(sbmJ0W6&O{gNnpgq0V%@!
zu&6o5m}0KYk-!AJR-6k`H_WcTzaI;~CUA9&1^d}WwHLMaMS@e6>BsoI+>WVZ$BIks
z8!4EELWUYIF$X5Q8KZaPbL#%Axg38cK5cbO-J?e1@JY0nH8$$v=)HYXuv*Bzfz>NM
ziY9G~jI=*zpAT>!n{|nA`0ZB;PHo&NFg6KeQVK?F&|WmvooY%+vVCXi6Nqca904oe
zPMwA)YJo+vzzmdRoWSmSGN;f;QSYhhXO9@%T8Z2u?1v0_oh_IwnD2j)3LQjXg;kdw
z-EaL-GYqIey7{&18ub!;_zL4`3Xm;B`4Ad`C{$6#4N8Vs${TDND;!Vco-u0T=nf?Q
zGXTvAJWTZ$b#)Ocp{IM;4tN%-W}T`Y*8?zNP>*r!<T}V;GT37t&VFiuvbMlkE?yJW
zGo%8SJ%T`G5NDv+zhVdU?Wurp1v|6$O^M|kzGyMr1af3u0=E{22LKa*a%Npwt4a_?
zt!mMcuC%qppK?WqzY60&%`zNjMSIdqK*C;`VfP+co(7fg>Iy_2RHXsmG!yKq<AR)%
zi65^{%QgakxW~emE3UW%jmORawX4++_vlg*@2c4)17<#~<88JqpVZ09Tj-D^qBE)Q
zJgCXTEa}W+UAAh?RAsyJB3&0N()iBiq0XYc4Lb+8d|XoFM|4WPgbCTcYU7BY!)Y{(
zU%hHZYq8yK6SLHh41GCfWg)N+gc?Yysgl_iAwXp_NnHbp8kTQLb*346I;G^i_AVJ#
z>vd*WtH|<qU)Q4yc`w9Jd88*OTfKZ8T}0$74_MhSa#w=r9=9lUz!3>x<${R83A4Oi
zqTdu<;6ldD)o>-$OR%N@L2OOCENSF<c2juIo6OzV>)&Lz-VZ>kNJFHgB(*+Whr8kt
z{)O5M`-V5av#=MI3rt6D!fMtlhK@P|e+L@F4=}16N%;h=05C@OX!0&lY2tcdSs012
z0RozGY8y?SH=9c8Wk+1f&ZP(92H5P!nFr-i1(mD3lMm|Pi>M}r57b`Gm0F43fQ6f3
zSV5V7xZBH<XOKK#&4Sl(+}%XLdL!IPWLCLNm%HWAZuwFZF0a!z+x5gCGOU>hbp`!S
zEPBuO_|B(+ax3~cm5r8e&_v1Q`DIe1-el$}sM-(u`nu|WRI79m`2OgdxE=h9VYmmr
z@i6w!4O+C1v0)kW_}{-TQ9DYLJc?Wf{llLaUx9<;0%rxWQ)LmulTX8iC!>zl-k?fI
zl6>-~Cff$1IIK;?Ax`;)z7*b`He+|vYeV@})8U=UBoSl#QtF*SRqcXuufL8V(-tfu
zk!V<>F^ymDH|tgQ2buQI?DgBl97!ii-nU+PW`GR6Td242jYsGwGLtoI5B9*yrT!v}
z3-jtnZHZ7-!}0?G@PCvxyqd?|C42Ym9ok1w*+9aZ6P1<KDuD2OlijOTihksM>5|BU
z9}(t{GCHR4vd^l=AuLrpxi7SNRK{hi{E^r~gMu2!8uyfB1Gi&lGsTN)+MeXPa}n5g
zc;z1JFf)0JP*4=wLX=DnV1#!+!`6(5#+!1<K}nev_gGK*x{UygZJDBR0Eu^z$LC&&
zm@l{YYMddqw!L`wu^r3)nKWI;L67UbUzMV^)QT-6sp4zcAb&Ng)V8cwl*oD{z{#;+
zqlJdPC=5}@Wn5b_Wo{!3e(Bm!^Hg*g{W#!MjKQm_;Tq}uSOSn`Uny(K{SNR^80#EJ
zCIhyzA>&@~A{?6LB$MIgt61Y@J|2GTg$sl4CH?KVxm!(fk!1p7P;wu;CUvm%yy%-C
ztfYqhAX?CK_mB42I>@>)Ud(5sDWDpp&T%f^{R)QX!`J<iPy!Oq_fKlvy-^4{c0cOb
z-Dxq{+a>##_V8p%VoDNpsb=z_&3#vQ_AxRYNiL&a+gjS5m|hTaIRdD<^fkMgsKylR
za+XoTQ36%&W|wyh`_Sn5c|_07Me6C7b!g7ceNa$NI*4F}F;Z?a!<aq7_D82x`9;h$
z%UXcquvV7?s%_SAYYKfo@Aw+r7aLLlA+_lemP{!U@W2DCPw8KptS7ewb;~s<vYkX;
z3b&0oI<C$dhoEJd`*!S$X3?T)5PAw<N0Igw4WDw&@g2@$HdAvS73J33+GUojFEyY)
z7#lvr*sM+q)<%t>5n*Y&^ruDkBE%~Xv-h0puf_C7s3m&^@YI4R^_qNIu-W4yl}Z&{
z@P!x|ErAiF=%IfW8f}p+qwRQT4klg1Omq`|w1@L~QM<d@4$ISSFp;ZkR8&qqJ3ZwI
zTi2@<cBxc)_wR%3E)x?_c&-rRGaN<QGdDhJ)HNXeds=KTV2UF?SnO}GmnJFlNf0Bs
zVg7D9NM|aTi2%Q43=eaXsTvv{ETD<8$?hj8?2w?4uckr&Pf#u033v%F>##w=6PJ9e
z=cCnoy#$_VwR{cu0iBuFL#Tummc7CCfDuNNKzlj37C;%G7&%tg&>Ay-Xgg3bKeAmw
zo=gB?@^io;RRc2s=t~fO{uojm>eqqnt20p-o;@2Om)rN!6k!E@0Fo;$ouYR_($#$o
zRm2{aSX$k%8haGSH{n{a36%zyCO(H6;wQ<93F&-8ym0acRrU>p5Wy2|;TMcsbVz9X
z=Sx`4&W!{RLn3C0ijaNt9%;DF8v8&;%P#iC<!IInD5rCK?%WUrP6>AAqm8k@rsb(K
ziR>P!+G{T*e~pqft%YEY{6VAFj{N=H8xYtiW_{Y|Pn&}Lq+^0h)-o-5!6iUL6XYMi
znj|huZ>)<a$kVbm(bT4Duz3*k=nAYG=LX&j(tVY6jji)xLSOa;g?}gN8jyI7O-`v&
z)0M$Kp>Cm#nDwFCrMXR8smEdwtZ0}JUT&KNq(tLGF14ZQxXhNy6UYk((|BvsnNXuX
zq5Y^1+~5CF9ml^@Ac)(mH;q?mUK8TL<3%yYGQ8su%pf5@O%yF$?|Tp5C15ocfIxxb
z6KKgBl|ZQd_XFpl+9EZOVbc`IDM1zu1P(vRLBt>ls{@QYud}zNfG_brIUBefXKq}l
ze<tD`kEgGdgJ|!LeW(kId@adLV3a*wW}ho^%J#aFC7^w^7&tepGTudkAT>0Yur_YU
zy4RXIza@TNuPiU~NHD<5*ymJihsTq)ks6=>&C}jpgSatL28O?f+c1_Gzu0nbKp5b!
zckmls+oaQNLw0m>GAk}UIa@iT!!~zVayA3^6t~0fB;qrd87H@az;?9-^Lh>lo(yAq
z&8=(IB+TOUrD|HO)Z69sq6YY2<ADS^C&Tqg&i%EmP&H<ys{65q#^*|JpUcB!rwPrK
z_L4V~y`;_KDE^XjVm#}Lh;3%|;VbEWWJX)9{e6-0q>qh^_2@*Z&BH>qlh@~F+Oe%=
zJEmi`wd}qQb;L_mHiy??-l3es_O6x&uBCHtp!siGZj8OHPPebm$kEIKmXxC<8YL)r
zqoj-PSw?#Px8uen_Whxh(3|S=z)>t8+js-TNNc0ZSUQ&Fvy_k5S~POBWJxsl!}jpp
z_96!=pNIZZ8?dadO!Viz@Z<b486T7t9>e!)t2Zo>L1{BvhYNUQK<p$Rr{y`8W3vsl
z*VkKrKAq{1w$>z`Q}i-rlRsQkyK_4Oz@fln%`3omLNA0ur@;KJYn=<S*vcjUiO^}9
zh9CuR=tHv#JP-d9dIm8T=;|nkbcYSXHu;VOj5GjGW&X2T)QRn0>@8SlurK&_Xipz3
z60D9I)J-o(>(6Qf>yO`h_(EfBVvHX<F*#scR$&W`fw)M30WAU9Jeq;o0O;m)^_a!N
z)zxT_q#zw&20WFX8Xj=xhP}jA((^vT9pb9DDM=$oyK1zO6EA9NPFNWp8J?_9(51gz
z8%lRge^yBJd8q+F>mxGv(&=F^_tP<;McQ>@tMoG6Qdb2j-%`D>RE6yHI@W^agf`W}
zEe}Aajlj+Zaj0_8vhB5r)Ml;0{OMJ3L%pHvm%L@P^4}@^0H6G-ti@qKl|Ql$vkKTD
zc!Mg?iZq;ZV}$61bA#0x$tZVFv+#F$LGBEHR;fDPm<8j~M_aDLq3Y1o!-kyD{Zp><
z4dkgu_ksG<*Kv#MGVH?+fMbUM_bEHM4bfi=zbo_t;dw>x1>+k^bPMSPMYe~M71FTk
zta`H_TQJP9$bmS|8K{Al_cJ>yr?{l(90UE7aBGKdEj!@;Z|pJngFP_i^PT^VJ;MJR
zdypt(TBjXY{|kG($+0vS+5j-2Pyd5G=#~D1J>+Pgg8#uD5v$i|n{fIqT>JlpJ+2e8
z4}P!*;Qxj_rVIa#Jxu5RgFS@)PwXKwj3)GdV-NZN9ebeNlKg``K>ve1_WuX$Aslap
zB)LC|k0dJ<_F!s2IJw)Aw(4mo4<wHN98b`yOPWCZ7l7fQ`&IfcK86gnkucu%7lcrJ
z{Fs;lto=aH(I?`@URnIAC|kNwT<$(ga1`ko`!w;|Apv8I6hATS5p|Md+yuh2SI2v3
z?3dp0^91*J)O^C(&_efncDZ5%DcUb7hmNe657A3^WW4E5m+7FpgJIqzUQQb4q$y4X
zTn29QQ9VU3Eh(p@xxAG<=urL&Nf%Fw2KV%3QZ$qzd-W%R-3wqhjNhYMx}oxa<O)Ao
zuF5zp{Ytc#8bz7I!;b}RG$@_NlAPI%*9FHTP_g+Al6aDw!|#+Bme+$2LIZ{Zek~>|
zT@^*Sl}EN+RD9C@LH-0aD8Q*Nq~xSQ1)5`EkLp9jB3S_&EejWhDUz?r0_e6mcxjX}
zbbh5=Ycv=-V%DU__4gNgG4KFqg3xUY8G)HF$8Xx|DHsAd+D=-PXq#tK)W^ibd}X2S
z@x{Q(>Q68xlgx4Dg-q2NQZO!!EFL|rGV?G3>UUB}l=@@?3{35)c@p&^5VmF60^vQB
zj4FbBy+x;IjY3#4t-DoAX<5z32366mDq{?GxQDAPEp<yfJd*NE!{7{LdekR1xK5_&
zRHC&#RaDI$JfASvpfu6-s(KN~VT_*A)RCXM>89+tbgFQtQcl|n2kxM2R8hqz!g=)8
z(GrH06{_o>Khj_oo>oOg$m;}SA&H=eOs^w=1KW;>LzQ&paMxNqdgfdLXrpUWGY@9y
zTkyBC@Uez53Je|T3*o3GXHC^D&l(ExoJwBJZ74Hnrtbh>IEhcDg#VLZWiVE1&l#B}
zueP@iW)_<KIu5Hsq)gl}JWv@7;C%3Vdggb3&=C^hA2T0X<uHtX3wBAdz}UA}0Rcm2
z6g!ClX&g|K$dLlvZxUiha?<Q%jQ1Bt0)%k!>=R2N#U^+Du|?&hOJqI1(snsN0^8>p
z#r-x2>8M{KI@1C4#dZ6Mk!e9TAcK`@!WdG85n3dkMwbNd%)x)6Pc#-=%7ketX%&T=
zgtQgbWfflUDh7K4oYdm5R|Bt699yddbBGVa)ad<aVHOr`lOiQPez1qbe`AkRO<rCC
ztbbz<vLEd6?oHG8=HT0F^SsjDxy12<J=D%pC6lxo!kpXdd%0s}lL3Agl`-?tpg!k(
z_(@?#0=vwsDU>ws->9ssRb0k}9o`;$0ujY4YTTW4Y3Ct{a*TqGgI=3+LW$(t+B5+#
zLaR^#5U4gHAfz!wA(olND@~#d6Aw00nxLWc)ryHPr5SA6Xg4OLo}A=Z^sEfv(V~YG
z55nsU=Rim$kb#92#Tw5!DDy_f-*e=Q+;O9>IBxny``_?L!R;h|=wLikSdoKH3S0k%
zbrshP=u;S)*T4R&R=Z@f-y)?iPtp2(QI#lfi}dY*m@{}z<;4w`mT#vS*i_peXpQ9(
zMj1>E#UmWdofo3Hdg~%w2vr69OKx?gu=kv2GO?db*@C+uTN(!H5SzN=T+#FZx!Cgq
z(jmo-^-eylnf9QCJPKCgM|*sSJ~#l5pSSM6d~a-d@_{H#zChr=@MDwhGerapgTo^t
zAO=CLq9g2pHSyAS)02Y1(5#~ux-1&ZhcBhG6QrN6niv#H7mAa`VkqKCkH|!cM`b%@
z6=hhAxxVjoJrB_3IvJI~^l)^XTwib5&a6338>iAyxx$a(O=YW+-N`!}>*h2IK1#K>
zV@VPnXis^C2(#FA6EJRjLVPwDIVhcsrpO4j{o_3>%6_~@eNX4+R_7Uu8}Q3@S_=8K
znck?p2eKQdS5oD3|2LS8GCWUlDg~$iei0eE`a{W-gb%OHSyq<j(C*E2Yyqjcm7POS
z45Iut=1r?c&)3l$w`;nVL;tJwe7g^UuaH85lf!IG_{+{*o%}X>jafR6o0x=fYjcA<
z8>@(ujc<Ub4r2BOadKYey(2xq4p%&uMh930r}j$5?2q?o-@JO|EjUK%;o=J88Rsbd
z@g7CPg|$3Y<jfdIv&uw0g2?IUgd>SS3KBowgY*^ZWRUO~x1fB*h*0D~H1YICNe-@P
zl2CEXi7}H~+}k&yZ2O>9C~iOQzM|q#Cp^nijl%c1$#PC;DSr&k?&{LzRP>kOu($eI
zzq3ghOn0PO=IVBT^8^yjk@}ZQDlc()wJ-EszMA>VZ&7*Mf>K{3u+YL^`MH=uX?BMk
z+?VlX#p41-qIE9ps>~MD=SR8nbGYXmi-|Pn2w)b6a4}o{fH{{J@%$l);W^zpDfZhw
zNlijsdnh8|=!=o)r3v-$#*pb!CJC=bz>n|=ITjovG+=`UC%=vDX%VYKOpQ!iXbR&C
zJo2`4#!pPw_2FNsByJ{@(LBk$U%_i67md#oD6}aXlP2QN_J~|GeS!DIgUAk+s8-kY
zMToX-26yd}_S<~@$~;&7A#r)4Kj1j@qs&E3Yw=v<U&|7Y(#{!Zi+GlL!iDuJwuXWY
z@0U7?!Ve8I{u2Em3bPJtk|k<ZBpa-N7h0bfSVamcZHW!FXN8gdF1!N`i*_S0y1H=9
zRp;TUN4&@lRC{yxVn1%#mdqY^%}`Eu+<4|mdFyt~$%`tiA~h7FDJQ5bi^X@AFesN8
zVMILgI+rJ+yPf2DKxb5_Vst1tjlQmja(+^L)8;E!ALW|1A%ZrGeV5-e$YpMZu1Tb$
zEtnp9O>s!U_SZri$rrA*_1-T~(Q7yzzPl+%Z53(cj&-97;W%81(U%sa^CiMqWN4jn
z)}Q?OvT-;0rOwded!vO>(l_@uK};xXxbve()Vta=$#jMxFTe^z(n?{}QN>bdrg7Kr
z=v_lT!v)`Y{Vlk`-PO}1cdQ#tQJ}Gom(~u*<|a8gz~fF)&s%%k(};8n&--(#*aV?&
zE@x5R&=@n#34xrJEnuT326H^^RE)__dY6gsQ8skxXeArc$L|_zJ2EZ_TOvJ4)Cs>Y
zT}fDsGUxatEsXG<97h=oJ>#oVx7Kc?!O*w#=czN=a(CheL|lWlepN9Hnma@p@|kwc
z1sY|ZRGDjZ{FnFmWA+K3jwv4qnv`6yJ*q%ZD^~<^fofV@BhXq(x)jxC1B=L>=a`{M
z2eN#zdASVjf1-|slEJxaJqUW=)#(q!7Rsglh@IVXWPW&teR({=@1MdtBXgqI@yjy(
z#IZWr|7J7mbTLEg1>nF7?ZMGeeK#nk+GZOnOTI<!{J5GQ+EJ-)Of>xT*Cf|p_elrG
z@WjHCH0*lZ1!-P-d#>5M;z!cw-c}p!LB>an5#Qs*@*SoU3)~|f8j(7$$oJ#1F`}q7
zVXYD3?Gw%cS@qaUKO}cGQT)GI(!_m($(34}cS2v`-P?ig1c>U^40|LG%E<JxQ^P16
z>CavOK^4OmvC2kqO=uXzkzY$=Z%|Fk;>&)*+?H15hdoi%ibDWa7KY3>(l8Rt!#PxS
zTdR)IBb@7Iw1h$y!{$$jMH8|NeV7BLxH>%S+AAJ?9upD#Mc)L%m|P1rUrBMCwDV03
zHHv{vsTG1jd(gwd&)S*|%U1Ot*ey7qUj$l);pL`<R~F|MVgxfK2*F>1&Cdo%_d<<J
z$%FRYPtn_}CSHZPqMTRWn}@r4JV|1jF}qt6iZouwdrRz0&YuMZ<qJvzn7(T_OT=iS
zxHGCwTc}k;(}k%aPca8y(LJ+#=Sy^BVkm1>k(XO0+2GaCNp)G@B)G}nMxXUlQDchH
zV!JOOIYgII-Ou(h`d=sMeJ{(>!;km4Y^O}I`c<5hZpHW7VsI_pdfqJ{XBI5pwk#@U
zXGgsn*((p6n9KBAS4!M^IF6sIHMb7RwCN6Px#^ffC+WgY^KCUWtUD!BzX*j!Y?{&y
zOYhcLU|J5^mSLV&=E-zjcSzV4wq*%tn%8WMvy~1um)q2(Mc7`Ed^5qlA3>v6L+QqN
zqq#$rjY>p*7eqb1hH;af<cXvZX1ZJ$dwDR!MG#xn>kNpTr(kxGnHRe2WSbV1MxvFr
zZc|`GO1vp^tRW{kfCgoaZa(<i23tL{)b3<{imCxeEsUz1lnnC$%7zMVS$|DyTf5f8
zyq5_jzo5d!sZWZR8`Y7E!j}KCtV^8y);%by$<&k=uNakGR7Y7bX;_sZHt(L8td`Z!
z9(u7|0zym#{I*Ltl6WWgsn)O3vid|Ms+NpGw7r|ue64oCJ}AGLaG^D>qa0vvj*X*!
za_-3RnG3uEd3A+}pPKCXKE|;Tfvmfn6N^k6P@9X`{tACMVhAhLl|f5Y|KmMj&lWfK
zl1tum%w_?0|11upm?+ol0=FVX)FFmJL1JH&kQ7Jw7h)_AJ~h0M`#q36VdnPz5&OoT
z2saV0AnF-k-KYQMfo*uqWO;6iJJMtlpDBF%Mk_(uVN`93=Y8V*_6w}Bg^weOSD!$j
z(;u=R_;Hj?4CxP%qLwkND}c}%-i%8{D}T@H>LTT9HxoHN$M=lZ@uPlLCbf!QtJ;*i
zB?3{3UXWUBs4(iv2M5v+<D0wah_+M6I7(C#<|u8#*%(xP;--H09Ck1J1>Pa%@S4xE
z-5-L;D{4zng{q!eyz@8{>p_%nwnlL(k$8rppa(LhE|>TxhI&7vM1`vjqqIks9>j&&
z9iPBwJ52A{P})vKKyBMoPW}@quE0Azf-#YwM{>x_^T&LrhP(mTR-6OV=VWR^;fRZg
zL(xbBkI!4I3RNOuFesemb<F~zpkNTn&4YnNp&$$a{vHgU4G1F=+yE96Krv$HHzv{q
z*(_8RuzPwhy}9R+-T6pJbexvH?lLbrr76Lf(`@|p&E^tguI@ypNN&+tE@>U5WBR4|
zbCuzIY)Q!?-CChwi}dA3WtaZ!bFyT6OU2C3^U*(<yGI7*8-%y(`2yGdkD_QTQZNjP
z>}&_nrBDs9(`icxqD!u<w1b=O$6%jIQtae}B-@2%ha1@?$MzqvgMjM?e93~p!|;Oo
zfgYisLFsq{qPGN>!92BCE`8uX;-mKD{T4THV^4b(Ofw&@xtFUJgSAgYPOehH1A;}a
zTEPPfOOK}$R^Lss*a>Yrh)wO8vnp^!kERpKQmq@aA`eNWPr@y@TD5nA+80tM2yNHh
zEyj6bPhAacrdOfNkHo4g?MQY&@s^kyFjDQ7of`~#PhJh+UU@^OpPM|i?G_?vS3eE7
zLH`#w2$Mb-NIr}N0l-2&NJ;tOcE3^@5PZLp8vtpaa2mkDo)0?sb6*$zuVH?Ms1SL2
zq=-BOC?y450z8pkJ9>P02YvKIepVv^QkY;*eBhAYt=-U$UhqJD1ehQ|J2JO?zD>ZE
z0qZ!pmVTOwDH=h(Q)urzwugY6S>Sddwo@qFRt%c}=2k=-KiXLgP65#+PVG~GmCEIK
zu2;^bH<f&zz^h)^^4$OwGw8865bHb^;($aVc6LE3Fyvl1nm#a<T7K?90qVh8Q)shk
zJ!a-W^4UHZ%(RSI%ssvrv@idjJ-U~lzQj_=fQ2u!H_;VTVCtUh3#?BtSXrp<uIUS;
z&%a0c$Ze-=@FMunUV=mtmt+S7nvwzE9u@l^BycF*ia~*X4t8i$rG34<Mu`W=(p};#
zy$iZs_DmeZhC(|KxP~=?Wt<@3TMjR<+<u?sE5nN)^uqh`Gv*^3l}O+ao@%w3z*qZ<
zzP%<~`rw`LH+?Q{Xw7wxD$O;97c^F%a8@DG*k(lJWk<Cva<Evd9{(D9=xrsL*U-wY
z{47_fKLeac*p!_mS?T>6N0Uf8%G3J&m`4v#mFWsYNfISh2ICUjp26u<ZjX#ix&dhF
zw?N!~vex<?sdeFI`WboWnI^TyC!y2|vN-w;On6~s`x3|F>9~LH%liqB&?&fUunU7m
zk_^LY<v1dOMBQxxnNFCDb6Pa4YGGYgG(WHJ@6xZe=fUS?%tbftS`sXZG0Qd9@vBp}
zQ~KvM=QHQA<}c<s&sfZ>A1WF}G-#B?ljkc|!>?0|Q;X1w(TYxrPl}G_8|E3$FwD&-
zg<XRig*B*oXqL<!l`BX8+#n_+v?Y$`DXkH?DgcxSK}rRd(}Us$jokulf}K?u2Wjs8
zItBO6hkppsnML*>*F0>#gxkUgyqra{(gTf5u#_tu62cx7glY6U9!F}cpW7z9Lpw7)
zBRdm413&X@^U#$zDQcL<IBRs0;G|I93wj8C=zhp))b>zaC#_Cm`j)UdluC6hF{Sc6
zgv%WobB8eLhk@wlNAGoSMedx%yY}079hb4=r%D^pcWkR4VE2GC68dG-FV_mrs0XnL
z>(dJDMUM{F=RBJOzY4b*2SqF9-y8=cJ{xi~i;2`lHRxOHThvqBQ^a>fsFPSD;VY(E
zG%<hUaO9KdliZ!$9p9Zo`!9W=>Hx}@$ea8m`CcSj6k8ly1pi-BMTyKhzVa=mQGK1*
zI!T3Ddk^8{ML(_R5?7y4YS$|&^j#l&6a2Yf4IOxh9#f=Gj66V)+|LUgaG=kR`{xv!
zzMHZ`F6xW61OAuU;&hPb?0uYtDc}cZGW*z++Ga5*e8_#s&YC;;k2-;q056(3g0W5h
zb&j(Ydye}IG<A@3L&tU;JQ3aY6?Z4bZZsG?FN8tBL%XPwh71)d6Iy`xG{brvWQrx<
zfYUHl*YLp<9oo+n-I}iP0pmM63ataB19u*yr(>s8OWn%trUaJp2i6Aa8uHvZnyU-4
z&*!ZB@9uow8o^Dbw7}Fa3>&<thPUw#z(Qth`U0RXpyLNgz$-m|rWR<kZGM+t>IPOY
zPN%!yCTw6xiQXmr9sDhRyjy%z<dCvVC2ytZ;3Z~>N0r?8y5<R{0SpY>edsqBrki-U
zrkf{iE9e&(hA5sQ7=;6cQSmu~h2&ahC~kkF5gC13$!6&L-9>81M$msvGt_gZi<Csc
zKN_Jw2Qftv;P%+NuG$*CH+69H8rE))SUXsjD7{jN)5uzjMMq#AP}-+UYMp4q(smIS
z6AW>;RGUcVWNO7%Z5;MZ3MFur6P7cUbC#!9pM~S<CdlRJ(blDIOl@82ybHX$dnS$P
z7_)6qS|vAIWab!CH7{*oTFWo7R<E}Yc=Vp*6q>3>RxebwPhtN2sd-fAT=QlQS)W<V
z*<M(j*^bqpqW+q)ynDEHr@`TTe;Y9!LL0eAzRO_iUV!a>TOC$wU{l#Hi#3m8U>i0g
z)wV1(C#^2dYl&;<6nAX*esjTKOwUMXwl=rcvC+^F(Y_zn$6#St`^~amkP*`sFKR2J
zFa1z}nJBN8q+4k&31z`@-`j~PDk4Mh2aQ(8$^mw?%>L+@s;gq0B@e%_g!}L2g|){v
zy1PvR1*mzUWMFZzv3ariU;Jp=<oNo$50?C~gYVHlPpc(0KY2ax)jRK(Pamz3?x!x9
ztd}=bGB^@e68+jZ!5nT0psK4=%0@w<kOI^?=|W}I3Y8<}yxzu$rffBEcRx0SN^}EX
zd{%S8WY$5}#xH>mbwl{CJU!Esmvv%w)p7%=_d?abuicIbp3~2t(>I=4#3RjnJyuwt
zr@95XcTp8Rb9Ik~r`pUI7&t>6F~9F%zHcFQH^IMpU|;%qryq#`LQ%+L6IRT4@cn-o
z3BbF-z+?e)a|2=L;ppU?UshQz=ZGo-Ee=fN!3FQecLo!>#gdUVo4F)*l^Ane*%$yE
zO7!&jK*Fj{svkiq)u8c_V@m#Xe2U$g(!zukdzD_*AA?jX=fe8X=LjX!l_=K)8jDC6
z%E%}!&!jBD(<Pul%&V)N5ZvI#ET2{4w2KiKaMfmW^Yoc7Z#B=)#d>-}6(2*caT$>9
z7nHI?iY^)*j^*v`-ctj646^E1$ha_wy>*Bs(ab){d`ll)Rpql?XAs#MD!BwR>~l!W
zw725J^q@&Pp*!4xWiNQ(T2wVn=b54<*;3%z2jD{NgSNKmx2d!={1EIXy#zl4ngj6T
zdSSC{z*N6cf=p~=>cCpHs3$ikq1B)rJ5LY&an7%hCc*^378MDZ!xhk#4?5#a0l}w;
zN5;D2$f00t!3}21S>E3!10V41jvY7}h&D_l(h=$}L_-v>bAHM;N%8tE_Y#av2Sbr)
z`S<&ywH2iM<aqAKnGDg%-^Y!@+?d+P%^OReiDP~$vJnE}<Bfuk_1GHmFmk2rKaZ!1
zABVzjs<^x^bkmh&PHDDaf2kNIcPaWs9WR{$eGB9DM3pasC4C;nT_oWFEoqJ&P59V3
zHk?3g*`h`H33qpg3Q+d5r~sfK5B7ht_7*{z1>3qU4u!kByE_yV_5+2x>yNu@;qLBM
zIEA~rySux)JD0s9?t5_}PUAJ+YOKhJT#ePp#>~ubj)7mcb4K+j-KLQd1qr!35k^U)
zLOe*N-W2H(KO!oON2^SLlq*14#r9Z~<(521Ag9aci!X{O<~Ts@P?Z|=o8=!misXcb
zsN&Q==yggIy?{`eFu%X^hQCb}K_S8r*mQ^ucmbh#Kjzk1%M@|UZ?2QGVv@FguyaA{
zFFo#Q5!nx7ife_mkshE;KGz1dJsR<4TtoytHb`ypZ>?^ehHPD|vd*K_49m>V$v6}|
zy?_>Wu~{3%(`Ebl#PZ>uA0!Y`sI|_$7dE%Or{}w~{NivN7|)@J##AusD&OVWft<PP
zXYwQD-T@$kC@#qSXevzhhJDC1)!fC<+iSL+I18rjOwLn_;Nd6kuOy9kpZs|Y1yfe7
zQbp-o&yyf@KeJp~6J6&!L5qw{Doqzo#u54R=~?}#66vu@+w1<day%g*ix429_+4m+
zGI&}@PCe@<)ShPil<I7i-odGiZaqfTF%hTMzw$iG5#&bf@wA)}7y&;1*3F%n2vcC;
zdh9FC@$__*B39HpiUdO+N;SVCD@yYtvQn{s<*7yvQSf&{s{$vmQ_XV9TjZ^pd-9<D
zbhlf}Dn5z@EgeA&+B)(QF-ByG;kn1pZWnyt%tAXD!$_w8y4i|GO0pGOy29Ifm_6)}
zBM%ipE4*?o3q1b$c%yX|ZKLIM)zDaR^*2LYAg(P=PG-B{6y=cf#$)qu-MrRmoSY3+
z486k_Jm)qa|3n|5<ZQD=y{pRkq31#P2J2_Ru;t;LK=_B4UxErcnJh~791>6}iLk#|
zSQ0+<Q%3BP1xn`x4;yb6GAldRTr}JPwX=jxf8#G*Oy8Ei7aA={IV{><Jft$z@~zmS
zA8f$B{-~#VaU{@qWqfGffEU7HJ3V~4V9C;sbez)HidzaF!u(HJ0@U)JD5K0RhP!2a
zAL^)5kG|>&HynntQd;Q{{A=vkS?$MS_>k)RNQzpp1>v54w`5~zsXaw$xS1l^)YoAu
z?%H9HX3;{RgL~n)Dl+GeG^dsu4MceK(#-{)O9i1j(DBXR^s&Mk7j}zNi)Gzz^|+R~
zQ4EjMtK#7Lf~aD{?sl@r@5=i0-cC8CYGxo1S0tjb>tnv|N?^&Rp||KTQq7^de8ZL@
zDbS>8X|&w^i6|sGNj8cbES@XKJ;LHtR#^$-`b=|B&Ezw5=ey*_DgE6@n^p=TAxlEz
z0BJZCNY+p4SDKYy!=wyK>4Yf&dh07<yb}JcU!Ow3FAco2&?`I^qZ<}FuwXG)E+g{h
zci#ZNQpx8S#ApzDTCi{gidb?at&YG+O3J=G*QTJw*CwL6=}JgCC~j|uv@=miN%|qN
z008+y;62GUOHQYXGISw34e6D6uumk))_-e)X^9_Yk8prF7WB%oX`z1-8iL%RmZSsT
zp3{Xs$vMpyBUkc;INsp@-mU*_bIFccj<69iJ+4zhuE*HEUVjc5#rWg>$@XR7ZP<*2
zCkp{iy__~H2R5OS>gEQ*Fs+A$%a0HH2F@{d`I+R*QDSD+n7956^ITz}lYOvfACkw+
zQaq<aoSg|v!5u9$ii13Q-^#t{j>(z-7Co_^&Kll-3lTp2=jS3mfdBUNSbjGwb&%-f
z0cn#8^s<QA-3~8Fx-^ruFw%|L7>o8_B2CbGws&*!cpE>;t_ebewR~nD-@1E#Cqj`O
zv|5j1UDCrqUv6^>*(j5Oi4Q+^<lBUiyI>D2tmacq+96tv_}&A)lOpr*8{TSfF@LQk
zBJ>|u!F?Hc$vQyt?dHea$AfJ#D-_F`Ta{?<;A5;%%qG}^I@7dCHL`Tslbt3fGfO~^
zCh;tqFnw4*I`Zl(E;F)8fGE9fXup3ZiY0y-3;K368+AUkr%nJ%!Bj2ekS=C}^9uFo
zpOqB}RcYFFG$ey5+(Fv<c=8CBwu?CsEr{8;_(S<*TI`<&W0))$QO%=A9T$lHdFpcX
z<b&(dmirhq8_2cmb>d|4IPv61Q9=GJSap+rx6uNbQmB1t1aQfnt?l>RKqC%ZOux6<
zyldeI?d1HA4>~fb&12F<Hb8U{4|+I+I?o--MP6Sw*#64q;BW0;9Z|jjsAiL~J6?3J
zk36LhtL_<bq>tjw!@EwF;?;S9UD}F?Ov)IS3jWub9&oNlS2B0AsVMND2VL_|e=Pe3
zugc-)zal;?VysVj_qM!NZaS7?&W0KY)+95zy(t@kA>@-|T*$-*EHV5Nza`B`fL8UZ
z)aBCXP;mL_l(ENVYDt*Zg}C_@Zjcf`^-+N(8TH0l^Ccp4i!NuX6`^LUsu*G9kCPpb
z&Y8dX^zU;fxLyykJ^x&`9Pu4Jd2L;tt=^Tm4Rw7voQ`jY=QrsJvO0U1z070)@qF4l
zDjbLCkbDjnZ2S3KJ|&dxLM0(?&G?@6<y5bl(Xnnsy8Xbv(*A-~Dr!>D`h%Hbz&4Vm
zmBmzd^Yqk*C*ezKw<OYu4H~ITbaYVT{ajj-PbIxGCYTYpo%<PM96+PBH(=rabFJ}7
zwUDw;3bnK9C(cz_9oieAU}pnQ1Idxtn+Qo^i}S|i!v(lE<$}iMEL9eh9D(rBnI9#0
z>;gl*(v{4v8lWdy`*@V6BSBSdY^)L!DT?JuIsPGD=V7+y-vKZKJ0($F8k3xbg=&51
z%?z*P9Lfzn{12?rDJg8mRG`RjRi*v)_B*YIo(?)=0RP=49NoBzf7L@ACz4!ocIs4A
zv9=0kq2)}zy^{Iv@q8GWQgLu{*ZauLCl-M4Zh>QYp@`c1B4Vhq$@$#Pc;awLv=M)-
zmcnmY5&FW8yw3E<NoZ1BuYXI_TOp>4`!vEaFT5Jsxps$F873P8!ZBif#^0icrKe?-
z9(o5Kx}es<P;pjg7b?4@OXD`LIRpl^Ng<po1$l*b&g#&;eDT7*%{Z7M{5LMyXJ`OL
zQ(8NRf0q^|9xb`5DAsE7)hQBhP_Bu1{i>y#wp6h!J0m-wEay*aZc~r$q?tK-5;vyf
zqLWyJQZPPrPStHJgwj&i&zZ)SriH&ZgS-Leu8=JB@W(V_r#M<NZP+V&Co!@7Re`e2
z)JI>O?=N?ip>(~g@y}BE-B1HYYDny=KL;1`1v@o1;}6MI8LF*0N0<7f@b?mye|ejs
zfZO|yp%b=B&Zrd98Y$9B1t6KNt{jVv&SP-72wBU=d1dQ0(uRKMkWq2bukubSkH?l=
zPm8K~H?XZYbQ8*!Z`BK+=)OM?@uO?E)h?72*a`nLNxhD5cmO5QhpoWgWN+t>^zz)>
zVOqE?JQ(2UQS@QiyXT$wRCQHpr$n|nS!=Yo?$(zF(y&;JV+<hLvRJyVN+&f$|2llC
zFxy(WXV~R6bm6%-&L^ghf37oS$P{L}3Ls2^JAx3`-455!Eo0jwRS<Mku2juB$W?N&
zk_^#F39ppOgGJ*oJVni-88zGes~#LDP9Q+X$B{;s;MeeqPvK41r~W}|`B*GSDo4D4
z?fW@?$|Qv2jqFYylgKaC*5<syd9rUs4ResAtt~4Hc83#idpA?=KR%e#4&h}u;_A&)
zyEi%~wK5x8(6AxJRbO9eTV*8HXAukgb@wPmcEP~sQ=2gCJ_w(-Tw6Z7(bAHof1AV{
zV>rQLlmO?!${FR4AvxZkx?TG%vT{^R9PnS&T(!=<*SM&N8DOy-X7x+1h`~7fRFAY7
zZst0SLfH!-zmQPynO`{g(F!v~mk1$#qFsSvJ8pTPY-GVDrIB&w-{2D5o6c+nI>LJ@
z+*2Yn0>y(SqHlyU_HU$E+Z#=67I5Ljazi!Q9}ipC1-61Bv89L`M=(*%SC*zik{)zu
zmntSnNiscAzLHm2UZOvi@a*WXTV4II@p)+nDKh>qY`n%T+kR1=z9>e+2~AOpXslmK
z=<Q$Cp%s9n#y>X5deTE=o>)_G4fV;-L(brqDRL0g^I=}=S>^YYhVoV@A^N|qGCNCp
z+|s7Ge&}TcMIB8wg6JfR;g}mFm{nc8($bwD3#1VuQVN<OK_ywA4J)|`tNSTB0@<Y4
z2?nc@+HC6c=>HnAi#z&>oJ=^xZv1}Nn<^+n5{Pde2Xr`~&+qsU(Cy6-H77hjD5&sI
z@!_ZRze21whCfK0KakgW_v^O2hxJo%W#LZ+Qq8Dcoh-bcN;)lj&`&wLCnN%x=Y`M2
z1o%bV!O<-btK}4NlY!K*g<$V$0!W32Es2D#*pV6dx^x8PrL4ST9WK3->g|u;Vd2L%
zORMbPG1jkF28pIVsh?Obe%uu1a%(uhY6V`PbQBFP^6CkYiDF`axg{kvhh?HRn`|yZ
zd*yd8r<wE_EtZFZXzg7+g$u2??|y(3*&~b0lk1`W=+vz(^34oUz4f3)NBBE1S`l#-
zQ7lbindaHh`7lq=-z6x7e2a@~boCDpFwoFJ-_1M7&_-hL2eq!`kOaPZ!$;~_o%}@u
zX!21wOxshS1ym54f1sqLeyxbjiv=)zG}XZ;SC0$@f+<%0op~e{3Zrl+tz}{Ygq3Qb
zuAT)$fgi_0gL4YSbmr3bDYFOTv1n)NWnOnu0_yVMWIU;KWDozb#Jf?|9=vaQQE|QI
zX-&qQ^EJ$5v`S|DF2fzoKwa<<s4rif)7CMR-+j|-clJ2mS+ebPa{Jxd)%w_7gjk@L
z?PfjZI%SKfPNvhhCCc|je;YWLh~w{2NL8XDAbl_p&W~L*)H`x-tStGL8Fdimn&Rdv
zi=l=&bn7ZxJS!8FB45Y9G;ghV!2mvpU0J`8Q3N2i%NF|E@1{(FC87ckzMD80zTpRE
z4%S`n)xOv7_uh^15cL)tX11yAzvp}_2oVmygTNM?@`zMScB8`3zR-#>A^{vqY6S-9
z=oTM)O(xLA-4X2cgG!na#q$KU=p7Zatn<|yz#{Xyq03(aQuJ%1@|j!KGzT1FM-t)P
zFcf9!9vL-m#GVEdj($X)uE<wl^83ZxtJ>5jZQ?UMYq_s>nD?h&U_@Iu=dvIVZ?3_I
z6P^K&4p6-8Ro)NU*xrt&*iTbICvk1iSCGtA9iHm2)PH@!{+}0g2p-7dEf}nu9rY%R
zKA&dy7b*xeeE%3s;Bv3jFTXiM@uIi8)=<zuy#9Ubj}J#e$?acAnAQ1>(51xW4~@cn
z^ubKO1o<H>^<jby(5!;2XKmXAmyExBbjZnPd;}A7F%g7H`~YSFVzZY_L5RnJjOvJV
z`V>wgNcX}-ym1^S>>gAw2Il9zJV3PBWtEkhvVoewoMut(SwXq3q-=>V#t-jTrW2&O
zFX=65xd7B~Ur++<ZqTGB3GrRQ=;`i}_2!**zTeG3+55I))ww<iS|61PkV0;oZEQEc
zqzxz_GHHWIT*bqE_0gCh5C(S<EjQLLb%NW^gEu;qXS#X@7YAwcDx#92h}B=!%*vud
zpD$W}#}dODk_~mdm^`kntYi>f!P?9OoeK3>Zx2CEfeJFYWnZdPDPcA6jhJ?5*oj3v
zB=}qM>UGgJi%C7K`LA{7z-H$cVq!(QX=XS@!k6!2UCiN5bN+}LNf4RfOaFU`!((5K
zzhCSx=1X7OJuDP}L?$AvbT8RoS%4z}{z#III}ZBDv3=f6sV{MeGaRZDHloj5;72s_
zVNzRU5cQ&sU`;eTM`(39ls%_L<>Qos9yigc$R7Dx!_#Pc6yvMBC@e77yGn=BjK+m6
zl3~Dcs72}Wl&bdj!LgZK<Ju!bij*m6rz>XPICdt}Cz5tK*e!w<DahX1=6p6d5p^~O
zzAzk}l4Myq(`8DVN>LrxY{^geXhKVZYs)TPRllO<9iyYklPfEW6f?lOer-*M@+Phz
zhNiBu5dfZogx!`Fr7L~>nLxYR%P*1D=@+f{`L8Ir#lfVy0QVWg5z?_wXvrt(VM~?!
zAjMs4hHX5d_<1q4^k=J-lTD50(D}bxh_XrTTQ$PyOM2}O39PBZxX0a(nGAA0-A}u(
zyWW&(cdjoOi=(%$;3_b95U1mag8vmW!S&5f_@AHxHdY?a|HT{o|AGpbxjC8t2dLmb
z`pG5Sp{a>MTuks#i2vv(Cyi02Ly2iEK$Cp0(fyFY!{{Xws(;6c8pUar!@w{W^dJ=c
zC8ZVnMQdU3OUxZn0z-?T`7d#JqD!D_->kUTU3M1N-QfnC>*SxWtIRtu$IGWT#$O;H
zr^E!?enYf}yjK?aUQnsCh#=o#thr5+V7hjA-&~rapgOev`qOu*z0@pF5CslJWQ@1Z
zjw)Ud$~RDXme6p?Xz910L|+C3XpoUZ2lX`{&ZP$sVj7UOuE2;N`?MTTAgW2J)}v7v
zR4WdIf_>+FAZDih*DLhD+A+aE;O6S<fEtoua1e5Xk9-Da=Jw_4vO@7H{2-*DAb}=+
zv1F-#X1=gNpj<lt;eP8UaliGGYKC=)sU9U#xrwcT1%^p2oQ{!^)H_Csr96}jy(BQD
zP%09lmI(ZlzA(fQ1r{>GFro91A;?D3%|BMh72ppBPlA0}I5@v&!TunFbN`C$xC{rC
zIm8D{-?*V>kOF;x7GW-y_yVb`s|(!elnJMgLNuL_p4P^0`2Kz7?pzGi$7@GjgO=r7
zE(|z75l4Iq!jWqV$Xk>ocfo&<!`ehpmBP`$ilpTc_M?RH^m3<TNp%Z3Z}SJ0iz;Yg
zFh%MQP+Wf_2}&qkaEnS6B|x=R^HKwFg-V6x^N*$B*qNf`$0PP@Gz<v^5p`gq&~5m|
zYzGOtBL?!S4I$f`snb)a*t6w=qf5Y@{FSDXU%u^=yu94JZ9Hw(e&akNP^>dA@~*s{
zgC^0jL;GR_E7OYuH5c-hW;_I;0%xhPV!+8kLx;d0{G8$iFtlRFj<%2_VD0EL5UG{n
z38XO8wtU}vuK?AGS20;*)%R=2E-tT$bQy*6;M$8|q|>1_{3)aE%<Xz6&wL_Ao}!g`
zo>caDH`b^rv(YL_pCK<S$Lflnt;g}zgM6&7PKL;Ex{nEg)#qn*jS<O!Z~NrM?Tt?!
ziomf!s;anm{qA8<XL)dSB0&j3r@AoDg-lye_^?nTfuw9S<X!mD!q44RwR^!A@2eEm
zB?p;WQal%E=$pL^Yzz~PwbgnjoI)HXuymC@P0GqDANAq_9Z|UpXRa%DSzLNCt*!ex
ztoz1!H_s&Oz>&x&K?DM?tk=T`HWZ1?lB(5wzWa${INs7)v{GFkaqqYJCh<o;HPynp
za>}w6!jK`@F6mh~ijC>8f=CtmxRO9(2skq+8B^;}qf^HL!yZLXPXR6RYN_r^oxqJY
zf(#-)6+QquL>f7@2rB0eGRRMiRpDO6W7w48Oe4fJI}<)F?7QNP$GHa9Cgpbii)t06
zB#ZjgzlbWPb=`C#2tg(PLdCjahz)QI8#zJC#`oa1-&bA-mFB@yv(<B3R`VJsqlpy!
zQY5-xk8iMgwyIb~9pfV^;4%u5hP^~`qU$^Z_FfYi#)N&$#){#Q-$z6?4<EZ9&gT~Y
zbj34z1YRz~VkIDev46-^TB=UenTmZQaP@O@PBt7IyAn&K=%<=go1ip3g^3omuI#IR
zYOdWWO&je6otfu1EyN&T$*6B>9m*B9rpHvM$FT7KC~Wq_i5{7%2x)6&sCys?rOl=I
zu|nkdE=aPcXCGMUXb=AyA#{;@;Ur%t2l<U8=#?XN_s$<!4S8y&!Feqs-D@gr&}KBw
zkYRk{jW4|@ZQz!lN3)%L+g1~YYboYs%-8IIUAO8z<-GLr7+`rlobF@AnpB(r^AI7u
z7dtO;#Jsz?fcC@NYuu?N(50T1PqdQ%5f0x+#`Q+ypGVo%U~lr9-xLL%#mATxZEPZn
z`+&ev*zBh@UufZ2ehxc^Zk8Dm(G#|Oe1!+i3c72r#s01?Lxh^UV7yTpo|H?a8l^}+
zX9aKuI2BL^b3iz7#E^Y(qQaWZ{F1ZbD4;pEWuvTQrquO^_{G?2v{|=nrD;KAU|foj
z6EY=%j<WTAN<Dl|6|og(%=P%;t70>84PmyUzIHa>G}bC0KI1?3Ngv{G`y{VypBZ??
z-=J}6lXS^1SLSdrQY}tPSiugO{~`&%B-Or9{bY&IN}fkGB>kbiKVhuT_V!h2tX|}s
z{#Nf;+I=fD_Xhc*E=TOQ%A!%^-(E{nSDm*NmQipIv`<e5qX^odXOFG~jI)WvH10gt
z4n(q_ANw*IQ5{{g4!a6%3es1jt{(@chfde-VRipSR5_q|>SBr;aYQ_RrIX2OI2D~w
zPv$uS-IH_PRtJ=pJOr>SDdxZ~sYb&KtTv&O);vS@&QuVeA}yiQlfI=TN_M8MCY+;H
z2ea1kyjf_K_{c$#OAl|yrHmFn9!+B-Hd!HzB5eEv_k&@>xxH)tDVN|^!{&l6MadL@
zCM^YOd+>NOG85GBM48JyJ4>q-S63?Z&}#3F@~NKDA~S7s6Pb}LLAzv{KxC%j9dIJ8
zE@Ypc&U*x6TDSn+yuSL$)*P@K5lj-8-)9$w>5yyj!L2PV(|_EpNc8$+(C6Bph5ZOD
z;1P<k&OTTAuw=i=WVU-xrV75~x&(8WirfbyTK<s8WtN*E*)SrDkvOH9BOxL?+liWv
ze~AEc-jnul(;+{`0PiK3g<_Jq*Fo)nwsx!as9^t$GRoj5&8;hOjUbKP^%CUqsoBVR
z>!eNNUhD54#7XzH&qfZXpUu#qL|o#r5So)hXJa(7uK<!0?Iyyn=o`!xs}MLXb=m%&
zUTT^t+3dJ@*lk=U$+5DZNg0A^B+bs-_FAKPWn<|rca|IFlayMODrpK_H#B&E-HKRc
zUF(w;&kqj>TAt5O3#}uZb`*6laPXYSNI`=mzN&a}C!x|kmMz*cDc3NA3cdBYGd|=@
zC>dI1ufM+CNT?hnxKd;U1T!+iEhLbm61Llx|7J?%UaL9#qyaa8$-fw_cEBN6jD4(M
zoJOVbd^LF;G^gePrEq{ufe}&!qYyjM)VhKRcI)+#*E_tCukgVa1P;p9noca!(wbre
zjJGx_b%xW8jsBUR@1Q1Fg-t6fvVIftG^sroQN<o#HR9=3sw&<m|ISwEK2>d9b-tQT
zW?ngFAMsDQcTT;%y^#OFfvDYB3e&YEY5Dqkin&JO=@f$8<@Q=AY_V)B*h=XM)O%r`
z(#Vc&&l26r`-Ou?IOpUB&%<Yp+ttObQ8#nhr|EhYM|P;eIyjjVC`ZTHV1lIh$>Q5e
z?&C?dS@@0?vB`K;+TgNaVB!ec@q_Q{-Kr8`A35wNu8t~I0F&T#syEm^HeAH`$kV5t
zSxWvO4t6wqJfai{6_LaiEJwSw=w}H=y=o`0D`1nA@(10VO{i)|4D${WJgP`Z{emiZ
zkV5RbgZ?a~t;pOEY^-wONdGbBIm+l2-jfRaf-!u7fHkfvNrSae$4&dSV5@ywEYhfy
z40oc?$ey=7(xuReMj?wS3WH<SEv9hqO&u|0z;k2rSR%MY9xg24oxxyRIOne#<n;mb
z)1pEw{uBSZ73%XR1Gz72tnROTW;1qJ8O(1q0)?>v8434?)<`!jtL-WRuaXuLl?1Gt
z@YPC-f-rHNkaegtw-?kmy4S=>Fk@vZndV2weVZ|?-|&R7ovp2Xw@oNgE$++~GbGqn
zLSURUYC1yvd?T!ODYmBCbk1#=I|+U5@dtX#CZ$Q<+Ml{aJH6E>5cw3zyV=fv?AA9r
z&dzE=^9$&w7)7Z5J5ho^5R&-L*vg8uMe?HDMjzDh^-&h^nP6mnXEhoiF*P<+JOh^K
zZjk^ikRp%s!s6?R)9H7Wt{j+;Zr5;)C3ZJ>iP)RR($=Qd+lo&4yg#KxOIJ$Tt1N!o
zAybzDstQY@Ubc=BsHKQ9sSqeg(*)9T6Jti84l_Ck()cgw;_p&YA?otZH6W85ab(H-
z{ADwNT>}eQDs1!QCqbh9RH|9`Ie&E!f}rUsn@7S-xxd}Hyw^nbur`$Sm@Y!m6h4%Z
zDRT4I(sYTQ*UDhh@UMh<g0nl<df-g-%JtLVv{tZSf?YUBd_-bSdfF{S2xxy9Bgyv?
zmHamQ&11t_Y^ouPhgt>Z;fF#vJV<}P97JZYb`ZW_81hgjT!B;H86A+cP8j;%$cQ?P
zSz`#1D@a}0`SfjELUJ+QvcG6Vm;ZGYjHovba1sVq4O`F%(q(Trb~-k1_EXoTo|&I5
zOW)Q?hAm>q?97yJe0Vcq^1Q3R9x~oZ&#GhSHop^(mS;94ElakOauD$~6K0!vDQkVj
z9vgrX0>?FdDLnsJ3)<e-SLCi!KX?uybtbUL$z0U*>#UA=i!9HQ%(Ug;YW&7k)Wox5
z+&xNvbAaJK^`>767$2C%)l52L%WIkRhFsXidBS%sJ_wm<)&(-OQ6+TCrH#^NXePnY
z@{76zoJ_dTx4#sn08HOgi8RMp^i6il_IjOB4il5*vYm||+JA)pY%^_uNx>AMFjm!P
z7#xQ{r7k2+ys<KjoKz+I2l>5Q@%?D4dolhGiXdcK(F~_ntM}I`OluP5mVfqFg0oda
zpU>=POneE$bLqLxSmMfQZqFnBZXsifRvXizW)NY0I-{N5@Cbq{%_Rf!eX*^TG#{=d
z!|<z(yU?-f4gciZWyn812f5SIXf4`9bPtKJqBY31*ZA{8`<;H5_3nf<0$2Fd4r`)a
zvYLW2d=wnjo(qfUd@oAL-xHP}o4wErzx3<rx^sr#XCs-MwPQMI+6BKGrgxO<yd3?<
zqPWktoKuG=cp2!+t>Kk^A{Hctl&}HpYdo8#?>8le>SE5Md41|zuW;|Yb3g%)h5^Bx
zZx|nEPls8TPDrz@S@+VnVY_YH9@e`RQ66V!-wB$d$6xJ&rylHHD3-<sZ}a2G4zy>1
z7w7<$P8TIq6n*<?tgz3?wm(5V$}yJ7DGC{z=rN2~7(S;HnWkz2pMifg_DhgSQz4+J
zAU|SB$*1_fpuRe>;KaG2a&Sw)XesE($ASnqP2OdF2u=H5c672v6n?b7;XpHa$|3!@
z1tmTbOni&S3zoOdKvRKC5*lEVO(a#eu+%0Z${~u1aQ^cCHAUnuypoM1x*|GuW~DmF
zeMAyI*c4Qj#lh>2%5xNn<4GZvtUZXW7Pl?{YcA_8*555Lrm@g^7q;wc=M^9bV+D8g
zvsH;ugHvfcCp>$%oY_b!qJ)-!q#?fDW}tQCPB{&PazKhCuVYcMOo!Bak;`LF?Z`B#
z#WBWw-~3@{v^IUlVro3M*F}vuk3qfq+Vvjlf;@OQa5VdL+y&PK#mGL)9OB9`LjI)w
zFlNOdK?8e0QDw=%59cAgyY0#(dV|VbMV|;K*E4<a-#Lo1sr~Dj=0O-*>7jv_yOR*y
z(AiT=WOm)Nweqa%?`vWFK0jfvh+td_wz|ydMuV`^#*w)umQHH0ydS+LKOy0vps>FF
zE1uL!ip@ZkKqLfT=|rFJU`FS_Uo|}@aY)-(_0Z%F_Y1c<LxIHxOMhMB^O#4p^Q7aW
zzHcA{gUnh}UGDYWxr)I6kNeGvD*l@t>~g|D=)I8<o|^Akv{o7!w{)kmo2DD5^zd@J
z3gj<nCaB$iSOnj_k=63^;Nb~CFc4U77++s<Np^|n;<SsC2tmi$4a}?kH&=!*;%;B3
zc-4+n^x<;73|kvu9hcjO+lZno(5O>J%XFqRtcmPAue-K+p+Os3Lr%t1C&dx2Sx_Zq
zR|+ier_i4mQn8n^bX`P0)vOw@eS=2~(s<8QRi3;mks2{6uE6jLR;P3SV!-1MPVt_0
zC0PWsNt(|Yj&}Z~xc1iIxWBL;O)R#_k*kvo&eHuJg*<5lr8pFq1#(`0%=C$@s!cn#
z(ygJJsT746ly{SC`azzG?Jt8PkO=AZSC3SSM9^_cM(Zv#y!vDQv2Nj9PmA@<*gs#M
zhj(;b*BEx5!bW%PW28U3igjA3dhk2k?a)I5I+`7rY*tb89op5ZslpLT(rD)CDNu+N
zM13o~H<)PAK{<Z}4UUX>p|ZbnHt+~NPGoKv_&d8&9xZx<TCe+PR6Smol#&TNUD~)L
zP}K78N7&G~@|>r${~&4KN9p?ysi4}O{&Dl#jw^%8di9yO-5)BCQkyWyu!I<59yMH@
z8;{;f8G?qX48~%nan<|&?fF#*!}_4EkaT5|$JMoN1p0m9E%Rj}lgH8IaC`$HItruA
zX8Abv*X;tA{>x7kGc%(HHQf(&C9mpN`yXf1@g5X+IX=%ofaj{4$ZfB+%!RrD<pd~-
z=QyLWwx;1h+FqnWcW;Cgd`rN~lDCD8&E@?14H}h-{*w%Kd#=aWq9-pvhI`>7XYy$B
zXzFwQ>7C&>v30WLyQJlimo?5eNKAKGm36ev)A4Lq%C_Tu7xikSRy;zFx9vv2+4YWN
zOJFEywb%ms>&f=3b4cTPWr)kA(_;rmJfg+w%O7s3?T;lRx7XUE#-{A$=ZvS%=WBOc
zRr_7SBF02j44>nl3B8J-tE-%j(~~i|@-Jl<tCePpnay8EdVt19Z>}ZQcFS4tgpCt}
zr4yv_wc@Od=ZEHV3bL-FpZ1e3jV7<no^XxU%RXt^FQoGGGmWo@4fU1?OGMeIpKUre
z%}$g{?Z8)sErdC7JlVNhqV<vu_Lk-g!)FAYqXV9p;;3@3x%%DVxTV7{^Zh{2kn`oY
zm>8~&=4>2EAGdoo_vqF1DGPxsZoAJ<7OoSN^<&-+g=H8hW}HS`N)VW>rOnp6>v9-M
zWN185g?`%_Z>&%~9wAN88K7(nIVc#{z2r1p?+;+{aV&@nYuaV?4&xum@+53NP!BGV
zT?McRJF2Gb7y9y$2|ILwfuCF9^Qy~`I@MUzp9*f!0)Ah6Gi~G3AOTJxBtL>dMLVOk
zFD`odBC{V!GUD)xQeI<2DQ*uy&c`+<P^4_R&8Z8nYyRzqgzBQ%06H;DnFUzWZVd5e
z171RXaQHlt?k{nW1HQxg?#x7(zC>@j6v{#bE=^+Bz;i!@<vr{trNo8ZI;a+LdAd-|
z$jiA`9QNH0Y?qON=|EGmt9aZYqZkKo7Wy7X8v1~PYOr(z<NKCCvI%O9$(KSm!5?x4
zCg0LZ*?~>mSy;I~w$uhrvk(r~{l$J7jKyBw@jIyJ7weOUkLD;h8-G3hpZw4S)sWdk
zt=~{4q+dQGH`dc(97_Yn1fl2q=n0+Q3HPRIBE)VI!ZBiiOoRkIBL{zQ6n21#wt=Pp
zkmh@GfBpk`WmbhuRHYNmZW$VYU2JcdT}wf!F7LokLxYDH70(_4ccY0k>TLV$N(3$6
zfr=e7=Hf@3yPsnuZs=z8CK#U`bZ4j>rV5}VupV%+??k$Zv$QerlCq;#jptYsqEyoq
z>_pN5?H%R$hOrD?wYwrtrMT)T_#SK;EezATL);#m#t#ufGJeB1ViQCZxw~Os0IeIs
zRV}>f4_r2n-op`zCU#*D&))vd#Dr{-Ox3erqGt{wK6tueZ3Z~np|(7|+`&5>?R-NP
z1W**?UO_6i?<hC7Gc_KDdm-<RRH$#Y_1rbgN05lp+1lJx6?UYnhAwE`rg_M|{Mt|E
ziey`SZVNJNRy0l!->_Ldlvl4wl6(FgCK@HMjQD1$`_d!byi%NAD|G~*W16sKLm<PD
zgLu=D>|a!gPzb6eyjt=q)S37eDa|<zazI8TLc6bM#D_@SmuE;A<mM>@JUTL{Q9DLY
zcrq9HxD&!7CxXey<utRj^8EE~<!zO+PH);~bcZu{Nh?ni&*@<bQ{&jl#O5S{5)xBb
z+$2SwMM2kmiK9h@ylqtSVp6}2W7aI{Xz;<Yn#2;c=ZCE&AI449>4Ivb|DE+>mfV{n
zmXfOYy|6Ao+QpXMl~~{r#7nY;W|+`-B?e1X7HRZf<fcJHVWbRDA(!;nki@?t{Jq;h
z#rlZ*g)UjE)d>oyr5NlByv0U1#`6e0t6NEBvh0&B5e;rk9K~f4Dr~^Z<Vl0Y_>gv>
zr)=?LOsMZCzuECN1pd2y&R0{?!L|OESX;;Z`d+&i<Pdg>|2e8p;0ax-vg=}Le>XCJ
z0_epFtz1CEO$m4f6=clI4$4(7;wgwjq=HNb14A7X@@g3m5e=EyVTAqEcS4`IX-?CN
z7k_BufKFpjq<!iR93Ge!9r3UOlZFU-5fX1^ra_FMRa=-=@V3NQG>szHvY!8^|BOzm
zMn^BzFU-cc>%=KQM)Y67qml_7*Q!iBy{0ql7$#Ue7Eu8)5+vq#o2Ui=?v`AmT38yv
zG|YmzG>5>*$wiF>?POVAEq9@4xqc6kQ6paf=X^d<f6V{aI+b<yT5FLxTL>$;TmxTE
zk2e580Xl!t=AwAm5G4y+JXM_+4oI3s;L2!7n!bZPW|%ITD;h7!p#ZZOTPJE_39LDM
zVPK>hD8yi$a;g9Q=Yv~DKx~hCSsouKinaKcYYtb6?#R?ZU=kA%8Ec?F-hy=CfR;@*
z4@#()ATUDK0UdHt7Kaz5sR*kL?*=N=D6ZXt7~lM#vWRT)>haBz43JYoA?f$%0YBYS
zgS4)>&SViT?0|4h6)_*2r<_nI%tawd@wBck$&>oEnsuApB_`y|0h7EiP@eK>`%0He
zTr8M1mIW1<TF7c7t-ZCn2Vu6O_!F9&2p+DRMF}2_7#ovg9JNoh{~q^nADfR^(%c!_
z(5i{>UwC1$#y_PG*fnitFr~1RUy$)g%H%I3LejXRN)pbX90}j5E&XSB1UbWI6gUxV
z5`8;$ImHi%H+0NIcvT@fF#<N4ATpF3D?ZDP(&g&;!#y36xqa#L52!c#`HT@8!Cp3V
zDdz5X-xgLp%X%zG4EnWHA!VAp5i=4V3s8>sKk#(o_~`xX`d}~5m_}w1!b#Gc|Fo;F
z9UA4S$>*3a(q#eyWD@gBL`K{?x$Nl*me-c)aJ&K>G(^gWca6d^$@hrw`6cAh@1?M<
ze?pAa%s1$!8!p6JScQ3rb95<{E09zhpPV1gqo?y@BJ2*B-KjTHAh_h`nN2!YGL-r{
zYL(#pbRZ98<ps$P$Rj<3)3rXPRr1P6qd^eC(Fo59;+bH;QIJ-;5CgUPTy<k3HTrE;
z9rgg@I6wFUfulAFskiy;ywlDINy9{nyS5JIjk~%R!V(FSllt_R@8sC{BrAfb5>I()
z(YzMY^se#ms4g68_v<pha4_FTLDqxZD+kXd3L-;^-CU&OtJA$tagQ`;Q<W@(_m-nf
z&#qrt@}e5BQRKd1zs5-W6J?AhgfUUU490$=CX?3&qr>@Ik#19?{q-Bf*5niGGf^;?
zD&uw%D%pToJ*h`G$ElXDU|1a%x5;t5`bk3WG%o%1Jn^>v)ONIf(Eh}KW%?1G=5cS%
zBrEq6378NLNcZ(`bBOBF>9aY=D+cHafu~{jOM;4#$CSg}BHV)Do_jL4anO#xg#N_r
z2oesEw_ye1?=1}@#|zDlppA>isW${1S&K_pxjvO~M^iae4)JPW9}gTCI?QZm9<6^|
z35QAx%^byF?)?cR#pts{X^Z6zS*4N^7ueeOeUp4T+#5TdN9BWJYQlPeHxyRD-oV9(
z=*grjMX)tA>P~5Yw*6DnvFy11#PK^<HyiM>AwN(;1-I}Ueqp$Q-<9ENAf^KxDn4Ym
znOKjBjr)=&u^~77h1N=`0ozhXq{De)!r;6oRl-n`bA((f^-8+6EV~2?2*NVBK`Cc%
zL;AT}qoIv>FW%l%SK^94`Spj5qhNH7V&6FN52N7y4nM_haXY4hcuAGgoAkXQZ~UKi
zy#0j3y|iNr(^eU8qn|e71TU({t_c`^HUaHHW~T6j=283sZY|lCi|LT5$jCbbb*XdV
zC2jlsnL+{<*cQ(p<FFEBY~%LF_TvtpqVz=B8C8vOK}OiH`!eI!NQOUNc|50?cIjXL
zsg*oIc_`D(YN70BjjCFii^X>By(6{{K4Usob$w*CUIJZ(y5#X+M-s5VVGtT?iuu7U
z(DQChGrS>Di#$#KHE4VEvl;XhJOzm_lLdgzpeR~cIW3}QQ}FQprZlAKqu9^96fC9k
zjAII$+`+WsDrabO-SwkI4;H^Od#V#_hx|X8Y@4fT?zaPcB{%kXICMtrMX%L1`5Rh?
z%L2!JEf(cIx9<U=m{eiWLpOh0Bh4D}ysmY`Llo7we9Va2rz~!*kh$WNYbmA|7~&d2
zYhn!CEcbt3N;-#{_lcz9Am18-C69uQC#aM!KuII}h@?r}8Rl^Zk1YPU$7pK-s419W
z<aX1#`b_Py(xtquIAwdT0Q0z_f#q`8(7;URA71y^H7H2KNG$T@xkJ{y;JYZ1Xmiau
z6~qgx4Ypz+J9LH~Yxq}4tTApab_6umNo5pp^eIE0!veQIne?P@jrAs716m{t=Eu4u
z7Khadsp5hr9LtlRuA9+L&JS>hy>Ix3d=lD^4=UrIAU)x4INhU;vWc-)9Njj=xf9@P
zHjRlKqTA2<OeGhtS2&p~QRO^pW?#|q`jO|VnzfveNb8QP@R)nANYcG4e@<LsrRz>_
zo<G6Kyk~5iczAWo-g9_Qxn>@CHm@z<iEJfTRdd~VrFyR@=jP7^EfwVOc00O2Ib1{*
z0k+UKFjnCPWTt?x&$^5EcpXizoeTHbyy2)@P3hj!G3kddGh$Ahon%~OOHZh-1%!L<
z!&U`u-rE;zGH*`xFGcsAHb?q(k66zA424fvZjlGByonFZ0h?T@M;-mR6uVgK;6>M5
z6TtPD((TaP5=@Z|OCyYv{R=wrmp>GdZ5n4_{}gZ6SUiPscIP`v_Mg+Vzj$h)3q}VW
zLCYl7_y|`XC5-M`t{R^5S2z9Kacc&&#-jhIc~tBLMQu#n8*j9gOuL<>g@bQ;Fd~-h
z;|>Tn9uvT2zO)bWNz^#|U?ATI;IuATUN$ib@#e(cd2eCIH@$H$99Pv{D#=_89NqH_
zdgZR_S+-$KwFo5}w%oBCh30+o@$zio48;qNt3Xo2i^($?_#8RB51ntQFY8*rgTJ*4
zoOJrCS3YTqHXesSt*YE_H>Bn^UN<o;i@8Aklx@7!doF*#t*kg$kW!gWIH!UO(46r~
zIU%#qsB1WHfxhA4eSOHwK1hY+zhX<|^IE==-nS=gT{%l@6aEYryCr*M68Wd|>Pbi_
zFBYgr{B!;G_TGmh`$}wSQRDKA3cN%EP4fJ%)jY@SWGB-H-qRmFX<&8CP%cSK?(V1E
zzekQ2-XT<H!B$={opZ=xrGyipy`LHa$%pM*+7i$#=fp31^~}GcrS02+tBiKH-lh@3
zacVFnGPH7)J7}|O&&s<xm+G1Et(ves>iCF!Wk*#`UMuNHJKNAvy<P!RFJm(A*DcFm
zj^N_B<**`eA@nh^KHB5uAw4p{=pc@9Ue{Y<e~GKK^+a=FX_7gT*~k4U1C@%s4;8vp
zli6;ZciNL(1>F@wJZe+j59!fMa)yJ`h<N)9$Nw3w4nQJd9run89Mm_JO0`Th$Ta&r
z9Ic5fM;&{S9%GTR>UOFXjy&k({l2Qlr!4$B<DYy0(~vBcDCCV4vtWPoW5$f1S(LO&
z>Z@5OqFT8xnl29P{Jz2yKLSBCfBtf;_#oi7;37_%f{XT2_R4WaA9+GKd_q2XkmZ>d
zBp%_PG^9Uj!~XSC`ZGdTXXxsQ>itW7=<am6Sd5Hj*WePv;PNU(eJ|_ASS5<zKK<>M
z13ms<c?`CDHVdKUe%blTZVOR=T_ahX1Y&$)LE=5-fDsA}X&T|)i%nyGi1v_|9nMo9
z6hHORoxtWcpF}V5A|RYUT6$9sYDG3&k_1QScZX*s@MFG4*IhQ_EyD8Y1EF*6<K|7G
z{<Dv8msznNl%Mi5)O)wBJPs~ZMvst|k=4h~YZN+llw0K;m#utnnChDepso-BaRwC}
zDjkU`Sw3d8PDN=yt_+X)BNT;=TaEU}=E_}s9eo87?VMkjsi6(>ri?ryQ#f6mhH}j|
z)@wf{v_TC>`XK7jc6o$KHXA#<o;giZsg~MFIEWrE2Nk>iYl{3mxLNh{YQ?Cv()5iM
ziWaXgYs&z1sq>e%=@%9t@RG}k=<m-tnnPWFggO;9^1F;R5tle6!Z>d9@OnV%G7Exd
zCd8*JozQw2fzcJvux|!&qrxcs0l;tE&r7z5dsBd78L4jF&lTy`8>#~Mvk^*5ri!az
z-VaNbj8`)rN&%qf+_fj8jilzv8xIu&(6bx*q1;7LbL91h8j>C2C>V+6qCf)n@#0KH
zD^VPyQi1(eWF|N)bD{WTCfF<+p;lx?IB~|JMJP&9!_1@`q3mReQK^Qa;V2^j@{g3k
z*60Y@w?6JkP<nlGe0l8c)eRobaKpd)I&ES#K&NwsdFPGlwzi>epzD91kIwTu&rj~R
z&&=<NXtz`QX{=<jWH8h~*;v^?l#P~+mL(4x0|x{90OtVP7{?g95XS{T1CRv#0N4Xq
z015yUfB}F6AOrvfcmo6gx&T6e4S*3K3qS<805}1v08D^Ma8Ia_D043kCjgr)F)l1F
z4y6~yL>&hQTPX4u0HiM`F5AH1ndJ|TK%`S-eI$G2e55kGZ7^0}LM}Gp7t%w<O~g&Y
zO~6goP1H@&P0&r+P1sG`jo(f7P4rFjP4G?nP54dxjsH#NP2^4DP2f%HP3TSRjjw%<
zeT;pIeTaRAeT032eSm$IeUyEYeUN>ceVBcmy`O!yeYAbDeXxDHeYkzRy}x~?eWZP&
zeV~1+eW-n`y>Cs<w_Z7=CZr~#CZZ;xCZHy(CaNZ>Ca5N@Cafl|#;+zj7v~InB(for
zBXS{91)d8?0fYqd0C9jcz#l*sAPSHK2nrMc5&{{4h(JytCXf;c1>^<d0%?J;Kvp0s
zkQ4|8<Okvd>4ES-_C38p!N@Kg9~J=1r%|Ml-MIq3C;AZKK#jQl|EFPMK+lV~{ii~v
z5Bd?&!2hqq|N9HY1Ow*c_Nxk+F6jSbh|wWHVPvrwhXJ3K=4@2WjNfL!TN@c0xFOFh
zD*pO|@f<2ZNS_${FB$ER4`<Q(X{38dS^l#C9oy}01116mjpH94zL#!=c*n4<$JeF8
zrr-Wfh_Jr_h*hNZLyVyH;MPKT)426u3^zJ(=jj0^e`(CXa038;NtlJe<%#COorMUH
zk#>Js%ft2ir?0Atlz^66YRTl{hR!sq=ax1upqBcY$>U7X?zB<Mqim^w90>8WYhWh!
z92NQzB!W>0{m@p$NAF`06GD;4PQd_!ywL%TCE5pf7b1+s+wWcA5kg!~BQOHjuy@9c
z#o59kMiuq7(+4-;rI&?)Omk9ik3|XGX2w>xPX&eW`^66j^2sfYMBj}x^~VoMBE-~O
z2sc(UWD!O2WV+R#>$*3W$_3W#J>(U^`{OD6HEaXvn&3}gUDdJ|Xig8+wSuVy@t^6m
zQ@E=dPv}j5F1JVAHnnXEH$T&<9yWXdNV#s{HB1$M|0Sr)Q%xK6r9YpW3*LI~j*K0+
zHuTc<sLFYz?-(zTY$twlS-u&Dar>H|8+y{8&Fz4lJE$*V8-g1#dM7D=8wL?6KxCVk
z8{~0s!fW{g(zDx!e+|-Q*A99avC*$WA8vC!a)YuO#R}xiSwc+cEY_r#Hx_=;pF^KR
z9dcd25HYT+Y5{h=7N5Sau2BDnIy|OdkUnTC(&0{ROS3UzYSed_Ntzj4dI);1Is>-I
zcf^hJN0T%J+O-uwHuRuBi$442J64-d_trKOGwl1nfHfF0XFIJOBxYe~SLEOT1Kwry
zc&F-j<MQCs?f72g?cSq+n+;-Sd1xva@N0LU|1P0v==;G1#6O#G_wzj$frQQFe4FP`
zt^SOE*^UFRc>P7+jR>yYJ!5^j*8Cd(BA6j)`XxWhG<C}@;<NYJw$fC7A2^n<m<19w
zk$97!HL-&{2>p~-)5;IzT}{8G>$kKVCA#9aCLoz#Tm%zlXh(&!uqYdcEQNAe5aPfe
zG&@87UR%+qrDkXHB$`?Yfup?CfD(wjUt;n?&?8@4D(>f_C*7378u9?>qW2kUgmd2N
zbot-VoS45)yNiT>@Y5lNpLD+qE3|8fet$3sd)A%!#R=!<|J)AZ9rR92#5e|byIs3Z
zj5Ykj;kY}|M`}fgb3F~i)uhKb%{~H@^hO5)2AUHYO4#`q97zJA8I93AXhk40GJH8P
zI7~0J-!m~t$S3j7Y7oKplL#&^yHvyiNb_G7?P;*K9(&VpZeWo7dEReL9EyufUoL}k
zUl4mC_pTaSMqWvEOb(A4i&Pp!#$K^^PqmvPbxpNCWM>WKYPGtfFK`-D2P<qVf=Lge
zi$IN-St?wlIahYV;Z~-z?D94T7x8w6v*hxO+Ab2^6la-56%93doyf6d(m{%wyuvd3
zp7=R#rnAg@4Jm=W$nv>b*^#>h2bbR232sI&>DQ8b6e-ia>cRy3;n^8(Gf8&D;ik8P
zPOsX>(eT#}@y`~mMMe$24-Xu^cl<$@uFXNtE`dQ+4J{+<<U5&K&e1xATdR&tbB!}2
ziZRVIzHaqBzG?LfzGd};GuHJ^k;tT4)nQFW%e3;s+T>?UX3U5PBZfp<%+NcpHtf5C
zqu*0;99ka9>l{j#=_IZ)DRt(xMWgAYmbK-QwUnc-X#1Tv0``O4Id0$ktUQ)M(=e7*
z(=?V@x{#ZYlnw0M^Fced5&T10){t~Y$Ivz7*Ve?UvBPj@1cw%#B^`wZr8js^==6Yf
z@Ci^8!Md)toRy^u_Kqx7Q=;M}=wb&x6^vrqbLDKpNf1+$;uJliIfF+RK4~Oz0`YjV
zl^q?<75kx`lO1^hE$=Iht7@^qP=x@3WZzU>6QsK0wvd$$5w5zrclB>ssEN31-bzol
zexoZ@>czSB1n1+T37scgU13|$%KGNK)uD|AXAKu8-pCum1%mY4Mt8YwmF1%2635<!
zy-8-~QsYp1!+MR0jHh#5a9gX!1R+p0X{%P;?U&o3U6pSl5iz5-H!4y_srE9aaU0MR
zc=uRMvG%y!?*HBw$vnmXnM=$2>GKVCb5e38=)U>7+GPJhCzC!~!0>2qE)F*)p@(kt
z?JGf`E9BSw^}7Z;9VBj6KYrKJihHA99Ora?0(v(SDRIK3w;O@$=&k3MeJAIT>K3m(
zQWo#u`KykoY=SAoBda5~>ZAP}@5`^JudOeyto5xbns~Pv1hFRclgnPEAkAvK!vzx8
zo`3#Su-S~&GCwfK;R6$ymQ0_Ws$Q%*9~Vf<Y_<6}mpIj@Rxis+;9EL&ACui1l3A;$
zrxLPF`CFfQ)|Fb)*BES`Qnlb(H7;F}TG$=g4rc=@S6fJ2Wi_HrYz7^i^q50%?jltZ
z)G85M>c(mtIHFeQY8&)jfR5CuKg%c!oLEE?_h(OJ7YQ+KH6#Ql6BRXn8*N>m%64^K
zq$)YrBk-uXAdO__o@5<zHd}nedQHV@)^&PrR1a@f8qB1tAssYTXbK8+n%l`I(Oclr
zo@l$qcyIq2$*XM4-7vw2*Stx^p-Xmp@r(zT>=In)E22uf)$)ln>c)SWki26`Gqm!C
zDzCZKtBqpHUrQ}0oOS#sMRfnQx$m&m-EZ3$zT~7cm-;A+F|+B1cjIzCh|v6vASc)i
zZrWvVW7`bO!u|y-*^a`8EH2oXkF<6T)nARFRgI${IvpVcv-hwZO4yEwHy!nG+{@dJ
zX;}kRHWP+e-ut_}+o2wavs#T_(TpjDEDVR4j}tK+NQ_&9T-5_MKE#n4q6TC<{0myA
z5W_p42ekmBk69T^q-H>A@)tHKHJVPr&p|rCk2Nt5V!#cfC=Vux+80T89|(K9EyTEP
zM*^J?7e&YXLzY`#9Meh$Xyt5%OpSqZxK9eO2R*V!WZKSohW?B`y5V}qnA*|c4=BFD
z${fhKLH`UC+(ml+=^e7Q%k|9R9fZOkMr8*TvzOuqAG3?~%;O!LvrFX$AvkFM{(pG8
z2N+5I_h0m5b9Zdpwryj__Kt1awr$(CZS2_g+}ZE%_g8XH&dJTm?Q}X%DxL06RaZ(~
zujdWHJ3yW>(9h<JyYu#p(-nTTv;K_I6>7b6<^rM9@9zSjGibXJ{dSFv)i1vhPRJHP
zyN?570HM>j*#aGWE$jgZe&g!#-L=QWhLk6g^O_v1hqM+qyJz@@-UF$5pTz?NcPQ9~
zk|zXy=VK*UqXyOA1$Qg_X=iiA-+9+~qk!Q1_UCuhTb&Va{ICCA@goNef|;)bPyiOe
z+(!;L00VCUAou_4r2qIjPyDCA4OBawk^f%MI%8+;RGxjWIw018nC=rgDX01hyqSL#
z+U!bP%e1IfH;0wst{P;u2t}h@P-&f}?6`W~%E<j$w?<{>4s+Iv{$OQtG}i8!`g_Vf
zHQ>an2V-LUFWe5zGUk((i%w@urmK3Yl;PsCGseB0i%)l)zQ&4*m|F}mP8y6lo56{8
zb>?y9Fe@ofl~z}4lrT?JRggKGEp42$+oPU7I2NX5eO;vnrm>@Z+y_3qhRL@(c?$2Z
zy;jVXUcO_wC#h(ruv+xqZ%kdDKm!rOZR#z5-<N@IkDA#0(3rq`dY$0nN$e_Pq8&P|
zv1c2>lk|t<Ni*rpqrUR$y|T^oGiZqNVZF-6oTdFk%}j4r`L4LJ%29T-(MWdm;W;CU
zYx)2^oHb(WoSJ1?{`?^-+oB;e`-Iv~4f<Mky;3tck?^fTI#u?Q?)%nIY0ByY_0wY8
zqhEN__O+zZB+hL1Bu1mq%7sRWiG@znN=D4;39<j}L7#g*Ix><Hk|4P`siJBeuBO50
zRAL_?6xqyiB0k(^H`?W3Nw}3Abukb;S1WiC_cl?#LPD=tF)2NqW@napqGrOA5oI;d
zK3ALh?4*x>=+!`YlJYhizQAu(!lB%60w>=dR;rySXPY=+oTy)wN|x)Swob=LpXY_F
zD;s~hZ%_hv*i=$^F8M2;%rjw;b5%rbb;8!OVs$_>0-4@ID}iTF{!qdn8O$@`F2!AO
zslv5^-%^{k&y>?sz{-H;GuuGh?dmZ3f$9+ZLF0(wYDmrkZLq?fu6kP>sYyiqEbU`L
zrT7Z(GmrGxh^c2Q;UVGhw1+>xs>nEM7UxWQApT~OJfA&l1yMFYvDU@A$Mp1!kwagj
zsVGiFlnGt>JVFFWGP#+?LTk?&?rD&PSU(w~kdrWpDX(^6$+QmwGxRt~jR9F&h){$A
zF-oX8_~&{=OY4zv|0Jy^uSmuA4%1NDr&`!Pr{b;>lUcwU;bI2fZ>=0wo|$ZkfxJ<l
zUu8+<DvdCb318h^J8)+fSh_>+0yK@ciI?LY4PX7qOBJk2*cxh^!jWts(tqr1luE+{
zT4UD;RFvZ?>VCRkaW&6&?zk!+G>k2L$Z9$Fo#U3ZHT@B|7(6I&$9_Xka~vx(`1+v>
zfMmAB`2UKC*!~j{{VS`Mjqaa}RvA4jBU%X=aVc?8N<lqKGkrU=f2RMhQ)>TeB!z$8
zqiSSkV(Ng$^qsFNVyS0hkN3Y$sbyusqo!wP!lP%PXToD=X3(PLw>S8k<I2kXuW^Xz
zS(#b7lKp!K<g|i%He&z!coqg`TD5=I)Xa?Z|CQzXU-`1M;tt<qH{kzmVrhi;4WD3*
zet##xn!_@(|JPjqpQP0OT}TSF|0AXLzb%*lp95-{=>Bu?QbxZ`98B>TnCY3m7nhl(
zgOT0eMeblEWMp7%X!M`%i;0b$o#B7DukV0bMRgQUUT8@?Dlh~{T|PsdEt7BeWf`{S
zBf*Czj2FO1AUP+lR)|PYCq~)y*L?xg<iJwo5dh8Qu^^e|M}W?SZL;n7`L)b65Kq8M
zvR*7iXelx?UoBRvK5aZ*wtjuMUxI%})PfcOb3xo0R@{}%u9y4c_XEiJv(Q;u8nF3|
z101{QtD#XQjp_(jGy?48u>w5fsQ87bDB73--Khfb5eeVs>u+~I$%FOmPyvK-$kUI;
zVy8kPuFN_BaBZ?%8V}Htq*VbhrR(1$+0yxFRtkalbO6^!veo7hQ9kY$r*K30xEaGl
z4}vroKmjN<=sU?!F@{=)?ToIt!T>k08B@8hu6u?8X!hO`He9<3AU@)(wCEGv-GN$u
zF5LAF1I!4kxe&t$78P59Dmhy&0?hljVTF~BA0SQEFBwP1Bf4e?Nip~45VL{sC+6f~
z%?f}<&*KA)BoL~P;DZRAhX_La0NVheKEiKP_;AqT%g(~&V?zMK2?4ak>%&1^4FJ3I
zLuAqf*H<K}u#TLV!Aa}~S6pvP-zpRzNc)hBupY#rgv1Hnu`$=442ODqdab-cy9(Em
z6rsd>c~U|oNKz8na)^5d@WTRa9)w*CKuXQ!lZP{e7PjQan)Dwv$;Ytqg-I$Va~*>2
zOSOgENI_#M3lr{_`yo7)-7keyE6**K2q=LRiSBdQixScjtBImG@MkbLJU441ve<O8
z?W4684Vp1&Ix;-ZwT1s9(9kq^O~9RvyNQY@pJ9G#X{vX%*A?1uLXySDmnI;M@tq=l
z6^O<k6WK&u19iAgggR#xCU!T&AT4YtWnaGr6jBpKgNzWFFzD_d4u&QViYC(+iU^|A
zlwEy%T(B6^HO3u}&Fj|t<mer4ZjV%7%O&u{-!Ig@c_Nj9negbSbKh??td!m!6hHJs
zw&3P?5|sIXGNYLud>!+nLZ({l<#KPkIZ(mYsC!lDOf@1oIcw$x@aay*x*IUDMo)FK
z!R<C*xtZqPgf*zhQnd1h7(GEzyJ5W~2Fr9Y)zDhCCC8BegD^^Zai{0Wy^Ezg%OnPS
zwS|%_26bDinqg{dsj5hvcHHA~TOiCLv!nJ?ud~CgR?j>;Ts+xp&IWz$(QU>?UdN&`
zS+w-~W)SbM_!#GE1s!ik4y;k{qx}10(f-L|D9&>GA7wgP_}#91^OP?=u}T&dC6m9+
zdUk93Xs3_;(Ya@|WdO_72;_12A&O?uFeX<KM&}Mggx>$Kuy7^CSZDfdwj;DVTcFT7
zwK?6BK`;o*`Pi-a2?998>xDy(=l;|rsZCxn?p@ud;-AQtS)W)Kdsn!zsULEZRxR67
z@M9pFH1bvTp<s|x9un?B!V5MESv>`*V4y_l4YYrVEGBzn+^7+-uM?=mI_HrG<sk&F
zh|Y4sx$i8dNlVw%mtUab@!wc}xa4XlC9Bfut>8Kcegqmr=#A#uGtvjnnBp;`yr#Zj
zfmz1V`D0q+8(q{rWj|Ks`PzUcwFOCb%iN}6wwJEp8G7<K^!_NPVLj3h7QRX2D0=4R
z4VPiwW<z+fiT%eQe=r{9N#$9-REA`~e8~VK%TIq}rsCU!QHiv>PuMkBg@)l5Lb7L{
zK6~dycqbA%q|pxdbc>k-R~m~&@`_U2)q-Xx9=t>rS>SH%7Z{qmiws#yT6Ag-F=YKZ
zu_aR86t^<-sbSp;c$;m`Lh*=Z!p}|XhFP)fIiJ09w_BunT^i}P6Mf_{_q`Pk^0F~6
z5G1pmJ{<+w_7Z7h@^@<BAXO`)`-Eq^8Jn41&va=2I^0`&1Ds}1S$s*<P{AiRm@Dgq
zi#PILZ~8f|A_C8Zs+E2Yk#2(>m+aCtvV!Ei;c>o)!#tn-!aFKn$C7lZR?QdWc40o8
zH=GTs{F6dUaw?r?a+yOASNFQB<;bQX3N=?%!*I36j_gI)ax7pe=f;_tkT^oJDk(5I
zzMQ1}Lnb|RZX-DJp>Vws>}yGP-~{jl$9(l<wm!}>7`^#ZQk>$8MjQ)d=C?>h(hOFb
zL<F&jdeC=9EkW)~*kDFd_EN*UA^xX7(4VRgV$e13GQL&SDVaUq>jyzo4P4UZP`$I^
zS7G7EZJ)Eq%uLqpvU@4%XU%%(;8WJE(2`AXoIsph`KiLH-)k$a7G$2gRq-UC@(Iki
zYqYp_{mxih4T&kucSu*Tj)aRNZV~OQLpB|`TIJV;b;lT_wNJw0E>7V#U)8O73B<+Y
z@E2q}tXbBNh0%^&j+N{Fvm6YQUtW0yY7={2N*(nkOkMmpHdg^|KDOlZP2`}?PNFLD
z_ikCaMheM-eT%?-JE5=q*3xrvQKZi87nRGc=5xyZ3K73?qOr)^`n`7<?vpYe6;;h$
z`;s@32r)Zy{CnBWB4yY%^PF`OTi>H_F4lIiyRo>Z(hH8fzy||B)u5lPia<;JP+~-j
zk4l_dJ4|4o+NZkdftCQD?blTD(A=({M}dALi3%|qrOwKkn24sqCll{Ly2cWufy?$Z
zi#+6BP8d(}y1V$LdN%@Ua^0mid|kiYxDcdibcFQ(v=JVyd)zsPkVg_2UVYSsme=5P
zSbFC*ykFH}uc{5?ZPA}dHvgrPfdrH-N%=$r`{7tO)BZkpAWuF?>==Jv!^Atm(l*Xb
z@Uoa1!14udKpSOva+qu+va}T<1F2)D6a6WM%zoWa(zr@d*N|YKdAn~nZv3YWZ$F7y
zkO;MyU|d4+NU{ISsTJO^j3r?Rgl;-Su^YBt;@(Te4qspRL_|xeS1iB6?idsLqBk*E
z4MUG#$SE}|U+3|8G}gZ*eZhSau-w9aK0O)!4fnqC(}jUp<v=5UQ@+5|902Gk*cKbJ
zOASwUo2&6bP?$)3cVIJO(w7ibHNe#99}re1Lz}_1-g@^bj?GWk`Egnz(28G?xW1_(
zDOqrSnSFuzRnRrDpL_br<~1CVX-I7`q$1ziPe-xZoQ2aK!#qBsFu&3-XdFk4m=+L+
z&ndnnfUfax{3TjvLfI`zF|F8{)$P@Nw8;Ckb;tdb;XcKE)X|+SOClx)3`u@=^dkt5
z$S0ts=i<=n`AO!tc;71^)>8xFa@y$c?{r$i?>`y0bAZeuYEN%1H)K+sjp$;Nw<_vU
zNDF@x)3Z>@i3W=><6sC+Nu>^4Qpzk@)_8WWE!sWTs3%p#&XdM6hDB1Z0xx*q=hNV}
zHez3Ceuhdr7b`BBr=KE}r{-L?RO)!KIQxT$ID83GrBZ7q4AMOKBX0kwtBto`!b2^l
z5PpkoF|a*YFf;xL95eGDPP8`fRpv+XB;z%sjedmoDr-3DQN1R(YxVmCix)qi9R?Hm
zHeuYB7OEV@$9X_wd#84EZ$X~HjGe(9alR}j!V>M4&y+?@Qs^eyN7|{&(=Q19siz@e
zjArZ^EV%Vn<bo1H!_b7nkt$vLC(qhVg7~#r%?xYt_!J9#dwAZ8Xl#r_XDWd2>=oRN
zN`}Fk@Lee&pWe`rIaCFxGh{Frkpk7wE)X{gbviM8VqfKky5Q=(>#$%yF`Y%fO&H(y
zYFF%E6K3Jl$ZL;c@?~TQ!;85(T|^G*dEagZ<v%h#zq9(wAbJx4_sm?#x*rL`OZLa1
zW892YOhJ+GwcX%On%`D|^@Ba)ENC_9NTZ6aL1qzV;ea~>&ztX>R2!;OWT6?fHF?66
zUx)>H!#EYOkbeMg=tJWA8ACaVmLCDE>-a;`g`OT#)sc`W-$}+AS9-=&SmtN>AHpY5
zI?(UUdtb0t;!K)7jWg4sb2~HybGZ%laWWc_LqSvRvOQ(nTt+HB{$hplmNN6uI&_l!
zOgXuEzSq+;@%SA0;fQ~zSdwfJ*`Iwoz?UNHAX1s<kV6lIWJBcy&f*+9o_<?4z7gBu
zV{7`xqXihI(Kdd)+EC@<_n{M2zuiyho2uI%=y1y#U{7D7eqq6&m4TVbCga&~yZfk&
zZ0kT5+%6P|Byb<_wYVoX&(*%DEEsO4JrHP!{g5|-P;lS~m?(+fn10Z`_-$mi6Lr0l
zWY&iG>K@?BP)4IM0CwJ1ef)vC-)Dp{fU-R(a-a$PL$JH`yPQmXN!38%7y*LK)JJx}
z22O(2#--zzQH%_E*@*H`dQGRa#|%l|&9T9E#_fKM$%dOa=^Ue#F|tfh9eT|%aAbBE
zYUVjAD;g46sAgZ?fzs$SZLLyv{B%ePM6KS4rlUTxz;}$Pl9(2TuLvahh0R&!EO#D*
zSB+@Axb4T-R1{5XH#WrQ74VqZ@17l6LQ3MKHaC?&+U378$6w2tjj<wes`%@)l6Kc5
z-OWCPZH<TO>0=^r$J{OPY+k=rrVA7)G@>1@eePE9SaWY>{BmpvTCTWmyinzj9~69y
zmabboHKtD2=$}|Koh5LUTd9;2H3_K_xW0(By_@-|ip%BC*(0ZFq}{nZ(*kMeiUD<X
zK7vN30EVq;G=rL1F>^2k007;uOG__wLl1*({syLBPMg$vcvc|DMoZy2!(WCt=?~Z0
z3t#y}=ER!u?FO+7g6LSL<M>*a3Eiz{3Xw+Ffa9e=%`X`naz}evK=`~vK|u`$vnm4T
z*2#x~)+p1v9hV*19n@bfO{W2Y`ZBrg4Qg%Fy+gs4oWan<jk~Y7+veSs)2Bvv0Ju@a
zI{Q%LHAD@i>=E}Eq~y$%kFKFua=^Z^GTyvD&Y%@P7wENyhGx1FWcr`yrJba2rXcB6
zx-IIX#GO*oHPkT++OA|N;T24xb`I~&i_XNwhV7%wWZ66$I*xuk{I2E^xm4&JlAkJf
zTfUlN-@3%eapwLLdw|{RJxl!iJ+jelyj))O(8P(a0{7I7$N<sZNN@e%9?y>9tYDHz
z<UwrGL|iCfkk6awmh<Ws7A$^~Mm;O2vMs)YV}l8(l+`Xv`{ViNtx=_DAR-8Zm>ASM
zzVHZ6^B3%=CoM{pCySSP4pd1(MGO_LhiUi?=Urho>`}0@?XPHwz0IjL_chlR$tql*
zhY$D*&r(>ylJ>#SGQY8$JylW(WU9{9>gMLB=-0tE&+XjdXs%q%C-*qbyg^4eNy3bI
zJmvoMzQic=3$D?OJCO-)1>*3j{0T}i9P2<P(QN_+zLvoV^NT>C3h$DvPh6p>7wAhZ
za(L>rl55!knX3}I9Wm%~3T%?*7;bBkcAVWx2C#^5RR00DiUL&*Vb97RZgZ-K#tE)=
z(H7q(OnAIDeGWG>OE~bnj87=7UT@bL{b7AXYWF5_Ghu>-Lq`7Fgo&eVGv4W@HWWp#
z;{W`|geBwmnmvU1a9S5fZxdR4n=p*LcFbYZa|EU%8#jw@6SiMwjNj=B<9kPX`Uo4H
z!TMz-G-jf3tPeB)DZqXAYEG;;pYgbaFD`L5kg9=(i-b4}p;sRT1qKW`*bRgA1@t^A
zH6jR0^izaCsv6P}9!3~C_-{Nd_vCLHZf>kWq5hf|C}bEw*bj|R#75YSU*nKa-WDNz
z{6|foEZf%CZ-j#Y1#uMzyFXyR+UwO2x(gwHj-ha+QelP!*|oshVA%N8wPHFTgE0Bj
z1HgUvv(Gg#0Du<W%zbu~Lf``g2SA7+2nP*&cQA2(-kHv_tMBD}eb<sC2%*EvtWYMU
zfvr1TJV;m9xWcc<BvU^(hnQ~ueL?n%{?X1y>xX7sO~iO(^4(0sye$uJ^qZn1ebWH%
z9PofMr9xtN#pUh~%UK+1KAb&G5`5R7<HUZqb>#F$2R~Cb3V%^rH&esx0~>@f&I`5Z
zEqZdgx-i~8PqykNFSZ(iE9r$Z;r^w&@QeM~EVHO0@N!YH_3vad?DK7C%wz4d`n?sf
zOE^_I=p>KQpG(tsW)a1ob02SaDNU<?O7VnA(rzs|ovgoqoQmeRO~)A<2beC(c70iR
zkA{?Nh2DqV5P|%jsq18EiRd6}u9V%r5>(a8UTJk*C7F8&M^PJq#reRrLPG+gu#lQW
z>oZ}0g3sg!bNJ{ojy?M;<N9=}*gvbsNp{KoRpRk60m)nhmi6#IfUIz!J6X9lCXMfM
zA|uImD}75KQFG;BkOO>v2_Qn7_$Nk&;r%f}=BHj$S&#O@)!{A4sq|=4l4!D@+T66f
z1@v~+F*#(lKb%NSWlV=qMQoc0YiFs>vo`Z4wN6o~f0}@$sWNFyq(<h&Li<UnvKb>!
z?|V>b-E-?cu{|?#T20W>Qp$tiq14C0RID}ndW8F#vYN!Bl3i!xu85fwEpN{^fK#tA
zDk)pRrI<kvq2^*6%Hxgq)tH@;oz2Vcef|uYxZ?Q}%GxH*b-nX~a5(eyRd%@ksCe>q
z<88xA0?)I^{#;!0?V~a^7&@5Rk{bJDtG>`^w6Iy*O|SIG@P&|=Hfz(NyUk?L@yhEh
zaE;U){PQmfTb957CSlH<cDv;6^`-AUe$cEOoo6&`9qUi&+cGDwH{T@ebf=xR`))od
zv0Quln}luZPzzt-rZgUojz?QPD>YefHW<(Hcn|A{G~B;iN4c6F1%Q*bG4xH%<EA)C
zv9o@bcVrY2cAc@?PPsK1n{RmruCwB_NL6V*pf)#Gbvkl?xb;W2#`k$QkHRKT9i%(S
zaG!RXy_@cv{kr)`Z%ijmYS4!1&OK}4dYipRY_!Hu#bLiaedmotbKcI$eEYn)IZS7*
zBS5zo^;Flbu6(IDynFON!bS58$LaO2l4O8L=YtpdVEJGJ*mYkk;e?kB*9Ec7(MA$}
zr<PfR-AjgxQ4zRL)4~_`>6t7rJO<ni$Q5jm1ZYo@a#r((hx=hc90cc+MIGak*hj!M
zI_bg-i>V8Z6)1Z%(Tvv!>m*2e4jlGH)&ZQ|)9ms<wanTBu&E~&gbxsFO|b07aRZxQ
z+&O}B5JV*2DK>!h@*RXAJe?HMN}9oirtq@CbR#HK4c$zz9WsxOn>ylBi+tkiG1Lu%
z%?<AU_!!QQuGGhs0uS92>{$&}mJ8RuPVfx**aLQM8{v*-)c9P<e~G^Um4lM+-slAu
z`AjoJ(+ZMy{rf;mVL#;@af;Tr(1rFd2vg~!P{aP9`7=V1P_gsQ;DH-VO2=rSOI@s=
zAJotje~n~ZiM*z}snzOeD-rl`4Rh#9`2HSsAH=gk(!ttKTZ5Ao=(GYgt*6BW&-t3$
zeempb+>>^8Q0FA%WE&>F9iVuv!3F@n%ZxJ)@ZU+8a!Y>_NOa>fb)@K-?FQ$1I>zP+
z!@x4hglX7NtXWe|k+JYNaD82y4iU>P4pW=6D8};C({?zC$e-V)R5+YJ2=2I!&=zq!
ze|91}?Lm3~c2ku_xFMQFt__|Dbr4pyr{B@`R_nqa>eK$65eI@!RIf;rH=`B!>YYu=
zZxZGL;MLD4iVvb?1ED=A)dlvKgtd?U4#o}J)3PnV{O=?T`+rZup8k`B&BgpBVNWPs
zJ1O!XGyjk<id!seVORB&XfHN*mC=d4JanAqarI~5;d?W96sb%G*E!&yqz6%>qf<5O
zBJuKs^TBWo@KTJ0MQE_2Zs!9)hV7xlr1I_2B&*``@^Jg1xPab3JNZ8Zvbs2wZf%)M
ztBZh{Endwyn50ED73m~F<znKgTSJAW+d_~~D8>y7SX)8}W-T(ZCQpbsP3B^1f7u2d
z$W+^lD_x8KJ~b;-+~h%BgHBb*96*<v91W5ygB1U%z~s*q6cAwsL^=TTlz{LFS6FLQ
zI(7J{IzPv-dQqoV2{qg^YBg&}%50;dz<r0lB$<0|aLTC1sPs|?rW9}f<&k>&&L+Ot
zs@#|eH<p(=Ak3($DKSh9ZpLEUYKFpZK>X(h6r`*<HMGDB_L!^HsgZUsnqZXWZn;OS
zY0xD_4ksVbQxM+PTZQt@$a4iyd1U60L4BXNq|U*YkX14_FIqfmkf{HVPTXGVNA@M5
zN)kmg?JLt_;rt;5IVooTG%h9&S#rtLWjWMB?JTZR=y>7aB&A|7G-NPuo2oMzE$YJu
z&xQ~;v|y@~y*MGZ1QatU2vL&%D^#j%s7$_KCX$EmF;&``6MZ*P^QpZV9D_!I)Mb!u
zY<TWX+@BdXG<c{xe>i7-h4bIaRaLo!o=N5v(-`7SYNdj`*W^NQ6yGFFijj8DPNj<=
zJJ9{C7+cYplXWHHn}j+1L&Cs$3u*vBjsHc$pub5NpA@X>UlJDmO~P1A5Wh*7l1c1f
znOfr+4UKvp&xzGSitc#CUlNwd`7aVi>^zgWql=sWTH-Hn(fp)nSQ|nU!5Bf6DNG+b
z6-0_kk2q-)VnnZ%Cr2?#B!=Y2d_b1Cx}{d(>Lp1bCazvMQIB2u!x~p6UUrTRN(E^c
zZ8ntoc(iU{ZtMj;Bf4JrV_=ZJwg5w1Ja8-`zJx#K8f3R9{$lX+As#GxIRB*gQiRKk
zAeA`!6kar~d?BVkm!-|qQ85KpL9;Rrs<o%jlR8;dL#3t=OfXb#k9uNsXiE`|KtSXB
zqJD$2(%7c)dwJ6&rE{p?@jWs{?krh+`^}X$_<xZwJHrUg?YRp8)5AF;I2#@W6d!{j
zG!i~MD)SWfpwJLvvlM@W^FE@&WxbHv&9*}Gq%38L%u~gcUBBHF2@ep87&AU$25O>^
zQD9RFNEC&i<c7}<L9)x&hC!G$bOF0SV8IVWi=s8Mdi<lhhz$x0^zjO8KW@gB>XR(O
zkR`2nx)K?rNBg#_n<s@j(a#_7x%^qc-zVTx2<uzHG;H~L>mt#G67|#kP!#e|<of%M
zYV5w@(F80>%(S&g5DTT!sDAj^0~D<ZV;}(o=zP`c!uqN}YZymL#2=HN(E??aiLm6y
zm`WoU`ur%UiVb+^U^z#CetAB!eWs-RIY5$HXN9FGu#ozaQgz@j>E@wOzE+YZjD>}B
z3G}82xFYF8HH4+j=t#o$S@xCkpqlGa(#Nsf_zAO+XxK=|j5^n5!m6pK>l0GyXk()c
z=TsABzej!a(~Kz}4epi?(-H9F_2VNeL{suuWK2tZFFXK-v`p@T2;E2REcz1TrB|YX
zDWz&04D|f-9>I@0Dl#k$yqO~V%gm+PKR~FphZ>$odcNYdX?m2EOt8ML*iD{-79fR@
z1akR+QXm?*K%`vJeXqsvxCHPZV@Qbtk~@INQ9xYL@uL_3F-#+J8x@&4s0gggkb`*;
z%yob+9Dap0z^r`BuU`jt&0qEHqyYg@sVA8)lTY9MR=J&>r<;$yHZRE?VBs17zPt?`
z++6q!-O~*?=I`^NlqNC>&r~NCaz!m{IoeH_DZn4hVW2L>fx9hwzEN1ch_*1dION`n
z4?&zL3&@L`E5O5}XUZZL@}b9ojEHlt9Bo4SSjxyVGlP#5e*9?sgflUuIry+L0TIRK
z2Sx1BPxfI0e=3-J1qb=o5@#Bl%dICoA(Fgf`_%J)P}uY~ffK$XO5=B%zm9HOK=`<o
zp?ylzbtF!l>IRetsy#t1`aE_Dzz=rSWt5IkJwTn?z3!XACH-lq?Pan+4p*@7tH88i
zjyk@|A-+h>>Dn__YOiygnPe_05zrS7_P`_VNMUL+lP;`vW!Sh%umyG4-zWy8LpMae
zhH++w=yw-l6{is#^gj>?H!p6Pj!5=saWn=K`Md`#ID<Kcci(B56r{(vwWPH9Z;oyS
zai<iiyvMc)P9Yu~&9jkcWrjd-pTJ%UZrCuj44W`-2+wMNG#+U1Z%B^;Z34Ms+D?ga
ztzo&M2p))3soP7?li-boAJMg=YhA_O*}T4#@RuCE#s7?vF;3f``8i_y7llPls;-X$
zF+hOcq8v7W)xvaUa33Q(!gVf`FSrA9cc90of1@zv$r4kMm~IOX%+H}?5_{{8yUcGC
z)+|~rN8mQ9h_-=srLCb*3HFV`OrMGzandXAE`JO)MX(oes>{@gL4MD5qX%@lvMQH>
z=S~(hS=_cU4_`EXr!XpQk$Urt@P<euqw3d^R)M>1_ILYuqN?Fdso$}fm-`tHOH&i^
zv|Id*(eClKp%MK`xJy<U?(10V;GS%%jSsR>ydiA1VaF~&@THU?ibj?G(;PGjL$9BL
zXFHB6u}6L_fl>s>zE$R775p8ZSpMmRs`j#F!XD5#B2IiG;o@pE&~&Ov^(trdBJZ%_
zLT#wS;rnPNnL@I)=@t&K;S~f(YT=vPcP_Ds;~$n_!`e4uH&grUOQaDW^kZ!iIImc>
z=$i+@$COL6`%O9NE=c(U4woiI1rqI#7i4%I$`huk`w#qwh_t9x#Ke<!%moW}t{uVW
zgxhzwcVb=Vqc6YdSd$W5UXn*RQhW9x4f*%6EdF?M{gzyFZFQ^D>FBxZ7T3PDTON7y
z;|_93@0hA39VLFm(tbkB5&=`Ys)J{j-Fn#Vl$yKVVxg}>ly$XDd?05D1uW9BrTkW5
zjK|gKbPHGb1iZ^xhfmP4sEw>|9|8g1KR3*@ach2ZM{eJtn>^!OI$clYT92!)ra$vY
zbw^Om&YDec|5agkk4Oh=iUh2lvJT@7s9_pe!}s4kw{HJYVaTqs*uu3}8nL+Z`9<zt
z4v-fSS0j}p51j+pMbkH2hA4Afyw{HxBRtqvJmj6#>*_0IAHvwSlE)vQIHMl2;B`38
zGjFf<8{-x71YW(|x&+<xTvHz<SW##p6!bGzcot$B);jECZ<NLxlfO_?h={kb>q)5u
z^4f6AUA$P9y_?QKN*QiEdVbCI;`m9qqcON{KdryX8(sBiMwVPJF{DjPR6ii-88{Pi
zt3S~snRYy61pHNDuxf+M5<Zr5oG5H}FPK+&lS?1Ud^7Mevz^)o-HzyUFA<v8Z$mL1
z^TVa-pB!gAi}%_cvf29^sAcbsP3<-luyt6JnbGW`s;Axgl|RQ*q@d_Uk#p#fggYZX
zGRN<DjlX*&KAP|2t{gpx!-EjnbS@JXiSsTj(-ebO4@)WcUQyJ9pToFiNNsjsYo9S`
zYK)gB-{z36%A$ZY=DpF(i!Rg{TddeW?RyHneXFp2_Cl;DbQDhRm8*hlHhAod$O$cC
z??HhV#J6PM1)2|T_)R6mT}(0f<_@k8oybG`*+$2xx7Sht^Q8fhM_24dS*8b@Dc(44
z{<JaO3!|Fiv7F);oEFWuG_E20P&Wi@EZ;{b^4kTrS2g_|Wni%@POrlUv^5hB{9o=`
zHLSzm+a7J<l%uW5Ull6RE;t-xUhs=f0mG#sO~s5)EUQCnRR@jVC=4b}Dac*XopG5{
zg=V)Cv_?f|DWp@S;U5&{Xi4(lP?$dKKPXJ&-zW_F8-;28gTe$~zfst0h=H2;7K6N_
z{`7L_l^}wVsM;O@_ioHX1&ju`>pLipw{S&HFao+UuebnVZ9VzK<~Itn^f*E>U{ohm
zxy@1`5Vh=sQ6PzHttMg24(l&C@Q&Qqq>WoF$f!^Vu9b__<wY0*V(8-tw6ddXTD>Rw
zZrb#kFvBX)|8b1fgAe=VUDe#}KYZ>cwfEt7#8cEY%@MYH2XW^aa^qG^b&4CKgkwTS
zb69^Y$Sw94g^fS`gTlsb8_(zW=<rVw|AoTT_b;xElmoeJgWl|bp+=RKL_0cq*g(z>
zEY4ShY<SW7)}ne{>|&@$i3>PWMN#4i7$yyvvZaYRMqxL=Rc&}Hh6U|-s`p`e{2`Br
z*TmvU=^~dI1C`=j3u0i1iMN=S>%7d>tFh+yUVmtKdVX9vdV25<X?*Fy+oGB60pOr|
z3(?+aEsY3I<k7+-C8u<c@caRmGRmOvicDRCJczIOI?|N)CprTI3o%2ZA*rEJyzxOB
zw=c@;78B@58Eqx8y<Cdo+$$P=L^C)-bSvGY578k;KVX{UmY|#R@;@i+7V_&vAzvWB
zciNnejFuR7IW!KIvG44=f1o3Y^Oy@h0OLr%#@_q&vTYKF-j;P?aa?W*<Kz{rQ03{{
zGWAItLAGgq%){qi#2D><<1nFs9W&<q8-7(-#(iK%j%*0ST;GA?kxl&lN+n`od2Qr!
zc(5qnO21MmEK-EaY5<II3G*fa@hn2k;;#yu3t|4N!t4lDFl)y`7`|~>ZC{9y2o>`l
zBw-R-?aF_cutJdu)_<EY`sEM;La0bGy6>}fE<(HiFk!I<LQRP3A`?vdL5Qg$@89+d
z&YHrkpKdGHbe<1bJhp+mr5%h`rC>(kxHnV477_#=Ni7L^W0U)M=ko94_x8GH*HQH9
zHn;s0`j|G=+YrMk<0-v9nj`vb1epl7h?NLYK1x1GK3F~np`U!De4>1ye5!mX;#A2<
zNe|gH*)Z8SSwGpN4ZQ@t1cL-!7-JZH7(*Bx6eAQp6ay69E#ocyEyFFH9itt+9fKWR
z9b+AR9YY-*10&2|3WnHc!@xk#z`#H^$LNO+7nB(r6`Q1I075@Ur@&Yd!50*W*dsP5
zHY(ODHYGMBHg;`7q(>IC{U!Ke{I36Q_^#_=;$h%n<e}$b?4j>r=%L$T(qYhH)S=g5
z+@arL*rCg1!ezi^#HGh&%%#s|$fdhsvSF}cw4t|QyrI8gxS^|QqG_OMq^YNAtf{YQ
zsHvM_l3|cxl%bbloS~m#n4ybhf@OeZgr$dNjHQodh^2dOa&B;Lbgp-9e6D|Pc&=+{
zVrgJ$WT|IqY^iT)XsKIaVmibz^lJ!X$b5)mNFpe@)~`0BHljA6HlQ}8Hl#MD)`vcu
zKAJw6KA1k8KAb+D-k&~`K9W9>K9D|@K9oL|-j_a$K8ikxK8QYzKJ12eA9rXwq8p76
z-J3y#j_r{wiaX38dT%BF|EwIF+<DJu`y!j-4ZDlp`@dTL#}MYD_8RipF34m!!~REE
zR>wpCO~Um4Az>+kXhEBD*eW7oJ-;E)D*AyyX`TFg_~-!cmva*Xyf_-dW>D_|ak$PR
zwP<&S^klJrsUHKj`Tuq)q&x=VIEyhCAe}*U0JzENge#?J=%;~e0JY+?n1N~lp}y9#
zKTq>5%7HY6!SD^r0i@%nDuF-sMUz7n@+Xr6UjU2ENpf03GWWw+Q<p4(BWPe$C@IQp
z3@rQp_aee1@mh<mB;<<1=Qamxiwb&d=WebCRKhnd2ZZLE=j<ls<v@@{j6;2+oGO43
z_*>r&Joph<yWP_aJn+j2xH{j877pl<h%1<Hg~JbF<0r+Tm=J?#IFp(ec#nq`45vG+
z#}R|Fa!mzM(5q*z3+n4)3<!vaoK*-y&S#fdTNNW^5`h>8<c&qrD+Ad5CD+|s{iQ9>
zTl)ss<!|lsh}=%Q!}tusa|%=22cDVRb&b>RyhH8cZ&F?B4yx^k>hg%i)xWEF4Z;N$
zeLW_4j-%_0+wQ(Y)8cQ^+)ItM1;X0nXaifVId}=xQZdhpM00Wv8xXz&1UKz(zeC05
zuPWoO$i@XJ<Fmhmrp*o&wR26!1_I{?tjoK#5xl8g1AabKucb>0=j?N#i@5^Tv@<!m
zVg-cR3s$2Iu8PzE_nV>u*rFGs2BQLq(igsBruX)#@mG{a()X3WCJ-vH@E(C0fC=!s
z9!*Ua@a74y`fE#)6u=^Xvu9ljC&eB^I>>2~y(CCouB=F4gI+W`jEKJUFa0O@XUum{
z5kKC>{6;zf&NT>cpWU@tZ8WeT^I&o!)8M}(%v4ldkM4T!j{o`hw<^T874Y`h`Zk50
zKH&FYoi>e_*-s$c4f&Nb*vXFl>011#Gw2RL*f(0>2+`RU+&tFcd)LMqGhhv1m3)#j
zK;0*Y&!gX~(6cma?_%T)G&2zF%|1&Ht>Iph+FxBrzlKAzu=qHjga2#&=a-A9*_%yn
zR1+$K`F^69oaDL@jU01rIbhj7oxnOc^kRc&ft>PsFobdgH-AaRya+@hA6p3o#c{*!
zm$NcXyWQH78X5GMsm2~|<Xlgo)ncH++L9Pqsg-oV50`I+IN$Uy5w`xr+aR!!`lfqQ
zAP0|!)<*}QcO-cH){m=&igg6k&JSxX>Dii`b0mnfes7AZg^KYvJs(;ZG$?)#B!h1R
zM@ef8KX@a;+*wYN0G$m0rx^I$9xx^kM4ui;42Bv%-d4lTBmh<s5IH|o43;%Xf4aEs
zF?<{V=zE`cv6%r;m5$jO2Jid;I&VSu_$$d-d4^|f{d67A=quToe@1umgG^Ru;s>UB
zwNYo>gTj=~h#Spx*63$x1!*15xLX3pmP<;T{|(=gr}~rOW@0_(o|SsD;by`I>`hyR
zMP1ccoBoBRW)liMO(<%mRs{4?#*nM}QNi@D?}K~8%p^yNtn7sPpG#FkwkHO2qJ`0F
zoan)o*pY%ua6|kS9kzU3o3u|C@r|k~&sW^H)0=fpqig6Z^DBtQEKT5#3{9YqEKOr;
z1Qzuf)^UyUSynM7XMd!|f00^LRxl@h4w;Vw7$h3S)XwcOdnEM^L8*@$QO7qbE&Wgr
zrv{A>-V;!VK1hGr<B~KnsJh2GS*<e`pH65u9?_crQ)OnyqP&Ep9&aQa$1J}D^76Z5
zgOvtv3=I>(DgrWuRRo-hMFf<JS>*YM?(^Ciy+3gr&6p%b&=c|yVcr7n(N#KJRlP&T
zy1+SS`Ka>}wmP0mH-^0j>ljn_k@YR@!^3luhbKC9!Qkos@!9*DEL&9hp`;HdabWuA
z!RYx7{JB-zq&83U$x+prj7_y8DRujj=Wyo0bR|&J`&Rwd1xz?XKX_{;KO*<!r7^sY
zbG^n}l`-i{El1nlBwUwEeJACV<xx1}dfQq`rB>xcQq`d`w2pm!YI*4D!t#LSxw#=r
z!V_kTzVtk*#gg-2%7X{JaRcR8MBE)ml~{cf?Oes5GQFkyMY{5Kf(i3mjYnums8Osv
z+=ORfp}-N@y(6VWXwLpj=TA}3&S6%^BwGOQY<n3Rt2lc*PO~&7>2<-lCP>)M0#qoX
zLIlIY1npx9$zE88sNI-GHf#ts?7c!@<Rcd0RLq~YQQ9RA{($Kv>54WXimbki<3d{M
zscgte#@+D&(RbM&;Tex_U03X`>9W)DN3J}im*UMm8~&I3zqcq_J7}te#tMg$G=C+x
z6FZC2(6Y<2x2Dt+Atl?%{K=ShWfZL$w38Uyo6vJYVslaNWEHg+<zg274g<dxJJn9d
z4&$X6B^uREO}|PERoAYU`sMPH@{*7mPZU>BFfd4DnJiR2QYxr$V4&|Rt;ygjoxwpQ
z-9c#Fhx~vIJVcCbJG#ScBbgtB0*uNigt<@Oe~)fEqzH&e$Vj3c-3c!KIP^l;GLRC4
zc!70l3J;b(bYD?vCf8kH64M0#y0%Eaw8mYs$upAV^yC1GxY=zP(lQjq@2+U!{QBPI
z3wW5i&U9>cg>m?Felwx9#MGj!HLPFisG!AYsg9yK+nh^_cCO>AC#>U5_YlswmXig#
z7=CK4!#lN@4O?oD;;~KG2|GW=gY}VW@p1Jf`gH}ab>+P?#2bV**HDf>>X}q|$OHV;
zSFA^A={tE%z5;@|i}Ot60dyG@-4Avg%%cX6>+fho>VdS>hg}2qJ2<+>>RRs^p(04x
zhH?W4Hz2VF$W4#^o{yEvpQZ(!Lyz2nkF$ZFlFAoF4Q8?iB5j964FcB(6e0M94jw~~
zhKUa*j}F|ppQ<D{RSvvS4tNp4m!c#9iYyo%A&4Ob4j)2*Jb{lMqz9fS1q=#_A0NpF
z^|lw-bq5Uf!0)GB4<N%zFPKV=4>}P-FNg>oAB&+cjzbP8ECj501eXn8&x&~;bDAGW
z2e9fc)I0bm?3Z8jZnh2jC!lpNaY_K|E`d}J=C$+pE(e*WM`y?JneiR+^Lv+L>jFE~
z&&~$j9jv;G{EYpM;ss3GU%d<S4kgnsc`eBXO1g`BZSR8U1xDL*cdhsg`Hm*j6TQRk
zf)dqF&jvN!gUALW+pkCm7Q7Qo2L-MN5~K$KwhO=o$@|@Z^{ocC3;b=T{hIAOaCk@l
z8IB9ceP{iedIfenz`CdZ8i5N!Cm4Lkq6WGPO2?PBUuFgHsUN@tvI|1TXS(0%8OzfD
zZRIqmGT@bTfj9RP@<F!5Tj1m8X|~+g|7y}E=rLdb4&VR9m;d<6w}3U$1)khT$VS-`
zPl1b{=Gk)Jle)J&pTT&O{;pbJycv|LC9)}&WzoEqi0IP}6;aIfgB3>*jQGXamL!o;
zV|Rxq#b;3jI_xSw5zG6r4fG_C87DF0$jWfS4Zs~nyJ*t9Xp68p$)Z1xevtNu+W%Z?
zy9NoIj>^Vl)!{HJg;tHqMyJi@PZE#}(>ieAXjdVp*e3w=b~G{?#G+C7qZ%ee<5*eN
zW(=pJ9y@*WXrX#&bIN{GynS-0@#EL;`X3h+3kU5)?c(LTw;4+(^&W?hINKEr(NW80
zu94cRnvBgQW*6^ystzd8=htcvZso)H?o@39<rp_(8W=a``8AKHG};>7TpW?!bQ;r;
zzb@3e7@HfqZ1jo^8KJ?_SNCSlDo_k=I{t)O*=4=rxYlKORSPlp<q=gwq%%9I47^)D
zDO&!z?c>i+MIkpx4fLjBcb)MG++73Ot{^d>as0zro=?t<p=eN%;&D2T56mp9_}(=x
z;y<f?AYUhafDkcZ%3=qeU@%4=s2UMAdumosvq)t$Yr61D6&3F3@t55xmD(?g$)Ctc
z5<*-n>7N}p4VU(84W%*Q&jQ*9i3Hu<Z9#LkQ?ukAxi$Q<#@Wkf^+u3qKdP&D>#ZcR
zhDl?yf<P62<8|jO5JO>}aB;J)@1lTen@r@rmZH{4sr!jIa0cl4mmIlv8ls6=8jh5b
zqWy$eO`P_tNaDt|cg-|5e@r8Gq|>v(_>NN5?ljO;uUH`-zHY<nKdZBZC`}hUJ&b8%
zFZd1jUCQqF1`|hr2MN9>hTKCq>1ScZGSrhZcXR7YO`?jxoKB<~6mbXbgH7!~Y0}Ux
zOJn9&=-FE=qM-*lU{i4*O8>FK4s;(@<S%FYDMf3;j#eRAji}U4Miwai8B$o*R);Vf
zzvwY_R9Y6Hh!mbS(ey<Fdb`wA@vGbBbTlI_4(s;m>X-5^1WSTQ(ll+BM2mU5H3rY@
zib`htO7l+CQoQPEJI2QX>swP3dtn_b-UjA%5XYq%&6%2<#bi{&=BT`jJdt&oYN@q&
zM&>H>IHz*D>U>ajcry_xXg&$9vd5ViPC2}B-j4|(&^t_XB|06Y{O_9B1qnWmz+NE*
znSnPj$m*g`kHQF%#eXcQjzfOVghUBRX1nX<&(A-M9!~OaS#=9zsSL`{YE4J>r=I0z
z#Axi1TR0l6w!4R@&P>g`*K<j0%$v5&+WpXO{@N9$>f3YdHEkqy<|eZCIu?lq<4d=}
z6Efwdw2&>FIPDE@vCeQ*$<Pv;d6PzsN2_%}yFKq#)4$iACz8OtSE?Hi@_`nq)_tk!
z8ED%%4?|Jnq$jb`)7V)!FISBRVb?QSG}iT)?NcbRF;z)es-%Wm7|{2}28JBb;G5M$
zB5l<y9iwBt#p0*pENa>8sR`W{qaJz5bKPZu&W|@ZU!E5R7lyCao%Nj0Oc&ce*5P2R
z*1T1*pRT*g-Ph-E?<b?RU5+1TozbgbS4b`yJxsEvkM7XlJWRG<_TRCyGvPU#=2K!~
zGVqZw1iF$Pe0*69Jd|K@E1@ha1U1^k^QjGlDrOulSYcs@)&hxk1bFL0OW%rr%%zlF
zM3>DmMe-(<Y7|O??wx<E@^ZpiDtxuN|A9a8%zFC1IO|I4etDNk>Lti04Ve1LhG#*P
zmF`sDl1DN1Yf!zM%>vn^62+mzm;n+HA7Hc{nkZjgMribf%#~6?B)_2?z=g`6qNC`f
z?DQ@e4!FY5EMleRRnl>ZyWrj?#v5+|w^$9j-USSQ!85Uz4h)zpjL9|7ca|>|?{Ypi
zBCwEUjoYaxBB|D0s6E&u>`j`bTGx3!Vi2j{U7{uV@>CR{S;8`#1q!X%#}@kEF90n^
zR8YH$5dc;q2$~MQ5t9L6TBdw^kqI56&C0W}@V=#%=}?*<5CDuQzTAXFI$_KrFfD&#
zMgSH>C9}7XI(+owXAf;5aJCwrRr3c;>3aO#e&#A6<XK66<wRis38CI7O5eCuGANWp
zAW`J6lGI~`0R%>rnc#1!j{209wkvg-4?b6-bt601{eA8?qd1(b8bYrUpo%%MAel=#
zZQ-e}+)$x+&#_RUj0~L|kd?7IFzOTmPq(hWyicCy^mkMoA1+ZvEBUl_4xmJn?AU!N
zF35-NMr@p7Z*RRW6dtv)cwFpVMpg4FbWGkQKspVS8y9CbR<C{@s4AFzeb&#u4+dU+
zrx`ziu}WSbAo+%p<autpU-jI)jQ$qJj}9c@BkW)4c+A_0qQFlb*ZFifec#mK-Gv+8
z%&p@o0bFSn&!byUB<RN~3h76(RU^Pkf(RzxLul0|*B3cYM|?9L=t8fx7P;$<a0(DI
zg;S$S^TA=kf$0R>{;8m6<^|TpcU69!sl*EcT_9gSWq&{&b)fRwz_cWg=10?zl@Mjp
zhMmEmvoeKpWi3~8j-7f5F<3f%IVW%-V_Pr+R0SNuAVXC-LkA6sUjZYq=l%z5BFnAM
z>k?8Qtv{%@7H1RDo={)du8;7*svN~X<}~86dXRpk2mmRH=|VwD;oD*x6SOmV!=~t3
z2@<ye)N??b;Q$HpXpgQRKuA=rStc`9NVQMKB&M(2v+R-;@AsUr*>J#RL;)A?`-DyX
zAUTW4=VRHi6(QlRC{SeVE?dZJ+Ja#mZE#TxQ!OE~#{XHbeh)#CB4e#G*Y*??`lLT}
z43;8>JzzB1RDP#hJT<pLMI3J_khB>{+aeS5>Jf`HTr1{HHHRC1KTPoPx70_?h&&Wf
z68!}}S!XCdRtj<v4g1=y6swwyZK)0Bqw)^v!mYu)x4uNeh<@;CUWP~#yAOON8l)=K
z8uvoTI0BaRoQsJzdllygluv1VZyZd(;gP4Vx*_Jbq-n=T$Kv(~mPS|?%B7FjZQ%5l
zUsYU*<Eue)n&qx2vQ$#6o9f@mqx$hK;2B^)%=I*UkLvM2Q!g%u)smdedOh%KFA#mv
z9GO0~uo=1gyBT0{h!kQxdD6&zZKx1NY-&>FF(9whIvY~2?A$RaOJB2Fh_ssWSRf0a
zf><bz(3ao^F{2uTQBj^e^SJ}ZC%6tzXF}*wNtoN#o{dJ`Z)Pkfq$e;t?M#_r2ru==
z^;D6kn7miyEY19eB1HzsaJlRD3_#9$`2hF6iUQ?LQmbv#ZHK0#Pm{$(TXGcr!WQqF
zC+hw7+tE**$FnWqX4v)w#vePbL&+#5oI!Z_JyBd$t-=GoAt1yA{e<7oF{3nwG;%(s
zpQJs}Z*;9Z6-v0;#5^4m9x0mJuylb`yMBXu*l_t%3=vgKJTDlu9eaF~FIgC<Vw)%I
zcQ*_0pDuOnCa3$Qip@G}bj82j|LpXtIt}G(c)L8$ykOIBt}b87USYLgUoB5>dRiPE
zPxH33-CT}##iClDvvYadjgOQ%#|#6DUIX4|Cx`qLEhc0F6EMJI`pu5fj1}oSBL?)N
z8qW<$C|ZA?%COq63Ig=;53*mizZJXSJXR0WG#gkeM!g(Lh*hBu1h46j5{&ZVFFwxO
z@_Z91ftkP}iOzI~1?$x(2WyWiPpa+bc-6N@E{xf1*FDjn*n>iiv^fhRr510swVxl<
z<tV(-R#>#EY$ne%N@~Pwp~=jFuxkbo!Z5iZxdg*<u?8h0^n7`>LOtu}+`EhJ^C=lj
zB&3n$8AHl426j2T4E2wA7G@MNH|l0BQDb=u8gix9-XUV98dc7VxDADAuql9vRop<=
z$cA{hasWBH?7!Y`>*F&^>-Uj~Gv514r3E_bKWjs!>0`;Yz2uOBiFswg+nb!8F+^$K
zj~?!_360**8hcAe{iU(b1Xb`W-VFCL<30OnwYJ@#KT!Eeu6`J0${EjyQ_f0fEO|76
zWE%mPqtqr*FY<(|O%SZr`F#Dt(#p7@!LbEJjAq}j&2gb3!?7Ro&#7|x$zrpp3U6Le
zByPdaYTwHb8GRU+tX=X$)t<j;chxUsp7b6ba+Lh#{y8QAr1(3RschEtPXOJ#{=gAj
znDJ>yeyM%IM{3x>P62`f`_rMx>%w*0g_UnoQOff<MN!KN_s;29#;5SpGY4;kF&GIr
z%#hN!nySl<tn!I3Kl3qlxhQ<a^u>t|VU_vuu_W@>5BYoA`^)$Uhg#MZ9sowS{W(7`
ztcGW_o95=wjk!$q^2qZ^y)e6!Hms}}b}8km9E$~vxiq}EPP0hTW}&%QrlZ(dZ*J2I
zS4)<ApKcd9cCKYd@`g8KF5+f--u*u7+V?JVVU-BU4LoH6=pvS~)EB;_33KD9^T5{$
z3#za>k0fWO9#FdEJG8xinHiQWZ8<+soXzjU1J`vwSmx(C*81db7u^bZWUG7vuDQ6J
zujyXNv*Bf2SHf&gx+R*_UMR+L2H;>fm7`_RIl(uQM>wOkr%W6(wDmdsnFJZx^vFX)
zXD{h9zHm<N4sZQ0n;;MK_3?c(6Fj2jm&~wDw6H+WRbQ#5YVO1ntnZ$U&y%wx<>Ry|
zuIe@Jp#KkR?-(OW)U|E4ZQHhO+s0|zwr$(CZQHi(({}fq=Y40s!8ggwBvYyE%Ff=k
zYNdWuQg_z6uO#+rikYiRtxvASjFzFWd@;53c>I6|;o)1W#!y=*yau)?o^5ozv~l0R
z(vMCO@6EV5@=&?q77QN0GzpJgU|Tbxm-o%qM$}39#`SzuxIW6LXW)o@P|ryvN%hXm
zJD(1!;qpw~>If*@L3bt6^?R`a=+*?Y7L&DPO#Yp0{+%5D#mEA&l>RFJ#+*8r>wK2M
z2taN|eR8ntVgDSA`p3@M&~2KB=W9Pq`nL7f8s^x?_+*I)B+-b~kV0e0)fpzzsZ{fg
z2hl>i2U1t1tq6L_<S68_t4J0H<g?Z44m$05ICD4P=x0KVNb7Zff>(-h;m3VlrhEag
zYGAEq;Xk3RkPq=a%@#;*XYt8LH1z-MoX*D^9e%$2e(zohp)>aL7{*3B9PT^pRHE0M
z6g+JcnA|hAp2xL8!NNY{)Y1O*y}9PGu{}6D8XB0-45k-LAs@=_>w(+i-BIH7`o=@3
zpSXYI#h95YO<W`?2Yay+t_?VU0;-S(_7uDkQ><SS_eb3_(wDmhrK6I7#y<fR6rxvj
z3N)Nm+~$WI3TOw4{~az2aEKcyaOfu1Yv%S>gE$Y?=zy6#X;euqq~b}0h;Zys9Zz@Y
zh(_@ZG7f3qLw#7MMQPv>1{U|pp+9Cw(8mX;Lu84r6&RM9|7R$H?9Va}Bm2koAH8*6
z?J+5CoM@B1z7RU60Xp%8*L_s(dWE_{4j^l#O^TlCnxdH?2JP7b;bb|7qWm#mv=Gic
z&^*Bstb!~)(q9FmIhH*-EDOW%Sp%%24k8cd3rMNs16P;OsIc>6&#2d3e~2>ik<=16
zF^)71|6mWXnjH~_)Q8RR9bQa74ip$McTf<+A8Swrx#l^<QU*j~zh55Xy}pla8c;a8
zg*daRX?QQMw94us&X!&&#3Yv{;U*fkl+DH{_bcO?VW=hGxidkig$jB_A9j6O79;)l
zcil8V%q>U}nu&|0znqkd4h#24?0X|<<^8q0J}(NeE0H^Es^x)N-d7?kFZ=0X4l{@r
zuQH|+V+fV-Xk=$*P&M%2syhM1OuwIfiux2xZ$GcVC^31Z`^$FfC-%#mnnU08pSpy8
zeUN3)Mv3G%)R-Qqs}k6nD<Iz)rY~c=0VGdS^pU1`F@^KcqyxA|L4y{z#h^c+Af$ie
zNp87j7UrrO{9*~)tZuJW(a`l9Jdqvkww(${2CQj&ZCehY*sxOr?BY`V>w9Fsc9yD$
zBu)IJ`q_!Ad)Ag*MbJ%RLwUA@MQExYv<E~^2O?_EX08b;zJZn#@r0{1114pKS8GkS
zCWXS8cMe;Rdlv_LjV+D(^83?LRD0U;UV9@vgN7BzPx>Nro7nd2>~lSo_k42=Io-Y3
zQ#NJPAmG?yO_N$!qPs)v6;?$0o`SZ3|FV>=kNmY;pC@nY?)9C>ttyjD=J}D|8Ktlz
z5A!(BYk$}YHZ+4Xd0{$naXN9~S+G|5rvvIu4KW9aNRAT1Pgv+fnj(p`xLsvnCKA#q
z(}|XFab5*5^s2$2VL0aa;33gKMOKlbfV+>$g?G)GRQzZ*4Oo@B_fkP{LzfP<iGSkO
zy^aPpMap55km~@$r1&jg+@D$XJ9A**W5ccVlAhy4l2k+C<H$$c3wo&r=*{t9^&*jX
zHP;<j3vqK!2zyh7DKO3KSFSmvqos_F?kR73<HY=Yf`(pB#^u%>dUZ>zTqC|cs72q5
z{#}J=0qQpQkGY<%C@9*RwwzAgaJ$@=gRYEwUmPDo-F~#8Y?D7~FARn0l|F$I;G3#%
zy8C?eN6Q4)dUiFy5h-%=%?5vQ*d=K3bA**7wkUyQt*PBOu^6m)wCc53C!*lC0A!9;
z>C%=T@7f}79|v*FbBnu-*tS8-2se8(J`bAGWX}6Up>e@9%Dr}%ejAixpRmW(<X{{>
z*W!T36%Wmw!!U5c$9xR5a#?9fI7+Dpzu}FILK-|wR|7`s*sdbb2wZ=-hf0pea?WG;
z?ZY^(hjHo`?O%+c`sPwCEp+OdsFYP|wtu5oDAQvBQc_$L3G~#W{RT6PbWZnRES4BT
ze7P%CEer*hEiu0;<!1;|uzSxT6_Dd|C16R)n}6e{Wi}r;Z+*MPSeNp1#>Q(~Eq93m
zE8sEZ()%v{GipIleo?2et`sGm3aqoev*Xip$;Nk^9Q@PkA&iMAqFG7qv+&(Cp6Z9(
ztRVd}8*$5|LXBv;B@&qtdUB|9ZTeOcvAc?_H-c3EV*!cb0f`cIgt1KJJ6O-(H?6#<
zf?#QdVyp5^V<mR{3NIO-nQ}MUeTiZ{isY{;hX-DyKH0!75&}uRkH_`;vmZ8B`lzPT
zPrem>6W*=Uz3Nb{Q)o$M?Cn*-F$}nx#*|0V$AejSIn-n#w4=eMsg{x+qsiHV<`BbZ
z5IF@ITgN{ek6r9r+-Gw)ZwGa)C9}w3@UAv=%Lg2I@HLz)8|P14lxp@G9$Ehky}S=3
zPR4(-$Ui<`zD+av-={_sI@Fe53-|oO@)&Ufjq4v9ql7`r(Q?bnQZ;0$72}u{*^xy$
z#?rE|3RCXxsNmq>5EUPXw*A>(>Ma;J24O3ewM!x7>1j>yEm%`^wJ-r$hTSaB*lKe(
z^{3UBbXNj~=LA|Am1Z}CF;arAaWfe)aay@qqRHgr%i<hxA~TH+26l!Ha>GHH;$qyI
zz>tj|jK?<3D7(_)K=Swm+(ibV4`9UH>vE{<-Y1L)Et~!lg(7N9J<x|Y4eK=kwW4iB
z?x<$RE(26H0%GBL5RBjJ8xv>;F9(xQTt0)|z19}BMJ{u-t5marV`!2mwvrJ^D~|JK
zSFYKNK%rOAkVdMoi4w)2Vn*=9{ERrq2jOSghEu_Gi`&SeEU<lLm>g1<Ica0xyPW9@
z*Pku59?0f_tr=)d(Ny9-9`LuEr#0deJM17ZAR2BSki9m5_!VD*R=}~kb~LLYL}44`
zc5L5j8J4gM)My)cr8r%xR$VKMf*!9+antU1<3x>V3i*j<pV*KO_R74!ZLZ=L4(;T4
z&3CzVEBbzaecg_1kf2+_v6V3|2#D-@8<H?00A%m<cJrv)Vo7wJv9ZFJ?jUQA^}><y
zlrDj<PNRw#`f(s+NY(MOBs_KD#IziUZAXW7nsPyTv9pM$U~;OMPeBbzG+JrXXx(D+
zHu9Mi3Qxtc^<i0KSLSV?n&W!6mh^-#2~jEDUEe;lqsI546Rzb1<!}b!_G%>y0@r<}
z)nR3=#mrpAo+)a(t}#*AVkTq2Ou~u9z=HLdjiL<ux4;5{b5F)B+ZU5Wm)}QpGI|qP
zz`iw`ehIm5uB2KOU(>%D$AIMwb8Z$q>&PD|C?A;b`C-<ruD8xIdG|V5<L4b6t&hDl
z7;)c!`(AEm54+I4Fm~jU*k-m`aObzN04Xj&U#&te!b%9203vNs5GauP4hYnzv=*#=
zufzYeR?c_w3$Q{Cuql9K0=U$3b?<TRIph=@i8S;%HJ!Y^|5L7V(dEATomT4)Bhr@T
z>1RZ~!SXD`Z}!a%f4_?CFx4}^-L!Cjwxh)Bm3)o9_snOvB_&moKVF`tyxDx2X5A%I
zw-^RGTAp)clXCesc1rt1S`-swlSTMQ6S@)sD?k`@kA|SUnY@8h)W79aht6(TGs+1a
z&^(AaK%m)Mb!Ei#390PB`g?5b1xD+@K&GLp(5DM)19VzJ=*!)|eZRZR5vk-9beG?&
zns_NB2Z5^b_xEyGf_WpRnh&6#DySO;63#LYd;h2tzXrWfcJIkQJMUw0=Z{up)L#OU
z_gJrXqEMkigA&hOt_anb_NXCSG{h+1gf^ZDO&*Gn>_Hvj4LMem-bT5GYQZcFVH_V1
z3}hQQSj1VM+!RjTLj7aGlJi$E^{qpN?Sh*Xz<XBQQ3{pdn{+9*9SX6Ai@!D>c1C==
z99@FitX$W9vgMQ-GMt`cKorY@0L2P0Alh4jbieb25H4sBV>e|mTW+<RH-}Y$+yELt
zFZP^5^4?+4n9mc$<j&(5>wr}0BR+U$G^wQr1m3HKmGm}d;G4&-oP@nok~z4Ff1`03
zw1L_SGgRjY<1gQ6Zyguy4Hg@pVKAu5nY*mott1tSGy|sqGDj%Ys(Ux}Ch?sbi4Tn7
z2*Rs-oVBYl680l&_NHw7)bPiAK|S)0b8uJmQ3$3XTcN8JCohrZXE;;)^0z?8uwQ5h
z@7u$7Ny2wQR<Zg(hjiOxKt2D}ICZCS;`veflf;Sl=HpXFRJb|onCWe!eE9QODpCuW
z*c*cvIL?)DGWmoOY!_u%CzmqzxV7>X-DmOJ5Q6#M_>@|kY#1R?TAGT&_okQl?tn#g
zfptl2%(%ByvTXBgjeSFrgEzEu6xFGD*P0N!$P8=J(!S}v>q^f3i0ksHT%<euwf!Vw
zxQEI5rD1ebB8%1a4AlfQ5NyDa_1y8kAz;S3#GC09^frru2g1EBtosk>0e8r5D4yjO
z(LR5=GdyHC9{SjKE5*TmPFC`cyxk`k4Y`##cvj~46Kp9Erz|{_5zdNf{)_)Y;*-eB
zD)1$EgM4iPtN<`?a4qMK<qZJQQNi-eTvC%LiitiMNns*R30P81F;a*V)W`yrKu9hE
z0FAf-m9UIQ<R4<M0q^n<{@OhF&*w1>d=3;3o#$jA-NSZ)N3^ETV@GgBZh-CGj=*_@
z5jAY$zOh5>LWWm>fLTnmTJ;#7wS+txZcEyc_8;IXC}63M*XMzp{6o6T&jV}q@M_?p
zLGu~9XhHvE{rb3J0pepRBI~S-|9S9osa|ftQ%&~|#WS8(tt>4*<ujfRn6<A)U;j3^
zwc|3wbBkV3xyYx-AX099F#B>C`O2eKc!IG`eKd5c_Pq^e8m*Brht%QcXCavrx=g^D
zlCt0mr*@#Ql6y&E*i>6)Vl*2V7He5vKVr`v42s4=)!Fc8NKqZmbhKKE2(l)R()@_2
znWfWvh}}P@J37=CsstvOfFeCiN`6(C{MWf|2irl+tC+Q^P_)cl@L2|!`m?DHN3~4N
zj;HJOHT1CUjfC5eIM+LTEuN?hXN>tyiFvL%5Ww1c*-=>HM=Tf&0NLZ?t#e`b%KW8L
zfpZlCDop|wY6Jmj43<Aqm8}Mx){cQES#=<#twBe6F01utRtwweOeA?E*|6!)5wtSQ
zdfqXLagrsO5z5ANj_ospcx>FP6{U<KyyAL%$(Z<A<C?lQiDk0Jeq0Y<<|cj%^v}07
zVqt)tAC&<pok_GKxGhd;=(!y|OoU|MO=Ga<m%rORcIF4wOs(A<*OM{MSC=AvP~oWM
zMO9@V3X_5oCj=$jFpiuMS2*c9bW#pRdEiO;3{&L*_H-5Y4=R&{qAHM8v1G5A2U9UL
z+dKe#lIAQ(n&;{k&}J<ko5+cMRdxiunx=^>0ZLuGnday+FotN|gb7C+Rb@t{Z|CaT
zA*VXO=9>c=9=TSKhT=KedPR3aBUCQxh+JjVOHE69IlU}4wTVDgAOTc_pw)JV8akwg
zx}+Wrp1|LKAjv(Ec!dy@X~HSdhLLcGKk$Y#k-I~FLPW(59B7bGXsHG)pnB_wbdbyo
zj^IUq>JH`Z>)oY{BMlXw;J$0ISj@`0?=EH_7-}O()9>Io*0M86CWbjo(0ji)q>EtR
zmB^L#?7~8_wTsFA23Vtg*dFXZ#Mb&4>HgU@ZfIcZXms<kZ6;4wbDf=|ytu9{(T$i0
zs2*mDk9CJezf$LRl2V(b=sI<ywpeC*5nZ>-+e?DzBJ=|z7F6%%&$yfkHgfd1Q`kdv
z$=XlM4jj5d`IcL~dhI;YwYlh(AxXvF40<K%{9*rSzhJfW|G2hHMLO~b^vJyy{m;o_
zoLkQnCrR;k{oe9s+~qUFz7ey;UN!ZCE7KJiD?OL9_vGvrFqYw5YJrKpPr=eDPqe{=
zhyJ{PmbWxkGb_<L#NJ!p+_!I^QR8~`D5l`GMrBWycC>RCOuum2kjdF}!F<DL25lxO
zm$xg}CW3V9Ki)ets7xm356rkPCvy1}AdEAYp{?bxgWi8n$7Cl!<}L~;j8tF37_^u!
zXhA)znJH0{qjfBV|7VGtRz?95Sw-Kc{F#iezdks|6c#x)^uBtq<I!@{^rZ@6dRkrE
zQj2Upd}Y20tb`4w+6Qf_l%iHr#jn93pkusqlT@$EyuwGX$#=DAj-q#VqV{1C;|fyv
ztg~H=$lca=Z2nA7C*MfSjqhXZx**~B$Kylu2x^oZEW-lw?}pg-JsGMVIQx(wyY<N3
z1OwCsIN>p=i<I#*Pi)`jB~cZ`YYGt#3ZZH^#f=CibEL`spgjz!Aw?uSwPJF3VYn-6
zAQED-Yd*6gN(iRpfrteYRzPh?(<=&GIYtb}6LUAR;@3BjH$$dkQLDe@5-7so6@`*x
zU@gb^XTRXbpjhtgDJEMTw2PN`F<G>O7u223Iwt9G)AJA9B;I()5T+kA<?q^w=<3`0
zI^Nq;85iV7{7g6Tpx*d#CVn=D?tb4VC+(;dMon#Z)4csdjC4o~_ai(|kboa%at+K)
z%OUgEf#?Px^EgF#TP0)y`5^@?8N%|^o!CfsS=W3OloBEeRIv&Ksg@#V?8$V6R6*b%
zb9(^T(}j6I%DN8>%2}o#zQ+#cCT4E@F78j4uBJA<w(FgnU3T$;u4KbI|0&26HkDg*
zS^s1u6v$Q}NQ9B6D2<{Oh*FjX`&Eo%f__91tLj9px`xyCq6pQ`Fu^PgVHuHmZSUO-
zPJ(2=?dx0aJ8tefzPr2kkMB)EHzI~YWw}x>BjHi|72It>`1dJiYY+?Kf~kU&q1!u(
zbQd3$-|k+$v!_r@+(oZY=ppGpHes%wbvbIXJCSfUHh#4^nh{kmSP_BV8AO~fu04D)
z5}xkrJ)ROesjgXd9s<y94yMvXT>u^p?)c+(oyUEX_cK@3mTe`>QHO#rL_=S}s>mnK
zrNK?7u(`r624z|^0H1(EI))_3LwrVH>6~Dum=lv^hP2DHh8)ggl+y;1nR_l{q6PI7
zl;?yhm5-2;LhuzD?j!p8e60*dKupi-m`z5kA5~ItY%pcemCeS^i-z|C<iiXobB88&
zFxGuEBIv1w1PcPXBBazlrj!9AoagES4&{ycaEi&bS{@u_7_>v9HqQ(i>@orwrv*?b
z4*bqzPz&|yq*B$;W)18701)MMqcrFP<|qzk>LArhWI0h3+bNuK5&wRyp}-^%tp33J
zt2$~q8f0Ys;F4o!7)uWr7oWzs&Okj>mxtGPc%Xo%!fRn=2SLs#ajM0SoRUNz_B%>(
zEaSLQgERH}gv;hubIT{Xuk&R-OHz;%ie2b2f{E7X8A&0Lm~;P0^nWvq)WKmIa@fF1
zRd*^fZlTw>N^eD_H?TM~)x4_)R%-}XT)M(X@}$AyT`<=$_RK}^>_m<ofcPZIvH9W2
zKU=z3tse%i|3!;dBTr!uKE>SG4>EuS<5V_f7c<0~0~5ORCTF&y<avQWmTv@vyutB`
zRT&39i-;wUFkG#synO14eDx{`BNd~<pwN&T3lk#!=ZSdWcQ?xZ5NuJ++1ov3xK@P7
z2cX&aYqGO?wu<XHF%1bw%fOE<xu_95H1pj#B3U_XABl)^q2<Jm17Du_my+5dyu!K)
zEoRikRJ&FGP-ng{v}oiynD5s{(M@x;@D$$w{he77={?!7ES!(|=EXn^rKcLZ9?cQX
z6*AMNd%Q|*o5>opU08}HFZ|5r<SJu#HulY{5XT-Fuo_rW935n*K*z8Aot$I3H?*=r
zsxj&PFQ{oU%Khjrvty~!k#O<9@|j3n+tVUFx0TxztI=;+PMVP|COK?Vo$8s1<`GiC
zmKb#RmFTQm3q8oqcXt?BBiu6H3W^EWvX-D&+(+WthCbMFBJmD3jJ6n)@eu7bA8lz8
zPRT*#>0KvBE_A)2uuut~PCi*k>DTX?Zm%E7&)Xco#oE^Dw)h!W{R4Stg*$KXn~i{7
z#c*Cpkm?#U#%Iuo5pQv2s=oYMB%Rt|M7$8(74S6I#kr<96>jyzv1f)ZY}fm_qA=2@
zzr=6FX1~8j`n~BF6|Td($U(LhN&TC7_A-JDxF7KI-IJ4Fa}vQIWG=ZXRl2NOd)VF`
z@4|AhZ6b%7NyzDpaxII9#pXDEvap~WiY+Pzby$h^XZ2G1t1+kSoQ~9DDo9+yBJXzT
z=gCx^uF$rL`wmSzim~UTercGc7WIA0F{jqEl4n}lxXtGZPC!2seKL;4Er<pdBPNtH
zW;?~k#F!@t73vFVw!lDu9win=_m5D<<X5NpW}II}OY5a`5BV*_Gr_3FpKG*oCSYsN
z{>5d5u2N=ib3IGj4BTtphdcQNf1?rh+q(TuhH|)n{|?->IR^T#$d_T<2u9TwifS%8
z<)-67Gx?y&jxjGYB`Kg&*UCN8R6Bc-Df!VR-}pAwrBR}Oi(#-HSX$n1`m&jmPK!iA
zeU0AVJH#$1yONlIq}Oz1yv@Sbb@zq9L%_tD9I`VovO^=^Npwc9LT)=dq1<@oyyJax
z`~sbtR~M9QF_l!(hB^zXIYMzQHz(Kwxq=H)q*PPDb^tDWj3_m5FentVJ#VpT7YkA}
z0)H!lD5Go`#5CNb?w_DsIlFRMTau->+RWGLF7>xA4P=BoPYs}LnKoNp2gg&lWGpV6
z&cw(5AjL|VYEzQ)G|5h<NR>K+xZ~>0{NfBe8_I2mVt&FfJw<g3drly{-+DAcU4-Ep
ziskBnrtG+^D}|xDoYx5V!aY-(iW1|<lmvQx=xgIw-v*KTC|m^bbvwL3gP89tJP4B#
zJd8NC!&ZO-hV08OhfGV@Pt<6|(8~dGn%KCzLlGr?k*SZT2dTo$O|HYdY&68_pan^H
zx~<4+FX<-6b*Udl_(nc`EY+7mY(({J#og(2*&Q_o+PcQ_xp|8l$QJ1$bApM8Dn))1
z^BU=C>zN`?iQ`>)eyqTbAiMq|!=tLz{Hxl2zV|fx8bEvd`7qMMv(;|-F2RrH|0r71
z+wD|=%80~jWMM7<XA#zR+MkIjaHe5te;*-Fv-YH@+r)g_k0|4|v|{f{!EWdoHfz9A
z8y|~t&w?~5KA}PhQh*T<3>KwH#yro@t`iWv^S6hAluAGSN44K(lu1!qFNo$BtD|Gk
zSPegl5E+B_!{IM=oVY(hiuEgTfy?M&9&u(N*&t+HB&e2=ObC`&IZ@0Yq}v<Is8*I&
zBrZ=2mpP7oIYt>T6N*E#Pd~<Y>Jh0}&~Ld+@NkZux^mG|@Aw+<+tJ=$V8(ft8GeKr
z`%}s1^{}5CL7TGqk_7&8=&mHKmKwXfYNw4ROTWj{?EcME{WL9I_igo1F}BzJGul?$
zbrhG!^-%H*d@tYkuynKM{@S1T^{+JtZ!n%)5W*|EO_KawnmA8hxEJ(+a-5Vf&)*w|
z0<p2++R#qvL%oPxm2#Vv07XkF_W^+R(?8YcTk{2w_VcTeX9OdCoAE<IreH7f0Gub5
zxy(TxXRlCur{xE2XAspCiSIrXFw{g&@Y~r|S2GXDLFp}e%H*_x@ZHd&^TD;`EYs_q
z8eLPVW9V+oyY%QNOH_@>z1uf`-$ZEGK4qCvP;KNr#!vwfL=x8Db*VAI4|2T`-9eDq
z^e67SG0x_y66lTdj@OU;rRk`BHtqA_#GAv#x=ixQ{U$rkRkqXErm@s2&DF`U%;9Qt
zz;*C^)pipfdA?p&Q=nWpL`u0pNfQ)H^IX8%8zsFw9RuiRKTeKd7%ZpM92@DI;f$}(
zyT(GYlM$76?xV-+*5|d?X^(g8Y+D*!?U`GvNNy!pox+mE&>**DzWV6*Nwp{bO2eo%
zit{q>Z=iqRXnyZQ^sLVKp?#v-C-(7DmH|_`_EIn%_-b-}lajqBn={D5X!kl9Idm3@
z-E@bGGHl8da9`u<&*S!y{y1H1Ku$CaS!*`-cj7VmnUg&0`tt3c1^$?oCTfw-$0<`k
zUexQi$J8q#C-Duy6V}8zfhe>vTq~@U`h1RJtv>{uUQOQwK9RG<U90BP>=y1llxLH-
z<$Fro?MC0F3SsPFu7^Nni<`h+aG)=KCV5+~bIK7>Izg+(3NBiakIq;N22Dy5v!Xt~
z!^FUJ>grCKnl2fuhvV!UB1XQV9X$=d<Eb-od`@)l;5jAXBOvfO7P~5%1*u=pQuP_Q
z9BT%uxN0f}A;{EG3!1?vjYn#m4UVu}Hs{mgWvDqsT(TMkgHV9Fq7+^Yq*o(X)~-m_
z(;YUEdkqgJT3Xr-Te9GDRRc(ugiKBK!vgHCe@q5MjVE-yLztIhWye421p)#xMC0LG
zpEMA7o>fI}Em%OF1FKX}o=bQ?bo=4pjAKHl`0^aB9a$+3`ps<HDbgNO-^WK>iB6oh
z_#U$-?03U#G-6A>vec%6SE*3fOL%5l+#H8>Hi^$!-?&wCi)IxsUBZ!1zpl#Kuiy{c
z9Ez7czIkf|sUe(&6=}JyJz@h{JGw=)icVCU>-szkvb{dFn2nj5GUAjU>wueN;8*06
z%)IhZeQ~C%9E@t9tU#&{8df9Zcw3uD)7BH)iqxf{&r^82kHgWwcj4@or@Fe&b51V<
zxfrlWF#zeZ;7`syFGy3-foYQG=K-R?(b&9M{AB}b0tx{15c~UC&Y-Zas2i9#h$S;i
zU#+}umdd|#OYH;;la-6341=xm5=niU`~t3}lmXC^ttr9vQ{mW++0CSq7_w-a7&{{P
zZJw{apQgjD%%pQv#TkXH%6FHS5V(E>aMw8A?XNp{ReOWzN!;*m;MFqbQd;=D-K72U
z+x3rjS8tBC-#_PkAK&cz3AAXeplw3LQYH*HeXpH=wdD29yW8&G8){f}!}`1}uaM6S
zb3Z-@V*&zRq*6y4(Oc<4xB48@K|}KBV=j*km-V#qG7SK3mSfKOvc>s*KQSuP$j&7F
zw=YT<ea%eL<%|*c0O~o=lU_d-HTrtfztGd-Y=HD<q@|7WbWBpRlo^^FBdGu)@3inp
z!O@R6x_DN7e`iaby*-j;Xa5-!PL`)<mp!OIa&)DYYJrsB?__V@rW|<ENaK#AyX<Mn
z`0PCVRq^(8-%5*%vu^j@7sHAJWU=W=fW1^z(=<s@RqKFscHJ;1{X_7>7uWZQygzL7
za5lm+1_(47HxM$1mNj_`!{&#$e+v(&mD$+bTlsgC=ccCWiysh&pneL9Cy4{RoRimT
zoXsy0-7nfN+b?rccNo|^`j^}<!!PalH5{{J4E)Qs*KPm-a9SUb8zl(2G9T{pWOZg9
zPFtV*I+V8_{pDZNAt9)Rr=xKITVjGRa->E$T=gh!JNl~uicxyMBF<3J8!1oh(Hl)}
zKmLBz8`htGy+b>-H(7Y!Zq|+>dcd*^UxdK?K&^7Z%YIq5zXP7;K>RGi09yI7t)sm4
zuw46p&O<--!Jh=^x8b{tp?N_FF-WjQ^&#NmOA4Pxg%N@{Nc2Gx8&AXz9{++i?gp#G
zPsGn&a_Z)ac50dEYNP7vHrD1u*7Aw2^&@q{O?C2>onr-wo4VZlc&FDLSiQ@B#U<-O
z>LtHxp0;J|nf;`9B)?mo+GS)+_c5sp0&6k&LwG0vm3Sj&2i^^$d?ENk*$u&T!()mZ
zD@KXY5X4anl7lrMcQu54KI>`yg8P+e>wfv&7zCrAeT1Bin(yzaWaU)Bzfv>7i+QUh
zfF{aQHD(?+MOFtCx#x-^3Xbhg*eDnW8{T?|p7xLTRFCtt{0jZswx?vwI<bb5aXN(F
zj~PFH#`9!FR1sCpCE=SyU_~}QYhh_cOeu+G`ijsZA{m+VD{;)s_#t_mptwQ2$P&3i
zq#{=Sim@}a+!Ql9Qa%UJB3dD?a*JNTBwM5*AK@vXB6iNJxRFHUNGnrgp-KPPHKal|
zaYo`nx4|gQkE^xNR*yMy;?}SsaeU|CVXOJwLlSbVCAErKw(4mD76GcqAkm`enVH&`
z`0SdO;EgArw2X=?L#7l_(7c=~5lfO-;LL*PCQaLrzKqPvkS!<4o1j9%i3Zul-Nk)-
zvwms`JyHlfab9C7MJTGQM3RXYOHvY_9E}rRx|m>0LQ|4dV1H~+;UOVaPYzuvEIlV4
zIZEmo(@c#gyY#l}Oo1yYS>WED`zJmg6^2ag=)#yK(b12}c1aR2E~F3+O0qVNLox1}
zs%UvI+P5mV?em)Xs+ne2VHr^fC5Y8Nb)SN1ZAqA-?I;OFULjVhT+8cl@xu+DY3CUb
z#r%Zfd6FM5$?3~Vb*ok9`H%cXDGPZ;W!4Vlx41tb0LyR>%>Nxbgz<lHD1;sD?1k*y
zwf{q=U}Iz=VCVct@=!2v{13_FKd22QdSN?T=YKON0_OjkD%m;zqf`(u(94<_TNwOL
zw<?)9*||6xnK%(J{nvIC4||h;@ytyAcZA1(7XG0;czFH`Ir8tKqQXeP$oAjcRhS4E
z|C>jmqQXqT_}};r6_tOSk^jnukB?r#(auQO#95nOK}3vR#l+oNmtNG}SzP%)Y5fZ(
zuFOcl#PXkDeE*LBferZ|&-`D(8>}4vVVwL=+>QSuY2#Ym%I>Hg^*dMZAWo%WG1AV`
zRk1%JWjLyPRjrgFQRwe9MMM-2Lo2hz=atvH0*$gG(MHCOD?2kjQ3Q*}#D9#cf7}^H
zd#>JRZCf9WQWx-UP1LzLVv$y&4*Gl&i^-2j4hz$EZiaiVau{L{IYK+~4p_Z5-#JSY
z`_VtvuJb%`P1hob<qXhdFwZ^m-00@-380109FoBuisvb&o~uO01SJYVp64DMZcU>@
z!ND)ih5yD~r&(Ha5b02KozKa7Aq`$rWX=L}i%l^Knpf$`ec>~qlH2%J(1S_)s6AD*
zd#0mSK_^HYrmNZ>Kd%@XsAcWWMQse~#SHezRUHhU8XzjPA7)4nK7DkifA8-w8w>Xf
zZq~+>LjO*-6Vxmg4;8XiUhoE&%y;|qqYOA`lFWCbWsr~pZ02TWaqDcmU-ToQI(!OW
zmOwNV?4th$5`gLyhs{ZlHEKHpK;Z7QP23p4(s2yzAj#0Y;njXQQ&9b#q7F%3*Cb@K
z8dQ;X{+QO)r*11g5zs_JT!t4yWOOcluR^GI%l`4q&Fv3{DB}HA&2OGH5PhRwsP@0w
z<&QazFo&koF3+`sXKo>17~=@_EaHb`36%#D{Rr7KEJna_Ykr8DeDdb_3qL|E2C@;n
zmGnu^N5^^c#UA25xRr`Slw=#`oFIE=SwLB^S%*p&=Mg}+KmdUp(>E=S9+7@rx4a%t
zhIrZ>_yq0j{&w*8HsoI2;DhNN6)1+dEyeAeoZSVj1HZ-AQQlye;*p<{pgKp`pHzs9
z%k?E|pvAU42ZCG1|IPtwPQ4qxgis}MAd+b{AVp);@49<M^{X?Rdl4GIQ?En$9IJ~1
zJL?GHR5QMG64FYE04pW01^Lpo+$a5=r+k@&5oJ@%XGQ&--JI4)TijdGL4m4WNYk&j
ztGQvtGv&qE$JC*@%Z&miwU_ekrtB*8{@c}PmPP3mC~1Tuwvkc2(34cljh&NoS2_!J
zWe-YndBpI&weEvm@>%5UeZDKO{~RO)p6V=XI7f`xWIIm1G@mb0>4Rv~40~1JUjROT
z!gsqtPDFT948B>m*Vtv#6Kn-mi#9S{rc5+(H~M5R>B4~AL|G27$VLP~y6mIZXc27G
znLt5jO9uVBEi{Q%U0Eyor(J}wtHrF5=I}>~F_v3xlHJKw7nG@Z`@voE+mg?1>3c~r
z)9)I81Bw~vsp;TC(wArcf;2xk^OnzOpkty~G*NvDx78xoyR*h4PovjR<Lk3I!y|Kd
z_oKsr@#?%YMbk=6XD0GJ24Ayqr1)8oetrieo;_z<?pJx8>wBb&2T!npm>w+z6;C_q
z)kceF=6gNdvWRn~$k1(BJN!ZVro5fkZb)iGi)R_8Jb%Ygz@vf|5WJzB5N^9cf~$0;
z;>v71WM;T*!<f;hz3zg)q>?(dp=Vs0B_{G*c;;)k4w1{aw$w_^kTjRIpQh@Bg`8v$
zAFt$H(J%YJ-P!jcs15e5kIkV83zU8uY;zhq`85va5xIGLhU)dN$gk`?hD_KVqoumM
zyZ9v8RL^s*Cx4ePR=Tf{9qias8;~q{HTHBH<6h?<G8mmwb@~g-r;pk8R-yOvCl+S$
z1$?EWJ)PN?5Aig?nPLZ{VJu#(z0D#`u|N3<78=Y~9r@6Xa5l+<Zm};rdyFDc3kJCx
z7ehfo{sV{v{=+p2kCyYa6R{7yCF;~3Yv!vG)NU;~^j^x+ifCL44ir4&>wtaBEmh*M
zKI_(&-WlqvTNziVGX}HQ7UF1&;RRZN0J_)b{<{xo4i9RhFliU*=$#md%jt1<mvj2+
zJ1*9jb7Go3u*otlb?FC-AcB+Rg5~)X{^E~LwOe3|vOyu#;!Q*d3d*(7?Q=l7ls9P|
z1_QDLfJP_ieR&G$E+S!|VRo<uW<`?VWZhmJGu{78p?&j!PqZq~)H+><OG1oR2RFvR
zX>Ea6*EvTwmsqP;yQG`zMfXny(|FBoqp-l=u>QTyu64szqbF@L{4GmQ=6AK_NJ{iN
z9DJG-i`~OqpFxmmfGdYmqVSj5%jB4sAA^HB`6M{^`n9Xd{<6V&i4{jNDi%vGK(t!<
zrVB&G?X`J$I9p`UZ?}ean8M5)y|cA`!uxbJUT+ujL)Qm;ePuVm-j6k>zZy^_<X#u+
z>{{D&8_hM?o6BUOs@z^Y47T{&ZU9d629*wV3V!jz?(sCvwfyFKQ2|y6<@jbmhdZUq
zG`c!Luq2f!QC3X;%`H(*K(FQ@xhs~Ot*w1V_;0SNOD*DS{-y}_3c@>*0v*h9J9WbT
zJONwGrlN=VcV(TgMdwvFns`C&t$ZxTD*Lh&Pd1L98p}{PX}a$=fuid0tWDvlcm8c9
z&n)_L@HO#erH>czMA~=ofZr%30G|i_cI(SpUX|LSN6oF5>)8w3p{vk5xCCSFo!**w
z0%t6bKsQ4^9~HKRABM=SfS;Q!dZ?f9*Plwr)pE7huoi8F-)mx7{qpU7{oU+@IW&@H
zx>HYAN7(kVo%wyT(P_P`KktkR04G4XCNrXK_q2A?{VCe+so3XqFukz%B>8{TIrmFe
zGZRqrsuO~x$YQcCe<G*``=aoG;9srzozriBc=5OJrYVg!3BoYk>b|zoX4A?yA~$#5
zHR%(z5uRYPA}n=kvj8+{U`W-`w!;&?G{O3`7~NS``XW*t*wy8ZrIFHy`*J`+LArV5
zD_5HrgUkt+=U4M%E9pZ$s<Q4a`FMV>Mq7>WG!1fDrjau}K3D^w47eJ8H2E68h(rB6
z%QFH9uBmM2vhJq))BaV<`1=_HNl|w1#vLqPL-xM`WKzX*$J@h{!^2)10Hozz(+K$H
zFW80=y(+Vh%(O9YdoM9$cMx(j!LT%4`}Q^iMXd!8(Tue+wl|a`WD7BH1`kLD8p+xN
zZG;)c#$4zMUven^A~!}JjbkLVo8>`}XoceuBca`zxZSDzGArqlSV<Um$z4&3p9Hz~
zz=UH#wI?vg_ys&T9FrjAik|>)qoo_q!20;C`;>ng5mZX7PBmjzxd*^%OjFaCh7L9J
zAT;2ZW)5vg<BSHoT?y`nyyw*H38zDrZY{EUCDc;mV_i^j4qcsFj;7wL$_ritZRlOM
zbVlc3`rw0dH7@ly1Jupu$1XO=3(Y%au<R<FhqhKBEsr*3-R50l`y(Zs;(ubvK;c?M
z1s$+Cx;cT^-g~pp%!!qGwO9fUCAtQID!aa3@TL<7oQB*>G=X9ehMuw_3_aYei6iIL
z%ZyA!u@*zE4+FTq{5=LvCGX}<dYb5_AdwfTk}|D|qcw@j8jK5a+)W6IrSHl_gOmb}
ze36%JjSCI(W#i#puwa9HQI;l78Qux*XRVEzDBC(D@AFlt%p{aWj+(2vrq&E$(H7!r
zh$lmpSZc&jpiL-8+?bzbS{(mw83VVVNT{&@9xv^G-8h7YzHDT(g|u8iHTBN0jxxzH
zi%boN6M}>scTTl>5o22USx1YgHKZl`_lZ-(bpE6)iDvc8i5H^S9A}{bJr@qL#1ICE
zfxeJjB!;AsWkJ8a-hds2F<!do!0nnEekseRw~7@@6|eFr{h82r!88}h(!IPCT6yYh
zCjkClX<@nFsxvuWbntLzk^_#_fm^a3(+T4QJXHW7&_*maRlC-?xi($-n@1myP<U3O
zQ;0vD8LMbVR$!w4A&!kgq7C(0*7QCI-i>laSB(2UGFAI_Goi=&4ojxnQa?P!#6)ij
zy;rmp+1OIvw5lY3=i?XK1*!~adqL5H$|>^+9Jkv~joBuz1xlv|<3k&5!fw)#EFix$
z;#Wc6wb$xE6WMpCmmqGbh<z9)V%b1Hu{;BE4o>FK2@k11-hcz`Qe0a@a{l$~RVOjV
zRIyxqG<)0Ij2Ty@koKDW$PN7&qgoBLqipov>1!XmLUckXr=uqD4$mnRN(2i)M@kBl
zv>bjAtuo7z!f`(T-t23QQ$H@moq>5qW9Mj=O>^IuDTvOS`GsvvA|NVuo8yd-aV;CR
z=BC5{R2y>CN$b8+ZB2AdO{$=y3#da8mKMN`bXn*B^3{2Dx-xwafpAh+m>l3g5?|lR
z_K(iw`dM!D4Kc#ThM_YXSvfERB9NUnGU>?#58Tw2s^gVZ?%{^O2{GYwFRU;@bEX?B
zAu`dJUHed4tt;9adL~}Qu>&=(XEwkxjTtjlJ5~A?mefQ8+Y@jkSc%9GI#HZ*3Hp_R
z#I3o{JOZqzNq(=~>rE5diU~EqQ`{hYdg^f$l5>MlmThKWhP>6ZAzp;}{M!F#{*CkX
zx;HuF*GCbx{vOnlkC55yrXq4EIwO;bL9bwqT8W>7YDVSMuc)ARg83WtNjBQ*Z4*{y
z#*ZJ(=1n3TCR%TcTOW7@Z}5_gWTmmwrlEZ2plShst!S<<#+KMhk|6UCfX%XHKraU8
zfWHIRXicL6aJKh^PWQ*tsc7P!N5oo&WRO6FJis5E9MOl5$i%#kbtubd8$yW=+RJgj
z0P}GyLJ)kVl>eI0G%~E@MVov>*L-KpcDz|2g#=@rPF(^Ee^}1*6Nk=ZafrvO8UsQf
zG(Iu$(+ga2KfYo8aeb9oDPi4Ov`zNR&F6#|V5)kD8X=bCh=ME){mn^icFy2mbEL($
zFKX;9cJG(LUZF(bS<$Dp^5za`Kkv>O5JfG4H!0r&KjUPWJ;&%uJT=a&Fgg&z5I`o%
zwbW5Lk%UzM+^>{oMWk7n9SD4|DsQjq4G+~sqCYy++$nC*K7DS?<4AQRWV&0NO&Er0
zosHe$uvteegx{u3K9XD-U7-V-eg!QZwmJrVVJ{y@o47|gE|!&UO3j!C`L-S7iy>wV
z{o3;uqGK1HePb&GE22QklFJ65zum4^sE9dsc)kJ3qoFn32!P#ngE?Ry!jqNuQx?pv
zp8`yf4P`qadLE+|MhBK|Ecp?e8OJ*ctiXA^NLO0cIS99a^JAmNEY8A!*sJG>e;@&K
zdbJOtieHTM>T47--qLMzv{0W)dwukFhqd6*bdmYBxk@_qIJUS7;k%PD#m@O7onGn(
zUztMvWT#^%D*9neNZdCMSy#FBTWvIl|1^!zXpk7m=G!Rm(yvkN@8v`$O)5*WSTi6`
z+RPv#wQF{L8Lq0sMkz<O7%-#>Aj|0Z@nK9&K~swS`$I#$sF>>E!C04F&6A{EKq44s
zzrcwr!Z|FS`eRjO5a<5Nh&#&wr|B{Cu%eJ0|3)q;7cZlAW{ug7*d2}vg66ryvz)Kq
zira{%u14l2GC{hO1JPnErfpArb(Z%^^$jr-=^#OJM!;?W2eXneaKSO4O2zo=7#JUN
zx^8{?@h&ThBrx?Y^c4T48nerRWX13isH^GqoxjdI@Z@ZfRj^USZHjt~EMI*v(S2Be
z-lFB^5>r#pR0(PGZ=?=)aGCZkhHaQmkQOTE68(+TOG$^j7d30pblHMHe^J^3fLpu!
znXxa!MV9#4)R|7wT^!yy><h-yN2EssRb^LWXPeBx(IL1Fkd5+8l}gDhi~V+A5r+LJ
z$6sY`tA1Q%`1~!zO$RHLm%swZ^(oXZ%FQ7tN6Zp^IHSKrf@FU?g7X&W==ek%zZ0R$
zHgeU3j|@UL<K&;@qop_=AXOP`LzKPTsUL>L7AX3F*mvaQ^8bi^Pp#==yBU8B@o9ol
zdWRq3gmK1{myL9bX(!ju)H0akv?7pEZxwEET#fiZ)Mi<Yc4k3f8i0C@NO<_c<G##*
zpO7)}i=IQ?X@6nJ6HqHN^@h$-aALP;Tk#1CC)O`Ro+DVIh0te<uS?Gw452RU^#tc}
zVrrEs579^t{n1IE!lc)lcSU9^@SbylZ^vRngvRD+{_*4fc6WF=IJ)S#(f-$3dT*In
zIzsD3X@V9HlJl%de<}WHVLzrXA4WN+C_QbwPj=a`vbS4opfr2qm-m<Cy@LBYQs}WN
zLVE9zNRPX0Iyub4^-=14K)uB&#Ns+m1mX_C9bOIFe>W2G6cLX781sUVFiP$AWbs)F
z&2IIPzE|?GypG`F)hAKTeZ2SsDETuwe0bKjFMU}rHIdy|ZTfMnWRxsxY=a?+-DPYj
zxI}H-2=yY&Kq(mk9O-Sjf(LR-*bsQYdFzt(m^}VK=4!5!kHbM93_JY2cQ6IDxTZ#K
zr$FVc>f>*XyP$o%{ZX}Nd4og}t7^v|l%|3j(}V@#PC}17_70!cXr{Q9E3FjCLGKf(
zOi4e}Yc+rwMTx?GY__NeLgO$$qC=;o;r$GsEJ0WaYz@nG>jJBkDGCGGCAv%v5KPB3
z|IUee+ZR+>Gz9V-$CA%DSd50J*NGaF0KsZ$o*EKVePgLx+_eHB&t(?$N;tW&8R{hZ
zs;^m}1r_V&JDcghsj?Bp{%$*8_J17sNnqUBM0~Vf%7(5k<Kp~&HO`m?yrzC$u&cbr
zGWm0**JZ7|sa`4wxVbwHiaR~2sJhJrv4mw@Qnn-k@T(LkFIvd=9&;Z{`TCC=*Jv$p
z3=1tz5lOgXOK%wcDy73lF;&4iL%kTH-QTpl3;hhCsOBJ10doJs;|YCUSL>X$mqf~V
z5y(~ujPax*bq#D+=MNu}k%H9ZRC_LBLSGVsmN;^7A{M+l<FMdbBY&1YYj>lHMQ)j&
z>qt+k+*$ssLA2^(jfsu=Wj;-O&M6S?-lFBBK5fCBQJ~Vi<UgNvXL!?}Q-L=T0+YZT
zhx<iGS%;nP+TLIpSY)ta^kKXr)8jOUAj5j8*En~gjqI{Baj`2hNF1+!XRHaVbZ?C#
z1AXP!TH80{O|Q^6gvagKCo>ng;z4S@>BiX;z#b2XCJ(pX?**{=9!HDs3xXqT9)6ik
zr3ZI|;Hh000WMcB^o&x?I!*L{`Ju5Mmm7p>t~zOS|HEC8anog69RX2z?vByW1@Ggo
z!w%OPIc<dRX12+Mo52N#&wR;0huuhZTGLZ(6Cco3R|Kd7WigfE^9;j!(o}g<YMIqh
zxwj#1Oa!Ogc>jAQs>r#PFj=3zQZ|_;tsRCrHz+XUKT_G622xoz`NdoCOeL!p^)=Bk
zPg7C=Mn7%ae)O=#0zNs8G_gx4Q32H4WmCs~9%us{aU7qxDZ2-(b<pZg6fawdk;~u9
zhu!1UsuA%0iS2587op&As@$`QI>AP5xMvyp0nrIj6tK9f6Mmx+d?7imJ|p}Q2bMQH
zG8F>F5=V5nKU5|5YopBw4_&rfzpc`w{!t+zYKX4Vgk@F)uSX}IR9A+-aKX{x?#I>p
z_TUlNKz{HS!Fx?^R}t<r(F4NX4f}%a9tU!=KWc3?UY+@~l`H<*tDcxO$QEWV(R)_}
z*p?``I@`9t7|N?T_m5^xl&TZ<2Cxh#JSo_Z($?Qg)DCbjiTydim$vq^@x<Gxa=;{E
zQDzJJtasIRDdb}cK|axWt%-`CnIi}>+1@|<zfu$Ddg`arX+`jFK_qF2qj%?0ziW3%
z_a`Io@8^quri>}_xj<!ES<fL*sc=n=@eVxH{*uE1@@oc#621>4k4%xb`lF&6^gYLT
zbZz_@<^}0NyJx9bzZE*jpjdtr`5jJjPA^ZQ!8^?24^D3X^H*7uK=e{w4^^6@BPmDI
zywd7{T-F9&sbqWTM^Ac6GAnJZJ~c8M@OOv}XZ*`{tXmL#*~AcY;4B%1O=Yl=d7}%w
z=zi~qxF6th>=Nt$PTl{H`u*Pm`~L@Z|G)M3|JUk1>wgsX{|0yepVj^UEc{>8{r?|z
z{QqS6-_id!9iNkt_5VS~A6D14+ZsppeXW~6LI^jX&1r&!;&8|`ZjfwiRnkvD0isoe
z)0Ui0RDpS2dxZ&W9LMC$bVx_@s6U<$V?N8ibNxBRlDEBTN^5F*+=!O@Yuw5;Bw4*E
z3G_QnE=k6u$cUb_aY~c1ohzHfA&KPf3aDr1W=4-h1^E^FWAZ|;8<xQ(IZep}8mE(c
z(P#b(;6rgo^tk@x;!ugS!CQ*&;ZTi2Sgjt>TGDHBWthP#+JUQP>>yMRRViVt-Jk<Y
zP3j;83Rfx8;d_gm=@adqU6@u^<TvYklS0CXwtQqCiEl}E>Kx^$&A!oE5f)b5P&oP9
z*>h1K+S(E}K=Fbxy6;?yhErpi3qLhr;xXA17aBQw%a2aU`s>m8EV<>Wa<b9bIw#0s
zYQUY^I-;i9(V$(dPYJXoJFR5hXijAmo7qiONEt^Oi25Vn+x*Wq8`A8j?!0Eaji}G*
zuGW1Wj=YdI)h6v_#Vh=!hl^ExZ@_0k-QVhuc3TOfr0Tj&Lx%GsX&b!62qj&{B8w@G
zKG%rN!okDW(P5ign&0=$VT>%LAp2d8gX*zWS&R}QmVabT4AjIc>}N;MrLYgf%xl^L
zi)hn3O(v6mM;xL<M(oJoS?bWo`m$YPmP;+7(1KH#0Hy3wKPd~et}VJ8a<U9CJ66<f
zv|eF_Kk(@)pbz#II1V$Z`jyO@%K2)=1j<Vv3zemp35fHinTh8&Q+^0`YyAqovavF1
z45lOx+$wrB{?54XQK!$l_6ifVU=+j~T+K~JyaofB{q#Vi9(ziL6dozXR{NJ|14I*c
z1Y+8p)}s2zP3>eF+g><}0EZXr9n`w?mcD_QTs%<_tTgCNLg9wX!+ALezv2>C-nnb#
zrYMuCIc|go&Oq!ueCRv;Y7V2-wJ;Q=aMXP)<?1V(g)*kOGB>}{W@0sMFqAT~5MG{b
zB3K|9@4A_Ow)U1>W3Y#N384yCP!o+B78T9_eDnj=9vhrid-0Eq>tZD66C!DB*RTrM
zrMX&%0>Oji-@1poD?`BL&M%yezh(AK<Tkft+>PxdFqOEM__Jp85^o@~SF2WD0D==G
za}#8rfM-QynS&AWMuiqMBamP#Y6{H3WW3pt2i*QSS38CYYtNQ#ts4M1okRh^n`YCK
z6X{AJADB*qHXG|%LA=4h!h6rqNfGZL0Vs~EA`qy;J2M>HF4w2jXQwJ4nROyJu;<pb
zxDf(Par6UGfn59xelKZJJnix~R-EA|JO|+@5y+VHfW*bsTa@gFrGwy?drq#)X+!1P
zcQHc-k)HOwQ;1tS#3WU>HbB5x*LwA5Rf@`;uuweO;vvKjYvHjg(fis7TjM}SnN;vy
zi*BH$CN2jc*gZvM=X03-glm5_3cq$4&B|hq!wV~TDF;wqc`nxBW&rSREVulO<V~<L
z35c)QUt=ddOr{C-qRqNz8sHKuZZv@zBMJ()xw115a7xF;w))gc$O7jSt%GDG9G@PP
zr(u4z6NXT{0d+)Ud$N{5UT;kS><{8A2TA(h^DI3W#<_J&vB6U{n0|lcJ|C?jW57yR
ziQjm|=WsL!*U67Mv#l8D4LwQX-gkWTMYy9{{e77Km-enZs;RBn(*!}0Dj*7mUIda5
zLW!Y+f>K0!6VfOWN(x;m0wRbsK|lmV5JeEBNR^_1^dc6Tpn!l#??sSzz-znrd-uM#
z*7xT<Yb9%E_RQ=#zdd`eJ;}@oT~&6$SWlk8P1*%F&vzdEMYC-8-?l~1)q40R3VxNJ
z81XdkThy0d93Rd14C^9zWS?yC#4Wp?luBH1<rFWL{UG?>DIpX;)J_jxY<{UCm0DD*
zzrv`_FwRs_(eu!~>WX0sq=yAxvl1iIDU)>7^ni6(9Ia^Zvm2`MD^)ZXnJj^FR9TTD
zrJRz@&I8!~tYZ2jxA+!QBxIQ_dim%Y<VSf)Jabo)oQmDasq;0R_YuloIp&QP^6B?j
z&pP`{G)TLR**IVuD(F0ndt5lpE^S!NU19e-zrK$gn0_q>zG>8YBoyoyuA|Fji_gf^
zjwMM7v0JwtxeW`U*3K@}j27%Zd22n)+jb7Taj~iH!ljmHdqh;^Hu~|f;LwUtTNZ!3
z%ok0UM{2y`4*Dw>m4&aF;anQ)#dTJ6w%>Z295-K9(b`be(_hmZ9EmHk#NVcL$6l3B
zK$Qvzx5XbDuj=bnqI{N7+R+ZlYhJcEouDylonPr*Y|;F&F7?x1+7B2HnvBrVJpcS|
zOV*=%jy6kq2Mk-KnNjW?e>BK#Ruu{AO;7Oe@iVPEcOS_wwgI2Jw8~lC@u>Y#hrNj%
zWgJ1(_do;>^BnUzqgw&QqHE8xfs)}@wXq#mwb{O3tC#X>9mxetcklCz>RyLT2(@xu
zx<e#LJYE{lUa@V>)z04&lux;u!AT=9r$Xb^zpNrw8wiG2x4JZ2V;;ec`CJx6=+ard
z#|fuD3(ReO@nFAUEEU3Xh}-9Qy-i&5qjFF7>6+e}P<F|b6_hG9<B)t`?~Pcd_M9dj
zQa1Zx?eHz<ekP~Jr4JwBLMIImk}|{0YdS<KG6aHM**_))$w=r$keX|l33_;IbV`TK
zsBx9GL)+mvyZq=nYF=vQ)y#>9s`Hb3r@-Z<5l@U*mSnr~=9lY7HwQ*ZISL@58lpb&
z{YV5MDx>`)8d5fQB^CXJF|X#OFSA)lk?`kzD6Zv-)8o9)pkZ7Q7hB#Qmx~qEp|&+R
z{!Zh*CqI1i#>3fyFMavqd@&F0CtH$*j}@2I^U81_=c`S@lr!h;P2Ha_Jc3X679_Kx
zW1W-K7hAZ(PG`i4U7?|i<F)D-oFdG5n0{d@6je2yU9t}ueCmA>S84RZDig)X8#ZxL
zH@)>)dAd1h-|N6LCFlo%i0ZeqRPF0uPHy?qex!a7p!Af=<Z_4XDf7mzqQM)H-D#EY
z#cn)2OLD`0@G>yW4S%W>tAxBTu|_$;)@5dyOx?#uGmZLk>vQev%l89yoL}i?HgM5O
zWAMSn;VIe?&eOvTgR7Niy3~0?`k^8vhZZ)@4EB!ezR5l?ENF65EjDaDQ)O>c@V+%m
z(dr3~nh1v^c+w(m?sGMXXYUJ#9TVSYZ04&PuyXVHW_`_))`-^Zv=8)q*Ox3MzIeGU
z@9iy+!3aLv=Kdr+AZfXr@OY#od#Z7(<yyY7&9g-1H?d6IUwE?gHjRDyS_l}cgyczX
zf7koHybD~iKq`@XVU%Ay+g2vSz8G3ma#y>Pt)k$*TZ8g}OL1FoZfsAej&O#a)I*a_
zg=9OJC;EwZo=z_c^?ox(O<53uI(_czd}|*Y3%2$^;EPgfdJXCsTUmeq`7fKFH#aVD
z9Hl?J;1HB$Rwr-pB5cU$$V^}x$tV^RI>9%~{75R&fH=AMeD13o@Q-XfB!|P^pD@V<
zqU4v3cbNHgPGL`)_sX6cQj|4cw@4W}_cAbST0%lYjLI{B(z?Gk0ct0`CON^&u$p(f
zfI?zPg0?XnRv9c7g>KDTrZ--1p1Qz`S}U;bi41=cE<(xr#Z1MmxxiN9S_Zh>=pKFd
zEdRx2b1bOi<r9JZLx=L%{N2vn-l7@EeNu1R2<@a$NPlkC8RcPHdXrdvQ*$&^*XJ|V
z@I(Yh|I<Fr+=1dX(mngxED5UE*x<4>MN4%^uWX3ezNE|oUj_*cFRl`DwqPNgy)L}5
zW}fSDf}E}ip5$}_@Lqb`o<PR(5>4|a8T?4aspUL}_}5C7IbvVwbF&$)SG%|l@O8=?
zh%LIS3lJ)%!$Cr0{xdRZZ@B%%3MP&WbM15DGqE!~-(8Xq(GPEfm=y1+gX(!Z^n6;+
z=woqbv2|jax~tw_f-KH?29HW++nb}&_<HElcA8u|&%Wv?nbmVA5Cef6j*I?#ZaoTE
zd@`P#yiHdo_dd$OkDID5NNgMY#ki!u^je6GP=X9Zw(h6_f3ck7^$FUZR`$r3=UOQ)
z4~ym(N5;j+LG6xW(!7{75jV6%hVtKVm`%OY&=Y3xZeOif{upc!S(l8PdS&>=E0|II
zZV+brqmt9W^(H}j5oNJ=@9E%O_F?U<Y^OoUtFXO{%!%zBQP1Mz@K@VjC?;Qt{H%c+
z9f&<975%#4RDng1yy|n^rl46|IN?ZrVj14h`)1_D>q1WM@5e^zqF_`L%p<p2g6QU~
zvXHMCa~V{`+nfXjgA&35UU*t@=?e8FPn`3rluvyM`;y&BG7f#k=2%iMu1w6Rh211@
zz)V|*I?$*ViIe?Ly0Ld;kfh~i&Ub|im++S)q+dr&Sr&V*Y=QMOYnnEsn^;@KIzE=|
zAAfb5ekwr3xgj|8*p|>98zPLp24a=zb6CmzE!_|gx>&(hA#hu*Z}^<OsAiS#)ASg%
z6@g}tC$(%2hlcJ{;A~UknRuyR4qdFPPd<F9S)MaOUR`!Dg%X!6<+_h(Y5(wIuCO8P
z8F9t^g!%5em#IR|-Sy|ECpfQmc5NZdhSx+>da&0{vh#7}MfM4wF}2jMGTLm<$)cJ<
ziEd?zT6YS8M+Hlt@wVMh$0UY<^YXy1NO%YWnx);mY6l<gp<}6ca*GY&d@DL|NRKd{
zs{T^o`Df0BgFXyt^)wMw62qU--i7jM;CIroYAJ@4cixu34vXg53|?5D7@n*P<7m=3
z#a)wi=KP&A-Q5blIw?<tA~aeoP1`;cg4}#uL320UoM(D*2^?0)J9P*4@#}t>VRGnu
zWrX1MV0t4`y~w4ezIPlZxY&L}SWEv(1dozjNAHWnMz=28H~8f#Dj;K9D-*Q@La;8^
zw<pa#uMXv`Nf<Y7#<)>iI)rw*H>FVPM+>=SU!M`S0qe0d1YdR{+of{pQ`p+83Bw$;
zt~OBS_mz7=a(x;nlis6*6ulP3bccl8LMu(TnCFAbJU_%tf%{eL^OZVJnLmh5BI~52
zqi@43$nhqLWiXb;^5~7{?{!U#dy9abM=FawIA3l^f!tDeYqnhwxp#<yY9TH`s)#%{
zrj?V=_b887v0Kf$xMWx^j|Xi8KI;SeI%Uhstw4ABV2X3;*X(tcA*1M|)IOsb%7Y_j
z^zVFcp@vz@jn&4ki-j`nTf5!3z}^1P|7I)()T?>g0jpTPqHdP*e*6iClD%~&msdD7
zTZu~L!#-`~2zFZA<_s%0ZTJ>9e3Q-kw$<y|gDi&v3c6a(L!+n)YE}Ja+C`TR4IP6e
z7k1=T@dh0i@KGM?Y<hYt){W!b#jMJiS3Z!-gkh@7JoW~%-UH=yBXdlAH&6O{E1!)k
zGo@us{czzz=DBnmAqh2=F7)0d2qA&%OB`43k$GnKh*nRg=$PZ%3wIA>=!2&OEIY7=
zMrR*m#XtCKhD~Mbb@2119cB`VIrFI)W&ijR7bG5Z;25)xw%_WV{r2=Pyl1TUzqmxJ
zKKI(8>u9y=qA=;6racu^x6Ph$`C_vFz-<CIjRE-~XCvRc(pD8F=W(^GIrLs!WmPoo
z+QbnQf25<l@W$0P7rE4p6WRezPmNj4y=<VFcni@`UU9SFLVQj_=Y^}s!8Z)EpKDG4
zRes@m(buw$4_;8tW}FEL#OCRCsmO6_QVnn>y<XGT->`KSr&o>}y4I%IVKHyGKu*xj
z5)+JiE5sZ`bu8u-OO%N1nDMG+)qJeUomkJuh>(S5@@K;JV@J)>;7ZQEwtnLlS~Tl8
z>5!c3qiDMfII_c&=>sdYtlaFJU%A`ziB^jE()vELVo8-cJ<1t}OIqphPcKi{kA(@5
zX@yK{MvE>hR!vG?8rsjtdi<dGN?c49R4+C$Y;U}XNGF+!19oLSXyx{#v1u+1`?18m
z=I5+SS;SIR4WHB3%|zk5>tEFQrv>qZZ|fXbx%U`WHyK9bXI1lNnS!QHh>Ia4=92}k
z8uc}5CYeeUUF{h0`Yy0o<FY9zK6hpx(lK0@hGi^!8V|;86XqK14J6#w3cJcJ>_>y>
zRO;Piw@u_C8p1m!pfs=c+)2{8egGX^yf;n~JaK2sSupdOb+wK?BF^-#NA;W;5p?(R
z-Szo<g#yDN(8+pYo^cpu2S2E%>wW{AS!Q}8d3`95L*&k!)!SF&i0Y2Xr&b3?Yv*Kd
zM`*JKG@{mhD#z=f#Z8)@HM85;ZMj&qmM&}?-1AbruUDejtGA~>Xl}$jui~MRxCg1p
zjE#_cx>kjpt{Jo5a<9ET4{@k;EqNAwq@LvhdAnBrxlP|;{4Lds$2;Ez@2}aOd$M$G
zMi@i0!c;8Bi#%5G_KgJ{i*^xeK!GzjfR%JhxzS7F-q7)kB)2o^!lB^JZKXx!Y1lsd
zGGbP#3U}+_Br%4gXmE>hiSt-w9ObJn&jYdt1KMbs+s-9xkGY)4jA7_)6*W7YcVhno
zr*XFx)o#=CE0ir~5gxUxOrtKmnvF*uwE7@NPq76`92eF`0=wH-PzBEwp`ph~Grj?i
z6;SpAohBtS;YR!+W7p6vY*viND|-$g2UL75@v?(Wkw<vSmT3ggO$NsY?$*8=g?v14
z@#Uvh<UG4{B65VDizZ@Y-of2SIx)!Z9<2zge2gzd;e_y;=&QsA&0fb0!ST)~jo`lf
zd~R(Q<8@f16oY-ULXueb3c%i*n=k00QW&BM@efj8Oc(B1H+z#BIwwQ%AarT7g6{QN
zN-fWgRO%J(oaml6zQ%auf~083tkU4@xnu!?ZuC(;qzTSaAD69WTj(1f^LR7ha(ZR&
z(;RWd^eY&|TPXvBY`Vu!oU~t49Ih8Xw&pzAW=$mPds!Q^)N;!tIa@mzXlwV6-EHu=
zs{uS!6_hc;ADGl><y{Fq$WBOMSa6x%5Fb%(yT12P;n~y=K8aGYE(xb!&F$O2lB=mm
z*-c^Ks^sOX=b&ZrDXJ$p<c0bZpF?LFujsc_<(irbsmOPme#FAV8fQ;(b*Ja8pE`23
z)UlVtQ-}K|Lnl}W0lSNMX%<po3g%6dEz|xK70n>p)WX5vHMh`tFLQ&0%K>L)OGbs<
z%W_~VY;6y3NHX<|t$l)FD2vvvnN*6@S!LVgyVQB{Q^(59p|7)Fi`y%^L}+UF?5Uk@
z4LNuwRNzKYLKxWAn|mz|zvXv{b*|*e^%gfa_|nv%jE&dr@%<-{!t#xa#at$HCB^OO
zsM0`Ug|ypk8G;|HD0DUmpJZ3_S?EKY$R@eZw9>1h0jIR;51<&8JvvjKR?5(BA4|J=
zcOYB;we{hs=69zp==G@zJ|1POd5BJt=)tU-s*3^-vv^KqrXsL%>gwkny5GkTo7upT
zk|e@XcxWzyq|)CzJn!Bz{G28pMfooN=25V+U#g9izv6c2ilkniR6D0>nzH00a8Wpv
zD!$?2aduV)uX=*ee7ibF6yc^8X400IyEKA%pb2z3G2u;pZO~CLTl9Xxv(p?X2kZT2
z=hDD_mF1h$C;a2E3V}ADa*gL5Qf&!QY-_rw##Tn!-Y2Yhj+<^c>G*x^{pv6yMO7rL
zHiN1=qRE)>d9$iL`ALJ2&Jyxv*gdN@wDS$$2!FmP^W^S5J+G@Pv|d~}TDKC(Y%5`c
zs5-b_Jny3we*25kY|WHxlHQe>Dbcf_hL+HgxD-Fpx7w;;m1rq&;>kv>{c9gQtSE|@
zhr$Ol<~SGPi*5=><PMD<`P5a)+H6M<cZ+Ns>?sQ;*b#`W^NnXs9^MNS#}0+cxWzTf
zT&_OAWY6EU`g991Z*fBW)6fmdtozvKdgl+lEofI17Uk}O9?)tKcIsoA;hB3X&9-i3
zpQAgYXU4!H#beXhhW7K$Tcj20X1h&SHh%|ya|+K_nwMM91>@8s)D@QC`&#4q%_`Ks
zY<{9zH!{`lrM^<q?<Y#ZBm$j!vneHi=fqM03(eY#>s&g;iir+;7-s}$FZb5ujvYIl
zJm5mqzZ$|W&uX4&vdYU_s_~%wS*^bJbRe&7cytBtXMd`esn!B<YcI-b!Z>VhLv5y@
z_*l*%jWc>KBJY&o>;88`W5y-hu01{x>9m(q1t<(i-7ebtPd^>(q~3q~eqGPqnFLe?
z>?Yt_|4gLc`TUK+5UlZ&ypx>&jjZnK4wMeSe*QE-0-tuok}RRSIr*TS%7e3@-S#h9
zp*!UVf2egwlXq$c%yf0Ye|*OegUc#>)2E9gqp&D4>SvlhQrXK5g>k}>L1>)4ql+T{
zY(+Ic$Puf^Zwl9i=(?%n92~WLh&V$ZJtK^d6Gj2cudKv?^g?(!yEy~eKwi#x7ZSot
zkspP1MdJ`adxs3>2ko+uofP?DQcy{t?3iDP0R#deiC8<tS&b8a$N`@e`5nk)Hv|~$
z>FFuu36la6kHAm`1qCof8Z0d>32;b~yj{pBFG&}Yz&9n|^=RNo7^0&a+0oSnw4)b=
zc6BE!^7HQu^yB(wpxZA4xsarGjg`W<I)i}@FjNW#{-GHVL;^$vP$z+P$KZ%csu-dx
z8bt<aIFiVYcsz~>l9Pf+!9k*?jxJbNPm&mNN6AnAKSoD_cTD=l#NGSf(f%j;Kbh`@
za{GbNZ>9qsfa#FmO$Uewbs`QZ=Fk9MO41OByd*?g5&}1ZN+Y09gf#3J1d4z_kl;UY
z{sayAqsNtK<m!r7I%BvCGh7Ob$Ae68MA8o6a4Bgi>0h+`!TTpQx~^D9JMaICDZg<3
zw-Ll*egNp^PQ>rJ7#0J@;c?D8l{o;2(BDDCVi0z&L}wIP3FYR7cf_D}Tx@5Sk>H<Q
zzuYN6#Oz@1O8h>_-`sC^sts|3->Khy0Pm=ziFYKS&^R)%kW3u$?ih@N<2Szn`hM!)
z5!m&n-&O4z^Ve~afHh=CG9LFQ4Lfe9iYNb0{b|e2ibUX1F7}H2UXoax9m*X~=2y~n
z1iYW*YDWf{x)QM<Ne~8wcSI9+0kI)r9B|Gk8xOz<rLeA;zq9=Jfp;zc&Bp)cYSGpG
zG2Q=hy*NAnKHGr1>*^vjTruuD?x3xq<nHc>MJU)|FgRH|c}ZD02t-mw8ZIxXfU}d6
zl(R$0;ovAV93l<e@n2+r&f3m00`zLTkjN+(4DP#Lj2#*VhrqCsIGjA77b>eDi30wy
zQxc^Bk(Y-n$Uxv|x$k;^k^S2>@eMs-TLrde@Q=OuFEjnkDgVpwKX3TItoT=T{|@pi
z8voe-7p{MV=vRh+;rbPge{BB?*FQq^E5pBV{ffpvw*Q6eA0hgc;qTyL_!-^dT!4_y
z6Nudy8Gt5<44hV-zZZ8ye=TPRPO-pQcjv$^s)5*v9w5>XI8+)6-3=T>AP^BTu&O)R
z!Idcb9}cf#;N92*==|Sf2C<zI^xe=(^nVMjtiH!qR$^jcATaoQbBuNlyQ2S}ld9Oy
z$lHsEvtwj{fS}UA`;QAG3x~ttpq-wbOHM&f76|QkE|AL)n!Ex~ivJr8D2j&w5&rKq
zxV+q-W#wfdkiW>vLKJ}Xyx(LMqyhZ@LW4qqM+y9i4+{IMED%NinGY^610)!Jmn9QX
ojzByMWd0z*hK@cs00aOS2H?C(B!9yN3YBGK5E9bVKf%cGKW)1FssI20

diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_schema.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_schema.sql
deleted file mode 100644
index 82ecfec53747..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_schema.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
--- Script to create all schema objects; usage:
--- sqlplus <USER>/<PASSWORD> @create_schema.sql <USER> <SITE INITIAL> <PASSWORD> <TABLESPACE>
-
--- Spool file
-spool create_schema_spool.log
-
--- Create all tables 
-@sites_table.sql
-@mdt_head_table.sql
-@mdt_tube_table.sql
-@mdt_rt_table.sql
-@mdt_rt_map_t_table.sql
-@mdt_rt_cheby_table.sql
-@mdt_rt_map_r_table.sql
-@mdt_rt_map_s_table.sql
-
--- Create all sequences
-@sequence_mdt_head.sql
-@sequence_mdt_tube.sql
-@sequence_mdt_rt.sql
-@sequence_mdt_rt_cheby.sql
-@sequence_mdt_rt_map_r.sql
-@sequence_mdt_rt_map_s.sql
-@sequence_mdt_rt_map_t.sql
-
--- Create view
-@view_allTub_rootFile_last10Cal.sql
-@view_allTub_rootFile_last10Cal_ordered.sql
-
--- Create all triggers
-@mdt_head_trigger.sql
-@mdt_tube_trigger.sql
-@mdt_rt_trigger.sql
-@mdt_rt_cheby_trigger.sql
-@mdt_rt_map_r_trigger.sql
-@mdt_rt_map_s_trigger.sql
-@mdt_rt_map_t_trigger.sql
-
-spool off
-exit
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_user.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_user.sql
deleted file mode 100644
index d3a82f0f3575..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/create_user.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
--- USAGE:
--- sqlplus sys/PASSWD @create_user.sql <user_name> <site_name><user_password> <user_default_tablespace> <user_default_temporary_tablespace>
-
---DROP USER &1;
-CREATE USER &1 PROFILE "DEFAULT" IDENTIFIED BY &3 DEFAULT TABLESPACE &4 TEMPORARY TABLESPACE &5 ACCOUNT UNLOCK;
-GRANT UNLIMITED TABLESPACE TO &1;
-GRANT CONNECT TO &1;
-GRANT RESOURCE TO &1;
-GRANT CREATE TABLE TO &1;
-GRANT CREATE SESSION to &1;
-GRANT CREATE VIEW to &1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/do_all b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/do_all
deleted file mode 100755
index 5ecd468e6d8f..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/do_all
+++ /dev/null
@@ -1,25 +0,0 @@
-# PROJECT: ATLAS MDT Calibration DB
-# AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
-# DATE: May 08
-# VERSION v1r1
-#
-# Script to create a new schema, load data into mdt_head, mdt_tube, mdt_rt, mdt_rt_map_t, mdt_rt_map_r and mdt_rt_map_s tables and update all views. 
-# Prerequisites are: a user with enough privileges (see create_user.sql script)
-# Usage: ./do_all <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
-##sqlplus $1/$3 @drop_all_schema_objects.sql $1
-
-sqlplus $1/$3 @create_schema.sql $1 $2 $3 $4
-
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_head.ctl;
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_tube.ctl;
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_rt.ctl;
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_rt_map_t.ctl;
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_rt_map_r.ctl;
-
-sqlldr $1/$3 errors=300 control=load_data/mdt_rt_map_s.ctl;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/drop_all_schema_objects_11.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/drop_all_schema_objects_11.sql
deleted file mode 100644
index 1ff8754f04b4..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/drop_all_schema_objects_11.sql
+++ /dev/null
@@ -1,45 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
--- Script to drop all schema objects; usage:
--- sqlplus <USER>/<PASSWORD> @drop_all_schema_objects.sql <USER> 
-
--- Spool file
-spool drop_spool.log
-
--- Drop views
-DROP VIEW &1..VIEW_ALLTUB_ROOTFILE_LAST10CAL;
-DROP VIEW &1..VIEW_ALLTUB_ROOT_LAST10CAL_ORD;
-
--- Drop all Triggers 
-DROP TRIGGER &1..mdt_head_trigger;
-DROP TRIGGER &1..mdt_tube_trigger;
-DROP TRIGGER &1..mdt_rt_cheby_trigger;
-DROP TRIGGER &1..mdt_rt_map_r_trigger;
-DROP TRIGGER &1..mdt_rt_map_s_trigger;
-DROP TRIGGER &1..mdt_rt_map_t_trigger;
-DROP TRIGGER &1..mdt_rt_trigger;
-
--- Drop all tables 
-DROP TABLE &1..MDT_TUBE;
-DROP TABLE &1..MDT_RT_CHEBY;
-DROP TABLE &1..MDT_RT_MAP_R;
-DROP TABLE &1..MDT_RT_MAP_S;
-DROP TABLE &1..MDT_RT_MAP_T;
-DROP TABLE &1..MDT_RT;
-DROP TABLE &1..MDT_HEAD;
-DROP TABLE &1..SITES;
-
--- Drop all sequences
-DROP SEQUENCE &1..MDT_HEAD_SEQUENCE;
-DROP SEQUENCE &1..MDT_TUBE_SEQUENCE;
-DROP SEQUENCE &1..MDT_RT_SEQUENCE;
-DROP SEQUENCE &1..MDT_RT_CHEBY_SEQUENCE;
-DROP SEQUENCE &1..MDT_RT_MAP_R_SEQUENCE;
-DROP SEQUENCE &1..MDT_RT_MAP_S_SEQUENCE;
-DROP SEQUENCE &1..MDT_RT_MAP_T_SEQUENCE;
-
-spool off
-exit
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.ctl
deleted file mode 100644
index df794bc0ce9e..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.ctl
+++ /dev/null
@@ -1,8 +0,0 @@
-LOAD DATA
-INFILE './load_data/mdt_head.dat'
-BADFILE './load_data/mdt_head.bad'
-DISCARDFILE 'load_data/mdt_head.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_head  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(IMPLEMENTATION,LOWRUN,UPRUN,LOWTIME,UPTIME,LUMINOSITY,ROOTFILE)
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.dat b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.dat
deleted file mode 100644
index b2bb34d1eb0e..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_head.dat
+++ /dev/null
@@ -1,6 +0,0 @@
- P2RomeClassic,20504,20504,20504,20504,1.000000,/storage/data5/calib/P2results/calibration/calib_20504_2
- P2RomeClassic,25928,26462,25928,26462,1.000000,/storage/data5/calib/P2results/calibration/calib_25928_26124_26241_26462_2
- P2RomeClassic,28940,28940,28940,28940,1.000000,/storage/data5/calib/P2results/calibration/calib_28940_2
- P2RomeClassic,33359,33366,33359,33366,1.000000,/storage/data5/calib/P2results/calibration/calib_33359_33363_33366_2
- P2RomeClassic,33601,33623,33601,33623,1.000000,/storage/data5/calib/P2results/calibration/calib_33601_33620_33623_2
- P2RomeClassic,34268,34268,34268,34268,1.000000,/storage/data5/calib/P2results/calibration/calib_34268_2
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.ctl
deleted file mode 100644
index 3cc3d6e0c011..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.ctl
+++ /dev/null
@@ -1,29 +0,0 @@
--- Usage
--- sqlldr provac/provac control=./load_data/mdt_rt.ctl
-
-LOAD DATA
-INFILE './load_data/mdt_rt.dat'
-BADFILE './load_data/mdt_rt.bad'
-DISCARDFILE './load_data/mdt_rt.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_rt  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(MDT_RT_ID,
-REGION_ID,
-HEAD_ID,
-LOWRUN,
-UPRUN,
-HISTOGRAM,
-N_SEGS,
-AVER_ANGLE,
-DELTA_AVER_ANGLE,
-AVER_SPREAD,
-DELTA_AVER_SPREAD,
-CONVERGENCE,
-B_AVER,
-T_AVER,
-HV,
-CURR,
-GAS,
-CALIBFLAG,
-VALIDFLAG)
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.dat b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.dat
deleted file mode 100644
index fd7447d3fb7e..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt.dat
+++ /dev/null
@@ -1,646 +0,0 @@
- 2,34619392,1,20504,20504,rootfiles/rts/Rt_BML_3_-6_20504.dat,118,-0.227781,0.189210,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,90710016,1,20504,20504,rootfiles/rts/Rt_BOS_2_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,51388416,1,20504,20504,rootfiles/rts/Rt_BMS_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,69222400,1,20504,20504,rootfiles/rts/Rt_BOL_3_-4_20504.dat,293,-0.331523,0.167576,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,68173824,1,20504,20504,rootfiles/rts/Rt_BOL_3_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,17833984,1,20504,20504,rootfiles/rts/Rt_BIS_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,0,1,20504,20504,rootfiles/rts/Rt_BOS_2_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,1064960,1,20504,20504,rootfiles/rts/Rt_BIL_3_-6_20504.dat,142,0.265017,0.290052,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,35659776,1,20504,20504,rootfiles/rts/Rt_BML_2_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,22036480,1,20504,20504,rootfiles/rts/Rt_BIS_3_2_20504.dat,319,0.209618,0.119342,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,36716544,1,20504,20504,rootfiles/rts/Rt_BML_3_-2_20504.dat,122,-0.261479,0.248976,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,5259264,1,20504,20504,rootfiles/rts/Rt_BIL_3_2_20504.dat,937,0.191823,0.138280,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,68698112,1,20504,20504,rootfiles/rts/Rt_BOL_3_-5_20504.dat,206,-0.278708,0.143604,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,68165632,1,20504,20504,rootfiles/rts/Rt_BOL_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,4726784,1,20504,20504,rootfiles/rts/Rt_BIL_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,70270976,1,20504,20504,rootfiles/rts/Rt_BOL_3_-2_20504.dat,580,0.196397,0.243206,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,36184064,1,20504,20504,rootfiles/rts/Rt_BML_2_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,38805504,1,20504,20504,rootfiles/rts/Rt_BML_2_2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,2113536,1,20504,20504,rootfiles/rts/Rt_BIL_3_-4_20504.dat,342,-0.241190,0.187820,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,7356416,1,20504,20504,rootfiles/rts/Rt_BIL_3_6_20504.dat,84,0.212129,0.257688,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,74465280,1,20504,20504,rootfiles/rts/Rt_BOL_3_6_20504.dat,64,0.159003,0.218814,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,73416704,1,20504,20504,rootfiles/rts/Rt_BOL_3_4_20504.dat,220,0.159330,0.277903,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,38281216,1,20504,20504,rootfiles/rts/Rt_BML_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,37240832,1,20504,20504,rootfiles/rts/Rt_BML_3_-1_20504.dat,300,-0.103662,0.320874,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,88621056,1,20504,20504,rootfiles/rts/Rt_BOS_3_1_20504.dat,81,0.030734,0.253718,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,87040000,1,20504,20504,rootfiles/rts/Rt_BOS_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,72892416,1,20504,20504,rootfiles/rts/Rt_BOL_3_3_20504.dat,1244,0.223878,0.151798,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,39854080,1,20504,20504,rootfiles/rts/Rt_BML_2_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,86523904,1,20504,20504,rootfiles/rts/Rt_BOS_3_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,0,1,20504,20504,rootfiles/rts/Rt_BIL_2_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,20455424,1,20504,20504,rootfiles/rts/Rt_BIS_2_-1_20504.dat,99,0.241344,0.178894,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,24125440,1,20504,20504,rootfiles/rts/Rt_BIS_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,56639488,1,20504,20504,rootfiles/rts/Rt_BMS_3_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,22552576,1,20504,20504,rootfiles/rts/Rt_BIS_2_3_20504.dat,288,0.155127,0.123683,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,37232640,1,20504,20504,rootfiles/rts/Rt_BML_2_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,51912704,1,20504,20504,rootfiles/rts/Rt_BMS_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,55058432,1,20504,20504,rootfiles/rts/Rt_BMS_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,35143680,1,20504,20504,rootfiles/rts/Rt_BML_3_-5_20504.dat,118,-0.272740,0.293082,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,40386560,1,20504,20504,rootfiles/rts/Rt_BML_3_5_20504.dat,92,0.189155,0.241449,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,52961280,1,20504,20504,rootfiles/rts/Rt_BMS_2_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,73940992,1,20504,20504,rootfiles/rts/Rt_BOL_3_5_20504.dat,1041,0.135446,0.144461,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,35667968,1,20504,20504,rootfiles/rts/Rt_BML_3_-4_20504.dat,238,-0.237644,0.276285,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,0,1,20504,20504,rootfiles/rts/Rt_BIS_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,18358272,1,20504,20504,rootfiles/rts/Rt_BIS_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,90185728,1,20504,20504,rootfiles/rts/Rt_BOS_2_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,6832128,1,20504,20504,rootfiles/rts/Rt_BIL_3_5_20504.dat,142,0.044637,0.170053,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,55590912,1,20504,20504,rootfiles/rts/Rt_BMS_3_2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,17842176,1,20504,20504,rootfiles/rts/Rt_BIS_3_-6_20504.dat,82,0.159975,0.275085,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,20463616,1,20504,20504,rootfiles/rts/Rt_BIS_3_-1_20504.dat,155,0.130361,0.294257,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,19931136,1,20504,20504,rootfiles/rts/Rt_BIS_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,85999616,1,20504,20504,rootfiles/rts/Rt_BOS_3_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,1589248,1,20504,20504,rootfiles/rts/Rt_BIL_3_-5_20504.dat,229,0.190020,0.221670,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,74457088,1,20504,20504,rootfiles/rts/Rt_BOL_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,84951040,1,20504,20504,rootfiles/rts/Rt_BOS_3_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,85467136,1,20504,20504,rootfiles/rts/Rt_BOS_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,88612864,1,20504,20504,rootfiles/rts/Rt_BOS_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,38813696,1,20504,20504,rootfiles/rts/Rt_BML_3_2_20504.dat,2180,0.179243,0.175480,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,3153920,1,20504,20504,rootfiles/rts/Rt_BIL_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,23085056,1,20504,20504,rootfiles/rts/Rt_BIS_3_4_20504.dat,164,0.117045,0.213494,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,21512192,1,20504,20504,rootfiles/rts/Rt_BIS_3_1_20504.dat,384,0.220134,0.154430,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,0,1,20504,20504,rootfiles/rts/Rt_BIS_2_5_20504.dat,84,0.127672,0.171376,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,52436992,1,20504,20504,rootfiles/rts/Rt_BMS_2_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,90193920,1,20504,20504,rootfiles/rts/Rt_BOS_3_4_20504.dat,59,0.119785,0.238949,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,68689920,1,20504,20504,rootfiles/rts/Rt_BOL_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,6299648,1,20504,20504,rootfiles/rts/Rt_BIL_2_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,2637824,1,20504,20504,rootfiles/rts/Rt_BIL_3_-3_20504.dat,366,-0.371319,0.108148,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,5783552,1,20504,20504,rootfiles/rts/Rt_BIL_3_3_20504.dat,804,0.176538,0.168635,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,18890752,1,20504,20504,rootfiles/rts/Rt_BIS_3_-4_20504.dat,124,-0.306717,0.167433,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,89137152,1,20504,20504,rootfiles/rts/Rt_BOS_2_2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,39329792,1,20504,20504,rootfiles/rts/Rt_BML_2_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,69746688,1,20504,20504,rootfiles/rts/Rt_BOL_3_-3_20504.dat,869,-0.323349,0.154508,0.000000,0.000000,0,0,0,0,0,0,0,0
- 73,89669632,1,20504,20504,rootfiles/rts/Rt_BOS_3_3_20504.dat,3559,0.088689,0.307712,0.000000,0.000000,0,0,0,0,0,0,0,0
- 74,19415040,1,20504,20504,rootfiles/rts/Rt_BIS_3_-3_20504.dat,98,-0.190245,0.345576,0.000000,0.000000,0,0,0,0,0,0,0,0
- 75,2629632,1,20504,20504,rootfiles/rts/Rt_BIL_2_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 76,69738496,1,20504,20504,rootfiles/rts/Rt_BOL_2_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 77,40378368,1,20504,20504,rootfiles/rts/Rt_BML_2_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 78,53493760,1,20504,20504,rootfiles/rts/Rt_BMS_3_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 79,85991424,1,20504,20504,rootfiles/rts/Rt_BOS_2_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 80,57155584,1,20504,20504,rootfiles/rts/Rt_BMS_2_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 81,5251072,1,20504,20504,rootfiles/rts/Rt_BIL_2_2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 82,54009856,1,20504,20504,rootfiles/rts/Rt_BMS_2_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 83,22028288,1,20504,20504,rootfiles/rts/Rt_BIS_2_2_20504.dat,430,0.203770,0.126430,0.000000,0.000000,0,0,0,0,0,0,0,0
- 84,40910848,1,20504,20504,rootfiles/rts/Rt_BML_3_6_20504.dat,1045,0.128019,0.145867,0.000000,0.000000,0,0,0,0,0,0,0,0
- 85,70262784,1,20504,20504,rootfiles/rts/Rt_BOL_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 86,72359936,1,20504,20504,rootfiles/rts/Rt_BOL_2_2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 87,39337984,1,20504,20504,rootfiles/rts/Rt_BML_3_3_20504.dat,1308,0.210005,0.161078,0.000000,0.000000,0,0,0,0,0,0,0,0
- 88,19406848,1,20504,20504,rootfiles/rts/Rt_BIS_2_-3_20504.dat,84,-0.347204,0.222270,0.000000,0.000000,0,0,0,0,0,0,0,0
- 89,39862272,1,20504,20504,rootfiles/rts/Rt_BML_3_4_20504.dat,111,0.230372,0.214373,0.000000,0.000000,0,0,0,0,0,0,0,0
- 90,57679872,1,20504,20504,rootfiles/rts/Rt_BMS_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 91,52969472,1,20504,20504,rootfiles/rts/Rt_BMS_3_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 92,4734976,1,20504,20504,rootfiles/rts/Rt_BIL_3_1_20504.dat,694,0.218786,0.147236,0.000000,0.000000,0,0,0,0,0,0,0,0
- 93,7348224,1,20504,20504,rootfiles/rts/Rt_BIL_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 94,0,1,20504,20504,rootfiles/rts/Rt_BMS_3_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 95,73932800,1,20504,20504,rootfiles/rts/Rt_BOL_2_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 96,36192256,1,20504,20504,rootfiles/rts/Rt_BML_3_-3_20504.dat,1316,-0.086411,0.329567,0.000000,0.000000,0,0,0,0,0,0,0,0
- 97,3162112,1,20504,20504,rootfiles/rts/Rt_BIL_3_-2_20504.dat,196,-0.006527,0.341426,0.000000,0.000000,0,0,0,0,0,0,0,0
- 98,91242496,1,20504,20504,rootfiles/rts/Rt_BOS_3_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 99,57163776,1,20504,20504,rootfiles/rts/Rt_BMS_3_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 100,35135488,1,20504,20504,rootfiles/rts/Rt_BML_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 101,23076864,1,20504,20504,rootfiles/rts/Rt_BIS_2_4_20504.dat,165,0.144221,0.233665,0.000000,0.000000,0,0,0,0,0,0,0,0
- 102,89145344,1,20504,20504,rootfiles/rts/Rt_BOS_3_2_20504.dat,93,0.164296,0.232723,0.000000,0.000000,0,0,0,0,0,0,0,0
- 103,51920896,1,20504,20504,rootfiles/rts/Rt_BMS_3_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 104,55066624,1,20504,20504,rootfiles/rts/Rt_BMS_3_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 105,18366464,1,20504,20504,rootfiles/rts/Rt_BIS_3_-5_20504.dat,94,-0.079329,0.243097,0.000000,0.000000,0,0,0,0,0,0,0,0
- 106,57688064,1,20504,20504,rootfiles/rts/Rt_BMS_3_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 107,89661440,1,20504,20504,rootfiles/rts/Rt_BOS_2_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 108,54018048,1,20504,20504,rootfiles/rts/Rt_BMS_3_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 109,3678208,1,20504,20504,rootfiles/rts/Rt_BIL_2_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 110,18882560,1,20504,20504,rootfiles/rts/Rt_BIS_2_-4_20504.dat,112,-0.330558,0.118938,0.000000,0.000000,0,0,0,0,0,0,0,0
- 111,85475328,1,20504,20504,rootfiles/rts/Rt_BOS_3_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 112,36708352,1,20504,20504,rootfiles/rts/Rt_BML_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 113,6307840,1,20504,20504,rootfiles/rts/Rt_BIL_3_4_20504.dat,492,0.181876,0.174587,0.000000,0.000000,0,0,0,0,0,0,0,0
- 114,2105344,1,20504,20504,rootfiles/rts/Rt_BIL_2_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 115,71843840,1,20504,20504,rootfiles/rts/Rt_BOL_3_1_20504.dat,1460,0.153204,0.192748,0.000000,0.000000,0,0,0,0,0,0,0,0
- 116,56107008,1,20504,20504,rootfiles/rts/Rt_BMS_2_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 117,0,1,20504,20504,rootfiles/rts/Rt_BOS_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 118,73408512,1,20504,20504,rootfiles/rts/Rt_BOL_2_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 119,84942848,1,20504,20504,rootfiles/rts/Rt_BOS_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 120,34611200,1,20504,20504,rootfiles/rts/Rt_BML_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 121,90718208,1,20504,20504,rootfiles/rts/Rt_BOS_3_5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 122,38289408,1,20504,20504,rootfiles/rts/Rt_BML_3_1_20504.dat,1488,0.202580,0.155302,0.000000,0.000000,0,0,0,0,0,0,0,0
- 123,70787072,1,20504,20504,rootfiles/rts/Rt_BOL_2_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 124,72884224,1,20504,20504,rootfiles/rts/Rt_BOL_2_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 125,1056768,1,20504,20504,rootfiles/rts/Rt_BIL_2_-6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 126,23609344,1,20504,20504,rootfiles/rts/Rt_BIS_3_5_20504.dat,109,0.032786,0.199474,0.000000,0.000000,0,0,0,0,0,0,0,0
- 127,3686400,1,20504,20504,rootfiles/rts/Rt_BIL_3_-1_20504.dat,192,-0.047572,0.310892,0.000000,0.000000,0,0,0,0,0,0,0,0
- 128,1581056,1,20504,20504,rootfiles/rts/Rt_BIL_2_-5_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 129,24133632,1,20504,20504,rootfiles/rts/Rt_BIS_3_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 130,71835648,1,20504,20504,rootfiles/rts/Rt_BOL_2_1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 131,72368128,1,20504,20504,rootfiles/rts/Rt_BOL_3_2_20504.dat,2363,0.210661,0.135793,0.000000,0.000000,0,0,0,0,0,0,0,0
- 132,22560768,1,20504,20504,rootfiles/rts/Rt_BIS_3_3_20504.dat,365,0.163822,0.138515,0.000000,0.000000,0,0,0,0,0,0,0,0
- 133,53485568,1,20504,20504,rootfiles/rts/Rt_BMS_2_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 134,55582720,1,20504,20504,rootfiles/rts/Rt_BMS_2_2_20504.dat,69,0.177583,0.251885,0.000000,0.000000,0,0,0,0,0,0,0,0
- 135,40902656,1,20504,20504,rootfiles/rts/Rt_BML_2_6_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 136,56115200,1,20504,20504,rootfiles/rts/Rt_BMS_3_3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 137,87048192,1,20504,20504,rootfiles/rts/Rt_BOS_3_-2_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 138,86515712,1,20504,20504,rootfiles/rts/Rt_BOS_2_-3_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 139,70795264,1,20504,20504,rootfiles/rts/Rt_BOL_3_-1_20504.dat,220,-0.270447,0.220873,0.000000,0.000000,0,0,0,0,0,0,0,0
- 140,19939328,1,20504,20504,rootfiles/rts/Rt_BIS_3_-2_20504.dat,85,0.134306,0.200262,0.000000,0.000000,0,0,0,0,0,0,0,0
- 141,52445184,1,20504,20504,rootfiles/rts/Rt_BMS_3_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 142,87572480,1,20504,20504,rootfiles/rts/Rt_BOS_3_-1_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 143,69214208,1,20504,20504,rootfiles/rts/Rt_BOL_2_-4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 144,56631296,1,20504,20504,rootfiles/rts/Rt_BMS_2_4_20504.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 1,68698112,2,25928,26462,rootfiles/rts/Rt_BOL_3_-5_25928_26124_26241_26462.dat,1608,-0.236690,0.296836,0.000000,0.000000,0,0,0,0,0,0,0,0
- 2,2629632,2,25928,26462,rootfiles/rts/Rt_BIL_2_-3_25928_26124_26241_26462.dat,231,0.009284,0.340433,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,69214208,2,25928,26462,rootfiles/rts/Rt_BOL_2_-4_25928_26124_26241_26462.dat,207,-0.022906,0.323274,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,68165632,2,25928,26462,rootfiles/rts/Rt_BOL_2_-6_25928_26124_26241_26462.dat,122,-0.131338,0.301630,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,52445184,2,25928,26462,rootfiles/rts/Rt_BMS_3_-4_25928_26124_26241_26462.dat,1885,-0.003302,0.301830,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,70262784,2,25928,26462,rootfiles/rts/Rt_BOL_2_-2_25928_26124_26241_26462.dat,245,0.056383,0.335945,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,57688064,2,25928,26462,rootfiles/rts/Rt_BMS_3_6_25928_26124_26241_26462.dat,2305,0.085548,0.242994,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,3153920,2,25928,26462,rootfiles/rts/Rt_BIL_2_-2_25928_26124_26241_26462.dat,246,-0.001053,0.336603,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,52961280,2,25928,26462,rootfiles/rts/Rt_BMS_2_-3_25928_26124_26241_26462.dat,1495,-0.006298,0.311347,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,4734976,2,25928,26462,rootfiles/rts/Rt_BIL_3_1_25928_26124_26241_26462.dat,11581,0.200492,0.137226,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,36192256,2,25928,26462,rootfiles/rts/Rt_BML_3_-3_25928_26124_26241_26462.dat,28465,0.032958,0.323116,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,39337984,2,25928,26462,rootfiles/rts/Rt_BML_3_3_25928_26124_26241_26462.dat,39346,0.096301,0.198860,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,7348224,2,25928,26462,rootfiles/rts/Rt_BIL_2_6_25928_26124_26241_26462.dat,295,-0.001500,0.327871,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,70795264,2,25928,26462,rootfiles/rts/Rt_BOL_3_-1_25928_26124_26241_26462.dat,15263,0.133597,0.302382,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,17833984,2,25928,26462,rootfiles/rts/Rt_BIS_2_-6_25928_26124_26241_26462.dat,2972,0.014558,0.309146,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,89137152,2,25928,26462,rootfiles/rts/Rt_BOS_2_2_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,40378368,2,25928,26462,rootfiles/rts/Rt_BML_2_5_25928_26124_26241_26462.dat,192,0.049078,0.258009,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,17842176,2,25928,26462,rootfiles/rts/Rt_BIS_3_-6_25928_26124_26241_26462.dat,3496,0.074828,0.320851,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,36708352,2,25928,26462,rootfiles/rts/Rt_BML_2_-2_25928_26124_26241_26462.dat,178,0.006848,0.339066,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,7356416,2,25928,26462,rootfiles/rts/Rt_BIL_3_6_25928_26124_26241_26462.dat,15298,0.066091,0.164361,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,57163776,2,25928,26462,rootfiles/rts/Rt_BMS_3_5_25928_26124_26241_26462.dat,1377,0.031196,0.279557,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,39329792,2,25928,26462,rootfiles/rts/Rt_BML_2_3_25928_26124_26241_26462.dat,183,0.072206,0.301395,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,56107008,2,25928,26462,rootfiles/rts/Rt_BMS_2_3_25928_26124_26241_26462.dat,2804,0.068719,0.246398,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,0,2,25928,26462,rootfiles/rts/Rt_BOS_2_6_25928_26124_26241_26462.dat,624,0.059505,0.276815,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,0,2,25928,26462,rootfiles/rts/Rt_BMS_3_-6_25928_26124_26241_26462.dat,110,0.012350,0.335675,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,54009856,2,25928,26462,rootfiles/rts/Rt_BMS_2_-1_25928_26124_26241_26462.dat,962,0.074446,0.305761,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,87048192,2,25928,26462,rootfiles/rts/Rt_BOS_3_-2_25928_26124_26241_26462.dat,3030,0.047220,0.275219,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,135350407,2,25928,26462,rootfiles/rts/Rt_BOL_2_4.dat,1000,0.100000,0.200000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,18882560,2,25928,26462,rootfiles/rts/Rt_BIS_2_-4_25928_26124_26241_26462.dat,3805,0.124728,0.297410,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,22036480,2,25928,26462,rootfiles/rts/Rt_BIS_3_2_25928_26124_26241_26462.dat,4709,0.147200,0.199794,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,56631296,2,25928,26462,rootfiles/rts/Rt_BMS_2_4_25928_26124_26241_26462.dat,2924,0.070659,0.229582,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,4726784,2,25928,26462,rootfiles/rts/Rt_BIL_2_1_25928_26124_26241_26462.dat,345,0.090180,0.293570,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,19939328,2,25928,26462,rootfiles/rts/Rt_BIS_3_-2_25928_26124_26241_26462.dat,2041,0.050814,0.291708,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,1056768,2,25928,26462,rootfiles/rts/Rt_BIL_2_-6_25928_26124_26241_26462.dat,202,0.088491,0.328933,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,56115200,2,25928,26462,rootfiles/rts/Rt_BMS_3_3_25928_26124_26241_26462.dat,2236,0.082393,0.255527,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,5259264,2,25928,26462,rootfiles/rts/Rt_BIL_3_2_25928_26124_26241_26462.dat,10577,0.109009,0.228031,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,2105344,2,25928,26462,rootfiles/rts/Rt_BIL_2_-4_25928_26124_26241_26462.dat,391,0.030519,0.313006,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,37240832,2,25928,26462,rootfiles/rts/Rt_BML_3_-1_25928_26124_26241_26462.dat,9197,0.092005,0.319140,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,37232640,2,25928,26462,rootfiles/rts/Rt_BML_2_-1_25928_26124_26241_26462.dat,160,0.031267,0.332988,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,89661440,2,25928,26462,rootfiles/rts/Rt_BOS_2_3_25928_26124_26241_26462.dat,3771,0.065134,0.268147,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,0,2,25928,26462,rootfiles/rts/Rt_BOS_2_-1_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,6307840,2,25928,26462,rootfiles/rts/Rt_BIL_3_4_25928_26124_26241_26462.dat,12124,0.098671,0.160313,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,57155584,2,25928,26462,rootfiles/rts/Rt_BMS_2_5_25928_26124_26241_26462.dat,1272,0.081209,0.243625,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,73416704,2,25928,26462,rootfiles/rts/Rt_BOL_3_4_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,22560768,2,25928,26462,rootfiles/rts/Rt_BIS_3_3_25928_26124_26241_26462.dat,7101,0.137442,0.195075,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,52436992,2,25928,26462,rootfiles/rts/Rt_BMS_2_-4_25928_26124_26241_26462.dat,1634,-0.018665,0.300926,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,72892416,2,25928,26462,rootfiles/rts/Rt_BOL_3_3_25928_26124_26241_26462.dat,31994,0.088677,0.190136,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,85999616,2,25928,26462,rootfiles/rts/Rt_BOS_3_-4_25928_26124_26241_26462.dat,1983,-0.214048,0.225921,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,51388416,2,25928,26462,rootfiles/rts/Rt_BMS_2_-6_25928_26124_26241_26462.dat,207,-0.011049,0.330811,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,51912704,2,25928,26462,rootfiles/rts/Rt_BMS_2_-5_25928_26124_26241_26462.dat,737,-0.136482,0.259341,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,90718208,2,25928,26462,rootfiles/rts/Rt_BOS_3_5_25928_26124_26241_26462.dat,3723,0.116799,0.242083,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,73940992,2,25928,26462,rootfiles/rts/Rt_BOL_3_5_25928_26124_26241_26462.dat,28142,0.118422,0.140996,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,2113536,2,25928,26462,rootfiles/rts/Rt_BIL_3_-4_25928_26124_26241_26462.dat,8229,-0.017019,0.303573,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,85467136,2,25928,26462,rootfiles/rts/Rt_BOS_2_-5_25928_26124_26241_26462.dat,507,-0.122059,0.320976,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,87572480,2,25928,26462,rootfiles/rts/Rt_BOS_3_-1_25928_26124_26241_26462.dat,9169,0.104537,0.342614,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,21512192,2,25928,26462,rootfiles/rts/Rt_BIS_3_1_25928_26124_26241_26462.dat,6741,0.229579,0.118478,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,55582720,2,25928,26462,rootfiles/rts/Rt_BMS_2_2_25928_26124_26241_26462.dat,2509,0.094185,0.252754,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,89669632,2,25928,26462,rootfiles/rts/Rt_BOS_3_3_25928_26124_26241_26462.dat,55800,0.016991,0.209086,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,18366464,2,25928,26462,rootfiles/rts/Rt_BIS_3_-5_25928_26124_26241_26462.dat,2931,0.020342,0.299452,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,40910848,2,25928,26462,rootfiles/rts/Rt_BML_3_6_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,35659776,2,25928,26462,rootfiles/rts/Rt_BML_2_-4_25928_26124_26241_26462.dat,119,0.030425,0.318076,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,88612864,2,25928,26462,rootfiles/rts/Rt_BOS_2_1_25928_26124_26241_26462.dat,3151,-0.067035,0.261609,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,53493760,2,25928,26462,rootfiles/rts/Rt_BMS_3_-2_25928_26124_26241_26462.dat,1318,0.020798,0.306239,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,135354391,2,25928,26462,rootfiles/rts/Rt_BIL_2_5.dat,1000,0.100000,0.200000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,35143680,2,25928,26462,rootfiles/rts/Rt_BML_3_-5_25928_26124_26241_26462.dat,11750,-0.009993,0.309490,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,85991424,2,25928,26462,rootfiles/rts/Rt_BOS_2_-4_25928_26124_26241_26462.dat,1742,-0.260598,0.226559,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,20463616,2,25928,26462,rootfiles/rts/Rt_BIS_3_-1_25928_26124_26241_26462.dat,2088,0.185880,0.301012,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,86523904,2,25928,26462,rootfiles/rts/Rt_BOS_3_-3_25928_26124_26241_26462.dat,3275,-0.049321,0.270436,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,38813696,2,25928,26462,rootfiles/rts/Rt_BML_3_2_25928_26124_26241_26462.dat,32324,0.121200,0.209791,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,3678208,2,25928,26462,rootfiles/rts/Rt_BIL_2_-1_25928_26124_26241_26462.dat,181,0.025552,0.329224,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,19406848,2,25928,26462,rootfiles/rts/Rt_BIS_2_-3_25928_26124_26241_26462.dat,2634,-0.044423,0.268429,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,68689920,2,25928,26462,rootfiles/rts/Rt_BOL_2_-5_25928_26124_26241_26462.dat,201,-0.060240,0.351893,0.000000,0.000000,0,0,0,0,0,0,0,0
- 73,55066624,2,25928,26462,rootfiles/rts/Rt_BMS_3_1_25928_26124_26241_26462.dat,2022,0.028743,0.288183,0.000000,0.000000,0,0,0,0,0,0,0,0
- 74,22028288,2,25928,26462,rootfiles/rts/Rt_BIS_2_2_25928_26124_26241_26462.dat,7235,0.178535,0.170463,0.000000,0.000000,0,0,0,0,0,0,0,0
- 75,0,2,25928,26462,rootfiles/rts/Rt_BIS_2_5_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 76,68173824,2,25928,26462,rootfiles/rts/Rt_BOL_3_-6_25928_26124_26241_26462.dat,279,-0.049128,0.303274,0.000000,0.000000,0,0,0,0,0,0,0,0
- 77,36716544,2,25928,26462,rootfiles/rts/Rt_BML_3_-2_25928_26124_26241_26462.dat,19289,0.054390,0.325723,0.000000,0.000000,0,0,0,0,0,0,0,0
- 78,85475328,2,25928,26462,rootfiles/rts/Rt_BOS_3_-5_25928_26124_26241_26462.dat,706,-0.140442,0.325640,0.000000,0.000000,0,0,0,0,0,0,0,0
- 79,52969472,2,25928,26462,rootfiles/rts/Rt_BMS_3_-3_25928_26124_26241_26462.dat,2061,0.003461,0.301229,0.000000,0.000000,0,0,0,0,0,0,0,0
- 80,56639488,2,25928,26462,rootfiles/rts/Rt_BMS_3_4_25928_26124_26241_26462.dat,2192,0.052081,0.272484,0.000000,0.000000,0,0,0,0,0,0,0,0
- 81,73932800,2,25928,26462,rootfiles/rts/Rt_BOL_2_5_25928_26124_26241_26462.dat,284,0.047483,0.267553,0.000000,0.000000,0,0,0,0,0,0,0,0
- 82,72359936,2,25928,26462,rootfiles/rts/Rt_BOL_2_2_25928_26124_26241_26462.dat,240,0.036563,0.324327,0.000000,0.000000,0,0,0,0,0,0,0,0
- 83,84942848,2,25928,26462,rootfiles/rts/Rt_BOS_2_-6_25928_26124_26241_26462.dat,1186,-0.104785,0.290085,0.000000,0.000000,0,0,0,0,0,0,0,0
- 84,1589248,2,25928,26462,rootfiles/rts/Rt_BIL_3_-5_25928_26124_26241_26462.dat,7121,-0.016243,0.310741,0.000000,0.000000,0,0,0,0,0,0,0,0
- 85,135356559,2,25928,26462,rootfiles/rts/Rt_BIL_3_5.dat,1000,0.100000,0.200000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 86,39854080,2,25928,26462,rootfiles/rts/Rt_BML_2_4_25928_26124_26241_26462.dat,153,0.083142,0.281153,0.000000,0.000000,0,0,0,0,0,0,0,0
- 87,84951040,2,25928,26462,rootfiles/rts/Rt_BOS_3_-6_25928_26124_26241_26462.dat,263,0.030978,0.309291,0.000000,0.000000,0,0,0,0,0,0,0,0
- 88,35135488,2,25928,26462,rootfiles/rts/Rt_BML_2_-5_25928_26124_26241_26462.dat,116,-0.022630,0.325017,0.000000,0.000000,0,0,0,0,0,0,0,0
- 89,23085056,2,25928,26462,rootfiles/rts/Rt_BIS_3_4_25928_26124_26241_26462.dat,7856,0.126369,0.158197,0.000000,0.000000,0,0,0,0,0,0,0,0
- 90,69746688,2,25928,26462,rootfiles/rts/Rt_BOL_3_-3_25928_26124_26241_26462.dat,23113,0.038508,0.320821,0.000000,0.000000,0,0,0,0,0,0,0,0
- 91,36184064,2,25928,26462,rootfiles/rts/Rt_BML_2_-3_25928_26124_26241_26462.dat,175,0.052054,0.343474,0.000000,0.000000,0,0,0,0,0,0,0,0
- 92,54018048,2,25928,26462,rootfiles/rts/Rt_BMS_3_-1_25928_26124_26241_26462.dat,1524,0.177489,0.265840,0.000000,0.000000,0,0,0,0,0,0,0,0
- 93,72884224,2,25928,26462,rootfiles/rts/Rt_BOL_2_3_25928_26124_26241_26462.dat,218,0.047151,0.288415,0.000000,0.000000,0,0,0,0,0,0,0,0
- 94,38289408,2,25928,26462,rootfiles/rts/Rt_BML_3_1_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 95,5783552,2,25928,26462,rootfiles/rts/Rt_BIL_3_3_25928_26124_26241_26462.dat,16112,0.133021,0.170216,0.000000,0.000000,0,0,0,0,0,0,0,0
- 96,0,2,25928,26462,rootfiles/rts/Rt_BIL_2_3_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 97,22552576,2,25928,26462,rootfiles/rts/Rt_BIS_2_3_25928_26124_26241_26462.dat,6193,0.116771,0.194382,0.000000,0.000000,0,0,0,0,0,0,0,0
- 98,20455424,2,25928,26462,rootfiles/rts/Rt_BIS_2_-1_25928_26124_26241_26462.dat,3055,0.172282,0.308649,0.000000,0.000000,0,0,0,0,0,0,0,0
- 99,74465280,2,25928,26462,rootfiles/rts/Rt_BOL_3_6_25928_26124_26241_26462.dat,813,0.055475,0.216971,0.000000,0.000000,0,0,0,0,0,0,0,0
- 100,89145344,2,25928,26462,rootfiles/rts/Rt_BOS_3_2_25928_26124_26241_26462.dat,3322,0.025955,0.276480,0.000000,0.000000,0,0,0,0,0,0,0,0
- 101,69222400,2,25928,26462,rootfiles/rts/Rt_BOL_3_-4_25928_26124_26241_26462.dat,17014,-0.214788,0.229417,0.000000,0.000000,0,0,0,0,0,0,0,0
- 102,38281216,2,25928,26462,rootfiles/rts/Rt_BML_2_1_25928_26124_26241_26462.dat,183,0.048843,0.355872,0.000000,0.000000,0,0,0,0,0,0,0,0
- 103,40902656,2,25928,26462,rootfiles/rts/Rt_BML_2_6_25928_26124_26241_26462.dat,200,0.066219,0.313929,0.000000,0.000000,0,0,0,0,0,0,0,0
- 104,70787072,2,25928,26462,rootfiles/rts/Rt_BOL_2_-1_25928_26124_26241_26462.dat,187,0.013292,0.340168,0.000000,0.000000,0,0,0,0,0,0,0,0
- 105,55590912,2,25928,26462,rootfiles/rts/Rt_BMS_3_2_25928_26124_26241_26462.dat,2216,0.082404,0.266937,0.000000,0.000000,0,0,0,0,0,0,0,0
- 106,88621056,2,25928,26462,rootfiles/rts/Rt_BOS_3_1_25928_26124_26241_26462.dat,2685,-0.056775,0.258116,0.000000,0.000000,0,0,0,0,0,0,0,0
- 107,6299648,2,25928,26462,rootfiles/rts/Rt_BIL_2_4_25928_26124_26241_26462.dat,523,0.022899,0.283829,0.000000,0.000000,0,0,0,0,0,0,0,0
- 108,71835648,2,25928,26462,rootfiles/rts/Rt_BOL_2_1_25928_26124_26241_26462.dat,265,-0.005243,0.328620,0.000000,0.000000,0,0,0,0,0,0,0,0
- 109,86515712,2,25928,26462,rootfiles/rts/Rt_BOS_2_-3_25928_26124_26241_26462.dat,2148,-0.063784,0.275850,0.000000,0.000000,0,0,0,0,0,0,0,0
- 110,91242496,2,25928,26462,rootfiles/rts/Rt_BOS_3_6_25928_26124_26241_26462.dat,543,0.036741,0.258958,0.000000,0.000000,0,0,0,0,0,0,0,0
- 111,90193920,2,25928,26462,rootfiles/rts/Rt_BOS_3_4_25928_26124_26241_26462.dat,3378,0.042894,0.267959,0.000000,0.000000,0,0,0,0,0,0,0,0
- 112,72368128,2,25928,26462,rootfiles/rts/Rt_BOL_3_2_25928_26124_26241_26462.dat,52036,0.117611,0.186127,0.000000,0.000000,0,0,0,0,0,0,0,0
- 113,2637824,2,25928,26462,rootfiles/rts/Rt_BIL_3_-3_25928_26124_26241_26462.dat,8178,-0.016297,0.305361,0.000000,0.000000,0,0,0,0,0,0,0,0
- 114,51920896,2,25928,26462,rootfiles/rts/Rt_BMS_3_-5_25928_26124_26241_26462.dat,795,-0.125617,0.274490,0.000000,0.000000,0,0,0,0,0,0,0,0
- 115,40386560,2,25928,26462,rootfiles/rts/Rt_BML_3_5_25928_26124_26241_26462.dat,17481,0.064562,0.185298,0.000000,0.000000,0,0,0,0,0,0,0,0
- 116,90710016,2,25928,26462,rootfiles/rts/Rt_BOS_2_5_25928_26124_26241_26462.dat,1506,0.208548,0.234750,0.000000,0.000000,0,0,0,0,0,0,0,0
- 117,24125440,2,25928,26462,rootfiles/rts/Rt_BIS_2_6_25928_26124_26241_26462.dat,7818,0.090155,0.179069,0.000000,0.000000,0,0,0,0,0,0,0,0
- 118,87040000,2,25928,26462,rootfiles/rts/Rt_BOS_2_-2_25928_26124_26241_26462.dat,3265,-0.004884,0.286174,0.000000,0.000000,0,0,0,0,0,0,0,0
- 119,69738496,2,25928,26462,rootfiles/rts/Rt_BOL_2_-3_25928_26124_26241_26462.dat,200,0.010018,0.327267,0.000000,0.000000,0,0,0,0,0,0,0,0
- 120,3686400,2,25928,26462,rootfiles/rts/Rt_BIL_3_-1_25928_26124_26241_26462.dat,3972,-0.021451,0.311629,0.000000,0.000000,0,0,0,0,0,0,0,0
- 121,53485568,2,25928,26462,rootfiles/rts/Rt_BMS_2_-2_25928_26124_26241_26462.dat,1925,0.015524,0.290830,0.000000,0.000000,0,0,0,0,0,0,0,0
- 122,5251072,2,25928,26462,rootfiles/rts/Rt_BIL_2_2_25928_26124_26241_26462.dat,414,0.022544,0.318279,0.000000,0.000000,0,0,0,0,0,0,0,0
- 123,19931136,2,25928,26462,rootfiles/rts/Rt_BIS_2_-2_25928_26124_26241_26462.dat,1991,-0.040654,0.320424,0.000000,0.000000,0,0,0,0,0,0,0,0
- 124,34619392,2,25928,26462,rootfiles/rts/Rt_BML_3_-6_25928_26124_26241_26462.dat,350,0.012047,0.324517,0.000000,0.000000,0,0,0,0,0,0,0,0
- 125,1064960,2,25928,26462,rootfiles/rts/Rt_BIL_3_-6_25928_26124_26241_26462.dat,9184,0.070031,0.284469,0.000000,0.000000,0,0,0,0,0,0,0,0
- 126,24133632,2,25928,26462,rootfiles/rts/Rt_BIS_3_6_25928_26124_26241_26462.dat,6797,0.103147,0.170296,0.000000,0.000000,0,0,0,0,0,0,0,0
- 127,71843840,2,25928,26462,rootfiles/rts/Rt_BOL_3_1_25928_26124_26241_26462.dat,30747,0.105550,0.232143,0.000000,0.000000,0,0,0,0,0,0,0,0
- 128,57679872,2,25928,26462,rootfiles/rts/Rt_BMS_2_6_25928_26124_26241_26462.dat,1918,0.090268,0.234272,0.000000,0.000000,0,0,0,0,0,0,0,0
- 129,74457088,2,25928,26462,rootfiles/rts/Rt_BOL_2_6_25928_26124_26241_26462.dat,181,0.080346,0.283459,0.000000,0.000000,0,0,0,0,0,0,0,0
- 130,90185728,2,25928,26462,rootfiles/rts/Rt_BOS_2_4_25928_26124_26241_26462.dat,74766,0.177709,0.101242,0.000000,0.000000,0,0,0,0,0,0,0,0
- 131,34611200,2,25928,26462,rootfiles/rts/Rt_BML_2_-6_25928_26124_26241_26462.dat,171,-0.039703,0.322791,0.000000,0.000000,0,0,0,0,0,0,0,0
- 132,23076864,2,25928,26462,rootfiles/rts/Rt_BIS_2_4_25928_26124_26241_26462.dat,8788,0.149142,0.162017,0.000000,0.000000,0,0,0,0,0,0,0,0
- 133,18358272,2,25928,26462,rootfiles/rts/Rt_BIS_2_-5_25928_26124_26241_26462.dat,3276,0.045633,0.335633,0.000000,0.000000,0,0,0,0,0,0,0,0
- 134,38805504,2,25928,26462,rootfiles/rts/Rt_BML_2_2_25928_26124_26241_26462.dat,172,0.066817,0.320505,0.000000,0.000000,0,0,0,0,0,0,0,0
- 135,0,2,25928,26462,rootfiles/rts/Rt_BIS_2_1_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 136,3162112,2,25928,26462,rootfiles/rts/Rt_BIL_3_-2_25928_26124_26241_26462.dat,12565,0.050523,0.316009,0.000000,0.000000,0,0,0,0,0,0,0,0
- 137,55058432,2,25928,26462,rootfiles/rts/Rt_BMS_2_1_25928_26124_26241_26462.dat,2016,0.052420,0.273116,0.000000,0.000000,0,0,0,0,0,0,0,0
- 138,1581056,2,25928,26462,rootfiles/rts/Rt_BIL_2_-5_25928_26124_26241_26462.dat,195,0.081282,0.318854,0.000000,0.000000,0,0,0,0,0,0,0,0
- 139,39862272,2,25928,26462,rootfiles/rts/Rt_BML_3_4_25928_26124_26241_26462.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 140,19415040,2,25928,26462,rootfiles/rts/Rt_BIS_3_-3_25928_26124_26241_26462.dat,2755,0.000953,0.323567,0.000000,0.000000,0,0,0,0,0,0,0,0
- 141,70270976,2,25928,26462,rootfiles/rts/Rt_BOL_3_-2_25928_26124_26241_26462.dat,17755,0.090498,0.312946,0.000000,0.000000,0,0,0,0,0,0,0,0
- 142,35667968,2,25928,26462,rootfiles/rts/Rt_BML_3_-4_25928_26124_26241_26462.dat,28975,0.019116,0.314489,0.000000,0.000000,0,0,0,0,0,0,0,0
- 143,18890752,2,25928,26462,rootfiles/rts/Rt_BIS_3_-4_25928_26124_26241_26462.dat,3143,-0.008665,0.323777,0.000000,0.000000,0,0,0,0,0,0,0,0
- 1,70795264,3,28940,28940,rootfiles/rts/Rt_BOL_3_-1_28940.dat,3726,0.110765,0.263820,0.000000,0.000000,0,0,0,0,0,0,0,0
- 2,5259264,3,28940,28940,rootfiles/rts/Rt_BIL_3_2_28940.dat,5173,0.145785,0.163217,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,69746688,3,28940,28940,rootfiles/rts/Rt_BOL_3_-3_28940.dat,3116,0.002859,0.315121,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,3686400,3,28940,28940,rootfiles/rts/Rt_BIL_3_-1_28940.dat,1006,0.023515,0.288452,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,84951040,3,28940,28940,rootfiles/rts/Rt_BOS_3_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,73940992,3,28940,28940,rootfiles/rts/Rt_BOL_3_5_28940.dat,26121,0.082619,0.105010,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,0,3,28940,28940,rootfiles/rts/Rt_BOS_2_-1_28940.dat,519,0.029453,0.204126,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,1056768,3,28940,28940,rootfiles/rts/Rt_BIL_2_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,2113536,3,28940,28940,rootfiles/rts/Rt_BIL_3_-4_28940.dat,1772,0.104647,0.279939,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,57679872,3,28940,28940,rootfiles/rts/Rt_BMS_2_6_28940.dat,649,0.078559,0.177563,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,18358272,3,28940,28940,rootfiles/rts/Rt_BIS_2_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,38805504,3,28940,28940,rootfiles/rts/Rt_BML_2_2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,23076864,3,28940,28940,rootfiles/rts/Rt_BIS_2_4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,39329792,3,28940,28940,rootfiles/rts/Rt_BML_2_3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,3162112,3,28940,28940,rootfiles/rts/Rt_BIL_3_-2_28940.dat,1138,0.038241,0.281307,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,87040000,3,28940,28940,rootfiles/rts/Rt_BOS_2_-2_28940.dat,415,-0.071990,0.238561,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,3153920,3,28940,28940,rootfiles/rts/Rt_BIL_2_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,73416704,3,28940,28940,rootfiles/rts/Rt_BOL_3_4_28940.dat,38871,0.062364,0.123066,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,54009856,3,28940,28940,rootfiles/rts/Rt_BMS_2_-1_28940.dat,452,0.025552,0.185579,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,38813696,3,28940,28940,rootfiles/rts/Rt_BML_3_2_28940.dat,10743,0.145949,0.151497,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,89661440,3,28940,28940,rootfiles/rts/Rt_BOS_2_3_28940.dat,887,0.093548,0.207701,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,22560768,3,28940,28940,rootfiles/rts/Rt_BIS_3_3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,4726784,3,28940,28940,rootfiles/rts/Rt_BIL_2_1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,6832128,3,28940,28940,rootfiles/rts/Rt_BIL_3_5_28940.dat,8246,0.093813,0.148626,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,89145344,3,28940,28940,rootfiles/rts/Rt_BOS_3_2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,39854080,3,28940,28940,rootfiles/rts/Rt_BML_2_4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,1581056,3,28940,28940,rootfiles/rts/Rt_BIL_2_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,5251072,3,28940,28940,rootfiles/rts/Rt_BIL_2_2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,52445184,3,28940,28940,rootfiles/rts/Rt_BMS_3_-4_28940.dat,193,0.030189,0.259516,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,68165632,3,28940,28940,rootfiles/rts/Rt_BOL_2_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,85475328,3,28940,28940,rootfiles/rts/Rt_BOS_3_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,53485568,3,28940,28940,rootfiles/rts/Rt_BMS_2_-2_28940.dat,372,-0.041107,0.251013,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,18882560,3,28940,28940,rootfiles/rts/Rt_BIS_2_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,17842176,3,28940,28940,rootfiles/rts/Rt_BIS_3_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,85999616,3,28940,28940,rootfiles/rts/Rt_BOS_3_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,72892416,3,28940,28940,rootfiles/rts/Rt_BOL_3_3_28940.dat,25225,0.097027,0.129544,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,0,3,28940,28940,rootfiles/rts/Rt_BIS_2_1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,72884224,3,28940,28940,rootfiles/rts/Rt_BOL_2_3_28940.dat,238,0.093540,0.236935,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,69214208,3,28940,28940,rootfiles/rts/Rt_BOL_2_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,18890752,3,28940,28940,rootfiles/rts/Rt_BIS_3_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,24133632,3,28940,28940,rootfiles/rts/Rt_BIS_3_6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,89669632,3,28940,28940,rootfiles/rts/Rt_BOS_3_3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,19939328,3,28940,28940,rootfiles/rts/Rt_BIS_3_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,39862272,3,28940,28940,rootfiles/rts/Rt_BML_3_4_28940.dat,16922,0.081170,0.135408,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,36184064,3,28940,28940,rootfiles/rts/Rt_BML_2_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,86523904,3,28940,28940,rootfiles/rts/Rt_BOS_3_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,70262784,3,28940,28940,rootfiles/rts/Rt_BOL_2_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,70270976,3,28940,28940,rootfiles/rts/Rt_BOL_3_-2_28940.dat,3700,0.011159,0.304616,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,57163776,3,28940,28940,rootfiles/rts/Rt_BMS_3_5_28940.dat,498,0.054593,0.207116,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,85467136,3,28940,28940,rootfiles/rts/Rt_BOS_2_-5_28940.dat,234,-0.128910,0.264132,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,22028288,3,28940,28940,rootfiles/rts/Rt_BIS_2_2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,55066624,3,28940,28940,rootfiles/rts/Rt_BMS_3_1_28940.dat,366,0.093480,0.247562,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,55582720,3,28940,28940,rootfiles/rts/Rt_BMS_2_2_28940.dat,579,0.136759,0.215365,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,90718208,3,28940,28940,rootfiles/rts/Rt_BOS_3_5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,36708352,3,28940,28940,rootfiles/rts/Rt_BML_2_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,40378368,3,28940,28940,rootfiles/rts/Rt_BML_2_5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,89137152,3,28940,28940,rootfiles/rts/Rt_BOS_2_2_28940.dat,755,0.099890,0.214646,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,74465280,3,28940,28940,rootfiles/rts/Rt_BOL_3_6_28940.dat,512,0.019127,0.203315,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,35659776,3,28940,28940,rootfiles/rts/Rt_BML_2_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,2629632,3,28940,28940,rootfiles/rts/Rt_BIL_2_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,69738496,3,28940,28940,rootfiles/rts/Rt_BOL_2_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,7348224,3,28940,28940,rootfiles/rts/Rt_BIL_2_6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,40910848,3,28940,28940,rootfiles/rts/Rt_BML_3_6_28940.dat,41025,0.055353,0.116418,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,24125440,3,28940,28940,rootfiles/rts/Rt_BIS_2_6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,90185728,3,28940,28940,rootfiles/rts/Rt_BOS_2_4_28940.dat,756,0.060807,0.183124,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,18366464,3,28940,28940,rootfiles/rts/Rt_BIS_3_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,21512192,3,28940,28940,rootfiles/rts/Rt_BIS_3_1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,54018048,3,28940,28940,rootfiles/rts/Rt_BMS_3_-1_28940.dat,669,0.129417,0.247063,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,34611200,3,28940,28940,rootfiles/rts/Rt_BML_2_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,90710016,3,28940,28940,rootfiles/rts/Rt_BOS_2_5_28940.dat,1657,0.039839,0.241598,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,39337984,3,28940,28940,rootfiles/rts/Rt_BML_3_3_28940.dat,31315,0.105337,0.134748,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,4734976,3,28940,28940,rootfiles/rts/Rt_BIL_3_1_28940.dat,5237,0.195731,0.107946,0.000000,0.000000,0,0,0,0,0,0,0,0
- 73,40386560,3,28940,28940,rootfiles/rts/Rt_BML_3_5_28940.dat,17842,0.074393,0.128672,0.000000,0.000000,0,0,0,0,0,0,0,0
- 74,0,3,28940,28940,rootfiles/rts/Rt_BIL_2_3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 75,55058432,3,28940,28940,rootfiles/rts/Rt_BMS_2_1_28940.dat,547,0.101962,0.233894,0.000000,0.000000,0,0,0,0,0,0,0,0
- 76,84942848,3,28940,28940,rootfiles/rts/Rt_BOS_2_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 77,71843840,3,28940,28940,rootfiles/rts/Rt_BOL_3_1_28940.dat,12290,0.165289,0.152750,0.000000,0.000000,0,0,0,0,0,0,0,0
- 78,23609344,3,28940,28940,rootfiles/rts/Rt_BIS_3_5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 79,34619392,3,28940,28940,rootfiles/rts/Rt_BML_3_-6_28940.dat,8307,-0.093480,0.238253,0.000000,0.000000,0,0,0,0,0,0,0,0
- 80,5783552,3,28940,28940,rootfiles/rts/Rt_BIL_3_3_28940.dat,4621,0.164401,0.164847,0.000000,0.000000,0,0,0,0,0,0,0,0
- 81,36192256,3,28940,28940,rootfiles/rts/Rt_BML_3_-3_28940.dat,3939,0.057295,0.307353,0.000000,0.000000,0,0,0,0,0,0,0,0
- 82,0,3,28940,28940,rootfiles/rts/Rt_BIL_2_5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 83,88621056,3,28940,28940,rootfiles/rts/Rt_BOS_3_1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 84,87048192,3,28940,28940,rootfiles/rts/Rt_BOS_3_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 85,56639488,3,28940,28940,rootfiles/rts/Rt_BMS_3_4_28940.dat,790,0.081083,0.210633,0.000000,0.000000,0,0,0,0,0,0,0,0
- 86,20455424,3,28940,28940,rootfiles/rts/Rt_BIS_2_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 87,22036480,3,28940,28940,rootfiles/rts/Rt_BIS_3_2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 88,52436992,3,28940,28940,rootfiles/rts/Rt_BMS_2_-4_28940.dat,268,0.029515,0.283335,0.000000,0.000000,0,0,0,0,0,0,0,0
- 89,87572480,3,28940,28940,rootfiles/rts/Rt_BOS_3_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 90,51920896,3,28940,28940,rootfiles/rts/Rt_BMS_3_-5_28940.dat,216,-0.015024,0.275560,0.000000,0.000000,0,0,0,0,0,0,0,0
- 91,90193920,3,28940,28940,rootfiles/rts/Rt_BOS_3_4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 92,74457088,3,28940,28940,rootfiles/rts/Rt_BOL_2_6_28940.dat,127,-0.012042,0.272040,0.000000,0.000000,0,0,0,0,0,0,0,0
- 93,52961280,3,28940,28940,rootfiles/rts/Rt_BMS_2_-3_28940.dat,213,-0.028956,0.267928,0.000000,0.000000,0,0,0,0,0,0,0,0
- 94,6307840,3,28940,28940,rootfiles/rts/Rt_BIL_3_4_28940.dat,7227,0.113361,0.122153,0.000000,0.000000,0,0,0,0,0,0,0,0
- 95,0,3,28940,28940,rootfiles/rts/Rt_BMS_3_-6_28940.dat,242,-0.034659,0.302555,0.000000,0.000000,0,0,0,0,0,0,0,0
- 96,3678208,3,28940,28940,rootfiles/rts/Rt_BIL_2_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 97,70787072,3,28940,28940,rootfiles/rts/Rt_BOL_2_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 98,88612864,3,28940,28940,rootfiles/rts/Rt_BOS_2_1_28940.dat,527,0.060463,0.234167,0.000000,0.000000,0,0,0,0,0,0,0,0
- 99,52969472,3,28940,28940,rootfiles/rts/Rt_BMS_3_-3_28940.dat,295,0.037743,0.273807,0.000000,0.000000,0,0,0,0,0,0,0,0
- 100,1064960,3,28940,28940,rootfiles/rts/Rt_BIL_3_-6_28940.dat,1907,-0.103457,0.294165,0.000000,0.000000,0,0,0,0,0,0,0,0
- 101,86515712,3,28940,28940,rootfiles/rts/Rt_BOS_2_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 102,51912704,3,28940,28940,rootfiles/rts/Rt_BMS_2_-5_28940.dat,222,-0.077127,0.256249,0.000000,0.000000,0,0,0,0,0,0,0,0
- 103,73408512,3,28940,28940,rootfiles/rts/Rt_BOL_2_4_28940.dat,311,0.083046,0.229976,0.000000,0.000000,0,0,0,0,0,0,0,0
- 104,38289408,3,28940,28940,rootfiles/rts/Rt_BML_3_1_28940.dat,12264,0.165940,0.175393,0.000000,0.000000,0,0,0,0,0,0,0,0
- 105,57688064,3,28940,28940,rootfiles/rts/Rt_BMS_3_6_28940.dat,786,0.077818,0.179260,0.000000,0.000000,0,0,0,0,0,0,0,0
- 106,35143680,3,28940,28940,rootfiles/rts/Rt_BML_3_-5_28940.dat,4382,-0.038095,0.291936,0.000000,0.000000,0,0,0,0,0,0,0,0
- 107,35135488,3,28940,28940,rootfiles/rts/Rt_BML_2_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 108,37240832,3,28940,28940,rootfiles/rts/Rt_BML_3_-1_28940.dat,2481,0.103515,0.257921,0.000000,0.000000,0,0,0,0,0,0,0,0
- 109,19406848,3,28940,28940,rootfiles/rts/Rt_BIS_2_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 110,0,3,28940,28940,rootfiles/rts/Rt_BIS_2_5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 111,57155584,3,28940,28940,rootfiles/rts/Rt_BMS_2_5_28940.dat,496,0.083241,0.195460,0.000000,0.000000,0,0,0,0,0,0,0,0
- 112,6299648,3,28940,28940,rootfiles/rts/Rt_BIL_2_4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 113,55590912,3,28940,28940,rootfiles/rts/Rt_BMS_3_2_28940.dat,328,0.122640,0.215399,0.000000,0.000000,0,0,0,0,0,0,0,0
- 114,56631296,3,28940,28940,rootfiles/rts/Rt_BMS_2_4_28940.dat,477,0.105994,0.212558,0.000000,0.000000,0,0,0,0,0,0,0,0
- 115,73932800,3,28940,28940,rootfiles/rts/Rt_BOL_2_5_28940.dat,307,0.082414,0.215228,0.000000,0.000000,0,0,0,0,0,0,0,0
- 116,72368128,3,28940,28940,rootfiles/rts/Rt_BOL_3_2_28940.dat,24938,0.105183,0.143219,0.000000,0.000000,0,0,0,0,0,0,0,0
- 117,1589248,3,28940,28940,rootfiles/rts/Rt_BIL_3_-5_28940.dat,1130,0.159277,0.259719,0.000000,0.000000,0,0,0,0,0,0,0,0
- 118,7356416,3,28940,28940,rootfiles/rts/Rt_BIL_3_6_28940.dat,9510,0.084359,0.138516,0.000000,0.000000,0,0,0,0,0,0,0,0
- 119,68173824,3,28940,28940,rootfiles/rts/Rt_BOL_3_-6_28940.dat,307,-0.104200,0.225572,0.000000,0.000000,0,0,0,0,0,0,0,0
- 120,36716544,3,28940,28940,rootfiles/rts/Rt_BML_3_-2_28940.dat,4219,0.069325,0.289731,0.000000,0.000000,0,0,0,0,0,0,0,0
- 121,85991424,3,28940,28940,rootfiles/rts/Rt_BOS_2_-4_28940.dat,319,-0.045862,0.243784,0.000000,0.000000,0,0,0,0,0,0,0,0
- 122,2637824,3,28940,28940,rootfiles/rts/Rt_BIL_3_-3_28940.dat,1917,0.052521,0.276508,0.000000,0.000000,0,0,0,0,0,0,0,0
- 123,71835648,3,28940,28940,rootfiles/rts/Rt_BOL_2_1_28940.dat,186,0.114911,0.258996,0.000000,0.000000,0,0,0,0,0,0,0,0
- 124,0,3,28940,28940,rootfiles/rts/Rt_BOS_2_6_28940.dat,274,0.048694,0.210463,0.000000,0.000000,0,0,0,0,0,0,0,0
- 125,91242496,3,28940,28940,rootfiles/rts/Rt_BOS_3_6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 126,68689920,3,28940,28940,rootfiles/rts/Rt_BOL_2_-5_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 127,35667968,3,28940,28940,rootfiles/rts/Rt_BML_3_-4_28940.dat,2334,0.014829,0.301649,0.000000,0.000000,0,0,0,0,0,0,0,0
- 128,72359936,3,28940,28940,rootfiles/rts/Rt_BOL_2_2_28940.dat,220,0.138537,0.256717,0.000000,0.000000,0,0,0,0,0,0,0,0
- 129,38281216,3,28940,28940,rootfiles/rts/Rt_BML_2_1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 130,22552576,3,28940,28940,rootfiles/rts/Rt_BIS_2_3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 131,69222400,3,28940,28940,rootfiles/rts/Rt_BOL_3_-4_28940.dat,5852,-0.033197,0.275804,0.000000,0.000000,0,0,0,0,0,0,0,0
- 132,56107008,3,28940,28940,rootfiles/rts/Rt_BMS_2_3_28940.dat,773,0.112242,0.209552,0.000000,0.000000,0,0,0,0,0,0,0,0
- 133,17833984,3,28940,28940,rootfiles/rts/Rt_BIS_2_-6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 134,19931136,3,28940,28940,rootfiles/rts/Rt_BIS_2_-2_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 135,56115200,3,28940,28940,rootfiles/rts/Rt_BMS_3_3_28940.dat,672,0.088281,0.213047,0.000000,0.000000,0,0,0,0,0,0,0,0
- 136,51388416,3,28940,28940,rootfiles/rts/Rt_BMS_2_-6_28940.dat,287,-0.019467,0.269192,0.000000,0.000000,0,0,0,0,0,0,0,0
- 137,2105344,3,28940,28940,rootfiles/rts/Rt_BIL_2_-4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 138,23085056,3,28940,28940,rootfiles/rts/Rt_BIS_3_4_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 139,19415040,3,28940,28940,rootfiles/rts/Rt_BIS_3_-3_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 140,68698112,3,28940,28940,rootfiles/rts/Rt_BOL_3_-5_28940.dat,6479,-0.210386,0.118957,0.000000,0.000000,0,0,0,0,0,0,0,0
- 141,20463616,3,28940,28940,rootfiles/rts/Rt_BIS_3_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 142,53493760,3,28940,28940,rootfiles/rts/Rt_BMS_3_-2_28940.dat,262,-0.023570,0.284014,0.000000,0.000000,0,0,0,0,0,0,0,0
- 143,37232640,3,28940,28940,rootfiles/rts/Rt_BML_2_-1_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 144,40902656,3,28940,28940,rootfiles/rts/Rt_BML_2_6_28940.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 1,73408512,4,33359,33366,rootfiles/rts/Rt_BOL_2_4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 2,85467136,4,33359,33366,rootfiles/rts/Rt_BOS_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,5251072,4,33359,33366,rootfiles/rts/Rt_BIL_2_2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,51388416,4,33359,33366,rootfiles/rts/Rt_BMS_2_-6_33359_33363_33366.dat,124,-0.086931,0.270794,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,37232640,4,33359,33366,rootfiles/rts/Rt_BML_2_-1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,38805504,4,33359,33366,rootfiles/rts/Rt_BML_2_2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,55058432,4,33359,33366,rootfiles/rts/Rt_BMS_2_1_33359_33363_33366.dat,152,0.141975,0.226125,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,87040000,4,33359,33366,rootfiles/rts/Rt_BOS_2_-2_33359_33363_33366.dat,136,0.013947,0.312225,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,56631296,4,33359,33366,rootfiles/rts/Rt_BMS_2_4_33359_33363_33366.dat,230,0.093090,0.168647,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,2105344,4,33359,33366,rootfiles/rts/Rt_BIL_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,57679872,4,33359,33366,rootfiles/rts/Rt_BMS_2_6_33359_33363_33366.dat,233,0.066305,0.162270,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,0,4,33359,33366,rootfiles/rts/Rt_BOS_2_6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,56107008,4,33359,33366,rootfiles/rts/Rt_BMS_2_3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,0,4,33359,33366,rootfiles/rts/Rt_BIL_2_3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,36184064,4,33359,33366,rootfiles/rts/Rt_BML_2_-3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,51912704,4,33359,33366,rootfiles/rts/Rt_BMS_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,71835648,4,33359,33366,rootfiles/rts/Rt_BOL_2_1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,69214208,4,33359,33366,rootfiles/rts/Rt_BOL_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,0,4,33359,33366,rootfiles/rts/Rt_BIS_2_5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,72359936,4,33359,33366,rootfiles/rts/Rt_BOL_2_2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,34611200,4,33359,33366,rootfiles/rts/Rt_BML_2_-6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,90185728,4,33359,33366,rootfiles/rts/Rt_BOS_2_4_33359_33363_33366.dat,288,0.070757,0.150213,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,72884224,4,33359,33366,rootfiles/rts/Rt_BOL_2_3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,3678208,4,33359,33366,rootfiles/rts/Rt_BIL_2_-1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,0,4,33359,33366,rootfiles/rts/Rt_BIL_2_5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,86515712,4,33359,33366,rootfiles/rts/Rt_BOS_2_-3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,40902656,4,33359,33366,rootfiles/rts/Rt_BML_2_6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,89137152,4,33359,33366,rootfiles/rts/Rt_BOS_2_2_33359_33363_33366.dat,254,0.093450,0.249534,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,0,4,33359,33366,rootfiles/rts/Rt_BOS_2_-1_33359_33363_33366.dat,463,0.093290,0.267139,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,40378368,4,33359,33366,rootfiles/rts/Rt_BML_2_5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,23076864,4,33359,33366,rootfiles/rts/Rt_BIS_2_4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,22552576,4,33359,33366,rootfiles/rts/Rt_BIS_2_3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,1056768,4,33359,33366,rootfiles/rts/Rt_BIL_2_-6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,52436992,4,33359,33366,rootfiles/rts/Rt_BMS_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,35135488,4,33359,33366,rootfiles/rts/Rt_BML_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,36708352,4,33359,33366,rootfiles/rts/Rt_BML_2_-2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,85991424,4,33359,33366,rootfiles/rts/Rt_BOS_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,69738496,4,33359,33366,rootfiles/rts/Rt_BOL_2_-3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,0,4,33359,33366,rootfiles/rts/Rt_BIS_2_1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,3153920,4,33359,33366,rootfiles/rts/Rt_BIL_2_-2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,89661440,4,33359,33366,rootfiles/rts/Rt_BOS_2_3_33359_33363_33366.dat,332,0.136677,0.146911,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,18882560,4,33359,33366,rootfiles/rts/Rt_BIS_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,6299648,4,33359,33366,rootfiles/rts/Rt_BIL_2_4_33359_33363_33366.dat,126,0.164249,0.151067,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,22028288,4,33359,33366,rootfiles/rts/Rt_BIS_2_2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,55582720,4,33359,33366,rootfiles/rts/Rt_BMS_2_2_33359_33363_33366.dat,115,0.110935,0.217238,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,38281216,4,33359,33366,rootfiles/rts/Rt_BML_2_1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,7348224,4,33359,33366,rootfiles/rts/Rt_BIL_2_6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,20455424,4,33359,33366,rootfiles/rts/Rt_BIS_2_-1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,70787072,4,33359,33366,rootfiles/rts/Rt_BOL_2_-1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,17833984,4,33359,33366,rootfiles/rts/Rt_BIS_2_-6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,24125440,4,33359,33366,rootfiles/rts/Rt_BIS_2_6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,74457088,4,33359,33366,rootfiles/rts/Rt_BOL_2_6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,90710016,4,33359,33366,rootfiles/rts/Rt_BOS_2_5_33359_33363_33366.dat,162,0.118286,0.181076,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,39854080,4,33359,33366,rootfiles/rts/Rt_BML_2_4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,1581056,4,33359,33366,rootfiles/rts/Rt_BIL_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,18358272,4,33359,33366,rootfiles/rts/Rt_BIS_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,70262784,4,33359,33366,rootfiles/rts/Rt_BOL_2_-2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,84942848,4,33359,33366,rootfiles/rts/Rt_BOS_2_-6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,88612864,4,33359,33366,rootfiles/rts/Rt_BOS_2_1_33359_33363_33366.dat,144,0.176125,0.238078,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,39329792,4,33359,33366,rootfiles/rts/Rt_BML_2_3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,54009856,4,33359,33366,rootfiles/rts/Rt_BMS_2_-1_33359_33363_33366.dat,182,0.133306,0.293077,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,68165632,4,33359,33366,rootfiles/rts/Rt_BOL_2_-6_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,19406848,4,33359,33366,rootfiles/rts/Rt_BIS_2_-3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,2629632,4,33359,33366,rootfiles/rts/Rt_BIL_2_-3_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,53485568,4,33359,33366,rootfiles/rts/Rt_BMS_2_-2_33359_33363_33366.dat,141,0.053831,0.318017,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,35659776,4,33359,33366,rootfiles/rts/Rt_BML_2_-4_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,52961280,4,33359,33366,rootfiles/rts/Rt_BMS_2_-3_33359_33363_33366.dat,117,0.030263,0.345306,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,73932800,4,33359,33366,rootfiles/rts/Rt_BOL_2_5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,19931136,4,33359,33366,rootfiles/rts/Rt_BIS_2_-2_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,68689920,4,33359,33366,rootfiles/rts/Rt_BOL_2_-5_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,57155584,4,33359,33366,rootfiles/rts/Rt_BMS_2_5_33359_33363_33366.dat,192,0.073959,0.163960,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,4726784,4,33359,33366,rootfiles/rts/Rt_BIL_2_1_33359_33363_33366.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 1,40378368,5,33601,33623,rootfiles/rts/Rt_BML_2_5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 2,24125440,5,33601,33623,rootfiles/rts/Rt_BIS_2_6_33601_33620_33623.dat,2337,0.120772,0.093828,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,19406848,5,33601,33623,rootfiles/rts/Rt_BIS_2_-3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,135510663,5,33601,33623,rootfiles/rts/Rt_BOS_2_6_33601_33620_33623.dat,1000,0.100000,0.200000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,69214208,5,33601,33623,rootfiles/rts/Rt_BOL_2_-4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,23076864,5,33601,33623,rootfiles/rts/Rt_BIS_2_4_33601_33620_33623.dat,2928,0.122499,0.072763,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,55582720,5,33601,33623,rootfiles/rts/Rt_BMS_2_2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,18358272,5,33601,33623,rootfiles/rts/Rt_BIS_2_-5_33601_33620_33623.dat,278,-0.303517,0.074925,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,74457088,5,33601,33623,rootfiles/rts/Rt_BOL_2_6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,38805504,5,33601,33623,rootfiles/rts/Rt_BML_2_2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,57155584,5,33601,33623,rootfiles/rts/Rt_BMS_2_5_33601_33620_33623.dat,939,0.139352,0.126370,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,87040000,5,33601,33623,rootfiles/rts/Rt_BOS_2_-2_33601_33620_33623.dat,387,0.064012,0.308609,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,2629632,5,33601,33623,rootfiles/rts/Rt_BIL_2_-3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,52436992,5,33601,33623,rootfiles/rts/Rt_BMS_2_-4_33601_33620_33623.dat,2328,0.028035,0.285143,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,86515712,5,33601,33623,rootfiles/rts/Rt_BOS_2_-3_33601_33620_33623.dat,369,0.065024,0.233098,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,0,5,33601,33623,rootfiles/rts/Rt_BIS_2_1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,7348224,5,33601,33623,rootfiles/rts/Rt_BIL_2_6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,69738496,5,33601,33623,rootfiles/rts/Rt_BOL_2_-3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,90710016,5,33601,33623,rootfiles/rts/Rt_BOS_2_5_33601_33620_33623.dat,1164,0.076816,0.181733,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,40902656,5,33601,33623,rootfiles/rts/Rt_BML_2_6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,19931136,5,33601,33623,rootfiles/rts/Rt_BIS_2_-2_33601_33620_33623.dat,990,0.222824,0.178623,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,5251072,5,33601,33623,rootfiles/rts/Rt_BIL_2_2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,4726784,5,33601,33623,rootfiles/rts/Rt_BIL_2_1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,22552576,5,33601,33623,rootfiles/rts/Rt_BIS_2_3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,18882560,5,33601,33623,rootfiles/rts/Rt_BIS_2_-4_33601_33620_33623.dat,1152,0.283715,0.146114,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,17833984,5,33601,33623,rootfiles/rts/Rt_BIS_2_-6_33601_33620_33623.dat,303,-0.149933,0.127336,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,34611200,5,33601,33623,rootfiles/rts/Rt_BML_2_-6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,37232640,5,33601,33623,rootfiles/rts/Rt_BML_2_-1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,0,5,33601,33623,rootfiles/rts/Rt_BIS_2_5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,36184064,5,33601,33623,rootfiles/rts/Rt_BML_2_-3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,70787072,5,33601,33623,rootfiles/rts/Rt_BOL_2_-1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,85991424,5,33601,33623,rootfiles/rts/Rt_BOS_2_-4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,1581056,5,33601,33623,rootfiles/rts/Rt_BIL_2_-5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,52961280,5,33601,33623,rootfiles/rts/Rt_BMS_2_-3_33601_33620_33623.dat,2303,0.107341,0.298955,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,51388416,5,33601,33623,rootfiles/rts/Rt_BMS_2_-6_33601_33620_33623.dat,4926,-0.153148,0.230327,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,73408512,5,33601,33623,rootfiles/rts/Rt_BOL_2_4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,54009856,5,33601,33623,rootfiles/rts/Rt_BMS_2_-1_33601_33620_33623.dat,4119,0.143800,0.330343,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,20455424,5,33601,33623,rootfiles/rts/Rt_BIS_2_-1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,56631296,5,33601,33623,rootfiles/rts/Rt_BMS_2_4_33601_33620_33623.dat,4908,0.060182,0.149555,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,85467136,5,33601,33623,rootfiles/rts/Rt_BOS_2_-5_33601_33620_33623.dat,624,-0.188312,0.159451,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,56107008,5,33601,33623,rootfiles/rts/Rt_BMS_2_3_33601_33620_33623.dat,7083,-0.107589,0.264935,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,68689920,5,33601,33623,rootfiles/rts/Rt_BOL_2_-5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,35135488,5,33601,33623,rootfiles/rts/Rt_BML_2_-5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,68165632,5,33601,33623,rootfiles/rts/Rt_BOL_2_-6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,0,5,33601,33623,rootfiles/rts/Rt_BIL_2_3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,2105344,5,33601,33623,rootfiles/rts/Rt_BIL_2_-4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,6299648,5,33601,33623,rootfiles/rts/Rt_BIL_2_4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,36708352,5,33601,33623,rootfiles/rts/Rt_BML_2_-2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,38281216,5,33601,33623,rootfiles/rts/Rt_BML_2_1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,39854080,5,33601,33623,rootfiles/rts/Rt_BML_2_4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,71835648,5,33601,33623,rootfiles/rts/Rt_BOL_2_1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,35659776,5,33601,33623,rootfiles/rts/Rt_BML_2_-4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,88612864,5,33601,33623,rootfiles/rts/Rt_BOS_2_1_33601_33620_33623.dat,315,-0.075381,0.300606,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,39329792,5,33601,33623,rootfiles/rts/Rt_BML_2_3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,0,5,33601,33623,rootfiles/rts/Rt_BIL_2_5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,70262784,5,33601,33623,rootfiles/rts/Rt_BOL_2_-2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,72359936,5,33601,33623,rootfiles/rts/Rt_BOL_2_2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,72884224,5,33601,33623,rootfiles/rts/Rt_BOL_2_3_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,90185728,5,33601,33623,rootfiles/rts/Rt_BOS_2_4_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,57679872,5,33601,33623,rootfiles/rts/Rt_BMS_2_6_33601_33620_33623.dat,6237,0.085498,0.178888,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,84942848,5,33601,33623,rootfiles/rts/Rt_BOS_2_-6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,22028288,5,33601,33623,rootfiles/rts/Rt_BIS_2_2_33601_33620_33623.dat,174,-0.262920,0.094407,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,89137152,5,33601,33623,rootfiles/rts/Rt_BOS_2_2_33601_33620_33623.dat,1893,-0.286525,0.192514,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,51912704,5,33601,33623,rootfiles/rts/Rt_BMS_2_-5_33601_33620_33623.dat,447,-0.236351,0.144824,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,0,5,33601,33623,rootfiles/rts/Rt_BOS_2_-1_33601_33620_33623.dat,757,0.088030,0.313914,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,89661440,5,33601,33623,rootfiles/rts/Rt_BOS_2_3_33601_33620_33623.dat,273,-0.035762,0.217919,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,53485568,5,33601,33623,rootfiles/rts/Rt_BMS_2_-2_33601_33620_33623.dat,5057,0.184059,0.282839,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,73932800,5,33601,33623,rootfiles/rts/Rt_BOL_2_5_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,1056768,5,33601,33623,rootfiles/rts/Rt_BIL_2_-6_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,3678208,5,33601,33623,rootfiles/rts/Rt_BIL_2_-1_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,55058432,5,33601,33623,rootfiles/rts/Rt_BMS_2_1_33601_33620_33623.dat,5484,-0.015071,0.344410,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,3153920,5,33601,33623,rootfiles/rts/Rt_BIL_2_-2_33601_33620_33623.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 1,37232640,6,34268,34268,rootfiles/rts/Rt_BML_2_-1_34268.dat,6159,0.136954,0.318935,0.000000,0.000000,0,0,0,0,0,0,0,0
- 2,19406848,6,34268,34268,rootfiles/rts/Rt_BIS_2_-3_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 3,0,6,34268,34268,rootfiles/rts/Rt_BIS_2_5_34268.dat,1125,0.131280,0.143822,0.000000,0.000000,0,0,0,0,0,0,0,0
- 4,84942848,6,34268,34268,rootfiles/rts/Rt_BOS_2_-6_34268.dat,1507,-0.017696,0.345233,0.000000,0.000000,0,0,0,0,0,0,0,0
- 5,22552576,6,34268,34268,rootfiles/rts/Rt_BIS_2_3_34268.dat,659,-0.012204,0.360228,0.000000,0.000000,0,0,0,0,0,0,0,0
- 6,22028288,6,34268,34268,rootfiles/rts/Rt_BIS_2_2_34268.dat,786,-0.109414,0.204691,0.000000,0.000000,0,0,0,0,0,0,0,0
- 7,36184064,6,34268,34268,rootfiles/rts/Rt_BML_2_-3_34268.dat,5626,0.038382,0.323229,0.000000,0.000000,0,0,0,0,0,0,0,0
- 8,71835648,6,34268,34268,rootfiles/rts/Rt_BOL_2_1_34268.dat,8092,0.074470,0.309386,0.000000,0.000000,0,0,0,0,0,0,0,0
- 9,51912704,6,34268,34268,rootfiles/rts/Rt_BMS_2_-5_34268.dat,4776,-0.019459,0.308624,0.000000,0.000000,0,0,0,0,0,0,0,0
- 10,18358272,6,34268,34268,rootfiles/rts/Rt_BIS_2_-5_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 11,1056768,6,34268,34268,rootfiles/rts/Rt_BIL_2_-6_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 12,89137152,6,34268,34268,rootfiles/rts/Rt_BOS_2_2_34268.dat,80335,0.081367,0.268459,0.000000,0.000000,0,0,0,0,0,0,0,0
- 13,70262784,6,34268,34268,rootfiles/rts/Rt_BOL_2_-2_34268.dat,3397,0.013954,0.289847,0.000000,0.000000,0,0,0,0,0,0,0,0
- 14,57679872,6,34268,34268,rootfiles/rts/Rt_BMS_2_6_34268.dat,10170,0.054247,0.180338,0.000000,0.000000,0,0,0,0,0,0,0,0
- 15,56631296,6,34268,34268,rootfiles/rts/Rt_BMS_2_4_34268.dat,13892,0.089143,0.179231,0.000000,0.000000,0,0,0,0,0,0,0,0
- 16,24125440,6,34268,34268,rootfiles/rts/Rt_BIS_2_6_34268.dat,1969,0.053826,0.169378,0.000000,0.000000,0,0,0,0,0,0,0,0
- 17,86515712,6,34268,34268,rootfiles/rts/Rt_BOS_2_-3_34268.dat,7244,-0.009066,0.331537,0.000000,0.000000,0,0,0,0,0,0,0,0
- 18,56107008,6,34268,34268,rootfiles/rts/Rt_BMS_2_3_34268.dat,19684,0.105557,0.182146,0.000000,0.000000,0,0,0,0,0,0,0,0
- 19,2105344,6,34268,34268,rootfiles/rts/Rt_BIL_2_-4_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 20,57155584,6,34268,34268,rootfiles/rts/Rt_BMS_2_5_34268.dat,8956,0.067194,0.174980,0.000000,0.000000,0,0,0,0,0,0,0,0
- 21,52436992,6,34268,34268,rootfiles/rts/Rt_BMS_2_-4_34268.dat,3711,0.022108,0.334400,0.000000,0.000000,0,0,0,0,0,0,0,0
- 22,4726784,6,34268,34268,rootfiles/rts/Rt_BIL_2_1_34268.dat,3391,0.187888,0.229494,0.000000,0.000000,0,0,0,0,0,0,0,0
- 23,2629632,6,34268,34268,rootfiles/rts/Rt_BIL_2_-3_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 24,1581056,6,34268,34268,rootfiles/rts/Rt_BIL_2_-5_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 25,88612864,6,34268,34268,rootfiles/rts/Rt_BOS_2_1_34268.dat,18380,0.123168,0.237046,0.000000,0.000000,0,0,0,0,0,0,0,0
- 26,0,6,34268,34268,rootfiles/rts/Rt_BIS_2_1_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 27,40902656,6,34268,34268,rootfiles/rts/Rt_BML_2_6_34268.dat,19404,0.063596,0.191354,0.000000,0.000000,0,0,0,0,0,0,0,0
- 28,52961280,6,34268,34268,rootfiles/rts/Rt_BMS_2_-3_34268.dat,5772,0.053587,0.329551,0.000000,0.000000,0,0,0,0,0,0,0,0
- 29,20455424,6,34268,34268,rootfiles/rts/Rt_BIS_2_-1_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 30,90710016,6,34268,34268,rootfiles/rts/Rt_BOS_2_5_34268.dat,33967,0.069773,0.204852,0.000000,0.000000,0,0,0,0,0,0,0,0
- 31,0,6,34268,34268,rootfiles/rts/Rt_BIL_2_3_34268.dat,3216,0.130595,0.271099,0.000000,0.000000,0,0,0,0,0,0,0,0
- 32,90185728,6,34268,34268,rootfiles/rts/Rt_BOS_2_4_34268.dat,36976,0.112972,0.160815,0.000000,0.000000,0,0,0,0,0,0,0,0
- 33,69214208,6,34268,34268,rootfiles/rts/Rt_BOL_2_-4_34268.dat,2682,0.050569,0.291889,0.000000,0.000000,0,0,0,0,0,0,0,0
- 34,89661440,6,34268,34268,rootfiles/rts/Rt_BOS_2_3_34268.dat,24552,0.113344,0.174196,0.000000,0.000000,0,0,0,0,0,0,0,0
- 35,85991424,6,34268,34268,rootfiles/rts/Rt_BOS_2_-4_34268.dat,7617,-0.014109,0.294879,0.000000,0.000000,0,0,0,0,0,0,0,0
- 36,23076864,6,34268,34268,rootfiles/rts/Rt_BIS_2_4_34268.dat,1834,0.167458,0.156851,0.000000,0.000000,0,0,0,0,0,0,0,0
- 37,85467136,6,34268,34268,rootfiles/rts/Rt_BOS_2_-5_34268.dat,7820,-0.218907,0.200214,0.000000,0.000000,0,0,0,0,0,0,0,0
- 38,72884224,6,34268,34268,rootfiles/rts/Rt_BOL_2_3_34268.dat,9982,0.156656,0.211847,0.000000,0.000000,0,0,0,0,0,0,0,0
- 39,0,6,34268,34268,rootfiles/rts/Rt_BOS_2_6_34268.dat,570,0.057667,0.275144,0.000000,0.000000,0,0,0,0,0,0,0,0
- 40,0,6,34268,34268,rootfiles/rts/Rt_BOS_2_-1_34268.dat,54890,0.039869,0.279197,0.000000,0.000000,0,0,0,0,0,0,0,0
- 41,39854080,6,34268,34268,rootfiles/rts/Rt_BML_2_4_34268.dat,7536,0.109515,0.198260,0.000000,0.000000,0,0,0,0,0,0,0,0
- 42,73932800,6,34268,34268,rootfiles/rts/Rt_BOL_2_5_34268.dat,7817,0.144333,0.157362,0.000000,0.000000,0,0,0,0,0,0,0,0
- 43,68689920,6,34268,34268,rootfiles/rts/Rt_BOL_2_-5_34268.dat,1431,-0.217504,0.220750,0.000000,0.000000,0,0,0,0,0,0,0,0
- 44,35135488,6,34268,34268,rootfiles/rts/Rt_BML_2_-5_34268.dat,4582,-0.062669,0.321698,0.000000,0.000000,0,0,0,0,0,0,0,0
- 45,3153920,6,34268,34268,rootfiles/rts/Rt_BIL_2_-2_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 46,17833984,6,34268,34268,rootfiles/rts/Rt_BIS_2_-6_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 47,54009856,6,34268,34268,rootfiles/rts/Rt_BMS_2_-1_34268.dat,9327,0.119377,0.294241,0.000000,0.000000,0,0,0,0,0,0,0,0
- 48,6299648,6,34268,34268,rootfiles/rts/Rt_BIL_2_4_34268.dat,6798,0.180245,0.167043,0.000000,0.000000,0,0,0,0,0,0,0,0
- 49,72359936,6,34268,34268,rootfiles/rts/Rt_BOL_2_2_34268.dat,12754,0.155749,0.239336,0.000000,0.000000,0,0,0,0,0,0,0,0
- 50,7348224,6,34268,34268,rootfiles/rts/Rt_BIL_2_6_34268.dat,4987,0.066103,0.216716,0.000000,0.000000,0,0,0,0,0,0,0,0
- 51,19931136,6,34268,34268,rootfiles/rts/Rt_BIS_2_-2_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 52,36708352,6,34268,34268,rootfiles/rts/Rt_BML_2_-2_34268.dat,6411,0.101579,0.326120,0.000000,0.000000,0,0,0,0,0,0,0,0
- 53,38805504,6,34268,34268,rootfiles/rts/Rt_BML_2_2_34268.dat,17123,0.170918,0.236141,0.000000,0.000000,0,0,0,0,0,0,0,0
- 54,55582720,6,34268,34268,rootfiles/rts/Rt_BMS_2_2_34268.dat,9274,0.133825,0.209580,0.000000,0.000000,0,0,0,0,0,0,0,0
- 55,70787072,6,34268,34268,rootfiles/rts/Rt_BOL_2_-1_34268.dat,2533,0.067008,0.307509,0.000000,0.000000,0,0,0,0,0,0,0,0
- 56,5251072,6,34268,34268,rootfiles/rts/Rt_BIL_2_2_34268.dat,3672,0.190752,0.218128,0.000000,0.000000,0,0,0,0,0,0,0,0
- 57,0,6,34268,34268,rootfiles/rts/Rt_BIL_2_5_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 58,53485568,6,34268,34268,rootfiles/rts/Rt_BMS_2_-2_34268.dat,8533,0.082325,0.313608,0.000000,0.000000,0,0,0,0,0,0,0,0
- 59,3678208,6,34268,34268,rootfiles/rts/Rt_BIL_2_-1_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 60,51388416,6,34268,34268,rootfiles/rts/Rt_BMS_2_-6_34268.dat,7959,-0.052992,0.290411,0.000000,0.000000,0,0,0,0,0,0,0,0
- 61,39329792,6,34268,34268,rootfiles/rts/Rt_BML_2_3_34268.dat,16950,0.149961,0.211359,0.000000,0.000000,0,0,0,0,0,0,0,0
- 62,40378368,6,34268,34268,rootfiles/rts/Rt_BML_2_5_34268.dat,13886,0.094636,0.192622,0.000000,0.000000,0,0,0,0,0,0,0,0
- 63,18882560,6,34268,34268,rootfiles/rts/Rt_BIS_2_-4_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 64,68165632,6,34268,34268,rootfiles/rts/Rt_BOL_2_-6_34268.dat,137,-0.074799,0.315306,0.000000,0.000000,0,0,0,0,0,0,0,0
- 65,69738496,6,34268,34268,rootfiles/rts/Rt_BOL_2_-3_34268.dat,1928,-0.098716,0.303964,0.000000,0.000000,0,0,0,0,0,0,0,0
- 66,74457088,6,34268,34268,rootfiles/rts/Rt_BOL_2_6_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 67,73408512,6,34268,34268,rootfiles/rts/Rt_BOL_2_4_34268.dat,14087,0.061056,0.202349,0.000000,0.000000,0,0,0,0,0,0,0,0
- 68,87040000,6,34268,34268,rootfiles/rts/Rt_BOS_2_-2_34268.dat,10132,0.039456,0.320278,0.000000,0.000000,0,0,0,0,0,0,0,0
- 69,35659776,6,34268,34268,rootfiles/rts/Rt_BML_2_-4_34268.dat,1461,0.019272,0.347144,0.000000,0.000000,0,0,0,0,0,0,0,0
- 70,38281216,6,34268,34268,rootfiles/rts/Rt_BML_2_1_34268.dat,12623,0.197259,0.268199,0.000000,0.000000,0,0,0,0,0,0,0,0
- 71,34611200,6,34268,34268,rootfiles/rts/Rt_BML_2_-6_34268.dat,0,0.000000,0.000000,0.000000,0.000000,0,0,0,0,0,0,0,0
- 72,55058432,6,34268,34268,rootfiles/rts/Rt_BMS_2_1_34268.dat,15891,0.139225,0.246206,0.000000,0.000000,0,0,0,0,0,0,0,0
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_r.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_r.ctl
deleted file mode 100644
index 9c0e451e19fd..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_r.ctl
+++ /dev/null
@@ -1,111 +0,0 @@
-LOAD DATA
-INFILE './load_data/mdt_rt_map_r.dat'
-BADFILE './load_data/mdt_rt_map_r.bad'
-DISCARDFILE './load_data/mdt_rt_map_r.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_rt_map_r  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(MDT_RT_MAP_R_ID,
-MDT_RT_ID, 	  
-MDT_RT_MAP_T_ID, 
-BINS,		  
-R_1,		  
-R_2, 
-R_3,
-R_4,
-R_5,
-R_6,
-R_7,
-R_8,
-R_9,
-R_10,
-R_11, 
-R_12, 
-R_13, 
-R_14, 
-R_15, 
-R_16, 
-R_17, 
-R_18, 
-R_19, 
-R_20, 
-R_21, 
-R_22, 
-R_23, 
-R_24, 
-R_25, 
-R_26, 
-R_27, 
-R_28, 
-R_29, 
-R_30, 
-R_31, 
-R_32, 
-R_33, 
-R_34, 
-R_35, 
-R_36, 
-R_37, 
-R_38, 
-R_39, 
-R_40, 
-R_41, 
-R_42, 
-R_43, 
-R_44, 
-R_45, 
-R_46, 
-R_47, 
-R_48, 
-R_49, 
-R_50, 
-R_51, 
-R_52, 
-R_53, 
-R_54, 
-R_55, 
-R_56, 
-R_57, 
-R_58, 
-R_59, 
-R_60, 
-R_61, 
-R_62, 
-R_63, 
-R_64, 
-R_65, 
-R_66, 
-R_67, 
-R_68, 
-R_69, 
-R_70, 
-R_71, 
-R_72, 
-R_73, 
-R_74, 
-R_75, 
-R_76, 
-R_77, 
-R_78, 
-R_79, 
-R_80, 
-R_81, 
-R_82, 
-R_83, 
-R_84, 
-R_85, 
-R_86, 
-R_87, 
-R_88, 
-R_89, 
-R_90, 
-R_91, 
-R_92, 
-R_93, 
-R_94, 
-R_95, 
-R_96, 
-R_97, 
-R_98, 
-R_99, 
-R_100)
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_s.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_s.ctl
deleted file mode 100644
index 2bd56fd3c1e2..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_s.ctl
+++ /dev/null
@@ -1,110 +0,0 @@
-LOAD DATA
-INFILE './load_data/mdt_rt_map_s.dat'
-BADFILE './load_data/mdt_rt_map_s.bad'
-DISCARDFILE './load_data/mdt_rt_map_s.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_rt_map_s  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(MDT_RT_MAP_S_ID,
-MDT_RT_ID,	  
-BINS,		 
-S_1,	
-S_2,
-S_3,
-S_4,
-S_5,
-S_6,
-S_7,
-S_8,
-S_9,
-S_10,
-S_11,     
-S_12,     
-S_13,     
-S_14,     
-S_15,     
-S_16,     
-S_17,     
-S_18,     
-S_19,     
-S_20,     
-S_21,     
-S_22,     
-S_23,     
-S_24,     
-S_25,     
-S_26,     
-S_27,     
-S_28,     
-S_29,     
-S_30,     
-S_31,     
-S_32,     
-S_33,     
-S_34,     
-S_35,     
-S_36,     
-S_37,     
-S_38,     
-S_39,     
-S_40,     
-S_41,     
-S_42,     
-S_43,     
-S_44,     
-S_45,     
-S_46,     
-S_47,     
-S_48,     
-S_49,     
-S_50,     
-S_51,     
-S_52,     
-S_53,     
-S_54,     
-S_55,     
-S_56,     
-S_57,     
-S_58,     
-S_59,     
-S_60,     
-S_61,     
-S_62,     
-S_63,     
-S_64,     
-S_65,     
-S_66,     
-S_67,     
-S_68,     
-S_69,     
-S_70,     
-S_71,     
-S_72,     
-S_73,     
-S_74,     
-S_75,     
-S_76,     
-S_77,     
-S_78,     
-S_79,     
-S_80,     
-S_81,     
-S_82,     
-S_83,     
-S_84,     
-S_85,     
-S_86,     
-S_87,     
-S_88,     
-S_89,     
-S_90,     
-S_91,     
-S_92,     
-S_93,     
-S_94,     
-S_95,     
-S_96,     
-S_97,     
-S_98,     
-S_99,     
-S_100  ) 
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_t.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_t.ctl
deleted file mode 100644
index ca031528f029..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_rt_map_t.ctl
+++ /dev/null
@@ -1,111 +0,0 @@
-LOAD DATA
-INFILE './load_data/mdt_rt_map_t.dat'
-BADFILE './load_data/mdt_rt_map_t.bad'
-DISCARDFILE './load_data/mdt_rt_map_t.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_rt_map_t  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(MDT_RT_MAP_T_ID,
-MDT_RT_ID_START, 
-MDT_RT_ID_END,	 
-BINS,		
-T_1,	
-T_2,
-T_3,
-T_4,
-T_5,
-T_6,
-T_7,
-T_8,
-T_9,
-T_10,
-T_11,
-T_12,
-T_13,
-T_14,
-T_15,
-T_16,
-T_17,
-T_18,
-T_19,
-T_20,
-T_21,
-T_22,
-T_23,
-T_24,
-T_25,
-T_26,
-T_27,
-T_28,
-T_29,
-T_30,
-T_31,
-T_32,
-T_33,
-T_34,
-T_35,
-T_36,
-T_37,
-T_38,
-T_39,
-T_40,
-T_41,
-T_42,
-T_43,
-T_44,
-T_45,
-T_46,
-T_47,
-T_48,
-T_49,
-T_50,
-T_51,
-T_52,
-T_53,
-T_54,
-T_55,
-T_56,
-T_57,
-T_58,
-T_59,
-T_60,
-T_61,
-T_62,
-T_63,
-T_64,
-T_65,
-T_66,
-T_67,
-T_68,
-T_69,
-T_70,
-T_71,
-T_72,
-T_73,
-T_74,
-T_75,
-T_76,
-T_77,
-T_78,
-T_79,
-T_80,
-T_81,
-T_82,
-T_83,
-T_84,
-T_85,
-T_86,
-T_87,
-T_88,
-T_89,
-T_90,
-T_91,
-T_92,
-T_93,
-T_94,
-T_95,
-T_96,
-T_97,
-T_98,
-T_99,
-T_100)
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_tube.ctl b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_tube.ctl
deleted file mode 100644
index 4f0aa21ad75f..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/load_data/mdt_tube.ctl
+++ /dev/null
@@ -1,57 +0,0 @@
-LOAD DATA
-INFILE './load_data/mdt_tube.dat'
-BADFILE './load_data/mdt_tube.bad'
-DISCARDFILE './load_data/mdt_tube.dsc'
-CONTINUEIF NEXT(1)='+'
-INTO TABLE mdt_tube  APPEND
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
-(HEAD_ID, 
-TUBE_ID, 
-CHAMBER, 
-LOWRUN, 
-UPRUN, 
-RUNFLAG, 
-CALIBFLAG, 
-VALIDFLAG, 
-ENTRIES, 
-CHISQUARE_1, 
-CHISQUARE_2, 
-P0, 
-P1, 
-P2, 
-P3, 
-P4, 
-P5, 
-P6, 
-P7, 
-P8, 
-P9, 
-P0_ERR, 
-P1_ERR, 
-P2_ERR, 
-P3_ERR, 
-P4_ERR, 
-P5_ERR, 
-P6_ERR, 
-P7_ERR, 
-P8_ERR, 
-P9_ERR, 
-COV_1,
-COV_2, 
-COV_3, 
-COV_4, 
-ADC_0, 
-ADC_1,
-ADC_2,
-ADC_3,
-ADC_0_ERR,
-ADC_1_ERR,
-ADC_2_ERR,
-ADC_3_ERR,
-ADC_CHISQUARE,
-ADC_PEDESTAL,
-ADC_PEDESTAL_WIDTH,
-NHITS,
-NHITS_ABOVE_ADC_CUT,
-ALGO_FLAG,
-TUBE_GROUPING)
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_table.sql
deleted file mode 100644
index ce440732b0cf..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_table.sql
+++ /dev/null
@@ -1,25 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_head_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_HEAD";
-CREATE TABLE &1.."MDT_HEAD" 
-( "HEAD_ID" NUMBER, 
-"IMPLEMENTATION" VARCHAR2(32) NOT NULL , 
-"LOWRUN" NUMBER(8) NOT NULL , 
-"UPRUN" NUMBER(8) NOT NULL , 
-"LOWTIME" NUMBER(10) NOT NULL , 
-"UPTIME" NUMBER(10) NOT NULL , 
-"LUMINOSITY" BINARY_FLOAT NOT NULL , 
-"ROOTFILE" VARCHAR2(4000) NOT NULL , 
-"SITE_NAME" VARCHAR2(2) DEFAULT UPPER('&2') , 
-"INSERT_TIME" VARCHAR2(29), 
-CONSTRAINT "SITE_NAME" FOREIGN KEY ("SITE_NAME") REFERENCES &1.."SITES" ("NAME") VALIDATE , 
-CONSTRAINT "HEAD_ID_PR" PRIMARY KEY ("HEAD_ID", "SITE_NAME") VALIDATE , 
-CHECK (UPRUN>=LOWRUN) VALIDATE , 
-CHECK (UPTIME>=LOWTIME) VALIDATE ) 
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_trigger.sql
deleted file mode 100644
index 99ae910e5f22..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_head_trigger.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_head_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_HEAD_TRIGGER;
-CREATE TRIGGER &1..MDT_HEAD_TRIGGER BEFORE
-INSERT ON &1.."MDT_HEAD" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN
-
-SELECT &1..mdt_head_sequence.nextval INTO :NEW.HEAD_ID FROM dual;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN RAISE;
-END mdt_head_trigger;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_table.sql
deleted file mode 100644
index 371c7ead2b3a..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_table.sql
+++ /dev/null
@@ -1,67 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_cheby_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_RT_CHEBY";
-CREATE TABLE &1.."MDT_RT_CHEBY"
-( "MDT_RT_CHEBY_ID" 	NUMBER NOT NULL	, 
-"MDT_RT_ID" 		NUMBER NOT NULL , 
-"N_CHEBY_R" 		NUMBER(3) NOT NULL , 
-"N_CHEBY_S" 		NUMBER(3) NOT NULL , 
-"T_MIN" 		NUMBER(5,1) NOT NULL , 
-"T_MAX" 		NUMBER(5,1) NOT NULL , 
-"SITE_NAME"             VARCHAR2(2) DEFAULT UPPER('&2') ,
-"INSERT_TIME"           VARCHAR2(19) ,
-"CHEBY_COE_R_1" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_2" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_3" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_4" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_5" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_6" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_7" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_8" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_9" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_10" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_11" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_12" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_13" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_14" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_15" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_R_16" 	NUMBER(6,5) NOT NULL , 
-"CHI_SQUARE_R" 		NUMBER(7,2) NOT NULL , 
-"T_MIN_S" 		NUMBER(5,1) NOT NULL , 
-"T_MAX_S" 		NUMBER(5,1) NOT NULL , 
-"CHEBY_COE_S_1" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_2" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_3" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_4" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_5" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_6" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_7" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_S_8" 	NUMBER(6,5) NOT NULL , 
-"CHI_SQUARE_A" 		NUMBER(7,2) NOT NULL , 
-"R_MIN" 		NUMBER(5,3) NOT NULL , 
-"R_MAX" 		NUMBER(5,3) NOT NULL , 
-"CHEBY_COE_T_1" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_2" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_3" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_4" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_5" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_6" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_7" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_8" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_9" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_10" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_11" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_12" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_13" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_14" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_15" 	NUMBER(6,5) NOT NULL , 
-"CHEBY_COE_T_16" 	NUMBER(6,5) NOT NULL , 
-CONSTRAINT "MDT_RT_CHEBY_ID_SITE_PR" PRIMARY KEY ("MDT_RT_CHEBY_ID", "SITE_NAME") VALIDATE , 
-CONSTRAINT "MDT_RT_CHEBY_MDT_RT_ID_REF" FOREIGN KEY ("MDT_RT_ID", "SITE_NAME") REFERENCES &1.."MDT_RT" ("MDT_RT_ID", "SITE_NAME") VALIDATE ) 
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) ;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_trigger.sql
deleted file mode 100644
index f5ffcb84eda3..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_cheby_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_cheby_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_RT_CHEBY_TRIGGER;
-CREATE TRIGGER &1..MDT_RT_CHEBY_TRIGGER BEFORE
-INSERT ON &1.."MDT_RT_CHEBY" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..MDT_RT_CHEBY_SEQUENCE.NEXTVAL INTO :NEW.MDT_RT_CHEBY_ID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_RT_CHEBY_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_table.sql
deleted file mode 100644
index b9f047b80409..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_table.sql
+++ /dev/null
@@ -1,120 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_r_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_RT_MAP_R";
-CREATE TABLE &1.."MDT_RT_MAP_R" 
-("MDT_RT_MAP_R_ID"  NUMBER        NOT NULL ,
-"MDT_RT_ID" 	    NUMBER        NOT NULL ,
-"MDT_RT_MAP_T_ID"   NUMBER        NOT NULL ,
-"BINS"		    NUMBER(4)     NOT NULL ,
-"SITE_NAME"         VARCHAR2(2) DEFAULT UPPER('&2') ,
-"INSERT_TIME"       VARCHAR2(19),
-"R_1"		    NUMBER(8,6)   NOT NULL ,
-"R_2"               NUMBER(8,6)   NOT NULL ,
-"R_3"               NUMBER(8,6)   NOT NULL ,
-"R_4"               NUMBER(8,6)   NOT NULL ,
-"R_5"               NUMBER(8,6)   NOT NULL ,
-"R_6"               NUMBER(8,6)   NOT NULL ,
-"R_7"               NUMBER(8,6)   NOT NULL ,
-"R_8"               NUMBER(8,6)   NOT NULL ,
-"R_9"               NUMBER(8,6)   NOT NULL ,
-"R_10"              NUMBER(8,6)   NOT NULL ,
-"R_11"              NUMBER(8,6)   NOT NULL ,
-"R_12"              NUMBER(8,6)   NOT NULL ,
-"R_13"              NUMBER(8,6)   NOT NULL ,
-"R_14"              NUMBER(8,6)   NOT NULL ,
-"R_15"              NUMBER(8,6)   NOT NULL ,
-"R_16"              NUMBER(8,6)   NOT NULL ,
-"R_17"              NUMBER(8,6)   NOT NULL ,
-"R_18"              NUMBER(8,6)   NOT NULL ,
-"R_19"              NUMBER(8,6)   NOT NULL ,
-"R_20"              NUMBER(8,6)   NOT NULL ,
-"R_21"              NUMBER(8,6)   NOT NULL ,
-"R_22"              NUMBER(8,6)   NOT NULL ,
-"R_23"              NUMBER(8,6)   NOT NULL ,
-"R_24"              NUMBER(8,6)   NOT NULL ,
-"R_25"              NUMBER(8,6)   NOT NULL ,
-"R_26"              NUMBER(8,6)   NOT NULL ,
-"R_27"              NUMBER(8,6)   NOT NULL ,
-"R_28"              NUMBER(8,6)   NOT NULL ,
-"R_29"              NUMBER(8,6)   NOT NULL ,
-"R_30"              NUMBER(8,6)   NOT NULL ,
-"R_31"              NUMBER(8,6)   NOT NULL ,
-"R_32"              NUMBER(8,6)   NOT NULL ,
-"R_33"              NUMBER(8,6)   NOT NULL ,
-"R_34"              NUMBER(8,6)   NOT NULL ,
-"R_35"              NUMBER(8,6)   NOT NULL ,
-"R_36"              NUMBER(8,6)   NOT NULL ,
-"R_37"              NUMBER(8,6)   NOT NULL ,
-"R_38"              NUMBER(8,6)   NOT NULL ,
-"R_39"              NUMBER(8,6)   NOT NULL ,
-"R_40"              NUMBER(8,6)   NOT NULL ,
-"R_41"              NUMBER(8,6)   NOT NULL ,
-"R_42"              NUMBER(8,6)   NOT NULL ,
-"R_43"              NUMBER(8,6)   NOT NULL ,
-"R_44"              NUMBER(8,6)   NOT NULL ,
-"R_45"              NUMBER(8,6)   NOT NULL ,
-"R_46"              NUMBER(8,6)   NOT NULL ,
-"R_47"              NUMBER(8,6)   NOT NULL ,
-"R_48"              NUMBER(8,6)   NOT NULL ,
-"R_49"              NUMBER(8,6)   NOT NULL ,
-"R_50"              NUMBER(8,6)   NOT NULL ,
-"R_51"              NUMBER(8,6)   NOT NULL ,
-"R_52"              NUMBER(8,6)   NOT NULL ,
-"R_53"              NUMBER(8,6)   NOT NULL ,
-"R_54"              NUMBER(8,6)   NOT NULL ,
-"R_55"              NUMBER(8,6)   NOT NULL ,
-"R_56"              NUMBER(8,6)   NOT NULL ,
-"R_57"              NUMBER(8,6)   NOT NULL ,
-"R_58"              NUMBER(8,6)   NOT NULL ,
-"R_59"              NUMBER(8,6)   NOT NULL ,
-"R_60"              NUMBER(8,6)   NOT NULL ,
-"R_61"              NUMBER(8,6)   NOT NULL ,
-"R_62"              NUMBER(8,6)   NOT NULL ,
-"R_63"              NUMBER(8,6)   NOT NULL ,
-"R_64"              NUMBER(8,6)   NOT NULL ,
-"R_65"              NUMBER(8,6)   NOT NULL ,
-"R_66"              NUMBER(8,6)   NOT NULL ,
-"R_67"              NUMBER(8,6)   NOT NULL ,
-"R_68"              NUMBER(8,6)   NOT NULL ,
-"R_69"              NUMBER(8,6)   NOT NULL ,
-"R_70"              NUMBER(8,6)   NOT NULL ,
-"R_71"              NUMBER(8,6)   NOT NULL ,
-"R_72"              NUMBER(8,6)   NOT NULL ,
-"R_73"              NUMBER(8,6)   NOT NULL ,
-"R_74"              NUMBER(8,6)   NOT NULL ,
-"R_75"              NUMBER(8,6)   NOT NULL ,
-"R_76"              NUMBER(8,6)   NOT NULL ,
-"R_77"              NUMBER(8,6)   NOT NULL ,
-"R_78"              NUMBER(8,6)   NOT NULL ,
-"R_79"              NUMBER(8,6)   NOT NULL ,
-"R_80"              NUMBER(8,6)   NOT NULL ,
-"R_81"              NUMBER(8,6)   NOT NULL ,
-"R_82"              NUMBER(8,6)   NOT NULL ,
-"R_83"              NUMBER(8,6)   NOT NULL ,
-"R_84"              NUMBER(8,6)   NOT NULL ,
-"R_85"              NUMBER(8,6)   NOT NULL ,
-"R_86"              NUMBER(8,6)   NOT NULL ,
-"R_87"              NUMBER(8,6)   NOT NULL ,
-"R_88"              NUMBER(8,6)   NOT NULL ,
-"R_89"              NUMBER(8,6)   NOT NULL ,
-"R_90"              NUMBER(8,6)   NOT NULL ,
-"R_91"              NUMBER(8,6)   NOT NULL ,
-"R_92"              NUMBER(8,6)   NOT NULL ,
-"R_93"              NUMBER(8,6)   NOT NULL ,
-"R_94"              NUMBER(8,6)   NOT NULL ,
-"R_95"              NUMBER(8,6)   NOT NULL ,
-"R_96"              NUMBER(8,6)   NOT NULL ,
-"R_97"              NUMBER(8,6)   NOT NULL ,
-"R_98"              NUMBER(8,6)   NOT NULL ,
-"R_99"              NUMBER(8,6)   NOT NULL ,
-"R_100"             NUMBER(8,6)   NOT NULL ,
-CONSTRAINT "MDT_RT_MAP_R_MDT_RT_ID_REF" FOREIGN KEY ("MDT_RT_ID", "SITE_NAME") REFERENCES &1.."MDT_RT" ("MDT_RT_ID", "SITE_NAME") VALIDATE ,
-CONSTRAINT "MDT_RT_MAP_R_MDT_RT_MAP_T_REF" FOREIGN KEY ("MDT_RT_MAP_T_ID", "SITE_NAME") REFERENCES &1.."MDT_RT_MAP_T" ("MDT_RT_MAP_T_ID", "SITE_NAME") VALIDATE ,
-CONSTRAINT "MDT_RT_MAP_R_ID_SITE_PR" PRIMARY KEY ("MDT_RT_MAP_R_ID", "SITE_NAME") VALIDATE )
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_trigger.sql
deleted file mode 100644
index cc9501f67701..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_r_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_r_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_RT_MAP_R_TRIGGER;
-CREATE TRIGGER &1..MDT_RT_MAP_R_TRIGGER BEFORE
-INSERT ON &1.."MDT_RT_MAP_R" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..MDT_RT_MAP_R_SEQUENCE.NEXTVAL INTO :NEW.MDT_RT_MAP_R_ID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_RT_MAP_R_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_table.sql
deleted file mode 100644
index 26d92ed6dab7..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_table.sql
+++ /dev/null
@@ -1,118 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_s_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_RT_MAP_S";
-CREATE TABLE &1.."MDT_RT_MAP_S" 
-("MDT_RT_MAP_S_ID"  NUMBER        NOT NULL ,
-"MDT_RT_ID"	    NUMBER        NOT NULL ,
-"BINS"		    NUMBER(4)     NOT NULL ,
-"SITE_NAME"         VARCHAR2(2) DEFAULT UPPER('&2') ,
-"INSERT_TIME"       VARCHAR2(19),
-"S_1"		    NUMBER(3,2)   NOT NULL ,
-"S_2"               NUMBER(3,2)   NOT NULL ,
-"S_3"               NUMBER(3,2)   NOT NULL ,
-"S_4"               NUMBER(3,2)   NOT NULL ,
-"S_5"               NUMBER(3,2)   NOT NULL ,
-"S_6"               NUMBER(3,2)   NOT NULL ,
-"S_7"               NUMBER(3,2)   NOT NULL ,
-"S_8"               NUMBER(3,2)   NOT NULL ,
-"S_9"               NUMBER(3,2)   NOT NULL ,
-"S_10"              NUMBER(3,2)   NOT NULL ,
-"S_11"              NUMBER(3,2)   NOT NULL ,
-"S_12"              NUMBER(3,2)   NOT NULL ,
-"S_13"              NUMBER(3,2)   NOT NULL ,
-"S_14"              NUMBER(3,2)   NOT NULL ,
-"S_15"              NUMBER(3,2)   NOT NULL ,
-"S_16"              NUMBER(3,2)   NOT NULL ,
-"S_17"              NUMBER(3,2)   NOT NULL ,
-"S_18"              NUMBER(3,2)   NOT NULL ,
-"S_19"              NUMBER(3,2)   NOT NULL ,
-"S_20"              NUMBER(3,2)   NOT NULL ,
-"S_21"              NUMBER(3,2)   NOT NULL ,
-"S_22"              NUMBER(3,2)   NOT NULL ,
-"S_23"              NUMBER(3,2)   NOT NULL ,
-"S_24"              NUMBER(3,2)   NOT NULL ,
-"S_25"              NUMBER(3,2)   NOT NULL ,
-"S_26"              NUMBER(3,2)   NOT NULL ,
-"S_27"              NUMBER(3,2)   NOT NULL ,
-"S_28"              NUMBER(3,2)   NOT NULL ,
-"S_29"              NUMBER(3,2)   NOT NULL ,
-"S_30"              NUMBER(3,2)   NOT NULL ,
-"S_31"              NUMBER(3,2)   NOT NULL ,
-"S_32"              NUMBER(3,2)   NOT NULL ,
-"S_33"              NUMBER(3,2)   NOT NULL ,
-"S_34"              NUMBER(3,2)   NOT NULL ,
-"S_35"              NUMBER(3,2)   NOT NULL ,
-"S_36"              NUMBER(3,2)   NOT NULL ,
-"S_37"              NUMBER(3,2)   NOT NULL ,
-"S_38"              NUMBER(3,2)   NOT NULL ,
-"S_39"              NUMBER(3,2)   NOT NULL ,
-"S_40"              NUMBER(3,2)   NOT NULL ,
-"S_41"              NUMBER(3,2)   NOT NULL ,
-"S_42"              NUMBER(3,2)   NOT NULL ,
-"S_43"              NUMBER(3,2)   NOT NULL ,
-"S_44"              NUMBER(3,2)   NOT NULL ,
-"S_45"              NUMBER(3,2)   NOT NULL ,
-"S_46"              NUMBER(3,2)   NOT NULL ,
-"S_47"              NUMBER(3,2)   NOT NULL ,
-"S_48"              NUMBER(3,2)   NOT NULL ,
-"S_49"              NUMBER(3,2)   NOT NULL ,
-"S_50"              NUMBER(3,2)   NOT NULL ,
-"S_51"              NUMBER(3,2)   NOT NULL ,
-"S_52"              NUMBER(3,2)   NOT NULL ,
-"S_53"              NUMBER(3,2)   NOT NULL ,
-"S_54"              NUMBER(3,2)   NOT NULL ,
-"S_55"              NUMBER(3,2)   NOT NULL ,
-"S_56"              NUMBER(3,2)   NOT NULL ,
-"S_57"              NUMBER(3,2)   NOT NULL ,
-"S_58"              NUMBER(3,2)   NOT NULL ,
-"S_59"              NUMBER(3,2)   NOT NULL ,
-"S_60"              NUMBER(3,2)   NOT NULL ,
-"S_61"              NUMBER(3,2)   NOT NULL ,
-"S_62"              NUMBER(3,2)   NOT NULL ,
-"S_63"              NUMBER(3,2)   NOT NULL ,
-"S_64"              NUMBER(3,2)   NOT NULL ,
-"S_65"              NUMBER(3,2)   NOT NULL ,
-"S_66"              NUMBER(3,2)   NOT NULL ,
-"S_67"              NUMBER(3,2)   NOT NULL ,
-"S_68"              NUMBER(3,2)   NOT NULL ,
-"S_69"              NUMBER(3,2)   NOT NULL ,
-"S_70"              NUMBER(3,2)   NOT NULL ,
-"S_71"              NUMBER(3,2)   NOT NULL ,
-"S_72"              NUMBER(3,2)   NOT NULL ,
-"S_73"              NUMBER(3,2)   NOT NULL ,
-"S_74"              NUMBER(3,2)   NOT NULL ,
-"S_75"              NUMBER(3,2)   NOT NULL ,
-"S_76"              NUMBER(3,2)   NOT NULL ,
-"S_77"              NUMBER(3,2)   NOT NULL ,
-"S_78"              NUMBER(3,2)   NOT NULL ,
-"S_79"              NUMBER(3,2)   NOT NULL ,
-"S_80"              NUMBER(3,2)   NOT NULL ,
-"S_81"              NUMBER(3,2)   NOT NULL ,
-"S_82"              NUMBER(3,2)   NOT NULL ,
-"S_83"              NUMBER(3,2)   NOT NULL ,
-"S_84"              NUMBER(3,2)   NOT NULL ,
-"S_85"              NUMBER(3,2)   NOT NULL ,
-"S_86"              NUMBER(3,2)   NOT NULL ,
-"S_87"              NUMBER(3,2)   NOT NULL ,
-"S_88"              NUMBER(3,2)   NOT NULL ,
-"S_89"              NUMBER(3,2)   NOT NULL ,
-"S_90"              NUMBER(3,2)   NOT NULL ,
-"S_91"              NUMBER(3,2)   NOT NULL ,
-"S_92"              NUMBER(3,2)   NOT NULL ,
-"S_93"              NUMBER(3,2)   NOT NULL ,
-"S_94"              NUMBER(3,2)   NOT NULL ,
-"S_95"              NUMBER(3,2)   NOT NULL ,
-"S_96"              NUMBER(3,2)   NOT NULL ,
-"S_97"              NUMBER(3,2)   NOT NULL ,
-"S_98"              NUMBER(3,2)   NOT NULL ,
-"S_99"              NUMBER(3,2)   NOT NULL ,
-"S_100"             NUMBER(3,2)   NOT NULL ,
-CONSTRAINT "MDT_RT_MAP_S_MDT_RT_ID_REF" FOREIGN KEY ("MDT_RT_ID", "SITE_NAME") REFERENCES &1.."MDT_RT" ("MDT_RT_ID", "SITE_NAME") VALIDATE ,
-CONSTRAINT "MDT_RT_MAP_S_ID_SITE_PR" PRIMARY KEY ("MDT_RT_MAP_S_ID", "SITE_NAME") VALIDATE )
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_trigger.sql
deleted file mode 100644
index b9d1e045d8be..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_s_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_s_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_RT_MAP_S_TRIGGER;
-CREATE TRIGGER &1..MDT_RT_MAP_S_TRIGGER BEFORE
-INSERT ON &1.."MDT_RT_MAP_S" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..MDT_RT_MAP_S_SEQUENCE.NEXTVAL INTO :NEW.MDT_RT_MAP_S_ID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_RT_MAP_S_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_table.sql
deleted file mode 100644
index 90106ca6bd30..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_table.sql
+++ /dev/null
@@ -1,121 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_t_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_RT_MAP_T";
-CREATE TABLE &1.."MDT_RT_MAP_T" 
-("MDT_RT_MAP_T_ID"  NUMBER        NOT NULL ,
-"MDT_RT_ID_START"   NUMBER        NOT NULL ,
-"MDT_RT_ID_END"	    NUMBER        NOT NULL ,
-"BINS"		    NUMBER(4)     NOT NULL ,
-"SITE_NAME"         VARCHAR2(2)   DEFAULT UPPER('&2') ,
-"INSERT_TIME"       VARCHAR2(19) ,
-"T_1"		    NUMBER(9,6)   NOT NULL ,
-"T_2"               NUMBER(9,6)   NOT NULL ,
-"T_3"               NUMBER(9,6)   NOT NULL ,
-"T_4"               NUMBER(9,6)   NOT NULL ,
-"T_5"               NUMBER(9,6)   NOT NULL ,
-"T_6"               NUMBER(9,6)   NOT NULL ,
-"T_7"               NUMBER(9,6)   NOT NULL ,
-"T_8"               NUMBER(9,6)   NOT NULL ,
-"T_9"               NUMBER(9,6)   NOT NULL ,
-"T_10"              NUMBER(9,6)   NOT NULL ,
-"T_11"              NUMBER(9,6)   NOT NULL ,
-"T_12"              NUMBER(9,6)   NOT NULL ,
-"T_13"              NUMBER(9,6)   NOT NULL ,
-"T_14"              NUMBER(9,6)   NOT NULL ,
-"T_15"              NUMBER(9,6)   NOT NULL ,
-"T_16"              NUMBER(9,6)   NOT NULL ,
-"T_17"              NUMBER(9,6)   NOT NULL ,
-"T_18"              NUMBER(9,6)   NOT NULL ,
-"T_19"              NUMBER(9,6)   NOT NULL ,
-"T_20"              NUMBER(9,6)   NOT NULL ,
-"T_21"              NUMBER(9,6)   NOT NULL ,
-"T_22"              NUMBER(9,6)   NOT NULL ,
-"T_23"              NUMBER(9,6)   NOT NULL ,
-"T_24"              NUMBER(9,6)   NOT NULL ,
-"T_25"              NUMBER(9,6)   NOT NULL ,
-"T_26"              NUMBER(9,6)   NOT NULL ,
-"T_27"              NUMBER(9,6)   NOT NULL ,
-"T_28"              NUMBER(9,6)   NOT NULL ,
-"T_29"              NUMBER(9,6)   NOT NULL ,
-"T_30"              NUMBER(9,6)   NOT NULL ,
-"T_31"              NUMBER(9,6)   NOT NULL ,
-"T_32"              NUMBER(9,6)   NOT NULL ,
-"T_33"              NUMBER(9,6)   NOT NULL ,
-"T_34"              NUMBER(9,6)   NOT NULL ,
-"T_35"              NUMBER(9,6)   NOT NULL ,
-"T_36"              NUMBER(9,6)   NOT NULL ,
-"T_37"              NUMBER(9,6)   NOT NULL ,
-"T_38"              NUMBER(9,6)   NOT NULL ,
-"T_39"              NUMBER(9,6)   NOT NULL ,
-"T_40"              NUMBER(9,6)   NOT NULL ,
-"T_41"              NUMBER(9,6)   NOT NULL ,
-"T_42"              NUMBER(9,6)   NOT NULL ,
-"T_43"              NUMBER(9,6)   NOT NULL ,
-"T_44"              NUMBER(9,6)   NOT NULL ,
-"T_45"              NUMBER(9,6)   NOT NULL ,
-"T_46"              NUMBER(9,6)   NOT NULL ,
-"T_47"              NUMBER(9,6)   NOT NULL ,
-"T_48"              NUMBER(9,6)   NOT NULL ,
-"T_49"              NUMBER(9,6)   NOT NULL ,
-"T_50"              NUMBER(9,6)   NOT NULL ,
-"T_51"              NUMBER(9,6)   NOT NULL ,
-"T_52"              NUMBER(9,6)   NOT NULL ,
-"T_53"              NUMBER(9,6)   NOT NULL ,
-"T_54"              NUMBER(9,6)   NOT NULL ,
-"T_55"              NUMBER(9,6)   NOT NULL ,
-"T_56"              NUMBER(9,6)   NOT NULL ,
-"T_57"              NUMBER(9,6)   NOT NULL ,
-"T_58"              NUMBER(9,6)   NOT NULL ,
-"T_59"              NUMBER(9,6)   NOT NULL ,
-"T_60"              NUMBER(9,6)   NOT NULL ,
-"T_61"              NUMBER(9,6)   NOT NULL ,
-"T_62"              NUMBER(9,6)   NOT NULL ,
-"T_63"              NUMBER(9,6)   NOT NULL ,
-"T_64"              NUMBER(9,6)   NOT NULL ,
-"T_65"              NUMBER(9,6)   NOT NULL ,
-"T_66"              NUMBER(9,6)   NOT NULL ,
-"T_67"              NUMBER(9,6)   NOT NULL ,
-"T_68"              NUMBER(9,6)   NOT NULL ,
-"T_69"              NUMBER(9,6)   NOT NULL ,
-"T_70"              NUMBER(9,6)   NOT NULL ,
-"T_71"              NUMBER(9,6)   NOT NULL ,
-"T_72"              NUMBER(9,6)   NOT NULL ,
-"T_73"              NUMBER(9,6)   NOT NULL ,
-"T_74"              NUMBER(9,6)   NOT NULL ,
-"T_75"              NUMBER(9,6)   NOT NULL ,
-"T_76"              NUMBER(9,6)   NOT NULL ,
-"T_77"              NUMBER(9,6)   NOT NULL ,
-"T_78"              NUMBER(9,6)   NOT NULL ,
-"T_79"              NUMBER(9,6)   NOT NULL ,
-"T_80"              NUMBER(9,6)   NOT NULL ,
-"T_81"              NUMBER(9,6)   NOT NULL ,
-"T_82"              NUMBER(9,6)   NOT NULL ,
-"T_83"              NUMBER(9,6)   NOT NULL ,
-"T_84"              NUMBER(9,6)   NOT NULL ,
-"T_85"              NUMBER(9,6)   NOT NULL ,
-"T_86"              NUMBER(9,6)   NOT NULL ,
-"T_87"              NUMBER(9,6)   NOT NULL ,
-"T_88"              NUMBER(9,6)   NOT NULL ,
-"T_89"              NUMBER(9,6)   NOT NULL ,
-"T_90"              NUMBER(9,6)   NOT NULL ,
-"T_91"              NUMBER(9,6)   NOT NULL ,
-"T_92"              NUMBER(9,6)   NOT NULL ,
-"T_93"              NUMBER(9,6)   NOT NULL ,
-"T_94"              NUMBER(9,6)   NOT NULL ,
-"T_95"              NUMBER(9,6)   NOT NULL ,
-"T_96"              NUMBER(9,6)   NOT NULL ,
-"T_97"              NUMBER(9,6)   NOT NULL ,
-"T_98"              NUMBER(9,6)   NOT NULL ,
-"T_99"              NUMBER(9,6)   NOT NULL ,
-"T_100"             NUMBER(9,6)   NOT NULL ,
-CONSTRAINT "MDT_RT_MAP_T_RT_ID_START_REF" FOREIGN KEY ("MDT_RT_ID_START", "SITE_NAME") REFERENCES &1.."MDT_RT" ("MDT_RT_ID", "SITE_NAME") VALIDATE ,
-CONSTRAINT "MDT_RT_MAP_T_RT_ID_END_REF" FOREIGN KEY ("MDT_RT_ID_END", "SITE_NAME") REFERENCES &1.."MDT_RT" ("MDT_RT_ID", "SITE_NAME") VALIDATE ,
-CONSTRAINT "SITE_NAME_REF" FOREIGN KEY ("SITE_NAME") REFERENCES &1.."SITES" ("NAME") VALIDATE ,
-CONSTRAINT "MDT_RT_MAP_T_ID_SITE_PR" PRIMARY KEY ("MDT_RT_MAP_T_ID", "SITE_NAME") VALIDATE ) 
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_trigger.sql
deleted file mode 100644
index 77b87481095c..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_map_t_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_map_t_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_RT_MAP_T_TRIGGER;
-CREATE TRIGGER &1..MDT_RT_MAP_T_TRIGGER BEFORE
-INSERT ON &1.."MDT_RT_MAP_T" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..MDT_RT_MAP_T_SEQUENCE.NEXTVAL INTO :NEW.MDT_RT_MAP_T_ID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_RT_MAP_T_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_table.sql
deleted file mode 100644
index 4fb8d4f647aa..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_table.sql
+++ /dev/null
@@ -1,35 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_RT";
-CREATE TABLE &1.."MDT_RT"  
-("MDT_RT_ID"        NUMBER            	NOT NULL ,
-"REGION_ID" 	    NUMBER           	NOT NULL , 
-"HEAD_ID"           NUMBER         	NOT NULL ,
-"LOWRUN" 	    NUMBER(8)      	NOT NULL , 
-"UPRUN" 	    NUMBER(8)      	NOT NULL , 
-"HISTOGRAM" 	    VARCHAR2(4000) 	NOT NULL ,
-"N_SEGS" 	    NUMBER(7)      	NOT NULL ,
-"AVER_ANGLE" 	    NUMBER(6,5)    	NOT NULL ,
-"DELTA_AVER_ANGLE"  NUMBER(6,5)	   	NOT NULL ,
-"AVER_SPREAD" 	    NUMBER(6,5)    	NOT NULL ,
-"DELTA_AVER_SPREAD" NUMBER(6,5)    	NOT NULL ,
-"CONVERGENCE" 	    NUMBER(7,4)    	NOT NULL ,
-"B_AVER" 	    NUMBER(3,2)    	NOT NULL ,
-"T_AVER"	    NUMBER(5,2)    	NOT NULL ,
-"HV"		    NUMBER(6,2)    	NOT NULL ,
-"CURR"  	    NUMBER(10,9)   	NOT NULL ,
-"GAS"		    NUMBER(5,2)         NOT NULL ,
-"CALIBFLAG"         NUMBER(3) DEFAULT 0 NOT NULL ,
-"VALIDFLAG"         NUMBER(3) DEFAULT 0 NOT NULL ,
-"SITE_NAME"         VARCHAR2(2) DEFAULT UPPER('&2') , 
-"INSERT_TIME"       VARCHAR2(19),
-CONSTRAINT "MDT_HEAD_RT_ID_REF"  FOREIGN KEY ("HEAD_ID", "SITE_NAME") REFERENCES &1.."MDT_HEAD"  ("HEAD_ID", "SITE_NAME")  VALIDATE ,
-CONSTRAINT "MDT_RT_ID_SITE_PR" PRIMARY KEY ("MDT_RT_ID", "SITE_NAME") VALIDATE , 
-CHECK ("UPRUN" >= "LOWRUN") VALIDATE ) 
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_trigger.sql
deleted file mode 100644
index 9dd72a554718..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_rt_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_rt_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_RT_TRIGGER;
-CREATE TRIGGER &1..MDT_RT_TRIGGER BEFORE
-INSERT ON &1.."MDT_RT" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..mdt_rt_sequence.NEXTVAL INTO :NEW.MDT_RT_ID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_RT_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_table.sql
deleted file mode 100644
index 5135ae4dcce0..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_table.sql
+++ /dev/null
@@ -1,67 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_tube_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."MDT_TUBE";
-CREATE TABLE &1.."MDT_TUBE" 
-( "SEQID" NUMBER NOT NULL,
-"TUBE_ID" NUMBER(10) NOT NULL ,
-"HEAD_ID" NUMBER NOT NULL , 
-"CHAMBER" varchar2(10) NOT NULL,
-"SITE_NAME" VARCHAR2(2) DEFAULT UPPER('&2') ,
-"INSERT_TIME" VARCHAR2(29),
-"LOWRUN" NUMBER(8) NOT NULL , 
-"UPRUN" NUMBER(8) NOT NULL , 
-"RUNFLAG" NUMBER(3) DEFAULT 0 NOT NULL , 
-"CALIBFLAG" NUMBER(3) DEFAULT 0 NOT NULL , 
-"VALIDFLAG" NUMBER(3) DEFAULT 0 NOT NULL , 
-"ENTRIES" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"CHISQUARE_1" BINARY_FLOAT DEFAULT -1 NOT NULL ,
-"CHISQUARE_2" BINARY_FLOAT DEFAULT -1 NOT NULL ,
-"P0" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P1" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P2" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P3" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P4" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P5" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P6" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P7" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P8" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P9" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"P0_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P1_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P2_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P3_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P4_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P5_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P6_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P7_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P8_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"P9_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"COV_1" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"COV_2" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"COV_3" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"COV_4" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_0" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"ADC_1" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"ADC_2" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_3" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_0_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_1_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_2_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_3_ERR" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_CHISQUARE" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_PEDESTAL" BINARY_FLOAT DEFAULT 0 NOT NULL ,
-"ADC_PEDESTAL_WIDTH" BINARY_FLOAT DEFAULT 0 NOT NULL , 
-"NHITS" NUMBER(6) DEFAULT 0 NOT NULL ,
-"NHITS_ABOVE_ADC_CUT" NUMBER(6)DEFAULT 0 NOT NULL ,
-"ALGO_FLAG" varchar2(12) DEFAULT 0 NOT NULL ,
-"TUBE_GROUPING" varchar2(12) DEFAULT 0 NOT NULL ,
-CONSTRAINT "HEAD_ID_SITE_REF" FOREIGN KEY ("HEAD_ID", "SITE_NAME") REFERENCES &1.."MDT_HEAD" ("HEAD_ID", "SITE_NAME") VALIDATE , 
-CONSTRAINT "SEQID_SITE_PR" PRIMARY KEY ("SEQID", "SITE_NAME") VALIDATE ,
-CHECK (uprun>=lowrun) VALIDATE ) 
-TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) LOGGING;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_trigger.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_trigger.sql
deleted file mode 100644
index 3de2046b9255..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/mdt_tube_trigger.sql
+++ /dev/null
@@ -1,21 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08 
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @mdt_tube_trigger.sql <USER_NAME>
-
---DROP TRIGGER &1..MDT_TUBE_TRIGGER;
-CREATE TRIGGER &1..MDT_TUBE_TRIGGER BEFORE
-INSERT ON &1.."MDT_TUBE" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
-BEGIN
-
-SELECT &1..mdt_tube_sequence.NEXTVAL INTO :NEW.SEQID FROM DUAL;
-SELECT TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH:MI AM') INTO :NEW.INSERT_TIME FROM DUAL;
-
-EXCEPTION
-WHEN OTHERS THEN
-       RAISE;
-END MDT_TUBE_TRIGGER;
-/
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_head.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_head.sql
deleted file mode 100644
index 27d7fc728cc5..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_head.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_head.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_HEAD_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_HEAD_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt.sql
deleted file mode 100644
index f616830bddac..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: Jul 07
--- VERSION v0r2
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_rt.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_RT_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_RT_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_cheby.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_cheby.sql
deleted file mode 100644
index 46905148965a..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_cheby.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_rt_cheby.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_RT_CHEBY_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_RT_CHEBY_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_r.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_r.sql
deleted file mode 100644
index 8aee6d192d1e..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_r.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_rt_map_r.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_RT_MAP_R_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_RT_MAP_R_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_s.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_s.sql
deleted file mode 100644
index f21210a92763..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_s.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_rt_map_s.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_RT_MAP_S_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_RT_MAP_S_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_t.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_t.sql
deleted file mode 100644
index 8335cb94b014..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_rt_map_t.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE:
---sqlplus <USER_NAME>/<USER_PASSWORD> @sequence_mdt_rt_map_t.sql <USER_NAME>
-
---DROP SEQUENCE &1.."MDT_RT_MAP_T_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_RT_MAP_T_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_tube.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_tube.sql
deleted file mode 100644
index 567dd55d0bf7..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sequence_mdt_tube.sql
+++ /dev/null
@@ -1,10 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE: 
---sqlplus sys/password @sequence_mdt_tube.sql <USER_NAME> 
-
---DROP SEQUENCE &1.."MDT_TUBE_SEQUENCE";
-CREATE SEQUENCE &1.."MDT_TUBE_SEQUENCE" NOCYCLE NOORDER NOCACHE NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sites_table.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sites_table.sql
deleted file mode 100644
index 0e9fa68a78a9..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/sites_table.sql
+++ /dev/null
@@ -1,11 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@roma3.infn.it
--- DATE: May 08
--- VERSION v1r1
-
---USAGE: 
---sqlplus sys/password @sites_table.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
---DROP TABLE &1.."SITES";
-CREATE TABLE &1.."SITES" ( "NAME" VARCHAR2(2), PRIMARY KEY ("NAME") VALIDATE ) TABLESPACE &4 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K BUFFER_POOL DEFAULT) NOLOGGING;
-INSERT INTO &1.."SITES" VALUES ( UPPER('&2') );
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal.sql
deleted file mode 100644
index 6e90ea9ab7d4..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08
--- VERSION v1r1
-
---View to select all fields of mdt_tube table and the rootfile from the matching mdt_head table for the last 10 calibrations (i.e. the 10th max values of MDT_HEAD.HEAD_ID)
---USAGE: 
---sqlplus sys/password @view_allTub_rootFile_last10Cal.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
-
---DROP VIEW &1.."VIEW_ALLTUB_ROOTFILE_LAST10CAL";
-CREATE VIEW &1.."VIEW_ALLTUB_ROOTFILE_LAST10CAL" 
-AS 
-select A.*, B.ROOTFILE from
-    (select * from &1..mdt_tube where head_id in
-                    (select head_id from
-                            (select distinct head_id from &1..mdt_head order by head_id desc)
-                            where rownum <= 10)) A INNER JOIN &1..mdt_head B
-ON A.HEAD_ID = B.HEAD_ID;
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal_ordered.sql b/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal_ordered.sql
deleted file mode 100644
index 13f817c9b71f..000000000000
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbScripts/share/view_allTub_rootFile_last10Cal_ordered.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- PROJECT: ATLAS MDT Calibration DB
--- AUTHOR: Elisabetta.Vilucchi@lnf.infn.it, celio@fis.uniroma3.it
--- DATE: May 08
--- VERSION v1r1
-
---View to select all fields of mdt_tube table and the rootfile from the matching mdt_head table for the last 10 calibrations (i.e. the 10th max values of MDT_HEAD.HEAD_ID)
---USAGE: 
---sqlplus sys/password @view_allTub_rootFile_last10Cal.sql <USER_NAME> <SITE_NAME>(2 characters like MU,MI,RM...) <USER_PASSOWRD> <TABLESPCE_NAME>
-
-
---DROP VIEW &1.."VIEW_ALLTUB_ROOT_LAST10CAL_ORD";
-CREATE VIEW &1.."VIEW_ALLTUB_ROOT_LAST10CAL_ORD" 
-AS 
-select A.*, B.ROOTFILE from
-    (select * from &1..mdt_tube where head_id in
-                    (select head_id from
-                            (select distinct head_id from &1..mdt_head order by head_id desc)
-                            where rownum <= 10)) A INNER JOIN &1..mdt_head B
-ON A.HEAD_ID = B.HEAD_ID order by seqid;
diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt
index 2319dac52c2c..e4bfa72fa677 100644
--- a/Projects/Athena/package_filters.txt
+++ b/Projects/Athena/package_filters.txt
@@ -69,7 +69,6 @@
 - MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibTools
 - MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibValidation
 - MuonSpectrometer/MuonCalib/MuonCalibAlgs
-- MuonSpectrometer/MuonCalib/MuonCalibDbScripts
 - MuonSpectrometer/MuonCalib/MuonCalibJobTransforms
 - MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg
 - MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools
-- 
GitLab


From 62ca01c8ccbb00f5b2b17f095fad87af1b1a8e44 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 18:45:13 +0200
Subject: [PATCH 019/217] Remove JetFitterCalibUtils: nothing was actually
 installed in the release

---
 .../JetFitterCalibUtils/CMakeLists.txt        |    7 -
 .../JetFitterCalibUtils/jetnetRoot/LinkDef.h  |   15 -
 .../jetnetRoot/TJetNet.cxx                    |  918 ---
 .../JetFitterCalibUtils/jetnetRoot/TJetNet.h  |  194 -
 .../jetnetRoot/TNetworkToHistoTool.cxx        |  230 -
 .../jetnetRoot/TNetworkToHistoTool.h          |   42 -
 .../jetnetRoot/TNeuralDataSet.cxx             |   94 -
 .../jetnetRoot/TNeuralDataSet.h               |   64 -
 .../jetnetRoot/TTrainedNetwork.cxx            |  154 -
 .../jetnetRoot/TTrainedNetwork.h              |   74 -
 .../jetnetRoot/doNormalization.C              |  101 -
 .../jetnetRoot/doTraining.C                   |   41 -
 .../JetFitterCalibUtils/jetnetRoot/jetnet.h   |  152 -
 .../jetnetRoot/jetnet_35.f                    | 5850 -----------------
 .../jetnetRoot/trainNN.cxx                    | 1015 ---
 .../likelihoodRoot/createAllHistograms.cxx    |   59 -
 .../likelihoodRoot/createTheHistograms.cxx    | 1349 ----
 .../likelihoodRoot/createTheHistograms.h      |   23 -
 .../likelihoodRoot/doCreateTheHistograms.C    |   11 -
 .../executeCreateAllHistograms.C              |   12 -
 .../likelihoodRoot/executeDoGetAllValues.C    |   14 -
 .../likelihoodRoot/macroDoGetAllValues.C      |   50 -
 .../likelihoodRoot/macroToGetAllValues.cxx    |  254 -
 .../likelihoodRoot/macroToGetAllValues.h      |   12 -
 .../likelihoodRoot/macroToMerge.C             |   65 -
 .../likelihoodRoot/writeNtuple.cxx            |  302 -
 .../doCalibrationForCOOL.C                    |   12 -
 .../prepareCalibrationFileForCOOL.C           |  233 -
 .../preparedatasets/collectionsToProcess.h    |   63 -
 .../getPtEtaCategoryLikelihood.h              |   73 -
 .../prepareAllNtuplesForLikelihood.C          |   13 -
 .../preparedatasets/prepareAllNtuplesForNN.C  |   13 -
 .../preparedatasets/readBaseBTagAnaTree.C     |   47 -
 .../preparedatasets/readBaseBTagAnaTree.h     |  149 -
 .../preparedatasets/readJFBTagAna.C           |   47 -
 .../preparedatasets/readJFBTagAna.h           |  173 -
 .../preparedatasets/writeNtupleAll.C          |   40 -
 .../preparedatasets/writeNtuple_Official.cxx  |  562 --
 .../preparedatasets/writeNtuple_Official.h    |   14 -
 .../sendToBatch/cleanAll.sh                   |   10 -
 .../sendToBatch/createDirectories.C           |    8 -
 .../sendToBatch/createDirectoriesMacro.C      |   32 -
 .../sendToBatch/sendToBatch_jetnet.sh         |   91 -
 .../sendToBatch/sendToBatch_likelihood.sh     |  109 -
 .../share/BTagAna_Rerun_forJetFitter.py       |  201 -
 45 files changed, 12992 deletions(-)
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/CMakeLists.txt
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/LinkDef.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.h
 delete mode 100755 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doNormalization.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doTraining.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet_35.f
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/trainNN.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createAllHistograms.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/doCreateTheHistograms.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeCreateAllHistograms.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeDoGetAllValues.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroDoGetAllValues.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToMerge.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/writeNtuple.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/doCalibrationForCOOL.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/prepareCalibrationFileForCOOL.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/collectionsToProcess.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/getPtEtaCategoryLikelihood.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForLikelihood.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForNN.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.h
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtupleAll.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.cxx
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.h
 delete mode 100755 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/cleanAll.sh
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectories.C
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectoriesMacro.C
 delete mode 100755 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_jetnet.sh
 delete mode 100755 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_likelihood.sh
 delete mode 100644 PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/share/BTagAna_Rerun_forJetFitter.py

diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/CMakeLists.txt
deleted file mode 100644
index 9a3151b8fdd5..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Package: JetFitterCalibUtils
-################################################################################
-
-# Declare the package name:
-atlas_subdir( JetFitterCalibUtils )
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/LinkDef.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/LinkDef.h
deleted file mode 100644
index e19ee3aa34e0..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/LinkDef.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifdef __CINT__
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ class TNeuralDataSet;
-#pragma link C++ class TJetNet;
-#pragma link C++ class TTrainedNetwork;
-
-#endif
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.cxx
deleted file mode 100644
index 3c9eccad9cd5..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.cxx
+++ /dev/null
@@ -1,918 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TJetNet.h"
-#include "jetnet.h"
-#include "TRandom3.h"
-#include "TTimeStamp.h"
-#include <unistd.h>
-#include <stdio.h>
-#include <cmath>
-#include "TTrainedNetwork.h"
-
-ClassImp( TJetNet )
- 
-//Constructors
-//______________________________________________________________________________
-TJetNet::TJetNet()
-{
-  // Default Constructor
-  mTestSetCnt = 0;
-  mTrainSetCnt = 0;
-  mLayerCount = 0;
-
-  mpLayers = 0;
-
-  mIsInitialized = kFALSE;
-  mInitLocked = kFALSE;
-
-  mpInputTrainSet = 0;
-  mpInputTestSet = 0;
-  mpOutputTrainSet = 0;
-  mpOutputTestSet = 0;
-
-  mEpochs = 0;
-  mCurrentEpoch = 0;
-}
-//______________________________________________________________________________
-TJetNet::TJetNet( Int_t aTestCount, Int_t aTrainCount,
-	 const Int_t aLayersCnt, const Int_t* aLayers )
-{
-  // Creates neural network with aLayersCnt number of layers,
-  // aTestCount number of patterns for the test set,
-  // aTrainCount patterns for the train set.
-  // aLayers contains the information for number of the units in the different layers
-
-  int i;
-  mDebug = kFALSE;
-#ifdef _DEBUG
-  mDebug = kTRUE;
-#endif
-  
-  if( mDebug ){ std::cout << "=====> Entering TJetNet::TJetNet(...)" << std::endl; }
-
-  mTestSetCnt  = aTestCount;
-  mTrainSetCnt = aTrainCount;
-  mLayerCount  = aLayersCnt; // Get the number of layers
-  
-  if( mLayerCount > 0 )
-  {  
-   //Perform deep copy of the array holding Layers count
-    mpLayers = new Int_t[ mLayerCount ];
-    for( i = 0; i < mLayerCount; ++i )
-    {
-      mpLayers[ i ] = aLayers[ i ];
-    }
-  }
-
-  mInputDim = mpLayers[ 0 ];
-  mOutputDim = mpLayers[ mLayerCount - 1 ];
-  mHiddenLayerDim = mLayerCount-2;
-  
-
-  mIsInitialized = kFALSE;
-  mInitLocked = kFALSE;
-
-  mpInputTrainSet  = new TNeuralDataSet( mTrainSetCnt, GetInputDim() );
-  mpInputTestSet = new TNeuralDataSet( mTestSetCnt, GetInputDim() );
-  mpOutputTrainSet = new TNeuralDataSet( mTrainSetCnt, GetOutputDim() );
-  mpOutputTestSet = new TNeuralDataSet( mTestSetCnt, GetOutputDim() );
-  
-  menActFunction=afSigmoid;
-
-  SetEpochs( -1 );
-
-  if( mDebug ){ std::cout << "=====> Leaving TJetNet::TJetNet(...)" << std::endl; }
-}
-//______________________________________________________________________________
-TJetNet::~TJetNet( void )
-{
-  // Default destructor
-  if( mDebug ){ std::cout << "=====> Entering TJetNet::~TJetNet(...)" << std::endl; }
-  delete [] mpLayers;
-  delete mpInputTestSet;
-  delete mpInputTrainSet;
-  delete mpOutputTestSet;
-  delete mpOutputTrainSet;
-  if( mDebug ){ std::cout << "=====> Leaving TJetNet::~TJetNet(...)" << std::endl; }
-}
-//______________________________________________________________________________
-//by Giacinto Piacquadio (18-02-2008)
-TTrainedNetwork* TJetNet::createTrainedNetwork() const
-{
-
-  Int_t nInput=GetInputDim();
-  Int_t nHidden=GetHiddenLayerDim();
-  std::vector<Int_t> nHiddenLayerSize;
-  //  Int_t* nHiddenLayerSize=new Int_t[nHidden];
-
-  for (Int_t o=0;o<nHidden;++o)
-  {
-    nHiddenLayerSize.push_back(GetHiddenLayerSize(o+1));
-  }
-  Int_t nOutput=GetOutputDim();
-
-  std::vector<TVectorD*> thresholdVectors;
-  std::vector<TMatrixD*> weightMatrices;
-
-  for (Int_t o=0;o<nHidden+1;++o)
-  {
-     int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
-     int sizePreviousLayer=(o==0)?nInput:nHiddenLayerSize[o-1];
-     thresholdVectors.push_back(new TVectorD(sizeActualLayer));
-     weightMatrices.push_back(new TMatrixD(sizePreviousLayer,sizeActualLayer));
-  }
-
-  for (Int_t o=0;o<nHidden+1;++o)
-  {
-
-    if (mDebug)
-    if (o<nHidden)
-    {
-      cout << " Iterating on hidden layer n.: " << o << endl;
-    }
-    else
-    {
-      cout << " Considering output layer " << endl;
-    }
-    
-    int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
-
-    for (Int_t s=0;s<sizeActualLayer;++s)
-    {
-      if (o<nHidden)
-      {
-	if (mDebug)
-	cout << " To hidden node: " << s << endl;
-      }
-      else
-      {
-	if (mDebug)
-	cout << " To output node: " << s << endl;
-      }
-      if (o==0)
-      {
-	for (Int_t p=0;p<nInput;++p)
-	{
-	  if (mDebug)
-	  cout << " W from inp nod: " << p << "weight: " <<
-	    GetWeight(o+1,s+1,p+1) << endl;
-	  weightMatrices[o]->operator() (p,s) = GetWeight(o+1,s+1,p+1);
-        }
-      }
-      else
-      {
-	for (Int_t p=0;p<nHiddenLayerSize[o-1];++p)
-	{
-	  if (mDebug)
-	  cout << " W from lay : " << o-1 << " nd: " << 
-	    p << " weight: " <<
-	    GetWeight(o+1,s+1,p+1) << endl;
-	  weightMatrices[o]->operator() (p,s)=GetWeight(o+1,s+1,p+1);
-	}
-      }
-      if (mDebug)
-      cout << " Threshold for node " << s << " : " << 
-	GetThreshold(o+1,s+1) << endl;
-      thresholdVectors[o]->operator() (s) = GetThreshold(o+1,s+1);
-    }
-  }
-
-  TTrainedNetwork* trainedNetwork=
-    new TTrainedNetwork(nInput,
-			nHidden,
-			nOutput,
-			nHiddenLayerSize,
-			thresholdVectors,
-			weightMatrices,
-			menActFunction);
-						
-  return trainedNetwork;
-
-}
-//______________________________________________________________________________
-//by Giacinto Piacquadio (18-02-2008)
-void TJetNet::readBackTrainedNetwork(const TTrainedNetwork* trainedNetwork)
-{
-
-  Int_t nInput=GetInputDim();
-  Int_t nHidden=GetHiddenLayerDim();
-  std::vector<Int_t> nHiddenLayerSize;
-
-  if (trainedNetwork->getnHidden()!=nHidden)
-  {
-    cout << " Network doesn't match.. not loading.." << endl;
-    return;
-  }
-
-  for (Int_t o=0;o<nHidden;++o)
-  {
-    nHiddenLayerSize.push_back(GetHiddenLayerSize(o+1));
-    if (nHiddenLayerSize[o]!=trainedNetwork->getnHiddenLayerSize()[o])
-    {
-      cout << " Network doesn't match... not loading..." << endl;
-      return;
-    }
-  }
-  Int_t nOutput=GetOutputDim();
-
-  if (trainedNetwork->getnInput()!=nInput)
-  {
-    cout << " Network doesn't match... not loading.." << endl;
-    return;
-  }
-
-
-  if (trainedNetwork->getnOutput()!=nOutput)
-  {
-    cout << " Network doesn't match.. not loading.." << endl;
-    return;
-  }
-  
-  //OK, everything matches... can go on...
-  
-  std::vector<TVectorD*> thresholdVectors=trainedNetwork->getThresholdVectors();
-  std::vector<TMatrixD*> weightMatrices=trainedNetwork->weightMatrices();
-  //ownership remains of the TTrainedNetwork
-
-  for (Int_t o=0;o<nHidden+1;++o)
-  {
-    int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
-    int sizePreviousLayer=(o==0)?nInput:nHiddenLayerSize[o-1];
-  
-    for (Int_t s=0;s<sizeActualLayer;++s)
-    {
-      Double_t nodeValue=0.;
-      if (o==0)
-      {
-	for (Int_t p=0;p<nInput;++p)
-	{
-	  mSetWeight(weightMatrices[o]->operator() (p,s),o+1,s+1,p+1);
-        }
-      }
-      else
-      {
-	for (Int_t p=0;p<nHiddenLayerSize[o-1];++p)
-	{
-	  mSetWeight(weightMatrices[o]->operator() (p,s),o+1,s+1,p+1);
-	}
-      }
-      mSetThreshold(thresholdVectors[o]->operator() (s),o+1,s+1);
-    }
-  }      
-  cout << " Successfully read back Trained Network " << endl;
-}
-//______________________________________________________________________________
-  
-void TJetNet::mSetWeight( Double_t weight,Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd )
-{
-  JNINT1.W[ JNINDX( aLayerInd, aNodeInd, aConnectedNodeInd )-1 ]=weight;
-}
-//______________________________________________________________________________
-void TJetNet::mSetThreshold( Double_t threshold, Int_t aLayerInd, Int_t aNodeInd)
-{
-  JNINT1.T[ JNINDX( aLayerInd, aNodeInd, 0 )-1 ]=threshold;
-}
-//______________________________________________________________________________
-void TJetNet::Print( void )
-{
-  // Prints on the screen, information for the neural network
-  Int_t i;
-
-  std::cout << "TJetNet" << std::endl;
-  std::cout << "Number of layers: " << mLayerCount << std::endl;
-
-  for( i = 0; i < mLayerCount; i++ )
-  {
-      std::cout << "\t\tNumber of units in layer " << i << " : " <<  mpLayers[ i ] << std::endl;
-  }
-
-  std::cout << "Epochs: " << GetEpochs() << std::endl;
-  std::cout << "Updates Per Epoch: " << GetUpdatesPerEpoch() << std::endl;
-  std::cout << "Updating Procedure: " << GetUpdatingProcedure() << std::endl;
-  std::cout << "Error Measure: " << GetErrorMeasure() << std::endl;
-  std::cout << "Patterns Per Update: " << GetPatternsPerUpdate() << std::endl;
-  std::cout << "Learning Rate: " << GetLearningRate() << std::endl;
-  std::cout << "Momentum: " << GetMomentum() << std::endl;
-  std::cout << "Initial Weights Width: " << GetInitialWeightsWidth() << std::endl;
-  std::cout << "Learning Rate Decrease: " << GetLearningRateDecrease() << std::endl;
-  std::cout << "Activation Function: " << GetActivationFunction() << std::endl;
-}
-//______________________________________________________________________________
-Double_t TJetNet::Test( void )
-{
-  // Initiate test cycle of the neural network
-  Int_t NRight = 0;
-  Double_t fMeanError = 0.0;
-  Double_t *TMP;
-  Int_t  NPatterns = GetTestSetCnt();
- 
-  for( Int_t iPattern = 0; iPattern < NPatterns; iPattern++ )
-  {
-
-      for( Int_t i = 0; i < GetInputDim(); i++ )
-      {
-	JNDAT1.OIN[ i ] = float ( GetInputTestSet( iPattern, i ) );
-      }
-
-      JNTEST();
-
-      for( Int_t j = 0; j < GetOutputDim(); j++ )
-      {
-	fMeanError+=
-	  std::pow(JNDAT1.OUT[ j ]-float( GetOutputTestSet( iPattern, j )),2)/(float)GetOutputDim();
-      }
-
-      if( mDebug ) std::cout << "Testing [ " << iPattern << " ] - "  << JNDAT1.OIN[ 0 ] 
-			     << " => " << JNDAT1.OUT[ 0 ] << std::endl;
-
-    }
-
-  fMeanError/=2.*NPatterns;
-
-  if (mDebug)
-  std::cout << " Test error: " << fMeanError << endl;
-
-  return fMeanError;
-}
-//______________________________________________________________________________
-Double_t TJetNet::Train( void )
-{
-  // Initiate the train phase for the neural network
-  Int_t NRight = 0;
-  Double_t fMeanError = 0.0;
-  Int_t  NPatterns = GetTrainSetCnt();
-
-  //  cout << " NPatterns is: " << NPatterns << endl;
-
-  Int_t inputDim=GetInputDim();
-  Int_t outputDim=GetOutputDim();
-  Int_t updatesPerEpoch=GetUpdatesPerEpoch();
-  Int_t patternsPerUpdate=GetPatternsPerUpdate();
-  
-  if (updatesPerEpoch*patternsPerUpdate<1./2.*NPatterns) 
-  {
-    cout << "Using only: " << updatesPerEpoch*patternsPerUpdate << 
-        " patterns on available: " << NPatterns << endl;
-  } else if (updatesPerEpoch*patternsPerUpdate>NPatterns) 
-  {
-    cout << " Trying to use " << updatesPerEpoch*patternsPerUpdate << 
-        " patterns, but available: " << NPatterns << endl;
-    return -100;
-  }
-  
-  for( Int_t iPattern = 0; iPattern < updatesPerEpoch*patternsPerUpdate;
-       iPattern++ )
-  {
-    for( Int_t i = 0; i < inputDim; i++ )
-    {
-      JNDAT1.OIN[ i ] = float ( GetInputTrainSet( iPattern, i ) );
-    }
-    
-    for( Int_t j = 0; j < outputDim; j++ )
-    {
-      JNDAT1.OUT[ j ] = float ( GetOutputTrainSet( iPattern, j ) );
-    }
-    JNTRAL();
-  }
-
-  return GetPARJN(8);
-}
-//______________________________________________________________________________
-void TJetNet::writeNetworkInfo(Int_t typeOfInfo)
-{
-  cout << " Invoking info of type: " << typeOfInfo << endl;
-  JNSTAT(typeOfInfo);
-}  
-//______________________________________________________________________________
-void TJetNet::Init( void )
-{
-  // Initializes the neuaral network
-  Int_t i;
-  JNDAT1.MSTJN[ 0 ] = mLayerCount; // Set the number of layers
-
-  // Set the number of nodes for each layer
-  for( i = 0; i < mLayerCount; i++ )
-  {
-    if ( mDebug ) std::cout << "Layer " << i + 1 << " has " << mpLayers[ i ] << " units." << std::endl; 
-    JNDAT1.MSTJN[ 9 + i ] = mpLayers[ i ]; 
-  }
-   
-  cout << " calling JNINIT " << endl;
-  JNINIT();
-  cout << " finishing calling JNINIT " << endl;
-  mIsInitialized = kTRUE;
-}
-//______________________________________________________________________________
-Int_t TJetNet::Epoch( void )
-{
-  // Initiate one train/test step the network. 
-
-  Double_t aTrain, aTest;
-  if ( mCurrentEpoch < mEpochs )
-  {
-      mCurrentEpoch++;
-      aTrain = Train();
-
-      //      if (mCurrentEpoch%2)
-
-      //      std::cout << " Calls to MSTJN: " << GetMSTJN(6) << 
-      //	std::endl;
-
-      if ( mDebug ) 
-      {
-
-
-	std::cout << "[ " << mCurrentEpoch << " ] Train: " << aTrain << std::endl;
-      }
-      if ( ( mCurrentEpoch % 2 ) == 0 )
-      {
-	  aTest = Test();
-	  //	  if ( mDebug )
-	  std::cout << "[" << mCurrentEpoch << "]: " << GetPARJN(8) << " ";
-	  std::cout << "Test: " << aTest << std::endl;
-      }
-  }
-  return mCurrentEpoch;
-}
-//______________________________________________________________________________
-void TJetNet::SetInputTrainSet( Int_t aPatternInd, Int_t aInputInd, Double_t aValue )
-{
-  // Changes the value of the cell corresponding to unit aInputInd in pattern aPatternInd into INPUT TRAIN set
-  mpInputTrainSet->SetData( aPatternInd, aInputInd, aValue );
-}
-//______________________________________________________________________________
-void TJetNet::SetOutputTrainSet( Int_t aPatternInd, Int_t aOutputInd, Double_t aValue )
-{
-  // Changes the value of the cell corresponding to unit aInputInd in pattern aPatternInd into OUTPUT TRAIN set
-  mpOutputTrainSet->SetData( aPatternInd, aOutputInd, aValue );
-}
-//______________________________________________________________________________
-void TJetNet::SetInputTestSet( Int_t aPatternInd, Int_t aInputInd, Double_t aValue )
-{
-  // Changes the value of the cell corresponding to unit aInputInd in pattern aPatternInd into INPUT TEST set
-  mpInputTestSet->SetData( aPatternInd, aInputInd, aValue );
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetOutputTrainSet( Int_t aPatternInd, Int_t aOutputInd )
-{
-  // Returns the value of the cell corresponding to unit aInputInd in pattern aPatternInd into OUTPUT TRAIN set
-  return mpOutputTrainSet->GetData( aPatternInd, aOutputInd );
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetInputTestSet( Int_t aPatternInd, Int_t aInputInd )
-{
-  // Returns the value of the cell corresponding to unit aInputInd in pattern aPatternInd into INPUT TEST set
-  return mpInputTestSet->GetData( aPatternInd, aInputInd );
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetOutputTestSet( Int_t aPatternInd, Int_t aOutputInd )
-{
-  // Returns the value of the cell corresponding to unit aInputInd in pattern aPatternInd into OUTPUT TEST set
-  return mpOutputTestSet->GetData( aPatternInd, aOutputInd );
-}
-//______________________________________________________________________________
-void  TJetNet::SaveDataAscii( TString aFileName )
-{
-  // Saves the Input/Output test and train data in plain text file
-  ofstream out;
-  int i, j;
-
-  // Open ASCII file
-  out.open( aFileName );
-
-  //Write the number of layers, including the input and output
-  out << mLayerCount << std::endl;
-
-  // Write into the file the number of units in input, hidden and output layers  
-  for ( i = 0; i < mLayerCount; i++ ) out << mpLayers[ i ] << " ";
-  out << std::endl;
-
-  // Write the size of Train and Test sets 
-  out << mTrainSetCnt << " " << mTestSetCnt << std::endl;
-
-  // Dump the Train set : Input1 Input2 ... InputN Output1 Output2 ... OutputN
-  for ( i = 0; i < mTrainSetCnt; i++ )
-  {
-    out << GetInputTrainSet( i, 0 );
-    for( j = 1; j < mpLayers[ 0 ]; j++ ) out << " " << GetInputTrainSet( i, j );
-    for( j = 0; j < mpLayers[ mLayerCount - 1 ]; j++ ) out << " " << GetOutputTrainSet( i, j );
-    out << std::endl;
-  }
-
- // Dump the Test set : Input1 Input2 ... InputN Output1 Output2 ... OutputN
-  for ( i = 0; i < mTestSetCnt; i++ )
-  {
-    out << GetInputTestSet( i, 0 );
-    for( j = 1; j < mpLayers[ 0 ]; j++ ) out << " " << GetInputTestSet( i, j );
-    for( j = 0; j < mpLayers[ mLayerCount - 1 ]; j++ ) out << " " << GetOutputTestSet( i, j );
-    out << std::endl;
-  }
-  // Close the file
-  out.close();
-}
-//______________________________________________________________________________
-void  TJetNet::LoadDataAscii( TString aFileName )
-{
-  // Loads the input/output test/train data from plain text file 
-  ifstream in;
-  int i, j, k, l, m;
-  int aiParam[ 5 ];//iTrainCount, iTestCount, iInputDim, iHiddenDim, iOutputDim;
-  Bool_t bFlag;
-  Double_t tmp;
-  Int_t iPatternLength;
-
-  in.open( aFileName );
-  bFlag = Bool_t( in.is_open() );
-  if ( in )
-  { 
-    in >> mLayerCount;
-    if( mDebug ){ std::cout << "Layers Count Set to " << mLayerCount << std::endl;}
-    i = 0;
-
-    delete [] mpLayers;
-    mpLayers = new Int_t[ mLayerCount ];
-
-    if( mDebug ){ std::cout << "Updating the Layers Nodes Counters..." << std::endl; }
-    while( ( i < mLayerCount ) && ( !in.eof() ) )
-    {
-      in >> mpLayers[ i ];
-      if( mDebug ){ std::cout << "Layer [ " << i + 1 << " ] has " << mpLayers[ i ] << " units" << std::endl; }
-      i++;
-    }
-
-    mInputDim = mpLayers[ 0 ];
-    mOutputDim = mpLayers[ mLayerCount - 1 ];
-    mHiddenLayerDim = mLayerCount-2;
-
-    //Get the patterns count per line 
-    iPatternLength = mInputDim + mOutputDim;
-    if( mDebug ){ std::cout << "Patterns per line = " << iPatternLength << std::endl; } 
-    in >> mTrainSetCnt;
-    if( mDebug ){ std::cout << "Train Set has " << mTrainSetCnt << " patterns." << std::endl; }
-    in >> mTestSetCnt;
-    if( mDebug ){ std::cout << "Test Set has " << mTestSetCnt << " patterns." << std::endl; }
-    
-    delete mpInputTestSet;
-    delete mpInputTrainSet;
-    delete mpOutputTestSet;
-    delete mpOutputTrainSet;
-    
-    mpInputTrainSet  = new TNeuralDataSet( mTrainSetCnt, GetInputDim() );
-    mpInputTestSet   = new TNeuralDataSet( mTestSetCnt, GetInputDim() );
-    mpOutputTrainSet = new TNeuralDataSet( mTrainSetCnt, GetOutputDim() );
-    mpOutputTestSet  = new TNeuralDataSet( mTestSetCnt, GetOutputDim() );
-
-    i = 0;
-    j = 0;
-    
-    while( ( i < ( mTrainSetCnt + mTestSetCnt ) ) && ( !in.eof() ) )
-    {
-      j = 0;
-      while( ( j < iPatternLength ) && ( !in.eof() ) )
-      {
-	if( i < mTrainSetCnt )
-	{
-	  if( j < mInputDim )
-	  {
-	    //Train Input Set
-	    in >> tmp;
-	    SetInputTrainSet( i, j, tmp );
-	  }
-	  else 
-	  {
-	    //Train Output Set 
-	    m = j - mInputDim;
-	    in >> tmp;
-	    SetOutputTrainSet( i, m, tmp );
-	  }
-	}
-	else
-	{
-	  l = i - mTrainSetCnt;
-	  if( j < mInputDim )
-	    {
-	      //Test Input Set
-	      in >> tmp;
-	      SetInputTestSet( l, j, tmp );
-	    }
-          else
-	    {
-	      //Test Output Set
-	      m = j - mInputDim;
-	      in >> tmp;
-	      SetOutputTestSet( l, m, tmp );
-	    }
-
-	}    
-	j++;
-      }
-      i++;
-    }
-  }
-  in.close();
-}
-//______________________________________________________________________________
-void  TJetNet::SaveDataRoot( TString aFileName )
-{
-  // Saves the neural network in ROOT file
-}
-//______________________________________________________________________________
-void  TJetNet::LoadDataRoot( TString aFileName )
-{
-  // Loads the neural network from ROOT file
-}
-//______________________________________________________________________________
-void TJetNet::Evaluate(  )
-{
-  //evaluates directly the input provided through SetInputs()
-  JNTEST();
-}
-//______________________________________________________________________________
-void TJetNet::Evaluate( Int_t aPattern  )
-{
-  // Evaluates the network output form the input data specified by the Test Pattern
-  for( Int_t i = 0; i < GetInputDim(); i++ )
-  {
-	JNDAT1.OIN[ i ] = float ( GetInputTestSet( aPattern, i ) );
-  }
-  JNTEST();
-}
-//______________________________________________________________________________
-void TJetNet::SetInputs( Int_t aIndex, Double_t aValue )
-{
-  // Directly sets the inputs of the network 
-  JNDAT1.OIN[ aIndex ] = float ( aValue );
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetOutput( Int_t aIndex )
-{
-  // Returns the output of the network 
-  return Double_t ( JNDAT1.OUT[ aIndex ] );
-}
-//______________________________________________________________________________
-void TJetNet::DumpToFile( TString aFileName )
-{
-  // Dumps the network data into JETNET specific format
-  JNDUMP( -8 );
-  std::cout << close( 8 ) << std::endl;
-  rename( "./fort.8", aFileName );
-}
-//______________________________________________________________________________
-void TJetNet::ReadFromFile( TString aFileName )
-{
-  // Loads the network from JETNET specific file
-  rename( aFileName, "./fort.12" );
-  JNREAD( -12 );
-  Reinitialize();
-  rename( "./fort.12", aFileName );
-  //std::cout << close( 12 ) << std::endl;
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetWeight( Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd ) const
-{
-  // Returns the node weight in specific Layer
-  return Double_t ( JNINT1.W[ JNINDX( aLayerInd, aNodeInd, aConnectedNodeInd )-1 ] );
-  //GP: ONE HAS TO PAY ATTENTION TO THIS STUPID -1!!!
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetThreshold( Int_t aLayerInd, Int_t aNodeInd) const
-{
-  //Returns the node threshold in the specific layer
-  return Double_t ( JNINT1.T[ JNINDX( aLayerInd, aNodeInd, 0 )-1 ] );
-  //GP: ONE HAS TO PAY ATTENTION TO THIS STUPID -1!!!
-}
-//______________________________________________________________________________
-void TJetNet::SelectiveFields( Int_t aLayerA, Int_t aNodeA1, Int_t aNodeA2, Int_t aNodeB1, Int_t aNodeB2, Int_t aSwitch )
-{
-  // JetNet Selective Fields
-  Int_t tmp, i1, i2, j1, j2;
-
-  if( ( aLayerA > 0 ) && ( aLayerA < mLayerCount ) )
-  {
-    i1 = TMath::Abs( aNodeA1 ); 
-    i2 = TMath::Abs( aNodeA2 );
-    j1 = TMath::Abs( aNodeB1 ); 
-    j2 = TMath::Abs( aNodeB2 );
-
-    if( i1 > i2 )
-    {
-      tmp = i1;
-      i1 = i2;
-      i2 = i1;
-    }//if
-
-    if( i1 > i2 )
-    {
-      tmp = i1;
-      i1 = i2;
-      i2 = i1;
-    }//if
-
-    if( ( i1 < mpLayers[ aLayerA ] ) && ( i2 < mpLayers[ aLayerA ] ) && 
-	( j1 < mpLayers[ aLayerA - 1 ] ) && ( j2 < mpLayers[ aLayerA - 1 ] ) )
-    {
-      JNSEFI( aLayerA, i1, i2, j1, j2, aSwitch );
-    }//if
-  } //if
-}
-//______________________________________________________________________________
-void TJetNet::Reinitialize( void )
-{
-  //Initializes the settings of the network
-    Int_t i;
-    
-   mLayerCount = JNDAT1.MSTJN[ 0 ]; // Set the number of layers
-   
-   delete [] mpLayers;
-   mpLayers = new Int_t[ mLayerCount ];
-   
-  // Set the number of nodes for each layer
-  for( i = 0; i < mLayerCount; i++ )
-  {
-    mpLayers[ i ] = JNDAT1.MSTJN[ 9 + i ]; 
-  }
-  
-  mpInputTrainSet  = new TNeuralDataSet( mTrainSetCnt, GetInputDim() );
-  mpInputTestSet   = new TNeuralDataSet( mTestSetCnt, GetInputDim() );
-  mpOutputTrainSet = new TNeuralDataSet( mTrainSetCnt, GetOutputDim() );
-  mpOutputTestSet  = new TNeuralDataSet( mTestSetCnt, GetOutputDim() );
-
-  mInputDim = mpLayers[ 0 ];
-  mOutputDim = mpLayers[ mLayerCount - 1 ];
-  mHiddenLayerDim = mLayerCount-2;
-
-
-}  
-//______________________________________________________________________________
-void TJetNet::Normalize( void )
-{
-  // Normilizes Inputs (both test and train)
-  mpInputTrainSet->Normalize();
-  mpInputTestSet->Normalize();
-}
-//______________________________________________________________________________
-void TJetNet::Randomize( void )
-{
-  // Randomizes Inputs and Outputs of both train and test sets
-  mpInputTrainSet->Randomize();
-  mpInputTestSet->Randomize();
-  mpOutputTrainSet->Randomize();
-  mpOutputTestSet->Randomize();
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetUnitCount( Int_t aLayer )
-{ 
-  // Returns the number of the units in specfic layer
-  if( ( aLayer > -1 ) && ( aLayer < mLayerCount ) ) 
-    return JNDAT1.MSTJN[ 9 + aLayer ]; 
-}
-//______________________________________________________________________________
-void TJetNet::SetUpdatesPerEpoch( Int_t aValue )
-{ 
-  // Sets the number of the updates per epoch
-  JNDAT1.MSTJN[ 8 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetUpdatingProcedure( Int_t aValue )
-{  
-  // Set specific weights update function
-  JNDAT1.MSTJN[ 4 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetErrorMeasure( Int_t aValue )
-{  
-  JNDAT1.MSTJN[ 3 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetActivationFunction( Int_t aValue )
-{ 
-  // Set the kind of activation function used
-  JNDAT1.MSTJN[ 2 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetPatternsPerUpdate( Int_t aValue )
-{ 
-  JNDAT1.MSTJN[ 1 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetLearningRate( Double_t aValue )
-{ 
-  // Change the Learning Rate
-  JNDAT1.PARJN[ 0 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetMomentum( Double_t aValue )
-{ 
-  JNDAT1.PARJN[ 1 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetInitialWeightsWidth( Double_t aValue )
-{ 
-  JNDAT1.PARJN[ 3 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-void TJetNet::SetLearningRateDecrease( Double_t aValue )
-{ 
-  JNDAT1.PARJN[ 10 ] = aValue; 
-  if( !mInitLocked ) this->Init();
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetUpdatesPerEpoch( void )
-{ 
-  return JNDAT1.MSTJN[ 8 ]; 
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetUpdatingProcedure( void )
-{  
-  return JNDAT1.MSTJN[ 3 ]; 
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetErrorMeasure( void )
-{ 
-  return JNDAT1.MSTJN[ 3 ]; 
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetActivationFunction( void )
-{ 
-  return JNDAT1.MSTJN[ 2 ]; 
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetPatternsPerUpdate( void )
-{ 
-  return JNDAT1.MSTJN[ 1 ]; 
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetLearningRate( void )
-{ 
-  return JNDAT1.PARJN[ 0 ]; 
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetMomentum( void )
-{ 
-  return JNDAT1.PARJN[ 1 ]; 
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetInitialWeightsWidth( void )
-{ 
-  return JNDAT1.PARJN[ 3 ]; 
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetLearningRateDecrease( void )
-{ 
-  return JNDAT1.PARJN[ 10 ]; 
-}
-//______________________________________________________________________________
-Int_t TJetNet::GetMSTJN( Int_t aIndex )
-{
-  return JNDAT1.MSTJN[ aIndex ]; 
-}
-//______________________________________________________________________________
-Double_t TJetNet::GetPARJN( Int_t aIndex )
-{
-  return JNDAT1.PARJN[ aIndex ];
-}
-//______________________________________________________________________________
-void TJetNet::SetMSTJN( Int_t aIndex, Int_t aValue )
-{
-  JNDAT1.MSTJN[ aIndex ] = aValue;
-}
-//______________________________________________________________________________
-void TJetNet::SetPARJN( Int_t aIndex, Double_t aValue )
-{
-  JNDAT1.PARJN[ aIndex ] = aValue;
-}
-//______________________________________________________________________________
-void TJetNet::Shuffle( Bool_t aShuffleTrainSet, Bool_t aShuffleTestSet )
-{
-  // Shuffles the train and/or test input/output sets
-  TTimeStamp ts;
-  Int_t Seed = ts.GetSec();
-  if ( aShuffleTrainSet )
-  {
-    
-    mpInputTrainSet->Shuffle( Seed );
-    mpOutputTrainSet->Shuffle( Seed );
-  }
-  //Shuffle Test Set
-  if ( aShuffleTestSet )
-  {
-    Seed = ts.GetSec();
-    mpInputTestSet->Shuffle( Seed );
-    mpOutputTestSet->Shuffle( Seed );
-  }
-
-  return;
-} 
-
-
-//EOF
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.h
deleted file mode 100644
index 504650c78354..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TJetNet.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/* 
- ROOT Interface to JETNET
- Author: Vassil Verguilov
- Created: 2005.02.22 14:07 EET
- Revisited and extended by: Giacinto Piacquadio (Freiburg University)
- (ATLAS - 18-02-2008)
-*/
-
-
-
-#ifndef __TJETNET_
-#define __TJETNET_
-
-//______________________________________________________________________________
-//
-// TJetNet
-//
-// This class is a ROOT wrapper for jetnet library.
-//
-//______________________________________________________________________________
-//
-
-//#define _DEBUG
-
-#include "TROOT.h"
-#include "TObject.h"
-#include "Riostream.h"
-#include "TNeuralDataSet.h"
-#include "TF1.h"
-
-class TTrainedNetwork;
-
-
-//typedef ActivationFunction  TActivationFunction;
-
-class TJetNet : public TObject
-{
- public:
-  
-  TJetNet( void );
-
-  TJetNet( Int_t aTestCount, Int_t aTrainCount, const Int_t aLayersCnt, const Int_t* aLayers );
-
-  virtual ~TJetNet( void );
-  
-  void Print( void );
-  
-  Int_t GetTrainSetCnt( void ) const { return mTrainSetCnt; };
-  Int_t GetTestSetCnt( void ) const { return mTestSetCnt; };
-  Int_t GetInputDim( void ) const { return mpLayers[ 0 ]; };
-  Int_t GetHiddenLayerDim( void ) const { return mHiddenLayerDim; };
-  Int_t GetHiddenLayerSize(Int_t number) const { return mpLayers[ number ]; };
-  Int_t GetOutputDim( void ) const { return mpLayers[ mLayerCount - 1 ]; };
-
-  void SetInputTrainSet( Int_t aPatternInd, Int_t aInputInd, Double_t aValue );
-  void SetOutputTrainSet( Int_t aPatternInd, Int_t aOutputInd, Double_t aValue );
-  void SetInputTestSet( Int_t aPatternInd, Int_t aInputInd, Double_t aValue );
-  void SetOutputTestSet( Int_t aPatternInd, Int_t aOutputInd, Double_t aValue );
-  
-  Double_t GetInputTrainSet( Int_t aPatternInd, Int_t aInputInd );
-  Double_t GetOutputTrainSet( Int_t aPatternInd, Int_t aOutputInd );
-  Double_t GetInputTestSet( Int_t aPatternInd, Int_t aInputInd );
-  Double_t GetOutputTestSet( Int_t aPatternInd, Int_t aOutputInd );
-  
-  Double_t GetWeight( Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd ) const; 
-  Double_t GetThreshold( Int_t aLayerInd, Int_t aNodeInd) const;
-
-  Int_t GetEpochs( void ) { return mEpochs; };
-  void SetEpochs( const Int_t aEpochs ) { mEpochs = aEpochs; mCurrentEpoch = 0; };
-  void Init( void );
-
-  Double_t Train( void );
-  Int_t Epoch( void );
-  Double_t Test( void );
-
-  void Shuffle ( Bool_t aShuffleTrainSet = true, Bool_t aShuffleTestSet = true );
- 
-  void SaveDataAscii( TString aFileName = "jndata.dat" );
-  void SaveDataRoot( TString aFileName = "jndata.root" );
-
-  void LoadDataAscii( TString aFileName = "jndata.dat" );
-  void LoadDataRoot( TString aFileName = "jndata.root" );
-  
-  void DumpToFile( TString aFileName = "fort.8" );
-  void ReadFromFile( TString aFileName = "fort.8" );
-
-  Double_t GetOutput( Int_t aIndex = 0 );
-  void SetInputs( Int_t aIndex = 0, Double_t aValue = 0.0 );
-  void Evaluate( Int_t aPattern );
-  void Evaluate();
-
-  void writeNetworkInfo(Int_t typeOfInfo = 0);
-
-  Int_t GetLayerCount( void ){ return mLayerCount; };
-  //Number of layers in NN
-  Int_t GetUnitCount( Int_t aLayer );
-  //Number of units in NN  
-
-  void SelectiveFields( Int_t aLayerA, Int_t aNodeA1, Int_t aNodeA2, Int_t aNodeB1, Int_t aNodeB2, Int_t aSwitch = 0 );
-  
-  void SetUpdatesPerEpoch( Int_t aValue );
-    void SetUpdatingProcedure( Int_t aValue );
-    void SetErrorMeasure( Int_t aValue );
-    void SetActivationFunction( Int_t aValue );
-    void SetPatternsPerUpdate( Int_t aValue );
-    void SetLearningRate( Double_t aValue );
-    void SetMomentum( Double_t aValue );
-    void SetInitialWeightsWidth( Double_t aValue );
-    void SetLearningRateDecrease( Double_t aValue );
-
-
-    Int_t GetUpdatesPerEpoch( void );
-    Int_t GetUpdatingProcedure( void );
-    Int_t GetErrorMeasure( void );
-    Int_t GetActivationFunction( void );
-    Int_t GetPatternsPerUpdate( void );
-    Double_t GetLearningRate( void );
-    Double_t GetMomentum( void );
-    Double_t GetInitialWeightsWidth( void );
-    Double_t GetLearningRateDecrease( void );
-    
-    void LockInit( void ){ mInitLocked = kTRUE; };
-    void UnlockInit( void ){ mInitLocked = kFALSE; };
-    Int_t GetMSTJN( Int_t aIndex );
-    Double_t GetPARJN( Int_t aIndex );
-    void SetMSTJN( Int_t aIndex, Int_t aValue );
-    void SetPARJN( Int_t aIndex, Double_t aValue );
-  
-    void Normalize( void );
-    void Randomize( void );
-
-    TTrainedNetwork* createTrainedNetwork() const;
-    void readBackTrainedNetwork(const TTrainedNetwork*);
-
-    enum TActivationFunction {
-      afSigmoid = 1,
-      afTanh    = 2,
-      afExp     = 3,
-      afLinear  = 4,
-      afSigmoidEntropy = 5
-    };
-    
-private:
-  
-  void mSetWeight( Double_t weight,Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd ); 
-  void mSetThreshold( Double_t threshold, Int_t aLayerInd, Int_t aNodeInd);
-
-  Int_t CopyFile( TString aSrcFile, TString aDestFile );
-  void Reinitialize( void ); // Synchronizing the paramaters of the class object from JETNET parameters
-
-  TActivationFunction menActFunction;
-
-  Int_t  mLayerCount; // Number of Layers (including the input and output)
-  Int_t* mpLayers; //! Array which contains the number of units in each layer 
-
-  TNeuralDataSet* mpInputTrainSet;
-  TNeuralDataSet* mpOutputTrainSet;
-  TNeuralDataSet* mpInputTestSet;
-  TNeuralDataSet* mpOutputTestSet;
-
-  Int_t mTrainSetCnt, mTestSetCnt; // Size of Train and Test set
-
-  Int_t mInputDim; // Number of the elements in intput layer
-  Int_t mHiddenLayerDim; // Number of Hidden Layers
-  Int_t mOutputDim; // Number of outputs
-  Int_t mEpochs;    // Epochs
-  Int_t mCurrentEpoch;    // Current epoch
-  Bool_t mDebug; // Debug Flag
-  Bool_t mIsInitialized;
-  Bool_t mInitLocked;
-
-  ClassDef( TJetNet, 1 )
-}; 
-
-inline void TJetNet::SetOutputTestSet( Int_t aPatternInd, Int_t aOutputInd, Double_t aValue )
-{
-  // Changes the value of the cell corresponding to unit aInputInd in pattern aPatternInd into OUTPUT TEST set
-  mpOutputTestSet->SetData( aPatternInd, aOutputInd, aValue );
-}
-//______________________________________________________________________________
-inline Double_t TJetNet::GetInputTrainSet( Int_t aPatternInd, Int_t aInputInd )
-{
-  // Returns the value of the cell corresponding to unit aInputInd in pattern aPatternInd into INPUT TRAIN set
-  return mpInputTrainSet->GetData( aPatternInd, aInputInd );
-}
-//______________________________________________________________________________
-
-
-#endif
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.cxx
deleted file mode 100644
index 7cc7fad81528..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <TH1F.h>
-#include <TH2F.h>
-#include "TTrainedNetwork.h"
-#include "TNetworkToHistoTool.h"
-#include <cmath>
-
-ClassImp( TNetworkToHistoTool)
-
-std::vector<TH1*> TNetworkToHistoTool::fromTrainedNetworkToHisto(TTrainedNetwork* trainedNetwork) const
-{
-
-  std::vector<TH1*> outputHistos;
-
-  if (trainedNetwork->getActivationFunction()!=1)
-  {
-    cout << "ERROR: activation function is different from one. Only one is supported..." << endl;
-    return outputHistos;
-  }
-    
-
-  Int_t nInput=trainedNetwork->getnInput();
-  vector<Int_t> nHiddenLayerSize=trainedNetwork->getnHiddenLayerSize();
-  Int_t nHidden=nHiddenLayerSize.size();
-
-  for (Int_t o=0;o<nHidden;++o)
-  {
-    cout << " Hidden lay: " << o << " size: " << nHiddenLayerSize[o];
-  }
-  
-  Int_t nOutput=trainedNetwork->getnOutput();
-  cout << " Output size: " << nOutput << endl;
-  
-  std::vector<TVectorD*> thresholdVectors=trainedNetwork->getThresholdVectors();
-  std::vector<TMatrixD*> weightMatrices=trainedNetwork->weightMatrices();
-
-  //LayersInfo
-
-  TH1F* histoLayersInfo=new TH1F("LayersInfo",
-                                 "LayersInfo",
-                                 nHidden+2,
-                                 0,
-                                 nHidden+2);
-
-  histoLayersInfo->SetBinContent(1,nInput);
-
-  for (Int_t i=0;i<nHidden;++i)
-  {
-    histoLayersInfo->SetBinContent(2+i,nHiddenLayerSize[i]);
-  }
-
-  histoLayersInfo->SetBinContent(2+nHidden,nOutput);
-
-  outputHistos.push_back(histoLayersInfo);
-
-  
-  //ThresholdInfo
-  for (Int_t i=0;i<nHidden+1;++i)
-  {
-    TString threName("Layer");
-    threName+=i;
-    threName+="_thresholds";
-   
-    Int_t layerSize=(i<nHidden)?nHiddenLayerSize[i]:nOutput;
-    Int_t previousLayerSize=(i==0)?nInput:nHiddenLayerSize[i-1];
-    
-    TH1F* histoThreshLayer=new TH1F(threName,
-                                    threName,
-                                    layerSize,
-                                    0,
-                                    layerSize);
-    
-    for (Int_t s=0;s<layerSize;s++)
-    {
-      histoThreshLayer->SetBinContent(s+1,thresholdVectors[i]->operator()(s));
-    }
-
-    TString weightsName("Layer");
-    weightsName+=i;
-    weightsName+="_weights";
-    
-    outputHistos.push_back(histoThreshLayer);
-
-    TH2F* histoWeightsLayer=new TH2F(weightsName,
-                                     weightsName,
-                                     previousLayerSize,
-                                     0,
-                                     previousLayerSize,
-                                     layerSize,
-                                     0,
-                                     layerSize);
-    
-    for (Int_t s=0;s<layerSize;s++)
-    {
-      for (Int_t p=0;p<previousLayerSize;++p)
-      {
-        histoWeightsLayer->SetBinContent(p+1,s+1,weightMatrices[i]->operator()(p,s));
-      }
-    }
-    
-    outputHistos.push_back(histoWeightsLayer);
-    
-  }
-  
-
-  return outputHistos;
-  
-}
-
-TH1* TNetworkToHistoTool::findHisto(TString nameOfHisto,
-                                     std::vector<TH1*> & inputHistos) const
-{
-
-  std::vector<TH1*>::const_iterator inputBegin=inputHistos.begin();
-  std::vector<TH1*>::const_iterator inputEnd=inputHistos.end();
-  
-  for ( std::vector<TH1*>::const_iterator inputIter=inputBegin;inputIter!=inputEnd;++inputIter)
-  {
-    if ((*inputIter)->GetName()==nameOfHisto)
-    {
-      return (*inputIter);
-    }
-  }
-  return 0;
-}
-
-
-
-TTrainedNetwork* TNetworkToHistoTool::fromHistoToTrainedNetwork(std::vector<TH1*> & inputHistos) const
-{
-
-  
-
-  TH1F* histoLayersInfo=dynamic_cast<TH1F*>(findHisto("LayersInfo",inputHistos));
-
-  if (histoLayersInfo==0)
-  {
-    cout << " Could not find LayersInfo histogram... Aborting " << endl;
-    return 0;
-  }
-
-
-  Int_t nHidden=histoLayersInfo->GetNbinsX()-2;
-  Int_t nInput=(Int_t)std::floor(histoLayersInfo->GetBinContent(1)+0.5);
-
-  vector<Int_t> nHiddenLayerSize;
-  for (Int_t i=0;i<nHidden;++i)
-  {
-    nHiddenLayerSize.push_back( (Int_t)std::floor(histoLayersInfo->GetBinContent(2+i)+0.5));
-  }
-
-  for (Int_t o=0;o<nHidden;++o)
-  {
-    cout << " Hidden lay: " << o << " size: " << nHiddenLayerSize[o];
-  }
-
-  Int_t nOutput=(Int_t)std::floor(histoLayersInfo->GetBinContent(2+nHidden)+0.5);
-  cout << " Output size: " << nOutput << endl;
-  
-  std::vector<TVectorD*> thresholdVectors;
-  std::vector<TMatrixD*> weightMatrices;
-
-
-  //Reconstruct thresholdInfo
-  for (Int_t i=0;i<nHidden+1;++i)
-  {
-    TString threName("Layer");
-    threName+=i;
-    threName+="_thresholds";
-
-    Int_t layerSize=(i<nHidden)?nHiddenLayerSize[i]:nOutput;
-    Int_t previousLayerSize=(i==0)?nInput:nHiddenLayerSize[i-1];
-
-    TVectorD* thresholdVector=new TVectorD(layerSize);
-    TMatrixD* weightMatrix=new TMatrixD(previousLayerSize,layerSize);
-   
-    TH1F* histoThreshLayer=dynamic_cast<TH1F*>(findHisto(threName,inputHistos));
-    if (histoThreshLayer==0)
-    {
-      cout << " Could not find " << threName << "  histogram... Aborting (mem leak also...)" << endl;
-      return 0;
-    }
-
-
-    for (Int_t s=0;s<layerSize;s++)
-    {
-      thresholdVector->operator()(s)=histoThreshLayer->GetBinContent(s+1);
-    }
-
-    TString weightsName("Layer");
-    weightsName+=i;
-    weightsName+="_weights";
-
-    TH2F* histoWeightsLayer=dynamic_cast<TH2F*>(findHisto(weightsName,inputHistos));
-    if (histoWeightsLayer==0)
-    {
-      cout << " Could not find " << weightsName << "  histogram... Aborting (mem leak also...)" << endl;
-      return 0;
-    }
-    
-    for (Int_t s=0;s<layerSize;s++)
-    {
-      for (Int_t p=0;p<previousLayerSize;++p)
-      {
-        weightMatrix->operator()(p,s)=histoWeightsLayer->GetBinContent(p+1,s+1);
-      }
-    }
-
-    thresholdVectors.push_back(thresholdVector);
-    weightMatrices.push_back(weightMatrix);
-
-  }
-
-
-  TTrainedNetwork* trainedNetwork=new TTrainedNetwork(nInput,
-                                                      nHidden,
-                                                      nOutput,
-                                                      nHiddenLayerSize,
-                                                      thresholdVectors,
-                                                      weightMatrices,
-                                                      1);
-  return trainedNetwork;
-  
-}
-        
-  
-  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.h
deleted file mode 100644
index 8a1f921188d9..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNetworkToHistoTool.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __TNetworkToHistoTool_
-#define __TNetworkToHistoTool_
-
-#include <TString.h>
-#include <vector>
-#include "TObject.h"
-
-class TH1;
-class TTrainedNetwork;
-
-//by Giacinto Piacquadio (19-2-2008)
-
-class TNetworkToHistoTool : public TObject
-{
-public:
-  
-  TNetworkToHistoTool() {};
-
-  ~TNetworkToHistoTool() {};
-
-  std::vector<TH1*> fromTrainedNetworkToHisto(TTrainedNetwork*) const;
-  
-  TTrainedNetwork* fromHistoToTrainedNetwork(std::vector<TH1*> &) const;
-
-private:
-
-  TH1* findHisto(TString nameOfHisto,
-                  std::vector<TH1*> & inputHistos) const;
-  
-  ClassDef( TNetworkToHistoTool, 1 );
-  
-};
-
-
-#endif
-  
-  
-  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.cxx
deleted file mode 100644
index 1c71d87d9b2b..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TNeuralDataSet.h"
-#include "TRandom3.h"
-
-ClassImp( TNeuralDataSet )
-//______________________________________________________________________________
-TNeuralDataSet::TNeuralDataSet( Int_t aNumberOfPatterns, Int_t aNumberOfUnits )
-{
-  // Default constructor
-  mpData = new TMatrixD( aNumberOfPatterns, aNumberOfUnits ); 
-  mpNormFactors = new TVectorD( aNumberOfUnits );
-  mpShiftFactors = new TVectorD(  aNumberOfUnits);
-}
-//______________________________________________________________________________
-TNeuralDataSet::~TNeuralDataSet()
-{
-  // Default destructor
-  delete mpData;
-  delete mpNormFactors;
-  delete mpShiftFactors;
-}
-//______________________________________________________________________________
-void TNeuralDataSet::SetData( const Int_t aPattern, const Int_t aIndex, Double_t aValue )
-{
-  // Changes the value of cell in the set specified by Pattern number and Unit index
-  mpData->operator() ( aPattern, aIndex ) = aValue;
-}
-//______________________________________________________________________________
-void TNeuralDataSet::Normalize( void )
-{
-  // Normalizes data
-  Double_t fMin;
-  Double_t fMax;
-  Double_t tmp;
-
-  for( UInt_t aUnitIndex = 0; aUnitIndex < this->GetUnitsCount(); aUnitIndex++ )
-  {
-    fMax = 0.0;
-    fMin = 0.0; 
-    for( UInt_t aPatternIndex = 0; aPatternIndex < this->GetPatternsCount(); aPatternIndex++ )
-    {
-	tmp = this->GetData( aPatternIndex, aUnitIndex );
-	fMin = ( tmp < fMin )? tmp : fMin;
-	fMax = ( tmp > fMax )? tmp : fMax;
-    }
-
-    for( UInt_t aPatternIndex = 0; aPatternIndex < this->GetPatternsCount(); aPatternIndex++ )
-    {
-      tmp = this->GetData( aPatternIndex, aUnitIndex );
-      tmp = (tmp - fMin)/(fMax-fMin);
-      this->SetData( aPatternIndex, aUnitIndex, tmp );
-    }
-
-    mpNormFactors->operator() (aUnitIndex) = 1./(fMax-fMin);
-    mpShiftFactors->operator() (aUnitIndex) = -fMin/(fMax-fMin);
-
-  }
-}
-//______________________________________________________________________________
-void TNeuralDataSet::Randomize( void )
-{
-  // Randomizes the data
-  TRandom3 r3;
-  for( Int_t i = 0; i < this->GetPatternsCount(); i ++ )
-    for( Int_t j = 0; j < this->GetUnitsCount(); j ++ ) 
-    {
-      this->SetData( i, j, r3.Gaus(0, 5) );  
-    }
-}
-//______________________________________________________________________________
-void TNeuralDataSet::Shuffle( Int_t aSeed )
-{
-  // Shuffles data
-  TRandom3 Random( aSeed );
-  Int_t j;
-  Double_t tmp;
-  Int_t a = this->GetPatternsCount() - 1;
-  for ( Int_t i = 0; i < this->GetPatternsCount(); i++ )
-  {
-     j = ( Int_t ) ( Random.Rndm() * a );
-     for( Int_t p = 0; p < this->GetUnitsCount(); p++ )
-     {
-	tmp = this->GetData( i, p );
-	this->SetData( i, p, this->GetData( j, p ) );
-	this->SetData( j, p, tmp );
-     }
-
-  }
-}
-
-//EOF
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.h
deleted file mode 100644
index 7d10063e269a..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TNeuralDataSet.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Author: Vassil Verguilov  11/05/2006
-
-#ifndef __NEURALDATASET_
-#define __NEURALDATASET_
-
-//______________________________________________________________________________
-//
-// TNeuralData
-//
-// This class is the base class for Neural Network Input/Output patterns
-// It contains methods for manupulating the data such as Randomize(),
-// Normalize(), Shuffle() and others.
-//
-//______________________________________________________________________________
-//
-
-#include "TMatrixD.h"
-#include "TVectorD.h"
-
-
-class TNeuralDataSet
-{
- public:
-  TNeuralDataSet( Int_t aNumberOfPatterns = 0, Int_t aNumberOfUnits = 0 );
-  virtual ~TNeuralDataSet( void );
-  
-  // Returns the number of the patterns in set
-  Int_t GetPatternsCount( void ){ return mpData->GetNrows(); };
-  // Returns the number of the units in pattern
-  Int_t GetUnitsCount( void ){ return mpData->GetNcols(); };
-  // Returns the data in cell defined by pattern number and unit index in the pattern
-  Double_t GetData( const Int_t aPattern, const Int_t aIndex );
-  // Change the data in cell defined by pattern number and unit index in the pattern
-  void     SetData( const Int_t aPattern, const Int_t aIndex, Double_t aValue );
-  // Normalize all data
-  void     Normalize( void );  
-  // Randomizes the data
-  void     Randomize( void );
-  // Shuffles the patterns
-  void     Shuffle( Int_t aSeed = 0 );
-
- private:  
-
-  TMatrixD * mpData;
-  TVectorD * mpNormFactors;
-  TVectorD * mpShiftFactors;
-
-  ClassDef( TNeuralDataSet, 1 )
-
-};
-
-inline Double_t TNeuralDataSet::GetData( const Int_t aPattern, const Int_t aIndex )
-{
-  // Returns the value of cell in the set specified by Pattern number and Unit index
-  return mpData->operator() ( aPattern, aIndex );
-}
-//______________________________________________________________________________
-
-
-#endif
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.cxx
deleted file mode 100644
index 91a99d47989b..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.cxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TTrainedNetwork.h"
-
-ClassImp( TTrainedNetwork)
-
-TTrainedNetwork::TTrainedNetwork()
-{
-  mnInput=0;
-  mnHidden=0;
-  mnOutput=0;
-  mActivationFunction=1;
-}
-
-TTrainedNetwork::TTrainedNetwork(Int_t nInput,
-		  Int_t nHidden,
-		  Int_t nOutput,
-		  std::vector<Int_t> & nHiddenLayerSize,
-		  std::vector<TVectorD*> & thresholdVectors,
-		  std::vector<TMatrixD*> & weightMatrices,
-		  Int_t activationFunction)
-{
-
-  mnInput=nInput;
-  mnHidden=nHidden;
-  mnOutput=nOutput;
-  mnHiddenLayerSize=nHiddenLayerSize;
-  mThresholdVectors=thresholdVectors;
-  mWeightMatrices=weightMatrices;
-  mActivationFunction=activationFunction;
-}
-
-TTrainedNetwork::~TTrainedNetwork()
-{
-  std::vector<TVectorD*>::const_iterator vectBegin=mThresholdVectors.begin();
-  std::vector<TVectorD*>::const_iterator vectEnd=mThresholdVectors.end();
-
-  for (std::vector<TVectorD*>::const_iterator vectIter=vectBegin;
-       vectIter!=vectEnd;
-       ++vectIter)
-  {
-    delete *vectIter;
-  }
-
-  std::vector<TMatrixD*>::const_iterator matrixBegin=mWeightMatrices.begin();
-  std::vector<TMatrixD*>::const_iterator matrixEnd=mWeightMatrices.end();
-
-  for (std::vector<TMatrixD*>::const_iterator matrixIter=matrixBegin;
-       matrixIter!=matrixEnd;
-       ++matrixIter)
-  {
-    delete *matrixIter;
-  }
-
-}
-
-void TTrainedNetwork::setNewWeights(std::vector<TVectorD*> & thresholdVectors,
-				    std::vector<TMatrixD*> & weightMatrices)
-{
-
-  std::vector<TVectorD*>::const_iterator vectBegin=mThresholdVectors.begin();
-  std::vector<TVectorD*>::const_iterator vectEnd=mThresholdVectors.end();
-
-  for (std::vector<TVectorD*>::const_iterator vectIter=vectBegin;
-       vectIter!=vectEnd;
-       ++vectIter)
-  {
-    delete *vectIter;
-  }
-
-  std::vector<TMatrixD*>::const_iterator matrixBegin=mWeightMatrices.begin();
-  std::vector<TMatrixD*>::const_iterator matrixEnd=mWeightMatrices.end();
-
-  for (std::vector<TMatrixD*>::const_iterator matrixIter=matrixBegin;
-       matrixIter!=matrixEnd;
-       ++matrixIter)
-  {
-    delete *matrixIter;
-  }
-
-  mThresholdVectors.clear();
-  mWeightMatrices.clear();
-
-  mThresholdVectors=thresholdVectors;
-  mWeightMatrices=weightMatrices;
-
-}
-
-std::vector<Double_t>  TTrainedNetwork::calculateOutputValues(std::vector<Double_t> & input) const 
-{
-
-  std::vector<Double_t> result;
-
-  //now calculate the value using:
-  TVectorD** resultVector=new TVectorD*[mnHidden+1];
-  
-
-  if (input.size()!=mnInput)
-  {
-    cout << " Input size: " << input.size() << " doesn't match with network: " << mnInput << endl;
-    return result;
-  }
-  
-  for (Int_t o=0;o<mnHidden+1;++o)
-  {
-
-    int sizeActualLayer=(o<mnHidden)?mnHiddenLayerSize[o]:mnOutput;
-    int sizePreviousLayer=(o==0)?mnInput:mnHiddenLayerSize[o-1];
-
-    resultVector[o]=new TVectorD(sizeActualLayer);
-    
-    for (Int_t s=0;s<sizeActualLayer;++s)
-    {
-      Double_t nodeValue=0.;
-      if (o==0)
-      {
-        for (Int_t p=0;p<mnInput;++p)
-        {
-          nodeValue+=mWeightMatrices[o]->operator() (p,s)*input[p];
-        }
-      }
-      else
-      {
-        for (Int_t p=0;p<mnHiddenLayerSize[o-1];++p)
-        {
-          nodeValue+=mWeightMatrices[o]->operator() (p,s)*resultVector[o-1]->operator()(p);
-        }
-      }
-      nodeValue+=mThresholdVectors[o]->operator() (s);
-      resultVector[o]->operator()(s) = sigmoid(nodeValue);
-    }
-  }      
-  
-  for (Int_t i=0;i<mnOutput;i++)
-  {
-    result.push_back(resultVector[mnHidden]->operator()(i));
-  }
-
-  for (Int_t o=0;o<mnHidden+1;++o)
-  {
-    int sizeActualLayer=(o<mnHidden)?mnHiddenLayerSize[o]:mnOutput;
-    delete resultVector[o];
-  }
-  delete resultVector;
-
-  return result;
-  
-}
-
-
-
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.h
deleted file mode 100644
index 62782c67e101..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/TTrainedNetwork.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __TTrainedNetwork_
-#define __TTrainedNetwork_
-
-#include "TObject.h"
-#include "TMatrixD.h"
-#include "TVectorD.h"
-#include "TJetNet.h"
-#include <math.h>
-#include <vector>
-
-//by Giacinto Piacquadio (18-02-2008)
-
-class TTrainedNetwork : public TObject
-{
- public:
-  
-  TTrainedNetwork();
-
-  //class takes ownership of all pointers...
-  TTrainedNetwork(Int_t nInput,
-		  Int_t nHidden,
-		  Int_t nOutput,
-		  std::vector<Int_t> & nHiddenLayerSize,
-		  std::vector<TVectorD*> & thresholdVectors,
-		  std::vector<TMatrixD*> & weightMatrices,
-		  Int_t activationFunction);
-
-  ~TTrainedNetwork();
-
-  void setNewWeights(std::vector<TVectorD*> & thresholdVectors,
-		     std::vector<TMatrixD*> & weightMatrices);
-
-  Int_t getnInput() const {return mnInput;};
-
-  Int_t getnHidden() const {return mnHidden;};
-
-  Int_t getnOutput() const {return mnOutput;};
-
-  const std::vector<Int_t> &  getnHiddenLayerSize() const {return mnHiddenLayerSize;};
-
-  Int_t getActivationFunction() const {return mActivationFunction;};
-
-  const std::vector<TVectorD*> & getThresholdVectors() const {return mThresholdVectors;};
-
-  const std::vector<TMatrixD*> & weightMatrices() const {return mWeightMatrices;};
-
-  std::vector<Double_t> calculateOutputValues(std::vector<Double_t> & input) const;
-
- private:
-
-  Int_t mnInput;
-  Int_t mnHidden;
-  Int_t mnOutput;
-
-  std::vector<Int_t> mnHiddenLayerSize;
-  //Int_t* mnHiddenLayerSize;
-
-  std::vector<TVectorD*> mThresholdVectors;
-  std::vector<TMatrixD*> mWeightMatrices;
-  //  TVectorD** mThresholdVectors;
-  //  TMatrixD** mWeightMatrices;
-  Int_t mActivationFunction;
-
-  Double_t sigmoid(Double_t x) const { return 1./(1.+exp(-2*x)); };
-
-  ClassDef( TTrainedNetwork, 1 )
-
-};
-
-#endif
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doNormalization.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doNormalization.C
deleted file mode 100755
index 96e26b573df9..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doNormalization.C
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <cmath>
-
-double norm_nVTX(int nVTX)
-{
-  return (((double)nVTX)-0.3)/0.5;
-}
-
-int back_nVTX(double nVTX)
-{
-  return (int)std::floor(nVTX*0.5+0.3+0.5);
-}
-
-double norm_nTracksAtVtx(int nTracksAtVtx)
-{
-  return ((double)nTracksAtVtx-1.)/1.6;
-}
-
-int back_nTracksAtVtx(double nTracksAtVtx)
-{
-  return (int)std::floor(nTracksAtVtx*1.6+1.+0.5);
-}
-
-double norm_nSingleTracks(int nSingleTracks)
-{
-  return ((double)nSingleTracks-0.2)/0.5;
-}
-
-int back_nSingleTracks(double nSingleTracks)
-{
-  return (int)std::floor(nSingleTracks*0.5+0.2+0.5);
-}
-
-
-double norm_energyFraction(double energyFraction)
-{
-  return (energyFraction-0.23)/0.33;
-}
-
-double back_energyFraction(double energyFraction)
-{
-  return (energyFraction*0.33)+0.23;
-}
-
-double norm_mass(double mass)
-{
-  return (mass-974.)/1600.;
-}
-
-double back_mass(double mass)
-{
-  return (mass*1600.)+974.;
-}
-
-double norm_significance3d(double s3d)
-{
-  return (s3d-7.)/14.;
-}
-
-double back_significance3d(double s3d)
-{
-  return (s3d*14.)+7.;
-}
-
-double norm_IP3D(double ip3d)
-{
-  return (ip3d-6.3)/6.;
-}
-
-double back_IP3D(double ip3d)
-{
-  return (ip3d*6.)+6.3;
-}
-
-
-double norm_cat_pT(int cat_pT)
-{
-  return ((double)cat_pT-3.)/3.;
-}
-
-int back_cat_pT(double cat_pT)
-{
-  return (int)std::floor(cat_pT*3.+3.+0.5);
-}
-
-double norm_cat_eta(double cat_eta)
-{
-  return (double)(cat_eta-1.);
-}
-
-int back_cat_eta(int cat_eta)
-{
-  return (int)std::floor(cat_eta+1.+0.5);
-}
-
-
-
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doTraining.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doTraining.C
deleted file mode 100644
index 05538d60e9bb..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/doTraining.C
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-void doTraining(TString nameCollection,bool withIP3D) {
-
-  gSystem->Load("./libTJetNet.so");
-  gSystem->Load("trainNN_cxx.so");
-
-  
-  TString path("../../../reduceddatasets/reduceddataset_");
-  path+=nameCollection;
-  path+="_forNN.root";
-  
-  TString classname("JetFitterNN_");
-  classname+=nameCollection;
-  
-  if (withIP3D)
-  {
-    trainNN(path,classname,
-            10000,//trainingEpoches
-            2,//dilution
-            false,//dummy
-            true,//withIP3D
-            14,//nHidden1
-            9);//nHidden2
-  }
-  else
-  {
-    trainNN(path,classname,
-            10000,//trainingEpoches
-            2,//dilution
-            false,//dummy
-            false,//withIP3D
-            12,//nHidden1
-            7);//nHidden2
-  }
-  
-  gROOT->ProcessLine(".q");
-
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet.h
deleted file mode 100644
index 489779398644..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
-Modified: 30.04.2005
-
-History:
-=================================================
-30.04.2005 -- Added Subroutine JNDUMP
-
-*/
-
-#ifndef f2cFortran
-#define f2cFortran
-#endif
-#include "cfortran.h"
-
-
-/*
- 1) Feed-forward network (JN):                                        C
-   ERRJN, GAUSJN, GJN, GPJN, JNCHOP, JNCOGR, JNCGBE, JNDELT, JNDUMP,  C
-   JNERR, JNFEED, JNHEAD, JNHEIG, JNHESS, JNINDX, JNINIT, JNLINS,     C
-   JNREAD, JNROLD, JNSATM, JNSCGR, JNSEFI, JNSEPA, JNSTAT, JNTEST,    C
-   JNTRAL, JNTRED, JNTQLI                                             C
-*/
-
-#define MAXI 1000;
-#define MAXO 1000;
-
-typedef struct
-{
-  int MSTJN[ 40 ];
-  float PARJN[ 40 ];
-  int MSTJM[ 20 ];
-  float PARJM[ 20 ];
-  float OIN[ 1000 ];
-  float OUT[ 1000 ];
-  int MXNDJM;
-} JNDAT1_DEF;
-
-#define JNDAT1 COMMON_BLOCK(JNDAT1,jndat1)
-COMMON_BLOCK_DEF(JNDAT1_DEF,JNDAT1);
-
-//COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-
-typedef struct
-{
-  float TINV[ 10 ];
-  int IGFN[ 10 ];
-  float ETAL[ 10 ];
-  float WIDL[ 10 ];
-  float SATM[ 10 ];
-} JNDAT2_DEF;
-
-#define JNDAT2 COMMON_BLOCK(JNDAT2,jndat2)
-COMMON_BLOCK_DEF(JNDAT2_DEF,JNDAT2);
-
-
-typedef struct
-{
-  float O [ 2000 ]; // Current value of node I in the network, does not include the input units
-  float A [ 2000 ]; // Current value of the summed input alpha_i to node I
-  float D [ 2000 ]; // Current value of delta_i at node I
-  float T [ 2000 ]; // Current value of threshold thetha_i at node I
-  float DT [ 2000 ]; // Current value of the update delta(thetha_i) for the threshold at node I
-  float W [ 150000 ]; // Current value for the weight with index IW
-  float DW [ 150000 ]; // Current value of the update for weight with index IW
-  int NSELF [ 150000 ]; // Switches for updating weight with index IW ( 0 = do not update, 1 = update )
-  int NTSELF [ 2000 ]; // Switches for updating the threshold for node I --------- " -----------------
-  float G [ 152000 ]; // Temporary weight and threshold vectors used in CG, SCG and QP
-  float ODW [ 150000 ]; // Stores old weight gradient in CG, SCG, QP and Rprop
-  float ODT [ 2000 ];  // stores old threshold gradient in CG, SCG, QP and Rprop
-  float ETAV [ 152000 ]; // Individual learning rates used in Rprop
-} JNINT1_DEF;
-
-#define JNINT1 COMMON_BLOCK(JNINT1,jnint1)
-COMMON_BLOCK_DEF(JNINT1_DEF,JNINT1);
-
-/*
-  INTEGER FUNCTION JNINDX(IL,I,J)
-*/
-
-PROTOCCALLSFFUN3(INT,JNINDX,jnindx,INT,INT,INT)
-#define JNINDX(IL,I,J) CCALLSFFUN3(JNINDX,jnindx,INT,INT,INT,IL,I,J)
-
-
-/*
-  REAL FUNCTION GAUSJN(IDUM)
-*/
-
-PROTOCCALLSFFUN1(FLOAT,GAUSJN,gausjn,INT)
-#define GAUSJN(IDUM) CCALLSFFUN1(GAUSJN,gausjn,INT,IDUM)
-
-/*
-  REAL FUNCTION RJN(IDUM)
-*/
-
-PROTOCCALLSFFUN1(FLOAT,RJN,rjn,INT)
-#define RJN(IDUM) CCALLSFFUN1(RJN,rjn,INT,IDUM)
-  
-/*
-  SUBROUTINE JNINIT
-*/
-
-PROTOCCALLSFSUB0(JNINIT,jninit)
-#define JNINIT() CCALLSFSUB0(JNINIT,jninit)
-
-/*
-  SUBROUTINE JNTRAL
-*/
-
-PROTOCCALLSFSUB0(JNTRAL,jntral)
-#define JNTRAL() CCALLSFSUB0(JNTRAL,jntral)
-
-/*
-  SUBROUTINE JNTEST
-*/
-
-PROTOCCALLSFSUB0(JNTEST,jntest)
-#define JNTEST() CCALLSFSUB0(JNTEST,jntest)
-
-/*
-SUBROUTINE JNDUMP(NF)
-*/
-PROTOCCALLSFSUB1(JNDUMP,jndump,INT)
-#define JNDUMP(NF) CCALLSFSUB1(JNDUMP,jndump,INT,NF);
-
-
-/*
-SUBROUTINE JNREAD(NF)
-*/
-PROTOCCALLSFSUB1(JNREAD,jnread,INT)
-#define JNREAD(NF) CCALLSFSUB1(JNREAD,jnread,INT,NF);
-
-/*
-SUBROUTINE JNSTAT(IS)
-*/
-PROTOCCALLSFSUB1(JNSTAT,jnstat,INT)
-#define JNSTAT(IS) CCALLSFSUB1(JNSTAT,jnstat,INT,IS);
-
-/*				      
-SUBROUTINE JNSEFI(ILA,I1,I2,J1,J2,NO)
-*/
-PROTOCCALLSFSUB6(JNSEFI,jnsefi,INT,INT,INT,INT,INT,INT)
-#define JNSEFI(ILA,I1,I2,J1,J2,NO) CCALLSFSUB6(JNSEFI,jnsefi,INT,INT,INT,INT,INT,INT,ILA,I1,I2,J1,J2,NO);
-
-/*
-SUBROUTINE REWIND(INT,INT)
-*/
-PROTOCCALLSFSUB1(REWIND,rewind,INT)
-#define REWIND(UNIT) CCALLSFSUB1(REWIND,rewind,INT,UNIT);
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet_35.f b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet_35.f
deleted file mode 100644
index 5c4a6ced4430..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/jetnet_35.f
+++ /dev/null
@@ -1,5850 +0,0 @@
-C**********************************************************************C
-C                                                                      C
-C                          J E T N E T - 3.5                           C
-C                                                                      C
-C           A Neural Network program for jet discrimination            C
-C         and other High Energy Physics triggering situations          C
-C                                                                      C
-C                    Latest date of change 97.04.16                    C
-C                                                                      C
-C                              Authors :                               C
-C                                                                      C
-C                   Leif Lonnblad, Carsten Peterson,                   C
-C                 Hong Pi and Thorsteinn Rognvaldsson                  C
-C                                                                      C
-C                   Department of Theoretical Physics                  C
-C                  University of Lund, Solvegatan 14A,                 C
-C                           S-223 62 Lund                              C
-C                               Sweden                                 C
-C                                                                      C
-C                        tel  int+46-46109073                          C
-C                        fax  int+46-46104438                          C
-C                                                                      C
-C                     internet    leif@thep.lu.se                      C
-C                                 carsten@thep.lu.se                   C
-C                                 pihong@thep.lu.se                    C
-C                                 denni@thep.lu.se                     C
-C                                                                      C
-C           Copyright 1991-1997 L. Lonnblad & Th. Rognvaldsson         C
-C                                                                      C
-C          Please report any errors to: <denni@thep.lu.se>             C
-C                                                                      C
-C**********************************************************************C
-
-C**********************************************************************C
-C                                                                      C
-C An updated version of the program is obtainable through anonymous    C
-C ftp from thep.lu.se in directory /pub/LundPrograms/Jetnet/           C
-C                                                                      C
-C**********************************************************************C
-
-C**********************************************************************C
-C  A description of the models and the program can be found in:        C
-C                                                                      C
-C  (i) Lonnblad et. al., "Self-organizing Networks for Extracting      C
-C   Jet Features", Computer Physics Communications, vol. 67,           C
-C   pp. 193-209, 1991.                                                 C
-C                                                                      C
-C  (ii) Lonnblad et. al., "Pattern recognition in High Energy Physics  C
-C  with Artificial Neural Networks - JETNET 2.0", Computer Physics     C
-C  Communications, nr. 70, pp. 167-182, 1992.                          C
-C                                                                      C
-C  (iii) Lonnblad et. al. "JETNET 3.0 - A Versatile Artificial         C
-C  Neural Network Package", Computer Physics Communications, vol. 81,  C
-C  pp. 185-220, 1994.                                                  C
-C                                                                      C
-C**********************************************************************C
-
-C**********************************************************************C
-C         Order of appearance of subroutines and functions:            C
-C                                                                      C
-C 1) Feed-forward network (JN):                                        C
-C   ERRJN, GAUSJN, GJN, GPJN, JNCHOP, JNCOGR, JNCGBE, JNDELT, JNDUMP,  C
-C   JNERR, JNESRT, JNFEED, JNHEAD, JNHEIG, JNHESS, JNINDX, JNINIT,     C
-C   JNLINS, JNREAD, JNROLD, JNSATM, JNSCGR, JNSEFI, JNSEPA, JNSTAT,    C
-C   JNTEST, JNTRAL, JNTRTQ                                             C
-C                                                                      C
-C 2) Self-organizing network (JM):                                     C
-C   GJM, JMDUMP, JMERR, JMFEED, JMINDX, JMINIT, JMINWE, JMNBHD,        C
-C   JMNORM, JMREAD, JMSEPA, JMSTAT, JMTEST, JMTRAL, JMWARN             C
-C                                                                      C
-C The block-data subroutine JNDATA is placed at the end, together      C
-C with a test-deck in the subroutine JNTDEC, and a random number       C
-C generator called RJN.                                                C
-C**********************************************************************C
-C**********************************************************************C
-
-C**********************************************************************C
-C PART ONE: FEED-FORWARD NETWORK                                       C
-C**********************************************************************C
-
-
-      REAL FUNCTION ERRJN(IDUM)
-
-C...JetNet function calculate ERRor.
-
-C...Returns the error function.
-C...The error measure is selected by MSTJN(4).
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNINT1/,/JNINT2/
-
-
-      ERR=0.0
-      IF (MSTJN(4).EQ.0) THEN
-C...Summed square error:
-
-        DO 100 I=1,M(NL)
-          OUTVAL=O(JNINDX(NL,I,0))
-          ERR=ERR+0.5*(OUT(I)-OUTVAL)**2
-          OUT(I)=OUTVAL
-100     CONTINUE
-
-      ELSEIF (MSTJN(4).EQ.1) THEN
-C...Cross Entropy error:
-
-        DO 110 I=1,M(NL)
-C...It is assumed that OUTVAL=0.0 or OUTVAL=1.0 never happens.
-          OUTVAL=O(JNINDX(NL,I,0))
-          ERR=ERR-(OUT(I)*LOG(OUTVAL)+(1.-OUT(I))*LOG(1.-OUTVAL))
-          OUT(I)=OUTVAL
-110     CONTINUE
-
-      ELSEIF (MSTJN(4).GE.2) THEN
-C...Kullback error:
-
-        DO 120 I=1,M(NL)
-C...It is assumed that OUTVAL=0.0 never happens.
-          OUTVAL=O(JNINDX(NL,I,0))
-          IF(OUT(I).GT.0.0) THEN
-            ERR=ERR+OUT(I)*LOG(OUT(I)/OUTVAL)
-          ENDIF
-          OUT(I)=OUTVAL
-120     CONTINUE
-
-      ELSEIF (MSTJN(4).EQ.-1) THEN
-C...Log-squared error:
-
-        DO 130 I=1,M(NL)
-C...It is assumed that |OUT(I)-OUTVAL|=1.0 never happens.
-          OUTVAL=O(JNINDX(NL,I,0))
-          ERR=ERR-0.5*LOG(1.-(OUT(I)-OUTVAL)**2)
-          OUT(I)=OUTVAL
-130     CONTINUE
-
-      ENDIF
-
-      ERRJN=ERR
-
-      RETURN
-
-C**** END OF ERRJN *****************************************************
-      END
-C***********************************************************************
-
-
-      REAL FUNCTION GAUSJN(IDUM)
-C...JetNet function GAUSsian random number.
-
-C...Generates Gaussian distributed random numbers with
-C...standard deviation 1.0 and mean 0.0. Polar method.
-
-      PARAMETER (TINY=1.E-20)
-
-      COMMON /JNGAUS/ ISET,GASDEV
-      SAVE /JNGAUS/
-
-      IF (ISET.EQ.0) THEN
-100     V1=2.*RJN(IDUM)-1.
-        V2=2.*RJN(IDUM)-1.
-        R=V1**2+V2**2
-        IF ((R.GE.1.).OR.(R.LE.TINY)) GOTO 100
-C...Box-Muller transformation:
-        FAC=SQRT(-2.*LOG(R)/R)
-        GAUSJN=V1*FAC
-        GASDEV=V2*FAC
-        ISET=1
-      ELSE
-        GAUSJN=GASDEV
-        ISET=0
-      ENDIF
-
-      RETURN
-
-C**** END OF GAUSJN ****************************************************
-      END
-C***********************************************************************
-
-
-      REAL FUNCTION GJN(IND,X,N)
-
-C...JetNet function G
-
-C...Gives sigmoid function N with argument X
-C...The derivative GPrime is also calculated and stored in GPJN.
-
-      PARAMETER(MAXV=2000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNSIGM/ GPJN(MAXV),GPPJN(MAXV)
-      SAVE /JNDAT1/,/JNSIGM/
-
-
-      IF(N.EQ.1) THEN
-C...        1 -> g(x)=1/(1+exp(-2x))
-        ARG=TANH(X)
-        GJN=0.5*(1.0+ARG)
-        GPJN(IND)=0.5*(1.0-ARG**2)+PARJN(23)
-        GPPJN(IND)=ARG*(ARG**2-1.)
-      ELSEIF(N.EQ.2) THEN
-C...        2 -> g(x)=tanh(x)
-        ARG=TANH(X)
-        GJN=ARG
-        GPJN(IND)=1.-ARG**2+PARJN(23)
-        GPPJN(IND)=2.*ARG*(ARG**2-1.)
-      ELSEIF(N.EQ.3) THEN
-C...        3 -> g(x)=exp(x) (only used internally for Potts-nodes)
-        GJN=EXP(MAX(-50.0,MIN(X,50.0)))
-        GPJN(IND)=1.0
-        GPPJN(IND)=0.0
-      ELSEIF(N.EQ.4) THEN
-C...        4 -> g(x)=x
-        GJN=X
-        GPJN(IND)=1.0
-        GPPJN(IND)=0.0
-      ELSEIF(N.EQ.5) THEN
-C...        5 -> g(x)=1/(1+exp(-2x)) (only used internally for
-C...             entropy error)
-        GJN=0.5*(1.0+TANH(X))
-        GPJN(IND)=2.0
-        GPPJN(IND)=0.0
-      ELSEIF(N.EQ.-1) THEN
-C...        same as above, but with fixed precision
-        ARG=TANH(X)
-        NS=2**ABS(MSTJN(28))
-        SS=1.0/(NS-1)
-        G=0.5*(1.0+ARG)
-        NG=INT(G/SS+0.5)
-        GJN=FLOAT(NG)*SS
-        GPJN(IND)=0.5*(1.0-ARG**2)+PARJN(23)
-        GPPJN(IND)=ARG*(ARG**2-1.)
-      ELSEIF(N.EQ.-2) THEN
-        ARG=TANH(X)
-        NS=2**(ABS(MSTJN(28))-1)
-        IF(NS.EQ.1) THEN
-          GJN=SIGN(1.0,ARG)
-        ELSE
-          SS=1.0/(NS-1)
-          G=ARG
-          NG=INT(ABS(G)/SS+0.5)
-          GJN=SIGN(FLOAT(NG)*SS,G)
-        ENDIF
-        GPJN(IND)=1.-ARG**2+PARJN(23)
-        GPPJN(IND)=2.*ARG*(ARG**2-1.)
-      ELSE
-        MSTJN(3)=N
-        CALL JNERR(15)
-      ENDIF
-
-      RETURN
-
-C**** END OF GJN *******************************************************
-      END 
-C***********************************************************************
-
-
-      SUBROUTINE JNCGBE(BETAK,IOP)
-C...JetNet subroutine Conjugate Gradient BEta_k.
-
-C...If IOP=0, it only saves current value of (DW,DT)*(DW,DT) to be 
-C...used later and returns BETAK=0.0. If IOP=1, it also calculates 
-C...the beta_k value used to generate next search direction. Which 
-C...formula to use is determined by MSTJN(5).
-
-C...Note: The vector (DW,DT) equals the negative gradient of E.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(TINY=1.E-8,BIG=1.E+8)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT2/,/JNINT1/,/JNINT2/,/JNINT4/
-
-
-      BETA=1.0
-      BETAK=0.0
-      OLDG2=G2
-      G2=0.0
-
-      IF ((MSTJN(5).EQ.4).OR.(MSTJN(5).EQ.10)) THEN
-C...Polak-Ribiere's formula:
-
-        DO 100 IL=NL,1,-1
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-          DO 110 I=MM0(IL)+1,MM0(IL+1)
-            DW(I)=DW(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NSELF(I))*(DW(I)*BETA)**2
-            BETAK=BETAK+FLOAT(NSELF(I))*
-     &                  DW(I)*ODW(I)*BETA**2
-            ODW(I)=DW(I)
-110       CONTINUE
-          DO 120 I=MV0(IL)+1,MV0(IL+1)
-            DT(I)=DT(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NTSELF(I))*(DT(I)*BETA)**2
-            BETAK=BETAK+FLOAT(NTSELF(I))*
-     &                  DT(I)*ODT(I)*BETA**2
-            ODT(I)=DT(I)
-120       CONTINUE
-100     CONTINUE
-
-        IF (IOP.EQ.0) THEN
-          BETAK=0.0
-        ELSE
-          IF (ABS(OLDG2).GT.TINY) THEN
-            BETAK=(G2-BETAK)/OLDG2
-          ELSE
-            BETAK=0.0
-          ENDIF
-        ENDIF
-
-      ELSEIF ((MSTJN(5).EQ.5).OR.(MSTJN(5).EQ.11)) THEN
-C...Hestenes-Stiefel's formula:
-
-        DGDW=0.0
-        DO 200 IL=NL,1,-1
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-          DO 210 I=MM0(IL)+1,MM0(IL+1)
-            DW(I)=DW(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NSELF(I))*(DW(I)*BETA)**2
-            BETAK=BETAK+FLOAT(NSELF(I))*
-     &                  DW(I)*ODW(I)*BETA**2
-            DGDW=DGDW+G(I)*(ODW(I)-DW(I))*BETA**2
-            ODW(I)=DW(I)
-210       CONTINUE
-          DO 220 I=MV0(IL)+1,MV0(IL+1)
-            DT(I)=DT(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NTSELF(I))*(DT(I)*BETA)**2
-            BETAK=BETAK+FLOAT(NTSELF(I))*
-     &                  DT(I)*ODT(I)*BETA**2
-            DGDW=DGDW+G(MM0(NL+1)+I)*(ODT(I)-DT(I))*BETA**2
-            ODT(I)=DT(I)
-220       CONTINUE
-200     CONTINUE
-
-        IF (IOP.EQ.0) THEN
-          BETAK=0.0
-        ELSE
-          IF (ABS(DGDW).GT.TINY) THEN
-            BETAK=(G2-BETAK)/DGDW
-          ELSE
-            BETAK=0.0
-          ENDIF
-        ENDIF
-
-      ELSEIF ((MSTJN(5).EQ.6).OR.(MSTJN(5).EQ.12)) THEN
-C...Fletcher-Reeves' formula: 
-
-        DO 300 IL=NL,1,-1
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-          DO 310 I=MM0(IL)+1,MM0(IL+1)
-            DW(I)=DW(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NSELF(I))*(DW(I)*BETA)**2
-            ODW(I)=DW(I)
-310       CONTINUE
-          DO 320 I=MV0(IL)+1,MV0(IL+1)
-            DT(I)=DT(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NTSELF(I))*(DT(I)*BETA)**2
-            ODT(I)=DT(I)
-320       CONTINUE
-300     CONTINUE
-
-       IF (IOP.EQ.0) THEN
-          BETAK=0.0
-        ELSE
-          IF (ABS(OLDG2).GT.TINY) THEN
-            BETAK=G2/OLDG2
-          ELSE
-            BETAK=0.0
-          ENDIF
-        ENDIF
-
-      ELSEIF ((MSTJN(5).EQ.7).OR.(MSTJN(5).EQ.13)) THEN
-C...Shanno's formula: 
-
-        F1=0.0
-        F2=0.0
-        F3=0.0
-        F4=0.0
-        FACT1=0.0
-        FACT2=0.0
-        DO 400 IL=NL,1,-1
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-          DO 410 I=MM0(IL)+1,MM0(IL+1)
-            DW(I)=DW(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NSELF(I))*(DW(I)*BETA)**2
-            F1=F1-G(I)*ODW(I)*BETA
-            F2=F2+G(I)*(ODW(I)-DW(I))*BETA
-            F3=F3+ODW(I)*(DW(I)-ODW(I))*BETA**2
-            F4=F4+((DW(I)-ODW(I))*BETA)**2
-            Y=(ODW(I)-DW(I))
-            ODW(I)=DW(I)
-            DW(I)=Y
-410       CONTINUE
-          DO 420 I=MV0(IL)+1,MV0(IL+1)
-            DT(I)=DT(I)/FLOAT(MSTJN(2))
-            G2=G2+FLOAT(NTSELF(I))*(DT(I)*BETA)**2
-            F1=F1-G(MM0(NL+1)+I)*ODT(I)*BETA
-            F2=F2+G(MM0(NL+1)+I)*(ODT(I)-DT(I))*BETA
-            F3=F3+ODT(I)*(DT(I)-ODT(I))*BETA**2
-            F4=F4+((DT(I)-ODT(I))*BETA)**2
-            Y=(ODT(I)-DT(I))
-            ODT(I)=DT(I)
-            DT(I)=Y
-420       CONTINUE
-          F1=F1*STEPLN(0)
-          F2=F2*STEPLN(0)
-          IF ((ABS(F2).GT.TINY).AND.(ABS(F2).LT.BIG)) THEN
-            FACT1=F1/F2
-            FACT2=(1.0+F4/F2)*FACT1-F3/F2
-          ELSE
-            FACT1=0.0
-            FACT2=0.0
-          ENDIF
-400     CONTINUE
-
-        IF (IOP.EQ.0) THEN
-          BETAK=0.0
-          DO 430 I=1,MM0(NL+1)
-            DW(I)=ODW(I)
-430       CONTINUE
-          DO 440 I=1,MV0(NL+1)
-            DT(I)=ODT(I)
-440       CONTINUE
-        ELSE
-          BETAK=-FACT2*STEPLN(0)
-          DO 450 I=1,MM0(NL+1)
-            DW(I)=ODW(I)+FACT1*DW(I)
-450       CONTINUE
-          DO 460 I=1,MV0(NL+1)
-            DT(I)=ODT(I)+FACT1*DT(I)
-460       CONTINUE
-        ENDIF
-
-      ENDIF
-
-      RETURN        
-
-C**** END OF JNCGBE ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNCHOP(ICHP)
-C...JetNet subroutine CHOP weights
-
-C...Switches on (ICHP>0) or off (ICHP<0) fixed precision weights 
-C...thresholds and sigmoid functions. For IHCP >= 0 the weights and
-C...thresholds are chopped to the fixed precision. 
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNINT1/,/JNINT2/
-
-
-      IF(ICHP.GT.0) THEN
-        ICPON=1
-        DO 100 I=1,NL-1
-          IF(ABS(NG(I)).NE.1.AND.ABS(NG(I)).NE.2) CALL JNERR(14)
-          IF(MSTJN(28).NE.0) THEN 
-            NG(I)=-ABS(NG(I))
-          ELSE
-            NG(I)=ABS(NG(I))
-          ENDIF
-100     CONTINUE
-        IF(MSTJN(28).GT.0) THEN
-          IF(ABS(NG(NL)).NE.1.AND.ABS(NG(NL)).NE.2) CALL JNERR(14)
-          NG(NL)=-ABS(NG(NL))
-        ELSE
-          NG(NL)=ABS(NG(NL))
-        ENDIF
-
-      ENDIF
-
-      IF(ICHP.LT.0) THEN
-        ICPON=0
-        DO 110 I=1,NL
-          NG(I)=ABS(NG(I))
-110     CONTINUE
-      ENDIF
-
-      IF(ICHP.GE.0) THEN
-
-        NSW=2**(MSTJN(30)-1)
-        NST=2**(MSTJN(29)-1)
-
-        DO 200 IL=1,NL
-
-          IF(MSTJN(30).GE.1) THEN
-            WMAX=0.0
-            DO 210 I=MM0(IL)+1,MM0(IL+1)
-              WMAX=MAX(WMAX,ABS(W(I)))
-210         CONTINUE
-            SS=1.0
-            IF(NSW.GT.1) THEN
-              SS=WMAX/(NSW-1)
-            ENDIF
-            DO 220 I=MM0(IL)+1,MM0(IL+1)
-             IF(NSW.GT.1) THEN
-                W(I)=SIGN(FLOAT(INT(ABS(W(I))/SS+0.5))*SS,W(I))
-              ELSE
-                W(I)=SIGN(WMAX,W(I))
-              ENDIF
-220         CONTINUE
-          ENDIF
-
-          IF(MSTJN(29).GE.1) THEN
-            TMAX=0.0
-            DO 230 I=MV0(IL)+1,MV0(IL+1)
-              TMAX=MAX(TMAX,ABS(T(I)))
-230         CONTINUE
-            SS=1.0
-            IF(NST.GT.1) THEN
-              SS=TMAX/(NST-1)
-            ENDIF
-            DO 240 I=MV0(IL)+1,MV0(IL+1)
-              IF(NST.GT.1) THEN
-                T(I)=SIGN(FLOAT(INT(ABS(T(I))/SS+0.5))*SS,T(I))
-              ELSE
-                T(I)=SIGN(TMAX,T(I))
-              ENDIF
-240         CONTINUE
-          ENDIF
-
-200     CONTINUE
-
-      ENDIF
-
-      RETURN
-
-C**** END OF JNCHOP ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNCOGR
-
-C...JetNet subroutine COnjugate GRadient
-
-C...Performs Conjugate Gradient updating. 
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT4/
-
-
-      IF(ILINON.EQ.0) THEN
-C...Calc. new conjugate search direction + calculate gradient:
-
-        CALL JNCGBE(BETAK,MOD(NC,(MM0(NL+1)+MV0(NL+1))))
-        NC=NC+1
-        NSC=0
-        DERRLN=0.0
-        BETA=1.0
-        STEPMN=0.0
-        DO 100 IL=NL,1,-1
-
-C...set effective beta in layer IL:
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-
-          DO 110 I=MM0(IL)+1,MM0(IL+1)
-            G(I)=BETAK*G(I)+DW(I)*FLOAT(NSELF(I))*BETA
-            DERRLN=DERRLN-ODW(I)*FLOAT(NSELF(I))*BETA*G(I)
-110       CONTINUE
-
-          DO 120 I=MV0(IL)+1,MV0(IL+1)
-            G(I+MM0(NL+1))=BETAK*G(I+MM0(NL+1))
-     &                     +DT(I)*FLOAT(NTSELF(I))*BETA
-            DERRLN=DERRLN-ODT(I)*FLOAT(NTSELF(I))*BETA*G(I+MM0(NL+1))
-120       CONTINUE
-
-100     CONTINUE
-
-        ILINON=1
-        NIT=0
-        CALL JNLINS
-
-      ELSE
-C...Do line search
-
-        CALL JNLINS
-
-        IF (ILINON.EQ.0) THEN
-C...Zero (DW,DT)
-          DO 130 I=1,MM0(NL+1)
-            DW(I)=0.0
-130       CONTINUE
-          DO 140 I=1,MV0(NL+1)
-            DT(I)=0.0
-140       CONTINUE
-        ENDIF
-
-      ENDIF
-
-      RETURN
-
-C**** END OF JNCOGR ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNDELT
-
-C...JetNet subroutine DELTa weights
-
-C...Calculates the change in weights and thresholds to minimize the
-C...cost function according to gradient descent
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      COMMON /JNSIGM/ GPJN(MAXV),GPPJN(MAXV)
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/,/JNSIGM/
-
-
-C...(Learning rate and inverse temperature are multiplied in JNTRAL).
-
-C...calculate the deltas at nodes in output layer
-
-      IF (MSTJN(4).EQ.-1) THEN
-        DO 101 I=1,M(NL)
-          MI=MV0(NL)+I
-          DIFF=OUT(I)-O(MI)
-          D(MI)=DIFF*GPJN(MI)/(1.-DIFF**2)
-101     CONTINUE
-      ELSE
-        DO 100 I=1,M(NL)
-          MI=MV0(NL)+I
-          D(MI)=(OUT(I)-O(MI))*GPJN(MI)
-100     CONTINUE
-      ENDIF
-
-C...calculate deltas in following layers
-
-      DO 200 IL=NL-1,1,-1
-
-C...calculate the deltas at nodes in layer IL
-
-       DO 210 J=1,M(IL)
-         MJ=MV0(IL)+J
-         MIJ=MM0(IL+1)+(J-1)*M(IL+1)
-         SUM=0.0
-         DO 220 I=MV0(IL+1)+1,MV0(IL+1)+M(IL+1)
-           MIJ=MIJ+1
-           SUM=SUM+D(I)*W(MIJ)
-220      CONTINUE
-        D(MJ)=SUM*GPJN(MJ)
-210     CONTINUE
-200   CONTINUE
-
-C...calculate deltas at all weights between first and second layer
-
-      NEXTL=2
-
-      IF(NXIN.EQ.0) THEN
-
-C...normal first layer
-
-        DO 300 I=1,M(1)
-          MIJ=I-M(1)
-          DO 310 J=1,M(0)
-            MIJ=MIJ+M(1)
-            DW(MIJ)=DW(MIJ)+D(I)*OIN(J)
-310       CONTINUE
-          DT(I)=DT(I)+D(I)
-300     CONTINUE
-
-      ELSE
-
-C...receptive fields in first layer
-
-        DO 320 IHPRF=1,NHPRF
-
-          SUMRFT=0.0
-
-          DO 330 IY=1,NYHRF
-            IH=IY-NYHRF+(IHPRF-1)*NHRF
-            DO 340 IX=1,NXHRF
-              IH=IH+NYHRF
-              DO 350 JY=1,NYRF
-                IW=JY-NYRF+(IHPRF-1)*NRFW
-                DO 360 JX=1,NXRF
-                  IW=IW+NYRF
-                  INX=IX+JX-1
-                  IF(INX.GT.ABS(NXIN)) INX=INX-ABS(NXIN)
-                  INY=IY+JY-1
-                  IF(INY.GT.ABS(NYIN)) INY=INY-ABS(NYIN)
-                  IN=(INX-1)*ABS(NYIN)+INY
-                  DW(IW)=DW(IW)+D(IH)*OIN(IN)/FLOAT(NHRF)
-360             CONTINUE
-350           CONTINUE
-              DO 370 IN=ABS(NXIN*NYIN)+1,M(0)
-                IW=NXRF*NYRF+IN-ABS(NXIN*NYIN)+(IHPRF-1)*NRFW
-                DW(IW)=DW(IW)+D(IH)*OIN(IN)/FLOAT(NHRF)
-370           CONTINUE
-              SUMRFT=SUMRFT+D(IH)
-340         CONTINUE
-330       CONTINUE
-
-          SUMRFT=SUMRFT/FLOAT(NXHRF*NYHRF)
-
-          DO 380 IH=1,NXHRF*NYHRF
-            DT(IH+(IHPRF-1)*NHRF)=DT(IH+(IHPRF-1)*NHRF)+SUMRFT
-380       CONTINUE
-
-320     CONTINUE
-
-        DO 390 IH=NHRF*NHPRF+1,M(1)
-          IW=NRFW*NHPRF+IH-M(1)
-          DO 400 IN=1,M(0)
-            IW=IW+M(1)
-            DW(IW)=DW(IW)+D(IH)*OIN(IN)
-400       CONTINUE
-          DT(IH)=DT(IH)+D(IH)
-390     CONTINUE
-
-        IF(MSTJN(27).LT.0) THEN
-
-          DO 500 I=1,M(2)
-            MI=MV0(2)+I
-            DO 510 IHPRF=1,NHPRF
-              SUMRFW=0.0
-              DO 520 J=(IHPRF-1)*NHRF+1,IHPRF*NHRF
-                SUMRFW=SUMRFW+D(MI)*O(J)
-520           CONTINUE
-              MIJ=MM0(2)+((IHPRF-1)*NHRF-1)*M(2)+I
-              SUMRFW=SUMRFW/FLOAT(NHRF)
-              DO 530 J=1,NHRF
-                MIJ=MIJ+M(2)
-                DW(MIJ)=DW(MIJ)+SUMRFW
-530           CONTINUE
-510         CONTINUE
-            MIJ=MM0(2)+I+(NHRF*NHPRF-1)*M(2)
-            DO 540 J=NHRF*NHPRF+1,M(1)
-              MIJ=MIJ+M(2)
-              DW(MIJ)=DW(MIJ)+D(MI)*O(J)
-540         CONTINUE
-            DT(MI)=DT(MI)+D(MI)
-500       CONTINUE
-
-          NEXTL=3
-
-        ENDIF
-
-      ENDIF
-
-C...calculate deltas at all weights between following layers
-
-      DO 410 IL=NEXTL,NL
-
-       DO 420 I=1,M(IL)
-         MIJ=MM0(IL)+I-M(IL)
-         MI=MV0(IL)+I
-         DO 430 J=MV0(IL-1)+1,MV0(IL-1)+M(IL-1)
-           MIJ=MIJ+M(IL)
-           DW(MIJ)=DW(MIJ)+D(MI)*O(J)
-430      CONTINUE
-         DT(MI)=DT(MI)+D(MI)
-420     CONTINUE
-410   CONTINUE
-
-      RETURN
-
-C**** END OF JNDELT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNDUMP(NF)
-
-C...JetNet subroutine DUMP weights
-
-C...Dumps weights, threshold and other characteristics of the
-C...net to a file for use in other programs
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/
-
-      CHARACTER C(0:1)
-
-
-      IF(NF.LT.0) THEN
-
-C...unformatted dump
-
-        JF=-NF
-        WRITE(JF) 30
-        WRITE(JF) MSTJN,PARJN,TINV,IGFN,ETAL,WIDL,SATM
-
-        DO 100 I=1,MM0(NL+1)
-          WRITE(JF) W(I)
-100     CONTINUE
-
-        DO 110 I=1,MV0(NL+1)
-          WRITE(JF) T(I)
-110     CONTINUE
-
-        DO 120 I=1,MM0(NL+1)
-          WRITE(JF) NSELF(I)
-120     CONTINUE
-
-        DO 130 I=1,MV0(NL+1)
-          WRITE(JF) NTSELF(I)
-130     CONTINUE
-
-      ELSE
-
-C...Formatted dump
-
-        C(1)=' '
-        C(0)='*'
-
-        NFSAVE=MSTJN(6)
-        MSTJN(6)=NF
-
-        WRITE(NF,600)
-        CALL JNHEAD
-        CALL JNSTAT(1)
-        CALL JNSTAT(2)
-
-        MSTJN(6)=NFSAVE
-
-        WRITE(NF,*)
-        WRITE(NF,*)
-        WRITE(NF,*)
-
-        IF(NXIN.EQ.0) THEN
-
-          WRITE(NF,610)0,1
-          DO 200 J=1,M(0)
-            WRITE(NF,*)
-            WRITE(NF,640)(W(JNINDX(1,I,J)),
-     &                    C(NSELF(JNINDX(1,I,J))),I=1,M(1))
-200       CONTINUE
-
-        ELSE
-
-          WRITE(NF,650)
-          DO 210 IHPRF=1,NHPRF
-            WRITE(NF,*)
-            WRITE(NF,640)(W(IW),C(NSELF(IW)),
-     &                      IW=NRFW*(IHPRF-1)+1,NRFW*IHPRF)
-210       CONTINUE
-          IF(NHRF*NHPRF.LT.M(1)) THEN
-            WRITE(NF,*)
-            WRITE(NF,660)
-            DO 220 J=1,M(0)
-              WRITE(NF,*)
-              WRITE(NF,640)(W(JNINDX(1,I,J)),
-     &                    C(NSELF(JNINDX(1,I,J))),I=NHRF*NHPRF+1,M(1))
-220         CONTINUE
-          ENDIF
-
-        ENDIF
-
-        WRITE(NF,*)
-        WRITE(NF,630) 1
-        WRITE(NF,*)
-        WRITE(NF,640)(T(JNINDX(1,I,0)),
-     &                C(NTSELF(JNINDX(1,I,0))),I=1,M(1))
-
-        DO 300 IL=2,NL
-
-          WRITE(NF,*)
-          WRITE(NF,610)IL-1,IL
-          DO 310 J=1,M(IL-1)
-            WRITE(NF,*)
-            WRITE(NF,640)(W(JNINDX(IL,I,J)),
-     &                    C(NSELF(JNINDX(IL,I,J))),I=1,M(IL))
-310       CONTINUE
-
-          WRITE(NF,*)
-          WRITE(NF,630)IL
-          WRITE(NF,*)
-          WRITE(NF,640)(T(JNINDX(IL,I,0)),
-     &                  C(NTSELF(JNINDX(IL,I,0))),I=1,M(IL))
-300     CONTINUE
-
-      ENDIF
-
-600   FORMAT(26X,'Dump of weights generated by')
-610   FORMAT(21X,'Values of weights between layer',I2,' (rows) and',I2,
-     &           ' (columns)')
-630   FORMAT(30X,'Thresholds in layer',I2)
-640   FORMAT(6(E12.4,A1))
-650   FORMAT(21X,'Values of weights in receptive fields')
-660   FORMAT(21X,'Values of other weights between input layer (rows)',
-     &           ' and layer  1 (columns)')
-
-      RETURN
-
-C**** END OF JNDUMP ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNERR(IERR)
-
-C...JetNet subroutine ERROR
-
-C...Writes out an error message and stops the execution
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(MAXD2E=300)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/
-
-
-      IF (MSTJM(8).EQ.1) MSTJN(6)=MSTJM(6)
-      WRITE(MSTJN(6),600) IERR
-
-      IF(IERR.EQ.1) THEN
-        WRITE(MSTJN(6),610) MSTJN(1)
-      ELSEIF(IERR.EQ.2) THEN
-        WRITE(MSTJN(6),620) MV0(NL+1),MAXV
-      ELSEIF(IERR.EQ.3) THEN
-        WRITE(MSTJN(6),630) MM0(NL+1),MAXM
-      ELSEIF(IERR.EQ.4) THEN
-        WRITE(MSTJN(6),640)
-      ELSEIF(IERR.EQ.5) THEN
-        WRITE(MSTJN(6),650) 'JNINDX'
-      ELSEIF(IERR.EQ.6) THEN
-        WRITE(MSTJN(6),650) 'JNSEFI'
-      ELSEIF(IERR.EQ.7) THEN
-        WRITE(MSTJN(6),660) MSTJN(10),MAXI
-      ELSEIF(IERR.EQ.8) THEN
-        WRITE(MSTJN(6),670) MSTJN(NL),MAXO
-      ELSEIF(IERR.EQ.9) THEN
-        WRITE(MSTJN(6),680) MSTJN(5)
-      ELSEIF(IERR.EQ.10) THEN
-        WRITE(MSTJN(6),690) (MSTJN(I),I=23,26)
-      ELSEIF(IERR.EQ.11) THEN
-        WRITE(MSTJN(6),700) MSTJN(10),MSTJN(23),MSTJN(24)
-      ELSEIF(IERR.EQ.12) THEN
-        WRITE(MSTJN(6),710)
-      ELSEIF(IERR.EQ.13) THEN
-        WRITE(MSTJN(6),720)
-      ELSEIF(IERR.EQ.14) THEN
-        WRITE(MSTJN(6),730)
-      ELSEIF(IERR.EQ.15) THEN
-        WRITE(MSTJN(6),740)MSTJN(3)
-      ELSEIF(IERR.EQ.16) THEN
-        WRITE(MSTJN(6),750)
-      ELSEIF(IERR.EQ.17) THEN
-        WRITE(MSTJN(6),760)
-      ELSEIF(IERR.EQ.18) THEN
-        WRITE(MSTJN(6),770)
-      ELSEIF(IERR.EQ.19) THEN
-        WRITE(MSTJN(6),780)
-      ELSEIF(IERR.EQ.20) THEN
-        WRITE(MSTJN(6),790)
-      ELSEIF(IERR.EQ.21) THEN
-        WRITE(MSTJN(6),800)MSTJN(38)
-        WRITE(MSTJN(6),805)MSTJN(36)
-      ELSEIF(IERR.EQ.22) THEN
-        WRITE(MSTJN(6),650) 'JNTRAL'
-      ELSEIF(IERR.EQ.23) THEN
-        WRITE(MSTJN(6),650) 'JNTEST'
-      ELSEIF(IERR.EQ.24) THEN
-        WRITE(MSTJN(6),810)MSTJN(9)
-      ELSEIF(IERR.EQ.25) THEN
-        WRITE(MSTJN(6),820)MSTJN(7)
-      ELSEIF(IERR.EQ.26) THEN
-        WRITE(MSTJN(6),650)'JNHESS'
-      ELSEIF(IERR.EQ.27) THEN
-        WRITE(MSTJN(6),830)MM0(NL+1)+MV0(NL+1)
-      ELSEIF(IERR.EQ.28) THEN
-        WRITE(MSTJN(6),650)'JNHDIA'
-      ELSEIF(IERR.EQ.29) THEN
-        WRITE(MSTJN(6),840)MSTJN(39)
-        WRITE(MSTJN(6),850)MSTJN(9)*MSTJN(2)
-      ELSEIF(IERR.EQ.30) THEN
-        WRITE(MSTJN(6),860)
-      ELSEIF(IERR.EQ.31) THEN
-        WRITE(MSTJN(6),870)MSTJN(4)
-        WRITE(MSTJN(6),880)IGFN(NL)
-      ELSEIF(IERR.EQ.32) THEN
-        WRITE(MSTJN(6),890)
-      ENDIF
-
-      IF(IERR.GT.0) STOP 0
-
-600   FORMAT(' *** JETNET ERROR:',I2,' ***')
-610   FORMAT(' Illegal number of layers (',I3,')')
-620   FORMAT(' Total number of nodes (',I6,') exceeds limit (',I6,').')
-630   FORMAT(' Total number of weights (',I6,') exceeds limit (',
-     &I6,').')
-640   FORMAT(' Number of nodes in output layer is incompatible ',/,
-     &       ' with the dimension of the Potts-nodes.')
-650   FORMAT(' JETNET must be initialized (with JNINIT or JNREAD) ',
-     &       'before ',A6,' can be called.')
-660   FORMAT(' Total number of input nodes (',I6,
-     &                   ') exceeds limit (',I6,').')
-670   FORMAT(' Total number of output nodes (',I6,
-     &                   ') exceeds limit (',I6,').')
-680   FORMAT(' Undefined updating algorithm (',I2,') chosen.')
-690   FORMAT(' Inconsistent geometry for receptive fields:',/,
-     &       ' (MSTJN(23) = ',I4,', MSTJN(24) = ',I4,
-     &       ', MSTJN(25) = ',I4,', MSTJN(26) = ',I4,')')
-700   FORMAT(' Too few input nodes (=',I4,') for receptive fields',/,
-     &       ' (MSTJN(23) = ',I4,' and MSTJN(24) = ',I4,').')
-710   FORMAT(' In JNSEFI: attempt to connect/disconnect unconnectable',
-     &       ' nodes.')
-720   FORMAT(' Cannot read file - wrong format. Try JNROLD instead.')
-730   FORMAT(' Chopping not allowed on non-sigmoid functions.')
-740   FORMAT(' Undefined transfer function (',I2,') in GJN.')
-750   FORMAT(' Call to JNINIT after calling JMINIT')
-760   FORMAT(' JNREAD cannot read data-file produced by JMDUMP')
-770   FORMAT(' JNROLD cannot read data-file produced by JMDUMP')
-780   FORMAT(' You cannot start learning by terminating Conj. Grad.')
-790   FORMAT(' Too many warnings issued by JETNET.')
-800   FORMAT(' Nr. of restarts (',I4,') in Quickprop, line search, or ')
-805   FORMAT(' Scaled Conj. Grad. exceeds maximum MSTJN(36) = ',I4)
-810   FORMAT(' MSTJN(9) (',I3,') must be > 0')
-820   FORMAT(' Layer ',I2,' has no nodes')
-830   FORMAT(' Nr. of weights (',I6,') exceeds limit in JNHESS.')
-840   FORMAT(' Nr. of calls to JNHESS (',I5,') must be an integer ')
-850   FORMAT(' multiple of MSTJN(9)*MSTJN(2) (',I5,') if JNHEIG',
-     &       ' is invoked')
-860   FORMAT(' Too many iterations in subroutine JNTRTQ.')
-870   FORMAT(' Error function, MSTJN(4) = ',I2,', incompatible with')
-880   FORMAT(' using output transfer function = ',I3)
-890   FORMAT(' Updating turned off, MSTJN(5) = 9, when calling JNINIT')
-
-      RETURN
-
-C**** END OF JNERR *****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNESRT(NWGTS,IGRAD)
-
-C...JetNet subroutine Eigenvector/value SoRT
-
-C...Sorts the eigenvectors and eigenvalues into descending order.
-C...The routine is taken from Press et al. "Numerical Recipes", where
-C...it is called eigsrt.
-C...If IGRAD =|= 0, then eigenvectors are also sorted, otherwise not.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(MAXD2E=300)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT5/ D2E(MAXD2E,MAXD2E)
-      SAVE /JNDAT1/,/JNINT5/
-
-      DO 13 I=1,NWGTS-1
-        K=I
-        TEMP=OUT(I)
-        DO 11 J=I+1,NWGTS
-          IF(OUT(J).GE.TEMP) THEN
-            K=J
-            TEMP=OUT(J)
-          ENDIF
-11      CONTINUE
-        IF(K.NE.I) THEN
-          OUT(K)=OUT(I)
-          OUT(I)=TEMP
-          IF(IGRAD.NE.0) THEN
-            DO 12 J=1,NWGTS
-              TEMP=D2E(J,I)
-              D2E(J,I)=D2E(J,K)
-              D2E(J,K)=TEMP
-12          CONTINUE
-          ENDIF
-        ENDIF
-13    CONTINUE
-
-      RETURN
-
-C**** END OF JNESRT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNFEED
-
-C...JetNet subroutine FEED signal through net
-
-C...Takes the the values of OIN and calculates the values of
-C...the output nodes without writing to OUT
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      SAVE /JNDAT1/,/JNDAT2/, /JNINT1/,/JNINT2/,/JNINT3/
-
-
-C...set beta in first layer
-
-      IF(TINV(1).EQ.0.0) THEN
-        BETA=PARJN(3)
-      ELSE
-        BETA=ABS(TINV(1))
-      ENDIF
-
-C...calculate nodes in first layer
-
-      IF(NXIN.EQ.0) THEN
-
-C...normal first layer
-
-        DO 100 I=1,M(1)
-          A(I)=T(I)
-          MIJ=I-M(1)
-          DO 110 J=1,M(0)
-            MIJ=MIJ+M(1)
-            A(I)=A(I)+W(MIJ)*OIN(J)
-110       CONTINUE
-          O(I)=GJN(I,BETA*A(I),NG(1))
-100     CONTINUE
-
-      ELSE
-
-C...receptive fields in first layer
-
-        DO 120 IHPRF=1,NHPRF
-
-          DO 130 IY=1,NYHRF
-            IH=IY-NYHRF+(IHPRF-1)*NHRF
-            DO 140 IX=1,NXHRF
-              IH=IH+NYHRF
-              A(IH)=T(IH)
-              DO 150 JY=1,NYRF
-                IW=JY-NYRF+(IHPRF-1)*NRFW
-                DO 160 JX=1,NXRF
-                  IW=IW+NYRF
-                  INX=IX+JX-1
-                  IF(INX.GT.ABS(NXIN)) INX=INX-ABS(NXIN)
-                  INY=IY+JY-1
-                  IF(INY.GT.ABS(NYIN)) INY=INY-ABS(NYIN)
-                  IN=(INX-1)*ABS(NYIN)+INY
-                  A(IH)=A(IH)+W(IW)*OIN(IN)
-160             CONTINUE
-150           CONTINUE
-              DO 170 IN=ABS(NXIN*NYIN)+1,M(0)
-                IW=NXRF*NYRF+IN-ABS(NXIN*NYIN)+(IHPRF-1)*NRFW
-                A(IH)=A(IH)+W(IW)*OIN(IN)
-170           CONTINUE
-              O(IH)=GJN(IH,BETA*A(IH),NG(1))
-140         CONTINUE
-130       CONTINUE
-120     CONTINUE
-
-        DO 180 IH=NHRF*NHPRF+1,M(1)
-          A(IH)=T(IH)
-          IW=NHRF*NHPRF+IH-M(1)
-          DO 190 IN=1,M(0)
-            IW=IW+M(1)
-            A(IH)=A(IH)+W(IW)*OIN(IN)
-190       CONTINUE
-          O(IH)=GJN(IH,BETA*A(IH),NG(1))
-180     CONTINUE
-
-      ENDIF
-
-C...calculate nodes in following layers
-
-      DO 200 IL=2,NL
-
-C...set beta in layer IL
-
-       IF(TINV(IL).EQ.0.0) THEN
-         BETA=PARJN(3)
-       ELSE
-         BETA=ABS(TINV(IL))
-       ENDIF
-
-C...calculate nodes in layer IL
-
-       DO 210 I=1,M(IL)
-         MI=MV0(IL)+I
-         A(MI)=T(MI)
-         MIJ=MM0(IL)-M(IL)+I
-         DO 220 J=MV0(IL-1)+1,MV0(IL-1)+M(IL-1)
-           MIJ=MIJ+M(IL)
-           A(MI)=A(MI)+W(MIJ)*O(J)
-220      CONTINUE
-         O(MI)=GJN(MI,BETA*A(MI),NG(IL))
-210     CONTINUE
-200   CONTINUE
-
-      IF(IPOTT.LT.2) RETURN
-
-C...Special treatment of output layer if Potts-nodes
-
-      DO 300 I=1,M(NL)/IPOTT
-        DD=0.0
-        JO=MV0(NL)+(I-1)*IPOTT
-        DO 310 J=1,IPOTT
-          DD=DD+O(JO+J)
-310     CONTINUE
-        DO 320 J=1,IPOTT
-          O(JO+J)=O(JO+J)/DD
-320     CONTINUE
-300   CONTINUE
-
-      RETURN
-
-C**** END OF JNFEED ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNHEAD
-
-C...JetNet subroutine write HEADer
-
-C...Writes a header on file number NF
-
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      SAVE /JNDAT1/
-
-
-      IF(MSTJM(8).EQ.1) MSTJN(6)=MSTJM(6)
-
-      WRITE(MSTJN(6),*)
-      WRITE(MSTJN(6),*)
-      WRITE(MSTJN(6),600)
-      WRITE(MSTJN(6),610)
-      WRITE(MSTJN(6),*)
-
-600   FORMAT(14X,'The Lund Neural Network Program - JETNET version 3.5')
-610   FORMAT(14X,'******  Latest date of change: April 16, 1997 ******')
-
-      RETURN
-
-C**** END OF JNHEAD ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNHEIG(IGRAD)
-
-C...JetNet subroutine Hessian EIGenvalues.
-
-C...Diagonalizes the Hessian matrix stored in D2E. The eigenvalues
-C...are placed in the vector OUT. If IGRAD isn't equal to 0 then the
-C...eigenvectors of the Hessian are calculated.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,TINY=1.E-20)
-      PARAMETER(MAXD2E=300)
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT5/ D2E(MAXD2E,MAXD2E)
-      SAVE /JNDAT1/,/JNINT2/,/JNINT5/
-
-
-      IF (MSTJN(8).EQ.0) CALL JNERR(28)
-      IF ((MOD(MSTJN(39),(MSTJN(2)*MSTJN(9))).NE.0).OR.
-     &    (MSTJN(39).LE.0)) CALL JNERR(29)
-
-      NWGTS=MM0(NL+1)+MV0(NL+1)
-C...Compute eigenvectors/values
-      CALL JNTRTQ(NWGTS,IGRAD)
-C...Sort them in descending order
-      CALL JNESRT(NWGTS,IGRAD)
-
-      RETURN
-
-C**** END OF JNHEIG ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNHESS
-
-C...JetNet subroutine calculate HESSian
-
-C...Calculates the Hessian for the network. It assumes a summed square
-C...error (MSTJN(4)=0).
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,TINY=1.E-20)
-      PARAMETER(MAXD2E=300)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT5/ D2E(MAXD2E,MAXD2E)
-      COMMON /JNSIGM/ GPJN(MAXV),GPPJN(MAXV)
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT5/,/JNSIGM/
-
-      DIMENSION DD(MAXD2E),Q(MAXD2E,MAXD2E)
-
-      IF (MSTJN(8).EQ.0) CALL JNERR(26)
-      IF (MSTJN(9).LE.0) CALL JNERR(24)
-
-      NWGTS=MM0(NL+1)+MV0(NL+1)
-      IF (NWGTS.GT.MAXD2E) CALL JNERR(27)
-      IF (MOD(MSTJN(39),(MSTJN(2)*MSTJN(9))).EQ.0) THEN
-C...zero Hessian:
-        DO 100 I=1,NWGTS
-          DO 110 J=1,NWGTS
-            D2E(I,J)=0.0
-110       CONTINUE
-100     CONTINUE
-      ENDIF
-
-      MSTJN(39)=MSTJN(39)+1
-
-      CALL JNFEED
-
-C...rescale GPJN and GPPJN:
-      DO 200 IL=1,NL
-        IF(TINV(IL).EQ.0.0) THEN
-          BETA=PARJN(3)
-        ELSE
-          BETA=ABS(TINV(IL))
-        ENDIF
-        DO 210 I=1,M(IL)
-          MI=JNINDX(IL,I,0)
-          GPJN(MI)=GPJN(MI)*BETA
-          GPPJN(MI)=GPPJN(MI)*BETA**2
-210     CONTINUE
-200   CONTINUE
-
-C...compute Q:
-      DO 220 IL1=NL,2,-1
-        DO 230 IL2=IL1-1,1,-1
-          DO 240 I=1,M(IL1)
-            MI=JNINDX(IL1,I,0)
-            DO 250 J=1,M(IL2)
-              MJ=JNINDX(IL2,J,0)
-              IF (IL2.EQ.IL1-1) THEN
-                MIJ=JNINDX(IL1,I,J)
-                Q(MI,MJ)=W(MIJ)
-              ELSE
-                SUM=0.0
-                DO 260 J2=1,M(IL2+1)
-                  MJ2=JNINDX(IL2+1,J2,0)
-                  MJK=JNINDX(IL2+1,J2,J)
-                  SUM=SUM+Q(MI,MJ2)*GPJN(MJ2)*W(MJK)
-260             CONTINUE
-                Q(MI,MJ)=SUM
-              ENDIF
-250         CONTINUE
-240       CONTINUE
-230     CONTINUE
-220   CONTINUE
-
-C...Loop over output units:
-      DO 300 I=1,M(NL)
-        MI=JNINDX(NL,I,0)
-        GAM=(O(MI)-OUT(I))*GPJN(MI)
-        GAMCAP=(O(MI)-OUT(I))*GPPJN(MI)
-
-C...Diagonal weights - output layer:
-        D2E(I,I)=D2E(I,I)+GAMCAP
-        IF (NL.NE.1) THEN
-          DO 310 J1=1,M(NL-1)
-            MJ1=JNINDX(NL-1,J1,0)
-            MIJ1=M(NL)+(I-1)*M(NL-1)+J1
-            TERM=GAMCAP*O(MJ1)
-            D2E(I,MIJ1)=D2E(I,MIJ1)+TERM
-            DO 320 J2=1,J1
-              MJ2=JNINDX(NL-1,J2,0)
-              MIJ2=M(NL)+(I-1)*M(NL-1)+J2
-              D2E(MIJ2,MIJ1)=D2E(MIJ2,MIJ1)+TERM*O(MJ2)
-320         CONTINUE
-310       CONTINUE
-        ELSE
-          DO 330 J1=1,M(0)
-            MIJ1=M(NL)+(I-1)*M(0)+J1
-            TERM=GAMCAP*OIN(J1)
-            D2E(I,MIJ1)=D2E(I,MIJ1)+TERM
-            DO 340 J2=1,J1
-              MIJ2=M(NL)+(I-1)*M(0)+J2
-              D2E(MIJ2,MIJ1)=D2E(MIJ2,MIJ1)+TERM*OIN(J2)
-340         CONTINUE
-330       CONTINUE
-        ENDIF
-
-C...Diagonal weights - other layers:
-        IOFST=0
-        DO 350 IL=NL-1,1,-1
-          IOFST=IOFST+M(IL+1)*(1+M(IL))
-          DO 360 J1=1,M(IL)
-            MJ1=JNINDX(IL,J1,0)
-            FACTOR=GAM*Q(MI,MJ1)*GPPJN(MJ1)
-
-            D2E(IOFST+J1,IOFST+J1)=D2E(IOFST+J1,IOFST+J1)+FACTOR
-            IF (IL.GT.1) THEN
-              DO 370 K1=1,M(IL-1)
-                MK1=JNINDX(IL-1,K1,0)
-                MJK1=M(IL)+(J1-1)*M(IL-1)+K1
-                TERM=FACTOR*O(MK1)
-                D2E(IOFST+J1,IOFST+MJK1)=
-     &          D2E(IOFST+J1,IOFST+MJK1)+TERM
-                DO 380 K2=1,K1
-                  MK2=JNINDX(IL-1,K2,0)
-                  MJK2=M(IL)+(J1-1)*M(IL-1)+K2
-                  D2E(IOFST+MJK2,IOFST+MJK1)=
-     &            D2E(IOFST+MJK2,IOFST+MJK1)+TERM*O(MK2)
-380             CONTINUE
-370           CONTINUE
-            ELSE
-              DO 390 K1=1,M(0)
-                MJK1=M(1)+(J1-1)*M(0)+K1
-                TERM=FACTOR*OIN(K1)
-                D2E(IOFST+J1,IOFST+MJK1)=
-     &          D2E(IOFST+J1,IOFST+MJK1)+TERM
-                DO 400 K2=1,K1
-                  MJK2=M(1)+(J1-1)*M(0)+K2
-                  D2E(IOFST+MJK2,IOFST+MJK1)=
-     &            D2E(IOFST+MJK2,IOFST+MJK1)+TERM*OIN(K2)
-400             CONTINUE
-390           CONTINUE
-            ENDIF
-
-            DO 410 J2=1,M(IL)
-              MJ2=JNINDX(IL,J2,0)
-              FACTOR=GAMCAP*Q(MI,MJ1)*GPJN(MJ1)*Q(MI,MJ2)*GPJN(MJ2)
-              IF (IL.LE.NL-2) THEN
-                SUM=0.0
-                DO 420 IL2=NL-1,IL+1,-1
-                  DO 430 J=1,M(IL2)
-                    MJ=JNINDX(IL2,J,0)
-                    SUM=SUM+Q(MI,MJ)*GPPJN(MJ)*Q(MJ,MJ1)*Q(MJ,MJ2)
-430               CONTINUE
-420             CONTINUE
-                FACTOR=FACTOR+SUM*GAM*GPJN(MJ1)*GPJN(MJ2)
-              ENDIF
-
-              IF (J2.GE.J1) THEN
-                D2E(IOFST+J1,IOFST+J2)=D2E(IOFST+J1,IOFST+J2)+FACTOR
-              ENDIF
-              IF (IL.GT.1) THEN
-                DO 431 K1=1,M(IL-1)
-                  MK1=JNINDX(IL-1,K1,0)
-                  MJK1=M(IL)+(J2-1)*M(IL-1)+K1
-                  TERM=FACTOR*O(MK1)
-                  D2E(IOFST+J1,IOFST+MJK1)=
-     &            D2E(IOFST+J1,IOFST+MJK1)+TERM
-                  IF (J2.EQ.J1) THEN
-                    DO 440 K2=1,K1
-                      MK2=JNINDX(IL-1,K2,0)
-                      MJK2=M(IL)+(J1-1)*M(IL-1)+K2
-                      D2E(IOFST+MJK2,IOFST+MJK1)=
-     &                D2E(IOFST+MJK2,IOFST+MJK1)+TERM*O(MK2)
-440                 CONTINUE
-                  ELSEIF (J2.GT.J1) THEN
-                    DO 450 K2=1,M(IL-1)
-                      MK2=JNINDX(IL-1,K2,0)
-                      MJK2=M(IL)+(J1-1)*M(IL-1)+K2
-                      D2E(IOFST+MJK2,IOFST+MJK1)=
-     &                D2E(IOFST+MJK2,IOFST+MJK1)+TERM*O(MK2)
-450                 CONTINUE
-                  ENDIF
-431             CONTINUE
-              ELSE
-                DO 460 K1=1,M(0)
-                  MJK1=M(1)+(J2-1)*M(0)+K1
-                  TERM=FACTOR*OIN(K1)
-                  D2E(IOFST+J1,IOFST+MJK1)=
-     &            D2E(IOFST+J1,IOFST+MJK1)+TERM
-                  IF (J2.EQ.J1) THEN
-                    DO 470 K2=1,K1
-                      MJK2=M(1)+(J1-1)*M(0)+K2
-                      D2E(IOFST+MJK2,IOFST+MJK1)=
-     &                D2E(IOFST+MJK2,IOFST+MJK1)+TERM*OIN(K2)
-470                 CONTINUE
-                  ELSEIF (J2.GT.J1) THEN
-                    DO 480 K2=1,M(0)
-                      MJK2=M(1)+(J1-1)*M(0)+K2
-                      D2E(IOFST+MJK2,IOFST+MJK1)=
-     &                D2E(IOFST+MJK2,IOFST+MJK1)+TERM*OIN(K2)
-480                 CONTINUE
-                  ENDIF
-460             CONTINUE
-              ENDIF
-
-410         CONTINUE
-360       CONTINUE
-
-350     CONTINUE
-C...End of diagonal weights.
-
-C...1st off-diagonal - output layer:
-        IOFST2=M(NL)*(1+M(NL-1))
-        DO 500 J=1,M(NL-1)
-          MJ=JNINDX(NL-1,J,0)
-          FACTOR=GAMCAP*Q(MI,MJ)*GPJN(MJ)
-
-          D2E(I,IOFST2+J)=D2E(I,IOFST2+J)+FACTOR
-
-          MIJ=M(NL)+(I-1)*M(NL-1)+J
-          FACT2=GAM*GPJN(MJ)
-
-          D2E(MIJ,IOFST2+J)=D2E(MIJ,IOFST2+J)+FACT2
-          IF (NL.GT.2) THEN
-            DO 510 K=1,M(NL-2)
-              MK=JNINDX(NL-2,K,0)
-              MJK=M(NL-1)+(J-1)*M(NL-2)+K
-              D2E(I,IOFST2+MJK)=
-     &        D2E(I,IOFST2+MJK)+FACTOR*O(MK)
-              D2E(MIJ,IOFST2+MJK)=
-     &        D2E(MIJ,IOFST2+MJK)+FACT2*O(MK)
-510         CONTINUE
-          ELSE
-            DO 520 K=1,M(0)
-              MJK=M(1)+(J-1)*M(0)+K
-              D2E(I,IOFST2+MJK)=
-     &        D2E(I,IOFST2+MJK)+FACTOR*OIN(K)
-              D2E(MIJ,IOFST2+MJK)=
-     &        D2E(MIJ,IOFST2+MJK)+FACT2*OIN(K)
-520         CONTINUE
-          ENDIF
-          DO 530 J2=1,M(NL-1)
-            MJ2=JNINDX(NL-1,J2,0)
-            MIJ2=M(NL)+(I-1)*M(NL-1)+J2
-            TERM=FACTOR*O(MJ2)
-            D2E(MIJ2,IOFST2+J)=D2E(MIJ2,IOFST2+J)+TERM
-            IF (NL.GT.2) THEN
-              DO 540 K=1,M(NL-2)
-                MK=JNINDX(NL-2,K,0)
-                MJK=M(NL-1)+(J-1)*M(NL-2)+K
-                D2E(MIJ2,IOFST2+MJK)=
-     &          D2E(MIJ2,IOFST2+MJK)+TERM*O(MK)
-540           CONTINUE
-            ELSE
-              DO 550 K=1,M(0)
-                MJK=M(1)+(J-1)*M(0)+K
-                D2E(MIJ2,IOFST2+MJK)=
-     &          D2E(MIJ2,IOFST2+MJK)+TERM*OIN(K)
-550           CONTINUE
-            ENDIF
-530       CONTINUE
-
-500     CONTINUE
-
-C...1st off-diagonal - other layers:
-        IOFST1=0
-        DO 560 IL=NL-1,2,-1
-          IOFST1=IOFST1+M(IL+1)*(1+M(IL))
-          IOFST2=IOFST2+M(IL)*(1+M(IL-1))
-          DO 570 J=1,M(IL)
-            MJ=JNINDX(IL,J,0)
-            DO 580 K=1,M(IL-1)
-              MK=JNINDX(IL-1,K,0)
-              FACTOR=GAMCAP*Q(MI,MJ)*GPJN(MJ)*Q(MI,MK)*GPJN(MK)+
-     &             GAM*Q(MI,MJ)*GPPJN(MJ)*Q(MJ,MK)*GPJN(MK)
-              IF (IL.LE.NL-2) THEN
-                SUM=0.0
-                DO 590 IL2=NL-1,IL+1,-1
-                  DO 600 J2=1,M(IL2)
-                    MJ2=JNINDX(IL2,J2,0)
-                    SUM=SUM+Q(MI,MJ2)*GPPJN(MJ2)*Q(MJ2,ML)*Q(MJ2,MJ)
-600               CONTINUE
-590             CONTINUE
-                FACTOR=FACTOR+SUM*GAM*GPJN(ML)*GPJN(MJ)
-              ENDIF
-
-              D2E(IOFST1+I,IOFST2+J)=D2E(IOFST1+I,IOFST2+J)+FACTOR
-
-              MJK=M(IL)+(J-1)*M(IL-1)+K
-              FACT2=GAM*Q(MI,MJ)*GPJN(MJ)*GPJN(MK)
-
-              D2E(IOFST1+MJK,IOFST2+J)=D2E(IOFST1+MJK,IOFST2+J)+FACT2
-
-              IF (IL-1.GT.1) THEN
-                DO 610 L=1,M(IL-2)
-                  ML=JNINDX(IL-2,L,0)
-                  MKL=M(IL-1)+(K-1)*M(IL-2)+L
-                  D2E(IOFST1+J,IOFST2+MKL)=
-     &            D2E(IOFST1+J,IOFST2+MKL)+FACTOR*O(ML)
-                  D2E(IOFST1+MJK,IOFST2+MKL)=
-     &            D2E(IOFST1+MJK,IOFST2+MKL)+FACT2*O(ML)
-610             CONTINUE
-              ELSE
-                DO 620 L=1,M(0)
-                  MKL=M(1)+(K-1)*M(0)+L
-                  D2E(IOFST1+J,IOFST2+MKL)=
-     &            D2E(IOFST1+J,IOFST2+MKL)+FACTOR*OIN(L)
-                  D2E(IOFST1+MJK,IOFST2+MKL)=
-     &            D2E(IOFST1+MJK,IOFST2+MKL)+FACT2*OIN(L)
-620             CONTINUE
-              ENDIF
-              DO 630 K2=1,M(IL-1)
-                MK2=JNINDX(IL-1,K2,0)
-                MJK2=M(IL)+(K-1)*M(IL-1)+K2
-                TERM=FACTOR*O(MK2)
-                D2E(IOFST1+MJK2,IOFST2+K)=D2E(IOFST1+MJK2,IOFST2+K)+
-     &                                    TERM
-                IF (IL-1.GT.1) THEN
-                  DO 640 L=1,M(IL-2)
-                    ML=JNINDX(IL-2,L,0)
-                    MKL=M(IL-1)+(K-1)*M(IL-2)+L
-                    D2E(IOFST1+MJK2,IOFST2+MKL)=
-     &              D2E(IOFST1+MJK2,IOFST2+MKL)+TERM*O(ML)
-640               CONTINUE
-                ELSE
-                  DO 650 L=1,M(0)
-                    MKL=M(1)+(K-1)*M(0)+L
-                    D2E(IOFST1+MJK2,IOFST2+MKL)=
-     &              D2E(IOFST1+MJK2,IOFST2+MKL)+TERM*OIN(L)
-650               CONTINUE
-                ENDIF
-630           CONTINUE
-
-580         CONTINUE
-570       CONTINUE
-560     CONTINUE
-C...End of 1st off-diagonal.
-
-C...Higher off-diagonals - output layer:
-        IOFST2=M(NL)*(1+M(NL-1))
-        DO 660 IL=NL-2,1,-1
-          IOFST2=IOFST2+M(IL+1)*(1+M(IL))
-          DO 670 K=1,M(IL)
-            MK=JNINDX(IL,K,0)
-            FACTOR=GAMCAP*Q(MI,MK)*GPJN(MK)
-
-            D2E(I,IOFST2+K)=D2E(I,IOFST2+K)+FACTOR
-            DO 690 J=1,M(NL-1)
-              MJ=JNINDX(NL-1,J,0)
-              MJK=M(NL)+(I-1)*M(NL-1)+J
-              FACT2=GAM*GPJN(MJ)*Q(MJ,MK)*GPJN(MK)
-              D2E(MJK,IOFST2+K)=D2E(MJK,IOFST2+K)+FACT2
-              IF (IL.GT.1) THEN
-                DO 700 L=1,M(IL-1)
-                  ML=JNINDX(IL-1,L,0)
-                  MKL=M(IL)+(K-1)*M(IL-1)+L
-                  D2E(I,IOFST2+MKL)=
-     &            D2E(I,IOFST2+MKL)+FACTOR*O(ML)
-                  D2E(MJK,IOFST2+MKL)=
-     &            D2E(MJK,IOFST2+MKL)+FACT2*O(ML)
-700             CONTINUE
-              ELSE
-                DO 710 L=1,M(0)
-                  MKL=M(1)+(K-1)*M(0)+L
-                  D2E(I,IOFST2+MKL)=
-     &            D2E(I,IOFST2+MKL)+FACTOR*OIN(L)
-                  D2E(MJK,IOFST2+MKL)=
-     &            D2E(MJK,IOFST2+MKL)+FACT2*OIN(L)
-710             CONTINUE
-              ENDIF
-690         CONTINUE
-670       CONTINUE
-660     CONTINUE
-
-C...Higher off-diagonals - other layers:
-        IOFST1=0
-        DO 720 IL1=NL-1,2,-1
-          IOFST1=IOFST1+M(IL1+1)*(1+M(IL1))
-          IOFST2=M(NL)*(1+M(NL-1))
-          DO 730 IL2=IL1-2,1,-1
-            IOFST2=IOFST2+M(IL2+1)*(1+M(IL2))
-            DO 740 J=1,M(IL1)
-              MJ=JNINDX(IL1,J,0)
-              DO 750 L=1,M(IL2)
-                ML=JNINDX(IL2,L,0)
-                FACTOR=GAMCAP*Q(MI,ML)*GPJN(ML)*Q(MI,MJ)*GPJN(MJ)+
-     &                 GAM*Q(MI,MJ)*GPPJN(MJ)*Q(MJ,ML)*GPJN(ML)
-                IF (IL1.LE.NL-2) THEN
-                  SUM=0.0
-                  DO 760 IL3=NL-1,IL1+1,-1
-                    DO 770 J2=1,M(IL3)
-                      MJ2=JNINDX(IL3,J2,0)
-                      SUM=SUM+Q(MI,MJ2)*GPPJN(MJ2)*Q(MJ2,MJ)*Q(MJ2,ML)
-770                 CONTINUE
-760               CONTINUE
-                  FACTOR=FACTOR+SUM*GAM*GPJN(ML)*GPJN(MJ)
-                ENDIF
-
-                D2E(IOFST1+J,IOFST2+L)=D2E(IOFST1+J,IOFST2+L)+
-     &                                 FACTOR
-                DO 780 K=1,M(IL1-1)
-                  MK=JNINDX(IL1-1,K,0)
-                  MKL=M(IL1)+(J-1)*M(IL1-1)+K
-                  FACT2=GAM*Q(MI,MJ)*GPJN(MJ)*GPJN(MK)*Q(MK,ML)*GPJN(ML)
-                  D2E(IOFST1+MKL,IOFST2+L)=D2E(IOFST1+MKL,IOFST2+L)+
-     &                                     FACT2
-                  IF (IL2.GT.1) THEN
-                    DO 790 M1=1,M(IL2-1)
-                      MM=JNINDX(IL2-1,M1,0)
-                      MLM=M(IL2)+(L-1)*M(IL2-1)+M1
-                      D2E(IOFST1+J,IOFST2+MLM)=
-     &                D2E(IOFST1+J,IOFST2+MLM)+FACTOR*O(MM)
-                      D2E(IOFST1+MKL,IOFST2+MLM)=
-     &                D2E(IOFST1+MKL,IOFST2+MLM)+FACT2*O(MM)
-790                 CONTINUE
-                  ELSE
-                    DO 800 M1=1,M(0)
-                      MLM=M(1)+(L-1)*M(0)+M1
-                      D2E(IOFST1+J,IOFST2+MLM)=
-     &                D2E(IOFST1+J,IOFST2+MLM)+FACTOR*OIN(M1)
-                      D2E(IOFST1+MKL,IOFST2+MLM)=
-     &                D2E(IOFST1+MKL,IOFST2+MLM)+FACT2*OIN(M1)
-800                 CONTINUE
-                  ENDIF
-780             CONTINUE
-
-750           CONTINUE
-740         CONTINUE
-730       CONTINUE
-720     CONTINUE
-
-300   CONTINUE
-C...End of loop over outputs.
-
-
-C...Add Jacobian part:
-      DO 900 I=1,M(NL)
-        DO 901 J=1,M(NL)
-          DD(J)=0.0
-          DO 902 K=1,M(NL-1)
-            DD(M(NL)+(J-1)*M(NL-1)+K)=0.0
-902       CONTINUE
-901     CONTINUE
-
-        MI=JNINDX(NL,I,0)
-        D(MI)=GPJN(MI)
-
-        DO 910 IL=NL-1,1,-1
-
-          DO 920 J=1,M(IL)
-            MJ=MV0(IL)+J
-            SUM=0.0
-            IF (IL.LT.NL-1) THEN
-              MIJ=MM0(IL+1)+(J-1)*M(IL+1)
-              DO 930 II=MV0(IL+1)+1,MV0(IL+1)+M(IL+1)
-                MIJ=MIJ+1
-                SUM=SUM+D(II)*W(MIJ)
-930           CONTINUE
-              D(MJ)=SUM*GPJN(MJ)
-            ELSE
-              MIJ=JNINDX(NL,I,J)
-              D(MJ)=D(MI)*W(MIJ)*GPJN(MJ)
-            ENDIF
-920       CONTINUE
-
-910     CONTINUE
-
-        DD(I)=D(MI)
-
-        IF (NL.EQ.1) THEN
-          DO 940 J=1,M(0)
-            DD(M(1)+(I-1)*M(0)+J)=D(MI)*OIN(J)
-940       CONTINUE
-        ELSE
-          DO 950 J=1,M(NL-1)
-            MJ=MV0(NL-1)+J
-            DD(M(NL)+(I-1)*M(NL-1)+J)=D(MI)*O(MJ)
-            DD(M(NL)+M(NL)*M(NL-1)+J)=D(MJ)
-950       CONTINUE
-          IOFST=M(NL)+M(NL)*M(NL-1)+M(NL-1)
-          DO 960 IL=NL-2,1,-1
-            DO 970 K=1,M(IL)
-              MK=MV0(IL)+K
-              INDX=IOFST+M(IL)*M(IL+1)+K
-              DD(INDX)=D(MK)
-              DO 980 J=1,M(IL+1)
-                MJ=MV0(IL+1)+J
-                INDX=IOFST+(J-1)*M(IL)+K
-                DD(INDX)=D(MJ)*O(MK)
-980           CONTINUE
-970         CONTINUE
-            IOFST=IOFST+M(IL)*M(IL+1)+M(IL)
-960       CONTINUE
-          DO 990 K=1,M(0)
-            DO 1000 J=1,M(1)
-              MJ=MV0(1)+J
-              INDX=IOFST+(J-1)*M(0)+K
-              DD(INDX)=D(MJ)*OIN(K)
-1000        CONTINUE
-990       CONTINUE
-        ENDIF
-
-        DO 1010 IW=1,NWGTS
-          DO 1020 IV=IW,NWGTS
-            D2E(IW,IV)=D2E(IW,IV)+DD(IW)*DD(IV)
-1020      CONTINUE
-1010    CONTINUE
-
-900   CONTINUE
-
-10    IF (MOD(MSTJN(39),(MSTJN(2)*MSTJN(9))).EQ.0) THEN
-C...Symmetrize and normalize the Hessian.
-        NWGTS=MM0(NL+1)+MV0(NL+1)
-        DO 20 I=1,NWGTS
-          D2E(I,I)=D2E(I,I)/FLOAT(MSTJN(2)*MSTJN(9))
-          DO 30 J=I+1,NWGTS
-            D2E(I,J)=D2E(I,J)/FLOAT(MSTJN(2)*MSTJN(9))
-            D2E(J,I)=D2E(I,J)
-30        CONTINUE
-20      CONTINUE
-      ENDIF
-
-      RETURN
-
-C**** END OF JNHESS ****************************************************
-      END
-C***********************************************************************
-
-
-      INTEGER FUNCTION JNINDX(IL,I,J)
-
-C...JetNet function INDeX
-
-C...Gives the node vector index of node I in layer IL for J=0
-C...else gives the weight vector index of weight between node  
-C...I of layer IL and node J of layer IL-1
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      SAVE /JNDAT1/,/JNINT2/,/JNINT3/
-
-
-      IF(MSTJN(8).EQ.0) CALL JNERR(5)
-
-      IF(J.EQ.0) THEN
-        JNINDX=MV0(IL)+I
-      ELSE
-        IF(NXIN.EQ.0.OR.IL.GT.1) THEN
-          JNINDX=MM0(IL)+(J-1)*M(IL)+I
-        ELSE
-          IF(I.LE.NHRF*NHPRF) THEN
-            IF(J.LE.ABS(NXIN*NYIN)) THEN
-              IX=(I-1)/NYHRF+1
-              IY=MOD(I-1,NYHRF)+1
-              INX=(J-1)/ABS(NYIN)+1
-              INY=MOD(J-1,ABS(NYIN))+1
-              JX=INX-IX+1
-              IF(JX.LE.0) JX=JX+NXRF
-              IF(JX.LE.0) CALL JNERR(12)
-              IF(JX.GT.NXRF) CALL JNERR(12)
-              JY=INY-IY+1
-              IF(JY.LE.0) JY=JY+NYRF
-              IF(JY.LE.0) CALL JNERR(12)
-              IF(JY.GT.NYRF) CALL JNERR(12)
-              JNINDX=(JX-1)*NYRF+JY+((I-1)/NHRF)*NRFW
-            ELSE
-              JNINDX=NXRF*NYRF+J-ABS(NXIN*NYIN)+((I-1)/NHRF)*NRFW
-            ENDIF
-          ELSE
-            JNINDX=NHPRF*NRFW+(J-1)*M(1)+I-NXHRF*NYHRF
-          ENDIF
-        ENDIF
-      ENDIF
-
-      RETURN
-
-C**** END OF JNINDX ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNINIT
-
-C...JetNet subroutine INITialize net
-
-C...Initializes a net according to switches and parameters in 
-C.../JNDAT1/ and /JNDAT2/
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/,/JNINT4/
-
-
-C...Check if JMINIT has been called
-
-      IF(MSTJM(8).EQ.1) CALL JNERR(16)
-
-C...Set parameters in /JNINT2/
-
-      CALL JNSEPA
-
-C...Set initial values of weights and thresholds
-
-      DO 100 IL=1,NL
-
-C...Set width in this layer
-
-        IF(WIDL(IL).LE.0) THEN
-          WIDTH=PARJN(4)
-        ELSE
-          WIDTH=WIDL(IL)
-        ENDIF
-
-C...Initialize weights
-
-        DO 110 I=MM0(IL)+1,MM0(IL+1)
-          IDUM=I
-          IF (WIDTH.GE.0.) THEN
-            W(I)=(2.0*RJN(IDUM)-1.0)*WIDTH
-          ELSE
-            W(I)=-RJN(IDUM)*WIDTH
-          ENDIF
-110     CONTINUE
-
-C...Initialize thresholds
-
-        DO 120 I=MV0(IL)+1,MV0(IL+1)
-          IDUM=I
-          IF (WIDTH.GE.0.) THEN
-            T(I)=(2.0*RJN(IDUM)-1.0)*WIDTH
-          ELSE
-            T(I)=-RJN(IDUM)*WIDTH
-          ENDIF
-120     CONTINUE
-
-100   CONTINUE
-
-      IF(NXIN.NE.0) THEN
-        DO 130 IHPRF=1,NHPRF
-          DO 140 I=2,NHRF
-            T((IHPRF-1)*NHRF+I)=T((IHPRF-1)*NHRF+1)
-140       CONTINUE
-130     CONTINUE
-
-        IF(MSTJN(27).LT.0) THEN
-          DO 150 I=1,M(2)
-            DO 160 IHPRF=1,NHPRF
-              MIJ=MM0(2)+(IHPRF-1)*NHRF*M(2)+I
-              SUMRFW=W(MIJ)
-              DO 170 J=2,NHRF
-                MIJ=MIJ+M(2)
-                W(MIJ)=SUMRFW
-170           CONTINUE
-160         CONTINUE
-150       CONTINUE
-        ENDIF
-
-      ENDIF
-
-C...Write statistics on output file
-
-      IF(MSTJN(6).LT.0) RETURN
-
-      CALL JNHEAD
-
-      CALL JNSTAT(1)
-
-      WRITE(MSTJN(6),600)
-
-600   FORMAT(22X,'Weights and thresholds set randomly')
-
-      RETURN
-
-C**** END OF JNINIT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNLINS
-
-C...JetNet subroutine do LINe Search.
-
-C...Performs a line search in the direction of G.
-C...The algorithm is a mixture between 'golden section search' and
-C...quadratic interpolation. Termination of the search is controlled
-C...by either of two criteria: (1) If the error has decreased 
-C...sufficiently much - set by PARJN(24); or (2) if the predicted
-C...location of the error is within the preset - PARJN(25) - tolerance
-C...distance from the current best point.
-C...The first step is always equal to PARJN(1), but PARJN(1) is set to
-C...about half the size of the last successful step every time
-C...the algorithm finds a minimum (provided that this step size is
-C...smaller than the maximum allowed step size).
-
-C...ERRLN(1) = error value in current point.
-C...ERRLN(2-3) = error values in previous points.
-C...ERRLN(0) = error value in the starting point.
-C...STEPLN(1) = step to be taken (the current point is always at x=0).
-C...STEPLN(2-3) = distance to previous points.
-C...STEPLN(0) = distance to starting point.
-C...STEPMN = distance to best minimum so far.
-C...PARJN(26)=minimum allowed relative change in error.
-C...PARJN(27)=maximum allowed step size.
-
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(GOLD=1.618034,CGOLD=0.3819660,GLIMIT=10.0,
-     &          TINY=1.E-20,ZEPS=1.E-8)
-
-C...ZEPS=machine precision.
-C...TINY=small number to prevent division by zero.
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT4/
-
-
-      IF (MSTJN(5).EQ.8) THEN
-C...Back up to best point so far and terminate updating.
-        IF (PARJN(8).LE.ERRMN) THEN
-          ERRMN=PARJN(8)
-          STEPMN=0.0
-        ENDIF
-        STEPLN(1)=-STEPMN
-C...Freeze updating:
-        MSTJN(5)=9
-        ILINON=0
-        NC=0
-        NIT=0
-        NSC=0
-        GOTO 20
-      ENDIF
-
-      NIT=NIT+1
-      IF (NIT.GT.MSTJN(35)) THEN
-C...Too many iterations -> restart from best minimum so far
-C...and rescale PARJN(1) according to previous success.
-        IF (MSTJN(38).GE.MSTJN(36)) CALL JNERR(21)
-        MSTJN(38)=MSTJN(38)+1
-        IF (ILINON.GT.0) THEN
-          IF (ERRLN(1).LE.ERRLN(0)) THEN
-            IF (ABS(STEPLN(0)).GT.TINY) THEN
-              PARJN(1)=MIN(MAX(ABS(STEPLN(0)),
-     &                     PARJN(1)*GOLD),PARJN(27))
-            ELSE
-              PARJN(1)=MIN(PARJN(1)*GOLD,PARJN(27))
-            ENDIF
-          ELSE
-            PARJN(1)=PARJN(1)*CGOLD
-          ENDIF
-        ELSE
-          PARJN(1)=PARJN(1)*CGOLD
-        ENDIF
-        PARJN(1)=MAX(PARJN(1),ZEPS)
-        STEPLN(1)=-STEPMN
-        ILINON=0
-        NC=0
-        NIT=0
-        GOTO 20
-      ENDIF
-
-      ETA=0.0
-10    IF (NIT.LT.3) THEN
-C...At least 3 points are needed
-
-        ERRLN(2)=ERRLN(1)
-C...Store last updated error 
-        ERRLN(1)=PARJN(8)
-
-        IF (NIT.EQ.1) THEN
-          ERRLN(0)=ERRLN(1)
-          ERRMN=ERRLN(1)
-          STEPLN(0)=0.0
-          STEPMN=0.0
-          DO 100 I=2,3
-            STEPLN(I)=0.0
-            ERRLN(I)=0.0
-100       CONTINUE
-          IF (ABS(DERRLN).GT.TINY) THEN
-            STEPLN(1)=-SIGN(PARJN(1),DERRLN)
-          ELSE
-            STEPLN(1)=PARJN(1)
-          ENDIF
-        ELSE
-          STEPLN(2)=-STEPLN(1)
-          DE2=2.*(ERRLN(1)-ERRLN(2)+STEPLN(2)*DERRLN)/STEPLN(2)**2
-          IF (ABS(DERRLN/STEPLN(2)).LT.(DE2*GLIMIT)) THEN
-            STEPLN(1)=-DERRLN/DE2
-          ELSE
-            STEPLN(1)=STEPLN(1)*GOLD
-          ENDIF
-        ENDIF
-
-        IF (ERRLN(1).LT.ERRMN) THEN
-          STEPMN=0.0
-          ERRMN=ERRLN(1)
-        ENDIF
-
-      ELSEIF (ILINON.GT.0) THEN
-C...Bracket the minimum
-
-C...Update error and step values:
-        ERRLN(3)=ERRLN(2)
-        ERRLN(2)=ERRLN(1)
-        STEPLN(3)=-STEPLN(1)+STEPLN(2)
-        STEPLN(2)=-STEPLN(1)
-        STEPLN(1)=0.0
-        ERRLN(1)=PARJN(8)
-        IF (ERRLN(1).LT.ERRMN) THEN
-          STEPMN=0.0
-          ERRMN=ERRLN(1)
-        ENDIF
-
-C...Check if the search is improving - else take default step.
-        IF (ABS(1.-ERRLN(0)/ERRLN(1)).LT.PARJN(26)) THEN
-          STEPLN(1)=-STEPLN(2)*GOLD
-          GOTO 20
-        ENDIF
-
-C...Quadratic fit
-        IF (((ERRLN(1)-ERRLN(3))*TINY).GT.STEPLN(3)) THEN
-          FACTOR=-1.0
-        ELSE
-          BC=((ERRLN(1)-ERRLN(3))/(STEPLN(3)+TINY) -
-     &       (ERRLN(1)-ERRLN(2))/(STEPLN(2)+TINY))/
-     &       (STEPLN(2)-STEPLN(3)+TINY)
-          AC=-BC*STEPLN(2)-(ERRLN(1)-ERRLN(2))/(STEPLN(2)+TINY)
-          ETA=-AC/(2.*BC+TINY)
-          IF (ABS(ETA).GT.TINY) THEN
-            FACTOR=(ERRLN(1)-ERRLN(2))/
-     &             (STEPLN(2)*(2.*ETA-STEPLN(2))+TINY)
-          ELSE
-            FACTOR=-1.0
-          ENDIF
-        ENDIF
-
-        IF (ERRLN(1).LT.ERRLN(2)) THEN
-          IF (ERRLN(1).LT.ERRLN(3)) THEN
-            IF (STEPLN(2)*STEPLN(3).LT.0.) THEN
-C...Minimum is bracketed -> find it
-              ILINON=-1
-              GOTO 10
-            ELSE
-C...Keep searching:
-              IF (FACTOR.GT.0.) THEN
-C...Quadratic fit OK.
-                IF ((ABS(ETA/STEPLN(2)).LT.GLIMIT).OR.
-     &              (ABS(ETA/STEPLN(3)).LT.GLIMIT)) THEN
-                  STEPLN(1)=ETA
-                ELSE
-                  STEPLN(1)=-STEPLN(2)*GOLD
-                ENDIF
-              ELSE
-                STEPLN(1)=-STEPLN(2)*GOLD
-              ENDIF
-            ENDIF
-          ELSE
-            IF (STEPLN(2)/STEPLN(3).GT.1.) THEN
-C...Back up to point (3)
-              STEPLN(1)=STEPLN(3)
-            ELSE
-C...Back up beyond point (3)
-              STEPLN(1)=GOLD*STEPLN(3)
-              STEPLN(2)=STEPLN(3)
-              ERRLN(2)=ERRLN(3)
-            ENDIF
-          ENDIF
-        ELSEIF (ERRLN(1).GT.ERRLN(2)) THEN
-          IF (ERRLN(2).LT.ERRLN(3)) THEN
-            IF (STEPLN(3)/STEPLN(2).GT.1.) THEN
-C...Minimum is bracketed -> back up towards point (2)
-              IF ((ETA/STEPLN(2).GT.0.).AND.
-     &           (ETA/STEPLN(2).LT.1.)) THEN
-                STEPLN(1)=ETA
-              ELSE
-                STEPLN(1)=STEPLN(2)
-                STEPLN(2)=STEPLN(3)
-                ERRLN(2)=ERRLN(3)
-              ENDIF
-              ILINON=-2
-            ELSE
-              STEPLN(1)=STEPLN(2)*GOLD
-            ENDIF
-          ELSE
-C...Rearrange and move beyond point (3)
-            STEPLN(1)=STEPLN(3)*GOLD
-            STEPLN(2)=STEPLN(3)
-            ERRLN(2)=ERRLN(3)
-          ENDIF
-        ELSE
-C...Take default step
-          STEPLN(1)=-STEPLN(2)*GOLD
-        ENDIF
-
-      ELSEIF (ILINON.LT.0) THEN
-C...Find minimum (knowing that minimum is bracketed)
-        ERRNOW=PARJN(8)
-        IF (ERRNOW.LT.ERRMN) THEN
-          STEPMN=0.0
-          ERRMN=ERRNOW
-        ENDIF
-C...Check bracket condition:
-        IF ((ERRNOW.GE.ERRLN(2)).OR.(ERRNOW.GE.ERRLN(3))) THEN
-          ILINON=1
-          GOTO 10
-        ENDIF
-
-        IF ((ERRLN(0)-ERRNOW).LE.
-     &       PARJN(24)*STEPLN(0)*DERRLN) THEN
-C...Satisfactory -> terminate search
-          NIT=0
-          ILINON=0
-          IF (ABS(STEPLN(0)).GT.ZEPS) THEN
-            PARJN(1)=MAX(MIN(ABS(STEPLN(0))*CGOLD,PARJN(27)),ZEPS)
-          ENDIF
-          IF (ERRNOW.GT.ERRMN) THEN
-C...Back up to best minimum so far
-            STEPLN(1)=-STEPMN
-            GOTO 20
-          ELSE
-            MSTJN(37)=0
-            RETURN
-          ENDIF
-        ELSE
-          IF (ILINON.NE.-1) THEN
-C...Rearrange points:
-            IF (ERRNOW.LE.ERRLN(1)) THEN
-              IF (STEPLN(1)/(STEPLN(2)+TINY).GT.0.) THEN
-                STEPLN(3)=-STEPLN(1)
-                ERRLN(3)=ERRLN(1)
-                STEPLN(2)=STEPLN(2)-STEPLN(1)
-                STEPLN(1)=0.0
-                ERRLN(1)=ERRNOW
-              ELSE
-                STEPLN(3)=STEPLN(3)-STEPLN(1)
-                STEPLN(2)=-STEPLN(1)
-                ERRLN(2)=ERRLN(1)
-                STEPLN(1)=0.0
-                ERRLN(1)=ERRNOW
-              ENDIF
-            ELSE
-              IF (STEPLN(1)/(STEPLN(2)+TINY).GT.0.) THEN
-                STEPLN(2)=STEPLN(1)
-                ERRLN(2)=ERRNOW
-                STEPLN(1)=0.0
-              ELSE
-                STEPLN(3)=STEPLN(1)
-                ERRLN(3)=ERRNOW
-                STEPLN(1)=0.0
-              ENDIF
-            ENDIF
-          ELSE
-            STEPLN(1)=0.0
-            ILINON=-2
-          ENDIF
-C...Quadratic fit
-          IF (((ERRLN(1)-ERRLN(3))*TINY).GT.STEPLN(3)) THEN
-            FACTOR=-1.0
-          ELSE
-            BC=((ERRLN(1)-ERRLN(3))/(STEPLN(3)+TINY) -
-     &         (ERRLN(1)-ERRLN(2))/(STEPLN(2)+TINY))/
-     &         (STEPLN(2)-STEPLN(3)+TINY)
-            AC=-BC*STEPLN(2)-(ERRLN(1)-ERRLN(2))/(STEPLN(2)+TINY)
-            ETA=-AC/(2.*BC+TINY)
-            IF (ABS(ETA).GT.TINY) THEN
-              FACTOR=(ERRLN(1)-ERRLN(2))/
-     &               (STEPLN(2)*(2.*ETA-STEPLN(2))+TINY)
-            ELSE
-              FACTOR=-1.0
-            ENDIF
-          ENDIF
-C..Tolerance:
-          TOL=MAX(PARJN(25),ZEPS)
-          IF (FACTOR.GT.0.) THEN
-C...Quadratic fit OK
-            IF (ETA/(STEPLN(2)+TINY).GT.0.) THEN
-              IF ((ETA/(STEPLN(2)+TINY).LT.1.).AND.
-     &            (ABS(ETA-STEPLN(2)).GT.TOL)) THEN
-                STEPLN(1)=ETA
-              ELSE
-                STEPLN(1)=CGOLD*STEPLN(2)
-              ENDIF
-            ELSEIF (ETA/(STEPLN(3)+TINY).GT.0.) THEN
-              IF ((ETA/(STEPLN(3)+TINY).LT.1.).AND.
-     &            (ABS(ETA-STEPLN(3)).GT.TOL)) THEN
-                STEPLN(1)=ETA
-              ELSE
-                STEPLN(1)=CGOLD*STEPLN(3)
-              ENDIF
-            ELSE
-C...Step too large -> decrease
-              STEPLN(1)=CGOLD*SIGN(MIN(STEPLN(2),STEPLN(3)),ETA)
-            ENDIF
-          ELSE
-C...Take step towards the most distant of points (2) and (3)
-            IF (STEPLN(2)/(STEPLN(3)+TINY).LT.-1.) THEN
-              STEPLN(1)=CGOLD*STEPLN(2)
-            ELSE
-              STEPLN(1)=CGOLD*STEPLN(3)
-            ENDIF
-          ENDIF
-        ENDIF
-        IF (ABS(STEPLN(1)).LE.TOL) THEN
-C...Predicted step less than tolerance from current point
-C...                                  -> terminate search
-          NIT=0
-          ILINON=0
-          IF (ABS(STEPLN(0)).GT.ZEPS) THEN
-            PARJN(1)=MAX(MIN(ABS(STEPLN(0))*CGOLD,PARJN(27)),ZEPS)
-          ENDIF
-          IF (ERRNOW.GT.ERRMN) THEN
-C...Back up to best minimum so far
-            STEPLN(1)=-STEPMN
-          ELSE
-            MSTJN(37)=ABS(ILINON)
-            RETURN
-          ENDIF
-        ENDIF
-      ENDIF
-
-20    CONTINUE
-C...Update weight vector:
-      DO 110 I=1,MM0(NL+1)
-        W(I)=W(I)+STEPLN(1)*G(I)*FLOAT(NSELF(I))
-110   CONTINUE
-      DO 120 I=1,MV0(NL+1)
-        T(I)=T(I)+STEPLN(1)*G(I+MM0(NL+1))*FLOAT(NTSELF(I))
-120   CONTINUE
-C...Keep track of starting point and best point up to now:
-      STEPLN(0)=STEPLN(0)+STEPLN(1)
-      STEPMN=STEPMN+STEPLN(1)
-
-      MSTJN(37)=ABS(ILINON)
-      RETURN
-
-C**** END OF JNLINS ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNREAD(NF)
-
-C...JetNet subroutine READ weights and parameters.
-
-C...Reads weights, thresholds and other statistics from a file NF and
-C...initializes the net
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/
-
-      CHARACTER LINE*100
-      DIMENSION MST(6),PAR(21)
-
-
-      IF(NF.LT.0) THEN
-
-C...unformatted read
-
-        NFSAVE=MSTJN(6)
-
-        JF=-NF
-        READ(JF) IVERS
-        IF(IVERS.LT.0) CALL JNERR(17)
-        IF(IVERS.LT.20) CALL JNERR(13)
-        IF(IVERS/10.EQ.2) THEN
-C...New meanings for MSTJN(35-) and PARJN(20-)
-          DO 400 I=1,6
-            MST(I)=MSTJN(34+I)
-400       CONTINUE
-          DO 410 I=1,21
-            PAR(I)=PARJN(19+I)
-410       CONTINUE
-        ENDIF
-        READ(JF) MSTJN,PARJN,TINV,IGFN,ETAL,WIDL,SATM
-
-        IF(IVERS/10.EQ.2) THEN
-          DO 420 I=1,6
-            MSTJN(34+I)=MST(I)
-420       CONTINUE
-          DO 430 I=1,21
-            PARJN(19+I)=PAR(I)
-430       CONTINUE
-        ENDIF
-
-        CALL JNSEPA
-
-        DO 100 I=1,MM0(NL+1)
-          READ(JF) W(I)
-100     CONTINUE
-
-        DO 110 I=1,MV0(NL+1)
-          READ(JF) T(I)
-110     CONTINUE
-
-        DO 120 I=1,MM0(NL+1)
-          READ(JF) NSELF(I)
-120     CONTINUE
-
-        DO 130 I=1,MV0(NL+1)
-          READ(JF) NTSELF(I)
-130     CONTINUE
-
-        MSTJN(6)=NFSAVE
-
-      ELSE
-
-C...Formatted dump
-
-        READ(NF,690)LINE
-        IF (LINE(27:28).EQ.' D') CALL JNERR(17)
-        READ(NF,*)
-        READ(NF,*)
-        READ(NF,650)FVERS
-        IVERS=INT(FVERS*10.0+0.001)
-        IF(IVERS.LT.20) CALL JNERR(13)
-        IF(IVERS/10.EQ.2) THEN
-C...New meanings for MSTJN(35-) and PARJN(20-)
-          DO 440 I=1,6
-            MST(I)=MSTJN(34+I)
-440       CONTINUE
-          DO 450 I=1,21
-            PAR(I)=PARJN(19+I)
-450       CONTINUE
-        ENDIF
-
-900     READ(NF,690) LINE
-        IF(LINE(1:24).NE.'        I       1      2') GOTO 900
-
-        NFSAVE=MSTJN(6)
-
-        READ(NF,601)(MSTJN(I),I=1,6),TRN,(MSTJN(I),I=8,10)
-        MSTJN(7)=INT(10**TRN+0.5)
-        READ(NF,600)(MSTJN(10+I),I=1,10)
-        READ(NF,600)(MSTJN(20+I),I=1,10)
-        READ(NF,600)(MSTJN(30+I),I=1,10)
-        READ(NF,610)(PARJN(I),I=1,10)
-        READ(NF,610)(PARJN(10+I),I=1,10)
-        READ(NF,610)(PARJN(20+I),I=1,10)
-        READ(NF,610)(PARJN(30+I),I=1,10)
-        PARJN(22)=10.**PARJN(22)
-        READ(NF,600)(IGFN(I),I=1,10)
-        READ(NF,610)(TINV(I),I=1,10)
-        READ(NF,610)(ETAL(I),I=1,10)
-        READ(NF,610)(WIDL(I),I=1,10)
-        READ(NF,610)(SATM(I),I=1,10)
-        READ(NF,*)
-
-        MSTJN(6)=NFSAVE
-
-        IF(IVERS/10.EQ.2) THEN
-          DO 460 I=1,6
-            MSTJN(34+I)=MST(I)
-460       CONTINUE
-          DO 470 I=1,21
-            PARJN(19+I)=PAR(I)
-470       CONTINUE
-        ENDIF
-
-        CALL JNSEPA
-     
-        READ(NF,*)
-        READ(NF,*)
-        READ(NF,*)
-
-        IF(NXIN.EQ.0) THEN
-
-          READ(NF,*)
-          DO 200 J=1,M(0)
-            READ(NF,*)
-            READ(NF,620)(W(JNINDX(1,I,J)),
-     &                    LINE(I:I),I=1,M(1))
-            DO 210 I=1,M(1)
-              IF(LINE(I:I).EQ.'*') THEN
-                NSELF(JNINDX(1,I,J))=0
-              ELSE
-                NSELF(JNINDX(1,I,J))=1
-              ENDIF
-210         CONTINUE
-
-200       CONTINUE
-
-        ELSE
-
-
-          READ(NF,*)
-          DO 220 IHPRF=1,NHPRF
-            READ(NF,*)
-            READ(NF,620)(W(IW),LINE(IW:IW),
-     &                     IW=NRFW*(IHPRF-1)+1,NRFW*IHPRF)
-            DO 230 IW=NRFW*(IHPRF-1)+1,NRFW*IHPRF
-              IF(LINE(IW:IW).EQ.'*') THEN
-                NSELF(IW)=0
-              ELSE
-                NSELF(IW)=1
-              ENDIF
-230         CONTINUE
-220       CONTINUE
-
-          IF(NHRF*NHPRF.LT.M(1)) THEN
-            READ(NF,*)
-            READ(NF,*)
-            DO 240 J=1,M(0)
-              READ(NF,*)
-              READ(NF,620)(W(JNINDX(1,I,J)),LINE(I:I),
-     &                                I=NHRF*NHPRF+1,M(1))
-              DO 250 I=NHRF*NHPRF+1,M(1)
-                IF(LINE(I:I).EQ.'*') THEN
-                  NSELF(JNINDX(1,I,J))=0
-                ELSE
-                  NSELF(JNINDX(1,I,J))=1
-                ENDIF
-250           CONTINUE
-240         CONTINUE
-          ENDIF
-
-        ENDIF
-
-        READ(NF,*)
-        READ(NF,*)
-        READ(NF,*)
-        READ(NF,620)(T(JNINDX(1,I,0)),LINE(I:I),I=1,M(1))
-        DO 260 I=1,M(1)
-          IF(LINE(I:I).EQ.'*') THEN
-            NTSELF(JNINDX(1,I,0))=0
-          ELSE
-            NTSELF(JNINDX(1,I,0))=1
-          ENDIF
-260     CONTINUE
-
-        DO 300 IL=2,NL
-
-          READ(NF,*)
-          READ(NF,*)
-          DO 310 J=1,M(IL-1)
-            READ(NF,*)
-            READ(NF,620)(W(JNINDX(IL,I,J)),LINE(I:I),I=1,M(IL))
-            DO 320 I=1,M(IL)
-              IF(LINE(I:I).EQ.'*') THEN
-                NSELF(JNINDX(IL,I,J))=0
-              ELSE
-                NSELF(JNINDX(IL,I,J))=1
-              ENDIF
-320         CONTINUE
-310       CONTINUE
-
-          READ(NF,*)
-          READ(NF,*)
-          READ(NF,*)
-          READ(NF,620)(T(JNINDX(IL,I,0)),LINE(I:I),I=1,M(IL))
-          DO 330 I=1,M(IL)
-            IF(LINE(I:I).EQ.'*') THEN
-              NTSELF(JNINDX(IL,I,0))=0
-            ELSE
-              NTSELF(JNINDX(IL,I,0))=1
-            ENDIF
-330       CONTINUE
-
-300    CONTINUE
-
-      ENDIF
-
-C...Write statistics on output file
-
-      IF(MSTJN(6).LT.0) RETURN
-
-      CALL JNHEAD
-
-      CALL JNSTAT(1)
-
-      WRITE(MSTJN(6),640)
-
-600   FORMAT(TR11,10I7)
-601   FORMAT(TR11,6I7,F7.3,3I7)
-610   FORMAT(TR11,10F7.4)
-620   FORMAT(6(F12.4,A1))
-640   FORMAT(29X,'Weights read from file')
-650   FORMAT(TR63,F3.1)
-690   FORMAT(A)
-
-      RETURN
-
-C**** END OF JNREAD ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNROLD(NF)
-
-C...JetNet subroutine Read weights from OLD versions
-C...(JETNET 1.0 and 1.1)
-
-C...Reads weights, thresholds and other statistics from a file NF and
-C...initializes the net
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/
-
-      CHARACTER*80 LINE
-      DIMENSION MSTJNO(20),PARJNO(20)
-
-
-C...MSTJN(9) has a new meaning:
-      MSTJ9=MSTJN(9)
-
-C...PARJN(5) has new meaning:
-      PARJ5=PARJN(5)
-
-C...PARJN(11-20) have new meanings:
-      PARJ11=PARJN(11)
-      PARJ12=PARJN(12)
-      PARJ13=PARJN(13)
-      PARJ14=PARJN(14)
-      PARJ15=PARJN(15)
-      PARJ16=PARJN(16)
-      PARJ17=PARJN(17)
-      PARJ18=PARJN(18)
-      PARJ19=PARJN(19)
-      PARJ20=PARJN(20)
-
-      IF(NF.LT.0) THEN
-
-C...unformatted read
-
-        JF=-NF
-        READ(JF) MSTJNO,PARJNO,TINV,IGFN
-
-        DO 100 I=1,20
-          MSTJN(I)=MSTJNO(I)
-          PARJN(I)=PARJNO(I)
-100     CONTINUE
-
-        MSTJN(9)=MSTJ9
-        PARJN(5)=PARJ5
-        PARJN(11)=PARJ11
-        PARJN(12)=PARJ12
-        PARJN(13)=PARJ13
-        PARJN(14)=PARJ14
-        PARJN(15)=PARJ15
-        PARJN(16)=PARJ16
-        PARJN(17)=PARJ17
-        PARJN(18)=PARJ18
-        PARJN(19)=PARJ19
-        PARJN(20)=PARJ20
-
-        CALL JNSEPA
-
-        DO 110 I=1,MM0(NL+1)
-          READ(JF) W(I)
-110     CONTINUE
-
-        DO 120 I=1,MV0(NL+1)
-          READ(JF) T(I)
-120     CONTINUE
-
-        DO 130 I=1,MM0(NL+1)
-          READ(JF) NSELF(I)
-130     CONTINUE
-
-      ELSE
-
-C...Formatted dump
-
-        READ(NF,690)LINE
-        IF (LINE(27:28).EQ.' D') CALL JNERR(18)
-900     READ(NF,690) LINE
-        IF(LINE(1:24).NE.'         I      1      2'.AND.
-     &     LINE(1:25).NE.'          I      1      2') GOTO 900
-
-        NFSAVE=MSTJN(6)
-
-        READ(NF,600)(MSTJNO(I),I=1,10)
-        READ(NF,600)(MSTJNO(10+I),I=1,10)
-        READ(NF,610)(PARJNO(I),I=1,10)
-        READ(NF,600)(IGFN(I),I=1,10)
-        READ(NF,610)(TINV(I),I=1,10)
-        READ(NF,*)
-
-        DO 200 I=1,20
-          MSTJN(I)=MSTJNO(I)
-          PARJN(I)=PARJNO(I)
-200     CONTINUE
-
-        MSTJN(6)=NFSAVE
-        MSTJN(9)=MSTJ9
-        PARJN(5)=PARJ5
-        PARJN(11)=PARJ11
-        PARJN(12)=PARJ12
-        PARJN(13)=PARJ13
-        PARJN(14)=PARJ14
-        PARJN(15)=PARJ15
-        PARJN(16)=PARJ16
-        PARJN(17)=PARJ17
-        PARJN(18)=PARJ18
-        PARJN(19)=PARJ19
-        PARJN(20)=PARJ20
-
-        CALL JNSEPA
-     
-        READ(NF,*)
-        READ(NF,*)
-        DO 210 IL=1,NL
-
-          READ(NF,*)
-          READ(NF,*)
-          DO 220 J=1,M(IL-1)
-            READ(NF,*)
-            READ(NF,620)(W(JNINDX(IL,I,J)),LINE(I:I),I=1,M(IL))
-            DO 230 I=1,M(IL)
-              IF(LINE(I:I).EQ.'*') THEN
-                NSELF(JNINDX(IL,I,J))=0
-              ELSE
-                NSELF(JNINDX(IL,I,J))=1
-              ENDIF
-230         CONTINUE
-220       CONTINUE
-
-         READ(NF,*)
-         READ(NF,*)
-         READ(NF,*)
-         READ(NF,630)(T(JNINDX(IL,I,0)),I=1,M(IL))
-210    CONTINUE
-
-      ENDIF
-
-C...Write statistics on output file
-
-      IF(MSTJN(6).LT.0) RETURN
-
-      CALL JNHEAD
-
-      CALL JNSTAT(1)
-
-      WRITE(MSTJN(6),640)
-
-600   FORMAT(TR11,10I7)
-610   FORMAT(TR11,10F7.4)
-620   FORMAT(10(F7.4,A1))
-630   FORMAT(10F8.4)
-640   FORMAT(17X,'Weights read from file produced with version 1')
-690   FORMAT(A)
-
-      RETURN
-
-C**** END OF JNROLD ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNSATM
-C...JetNet subroutine SATuration Measure
-
-C...Calculates the saturation measure "S" for each layer.
-C...Note: The response function for the layer must be a sigmoid.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/
-
-
-      DO 100 IL=1,NL
-
-        IF (ABS(NG(IL)).EQ.1.OR.ABS(NG(IL)).EQ.5) THEN
-
-          SUM=0.0
-          DO 110 I=1,M(IL)
-            MI=MV0(IL)+I
-            SUM=SUM+(1.-2.*O(MI))**2
-110       CONTINUE
-          SM(IL)=SM(IL)+SUM/FLOAT(M(IL))
-
-        ELSEIF (ABS(NG(IL)).EQ.2) THEN
-
-          SUM=0.0
-          DO 120 I=1,M(IL)
-            MI=MV0(IL)+I
-            SUM=SUM+O(MI)**2
-120       CONTINUE
-          SM(IL)=SM(IL)+SUM/FLOAT(M(IL))
-
-        ELSE
-          SM(IL)=0.0
-        ENDIF
-
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JNSATM ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNSCGR
-
-C...JetNet subroutine Scaled Conjugate GRadient
-
-C...Performs the Scaled Conjugate Gradient updating.
-
-C...The algorithm is described in:
-C...M. F. Moller, "A Scaled Conjugate Gradient Algorithm for Fast
-C...Supervised Learning", Neural Networks, Vol. 6, pp 525-533 (1993)
-
-C...The following notation is used (cf. Moller's article):
-C...S-vector = -(DW,DT)
-C...R-vector = (ODW,ODT)
-C...P-vector = G
-C...K = NSC
-C...MU=-DERRLN
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-      PARAMETER(ZEPS=1.E-8,TINY=1.E-20,XLAMX=1.0)
-
-C...ZEPS=Machine precision
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT4/
-
-      REAL LAMBDA
-
-      EQUIVALENCE (ALPHA,STEPLN(1)),(LAMBDA,STEPLN(2)),
-     &            (SIGMA,ERRLN(1)),(DELTA,ERRLN(2)),(CDELTA,ERRLN(3))
-
-
-      IF (MSTJN(5).EQ.14) THEN
-C...Move to last minimum and terminate the search.
-        IF (PARJN(8).LE.ERRLN(0)) STEPLN(0)=0.0
-        DO 400 I=1,MM0(NL+1)
-          W(I)=W(I)-STEPLN(0)*G(I)
-400     CONTINUE
-        DO 410 I=1,MV0(NL+1)
-          T(I)=T(I)-STEPLN(0)*G(I+MM0(NL+1))
-410     CONTINUE
-        NSC=0
-        NIT=0
-        NC=0
-        ILINON=0
-        MSTJN(5)=9
-        MSTJN(37)=ABS(ILINON)
-        RETURN
-      ENDIF
-
-      IF (IEVAL.EQ.1) GOTO 10
-
-      IF (ISUCC.GT.0) THEN
-C...Calculate 2nd order information:
-        NSC=NSC+1
-        NC=0
-
-        IF (ICURVE.EQ.0) THEN
-C...1st sweep -> Create new search direction and 
-C...             Get curvature information
-
-          ERRLN(0)=PARJN(8)
-
-          CALL JNCGBE(BETAK,MOD((NSC-1),(MM0(NL+1)+MV0(NL+1))))
-          DERRLN=0.0
-          BETA=1.0
-          GVEC2=0.0
-          DO 100 IL=NL,1,-1
-
-C...set effective beta in layer IL:
-            IF(TINV(IL).EQ.0.0) THEN
-              BETA=BETA*PARJN(3)
-            ELSE
-              BETA=BETA*ABS(TINV(IL))
-            ENDIF
-
-            DO 110 I=MM0(IL)+1,MM0(IL+1)
-              G(I)=BETAK*G(I)+ODW(I)*FLOAT(NSELF(I))*BETA
-              DERRLN=DERRLN-ODW(I)*FLOAT(NSELF(I))*BETA*G(I)
-              GVEC2=GVEC2+G(I)**2
-110         CONTINUE
-
-            DO 120 I=MV0(IL)+1,MV0(IL+1)
-              G(I+MM0(NL+1))=BETAK*G(I+MM0(NL+1))
-     &                       +ODT(I)*FLOAT(NTSELF(I))*BETA
-              DERRLN=DERRLN-ODT(I)*FLOAT(NTSELF(I))*BETA*G(I+MM0(NL+1))
-              GVEC2=GVEC2+G(I+MM0(NL+1))**2
-120         CONTINUE
-
-100       CONTINUE
-
-C...Initial value for lambda
-          IF (NSC.EQ.1) LAMBDA=PARJN(29)
-
-          NIT=1
-          SIGMA=PARJN(28)/(SQRT(GVEC2)+TINY)
-          FACTOR=FLOAT(MSTJN(2))
-          DO 200 I=1,MM0(NL+1)
-            DW(I)=-DW(I)*FACTOR
-            W(I)=W(I)+SIGMA*G(I)
-200       CONTINUE
-          DO 210 I=1,MV0(NL+1)
-            DT(I)=-DT(I)*FACTOR
-            T(I)=T(I)+SIGMA*G(I+MM0(NL+1))
-210       CONTINUE
-          ICURVE=1
-          MSTJN(37)=ABS(ILINON)
-          STEPLN(0)=SIGMA
-          RETURN
-        ELSE
-C...2nd sweep -> Curvature information exists
-          DELTA=0.0
-          FACTOR=SIGMA*FLOAT(MSTJN(2))+TINY
-          DO 220 I=1,MM0(NL+1)
-            DW(I)=-DW(I)/FACTOR
-            DELTA=DELTA+G(I)*DW(I)
-            W(I)=W(I)-SIGMA*G(I)
-220       CONTINUE
-          DO 230 I=1,MV0(NL+1)
-            DT(I)=-DT(I)/FACTOR
-            DELTA=DELTA+G(I+MM0(NL+1))*DT(I)
-            T(I)=T(I)-SIGMA*G(I+MM0(NL+1))
-230       CONTINUE
-          ILINON=1
-          ICURVE=0
-          STEPLN(0)=0.0
-        ENDIF
-      ENDIF
-
-      IF ((DELTA+LAMBDA*GVEC2).LE.0.0) THEN
-C...Make Hessian positive definite:
-        LAMBDA=2.*(LAMBDA-DELTA/(GVEC2+TINY))
-      ENDIF
-      DELTA=DELTA+LAMBDA*GVEC2
-
-C...Update weights to calculate comparison parameter:
-      ALPHA=-DERRLN/(DELTA+TINY)
-      IF ((ABS(ALPHA).LE.ZEPS).OR.(NIT.GE.MSTJN(35)).OR.
-     &(LAMBDA.GT.XLAMX)) THEN
-C...Search is stuck! -> Restart.
-        DO 280 I=1,MM0(NL+1)
-          DW(I)=0.0
-280     CONTINUE
-        DO 290 I=1,MV0(NL+1)
-          DT(I)=0.0
-290     CONTINUE
-        STEPLN(0)=0.0
-        ISUCC=1
-        IEVAL=0
-        ILINON=0
-        NSC=0
-        MSTJN(38)=MSTJN(38)+1
-        IF (MSTJN(38).GT.MSTJN(36)) CALL JNERR(21)
-        MSTJN(37)=0
-        RETURN
-      ENDIF
-      DO 300 I=1,MM0(NL+1)
-        W(I)=W(I)+ALPHA*G(I)
-300   CONTINUE
-      DO 310 I=1,MV0(NL+1)
-        T(I)=T(I)+ALPHA*G(I+MM0(NL+1))
-310   CONTINUE
-      STEPLN(0)=ALPHA
-      IEVAL=1
-      NIT=NIT+1
-      MSTJN(37)=ABS(ILINON)
-      RETURN
-
-C...Come here if the comparison parameter is to be calculated:
-10    CDELTA=2.*DELTA*(ERRLN(0)-PARJN(8))/(DERRLN**2+TINY)
-      IEVAL=0
-
-      IF (CDELTA.GE.0.0) THEN
-C...Successful reduction in error.
-        ISUCC=1
-        DO 320 I=1,MM0(NL+1)
-          DW(I)=0.0
-320     CONTINUE
-        DO 330 I=1,MV0(NL+1)
-          DT(I)=0.0
-330     CONTINUE
-        STEPLN(0)=0.0
-        ILINON=0
-        IF (CDELTA.GE.0.75) LAMBDA=LAMBDA/4.0
-      ELSE
-C...Not a successful error reduction -> move back and make new attempt
-        ISUCC=0
-        DO 340 I=1,MM0(NL+1)
-          W(I)=W(I)-ALPHA*G(I)
-340     CONTINUE
-        DO 350 I=1,MV0(NL+1)
-          T(I)=T(I)-ALPHA*G(I+MM0(NL+1))
-350     CONTINUE
-        STEPLN(0)=0.0
-      ENDIF
-      IF (CDELTA.LT.0.25) LAMBDA=LAMBDA+DELTA*(1.-CDELTA)/GVEC2
-
-      MSTJN(37)=ABS(ILINON)
-      RETURN
-
-C**** END OF JNSCGR ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNSEFI(ILA,I1,I2,J1,J2,NO)
-
-C...JetNet subroutine SElect FIelds
-
-C...Switches the updating of the weights between nodes I1 to I2 in layer 
-C...ILA and nodes J1 to J2 in layer ILA-1 on or off according to NO. If 
-C...NO<=0 updating is turned off else it is turned on. In addition if
-C...NO=0 the weight is set to zero and if NO=1 the weight is 
-C...reinitialized.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/
-
-
-      IF(MSTJN(8).EQ.0) CALL JNERR(6)
-
-      IF=MAX(I1,1)
-      IL=MIN(I2,M(ILA))
-
-      IF(WIDL(ILA).LE.0.0) THEN
-        WIDTH=PARJN(4)
-      ELSE
-        WIDTH=WIDL(ILA)
-      ENDIF
-
-      IF(J1.NE.0.OR.J2.NE.0) THEN
-
-        JF=MAX(J1,1)
-        JL=MIN(J2,M(ILA-1))
-
-        DO 100 II=IF,IL
-          DO 110 JJ=JF,JL
-            IF(NO.GT.0) THEN
-              NSELF(JNINDX(ILA,II,JJ))=1
-            ELSE
-              NSELF(JNINDX(ILA,II,JJ))=0
-            ENDIF
-            IF(NO.EQ.1) THEN
-              IDUM=JJ
-              W(JNINDX(ILA,II,JJ))=(2.0*RJN(IDUM)-1.0)*WIDTH
-            ELSEIF(NO.EQ.0) THEN
-              W(JNINDX(ILA,II,JJ))=0.0
-            ENDIF
-110       CONTINUE
-100     CONTINUE
-
-      ELSE
-
-        DO 200 II=IF,IL
-          IF(NO.GT.0) THEN
-            NTSELF(JNINDX(ILA,II,0))=1
-          ELSE
-            NTSELF(JNINDX(ILA,II,0))=0
-          ENDIF
-          IF(NO.EQ.1) THEN
-            IDUM=II
-            T(JNINDX(ILA,II,0))=(2.0*RJN(IDUM)-1.0)*WIDTH
-          ELSEIF(NO.EQ.0) THEN
-            T(JNINDX(ILA,II,0))=0.0
-          ENDIF
-200     CONTINUE
-
-      ENDIF
-
-      RETURN
-
-C**** END OF JNSEFI ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNSEPA
-
-C...JetNet subroutine SEt PArameters
-
-C...Sets parameters in /JNINT2/
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(MAXD2E=300)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/,/JNINT4/
-
-
-C...last layer:
-
-      NL=MSTJN(1)-1
-      IF(NL.GT.10.OR.NL.LT.1) CALL JNERR(1)
-
-C...number of nodes in each layer
-
-      IF(MSTJN(10).GT.MAXI) CALL JNERR(7)
-      IF(MSTJN(10+NL).GT.MAXO) CALL JNERR(8)
-
-      DO 400 IL=1,MSTJN(1)
-        IF(MSTJN(9+IL).EQ.0) THEN
-          MSTJN(7)=IL
-          CALL JNERR(25)
-        ENDIF
-400   CONTINUE
-
-      IF(MSTJN(23).NE.0) THEN
-
-C...receptive fields will be used, check consistency and set indexes
-
-        IF(MSTJN(24).EQ.0.OR.MSTJN(25).LE.0.OR.MSTJN(26).LE.0)
-     &      CALL JNERR(10)
-
-        NXIN=MSTJN(23)
-        NYIN=MSTJN(24)
-        NXRF=MSTJN(25)
-        NYRF=MSTJN(26)
-        NHPRF=ABS(MSTJN(27))
-        IF(MSTJN(10).LT.ABS(NXIN*NYIN)) CALL JNERR(11)
-        if(NXRF.GT.ABS(NXIN).OR.NYRF.GT.ABS(NYIN)) CALL JNERR(11)
-
-        IF(NXIN.GT.0) THEN
-          NXHRF=NXIN-NXRF+1
-        ELSE
-          NXHRF=-NXIN
-        ENDIF
-
-        IF(NYIN.GT.0) THEN
-          NYHRF=NYIN-NYRF+1
-        ELSE
-          NYHRF=-NYIN
-        ENDIF
-
-        NHRF=NXHRF*NYHRF
-        MSTJN(11)=MAX(MSTJN(11),NHRF*NHPRF)
-
-        NRFW=NXRF*NYRF+MSTJN(10)-ABS(NXIN*NYIN)
-        NRFLW=NRFW*NHPRF+(MSTJN(11)-NHRF*NHPRF)*MSTJN(10)
-
-      ELSE
-
-        NXIN=0
-        NYIN=0
-        NXRF=0
-        NYRF=0
-        NXHRF=0
-        NYHRF=0
-        NHRF=0
-        NRFW=0
-        NRFLW=0
-
-      ENDIF
-
-      DO 100 IL=0,NL
-        M(IL)=MSTJN(10+IL)
-100   CONTINUE
-
-C...offset index in node vectors and weight vectors
-
-      MV0(1)=0
-      MM0(1)=0
-      MV0(2)=M(1)
-      MM0(2)=M(0)*M(1)
-      IF(NXIN.NE.0) MM0(2)=NRFLW
-
-      DO 110 IL=3,NL+1
-        MV0(IL)=MV0(IL-1)+M(IL-1)
-        MM0(IL)=MM0(IL-1)+M(IL-1)*M(IL-2)
-110   CONTINUE
-
-      IF(MV0(NL+1).GT.MAXV) CALL JNERR(2)
-      IF(MM0(NL+1).GT.MAXM) CALL JNERR(3)
-
-C...check Potts-nodes
-
-      IPOTT=MSTJN(4)
-      IF(IPOTT.GE.2) THEN
-        IF(MOD(M(NL),IPOTT).NE.0) CALL JNERR(4)
-        IGFN(NL)=3
-      ENDIF
-      IF(IPOTT.EQ.1) IGFN(NL)=5
-
-C...set transfer functions to use
-
-      DO 120 IL=1,NL
-        IF(IGFN(IL).EQ.0) THEN
-          NG(IL)=MSTJN(3)
-        ELSE
-          NG(IL)=IGFN(IL)
-        ENDIF
-120   CONTINUE
-
-C...Check consistency between error measure and transfer function.
-      IF(MSTJN(4).EQ.1) THEN
-        IF((IGFN(NL).EQ.2).OR.(IGFN(NL).EQ.4)) CALL JNERR(31)
-      ENDIF
-
-C...Zero weight and threshold vectors
-      DO 200 I=1,MV0(NL+1)
-        DT(I)=0.0
-        NTSELF(I)=1
-200   CONTINUE
-
-      DO 210 I=1,MM0(NL+1)
-        DW(I)=0.0
-        NSELF(I)=1
-210   CONTINUE
-
-C...set precision chopping
-
-      IF((MSTJN(28).GT.0).OR.(MSTJN(29).GT.0).OR.
-     &(MSTJN(30).GT.0)) ICPON=1
-
-C...If updating is turned off, stop here.
-      IF(MSTJN(5).EQ.9) CALL JNERR(32)
-
-C...Initialize Quickprop, Rprop and Conjugate Gradient searches
-
-      IF ((MSTJN(5).GE.3).AND.(MSTJN(5).LE.14)) THEN
-        DO 300 I=1,MM0(NL+1)
-          ODW(I)=0.0
-          G(I)=0.0
-300     CONTINUE
-        DO 310 I=1,MV0(NL+1)
-          ODT(I)=0.0
-          G(MM0(NL+1)+I)=0.0
-310     CONTINUE
-      ENDIF
-      IF (MSTJN(5).EQ.8) CALL JNERR(19)
-
-      MSTJN(8)=1
-
-C...Initialize Rprop learning rate:
-      DO 500 IL=NL,1,-1
-        IF (ETAL(IL).EQ.0.0) THEN
-          ETA=PARJN(1)/FLOAT(MSTJN(2))
-        ELSE
-          ETA=ETAL(IL)/FLOAT(MSTJN(2))
-        ENDIF
-        DO 510 I=1,M(IL)
-          IT=JNINDX(IL,I,0)
-          ETAV(MM0(NL+1)+IT)=ETA
-          DO 520 J=1,M(IL-1)
-            IW=JNINDX(IL,I,J)
-            ETAV(IW)=ETA
-520       CONTINUE
-510     CONTINUE
-500   CONTINUE
-
-C...Reset restart counter
-      MSTJN(38)=0
-
-      RETURN
-
-C**** END OF JNSEPA ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNSTAT(IS)
-
-C...JetNet subroutine output STATistics 
-
-C...Statistics chosen by IS is written on the default file
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-      PARAMETER(MAXD2E=300)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT3/ NXIN,NYIN,NXRF,NYRF,NXHRF,NYHRF,NHRF,NRFW,NHPRF
-      COMMON /JNINT5/ D2E(MAXD2E,MAXD2E)
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT3/,/JNINT5/
-
-
-      IF(IS.EQ.1) THEN
-C...Write out number of layers, units and receptive field status
-        WRITE(MSTJN(6),*)
-        WRITE(MSTJN(6),600) NL+1
-        WRITE(MSTJN(6),615) M(NL),NL
-        DO 100 IL=NL-1,1,-1
-          WRITE(MSTJN(6),620) M(IL),IL
-100     CONTINUE
-        WRITE(MSTJN(6),610) M(0)
-        WRITE(MSTJN(6),*)
-        IF(IPOTT.GT.1) WRITE(MSTJN(6),630)IPOTT
-        IF(MSTJN(23).NE.0) THEN
-          WRITE(MSTJN(6),631) ABS(MSTJN(23)*MSTJN(24)),ABS(MSTJN(23)),
-     &    ABS(MSTJN(24)),MSTJN(25),MSTJN(26),ABS(MSTJN(27))
-        ENDIF
-        IF(MSTJN(23).LT.0) WRITE(MSTJN(6),632)
-        IF(MSTJN(24).LT.0) WRITE(MSTJN(6),633)
-        IF(MSTJN(27).LT.0) WRITE(MSTJN(6),634) 
-        IF(IPOTT.EQ.1) WRITE(MSTJN(6),635)
-        IF(MSTJN(5).EQ.0) THEN
-          WRITE(MSTJN(6),639)
-        ELSEIF(MSTJN(5).EQ.1) THEN
-          WRITE(MSTJN(6),640)
-        ELSEIF(MSTJN(5).EQ.2) THEN
-          WRITE(MSTJN(6),645)
-        ELSEIF(MSTJN(5).EQ.3) THEN
-          WRITE(MSTJN(6),646)
-        ELSEIF(MSTJN(5).EQ.4) THEN
-          WRITE(MSTJN(6),647)
-        ELSEIF(MSTJN(5).EQ.5) THEN
-          WRITE(MSTJN(6),648)
-        ELSEIF(MSTJN(5).EQ.6) THEN
-          WRITE(MSTJN(6),649)
-        ELSEIF(MSTJN(5).EQ.7) THEN
-          WRITE(MSTJN(6),651)
-        ELSEIF(MSTJN(5).EQ.10) THEN
-          WRITE(MSTJN(6),652)
-        ELSEIF(MSTJN(5).EQ.11) THEN
-          WRITE(MSTJN(6),653)
-        ELSEIF(MSTJN(5).EQ.12) THEN
-          WRITE(MSTJN(6),654)
-        ELSEIF(MSTJN(5).EQ.13) THEN
-          WRITE(MSTJN(6),655)
-        ELSEIF(MSTJN(5).EQ.15) THEN
-          WRITE(MSTJN(6),656)
-        ENDIF
-        WRITE(MSTJN(6),*)
-
-      ELSEIF(IS.EQ.2) THEN
-C...Write out values of parameters and switches
-        PAR22=PARJN(22)
-        PARJN(22)=LOG10(PAR22)
-        WRITE(MSTJN(6),*)
-        WRITE(MSTJN(6),650)
-        WRITE(MSTJN(6),*)
-        WRITE(MSTJN(6),660)'I ',(I,I=1,10)
-        WRITE(MSTJN(6),661)'MSTJN (I)',(MSTJN(I),I=1,6),
-     &   LOG10(MAX(FLOAT(MSTJN(7)),1.)),(MSTJN(I),I=8,10)
-        WRITE(MSTJN(6),660)'(10+I)',(MSTJN(10+I),I=1,10)
-        WRITE(MSTJN(6),660)'(20+I)',(MSTJN(20+I),I=1,10)
-        WRITE(MSTJN(6),660)'(30+I)',(MSTJN(30+I),I=1,10)
-        WRITE(MSTJN(6),670)'PARJN (I)',(PARJN(I),I=1,10)
-        WRITE(MSTJN(6),670)'(10+I)',(PARJN(10+I),I=1,10)
-        WRITE(MSTJN(6),670)'(20+I)',(PARJN(20+I),I=1,10)
-        WRITE(MSTJN(6),670)'(30+I)',(PARJN(30+I),I=1,10)
-        WRITE(MSTJN(6),660)'IGFN (I)',(IGFN(I),I=1,10)
-        WRITE(MSTJN(6),670)'TINV (I)',(TINV(I),I=1,10)
-        WRITE(MSTJN(6),670)'ETAL (I)',(ETAL(I),I=1,10)
-        WRITE(MSTJN(6),670)'WIDL (I)',(WIDL(I),I=1,10)
-        WRITE(MSTJN(6),670)'SATM (I)',(SATM(I),I=1,10)
-        WRITE(MSTJN(6),*)
-        PARJN(22)=PAR22
-
-      ELSEIF(IS.EQ.3) THEN
-C...Write out time factor for net
-        NWFAC=0
-        IF(NXIN.EQ.0) THEN
-          NWFAC=MM0(NL+1)+MV0(NL+1)
-          NWSUM=NWFAC
-        ELSE
-          NWFAC=MM0(NL+1)+MV0(NL+1)-MM0(2)+NHRF*NRFW*NHPRF
-     &          +(MSTJN(11)-NHRF*NHPRF)*MSTJN(10)
-          NWSUM=MM0(NL+1)+MV0(NL+1)-MM0(2)+NRFW*NHPRF-(NHRF-1)*NHPRF
-     &          +(MSTJN(11)-NHRF*NHPRF)*MSTJN(10)
-          IF(MSTJN(27).LT.0) NWSUM=NWSUM-(NHRF-1)*NHPRF*MSTJN(12)
-        ENDIF
-        WRITE(MSTJN(6),680) NWFAC
-        WRITE(MSTJN(6),690) NWSUM
-
-      ELSEIF(IS.EQ.4) THEN
-C...Write out Hessian Matrix
-        NWGTS=MM0(NL+1)+MV0(NL+1)
-        WRITE(MSTJN(6),700)NWGTS,NWGTS
-        WRITE(MSTJN(6),*)
-        NHOP=NWGTS/7
-        NEXTRA=NWGTS-NHOP*7
-        DO 200 I=1,NWGTS
-          WRITE(MSTJN(6),720)I
-          DO 210 JHOP=1,NHOP
-            WRITE(MSTJN(6),710)(D2E((JHOP-1)*7+J,I),J=1,7)
-210       CONTINUE
-          IF (NEXTRA.GT.0) THEN
-            WRITE(MSTJN(6),710)(D2E(NHOP*7+J,I),J=1,NEXTRA)
-          ENDIF
-          WRITE(MSTJN(6),*)
-200     CONTINUE
-
-      ELSEIF(IS.EQ.5) THEN
-C...Write out the diagonal elements of the Hessian Matrix and its Trace
-        TRACE=0.0
-        NWGTS=MM0(NL+1)+MV0(NL+1)
-        DO 220 IW=1,NWGTS
-          TRACE=TRACE+D2E(IW,IW)
-220     CONTINUE
-        WRITE(MSTJN(6),700)NWGTS,NWGTS
-        WRITE(MSTJN(6),730)
-        WRITE(MSTJN(6),*)
-        NHOP=NWGTS/7
-        NEXTRA=NWGTS-NHOP*7
-        DO 230 JHOP=1,NHOP
-          WRITE(MSTJN(6),710)(D2E((JHOP-1)*7+J,(JHOP-1)*7+J),J=1,7)
-230     CONTINUE
-        IF (NEXTRA.GT.0) THEN
-          WRITE(MSTJN(6),710)(D2E(NHOP*7+J,NHOP*7+J),J=1,NEXTRA)
-        ENDIF
-        WRITE(MSTJN(6),*)
-        WRITE(MSTJN(6),740)TRACE
-        WRITE(MSTJN(6),*)
-
-      ENDIF
-
-600   FORMAT(22X,'Initialized for a',I2,' layered net with')
-610   FORMAT(22X,I3,' nodes in layer number 0 (input layer)')
-615   FORMAT(22X,I3,' nodes in layer number',I2,' (output layer)')
-620   FORMAT(22X,I3,' nodes in layer number',I2)
-630   FORMAT(5X,'with',I3,'-dimensional Potts nodes in output layer.')
-631   FORMAT(5X,'receptive fields in first layer assuming the ',I4,
-     &   ' first nodes in the',/,
-     &   5X,'input layer are organised in a plane of ',
-     &   I3,'*',I3,' nodes, where the',/,
-     &   5X,'receptive field nodes scan ',
-     &   I3,'*',I3,' input nodes each with ',I3,' hidden'/,
-     &   5X,'nodes per field.')
-632   FORMAT(5X,'The input layer is assumed to be cyclic ',
-     &       'in the x-direction.')
-633   FORMAT(5X,'The input layer is assumed to be cyclic ',
-     &       'in the y-direction.')
-634   FORMAT(5X,'The weights from equivalent nodes with receptive ',
-     &           'fields are clamped.')
-635   FORMAT(22X,'Using Cross-Entropy error.')
-639   FORMAT(22X,'Standard Back-Propagation updating.')
-640   FORMAT(22X,'Manhattan updating.')
-645   FORMAT(22X,'Langevin updating.')
-646   FORMAT(22X,'Quickprop updating.')
-647   FORMAT(22X,'Conjugate Gradient updating (Polak-Ribiere).')
-648   FORMAT(22X,'Conjugate Gradient updating (Hestenes-Stiefel).')
-649   FORMAT(22X,'Conjugate Gradient updating (Fletcher-Reeves).')
-650   FORMAT(18X,'Values of parameters and switches in JETNET')
-651   FORMAT(22X,'Conjugate Gradient updating (Shanno).')
-652   FORMAT(22X,'Scaled Conj. Grad. updating (Polak-Ribiere).')
-653   FORMAT(22X,'Scaled Conj. Grad. updating (Hestenes-Stiefel).')
-654   FORMAT(22X,'Scaled Conj. Grad. updating (Fletcher-Reeves).')
-655   FORMAT(22X,'Scaled Conj. Grad. updating (Shanno).')
-656   FORMAT(22X,'Rprop updating.')
-660   FORMAT(A10,10I7)
-661   FORMAT(A10,6I7,F7.3,3I7)
-670   FORMAT(A10,10F7.4)
-680   FORMAT(5X,'Time factor for this net:',I10)
-690   FORMAT(5X,'Effective number of weights:',I7)
-700   FORMAT(5X,'The Hessian Matrix: (',I3,' x ',I3,')')
-710   FORMAT(5X,7(E9.2,1X))
-720   FORMAT(5X,'Column: ',I3)
-730   FORMAT(5X,'Diagonal elements only')
-740   FORMAT(5X,'Trace(H) = ',F10.5)
-      RETURN
-
-C**** END OF JNSTAT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNTEST
-
-C...JetNet subroutine TEST 
-
-C...Sets the values of OUT according to given pattern in OIN and
-C...current weights
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/
-
-
-      IF (MSTJN(8).EQ.0) CALL JNERR(23)
-
-      CALL JNFEED
-
-      DO 100 I=1,M(NL)
-        OUT(I)=O(JNINDX(NL,I,0))
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JNTEST ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNTRAL
-
-C...JetNet subroutine TRaining ALgorithm
-
-C...Trains the net.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,TINY=1.E-20)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      SAVE /JNDAT1/,/JNDAT2/,/JNINT1/,/JNINT2/,/JNINT4/
-
-
-      IF (MSTJN(8).EQ.0) CALL JNERR(22)
-      IF (MSTJN(9).LE.0) CALL JNERR(24)
-
-      MSTJN(7)=MSTJN(7)+1
-
-      CALL JNFEED
-      IF (ILINON.EQ.0) CALL JNDELT
-
-      ERR=ERRJN(0)
-
-      ERR=ERR/FLOAT(M(NL))
-      PARJN(7)=ERR
-      ER1=ER1+ERR
-      ER2=ER2+ERR
-
-      IF (MSTJN(22).NE.0) CALL JNSATM
-
-      IF(MOD(MSTJN(7),MSTJN(2)).NE.0) RETURN
-
-C...update only every MSTJN(2) calls
-
-      PARJN(8)=ER1/FLOAT(MSTJN(2))
-      ER1=0.0
-
-
-      IF(MSTJN(21).GT.0) THEN
-
-C...Include pruning factors
-
-        BETA=1.0
-        DO 110 IL=NL,1,-1
-
-C...set beta in layer IL:
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-
-          FACTOR=2.0*FLOAT(MSTJN(2))*PARJN(14)*PARJN(18)**2/BETA
-
-          DO 120 I=MM0(IL)+1,MM0(IL+1)
-            DW(I)=DW(I)-FACTOR*W(I)/
-     &            (PARJN(18)**2+W(I)**2)**2
-120       CONTINUE
-
-          DO 130 I=MV0(IL)+1,MV0(IL+1)
-            DT(I)=DT(I)-FACTOR*T(I)/
-     &            (PARJN(18)**2+T(I)**2)**2
-130       CONTINUE
-
-110     CONTINUE
-
-      ENDIF
-
-      IF(MSTJN(5).EQ.0) THEN
-
-C...Normal updating:
-
-        BETA=1.0
-        DO 200 IL=NL,1,-1
-
-C...set beta in layer IL:
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-
-C...set eta in layer IL:
-
-          IF(ETAL(IL).EQ.0.0) THEN
-            ETA=PARJN(1)/FLOAT(MSTJN(2))*BETA
-          ELSE
-            ETA=ETAL(IL)/FLOAT(MSTJN(2))*BETA
-          ENDIF
-
-          DO 210 I=MM0(IL)+1,MM0(IL+1)
-            W(I)=(1.0-PARJN(5)*FLOAT(NSELF(I)))*W(I)+
-     &           DW(I)*FLOAT(NSELF(I))*ETA
-            DW(I)=DW(I)*PARJN(2)
-210       CONTINUE
-
-          DO 220 I=MV0(IL)+1,MV0(IL+1)
-            T(I)=(1.0-PARJN(5)*FLOAT(NTSELF(I)))*T(I)+
-     &           DT(I)*FLOAT(NTSELF(I))*ETA
-            DT(I)=DT(I)*PARJN(2)
-220       CONTINUE
-
-200     CONTINUE
-
-        ILINON=0
-        NC=0
-        NSC=0
-
-      ELSEIF(MSTJN(5).EQ.1) THEN
-
-C...Manhattan updating:
-
-C...set eta in layer IL:
-
-        DO 300 IL=1,NL
-          IF(ETAL(IL).EQ.0.0) THEN
-            ETA=PARJN(1)/FLOAT(MSTJN(2))
-          ELSE
-            ETA=ETAL(IL)/FLOAT(MSTJN(2))
-          ENDIF
-
-          DO 310 I=MM0(IL)+1,MM0(IL+1)
-            W(I)=(1.0-PARJN(5)*FLOAT(NSELF(I)))*W(I)+
-     &             SIGN(ETA,DW(I))*FLOAT(NSELF(I))
-            DW(I)=DW(I)*PARJN(2)
-310       CONTINUE
-
-          DO 320 I=MV0(IL)+1,MV0(IL+1)
-            T(I)=(1.0-PARJN(5)*FLOAT(NTSELF(I)))*T(I)+
-     &            SIGN(ETA,DT(I))*FLOAT(NTSELF(I))
-            DT(I)=DT(I)*PARJN(2)
-320       CONTINUE
-
-300     CONTINUE
-
-        ILINON=0
-        NC=0
-        NSC=0
-
-      ELSEIF(MSTJN(5).EQ.2) THEN
-
-C...Langevin updating:
-
-        BETA=1.0
-        DO 400 IL=NL,1,-1
-
-C...set effective beta in layer IL:
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-
-C...set eta in layer IL:
-
-          IF(ETAL(IL).EQ.0.0) THEN
-            ETA=PARJN(1)/FLOAT(MSTJN(2))*BETA
-          ELSE
-            ETA=ETAL(IL)/FLOAT(MSTJN(2))*BETA
-          ENDIF
-
-          DO 410 I=MM0(IL)+1,MM0(IL+1)
-            IDUM=I
-            W(I)=(1.0-PARJN(5)*FLOAT(NSELF(I)))*W(I)+
-     &           DW(I)*FLOAT(NSELF(I))*ETA+
-     &           GAUSJN(IDUM)*PARJN(6)
-            DW(I)=DW(I)*PARJN(2)
-410       CONTINUE
-
-          DO 420 I=MV0(IL)+1,MV0(IL+1)
-            IDUM=I
-            T(I)=(1.0-PARJN(5)*FLOAT(NTSELF(I)))*T(I)+
-     &           DT(I)*FLOAT(NTSELF(I))*ETA+
-     &           GAUSJN(IDUM)*PARJN(6)
-            DT(I)=DT(I)*PARJN(2)
-420       CONTINUE
-
-400     CONTINUE
-
-        ILINON=0
-        NC=0
-        NSC=0
-
-      ELSEIF(MSTJN(5).EQ.3) THEN
-
-C...Fahlman's Quickprop:
-
-        WMAX=0.0
-        BETA=1.0
-        DO 500 IL=NL,1,-1
-
-C...set beta in layer IL:
-          IF(TINV(IL).EQ.0.0) THEN
-            BETA=BETA*PARJN(3)
-          ELSE
-            BETA=BETA*ABS(TINV(IL))
-          ENDIF
-
-C...set eta in layer IL:
-
-          IF(ETAL(IL).EQ.0.0) THEN
-            ETA=PARJN(1)/FLOAT(MSTJN(2))*BETA
-          ELSE
-            ETA=ETAL(IL)/FLOAT(MSTJN(2))*BETA
-          ENDIF
-
-          DO 510 I=MM0(IL)+1,MM0(IL+1)
-            SCALE=MAX(-PARJN(21),
-     &            MIN(PARJN(21),DW(I)/(ODW(I)-DW(I)+TINY)))
-            SWITCH=FLOAT(NSELF(I))*(SIGN(0.5,ODW(I)*DW(I))+0.5)
-            G(I)=DW(I)*SWITCH*ETA+SCALE*G(I)
-            W(I)=(1.0-PARJN(5))*W(I)+G(I)
-            ODW(I)=DW(I)
-            DW(I)=0.0
-            IF (ABS(W(I)).GT.WMAX) WMAX=ABS(W(I))
-510       CONTINUE
-
-          DO 520 I=MV0(IL)+1,MV0(IL+1)
-            SCALE=MAX(-PARJN(21),
-     &            MIN(PARJN(21),DT(I)/(ODT(I)-DT(I)+TINY)))
-            SWITCH=FLOAT(NTSELF(I))*(SIGN(0.5,ODT(I)*DT(I))+0.5)
-            G(MM0(NL+1)+I)=DT(I)*SWITCH*ETA+SCALE*G(MM0(NL+1)+I)
-            T(I)=(1.0-PARJN(5))*T(I)+G(MM0(NL+1)+I)
-            ODT(I)=DT(I)
-            DT(I)=0.0
-            IF (ABS(T(I)).GT.WMAX) WMAX=ABS(T(I))
-520       CONTINUE
-
-500     CONTINUE
-
-        IF (WMAX.GT.PARJN(22)) THEN
-C...Quickprop is stuck -> reset weights and restart
-          DO 530 IL=1,NL
-            IF(WIDL(IL).LE.0) THEN
-              WIDTH=PARJN(4)
-            ELSE
-              WIDTH=WIDL(IL)
-            ENDIF
-            DO 540 I=MM0(IL)+1,MM0(IL+1)
-              IDUM=I
-              IF (WIDTH.GE.0.) THEN
-                W(I)=(2.0*RJN(IDUM)-1.0)*WIDTH
-              ELSE
-                W(I)=-RJN(IDUM)*WIDTH
-              ENDIF
-540         CONTINUE
-            DO 550 I=MV0(IL)+1,MV0(IL+1)
-              IDUM=I
-              IF (WIDTH.GE.0.) THEN
-                T(I)=(2.0*RJN(IDUM)-1.0)*WIDTH
-              ELSE
-                T(I)=-RJN(IDUM)*WIDTH
-              ENDIF
-550         CONTINUE
-530       CONTINUE
-          MSTJN(38)=MSTJN(38)+1
-          IF (MSTJN(38).GT.MSTJN(36)) CALL JNERR(21)
-        ENDIF
-
-        ILINON=0
-        NC=0
-        NSC=0
-
-      ELSEIF((MSTJN(5).GE.4).AND.(MSTJN(5).LE.8)) THEN
-
-C...Conjugate Gradient updating:
-
-        CALL JNCOGR
-
-      ELSEIF(MSTJN(5).EQ.9) THEN
-
-C...Minimization terminated - don't update:
-
-        RETURN
-
-      ELSEIF((MSTJN(5).GE.10).AND.(MSTJN(5).LE.14)) THEN
-
-C...Scaled Conjugate Gradient:
-
-        CALL JNSCGR
-
-      ELSEIF(MSTJN(5).EQ.15) THEN
-
-C...Riedmiller's & Braun's Rprop:
-
-        DO 700 IW=1,MM0(NL+1)
-          IF (DW(IW)*ODW(IW).GT.0.) THEN
-            ETAV(IW)=MIN(PARJN(32),MAX(PARJN(33),ETAV(IW)*PARJN(30)))
-          ELSEIF (DW(IW)*ODW(IW).LT.0.) THEN
-            ETAV(IW)=MIN(PARJN(32),MAX(PARJN(33),ETAV(IW)*PARJN(31)))
-          ENDIF
-          W(IW)=W(IW)+SIGN(ETAV(IW),DW(IW)*FLOAT(NSELF(IW)))
-          ODW(IW)=DW(IW)
-          DW(IW)=0.0
-700     CONTINUE
-        DO 710 IT=1,MV0(NL+1)
-          IF (DT(IT)*ODT(IT).GT.0.) THEN
-            ETAV(MM0(NL+1)+IT)=MIN(PARJN(32),
-     &           MAX(PARJN(33),ETAV(MM0(NL+1)+IT)*PARJN(30)))
-          ELSEIF (DT(IT)*ODT(IT).LT.0.) THEN
-            ETAV(MM0(NL+1)+IT)=MIN(PARJN(32),MAX(PARJN(33),
-     &           ETAV(MM0(NL+1)+IT)*PARJN(31)))
-          ENDIF
-          T(IT)=T(IT)+SIGN(ETAV(MM0(NL+1)+IT),
-     &                DT(IT)*FLOAT(NTSELF(IT)))
-          ODT(IT)=DT(IT)
-          DT(IT)=0.0
-710     CONTINUE
-
-      ELSE
-
-        CALL JNERR(9)
-
-      ENDIF
-
-C...do fixed precision weights
-
-      IF(ICPON.EQ.1) CALL JNCHOP(0)
-
-C...Scale temperature
-
-      IF(MSTJN(22).GE.0) THEN
-
-        SCALE=PARJN(13)**(1.0/FLOAT(MSTJN(9)))
-        PARJN(3)=PARJN(3)/SCALE
-        DO 600 I=1,NL
-          TINV(I)=TINV(I)/SCALE
-600     CONTINUE
-
-      ENDIF
-
-      IF(MOD(MSTJN(7),MSTJN(2)*MSTJN(9)).NE.0) RETURN
-
-C...Update some parameters every epoch
-
-      OLDE=PARJN(9)
-      PARJN(9)=ER2/FLOAT(MSTJN(2)*MSTJN(9))
-      ER2=0.0
-
-      IF (MSTJN(21).GT.0) THEN
-
-C...Update pruning parameters
-
-        PARJN(10)=PARJN(16)*PARJN(10)+(1.-PARJN(16))*PARJN(9)
-        IF((PARJN(9).LT.OLDE).OR.(PARJN(9).LT.PARJN(19))) THEN
-          PARJN(14)=PARJN(14)+PARJN(15)
-        ELSEIF(PARJN(9).LT.PARJN(10)) THEN
-          PARJN(14)=PARJN(14)-PARJN(15)
-        ELSE
-          PARJN(14)=PARJN(17)*PARJN(14)
-        ENDIF
-      ENDIF
-
-      IF (MSTJN(22).NE.0) THEN
-
-C...Calculate saturation measures
-
-        DO 610 IL=1,NL
-          SATM(IL)=SM(IL)/FLOAT(MSTJN(2)*MSTJN(9))
-          SM(IL)=0.0
-610     CONTINUE
-      ENDIF
-
-      IF(MSTJN(22).LT.0) THEN
-
-        DO 620 I=1,NL
-
-          IF(TINV(I).GE.0.0) GOTO 620
-
-          IF(SATM(I).GT.0.75) THEN
-            TINV(I)=TINV(I)/(1.0+16.0*(PARJN(13)-1.0)*(SATM(I)-0.5)**2)
-            GOTO 630
-          ELSEIF(SATM(I).LT.0.25) THEN
-            TINV(I)=TINV(I)*(1.0+16.0*(PARJN(13)-1.0)*(0.5-SATM(I))**2)
-            GOTO 630
-          ENDIF
-620     CONTINUE
-
-630   ENDIF
-
-
-C...Scale parameters:
-
-      IF (MSTJN(5).LE.2) THEN
-        IF (PARJN(11).GT.0.) THEN
-C...Change eta using 'bold driver':
-          IF (PARJN(9).GE.OLDE) THEN
-            PARJN(1)=PARJN(1)*PARJN(11)
-            DO 640 I=1,10
-              ETAL(I)=ETAL(I)*PARJN(11)
-640         CONTINUE
-          ELSE
-            PARJN(1)=PARJN(1)*(1.0+0.1*(1.0-PARJN(11)))
-            DO 650 I=1,10
-              ETAL(I)=ETAL(I)*(1.0+0.1*(1.0-PARJN(11)))
-650         CONTINUE
-          ENDIF
-        ELSEIF (PARJN(11).LT.0.) THEN
-C...Decrease eta geometrically:
-          PARJN(1)=PARJN(1)*ABS(PARJN(11))
-          DO 660 I=1,10
-            ETAL(I)=ETAL(I)*ABS(PARJN(11))
-660       CONTINUE
-        ENDIF
-      ENDIF
-C...Scale alpha:
-      PARJN(2)=PARJN(2)*PARJN(12)
-C...Scale Langevin noise:
-      PARJN(6)=PARJN(6)*PARJN(20)
-
-      RETURN
-
-C**** END OF JNTRAL ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JNTRTQ(N,IGRAD)
-
-C...JetNet subroutine TR and TQ.
-C...This routine changed ( = error correction) from version 3.4 to 3.5.
-
-C...Computes the eigenvalues for the Hessian Matrix.
-C...If IGRAD does not equal 0, then the eigenvectors are returned
-C...as column vectors in D2E
-
-C...First:
-C...Householder reduction of the NxN Hessian stored in D2E. 
-C...This routine is taken from "Numerical Recipes" by W.H.Press 
-C...et. al., where it is called TRED2. It has been slightly changed to
-C...fit into JETNET.
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-      PARAMETER(MAXD2E=300,MAXIT=100)
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT5/ D2E(MAXD2E,MAXD2E)
-      SAVE /JNDAT1/,/JNINT5/
-      DIMENSION A(MAXD2E,MAXD2E),D(MAXD2E),E(MAXD2E)
-
-C...  First, commute matrix so that the smallest values are in the
-C...  top left corner.
-      DO 101 IW=1,N
-        DO 102 JW=1,N
-          A(N-IW+1,N-JW+1)=D2E(IW,JW)
-102     CONTINUE
-101   CONTINUE
-
-      IF(N.GT.1)THEN
-        DO 18 I=N,2,-1  
-          L=I-1
-          H=0.
-          SCALE=0.
-          IF(L.GT.1)THEN
-            DO 11 K=1,L
-              SCALE=SCALE+ABS(A(I,K))
-11          CONTINUE
-            IF(SCALE.EQ.0.)THEN
-              E(I)=A(I,L)
-            ELSE
-              DO 12 K=1,L
-                A(I,K)=A(I,K)/SCALE
-                H=H+A(I,K)**2
-12            CONTINUE
-              F=A(I,L)
-              G=-SIGN(SQRT(H),F)
-              E(I)=SCALE*G
-              H=H-F*G
-              A(I,L)=F-G
-              F=0.
-              DO 15 J=1,L
-C...If eigenvectors are needed
-                IF (IGRAD.NE.0) A(J,I)=A(I,J)/H
-                G=0.
-                DO 13 K=1,J
-                  G=G+A(J,K)*A(I,K)
-13              CONTINUE
-                IF(L.GT.J)THEN
-                  DO 14 K=J+1,L
-                    G=G+A(K,J)*A(I,K)
-14                CONTINUE
-                ENDIF
-                E(J)=G/H
-                F=F+E(J)*A(I,J)
-15            CONTINUE
-              HH=F/(H+H)
-              DO 17 J=1,L
-                F=A(I,J)
-                G=E(J)-HH*F
-                E(J)=G
-                DO 16 K=1,J
-                  A(J,K)=A(J,K)-F*E(K)-G*A(I,K)
-16              CONTINUE
-17            CONTINUE
-            ENDIF
-          ELSE
-            E(I)=A(I,L)
-          ENDIF
-          D(I)=H
-18      CONTINUE
-      ENDIF
-C...If eigenvectors are needed:
-      IF (IGRAD.NE.0) D(1)=0.
-      E(1)=0.
-      DO 23 I=1,N
-C...If eigenvectors are needed:
-        IF (IGRAD.NE.0) THEN
-          L=I-1
-          IF(D(I).NE.0.)THEN
-            DO 21 J=1,L
-              G=0.
-              DO 19 K=1,L
-                G=G+A(I,K)*A(K,J)
-19            CONTINUE
-              DO 20 K=1,L
-                A(K,J)=A(K,J)-G*A(K,I)
-20            CONTINUE
-21          CONTINUE
-          ENDIF
-        ENDIF
-C...
-        D(I)=A(I,I)
-C...If eigenvectors are needed:
-        IF (IGRAD.NE.0) THEN
-          A(I,I)=1.
-          IF(L.GE.1)THEN
-            DO 22 J=1,L
-              A(I,J)=0.
-              A(J,I)=0.
-22          CONTINUE
-          ENDIF
-        ENDIF
-C...
-23    CONTINUE
-
-C...Second:
-C...QL algorithm with implicit shifts to determine the eigenvalues and
-C...eigenvectors of the NxN Hessian. 
-C...Eigenvalues and eigenvectors are computed if IGRAD is non-zero.
-C...At return the eigenvectors are stored as columns in D2E and the
-C...eigenvalues are placed in the vector OUT.
-C...This routine is taken from "Numerical Recipes" by W.H.Press 
-C...et. al., where it is called TQLI. It has been slightly modified 
-C...to fit into JETNET.
-
-      IF (N.GT.1) THEN
-        DO 51 I=2,N
-          E(I-1)=E(I)
-51      CONTINUE
-        E(N)=0.
-        DO 55 L=1,N
-          ITER=0
-41        DO 52 M=L,N-1
-            DD=ABS(D(M))+ABS(D(M+1))
-            IF (ABS(E(M))+DD.EQ.DD) GO TO 42
-52        CONTINUE
-          M=N
-42        IF(M.NE.L)THEN
-            IF(ITER.EQ.MAXIT) CALL JNERR(30)
-            ITER=ITER+1
-            G=(D(L+1)-D(L))/(2.*E(L))
-C...        Pythagorean without under/overflow
-            ABSG=ABS(G)
-            IF(ABSG.GT.1.0) THEN
-              R=ABSG*SQRT(1.+(1./ABSG)**2)
-            ELSE
-              R=SQRT(1.+ABSG**2)
-            ENDIF
-C...
-            G=D(M)-D(L)+E(L)/(G+SIGN(R,G))
-            SS=1.
-            C=1.
-            P=0.
-            DO 54 I=M-1,L,-1
-              F=SS*E(I)
-              B=C*E(I)
-C...          Pythagorean without over/underflow
-              ABSF=ABS(F)
-              ABSG=ABS(G)
-              IF(ABSF.GT.ABSG) THEN
-                R=ABSF*SQRT(1.+(ABSG/ABSF)**2)
-              ELSE
-                IF(ABSG.EQ.0.) THEN
-                  R=0.
-                ELSE
-                  R=ABSG*SQRT(1.+(ABSF/ABSG)**2)
-                ENDIF
-              ENDIF
-C...
-              E(I+1)=R
-C...Recover from underflow
-              IF(R.EQ.0.) THEN
-                D(I+1)=D(I+1)-P
-                E(M)=0.
-                GOTO 41
-              ENDIF
-              SS=F/R
-              C=G/R
-              G=D(I+1)-P
-              R=(D(I)-G)*SS+2.*C*B
-              P=SS*R
-              D(I+1)=G+P
-              G=C*R-B
-C...If eigenvectors are needed:
-              IF (IGRAD.NE.0) THEN
-                DO 53 K=1,N
-                  F=A(K,I+1)
-                  A(K,I+1)=SS*A(K,I)+C*F
-                  A(K,I)=C*A(K,I)-SS*F
-                  D2E(N-K+1,N-I+1)=A(K,I)
-53              CONTINUE
-              ENDIF
-C...
-54          CONTINUE
-            D(L)=D(L)-P
-            E(L)=G
-            E(M)=0.
-            GO TO 41
-          ENDIF
-55      CONTINUE
-      ENDIF
-
-C...Put eigenvalues in OUT:
-      DO 100 I=1,N
-        OUT(I)=D(N-I+1)
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JNTRTQ ****************************************************
-      END
-C***********************************************************************
-
-C**********************************************************************C
-C PART TWO: SELF-ORGANIZING MAP NETWORK                                C
-C**********************************************************************C
-
-
-      REAL FUNCTION GJM(X,N)
-C...JetMap function G.
-
-C...Gives response function N with argument X.
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      SAVE /JNDAT1/
-
-
-      IF(N.EQ.1) THEN
-        GJM=0.5*(1.0+TANH(X))
-      ELSEIF(N.EQ.2) THEN
-        GJM=EXP(MAX(-50.0,MIN(-X,50.0)))
-      ELSE
-        MSTJM(3)=N
-        CALL JMERR(11)
-      ENDIF
-
-      RETURN
-
-C**** END OF GJM *******************************************************
-      END 
-C***********************************************************************
-
-
-      SUBROUTINE JMDUMP(NF)
-
-C...JetMap subroutine DUMP weights
-
-C...Dumps weights and other characteristics of the
-C...net to file NF for use in other programs.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF (MSTJM(8).NE.1) CALL JMERR(8)
-
-      IF(NF.LT.0) THEN
-
-C...Unformatted dump
-
-        JF=-NF
-        WRITE(JF) -30
-        WRITE(JF) MSTJM,PARJM
-
-        DO 100 IW=1,INDW(NODES(MAXD+1)+1)-1
-          WRITE(JF) W(IW)
-100     CONTINUE
-
-      ELSE
-
-C...Formatted dump
-
-        NFSAVE=MSTJM(6)
-        MSTJM(6)=NF
-
-        WRITE(NF,600)
-        CALL JNHEAD
-        CALL JMSTAT(1)
-        CALL JMSTAT(2)
-
-        MSTJM(6)=NFSAVE
-
-        DO 200 INOD=1,NODES(MAXD+1)
-          WRITE(NF,*)
-          CALL JMINDX(INOD,I,J)
-          IF (NDIM.EQ.1) THEN
-            WRITE(NF,610)I
-          ELSE
-            WRITE(NF,620)I,J
-          ENDIF
-         
-          IW=INDW(INOD)-1
-          WRITE(NF,630)(W(IW+K),K=1,NODES(0))
-
-200    CONTINUE
-
-      ENDIF
-
-600   FORMAT(26X,' Dump of weights generated by')
-610   FORMAT('Unit ',I2)
-620   FORMAT('Unit (',I2,',',I2,')')
-630   FORMAT(10(F8.4,1X))
-
-      RETURN
-
-C**** END OF JMDUMP ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMERR(IERR)
-C...JetMap subroutine ERRor.
-
-C...Writes out an error message and stops the execution.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF (MSTJN(8).EQ.1) MSTJM(6)=MSTJN(6)
-      WRITE(MSTJM(6),600)IERR
-
-      IF (IERR.EQ.1) THEN
-        WRITE(MSTJM(6),610)MSTJM(1)
-      ELSEIF (IERR.EQ.2) THEN
-        WRITE(MSTJM(6),620)MSTJM(10),MAXI
-      ELSEIF (IERR.EQ.3) THEN
-        WRITE(MSTJM(6),630)ABS(MSTJM(11)*MSTJM(12)),MAXO
-      ELSEIF (IERR.EQ.4) THEN
-        WRITE(MSTJM(6),640)NODES(MAXD+1)*(NODES(0)+1),MAXM
-      ELSEIF (IERR.EQ.5) THEN
-        WRITE(MSTJM(6),650)'JMTEST'
-      ELSEIF (IERR.EQ.6) THEN
-        WRITE(MSTJM(6),650)'JMTRAL'
-      ELSEIF (IERR.EQ.7) THEN
-        WRITE(MSTJM(6),650)'JMINDX'
-      ELSEIF (IERR.EQ.8) THEN
-        WRITE(MSTJM(6),650)'JMDUMP'
-      ELSEIF (IERR.EQ.9) THEN
-        WRITE(MSTJM(6),650)'JMINWE'
-      ELSEIF (IERR.EQ.10) THEN
-        WRITE(MSTJM(6),660)
-      ELSEIF (IERR.EQ.11) THEN
-        WRITE(MSTJM(6),670)MSTJM(3)
-      ELSEIF (IERR.EQ.12) THEN
-        WRITE(MSTJM(6),680)
-      ELSEIF (IERR.EQ.13) THEN
-        WRITE(MSTJM(6),690)
-      ELSEIF (IERR.EQ.14) THEN
-        WRITE(MSTJM(6),650)'JMNBHD'
-      ENDIF
-
-      IF (IERR.GT.0) STOP 0
-
-600   FORMAT(' *** JETMAP ERROR:',I2,' ***')
-610   FORMAT(' Illegal number of dimensions (',I2,')')
-620   FORMAT(' Total number of input nodes (',I6,') exceeds limit (',
-     &I6,')')
-630   FORMAT(' Total number of network nodes (',I6,
-     &') exceeds limit (',I6,')')
-640   FORMAT(' The number of weights (',I6,') exceeds limit (',I5,')')
-650   FORMAT(' Network must be initialized (with JMINIT or JMREAD) ',
-     &'before ',A6,' can be called')
-660   FORMAT(' Call to JMINIT after calling JNINIT')
-670   FORMAT(' Undefined response function (',I2,') in GJM.')
-680   FORMAT(' JMREAD cannot read data-file produced by JNDUMP')
-690   FORMAT(' Too many warnings issued by JETMAP')
-
-      RETURN
-
-C**** END OF JMERR *****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMFEED
-C...JetMap subroutine FEED signal to net.
-
-C...Feeds the input signal into the network and calculates
-C...MXNDJM and DW.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-      PARAMETER(BIAS=0.5)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      MXNDJM=0
-
-      IF (ISW(1).EQ.1) THEN
-C *** Sigmoidal unit ***
-
-        ODUM=0.0
-        IW=0
-        DO 100 J=1,NODES(MAXD+1)
-          RSUM=0.0
-          DO 110 K=1,NODES(0)
-            IW=IW+1
-            DW(IW)=OIN(K)-W(IW)
-            RSUM=RSUM+OIN(K)*W(IW)
-110       CONTINUE
-          O(J)=GJM((RSUM-BIAS)*PARJM(3),ISW(1))
-          IF (O(J).GT.ODUM) THEN
-            ODUM=O(J)
-            MXNDJM=J
-          ENDIF
-100     CONTINUE
-
-      ELSEIF(ISW(1).EQ.2) THEN
-C *** Gaussian unit ***
-
-        ODUM=EXP(-49.0)
-        IW=0
-        DO 200 J=1,NODES(MAXD+1)
-          RSUM=0.0
-          DO 210 K=1,NODES(0)
-            IW=IW+1
-            DW(IW)=OIN(K)-W(IW)
-            RSUM=RSUM+DW(IW)**2
-210       CONTINUE
-          O(J)=GJM(RSUM*PARJM(3),ISW(1))
-          IF (O(J).GT.ODUM) THEN
-            ODUM=O(J)
-            MXNDJM=J
-          ENDIF
-200     CONTINUE
-
-      ENDIF
-
-      IF (MXNDJM.EQ.0) CALL JMWARN(1)
-
-      RETURN
-
-C**** END OF JMFEED ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMINDX(INOD,I,J)
-C...JetMap subroutine INDeX.
-
-C...If INOD>0 it returns the (I,J)-coordinates for INOD, if
-C...INOD=0 it returns the INOD-number (in O array) for unit (I,J)
-C...in net.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF (MSTJM(8).NE.1) CALL JMERR(7)
-
-      IF (INOD.GT.0) THEN
-C...INOD -> (I,J)
-
-        IF (NDIM.EQ.1) THEN
-          J=1
-          I=INOD
-        ELSEIF (NDIM.EQ.2) THEN
-          J=MOD(INOD,NODES(2))
-          I=INOD/NODES(2)+1
-          IF (J.EQ.0) THEN
-            J=NODES(2)
-            I=I-1
-          ENDIF
-        ENDIF
-
-      ELSEIF (INOD.EQ.0) THEN
-C...(I,J) -> INOD
-
-        IF (NDIM.EQ.1) THEN
-          INOD=I
-        ELSEIF (NDIM.EQ.2) THEN
-          INOD=(I-1)*NODES(2)+J
-        ENDIF
-
-      ENDIF
-
-      RETURN
-
-C**** END OF JMINDX ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMINIT
-C...JetMap subroutine INITialize net.
-
-C...Initializes the net according to switches and parameters in
-C.../JMDAT1/ and /JMDAT2/.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-C...Check if JNINIT has been called:
-      IF(MSTJN(8).EQ.1) CALL JMERR(10)
-
-C...Set parameters:
-      CALL JMSEPA
-
-C...Set initial values of weights:
-      DO 100 IW=1,INDW(NODES(MAXD+1)+1)-1
-        IDUM=IW
-        IF (MSTJM(2).EQ.0) THEN
-          W(IW)=RJN(IDUM)*PARJM(4)
-        ELSEIF (MSTJM(2).EQ.1) THEN
-          W(IW)=(2.*RJN(IDUM)-1.)*PARJM(4)
-        ENDIF
-100   CONTINUE
-
-C...Normalize weights: 
-      IF (MSTJM(7).EQ.1) CALL JMNORM
-
-C...Write statistics on output file:
-
-      IF (MSTJM(6).LT.0) RETURN
-
-      CALL JNHEAD
-
-      CALL JMSTAT(1)
-
-      IF (MSTJM(5).EQ.0) THEN
-        WRITE(MSTJM(6),600)
-      ELSEIF (MSTJM(5).EQ.1) THEN
-        WRITE(MSTJM(6),610)
-      ELSEIF (MSTJM(5).EQ.2) THEN
-        WRITE(MSTJM(6),660)
-      ENDIF
-
-      WRITE(MSTJM(6),*)
-
-      IF (MSTJM(2).EQ.0) THEN
-        WRITE(MSTJM(6),620) PARJM(4)
-      ELSEIF (MSTJM(2).EQ.1) THEN
-        WRITE(MSTJM(6),630) PARJM(4)
-      ENDIF
-
-      WRITE(MSTJM(6),*)
-
-      IF (MSTJM(7).EQ.0) THEN
-        WRITE(MSTJM(6),640)
-      ELSEIF (MSTJM(7).EQ.1) THEN
-        WRITE(MSTJM(6),650)
-      ENDIF
-
-      WRITE(MSTJM(6),*)
-
-600   FORMAT(26X,'Self-organized Clustering')
-610   FORMAT(25X,'Learning Vector Quantization')
-620   FORMAT(16X,'Weights set randomly between 0.0 and + ',F6.3)
-630   FORMAT(20X,'Weights set randomly between +/- ',F6.3)
-640   FORMAT(26X,'Weights are not normalized')
-650   FORMAT(28X,'Weights are normalized')
-660   FORMAT(24X,'LVQ with neighborhood function')
-
-      RETURN
-
-C**** END OF JMINIT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMINWE(INOD)
-C...JetMap subroutine INitial WEight.
-
-C...Sets the weight vector for unit INOD equal to the 
-C...input pattern stored in OIN.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF (MSTJM(8).NE.1) CALL JMERR(9)
-
-      DO 100 K=1,NODES(0)
-        IW=INDW(INOD)+K-1
-        W(IW)=OIN(K)
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JMINWE ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMNBHD
-C...JetMap subroutine NeighBourHooD.
-
-C...Specifies the neighbourhood to update according to MSTJM(9).
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV),NBHD(MAXO,0:121)
-      EQUIVALENCE (NSELF(1),NBHD(1,0)),(NTSELF(1),INDW(1))
-
-
-      IF(MSTJM(8).NE.1) CALL JMERR(14)
-
-      IF (NDIM.EQ.1.AND.ABS(MSTJM(9)).GT.121) THEN
-        CALL JMWARN(3)
-        MSTJM(9)=SIGN(121,MSTJM(9))
-      ELSEIF (NDIM.EQ.2.AND.ABS(MSTJM(9)).GT.5) THEN
-        CALL JMWARN(2)
-        MSTJM(9)=SIGN(5,MSTJM(9))
-      ENDIF
-
-      IF (MSTJM(9).EQ.0) THEN
-        DO 200 INOD=1,NODES(MAXD+1)
-          NBHD(INOD,1)=INOD
-          NBHD(INOD,0)=1
-200     CONTINUE
-        RETURN
-      ENDIF
-
-      IF (NDIM.EQ.1) THEN
-
-        DO 100 INOD=1,NODES(MAXD+1)
-          IF (MSTJM(11).GE.0) THEN
-C...Non-periodic boundary:
-            ISTRT=MAX(1,INOD-ABS(MSTJM(9)))
-            IEND=MIN(MSTJM(11),INOD+ABS(MSTJM(9)))
-          ELSE
-C...Periodic boundary:
-            ISTRT=INOD-ABS(MSTJM(9))
-            IEND=ISTRT+2*ABS(MSTJM(9))
-          ENDIF
-          NBNUM=0
-          DO 110 I=ISTRT,IEND
-            IND=MOD(I-1,MSTJM(11))+1
-            NBNUM=NBNUM+1
-            NBHD(INOD,NBNUM)=IND
-110       CONTINUE
-          NBHD(INOD,0)=NBNUM
-100     CONTINUE
-
-      ELSEIF (NDIM.EQ.2) THEN
-
-        IF (MSTJM(9).GT.0) THEN
-C...Square neighbourhood:
-          DO 120 INOD=1,NODES(MAXD+1)
-            CALL JMINDX(INOD,IC,JC)
-            IF (MSTJM(11).GE.0) THEN
-C...Non-periodic in dim. 1:
-              ISTRT=MAX(1,IC-MSTJM(9))
-              IEND=MIN(MSTJM(11),IC+MSTJM(9))
-            ELSE
-C...Periodic in dim. 1:
-              ISTRT=ABS(MSTJM(11))+IC-MSTJM(9)
-              ISTRT=MOD(ISTRT-1,ABS(MSTJM(11)))+1
-              IEND=ISTRT+2*MSTJM(9)
-            ENDIF
-            IF (MSTJM(12).GE.0) THEN
-C...Non-periodic in dim.2:
-              JSTRT=MAX(1,JC-MSTJM(9))
-              JEND=MIN(MSTJM(12),JC+MSTJM(9))
-            ELSE
-C...Periodic in dim. 2:
-              JSTRT=ABS(MSTJM(12))+JC-MSTJM(9)
-              JSTRT=MOD(JSTRT-1,ABS(MSTJM(12)))+1
-              JEND=JSTRT+2*MSTJM(9)
-            ENDIF
-            NBNUM=0
-            DO 130 I=ISTRT,IEND
-              DO 140 J=JSTRT,JEND
-                IND=MOD(I-1,MSTJM(11))+1
-                JND=MOD(J-1,MSTJM(12))+1
-                NBNUM=NBNUM+1
-                NBNOD=0
-                CALL JMINDX(NBNOD,IND,JND)
-                NBHD(INOD,NBNUM)=NBNOD
-140           CONTINUE
-130         CONTINUE
-            NBHD(INOD,0)=NBNUM
-120       CONTINUE
-
-        ELSEIF (MSTJM(9).LT.0) THEN
-C...Circular neighbourhood:
-          DO 150 INOD=1,NODES(MAXD+1)
-            CALL JMINDX(INOD,IC,JC)
-            IF (MSTJM(11).GE.0) THEN
-C...Non-periodic in dim. 1:
-              ISTRT=MAX(1,IC+MSTJM(9))
-              IEND=MIN(MSTJM(11),IC-MSTJM(9))
-            ELSE
-C...Periodic in dim. 1:
-              ISTRT=ABS(MSTJM(11))+IC+MSTJM(9)
-              ISTRT=MOD(ISTRT-1,ABS(MSTJM(11)))+1
-              IEND=ISTRT-2*MSTJM(9)
-              IC=ISTRT-MSTJM(9)
-            ENDIF
-            IF (MSTJM(12).GE.0) THEN
-C...Non-periodic in dim.2:
-              JSTRT=MAX(1,JC+MSTJM(9))
-              JEND=MIN(MSTJM(12),JC-MSTJM(9))
-            ELSE
-C...Periodic in dim. 2:
-              JSTRT=ABS(MSTJM(12))+JC+MSTJM(9)
-              JSTRT=MOD(JSTRT-1,ABS(MSTJM(12)))+1
-              JEND=JSTRT-2*MSTJM(9)
-              JC=JSTRT-MSTJM(9)
-            ENDIF
-            NBNUM=0
-            DO 160 I=ISTRT,IEND
-              DO 170 J=JSTRT,JEND
-                RDIST=SQRT(FLOAT((IC-I)**2+(JC-J)**2))
-                IF (RDIST.LE.FLOAT(-MSTJM(9))) THEN
-                  IND=MOD(I-1,ABS(MSTJM(11)))+1
-                  JND=MOD(J-1,ABS(MSTJM(12)))+1
-                  NBNUM=NBNUM+1
-                  NBNOD=0
-                  CALL JMINDX(NBNOD,IND,JND)
-                  NBHD(INOD,NBNUM)=NBNOD
-                ENDIF
-170           CONTINUE
-160         CONTINUE
-            NBHD(INOD,0)=NBNUM
-150       CONTINUE
-        ENDIF
-
-      ENDIF
-
-      NBO=MSTJM(9)
-
-      RETURN
-
-C**** END OF JMNBHD ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMNORM
-C...JetMap subroutine NORMalize weights.
-
-C...Normalizes the weights.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXD=2)
-
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      DO 100 INOD=1,NODES(MAXD+1)
-        RNORM=0.0
-        IWSTRT=INDW(INOD)
-        IWEND=INDW(INOD)+NODES(0)-1
-        DO 110 IW=IWSTRT,IWEND
-          RNORM=RNORM+W(IW)*W(IW)
-110     CONTINUE
-        RNORM=SQRT(RNORM)
-        DO 120 IW=IWSTRT,IWEND
-          W(IW)=W(IW)/RNORM
-120     CONTINUE
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JMNORM ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMREAD(NF)
-C...JetMap subroutine READ weights and parameters.
-
-C...Reads weights and parameters from file NF and initializes the net.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-      CHARACTER LINE*100
-
-
-      NDUM=MSTJM(6)
-
-      IF(NF.LT.0) THEN
-
-C...Unformatted read
-       JF=-NF
-       READ(JF) IVERS
-       IF(IVERS.GE.0) CALL JMERR(12)
-       READ(JF) MSTJM,PARJM
-       
-       CALL JMSEPA
-
-       DO 100 IW=1,INDW(NODES(MAXD+1)+1)-1
-        READ(JF) W(IW)
-100    CONTINUE
-
-      ELSE
-C...Formatted read
-
-        NFSAVE=MSTJM(6)
-
-        READ(NF,690)LINE
-        IF (LINE(27:28).EQ.'Du') CALL JMERR(12)
-        READ(NF,*)
-        READ(NF,*)
-        READ(NF,710)FVERS
-        IVERS=INT(FVERS*10.0+0.001)
-
-900     READ(NF,690)LINE
-        IF (LINE(1:17).NE.'         I      1') GOTO 900
-
-        READ(NF,610)LINE(1:10),(MSTJM(I),I=1,10)
-        READ(NF,610)LINE(1:10),(MSTJM(10+I),I=1,10)
-        READ(NF,620)LINE(1:10),(PARJM(I),I=1,10)
-        READ(NF,620)LINE(1:10),(PARJM(10+I),I=1,10)
-        READ(NF,*)
-
-        MSTJM(6)=NFSAVE
-
-        CALL JMSEPA
-
-        IF (NDIM.EQ.1) THEN
-          DO 110 INOD=1,NODES(MAXD+1)
-            READ(NF,*)
-            READ(NF,630)LINE,I
-            IW=INDW(INOD)-1
-            READ(NF,640)(W(IW+K),K=1,NODES(0))
-110       CONTINUE
-        ELSEIF(NDIM.EQ.2) THEN
-          DO 120 INOD=1,NODES(MAXD+1)
-            READ(NF,*)
-            READ(NF,650)LINE,I,LINE,J,LINE
-            IW=INDW(INOD)-1
-            READ(NF,640)(W(IW+K),K=1,NODES(0))
-120       CONTINUE
-        ENDIF
-
-      ENDIF
-
-      MSTJM(6)=NDUM
-
-C...Write statistics on output file:
-      IF (MSTJM(6).LT.0) RETURN
-      CALL JNHEAD
-      CALL JMSTAT(1)
-      WRITE(MSTJM(6),600)
-
-600   FORMAT(21X,'Weights read from file')
-610   FORMAT(A,10I7)
-620   FORMAT(A,10F7.4)
-630   FORMAT(A5,I2)
-640   FORMAT(10F9.4)
-650   FORMAT(A6,I2,A1,I2,A1)
-690   FORMAT(A)
-700   FORMAT(I2,A)
-710   FORMAT(TR63,F2.1)
-
-      RETURN
-
-C**** END OF JMREAD ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMSEPA
-C...JetMap subroutine SEt PArameters.
-
-C...Sets parameters in /JMINT1/.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-C...Number of dimensions:
-      NDIM=MSTJM(1)
-      IF (NDIM.GT.MAXD.OR.NDIM.LE.0) CALL JMERR(1)
-
-C...Number of nodes:
-      IF (MSTJM(10).GT.MAXI) CALL JMERR(2)
-      IF (NDIM.EQ.1) THEN
-        NODES(MAXD+1)=ABS(MSTJM(11))
-      ELSEIF (NDIM.EQ.2) THEN
-        NODES(MAXD+1)=ABS(MSTJM(11)*MSTJM(12))
-      ENDIF
-      IF (NODES(MAXD+1).GT.MAXO) CALL JMERR(3)
-      DO 100 IDIM=1,MAXD+1
-        NODES(IDIM-1)=ABS(MSTJM(9+IDIM))
-100   CONTINUE
-
-C *** Set internal switches: ***
-C...Response function:
-      ISW(1)=MSTJM(3)
-C...Error measure:
-      ISW(2)=MSTJM(4)
-
-C *** Calculate weight pointers: ***
-      IF (NODES(MAXD+1)*NODES(0).GT.MAXM) CALL JMERR(4)
-      DO 110 INOD=1,NODES(MAXD+1)+1
-        INDW(INOD)=(INOD-1)*NODES(0)+1
-110   CONTINUE
-
-      MSTJM(8)=1
-
-C...Initialize neighbourhood:
-      CALL JMNBHD
-
-      RETURN
-
-C**** END OF JMSEPA ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMSTAT(IS)
-
-C...JetMap subroutine output STATistics.
-
-C...Statistics chosen by IS is written on file MSTJM(6).
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF(IS.EQ.1) THEN
-        WRITE(MSTJM(6),*)
-        WRITE(MSTJM(6),600) NDIM
-        DO 100 IDIM=1,NDIM
-          WRITE(MSTJM(6),610) NODES(IDIM),IDIM
-100     CONTINUE
-        WRITE(MSTJM(6),620) NODES(0)
-        WRITE(MSTJM(6),*)
-        WRITE(MSTJM(6),*)
-
-      ELSEIF(IS.EQ.2) THEN
-        WRITE(MSTJM(6),*)
-        WRITE(MSTJM(6),630)
-        WRITE(MSTJM(6),*)
-        WRITE(MSTJM(6),640)'I',(I,I=1,10)
-        WRITE(MSTJM(6),640)'MSTJM I',(MSTJM(I),I=1,10)
-        WRITE(MSTJM(6),640)'MSTJM 10+I',(MSTJM(10+I),I=1,10)
-        WRITE(MSTJM(6),650)'PARJM I',(PARJM(I),I=1,10)
-        WRITE(MSTJM(6),650)'PARJM 10+I',(PARJM(10+I),I=1,10)
-        WRITE(MSTJM(6),*)
-
-      ELSE
-        NWFAC=INDW(NODES(MAXD+1)+1)-1
-        WRITE(MSTJM(6),660)NWFAC
-      ENDIF
-
-600   FORMAT(22X,'Initialized for a ',I1,'-dimensional map with')
-610   FORMAT(27X,I3,' nodes in dimension ',I1)
-620   FORMAT(27X,I3,' input nodes')
-630   FORMAT(18X,'Values of parameters and switches in JETNET')
-640   FORMAT(A10,10I7)
-650   FORMAT(A10,10F7.4)
-660   FORMAT(5X,'Time factor for this map:',I10)
-
-      RETURN
-
-C**** END OF JMSTAT ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMTEST
-C...JetMap subroutine TEST
-
-C...Sets the values of OUT according to given pattern in OIN
-C...and current values of weights.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV)
-      EQUIVALENCE (NTSELF(1),INDW(1))
-
-
-      IF (MSTJM(8).NE.1) CALL JMERR(7)
-
-      CALL JMFEED
-
-      DO 100 INOD=1,NODES(MAXD+1)
-        OUT(INOD)=O(INOD)
-100   CONTINUE
-
-      RETURN
-
-C**** END OF JMTEST ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMTRAL
-C...JetMap subroutine TRaining ALgorithm.
-
-C...Trains the net according to /JMDAT1/.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      SAVE /JNDAT1/,/JNINT1/,/JMINT1/
-
-      DIMENSION INDW(MAXV),NBHD(MAXO,0:121)
-      EQUIVALENCE (NSELF(1),NBHD(1,0)),(NTSELF(1),INDW(1))
-
-
-      IF (MSTJM(8).NE.1) CALL JMERR(6)
-
-C...Update neighbourhood:
-      IF (MSTJM(9).NE.NBO) CALL JMNBHD
-
-      CALL JMFEED
-      IF (MXNDJM.EQ.0) RETURN
-
-      IF (MSTJM(5).EQ.0) THEN
-C...Normal updating
-        DO 100 INBH=1,NBHD(MXNDJM,0)
-          IWSTRT=INDW(NBHD(MXNDJM,INBH))
-          IWEND=INDW(NBHD(MXNDJM,INBH)+1)-1
-          DO 110 IW=IWSTRT,IWEND
-            W(IW)=W(IW)+PARJM(1)*DW(IW)
-110       CONTINUE
-100     CONTINUE
-
-      ELSEIF (MSTJM(5).EQ.1) THEN
-C...Learning Vector Quantization
-        IWSTRT=INDW(MXNDJM)
-        IWEND=INDW(MXNDJM+1)-1
-        IF (OUT(MXNDJM).LT.0.5) THEN
-C...Wrong answer:
-          DO 200 IW=IWSTRT,IWEND
-            W(IW)=W(IW)-PARJM(1)*DW(IW)
-200       CONTINUE
-        ELSE
-C...Correct answer:
-          DO 210 IW=IWSTRT,IWEND
-            W(IW)=W(IW)+PARJM(1)*DW(IW)
-210       CONTINUE
-        ENDIF
-
-      ELSEIF (MSTJM(5).EQ.2) THEN
-C...LVQ with neighborhood function:
-        IWSTRT=INDW(MXNDJM)
-        IWEND=INDW(MXNDJM+1)-1
-        DO 220 IW=IWSTRT,IWEND
-          W(IW)=W(IW)+PARJM(1)*DW(IW)*OUT(MXNDJM)
-220     CONTINUE
-
-      ENDIF
-
-      DO 300 INOD=1,NODES(MAXD+1)
-        OUT(INOD)=O(INOD)
-300   CONTINUE
-
-C...If normalize:
-      IF (MSTJM(7).EQ.1) CALL JMNORM
-
-      RETURN
-
-C**** END OF JMTRAL ****************************************************
-      END
-C***********************************************************************
-
-
-      SUBROUTINE JMWARN(IWARN)
-C...JetMap subroutine WARNing.
-
-C...Writes out a warning on file MSTJM(6).
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      SAVE /JNDAT1/
-
-
-      MSTJN(34)=MSTJN(34)+1
-      MSTJN(33)=IWARN
-      IF(MSTJN(34).LT.MSTJN(32)) THEN
-
-       WRITE(MSTJM(6),600)IWARN
-
-       IF (IWARN.EQ.1) THEN
-         WRITE(MSTJM(6),610)
-       ELSEIF (IWARN.EQ.2) THEN
-         WRITE(MSTJM(6),620)MSTJM(9)
-         WRITE(MSTJM(6),630)
-         WRITE(MSTJM(6),640)
-       ELSEIF (IWARN.EQ.3) THEN
-         WRITE(MSTJM(6),620)MSTJM(9)
-         WRITE(MSTJM(6),650)
-         WRITE(MSTJM(6),660)
-       ENDIF
-
-      ELSEIF(MSTJN(31).GE.1) THEN
-
-       CALL JMERR(13)
-
-      ENDIF
-
-600   FORMAT(' *** JETMAP WARNING:',I2,' ***')
-610   FORMAT(' No response in net for presented input')
-620   FORMAT(' Illegal value of neighbourhood size (',I2,')')
-630   FORMAT(' absolute value of MSTJM(9) must be within [0,5]')
-640   FORMAT(' MSTJM(9) set to limit value 5')
-650   FORMAT(' absolute value of MSTJM(9) must be within [0,121]')
-660   FORMAT(' MSTJM(9) set to limit value 121')
-
-      RETURN
-
-C**** END OF JMWARN ****************************************************
-      END
-C***********************************************************************
-
-
-      BLOCK DATA JNDATA
-
-C...JetNet block DATA 
-
-C...Initial values for parameters and switches for JETNET.
-
-      PARAMETER(MAXV=2000,MAXM=150000,MAXI=1000,MAXO=1000,MAXD=2)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      COMMON /JNDAT2/ TINV(10),IGFN(10),ETAL(10),WIDL(10),SATM(10)
-      COMMON /JNINT1/ O(MAXV),A(MAXV),D(MAXV),T(MAXV),DT(MAXV),
-     &                W(MAXM),DW(MAXM),NSELF(MAXM),NTSELF(MAXV),
-     &                G(MAXM+MAXV),ODW(MAXM),ODT(MAXV),ETAV(MAXM+MAXV)
-      COMMON /JNINT2/ M(0:10),MV0(11),MM0(11),NG(10),NL,IPOTT,
-     &                ER1,ER2,SM(10),ICPON
-      COMMON /JNINT4/ ILINON,NC,G2,NIT,ERRLN(0:3),DERRLN,STEPLN(0:3),
-     &                STEPMN,ERRMN,IEVAL,ISUCC,ICURVE,NSC,GVEC2
-      COMMON /JMINT1/ NDIM,ISW(10),NODES(0:MAXD+1),NBO
-      COMMON /JNGAUS/ ISET,GASDEV
-      COMMON /JNDATR/ MRJN(5),RRJN(100)
-
-
-C...Brief explanation of parameters and switches :
-C...
-C.../JNDAT1/:
-C...Feed-forward net:
-C...MSTJN(1) (D=3)      number of layers in net
-C...MSTJN(2) (D=10)     number of patterns per update in JNTRAL
-C...MSTJN(3) (D=1)      overall transfer function used in net
-C...        1 -> g(x)=1/(1+exp(-2x))
-C...        2 -> g(x)=tanh(x)
-C...        3 -> g(x)=exp(x) (only used internally for Potts-nodes)
-C...        4 -> g(x)=x
-C...        5 -> g(x)=1/(1+exp(-2x)) (only used internally for
-C...             entropy error)
-C...MSTJN(4) (D=0)      error measure
-C...       -1 -> log-squared error:     E = -log(1-(o-t)**2)
-C...        0 -> summed square error:   E = 0.5*(o-t)**2
-C...        1 -> entropy error:         E = -t*log(o) + (1-t)*log(1-o)
-C...      >=2 -> Kullback measure, using Potts nodes of dimension 
-C...             MSTJN(4):              E = t*log(t/o)
-C...MSTJN(5) (D=0)      updating procedure
-C...        0 -> standard Back-Propagation updating
-C...        1 -> Manhattan updating
-C...        2 -> Langevin updating
-C...        3 -> Quickprop
-C...        4 -> Conjugate Gradient - Polak-Ribiere
-C...        5 -> Conjugate Gradient - Hestenes-Stiefel
-C...        6 -> Conjugate Gradient - Fletcher-Reeves
-C...        7 -> Conjugate Gradient - Shanno
-C...        8 -> Terminate Conjugate Gradient search
-C...        9 -> No updating
-C...       10 -> Scaled Conjugate Gradient - Polak-Ribiere
-C...       11 -> Scaled Conjugate Gradient - Hestenes-Stiefel
-C...       12 -> Scaled Conjugate Gradient - Fletcher-Reeves
-C...       13 -> Scaled Conjugate Gradient - Shanno
-C...       14 -> Terminate Scaled Conjugate Gradient Search
-C...       15 -> Rprop
-C...MSTJN(6) (D=6)      file number for output statistics
-C...MSTJN(7) (I)        number of calls to JNTRAL
-C...MSTJN(8) (I)        initialization done -> 0 = no
-C...MSTJN(9) (D=100)    number of updates per epoch 
-C...MSTJN(10+I)         number of nodes in layer I (I=0 => input layer)
-C...MSTJN(10) (D=16)
-C...MSTJN(11) (D=8)
-C...MSTJN(12) (D=1)
-C...MSTJN(13-20) (D=0)
-C...MSTJN(21) (D=0)     pruning (>0 -> on)
-C...MSTJN(22) (D=0)     saturation measure (<>0 -> on)
-C...                    <0 -> update temperature to give measure ~0.5
-C...MSTJN(23,24) (D=0)  geometry of input nodes for receptive fields
-C...MSTJN(25,26) (D=0)  geometry of receptive fields
-C...MSTJN(27)    (D=1)  number of hidden nodes per receptive field
-C...MSTJN(28-30) (D=0)  precision in bits (0 -> machine precision) for
-C...                    sigmoid functions (28), thresholds (29) and
-C...                    weights (30)
-C...MSTJN(31)    (D=1)  Warning procedure
-C...        0 -> No action is taken after a warning
-C...        1 -> The execution is stopped after the program 
-C...             has experienced MSTJN(32) warnings
-C...             in any case only MSTJN(32) warning messages are printed
-C...             out.
-C...MSTJN(32) (D=10)    Maximum number of warning messages to be  
-C...                    printed. As described above.
-C...MSTJN(33) (I)       code for latest warning issued by the program.
-C...MSTJN(34) (I)       Number of warnings issued by the program so far.
-C...MSTJN(35) (D=10)    Max. number of iterations allowed in line search.
-C...MSTJN(36) (D=10)    Max. number of allowed restarts in line search.
-C...MSTJN(37) (I)       Status of line search
-C...        0 -> Minimum found
-C...        1 -> Searching for minimum
-C...MSTJN(38) (I)       Number of restarts in Quickprop/ConjGr/ScConjGr
-C...MSTJN(39) (I)       Number of calls to JNHESS.
-C...MSTJN(40)           not used
-C...
-C...
-C...PARJN(1) (D=0.001)  learning parameter eta
-C...PARJN(2) (D=0.5)    momentum term alfa
-C...PARJN(3) (D=1.0)    overall inverse temperature beta
-C...PARJN(4) (D=0.1)    width of initial weights
-C...        > 0 -> [-width,+width]
-C...        < 0 -> [0,+width]
-C...PARJN(5) (D=0.0)    forgetting parameter epsilon
-C...PARJN(6) (D=0.0)    noise width in Langevin equation
-C...PARJN(7) (R)        last error per node
-C...PARJN(8) (R)        mean error in last update
-C...PARJN(9) (R)        mean error last epoch (equal to MSTJN(9) updates)
-C...PARJN(10)(R)        weighted mean average used in pruning
-C...PARJN(11) (D=1.0)   change in eta (scale factor per epoch)
-C...        > 0 -> Geometric with "bold driver" dynamics
-C...        < 0 -> Geometric decrease of eta
-C...PARJN(12) (D=1.0)   change in momentum alpha (scale factor per epoch)
-C...PARJN(13) (D=1.0)   change in temperature (scale factor per epoch)
-C...PARJN(14) (D=0.0)   pruning parameter lambda
-C...PARJN(15) (D=1.E-6) change in lambda
-C...PARJN(16) (D=0.9)   parameter gamma used for calculation of PARJN(10)
-C...PARJN(17) (D=0.9)   pruning "cut-off"
-C...PARJN(18) (D=1.0)   scale parameter W(0), used in pruning
-C...PARJN(19) (D=0.0)   target error when pruning
-C...PARJN(20) (D=1.0)   decrease in Langevin noise (scale factor per epoch)
-C...PARJN(21) (D=1.75)  maximum scale for Quickprop updating
-C...PARJN(22) (D=1000.) maximum allowed size of weights in Quickprop
-C...PARJN(23) (D=0.0)   constant added to g'(x) to avoid 'flat spot'
-C...PARJN(24) (D=0.1)   line search convergence parameter (0 < ... < 1)
-C...PARJN(25) (D=0.05)  tolerance of minimum in line search
-C...PARJN(26) (D=0.001) minimum allowed change in error in line search
-C...PARJN(27) (D=2.0)   maximum allowed step size in line search
-C...PARJN(28) (D=1.E-4) constant sigma_0 used in SCG
-C...PARJN(29) (D=1.E-6) initial value for lambda in SCG
-C...PARJN(30) (D=1.2)   scale-up factor used in Rprop
-C...PARJN(31) (D=0.5)   scale-down factor used in Rprop
-C...PARJN(32) (D=50.)   maximum scale-up factor in Rprop
-C...PARJN(33) (D=1.E-6) minimum scale-down factor in Rprop
-C...PARJN(34-40)        not used
-C...
-C...
-C...Self-organizing net:
-C...MSTJM(1)   (D=1)    number of dimensions in net
-C...MSTJM(2)   (D=0)    symmetry of initial weights
-C...        0 -> [0,+width]
-C...        1 -> [-width,+width]
-C...MSTJM(3)   (D=2)    response function
-C...        1 -> g(x)=0.5*(1.0+tanh(x) : for normalized data
-C...        2 -> g(x)=exp(-x)          : for unnormalized data
-C...MSTJM(4)   (D=1)    error measure
-C...        1 -> summed square error
-C...MSTJM(5)   (D=0)    updating procedure
-C...        0 -> unsupervized clustering & topological ordering
-C...        1 -> Learning Vector Quantization (LVQ 1)
-C...        2 -> as 1, but with neighborhood function.
-C...MSTJM(6)   (D=6)     output file number
-C...MSTJM(7)   (D=0)     normalize weights or not
-C...        0 -> unnormalized
-C...        1 -> normalized
-C...MSTJM(8) (I)         initialization done
-C...MSTJM(9)   (D=0)     neighbourhood size
-C...        0< -> square neighbourhood
-C...        <0 -> circular neighbourhood
-C...MSTJM(10)  (D=8)     number of input nodes
-C...MSTJM(11)  (D=10)    number of nodes in dimension 1.
-C...        <0 -> periodic boundary
-C...MSTJM(12)  (D=1)     number of nodes in dimension 2.
-C...        <0 -> periodic boundary
-C...MSTJM(13-20)         not used
-C...
-C...
-C...PARJM(1)   (D=0.001) learning parameter eta
-C...PARJM(2)   (D=0.0)   not used
-C...PARJM(3)   (D=0.01)  overall inverse temperature beta
-C...PARJM(4)   (D=0.5)   initial width of weights
-C...PARJM(5-20)          not used
-C...
-C...
-C.../JNDAT2/:
-C...TINV(I) (D=0.0)     inverse temperature of layer I (if 0 use PARJN(3))
-C...
-C...IGFN(I) (D=0)       sigmoid function for layer I (if 0 use MSTJN(3))
-C...
-C...ETAL(I) (D=0.0)     learning parameter in layer I (if 0 use PARJN(1))
-C...
-C...WIDL(I) (D=0.0)     initial width in layer I (if 0 use PARJN(4))
-C...
-C...SATM(I) (R)         saturation measure "S" for layer I.
-C...      MSTJN(3)=1 -> S = sum[(1.-2.*O(J))**2]
-C...      MSTJN(3)=2 -> S = sum[O(J)**2]
-C...
-C...End of description
-
-
-      DATA MSTJN/3,10,1,0,0,6,0,0,100,16,8,1,14*0,1,3*0,
-     &           1,10,2*0,10,10,4*0/
-      DATA PARJN/0.001,0.5,1.0,0.1,6*0.0,
-     &           3*1.0,0.0,1.E-6,0.9,0.9,1.0,0.0,1.0,
-     &           1.75,1000.0,0.0,0.1,0.05,0.001,2.0,1.E-4,1.E-6,1.2,
-     &           0.5,50.,1.E-6,7*0.0/
-      DATA MSTJM/1,0,2,1,0,6,0,0,0,10,10,1,8*0/
-      DATA PARJM/0.001,0.0,0.01,0.5,16*0.0/
-      DATA TINV/10*0.0/
-      DATA IGFN/10*0/
-      DATA ETAL/10*0.0/
-      DATA WIDL/10*0.0/
-      DATA SATM/10*0.0/
-      DATA ER1/0.0/
-      DATA ER2/0.0/
-      DATA SM/10*0.0/
-      DATA NBO/10/
-      DATA ICPON/0/
-      DATA ILINON,NC,NIT,IEVAL,ISUCC,ICURVE,NSC/4*0,1,2*0/
-      DATA G2,ERRLN,DERRLN,STEPLN,STEPMN,ERRMN,GVEC2/13*0.0/
-      DATA ISET/0/
-      DATA GASDEV/0.0/
-      DATA MRJN/19780503,0,0,97,33/
-
-C**** END OF JNDATA ****************************************************
-      END
-C***********************************************************************
-
-      SUBROUTINE JNTDEC(METHOD)
-C...JetNet subroutine Test-DECk
-
-C...Runs a test-program using data from two overlapping Gaussian
-C...distributions in the input space. The test-program uses the
-C...method specified by METHOD.
-
-      PARAMETER(MAXI=1000,MAXO=1000)
-
-      COMMON /JNDAT1/ MSTJN(40),PARJN(40),MSTJM(20),PARJM(20),
-     &                OIN(MAXI),OUT(MAXO),MXNDJM
-      SAVE /JNDAT1/
-
-      PARAMETER(INDIM=5,HIDDEN=10,NTRAIN=5000,NTEST=10000,NEPOCH=100)
-      PARAMETER(WID1=1.,WID2=2.,XI=0.00,BAYES=85.2)
-      DIMENSION TIN(NTRAIN+NTEST,INDIM),TOUT(NTRAIN+NTEST)
-
-
-      WRITE(MSTJN(6),600)
-
-      WRITE(MSTJN(6),610)INDIM
-      WRITE(MSTJN(6),620)WID1,WID2
-      WRITE(MSTJN(6),621)XI
-      WRITE(MSTJN(6),*)
-
-C...Generate data:
-      WRITE(MSTJN(6),625)
-      DO 100 IPAT=1,NTRAIN+NTEST
-        IDUM=IPAT
-        IF (RJN(IDUM).GT.0.5) THEN
-          DO 110 I=1,INDIM
-            TIN(IPAT,I)=WID1*GAUSJN(IDUM)
-110       CONTINUE
-          TOUT(IPAT)=1.0
-        ELSE
-          TIN(IPAT,1)=WID2*GAUSJN(IDUM)+XI
-          DO 120 I=2,INDIM
-            TIN(IPAT,I)=WID2*GAUSJN(IDUM)
-120       CONTINUE
-          TOUT(IPAT)=0.0
-        ENDIF
-100   CONTINUE
-      WRITE(MSTJN(6),626)
-
-C...Set network architecture: MSTJN(1)-layered network with 
-C...MSTJN(11) hidden nodes, MSTJN(12) output nodes and 
-C...MSTJN(10) inputs.
-      MSTJN(1)=3
-      MSTJN(10)=INDIM
-      MSTJN(11)=HIDDEN
-      MSTJN(12)=1
-
-C...Set sigmoid function: 
-      MSTJN(3)=1
-
-C...Initial width of weights:
-      PARJN(4)=0.5
-
-C...Choose updating method
-      MSTJN(5)=METHOD
-      IF ((MSTJN(5).EQ.8).OR.(MSTJN(5).EQ.9).OR.(MSTJN(5).EQ.14).OR.
-     &(MSTJN(5).LT.0).OR.(MSTJN(5).GT.15)) THEN
-        WRITE(MSTJN(6),660)
-        STOP 0
-      ENDIF
-
-C...Initialize network:
-      CALL JNINIT
-
-C...Set parameters suitable for the given method of updating
-      IF (MSTJN(5).EQ.0) THEN
-C...Normal Backprop
-        PARJN(1)=2.0
-        PARJN(2)=0.5
-        PARJN(11)=0.999
-      ELSEIF (MSTJN(5).EQ.1) THEN
-C...Manhattan
-        PARJN(1)=0.05
-        PARJN(2)=0.5
-        PARJN(11)=-0.99
-      ELSEIF (MSTJN(5).EQ.2) THEN
-C...Langevin
-        PARJN(1)=1.0
-        PARJN(2)=0.5
-        PARJN(6)=0.01
-        PARJN(11)=0.999
-        PARJN(20)=0.99
-      ELSEIF (MSTJN(5).EQ.3) THEN
-C...Quickprop
-        PARJN(1)=2.0
-        PARJN(2)=0.0
-        PARJN(6)=0.0
-        PARJN(11)=1.0
-        PARJN(20)=1.0
-        MSTJN(2)=NTRAIN
-      ELSEIF ((MSTJN(5).GE.4).AND.(MSTJN(5).LE.7)) THEN
-C...Conjugate Gradient
-        PARJN(1)=1.0
-        MSTJN(2)=NTRAIN
-      ELSEIF ((MSTJN(5).GE.10).AND.(MSTJN(5).LE.13)) THEN
-C...Scaled Conjugate Gradient
-        MSTJN(2)=NTRAIN
-      ELSEIF (MSTJN(5).EQ.15) THEN
-C...Rprop
-        PARJN(1)=1.0
-        MSTJN(2)=NTRAIN
-      ENDIF
-
-C...Define the size of one epoch. Note that for batch training, the
-C...number of patterns per update, MSTJN(2), must be set to the
-C...total number of training patterns, and hence MSTJN(9), the
-C...number of updates per epoch must be set to one.
-      MSTJN(9)=MAX(1,NTRAIN/MSTJN(2))
-
-C...Other parameters keep their default values.
-
-      WRITE(MSTJN(6),*)
-      WRITE(MSTJN(6),630)
-
-      TESTMX=0.0
-      TRNMX=0.0
-C...Main loop over epochs:
-      DO 300 IEPOCH=1,NEPOCH
-
-C...Training loop:
-        NRIGHT=0
-        DO 310 IP=1,NTRAIN
-          IF (MSTJN(5).LE.2) THEN
-C...Note that for non-batch training it is often a good idea to pick
-C...training patterns at random
-            IPAT=INT(RJN(IP)*FLOAT(NTRAIN))+1
-          ELSE
-            IPAT=IP
-          ENDIF
-
-C...Put pattern into OIN:
-          DO 320 I=1,MSTJN(10)
-            OIN(I)=TIN(IPAT,I)
-320       CONTINUE
-C...Put target output value into OUT:
-          OUT(1)=TOUT(IPAT)
-
-C...Invoke training algorithm:
-          CALL JNTRAL
-
-C...Calculate performance on training set:
-          IF (ABS(OUT(1)-TOUT(IPAT)).LT.0.5) NRIGHT=NRIGHT+1
-
-310     CONTINUE
-        TRAIN=FLOAT(NRIGHT)/FLOAT(NTRAIN)
-
-        IF (MOD(IEPOCH,10).EQ.0) THEN
-C...Testing loop:
-          NRIGHT=0
-          DO 330 IPAT=NTRAIN+1,NTRAIN+NTEST
-
-C...Put pattern into OIN:
-            DO 340 I=1,MSTJN(10)
-              OIN(I)=TIN(IPAT,I)
-340         CONTINUE
-
-C...Get network output:
-            CALL JNTEST
-
-C...Calculate performance on test set (=generalization):
-            IF (ABS(OUT(1)-TOUT(IPAT)).LT.0.5) NRIGHT=NRIGHT+1
-330       CONTINUE
-          TEST=FLOAT(NRIGHT)/FLOAT(NTEST)
-          IF ((MSTJN(5).GT.3).AND.(MSTJN(5).LT.15)) THEN
-            IF (TRAIN.GT.TRNMX) THEN
-              TRNMX=TRAIN
-              TESTMX=TEST
-            ENDIF
-            TEST=TESTMX
-            TRAIN=TRNMX
-          ENDIF
-
-
-C...Display performance:
-          WRITE(MSTJN(6),640)IEPOCH,TRAIN,TEST
-        ENDIF
-
-C...Terminate CG and SCG training:
-        IF (IEPOCH.EQ.NEPOCH-1) THEN
-          IF ((MSTJN(5).GT.3).AND.(MSTJN(5).LT.15)) THEN
-            IF (MSTJN(5).LT.9) THEN
-              MSTJN(5)=8
-            ELSE
-              MSTJN(5)=14
-            ENDIF
-            TRNMX=0.0
-            TESTMX=0.0
-          ENDIF
-        ENDIF
-
-300   CONTINUE
-
-      WRITE(MSTJN(6),*)
-      WRITE(MSTJN(6),650)BAYES
-      IF (METHOD.EQ.0) THEN
-        WRITE(MSTJN(6),670)
-      ELSEIF (METHOD.EQ.1) THEN
-        WRITE(MSTJN(6),680)
-      ELSEIF (METHOD.EQ.2) THEN
-        WRITE(MSTJN(6),690)
-      ELSEIF (METHOD.EQ.3) THEN
-        WRITE(MSTJN(6),700)
-      ELSEIF (METHOD.EQ.4) THEN
-        WRITE(MSTJN(6),710)
-      ELSEIF (METHOD.EQ.5) THEN
-        WRITE(MSTJN(6),720)
-      ELSEIF (METHOD.EQ.6) THEN
-        WRITE(MSTJN(6),730)
-      ELSEIF (METHOD.EQ.7) THEN
-        WRITE(MSTJN(6),740)
-      ELSEIF (METHOD.EQ.10) THEN
-        WRITE(MSTJN(6),750)
-      ELSEIF (METHOD.EQ.11) THEN
-        WRITE(MSTJN(6),760)
-      ELSEIF (METHOD.EQ.12) THEN
-        WRITE(MSTJN(6),770)
-      ELSEIF (METHOD.EQ.13) THEN
-        WRITE(MSTJN(6),780)
-      ELSEIF (METHOD.EQ.15) THEN
-        WRITE(MSTJN(6),790)
-      ENDIF
-
-600   FORMAT(31X,'JETNET Test-Deck')
-610   FORMAT(15X,'Two overlapping Gaussian distributions in ',
-     &I2,' dimensions.')
-620   FORMAT(15X,'Their standard deviations are ',F3.1,' and ',F3.1)
-621   FORMAT(15X,'Their mean values are separated by ',F4.2)
-625   FORMAT(15X,'Generating training and test patterns...')
-626   FORMAT(15X,'...done generating data.')
-630   FORMAT('   Epoch   /  Training  /  General. ')
-640   FORMAT(I8,2X,2(' /',F9.3,2X))
-650   FORMAT(' The optimal generalization performance is ',F4.1,'%')
-660   FORMAT(' Undefined training algorithm in call to JNTDEC')
-670   FORMAT(' Backprop should reach (81.0 +- 2.2)% in 100 epochs')
-680   FORMAT(' Manhattan should reach (84.3 +- 0.6)% in 100 epochs')
-690   FORMAT(' Langevin should reach (82.9 +- 1.8)% in 100 epochs')
-700   FORMAT(' Quickprop should reach (82.8 +- 8.8)% in 100 epochs')
-710   FORMAT(' Polak-Ribiere CG should reach (79.0 +- 7.0)% in 100',
-     &' epochs')
-720   FORMAT(' Hestenes-Stiefel CG should reach (79.8 +- 5.6)% in 100',
-     &' epochs')
-730   FORMAT(' Fletcher-Reeves CG should reach (79.6 +- 5.6)% in 100',
-     &' epochs')
-740   FORMAT(' Shanno CG should reach (71.7 +- 11.6)% in 100 epochs')
-750   FORMAT(' Polak-Ribiere SCG should reach (84.0 +- 1.6)% in 100',
-     &' epochs')
-760   FORMAT(' Hestenes-Stiefel SCG should reach (84.1 +- 2.6)% in 100',
-     &' epochs')
-770   FORMAT(' Fletcher-Reeves SCG should reach (81.4 +- 5.2)% in 100',
-     &' epochs')
-780   FORMAT(' Shanno SCG should reach (70.7 +- 8.1)% in 100 epochs')
-790   FORMAT(' Rprop should reach (83.5 +- 2.2)% in 100 epochs')
-
-      RETURN
-
-C**** END OF JNTDEC ****************************************************
-      END
-C***********************************************************************
-
-      REAL FUNCTION RJN(IDUM)
-C...JetNet function Random number generator.
-C...Generates random numbers uniformly distributed in ]0,1[
-
-C...This function is taken from the Lund program JETSET
-C...written by T. Sjostrand.
-C...The algorithm is due to Marsaglia, Zaman and Tsang:
-C...Stat. Prob. Lett., vol. 9, (1990)
-C...This function is very much based on a routine
-C...written by F.James: F.James, Comp. Phys. Comm., vol 60 (1990).
-
-C...Names have been changed w.r.t. the JETSET function RLU and
-C...the switch that determines the current position has been
-C...removed.
-
-
-      COMMON /JNDATR /MRJN(5),RRJN(100)
-      SAVE /JNDATR/
-
-
-C...Initialize generation from given seed.
-      IF(MRJN(2).EQ.0) THEN
-        IJ=MOD(MRJN(1)/30082,31329)
-        KL=MOD(MRJN(1),30082)
-        I=MOD(IJ/177,177)+2
-        J=MOD(IJ,177)+2
-        K=MOD(KL/169,178)+1
-        L=MOD(KL,169)
-        DO 110 II=1,97
-        S=0.
-        T=0.5
-        DO 100 JJ=1,24
-        M=MOD(MOD(I*J,179)*K,179)
-        I=J
-        J=K
-        K=M
-        L=MOD(53*L+1,169)
-        IF(MOD(L*M,64).GE.32) S=S+T
-  100   T=0.5*T
-  110   RRJN(II)=S
-        TWOM24=1.
-        DO 120 I24=1,24
-  120   TWOM24=0.5*TWOM24
-        RRJN(98)=362436.*TWOM24
-        RRJN(99)=7654321.*TWOM24
-        RRJN(100)=16777213.*TWOM24
-        MRJN(2)=1
-        MRJN(3)=0
-        MRJN(4)=97
-        MRJN(5)=33
-      ENDIF
-
-C...Generate next random number.
-  130 RUNI=RRJN(MRJN(4))-RRJN(MRJN(5))
-      IF(RUNI.LT.0.) RUNI=RUNI+1.
-      RRJN(MRJN(4))=RUNI
-      MRJN(4)=MRJN(4)-1
-      IF(MRJN(4).EQ.0) MRJN(4)=97
-      MRJN(5)=MRJN(5)-1
-      IF(MRJN(5).EQ.0) MRJN(5)=97
-      RRJN(98)=RRJN(98)-RRJN(99)
-      IF(RRJN(98).LT.0.) RRJN(98)=RRJN(98)+RRJN(100)
-      RUNI=RUNI-RRJN(98)
-      IF(RUNI.LT.0.) RUNI=RUNI+1.
-      IF(RUNI.LE.0.OR.RUNI.GE.1.) GOTO 130
-
-C...Update counters. Random number to output.
-      MRJN(3)=MRJN(3)+1
-      IF(MRJN(3).EQ.1000000000) THEN
-        MRJN(2)=MRJN(2)+1
-        MRJN(3)=0
-      ENDIF
-      RJN=RUNI
-
-      RETURN
-
-C**** END OF RJN *******************************************************
-      END
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/trainNN.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/trainNN.cxx
deleted file mode 100644
index a70d7214aa6a..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/jetnetRoot/trainNN.cxx
+++ /dev/null
@@ -1,1015 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <TTree.h>
-#include <TFile.h>
-#include <TCanvas.h>
-#include <TH1F.h>
-#include <TLegend.h>
-#include <iostream>
-#include <TPad.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-#include "TJetNet.h"
-#include "doNormalization.C"
-#include "Riostream.h"
-#include "TNetworkToHistoTool.h"
-
-#include "TTrainedNetwork.h"
-
-
-#include "TMatrixD.h"
-#include "TVectorD.h"
-
-Double_t sigmoid(Double_t x)
-{
-  return 1./(1.+exp(-2*x));
-}
-
-using namespace std;
-
-void trainNN(TString inputfile,
-             TString outputclass="JetFitterNN",
-             int nIterations=10,
-             int dilutionFactor=2,
-             bool useSD=false,
-             bool withIP3D=true,
-             int nodesFirstLayer=10,
-             int nodesSecondLayer=9,
-             int restartTrainingFrom=0);
-
-
-int main()
-{
-  trainNN(
-      "../reduceddatasets/reduceddataset_Cone4H1TopoParticleJets_forNN.root",
-      "dummy",
-      10000,
-      200,
-      false,
-      false,//withIP3D
-      10,
-      10,
-      0);
-  return 0;
-}
-
-
-int doIt() 
-{
-
-  trainNN(
-      "../reduceddatasets/reduceddataset_Cone4H1TopoParticleJets_forNN.root",
-      "dummy",
-      10000,
-      200,
-      false,
-      false,//withIP3D
-      10,
-      10,
-      0);
-  return 0;
-
-}
-
-
-
-
-
-void trainNN(TString inputfile,
-             TString outputclass,
-             int nIterations,
-             int dilutionFactor,
-             bool useSD,
-             bool withIP3D,
-             int nodesFirstLayer,
-             int nodesSecondLayer,
-             int restartTrainingFrom) {
-
-  gROOT->SetStyle("Plain");
-
-  cout << "starting with settings: " << endl;
-  cout << " nIterations: " << nIterations << endl;
-  cout << " dilutionFactor: " << dilutionFactor << endl;
-  cout << " useSD: " << (useSD==true?"yes":"no") << endl;
-  cout << " withIP3D: " << (withIP3D==true?"yes":"no") << endl;
-  cout << " nodesFirstLayer: " << nodesFirstLayer << endl;
-  cout << " nodesSecondLayer: " << nodesSecondLayer << endl;
-  
-  
-  TFile *file= new TFile(inputfile);
-  TTree *simu = (TTree*)file->Get("SVTree");
-
-  Int_t           nVTX;
-  Int_t           nTracksAtVtx;
-  Int_t           nSingleTracks;
-  Double_t        energyFraction;
-  Double_t        mass;
-  Double_t        significance3d;
-  Double_t        discriminatorIP3D;
-  Int_t        cat_pT;
-  Int_t        cat_eta;
-  Double_t        weight;
-  Int_t bottom;
-  Int_t charm;
-  Int_t light;
-  
-  simu->SetBranchAddress("nVTX",&nVTX);
-  simu->SetBranchAddress("nTracksAtVtx",&nTracksAtVtx);
-  simu->SetBranchAddress("nSingleTracks",&nSingleTracks);
-  simu->SetBranchAddress("energyFraction",&energyFraction);
-  simu->SetBranchAddress("mass",&mass);
-  simu->SetBranchAddress("significance3d",&significance3d);
-  simu->SetBranchAddress("discriminatorIP3D",&discriminatorIP3D);
-  simu->SetBranchAddress("cat_pT",&cat_pT);
-  simu->SetBranchAddress("cat_eta",&cat_eta);
-  simu->SetBranchAddress("weight",&weight);
-  simu->SetBranchAddress("bottom",   &bottom);
-  simu->SetBranchAddress("charm",   &charm);
-  simu->SetBranchAddress("light",&light);
-
-
-  TString filterTrain("Entry$%");
-  filterTrain+=dilutionFactor;
-  filterTrain+="==0";
-  
-  TString filterTest("Entry$%");
-  filterTest+=dilutionFactor;
-  filterTest+="==1";
-
-  int* nneurons;
-  int nlayer=3;
-
-  int numberinputs=8;
-  if (withIP3D)
-  {
-    numberinputs=9;
-  }
-  int numberoutputs=3;
-
-  if (nodesSecondLayer!=0)
-  {
-    nlayer=4;
-  }
-
-  if (nodesSecondLayer!=0)
-  {
-    nneurons=new int[4];
-  }
-  else
-  {
-    nneurons=new int[3];
-  }
-  
-  if (withIP3D)
-  {
-    nneurons[0]=9;
-  }
-  else
-  {
-    nneurons[0]=8;
-  }
-  
-  nneurons[1]=nodesFirstLayer;
-
-  if (nodesSecondLayer!=0)
-  {
-    nneurons[2]=nodesSecondLayer;
-    nneurons[3]=3;
-  }
-  else
-  {
-    nneurons[2]=3;
-  }
-
-  //  float eventWeight(0);
-  float trainingError(0);
-  float testError(0);
-  
-  //setting learning parameters
-
-  cout << " now providing training events " << endl;
-  
-  Int_t numberTrainingEvents=0;
-  Int_t numberTestingEvents=0;
-
-  for (Int_t i = 0; i < simu->GetEntries(); i++) {
-
-    if (i % 100000 == 0 ) {
-      std::cout << " Counting training / testing events in sample. Looping over event " << i << std::endl;
-    }
-    
-    if (i%dilutionFactor==0) numberTrainingEvents+=1;
-//    if (i%dilutionFactor==1||i%dilutionFactor==2) numberTestingEvents+=1;
-    if (i%dilutionFactor==1) numberTestingEvents+=1;
-
-  }
-  
-  cout << " N. training events: " << numberTrainingEvents << 
-      " N. testing events: " << numberTestingEvents << endl;
-
-  cout << "now start to setup the network..." << endl;
-  
- 
-  TJetNet* jn = new TJetNet( numberTestingEvents, numberTrainingEvents, nlayer, nneurons );
-
-  cout <<  " setting learning method... " << endl;
-
-  //  jn->SetMSTJN(4,12); Fletscher-Rieves (Scaled Conj Grad)
-
-  int nPatternsPerUpdate=20;
-  
-  jn->SetPatternsPerUpdate( nPatternsPerUpdate );
-  jn->SetUpdatesPerEpoch( (int)std::floor((float)numberTrainingEvents/(float)nPatternsPerUpdate) );
-  jn->SetUpdatingProcedure( 0 );
-  jn->SetErrorMeasure( 0 );
-  jn->SetActivationFunction( 1 );
-  jn->SetLearningRate( 0.5 );//0.8
-  jn->SetMomentum( 0.2 );//0.3 //is now 0.5
-  jn->SetInitialWeightsWidth( 1. );
-  //  jn->SetLearningRateDecrease( 0.992 );
-  jn->SetLearningRateDecrease( 0.99 );//0.992
-  
-
-  cout << " setting pattern for training events " << endl;
-
-  int trainSampleNumber=0;
-  int testSampleNumber=1;
-  
-  cout << " copying over training events " << endl;
-  
-  int counter=0;
-  for (Int_t i = 0; i < simu->GetEntries(); i++) {
-    
-    if (i % 100000 == 0 ) {
-      std::cout << " Copying over training events. Looping over event " << i << std::endl;
-    }
-
-    if (i%dilutionFactor!=0) continue;
-
-    simu->GetEntry(i);
-
-    jn->SetInputTrainSet( counter, 0, norm_nVTX(nVTX) );
-    jn->SetInputTrainSet( counter, 1, norm_nTracksAtVtx(nTracksAtVtx) );
-    jn->SetInputTrainSet( counter, 2, norm_nSingleTracks(nSingleTracks) );
-    jn->SetInputTrainSet( counter, 3, norm_energyFraction(energyFraction) );
-    jn->SetInputTrainSet( counter, 4, norm_mass(mass) );
-    jn->SetInputTrainSet( counter, 5, norm_significance3d(significance3d ) );
-    if (withIP3D)
-    {
-      jn->SetInputTrainSet( counter, 6, norm_IP3D(discriminatorIP3D) );
-      jn->SetInputTrainSet( counter, 7, norm_cat_pT(cat_pT) );
-      jn->SetInputTrainSet( counter, 8, norm_cat_eta(cat_eta) );
-    }
-    else
-    {
-      jn->SetInputTrainSet( counter, 6, norm_cat_pT(cat_pT) );
-      jn->SetInputTrainSet( counter, 7, norm_cat_eta(cat_eta) );
-    }
-
-    jn->SetOutputTrainSet( counter, 0, bottom );
-    jn->SetOutputTrainSet( counter, 1, charm );
-    jn->SetOutputTrainSet( counter, 2, light );
-
-    counter+=1;
-
-    //not used!
-    //    eventWeight=weight;
-
-  }
-
-  if (counter!=numberTrainingEvents)
-  {
-    cout << " counter up to: " << counter << " while events in training sample are " << numberTrainingEvents << endl;
-    return;
-  }
-
-  cout << " setting pattern for testing events " << endl;
-
-  
-  cout << " copying over testing events " << endl;
-  counter=0;
-  
-  
-  for (Int_t i = 0; i < simu->GetEntries(); i++) {
-    
-    if (i % 100000 == 0 ) {
-      std::cout << " Copying over testing events. Looping over event " << i << std::endl;
-    }
-    
-    if (i%dilutionFactor!=1) continue;
-    
-    simu->GetEntry(i);
-    jn->SetInputTestSet( counter, 0, norm_nVTX(nVTX) );
-    jn->SetInputTestSet( counter, 1, norm_nTracksAtVtx(nTracksAtVtx) );
-    jn->SetInputTestSet( counter, 2, norm_nSingleTracks(nSingleTracks) );
-    jn->SetInputTestSet( counter, 3, norm_energyFraction(energyFraction) );
-    jn->SetInputTestSet( counter, 4, norm_mass(mass) );
-    jn->SetInputTestSet( counter, 5, norm_significance3d(significance3d ) );
-    if (withIP3D)
-    {
-      jn->SetInputTestSet( counter, 6, norm_IP3D(discriminatorIP3D) );
-      jn->SetInputTestSet( counter, 7, norm_cat_pT(cat_pT) );
-      jn->SetInputTestSet( counter, 8, norm_cat_eta(cat_eta) );
-    }
-    else
-    {
-      jn->SetInputTestSet( counter, 6, norm_cat_pT(cat_pT) );
-      jn->SetInputTestSet( counter, 7, norm_cat_eta(cat_eta) );
-    }
-
-    jn->SetOutputTestSet( counter, 0, bottom );
-    jn->SetOutputTestSet( counter, 1, charm );
-    jn->SetOutputTestSet( counter, 2, light );
-
-    counter+=1;
-
-    //not used!
-    //    eventWeight=weight;
-  }
-    
-  if (counter!=numberTestingEvents)
-  {
-    cout << " counter up to: " << counter << " while events in testing sample are " << numberTestingEvents << endl;
-    return;
-  }
-
-  //normalize inputvariables?
-  //jn->Normalize();
-
-  jn->Shuffle(true,false);
-  
-  if (restartTrainingFrom==0)
-  {
-    jn->Init();
-    //    jn->DumpToFile("WeightsInitial.w");
-  }
-  else
-  {
-    TString name("Weights");
-    name+=restartTrainingFrom;
-    name+=".w";
-
-    jn->ReadFromFile(name);
-  }
-  
-
-
-  float minimumError=1e10;
-  int epochesWithRisingError=0;
-  int epochWithMinimum=0;
-
-  int updatesPerEpoch=jn->GetUpdatesPerEpoch();
-
-  //prepare output stream
-
-  ofstream cronology("weights/trainingCronology.txt",ios_base::out);//|ios_base::app);
-  
-  cronology << "-------------SETTINGS----------------" << endl;
-  cronology << "Epochs: " << jn->GetEpochs() << std::endl;
-  cronology << "Updates Per Epoch: " << jn->GetUpdatesPerEpoch() << std::endl;
-  cronology << "Updating Procedure: " << jn->GetUpdatingProcedure() << std::endl;
-  cronology << "Error Measure: " << jn->GetErrorMeasure() << std::endl;
-  cronology << "Patterns Per Update: " << jn->GetPatternsPerUpdate() << std::endl;
-  cronology << "Learning Rate: " << jn->GetLearningRate() << std::endl;
-  cronology << "Momentum: " << jn->GetMomentum() << std::endl;
-  cronology << "Initial Weights Width: " << jn->GetInitialWeightsWidth() << std::endl;
-  cronology << "Learning Rate Decrease: " << jn->GetLearningRateDecrease() << std::endl;
-  cronology << "Activation Function: " << jn->GetActivationFunction() << std::endl;
-  cronology << "-------------LAYOUT------------------" << endl;
-  cronology << "Input variables: " << jn->GetInputDim() << endl;
-  cronology << "Output variables: " << jn->GetOutputDim() << endl;
-  cronology << "Hidden layers: " << jn->GetHiddenLayerDim() << endl;
-  cronology << "Layout : ";
-  for (Int_t s=0;s<jn->GetHiddenLayerDim()+2;++s)
-  {
-    cronology << jn->GetHiddenLayerSize(s);
-    if (s<jn->GetHiddenLayerDim()+1) cronology << "-";
-  }
-  cronology << endl;
-  cronology << "--------------HISTORY-----------------" << endl;
-  cronology << "History of iterations: " << endl;
-  cronology.close();
-
-  //prepare training histo
-  TH1F* histoTraining=new TH1F("training","training",(int)std::floor((float)nIterations/10.+0.5),1,std::floor((float)nIterations/10.+1.5));
-  TH1F* histoTesting=new TH1F("testing","testing",(int)std::floor((float)nIterations/10.+0.5),1,std::floor((float)nIterations/10.+1.5));
-
-  double maximumTrain=0;
-  double minimumTrain=1e10;
-
-  for(int epoch=restartTrainingFrom+1;epoch<=nIterations;++epoch)
-  {
-    trainingError = jn->Train();
-
-    if (epoch%10==0)
-    {
-
-      cronology.open("weights/trainingCronology.txt",ios_base::app);
-
-      testError = jn->Test();
-
-      if (trainingError>maximumTrain) maximumTrain=trainingError;
-      if (testError>maximumTrain) maximumTrain=testError;
-      if (trainingError<minimumTrain) minimumTrain=trainingError;
-      if (testError<minimumTrain) minimumTrain=testError;
-
-      
-      histoTraining->Fill(epoch/10.,trainingError);
-      histoTesting->Fill(epoch/10.,testError);
-
-      if (testError<minimumError)
-      {
-        minimumError=testError;
-        epochesWithRisingError=0;
-        epochWithMinimum=epoch;
-      }
-      else
-      {
-        epochesWithRisingError+=10;
-        if (trainingError>testError)
-        {
-          epochWithMinimum=epoch;
-        }
-      }
-      
-      
-      if (epochesWithRisingError>300)
-      {
-	if (trainingError<minimumError)
-	{
-	  cout << " End of training. Minimum already on epoch: " << epochWithMinimum << endl;
-          cronology << " End of training. Minimum already on epoch: " << epochWithMinimum << endl;
-	  break;
-	} 
-      }
-      
-      cronology << "Epoch: [" << epoch <<
-          "] Error: " << trainingError << 
-          " Test: " << testError << endl;
-
-      cout << "Epoch: [" << epoch <<
-	"] Error: " << trainingError << 
-	" Test: " << testError << endl;
-
-      cronology.close();
-      
-      TString name("weights/Weights");
-      name+=epoch;
-      name+=".root";
-
-      TFile* file=new TFile(name,"recreate");
-      TTrainedNetwork* trainedNetwork=jn->createTrainedNetwork();
-      trainedNetwork->Write();
-      file->Write();
-      file->Close();
-      delete file;
-
-      /*
-      TFile* file2=new TFile(name);
-      trainedNetwork=(TTrainedNetwork*)file2->Get("TTrainedNetwork");
-      cout <<" hid lay 1 size: " << trainedNetwork->getnHiddenLayerSize()[0] << endl;
-      file2->Close();
-      delete file2;
-      */
-
-      //      jn->DumpToFile(name);
-    }
-  }
-      
-  jn->writeNetworkInfo(1);
-  jn->writeNetworkInfo(2);
-  //  jn->writeNetworkInfo(3);
-  //  jn->writeNetworkInfo(4);
-  //  jn->writeNetworkInfo(5);
-
-
-  //  cout << " Now try to understand how to get the weights..." << endl;
-
-  ////////////WWWWWAAAAASSSSSS HERE
-  Int_t nInput=jn->GetInputDim();
-  
-  cout << " create Trained Network object..." << endl;
-  
-  TTrainedNetwork* trainedNetwork=jn->createTrainedNetwork();
-
-  cout << " now getting value with trained Network ";
-
-  
-
-
-  double inputexample[9]={norm_nVTX(1),
-			  norm_nTracksAtVtx(2),
-			  norm_nSingleTracks(0),
-			  norm_energyFraction(0.6),
-			  norm_mass(2500),
-			  norm_significance3d(4 ),
-			  norm_IP3D(3),
-			  norm_cat_pT(3),
-			  norm_cat_eta(1)};
-
-  for (Int_t i=0;i<nInput;++i)
-  {
-    jn->SetInputs(i,inputexample[i]);
-  }
-
-  cronology.open("weights/trainingCronology.txt",ios_base::app);
-
-  jn->Evaluate();
-
-  cronology << "----------------CONSISTENCY CHECK-----------" << endl;
-  cout << "Result 0:" << jn->GetOutput(0);
-  cronology << "Result 0:" << jn->GetOutput(0);
-  cout << " Result 1:" << jn->GetOutput(1);
-  cronology << "Result 0:" << jn->GetOutput(1);
-  cout << " Result 2:" << jn->GetOutput(2) << endl;
-  cronology << " Result 2:" << jn->GetOutput(2) << endl;
-
-  cout << " Reading back old network " << endl;
-  jn->readBackTrainedNetwork(trainedNetwork);
-
-  cout <<" resetting input " << endl;
-  for (Int_t i=0;i<nInput;++i)
-  {
-    jn->SetInputs(i,inputexample[i]);
-  }
-
-  jn->Evaluate();
- 
-  cout << "After reading back - Result 0:" << jn->GetOutput(0);
-  cronology << "After reading back - Result 0:" << jn->GetOutput(0);
-  // <<     " my: " << result[0] << endl;
-  cout << " After reading back - Result 1:" << jn->GetOutput(1);
-  cronology << "After reading back - Result 1:" << jn->GetOutput(1);
-  //<<     " my: " << result[1] << endl;
-  cout << " After reading back - Result 2:" << jn->GetOutput(2) << endl;
-  cronology << "After reading back - Result 2:" << jn->GetOutput(2);
-  // << " my: " << result[2] << endl;
-
-  cout << " Now getting histograms from trainingResult" << endl;
-  cronology << " Now getting histograms from trainingResult" << endl;
-
-  TNetworkToHistoTool myHistoTool;
-
-  cout << " From network to histo..." << endl;
-  std::vector<TH1*> myHistos=myHistoTool.fromTrainedNetworkToHisto(trainedNetwork);
-
-  cout << " From histo to network back..." << endl;
-  TTrainedNetwork* trainedNetwork2=myHistoTool.fromHistoToTrainedNetwork(myHistos);
-  
-  cout << " reading back " << endl;
-  jn->readBackTrainedNetwork(trainedNetwork2);
-   
-  cout <<" resetting input " << endl;
-  for (Int_t i=0;i<nInput;++i)
-  {
-    jn->SetInputs(i,inputexample[i]);
-  }
-
-  jn->Evaluate();
-
-  cout << "After reading back - Result 0:" << jn->GetOutput(0);
-  cronology << "After reading back - Result 0:" << jn->GetOutput(0);
-  // <<     " my: " << result[0] << endl;
-  cout << " After reading back - Result 1:" << jn->GetOutput(1);
-  cronology << "After reading back - Result 1:" << jn->GetOutput(1);
-  //<<     " my: " << result[1] << endl;
-  cout << " After reading back - Result 2:" << jn->GetOutput(2) << endl;
-  cronology << "After reading back - Result 2:" << jn->GetOutput(2);
-  // << " my: " << result[2] << endl;
-  
-  cout << " Directly from the trainedNetwork read back from HISTOS...!" << endl;
-
-  std::vector<Double_t> inputData;
-  for (Int_t u=0;u<nInput;++u)
-  {
-    inputData.push_back(inputexample[u]);
-  }
-
-  std::vector<Double_t> outputData=trainedNetwork2->calculateOutputValues(inputData);
-
-  cout << "After reading back - Result 0:" << outputData[0] << endl;
-  cout << " After reading back - Result 1:" << outputData[1] << endl;
-  cout << " After reading back - Result 2:" << outputData[2] << endl;
-   
-
-  
-
-
-  if (epochWithMinimum!=0)
-  {
-    cronology << "Minimum stored from Epoch: " << epochWithMinimum << endl;
-  }  else
-  {
-    cronology << "Minimum not reached" << endl;
-  }
-
-  cronology.close();
-
-  if (epochWithMinimum!=0)
-  {
-    
-      TString name("weights/Weights");
-      name+=epochWithMinimum;
-      name+=".root";
-
-      std::cout << " reading back from minimum " << endl;
-
-
-      TFile *_file0 = new TFile(name);
-      TTrainedNetwork* trainedNetwork=(TTrainedNetwork*)_file0->Get("TTrainedNetwork");
-
-      cout << " Reading back network with minimum" << endl;
-      jn->readBackTrainedNetwork(trainedNetwork);
-
-      TFile* file=new TFile("weights/weightMinimum.root","recreate");
-      trainedNetwork->Write();
-      file->Write();
-      file->Close();
-      delete file;
-
-      cout << " -------------------- " << endl;
-      cout << " Writing OUTPUT histos " << endl;
-      TFile* fileHistos=new TFile("weights/histoWeights.root","recreate");
-      TNetworkToHistoTool histoTool;
-      std::vector<TH1*> myHistos=histoTool.fromTrainedNetworkToHisto(trainedNetwork);
-      std::vector<TH1*>::const_iterator histoBegin=myHistos.begin();
-      std::vector<TH1*>::const_iterator histoEnd=myHistos.end();
-      for (std::vector<TH1*>::const_iterator histoIter=histoBegin;
-           histoIter!=histoEnd;++histoIter)
-      {
-        (*histoIter)->Write();
-      }
-      fileHistos->Write();
-      fileHistos->Close();
-      delete fileHistos;
-
-      //        " filename: " << name << endl;
-      
-    //    jn->ReadFromFile(name);
-
-  } 
-  else
-  {
-    cout << " using network at last iteration (minimum not reached..." << endl;
-  }
-  
-  //here you should create the class... Still open how to deal with this...
-  //  char* myname=const_cast<char*>(static_cast<const char*>(outputclass));
-  //  ierr=mlpsavecf_(myname);
- 
-  TFile* histoFile=new TFile("weights/trainingInfo.root","recreate");
-  histoTraining->Write();
-  histoTesting->Write();
-  histoFile->Write();
-  histoFile->Close();
-  delete histoFile;
-
-  TCanvas* trainingCanvas=new TCanvas("trainingCanvas","trainingCanvas");
-  histoTraining->SetLineColor(2);
-  histoTesting->SetLineColor(4);
-
-  histoTraining->GetYaxis()->SetRangeUser(minimumTrain,maximumTrain);
-  histoTraining->Draw("l");
-  histoTesting->Draw("lsame");
-  trainingCanvas->SaveAs("weights/trainingCurve.eps");
-
- 
-  TCanvas* mlpa_canvas = new TCanvas("jetnet_canvas","Network analysis");
-  mlpa_canvas->Divide(2,4);
-
-
-  
-//  TCanvas* mlpa_canvas_5=gDirectory->Get("mlpa_canvas_5");
-//  mlpa_canvas_5->SetLogy(kTrue);
-  gPad->SetLogy();
-
-  // Use the NN to plot the results for each sample
-  // This will give approx. the same result as DrawNetwork.
-  // All entries are used, while DrawNetwork focuses on 
-  // the test sample. Also the xaxis range is manually set.
-  TH1F *bg2 = new TH1F("bg2h", "NN output", 50, -.5, 1.5);
-  TH1F *bg = new TH1F("bgh", "NN output", 50, -.5, 1.5);
-  TH1F *sig = new TH1F("sigh", "NN output", 50, -.5, 1.5);
-
-  TH1F *bg2test = new TH1F("bg2htest", "NN output", 50, -.5, 1.5);
-  TH1F *bgtest = new TH1F("bghtest", "NN output", 50, -.5, 1.5);
-  TH1F *sigtest = new TH1F("sightest", "NN output", 50, -.5, 1.5);
-
-
-
-      
-  for (Int_t i = 0; i < simu->GetEntries(); i++) {
-    
-    if (i % 100000 == 0 ) {
-      std::cout << " First plot. Looping over event " << i << std::endl;
-    }
-    
-    if (i%dilutionFactor!=0&&i%dilutionFactor!=1) continue;
-    
-    simu->GetEntry(i);
-
-    jn->SetInputs(0, norm_nVTX(nVTX) );
-    jn->SetInputs(1, norm_nTracksAtVtx(nTracksAtVtx) );
-    jn->SetInputs(2, norm_nSingleTracks(nSingleTracks) );
-    jn->SetInputs(3, norm_energyFraction(energyFraction) );
-    jn->SetInputs(4, norm_mass(mass) );
-    jn->SetInputs(5, norm_significance3d(significance3d ) );
-    if (withIP3D)
-    {
-      jn->SetInputs(6, norm_IP3D(discriminatorIP3D) );
-      jn->SetInputs(7, norm_cat_pT(cat_pT) );
-      jn->SetInputs(8, norm_cat_eta(cat_eta) );
-    }
-    else
-    {
-      jn->SetInputs(6, norm_cat_pT(cat_pT) );
-      jn->SetInputs(7, norm_cat_eta(cat_eta) );
-    }
-
-    jn->Evaluate();
-
-    float bvalue=jn->GetOutput(0);
-    float lvalue=jn->GetOutput(2);
-
-
-
-    if (bottom==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        sig->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-      else if (i%dilutionFactor==1)
-      {
-        sigtest->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-    }
-    if (light==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        bg->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-      else if (i%dilutionFactor==1)
-      {
-        bgtest->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-    }
-    if (charm==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        bg2->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-      else  if (i%dilutionFactor==1)
-      {
-        bg2test->Fill(bvalue/(bvalue+lvalue),weight);
-      }
-    }
-  }
-
-  //now you need the maximum
-  float maximum=1;
-  for (Int_t a=0;a<bg->GetNbinsX();a++)
-  {
-    if (bg->GetBinContent(a)>maximum)
-    {
-      maximum=1.2*bg->GetBinContent(a);
-    }
-  }
-
-
-  bg2->SetLineColor(kYellow);
-  bg2->SetFillStyle(3008);   bg2->SetFillColor(kYellow);
-  bg->SetLineColor(kBlue);
-  bg->SetFillStyle(3008);   bg->SetFillColor(kBlue);
-  sig->SetLineColor(kRed);
-  sig->SetFillStyle(3003); sig->SetFillColor(kRed);
-  bg2->SetStats(0);
-  bg->SetStats(0);
-  sig->SetStats(0);
-
-
-  bg2test->SetLineColor(kYellow);
-  bg2test->SetFillStyle(3008);   bg2test->SetFillColor(kYellow);
-  bgtest->SetLineColor(kBlue);
-  bgtest->SetFillStyle(3008);   bgtest->SetFillColor(kBlue);
-  sigtest->SetLineColor(kRed);
-  sigtest->SetFillStyle(3003); sigtest->SetFillColor(kRed);
-  bg2test->SetStats(0);
-  bgtest->SetStats(0);
-  sigtest->SetStats(0);
-
- mlpa_canvas->cd(1);
- gPad->SetLogy();
-
- bg->GetYaxis()->SetRangeUser(1,maximum);
- bgtest->GetYaxis()->SetRangeUser(1,maximum);
-
- mlpa_canvas->cd(1);
- bg->Draw();
- bg2->Draw("same");
- sig->Draw("same");
-
- TLegend *legend = new TLegend(.75, .80, .95, .95);
- legend->AddEntry(bg2, "Background2 (charm)");
- legend->AddEntry(bg, "Background (light)");
- legend->AddEntry(sig, "Signal (bottom)");
- legend->Draw();
- 
- mlpa_canvas->cd(2);
- gPad->SetLogy();
-
- bgtest->Draw();
- bg2test->Draw("same");
- sigtest->Draw("same");
-
- TLegend *legendtest = new TLegend(.75, .80, .95, .95);
- legendtest->AddEntry(bg2test, "Background2 (charm)");
- legendtest->AddEntry(bgtest, "Background (light)");
- legendtest->AddEntry(sigtest, "Signal (bottom)");
- legendtest->Draw();
-
- mlpa_canvas->cd(5);
- gPad->SetLogy();
- bg->DrawNormalized();
- bg2->DrawNormalized("same");
- sig->DrawNormalized("same");
- legend->Draw();
- 
- mlpa_canvas->cd(6);
- gPad->SetLogy();
- bgtest->DrawNormalized();
- bg2test->DrawNormalized("same");
- sigtest->DrawNormalized("same");
- legendtest->Draw();
-
-
- 
- mlpa_canvas->cd(3);
- gPad->SetLogy();
- 
- // Use the NN to plot the results for each sample
- // This will give approx. the same result as DrawNetwork.
- // All entries are used, while DrawNetwork focuses on 
- // the test sample. Also the xaxis range is manually set.
- TH1F *c_bg2 = new TH1F("c_bg2h", "NN output", 50, -.5, 1.5);
- TH1F *c_bg = new TH1F("c_bgh", "NN output", 50, -.5, 1.5);
- TH1F *c_sig = new TH1F("c_sigh", "NN output", 50, -.5, 1.5);
-
- TH1F *c_bg2test = new TH1F("c_bg2htest", "NN output", 50, -.5, 1.5);
- TH1F *c_bgtest = new TH1F("c_bghtest", "NN output", 50, -.5, 1.5);
- TH1F *c_sigtest = new TH1F("c_sightest", "NN output", 50, -.5, 1.5);
-
- for (Int_t i = 0; i < simu->GetEntries(); i++) {
-   
-   if (i % 100000 == 0 ) {
-     std::cout << " Second plot. Looping over event " << i << std::endl;
-   }
-   
-   if (i%dilutionFactor!=0&&i%dilutionFactor!=1) continue;
-   
-   simu->GetEntry(i);
-
-    jn->SetInputs(0, norm_nVTX(nVTX) );
-    jn->SetInputs(1, norm_nTracksAtVtx(nTracksAtVtx) );
-    jn->SetInputs(2, norm_nSingleTracks(nSingleTracks) );
-    jn->SetInputs(3, norm_energyFraction(energyFraction) );
-    jn->SetInputs(4, norm_mass(mass) );
-    jn->SetInputs(5, norm_significance3d(significance3d ) );
-    if (withIP3D)
-    {
-      jn->SetInputs(6, norm_IP3D(discriminatorIP3D) );
-      jn->SetInputs(7, norm_cat_pT(cat_pT) );
-      jn->SetInputs(8, norm_cat_eta(cat_eta) );
-    }
-    else
-    {
-      jn->SetInputs(6, norm_cat_pT(cat_pT) );
-      jn->SetInputs(7, norm_cat_eta(cat_eta) );
-    }
-
-    jn->Evaluate();
-
-   float bvalue=jn->GetOutput(0);
-   float cvalue=jn->GetOutput(1);
-
-    if (bottom==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        c_sig->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-      else if (i%dilutionFactor==1)
-      {
-        c_sigtest->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-    }
-    if (light==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        c_bg->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-      else if (i%dilutionFactor==1)
-      {
-        c_bgtest->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-    }
-    if (charm==1)
-    {
-      if (i%dilutionFactor==0)
-      {
-        c_bg2->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-      else  if (i%dilutionFactor==1)
-      {
-        c_bg2test->Fill(bvalue/(bvalue+cvalue),weight);
-      }
-    }
-   }
-
-  //now you need the maximum
- maximum=1;
-  for (Int_t a=0;a<c_bg->GetNbinsX();a++)
-  {
-    if (c_bg->GetBinContent(a)>maximum)
-    {
-      maximum=1.2*c_bg->GetBinContent(a);
-    }
-  }
-
-   c_bg2->SetLineColor(kYellow);
-   c_bg2->SetFillStyle(3008);   c_bg2->SetFillColor(kYellow);
-   c_bg->SetLineColor(kBlue);
-   c_bg->SetFillStyle(3008);   c_bg->SetFillColor(kBlue);
-   c_sig->SetLineColor(kRed);
-   c_sig->SetFillStyle(3003); c_sig->SetFillColor(kRed);
-   c_bg2->SetStats(0);
-   c_bg->SetStats(0);
-   c_sig->SetStats(0);
- 
-   c_bg2test->SetLineColor(kYellow);
-   c_bg2test->SetFillStyle(3008);   c_bg2test->SetFillColor(kYellow);
-   c_bgtest->SetLineColor(kBlue);
-   c_bgtest->SetFillStyle(3008);   c_bgtest->SetFillColor(kBlue);
-   c_sigtest->SetLineColor(kRed);
-   c_sigtest->SetFillStyle(3003); c_sigtest->SetFillColor(kRed);
-   c_bg2test->SetStats(0);
-   c_bgtest->SetStats(0);
-   c_sigtest->SetStats(0);
-
-   mlpa_canvas->cd(3);
-   gPad->SetLogy();
-
-
-   c_bg->GetYaxis()->SetRangeUser(1,maximum);
-   c_bgtest->GetYaxis()->SetRangeUser(1,maximum);
-   
-   c_bg->Draw();
-   c_bg2->Draw("same");
-   c_sig->Draw("same");
-
-   TLegend *legend2 = new TLegend(.75, .80, .95, .95);
-   legend2->AddEntry(c_bg2, "Background2 (charm)");
-   legend2->AddEntry(c_bg, "Background (light)");
-   legend2->AddEntry(c_sig, "Signal (bottom)");
-   legend2->Draw();
-
-   mlpa_canvas->cd(4);
-   gPad->SetLogy();
-   
-   c_bgtest->Draw();
-   c_bg2test->Draw("same");
-   c_sigtest->Draw("same");
-
-   TLegend *legend2test = new TLegend(.75, .80, .95, .95);
-   legend2test->AddEntry(c_bg2test, "Background2 (charm)");
-   legend2test->AddEntry(c_bgtest, "Background (light)");
-   legend2test->AddEntry(c_sigtest, "Signal (bottom)");
-   legend2test->Draw();
-
-   mlpa_canvas->cd(7);
-   gPad->SetLogy();
-   c_bg->DrawNormalized();
-   c_bg2->DrawNormalized("same");
-   c_sig->DrawNormalized("same");
-   legend2->Draw();
- 
-   mlpa_canvas->cd(8);
-   gPad->SetLogy();
-   c_bgtest->DrawNormalized();
-   c_bg2test->DrawNormalized("same");
-   c_sigtest->DrawNormalized("same");
-   legend2test->Draw();
-
-
-   mlpa_canvas->cd(0);
-
-   mlpa_canvas->SaveAs("weights/result.eps");
-}
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createAllHistograms.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createAllHistograms.cxx
deleted file mode 100644
index 481281757ab9..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createAllHistograms.cxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "createTheHistograms.h"
-#include "../preparedatasets/collectionsToProcess.h"
-#include <TString.h>
-#include <vector>
-#include <iostream>
-
-using namespace std;
-
-void createAllHistograms()
-{
-
-  vector<TString> collectionsToProcess=getCollectionsToProcess();
-
-  
-  vector<TString>::const_iterator collectionsToProcessBegin=collectionsToProcess.begin();
-  vector<TString>::const_iterator collectionsToProcessEnd=collectionsToProcess.end();
-  
-  for (vector<TString>::const_iterator collectionsToProcessIter=++(collectionsToProcessBegin++);
-       collectionsToProcessIter!=collectionsToProcessEnd;
-       ++collectionsToProcessIter) 
-  {  
-
-    cout << " Processing : " << *collectionsToProcessIter << endl;
-
-    createTheHistograms(5,*collectionsToProcessIter);    
-    createTheHistograms(1,*collectionsToProcessIter);
-    createTheHistograms(4,*collectionsToProcessIter);
-
-    
-  }
-  
-  
-}
-
-void createAllHistograms(int number, int flavour)
-{
-
-
-
-  vector<TString> collectionsToProcess=getCollectionsToProcess();
-  if (number>collectionsToProcess.size()-1)
-  {
-    cout << " number to process: " << number << " not existent " << endl;
-    return;
-  }
-  
-  
-    cout << " Processing : " << collectionsToProcess[number] << endl;
-    
-    createTheHistograms(flavour,collectionsToProcess[number]);
-    
-}
-  
-
-    
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.cxx
deleted file mode 100644
index 50231c43dd4b..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.cxx
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "createTheHistograms.h"
-
-#include <RooCategory.h>
-#include <RooMappedCategory.h>
-#include <RooRealVar.h>
-#include <RooThresholdCategory.h>
-#include <RooFormulaVar.h>
-#include <RooArgList.h>
-#include <RooProdPdf.h>
-#include <RooAddPdf.h>
-#include <RooSuperCategory.h>
-#include <RooMappedCategory.h>
-#include <RooSimultaneous.h>
-#include <RooArgSet.h>
-#include <RooParametricStepFunction.h>
-#include <RooDataHist.h>
-#include <RooDataSet.h>
-#include <RooHistPdf.h>
-#include <RooNDKeysPdf.h>
-#include <RooBinning.h>
-#include <RooCmdArg.h>
-#include <RooGlobalFunc.h>
-#include <Roo1DTable.h>
-#include <RooPlot.h>
-
-#include <TH1.h>
-#include <TFile.h>
-#include <TTree.h>
-#include <TMath.h>
-#include <TCanvas.h>
-
-using namespace RooFit;
-using namespace std;
-
-TH1F* makeHisto(RooNDKeysPdf* myKeysPdf,const char* name,int numtot,double begin,double end,RooRealVar* dep) {
-
-  TH1F* newhisto=new TH1F(name,name,numtot,begin,end);
-
-  int nbins=newhisto->GetNbinsX();
-
-  for (int ss=1;ss<nbins+1;++ss) {
-    double center=newhisto->GetBinCenter(ss);
-    double width=newhisto->GetBinWidth(ss);
-//    std::cout << "Center is " << center << std::endl;
-    dep->setRange("selection",center-width/2.,center+width/2.) ;
-    RooAbsReal* fracInt = myKeysPdf->createIntegral(*dep,RooFit::Range("selection")) ;
-//    std::cout << " Evaluated to " << fracInt->getVal() << std::endl;
-    newhisto->Fill(center,fracInt->getVal());
-    delete fracInt;
-  }
-  return newhisto;
-}
-//RooAbsPdf* createTheFit() {
-void createTheHistograms(
-                         TString collectionName,
-                         int flavourType)
-{
-
-  TString flavourString;
-
-  if (flavourType==5)
-  {
-    flavourString=TString("bottom");
-  }
-  if (flavourType==4)
-  {
-    flavourString=TString("charm");
-  }
-  if (flavourType==1)
-  {
-    flavourString=TString("light");
-  }
-
-  TString identificationFile("../trainingResultsLikelihood/plots/");
-  identificationFile+=collectionName;
-  identificationFile+="_";
-  identificationFile+=flavourString;
-
-  RooCategory *cat_flavour=new RooCategory("cat_flavour","jet flavour");
-  cat_flavour->defineType("b",5);
-  cat_flavour->defineType("c",4);
-  cat_flavour->defineType("l",1);
-  
-
-  RooCategory *cat_nVTX=new RooCategory("nVTX","number of vertices category");
-  cat_nVTX->defineType("NoVTX",0);
-  cat_nVTX->defineType("1VTX",1);
-  cat_nVTX->defineType("2VTX",2);
-  cat_nVTX->defineType("3VTX",3);
-  cat_nVTX->defineType("4VTX",4);
-  cat_nVTX->defineType("5VTX",5);//I hope not to need more!!!
-
-  RooCategory* cat_nTracksAtVtx=new RooCategory("nTracksAtVtx","number of tracks at Vertices");
-  cat_nTracksAtVtx->defineType("NoTrackVTX",0);
-  cat_nTracksAtVtx->defineType("2TrackVTX",2);
-  cat_nTracksAtVtx->defineType("3TrackVTX",3);
-  cat_nTracksAtVtx->defineType("4TrackVTX",4);
-  cat_nTracksAtVtx->defineType("5TrackVTX",5);
-  cat_nTracksAtVtx->defineType("6TrackVTX",6);
-  cat_nTracksAtVtx->defineType("7TrackVTX",7);
-  cat_nTracksAtVtx->defineType("8TrackVTX",8);
-  cat_nTracksAtVtx->defineType("9TrackVTX",9);
-  cat_nTracksAtVtx->defineType("10TrackVTX",10);
-  cat_nTracksAtVtx->defineType("11TrackVTX",11);
-  cat_nTracksAtVtx->defineType("12TrackVTX",12);
-  cat_nTracksAtVtx->defineType("13TrackVTX",13);
-  cat_nTracksAtVtx->defineType("14TrackVTX",14);
-  cat_nTracksAtVtx->defineType("15TrackVTX",15);
-
-
-  RooCategory* cat_nSingleTracks=new RooCategory("nSingleTracks","number of single significant tracks");
-  cat_nSingleTracks->defineType("NoSingleTrack",0);
-  cat_nSingleTracks->defineType("1SingleTrack",1);
-  cat_nSingleTracks->defineType("2SingleTrack",2);
-  cat_nSingleTracks->defineType("3SingleTrack",3);
-  cat_nSingleTracks->defineType("4SingleTrack",4);
-  cat_nSingleTracks->defineType("5SingleTrack",5);
-  cat_nSingleTracks->defineType("6SingleTrack",6);
-  cat_nSingleTracks->defineType("7SingleTrack",7);
-  
-  RooMappedCategory* mycat_nVTX=new RooMappedCategory("mycat_nVTX","number of vertices categories",*cat_nVTX);//,"Undefined");
-  mycat_nVTX->map("NoVTX","NoVTX");
-  mycat_nVTX->map("1VTX","1VTX");
-  mycat_nVTX->map("2VTX","2orMoreVTX");
-  mycat_nVTX->map("3VTX","2orMoreVTX");
-  mycat_nVTX->map("4VTX","2orMoreVTX");
-  mycat_nVTX->map("5VTX","2orMoreVTX");
-  
-
-  RooMappedCategory* mycat_nTracksAtVtx6Bin=
-    new RooMappedCategory("mycat_nTracksAtVtx6Bin","number of tracks at vertices category",*cat_nTracksAtVtx);//,"Undefined");
-  mycat_nTracksAtVtx6Bin->map("NoTrackVTX","NoTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("2TrackVTX","2TrackVTX");
-  mycat_nTracksAtVtx6Bin->map("3TrackVTX","3TrackVTX");
-  mycat_nTracksAtVtx6Bin->map("4TrackVTX","4TrackVTX");
-  mycat_nTracksAtVtx6Bin->map("5TrackVTX","5or6TrackVTX");
-  mycat_nTracksAtVtx6Bin->map("6TrackVTX","5or6TrackVTX");
-  mycat_nTracksAtVtx6Bin->map("7TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("8TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("9TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("10TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("11TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("12TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("13TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("14TrackVTX","7orMoreTrackVTX");
-  mycat_nTracksAtVtx6Bin->map("15TrackVTX","7orMoreTrackVTX");
-
-   RooMappedCategory* mycat_nTracksAtVtx4Bin=
-     new RooMappedCategory("mycat_nTracksAtVtx4Bin","number of tracks at vertices category",*cat_nTracksAtVtx);//,"Undefined");
-  mycat_nTracksAtVtx4Bin->map("NoTrackVTX","NoTrackVTX");
-  //mycat_nTracksAtVtx4Bin->map("NoTrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("2TrackVTX","2TrackVTX");
-  mycat_nTracksAtVtx4Bin->map("3TrackVTX","3TrackVTX");
-  mycat_nTracksAtVtx4Bin->map("4TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("5TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("6TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("7TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("8TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("9TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("10TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("11TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("12TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("13TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("14TrackVTX","4orMoreTrackVTX");
-  mycat_nTracksAtVtx4Bin->map("15TrackVTX","4orMoreTrackVTX");
-
-  RooMappedCategory* mycat_nTracksAtVtx3Bin=
-    new RooMappedCategory("mycat_nTracksAtVtx3Bin","number of tracks at vertices category",*cat_nTracksAtVtx);//,"Undefined");
-  mycat_nTracksAtVtx3Bin->map("NoTrackVTX","NoTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("2TrackVTX","2TrackVTX");
-  mycat_nTracksAtVtx3Bin->map("3TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("4TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("5TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("6TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("7TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("8TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("9TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("10TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("11TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("12TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("13TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("14TrackVTX","3orMoreTrackVTX");
-  mycat_nTracksAtVtx3Bin->map("15TrackVTX","3orMoreTrackVTX");
-
-
-  RooMappedCategory* mycat_nSingleTracks=
-    new RooMappedCategory("mycat_nSingleTracks","number of single significant tracks category",*cat_nSingleTracks);//,"Undefined");
-  mycat_nSingleTracks->map("NoSingleTrack","NoSingleTrack");
-  mycat_nSingleTracks->map("1SingleTrack","1SingleTrack");
-  mycat_nSingleTracks->map("2SingleTrack","2SingleTrack");
-  mycat_nSingleTracks->map("3SingleTrack","3orMoreSingleTrack");
-  mycat_nSingleTracks->map("4SingleTrack","3orMoreSingleTrack");
-  mycat_nSingleTracks->map("5SingleTrack","3orMoreSingleTrack");
-  mycat_nSingleTracks->map("6SingleTrack","3orMoreSingleTrack");
-  mycat_nSingleTracks->map("7SingleTrack","3orMoreSingleTrack");
-
-  /*
-  RooMappedCategory* mycat_nSingleTracksMain=
-    new RooMappedCategoryMain("mycat_nSingleTracksMain","number of single significant tracks category only two bins",*cat_nSingleTracks,"Undefined");
-  mycat_nSingleTracks->map("NoSingleTrack","NoSingleTrack");
-  mycat_nSingleTracks->map("1SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("2SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("3SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("4SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("5SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("6SingleTrack","1orMoreSingleTrack");
-  mycat_nSingleTracks->map("7SingleTrack","1orMoreSingleTrack");
-  */
-  
-  RooRealVar *energyFraction=new RooRealVar("energyFraction","energyFraction",0.5,0.,1.00001);
-  RooRealVar *significance3d=new RooRealVar("significance3d","significance3d",5.,0.,100.);
-  RooRealVar *mass=new RooRealVar("mass","mass",2000.,0.,10000.);
-  //  RooRealVar* nVTX=new RooRealVar("nVTX","nVTX",1,-0.5,5.5);
-  RooRealVar* nTracksAtVtx=new RooRealVar("nTracksAtVtx2","nTracksAtVtx2",2,-0.5,15.5);
-  RooRealVar* nSingleTracks=new RooRealVar("nSingleTracks2","nSingleTracks2",0,-0.5,7.5);
-
-  RooThresholdCategory* energyFractionCat=new RooThresholdCategory("energyFractionCat","energyFractionCat",
-								   *energyFraction,"NoFrag");
-  energyFractionCat->addThreshold(0.999,"Normal");
-
-
-
-  Double_t significance3d_bins[50];
-
-  for (int jj=0;jj<49;jj++) {
-//    std::cout << " bin " << jj << std::endl;
-    significance3d_bins[jj]=((Double_t)jj)*(40./48.);
-//    std::cout << " significance 3d " << significance3d_bins[jj] << std::endl;
-  }
-  significance3d_bins[49]=1000.;
-    
-  std::cout << " before roobinning " << std::endl;
-  RooBinning* significance3d_binning=new RooBinning(49,significance3d_bins,"significance3d_binning");
-  significance3d_binning->Print("v");
-  
-  Double_t mass_bins[50];
-  
-  for (int ss=0;ss<49;ss++) {
-    mass_bins[ss]=((Double_t)ss)*(5000./48);
-//    std::cout << " mass " << mass_bins[ss] << std::endl;
-
-  }
-  mass_bins[49]=20000.;
-    
-  RooBinning* mass_binning=new RooBinning(49,mass_bins,"mass_binning");
-  mass_binning->Print("v");
-
-  Double_t energyFraction_bins[50];
-  
-  for (int ii=0;ii<49;ii++) {
-    energyFraction_bins[ii]=(Double_t(ii))*(1./48);
-//    std::cout << " energyFraction " << energyFraction_bins[ii] << std::endl;
-  }
-  energyFraction_bins[49]=1.000001;
-    
-  RooBinning* energyFraction_binning=new RooBinning(49,energyFraction_bins,"energyFraction_binning");
-  energyFraction_binning->Print("v");
-
-  
-//  std::cout << " here " << std::endl;
-  
-  TString fileName("../../../reduceddatasets/reduceddataset_");
-  fileName+=collectionName;
-  fileName+=".root";
-  
-  TFile *file=new TFile(fileName);
-  TTree* tree=(TTree*)file->Get("SVTree");
-
-  TString outputFileName("../trainingResultsLikelihood/smoothedhistos_");
-  outputFileName+=collectionName;
-  outputFileName+="_";
-  outputFileName+=flavourString;
-  outputFileName+=".root";
-  TFile *filehistos=new TFile(outputFileName,"recreate");
-
-  TString eventListString("cat_flavour==");
-  eventListString+=flavourType;
-  
-
-  tree->Draw(">>eventlist",eventListString);
-  
-//  TEventList* eventlist=(TEventList*)gDirectory->Get("eventlist");
-  
-//  tree->SetEventList(eventlist);
-
-
-  //  mass->setBinning(*mass_binning);
-  //  energyFraction->setBinning(*energyFraction_binning);
-  //  significance3d->setBinning(*significance3d_binning);
-
-
-  mass->Print("v");
-  energyFraction->Print("v");
-  significance3d->Print("v");
-
-  RooArgSet before(*cat_nVTX,*cat_nTracksAtVtx,
-                   *cat_nSingleTracks,*energyFraction,
-                   *mass,*significance3d,*cat_flavour);
-  
-
-  before.add(*cat_flavour);
-
-  
-  before.Print("v");
-  cout << "  Reading in dataset " << endl;
-
-  TString set("MC");
-  set+=collectionName;
-  if (flavourType==1)
-  {
-    set+="1";
-  }
-  else if (flavourType==4)
-  {
-    set+="4";
-  }
-  else if (flavourType==5)
-  {
-    set+="5";
-  }
-  
-  
-
-  RooDataSet* dataset2=new RooDataSet(set,set,before);
-
-
-  int var_nVTX;
-  int var_nTracksAtVtx;
-  int var_nSingleTracks;
-  double var_energyFraction;
-  double var_mass;
-  double var_significance3d;
-  int var_cat_flavour;
-
-  tree->SetBranchAddress("nVTX",&var_nVTX);
-  tree->SetBranchAddress("nTracksAtVtx",&var_nTracksAtVtx);
-  tree->SetBranchAddress("nSingleTracks",&var_nSingleTracks);
-  tree->SetBranchAddress("energyFraction",&var_energyFraction);
-  tree->SetBranchAddress("mass",&var_mass);
-  tree->SetBranchAddress("significance3d",&var_significance3d);
-  tree->SetBranchAddress("cat_flavour",&var_cat_flavour);
-  
-  for (int i=0;i<tree->GetEntries();i++)
-  {
-    tree->GetEntry(i);
-
-
-    cat_nVTX->setIndex(var_nVTX);
-    cat_nTracksAtVtx->setIndex(var_nTracksAtVtx);
-    cat_nSingleTracks->setIndex(var_nSingleTracks);
-    energyFraction->setVal(var_energyFraction);
-    mass->setVal(var_mass);
-    significance3d->setVal(var_significance3d);
-    cat_flavour->setIndex(var_cat_flavour);
-  
-    dataset2->add(RooArgSet(*cat_nVTX,
-                            *cat_nTracksAtVtx,
-                            *cat_nSingleTracks,
-                            *energyFraction,
-                            *mass,
-                            *significance3d,
-                            *cat_flavour));
-
-  }
-
-
-
-//  RooDataSet* dataset2=new RooDataSet("MC","MC",tree,before);
-  cout << "  Reading in dataset FINISHED " << endl;
-  
-  RooDataSet* dataset=(RooDataSet*)dataset2->reduce(eventListString);
-
-  dataset->addColumn(*energyFractionCat);
-  dataset->addColumn(*mycat_nVTX);
-  dataset->addColumn(*mycat_nSingleTracks);
-  dataset->addColumn(*mycat_nTracksAtVtx3Bin);
-  dataset->addColumn(*mycat_nTracksAtVtx4Bin);
-  dataset->addColumn(*mycat_nTracksAtVtx6Bin);
-  
-  const RooArgSet* obsindata2  = dataset->get(0);
-  RooCategory* cat_energyFractionCat = static_cast<RooCategory*>(obsindata2->find("energyFractionCat"));
-
-
-  /*
-  RooDataHist* datahist=new RooDataHist("MC_binned","MC_binned",RooArgSet(*cat_nVTX,*cat_nTracksAtVtx,
-									  *cat_nSingleTracks,*energyFraction,
-									  *mass,*significance3d),*dataset);
-  datahist->Print("v");
-  cout << " datahist created " << endl;
-
-  
-  datahist->addColumn(*mycat_nVTX);
-  //  datahist->addColumn(*mycat_nSingleTracks);
-  //  datahist->addColumn(*mycat_nTracksAtVtx3Bin);
-  //  datahist->addColumn(*mycat_nTracksAtVtx4Bin);
-  datahist->addColumn(*mycat_nTracksAtVtx6Bin);
-
-  //  datahist->Print("v");
-
-  cout << "datahist created DONE" << endl;
-  */
-  //jetzt die PDF...
-  
-  dataset->Print("v");
-
-  dataset->table(*mycat_nVTX)->Print();
-  dataset->table(*mycat_nSingleTracks)->Print();
-  dataset->table(*mycat_nTracksAtVtx3Bin)->Print();
-  dataset->table(*mycat_nTracksAtVtx4Bin)->Print();
-
-  
-  RooRealVar* bottom_coef=new RooRealVar(flavourString+"_coef","bottom jet component",100000.,0.,1000000.);
-  //  RooRealVar* light_coef=new RooRealVar("light_coef","light jet component",0.2,0.,1.);
-  //  RooFormulaVar* charm_coef=new RooFormulaVar("charm_coef","charm jet component","1.-@0-@1",RooArgList(*light_coef,*bottom_coef));
-
-  //////NNNNNNOOOOOOOOOWWWWWWWW    BBBBBBOOOOOOOOTTTTTTTTOOOOOOOOMMMMMMMMM
-
-  RooRealVar* bottom_e_NoVTX=new RooRealVar(flavourString+"_e_NoVTX","no vertex coefficient",0.2,0.,1.);
-  RooRealVar* bottom_e_1VTX=new RooRealVar(flavourString+"_e_1VTX","1 vertex coefficient",0.2,0.,1.);
-  //RooFormulaVar* bottom_e_2orMoreVTX=new RooFormulaVar(flavourString+"_e_2orMoreVTX","2 vertex coefficient","1.-@0-@1",RooArgList(*bottom_e_NoVTX,*bottom_e_1VTX));
-  RooFormulaVar* bottom_e_2orMoreVTX=new RooFormulaVar(flavourString+"_e_2orMoreVTX","2 vertex coefficient","1.-@0-@1",RooArgList(*bottom_e_NoVTX,
-															  *bottom_e_1VTX));
-  
-
-  RooRealVar* bottom_e_1VTX_2TrackVTX=new RooRealVar(flavourString+"_e_1VTX_2TrackVTX",
-						     flavourString+"_e_1VTX_2TrackVTX",0.2,0.,1.);
-  RooRealVar* bottom_e_1VTX_3TrackVTX=new RooRealVar(flavourString+"_e_1VTX_3TrackVTX",
-						     flavourString+"_e_1VTX_3TrackVTX",0.2,0.,1.);
-  RooRealVar* bottom_e_1VTX_4TrackVTX=new RooRealVar(flavourString+"_e_1VTX_4TrackVTX",
-						     flavourString+"_e_1VTX_4TrackVTX",0.2,0.,1.);
-  RooRealVar* bottom_e_1VTX_5or6TrackVTX=new RooRealVar(flavourString+"_e_1VTX_5or6TrackVTX",
-							flavourString+"_e_1VTX_5or6TrackVTX",0.2,0.,1.);
-  RooFormulaVar* bottom_e_1VTX_7orMoreTrackVTX =new RooFormulaVar(flavourString+"_e_1VTX_7orMoreTrackVTX",
-								  flavourString+"_e_1VTX_7orMoreTrackVTX",
-								  "1.-@0-@1-@2-@3",RooArgList(*bottom_e_1VTX_2TrackVTX,
-											      *bottom_e_1VTX_3TrackVTX,
-											      *bottom_e_1VTX_4TrackVTX,
-											      *bottom_e_1VTX_5or6TrackVTX));
-
-
-   RooRealVar* bottom_e_1Vtx_NoSingleTrack=new RooRealVar(flavourString+"_e_1Vtx_NoSingleTrack",
-							  flavourString+"_e_1Vtx_NoSingleTrack",
-							  0.4,0.,1.);
-   RooRealVar* bottom_e_1Vtx_1SingleTrack=new RooRealVar(flavourString+"_e_1Vtx_1SingleTrack",
-							  flavourString+"_e_1Vtx_1SingleTrack",
-							  0.4,0.,1.);
-   RooFormulaVar* bottom_e_1Vtx_2orMoreSingleTrack=new RooFormulaVar(flavourString+"_e_1Vtx_2orMoreSingleTrack",
-								     flavourString+"_e_1Vtx_2orMoreSingleTrack",
-								     "1.-@0-@1",RooArgList(*bottom_e_1Vtx_NoSingleTrack,
-											   *bottom_e_1Vtx_1SingleTrack));
-     
-
-   RooRealVar* bottom_e_2orMoreVTX_4TrackVTX=new RooRealVar(flavourString+"_e_2orMoreVTX_4TrackVTX",
-							    flavourString+"_e_2orMoreVTX_4TrackVTX",0.2,0.,1.);
-   RooFormulaVar* bottom_e_2orMoreVTX_5orMoreTrackVTX=new RooFormulaVar(flavourString+"_e_2orMoreVTX_5orMoreTrackVTX",
-								       flavourString+"_e_2orMoreVTX_5orMoreTrackVTX",
-								       "1.-@0",RooArgList(*bottom_e_2orMoreVTX_4TrackVTX));
-
-
-   //energyFraction normal...
-
-   RooRealVar* bottom_e_NoVtx_1SingleTrack_energyFraction_normal=new RooRealVar(flavourString+"_e_NoVtx_1SingleTrack_energyFraction_normal",
-										flavourString+"_e_NoVtx_1SingleTrack_energyFraction_normal",
-										0.8,0.,1.);
-  
-
-  
-   RooFormulaVar* bottom_e_NoVtx_1SingleTrack_energyFraction_nofrag=new RooFormulaVar(flavourString+"_e_NoVtx_1SingleTrack_energyFraction_nofrag",
-										      flavourString+"_e_NoVtx_1SingleTrack_energyFraction_nofrag",
-										      "1.-@0",RooArgList(*bottom_e_NoVtx_1SingleTrack_energyFraction_normal));
-  
-  
-   RooRealVar* bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_normal=new RooRealVar(flavourString+"_e_NoVtx_2orMoreSingleTrack_energyFraction_normal",
-										      flavourString+"_e_NoVtx_2orMoreSingleTrack_energyFraction_normal",
-										      0.8,0.,1.);
-  
-  
-  
-   RooFormulaVar* bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_nofrag=new RooFormulaVar(flavourString+"_e_NoVtx_2orMoreSingleTrack_energyFraction_nofrag",
-											    flavourString+"_e_NoVtx_2orMoreSingleTrack_energyFraction_nofrag",
-											    "1-@0",RooArgList(*bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_normal));
-
-
-   RooRealVar* bottom_e_1orMoreVTX_2TrackVTX_energyFraction_normal=new RooRealVar(flavourString+"_e_1orMoreVTX_2TrackVTX_energyFraction_normal",
-										  flavourString+"_e_1orMoreVTX_2TrackVTX_energyFraction_normal",
-										  0.8,0.,1.);
-  
-  
-  
-  RooFormulaVar* bottom_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag=new RooFormulaVar(flavourString+"_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag",
-										       flavourString+"_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag",
-										       "1-@0",RooArgList(*bottom_e_1orMoreVTX_2TrackVTX_energyFraction_normal));
-  
-  
-  RooRealVar* bottom_e_1orMoreVTX_3TrackVTX_energyFraction_normal=new RooRealVar(flavourString+"_e_1orMoreVTX_3TrackVTX_energyFraction_normal",
-										 flavourString+"_e_1orMoreVTX_3TrackVTX_energyFraction_normal",
-										 0.8,0.,1.);
-  
-  
-  
-  RooFormulaVar* bottom_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag=new RooFormulaVar(flavourString+"_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag",
-										       flavourString+"_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag",
-										       "1-@0",RooArgList(*bottom_e_1orMoreVTX_3TrackVTX_energyFraction_normal));
-  
-  RooRealVar* bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal=new RooRealVar(flavourString+"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal",
-										       flavourString+"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal",
-										       0.8,0.,1.);
-  
-  RooFormulaVar* bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag=new RooFormulaVar(flavourString+"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag",
-											     flavourString+"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag",
-											     "1-@0",RooArgList(*bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-
-
-  //0ST
-
-  RooFormulaVar* bottom_1VTX_0ST_2VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_2VTX_normal",
-								    flavourString+"_1VTX_0ST_2VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_2TrackVTX,
-												*bottom_e_1orMoreVTX_2TrackVTX_energyFraction_normal));
-
-
-  RooFormulaVar* bottom_1VTX_0ST_3VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_3VTX_normal",
-								    flavourString+"_1VTX_0ST_3VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_3TrackVTX,
-												*bottom_e_1orMoreVTX_3TrackVTX_energyFraction_normal));
-
-  RooFormulaVar* bottom_1VTX_0ST_4VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_4VTX_normal",
-								    flavourString+"_1VTX_0ST_4VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_4TrackVTX,
-												*bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-
-  RooFormulaVar* bottom_1VTX_0ST_5or6VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_5or6VTX_normal",
-								       flavourString+"_1VTX_0ST_5or6VTX_normal",
-								       "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												   *bottom_e_1VTX,
-												   *bottom_e_1Vtx_NoSingleTrack,
-												   *bottom_e_1VTX_5or6TrackVTX,
-												   *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-
-  RooFormulaVar* bottom_1VTX_0ST_7orMoreVTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_7orMoreVTX_normal",
-									  flavourString+"_1VTX_0ST_7orMoreVTX_normal",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_NoSingleTrack,
-												      *bottom_e_1VTX_7orMoreTrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  //1ST
-  
-  RooFormulaVar* bottom_1VTX_1ST_2VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_2VTX_normal",
-								    flavourString+"_1VTX_1ST_2VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_2TrackVTX,
-												*bottom_e_1orMoreVTX_2TrackVTX_energyFraction_normal));
-  
-  
-  RooFormulaVar* bottom_1VTX_1ST_3VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_3VTX_normal",
-								    flavourString+"_1VTX_1ST_3VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_3TrackVTX,
-												*bottom_e_1orMoreVTX_3TrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_1VTX_1ST_4VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_4VTX_normal",
-								    flavourString+"_1VTX_1ST_4VTX_normal",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_4TrackVTX,
-												*bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_1VTX_1ST_5or6VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_5or6VTX_normal",
-								       flavourString+"_1VTX_1ST_5or6VTX_normal",
-								       "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												   *bottom_e_1VTX,
-												   *bottom_e_1Vtx_1SingleTrack,
-												   *bottom_e_1VTX_5or6TrackVTX,
-												   *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_1VTX_1ST_7orMoreVTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_7orMoreVTX_normal",
-									  flavourString+"_1VTX_1ST_7orMoreVTX_normal",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_1SingleTrack,
-												      *bottom_e_1VTX_7orMoreTrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  
-  //2orMoreST
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_2VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_2VTX_normal",
-									  flavourString+"_1VTX_2orMoreST_2VTX_normal",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_2TrackVTX,
-												      *bottom_e_1orMoreVTX_2TrackVTX_energyFraction_normal));
-  
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_3VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_3VTX_normal",
-									  flavourString+"_1VTX_2orMoreST_3VTX_normal",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_3TrackVTX,
-												      *bottom_e_1orMoreVTX_3TrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_4VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_4VTX_normal",
-									  flavourString+"_1VTX_2orMoreST_4VTX_normal",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_4TrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-
-  RooFormulaVar* bottom_1VTX_2orMoreST_5or6VTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_5or6VTX_normal",
-									     flavourString+"_1VTX_2orMoreST_5or6VTX_normal",
-									     "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-													 *bottom_e_1VTX,
-													 *bottom_e_1Vtx_2orMoreSingleTrack,
-													 *bottom_e_1VTX_5or6TrackVTX,
-													 *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_7orMoreVTX_normal_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_7orMoreVTX_normal",
-										flavourString+"_1VTX_2orMoreST_7orMoreVTX_normal",
-										"@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-													    *bottom_e_1VTX,
-													    *bottom_e_1Vtx_2orMoreSingleTrack,
-													    *bottom_e_1VTX_7orMoreTrackVTX,
-													    *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-
-  
-  //2orMoreVTX
-  
-  RooFormulaVar* bottom_2orMoreVTX_4VTX_normal_coef=new RooFormulaVar(flavourString+"_2orMoreVTX_4VTX_normal",
-								      flavourString+"_2orMoreVTX_4VTX_normal",
-								      "@0*@1*@2*@3",RooArgList(*bottom_coef,
-											       *bottom_e_2orMoreVTX,
-											       *bottom_e_2orMoreVTX_4TrackVTX,
-											       *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-  
-  RooFormulaVar* bottom_2orMoreVTX_5orMoreVTX_normal_coef=new RooFormulaVar(flavourString+"_2orMoreVTX_5orMoreVTX_normal",
-									    flavourString+"_2orMoreVTX_5orMoreVTX_normal",
-									    "@0*@1*@2*@3",RooArgList(*bottom_coef,
-												     *bottom_e_2orMoreVTX,
-												     *bottom_e_2orMoreVTX_5orMoreTrackVTX,
-												     *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal));
-
-												       
-  //
-
-  RooRealVar* bottom_e_NoVtx_NoSingleTrack=new RooRealVar(flavourString+"_e_NoVtx_NoSingleTrack",
-							  flavourString+"_e_NoVtx_NoSingleTrack",
-							  0.4,0.,1.);
-  RooRealVar* bottom_e_NoVtx_1SingleTrack=new RooRealVar(flavourString+"_e_NoVtx_1SingleTrack",
-							 flavourString+"_e_NoVtx_1SingleTrack",
-							 0.2,0.,1.);
-  RooRealVar* bottom_e_NoVtx_2SingleTrack=new RooRealVar(flavourString+"_e_NoVtx_2SingleTrack",
-							 flavourString+"_e_NoVtx_2SingleTrack",
-							 0.2,0.,1.);
-  RooFormulaVar* bottom_e_NoVtx_3orMoreSingleTrack=new RooFormulaVar(flavourString+"_e_NoVtx_3orMoreSingleTrack",
-								     flavourString+"_e_NoVtx_3orMoreSingleTrack",
-								     "1.-@0-@1-@2",RooArgList(*bottom_e_NoVtx_NoSingleTrack,
-											      *bottom_e_NoVtx_1SingleTrack,
-											      *bottom_e_NoVtx_2SingleTrack));
-  
-  //coef for noVTX case
-  
-  RooFormulaVar* bottom_noVTX_0ST_coef=new RooFormulaVar(flavourString+"_noVTX_0ST",
-							 flavourString+"_noVTX_0ST",
-							 "@0*@1*@2",RooArgList(*bottom_coef,
-									       *bottom_e_NoVTX,
-									       *bottom_e_NoVtx_NoSingleTrack));
-  
-  RooFormulaVar* bottom_noVTX_1ST_normal_coef=new RooFormulaVar(flavourString+"_noVTX_1ST_normal",
-								flavourString+"_noVTX_1ST_normal",
-								"@0*@1*@2*@3",RooArgList(*bottom_coef,
-											 *bottom_e_NoVTX,
-											 *bottom_e_NoVtx_1SingleTrack,
-											 *bottom_e_NoVtx_1SingleTrack_energyFraction_normal));
-
-  RooFormulaVar* bottom_noVTX_2ST_normal_coef=new RooFormulaVar(flavourString+"_noVTX_2ST_normal",
-								flavourString+"_noVTX_2ST_normal",
-								"@0*@1*@2*@3",RooArgList(*bottom_coef,
-											 *bottom_e_NoVTX,
-											 *bottom_e_NoVtx_2SingleTrack,
-											 *bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_normal));
-
-  RooFormulaVar* bottom_noVTX_3orMoreST_normal_coef=new RooFormulaVar(flavourString+"_noVTX_3orMoreST_normal",
-								      flavourString+"_noVTX_3orMoreST_normal",
-								      "@0*@1*@2*@3",RooArgList(*bottom_coef,
-											       *bottom_e_NoVTX,
-											       *bottom_e_NoVtx_3orMoreSingleTrack,
-											       *bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_normal));
-
-  //ALL COEFFICIENTS FOR NOFRAG CASE AGAIN
-
-
-  //0ST
-
-  RooFormulaVar* bottom_1VTX_0ST_2VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_2VTX_nofrag",
-								    flavourString+"_1VTX_0ST_2VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_2TrackVTX,
-												*bottom_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag));
-
-
-  RooFormulaVar* bottom_1VTX_0ST_3VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_3VTX_nofrag",
-								    flavourString+"_1VTX_0ST_3VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_3TrackVTX,
-												*bottom_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_0ST_4VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_4VTX_nofrag",
-								    flavourString+"_1VTX_0ST_4VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_NoSingleTrack,
-												*bottom_e_1VTX_4TrackVTX,
-												*bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_0ST_5or6VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_5or6VTX_nofrag",
-								       flavourString+"_1VTX_0ST_5or6VTX_nofrag",
-								       "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												   *bottom_e_1VTX,
-												   *bottom_e_1Vtx_NoSingleTrack,
-												   *bottom_e_1VTX_5or6TrackVTX,
-												   *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_0ST_7orMoreVTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_0ST_7orMoreVTX_nofrag",
-									  flavourString+"_1VTX_0ST_7orMoreVTX_nofrag",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_NoSingleTrack,
-												      *bottom_e_1VTX_7orMoreTrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-  
-  //1ST
-
-  RooFormulaVar* bottom_1VTX_1ST_2VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_2VTX_nofrag",
-								    flavourString+"_1VTX_1ST_2VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_2TrackVTX,
-												*bottom_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag));
-  
-  
-  RooFormulaVar* bottom_1VTX_1ST_3VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_3VTX_nofrag",
-								    flavourString+"_1VTX_1ST_3VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_3TrackVTX,
-												*bottom_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_1ST_4VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_4VTX_nofrag",
-								    flavourString+"_1VTX_1ST_4VTX_nofrag",
-								    "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												*bottom_e_1VTX,
-												*bottom_e_1Vtx_1SingleTrack,
-												*bottom_e_1VTX_4TrackVTX,
-												*bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_1ST_5or6VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_5or6VTX_nofrag",
-								       flavourString+"_1VTX_1ST_5or6VTX_nofrag",
-								       "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												   *bottom_e_1VTX,
-												   *bottom_e_1Vtx_1SingleTrack,
-												   *bottom_e_1VTX_5or6TrackVTX,
-												   *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_1ST_7orMoreVTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_1ST_7orMoreVTX_nofrag",
-									  flavourString+"_1VTX_1ST_7orMoreVTX_nofrag",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_1SingleTrack,
-												      *bottom_e_1VTX_7orMoreTrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-
-  //2orMoreST
-
-  RooFormulaVar* bottom_1VTX_2orMoreST_2VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_2VTX_nofrag",
-									  flavourString+"_1VTX_2orMoreST_2VTX_nofrag",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_2TrackVTX,
-												      *bottom_e_1orMoreVTX_2TrackVTX_energyFraction_nofrag));
-  
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_3VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_3VTX_nofrag",
-									  flavourString+"_1VTX_2orMoreST_3VTX_nofrag",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_3TrackVTX,
-												      *bottom_e_1orMoreVTX_3TrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_2orMoreST_4VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_4VTX_nofrag",
-									  flavourString+"_1VTX_2orMoreST_4VTX_nofrag",
-									  "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-												      *bottom_e_1VTX,
-												      *bottom_e_1Vtx_2orMoreSingleTrack,
-												      *bottom_e_1VTX_4TrackVTX,
-												      *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_1VTX_2orMoreST_5or6VTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_5or6VTX_nofrag",
-									     flavourString+"_1VTX_2orMoreST_5or6VTX_nofrag",
-									     "@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-													 *bottom_e_1VTX,
-													 *bottom_e_1Vtx_2orMoreSingleTrack,
-													 *bottom_e_1VTX_5or6TrackVTX,
-													 *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-  
-  RooFormulaVar* bottom_1VTX_2orMoreST_7orMoreVTX_nofrag_coef=new RooFormulaVar(flavourString+"_1VTX_2orMoreST_7orMoreVTX_nofrag",
-										flavourString+"_1VTX_2orMoreST_7orMoreVTX_nofrag",
-										"@0*@1*@2*@3*@4",RooArgList(*bottom_coef,
-													    *bottom_e_1VTX,
-													    *bottom_e_1Vtx_2orMoreSingleTrack,
-													    *bottom_e_1VTX_7orMoreTrackVTX,
-													    *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-  
-
-
-  //2orMoreVTX
-
-  RooFormulaVar* bottom_2orMoreVTX_4VTX_nofrag_coef=new RooFormulaVar(flavourString+"_2orMoreVTX_4VTX_nofrag",
-								      flavourString+"_2orMoreVTX_4VTX_nofrag",
-								      "@0*@1*@2*@3",RooArgList(*bottom_coef,
-											       *bottom_e_2orMoreVTX,
-											       *bottom_e_2orMoreVTX_4TrackVTX,
-											       *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-  
-  RooFormulaVar* bottom_2orMoreVTX_5orMoreVTX_nofrag_coef=new RooFormulaVar(flavourString+"_2orMoreVTX_5orMoreVTX_nofrag",
-									    flavourString+"_2orMoreVTX_5orMoreVTX_nofrag",
-									    "@0*@1*@2*@3",RooArgList(*bottom_coef,
-												     *bottom_e_2orMoreVTX,
-												     *bottom_e_2orMoreVTX_5orMoreTrackVTX,
-												     *bottom_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_nofrag));
-
-
-
-  //coef for noVTX case
-  
-  RooFormulaVar* bottom_noVTX_1ST_nofrag_coef=new RooFormulaVar(flavourString+"_noVTX_1ST_nofrag",
-								flavourString+"_noVTX_1ST_nofrag",
-								"@0*@1*@2*@3",RooArgList(*bottom_coef,
-											 *bottom_e_NoVTX,
-											 *bottom_e_NoVtx_1SingleTrack,
-											 *bottom_e_NoVtx_1SingleTrack_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_noVTX_2ST_nofrag_coef=new RooFormulaVar(flavourString+"_noVTX_2ST_nofrag",
-								flavourString+"_noVTX_2ST_nofrag",
-								"@0*@1*@2*@3",RooArgList(*bottom_coef,
-											 *bottom_e_NoVTX,
-											 *bottom_e_NoVtx_2SingleTrack,
-											 *bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_nofrag));
-
-  RooFormulaVar* bottom_noVTX_3orMoreST_nofrag_coef=new RooFormulaVar(flavourString+"_noVTX_3orMoreST_nofrag",
-								      flavourString+"_noVTX_3orMoreST_nofrag",
-								      "@0*@1*@2*@3",RooArgList(*bottom_coef,
-											       *bottom_e_NoVTX,
-											       *bottom_e_NoVtx_3orMoreSingleTrack,
-											       *bottom_e_NoVtx_2orMoreSingleTrack_energyFraction_nofrag));
-
-
-  //
-
-  /*
-  RooRealVar* bottom_e_NoVTX_noSingleTrack=new RooRealVar(flavourString+"_e_NoVTX_noSingleTrack",flavourString+"_e_NoVTX_noTracks",0.2,0.,1.);
-  RooRealVar* bottom_e_NoVTX_1SingleTrack=new RooRealVar(flavourString+"_e_NoVTX_1SingleTrack",flavourString+"_e_NoVTX_1SingleTrack",0.2,0.,1.);
-  RooRealVar* bottom_e_NoVTX_2SingleTracks=new RooRealVar(flavourString+"_e_NoVTX_2SingleTracks",flavourString+"_e_NoVTX_2SingleTracks",0.1,0.,1.);
-  RooFormulaVar* bottom_e_NoVTX_3orMoreSingleTracks=new RooFormulaVar(flavourString+"_e_NoVTX_2orMoreSingleTracks",
-								      flavourString+"_e_NoVTX_2orMoreSingleTracks",
-								      "1.-@0-@1-@2",RooArgList(*bottom_e_NoVTX_noSingleTrack,
-											       *bottom_e_NoVTX_1SingleTrack,
-											       *bottom_e_NoVTX_2SingleTracks));
-
-  */
-								      /*
-								      "1.-@0-@1",RooArgList(*bottom_e_NoVTX_1SingleTrack,
-											    *bottom_e_NoVTX_2SingleTracks));
-									*/
-  
-  //DUMMY PDF  
-  Int_t bottom_noVTX_noSingleTrack_nbins(1);
-  TArrayD bottom_noVTX_noSingleTrack_limits(bottom_noVTX_noSingleTrack_nbins+1);
-  bottom_noVTX_noSingleTrack_limits[0]=-0.5;
-  bottom_noVTX_noSingleTrack_limits[1]=7.5;
-  RooArgList* bottom_noVTX_noSingleTrack_list = new RooArgList(flavourString+"_noVTX_noSingleTrack_list");
-  RooParametricStepFunction* bottom_noVTX_noSingleTrack_pdf=new RooParametricStepFunction(flavourString+"_noVTX_noSingleTrack_pdf",
-											  flavourString+"_noVTX_noSingleTrack_pdf",
-											  *nSingleTracks,
-											  *bottom_noVTX_noSingleTrack_list,
-											  bottom_noVTX_noSingleTrack_limits,
-											  bottom_noVTX_noSingleTrack_nbins);
-  
-  
-  
-  std::cout << "First smoothing " << std::endl;
-  
-  
-  RooDataSet* data_noVTX=(RooDataSet*)dataset->reduce("nVTX==0&&nSingleTracks>0");
-  RooNDKeysPdf* bottom_noVTX_significance3d_pdf=new RooNDKeysPdf(flavourString+"_noVTX_significance3d_pdf",
-                                                                 flavourString+"_noVTX_significance3d_pdf",
-                                                                 *significance3d,
-                                                                 *data_noVTX,
-                                                                 RooNDKeysPdf::NoMirror,1);
-  
-  TH1F* bottom_noVTX_significance3d_histo=makeHisto(bottom_noVTX_significance3d_pdf,
-						    flavourString+"_noVTX_significance3d_histo",
-						    500,0,100,
-						    significance3d);
-
-  /*
-    RooDataHist* bottom_noVTX_significance3d_histo2=new RooDataHist(flavourString+"_noVTX_significance3d_histo2",
-    flavourString+"_noVTX_significance3d_histo2",
-    *significance3d,
-    bottom_noVTX_significance3d_histo,
-    1.0);
-    
-    std::cout << " 1 " << std::endl;
-    
-    RooHistPdf* bottom_noVTX_significance3d_pdf2=new RooHistPdf(flavourString+"_noVTX_significance3d_pdf2",
-    flavourString+"_noVTX_significance3d_pdf2",
-    *significance3d,
-    *bottom_noVTX_significance3d_histo2);
-    */
-  
-  TCanvas c1("c1","c1");						
-  RooPlot* bottom_noVTX_significance3d_pdf_plot=significance3d->frame();
-  data_noVTX->plotOn(bottom_noVTX_significance3d_pdf_plot);
-  bottom_noVTX_significance3d_pdf->plotOn(bottom_noVTX_significance3d_pdf_plot);
-  bottom_noVTX_significance3d_pdf_plot->Draw();
-
-
-  c1.Update();
-  c1.SaveAs(identificationFile+"_noVTX_significance3d_pdf.eps");
-  
-
-  std::cout << "new smoothing " << std::endl;
-  
-  RooDataSet* data_noVTX_1SingleTrack=(RooDataSet*)dataset->reduce("nVTX==0&&nSingleTracks==1&&energyFractionCat==energyFractionCat::Normal");
-
-  RooNDKeysPdf* bottom_noVTX_1SingleTrack_energyFraction_normal_pdf=new RooNDKeysPdf(flavourString+"_noVTX_1SingleTrack_energyFraction_normal_pdf",
-										 flavourString+"_noVTX_1SingleTrack_energyFraction_normal_pdf",
-										 *energyFraction,
-										 *data_noVTX_1SingleTrack,
-                                                                                 RooNDKeysPdf::NoMirror,1);
-
-  TH1F* bottom_noVTX_1SingleTrack_energyFraction_normal_histo=makeHisto(bottom_noVTX_1SingleTrack_energyFraction_normal_pdf,
-									flavourString+"_noVTX_1SingleTrack_energyFraction_normal_histo",
-									500,0,1.00001,
-									energyFraction);
-
-
-  Int_t bottom_dummy1_nbins(1);
-  TArrayD bottom_dummy1_limits(bottom_dummy1_nbins+1);
-  bottom_dummy1_limits[0]=0.;
-  bottom_dummy1_limits[1]=1.00001;
-  RooArgList* bottom_dummy1_list = new RooArgList(flavourString+"_dummy1_list");
-  RooParametricStepFunction* bottom_dummy1_pdf=new RooParametricStepFunction(flavourString+"_dummy1_pdf",
-									     flavourString+"_dummy1_pdf",
-									     *energyFraction,
-									     *bottom_dummy1_list,
-									     bottom_dummy1_limits,
-									     bottom_dummy1_nbins);
-
-
-  
-  
-  
-  TCanvas c2("c2","c2");						
-  RooPlot* bottom_noVTX_1SingleTrack_energyFraction_pdf_plot=energyFraction->frame();
-  data_noVTX_1SingleTrack->plotOn(bottom_noVTX_1SingleTrack_energyFraction_pdf_plot);
-  bottom_noVTX_1SingleTrack_energyFraction_normal_pdf->plotOn(bottom_noVTX_1SingleTrack_energyFraction_pdf_plot);
-  bottom_noVTX_1SingleTrack_energyFraction_pdf_plot->Draw();
-  c2.Update();
-  c2.SaveAs(identificationFile+"_noVTX_1SingleTrack_energyFraction_pdf.eps");
-  
-
-
-
-
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_noVTX_2orMoreSingleTrack=(RooDataSet*)dataset->reduce("nVTX==0&&nSingleTracks>1&&energyFractionCat==energyFractionCat::Normal");
-  RooNDKeysPdf* bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_pdf=new RooNDKeysPdf(flavourString+"_noVTX_2orMoreSingleTrack_energyFraction_normal_pdf",
-										       flavourString+"_noVTX_2orMoreSingleTrack_energyFraction_normal_pdf",
-										       *energyFraction,
-										       *data_noVTX_2orMoreSingleTrack,
-                                                                                       RooNDKeysPdf::NoMirror,1);
-
-  
-  TH1F* bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_histo=makeHisto(bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_pdf,
-									      flavourString+"_noVTX_2orMoreSingleTrack_energyFraction_normal_histo",
-									      500,0,1.00001,
-									      energyFraction);
-  
-  
-
-  TCanvas c3("c3","c3");						
-  RooPlot* bottom_noVTX_2orMoreSingleTrack_energyFraction_pdf_plot=energyFraction->frame();
-  data_noVTX_2orMoreSingleTrack->plotOn(bottom_noVTX_2orMoreSingleTrack_energyFraction_pdf_plot);
-  bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_pdf->plotOn(bottom_noVTX_2orMoreSingleTrack_energyFraction_pdf_plot);
-  bottom_noVTX_2orMoreSingleTrack_energyFraction_pdf_plot->Draw();
-  c3.Update();
-  c3.SaveAs(identificationFile+"_noVTX_2orMoreSingleTrack_energyFraction_pdf.eps");
-  
-
-
-
-  /*
-  Int_t bottom_1VTX_nSingleTracks_nbins(4);
-  TArrayD bottom_1VTX_nSingleTracks_limits(bottom_1VTX_nSingleTracks_nbins+1);
-  bottom_1VTX_nSingleTracks_limits[0]=-0.5;
-  bottom_1VTX_nSingleTracks_limits[1]=0.5;
-  bottom_1VTX_nSingleTracks_limits[2]=1.5;
-  bottom_1VTX_nSingleTracks_limits[3]=2.5;
-  bottom_1VTX_nSingleTracks_limits[4]=7.5;
-  
-  RooArgList* bottom_1VTX_nSingleTracks_list = new RooArgList(flavourString+"_1VTX_nSingleTracks_list");
-  RooRealVar* bottom_1VTX_nSingleTracks_noTracks=new RooRealVar(flavourString+"_1VTX_nSingleTracks_noTracks","bin 0 value",
-								0.1,0.0,20.0);
-  RooRealVar* bottom_1VTX_nSingleTracks_1Track=new RooRealVar(flavourString+"_1VTX_nSingleTracks_1Track","bin 1 value",
-							      0.1,0.0,20.0);
-  RooRealVar* bottom_1VTX_nSingleTracks_2Track=new RooRealVar(flavourString+"_1VTX_nSingleTracks_2Track","bin 2 value",
-							      0.1,0.0,20.0);
-
-  bottom_1VTX_nSingleTracks_list->add(*bottom_1VTX_nSingleTracks_noTracks);
-  bottom_1VTX_nSingleTracks_list->add(*bottom_1VTX_nSingleTracks_1Track);
-  bottom_1VTX_nSingleTracks_list->add(*bottom_1VTX_nSingleTracks_2Track);
-
-  RhhBinnedPdf* bottom_1VTX_nSingleTracks_pdf=new RhhBinnedPdf(flavourString+"_1VTX_nSingleTracks_pdf",
-							       flavourString+"_1VTX_nSingleTracks_pdf",
-							       *nSingleTracks,
-							       *bottom_1VTX_nSingleTracks_list,
-							       bottom_1VTX_nSingleTracks_limits);
-  */
-
- 
-
-
-  Int_t bottom_1VTX_nTracksAtVtx_nbins(5);
-  TArrayD bottom_1VTX_nTracksAtVtx_limits(bottom_1VTX_nTracksAtVtx_nbins+1);
-  // bottom_1VTX_nTracksAtVtx_limits[0]=1.5;
-  bottom_1VTX_nTracksAtVtx_limits[0]=-.5;
-  bottom_1VTX_nTracksAtVtx_limits[1]=2.5;
-  bottom_1VTX_nTracksAtVtx_limits[2]=3.5;
-  bottom_1VTX_nTracksAtVtx_limits[3]=4.5;
-  bottom_1VTX_nTracksAtVtx_limits[4]=6.5;
-  bottom_1VTX_nTracksAtVtx_limits[5]=15.5;
-  
-  
-  RooArgList* bottom_1VTX_nTracksAtVtx_list = new RooArgList(flavourString+"_1VTX_nTracksAtVtx_list");
-  RooRealVar* bottom_1VTX_nTracksAtVtx_2Tracks=new RooRealVar(flavourString+"_1VTX_nTracksAtVtx_2Tracks","bin 0 value",
-							      0.1,0.0,1.0);
-  RooRealVar* bottom_1VTX_nTracksAtVtx_3Tracks=new RooRealVar(flavourString+"_1VTX_nTracksAtVtx_3Tracks","bin 1 value",
-							     0.1,0.0,1.0);
-  RooRealVar* bottom_1VTX_nTracksAtVtx_4Tracks=new RooRealVar(flavourString+"_1VTX_nTracksAtVtx_4Tracks","bin 2 value",
-							     0.1,0.0,1.0);
-  RooRealVar* bottom_1VTX_nTracksAtVtx_56Tracks=new RooRealVar(flavourString+"_1VTX_nTracksAtVtx_56Tracks","bin 3 value",
-							       0.1,0.0,1.0);
-  bottom_1VTX_nTracksAtVtx_list->add(*bottom_1VTX_nTracksAtVtx_2Tracks);
-  bottom_1VTX_nTracksAtVtx_list->add(*bottom_1VTX_nTracksAtVtx_3Tracks);
-  bottom_1VTX_nTracksAtVtx_list->add(*bottom_1VTX_nTracksAtVtx_4Tracks);
-  bottom_1VTX_nTracksAtVtx_list->add(*bottom_1VTX_nTracksAtVtx_56Tracks);
-  bottom_1VTX_nTracksAtVtx_list->add(*bottom_1VTX_nTracksAtVtx_2Tracks);
-  
-
-  RooParametricStepFunction* bottom_1VTX_nTracksAtVtx_pdf=new RooParametricStepFunction(flavourString+"_1VTX_nTracksAtVtx_pdf",
-											flavourString+"_1VTX_nTracksAtVtx_pdf",
-											*nTracksAtVtx,
-											*bottom_1VTX_nTracksAtVtx_list,
-											bottom_1VTX_nTracksAtVtx_limits,
-											bottom_1VTX_nTracksAtVtx_nbins);
-
-  Int_t bottom_2orMoreVTX_nTracksAtVtx_nbins(2);
-  TArrayD bottom_2orMoreVTX_nTracksAtVtx_limits(bottom_2orMoreVTX_nTracksAtVtx_nbins+1);
-  bottom_2orMoreVTX_nTracksAtVtx_limits[0]=-0.5;
-  //  bottom_2orMoreVTX_nTracksAtVtx_limits[0]=3.5;
-  bottom_2orMoreVTX_nTracksAtVtx_limits[1]=4.5;
-  bottom_2orMoreVTX_nTracksAtVtx_limits[2]=15.5;
-  
-  RooArgList* bottom_2orMoreVTX_nTracksAtVtx_list = new RooArgList(flavourString+"_2orMoreVTX_nTracksAtVtx_list");
-  RooRealVar* bottom_2orMoreVTX_nTracksAtVtx_4Tracks=new RooRealVar(flavourString+"_2orMoreVTX_nTracksAtVtx_4Tracks","bin 0 value",
-								    0.4,0.0,1.0);
-  bottom_2orMoreVTX_nTracksAtVtx_list->add(*bottom_2orMoreVTX_nTracksAtVtx_4Tracks);
-
-  RooParametricStepFunction* bottom_2orMoreVTX_nTracksAtVtx_pdf=new RooParametricStepFunction(flavourString+"_2orMoreVTX_nTracksAtVtx_normal_pdf",
-											      flavourString+"_2orMoreVTX_nTracksAtVtx_normal_pdf",
-											      *nTracksAtVtx,
-											      *bottom_2orMoreVTX_nTracksAtVtx_list,
-											      bottom_2orMoreVTX_nTracksAtVtx_limits,
-											      bottom_2orMoreVTX_nTracksAtVtx_nbins);
-  
-
-  
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_1orMoreVTX_2TrackVTX=(RooDataSet*)dataset->reduce("nVTX>0&&nTracksAtVtx==2&&energyFractionCat==energyFractionCat::Normal"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_2TrackVTX_energyFraction_normal_pdf",
-									    flavourString+"_1orMoreVTX_2TrackVTX_energyFraction_normal_pdf",
-									    *energyFraction,
-									    *data_1orMoreVTX_2TrackVTX,
-                                                             RooNDKeysPdf::NoMirror,1.);
-
-  TH1F* bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_histo=makeHisto(bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_pdf,
-									  flavourString+"_1orMoreVTX_2TrackVTX_energyFraction_normal_histo",
-									  500,0,1.00001,
-									  energyFraction);
-
-
-  Int_t bottom_dummy3_nbins(1);
-  TArrayD bottom_dummy3_limits(bottom_dummy1_nbins+1);
-  bottom_dummy3_limits[0]=0.;
-  bottom_dummy3_limits[1]=1.00001;
-  RooArgList* bottom_dummy3_list = new RooArgList(flavourString+"_dummy3_list");
-  RooParametricStepFunction* bottom_dummy3_pdf=new RooParametricStepFunction(flavourString+"_dummy3_pdf",
-									     flavourString+"_dummy3_pdf",
-									     *energyFraction,
-									     *bottom_dummy3_list,
-									     bottom_dummy3_limits,
-									     bottom_dummy3_nbins);
-
-
-
-
-
-  TCanvas c4("c4","c4");						
-  RooPlot* bottom_1orMoreVTX_2TrackVTX_energyFraction_pdf_plot=energyFraction->frame();
-  data_1orMoreVTX_2TrackVTX->plotOn(bottom_1orMoreVTX_2TrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_pdf->plotOn(bottom_1orMoreVTX_2TrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_2TrackVTX_energyFraction_pdf_plot->Draw();
-  c4.Update();
-  c4.SaveAs(identificationFile+"_1orMoreVTX_2TrackVTX_energyFraction_pdf.eps");
-  
-  
-
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_1orMoreVTX_3TrackVTX=(RooDataSet*)dataset->reduce("nVTX>0&&(nTracksAtVtx+nSingleTracks)==3&&energyFractionCat==energyFractionCat::Normal"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_3TrackVTX_energyFraction_normal_pdf",
-										   flavourString+"_1orMoreVTX_3TrackVTX_energyFraction_normal_pdf",
-										   *energyFraction,
-										   *data_1orMoreVTX_3TrackVTX,
-                                                             RooNDKeysPdf::NoMirror,1);
-  
-  TH1F* bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_histo=makeHisto(bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_pdf,
-									  flavourString+"_1orMoreVTX_3TrackVTX_energyFraction_normal_histo",
-									  500,0,1.00001,
-									  energyFraction);
-
-  
-
-  Int_t bottom_dummy4_nbins(1);
-  TArrayD bottom_dummy4_limits(bottom_dummy1_nbins+1);
-  bottom_dummy4_limits[0]=0.;
-  bottom_dummy4_limits[1]=1.00001;
-  RooArgList* bottom_dummy4_list = new RooArgList(flavourString+"_dummy4_list");
-  RooParametricStepFunction* bottom_dummy4_pdf=new RooParametricStepFunction(flavourString+"_dummy4_pdf",
-									     flavourString+"_dummy4_pdf",
-									     *energyFraction,
-									     *bottom_dummy4_list,
-									     bottom_dummy4_limits,
-									     bottom_dummy4_nbins);
-
-
-
-
-  TCanvas c5("c5","c5");						
-  RooPlot* bottom_1orMoreVTX_3TrackVTX_energyFraction_pdf_plot=energyFraction->frame();
-  data_1orMoreVTX_3TrackVTX->plotOn(bottom_1orMoreVTX_3TrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_pdf->plotOn(bottom_1orMoreVTX_3TrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_3TrackVTX_energyFraction_pdf_plot->Draw();
-  c5.Update();
-  c5.SaveAs(identificationFile+"_1orMoreVTX_3TrackVTX_energyFraction_pdf.eps");
-  
- 
-
-
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_1orMoreVTX_4orMoreTrackVTX=(RooDataSet*)dataset->reduce("nVTX>0&&(nTracksAtVtx+nSingleTracks)>3&&energyFractionCat==energyFractionCat::Normal"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_pdf",
-											 flavourString+"_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_pdf",
-											 *energyFraction,
-											 *data_1orMoreVTX_4orMoreTrackVTX,
-                                                             RooNDKeysPdf::NoMirror,1);
-
-  TH1F* bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo=makeHisto(bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_pdf,
-										flavourString+"_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo",
-										500,0,1.00001,
-										energyFraction);
-
-  
-
-  
-  
-  Int_t bottom_dummy5_nbins(1);
-  TArrayD bottom_dummy5_limits(bottom_dummy1_nbins+1);
-  bottom_dummy5_limits[0]=0.;
-  bottom_dummy5_limits[1]=1.00001;
-  RooArgList* bottom_dummy5_list = new RooArgList(flavourString+"_dummy5_list");
-  RooParametricStepFunction* bottom_dummy5_pdf=new RooParametricStepFunction(flavourString+"_dummy5_pdf",
-									     flavourString+"_dummy5_pdf",
-									     *energyFraction,
-									     *bottom_dummy5_list,
-									     bottom_dummy5_limits,
-									     bottom_dummy5_nbins);
-
-
-
-
-  TCanvas c6("c6","c6");						
-  RooPlot* bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_pdf_plot=energyFraction->frame();
-  data_1orMoreVTX_4orMoreTrackVTX->plotOn(bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_pdf->plotOn(bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_pdf_plot);
-  bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_pdf_plot->Draw();
-  c6.Update();
-  c6.SaveAs(identificationFile+"_1orMoreVTX_4orMoreTrackVTX_energyFraction_pdf.eps");
-  
-  
-
-  
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_1orMoreVTX=(RooDataSet*)dataset->reduce("nVTX>0"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_significance3d_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_significance3d_pdf",
-								  flavourString+"_1orMoreVTX_significance3d_pdf",
-								  *significance3d,
-								  *data_1orMoreVTX,
-                                                             RooNDKeysPdf::NoMirror,1);
-
-  TH1F* bottom_1orMoreVTX_significance3d_histo=makeHisto(bottom_1orMoreVTX_significance3d_pdf,
-						    flavourString+"_1orMoreVTX_significance3d_histo",
-						    500,0,100,
-						    significance3d);
-
- 
-
-  TCanvas c7("c7","c7");						
-  RooPlot* bottom_1orMoreVTX_significance3d_pdf_plot=significance3d->frame();
-  data_1orMoreVTX->plotOn(bottom_1orMoreVTX_significance3d_pdf_plot);
-  bottom_1orMoreVTX_significance3d_pdf->plotOn(bottom_1orMoreVTX_significance3d_pdf_plot);
-  bottom_1orMoreVTX_significance3d_pdf_plot->Draw();
-  c7.Update();
-  c7.SaveAs(identificationFile+"_1orMoreVTX_significance3d_pdf_plot.eps");
-  
-
-
-
-
-
-  std::cout << "new smoothing " << std::endl;
-  //RooDataSet* data_1orMoreVTX_2TrackVTX=dataset->reduce("cat_nVTX>0&&cat_nTracksAtVtx==2"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_2TrackVTX_mass_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_2TrackVTX_mass_pdf",
-								  flavourString+"_1orMoreVTX_2TrackVTX_mass_pdf",
-								  *mass,
-								  *data_1orMoreVTX_2TrackVTX,
-                                                             RooNDKeysPdf::NoMirror,1);
-
-  TH1F* bottom_1orMoreVTX_2TrackVTX_mass_histo=makeHisto(bottom_1orMoreVTX_2TrackVTX_mass_pdf,
-						    flavourString+"_1orMoreVTX_2TrackVTX_mass_histo",
-						    500,0,10000,
-						    mass);
-
-
-  //,
-
-  TCanvas c8("c8","c8");						
-  RooPlot* bottom_1orMoreVTX_2TrackVTX_mass_pdf_plot=mass->frame();
-  data_1orMoreVTX_2TrackVTX->plotOn(bottom_1orMoreVTX_2TrackVTX_mass_pdf_plot);
-  bottom_1orMoreVTX_2TrackVTX_mass_pdf->plotOn(bottom_1orMoreVTX_2TrackVTX_mass_pdf_plot);
-  bottom_1orMoreVTX_2TrackVTX_mass_pdf_plot->Draw();
-  c8.Update();
-  c8.SaveAs(identificationFile+"_1orMoreVTX_2TrackVTX_mass_pdf.eps");
-  
-
-
-  //							      bottom_1orMoreVTX_2TrackVTX_mass_nbins);
-  //  RooNumIntConfig* cfg = RooAbsReal::defaultIntegratorConfig();
-  //  cfg->setEpsAbs(1E-4);
-  //  cfg->setEpsRel(1E-4);
-  //    cfg->method1D().setLabel("RooIntegrator1D");
-  //  cfg->method1D()->Print("v");
-  //  cfg->getConfigSection("RooIntegrator1D")->setRealValue("maxSteps",100);
-  //  bottom_1orMoreVTX_2TrackVTX_mass_pdf->setIntegratorConfig(*cfg);
-  
-  //bottom_1orMoreVTX_2TrackVTX_mass_pdf->->setIntegratorConfig(*cfg);
-
-  
-  std::cout << "new smoothing " << std::endl;
-  RooDataSet* data_1orMoreVTX_3orMoreTrackVTX=(RooDataSet*)dataset->reduce("nVTX>0&&(nTracksAtVtx+nSingleTracks)>2"); 
-  RooNDKeysPdf* bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf=new RooNDKeysPdf(flavourString+"_1orMoreVTX_3orMoreTrackVTX_mass_pdf",
-									flavourString+"_1orMoreVTX_3orMoreTrackVTX_mass_pdf",
-									*mass,
-									*data_1orMoreVTX_3orMoreTrackVTX,
-                                                             RooNDKeysPdf::NoMirror,1.);
-
-  
-  TH1F* bottom_1orMoreVTX_3orMoreTrackVTX_mass_histo=makeHisto(bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf,
-						    flavourString+"_1orMoreVTX_3orMoreTrackVTX_mass_histo",
-						    500,0,10000,
-						    mass);
-
-  TCanvas c9("c9","c9");						
-  RooPlot* bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf_plot=mass->frame();
-  data_1orMoreVTX_3orMoreTrackVTX->plotOn(bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf_plot);
-  bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf->plotOn(bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf_plot);
-  bottom_1orMoreVTX_3orMoreTrackVTX_mass_pdf_plot->Draw();
-  c9.Update();
-  c9.SaveAs(identificationFile+"_1orMoreVTX_3orMoreTrackVTX_mass_pdf_plot.eps");
-  
-
-  bottom_noVTX_significance3d_histo->Write();
-  bottom_noVTX_1SingleTrack_energyFraction_normal_histo->Write();
-  bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_histo->Write();
-  bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_histo->Write();
-  bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_histo->Write();
-  bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo->Write();
-  bottom_1orMoreVTX_significance3d_histo->Write();
-  bottom_1orMoreVTX_2TrackVTX_mass_histo->Write();
-  bottom_1orMoreVTX_3orMoreTrackVTX_mass_histo->Write();
-  filehistos->Write();
-  filehistos->Close();
-  
-
-}
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.h
deleted file mode 100644
index 3b00e03d56a8..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/createTheHistograms.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TString.h"
-
-class TH1F;
-class RooNDKeysPdf;
-class RooRealVar;
-void createTheHistograms(TString collectionName,
-                         int flavourType);
-
-void createTheHistograms(int flavourType,
-                         TString collectionName)
-{
-  createTheHistograms( collectionName,
-                       flavourType);
-}
-
-
-
-TH1F* makeHisto(RooNDKeysPdf* myKeysPdf,const char* name,int numtot,double begin,double end,RooRealVar* dep);
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/doCreateTheHistograms.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/doCreateTheHistograms.C
deleted file mode 100644
index 7c8fbb3dcbe6..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/doCreateTheHistograms.C
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-void doCreateTheHistograms(TString collectionName,
-                           int flavour)
-{
-  gROOT->ProcessLine(".L createTheHistograms.cxx+");
-  createTheHistograms(flavour,
-                      collectionName);
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeCreateAllHistograms.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeCreateAllHistograms.C
deleted file mode 100644
index 34086a370291..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeCreateAllHistograms.C
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-executeCreateAllHistograms(int number=0,int flavour=0) {
-  gROOT->ProcessLine(".L createTheHistograms.cxx+g");
-  gROOT->ProcessLine(".L createAllHistograms.cxx+g");
-//  createAllHistograms(number,flavour);
-  createAllHistograms();
-
-}
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeDoGetAllValues.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeDoGetAllValues.C
deleted file mode 100644
index 341bea462c87..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/executeDoGetAllValues.C
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-gROOT->ProcessLine(".L macroToGetAllValues.cxx+");
-gROOT->ProcessLine(".L macroDoGetAllValues.C+");
-
-prepareCalibrationFileForCOOL();
-
-}
-
-
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroDoGetAllValues.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroDoGetAllValues.C
deleted file mode 100644
index de9c587021ce..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroDoGetAllValues.C
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "../preparedatasets/collectionsToProcess.h"
-#include "macroToGetAllValues.h"
-#include <TString.h>
-
-using namespace std;
-
-void prepareCalibrationFileForCOOL()
-{
-
-  vector<TString> collectionsToProcess=getCollectionsToProcess();
-  
-  vector<TString>::const_iterator collectionsToProcessBegin=collectionsToProcess.begin();
-  vector<TString>::const_iterator collectionsToProcessEnd=collectionsToProcess.end();
-  
-  for (vector<TString>::const_iterator collectionsToProcessIter=collectionsToProcessBegin;
-       collectionsToProcessIter!=collectionsToProcessEnd;
-       ++collectionsToProcessIter) 
-  {
-
-    TString filename("../reduceddatasets/reduceddataset_");
-    filename+=*collectionsToProcessIter;
-    filename+=".root";
-
-    getAllValues(filename,
-                 *collectionsToProcessIter,
-                 5);
-    
-    getAllValues(filename,
-                 *collectionsToProcessIter,
-                 4);
-    
-    getAllValues(filename,
-                 *collectionsToProcessIter,
-                 1);
-
-    mergeFiles(*collectionsToProcessIter);
-
-  }
-  
-}
-
-    
-
-    
-                  
-                  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.cxx
deleted file mode 100644
index 15840038b8c8..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.cxx
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iostream>
-#include <TTree.h>
-#include <TFile.h>
-#include <TEventList.h>
-#include "Riostream.h"
-#include <TH1D.h>
-#include <TString.h>
-#include <vector>
-#include <iostream>
-
-using namespace std;
-
-void makeHisto(TString title, double value)
-{
-  TH1D* newHisto=new TH1D(title,title,1,0,1);
-  newHisto->Fill(0.5,value);
-  newHisto->Write();
-}
-
-
-void getAllValues(TString fileName,TString jetCollection,int flavourType)
-{
-
-  TString flavourString;
-
-  if (flavourType==5)
-  {
-    flavourString=TString("bottom");
-  }
-  if (flavourType==4)
-  {
-    flavourString=TString("charm");
-  }
-  if (flavourType==1)
-  {
-    flavourString=TString("light");
-  }
-
-  TString identificationFile("../trainingResultsLikelihood/coefficientsHistos_");
-  identificationFile+=jetCollection;
-  identificationFile+="_";
-  identificationFile+=flavourString;
-  identificationFile+=".root";
-
-  TString identificationFile2("../trainingResultsLikelihood/coefficientsFile_");
-  identificationFile2+=jetCollection;
-  identificationFile2+="_";
-  identificationFile2+=flavourString;
-  identificationFile2+=".txt";
-
-  TString flavourCondition="cat_flavour==";
-  flavourCondition+=flavourType;
-
-  ofstream cronology(identificationFile2,ios_base::out|ios_base::app);
-
-  TFile file(fileName);
-  TTree* myTTree=(TTree*)file.Get("SVTree");
-
-  TFile* output=new TFile(identificationFile,"recreate");
-
-  TH1::AddDirectory(kFALSE);
-
-  myTTree->Draw(">>myList",flavourCondition+"&&nTracksAtVtx>-998.");
-  TEventList* myEventList=(TEventList*)gDirectory->Get("myList");
-  int allnumber=myTTree->GetEntries();
-  cronology << flavourString <<  "_"<<jetCollection<<"_coef = " << myEventList->GetN()  << " L(0 - 1e+08)" <<  endl;
-  makeHisto(flavourString+"_coef",(double)myEventList->GetN());
-
-  myTTree->Draw(">>myList2",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1");
-  TEventList* myEventList2=(TEventList*)gDirectory->Get("myList2");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX = " << (double)myEventList2->GetN()/(double)myEventList->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1VTX",(double)myEventList2->GetN()/(double)myEventList->GetN());
-
-  myTTree->Draw(">>myList3",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&nTracksAtVtx==2");
-  TEventList* myEventList3=(TEventList*)gDirectory->Get("myList3");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX_2TrackVTX = " << (double)myEventList3->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1VTX_2TrackVTX",(double)myEventList3->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList4",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&nTracksAtVtx==3");
-  TEventList* myEventList4=(TEventList*)gDirectory->Get("myList4");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX_3TrackVTX = " << (double)myEventList4->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1VTX_3TrackVTX",(double)myEventList4->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList5",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&nTracksAtVtx==4");
-  TEventList* myEventList5=(TEventList*)gDirectory->Get("myList5");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX_4TrackVTX = " << (double)myEventList5->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1VTX_4TrackVTX",(double)myEventList5->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList6",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&(nTracksAtVtx==5||nTracksAtVtx==6)");
-  TEventList* myEventList6=(TEventList*)gDirectory->Get("myList6");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX_5or6TrackVTX = " << (double)myEventList6->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1VTX_5or6TrackVTX",(double)myEventList6->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList7",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&nSingleTracks==1");
-  TEventList* myEventList7=(TEventList*)gDirectory->Get("myList7");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1Vtx_1SingleTrack = " << (double)myEventList7->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1Vtx_1SingleTrack",(double)myEventList7->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList8",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==1&&nSingleTracks==0");
-  TEventList* myEventList8=(TEventList*)gDirectory->Get("myList8");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1Vtx_NoSingleTrack = " << (double)myEventList8->GetN()/(double)myEventList2->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1Vtx_NoSingleTrack",(double)myEventList8->GetN()/(double)myEventList2->GetN());
-
-  myTTree->Draw(">>myList11",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>0&&nTracksAtVtx>3");
-  TEventList* myEventList11=(TEventList*)gDirectory->Get("myList11");
-  //  cronology << flavourString <<  "_"<<jetCollection<<"_e_1VTX " << (double)myEventList2->GetN()/(double)myEventList->GetN() << " L(0 - 1) " << endl;
-
-  myTTree->Draw(">>myList28",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>0&&nTracksAtVtx==2&&energyFraction<.9999");
-  TEventList* myEventList28=(TEventList*)gDirectory->Get("myList28");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1orMoreVTX_2TrackVTX_energyFraction_normal = " << (double)myEventList28->GetN()/(double)myEventList3->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1orMoreVTX_2TrackVTX_energyFraction_normal",(double)myEventList28->GetN()/(double)myEventList3->GetN());
-
-  myTTree->Draw(">>myList9",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>0&&nTracksAtVtx==3&&energyFraction<.9999");
-  TEventList* myEventList9=(TEventList*)gDirectory->Get("myList9");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1orMoreVTX_3TrackVTX_energyFraction_normal = " << (double)myEventList9->GetN()/(double)myEventList4->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1orMoreVTX_3TrackVTX_energyFraction_normal",(double)myEventList9->GetN()/(double)myEventList4->GetN());
-
-  myTTree->Draw(">>myList10",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>0&&nTracksAtVtx>3&&energyFraction<.9999");
-  TEventList* myEventList10=(TEventList*)gDirectory->Get("myList10");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal = " << (double)myEventList10->GetN()/(double)myEventList11->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal" ,(double)myEventList10->GetN()/(double)myEventList11->GetN());
-
-  myTTree->Draw(">>myList12",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>1");
-  TEventList* myEventList12=(TEventList*)gDirectory->Get("myList12");
-
-  myTTree->Draw(">>myList13",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX>1&&nTracksAtVtx==4");
-  TEventList* myEventList13=(TEventList*)gDirectory->Get("myList13");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_2orMoreVTX_4TrackVTX = " << (double)myEventList13->GetN()/(double)myEventList12->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_2orMoreVTX_4TrackVTX",(double)myEventList13->GetN()/(double)myEventList12->GetN());
-
-
-  myTTree->Draw(">>myList14",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0");
-  TEventList* myEventList14=(TEventList*)gDirectory->Get("myList14");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVTX = " << (double)myEventList14->GetN()/(double)myEventList->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVTX",(double)myEventList14->GetN()/(double)myEventList->GetN());
-
-  myTTree->Draw(">>myList15",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks==1");
-  TEventList* myEventList15=(TEventList*)gDirectory->Get("myList15");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_1SingleTrack = " << (double)myEventList15->GetN()/(double)myEventList14->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVtx_1SingleTrack",(double)myEventList15->GetN()/(double)myEventList14->GetN());
-
-  myTTree->Draw(">>myList16",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks==2");
-  TEventList* myEventList16=(TEventList*)gDirectory->Get("myList16");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_2SingleTrack = " << (double)myEventList16->GetN()/(double)myEventList14->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVtx_2SingleTrack",(double)myEventList16->GetN()/(double)myEventList14->GetN());
-
-  myTTree->Draw(">>myList17",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks>1");
-  TEventList* myEventList17=(TEventList*)gDirectory->Get("myList17");
-  //  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_3SingleTrack " << (double)myEventList17->GetN()/(double)myEventList14->GetN() << " L(0 - 1) " << endl;
-  myTTree->Draw(">>myList18",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks==0");
-  TEventList* myEventList18=(TEventList*)gDirectory->Get("myList18");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_NoSingleTrack = " << (double)myEventList18->GetN()/(double)myEventList14->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVtx_NoSingleTrack",(double)myEventList18->GetN()/(double)myEventList14->GetN());
-
-  myTTree->Draw(">>myList19",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks==1&&energyFraction<.9999");
-  TEventList* myEventList19=(TEventList*)gDirectory->Get("myList19");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_1SingleTrack_energyFraction_normal = " << (double)myEventList19->GetN()/(double)myEventList15->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVtx_1SingleTrack_energyFraction_normal", (double)myEventList19->GetN()/(double)myEventList15->GetN());
-
-  myTTree->Draw(">>myList20",flavourCondition+"&&nTracksAtVtx>-998.&&nVTX==0&&nSingleTracks>1&&energyFraction<.9999");
-  TEventList* myEventList20=(TEventList*)gDirectory->Get("myList20");
-  cronology << flavourString <<  "_"<<jetCollection<<"_e_NoVtx_2orMoreSingleTrack_energyFraction_normal = " << (double)myEventList20->GetN()/(double)myEventList17->GetN() << " L(0 - 1) " << endl;
-  makeHisto(flavourString+"_e_NoVtx_2orMoreSingleTrack_energyFraction_normal",(double)myEventList20->GetN()/(double)myEventList17->GetN());
-  
-  output->Write();
-  output->Close();
-
-  cronology.close();
-
-}
-
-void mergeFiles(TString jetCollection)
-{
-
-  std::vector<int> allFlavours;
-  allFlavours.push_back(1);
-  allFlavours.push_back(4);
-  allFlavours.push_back(5);
-  
-  std::vector<int>::const_iterator begin=allFlavours.begin();
-  std::vector<int>::const_iterator end=allFlavours.end();
-  
-  TString identificationFile("../trainingResultsLikelihood/coefficientsHistos_");
-  identificationFile+=jetCollection;
-  identificationFile+=".root";
-
-  TFile* outputFile=new TFile(identificationFile,"recreate");
-
-  for (std::vector<int>::const_iterator iter=begin;iter!=end;++iter)
-  {
-
-    TString flavourString;
-    
-    int flavourType=*iter;
-
-    if (flavourType==5)
-    {
-      flavourString=TString("bottom");
-    }
-    if (flavourType==4)
-    {
-      flavourString=TString("charm");
-    }
-    if (flavourType==1)
-    {
-      flavourString=TString("light");
-    }
-
-    TString identificationFile("../trainingResultsLikelihood/coefficientsHistos_");
-    identificationFile+=jetCollection;
-    identificationFile+="_";
-    identificationFile+=flavourString;
-    identificationFile+=".root";
-    
-    TFile openFile(identificationFile);
-    
-    outputFile->cd();
-    
-    TList* list=openFile.GetListOfKeys();
-    TIterator* firstIter=list->MakeIterator();
-
-
-    do {
-    
-      TObject* inList=firstIter->Next();
-      
-      if (inList==0)
-      {
-        break;
-      }
-      
-      std::cout << " Name: " << inList->ClassName() << std::endl;
-
-      if ( openFile.Get(inList->GetName())->ClassName()!=TString("TH1D") ){
-        continue;
-      }
-
-      TH1D* histo=(TH1D*) openFile.Get(inList->GetName());
-
-      histo->Write();
-      
-   } while(true);
-  } 
-  
-  outputFile->Write();
-  outputFile->Close();
-  
-}
-
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.h
deleted file mode 100644
index 8386957e6963..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToGetAllValues.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <TString.h>
-
-void getAllValues(TString fileName,TString jetCollection,int flavourType);
-
-void makeHisto(TString title, double value);
-
-void mergeFiles(TString jetCollection);
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToMerge.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToMerge.C
deleted file mode 100644
index c895b787a359..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/macroToMerge.C
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-  TFile filebottom("smoothedhistosbottom.root");
-  TFile filecharm("smoothedhistoscharm.root");
-  TFile filelight("smoothedhistoslight.root");
-  TFile fileoutput("smoothedhistos.root","recreate");
-  TH1F* histobottom1=filebottom.Get("bottom_noVTX_significance3d_histo");
-  TH1F* histobottom2=filebottom.Get("bottom_noVTX_1SingleTrack_energyFraction_normal_histo");
-  TH1F* histobottom3=filebottom.Get("bottom_noVTX_2orMoreSingleTrack_energyFraction_normal_histo");
-  TH1F* histobottom4=filebottom.Get("bottom_1orMoreVTX_2TrackVTX_energyFraction_normal_histo");
-  TH1F* histobottom5=filebottom.Get("bottom_1orMoreVTX_3TrackVTX_energyFraction_normal_histo");
-  TH1F* histobottom6=filebottom.Get("bottom_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo");
-  TH1F* histobottom7=filebottom.Get("bottom_1orMoreVTX_significance3d_histo");
-  TH1F* histobottom8=filebottom.Get("bottom_1orMoreVTX_2TrackVTX_mass_histo");
-  TH1F* histobottom9=filebottom.Get("bottom_1orMoreVTX_3orMoreTrackVTX_mass_histo");
-  TH1F* histocharm1=filecharm.Get("charm_noVTX_significance3d_histo");
-  TH1F* histocharm2=filecharm.Get("charm_noVTX_1SingleTrack_energyFraction_normal_histo");
-  TH1F* histocharm3=filecharm.Get("charm_noVTX_2orMoreSingleTrack_energyFraction_normal_histo");
-  TH1F* histocharm4=filecharm.Get("charm_1orMoreVTX_2TrackVTX_energyFraction_normal_histo");
-  TH1F* histocharm5=filecharm.Get("charm_1orMoreVTX_3TrackVTX_energyFraction_normal_histo");
-  TH1F* histocharm6=filecharm.Get("charm_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo");
-  TH1F* histocharm7=filecharm.Get("charm_1orMoreVTX_significance3d_histo");
-  TH1F* histocharm8=filecharm.Get("charm_1orMoreVTX_2TrackVTX_mass_histo");
-  TH1F* histocharm9=filecharm.Get("charm_1orMoreVTX_3orMoreTrackVTX_mass_histo");
-  TH1F* histolight1=filelight.Get("light_noVTX_significance3d_histo");
-  TH1F* histolight2=filelight.Get("light_noVTX_1SingleTrack_energyFraction_normal_histo");
-  TH1F* histolight3=filelight.Get("light_noVTX_2orMoreSingleTrack_energyFraction_normal_histo");
-  TH1F* histolight4=filelight.Get("light_1orMoreVTX_2TrackVTX_energyFraction_normal_histo");
-  TH1F* histolight5=filelight.Get("light_1orMoreVTX_3TrackVTX_energyFraction_normal_histo");
-  TH1F* histolight6=filelight.Get("light_1orMoreVTX_4orMoreTrackVTX_energyFraction_normal_histo");
-  TH1F* histolight7=filelight.Get("light_1orMoreVTX_significance3d_histo");
-  TH1F* histolight8=filelight.Get("light_1orMoreVTX_2TrackVTX_mass_histo");
-  TH1F* histolight9=filelight.Get("light_1orMoreVTX_3orMoreTrackVTX_mass_histo");
-  histobottom1->Write();
-  histobottom2->Write();
-  histobottom3->Write();
-  histobottom4->Write();
-  histobottom5->Write();
-  histobottom6->Write();
-  histobottom7->Write();
-  histobottom8->Write();
-  histobottom9->Write();
-  histocharm1->Write();
-  histocharm2->Write();
-  histocharm3->Write();
-  histocharm4->Write();
-  histocharm5->Write();
-  histocharm6->Write();
-  histocharm7->Write();
-  histocharm8->Write();
-  histocharm9->Write();
-  histolight1->Write();
-  histolight2->Write();
-  histolight3->Write();
-  histolight4->Write();
-  histolight5->Write();
-  histolight6->Write();
-  histolight7->Write();
-  histolight8->Write();
-  histolight9->Write();
-  fileoutput.Write();
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/writeNtuple.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/writeNtuple.cxx
deleted file mode 100644
index e436af4afa7e..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/likelihoodRoot/writeNtuple.cxx
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "readBTag.h"
-#include "readParticleJetTree.h"
-#include <TTree.h>
-#include <iostream>
-#include <TMath.h>
-
-using namespace std;
-
-int writeNtuple(void) {
-
-  cout << "starting" << endl;
-
-  readParticleJetTree* t=new readParticleJetTree();
-  readBTag* myBTag=new readBTag();
-  
-
-  Int_t nVTX;
-  Int_t nTracksAtVtx;
-  Int_t nSingleTracks;
-  Float_t energyFraction;
-  Float_t mass;
-  Float_t significance3d;
-  Int_t cat_nVTX;
-  Int_t cat_nTracksAtVtx;
-  Int_t cat_nSingleTracks;
-  Int_t cat_flavour;
-  Float_t IP3dlike;
-  Float_t IPlikecombold;
-  Int_t cat_oneVTX;
-  Float_t pT;
-  Float_t eta;
-  
-//  Int_t cat_twoTracks;
-  
-
-
-  const double s_pion=139.57018;
-
-  TFile *file=new TFile("simpleTree.root","recreate");
-  
-  TTree* myTree=new TTree("SVTree","SVTree");
-  
-  myTree->Branch("nVTX",&nVTX,"nVTX/I");
-  myTree->Branch("nTracksAtVtx",&nTracksAtVtx,"nTracksAtVtx/I");
-  myTree->Branch("nSingleTracks",&nSingleTracks,"nSingleTracks/I");
-  myTree->Branch("energyFraction",&energyFraction,"energyFraction/F");
-  myTree->Branch("mass",&mass,"mass/F");
-  myTree->Branch("significance3d",&significance3d,"significance3d/F");
-  myTree->Branch("cat_nVTX",&cat_nVTX,"cat_nVTX/I");
-  myTree->Branch("cat_nTracksAtVtx",&cat_nTracksAtVtx,"cat_nTracksAtVtx/I");
-  myTree->Branch("cat_nSingleTracks",&cat_nSingleTracks,"cat_nSingleTracks/I");
-  myTree->Branch("cat_flavour",&cat_flavour,"cat_flavour/I");
-  myTree->Branch("IP3dlike",&IP3dlike,"IP3dlike/F");
-  myTree->Branch("IPlikecombold",&IPlikecombold,"IPlikecombold/F");
-  myTree->Branch("cat_oneVTX",&cat_oneVTX,"cat_oneVTX/I");
-  myTree->Branch("pT",&pT,"pT/F");
-  myTree->Branch("eta",&eta,"eta/F");
-//  myTree->Branch("cat_twoTracks",&cat_twoTracks,"cat_twoTracks/I");
-  
-
-
-  Int_t num_entries=t->fChain->GetEntries();
-  
-  if (num_entries!=myBTag->fChain->GetEntries()) {
-    throw;
-  }
-
-  cout << "Total entries are: " << num_entries << endl;
-  for (Int_t i=0;i<num_entries;i++) {
-
-//    std::cout << " get entry " << i << std::endl;
-    myBTag->GetEntry(i);
-    IP3dlike=myBTag->WeightIP3D;
-    IPlikecombold=myBTag->Discriminator;
-//    std::cout << " finished get entry" << IP3dlike << " " << IPlikecombold << std::endl;
-   
-      
-    //    cout << " IP3dlike " << IP3dlike << endl;
-    
-    if (i % 10000 == 0 ) {
-      std::cout << " processing event number " << i << std::endl;
-    }
-
-    t->GetEntry(i);
-    cat_flavour=(Int_t)t->m_jet_flavour;
-    
-    // energy from primary vertex
-
-    if (fabs(t->m_jet_momentum_eta)<2.5&&t->m_jet_momentum_pt>15000.) {
-
-      eta=t->m_jet_momentum_eta;
-      pT=t->m_jet_momentum_pt;
-      
-    double primaryVertexEnergy=0;
-    
-    for (int j=0;j<t->number_primary;++j) {
-      
-      if (fabs(t->primary_IPd0[j])<3.5&&
-          fabs(t->primary_IPz0[j])<5.&&
-          t->primary_pT[j]>500.) 
-      {
-        primaryVertexEnergy+=TMath::Sqrt(t->primary_p[j]*t->primary_p[j]+s_pion*s_pion);
-      }
-      
-    }
-    
-    for (int o=0;o<t->neutral_particle_number;++o) 
-    {
-      if (t->neutral_particle_forIP[o]>0
-          &&
-          TMath::Sqrt(fabs(t->neutral_particle_IPchi2[o]))<3)
-      {
-        primaryVertexEnergy+=TMath::Sqrt(t->neutral_particle_mass[o]*
-                                         t->neutral_particle_mass[o]+
-                                         1./t->neutral_particle_qOverP[o]*
-                                         1./t->neutral_particle_qOverP[o]);
-      }
-    }
-    
-    primaryVertexEnergy+=t->jetVTXfit_energyFromPrimaryVtx;
-
-
-      
- 
-      nVTX=0;
-      nSingleTracks=0;
-
-     for (int q=0;q<t->jetVTXfit_clusternum;q++) 
-    {
-      if (t->jetVTXfit_dist[q]>0)
-      {
-        if (t->jetVTXfit_ntracks[q]>1)
-        {
-          nVTX+=1;
-        }
-        else
-        {
-          nSingleTracks+=1;
-        }
-      }
-    }
-
-
-      cat_nVTX=nVTX;
-      cat_nSingleTracks=nSingleTracks;
-
-      nTracksAtVtx=0;
-      energyFraction=0.;
-
-      for (int u=0;u<t->jetVTXfit_clusternum;++u) {
-        if (t->jetVTXfit_dist[u]>0) 
-        {
-          
-          if (t->jetVTXfit_ntracks[u]>1) {
-            nTracksAtVtx+=t->jetVTXfit_ntracks[u];
-
-          }
-
-          if (nVTX>0)
-          {
-            nTracksAtVtx+=t->jetVTXfit_nNeutracks[u];
-          }
-          //    if (t->jetVTXfit_ntracks[u]>1||nVTX==0) {
-//          if (t->jetVTXfit_ntracks[u]>1||nVTX==0) {
-          energyFraction+=TMath::Sqrt(t->jetVTXfit_p[u]*t->jetVTXfit_p[u]+
-                                      t->jetVTXfit_mass[u]*t->jetVTXfit_mass[u]);
-//                                      t->jetVTXfit_massWithNeu[u]*t->jetVTXfit_massWithNeu[u]);
-//            std::cout << " energy from sec: " << energyFraction << std::endl;
-            //}
-        }
-      }
-      
-      if (energyFraction+primaryVertexEnergy>0) {
-        energyFraction=energyFraction/(energyFraction+primaryVertexEnergy);
-      }
-      
-      cat_nTracksAtVtx=nTracksAtVtx;
-      mass=0.;
-      significance3d=0.;
-      if (nVTX>0) {
-	Float_t px(0.);
-	Float_t py(0.);
-	Float_t pz(0.);
-	Float_t dist(0.);
-	Float_t inverror(0.);
-	Float_t e(0.);
-	for (int u=0;u<t->jetVTXfit_clusternum;++u) {
-          if (t->jetVTXfit_dist[u]>0) 
-          {
-	  if (t->jetVTXfit_ntracks[u]>1) {
-	    dist+=t->jetVTXfit_dist[u]/t->jetVTXfit_errdist[u]/t->jetVTXfit_errdist[u];
-	    inverror+=1./t->jetVTXfit_errdist[u]/t->jetVTXfit_errdist[u];
-          }
-          px+=t->jetVTXfit_px[u];
-          py+=t->jetVTXfit_py[u];
-          pz+=t->jetVTXfit_pz[u];
-          e+=TMath::Sqrt(t->jetVTXfit_p[u]*t->jetVTXfit_p[u]+t->jetVTXfit_mass[u]*t->jetVTXfit_mass[u]);
-          }
-	}
-	if (e*e-px*px-py*py-pz*pz>0.) {
-	  mass=TMath::Sqrt(e*e-px*px-py*py-pz*pz);
-	  if (mass>5000.) {
-	    Double_t touse=mass-5000.;
-	    Double_t pi=TMath::Pi();
-	    mass = 5000.+5000./pi*2.*TMath::ATan(pi/2./5000.*touse);
-	  }
-	}
-        if (inverror>0) 
-        {
-          significance3d=dist/TMath::Sqrt(inverror);
-          significance3d=100./(TMath::Pi()/2.)*TMath::ATan(TMath::Pi()/2./100.*significance3d);
-        }
-        
-	//	}
-      } else {
-	Float_t px(0.);
-	Float_t py(0.);
-	Float_t pz(0.);
-	Float_t e(0.);
-	Float_t dist(0.);
-	Float_t inverror(0.);
-	for (int u=0;u<t->jetVTXfit_clusternum;++u) {
-          if (t->jetVTXfit_dist[u]>0) 
-          {
-            
-	  if (t->jetVTXfit_ntracks[u]==1) {
-	    dist+=t->jetVTXfit_dist[u]/t->jetVTXfit_errdist[u]/t->jetVTXfit_errdist[u];
-	    inverror+=1./t->jetVTXfit_errdist[u]/t->jetVTXfit_errdist[u];
-	    px+=t->jetVTXfit_px[u];
-	    py+=t->jetVTXfit_py[u];
-	    pz+=t->jetVTXfit_pz[u];
-	    e+=TMath::Sqrt(t->jetVTXfit_p[u]*t->jetVTXfit_p[u]+t->jetVTXfit_mass[u]*t->jetVTXfit_mass[u]);
-	  } else {
-	    //	    throw;
-	    std::cout << "ERRORE " << std::endl;
-	  }
-          }
-          
-	}
-	if (t->jetVTXfit_clusternum>0) {
-	  significance3d=dist/TMath::Sqrt(inverror);
-	  significance3d=100./(TMath::Pi()/2.)*TMath::ATan(TMath::Pi()/2./100.*significance3d);
-	}
-	if (e*e-px*px-py*py-pz*pz>0.) {
-	  mass=TMath::Sqrt(e*e-px*px-py*py-pz*pz);
-	  if (mass>5000.) {
-	    Double_t touse=mass-5000.;
-	    Double_t pi=TMath::Pi();
-	    mass = 5000.+5000./pi*2.*TMath::ATan(pi/2./5000.*touse);
-	  }
-	}
-      }
-      
-      //      if (nVTX>0) {
-
-      if (nVTX==0) 
-      {
-        if (nSingleTracks<2) 
-        {
-          cat_oneVTX=0;
-        }
-        else
-        {
-          cat_oneVTX=1;
-        }
-      }
-      else
-      {
-        if (nSingleTracks+nTracksAtVtx==2) 
-        {
-          cat_oneVTX=2;
-        }
-        else if (nSingleTracks+nTracksAtVtx==3)
-        {
-          cat_oneVTX=3;
-        }
-        else if (nSingleTracks+nTracksAtVtx>3)
-        {
-          cat_oneVTX=4;
-        }
-        else
-        {
-          std::cout <<" WRONG " << std::endl;
-        }
-        
-      }
-      
-        
-
-
-      myTree->Fill();
-      //      }
-    }
-  }
-  myTree->Write();
-  file->Write();
-}
-  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/doCalibrationForCOOL.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/doCalibrationForCOOL.C
deleted file mode 100644
index a67194eba817..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/doCalibrationForCOOL.C
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-
-gSystem->Load("../jetnetRoot/libTJetNet.so");
-gSystem->Load("prepareCalibrationFileForCOOL_C.so");
-prepareCalibrationFileForCOOL(true);
-
-}
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/prepareCalibrationFileForCOOL.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/prepareCalibrationFileForCOOL.C
deleted file mode 100644
index dd33d0b2f1c1..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/prepareFinalCalibrationFiles/prepareCalibrationFileForCOOL.C
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "../preparedatasets/collectionsToProcess.h"
-#include <TFile.h>
-#include <TH1.h>
-#include "../jetnetRoot/TNetworkToHistoTool.h"
-#include "../jetnetRoot/TTrainedNetwork.h"
-#include <vector>
-
-using namespace std;
-
-void prepareCalibrationFileForCOOL(bool withLikelihood=false,
-                                   TString calibrationFileName="../finalCalibFile/BTaggingCalibV2_JetFitter",
-                                   TString mainDirectoryName="../trainingResultsJetNet",
-                                   TString tagToUse="NeuralNetwork",
-                                   TString tagToUseForLikelihood="RooFitLikelihood",
-                                   TString likelihoodPDFDir="../trainingResultsLikelihoodHistos",
-                                   TString likelihoodCoefDir="../trainingResultsLikelihood")
-{
-
-
-  TNetworkToHistoTool networkToHisto;
-
-  vector<TString> collectionsToProcess=getCollectionsToProcess();
-  
-  vector<TString>::const_iterator collectionsToProcessBegin=collectionsToProcess.begin();
-  vector<TString>::const_iterator collectionsToProcessEnd=collectionsToProcess.end();
-  
-  for (vector<TString>::const_iterator collectionsToProcessIter=collectionsToProcessBegin;
-       collectionsToProcessIter!=collectionsToProcessEnd;
-       ++collectionsToProcessIter) 
-  {
-
-
-    
-    TString calibrationFileToWrite(calibrationFileName);
-    calibrationFileToWrite+="_";
-    calibrationFileToWrite+=*collectionsToProcessIter;
-    calibrationFileToWrite+=".root";
-
-    cout << " Writing calibration file: " << calibrationFileToWrite << endl;
-    TFile* calibrationFile=new TFile(calibrationFileToWrite,"recreate");
-  
-    calibrationFile->cd("/");
-
-    TString calibrationFileToTake=*collectionsToProcessIter;
-//    if (calibrationFileToTake=="Cone7H1TowerParticleJets")
-//    {
-//      calibrationFileToTake="Cone7H1TopoParticleJets";
-//    }
-    if (calibrationFileToTake=="Cone7H1TowerJets")
-    {
-      continue;
-    }
-    
-    calibrationFile->cd("/");
-    gDirectory->mkdir(tagToUse);
-    gDirectory->cd(tagToUse);
-
-    if (withLikelihood)
-    {
-      gDirectory->cd("/");
-      gDirectory->mkdir(tagToUseForLikelihood);
-    }
-
-
-    TString histoDirBase=mainDirectoryName+"/"+calibrationFileToTake+"/";
-
-    //now first work on combined with IP3
-    gDirectory->cd("/"+tagToUse);
-
-    gDirectory->mkdir("comb");
-    gDirectory->cd("comb");
-
-    TString inputRootFileName=histoDirBase+"comb/weights/weightMinimum.root";
-
-    cout << " Considering " << inputRootFileName << endl;
-
-    TFile* actualFile=new TFile(inputRootFileName);
-    TTrainedNetwork* myNetwork=(TTrainedNetwork*)actualFile->Get("TTrainedNetwork");
-    
-    cout << " Hidden Layers: " << myNetwork->getnHidden() << endl;
-    std::vector<TH1*> histoVector=networkToHisto.fromTrainedNetworkToHisto(myNetwork);
-
-    calibrationFile->cd("/"+tagToUse+"/comb/");
-
-    std::vector<TH1*>::const_iterator histoBegin=histoVector.begin();
-    std::vector<TH1*>::const_iterator histoEnd=histoVector.end();
-    
-    for (std::vector<TH1*>::const_iterator histoIter=histoBegin;histoIter!=histoEnd;
-         ++histoIter)
-    {
-
-      cout << " Iterator pointer: " << *histoIter << endl;
-      if ((*histoIter)->GetName()!="TObject")
-      {
-        cout << "--> writing out  histogram: " << (*histoIter)->GetName() << endl;
-        (*histoIter)->Write();
-      }
-      
-    }
-
-
-    //now first work on combined with IP3D
-    gDirectory->cd("/"+tagToUse);
-    gDirectory->mkdir("standalone");
-    gDirectory->cd("standalone");
-
-    inputRootFileName=histoDirBase+"standalone/weights/weightMinimum.root";
-
-    cout << " Considering " << inputRootFileName << endl;
-
-    TFile* actualFile2=new TFile(inputRootFileName);
-    myNetwork=(TTrainedNetwork*)actualFile2->Get("TTrainedNetwork");
-    histoVector=networkToHisto.fromTrainedNetworkToHisto(myNetwork);
-
-    calibrationFile->cd("/"+tagToUse+"/standalone/");
-
-    histoBegin=histoVector.begin();
-    histoEnd=histoVector.end();
-    
-    for (std::vector<TH1*>::const_iterator histoIter=histoBegin;histoIter!=histoEnd;
-         ++histoIter)
-    {
-     if ((*histoIter)->GetName()!="TObject")
-     {
-       cout << "--> writing out  histogram: " << (*histoIter)->GetName() << endl;
-       (*histoIter)->Write();
-     }
-    }
-
-//likelihoodPDFDir
-//likelihoodCoefDir
-
-    std::vector<TString> flavours;
-    flavours.push_back("bottom");
-    flavours.push_back("charm");
-    flavours.push_back("light");
-    
-
-    if (withLikelihood)
-    {
-      TString histoDirBasePDFs=likelihoodPDFDir+"/"+calibrationFileToTake+"/trainingResultsLikelihood/smoothedhistos_"+calibrationFileToTake+"_";
-//      gDirectory->cd("/"+tagToUseForLikelihood);
-        
-      for (std::vector<TString>::const_iterator iterFlavour=flavours.begin();iterFlavour!=flavours.end();++iterFlavour)
-      {
-
-        TString inputLikelihoodHistoFileName=histoDirBasePDFs+*iterFlavour+".root";
-      
-        cout << " Considering for likelihood " << inputLikelihoodHistoFileName << endl;
-
-        TFile* actualHistoFile=new TFile(inputLikelihoodHistoFileName);
-      
-        TList* myHistoList=gDirectory->GetListOfKeys();
-      
-        TIterator* myHistoListIterator=myHistoList->MakeIterator();
-      
-        do
-        {
-          actualHistoFile->cd("/");
-          TObject* next=myHistoListIterator->Next();
-          if (next==0) break;
-          if (gDirectory->Get(next->GetName())->ClassName()==TString("TH1F"))
-          {
-            TH1F* myHisto=(TH1F*)gDirectory->Get(next->GetName());
-            cout << " Writing out histogram: " << next->GetName() << endl;
-            calibrationFile->cd("/"+tagToUseForLikelihood);
-            myHisto->Write();
-          } else 
-          {
-            cout << " Cannot cast to a TH1F " << endl;
-          }
-        }
-        while (true);
-
-        actualHistoFile->Close();
-        delete actualHistoFile;
-        actualHistoFile=0;
-
-      }//end flavour loop
-
-      
-      TString histoDirBaseCoef=likelihoodCoefDir+"/coefficientsHistos_"+calibrationFileToTake;
-      gDirectory->cd("/"+tagToUseForLikelihood);
-        
-      TString inputLikelihoodCoefFileName=histoDirBaseCoef+".root";
-      
-      cout << " Considering for likelihood " << inputLikelihoodCoefFileName << endl;
-
-      TFile* actualCoefFile=new TFile(inputLikelihoodCoefFileName);
-      
-      TList* myCoefList=gDirectory->GetListOfKeys();
-      
-      TIterator* myCoefListIterator=myCoefList->MakeIterator();
-      
-      do
-      {
-        actualCoefFile->cd("/");
-        TObject* next=myCoefListIterator->Next();
-        if (next==0) break;
-        if (gDirectory->Get(next->GetName())->ClassName()==TString("TH1D"))
-        {
-          TH1D* myHisto=(TH1D*)gDirectory->Get(next->GetName());
-          cout << " Writing out histogram: " << next->GetName() << endl;
-          calibrationFile->cd("/"+tagToUseForLikelihood);
-          myHisto->Write();
-        } else 
-        {
-          cout << " Cannot cast to a TH1D " << endl;
-        }
-      }
-      while (true);
-
-      
-      actualCoefFile->Close();
-      delete actualCoefFile;
-      actualCoefFile=0;
-    }
-    
-
-
-    //now close collection file
-    calibrationFile->Write();
-    calibrationFile->Close();
-    delete calibrationFile;
-    calibrationFile=0;
-
-  }//end collections
-
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/collectionsToProcess.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/collectionsToProcess.h
deleted file mode 100644
index 3309218a1b10..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/collectionsToProcess.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <vector>
-#include <TString.h>
-
-using namespace std;
-
-vector<TString> getCollectionsToProcess() 
-{
-  
-  vector<TString> collectionsToProcess;
-  
-  //collectionsToProcess.push_back("Cone4H1TowerParticleJets");
-  //collectionsToProcess.push_back("Cone7H1TowerParticleJets");
-  //collectionsToProcess.push_back("Kt6H1TowerParticleJets");
-  //collectionsToProcess.push_back("Kt4H1TowerParticleJets");
-
-  collectionsToProcess.push_back("Cone4H1TopoJets");
-  collectionsToProcess.push_back("Cone7LCTopoJets");
-  collectionsToProcess.push_back("Kt4LCTopoJets");
-  collectionsToProcess.push_back("Kt6LCTopoJets");
-
-  collectionsToProcess.push_back("Cone4H1TowerJets");
- collectionsToProcess.push_back("Cone7H1TowerJets");
-
-  collectionsToProcess.push_back("Kt4TruthJets");
-  collectionsToProcess.push_back("Kt6TruthJets");
-  collectionsToProcess.push_back("Cone7TruthJets");
-  collectionsToProcess.push_back("Cone4TruthJets");
-
-  
-  return collectionsToProcess;
-  
-}
-
-vector<TString> getAllCollections() 
-{
-  
-  vector<TString> collectionsToProcess;
-  
-  collectionsToProcess.push_back("Cone4H1TowerParticleJets");
-  collectionsToProcess.push_back("Cone7H1TowerParticleJets");
-  collectionsToProcess.push_back("Kt6H1TowerParticleJets");
-  collectionsToProcess.push_back("Kt4H1TowerParticleJets");
-
-  collectionsToProcess.push_back("Cone4H1TopoParticleJets");
-  collectionsToProcess.push_back("Cone7H1TopoParticleJets");
-  collectionsToProcess.push_back("Kt6H1TopoParticleJets");
-  collectionsToProcess.push_back("Kt4H1TopoParticleJets");
-
-  collectionsToProcess.push_back("Cone4TruthParticleJets");
-  collectionsToProcess.push_back("Cone7TruthParticleJets");
-  collectionsToProcess.push_back("Kt6TruthParticleJets");
-  collectionsToProcess.push_back("Kt4TruthParticleJets");
-  
-
-//  collectionsToProcess.push_back("Cone4H1TowerParticleJets");
-
-  return collectionsToProcess;
-  
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/getPtEtaCategoryLikelihood.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/getPtEtaCategoryLikelihood.h
deleted file mode 100644
index b283abab0475..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/getPtEtaCategoryLikelihood.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <vector>
-#include <utility>
-#include <math.h>
-
-using namespace std;
-
-pair<int,double> getPtCategory(double Pt)
-{
-
-  double correctionfactor=1.;
-  int actualpT=-1;
-  double interval=1;
-  
-  if (fabs(Pt)<25*correctionfactor){
-    actualpT=0;
-  } else if (fabs(Pt)>=25*correctionfactor&&fabs(Pt)<35*correctionfactor) {
-    actualpT=1;
-//    interval=5;
-  } else if (fabs(Pt)>=35*correctionfactor&&fabs(Pt)<50*correctionfactor) {
-    actualpT=2;
-//    interval=15;
-  } else if (fabs(Pt)>=50*correctionfactor&&fabs(Pt)<80*correctionfactor) {
-    actualpT=3;
-//    interval=20;
-  } else if (fabs(Pt)>=80*correctionfactor&&fabs(Pt)<120*correctionfactor) {
-    actualpT=4;
-//    interval=40;
-  } else if (fabs(Pt)>=120*correctionfactor&&fabs(Pt)<200*correctionfactor) {
-    actualpT=5;
-//    interval=65/2;
-  } else if (fabs(Pt)>=200*correctionfactor) {
-    actualpT=6;
-//    interval=200/6;
-  }
-
-  return pair<int,double>(actualpT,interval);
-}
-
-pair<int,double> getEtaCategory(double eta)
-{
-
-  int actualeta=-1;
-  double interval=1;
-  
-  if (fabs(eta)>1.5){
-    actualeta=2;
-//    interval=2.;
-  } else if (fabs(eta)>=0.7&&fabs(eta)<1.5){
-    actualeta=1;
-//    interval=1.;
-  } else {
-    actualeta=0;
-//    interval=0.6;
-  }
-  
-  return pair<int,double>(actualeta,interval);
-}
-
-int getNPtBins()
-{
-  return 7;
-}
-
-int getNEtaBins()
-{
-  return 3;
-}
-
- 
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForLikelihood.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForLikelihood.C
deleted file mode 100644
index 180df20dc13a..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForLikelihood.C
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-gROOT->ProcessLine(".L readJFBTagAna.C+");
-gROOT->ProcessLine(".L readBaseBTagAnaTree.C+");
-gROOT->ProcessLine(".L writeNtuple_Official.cxx+");
-gROOT->ProcessLine(".L writeNtupleAll.C+");
-
-writeAllNtuples("../datasets/all.root",false);
-
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForNN.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForNN.C
deleted file mode 100644
index 9d19a20968b7..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/prepareAllNtuplesForNN.C
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-gROOT->ProcessLine(".L readJFBTagAna.C+");
-gROOT->ProcessLine(".L readBaseBTagAnaTree.C+");
-gROOT->ProcessLine(".L writeNtuple_Official.cxx+");
-gROOT->ProcessLine(".L writeNtupleAll.C+");
-
-writeAllNtuples("../datasets/all.root",true);
-
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.C
deleted file mode 100644
index 3e355bb3cb9b..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.C
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#define readBaseBTagAnaTree_cxx
-#include "readBaseBTagAnaTree.h"
-#include <TH2.h>
-#include <TStyle.h>
-#include <TCanvas.h>
-
-void readBaseBTagAnaTree::Loop()
-{
-//   In a ROOT session, you can do:
-//      Root > .L readBaseBTagAnaTree.C
-//      Root > readBaseBTagAnaTree t
-//      Root > t.GetEntry(12); // Fill t data members with entry number 12
-//      Root > t.Show();       // Show values of entry 12
-//      Root > t.Show(16);     // Read and show values of entry 16
-//      Root > t.Loop();       // Loop on all entries
-//
-
-//     This is the loop skeleton where:
-//    jentry is the global entry number in the chain
-//    ientry is the entry number in the current Tree
-//  Note that the argument to GetEntry must be:
-//    jentry for TChain::GetEntry
-//    ientry for TTree::GetEntry and TBranch::GetEntry
-//
-//       To read only selected branches, Insert statements like:
-// METHOD1:
-//    fChain->SetBranchStatus("*",0);  // disable all branches
-//    fChain->SetBranchStatus("branchname",1);  // activate branchname
-// METHOD2: replace line
-//    fChain->GetEntry(jentry);       //read all branches
-//by  b_branchname->GetEntry(ientry); //read only this branch
-   if (fChain == 0) return;
-
-   Long64_t nentries = fChain->GetEntriesFast();
-
-   Long64_t nbytes = 0, nb = 0;
-   for (Long64_t jentry=0; jentry<nentries;jentry++) {
-      Long64_t ientry = LoadTree(jentry);
-      if (ientry < 0) break;
-      nb = fChain->GetEntry(jentry);   nbytes += nb;
-      // if (Cut(ientry) < 0) continue;
-   }
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.h
deleted file mode 100644
index 44b5d800f5ae..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readBaseBTagAnaTree.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//////////////////////////////////////////////////////////
-// This class has been automatically generated on
-// Fri Feb  8 11:44:02 2008 by ROOT version 5.18/00
-// from TTree PerfTreeAll/Performance Tree for All
-// found on file: all5212.root
-//////////////////////////////////////////////////////////
-
-#ifndef readBaseBTagAnaTree_h
-#define readBaseBTagAnaTree_h
-
-#include <TROOT.h>
-#include <TChain.h>
-#include <TFile.h>
-
-class readBaseBTagAnaTree {
-public :
-   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
-   Int_t           fCurrent; //!current Tree number in a TChain
-
-   // Declaration of leaf types
-   Int_t           Flavour;
-   Double_t        DeltaRtoBorCorTau;
-   Double_t        Discriminator;
-   Double_t        JetMomentum;
-   Double_t        JetPt;
-   Double_t        JetEta;
-   Double_t        JetPhi;
-
-   // List of branches
-   TBranch        *b_Flavour;   //!
-   TBranch        *b_DeltaRtoBorCorTau;   //!
-   TBranch        *b_Discriminator;   //!
-   TBranch        *b_JetMomentum;   //!
-   TBranch        *b_JetPt;   //!
-   TBranch        *b_JetEta;   //!
-   TBranch        *b_JetPhi;   //!
-
-   readBaseBTagAnaTree(TTree *tree=0);
-   virtual ~readBaseBTagAnaTree();
-   virtual Int_t    Cut(Long64_t entry);
-   virtual Int_t    GetEntry(Long64_t entry);
-   virtual Long64_t LoadTree(Long64_t entry);
-   virtual void     Init(TTree *tree);
-   virtual void     Loop();
-   virtual Bool_t   Notify();
-   virtual void     Show(Long64_t entry = -1);
-};
-
-#endif
-
-#ifdef readBaseBTagAnaTree_cxx
-readBaseBTagAnaTree::readBaseBTagAnaTree(TTree *tree)
-{
-// if parameter tree is not specified (or zero), connect the file
-// used to generate this class and read the Tree.
-   if (tree == 0) {
-      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("all5212.root");
-      if (!f) {
-         f = new TFile("all5212.root");
-      }
-      tree = (TTree*)gDirectory->Get("PerfTreeAll");
-
-   }
-   Init(tree);
-}
-
-readBaseBTagAnaTree::~readBaseBTagAnaTree()
-{
-   if (!fChain) return;
-   delete fChain->GetCurrentFile();
-}
-
-Int_t readBaseBTagAnaTree::GetEntry(Long64_t entry)
-{
-// Read contents of entry.
-   if (!fChain) return 0;
-   return fChain->GetEntry(entry);
-}
-Long64_t readBaseBTagAnaTree::LoadTree(Long64_t entry)
-{
-// Set the environment to read one entry
-   if (!fChain) return -5;
-   Long64_t centry = fChain->LoadTree(entry);
-   if (centry < 0) return centry;
-   if (!fChain->InheritsFrom(TChain::Class()))  return centry;
-   TChain *chain = (TChain*)fChain;
-   if (chain->GetTreeNumber() != fCurrent) {
-      fCurrent = chain->GetTreeNumber();
-      Notify();
-   }
-   return centry;
-}
-
-void readBaseBTagAnaTree::Init(TTree *tree)
-{
-   // The Init() function is called when the selector needs to initialize
-   // a new tree or chain. Typically here the branch addresses and branch
-   // pointers of the tree will be set.
-   // It is normally not necessary to make changes to the generated
-   // code, but the routine can be extended by the user if needed.
-   // Init() will be called many times when running on PROOF
-   // (once per file to be processed).
-
-   // Set branch addresses and branch pointers
-   if (!tree) return;
-   fChain = tree;
-   fCurrent = -1;
-   fChain->SetMakeClass(1);
-
-   fChain->SetBranchAddress("Flavour", &Flavour, &b_Flavour);
-   fChain->SetBranchAddress("DeltaRtoBorCorTau", &DeltaRtoBorCorTau, &b_DeltaRtoBorCorTau);
-   fChain->SetBranchAddress("Discriminator", &Discriminator, &b_Discriminator);
-   fChain->SetBranchAddress("JetMomentum", &JetMomentum, &b_JetMomentum);
-   fChain->SetBranchAddress("JetPt", &JetPt, &b_JetPt);
-   fChain->SetBranchAddress("JetEta", &JetEta, &b_JetEta);
-   fChain->SetBranchAddress("JetPhi", &JetPhi, &b_JetPhi);
-   Notify();
-}
-
-Bool_t readBaseBTagAnaTree::Notify()
-{
-   // The Notify() function is called when a new file is opened. This
-   // can be either for a new TTree in a TChain or when when a new TTree
-   // is started when using PROOF. It is normally not necessary to make changes
-   // to the generated code, but the routine can be extended by the
-   // user if needed. The return value is currently not used.
-
-   return kTRUE;
-}
-
-void readBaseBTagAnaTree::Show(Long64_t entry)
-{
-// Print contents of entry.
-// If entry is not specified, print current entry
-   if (!fChain) return;
-   fChain->Show(entry);
-}
-Int_t readBaseBTagAnaTree::Cut(Long64_t entry)
-{
-// This function may be called from Loop.
-// returns  1 if entry is accepted.
-// returns -1 otherwise.
-   return 1;
-}
-#endif // #ifdef readBaseBTagAnaTree_cxx
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.C
deleted file mode 100644
index 0bad72e11fe7..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.C
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#define readJFBTagAna_cxx
-#include "readJFBTagAna.h"
-#include <TH2.h>
-#include <TStyle.h>
-#include <TCanvas.h>
-
-void readJFBTagAna::Loop()
-{
-//   In a ROOT session, you can do:
-//      Root > .L readJFBTagAna.C
-//      Root > readJFBTagAna t
-//      Root > t.GetEntry(12); // Fill t data members with entry number 12
-//      Root > t.Show();       // Show values of entry 12
-//      Root > t.Show(16);     // Read and show values of entry 16
-//      Root > t.Loop();       // Loop on all entries
-//
-
-//     This is the loop skeleton where:
-//    jentry is the global entry number in the chain
-//    ientry is the entry number in the current Tree
-//  Note that the argument to GetEntry must be:
-//    jentry for TChain::GetEntry
-//    ientry for TTree::GetEntry and TBranch::GetEntry
-//
-//       To read only selected branches, Insert statements like:
-// METHOD1:
-//    fChain->SetBranchStatus("*",0);  // disable all branches
-//    fChain->SetBranchStatus("branchname",1);  // activate branchname
-// METHOD2: replace line
-//    fChain->GetEntry(jentry);       //read all branches
-//by  b_branchname->GetEntry(ientry); //read only this branch
-   if (fChain == 0) return;
-
-   Long64_t nentries = fChain->GetEntriesFast();
-
-   Long64_t nbytes = 0, nb = 0;
-   for (Long64_t jentry=0; jentry<nentries;jentry++) {
-      Long64_t ientry = LoadTree(jentry);
-      if (ientry < 0) break;
-      nb = fChain->GetEntry(jentry);   nbytes += nb;
-      // if (Cut(ientry) < 0) continue;
-   }
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.h
deleted file mode 100644
index 167ee3978851..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/readJFBTagAna.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//////////////////////////////////////////////////////////
-// This class has been automatically generated on
-// Fri Feb  8 11:45:23 2008 by ROOT version 5.18/00
-// from TTree PerfTreeAll/Performance Tree for All
-// found on file: all5212.root
-//////////////////////////////////////////////////////////
-
-#ifndef readJFBTagAna_h
-#define readJFBTagAna_h
-
-#include <TROOT.h>
-#include <TChain.h>
-#include <TFile.h>
-
-class readJFBTagAna {
-public :
-   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
-   Int_t           fCurrent; //!current Tree number in a TChain
-
-   // Declaration of leaf types
-   Int_t           Flavour;
-   Double_t        DeltaRtoBorCorTau;
-   Double_t        Discriminator;
-   Double_t        JetMomentum;
-   Double_t        JetPt;
-   Double_t        JetEta;
-   Double_t        JetPhi;
-   Int_t           nVTX;
-   Int_t           nTracksAtVtx;
-   Int_t           nSingleTracks;
-   Double_t        energyFraction;
-   Double_t        mass;
-   Double_t        significance3d;
-   Double_t        deltaphi;
-   Double_t        deltaeta;
-
-   // List of branches
-   TBranch        *b_Flavour;   //!
-   TBranch        *b_DeltaRtoBorCorTau;   //!
-   TBranch        *b_Discriminator;   //!
-   TBranch        *b_JetMomentum;   //!
-   TBranch        *b_JetPt;   //!
-   TBranch        *b_JetEta;   //!
-   TBranch        *b_JetPhi;   //!
-   TBranch        *b_nVTX;   //!
-   TBranch        *b_nTracksAtVtx;   //!
-   TBranch        *b_nSingleTracks;   //!
-   TBranch        *b_energyFraction;   //!
-   TBranch        *b_mass;   //!
-   TBranch        *b_significance3d;   //!
-   TBranch        *b_deltaphi;   //!
-   TBranch        *b_deltaeta;   //!
-
-   readJFBTagAna(TTree *tree=0);
-   virtual ~readJFBTagAna();
-   virtual Int_t    Cut(Long64_t entry);
-   virtual Int_t    GetEntry(Long64_t entry);
-   virtual Long64_t LoadTree(Long64_t entry);
-   virtual void     Init(TTree *tree);
-   virtual void     Loop();
-   virtual Bool_t   Notify();
-   virtual void     Show(Long64_t entry = -1);
-};
-
-#endif
-
-#ifdef readJFBTagAna_cxx
-readJFBTagAna::readJFBTagAna(TTree *tree)
-{
-// if parameter tree is not specified (or zero), connect the file
-// used to generate this class and read the Tree.
-   if (tree == 0) {
-      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("all5212.root");
-      if (!f) {
-         f = new TFile("all5212.root");
-      }
-      tree = (TTree*)gDirectory->Get("PerfTreeAll");
-
-   }
-   Init(tree);
-}
-
-readJFBTagAna::~readJFBTagAna()
-{
-   if (!fChain) return;
-   delete fChain->GetCurrentFile();
-}
-
-Int_t readJFBTagAna::GetEntry(Long64_t entry)
-{
-// Read contents of entry.
-   if (!fChain) return 0;
-   return fChain->GetEntry(entry);
-}
-Long64_t readJFBTagAna::LoadTree(Long64_t entry)
-{
-// Set the environment to read one entry
-   if (!fChain) return -5;
-   Long64_t centry = fChain->LoadTree(entry);
-   if (centry < 0) return centry;
-   if (!fChain->InheritsFrom(TChain::Class()))  return centry;
-   TChain *chain = (TChain*)fChain;
-   if (chain->GetTreeNumber() != fCurrent) {
-      fCurrent = chain->GetTreeNumber();
-      Notify();
-   }
-   return centry;
-}
-
-void readJFBTagAna::Init(TTree *tree)
-{
-   // The Init() function is called when the selector needs to initialize
-   // a new tree or chain. Typically here the branch addresses and branch
-   // pointers of the tree will be set.
-   // It is normally not necessary to make changes to the generated
-   // code, but the routine can be extended by the user if needed.
-   // Init() will be called many times when running on PROOF
-   // (once per file to be processed).
-
-   // Set branch addresses and branch pointers
-   if (!tree) return;
-   fChain = tree;
-   fCurrent = -1;
-   fChain->SetMakeClass(1);
-
-   fChain->SetBranchAddress("Flavour", &Flavour, &b_Flavour);
-   fChain->SetBranchAddress("DeltaRtoBorCorTau", &DeltaRtoBorCorTau, &b_DeltaRtoBorCorTau);
-   fChain->SetBranchAddress("Discriminator", &Discriminator, &b_Discriminator);
-   fChain->SetBranchAddress("JetMomentum", &JetMomentum, &b_JetMomentum);
-   fChain->SetBranchAddress("JetPt", &JetPt, &b_JetPt);
-   fChain->SetBranchAddress("JetEta", &JetEta, &b_JetEta);
-   fChain->SetBranchAddress("JetPhi", &JetPhi, &b_JetPhi);
-   fChain->SetBranchAddress("nVTX", &nVTX, &b_nVTX);
-   fChain->SetBranchAddress("nTracksAtVtx", &nTracksAtVtx, &b_nTracksAtVtx);
-   fChain->SetBranchAddress("nSingleTracks", &nSingleTracks, &b_nSingleTracks);
-   fChain->SetBranchAddress("energyFraction", &energyFraction, &b_energyFraction);
-   fChain->SetBranchAddress("mass", &mass, &b_mass);
-   fChain->SetBranchAddress("significance3d", &significance3d, &b_significance3d);
-   fChain->SetBranchAddress("deltaphi", &deltaphi, &b_deltaphi);
-   fChain->SetBranchAddress("deltaeta", &deltaeta, &b_deltaeta);
-   Notify();
-}
-
-Bool_t readJFBTagAna::Notify()
-{
-   // The Notify() function is called when a new file is opened. This
-   // can be either for a new TTree in a TChain or when when a new TTree
-   // is started when using PROOF. It is normally not necessary to make changes
-   // to the generated code, but the routine can be extended by the
-   // user if needed. The return value is currently not used.
-
-   return kTRUE;
-}
-
-void readJFBTagAna::Show(Long64_t entry)
-{
-// Print contents of entry.
-// If entry is not specified, print current entry
-   if (!fChain) return;
-   fChain->Show(entry);
-}
-Int_t readJFBTagAna::Cut(Long64_t entry)
-{
-// This function may be called from Loop.
-// returns  1 if entry is accepted.
-// returns -1 otherwise.
-   return 1;
-}
-#endif // #ifdef readJFBTagAna_cxx
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtupleAll.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtupleAll.C
deleted file mode 100644
index 3658fab2deb2..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtupleAll.C
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "writeNtuple_Official.h"
-#include "collectionsToProcess.h"
-#include <TString.h>
-#include <iostream>
-
-using namespace std;
-
-
-void writeAllNtuples (TString inputfilename,
-                      bool forNN=false) 
-{
-  vector<TString> collectionsToProcess=getCollectionsToProcess();
-
-  vector<TString>::const_iterator collectionsToProcessBegin=collectionsToProcess.begin();
-  vector<TString>::const_iterator collectionsToProcessEnd=collectionsToProcess.end();
-  
-  for (vector<TString>::const_iterator collectionsToProcessIter=collectionsToProcessBegin;
-       collectionsToProcessIter!=collectionsToProcessEnd;
-       ++collectionsToProcessIter) 
-  {
-    
-    cout << " Writing ALL Ntuples: processing " << *collectionsToProcessIter << endl;
-    writeNtuple_Official(inputfilename,
-                         *collectionsToProcessIter,
-                         "AOD",
-                         forNN,
-                         false);
-  }
-
-  
-}
-
-
-
-        
-        
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.cxx
deleted file mode 100644
index e158b912c38f..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.cxx
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "readBaseBTagAnaTree.h"
-#include "readJFBTagAna.h"
-#include <TFile.h>
-#include <TTree.h>
-#include <iostream>
-#include "writeNtuple_Official.h"
-#include "getPtEtaCategoryLikelihood.h"
-#include "TRandom.h"
-#include <cmath>
-#include <vector>
-#include <algorithm>
-
-using namespace std;
-
-struct number_pair
-{
-  int first;
-  double second;
-  number_pair(int p1, double p2)
-    : first (p1), second (p2) {}
-  bool operator< (const number_pair& other) const
-  { return second > other.second; }
-};
-
-struct allinfos
-{
-  Int_t nVTX;
-  Int_t nTracksAtVtx;
-  Int_t nSingleTracks;
-  Double_t energyFraction;
-  Double_t mass;
-  Double_t significance3d;
-
-  Int_t cat_flavour;
-  Int_t bottom;
-  Int_t charm;
-  Int_t light;
-
-  Double_t discriminatorIP2D;
-  Double_t discriminatorIP3D;
-  Double_t discriminatorSV1;
-  Double_t discriminatorCOMB;
- 
-  Double_t weight;
- 
-  Double_t deltaR;
-  Double_t JetPt;
-  Double_t JetEta;
-  Int_t cat_pT;
-  Int_t cat_eta;
-};
-
-
-
-
-void writeNtuple_Official(TString inputFileName,
-                          TString jetCollectionName,
-                          TString suffix,
-                          bool forNN,
-                          bool randomize) 
-{
-  
-
-  TString jetCollection=jetCollectionName+suffix;
-
-  cout << " opening input file: " << inputFileName << endl << " processing to obtain: " << 
-      jetCollection << " root file "  << endl;
-  
-  TFile inputFile(inputFileName);
-
-
-  TString baseBTag("BTag_");
-  TString suffixIP2D("_IP2D/PerfTreeAll");
-  TString suffixIP3D("_IP3D/PerfTreeAll");
-  TString suffixSV1("_SV1/PerfTreeAll");
-  TString suffixCOMB("_COMB/PerfTreeAll");
-  TString suffixJF("_JetFitterTag/PerfTreeAll");
-
-  cout << "instantiating IP2D " << endl;
-  TTree* treeIP2D=(TTree*)inputFile.Get(baseBTag+jetCollection+suffixIP2D);
-  if (treeIP2D==0) throw std::string("Problem IP2D");
-  readBaseBTagAnaTree* readTreeIP2D= new readBaseBTagAnaTree(treeIP2D);
-  
-  cout << "instantiating IP3D " << endl;
-  TTree* treeIP3D=(TTree*)inputFile.Get(baseBTag+jetCollection+suffixIP3D);
-  if (treeIP3D==0) throw std::string("Problem IP3D");
-  readBaseBTagAnaTree* readTreeIP3D= new readBaseBTagAnaTree(treeIP3D);
-
-  cout << "instantiating SV1 " << endl;
-  TTree* treeSV1=(TTree*)inputFile.Get(baseBTag+jetCollection+suffixSV1);
-  if (treeSV1==0) throw std::string("Problem SV1");
-  readBaseBTagAnaTree* readTreeSV1= new readBaseBTagAnaTree(treeSV1);
-
-  cout << "instantiating COMB " << endl;
-  TTree* treeCOMB=(TTree*)inputFile.Get(baseBTag+jetCollection+suffixCOMB);
-  if (treeCOMB==0) throw std::string("Problem COMB");
-  readBaseBTagAnaTree* readTreeCOMB= new readBaseBTagAnaTree(treeCOMB);
-
-  cout << "instantiating JetFitterTag " << endl;
-  TTree* treeJF=(TTree*)inputFile.Get(baseBTag+jetCollection+suffixJF);
-  if (treeJF==0) throw std::string("Problem JF");
-  readJFBTagAna* readTreeJF=new readJFBTagAna(treeJF);
-  
-
-  Int_t nVTX;
-  Int_t nTracksAtVtx;
-  Int_t nSingleTracks;
-  Double_t energyFraction;
-  Double_t mass;
-  Double_t significance3d;
-
-  Int_t cat_flavour;
-  Int_t bottom;
-  Int_t charm;
-  Int_t light;
-
-  Double_t discriminatorIP2D;
-  Double_t discriminatorIP3D;
-  Double_t discriminatorSV1;
-  Double_t discriminatorCOMB;
- 
-  Double_t weight;
- 
-  Double_t deltaR;
-  Double_t JetPt;
-  Double_t JetEta;
-  Int_t cat_pT;
-  Int_t cat_eta;
-
-  //for the NN you need to get the number of b,c or light jets
-
-  Int_t num_entries=readTreeJF->fChain->GetEntries();
-
-  int numberb=0;
-  int numberc=0;
-  int numberl=0;
-
-  if (forNN) 
-  {
-
-    for (Long64_t i=0;i<num_entries;i++) {
-      
-      readTreeJF->GetEntry(i);
-      
-      if (readTreeJF->mass>-100)
-      {
-        if (abs(readTreeJF->Flavour)==5){
-          numberb+=1;
-        }
-        if (abs(readTreeJF->Flavour)==4){
-          numberc+=1;
-        }
-        if (abs(readTreeJF->Flavour==1)){
-          numberl+=1;
-        }
-      }
-    }
-  }
-  
-  //now you have to calculate the weights...
-  //(store them in a matrix for b,c or light jets...
-
-  cout << " number of b found : " << numberb << " c: " << numberc << " l: " << numberl << endl;
-
-  double correctionfactor=1;
-
-  
-  int numPtBins=getNPtBins();
-  int numEtaBins=getNEtaBins();
-
-  Double_t* weightsb=0;
-  Double_t* weightsl=0;
-  Double_t* weightsc=0;
-
-  Double_t* countb=0;
-  Double_t* countl=0;
-  Double_t* countc=0;
-
-  Double_t toleranceb=1;
-  Double_t tolerancec=1;
-  Double_t tolerancel=1;
-  TRandom random;
-
-
-  Double_t maxweightb=0;
-  Double_t maxweightl=0;
-  Double_t maxweightc=0;
-  
-  
-  if (forNN) 
-  {
-    
-    weightsb=new Double_t[numPtBins*numEtaBins];
-    weightsl=new Double_t[numPtBins*numEtaBins];
-    weightsc=new Double_t[numPtBins*numEtaBins];
-
-    countb=new Double_t[numPtBins*numEtaBins];
-    countl=new Double_t[numPtBins*numEtaBins];
-    countc=new Double_t[numPtBins*numEtaBins];
-
-    for (int i=0;i<numPtBins*numEtaBins;i++){
-      weightsb[i]=0;
-      weightsl[i]=0;
-      weightsc[i]=0;
-      countb[i]=0;
-      countl[i]=0;
-      countc[i]=0;
-    }
-    
-    for (Long64_t i=0;i<num_entries;i++) {
-      
-      readTreeJF->GetEntry(i);
-      
-      if (readTreeJF->mass<-100) continue;
-      
-      if (fabs(readTreeJF->JetEta)>2.5||readTreeJF->JetPt<=15.)  continue;
-
-      
-      pair<int,double> ptInfo=getPtCategory(readTreeJF->JetPt);
-      pair<int,double> etaInfo=getEtaCategory(readTreeJF->JetEta);
-
-      int actualpT=ptInfo.first;
-      int actualeta=etaInfo.first;
-      
-      int flavour=abs(readTreeJF->Flavour);
-
-//      cout << " actualpT " << actualpT << " actualeta " << actualeta << endl;
-      
-      switch (flavour)
-      {
-      case 5:
-        countb[actualpT+numPtBins*actualeta]+=1./(ptInfo.second*etaInfo.second);
-        break;
-      case 4:
-        countc[actualpT+numPtBins*actualeta]+=1./(ptInfo.second*etaInfo.second);
-        break;
-      case 1:
-        countl[actualpT+numPtBins*actualeta]+=1./(ptInfo.second*etaInfo.second);
-        break;
-      }
-
-    }
-    
-      
-    for (int i=0;i<numPtBins*numEtaBins;i++){
-//      cout << " for i=ptxeta = " << i << " weightsb[i] " << weightsb[i]
-//           << " weightsl[i] " << weightsl[i] << " weightsc[i] " << weightsc[i] << endl;
-      weightsb[i]= (Double_t)numberb / (Double_t)countb[i] ;
-      weightsl[i]= (Double_t)numberl / (Double_t)countl[i] ;
-      weightsc[i]= (Double_t)numberc / (Double_t)countc[i];
-
-      if (weightsb[i]>maxweightb) maxweightb=weightsb[i];
-      if (weightsl[i]>maxweightl) maxweightl=weightsl[i];
-      if (weightsc[i]>maxweightc) maxweightc=weightsc[i];
-
-    }
-  
-  }
-  
-
-  cout << " maxweightb: " << maxweightb << " maxweightc: " << maxweightc << 
-      " maxweightl: " << maxweightl << endl;
-
-  TFile* file=0;
-  
-  TString filename("../reduceddatasets/reduceddataset_");
-  filename+=jetCollectionName;
-  if (forNN)
-  {
-    filename+="_forNN";
-  }
-  filename+=".root";
-
-  file=new TFile(filename,"recreate");
-  
-  TTree* myTree=new TTree("SVTree","SVTree");
-
-  
-  myTree->Branch("nVTX",&nVTX,"nVTX/I");
-  myTree->Branch("nTracksAtVtx",&nTracksAtVtx,"nTracksAtVtx/I");
-  myTree->Branch("nSingleTracks",&nSingleTracks,"nSingleTracks/I");
-  myTree->Branch("energyFraction",&energyFraction,"energyFraction/D");
-  myTree->Branch("mass",&mass,"mass/D");
-  myTree->Branch("significance3d",&significance3d,"significance3d/D");
-
-  
-  if (forNN)
-  {
-    myTree->Branch("cat_pT",&cat_pT,"cat_pT/I");
-    myTree->Branch("cat_eta",&cat_eta,"cat_eta/I");
-    myTree->Branch("weight",&weight,"weight/D");
-    myTree->Branch("discriminatorIP3D",&discriminatorIP3D,"discriminatorIP3D/D");
-    myTree->Branch("bottom",&bottom,"bottom/I");
-    myTree->Branch("charm",&charm,"charm/I");
-    myTree->Branch("light",&light,"light/I");
-  }
-  
-
-
-  if (!forNN)
-  {
-    myTree->Branch("cat_flavour",&cat_flavour,"cat_flavour/I");
-//    myTree->Branch("deltaR",&deltaR,"deltaR/D");    
-//    myTree->Branch("JetPt",&JetPt,"JetPt/D");
-//    myTree->Branch("JetEta",&JetEta,"JetEta/D");
-//    myTree->Branch("discriminatorIP2D",&discriminatorIP2D,"discriminatorIP2D/D");
-//    myTree->Branch("discriminatorSV1",&discriminatorSV1,"discriminatorSV1/D");
-//    myTree->Branch("discriminatorCOMB",&discriminatorCOMB,"discriminatorCOMB/D");
-  }
-  
-
-  
-
-
-//  if (num_entries!=readTreeCOMB->fChain->GetEntries()) {
-//    throw std::string("event number doesn't match");
-//  }
-
-  //now randomize entries
-
-/*
-  std::vector<int> inputvalues;
-  
-  for (Int_t i=0;i<num_entries;i++) 
-  {
-    inputvalues.push_back(i);
-  }
-  
-  std::vector<int> outputvalues;
-  int counter=0;
-  do
-  {
-
-    int size=inputvalues.size();
-    if (size==0)
-    {
-      break;
-    }
-    double randomNumber=random.Uniform(0,size);
-    int nToTransfer=(int)(std::floor(randomNumber<size?randomNumber:0)+0.5);
-    vector<int>::iterator begin=inputvalues.begin();
-    begin+=nToTransfer;
-    outputvalues.push_back(inputvalues[nToTransfer]);
-    if (counter%100000==0)
-    {
-    cout << " Processing randomizing event: " << counter << 
-        " inputvalue " << inputvalues[nToTransfer] <<  endl;
-    }
-    
-    inputvalues.erase(begin);
-    counter+=1;
-
-
-  }
-  while (true);
-*/
-
-  std::vector<number_pair> outputvalues;
-  
-  for (Int_t i=0;i<num_entries;i++) 
-  {
-    outputvalues.push_back(number_pair(i,random.Uniform()));
-  }
-  
-  if (randomize)
-  {
-    
-    cout << " Doing sorting... " << endl;
-    std::sort (outputvalues.begin(), outputvalues.end());
-    cout << " End sorting ... " << endl;
-  }
-  
-
-  cout << "Total entries are: " << num_entries << endl;
-  Int_t i=0;
-
-  
-  vector<number_pair>::const_iterator begin=outputvalues.begin();
-  vector<number_pair>::const_iterator end=outputvalues.end();
-  
-  Int_t counter=0;
-  for (vector<number_pair>::const_iterator iter=begin;iter!=end;++iter)
-  {
-    i=(*iter).first;
-
-    //take only every fifth data point
-    if (!forNN)
-    {
-      if (counter%5 != 0)
-      {
-        counter+=1;
-        continue;
-      }
-    }
-    
-
-//    if (counter>1000000)
-//      break;
-//    }
-    
-
-    if (counter % 500000 == 0 ) {
-      std::cout << " processing event number " << counter << " data event: " << i << " which was event n. " << std::endl;
-    }
-    
-    counter+=1;
-     
-    
-    readTreeJF->GetEntry(i);
-
-
-    if (fabs(readTreeJF->JetEta)<2.5&&readTreeJF->JetPt>15.&&readTreeJF->mass>-100) {
-
-
-      JetPt=readTreeJF->JetPt;
-      JetEta=readTreeJF->JetEta;
-      cat_pT=getPtCategory(JetPt).first;
-      cat_eta=getEtaCategory(JetEta).first;
-      
-      cat_flavour=abs(readTreeJF->Flavour);
-      if (forNN)
-      {
-        bottom=0;
-        charm=0;
-        light=0;
-
-        bool throwevent(false);
-
-        switch (cat_flavour)
-        {
-        case 5:
-          bottom=1;
-          weight=weightsb[cat_pT+numPtBins*cat_eta];
-
-          if (forNN)
-          {
-            
-            if (weight<maxweightb/toleranceb)
-            {
-              if (random.Uniform()>weight*toleranceb/maxweightb)
-              {
-                throwevent=true;
-              }
-              weight=1.;//maxweightb/toleranceb;
-            }
-            else
-            {
-              weight/=(maxweightb/toleranceb);
-            }
-          } 
-            
-          
-          break;
-        case 4:
-          charm=1;
-          weight=weightsc[cat_pT+numPtBins*cat_eta];
-
-          if (forNN)
-          {
-            if (weight<maxweightc/tolerancec)
-            {
-              if (random.Uniform()>weight*tolerancec/maxweightc)
-              {
-                throwevent=true;
-              }
-              weight=1.;//maxweightc/tolerancec;
-            }
-            else
-            {
-              weight/=(maxweightc/tolerancec);
-            }
-          }
-          
-
-
-          break;
-        case 1:
-          light=1;
-          weight=weightsl[cat_pT+numPtBins*cat_eta];
-
-          if (forNN)
-          {
-            
-            if (weight<maxweightl/tolerancel)
-            {
-              if (random.Uniform()>weight*tolerancel/maxweightl)
-              {
-                throwevent=true;
-              }
-              weight=1.;//maxweightl/tolerancel;
-            }
-            else 
-            {
-              weight/=(maxweightl/tolerancel);
-            }
-            
-          }
-          
-          break;
-        }
-
-        if (throwevent) continue;
-
-      }
-      
-
- 
-
-      //read the others only on demand (faster)
-      readTreeIP2D->GetEntry(i);
-      readTreeIP3D->GetEntry(i);
-      readTreeSV1->GetEntry(i);
-      readTreeCOMB->GetEntry(i);
-
-      discriminatorIP3D=readTreeIP3D->Discriminator;
-//          readTreeIP3D->Discriminator>-10?readTreeIP3D->Discriminator:-10;
-      
-      if (!forNN)
-      {
-        discriminatorIP2D=readTreeIP2D->Discriminator;
-        discriminatorSV1=readTreeSV1->Discriminator;
-        discriminatorCOMB=readTreeCOMB->Discriminator;
-        deltaR=readTreeCOMB->DeltaRtoBorCorTau;
-      }
-      
-
-      nVTX=readTreeJF->nVTX;
-      nSingleTracks=readTreeJF->nSingleTracks;
-      nTracksAtVtx=readTreeJF->nTracksAtVtx;
-      energyFraction=readTreeJF->energyFraction;
-      mass=readTreeJF->mass;
-      significance3d=readTreeJF->significance3d;
-      myTree->Fill();
-      
-    }
-    
-  }
-
-
-  myTree->Write();
-  file->Write();
-  file->Close();
-  
-
-
-  /*
-  delete readTreeIP2D;
-  delete readTreeIP3D;
-  delete readTreeSV1;
-  delete readTreeCOMB;
-  delete readTreeJF;
-  */
-
-  inputFile.Close();
-
-  
-}
-  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.h b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.h
deleted file mode 100644
index 3bcc19c8ae17..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/preparedatasets/writeNtuple_Official.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <TString.h>
-
-using namespace std;
-
-void writeNtuple_Official(TString inputFileName="all.root",
-                          TString jetCollectionName="Cone4H1TowerParticleJets",
-                          TString suffix = "AOD",
-                          bool forNN = false,
-                          bool randomize = false);
-  
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/cleanAll.sh b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/cleanAll.sh
deleted file mode 100755
index 54c6cbe21a0d..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/cleanAll.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-for a in $(ls); do
-    echo "Cleaning directory: " $a
-    cd $a
-    rm -r comb
-    rm -r standalone
-    rm -r likelihood
-    rm -r trainingResultsLikelihood
-    cd ..
-done
\ No newline at end of file
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectories.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectories.C
deleted file mode 100644
index d40e50a6185e..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectories.C
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-{
-gROOT->ProcessLine(".L createDirectoriesMacro.C+");
-createDirectoriesMacro();
-}
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectoriesMacro.C b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectoriesMacro.C
deleted file mode 100644
index d894cdc9b554..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/createDirectoriesMacro.C
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "../preparedatasets/collectionsToProcess.h"
-#include <vector>
-#include "TSystem.h"
-
-using namespace std;
-
-void createDirectoriesMacro()
-{
-
-  gSystem->Exec("mkdir ../trainingResultsJetNet");
-  gSystem->Exec("mkdir ../trainingResultsLikelihoodHistos");
-  
-  std::vector<TString> collections=getCollectionsToProcess();
-
-  for (std::vector<TString>::const_iterator iter=collections.begin();
-       iter!=collections.end();iter++)
-  {
-    
-    TString command("mkdir ../trainingResultsJetNet/");
-    command+=*iter;
-    gSystem->Exec(command);
-    TString command2("mkdir ../trainingResultsLikelihoodHistos/");
-    command2+=*iter;
-    gSystem->Exec(command2);
-  }
-}
-
-
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_jetnet.sh b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_jetnet.sh
deleted file mode 100755
index 2256d0fa9280..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_jetnet.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-for a in $(ls); do
-    echo "Processing directory: " $a
-    cd $a
-
-    echo "Creating directories if missing"
-    if $(test ! -e comb);then mkdir comb;fi
-    if $(test ! -e standalone);then mkdir standalone;fi
-
-    echo "Processing comb"
-
-    cd comb
-
-    mkdir weights
-
-    echo "Linking necessary macros..."
-    ln -s ../../../jetnetRoot/libTJetNet.so
-    ln -s ../../../jetnetRoot/trainNN_cxx.so
-    ln -s ../../../jetnetRoot/doTraining.C
-
-    actualdir=$(pwd)
-
-    echo "Create batch comb file for " $a
-    
-    echo '================='
-    echo 'NNtraincomb' $a '.pbs'
-    echo '================='
-
-    filename=$(echo 'NNtraincomb'$a'.pbs')
-
-    
-
-    echo "#!/bin/sh" > $filename
-    echo "" >> $filename
-    echo "unset DISPLAY" >> $filename
-    echo "echo Runnin on host \`hostname\`" >> $filename
-    echo "cd  "$actualdir" " >> $filename
-    echo "root -b \"doTraining.C(\\\""$a"\\\",true)\"|tee logTraining.txt " >> $filename
-    echo "echo \"Finished\" " >> $filename
-    chmod a+x $filename
-
-    qsub -N $(echo "NN"$a"comb") -l qt=1nw,mem_alloc=100M,systemtype=4 $HOME/bin/SGE_Start $filename
-
-    cd ..
- 
-    echo "Processing standalone"
-    cd standalone
-    
-    mkdir weights
-
-    echo "Linking necessary macros..."
-    ln -s ../../../jetnetRoot/libTJetNet.so
-    ln -s ../../../jetnetRoot/trainNN_cxx.so
-    ln -s ../../../jetnetRoot/doTraining.C
-
-
-    actualdir=$(pwd)
-
-    echo "Create batch standalone file for " $a
-    
-    echo '================='
-    echo 'NNtrainstandalone' $a '.pbs'
-    echo '================='
-
-    filename=$(echo 'NNtrainstandalone'$a'.pbs')
-
-    
-
-    echo "#!/bin/sh" > $filename
-    echo "" >> $filename
-    echo "unset DISPLAY" >> $filename
-    echo "echo Runnin on host \`hostname\`" >> $filename
-    echo "cd  " $actualdir " " >> $filename
-    echo "root -b \"doTraining.C(\\\""$a"\\\",false)\"|tee logTraining.txt " >> $filename
-    echo "echo \"Finished\" " >>$filename
-
-    chmod a+x $filename
-
-    qsub -N $(echo "NN"$a"standalone") -l qt=1nw,mem_alloc=100M,systemtype=4 $HOME/bin/SGE_Start $filename
-
-    cd ../..;
-done
-
-   
-    
-	
- 
-    
-    
-    
-    
\ No newline at end of file
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_likelihood.sh b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_likelihood.sh
deleted file mode 100755
index 465b53805a0b..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/sendToBatch/sendToBatch_likelihood.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-for a in $(ls); do
-    echo "Processing directory: " $a
-    cd $a
-
-    echo "Creating directories if missing"
-    if $(test ! -e likelihood);then mkdir likelihood;fi
-
-    echo "Processing b"
-
-    mkdir trainingResultsLikelihood
-    mkdir trainingResultsLikelihood/plots
-
-    cd likelihood
-
-    ln -s ../../../likelihoodRoot/createTheHistograms.cxx
-    ln -s ../../../likelihoodRoot/createTheHistograms.h
-    ln -s ../../../likelihoodRoot/doCreateTheHistograms.C
-
-
-    actualdir=$(pwd)
-
-    echo "Create batch comb file for " $a
-    
-    echo '================='
-    echo 'LLtrainB' $a '.pbs'
-    echo '================='
-
-    filename=$(echo 'LLtrainB'$a'.pbs')
-
-    
-
-    echo "#!/bin/sh" > $filename
-    echo "" >> $filename
-    echo "unset DISPLAY" >> $filename
-    echo "echo Runnin on host \`hostname\`" >> $filename
-    echo "cd  "$actualdir" " >> $filename
-    echo "root -b \"doCreateTheHistograms.C(\\\""$a"\\\",5)\"|tee "$actualdir"/logTrainingB.txt " >> $filename
-    echo "echo \"Finished\" " >> $filename
-    chmod a+x $filename
-
-    qsub -N $(echo "LL"$a"B") -l qt=1nw,mem_alloc=2000M,systemtype=4 $HOME/bin/SGE_Start $filename
-
-    cd ..
- 
-    echo "Processing c"
-    cd likelihood
-
-    actualdir=$(pwd)
-
-    echo "Create batch comb file for " $a
-    
-    echo '================='
-    echo 'LLtrainC' $a '.pbs'
-    echo '================='
-
-    filename=$(echo 'LLtrainC'$a'.pbs')
-
-    
-
-    echo "#!/bin/sh" > $filename
-    echo "" >> $filename
-    echo "unset DISPLAY" >> $filename
-    echo "echo Runnin on host \`hostname\`" >> $filename
-    echo "cd  "$actualdir" " >> $filename
-    echo "root -b \"doCreateTheHistograms.C(\\\""$a"\\\",4)\"|tee "$actualdir"/logTrainingC.txt " >> $filename
-    echo "echo \"Finished\" " >> $filename
-    chmod a+x $filename
-    
-    qsub -N $(echo "LL"$a"C") -l qt=1nw,mem_alloc=2000M,systemtype=4 $HOME/bin/SGE_Start $filename
-
-    cd ..
-    echo "Processing l"
-    cd likelihood
-
-    actualdir=$(pwd)
-
-    echo "Create batch comb file for " $a
-    
-    echo '================='
-    echo 'LLtrainL' $a '.pbs'
-    echo '================='
-
-    filename=$(echo 'LLtrainL'$a'.pbs')
-
-    
-
-    echo "#!/bin/sh" > $filename
-    echo "" >> $filename
-    echo "unset DISPLAY" >> $filename
-    echo "echo Runnin on host \`hostname\`" >> $filename
-    echo "cd  "$actualdir" " >> $filename
-    echo "root -b \"doCreateTheHistograms.C(\\\""$a"\\\",1)\"|tee "$actualdir"/logTrainingL.txt " >> $filename
-    echo "echo \"Finished\" " >> $filename
-    chmod a+x $filename
-
-    qsub -N $(echo "LL"$a"L") -l qt=1nw,mem_alloc=2000M,systemtype=4 $HOME/bin/SGE_Start $filename
-
-    cd ../..;
-done
-
-   
-    
-	
- 
-    
-    
-    
-    
\ No newline at end of file
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/share/BTagAna_Rerun_forJetFitter.py b/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/share/BTagAna_Rerun_forJetFitter.py
deleted file mode 100644
index 85c40f049ae5..000000000000
--- a/PhysicsAnalysis/JetTagging/JetTagCalibUtils/JetFitterCalibUtils/share/BTagAna_Rerun_forJetFitter.py
+++ /dev/null
@@ -1,201 +0,0 @@
-
-# Python job to run b-tagging+analysis job on a pre-existing AOD
-
-#
-# run in 'Standard' mode or with all tracking algos?
-#
-from IOVDbSvc.IOVDbSvcConf import IOVDbSvc
-IOVDbSvc.GlobalTag="OFLCOND-SIM-00-00-03"
-
-
-allTrackingAlgos = False
-
-
-#theApp.Dlls += [ "GaudiAud" ]
-#theAuditorSvc = AuditorSvc()
-#theAuditorSvc.Auditors += [ "ChronoAuditor" ]
-#theApp.AuditAlgorithms = True 
-
-
-
-# ------ Geometry:
-#include( "AthenaCommon/AthenaCommonFlags.py" )
-#include( "RecExCommon/AllDet_detDescr.py")
-
-from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
-from AthenaCommon.AppMgr import theApp
-from AthenaCommon.AppMgr import ServiceMgr
-from AthenaCommon.GlobalFlags  import globalflags
-
-#DetDescrVersion = "ATLAS-CSC-02-01-00"
-DetDescrVersion = "ATLAS-GEO-02-01-00"
-#DetDescrVersion = "ATLAS-CSC-05-00-00"
-#GeoModelSvc.IgnoreTagDifference = True
-
-include( "RecExCommon/AllDet_detDescr.py")
-
-
-
-import AthenaPoolCnvSvc.ReadAthenaPool
-ServiceMgr.EventSelector.InputCollections = ["ZEBRA.P"]
-
-theApp.EvtMax = -1
-
-# ------ POOL:
-include( "PartPropSvc/PartPropSvc.py" )
-include( "AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py" )
-include( "EventAthenaPool/EventAthenaPool_joboptions.py" )
-#theApp.Dlls += [ "AthenaPoolUtilities" ]
-theApp.Dlls += ["CaloTools" ]
-theApp.Dlls += ["TileRecAlgs"]
-theApp.Dlls += ["LArClusterRec"]
-theApp.Dlls += ["CaloRec"]
-theApp.Dlls += ["TileRec"]
-include( "ParticleBuilderOptions/ESD_PoolCnv_jobOptions.py")
-include( "ParticleBuilderOptions/AOD_PoolCnv_jobOptions.py")
-include( "InDetEventCnvTools/InDetEventCnvTools_jobOptions.py" )
-include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py")
-
-
-####################################################END VERTEXING
-
-#REOBTAIN some of the Jet algorithms...
-from JetRec.JetGetters import *
-from JetRec.JetRecFlags import jetFlags
-
-jetFlags.inputFileType.set_Value('AOD')
-
-
-Kt6alg = make_StandardJetGetter('Kt', 0.6, 'LCTopo').jetAlgorithmHandle()
-Cone7alg = make_StandardJetGetter('Cone', 0.7, 'LCTopo').jetAlgorithmHandle()
-Kt4alg = make_StandardJetGetter('Kt', 0.4, 'LCTopo').jetAlgorithmHandle()
-#Cone4alg = make_StandardJetGetter('Cone', 0.4, 'LCTopo').jetAlgorithmHandle()
-
-Kt6Truthalg = make_StandardJetGetter('Kt', 0.6, 'Truth').jetAlgorithmHandle()
-Cone7Truthalg = make_StandardJetGetter('Cone', 0.7, 'Truth').jetAlgorithmHandle()
-Kt4Truthalg = make_StandardJetGetter('Kt', 0.4, 'Truth').jetAlgorithmHandle()
-#Cone4Truthalg = make_StandardJetGetter('Cone', 0.4, 'Truth').jetAlgorithmHandle()
-
-#Kt7alg.OutputLevel = 3
-#Kt5alg.OutputLevel = 2
-
-# ------ BTagging configuration:
-if not 'BTaggingFlags' in dir():
-          from BTagging.BTaggingFlags import BTaggingFlags
-BTaggingFlags.Print()
-BTaggingFlags.Runmodus      = "analysis" 
-BTaggingFlags.PoolInputType = "AOD"
-#BTaggingFlags.SoftEl = False
-#BTaggingFlags.SoftMu = False
-#BTaggingFlags.JetFitterTag = True
-BTaggingFlags.OutputLevel = INFO
-# rerun only cone 0.4 Jets
-BTaggingFlags.Jets=['Cone4H1Topo',
-                    'Cone4H1Tower',
-                    'Cone4Truth',
-                    'Cone7H1Tower',
-                    'Cone7LCTopo',
-                    'Kt4LCTopo',
-                    'Kt6LCTopo',
-                    'Kt6Truth',
-                    'Kt4Truth',
-                    'Cone7Truth'] 
-BTaggingFlags.CalibrationChannelAliases=['Cone4H1Tower->Cone4H1Topo',
-                                         'Cone4Truth->Cone4H1Topo',
-                                         'Cone7H1Tower->Cone4H1Topo',
-                                         'Cone7LCTopo->Cone4H1Topo',
-                                         'Kt4LCTopo->Cone4H1Topo',
-                                         'Kt6LCTopo->Cone4H1Topo',
-                                         'Kt6Truth->Cone4H1Topo',
-                                         'Kt4Truth->Cone4H1Topo',
-                                         'Cone7Truth->Cone4H1Topo']
-#
-# Steering (BEFORE including the other job options files)
-#
-
-if allTrackingAlgos:
-  include( "BTagging/MyBTagging_jobOptions.py" )
-else:	
-  BTaggingFlags.PrimaryVertexCollectionName = "VxPrimaryCandidate"
-  BTaggingFlags.TrackParticleCollectionName = "TrackParticleCandidate"
-  BTaggingFlags.CalibrationTag = "BTagCalib-02-00"
-  include( "BTagging/BTagging_jobOptions.py" )
-#  redo only on cone0.4 jets, disable b-tagging on other jet collections:
-#CW  import AthenaCommon.PropertiesManip as manip
-#  manip.removeFromList(theApp,'TopAlg',"Analysis::BJetBuilder/BJetBuilderCone7")
-#  manip.removeFromList(theApp,'TopAlg',"Analysis::BJetBuilder/BJetBuilderKt")
-
-
-
-
-
-
-# ------ BTagAna part:
-
-theApp.Dlls += [ "JetTagRTT" ]
-theApp.TopAlg += [ "BTagAna" ]
-Analysis = Algorithm( "BTagAna" )
-
-Analysis.JetCollection =  "Cone4H1TowerJets"
-Analysis.HistogramStreamName = "File1"
-Analysis.OutputLevel = INFO
-
-Analysis.SaveTrees = True
-
-Analysis.FlavourTrees = False
-
-# note that the new collection has a different name:
-# NOW: Has the tracking appendix added!!
-#      also run over the existing one without re-reconstructing
-Analysis.JetCollectionsForTree = [
-    'Cone4H1TopoJetsAOD',
-    'Cone4H1TowerJetsAOD',
-    'Cone4TruthJetsAOD',
-    'Cone7H1TowerJetsAOD',
-    'Cone7LCTopoJetsAOD',
-    'Kt4LCTopoJetsAOD',
-    'Kt6LCTopoJetsAOD',
-    'Kt6TruthJetsAOD',
-    'Kt4TruthJetsAOD',
-    'Cone7TruthJetsAOD'
-    ]
-
-#if allTrackingAlgos:
-#Analysis.JetCollectionsForTree += [
-#  "Cone4TowerJetsAODIP", 
-#  "Cone4TowerJetsAODXK", 
-#  "Cone4TowerJetsAODNT",
-#  ]
-
-Analysis.BTagAlgorithms = [
-    "JetProb",   
-    "IP2D"            ,
-    "IP3D"		  ,
-    "SV1" 		  ,
-    "SV2" 		  ,
-    "COMB"		  ,
-    "JetFitterTag"    ,
-    "JetFitterCOMB"   ,
-    "JetFitterTagNN",
-    "JetFitterCOMBNN",
-    "SoftMuon",
-    "SoftElectron"]
-
-Analysis.OutputLevel = INFO
-#
-
-
-# histogram file (rm file first otherwise crash):
-import commands
-stat, out = commands.getstatusoutput('rm BTagAna.root')
-THistSvc = Service("THistSvc")
-THistSvc.Output += ["File1 DATAFILE='BTagAna.root' OPT='RECREATE'"]
-
-
-
-MessageSvc = Service( "MessageSvc" )
-MessageSvc.OutputLevel = INFO
-MessageSvc.defaultLimit = 9999999  # all messages
-MessageSvc.Format = "% F%50W%S%7W%R%T %0W%M"
-
-
-- 
GitLab


From 21407e0af97afaecc53f986ea5882596ba2cd0ca Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 3 Jul 2020 18:49:17 +0200
Subject: [PATCH 020/217] Remove empty xAODHIEventCnv package

---
 Event/xAOD/xAODHIEventCnv/CMakeLists.txt | 7 -------
 1 file changed, 7 deletions(-)
 delete mode 100644 Event/xAOD/xAODHIEventCnv/CMakeLists.txt

diff --git a/Event/xAOD/xAODHIEventCnv/CMakeLists.txt b/Event/xAOD/xAODHIEventCnv/CMakeLists.txt
deleted file mode 100644
index 5078beea7233..000000000000
--- a/Event/xAOD/xAODHIEventCnv/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-################################################################################
-# Package: xAODHIEventCnv
-################################################################################
-
-# Declare the package name:
-atlas_subdir( xAODHIEventCnv )
-
-- 
GitLab


From 700e291e640567beec0380ddda72b793906ebbc5 Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Wed, 1 Jul 2020 17:12:57 +0100
Subject: [PATCH 021/217] Set up bones of ISF_SimulationSelectorsConfigNew and
 begin constructing its dependencies
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Correct errors and typos

Correct [get]AdditionalParticleParametrizationFileNames error (thanks Blaž)

Split ISF_ServicesCore to resolve circular dependency. Correct ConfigFlags.TruthStrategy to ConfigFlags.Sim.TruthStrategy

Correct python warnings caught by build

Remove multiple import
---
 .../python/BarcodeServicesConfigNew.py        | 138 ++-
 .../G4AtlasAlg/python/G4AtlasAlgConfigNew.py  |   3 +-
 .../G4AtlasApps/python/SimConfigFlags.py      |  26 +-
 .../python/G4AtlasUserActionConfigNew.py      | 102 +-
 .../python/ISF_ServicesConfigNew.py           | 310 ++++--
 .../python/ISF_ServicesCoreConfigNew.py       |  78 ++
 .../test/ISF_ServicesConfigNew_test.py        |   3 +-
 .../ISF_Tools/python/ISF_ToolsConfigNew.py    | 147 +++
 ...ISF_FastCaloSimParametrizationConfigNew.py |  20 +
 .../python/AdditionalConfigNew.py             | 938 ++++++++++++++++++
 .../ISF_FastCaloSimServicesConfigNew.py       | 108 ++
 .../python/ISF_Geant4CommonToolsConfigNew.py  |  43 +
 .../python/ISF_Geant4ServicesConfigNew.py     |  68 ++
 .../python/ISF_Geant4ToolsConfigNew.py        | 137 +++
 .../python/ISF_HepMC_ToolsConfigNew.py        | 226 +++--
 .../python/ISF_SimulationSelectorsConfig.py   |   2 +-
 .../ISF_SimulationSelectorsConfigNew.py       | 533 ++++++++++
 17 files changed, 2682 insertions(+), 200 deletions(-)
 create mode 100644 Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesCoreConfigNew.py
 create mode 100644 Simulation/ISF/ISF_Core/ISF_Tools/python/ISF_ToolsConfigNew.py
 create mode 100644 Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/ISF_FastCaloSimParametrizationConfigNew.py
 create mode 100644 Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfigNew.py
 create mode 100644 Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigNew.py
 create mode 100644 Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py
 create mode 100644 Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py
 create mode 100644 Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py
 create mode 100644 Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigNew.py

diff --git a/Simulation/Barcode/BarcodeServices/python/BarcodeServicesConfigNew.py b/Simulation/Barcode/BarcodeServices/python/BarcodeServicesConfigNew.py
index 2d9676536334..c275123490e4 100644
--- a/Simulation/Barcode/BarcodeServices/python/BarcodeServicesConfigNew.py
+++ b/Simulation/Barcode/BarcodeServices/python/BarcodeServicesConfigNew.py
@@ -1,17 +1,46 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+"""ComponentAccumulator BarcodeServices configurations
 
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
-BarcodeServices configurations
-Elmar Ritsch, 23/10/2014
-"""
-
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
-Barcode__LegacyBarcodeSvc=CompFactory.Barcode.LegacyBarcodeSvc
 
-#Functions yet to be migrated:
-#getMC15BarcodeSvc, getMC18BarcodeSvc, getMC18LLPBarcodeSvc, getPhysicsProcessBarcodeSvc, getMC15BarcodeSvc, getGlobalBarcodeSvc, getValidationBarcodeSvc, barcodeOffsetForTruthStrategy
+def BarcodeSvcCfg(ConfigFlags, **kwargs):
+    """Return the MCxBarcodeSvcCfg config flagged by Sim.TruthStrategy"""
+    stratmap = {
+        "MC12": MC12BarcodeSvcCfg,
+        "MC15": MC15BarcodeSvcCfg,
+        "MC12LLP": MC12LLPBarcodeSvcCfg,
+        "MC12Plus": MC12PlusBarcodeSvcCfg,
+        "MC15aPlus": MC15aPlusBarcodeSvcCfg,
+        "MC15aPlusLLP": MC15aPlusLLPBarcodeSvcCfg,
+        "MC15a": MC15aBarcodeSvcCfg,
+        "MC16": MC16BarcodeSvcCfg,
+        "MC16LLP": MC16LLPBarcodeSvcCfg,
+        "MC18": MC18BarcodeSvcCfg,
+        "MC18LLP": MC18LLPBarcodeSvcCfg,
+        "PhysicsProcess": PhysicsProcessBarcodeSvcCfg,
+        "Global": GlobalBarcodeSvcCfg,
+        "Validation": ValidationBarcodeSvcCfg,
+    }
+    MCxCfg = stratmap[ConfigFlags.Sim.TruthStrategy]
+    return MCxCfg(ConfigFlags, **kwargs)
+
+
+def MC15BarcodeSvcCfg(ConfigFlags, name="Barcode_MC15BarcodeSvc", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("FirstSecondaryVertexBarcode"   ,  -1000001 )
+    kwargs.setdefault("VertexIncrement"               ,        -1 )
+    kwargs.setdefault("FirstSecondaryBarcode"         ,   1000001 )
+    kwargs.setdefault("SecondaryIncrement"            ,         1 )
+    kwargs.setdefault("ParticleRegenerationIncrement" ,  10000000 )
+    kwargs.setdefault("DoUnderAndOverflowChecks"      ,      True )
+    kwargs.setdefault("EncodePhysicsProcessInVertexBC",     False )
+    svc = CompFactory.Barcode.GenericBarcodeSvc(name, **kwargs)
+    result.addService(svc, primary=True)
+    return result
+
 
 def MC12BarcodeSvcCfg(ConfigFlags, name="Barcode_MC12BarcodeSvc", **kwargs):
     result = ComponentAccumulator()
@@ -20,34 +49,101 @@ def MC12BarcodeSvcCfg(ConfigFlags, name="Barcode_MC12BarcodeSvc", **kwargs):
     kwargs.setdefault("FirstSecondaryBarcode"       , 200001)
     kwargs.setdefault("SecondaryIncrement"          , 1)
     kwargs.setdefault("ParticleGenerationIncrement" , 1000000)
-    result.addService(Barcode__LegacyBarcodeSvc(name, **kwargs))
+    svc = CompFactory.Barcode.LegacyBarcodeSvc(name, **kwargs)
+    result.addService(svc, primary=True)
     return result
 
 
-def getMC12LLPBarcodeSvcCfg(name="Barcode_MC12LLPBarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
+def MC12LLPBarcodeSvcCfg(ConfigFlags, name="Barcode_MC12LLPBarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
 
 
-def getMC12PlusBarcodeSvcCfg(name="Barcode_MC12PlusBarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
+def MC12PlusBarcodeSvcCfg(ConfigFlags, name="Barcode_MC12PlusBarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
 
 
 def MC15aPlusBarcodeSvcCfg(ConfigFlags, name="Barcode_MC15aPlusBarcodeSvc", **kwargs):
     return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
 
 
-def getMC15aPlusLLPBarcodeSvcCfg(name="Barcode_MC15aPlusLLPBarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
+def MC15aPlusLLPBarcodeSvcCfg(ConfigFlags, name="Barcode_MC15aPlusLLPBarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
+
+
+def MC15aBarcodeSvcCfg(ConfigFlags, name="Barcode_MC15aBarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
+
+
+def MC16BarcodeSvcCfg(ConfigFlags, name="Barcode_MC16BarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
+
+
+def MC16LLPBarcodeSvcCfg(ConfigFlags, name="Barcode_MC16LLPBarcodeSvc", **kwargs):
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
+
+
+def MC18BarcodeSvcCfg(ConfigFlags, name="Barcode_MC18BarcodeSvc", **kwargs):
+    kwargs.setdefault("FirstSecondaryVertexBarcode" ,  -1000001 )
+    kwargs.setdefault("FirstSecondaryBarcode"       ,   1000001 )
+    kwargs.setdefault("ParticleGenerationIncrement" ,  10000000 )
+    return MC12BarcodeSvcCfg(ConfigFlags, name, **kwargs)
 
 
-def getMC15aBarcodeSvcCfg(name="Barcode_MC15aBarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
+def MC18LLPBarcodeSvcCfg(ConfigFlags, name="Barcode_MC18LLPBarcodeSvc", **kwargs):
+    return MC18BarcodeSvcCfg(ConfigFlags, name, **kwargs)
 
 
-def getMC16BarcodeSvcCfg(name="Barcode_MC16BarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
+def PhysicsProcessBarcodeSvcCfg(ConfigFlags, name="Barcode_PhysicsProcessBarcodeSvc", **kwargs):
+    kwargs.setdefault("EncodePhysicsProcessInVertexBC",  False  )
+    kwargs.setdefault("FirstSecondaryVertexBarcode"   , -200000 )
+    kwargs.setdefault("VertexIncrement"               , -1000000)
+    kwargs.setdefault("FirstSecondaryBarcode"         ,  200001 )
+    kwargs.setdefault("SecondaryIncrement"            ,  1      )
+    kwargs.setdefault("EncodePhysicsProcessInVertexBC",  True   )
+    return MC15BarcodeSvcCfg(ConfigFlags, name, **kwargs)
+
+
+def GlobalBarcodeSvcCfg(ConfigFlags, name="Barcode_GlobalBarcodeSvc", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("FirstSecondaryVertexBarcode"   ,  -200000  )
+    kwargs.setdefault("VertexIncrement"               ,  -1000000 )
+    kwargs.setdefault("FirstSecondaryBarcode"         ,   200001  )
+    kwargs.setdefault("SecondaryIncrement"            ,   1       )
+    kwargs.setdefault("DoUnderAndOverflowChecks"      ,   True    )
+    kwargs.setdefault("EncodePhysicsProcessInVertexBC",   True    )
+    svc = CompFactory.Barcode.GlobalBarcodeSvc(name, **kwargs)
+    result.addService(svc, primary=True)
+    return result
+
 
+def ValidationBarcodeSvcCfg(ConfigFlags, name="Barcode_ValidationBarcodeSvc", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("FirstSecondaryVertexBarcode" , -200001)
+    kwargs.setdefault("VertexIncrement"             , -1)
+    kwargs.setdefault("FirstSecondaryBarcode"       , 200001)
+    kwargs.setdefault("SecondaryIncrement"          , 1)
+    kwargs.setdefault("ParticleGenerationIncrement" , 1000000)
+    kwargs.setdefault("DoUnderAndOverflowChecks"    , True)
+    svc = CompFactory.Barcode.ValidationBarcodeSvc(name, **kwargs)
+    result.addService(svc, primary=True)
+    return result
 
-def getMC16LLPBarcodeSvcCfg(name="Barcode_MC16LLPBarcodeSvc", **kwargs):
-    return MC12BarcodeSvcCfg(name, **kwargs)
 
+def barcodeOffsetForTruthStrategy(strategyName):
+    offsets = {'MC12':         200000,
+               'MC12LLP':      200000,
+               'MC12Plus':     200000,
+               'MC15a':        200000,
+               'MC15aPlus':    200000,
+               'MC15aPlusLLP': 200000,
+               'MC15':        1000000,
+               'MC16':         200000,
+               'MC16LLP':      200000,
+               'MC18':        1000000,
+               'MC18LLP':     1000000,
+               'Validation':   200000
+               }
+    currentOffset = offsets.get(strategyName)
+    if currentOffset is None:
+        raise RuntimeError("No barcode offset listed for truth strategy named "+str(strategyName))
+    return currentOffset
diff --git a/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfigNew.py b/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfigNew.py
index 62ccdbee199d..9c750c582f21 100644
--- a/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfigNew.py
+++ b/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfigNew.py
@@ -1,6 +1,7 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from G4AtlasServices.G4AtlasServicesConfigNew import DetectorGeometrySvcCfg, PhysicsListSvcCfg
-from ISF_Services.ISF_ServicesConfigNew import MC15aPlusTruthServiceCfg, GeoIDSvcCfg, InputConverterCfg
+from ISF_Services.ISF_ServicesConfigNew import MC15aPlusTruthServiceCfg, InputConverterCfg
+from ISF_Services.ISF_ServicesCoreConfigNew import GeoIDSvcCfg
 from G4AtlasTools.G4AtlasToolsConfigNew import SensitiveDetectorMasterToolCfg, FastSimulationMasterToolCfg
 from G4AtlasServices.G4AtlasUserActionConfigNew import UserActionSvcCfg
 from G4AtlasApps.G4Atlas_MetadataNew import writeSimulationParametersMetadata
diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index 009e4af15959..51d3efbd297b 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -30,7 +30,7 @@ def createSimConfigFlags():
     #in simflags
     scf.addFlag("Sim.ReleaseGeoModel",True)
     scf.addFlag("Sim.RecordFlux",False)
-    scf.addFlag("Sim.TruthStrategy","MC12") #todo - needs to have some extra functionality!
+    scf.addFlag("Sim.TruthStrategy", "MC12")
     scf.addFlag("Sim.G4Commands",["/run/verbose 2"])
     #in atlasflags
     scf.addFlag("Sim.FlagAbortedEvents",False)
@@ -67,9 +67,33 @@ def createSimConfigFlags():
     scf.addFlag("Sim.G4EquationOfMotion", "")
     scf.addFlag("Sim.UsingGeant4", True)
 
+    # for cosmics
+    #  volume(s) used to do cosmics filtering
+    #  G4 volume names from {"Muon", "Calo", "InnerDetector", "TRT_Barrel", "TRT_EC", "SCT_Barrel", "Pixel"}
+    scf.addFlag("Sim.CosmicFilterVolumeNames", ["InnerDetector"])
+    scf.addFlag("Sim.CosmicFilterID", "13") # PDG ID to be filtered
+    scf.addFlag("Sim.CosmicFilterPTmin", "5000") # min pT filtered in cosmics processing (MeV)
+    scf.addFlag("Sim.CosmicFilterPTmax", "6000") # max pT filtered in cosmics processing (MeV)
+
     # For ISF
     scf.addFlag("Sim.ISFRun",False)
     scf.addFlag("Sim.ISF.HITSMergingRequired", True)
     scf.addFlag("Sim.ISF.Simulator", "ATLFASTII")
+    scf.addFlag("Sim.ISF.DoTimeMonitoring", True) # bool: run time monitoring
+    scf.addFlag("Sim.ISF.ValidationMode", False) # bool: run ISF internal validation checks
+
+    scf.addFlag("Sim.FastCalo.ParamsInputFilename", "FastCaloSim/MC16/TFCSparam_v011.root") # filename of the input parametrizations file
+    scf.addFlag("Sim.FastCalo.CaloCellsName", "AllCalo") # StoreGate collection name for FastCaloSim hits
+    
+    scf.addFlag("Sim.FastShower.InputCollection", "TruthEvent") # StoreGate collection name of modified TruthEvent for legayc FastCaloSim use
+
+    # FastChain
+    # Setting the BCID for Out-of-Time PU events, list of int
+    scf.addFlag("Sim.FastChain.BCID", [1])
+    # weights for Out-of-Time PU events
+    scf.addFlag("Sim.FastChain.PUWeights_lar_em", [1.0]) # LAr EM
+    scf.addFlag("Sim.FastChain.PUWeights_lar_hec", [1.0]) # LAr HEC
+    scf.addFlag("Sim.FastChain.PUWeights_lar_bapre", [1.0]) # LAr Barrel presampler
+    scf.addFlag("Sim.FastChain.PUWeights_tile", [1.0]) # Tile
 
     return scf
diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py
index ca25e6390ee7..1b9c5f9651b5 100644
--- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py
+++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py
@@ -6,7 +6,6 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 from G4UserActions.G4UserActionsConfigNew import AthenaStackingActionToolCfg, AthenaTrackingActionToolCfg, LooperKillerToolCfg, G4SimTimerToolCfg, G4TrackCounterToolCfg
 
 
-
 # New function for all user action types
 def getDefaultActions(ConfigFlags):
     result = ComponentAccumulator()
@@ -27,27 +26,28 @@ def getDefaultActions(ConfigFlags):
     actions += [result.popToolsAndMerge( G4TrackCounterToolCfg(ConfigFlags) ) ]
 
     # Cosmic Perigee action
-    if ConfigFlags.Beam.Type == 'cosmics' and ConfigFlags.Sim.CavernBG:
-        actions += ['G4UA::CosmicPerigeeActionTool']
+    if ConfigFlags.Beam.Type == "cosmics" and ConfigFlags.Sim.CavernBG:
+        actions += ["G4UA::CosmicPerigeeActionTool"]
     # Cosmic filter
-    if ConfigFlags.Beam.Type == 'cosmics' and not ConfigFlags.Sim.ISFRun:
-        actions += ['G4UA::G4CosmicFilterTool']
+    if ConfigFlags.Beam.Type == "cosmics" and not ConfigFlags.Sim.ISFRun:
+        actions += ["G4UA::G4CosmicFilterTool"]
     if ConfigFlags.Sim.StoppedParticleFile:
-        actions += ['G4UA::StoppedParticleFilterTool',
-                    'G4UA::StoppedParticleActionTool']
+        actions += ["G4UA::StoppedParticleFilterTool",
+                    "G4UA::StoppedParticleActionTool"]
     # Hit wrapper action
-    if ConfigFlags.Sim.CavernBG == 'Read':
-        actions += ['G4UA::HitWrapperTool']
+    if ConfigFlags.Sim.CavernBG == "Read":
+        actions += ["G4UA::HitWrapperTool"]
     # Photon killer
-    if ConfigFlags.Sim.PhysicsList == 'QGSP_BERT_HP':
-        actions += ['G4UA::PhotonKillerTool']
+    if ConfigFlags.Sim.PhysicsList == "QGSP_BERT_HP":
+        actions += ["G4UA::PhotonKillerTool"]
     # Calo calibration default processing
-    if ConfigFlags.Sim.CalibrationRun == 'LAr+Tile':
-        actions+=['G4UA::CaloG4::CalibrationDefaultProcessingTool']
+    if ConfigFlags.Sim.CalibrationRun == "LAr+Tile":
+        actions+=["G4UA::CaloG4::CalibrationDefaultProcessingTool"]
 
     actions += [ result.popToolsAndMerge( LooperKillerToolCfg(ConfigFlags) ) ]
     return actions
 
+
 def UserActionSvcCfg(ConfigFlags, name="G4UA::UserActionSvc", **kwargs):
     """
     Get the standard UA svc configurable with all default actions added.
@@ -56,10 +56,82 @@ def UserActionSvcCfg(ConfigFlags, name="G4UA::UserActionSvc", **kwargs):
     result = ComponentAccumulator()
 
     # new user action tools
-    kwargs.setdefault('UserActionTools', getDefaultActions(ConfigFlags))
+    kwargs.setdefault("UserActionTools", getDefaultActions(ConfigFlags))
 
     # placeholder for more advanced config, if needed
     result.addService ( CompFactory.G4UA.UserActionSvc(name, **kwargs) )
 
     return result
-    
+
+
+def CTBUserActionSvcCfg(ConfigFlags, name="G4UA::CTBUserActionSvc", **kwargs):
+    result = ComponentAccumulator()
+    # FIXME migrate an alternative to this    
+    generalActions = getDefaultActions() + ["G4UA::LooperKillerTool"]
+    # This comment carried over from old style:
+    # FIXME: ADS these actions are not yet migrated to Hive
+    #if simFlags.SimLayout.get_Value()=="tb_LArH6_2004":
+    #    eoe=["LArHitsH6EventAction"]+eoe
+    #    eoe+=["LArGeoH62004EventAction"]
+    #    if simFlags.LArTB_H6Step.statusOn:
+    #        if simFlags.LArTB_H6Step.get_Value():
+    #            stepping+=["LArGeoH62004SteppingAction"]
+    #            event+=["RadLenNtuple"]
+    #            eoe+=["RadLenNtuple"]
+    #            stepping+=["RadLenNtuple"]
+
+    # New user action tools
+    kwargs.setdefault("UserActionTools", generalActions)
+
+    # placeholder for more advanced config, if needed
+    result.addService(CompFactory.G4UA.UserActionSvc(name, **kwargs))
+    return result
+
+
+def ISFUserActionSvcCfg(ConfigFlags, name="G4UA::ISFUserActionSvc", **kwargs):
+    result = ComponentAccumulator()
+    TrackProcessorUserAction = kwargs.pop("TrackProcessorUserAction",[])
+    PhysicsValidationUserAction = []
+    if ConfigFlags.Sim.ISF.ValidationMode:
+        PhysicsValidationUserAction = ["ISFG4PhysicsValidationUserActionTool"]
+    MCTruthUserAction = kwargs.pop("MCTruthUserAction",["ISFMCTruthUserActionTool"])
+    # FIXME migrate an alternative to this
+    #from G4AtlasApps.SimFlags import simFlags
+    #optActions = simFlags.OptionalUserActionList.get_Value()
+    #generalActions = (
+        #TrackProcessorUserAction + MCTruthUserAction +
+        #getDefaultActions() + optActions["General"] +
+        #PhysicsValidationUserAction
+    #)
+    #optActions = simFlags.OptionalUserActionList.get_Value()
+    generalActions = (
+        TrackProcessorUserAction + MCTruthUserAction +
+        getDefaultActions() + ["G4UA::LooperKillerTool"] +
+        PhysicsValidationUserAction
+    )
+
+    # New user action tools
+    kwargs.setdefault("UserActionTools", generalActions)
+    result.addService(CompFactory.G4UA.UserActionSvc(name, **kwargs))
+    return result
+
+
+def ISFFullUserActionSvcCfg(ConfigFlags, name="G4UA::ISFFullUserActionSvc", **kwargs):
+    # this configuration needs ISFMCTruthUserAction
+    # and FullG4TrackProcessorUserAction
+    kwargs.setdefault("TrackProcessorUserAction", ["FullG4TrackProcessorUserActionTool"])
+    return ISFUserActionSvcCfg(name, **kwargs)
+
+
+def ISFPassBackUserActionSvcCfg(ConfigFlags, name="G4UA::ISFPassBackUserActionSvc", **kwargs):
+    # this configuration needs ISFMCTruthUserAction and
+    # PassBackG4TrackProcessorUserAction
+    kwargs.setdefault("TrackProcessorUserAction", ["PassBackG4TrackProcessorUserActionTool"])
+    return ISFUserActionSvcCfg(name, **kwargs)
+
+
+def ISF_AFIIUserActionSvcCfg(ConfigFlags, name="G4UA::ISF_AFIIUserActionSvc", **kwargs):
+    # this configuration needs ISFMCTruthUserAction and
+    # AFII_G4TrackProcessorUserAction
+    kwargs.setdefault("TrackProcessorUserAction", ["AFII_G4TrackProcessorUserActionTool"])
+    return ISFUserActionSvcCfg(name, **kwargs)
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
index bf8300e697ee..7cefb98f4f53 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfigNew.py
@@ -1,158 +1,266 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""ComponentAccumulator service configuration for ISF
 
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
-Service configurations for ISF
-KG Tan, 17/06/2012
-"""
-
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
+from ISF_HepMC_Tools.ISF_HepMC_ToolsConfigNew import (
+    ParticleFinalStateFilterCfg, ParticlePositionFilterDynamicCfg,
+    EtaPhiFilterCfg, GenParticleInteractingFilterCfg,
+    KeepLLPDecayChildrenStrategyCfg,
+    KeepLLPHadronicInteractionChildrenStrategyCfg,
+    TruthStrategyGroupID_MC15Cfg,
+    TruthStrategyGroupIDHadInt_MC15Cfg,
+    TruthStrategyGroupCaloMuBrem_MC15Cfg,
+    TruthStrategyGroupCaloDecay_MC15Cfg,
+    LLPTruthStrategyCfg,
+    TruthStrategyGroupIDCfg,
+    TruthStrategyGroupIDHadIntCfg,
+    TruthStrategyGroupCaloMuBremCfg,
+    ParticleSimWhiteListCfg,
+)
+from BarcodeServices.BarcodeServicesConfigNew import BarcodeSvcCfg
 
-from BarcodeServices.BarcodeServicesConfigNew import MC15aPlusBarcodeSvcCfg
-from ISF_HepMC_Tools.ISF_HepMC_ToolsConfigNew import TruthStrategyGroupID_MC15Cfg, TruthStrategyGroupCaloMuBremCfg, TruthStrategyGroupCaloDecay_MC15Cfg, TruthStrategyGroupIDHadInt_MC15Cfg, ParticleFinalStateFilterCfg, ParticlePositionFilterDynamicCfg, EtaPhiFilterCfg, GenParticleInteractingFilterCfg
-from SubDetectorEnvelopes.SubDetectorEnvelopesConfigNew import EnvelopeDefSvcCfg
+
+def GenParticleFiltersToolCfg(ConfigFlags):
+    result = ComponentAccumulator()
+    genParticleFilterList = []
+    acc = ParticleFinalStateFilterCfg(ConfigFlags)
+    genParticleFilterList += [result.popToolsAndMerge(acc)]
+    if "ATLAS" in ConfigFlags.GeoModel.Layout or "atlas" in ConfigFlags.GeoModel.Layout:
+        if ConfigFlags.Beam.Type != "cosmics":
+            acc = ParticlePositionFilterDynamicCfg(ConfigFlags)
+            genParticleFilterList += [result.popToolsAndMerge(acc)]
+            if ((ConfigFlags.Sim.CavernBG in (False, "Signal")) and
+                (not ConfigFlags.Detector.SimulateCavern)):
+                acc = EtaPhiFilterCfg(ConfigFlags)
+                genParticleFilterList += [result.popToolsAndMerge(acc)]
+    acc = GenParticleInteractingFilterCfg(ConfigFlags)
+    genParticleFilterList += [result.popToolsAndMerge(acc)]
+    result.setPrivateTools(genParticleFilterList)
+    return result
 
 
-ISF__TruthSvc, ISF__GeoIDSvc, ISF__ISFEnvelopeDefSvc, ISF__InputConverter=CompFactory.getComps("ISF::TruthSvc","ISF::GeoIDSvc","ISF::ISFEnvelopeDefSvc","ISF::InputConverter",)
+def InputConverterCfg(ConfigFlags, name="ISF_InputConverter", **kwargs):
+    result = BarcodeSvcCfg(ConfigFlags)
+    kwargs.setdefault("BarcodeSvc", result.getPrimary())
+    kwargs.setdefault("UseGeneratedParticleMass", False)
+    acc_GenParticleFiltersList = GenParticleFiltersToolCfg(ConfigFlags)
+    kwargs.setdefault("GenParticleFilters", result.popToolsAndMerge(acc_GenParticleFiltersList) )
+    result.addService(CompFactory.ISF.InputConverter(name, **kwargs))
+    return result
 
-#Functions yet to be migrated:
-#getParticleBrokerSvcNoOrdering, getParticleBrokerSvc, getAFIIParticleBrokerSvc, getAFIIEnvelopeDefSvc, getAFIIGeoIDSvc
-#getLongLivedInputConverter, getValidationTruthService, getMC12BeamPipeTruthStrategies, getMC12IDTruthStrategies
-#getMC12CaloTruthStrategies, getMC12MSTruthStrategies, getMC12TruthService, getTruthService, getMC12LLPTruthService, getMC12PlusTruthService,  getMC15IDTruthStrategies
-#getMC15CaloTruthStrategies
 
-def ISFEnvelopeDefSvcCfg(ConfigFlags, name="ISF_ISFEnvelopeDefSvc", **kwargs):
-    result = EnvelopeDefSvcCfg(ConfigFlags)
-    # ATLAS common envlope definitions
-    kwargs.setdefault("ATLASEnvelopeDefSvc", result.getService("AtlasGeometry_EnvelopeDefSvc"))
+def LongLivedInputConverterCfg(ConfigFlags, name="ISF_LongLivedInputConverter", **kwargs):
+    result = ComponentAccumulator()
+    gpfilt = [
+        result.popToolsAndMerge(ParticleSimWhiteListCfg(ConfigFlags)),
+        result.popToolsAndMerge(ParticlePositionFilterDynamicCfg(ConfigFlags)),
+        result.popToolsAndMerge(EtaPhiFilterCfg(ConfigFlags)),
+        result.popToolsAndMerge(GenParticleInteractingFilterCfg(ConfigFlags)),
+    ]
+    kwargs.setdefault("GenParticleFilters", gpfilt)
+    kwargs.setdefault("QuasiStableParticlesIncluded", True)
+    return InputConverterCfg(name, **kwargs)
 
-    result.addService(ISF__ISFEnvelopeDefSvc(name, **kwargs))
-    return result
 
+# Generic Truth Service Configurations
+def TruthServiceCfg(ConfigFlags, **kwargs):
+    """Return the TruthService config flagged by Sim.TruthStrategy"""
+    stratmap = {
+        "": BlankTruthServiceCfg,
+        "MC12": MC12TruthServiceCfg,
+        "MC12LLP": MC12LLPTruthServiceCfg,
+        "MC12Plus": MC12PlusTruthServiceCfg,
+        "MC15": MC15TruthServiceCfg,
+        "MC15a": MC15aTruthServiceCfg,
+        "MC15aPlus": MC15aPlusTruthServiceCfg,
+        "MC15aPlusLLP": MC15aPlusLLPTruthServiceCfg,
+        "MC16": MC16TruthServiceCfg,
+        "MC16LLP": MC16LLPTruthServiceCfg,
+        "MC18": MC18TruthServiceCfg,
+        "MC18LLP": MC18LLPTruthServiceCfg,
+        "Validation": ValidationTruthServiceCfg,
+    }
+    xCfg = stratmap[ConfigFlags.Sim.TruthStrategy]
+    return xCfg(ConfigFlags, **kwargs)
+
+
+def GenericTruthServiceCfg(ConfigFlags, name="ISF_TruthService", **kwargs):
+    result = BarcodeSvcCfg(ConfigFlags)
+    kwargs.setdefault("BarcodeSvc", result.getPrimary())
 
+    kwargs.setdefault("SkipIfNoChildren", True)
+    kwargs.setdefault("SkipIfNoParentBarcode", True)
+    kwargs.setdefault("ForceEndVtxInRegions", [])
+
+    # Mimics old configuration, which is marked as `#FIXME this should be set in a nicer way."
+    long_lived_simulators = ["LongLived", "longLived", "QS"]
+    simulator = ConfigFlags.Sim.ISF.Simulator
+    is_long_lived_simulation = any(x in simulator for x in long_lived_simulators)
+    if is_long_lived_simulation:
+        kwargs.setdefault("QuasiStableParticlesIncluded", True)
 
-def GeoIDSvcCfg(ConfigFlags, name="ISF_GeoIDSvc", **kwargs):
-    result = ISFEnvelopeDefSvcCfg(ConfigFlags)
-    # with ISF volume definitions
-    kwargs.setdefault("EnvelopeDefSvc", result.getService("ISF_ISFEnvelopeDefSvc"))
-    result.addService(ISF__GeoIDSvc(name, **kwargs))
+    svc = CompFactory.ISF.TruthSvc(name, **kwargs)
+    result.addService(svc, primary=True)
     return result
 
 
-def GenParticleFiltersToolCfg(ConfigFlags):
-    result = ComponentAccumulator()
+def ValidationTruthServiceCfg(ConfigFlags, name="ISF_ValidationTruthService", **kwargs):
+    kwargs.setdefault("TruthStrategies", ["ISF_ValidationTruthStrategy"] )
+    kwargs.setdefault("IgnoreUndefinedBarcodes", True)
+    kwargs.setdefault("PassWholeVertices", True)
+    return GenericTruthServiceCfg(name, **kwargs)
 
-    #acc1 = ParticlePositionFilterDynamicCfg(ConfigFlags)
-    genParticleFilterList = []
 
-    acc1 = ParticleFinalStateFilterCfg(ConfigFlags)
-    #genParticleFilterList = ['ISF_ParticleFinalStateFilter'] # not used for Quasi-stable particle simulation
-    genParticleFilterList += [result.popToolsAndMerge(acc1)]
+# MC12 Truth Service Configurations
+def MC12BeamPipeTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupID"]
 
-    #from G4AtlasApps.SimFlags import simFlags
-    #if "ATLAS" in simFlags.SimLayout():
-    if "ATLAS" in ConfigFlags.GeoModel.Layout or "atlas" in ConfigFlags.GeoModel.Layout:
-        #from AthenaCommon.BeamFlags import jobproperties
-        #if jobproperties.Beam.beamType() != "cosmics":
 
-        if True:
-        #if ConfigFlags.Beam.Type != "cosmics":
+def MC12IDTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupID", "ISF_MCTruthStrategyGroupIDHadInt"]
 
-            acc2 = ParticlePositionFilterDynamicCfg(ConfigFlags)
-            genParticleFilterList += [result.popToolsAndMerge(acc2)]
-            #genParticleFilterList += ['ISF_ParticlePositionFilterDynamic']
 
+def MC12CaloTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupCaloMuBrem"]
 
-            #if (not simFlags.CavernBG.statusOn) or simFlags.CavernBG.get_Value() == 'Signal':
-            #if ConfigFlags.Sim.CavernBG == 'Signal': #or if off?
-            if True: 
-                acc3 = EtaPhiFilterCfg(ConfigFlags)
-                genParticleFilterList += [result.popToolsAndMerge(acc3)]
-                #genParticleFilterList += ['ISF_EtaPhiFilter']
 
-    acc4 = GenParticleInteractingFilterCfg(ConfigFlags)
-    genParticleFilterList += [result.popToolsAndMerge(acc4)]
-    #genParticleFilterList += ['ISF_GenParticleInteractingFilter']
+def MC12MSTruthStrategies():
+    return []
 
-    result.setPrivateTools(genParticleFilterList)
+
+def MC12TruthServiceCfg(ConfigFlags, name="ISF_MC12TruthService", **kwargs):
+    result = ComponentAccumulator()
+    if "TruthStrategies" not in kwargs:
+        truthCfgs = [
+            TruthStrategyGroupIDCfg,
+            TruthStrategyGroupIDHadIntCfg,
+            TruthStrategyGroupCaloMuBremCfg,
+        ]
+        truthStrats = [result.popToolsAndMerge(cfg(ConfigFlags)) for cfg in truthCfgs]
+        kwargs.setdefault("TruthStrategies", truthStrats)
+    kwargs.setdefault("IgnoreUndefinedBarcodes", False)
+    kwargs.setdefault("PassWholeVertices", True)
+    result.merge(GenericTruthServiceCfg(name, **kwargs))
     return result
 
 
-def InputConverterCfg(ConfigFlags, name="ISF_InputConverter", **kwargs):
+def BlankTruthServiceCfg(ConfigFlags, name="ISF_TruthService", **kwargs):
+    if ConfigFlags.ISF.ValidationMode:
+        return ValidationTruthServiceCfg(name, **kwargs)
+    else:
+        return MC12TruthServiceCfg(name, **kwargs)
+
+
+def MC12LLPTruthServiceCfg(ConfigFlags, name="ISF_MC12TruthLLPService", **kwargs):
     result = ComponentAccumulator()
+    truthCfgs = [
+        TruthStrategyGroupIDCfg,
+        TruthStrategyGroupIDHadIntCfg,
+        TruthStrategyGroupCaloMuBremCfg,
+        LLPTruthStrategyCfg,
+    ]
+    truthStrats = [result.popToolsAndMerge(cfg(ConfigFlags)) for cfg in truthCfgs]
+    kwargs.setdefault("TruthStrategies", truthStrats)
+    result.merge(MC12TruthServiceCfg(name, **kwargs))
+    return result
 
-    #just use this barcodeSvc for now. TODO - make configurable
-    #from G4AtlasApps.SimFlags import simFlags
-    #kwargs.setdefault('BarcodeSvc', simFlags.TruthStrategy.BarcodeServiceName())
-    result = MC15aPlusBarcodeSvcCfg(ConfigFlags)
-    kwargs.setdefault('BarcodeSvc', result.getService("Barcode_MC15aPlusBarcodeSvc") )
 
-    kwargs.setdefault("UseGeneratedParticleMass", False)
+def MC12PlusTruthServiceCfg(ConfigFlags, name="ISF_MC12PlusTruthService", **kwargs):
+    # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
+    import ROOT, cppyy
+    cppyy.loadDictionary("AtlasDetDescrDict")
+    AtlasRegion = ROOT.AtlasDetDescr
+    kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID] )
+    return MC12TruthServiceCfg(name, **kwargs)
 
-    acc_GenParticleFiltersList = GenParticleFiltersToolCfg(ConfigFlags)
-    kwargs.setdefault("GenParticleFilters", result.popToolsAndMerge(acc_GenParticleFiltersList) )
 
-    result.addService(ISF__InputConverter(name, **kwargs))
-    return result
+# MC15 Truth Service Configurations
+def MC15BeamPipeTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupID_MC15"]
 
 
-#
-# Generic Truth Service Configurations
-#
+def MC15IDTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupID_MC15", "ISF_MCTruthStrategyGroupIDHadInt_MC15"]
 
-def GenericTruthServiceCfg(ConfigFlags, name="ISF_TruthService", **kwargs):
-    #from G4AtlasApps.SimFlags import simFlags
-    #kwargs.setdefault('BarcodeSvc', simFlags.TruthStrategy.BarcodeServiceName())
-    result = MC15aPlusBarcodeSvcCfg(ConfigFlags)
-    kwargs.setdefault('BarcodeSvc', result.getService("Barcode_MC15aPlusBarcodeSvc") )
-    
-    kwargs.setdefault('SkipIfNoChildren', True)
-    kwargs.setdefault('SkipIfNoParentBarcode', True)
-    kwargs.setdefault('ForceEndVtxInRegions', [])
-    
-    # Mimics old configuration, which is marked as `#FIXME this should be set in a nicer way.'
-    long_lived_simulators = ['LongLived', 'longLived', 'QS']
-    simulator = ConfigFlags.Sim.ISF.Simulator
-    is_long_lived_simulation = any(x in simulator for x in long_lived_simulators)
-    if is_long_lived_simulation:
-        kwargs.setdefault('QuasiStableParticlesIncluded', True)
 
-    result.addService(ISF__TruthSvc(name, **kwargs))
-    return result
+def MC15CaloTruthStrategies():
+    return ["ISF_MCTruthStrategyGroupCaloMuBrem", "ISF_MCTruthStrategyGroupCaloMuBrem_MC15"]
+
+def MC15MSTruthStrategies():
+    return []
 
 
 def MC15TruthServiceCfg(ConfigFlags, name="ISF_MC15TruthService", **kwargs):
     result = ComponentAccumulator()
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
 
-    acc1 = TruthStrategyGroupID_MC15Cfg(ConfigFlags)
-    acc2 = TruthStrategyGroupIDHadInt_MC15Cfg(ConfigFlags)
-    acc3 = TruthStrategyGroupCaloMuBremCfg(ConfigFlags)
-    acc4 = TruthStrategyGroupCaloDecay_MC15Cfg(ConfigFlags)
-
-    kwargs.setdefault('TruthStrategies', [result.popToolsAndMerge(acc1),
-                                          result.popToolsAndMerge(acc2),
-                                          result.popToolsAndMerge(acc3), #FIXME this should be ISF_MCTruthStrategyGroupCaloMuBrem_MC15!!
-                                          result.popToolsAndMerge(acc4)])
-
-
-    kwargs.setdefault('IgnoreUndefinedBarcodes', False)
-    kwargs.setdefault('PassWholeVertices', False) # new for MC15 - can write out partial vertices.
-    kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID])
+    if "TruthStrategies" not in kwargs:
+        truthCfgs = [
+            TruthStrategyGroupID_MC15Cfg,
+            TruthStrategyGroupIDHadInt_MC15Cfg,
+            TruthStrategyGroupCaloMuBrem_MC15Cfg,
+            TruthStrategyGroupCaloDecay_MC15Cfg,
+        ]
+        truthStrats = [result.popToolsAndMerge(cfg(ConfigFlags)) for cfg in truthCfgs]
+        kwargs.setdefault("TruthStrategies", truthStrats)
+
+    kwargs.setdefault("IgnoreUndefinedBarcodes", False)
+    kwargs.setdefault("PassWholeVertices", False) # new for MC15 - can write out partial vertices.
+    kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
     accTruthService = GenericTruthServiceCfg(ConfigFlags, name, **kwargs)
     result.merge(accTruthService)
     return result
 
 
+def MC15aTruthServiceCfg(ConfigFlags, name="ISF_MC15aTruthService", **kwargs):
+    kwargs.setdefault("ForceEndVtxInRegions", [])
+    return MC15TruthServiceCfg(name, **kwargs)
+
+
 def MC15aPlusTruthServiceCfg(ConfigFlags, name="ISF_MC15aPlusTruthService", **kwargs):
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
-    kwargs.setdefault('ForceEndVtxInRegions', [AtlasRegion.fAtlasID])
+    kwargs.setdefault("ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
     result = MC15TruthServiceCfg(ConfigFlags, name, **kwargs)
     return result
 
+
+def MC15aPlusLLPTruthServiceCfg(ConfigFlags, name="ISF_MC15aPlusLLPTruthService", **kwargs):
+    result = ComponentAccumulator()
+    truthCfgs = [
+        KeepLLPDecayChildrenStrategyCfg,
+        KeepLLPHadronicInteractionChildrenStrategyCfg,
+        TruthStrategyGroupID_MC15Cfg,
+        TruthStrategyGroupIDHadInt_MC15Cfg,
+        TruthStrategyGroupCaloMuBrem_MC15Cfg,
+        TruthStrategyGroupCaloDecay_MC15Cfg,
+        LLPTruthStrategyCfg,
+    ]
+    truthStrats = [result.popToolsAndMerge(cfg(ConfigFlags)) for cfg in truthCfgs]
+    kwargs.setdefault("TruthStrategies", truthStrats)
+    return MC15aPlusTruthServiceCfg(name, **kwargs)
+
+
+# MC16 Truth Service Configurations
+def MC16TruthServiceCfg(ConfigFlags, name="ISF_MC16TruthService", **kwargs):
+    return MC15aPlusTruthServiceCfg(name, **kwargs)
+
+
+def MC16LLPTruthServiceCfg(ConfigFlags, name="ISF_MC16LLPTruthService", **kwargs):
+    return MC15aPlusLLPTruthServiceCfg(name, **kwargs)
+
+
+# MC18 Truth Service Configurations
+def MC18TruthServiceCfg(ConfigFlags, name="ISF_MC18TruthService", **kwargs):
+    return MC15aPlusTruthServiceCfg(name, **kwargs)
+
+
+def MC18LLPTruthServiceCfg(ConfigFlags, name="ISF_MC18LLPTruthService", **kwargs):
+    return MC15aPlusLLPTruthServiceCfg(name, **kwargs)
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesCoreConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesCoreConfigNew.py
new file mode 100644
index 000000000000..6dc3ea47bffa
--- /dev/null
+++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesCoreConfigNew.py
@@ -0,0 +1,78 @@
+"""ComponentAccumulator core ISF_Service configuration
+Provides local configuration to be imported without circular dependencies
+Complements ISF_ServicesConfigNew
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.SystemOfUnits import mm
+from SubDetectorEnvelopes.SubDetectorEnvelopesConfigNew import EnvelopeDefSvcCfg
+from BarcodeServices.BarcodeServicesConfigNew import BarcodeSvcCfg
+from ISF_Tools.ISF_ToolsConfigNew import ParticleKillerToolCfg
+
+
+def ParticleBrokerSvcNoOrderingCfg(ConfigFlags, name="ISF_ParticleBrokerSvcNoOrdering", **kwargs):
+    kwargs.setdefault("EntryLayerTool", "ISF_EntryLayerTool") # TODO
+    kwargs.setdefault("GeoIDSvc", "ISF_GeoIDSvc") # TODO
+    kwargs.setdefault("AlwaysUseGeoIDSvc", False)
+    kwargs.setdefault("ValidateGeoIDs", ConfigFlags.ISF.ValidationMode)
+    kwargs.setdefault("ValidationOutput", ConfigFlags.ISF.ValidationMode)
+    kwargs.setdefault("ValidationStreamName", "ParticleBroker")
+    result = BarcodeSvcCfg(ConfigFlags)
+    kwargs.setdefault("BarcodeService", result.getPrimary())
+    result.addService(CompFactory.ISF.ParticleBrokerDynamicOnReadIn(name, **kwargs))
+    return result
+
+
+def ParticleBrokerSvcCfg(ConfigFlags, name="ISF_ParticleBrokerSvc", **kwargs):
+    #kwargs.setdefault("ParticleOrderingTool", "ISF_InToOutSubDetOrderingTool")
+    kwargs.setdefault("ParticleOrderingTool", "ISF_ParticleOrderingTool") # TODO
+    return ParticleBrokerSvcNoOrderingCfg(name, **kwargs)
+
+
+def AFIIParticleBrokerSvcCfg(ConfigFlags, name="ISF_AFIIParticleBrokerSvc", **kwargs):
+    kwargs.setdefault("EntryLayerTool", "ISF_AFIIEntryLayerTool") # TODO
+    return ParticleBrokerSvcCfg(name, **kwargs)
+
+
+def ISFEnvelopeDefSvcCfg(ConfigFlags, name="ISF_ISFEnvelopeDefSvc", **kwargs):
+    result = EnvelopeDefSvcCfg(ConfigFlags)
+    # ATLAS common envlope definitions
+    kwargs.setdefault("ATLASEnvelopeDefSvc", result.getService("AtlasGeometry_EnvelopeDefSvc"))
+    result.addService(CompFactory.ISF.ISFEnvelopeDefSvc(name, **kwargs))
+    return result
+
+
+def GeoIDSvcCfg(ConfigFlags, name="ISF_GeoIDSvc", **kwargs):
+    result = ISFEnvelopeDefSvcCfg(ConfigFlags)
+    # with ISF volume definitions
+    kwargs.setdefault("EnvelopeDefSvc", result.getService("ISF_ISFEnvelopeDefSvc"))
+    result.addService(CompFactory.ISF.GeoIDSvc(name, **kwargs))
+    return result
+
+
+def AFIIEnvelopeDefSvcCfg(ConfigFlags, name="ISF_AFIIEnvelopeDefSvc", **kwargs):
+    result = EnvelopeDefSvcCfg(ConfigFlags)
+    # ATLAS common envlope definitions
+    kwargs.setdefault("ISFEnvelopeDefSvc", result.getService("AtlasGeometry_EnvelopeDefSvc"))
+    kwargs.setdefault("InDetMaxExtentZ", 3549.5*mm)
+    result.addService(CompFactory.ISF.AFIIEnvelopeDefSvc(name, **kwargs))
+    return result
+
+
+def AFIIGeoIDSvcCfg(ConfigFlags, name="ISF_AFIIGeoIDSvc", **kwargs):
+    result = AFIIEnvelopeDefSvcCfg(ConfigFlags)
+    kwargs.setdefault("EnvelopeDefSvc", result.getService("ISF_AFIIEnvelopeDefSvc"))
+    result.addService(CompFactory.ISF.GeoIDSvc(name, **kwargs))
+    return result
+
+
+# previously in LegacySimServicesConfig
+def ParticleKillerSvcCfg(ConfigFlags, name="ISF_ParticleKillerSvc", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("Identifier", "ParticleKiller")
+    kwargs.setdefault("SimulatorTool", ParticleKillerToolCfg(ConfigFlags))
+    svc = CompFactory.ISF.LegacySimSvc(name, **kwargs)
+    result.addService(svc)
+    return result
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/ISF_ServicesConfigNew_test.py b/Simulation/ISF/ISF_Core/ISF_Services/test/ISF_ServicesConfigNew_test.py
index 0a37a5d11f0a..61c0001c8ed7 100755
--- a/Simulation/ISF/ISF_Core/ISF_Services/test/ISF_ServicesConfigNew_test.py
+++ b/Simulation/ISF/ISF_Core/ISF_Services/test/ISF_ServicesConfigNew_test.py
@@ -28,7 +28,8 @@ if __name__ == '__main__':
   # Finalize 
   ConfigFlags.lock()
 
-  from ISF_Services.ISF_ServicesConfigNew import MC15aPlusTruthServiceCfg, GeoIDSvcCfg, InputConverterCfg
+  from ISF_Services.ISF_ServicesConfigNew import MC15aPlusTruthServiceCfg, InputConverterCfg
+  from ISF_Services.ISF_ServicesCoreConfigNew import GeoIDSvcCfg
 
   ## Initialize a new component accumulator
   cfg = MainServicesCfg(ConfigFlags)
diff --git a/Simulation/ISF/ISF_Core/ISF_Tools/python/ISF_ToolsConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Tools/python/ISF_ToolsConfigNew.py
new file mode 100644
index 000000000000..2b8c4355e8c3
--- /dev/null
+++ b/Simulation/ISF/ISF_Core/ISF_Tools/python/ISF_ToolsConfigNew.py
@@ -0,0 +1,147 @@
+"""ComponentAccumulator tool configuration for ISF
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.SystemOfUnits import MeV
+from BarcodeServices.BarcodeServicesConfigNew import BarcodeSvcCfg
+
+
+def ParticleHelperCfg(flags, name="ISF_ParticleHelper", **kwargs):
+    acc = BarcodeSvcCfg(flags)
+    kwargs.setdefault("BarcodeSvc", acc.getPrimary())
+    acc.setPrivateTools(CompFactory.ISF.ParticleHelper(name, **kwargs))
+    return acc
+
+
+def MemoryMonitorToolCfg(flags, name="ISF_MemoryMonitor", **kwargs):
+    return CompFactory.ISF.MemoryMonitoringTool(name, **kwargs)
+
+
+def EntryLayerFilterCfg(ConfigFlags, **kwargs):
+    """Return the MCxEntryLayerFilterCfg config flagged by Sim.TruthStrategy"""
+    stratmap = {
+        "MC12": MC12EntryLayerFilterCfg,
+        "MC12LLP": MC12LLPEntryLayerFilterCfg,
+        "MC12Plus": MC12PlusEntryLayerFilterCfg,
+        "MC15": MC15EntryLayerFilterCfg,
+        "MC15a": MC15aEntryLayerFilterCfg,
+        "MC15aPlus": MC15aPlusEntryLayerFilterCfg,
+        "MC15aPlusLLP": MC15aPlusLLPEntryLayerFilterCfg,
+        "MC16": MC16EntryLayerFilterCfg,
+        "MC16LLP": MC16LLPEntryLayerFilterCfg,
+        "MC18": MC18EntryLayerFilterCfg,
+        "MC18LLP": MC18LLPEntryLayerFilterCfg,
+        "Validation": ValidationEntryLayerFilterCfg,
+        "Cosmic": CosmicEventFilterToolCfg,
+    }
+    MCxCfg = stratmap[ConfigFlags.Sim.TruthStrategy]
+    return MCxCfg(ConfigFlags, **kwargs)
+
+
+def MC12EntryLayerFilterCfg(flags, name="ISF_MC12EntryLayerFilter", **kwargs):
+    kwargs.setdefault("AllowOnlyDefinedBarcodes", True)
+    kwargs.setdefault("AllowOnlyLegacyPrimaries", False)
+    kwargs.setdefault("LegacyParticleGenerationIncrement", 1000000)
+    kwargs.setdefault("LegacyFirstSecondaryBarcode", 200001)
+    return CompFactory.ISF.GenericBarcodeFilter(name, **kwargs)
+
+
+def MC12LLPEntryLayerFilterCfg(flags, name="ISF_MC12LLPEntryLayerFilter", **kwargs):
+    return MC12EntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC12PlusEntryLayerFilterCfg(flags, name="ISF_MC12PlusEntryLayerFilter", **kwargs):
+    return MC12EntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC15EntryLayerFilterCfg(flags, name="ISF_MC15EntryLayerFilter", **kwargs):
+    kwargs.setdefault("MinEkinCharged", 100.*MeV)
+    kwargs.setdefault("MinEkinNeutral", -1.)
+    return CompFactory.ISF.EntryLayerFilter(name, **kwargs  )
+
+
+def MC15aEntryLayerFilterCfg(flags, name="ISF_MC15aEntryLayerFilter", **kwargs):
+    return MC15EntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC15aPlusEntryLayerFilterCfg(flags, name="ISF_MC15aPlusEntryLayerFilter", **kwargs):
+    return MC15EntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC15aPlusLLPEntryLayerFilterCfg(flags, name="ISF_MC15aPlusLLPEntryLayerFilter", **kwargs):
+    return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC16EntryLayerFilterCfg(flags, name="ISF_MC16EntryLayerFilter", **kwargs):
+    return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC16LLPEntryLayerFilterCfg(flags, name="ISF_MC16LLPEntryLayerFilter", **kwargs):
+    return MC15aPlusLLPEntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC18EntryLayerFilterCfg(flags, name="ISF_MC18EntryLayerFilter", **kwargs):
+    return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def MC18LLPEntryLayerFilterCfg(flags, name="ISF_MC18LLPEntryLayerFilter", **kwargs):
+    return MC15aPlusLLPEntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def ValidationEntryLayerFilterCfg(flags, name="ISF_ValidationEntryLayerFilter", **kwargs):
+    return MC12EntryLayerFilterCfg(flags, name, **kwargs)
+
+
+def CosmicEventFilterToolCfg(flags, name="ISF_CosmicEventFilter", **kwargs):
+    volmap = {
+        "Muon": ["MuonExitLayer"],
+        "Calo": ["MuonEntryLayer"],
+        "InnerDetector": ["CaloEntryLayer"],
+        "TRT_Barrel": ["TRTBarrelEntryLayer"],
+        "TRT_EC": ["TRTECAEntryLayer", "TRTECBEntryLayer"],
+        "SCT_Barrel": ["SCTBarrelEntryLayer"],
+        "Pixel": ["PixelEntryLayer"],
+    }
+    volumeNames = []
+    for vol in flags.Sim.CosmicFilterVolumeNames:
+        volumeNames += volmap[name]
+
+    kwargs.setdefault("UseAndFilter", True)
+    kwargs.setdefault("VolumeNames", volumeNames)
+    kwargs.setdefault("PDG_ID", flags.Sim.CosmicFilterID)
+    kwargs.setdefault("ptMin", flags.Sim.CosmicFilterPTmin)
+    kwargs.setdefault("ptMax", flags.Sim.CosmicFilterPTmax)
+    return CompFactory.ISF.CosmicEventFilterTool(name, **kwargs)
+
+
+def StoppedParticleFilterToolCfg(flags, name="ISF_StoppedParticleFilter", **kwargs):
+    kwargs.setdefault("VolumeNames", ["StoppingPositions"])
+    return CompFactory.ISF.CosmicEventFilterTool(name, **kwargs)
+
+
+def InToOutSubDetOrderingToolCfg(flags, name="ISF_InToOutSubDetOrderingTool", **kwargs):
+    # higher ordered particles will be simulated first
+    kwargs.setdefault("OrderID"      , 100000000)
+    kwargs.setdefault("OrderBeamPipe", 1000000  )
+    kwargs.setdefault("OrderCalo"    , 10000    )
+    kwargs.setdefault("OrderMS"      , 100      )
+    kwargs.setdefault("OrderCavern"  , 1        )
+    return CompFactory.ISF.GenericParticleOrderingTool(name, **kwargs)
+
+
+def ParticleOrderingToolCfg(flags, name="ISF_ParticleOrderingTool", **kwargs):
+    kwargs.setdefault("OrderID"      , 1)
+    kwargs.setdefault("OrderBeamPipe", 1)
+    kwargs.setdefault("OrderCalo"    , 1)
+    kwargs.setdefault("OrderMS"      , 1)
+    kwargs.setdefault("OrderCavern"  , 1)
+    return CompFactory.ISF.GenericParticleOrderingTool(name, **kwargs)
+
+
+def EnergyParticleOrderingToolCfg(flags, name="ISF_EnergyParticleOrderingTool", **kwargs):
+    return CompFactory.ISF.EnergyParticleOrderingTool(name, **kwargs)
+
+
+def ParticleKillerToolCfg(flags, name="ISF_ParticleKillerTool", **kwargs):
+    return CompFactory.ISF.ParticleKillerSimTool(name, **kwargs)
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/ISF_FastCaloSimParametrizationConfigNew.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/ISF_FastCaloSimParametrizationConfigNew.py
new file mode 100644
index 000000000000..ef788f5baa81
--- /dev/null
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/ISF_FastCaloSimParametrizationConfigNew.py
@@ -0,0 +1,20 @@
+"""ComponentAccumulator config of tools for ISF_FastCaloSimParametrization
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+def FastCaloSimCaloExtrapolationCfg(flags, name="FastCaloSimCaloExtrapolation", **kwargs):
+    kwargs.setdefault("CaloBoundaryR", [1148.0, 120.0, 41.0])
+    kwargs.setdefault("CaloBoundaryZ", [3550.0, 4587.0, 4587.0])
+    kwargs.setdefault("CaloMargin", 100)
+    kwargs.setdefault("Extrapolator", "TimedExtrapolator") # TODO prevent circular import with AdditionalConfigNew
+    kwargs.setdefault("CaloGeometryHelper", "FastCaloSimGeometryHelper")
+    kwargs.setdefault("CaloEntrance", "InDet::Containers::InnerDetector")
+
+    return CompFactory.FastCaloSimCaloExtrapolation(name, **kwargs)
+
+
+def FastCaloSimGeometryHelperCfg(flags, name="FastCaloSimGeometryHelper", **kwargs):
+    return CompFactory.FastCaloSimGeometryHelper(name, **kwargs)
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfigNew.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfigNew.py
new file mode 100644
index 000000000000..2e087553a809
--- /dev/null
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfigNew.py
@@ -0,0 +1,938 @@
+"""ComponentAccumulator additional configuration of tools for ISF_FastCaloSimServices
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from RngComps.RandomServices import RNG
+from BarcodeServices.BarcodeServicesConfigNew import BarcodeSvcCfg
+from SubDetectorEnvelopes.SubDetectorEnvelopesConfigNew import EnvelopeDefSvcCfg
+from IOVDbSvc.IOVDbSvcConfig import addFolders
+
+# TODO check this for new config
+from ISF_Algorithms.collection_merger_helpers import generate_mergeable_collection_name
+
+
+def AdditionalParticleParametrizationFileNames():
+    return [
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_10000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_10000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_10000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_10000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_10000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_100000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_100000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_100000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_100000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_100000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_1000000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_2000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_2000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_2000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_2000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_2000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_20000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_20000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_20000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_20000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_20000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_200000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_5000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_5000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_5000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_5000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_5000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_50000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_50000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_50000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_50000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_50000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_500000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_500000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_500000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_500000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_500000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_400/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_400/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_400/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_400/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_400/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_600/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_600/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_600/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_600/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_600/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_800/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_800/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_800/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_800/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_211/EN_800/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_10000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_10000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_10000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_10000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_10000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_100000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_1000000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_2000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_2000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_2000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_2000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_2000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_20000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_20000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_20000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_20000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_20000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_200000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_5000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_5000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_5000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_5000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_5000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_50000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_500000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_500000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_500000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_500000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_500000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_400/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_400/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_400/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_400/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_400/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_600/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_600/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_600/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_600/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_600/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_800/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_800/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_800/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_800/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_22/EN_800/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_10000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_10000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_10000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_10000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_10000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_100000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_1000000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_2000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_2000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_2000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_2000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_2000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_20000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_20000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_20000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_20000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_20000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_200000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_5000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_5000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_5000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_5000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_5000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_50000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_500000/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_500000/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_500000/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_500000/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_500000/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_400/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_400/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_400/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_400/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_400/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_600/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_600/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_600/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_600/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_600/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_800/eta_central",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_800/eta_crack",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_800/eta_endcap1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_800/eta_endcap2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:EnergyResults/pdgid_11/EN_800/eta_fcal",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_5000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_2000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_10000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_1000000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_500000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_20000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_100000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_200000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_22/EN_50000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_5000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_2000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_10000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_1000000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_500000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_20000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_100000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_200000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_11/EN_50000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_5000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_2000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_10000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_1000000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_500000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_20000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_100000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_4",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_200000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_14",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_12",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_8",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_13",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_20",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_9",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_11",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_10",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_5",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_6",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_1",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_7",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_2",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_19",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_0",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_3",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_18",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_15",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_16",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_17",
+      "DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:ShapeResults/pdgid_211/EN_50000/calosample_4",
+      ]
+
+
+# definitions taken from file:
+#   FastSimulationJobTransforms/jobConfig.FastCaloSim_DB.py
+def setAdditionalParticleParametrizationFileNames(FastShowerCellBuilderTool):
+    FastShowerCellBuilderTool.AdditionalParticleParametrizationFileNames = AdditionalParticleParametrizationFileNames()
+
+
+def PunchThroughToolCfg(flags, name="ISF_PunchThroughTool", **kwargs):
+    acc = RNG(flags.Random.Engine)
+    kwargs.setdefault("RandomNumberService", acc.getService("AthRNGSvc"))
+    kwargs.setdefault("RandomStreamName", "AthRNGSvc") # TODO check
+    kwargs.setdefault("FilenameLookupTable", "CaloPunchThroughParametrisation.root")
+    kwargs.setdefault("PunchThroughInitiators", [211])
+    kwargs.setdefault("PunchThroughParticles", [   2212,     211,      22,      11,      13])
+    kwargs.setdefault("DoAntiParticles"      , [  False,    True,   False,    True,    True])
+    kwargs.setdefault("CorrelatedParticle"   , [    211,    2212,      11,      22,       0])
+    kwargs.setdefault("FullCorrelationEnergy", [100000., 100000., 100000., 100000.,      0.])
+    kwargs.setdefault("MinEnergy"            , [  938.3,   135.6,     50.,     50.,   105.7])
+    kwargs.setdefault("MaxNumParticles"      , [     -1,      -1,      -1,      -1,      -1])
+    kwargs.setdefault("EnergyFactor"         , [     1.,      1.,      1.,      1.,      1.])
+    acc_bar = BarcodeSvcCfg(flags)
+    kwargs.setdefault("BarcodeSvc", acc_bar.getPrimary())
+    acc.merge(acc_bar)
+    acc.merge(EnvelopeDefSvcCfg(flags))
+    kwargs.setdefault("EnvelopeDefSvc", acc.getService("AtlasGeometry_EnvelopeDefSvc"))
+    kwargs.setdefault("BeamPipeRadius", 500.)
+    acc.setPrivateTools(CompFactory.ISF.PunchThroughTool(name, **kwargs))
+    return acc
+
+
+def EmptyCellBuilderToolCfg(flags, name="ISF_EmptyCellBuilderTool", **kwargs):
+    return CompFactory.EmptyCellBuilderTool(name, **kwargs)
+
+
+def NIMatEffUpdatorCfg(flags, name="ISF_NIMatEffUpdator", **kwargs):
+    return CompFactory.Trk.NIMatEffUpdator(name, **kwargs)
+
+
+def NIPropagatorCfg(flags, name="ISF_NIPropagator", **kwargs):
+    kwargs.setdefault("MaterialEffects", False)
+    return CompFactory.Trk.STEP_Propagator(name, **kwargs)
+
+
+def NITimedExtrapolatorCfg(flags, name="ISF_NITimedExtrapolator", **kwargs):
+    kwargs.setdefault("MaterialEffectsUpdators", [NIMatEffUpdatorCfg(flags)])
+    kwargs.setdefault("ApplyMaterialEffects", False)
+    kwargs.setdefault("STEP_Propagator", NIPropagatorCfg(flags))
+    return CompFactory.Trk.TimedExtrapolator(name, **kwargs)
+
+
+def TimedExtrapolatorCfg(flags, name="TimedExtrapolator", **kwargs):
+    kwargs.setdefault("MaterialEffectsUpdators", [NIMatEffUpdatorCfg(flags)])
+    kwargs.setdefault("ApplyMaterialEffects", False )
+    kwargs.setdefault("STEP_Propagator", NIPropagatorCfg(flags))
+    return CompFactory.Trk.TimedExtrapolator(name, **kwargs)
+
+
+# FastShowerCellBuilderTool
+def DefaultFastShowerCellBuilderToolCfg(flags, name, **kwargs):
+    acc = RNG(flags.Random.Engine)
+    kwargs.setdefault("RandomService", acc.getService("AthRNGSvc"))
+    kwargs.setdefault("RandomStreamName", "AthRNGSvc") # TODO check
+    kwargs.setdefault("DoSimulWithInnerDetectorTruthOnly", True)
+    kwargs.setdefault("ID_cut_off_r", [1150])
+    kwargs.setdefault("ID_cut_off_z", [3490])
+    kwargs.setdefault("DoSimulWithInnerDetectorV14TruthCuts", True)
+    kwargs.setdefault("DoNewEnergyEtaSelection", True)
+    kwargs.setdefault("DoEnergyInterpolation", True)
+    kwargs.setdefault("use_Ekin_for_depositions", True)
+    kwargs.setdefault("McLocation", flags.Sim.FastShower.InputCollection)
+    kwargs.setdefault("ParticleParametrizationFileName", "")
+    kwargs.setdefault("Extrapolator", NITimedExtrapolatorCfg(flags))
+    # TODO migrate
+    from FastCaloSim.FastCaloSimFactory import FastCaloSimFactory
+    return FastCaloSimFactory(name, **kwargs)
+
+
+def FastShowerCellBuilderToolCfg(flags, name="ISF_FastShowerCellBuilderTool", **kwargs):
+    localFileNameList = AdditionalParticleParametrizationFileNames()
+    localFileNameList.insert(0,"L1_L2_egamma_corr.config20.root")
+    kwargs.setdefault("AdditionalParticleParametrizationFileNames", localFileNameList)
+    acc = addFolders(flags, "/GLOBAL/AtlfastII/FastCaloSimParam", "GLOBAL_OFL", tag="FastCaloSim_v2")
+    acc.setPrivateTools(DefaultFastShowerCellBuilderToolCfg(flags, name, **kwargs)) # TODO
+    return acc
+
+
+def LegacyFastShowerCellBuilderToolCfg(flags, name="ISF_LegacyFastShowerCellBuilderTool", **kwargs):
+    acc = FastShowerCellBuilderToolCfg(flags, name, **kwargs)
+    FastShowerCellBuilderTool = acc.popPrivateTools()
+    FastShowerCellBuilderTool.Invisibles += [13]
+    acc.setPrivateTools(FastShowerCellBuilderTool)
+    return acc
+
+
+def PileupFastShowerCellBuilderToolCfg(flags, name="ISF_PileupFastShowerCellBuilderTool", **kwargs):
+    # weights from: FIXME dead link
+    # http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Simulation/FastShower/FastCaloSim/FastCaloSim/FastCaloSim_CaloCell_ID.h
+    weightsfcs = [
+      ### LAr presampler
+      #FirstSample=CaloCell_ID::PreSamplerB,
+      2.0,
+      ### LAr barrel
+      #PreSamplerB=CaloCell_ID::PreSamplerB,
+      #EMB1=CaloCell_ID::EMB1,
+      #EMB2=CaloCell_ID::EMB2,
+      #EMB3=CaloCell_ID::EMB3,
+      2.0, 2.0, 2.0, 2.0,
+      ### LAr EM endcap
+      #PreSamplerE=CaloCell_ID::PreSamplerE,
+      #EME1=CaloCell_ID::EME1,
+      #EME2=CaloCell_ID::EME2,
+      #EME3=CaloCell_ID::EME3,
+      2.0, 2.0, 2.0, 2.0,
+      ### Hadronic end cap cal.
+      #HEC0=CaloCell_ID::HEC0,
+      #HEC1=CaloCell_ID::HEC1,
+      #HEC2=CaloCell_ID::HEC2,
+      #HEC3=CaloCell_ID::HEC3,
+      2.0, 2.0, 2.0, 2.0,
+      ### Tile barrel
+      #TileBar0=CaloCell_ID::TileBar0,
+      #TileBar1=CaloCell_ID::TileBar1,
+      #TileBar2=CaloCell_ID::TileBar2,
+      1.0, 1.0, 1.0,
+      ### Tile gap (ITC & scint)
+      #TileGap1=CaloCell_ID::TileGap1,
+      #TileGap2=CaloCell_ID::TileGap2,
+      #TileGap3=CaloCell_ID::TileGap3,
+      1.0, 1.0, 1.0,
+      ### Tile extended barrel
+      #TileExt0=CaloCell_ID::TileExt0,
+      #TileExt1=CaloCell_ID::TileExt1,
+      #TileExt2=CaloCell_ID::TileExt2,
+      1.0, 1.0, 1.0,
+      ### Forward EM endcap
+      #FCAL0=CaloCell_ID::FCAL0,
+      #FCAL1=CaloCell_ID::FCAL1,
+      #FCAL2=CaloCell_ID::FCAL2,
+      1.0, 1.0, 1.0,
+      ### Beware of MiniFCAL! We don"t have it, so different numbers after FCAL2
+      #LastSample = CaloCell_ID::FCAL2,
+      #MaxSample = LastSample+1
+      1.0, 1.0,
+    ]
+
+    kwargs.setdefault("sampling_energy_reweighting", weightsfcs )
+    return FastShowerCellBuilderToolCfg(flags, name, **kwargs)
+
+
+# TODO
+def FastHitConvertToolCfg(flags, name="ISF_FastHitConvertTool", **kwargs):
+    mergeable_collection_suffix = "_FastCaloSim"
+
+    EMB_hits_bare_collection_name = "LArHitEMB"
+    EMB_hits_merger_input_property = "LArEMBHits"
+    EMB_hits_collection_name = generate_mergeable_collection_name(
+        EMB_hits_bare_collection_name,
+        mergeable_collection_suffix,
+        EMB_hits_merger_input_property)
+
+    EMEC_hits_bare_collection_name = "LArHitEMEC"
+    EMEC_hits_merger_input_property = "LArEMECHits"
+    EMEC_hits_collection_name = generate_mergeable_collection_name(
+        EMEC_hits_bare_collection_name,
+        mergeable_collection_suffix,
+        EMEC_hits_merger_input_property)
+
+    FCAL_hits_bare_collection_name = "LArHitFCAL"
+    FCAL_hits_merger_input_property = "LArFCALHits"
+    FCAL_hits_collection_name = generate_mergeable_collection_name(
+        FCAL_hits_bare_collection_name,
+        mergeable_collection_suffix,
+        FCAL_hits_merger_input_property)
+
+    HEC_hits_bare_collection_name = "LArHitHEC"
+    HEC_hits_merger_input_property = "LArHECHits"
+    HEC_hits_collection_name = generate_mergeable_collection_name(
+        HEC_hits_bare_collection_name,
+        mergeable_collection_suffix,
+        HEC_hits_merger_input_property)
+
+    tile_hits_bare_collection_name = "TileHitVec"
+    tile_hits_merger_input_property = "TileHits"
+    tile_hits_collection_name = generate_mergeable_collection_name(
+        tile_hits_bare_collection_name,
+        mergeable_collection_suffix,
+        tile_hits_merger_input_property)
+
+    kwargs.setdefault("embHitContainername", EMB_hits_collection_name)
+    kwargs.setdefault("emecHitContainername", EMEC_hits_collection_name)
+    kwargs.setdefault("fcalHitContainername", FCAL_hits_collection_name)
+    kwargs.setdefault("hecHitContainername", HEC_hits_collection_name)
+    kwargs.setdefault("tileHitContainername", tile_hits_collection_name)
+
+    return CompFactory.FastHitConvertTool(name,**kwargs)
+
+
+def CaloNoiseToolCfg(flags, name="ISF_FCS_CaloNoiseTool", **kwargs):
+    # TODO
+    from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault
+    return CaloNoiseToolDefault(name, **kwargs)
+
+
+def AddNoiseCellBuilderToolCfg(flags, name="ISF_AddNoiseCellBuilderTool", **kwargs):
+    # TODO
+    from FastCaloSim.AddNoiseCellBuilderToolDefault import AddNoiseCellBuilderToolDefault
+    return AddNoiseCellBuilderToolDefault(name, **kwargs)
+
+
+def CaloCellContainerFinalizerToolCfg(flags, name="ISF_CaloCellContainerFinalizerTool", **kwargs):
+    return CompFactory.CaloCellContainerFinalizerTool(name, **kwargs)
+
+
+def CaloCellContainerFCSFinalizerToolCfg(flags, name="ISF_CaloCellContainerFCSFinalizerTool", **kwargs):
+    return CompFactory.CaloCellContainerFCSFinalizerTool(name, **kwargs)
+
+
+def FastHitConvAlgCfg(flags, name="ISF_FastHitConvAlg", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CaloCellsInputName"  , flags.Sim.FastCalo.CaloCellsName)
+    # TODO: do we need this?
+    #from AthenaCommon.DetFlags import DetFlags
+    #if DetFlags.pileup.LAr_on() or DetFlags.pileup.Tile_on():
+    #  kwargs.setdefault("doPileup", True)
+    #else:
+    #  kwargs.setdefault("doPileup", False)
+    acc.addEventAlgo(CompFactory.FastHitConv(name, **kwargs))
+    return acc
+
+
+def FastCaloToolBaseCfg(flags, name="ISF_FastCaloToolBase", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("BatchProcessMcTruth"              , False)
+    kwargs.setdefault("SimulateUndefinedBarcodeParticles", False)
+    kwargs.setdefault("CaloCellsOutputName"              , flags.Sim.FastCalo.CaloCellsName)
+    kwargs.setdefault("PunchThroughTool"                 , acc.popToolsAndMerge(PunchThroughToolCfg(flags)))
+    kwargs.setdefault("DoPunchThroughSimulation"         , False)
+    kwargs.setdefault("CaloCellMakerTools_setup"         , [EmptyCellBuilderToolCfg(flags)])
+    tool = acc.popToolsAndMerge(FastShowerCellBuilderToolCfg(flags))
+    kwargs.setdefault("CaloCellMakerTools_simulate"      , [tool])
+    # TODO
+    kwargs.setdefault("CaloCellMakerTools_release"       , [#"ISF_AddNoiseCellBuilderTool",
+                                                            CaloCellContainerFinalizerToolCfg(flags),
+                                                            FastHitConvertToolCfg(flags)])
+    kwargs.setdefault("Extrapolator", NITimedExtrapolatorCfg(flags))
+    # FIXME not migrated. Remove or replace
+    # register the FastCaloSim random number streams
+    #from G4AtlasApps.SimFlags import simFlags
+    #if not simFlags.RandomSeedList.checkForExistingSeed(ISF_FastCaloSimFlags.RandomStreamName()):
+        #simFlags.RandomSeedList.addSeed( ISF_FastCaloSimFlags.RandomStreamName(), 98346412, 12461240)
+    return CompFactory.ISF.FastCaloTool(name, **kwargs)
+
+def FastCaloToolCfg(flags, name="ISF_FastCaloTool", **kwargs):
+    return FastCaloToolBaseCfg(flags, name, **kwargs)
+
+def FastCaloPileupToolCfg(flags, name="ISF_FastCaloPileupTool", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CaloCellsOutputName", flags.Sim.FastCalo.CaloCellsName + "PileUp")
+    tool = acc.popToolsAndMerge(PileupFastShowerCellBuilderToolCfg(flags))
+    kwargs.setdefault("CaloCellMakerTools_simulate", [tool])
+    acc.merge(FastCaloToolBaseCfg(name, **kwargs))
+    return acc
+
+def LegacyAFIIFastCaloToolCfg(flags, name="ISF_LegacyAFIIFastCaloTool", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("BatchProcessMcTruth", True)
+    tool = acc.popToolsAndMerge(LegacyFastShowerCellBuilderToolCfg(flags))
+    kwargs.setdefault("CaloCellMakerTools_simulate", [tool])
+    acc.merge(FastCaloToolBaseCfg(name, **kwargs))
+    return acc
+
+def FastCaloSimV2ToolCfg(flags, name="ISF_FastCaloSimV2Tool", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CaloCellsOutputName", flags.Sim.FastCalo.CaloCellsName)
+    kwargs.setdefault("CaloCellMakerTools_setup", [EmptyCellBuilderToolCfg(flags)] )
+    kwargs.setdefault("CaloCellMakerTools_release", [CaloCellContainerFCSFinalizerToolCfg(flags),
+                                                     FastHitConvertToolCfg(flags)])
+    kwargs.setdefault("FastCaloSimCaloExtrapolation", "FastCaloSimCaloExtrapolation") # tool TODO
+    kwargs.setdefault("ParamSvc", "ISF_FastCaloSimV2ParamSvc") # TODO
+    acc.merge(RNG(flags.Random.Engine))
+    kwargs.setdefault("RandomSvc", acc.getService("AthRNGSvc"))
+    kwargs.setdefault("RandomStream", "AthRNGSvc") # TODO check
+    kwargs.setdefault("PunchThroughTool", acc.popToolsAndMerge(PunchThroughToolCfg(flags)))
+    return CompFactory.ISF.FastCaloSimV2Tool(name, **kwargs)
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigNew.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigNew.py
new file mode 100644
index 000000000000..eb6e3147be2a
--- /dev/null
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/ISF_FastCaloSimServicesConfigNew.py
@@ -0,0 +1,108 @@
+"""ComponentAccumulator service configuration for ISF_FastCaloSimServices
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from RngComps.RandomServices import RNG
+
+
+def FastCaloSimSvcCfg(flags, name="ISF_FastCaloSimSvc", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("SimulatorTool", "ISF_FastCaloTool")
+    kwargs.setdefault("Identifier", "FastCaloSim")
+    acc.addService(CompFactory.ISF.LegacySimSvc(name, **kwargs))
+    return acc
+
+
+def FastCaloSimPileupSvcCfg(flags, name="ISF_FastCaloSimPileupSvc", **kwargs):
+    kwargs.setdefault("SimulatorTool", "ISF_FastCaloPileupTool")
+    return FastCaloSimSvcCfg(flags, name, **kwargs)
+
+
+def LegacyAFIIFastCaloSimSvcCfg(flags, name="ISF_LegacyAFIIFastCaloSimSvc", **kwargs):
+    kwargs.setdefault("SimulatorTool", "ISF_LegacyAFIIFastCaloTool")
+    return FastCaloSimSvcCfg(flags, name, **kwargs)
+
+
+def FastHitConvAlgFastCaloSimSvcCfg(flags, name="ISF_FastHitConvAlgFastCaloSimSvc",**kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CaloCellMakerTools_release", ["ISF_AddNoiseCellBuilderTool",
+                                                     "ISF_CaloCellContainerFCSFinalizerTool"])
+    # setup FastCaloSim hit converter and add it to the alg sequence:
+    # -> creates HITS from reco cells
+    from AthenaCommon.AlgSequence import AlgSequence
+    topSequence=AlgSequence()
+    from AthenaCommon.CfgGetter import getAlgorithm
+    topSequence+=getAlgorithm("ISF_FastHitConvAlg")
+    acc.merge(FastCaloSimSvcCfg(flags, name, **kwargs))
+    return acc
+
+
+def FastHitConvAlgLegacyAFIIFastCaloSimSvcCfg(flags, name="ISF_FastHitConvAlgLegacyAFIIFastCaloSimSvc", **kwargs):
+    kwargs.setdefault("BatchProcessMcTruth", True)
+    return FastHitConvAlgFastCaloSimSvcCfg(flags, name, **kwargs)
+
+
+def FastCaloSimPileupOTSvcCfg(flags, name="ISF_FastCaloSimPileupOTSvc", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("BatchProcessMcTruth", False)
+    kwargs.setdefault("SimulateUndefinedBarcodeParticles", False)
+    kwargs.setdefault("Identifier", "FastCaloSim")
+    kwargs.setdefault("CaloCellsOutputName", flags.Sim.FastCalo.CaloCellsName + "PileUp")
+    kwargs.setdefault("PunchThroughTool", "ISF_PunchThroughTool")
+    kwargs.setdefault("DoPunchThroughSimulation", False)
+    kwargs.setdefault("PUWeights_lar_bapre", flags.Sim.FastChain.PUWeights_lar_bapre)
+    kwargs.setdefault("PUWeights_lar_hec", flags.Sim.FastChain.PUWeights_lar_hec)
+    kwargs.setdefault("PUWeights_lar_em", flags.Sim.FastChain.PUWeights_lar_em)
+    kwargs.setdefault("PUWeights_tile", flags.Sim.FastChain.PUWeights_tile)
+    kwargs.setdefault("CaloCellMakerTools_setup", ["ISF_EmptyCellBuilderTool"])
+    kwargs.setdefault("CaloCellMakerTools_simulate", ["ISF_FastShowerCellBuilderTool"])
+    kwargs.setdefault("CaloCellMakerTools_release", [#"ISF_AddNoiseCellBuilderTool",
+                                                     "ISF_CaloCellContainerFCSFinalizerTool",
+                                                     "ISF_FastHitConvertTool"])
+    kwargs.setdefault("Extrapolator", "ISF_NITimedExtrapolator")
+    # FIXME not migrated. Remove or replace
+    # register the FastCaloSim random number streams
+    #from G4AtlasApps.SimFlags import simFlags
+    #if not simFlags.RandomSeedList.checkForExistingSeed(ISF_FastCaloSimFlags.RandomStreamName()):
+        #simFlags.RandomSeedList.addSeed( ISF_FastCaloSimFlags.RandomStreamName(), 98346412, 12461240)
+    acc.addService(CompFactory.ISF.FastCaloSimSvcPU(name, **kwargs))
+    return acc
+
+
+def FastCaloSimV2ParamSvcCfg(flags, name="ISF_FastCaloSimV2ParamSvc", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("ParamsInputFilename", flags.Sim.FastCaloParamsInputFilename)
+    kwargs.setdefault("ParamsInputObject", "SelPDGID")
+    acc.addService(CompFactory.ISF.FastCaloSimV2ParamSvc(name, **kwargs))
+    return acc
+
+
+def FastCaloSimSvcV2Cfg(flags, name="ISF_FastCaloSimSvcV2", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("SimulatorTool", "ISF_FastCaloSimV2Tool")
+    kwargs.setdefault("Identifier", "FastCaloSim")
+    acc.addService(CompFactory.ISF.LegacySimSvc(name, **kwargs))
+    return acc
+
+
+def DNNCaloSimSvcCfg(flags, name="ISF_DNNCaloSimSvc", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CaloCellsOutputName", flags.Sim.FastCaloCaloCellsName)
+    kwargs.setdefault("CaloCellMakerTools_setup", ["ISF_EmptyCellBuilderTool"])
+    kwargs.setdefault("CaloCellMakerTools_release", ["ISF_CaloCellContainerFinalizerTool",
+                                                     "ISF_FastHitConvertTool"]) #DR needed ?
+    kwargs.setdefault("ParamsInputFilename", flags.Sim.FastCaloParamsInputFilename)
+    kwargs.setdefault("FastCaloSimCaloExtrapolation", "FastCaloSimCaloExtrapolation") # tool TODO
+
+    # FIXME not migrated. Remove or replace
+    # register the FastCaloSim random number streams
+    #from G4AtlasApps.SimFlags import simFlags
+    #if not simFlags.RandomSeedList.checkForExistingSeed(ISF_FastCaloSimFlags.RandomStreamName()):
+        #simFlags.RandomSeedList.addSeed( ISF_FastCaloSimFlags.RandomStreamName(), 98346412, 12461240)
+    #kwargs.setdefault("RandomStream", ISF_FastCaloSimFlags.RandomStreamName())
+    acc.merge(RNG(flags.Random.Engine))
+    kwargs.setdefault("RandomSvc", acc.getService("AthRNGSvc"))
+    acc.addService(CompFactory.ISF.DNNCaloSimSvc(name, **kwargs))
+    return acc
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py
new file mode 100644
index 000000000000..ab18670d240b
--- /dev/null
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py
@@ -0,0 +1,43 @@
+"""ComponentAccumulator Geant4 tools config for ISF
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentFactory import CompFactory
+from ISF_Services.ISF_ServicesConfigNew import GeoIDSvcCfg, AFIIGeoIDSvcCfg
+from ISF_Tools.ISF_ToolsConfigNew import EntryLayerFilterCfg
+
+
+def EntryLayerToolCfg(flags, name="ISF_EntryLayerTool", **kwargs):
+    acc = GeoIDSvcCfg(flags)
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_GeoIDSvc"))
+    acc_filter = EntryLayerFilterCfg(flags)
+    kwargs.setdefault("ParticleFilters", [acc.popToolsAndMerge(acc_filter)])
+    if flags.Sim.DoFullChain: # TODO and DetFlags.pileup.any_on():
+        kwargs.setdefault("EvtStore", "OriginalEvent_SG") # For Fast Chain
+    acc.setPrivateTools(CompFactory.ISF.EntryLayerTool(name, **kwargs))
+    return acc
+
+
+def EntryLayerToolMTCfg(flags, name="ISF_EntryLayerToolMT", **kwargs):
+    acc = GeoIDSvcCfg(flags)
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_GeoIDSvc"))
+    acc_filter = EntryLayerFilterCfg(flags)
+    kwargs.setdefault("ParticleFilters", [acc.popToolsAndMerge(acc_filter)])
+    if flags.Sim.DoFullChain: # TODO and DetFlags.pileup.any_on():
+        kwargs.setdefault("EvtStore", "OriginalEvent_SG") # For Fast Chain
+    acc.setPrivateTools(CompFactory.ISF.EntryLayerToolMT(name, **kwargs))
+    return acc
+
+
+def AFIIEntryLayerToolCfg(flags, name="ISF_AFIIEntryLayerTool", **kwargs):
+    acc = AFIIGeoIDSvcCfg(flags)
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_AFIIGeoIDSvc"))
+    acc.merge(EntryLayerToolCfg(name, **kwargs))
+    return acc
+
+
+def AFIIEntryLayerToolMTCfg(flags, name="ISF_AFIIEntryLayerToolMT", **kwargs):
+    acc = AFIIGeoIDSvcCfg(flags)
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_AFIIGeoIDSvc"))
+    acc.merge(EntryLayerToolMTCfg(name, **kwargs))
+    return acc
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py
new file mode 100644
index 000000000000..1f909f69cb9e
--- /dev/null
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py
@@ -0,0 +1,68 @@
+"""Geant4 services config for ISF with ComponentAccumulator
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from ISF_Geant4Tools.ISF_Geant4ToolsConfig import (
+    Geant4ToolCfg, FullGeant4ToolCfg, ISF_LongLivedGeant4Tool, PassBackGeant4ToolCfg,
+    AFIIGeant4ToolCfg, AFII_QS_Geant4ToolCfg
+)
+
+
+def Geant4SimCfg(flags, name="ISFG4SimSvc", **kwargs):
+    acc = ComponentAccumulator()
+
+    G4_DDDBEnvelopeDefSvc = CompFactory.DetDescrDBEnvelopeSvc("G4EnvelopeDefSvc")
+    G4_DDDBEnvelopeDefSvc.DBBeamPipeNode = "BPipeEnvelopeG4"
+    G4_DDDBEnvelopeDefSvc.DBInDetNode = "InDetEnvelopeG4"
+    G4_DDDBEnvelopeDefSvc.DBCaloNode = "CaloEnvelopeG4"
+    G4_DDDBEnvelopeDefSvc.DBMSNode = "MuonEnvelopeG4"
+    G4_DDDBEnvelopeDefSvc.DBCavernNode = "CavernEnvelopeG4"
+    acc.addService(G4_DDDBEnvelopeDefSvc)
+
+    if "SimulatorTool" not in kwargs:
+        tool = acc.popToolsAndMerge(Geant4ToolCfg(flags))
+        kwargs.setdefault("SimulatorTool", tool)
+    kwargs.setdefault("Identifier", "Geant4")
+    kwargs.setdefault("FullGeant4", False)
+    Geant4SimService = CompFactory.iGeant4.Geant4SimSvc(name, **kwargs)
+    acc.addService(Geant4SimService)
+    return acc
+
+
+def FullGeant4SimCfg(flags, name="ISF_FullGeant4SimSvc", **kwargs):
+    acc = FullGeant4ToolCfg(flags)
+    kwargs.setdefault("SimulatorTool", acc.popPrivateTools())
+    kwargs.setdefault("FullGeant4", True)
+    acc.merge(Geant4SimCfg(name, **kwargs))
+    return acc
+
+
+def LongLivedGeant4SimCfg(flags, name="ISF_LongLivedGeant4SimSvc", **kwargs):
+    acc = ISF_LongLivedGeant4Tool(flags)
+    kwargs.setdefault("SimulatorTool", acc.popPrivateTools())
+    acc.merge(FullGeant4SimCfg(name, **kwargs))
+    return acc
+
+
+def PassBackGeant4SimCfg(flags, name="ISF_PassBackGeant4SimSvc", **kwargs):
+    acc = PassBackGeant4ToolCfg(flags)
+    kwargs.setdefault("SimulatorTool", acc.popPrivateTools())
+    kwargs.setdefault("FullGeant4", False)
+    acc.merge(Geant4SimCfg(name, **kwargs))
+    return acc
+
+
+def AFIIGeant4SimCfg(flags, name="ISF_AFIIGeant4SimSvc", **kwargs):
+    acc = AFIIGeant4ToolCfg(flags)
+    kwargs.setdefault("SimulatorTool", acc.popPrivateTools())
+    acc.merge(PassBackGeant4SimCfg(name, **kwargs))
+    return acc
+
+
+def AFII_QS_Geant4SimCfg(flags, name="ISF_AFII_QS_Geant4SimSvc", **kwargs):
+    acc = AFII_QS_Geant4ToolCfg(flags)
+    kwargs.setdefault("SimulatorTool", acc.popPrivateTools())
+    acc.merge(PassBackGeant4SimCfg(name, **kwargs))
+    return acc
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py
new file mode 100644
index 000000000000..f132d21e71f0
--- /dev/null
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfigNew.py
@@ -0,0 +1,137 @@
+"""Geant4 tools config for ISF with ComponentAccumulator
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.SystemOfUnits import MeV
+from ISF_Services.ISF_ServicesConfigNew import (
+    TruthServiceCfg, GeoIDSvcCfg, AFIIGeoIDSvcCfg,
+    ParticleBrokerSvcCfg, InputConverterCfg,
+    LongLivedInputConverterCfg
+)
+from ISF_Geant4CommonTools.ISF_Geant4CommonToolsConfigNew import EntryLayerToolCfg, EntryLayerToolMTCfg
+from G4AtlasServices.G4AtlasUserActionConfigNew import (
+    ISFUserActionSvcCfg, ISFFullUserActionSvcCfg,
+    ISFPassBackUserActionSvcCfg, ISF_AFIIUserActionSvcCfg,
+)
+from G4AtlasTools.G4AtlasToolsConfigNew import (
+    SensitiveDetectorMasterToolCfg, FastSimulationMasterToolCfg
+)
+from RngComps.RandomServices import RNG
+
+# Basic versions
+def MCTruthUserActionToolCfg(flags, name="ISFMCTruthUserActionTool", **kwargs):
+    acc = ComponentAccumulator()
+    truthacc = TruthServiceCfg(flags)
+    kwargs.setdefault("TruthRecordSvc", truthacc.getPrimary())
+    acc.merge(truthacc)
+    acc.setPrivateTools(CompFactory.G4UA.iGeant4.MCTruthUserActionTool(name, **kwargs))
+    return acc
+
+
+def PhysicsValidationUserActionToolCfg(flags, name="ISFG4PhysicsValidationUserActionTool", **kwargs):
+    acc = ComponentAccumulator()
+    acc.setPrivateTools(CompFactory.G4UA.iGeant4.PhysicsValidationUserActionTool(name, **kwargs))
+    return acc
+
+
+def TrackProcessorUserActionToolCfg(flags, name="ISFG4TrackProcessorUserActionTool", **kwargs):
+    acc = ParticleBrokerSvcCfg(flags)
+    kwargs.setdefault("ParticleBroker", acc.getService("ISF_ParticleBrokerSvc"))
+    acc.merge(GeoIDSvcCfg(flags))
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_GeoIDSvc"))
+    acc.setPrivateTools(CompFactory.G4UA.iGeant4.TrackProcessorUserActionPassBackTool(name, **kwargs))
+    return acc
+
+
+# Specialized Versions
+def FullG4TrackProcessorUserActionToolCfg(flags, name="FullG4TrackProcessorUserActionTool", **kwargs):
+    acc = ComponentAccumulator()
+    if flags.Sim.Simulator in ["FullG4MT"]:
+        tool = acc.popToolsAndMerge(EntryLayerToolMTCfg(flags))
+    else:
+        tool = acc.popToolsAndMerge(EntryLayerToolCfg(flags))
+    kwargs.setdefault("EntryLayerTool", tool)
+    acc.merge(GeoIDSvcCfg(flags))
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_GeoIDSvc"))
+    if flags.Detector.SimulateCavern:
+        kwargs.setdefault("TruthVolumeLevel", 2)
+    acc.setPrivateTools(CompFactory.G4UA.iGeant4.TrackProcessorUserActionFullG4Tool(name, **kwargs))
+    return acc
+
+
+def PassBackG4TrackProcessorUserActionToolCfg(flags, name="PassBackG4TrackProcessorUserActionTool", **kwargs):
+    return TrackProcessorUserActionToolCfg(name, **kwargs)
+
+
+def AFII_G4TrackProcessorUserActionToolCfg(flags, name="AFII_G4TrackProcessorUserActionTool", **kwargs):
+    acc = ComponentAccumulator()
+    if flags.Sim.Simulator in ["PassBackG4MT", "ATLFASTIIMT", "G4FastCaloMT"]:
+        kwargs.setdefault("ParticleBroker", "")
+    acc.merge(AFIIGeoIDSvcCfg(flags))
+    kwargs.setdefault("GeoIDSvc", acc.getService("ISF_AFIIGeoIDSvc"))
+    kwargs.setdefault("PassBackEkinThreshold", 0.05*MeV)
+    kwargs.setdefault("KillBoundaryParticlesBelowThreshold", True)
+    acc.merge(PassBackG4TrackProcessorUserActionToolCfg(name, **kwargs))
+    return acc
+
+
+def Geant4ToolCfg(flags, name="ISF_Geant4Tool", **kwargs):
+    acc = RNG(flags.Random.Engine)
+    kwargs.setdefault("RandomNumberService", acc.getService("AthRNGSvc"))
+    acc.merge(InputConverterCfg(flags))
+    kwargs.setdefault("InputConverter", acc.getService("ISF_InputConverter"))
+    acc.merge(ISFUserActionSvcCfg(flags))
+    kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFUserActionSvc"))
+    kwargs.setdefault("RecordFlux", flags.Sim.RecordFlux)
+
+    kwargs.setdefault("MultiThreading", flags.Concurrency.NumThreads > 0)
+    # Set commands for the G4AtlasAlg
+    kwargs.setdefault("G4Commands", flags.Sim.G4Commands)
+    kwargs.setdefault("PrintTimingInfo", flags.Sim.ISF.DoTimeMonitoring)
+    tool = acc.popToolsAndMerge(SensitiveDetectorMasterToolCfg(flags))
+    kwargs.setdefault("SenDetMasterTool", tool)
+    tool = acc.popToolsAndMerge(FastSimulationMasterToolCfg(flags))
+    kwargs.setdefault("FastSimMasterTool", tool)
+    # Workaround to keep other simulation flavours working while we migrate everything to be AthenaMT-compatible.
+    if flags.Sim.Simulator in ["FullG4", "FullG4MT", "PassBackG4", "PassBackG4MT", "G4FastCalo", "G4FastCaloMT"]:
+        acc.setPrivateTools(CompFactory.iGeant4.G4TransportTool(name, **kwargs))
+    else:
+        acc.setPrivateTools(CompFactory.iGeant4.G4LegacyTransportTool(name, **kwargs))
+    
+    return acc
+
+
+def FullGeant4ToolCfg(flags, name="ISF_FullGeant4Tool", **kwargs):
+    acc = ISFFullUserActionSvcCfg(flags)
+    kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFFullUserActionSvc"))
+    acc.merge(Geant4ToolCfg(name, **kwargs))
+    return acc
+
+
+def PassBackGeant4ToolCfg(flags, name="ISF_PassBackGeant4Tool", **kwargs):
+    acc = ISFPassBackUserActionSvcCfg(flags)
+    kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISFPassBackUserActionSvc"))
+    return Geant4ToolCfg(name, **kwargs)
+
+
+def AFIIGeant4ToolCfg(flags, name="ISF_AFIIGeant4Tool", **kwargs):
+    acc = ISF_AFIIUserActionSvcCfg(flags)
+    kwargs.setdefault("UserActionSvc", acc.getService("G4UA::ISF_AFIIUserActionSvc"))
+    acc.merge(PassBackGeant4ToolCfg(name, **kwargs))
+    return acc
+
+
+def LongLivedGeant4ToolCfg(flags, name="ISF_LongLivedGeant4Tool", **kwargs):
+    acc = LongLivedInputConverterCfg(flags)
+    kwargs.setdefault("InputConverter", acc.getService("ISF_LongLivedInputConverter"))
+    acc.merge(FullGeant4ToolCfg(name, **kwargs))
+    return acc
+
+
+def AFII_QS_Geant4ToolCfg(flags, name="AFII_QS_Geant4Tool", **kwargs):
+    acc = LongLivedInputConverterCfg(flags)
+    kwargs.setdefault("InputConverter", acc.getService("ISF_LongLivedInputConverter"))
+    acc.merge(AFIIGeant4ToolCfg(name, **kwargs))
+    return acc
diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigNew.py b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigNew.py
index fa5cc1468560..554e8709079a 100644
--- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigNew.py
+++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigNew.py
@@ -1,24 +1,17 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+"""ComponentAccumulator HepMC tools configurations for ISF
 
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 """
-Tools configurations for ISF
-KG Tan, 17/06/2012
-"""
-
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
-
-ISF__GenericTruthStrategy, ISF__GenParticleFinalStateFilter, ISF__GenParticlePositionFilter, ISF__GenParticleGenericFilter, ISF__GenParticleInteractingFilter=CompFactory.getComps("ISF::GenericTruthStrategy","ISF::GenParticleFinalStateFilter","ISF::GenParticlePositionFilter","ISF::GenParticleGenericFilter","ISF::GenParticleInteractingFilter",)
-
 from AthenaCommon.SystemOfUnits import MeV, mm
+from ISF_Services.ISF_ServicesCoreConfigNew import GeoIDSvcCfg
 
 #Functions yet to be migrated:
-#getParticleSimWhiteList, getParticlePositionFilterMS
+#getParticlePositionFilterMS
 #getTruthStrategyGroupID, getTruthStrategyGroupIDHadInt, getTruthStrategyGroupCaloMuBrem_MC15, getTruthStrategyGroupCaloDecay, getValidationTruthStrategy, getLLPTruthStrategy
 
-#--------------------------------------------------------------------------------------------------
-## GenParticleFilters
-
+# GenParticleFilters
 def ParticleFinalStateFilterCfg(ConfigFlags, name="ISF_ParticleFinalStateFilter", **kwargs):
     result = ComponentAccumulator()
     G4NotInUse = not ConfigFlags.Sim.UsingGeant4
@@ -26,34 +19,43 @@ def ParticleFinalStateFilterCfg(ConfigFlags, name="ISF_ParticleFinalStateFilter"
     # use CheckGenInteracting==False to allow GenEvent neutrinos to propagate into the simulation
     kwargs.setdefault("CheckGenSimStable", G4NotInUse)
     kwargs.setdefault("CheckGenInteracting", G4NotInUse)
+    result.setPrivateTools(CompFactory.ISF.GenParticleFinalStateFilter(name, **kwargs))
+    return result
 
-    result.setPrivateTools(ISF__GenParticleFinalStateFilter(name, **kwargs))
+def ParticleSimWhiteListCfg(ConfigFlags, name="ISF_ParticleSimWhiteList", **kwargs):
+    result = ComponentAccumulator()
+    result.setPrivateTools(CompFactory.ISF.GenParticleSimWhiteList(name, **kwargs))
     return result
 
-def ParticlePositionFilterCfg(ConfigFlags, name="ISF_ParticlePositionFilter", **kwargs):
+def ParticleSimWhiteList_ExtraParticles(ConfigFlags, name="ISF_ParticleSimWhiteList_ExtraParticles", **kwargs):
     result = ComponentAccumulator()
-    # ParticlePositionFilter
-    kwargs.setdefault('GeoIDService' , 'ISF_GeoIDSvc'    ) #this svc updated - add once Merge request gone in
+    kwargs.setdefault("WhiteLists" , ["G4particle_whitelist.txt", "G4particle_whitelist_ExtraParticles.txt"] )
+    result.setPrivateTools(CompFactory.ISF.GenParticleSimWhiteList(name, **kwargs))
+    return result
 
-    result.setPrivateTools(ISF__GenParticlePositionFilter(name, **kwargs))
+def ParticlePositionFilterCfg(ConfigFlags, name="ISF_ParticlePositionFilter", **kwargs):
+    result = GeoIDSvcCfg(ConfigFlags)
+    # ParticlePositionFilter
+    kwargs.setdefault("GeoIDService", result.getService("ISF_GeoIDSvc"))
+    result.setPrivateTools(CompFactory.ISF.GenParticlePositionFilter(name, **kwargs))
     return result
 
 def ParticlePositionFilterIDCfg(ConfigFlags, name="ISF_ParticlePositionFilterID", **kwargs):
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
 
-    kwargs.setdefault('CheckRegion'  , [ AtlasRegion.fAtlasID ] )
+    kwargs.setdefault("CheckRegion"  , [ AtlasRegion.fAtlasID ] )
     return ParticlePositionFilterCfg(ConfigFlags, name, **kwargs)
 
 def ParticlePositionFilterCaloCfg(ConfigFlags, name="ISF_ParticlePositionFilterCalo", **kwargs):
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
 
-    kwargs.setdefault('CheckRegion'  , [ AtlasRegion.fAtlasID,
+    kwargs.setdefault("CheckRegion"  , [ AtlasRegion.fAtlasID,
                                             AtlasRegion.fAtlasForward,
                                             AtlasRegion.fAtlasCalo ] )
     return ParticlePositionFilterCfg(ConfigFlags, name, **kwargs)
@@ -61,10 +63,10 @@ def ParticlePositionFilterCaloCfg(ConfigFlags, name="ISF_ParticlePositionFilterC
 def ParticlePositionFilterMSCfg(name="ISF_ParticlePositionFilterMS", **kwargs):
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
 
-    kwargs.setdefault('CheckRegion'  , [ AtlasRegion.fAtlasID,
+    kwargs.setdefault("CheckRegion"  , [ AtlasRegion.fAtlasID,
                                             AtlasRegion.fAtlasForward,
                                             AtlasRegion.fAtlasCalo,
                                             AtlasRegion.fAtlasMS ] )
@@ -73,9 +75,9 @@ def ParticlePositionFilterMSCfg(name="ISF_ParticlePositionFilterMS", **kwargs):
 def ParticlePositionFilterWorldCfg(ConfigFlags, name="ISF_ParticlePositionFilterWorld", **kwargs):
     # importing Reflex dictionary to access AtlasDetDescr::AtlasRegion enum
     import ROOT, cppyy
-    cppyy.loadDictionary('AtlasDetDescrDict')
+    cppyy.loadDictionary("AtlasDetDescrDict")
     AtlasRegion = ROOT.AtlasDetDescr
-    kwargs.setdefault('CheckRegion'  , [ AtlasRegion.fAtlasID,
+    kwargs.setdefault("CheckRegion"  , [ AtlasRegion.fAtlasID,
                                             AtlasRegion.fAtlasForward,
                                             AtlasRegion.fAtlasCalo,
                                             AtlasRegion.fAtlasMS,
@@ -84,7 +86,7 @@ def ParticlePositionFilterWorldCfg(ConfigFlags, name="ISF_ParticlePositionFilter
 
 def ParticlePositionFilterDynamicCfg(ConfigFlags, name="ISF_ParticlePositionFilterDynamic", **kwargs):
     # automatically choose the best fitting filter region
-    
+
     #if ConfigFlags.Detector.SimulateMuon:
     if True:
       return ParticlePositionFilterWorldCfg(ConfigFlags, name, **kwargs)
@@ -102,22 +104,22 @@ def GenParticleInteractingFilterCfg(ConfigFlags, name="ISF_GenParticleInteractin
     #from G4AtlasApps.SimFlags import simFlags
     #simdict = simFlags.specialConfiguration.get_Value()
     #if simdict is not None and "InteractingPDGCodes" in simdict:
-    #    kwargs.setdefault('AdditionalInteractingParticleTypes', eval(simdict["InteractingPDGCodes"]))
+    #    kwargs.setdefault("AdditionalInteractingParticleTypes", eval(simdict["InteractingPDGCodes"]))
     #if simdict is not None and "NonInteractingPDGCodes" in simdict:
-    #    kwargs.setdefault('AdditionalNonInteractingParticleTypes', eval(simdict["InteractingNonPDGCodes"]))
+    #    kwargs.setdefault("AdditionalNonInteractingParticleTypes", eval(simdict["InteractingNonPDGCodes"]))
 
-    result.setPrivateTools(ISF__GenParticleInteractingFilter(name, **kwargs))
+    result.setPrivateTools(CompFactory.ISF.GenParticleInteractingFilter(name, **kwargs))
     return result
 
 def EtaPhiFilterCfg(ConfigFlags, name="ISF_EtaPhiFilter", **kwargs):
     result = ComponentAccumulator()
     # EtaPhiFilter
     EtaRange = 7.0 if ConfigFlags.Detector.SimulateLucid else 6.0
-    kwargs.setdefault('MinEta' , -EtaRange)
-    kwargs.setdefault('MaxEta' , EtaRange)
-    kwargs.setdefault('MaxApplicableRadius', 30*mm)
+    kwargs.setdefault("MinEta" , -EtaRange)
+    kwargs.setdefault("MaxEta" , EtaRange)
+    kwargs.setdefault("MaxApplicableRadius", 30*mm)
 
-    result.setPrivateTools(ISF__GenParticleGenericFilter(name, **kwargs))
+    result.setPrivateTools(CompFactory.ISF.GenParticleGenericFilter(name, **kwargs))
     return result
 
 #--------------------------------------------------------------------------------------------------
@@ -137,42 +139,148 @@ def EtaPhiFilterCfg(ConfigFlags, name="ISF_EtaPhiFilter", **kwargs):
 #  http://www-geant4.kek.jp/lxr/source//processes/hadronic/management/include/G4HadronicProcessType.hh#L46
 def TruthStrategyGroupID_MC15Cfg(ConfigFlags, name="ISF_MCTruthStrategyGroupID_MC15", **kwargs):
     result = ComponentAccumulator()
-    kwargs.setdefault('ParentMinPt'         , 100.*MeV)
-    kwargs.setdefault('ChildMinPt'          , 300.*MeV)
-    kwargs.setdefault('VertexTypes'         , [ 3, 14, 15, 4, 5, 6, 7, 2, 12, 13 ])
-    kwargs.setdefault('VertexTypeRangeLow'  , 201)  # All kinds of decay processes
-    kwargs.setdefault('VertexTypeRangeHigh' , 298)  # ...
-    kwargs.setdefault('Regions', [1,2]) # Could import AtlasDetDescr::AtlasRegion enum as in TruthService CfgGetter methods here
-    result.setPrivateTools(ISF__GenericTruthStrategy(name, **kwargs))
+    kwargs.setdefault("ParentMinPt", 100.*MeV)
+    kwargs.setdefault("ChildMinPt" , 300.*MeV)
+    kwargs.setdefault("VertexTypes", [3, 14, 15, 4, 5, 6, 7, 2, 12, 13])
+    kwargs.setdefault("VertexTypeRangeLow", 201)  # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh", 298)  # ...
+    kwargs.setdefault("Regions", [1,2]) # Could import AtlasDetDescr::AtlasRegion enum as in TruthService CfgGetter methods here
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
     return result
 
+
 def TruthStrategyGroupIDHadInt_MC15Cfg(ConfigFlags, name="ISF_MCTruthStrategyGroupIDHadInt_MC15", **kwargs):
     result = ComponentAccumulator()
-    kwargs.setdefault('ParentMinPt'                       , 100.*MeV)
-    kwargs.setdefault('ChildMinPt'                        , 300.*MeV)
-    kwargs.setdefault('VertexTypes'                       , [ 111, 121, 131, 141, 151, 161, 210 ])
-    kwargs.setdefault('AllowChildrenOrParentPassKineticCuts' , True)
-    kwargs.setdefault('Regions', [1])
-    result.setPrivateTools(ISF__GenericTruthStrategy(name, **kwargs))
+    kwargs.setdefault("ParentMinPt", 100.*MeV)
+    kwargs.setdefault("ChildMinPt" , 300.*MeV)
+    kwargs.setdefault("VertexTypes", [111, 121, 131, 141, 151, 161, 210])
+    kwargs.setdefault("AllowChildrenOrParentPassKineticCuts", True)
+    kwargs.setdefault("Regions", [1])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
     return result
 
+
 def TruthStrategyGroupCaloMuBremCfg(ConfigFlags, name="ISF_MCTruthStrategyGroupCaloMuBrem", **kwargs):
     result = ComponentAccumulator()
-    kwargs.setdefault('ParentMinEkin'       , 500.*MeV)
-    kwargs.setdefault('ChildMinEkin'        , 100.*MeV)
-    kwargs.setdefault('VertexTypes'         , [ 3 ])
-    kwargs.setdefault('ParentPDGCodes'      , [ 13, -13 ])
-    kwargs.setdefault('Regions', [3])
-    result.setPrivateTools(ISF__GenericTruthStrategy(name, **kwargs))
+    kwargs.setdefault("ParentMinEkin", 500.*MeV)
+    kwargs.setdefault("ChildMinEkin" , 100.*MeV)
+    kwargs.setdefault("VertexTypes"  , [3])
+    kwargs.setdefault("ParentPDGCodes", [13, -13])
+    kwargs.setdefault("Regions", [3])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
     return result
 
+
 def TruthStrategyGroupCaloDecay_MC15Cfg(ConfigFlags, name="ISF_MCTruthStrategyGroupCaloDecay_MC15", **kwargs):
     result = ComponentAccumulator()
-    kwargs.setdefault('ParentMinEkin'       , 1000.*MeV)
-    kwargs.setdefault('ChildMinEkin'        , 500.*MeV)
-    kwargs.setdefault('VertexTypes'         , [ 5, 6, 7 ])
-    kwargs.setdefault('VertexTypeRangeLow'  , 201)  # All kinds of decay processes
-    kwargs.setdefault('VertexTypeRangeHigh' , 298)  # ...
-    kwargs.setdefault('Regions', [3])
-    result.setPrivateTools(ISF__GenericTruthStrategy(name, **kwargs))
+    kwargs.setdefault("ParentMinEkin", 1000.*MeV)
+    kwargs.setdefault("ChildMinEkin" , 500.*MeV)
+    kwargs.setdefault("VertexTypes"  , [5, 6, 7])
+    kwargs.setdefault("VertexTypeRangeLow" , 201)  # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh", 298)  # ...
+    kwargs.setdefault("Regions", [3])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
+    return result
+
+
+def TruthStrategyGroupIDCfg(ConfigFlags, name="ISF_MCTruthStrategyGroupID", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParentMinPt", 100.*MeV)
+    kwargs.setdefault("ChildMinPt" , 100.*MeV)
+    kwargs.setdefault("VertexTypes", [3, 14, 15, 4, 5, 6, 7, 2, 12, 13])
+    kwargs.setdefault("VertexTypeRangeLow"  , 201)  # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh" , 298)  # ...
+    kwargs.setdefault("Regions", [1,2])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
+    return result
+
+
+def TruthStrategyGroupIDHadIntCfg(ConfigFlags, name="ISF_MCTruthStrategyGroupIDHadInt", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParentMinPt", 100.*MeV)
+    kwargs.setdefault("ChildMinPt" , 100.*MeV)
+    kwargs.setdefault("VertexTypes", [111, 121, 131, 141, 151, 161, 210])
+    kwargs.setdefault("AllowChildrenOrParentPassKineticCuts", True)
+    kwargs.setdefault("Regions", [1])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
+    return result
+
+
+def TruthStrategyGroupCaloMuBrem_MC15Cfg(ConfigFlags, name="ISF_MCTruthStrategyGroupCaloMuBrem_MC15", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParentMinEkin", 500.*MeV)
+    kwargs.setdefault("ChildMinEkin" , 300.*MeV)
+    kwargs.setdefault("VertexTypes"  , [3])
+    kwargs.setdefault("ParentPDGCodes", [13, -13])
+    kwargs.setdefault("Regions", [3])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
+    return result
+
+
+def TruthStrategyGroupCaloDecayCfg(ConfigFlags, name="ISF_MCTruthStrategyGroupCaloDecay", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParentMinPt", 1000.*MeV)
+    kwargs.setdefault("ChildMinPt" , 500.*MeV)
+    kwargs.setdefault("VertexTypes", [5, 6, 7])
+    kwargs.setdefault("VertexTypeRangeLow" , 201)  # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh", 298)  # ...
+    kwargs.setdefault("Regions", [3])
+    result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
+    return result
+
+def ValidationTruthStrategyCfg(ConfigFlags, name="ISF_ValidationTruthStrategy", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParentMinP", 50.*MeV)
+    kwargs.setdefault("Regions", [1,3])
+    result.setPrivateTools(CompFactory.ISF.ValidationTruthStrategy(name, **kwargs))
+    return result
+
+
+def LLPTruthStrategyCfg(ConfigFlags, name="ISF_LLPTruthStrategy", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("PassProcessCodeRangeLow",  200)
+    kwargs.setdefault("PassProcessCodeRangeHigh", 299)
+    # ProcessCategory==9 corresponds to the "fUserDefined" G4ProcessType:
+    #   http://www-geant4.kek.jp/lxr/source//processes/management/include/G4ProcessType.hh
+    kwargs.setdefault("PassProcessCategory", 9) # ==
+    kwargs.setdefault("Regions", [1,2,3,4])
+    result.setPrivateTools(CompFactory.ISF.LLPTruthStrategy(name, **kwargs))
+    return result
+
+
+def KeepLLPDecayChildrenStrategyCfg(ConfigFlags, name="ISF_KeepLLPDecayChildrenStrategy", **kwargs):
+    result = ComponentAccumulator()
+    # ProcessCategory==9 corresponds to the "fUserDefined" G4ProcessType:
+    #   http://www-geant4.kek.jp/lxr/source//processes/management/include/G4ProcessType.hh
+    kwargs.setdefault("PassProcessCategory", 9) # ==
+    kwargs.setdefault("VertexTypeRangeLow" , 200) # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh", 299) # ...
+    kwargs.setdefault("BSMParent"          , True)
+    result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
+    return result
+
+
+def KeepLLPHadronicInteractionChildrenStrategyCfg(ConfigFlags, name="ISF_KeepLLPHadronicInteractionChildrenStrategy", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("VertexTypes", [111, 121, 131, 141, 151, 161, 210])
+    kwargs.setdefault("BSMParent"  , True)
+    result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
+    return result
+
+
+def KeepAllDecayChildrenStrategyCfg(ConfigFlags, name="ISF_KeepAllDecayChildrenStrategy", **kwargs):
+    result = ComponentAccumulator()
+    # ProcessCategory==9 corresponds to the "fUserDefined" G4ProcessType:
+    #   http://www-geant4.kek.jp/lxr/source//processes/management/include/G4ProcessType.hh
+    kwargs.setdefault("PassProcessCategory", 9) # ==
+    kwargs.setdefault("VertexTypeRangeLow" , 200) # All kinds of decay processes
+    kwargs.setdefault("VertexTypeRangeHigh", 299) # ...
+    result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
+    return result
+
+
+def KeepHadronicInteractionChildrenStrategyCfg(ConfigFlags, name="ISF_KeepHadronicInteractionChildrenStrategy", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("VertexTypes", [111, 121, 131, 141, 151, 161, 210])
+    result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
     return result
diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
index 9e71c9a09f31..ac7fb2086c9d 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
+++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py
@@ -350,7 +350,7 @@ def getJPsiLeptonsConeGeant4Selector(name="ISF_JPsiLeptonsConeGeant4Selector", *
     kwargs.setdefault('ConeCreatorMinPt'            , 0.          )
     kwargs.setdefault('ConeSize'                    , 0.4         )
     kwargs.setdefault('CheckConeCreatorAncestors'   , True        )
-    kwargs.setdefault('ConeCreatorAncestor'         , [ 443 ]     ) # W
+    kwargs.setdefault('ConeCreatorAncestor'         , [ 443 ]     ) # J/Psi
     # see HepMC manual for HepMC::GenVertex::particle iterator
     # 0=parents, 1=family, 2=ancestors, 3=relatives
     kwargs.setdefault('ConeCreatorAncestorRelation' , 0           )
diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigNew.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigNew.py
new file mode 100644
index 000000000000..fde6340e3d45
--- /dev/null
+++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigNew.py
@@ -0,0 +1,533 @@
+"""
+ISF_SimulationSelectors for ComponentAccumulator configuration
+
+Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaCommon.SystemOfUnits import GeV
+from ISF_SimulationSelectors import SimulationFlavor
+from ISF_Services.ISF_ServicesConfigNew import ParticleKillerSvcCfg
+from ISF_Geant4Services.ISF_Geant4ServicesConfigNew import (
+    Geant4SimCfg, AFIIGeant4SimCfg, LongLivedGeant4SimCfg, AFII_QS_Geant4SimCfg,
+    FullGeant4SimCfg, PassBackGeant4SimCfg
+)
+
+
+def DefaultSimSelectorCfg(flags, name="ISF_DefaultSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    acc.setPrivateTools(CompFactory.ISF.DefaultSimSelector(name, **kwargs))
+    return acc
+
+
+def DefaultParticleKillerSelectorCfg(flags, name="ISF_DefaultParticleKillerSelector", **kwargs):
+    acc = ParticleKillerSvcCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_ParticleKillerSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.ParticleKiller)
+    acc.merge(DefaultSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def PileupParticleKillerSelectorCfg(flags, name="ISF_PileupParticleKillerSelector", **kwargs):
+    acc = ParticleKillerSvcCfg(flags)
+    kwargs.setdefault("PileupBCID", [1])
+    kwargs.setdefault("Simulator", acc.getService("ISF_ParticleKillerSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.ParticleKiller)
+    acc.setPrivateTools(CompFactory.ISF.KinematicPileupSimSelector(name, **kwargs))
+    return acc
+
+
+def DefaultGeant4SelectorCfg(flags, name="ISF_DefaultGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(DefaultSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def DefaultAFIIGeant4SelectorCfg(flags, name="ISF_DefaultAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    acc.merge(DefaultGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def DefaultLongLivedGeant4SelectorCfg(flags, name="ISF_DefaultLongLivedGeant4Selector", **kwargs):
+    acc = LongLivedGeant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_LongLivedGeant4SimSvc"))
+    acc.merge(DefaultGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def DefaultAFII_QS_Geant4SelectorCfg(flags, name="ISF_DefaultAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(DefaultGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def FullGeant4SelectorCfg(flags, name="ISF_FullGeant4Selector", **kwargs):
+    acc = FullGeant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_FullGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(DefaultSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def PassBackGeant4SelectorCfg(flags, name="ISF_PassBackGeant4Selector", **kwargs):
+    acc = PassBackGeant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_PassBackGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(DefaultSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def DefaultFastCaloSimSelectorCfg(flags, name="ISF_DefaultFastCaloSimSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FastCaloSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSim)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultLegacyAFIIFastCaloSimSelectorCfg(flags, name="ISF_DefaultLegacyAFIIFastCaloSimSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_LegacyAFIIFastCaloSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSim)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultFastCaloSimV2SelectorCfg(flags, name="ISF_DefaultFastCaloSimV2Selector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FastCaloSimSvcV2") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSimV2)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultDNNCaloSimSelectorCfg(flags, name="ISF_DefaultDNNCaloSimSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_DNNCaloSimSvc") # TODO
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def FastHitConvAlgFastCaloSimSelectorCfg(flags, name="ISF_FastHitConvAlgFastCaloSimSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FastHitConvAlgFastCaloSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSim)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+def FastHitConvAlgLegacyAFIIFastCaloSimSelectorCfg(flags, name="ISF_FastHitConvAlgLegacyAFIIFastCaloSimSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FastHitConvAlgLegacyAFIIFastCaloSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSim)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultFatrasSelectorCfg(flags, name="ISF_DefaultFatrasSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultFatrasNewExtrapolationSelectorCfg(flags, name="ISF_DefaultFatrasNewExtrapolationSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasNewExtrapolationSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+def DefaultParametricSimulationSelectorCfg(flags, name="ISF_DefaultParametricSimulationSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_ParametricSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Parametric)
+    return DefaultSimSelectorCfg(flags, name, **kwargs)
+
+
+# PileUpSimSelector Configurations
+def PileupSimSelectorCfg(flags, name="ISF_PileupSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    acc.setPrivateTools(CompFactory.ISF.KinematicPileupSimSelector(name, **kwargs))
+    return acc
+
+
+def FatrasPileupSelectorCfg(flags, name="ISF_FatrasPileupSelector", **kwargs):
+    kwargs.setdefault("PileupBCID", [1])
+    kwargs.setdefault("Simulator", "ISF_FatrasPileupSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FatrasPileup)
+    return PileupSimSelectorCfg(flags, name, **kwargs)
+
+
+def FatrasPileupSelector_noHits(flags, name="ISF_FatrasPileupSelector_noHits", **kwargs):
+    kwargs.setdefault("PileupBCID", [2])
+    kwargs.setdefault("Simulator", "ISF_FatrasPileupSimSvc_noHits") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FatrasPileup)
+    return PileupSimSelectorCfg(flags, name, **kwargs)
+
+
+def FastCaloSimPileupSelectorCfg(flags, name="ISF_FastCaloSimPileupSelector", **kwargs):
+    kwargs.setdefault("PileupBCID"  , flags.Sim.FastChain.BCID)
+    kwargs.setdefault("Simulator", "ISF_FastCaloSimPileupSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSimPileup)
+    return PileupSimSelectorCfg(flags, name, **kwargs)
+
+
+def FastCaloSimPileupOTSelectorCfg(flags, name="ISF_FastCaloSimPileupOTSelector", **kwargs):
+    kwargs.setdefault("PileupBCID", flags.Sim.FastChain.BCID)
+    kwargs.setdefault("Simulator", "ISF_FastCaloSimPileupOTSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSimPileup)
+    return PileupSimSelectorCfg(flags, name, **kwargs)
+
+
+# KinematicSimSelector Configurations
+def ElectronGeant4SelectorCfg(flags, name="ISF_ElectronGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("ParticlePDG", 11)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def NeutralGeant4SelectorCfg(flags, name="ISF_NeutralGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Charge", 0)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def ProtonAFIIGeant4SelectorCfg(flags, name="ISF_ProtonAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("MaxMom", 750)
+    kwargs.setdefault("ParticlePDG", 2212)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def ProtonAFII_QS_Geant4SelectorCfg(flags, name="ISF_ProtonAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(ProtonAFIIGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def PionAFIIGeant4SelectorCfg(flags, name="ISF_PionAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("MaxMom", 200)
+    kwargs.setdefault("ParticlePDG", 211)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def PionAFII_QS_Geant4SelectorCfg(flags, name="ISF_PionAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(PionAFIIGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def ChargedKaonAFIIGeant4SelectorCfg(flags, name="ISF_ChargedKaonAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("MaxMom", 750)
+    kwargs.setdefault("ParticlePDG", 321)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def ChargedKaonAFII_QS_Geant4SelectorCfg(flags, name="ISF_ChargedKaonAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(ChargedKaonAFIIGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def KLongAFIIGeant4SelectorCfg(flags, name="ISF_KLongAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("MaxMom", 750)
+    kwargs.setdefault("ParticlePDG", 130)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def KLongAFII_QS_Geant4SelectorCfg(flags, name="ISF_KLongAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(KLongAFIIGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def MuonSelectorCfg(flags, name="ISF_MuonSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("ParticlePDG", 13)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+def MuonGeant4SelectorCfg(flags, name="ISF_MuonGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(MuonSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def MuonAFIIGeant4SelectorCfg(flags, name="ISF_MuonAFIIGeant4Selector", **kwargs):
+    acc = AFIIGeant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFIIGeant4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(MuonGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def MuonAFII_QS_Geant4SelectorCfg(flags, name="ISF_MuonAFII_QS_Geant4Selector", **kwargs):
+    acc = AFII_QS_Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_AFII_QS_Geant4SimSvc"))
+    acc.merge(MuonGeant4SelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def MuonFatrasSelectorCfg(flags, name="ISF_MuonFatrasSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return MuonSelectorCfg(flags, name, **kwargs)
+
+
+def MuonFatrasPileupSelectorCfg(flags, name="ISF_MuonFatrasPileupSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasPileupSimSvc") # TODO
+    kwargs.setdefault("PileupBCID", [1])
+    kwargs.setdefault("ParticlePDG", 13)
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return PileupSimSelectorCfg(flags, name, **kwargs)
+
+
+def WithinEta5FastCaloSimSelectorCfg(flags, name="ISF_WithinEta5FastCaloSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("Simulator", "ISF_FastCaloSimSvc") # TODO
+    kwargs.setdefault("MinPosEta", -5.0)
+    kwargs.setdefault("MaxPosEta",  5.0)
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.FastCaloSim)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def EtaGreater5ParticleKillerSimSelectorCfg(flags, name="ISF_EtaGreater5ParticleKillerSimSelector", **kwargs):
+    acc = ParticleKillerSvcCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_ParticleKillerSvc"))
+    kwargs.setdefault("MinPosEta", -5.0)
+    kwargs.setdefault("MaxPosEta",  5.0)
+    kwargs.setdefault("InvertCuts", True)
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.ParticleKiller)
+    acc.setPrivateTools(CompFactory.ISF.KinematicSimSelector(name, **kwargs))
+    return acc
+
+
+def EtaGreater5PileupParticleKillerSimSelectorCfg(flags, name="ISF_EtaGreater5PileupParticleKillerSimSelector", **kwargs):
+    acc = ParticleKillerSvcCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISF_ParticleKillerSvc"))
+    kwargs.setdefault("MinPosEta", -5.0)
+    kwargs.setdefault("MaxPosEta",  5.0)
+    kwargs.setdefault("InvertCuts", True)
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.ParticleKiller)
+    acc.setPrivateTools(CompFactory.ISF.KinematicPileupSimSelector(name, **kwargs))
+    return acc
+
+
+# ConeSimSelector Configurations
+def PhotonConeSelectorCfg(flags, name="ISF_PhotonConeSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("ConeCreatorPDGs", [22]) # photons
+    kwargs.setdefault("ConeCreatorMinPt", 20.*GeV)
+    kwargs.setdefault("ConeSize", 0.6)
+    kwargs.setdefault("CheckConeCreatorAncestors", False)
+    acc.setPrivateTools(CompFactory.ISF.ConeSimSelector(name, **kwargs))
+    return acc
+
+
+def PhotonConeFatrasSelectorCfg(flags, name="ISF_PhotonConeFatrasSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return PhotonConeSelectorCfg(flags, name, **kwargs)
+
+
+def PhotonConeGeant4SelectorCfg(flags, name="ISF_PhotonConeGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(PhotonConeSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def HiggsLeptonsConeSimSelectorCfg(flags, name="ISF_HiggsLeptonsConeSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("ConeCreatorPDGs", [11, 13]) # e, mu
+    kwargs.setdefault("ConeCreatorMinPt", 0.)
+    kwargs.setdefault("ConeSize", 0.4)
+    kwargs.setdefault("CheckConeCreatorAncestors", True)
+    kwargs.setdefault("ConeCreatorAncestor", [24, 23]) # W , Z
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("ConeCreatorAncestorRelation", 1)
+    acc.setPrivateTools(CompFactory.ISF.ConeSimSelector(name, **kwargs))
+    return acc
+
+
+def HiggsLeptonsConeGeant4SelectorCfg(flags, name="ISF_HiggsLeptonsConeGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(HiggsLeptonsConeSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def ElectronsMuonsConeSimSelectorCfg(flags, name="ISF_ElectronsMuonsConeSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("ConeCreatorPDGs", [11, 13]) # e, mu
+    acc.setPrivateTools(CompFactory.ISF.ConeSimSelector(name, **kwargs))
+    return acc
+
+
+def HiggsLeptonsConeGeant4CaloSelectorCfg(flags, name="ISF_HiggsLeptonsConeGeant4CaloSelector", **kwargs):
+    kwargs.setdefault( "ExtrapolateToCaloEntry", True)
+    kwargs.setdefault( "Extrapolator", "ISF_CaloEntryTrkExtrapolator")
+    return HiggsLeptonsConeGeant4SelectorCfg(flags, name, **kwargs)
+
+
+def WLeptonsConeGeant4SelectorCfg(flags, name="ISF_WLeptonsConeGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    kwargs.setdefault("ConeCreatorMinPt", 0.)
+    kwargs.setdefault("ConeSize", 0.4)
+    kwargs.setdefault("CheckConeCreatorAncestors", True)
+    kwargs.setdefault("ConeCreatorAncestor", [24]) # W
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("ConeCreatorAncestorRelation", 0)
+    acc.merge(ElectronsMuonsConeSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def ZLeptonsDirectionConeGeant4SelectorCfg(flags, name="ISF_ZLeptonsDirectionConeGeant4Selector", **kwargs):
+    # this selector picks all particles with a mometum direction
+    # within DeltaR<ConeSize relative to the Z decay lepton directions
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    kwargs.setdefault("ConeCreatorMinPt", 0.)
+    kwargs.setdefault("ConeSize", 0.4)
+    kwargs.setdefault("CheckConeCreatorAncestors", True)
+    kwargs.setdefault("ConeCreatorAncestor", [23]) # Z
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("ConeCreatorAncestorRelation", 0)
+    acc.merge(ElectronsMuonsConeSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def ZLeptonsPositionConeGeant4SelectorCfg(flags, name="ISF_ZLeptonsPositionConeGeant4Selector", **kwargs):
+    # this selector picks all particles with a position inside a cone
+    # around the Z decay leptons directions
+    kwargs.setdefault("CheckParticlePosition", True)
+    return ZLeptonsDirectionConeGeant4SelectorCfg(flags, name, **kwargs)
+
+
+def JPsiLeptonsConeGeant4SelectorCfg(flags, name="ISF_JPsiLeptonsConeGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    kwargs.setdefault("ConeCreatorMinPt", 0.)
+    kwargs.setdefault("ConeSize", 0.4)
+    kwargs.setdefault("CheckConeCreatorAncestors", True)
+    kwargs.setdefault("ConeCreatorAncestor", [443]) # J/Psi
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("ConeCreatorAncestorRelation", 0)
+    acc.merge(ElectronsMuonsConeSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+# TruthAssocSimSelector configurations
+def BHadronProductsSimSelectorCfg(flags, name="ISF_BHadronProductsSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    B_hadrons = [
+        511, 521, 531, 541,
+        5122, 5112, 5132,
+        5232, 5212, 5222
+    ]
+    kwargs.setdefault("RelativesPDGCode", B_hadrons)
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("Relation", 2)
+    acc.setPrivateTools(CompFactory.ISF.TruthAssocSimSelector(name, **kwargs))
+    return acc
+
+
+def BHadronProductsGeant4SelectorCfg(flags, name="ISF_BHadronProductsGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(BHadronProductsSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def BHadronProductsFatrasSelectorCfg(flags, name="ISF_BHadronProductsFatrasSelector", **kwargs):
+    kwargs.setdefault("Simulator", "ISF_FatrasSimSvc") # TODO
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Fatras)
+    return BHadronProductsSimSelectorCfg(flags, name, **kwargs)
+
+
+def TauProductsSimSelectorCfg(flags, name="ISF_TauProductsSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("RelativesPDGCode", [15]) # tau
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("Relation", 0)
+    acc.setPrivateTools(CompFactory.ISF.TruthAssocSimSelector(name, **kwargs))
+    return acc
+
+
+def TauProductsGeant4SelectorCfg(flags, name="ISF_TauProductsGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(TauProductsSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+def ZProductsSimSelectorCfg(flags, name="ISF_ZProductsSimSelector", **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("RelativesPDGCode", [23]) # Z
+    # see HepMC manual for HepMC::GenVertex::particle iterator
+    # 0=parents, 1=family, 2=ancestors, 3=relatives
+    kwargs.setdefault("Relation", 0)
+    acc.setPrivateTools(CompFactory.ISF.TruthAssocSimSelector(name, **kwargs))
+    return acc
+
+
+def ZProductsGeant4SelectorCfg(flags, name="ISF_ZProductsGeant4Selector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.merge(ZProductsSimSelectorCfg(flags, name, **kwargs))
+    return acc
+
+
+# HistorySimSelector Configurations
+def SubDetStickyGeant4SimSelectorCfg(flags, name="ISF_SubDetStickyGeant4SimSelector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("PrevSimSvc", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("RequiresUnchangedGeoID", True)
+    kwargs.setdefault("Simulator", "ISF_Geant4SimSvc")
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.HistorySimSelector(name, **kwargs))
+    return acc
+
+
+def GlobalStickyGeant4SimSelectorCfg(flags, name="ISF_GlobalStickyGeant4SimSelector", **kwargs):
+    acc = Geant4SimCfg(flags)
+    kwargs.setdefault("PrevSimSvc", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("RequiresUnchangedGeoID", False)
+    kwargs.setdefault("Simulator", acc.getService("ISFG4SimSvc"))
+    kwargs.setdefault("SimulationFlavor", SimulationFlavor.Geant4)
+    acc.setPrivateTools(CompFactory.ISF.HistorySimSelector(name, **kwargs))
+    return acc
-- 
GitLab


From 3ff65cd2f8f012ddd8e54dcc54629b76ddc3204d Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Fri, 3 Jul 2020 23:05:23 +0200
Subject: [PATCH 022/217] Fix crash in finalisation of the standalone post
 processing

For some reason, when compiling with cmake, ths standalone job
crashes in the finalisation of a correlation plot.

The changes the type of fit that root is trying and so should
no longer crash.

Interestingly, when compiled outside athena, or with the athena
release, but with a standalone makefile, this runs fine.
---
 .../TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
index 6f9eec0452cd..c99318a83c67 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx
@@ -2216,7 +2216,7 @@ int main(int argc, char** argv)
   
   //  hcorr->Finalise(Resplot::FitPoisson);
 
-  hcorr->Finalise(); 
+  hcorr->Finalise(Resplot::FitNull95); 
   hcorr->Write();
 
   for ( int i=analyses.size() ; i-- ; ) { 
-- 
GitLab


From 3ae812e5327ee96cf563c8b907f7a9436cf70c8e Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Fri, 3 Jul 2020 23:00:41 +0200
Subject: [PATCH 023/217] Add switch over surface types

---
 .../TrkExUtils/src/RungeKuttaUtils.cxx        | 112 +++++++++++++-----
 1 file changed, 83 insertions(+), 29 deletions(-)

diff --git a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx
index dd9aab60994f..a9f7bd7f4e46 100755
--- a/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx
+++ b/Tracking/TrkExtrapolation/TrkExUtils/src/RungeKuttaUtils.cxx
@@ -98,14 +98,14 @@ transformGlobalToDisc(const Trk::Surface* su,
 {
   const Amg::Transform3D&  T = su->transform();  
 
-  double Ax[3] = {T(0,0),T(1,0),T(2,0)};
-  double Ay[3] = {T(0,1),T(1,1),T(2,1)};
+  const double Ax[3] = {T(0,0),T(1,0),T(2,0)};
+  const double Ay[3] = {T(0,1),T(1,1),T(2,1)};
   
-  double d[3] = {P[0]-T(0,3),P[1]-T(1,3),P[2]-T(2,3)};
+  const double d[3] = {P[0]-T(0,3),P[1]-T(1,3),P[2]-T(2,3)};
 
-  double RC   = d[0]*Ax[0]+d[1]*Ax[1]+d[2]*Ax[2];
-  double RS   = d[0]*Ay[0]+d[1]*Ay[1]+d[2]*Ay[2];
-  double R2   = RC*RC+RS*RS;
+  const double RC   = d[0]*Ax[0]+d[1]*Ax[1]+d[2]*Ax[2];
+  const double RS   = d[0]*Ay[0]+d[1]*Ay[1]+d[2]*Ay[2];
+  const double R2   = RC*RC+RS*RS;
   par[0]      = sqrt(R2);
   par[1]      = atan2(RS,RC);
   
@@ -171,9 +171,9 @@ transformGlobalToCylinder(const Trk::Surface* su,
 
   const Amg::Transform3D&  T = su->transform();  
  
-  double Ax[3] = {T(0,0),T(1,0),T(2,0)};
-  double Ay[3] = {T(0,1),T(1,1),T(2,1)};
-  double Az[3] = {T(0,2),T(1,2),T(2,2)};
+  const double Ax[3] = {T(0,0),T(1,0),T(2,0)};
+  const double Ay[3] = {T(0,1),T(1,1),T(2,1)};
+  const double Az[3] = {T(0,2),T(1,2),T(2,2)};
 
   double R     = static_cast<const Trk::CylinderSurface*>(su)->bounds().r();
 
@@ -244,7 +244,7 @@ transformGlobalToLine(const Trk::Surface* su,
 {
   const Amg::Transform3D&  T = su->transform();  
   
-  double A[3] = {T(0,2),T(1,2),T(2,2)};
+  const double A[3] = {T(0,2),T(1,2),T(2,2)};
 
   double Bx = A[1]*P[5]-A[2]*P[4];
   double By = A[2]*P[3]-A[0]*P[5];
@@ -535,14 +535,34 @@ void Trk::RungeKuttaUtils::transformGlobalToLocal
   par[3]  = acos (P[5]);
   par[4]  = P[6];
 
-  const unsigned int ty = su->type(); 
+  const unsigned int ty = su->type();
 
-  if     (ty == Trk::Surface::Plane   ) transformGlobalToPlane   (su,useJac,P,par,Jac); 
-  else if(ty == Trk::Surface::Line    ) transformGlobalToLine    (su,useJac,P,par,Jac);
-  else if(ty == Trk::Surface::Cylinder) transformGlobalToCylinder(su,useJac,P,par,Jac);
-  else if(ty == Trk::Surface::Perigee ) transformGlobalToLine    (su,useJac,P,par,Jac);
-  else if(ty == Trk::Surface::Disc    ) transformGlobalToDisc    (su,useJac,P,par,Jac);
-  else                                  transformGlobalToCone    (su,useJac,P,par,Jac);
+  switch (ty) {
+    case Trk::Surface::Plane: {
+      transformGlobalToPlane(su, useJac, P, par, Jac);
+      break;
+    }
+    case Trk::Surface::Line: {
+      transformGlobalToLine(su, useJac, P, par, Jac);
+      break;
+    }
+    case Trk::Surface::Cylinder: {
+      transformGlobalToCylinder(su, useJac, P, par, Jac);
+      break;
+    }
+    case Trk::Surface::Perigee: {
+      transformGlobalToLine(su, useJac, P, par, Jac);
+      break;
+    }
+    case Trk::Surface::Disc: {
+      transformGlobalToDisc(su, useJac, P, par, Jac);
+      break;
+    }
+    case Trk::Surface::Cone: {
+      transformGlobalToCone(su, useJac, P, par, Jac);
+      break;
+    }
+  }
 
   if(!useJac) return;
 
@@ -574,11 +594,23 @@ void Trk::RungeKuttaUtils::transformGlobalToLocal
 double Trk::RungeKuttaUtils::stepEstimator
 (int kind,double* Su,const double* P,bool& Q)
 {
-  if(kind==1) return stepEstimatorToPlane       (Su,P,Q);
-  if(kind==0) return stepEstimatorToStraightLine(Su,P,Q);
-  if(kind==2) return stepEstimatorToCylinder    (Su,P,Q);
-  if(kind==3) return stepEstimatorToCone        (Su,P,Q);
-  return 1000000.;
+  switch (kind) {
+    case 0: {
+      return stepEstimatorToStraightLine(Su, P, Q);
+    }
+    case 1: {
+      return stepEstimatorToPlane(Su, P, Q);
+    }
+    case 2: {
+      return stepEstimatorToCylinder(Su, P, Q);
+    }
+    case 3: {
+      return stepEstimatorToCone(Su, P, Q);
+    }
+    default: {
+      return 1000000.;
+    }
+  }
 } 
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -964,12 +996,32 @@ bool Trk::RungeKuttaUtils::transformLocalToGlobal
   }
 
   const unsigned int ty = su->type();
-  if(ty == Trk::Surface::Plane   ) {transformPlaneToGlobal   (useJac,su,p,P); return true;}
-  if(ty == Trk::Surface::Line    ) {transformLineToGlobal    (useJac,su,p,P); return true;}
-  if(ty == Trk::Surface::Cylinder) {transformCylinderToGlobal(useJac,su,p,P); return true;}
-  if(ty == Trk::Surface::Perigee ) {transformLineToGlobal    (useJac,su,p,P); return true;}
-  if(ty == Trk::Surface::Disc    ) {transformDiscToGlobal    (useJac,su,p,P); return true;}
-  return false; 
+  switch (ty) {
+    case Trk::Surface::Plane: {
+      transformPlaneToGlobal(useJac, su, p, P);
+      return true;
+    }
+    case Trk::Surface::Line: {
+      transformLineToGlobal(useJac, su, p, P);
+      return true;
+    }
+    case Trk::Surface::Cylinder: {
+      transformCylinderToGlobal(useJac, su, p, P);
+      return true;
+    }
+    case Trk::Surface::Perigee: {
+      transformLineToGlobal(useJac, su, p, P);
+      return true;
+    }
+    case Trk::Surface::Disc: {
+      transformDiscToGlobal(useJac, su, p, P);
+      return true;
+    }
+    default: {
+      return false;
+    }
+  }
+
 }
 
 /////////////////////////////////////////////////////////////////////////////////
@@ -1125,7 +1177,9 @@ void Trk::RungeKuttaUtils::jacobianTransformCurvilinearToLocal
 
   const Amg::Transform3D& T = su->transform();
 
-  double Sf,Cf,Ce,Se; sincos(P[2],&Sf,&Cf);  sincos(P[3],&Se,&Ce);
+  double Sf,Cf,Ce,Se; 
+  sincos(P[2],&Sf,&Cf);  
+  sincos(P[3],&Se,&Ce);
   
   P[ 4] =  Cf*Se; P[ 5] =  Sf*Se; P[ 6] = Ce    ;   // At   
   P[ 7] = -Sf   ; P[ 8] =  Cf   ; P[ 9] = 0.    ;   // Au
-- 
GitLab


From 095e994750d9a1dd50d07bab0530108053e116af Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Thu, 2 Jul 2020 20:10:37 +0200
Subject: [PATCH 024/217] Fix BStoBStoESDAOD test options

---
 .../test_trigAna_BStoBStoESDAOD_mt1_build.py  | 27 +++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
index 20b559c737ff..38c051550fa7 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_BStoBStoESDAOD_mt1_build.py
@@ -11,13 +11,21 @@ def findFile(pattern):
     '''Bash inline file name finder'''
     return '`find . -name \'{:s}\' | tail -n 1`'.format(pattern)
 
+menu_name = 'LS2_v1'
+
 # Run athena BS->BS job
 BStoBS = ExecStep.ExecStep("BStoBS")
 BStoBS.type = 'athena'
 BStoBS.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 BStoBS.input = 'data'
 BStoBS.threads = 1
-BStoBS.args += ' -c "setMenu=\'LS2_v1\';doWriteBS=True;doWriteRDOTrigger=False;forceEnableAllChains=True;"'
+BStoBSPreExec = ''.join([
+  'setMenu=\'{:s}\';'.format(menu_name),
+  'rewriteLVL1=True;',  # Write L1 result to BS
+  'doWriteBS=True;',    # Write HLT result to BS
+  'forceEnableAllChains=True;',  # Ignore L1 decisions in seeding chains
+])
+BStoBS.args = ' -c "{:s}"'.format(BStoBSPreExec)
 
 # Extract the Main stream data
 filterBS = ExecStep.ExecStep('FilterBS')
@@ -28,9 +36,24 @@ filterBS.args = '-s Main ' + findFile('data_test.*.Single_Stream.daq.RAW.*.data'
 
 # Reconstruction step, BS->ESD->AOD
 recoPreExec = ' '.join([
+  # Reco flags to disable things missing inputs from previous step
+  "from RecExConfig.RecFlags import rec;",
+  "rec.doInDet=False;",
+  "rec.doAFP=False;",
+  "rec.doEgamma=False;",
+  "rec.doForwardDet=False;",
+  "rec.doMuon=False;",
+  "rec.doMuonCombined=False;",
+  "rec.doJetMissingETTag=False;",
+  "rec.doTau=False;",
+  "rec.doLucid=False;",
+  "from ParticleBuilderOptions.AODFlags import AODFlags;",
+  "AODFlags.ThinNegativeEnergyNeutralPFOs.set_Value_and_Lock(False);",
+  "AODFlags.AddEgammaMuonTracksInAOD.set_Value_and_Lock(False);",
+  # Trigger flags
   "from TriggerJobOpts.TriggerFlags import TriggerFlags;",
   "TriggerFlags.configForStartup=\'HLToffline\';",
-  "TriggerFlags.triggerMenuSetup=\'PhysicsP1_pp_run3_v1\';",
+  "TriggerFlags.triggerMenuSetup=\'{:s}\';".format(menu_name),
   "TriggerFlags.inputHLTconfigFile.set_Value_and_Lock(\'NONE\');",
   "TriggerFlags.AODEDMSet.set_Value_and_Lock(\'AODFULL\');"])
 reco = ExecStep.ExecStep('Tier0Reco')
-- 
GitLab


From bf99fffcca769a839e3783fb412d08650ccce433 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 3 Jul 2020 16:40:06 +0200
Subject: [PATCH 025/217] Extend rewriteLVL1 modifier to support offline athena

---
 .../TriggerJobOpts/python/Modifiers.py        | 32 ++++++++++++++++---
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index 932b1d6de013..a1725831e0ba 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -767,7 +767,7 @@ class rerunDMLVL1(_modifier):
 
 class rewriteLVL1(_modifier):
     """
-    Rewrite LVL1 (use together with rerunLVL1)
+    Write LVL1 results to ByteStream output, usually used together with rerunLVL1
     """
     # Example:
     # athenaHLT -c "setMenu='PhysicsP1_pp_run3_v1';rerunLVL1=True;rewriteLVL1=True;" --filesInput=input.data TriggerJobOpts/runHLT_standalone.py
@@ -777,11 +777,33 @@ class rewriteLVL1(_modifier):
         L1ByteStreamEncodersRecExSetup()
 
     def postSetup(self):
-        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
         from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-        TriggerFlags.writeBS = True
-        svcMgr.HltEventLoopMgr.RewriteLVL1 = True
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        if not TriggerFlags.writeBS:
+            log.warning('rewriteLVL1 is True but TriggerFlags.writeBS is False')
+        if not ConfigFlags.Output.doWriteBS:
+            log.warning('rewriteLVL1 is True but ConfigFlags.Output.doWriteBS is False')
+        if not ConfigFlags.Trigger.writeBS:
+            log.warning('rewriteLVL1 is True but ConfigFlags.Trigger.writeBS is False')
+
+        if ConfigFlags.Trigger.Online.isPartition:
+            # online
+            from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+            svcMgr.HltEventLoopMgr.RewriteLVL1 = True
+        else:
+            # offline
+            from AthenaCommon.AlgSequence import AthSequencer
+            from AthenaCommon.CFElements import findAlgorithm
+            seq = AthSequencer('AthOutSeq')
+            streamBS = findAlgorithm(seq, 'BSOutputStreamAlg')
+            if False: # (needs !33608) ConfigFlags.Trigger.enableL1Phase1:
+                out_type = 'xAOD::TrigCompositeContainer'
+                out_name = 'L1TriggerResult'
+            else:
+                out_type = 'ROIB::RoIBResult'
+                out_name = 'RoIBResult'
+            streamBS.ExtraInputs += [ (out_type, 'StoreGateSvc+'+out_name) ]
+            streamBS.ItemList += [ out_type+'#'+out_name ]
 
 
 class writeBS(_modifier):
-- 
GitLab


From 340aaaf52a3ba1f30f23e00a10febb6cdc2121b2 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 3 Jul 2020 16:40:32 +0200
Subject: [PATCH 026/217] Move modifierst postSetup to the end of
 runHLT_standalone

---
 .../TriggerJobOpts/share/runHLT_standalone.py        | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 4f66fbe955c3..120161eec1b7 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -536,12 +536,6 @@ if hasattr(svcMgr.THistSvc, "Output"):
     from TriggerJobOpts.HLTTriggerGetter import setTHistSvcOutput
     setTHistSvcOutput(svcMgr.THistSvc.Output)
 
-#-------------------------------------------------------------
-# Apply modifiers
-#-------------------------------------------------------------
-for mod in modifierList:
-    mod.postSetup()
-
 #-------------------------------------------------------------
 # Conditions overrides
 #-------------------------------------------------------------    
@@ -631,6 +625,12 @@ include("TriggerTest/disableChronoStatSvcPrintout.py")
 #-------------------------------------------------------------
 include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py")
 
+#-------------------------------------------------------------
+# Apply modifiers
+#-------------------------------------------------------------
+for mod in modifierList:
+    mod.postSetup()
+
 #-------------------------------------------------------------
 # Print top sequence
 #-------------------------------------------------------------
-- 
GitLab


From 260f6b81362c6e83dfc2247116f746078653daad Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 3 Jul 2020 23:53:03 +0200
Subject: [PATCH 027/217] Make use of new Trigger config flag

---
 Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index a1725831e0ba..16f7c4c7e6ee 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -796,7 +796,7 @@ class rewriteLVL1(_modifier):
             from AthenaCommon.CFElements import findAlgorithm
             seq = AthSequencer('AthOutSeq')
             streamBS = findAlgorithm(seq, 'BSOutputStreamAlg')
-            if False: # (needs !33608) ConfigFlags.Trigger.enableL1Phase1:
+            if ConfigFlags.Trigger.enableL1Phase1:
                 out_type = 'xAOD::TrigCompositeContainer'
                 out_name = 'L1TriggerResult'
             else:
-- 
GitLab


From 7a3f14c96bbab4226a225ffa76ee17267937dac7 Mon Sep 17 00:00:00 2001
From: Alexander Solodkov <Sanya.Solodkov@cern.ch>
Date: Sat, 4 Jul 2020 00:24:33 +0200
Subject: [PATCH 028/217] - jobOptions for calibration runs updated - minor fix
 in VERBOSE output in TileRawChannelToL2.cxx

---
 .../share/jobOptions_TileCalibRec.py          |  4 ++--
 .../TileRecEx/share/jobOptions_TileTBDump.py  | 12 ++++++----
 .../TileRecEx/share/jobOptions_TileTBStat.py  | 12 ++++++----
 .../TileL2Algs/src/TileRawChannelToL2.cxx     | 23 +++++++++----------
 4 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
index d789814f9a55..72bc0cb26a08 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
@@ -725,7 +725,7 @@ else:
     # Set Global tag for IOVDbSvc
     if not 'CondDbTag' in dir():
         if RUN2:
-            if 'UPD4' in dir() and UPD4: CondDbTag = 'CONDBR2-BLKPA-2018-13'
+            if 'UPD4' in dir() and UPD4: CondDbTag = 'CONDBR2-BLKPA-2018-16'
             else:                        CondDbTag = 'CONDBR2-ES1PA-2018-05'
         else:
             if 'UPD4' in dir() and UPD4 and RunNumber > 141066: CondDbTag = 'COMCOND-BLKPA-RUN1-06'
@@ -736,7 +736,7 @@ else:
     # Set Geometry version
     if not 'DetDescrVersion' in dir():
         if RUN2:
-            DetDescrVersion = 'ATLAS-R2-2015-04-00-00'
+            DetDescrVersion = 'ATLAS-R2-2016-01-00-01'
         else:
             DetDescrVersion = 'ATLAS-R1-2012-02-00-00'
 jobproperties.Global.DetDescrVersion = DetDescrVersion 
diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
index 3cc44b408a36..8a0247f6c094 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
@@ -7,6 +7,7 @@
 from os import system,popen
 from subprocess import check_output
 from subprocess import CalledProcessError
+import six
 
 from AthenaCommon.AppMgr import theApp
 svcMgr = theApp.serviceMgr()
@@ -112,8 +113,10 @@ if not 'InputDirectory' in dir():
             Year = 2017
         elif RunNumber < 367980:
             Year = 2018
-        else:
+        elif RunNumber < 374260:
             Year = 2019
+        else:
+            Year = 2020
 
 
         if 'RunStream' in dir():
@@ -176,6 +179,7 @@ def FindFile(path, runinput, filter):
         log.warn('Seems there are no such directory: ' + path)
 
 
+    files = [six.ensure_str(f) for f in files]
     for file_name in (files):
         if (path.startswith('/eos/')):
             fullname.append('root://eosatlas.cern.ch/' + path + '/' + file_name)
@@ -270,7 +274,7 @@ DetFlags.readRDOBS.Tile_setOn()
 DetFlags.Print()
 
 from AthenaCommon.GlobalFlags import jobproperties
-if RUN2: jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00"
+if RUN2: jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
 else:    jobproperties.Global.DetDescrVersion = "ATLAS-R1-2012-02-00-00"
 tbdump_log.info( "DetDescrVersion = %s" % (jobproperties.Global.DetDescrVersion()) )
 
@@ -286,8 +290,8 @@ if RUN2: rec.projectName = "data15_tilecomm"
 else:    rec.projectName = "data12_tilecomm"
 
 from IOVDbSvc.CondDB import conddb
-if MC:     conddb.setGlobalTag("OFLCOND-RUN12-SDR-25")
-elif RUN2: conddb.setGlobalTag("CONDBR2-BLKPA-2018-03")
+if MC:     conddb.setGlobalTag("OFLCOND-RUN12-SDR-35")
+elif RUN2: conddb.setGlobalTag("CONDBR2-BLKPA-2018-16")
 else:      conddb.setGlobalTag("COMCOND-BLKPA-RUN1-06")
 
 #=============================================================
diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
index b3c00014d093..04a07587c057 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
@@ -7,6 +7,7 @@
 from os import system,popen
 from subprocess import check_output
 from subprocess import CalledProcessError
+import six
 
 from AthenaCommon.AppMgr import theApp
 svcMgr = theApp.serviceMgr()
@@ -113,8 +114,10 @@ if not 'InputDirectory' in dir():
             Year = 2017
         elif RunNumber < 367980:
             Year = 2018
-        else:
+        elif RunNumber < 374260:
             Year = 2019
+        else:
+            Year = 2020
 
 
         if 'RunStream' in dir():
@@ -176,6 +179,7 @@ def FindFile(path, runinput, filter):
         log.warn('Seems there are no such directory: ' + path)
 
 
+    files = [six.ensure_str(f) for f in files]
     for file_name in (files):
         try:
             good=(not file_name in open('/afs/cern.ch/user/t/tilebeam/ARR/bad_data_files').read())
@@ -273,7 +277,7 @@ DetFlags.readRDOBS.Tile_setOn()
 DetFlags.Print()
 
 from AthenaCommon.GlobalFlags import jobproperties
-if RUN2: jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00"
+if RUN2: jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
 else:    jobproperties.Global.DetDescrVersion = "ATLAS-R1-2012-02-00-00"
 tbstat_log.info( "DetDescrVersion = %s" % (jobproperties.Global.DetDescrVersion()) )
 
@@ -289,8 +293,8 @@ if RUN2: rec.projectName = "data15_tilecomm"
 else:    rec.projectName = "data12_tilecomm"
 
 from IOVDbSvc.CondDB import conddb
-if MC:     conddb.setGlobalTag("OFLCOND-RUN12-SDR-25")
-elif RUN2: conddb.setGlobalTag("CONDBR2-BLKPA-2018-03")
+if MC:     conddb.setGlobalTag("OFLCOND-RUN12-SDR-35")
+elif RUN2: conddb.setGlobalTag("CONDBR2-BLKPA-2018-16")
 else:      conddb.setGlobalTag("COMCOND-BLKPA-RUN1-06")
 
 #=============================================================
diff --git a/TileCalorimeter/TileL2Algs/src/TileRawChannelToL2.cxx b/TileCalorimeter/TileL2Algs/src/TileRawChannelToL2.cxx
index 0decb2f62312..37decf2eb4a1 100755
--- a/TileCalorimeter/TileL2Algs/src/TileRawChannelToL2.cxx
+++ b/TileCalorimeter/TileL2Algs/src/TileRawChannelToL2.cxx
@@ -78,23 +78,22 @@ StatusCode TileRawChannelToL2::execute() {
     for (const TileL2* l2 : *l2Container) {
 
       msg(MSG::VERBOSE) << "frag ID = 0x" << MSG::hex << l2->identify() << MSG::dec
-                      << "  phi = " << l2->phi(0)
-                      << "  Et = " << l2->Et()
-                      << "  word = 0x" << MSG::hex << l2->val(0) << MSG::dec << endmsg;
+                        << "  phi = " << l2->phi(0)
+                        << "  Et = " << l2->Et() << endmsg;
 
       for (unsigned int i = 0; i < l2->NMuons(); ++i) {
         msg(MSG::VERBOSE) << "Muon found:"
-                        << " frag ID = 0x" << MSG::hex << l2->identify() << MSG::dec
-                        << " word1 = 0x" << MSG::hex << l2->val(1 + 2 * i) << MSG::dec
-                        << " word2 = 0x" << MSG::hex << l2->val(2 + 2 * i) << MSG::dec
-                        << " eta = " << l2->eta(i)
-                        << " phi = " << l2->phi(i) << endmsg;
+                          << " frag ID = 0x" << MSG::hex << l2->identify()
+                          << " word1 = 0x" << l2->val(2 * i)
+                          << " word2 = 0x" << l2->val(2 * i + 1) << MSG::dec
+                          << " eta = " << l2->eta(i)
+                          << " phi = " << l2->phi(i) << endmsg;
 
         msg(MSG::VERBOSE) << "Muon found:"
-                        << " E[0] = " << l2->enemu0(i) << " MeV"
-                        << " E[1] = " << l2->enemu1(i) << " MeV"
-                        << " E[2] = " << l2->enemu2(i) << " MeV"
-                        << " QF = " << l2->qual(i) << endmsg;
+                          << " E[0] = " << l2->enemu0(i) << " MeV"
+                          << " E[1] = " << l2->enemu1(i) << " MeV"
+                          << " E[2] = " << l2->enemu2(i) << " MeV"
+                          << " QF = " << l2->qual(i) << endmsg;
 
       }
     }
-- 
GitLab


From b8c2fcd72aeedee7c201b7f1ee03d7239b0985a5 Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Fri, 3 Jul 2020 16:09:04 +0000
Subject: [PATCH 029/217] Merge branch
 '21p0.ISF_FastCaloSimParametrization.ISF_HitAnalysis.fix.MuonEntry_retrieve'
 into '21.0'

Update ISF_HitAnalysis.cxx: check StatusCode retrieving MuonEntry

See merge request atlas/athena!34141

(cherry picked from commit 4c6c1b83524a543539f3ee841c13f6273f785697)

7457228a Update ISF_HitAnalysis.cxx: check StatusCode retrieving MuonEntry
---
 .../ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
index b16832585f61..3d40c06dca2e 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
@@ -1137,7 +1137,7 @@ StatusCode ISF_HitAnalysis::execute()
 
  //Retrieve and save MuonEntryLayer information 
  const TrackRecordCollection *MuonEntry = nullptr;
- ATH_CHECK(evtStore()->retrieve(MuonEntry, "MuonEntryLayer"));
+ sc = evtStore()->retrieve(MuonEntry, "MuonEntryLayer");
  if (sc.isFailure())
  {
  ATH_MSG_WARNING( "Couldn't read MuonEntry from StoreGate");
-- 
GitLab


From bc4869b971ad4846e5340e4e353fe9caace84a93 Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Fri, 3 Jul 2020 16:23:27 +0000
Subject: [PATCH 030/217] Merge branch 'ART_AtlasG4FullG4comparison' into
 '21.0'

Add ART comparison of AtlasG4 and FullG4

See merge request atlas/athena!34043

(cherry picked from commit ab9c797546e4224e9e259d40aee2ec7f2a5bae95)

97124b3c Add ART comparison of AtlasG4 and FullG4
53be6060 Update ART comparison of AtlasG4 and FullG4
d8c1e389 Add protection against failed jobs to ART comparison of AtlasG4 and FullG4
9fd92da8 Address comments in MR34043
---
 .../test/test_AtlasG4_FullG4_comparison.sh    | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100755 Simulation/ISF/ISF_Validation/test/test_AtlasG4_FullG4_comparison.sh

diff --git a/Simulation/ISF/ISF_Validation/test/test_AtlasG4_FullG4_comparison.sh b/Simulation/ISF/ISF_Validation/test/test_AtlasG4_FullG4_comparison.sh
new file mode 100755
index 000000000000..8aa32cb96fbc
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_AtlasG4_FullG4_comparison.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation comparison of FullG4 and AtlasG4
+# art-type: build
+# art-include: 21.0/Athena
+# art-include: 21.0/AthSimulation
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-include: master/AthSimulation
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+
+export TRF_ECHO=1
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "HITS.FullG4.pool.root" \
+--maxEvents 2 \
+--imf False
+
+rc1=$?
+echo  "art-result: $rc1 simulation FullG4"
+
+AtlasG4_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'sim:SimulationJobOptions/preInclude.BeamPipeKill.py' \
+--preExec 'sim:simFlags.TightMuonStepping=True' \
+--postExec 'sim:topSeq.BeamEffectsAlg.ISFRun=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "HITS.AtlasG4.pool.root" \
+--maxEvents 2 \
+--imf False
+
+rc2=$?
+echo  "art-result: $rc2 simulation AtlasG4"
+
+rc3=-999
+if [ $rc1 -eq 0 ]
+then
+  if [ $rc2 -eq 0 ]
+  then
+    # Compare the merged outputs
+    acmd.py diff-root HITS.FullG4.pool.root HITS.AtlasG4.pool.root --error-mode resilient --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings TrackRecordCollection_p2_CaloEntryLayer TrackRecordCollection_p2_MuonEntryLayer TrackRecordCollection_p2_MuonExitLayer RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_timings RAWtoALL_mems RAWtoALL_timings RecoTimingObj_p1_RAWtoALL_mems RecoTimingObj_p1_RAWtoALL_timings RecoTimingObj_p1_EVNTtoHITS_timings EVNTtoHITS_timings RecoTimingObj_p1_Bkg_HITStoRDO_timings index_ref
+    rc3=$?
+  fi
+fi
+echo "art-result: $rc3 comparison"
+
-- 
GitLab


From 45acd6a99822f054f22ce264d784c090c2e7d424 Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Fri, 3 Jul 2020 16:20:14 +0000
Subject: [PATCH 031/217] Merge branch 'updateCaloSamplingFractionAnalysis'
 into '21.0'

Add readme and instructions to CaloSamplingFractionAnalysis package

See merge request atlas/athena!34077

(cherry picked from commit 4cf39c16a3b554e4e6413dabde2f4f7856cfb8d0)

e00ebff0 Add readme and instructions to CaloSamplingFractionAnalysis package
16d0abfb Update instructions for CaloSamplingFractionAnalysis package
---
 .../CaloSamplingFractionAnalysis/README.md    | 72 +++++++++++++++++++
 ..._pid11_Mom50000_Radius1500000_eta_0_140.py |  1 +
 ...pid11_Mom50000_Z3740500_bec_eta_135_350.py |  1 +
 3 files changed, 74 insertions(+)
 create mode 100644 Simulation/Tools/CaloSamplingFractionAnalysis/README.md
 create mode 100644 Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Radius1500000_eta_0_140/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.py
 create mode 100644 Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Z3740500_bec_eta_135_350/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.py

diff --git a/Simulation/Tools/CaloSamplingFractionAnalysis/README.md b/Simulation/Tools/CaloSamplingFractionAnalysis/README.md
new file mode 100644
index 000000000000..4554a4a30c3c
--- /dev/null
+++ b/Simulation/Tools/CaloSamplingFractionAnalysis/README.md
@@ -0,0 +1,72 @@
+# LAr EM sampling fractions
+
+## Input evgen
+
+The sampling fractions input electrons are generated in release 21.6 as single electrons with a momentum of 50 GeV, injected at a radius of r=1.5m for the barrel and distance of z=3.7405m for the endcap
+```
+setupATLAS
+asetup 21.6.31,AthGeneration
+Gen_tf.py  --ecmEnergy=13000 --firstEvent=1 --maxEvents=10 --randomSeed=1234 --jobConfig=athena/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Radius1500000_eta_0_140 --outputEVNTFile=mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.HITS.root
+Gen_tf.py  --ecmEnergy=13000 --firstEvent=1 --maxEvents=10 --randomSeed=1234 --jobConfig=athena/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Z3740500_bec_eta_135_350 --outputEVNTFile=mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.HITS.pool.root
+```
+Input files with 100k events can be found in:
+```
+/eos/atlas/atlascerngroupdisk/proj-simul/G4Run3/SamplingFractions/LArEM/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.100k.EVNT.root
+/eos/atlas/atlascerngroupdisk/proj-simul/G4Run3/SamplingFractions/LArEM/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.100k.EVNT.root
+```
+
+## G4 Simulation
+Simulation is run with calibration hits
+```
+Sim_tf.py --simulator 'FullG4' \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--postExec 'EVNTtoHITS:topSequence.BeamEffectsAlg.GenEventManipulators = [getPublicTool("GenEventValidityChecker")]' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.CalHits.py,SimulationJobOptions/preInclude.ParticleID.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/eos/atlas/atlascerngroupdisk/proj-simul/G4Run3/SamplingFractions/LArEM/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.100k.EVNT.root" \
+--outputHITSFile 'mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.0_10k.HITS.root' \
+--maxEvents 10000 \
+--skipEvent 0 \
+--imf False
+Sim_tf.py --simulator 'FullG4' \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--postExec 'EVNTtoHITS:topSequence.BeamEffectsAlg.GenEventManipulators = [getPublicTool("GenEventValidityChecker")]' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.CalHits.py,SimulationJobOptions/preInclude.ParticleID.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/afs/cern.ch/user/m/mduehrss/public/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.100k.EVNT.root" \
+--outputHITSFile 'mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.0_5k.HITS.pool.root' \
+--maxEvents 5000 \
+--skipEvent 0 \
+--imf False
+```
+
+## NTuple creation and analysis
+For a sufficient precision, ~40k electrons in the barrel and ~40k electrons in the endcap are needed
+
+```
+get_files LarEMSamplingFraction_topOptions.py
+athena.py -c 'inFileName=["mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.0_10k.HITS.root","mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.10k_20k.HITS.root","mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.20k_30k.HITS.root","mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.30k_40k.HITS.root"]' LarEMSamplingFraction_topOptions.py
+mv LArEM_SF.root LArEM_SF_barrel.root
+
+athena.py -c 'inFileName=["mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.0_5k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.5k_10k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.10k_15k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.15k_20k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.20k_25k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.25k_30k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.30k_35k.HITS.pool.root","mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.35k_40k.HITS.pool.root"]' LarEMSamplingFraction_topOptions.py
+mv LArEM_SF.root LArEM_SF_endcap.root
+
+get_files LarEMSamplingFraction_analysis.C
+root -b -q LarEMSamplingFraction_analysis.C 
+```
+
+# HEC sampling fractions
+
+# FCal sampling fractions
+
+# Tile sampline fractions
diff --git a/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Radius1500000_eta_0_140/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.py b/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Radius1500000_eta_0_140/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.py
new file mode 100644
index 000000000000..1803a9aec981
--- /dev/null
+++ b/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Radius1500000_eta_0_140/mc.PG_pid11_Mom50000_Radius1500000_eta_0_140.py
@@ -0,0 +1 @@
+include('ParticleGun/ParticleGun_SamplingFraction.py')
diff --git a/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Z3740500_bec_eta_135_350/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.py b/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Z3740500_bec_eta_135_350/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.py
new file mode 100644
index 000000000000..1803a9aec981
--- /dev/null
+++ b/Simulation/Tools/CaloSamplingFractionAnalysis/share/PG_pid11_Mom50000_Z3740500_bec_eta_135_350/mc.PG_pid11_Mom50000_Z3740500_bec_eta_135_350.py
@@ -0,0 +1 @@
+include('ParticleGun/ParticleGun_SamplingFraction.py')
-- 
GitLab


From e510683efb76c48155bc7203b2aacb015d8f81cd Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Fri, 3 Jul 2020 16:11:06 +0000
Subject: [PATCH 032/217] Merge branch '21.0-TrackOverlay-deletingARTtests'
 into '21.0'

Deleting ART tests for Track overlay

See merge request atlas/athena!34089

(cherry picked from commit 8a4e6e2485b0b242fbd723aa8ebaf9acef3fc190)

f4bf0b1e Deleting ART tests for Track overlay
---
 .../test/test_TrackingOverlay_JZ5W_wPU.sh     | 41 -------------------
 .../test/test_TrackingOverlay_JZ5W_woPU.sh    | 32 ---------------
 .../test/test_TrackingOverlay_JZ6W_wPU.sh     | 41 -------------------
 .../test/test_TrackingOverlay_JZ6W_woPU.sh    | 32 ---------------
 4 files changed, 146 deletions(-)
 delete mode 100755 Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_wPU.sh
 delete mode 100755 Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_woPU.sh
 delete mode 100755 Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_wPU.sh
 delete mode 100755 Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_woPU.sh

diff --git a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_wPU.sh b/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_wPU.sh
deleted file mode 100755
index bb44ba6e05c5..000000000000
--- a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_wPU.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# art-description: Run the full reconstruction on HITS with pile-up for JZ5W samples (leading jet pt: 800-1300 GeV) for validation of tracking overlay
-# art-include: 21.0/Athena
-# art-include: master/Athena
-# art-type: grid
-
-export inputHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrackingOverlay/JZ5W_HITS
-export inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/FastChainPileup/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.simul.HITS.e4981_s3087_s3161
-export inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/FastChainPileup/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.simul.HITS.e4981_s3087_s3161
-export outputRDOFile=RDO.JZ5W_wPU.root
-export outputESDFile=ESD.JZ5W_wPU.root
-export outputAODFile=AOD.JZ5W_wPU.root
-export outputNTUP_PHYSVALFile=NTUP_PHYSVAL.JZ5W_wPU.root
-
-# Copied from r11627 (asetup Athena,21.0.97)
-# Running also with asetup 21.0,Athena,2020-02-28T2145
-Reco_tf.py --inputHITSFile $inputHitsFile/*root.? \
-           --inputHighPtMinbiasHitsFile $inputHighPtMinbiasHitsFile/*root.? \
-           --inputLowPtMinbiasHitsFile $inputLowPtMinbiasHitsFile/*.root.? \
-           --triggerConfig "RDOtoRDOTrigger=MCRECO:DBF:TRIGGERDBMC:2232,86,278" \
-           --steering "doRDO_TRIG" \
-           --autoConfiguration everything \
-           --conditionsTag "default:OFLCOND-MC16-SDR-25" \
-           --geometryVersion "default:ATLAS-R2-2016-01-00-01" \
-           --postExec "all:CfgMgr.MessageSvc().setError+=['HepMcParticleLink']" 'svcMgr.AthenaPoolCnvSvc.MaxFileSizes=["15000000000"]' \
-           --postInclude "default:PyJobTransforms/UseFrontier.py" \
-           --preExec "all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)" 'HITtoRDO:userRunLumiOverride={"run":310000,"lb":61,"starttstamp":1550003600,"mu":60.500};' "from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);" \
-           --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_user.py" \
-           --valid=True \
-           --validationFlags doEgamma,doInDet,doZee,doJet \
-           --outputRDOFile $outputRDOFile \
-           --outputESDFile $outputESDFile \
-           --outputAODFile $outputAODFile \
-           --outputNTUP_PHYSVALFile $outputNTUP_PHYSVALFile \
-           --jobNumber=2 \
-           --maxEvents=2000 \
-           --numberOfCavernBkg 0 \
-           --numberOfHighPtMinBias 0.2595392 \
-           --numberOfLowPtMinBias 99.2404608 \
-           --pileupFinalBunch 6
diff --git a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_woPU.sh b/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_woPU.sh
deleted file mode 100755
index 844acca7c754..000000000000
--- a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ5W_woPU.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# art-description: Run the full reconstruction on HITS without pile-up JZ5W samples (leading jet pt: 800-1300 GeV) for validation of tracking overlay
-# art-include: 21.0/Athena
-# art-include: master/Athena
-# art-type: grid
-
-export inputHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrackingOverlay/JZ5W_HITS
-export outputRDOFile=RDO.JZ5W_woPU.root
-export outputESDFile=ESD.JZ5W_woPU.root
-export outputAODFile=AOD.JZ5W_woPU.root
-export outputNTUP_PHYSVALFile=NTUP_PHYSVAL.JZ5W_woPU.root
-
-# Copied from r11627 (asetup Athena,21.0.97)
-# Running also with asetup 21.0,Athena,2020-02-28T2145
-Reco_tf.py --inputHITSFile $inputHitsFile/*root.? \
-           --triggerConfig "RDOtoRDOTrigger=MCRECO:DBF:TRIGGERDBMC:2232,86,278" \
-           --steering "doRDO_TRIG" \
-           --autoConfiguration everything \
-           --conditionsTag "default:OFLCOND-MC16-SDR-25" \
-           --geometryVersion "default:ATLAS-R2-2016-01-00-01" \
-           --postExec "all:CfgMgr.MessageSvc().setError+=['HepMcParticleLink']" \
-           --postInclude "default:PyJobTransforms/UseFrontier.py" \
-           --preExec "all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)" 'HITtoRDO:userRunLumiOverride={"run":310000,"lb":61,"starttstamp":1550003600,"mu":60.500};' "from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);" \
-           --valid=True \
-           --validationFlags doEgamma,doInDet,doZee,doJet \
-           --outputRDOFile $outputRDOFile \
-           --outputESDFile $outputESDFile \
-           --outputAODFile $outputAODFile \
-           --outputNTUP_PHYSVALFile $outputNTUP_PHYSVALFile \
-           --jobNumber=2 \
-           --maxEvents=2000
diff --git a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_wPU.sh b/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_wPU.sh
deleted file mode 100755
index 4637d1f8a053..000000000000
--- a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_wPU.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# art-description: Run the full reconstruction on HITS with pile-up for JZ6W samples (leading jet pt: 1300-1800 GeV) for validation of tracking overlay
-# art-include: 21.0/Athena
-# art-include: master/Athena
-# art-type: grid
-
-export inputHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrackingOverlay/JZ6W_HITS
-export inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/FastChainPileup/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.simul.HITS.e4981_s3087_s3161
-export inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/FastChainPileup/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.simul.HITS.e4981_s3087_s3161
-export outputRDOFile=RDO.JZ6W_wPU.root
-export outputESDFile=ESD.JZ6W_wPU.root
-export outputAODFile=AOD.JZ6W_wPU.root
-export outputNTUP_PHYSVALFile=NTUP_PHYSVAL.JZ6W_wPU.root
-
-# Copied from r11627 (asetup Athena,21.0.97)
-# Running also with asetup 21.0,Athena,2020-02-28T2145
-Reco_tf.py --inputHITSFile $inputHitsFile/*root.? \
-           --inputHighPtMinbiasHitsFile $inputHighPtMinbiasHitsFile/*root.? \
-           --inputLowPtMinbiasHitsFile $inputLowPtMinbiasHitsFile/*.root.? \
-           --triggerConfig "RDOtoRDOTrigger=MCRECO:DBF:TRIGGERDBMC:2232,86,278" \
-           --steering "doRDO_TRIG" \
-           --autoConfiguration everything \
-           --conditionsTag "default:OFLCOND-MC16-SDR-25" \
-           --geometryVersion "default:ATLAS-R2-2016-01-00-01" \
-           --postExec "all:CfgMgr.MessageSvc().setError+=['HepMcParticleLink']" 'svcMgr.AthenaPoolCnvSvc.MaxFileSizes=["15000000000"]' \
-           --postInclude "default:PyJobTransforms/UseFrontier.py" \
-           --preExec "all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)" 'HITtoRDO:userRunLumiOverride={"run":310000,"lb":61,"starttstamp":1550003600,"mu":60.500};' "from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);" \
-           --preInclude "HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_user.py" \
-           --valid=True \
-           --validationFlags doEgamma,doInDet,doZee,doJet \
-           --outputRDOFile $outputRDOFile \
-           --outputESDFile $outputESDFile \
-           --outputAODFile $outputAODFile \
-           --outputNTUP_PHYSVALFile $outputNTUP_PHYSVALFile \
-           --jobNumber=2 \
-           --maxEvents=2000 \
-           --numberOfCavernBkg 0 \
-           --numberOfHighPtMinBias 0.2595392 \
-           --numberOfLowPtMinBias 99.2404608 \
-           --pileupFinalBunch 6
diff --git a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_woPU.sh b/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_woPU.sh
deleted file mode 100755
index d75346280fcb..000000000000
--- a/Simulation/FastSimulation/FastChainPileup/test/test_TrackingOverlay_JZ6W_woPU.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# art-description: Run the full reconstruction on HITS without pile-up JZ6W samples (leading jet pt: 1300-1800 GeV) for validation of tracking overlay
-# art-include: 21.0/Athena
-# art-include: master/Athena
-# art-type: grid
-
-export inputHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrackingOverlay/JZ6W_HITS
-export outputRDOFile=RDO.JZ6W_woPU.root
-export outputESDFile=ESD.JZ6W_woPU.root
-export outputAODFile=AOD.JZ6W_woPU.root
-export outputNTUP_PHYSVALFile=NTUP_PHYSVAL.JZ6W_woPU.root
-
-# Copied from r11627 (asetup Athena,21.0.97)
-# Running also with asetup 21.0,Athena,2020-02-28T2145
-Reco_tf.py --inputHITSFile $inputHitsFile/*root.? \
-           --triggerConfig "RDOtoRDOTrigger=MCRECO:DBF:TRIGGERDBMC:2232,86,278" \
-           --steering "doRDO_TRIG" \
-           --autoConfiguration everything \
-           --conditionsTag "default:OFLCOND-MC16-SDR-25" \
-           --geometryVersion "default:ATLAS-R2-2016-01-00-01" \
-           --postExec "all:CfgMgr.MessageSvc().setError+=['HepMcParticleLink']" \
-           --postInclude "default:PyJobTransforms/UseFrontier.py" \
-           --preExec "all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)" 'HITtoRDO:userRunLumiOverride={"run":310000,"lb":61,"starttstamp":1550003600,"mu":60.500};' "from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);" \
-           --valid=True \
-           --validationFlags doEgamma,doInDet,doZee,doJet \
-           --outputRDOFile $outputRDOFile \
-           --outputESDFile $outputESDFile \
-           --outputAODFile $outputAODFile \
-           --outputNTUP_PHYSVALFile $outputNTUP_PHYSVALFile \
-           --jobNumber=2 \
-           --maxEvents=2000
-- 
GitLab


From a60f28b4b8a7d67d179b36981d2712c461cb0f1c Mon Sep 17 00:00:00 2001
From: Yasuyuki Okumura <yasuyuki.okumura@cern.ch>
Date: Sat, 4 Jul 2020 13:18:39 +0200
Subject: [PATCH 033/217] Add ART tests for PhysVal WebDisplay nightlies
 (AthenaMT) in TrigAnalysisTest (ATR-21677)

---
 .../test/test_trigAna_PhysValWeb_mt1_grid.py  | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100755 Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
new file mode 100755
index 000000000000..f6885daae640
--- /dev/null
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_trigAna_PhysValWeb_mt1_grid.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+
+# art-description: Test of transform RDO->RDO_TRIG->ESD->AOD with AthenaMT and AOD->NTUP_PHYSVAL with serial athena to produce webdisplay
+# art-type: grid
+# art-include: master/Athena
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.pmon.gz
+# art-output: *perfmon*
+# art-output: prmon*
+# art-output: *.check*
+# art-output: HLTconfig*.xml
+# art-output: L1Topoconfig*.xml
+# art-output: LVL1config*.xml
+# art-output: PHYSVAL_WEB
+# art-html: PHYSVAL_WEB
+
+from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps
+import os
+
+# To run single-process transform on MCORE sites
+if 'ATHENA_NPROC_NUM' in os.environ:
+    del os.environ['ATHENA_NPROC_NUM']
+
+rdo2aod = ExecStep.ExecStep('RDOtoAOD')
+rdo2aod.type = 'Reco_tf'
+rdo2aod.input = 'ttbar'
+rdo2aod.threads = 1
+rdo2aod.max_events = 500
+rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --valid=True'
+rdo2aod.args += ' --preExec="all:from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\");"'
+
+physval = ExecStep.ExecStep('PhysVal')
+physval.type = 'Reco_tf'
+physval.input = ''
+physval.explicit_input = True
+physval.args = '--inputAODFile=AOD.pool.root --outputNTUP_PHYSVALFile=NTUP_PHYSVAL.pool.root --valid=True'
+
+validationFlags = 'doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet'
+physval.args += ' --validationFlags="{:s}"'.format(validationFlags)
+
+test = Test.Test()
+test.art_type = 'grid'
+test.exec_steps = [rdo2aod,physval]
+test.check_steps = CheckSteps.default_check_steps(test)
+
+
+download=CheckSteps.DownloadRefStep()
+download.artpackage = 'TrigAnalysisTest'
+download.artjobname = 'test_trigAna_PhysValWeb_grid.py'
+download.required=True
+test.check_steps.append(download)
+
+
+if not os.path.exists('PHYSVAL_WEB'):
+    os.mkdir('PHYSVAL_WEB')
+
+
+pv=[]
+pv.append(['Tau','TauMon'])
+pv.append(['Muon','MuonMon'])
+pv.append(['ID','IDMon'])
+pv.append(['Bphys','BphysMon'])
+pv.append(['HLTCalo','HLTCaloESD'])
+pv.append(['Result','ResultMon'])
+pv.append(['Bjet','BjetMon'])
+pv.append(['MET','METMon'])
+pv.append(['MinBias','MinBiasMon'])
+pv.append(['Egamma','Egamma'])
+
+for slice in pv:
+    name='PhysValWeb'+slice[0]
+    sliceweb=CheckSteps.PhysValWebStep(name)
+    sliceweb.sig=slice[1]
+    sliceweb.required=True
+    test.check_steps.append(sliceweb)
+    
+import sys
+sys.exit(test.run())
+
-- 
GitLab


From 5fe73f5d208d9e62e894df9a59101de15fabedbd Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Sat, 4 Jul 2020 18:24:06 +0200
Subject: [PATCH 034/217] GeoExporter moved to use the standalone GeoModelIO
 from AthenaExternals.

---
 .../GeoExporter/CMakeLists.txt                | 19 +++++++++++++------
 .../GeoExporter/src/GeoExporter.cxx           |  4 ++--
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt
index 9e5c33f35be3..a2c03128bcf1 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt
@@ -13,19 +13,21 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/EventInfo
                           Tools/PathResolver
                           DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter
-                          DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite
-                          DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager
                           DetectorDescription/GeoModel/GeoModelKernel
                           DetectorDescription/GeoModel/GeoModelUtilities
                           graphics/VP1/VP1Utils
                           )
+                          #DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite
+                          #DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager
 
 # External dependencies:
 find_package( Qt5 COMPONENTS Sql Gui PrintSupport )
 find_package( Eigen ) # is it really needed here?
 FIND_PACKAGE( Boost ) # is it really needed here?
 find_package( CLHEP )
-find_package( GeoModelCore )
+#find_package( GeoModelCore REQUIRED )
+find_package( GeoModelIO REQUIRED )
+#message( "GEOMODELIO_LIBRARIES: ${GEOMODELIO_LIBRARIES}")
 
 # Component(s) in the package:
 atlas_add_library( GeoExporter
@@ -34,9 +36,14 @@ atlas_add_library( GeoExporter
                    PUBLIC_HEADERS GeoExporter
                    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
                    ${CLHEP_INCLUDE_DIRS}
-                   LINK_LIBRARIES Qt5::Sql ${GeoModel_LIBRARIES} GeoModelDBManager
-                   GeoModelUtilities VP1Utils GeoWrite ${CLHEP_LIBRARIES}
-                   ${EIGEN_LIBRARIES} )
+                   LINK_LIBRARIES Qt5::Sql
+                      ${GEOMODELIO_LIBRARIES}
+                      GeoModelUtilities
+                      VP1Utils
+                      ${CLHEP_LIBRARIES}
+                      ${EIGEN_LIBRARIES}
+                  )
+                  #NEW SYNTAX TO BE USED SOON: GeoModelIO::GeoModelDBManager GeoModelIO::GeoModelWrite
 
 # Install files from the package:
 atlas_install_headers( GeoExporter )
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx
index 3d504ce8abc3..9abb6031ef8a 100755
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx
@@ -27,7 +27,7 @@
 
 #include "GeoModelDBManager/GMDBManager.h"
 
-#include "GeoWrite/DumpGeoModelActionLocal.h"
+#include "GeoModelWrite/WriteGeoModel.h" //DumpGeoModelActionLocal.h"
 
 #include <QCoreApplication>
 #include <QtCore/QStringList>
@@ -219,7 +219,7 @@ void GeoExporter::init()
 
    std::cout << "Dumping the GeoModel geometry to the DB file..." << std::endl;
   // Dump the tree volumes into a DB
-  DumpGeoModelActionLocal dumpGeoModelGraph(db); // init the GeoModel node action
+  GeoModelIO::WriteGeoModel dumpGeoModelGraph(db); // init the GeoModel node action
   world->exec(&dumpGeoModelGraph); // visit all GeoModel nodes
   std::cout << "Saving the GeoModel tree to the DB." << std::endl;
   dumpGeoModelGraph.saveToDB(); // save to the SQlite DB file
-- 
GitLab


From 0eff924e918369e635ebae4ed2f0e7be2988989f Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Sat, 4 Jul 2020 18:46:04 +0200
Subject: [PATCH 035/217] Removing old Athena packages, now replaced and
 extended by standalone GeoModelIO

---
 .../GeoModelDBManager/CMakeLists.txt          |   28 -
 .../GeoModelDBManager/GMDBManager.h           |  198 --
 .../GeoModelDBManager/src/GMDBManager.cpp     | 1561 ---------------
 .../GeoModelErrorHandler/CMakeLists.txt       |    9 -
 .../GeoModelErrorHandler/ErrorHandler.h       |   64 -
 .../GeoModelStandalone/GeoRead/CMakeLists.txt |   38 -
 .../GeoRead/GeoRead/GReadIn.h                 |  148 --
 .../examples/hellogeo/CMakeLists.txt.example  |   34 -
 .../examples/hellogeo/main.cpp.example        |  131 --
 .../GeoRead/src/GReadIn.cpp                   | 1741 -----------------
 .../GeoWrite/CMakeLists.txt                   |   36 -
 .../GeoWrite/DumpGeoModelAction.h.oldVersion  |  137 --
 .../GeoWrite/DumpGeoModelActionLocal.h        |  186 --
 .../GeoWrite/WriteGeoModelAction.h.oldSqlite  |  210 --
 .../src/DumpGeoModelAction.oldVersion         | 1600 ---------------
 .../GeoWrite/src/DumpGeoModelActionLocal.cpp  | 1700 ----------------
 .../src/WriteGeoModelAction.cxx.oldSqlite     |  663 -------
 .../TFPersistification/CMakeLists.txt         |   25 -
 .../TFPersistification/ACosIO.h               |   28 -
 .../TFPersistification/ASinIO.h               |   27 -
 .../TFPersistification/ATanIO.h               |   27 -
 .../TFPersistification/AbsIO.h                |   27 -
 .../TFPersistification/ArrayFunctionIO.h      |   27 -
 .../TFPersistification/CosIO.h                |   28 -
 .../TFPersistification/FixedConstantIO.h      |   27 -
 .../GenFunctionInterpreter.h                  |   54 -
 .../GenFunctionPersistifier.h                 |   61 -
 .../TFPersistification/GenFunctionReader.h    |   58 -
 .../TFPersistification/GenFunctionRecorder.h  |   46 -
 .../TFPersistification/GenfunIO.h             |  240 ---
 .../TFPersistification/ModIO.h                |   28 -
 .../TFPersistification/RectangularIO.h        |   28 -
 .../TFPersistification/SinIO.h                |   29 -
 .../TFPersistification/SqrtIO.h               |   28 -
 .../TFPersistification/SquareIO.h             |   28 -
 .../TFPersistification/TanIO.h                |   28 -
 .../TransFunctionInterpreter.h                |   59 -
 .../TransFunctionPersistifier.h               |   71 -
 .../TFPersistification/TransFunctionReader.h  |  106 -
 .../TransFunctionRecorder.h                   |   89 -
 .../TFPersistification/src/ACosIO.cpp         |   23 -
 .../TFPersistification/src/ASinIO.cpp         |   23 -
 .../TFPersistification/src/ATanIO.cpp         |   23 -
 .../TFPersistification/src/AbsIO.cpp          |   23 -
 .../src/ArrayFunctionIO.cpp                   |   46 -
 .../TFPersistification/src/CosIO.cpp          |   22 -
 .../src/FixedConstantIO.cpp                   |   28 -
 .../src/GenFunctionInterpreter.cpp            |   92 -
 .../src/GenFunctionPersistifier.cpp           |   85 -
 .../src/GenFunctionReader.cpp                 |   70 -
 .../src/GenFunctionRecorder.cpp               |   16 -
 .../TFPersistification/src/GenfunIO.cpp       |  290 ---
 .../TFPersistification/src/ModIO.cpp          |   30 -
 .../TFPersistification/src/RectangularIO.cpp  |   55 -
 .../TFPersistification/src/SinIO.cpp          |   23 -
 .../TFPersistification/src/SqrtIO.cpp         |   23 -
 .../TFPersistification/src/SquareIO.cpp       |   23 -
 .../TFPersistification/src/TanIO.cpp          |   23 -
 .../src/TransFunctionInterpreter.cpp          |   51 -
 .../src/TransFunctionPersistifier.cpp         |   55 -
 .../src/TransFunctionReader.cpp               |  109 --
 .../src/TransFunctionRecorder.cpp             |  104 -
 62 files changed, 10890 deletions(-)
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/CMakeLists.txt
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/src/GMDBManager.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/CMakeLists.txt
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/GeoModelErrorHandler/ErrorHandler.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/CMakeLists.txt
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/CMakeLists.txt.example
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/main.cpp.example
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/CMakeLists.txt
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelAction.h.oldVersion
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/WriteGeoModelAction.h.oldSqlite
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelAction.oldVersion
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/WriteGeoModelAction.cxx.oldSqlite
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/CMakeLists.txt
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ACosIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ASinIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ATanIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/AbsIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ArrayFunctionIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/CosIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/FixedConstantIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionInterpreter.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionPersistifier.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionReader.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionRecorder.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenfunIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ModIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/RectangularIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SinIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SqrtIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SquareIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TanIO.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionInterpreter.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionPersistifier.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionReader.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionRecorder.h
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ACosIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ASinIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ATanIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/AbsIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ArrayFunctionIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/CosIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/FixedConstantIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionInterpreter.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionPersistifier.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionReader.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionRecorder.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenfunIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ModIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/RectangularIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SinIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SqrtIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SquareIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TanIO.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionInterpreter.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionPersistifier.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionReader.cpp
 delete mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionRecorder.cpp

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/CMakeLists.txt
deleted file mode 100644
index 3d40c7ba8975..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-################################################################################
-# Package: GeoModelDBManager
-################################################################################
-
-# Declare the package name:
-atlas_subdir( GeoModelDBManager )
-
-# comment if you want to get debug messages in Release
-if(CMAKE_BUILD_TYPE MATCHES Release)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT)
-endif(CMAKE_BUILD_TYPE MATCHES Release)
-if(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT)
-endif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment if you need debug messages in Debug build
-endif(CMAKE_BUILD_TYPE MATCHES Debug)
-
-
-# External dependencies:
-find_package( Qt5 COMPONENTS Core Sql )
-
-# Component(s) in the package:
-atlas_add_library( GeoModelDBManager
-                   src/*.cpp
-                   GeoModelDBManager/*.h
-                   PUBLIC_HEADERS GeoModelDBManager
-                   LINK_LIBRARIES Qt5::Sql )
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/GeoModelDBManager/GMDBManager.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
deleted file mode 100644
index 1e857144c7e5..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-// author: Riccardo.Maria.Bianchi@cern.ch
-// major updates: Aug 2018
-
-#ifndef GMDBManager_H
-#define GMDBManager_H
-
-
-// include Qt
-#include <QSqlDatabase>
-#include <QStringList>
-#include <QVariant>
-#include <QString>
-#include <QMap>
-
-// include C++
-#include <iostream>
-
-/**
- * \class GMDBManager
- *
- * \brief SQL Database Manager class for GeoModel
- *
- * GMDBManager sets up the connection with SQL database
- * and performs some basics queries.
- */
-class GMDBManager
-{
-public:
-	/**
-	 * @brief Constructor
-	 *
-	 * Constructor sets up connection with db and opens it
-	 * @param path - absolute path to db file
-	 */
-	GMDBManager(const QString& path);
-
-	/**
-	 * @brief Destructor
-	 *
-	 * Close the db connection
-	 */
-	~GMDBManager();
-
-
-	bool isOpen() const;
-
-	/**
-	 * @brief Print names of all GeoPhysVol objects in db
-	 */
-	void printAllPhysVols() const;
-
-	/**
-	 * @brief Print names of all GeoFullPhysVol objects in db
-	 */
-	void printAllFullPhysVols() const;
-
-	/**
-	 * @brief Print names of all GeoLogVol objects in db
-	 */
-	void printAllLogVols() const;
-
-	/**
-	 * @brief Print names of all GeoMaterial objects in db
-	 */
-	void printAllMaterials() const;
-
-	/**
-	 * @brief Print names of all GeoElement objects in db
-	 */
-	void printAllElements() const;
-
-	/**
-	 * @brief Print names of all PhysVol objects in db
-	 */
-	void printAllShapes() const;
-
-	/**
-	 * @brief Print names of all GeoSerialDenominator objects in db
-	 */
-	void printAllSerialDenominators() const;
-
-
-	void printAllSerialTransformers() const;
-	void printAllFunctions() const;
-	void printAllTransforms() const;
-	void printAllAlignableTransforms() const;
-	void printAllNameTags() const;
-
-	/**
-	 * @brief Print the db table storing all the children positions per parent
-	 */
-	void printAllChildrenPositions() const;
-
-	/**
-	 * @brief Print the db table storing all the children positions per parent
-	 */
-	void printAllNodeTypes() const;
-
-	/**
-	 * @brief Print the DB table storing the ID of the PhysVol that is the Root volume
-	 */
-	void printRootVolumeId() const;
-
-	void printDBVersion() const;
-
-	// ADD methods
-	QVariant addShape(const QString &type, const QString &parameters);
-	QVariant addMaterial(const QString &name, const QString &density, const QString &elements);
-	QVariant addElement(const QString &name, const QString &symbol, const QString &elZ, const QString &elA);
-	QVariant addLogVol(const QString &name, const QVariant &shapeId, const QVariant &materialId);
-	QVariant addPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume = false);
-	QVariant addFullPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume = false);
-	QVariant addSerialDenominator(const QString &baseName);
-	QVariant addFunction(const QString expression);
-	QVariant addSerialTransformer(const QVariant &funcId, const QVariant &physvolId, const QString volType, const unsigned int &copies);
-	QVariant addTransform(QVector<double> parameters);
-	QVariant addAlignableTransform(QVector<double> parameters);
-	QVariant addNameTag(const QString &name);
-
-
-	bool addListOfRecords(const QString geoType, const std::vector<QStringList> records);
-	bool addListOfRecordsToTable(const QString tableName, const std::vector<QStringList> records);
-	bool addListOfRecordsToTableOld(const QString tableName, const std::vector<QStringList> records);
-	bool addListOfChildrenPositions(const std::vector<QStringList> records);
-
-	bool addRootVolume(const QStringList);
-	void addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyNumber, const unsigned int childPos, const QString childType, const unsigned int childCopyN);
-
-	void addDBversion(const QString);
-
-	// GET methods
-
-    QString getDBFilePath();
-
-	QStringList getRootPhysVol();
-
-	QStringList getItem(QString geoType, unsigned int id);
-	QStringList getItem(unsigned int tableId, unsigned int id);
-	QStringList getItemFromTableName(QString tableName, unsigned int id);
-	QStringList getItemAndType(unsigned int tableId, unsigned int id);
-
-	QString getNodeTypeFromTableId(unsigned int id);
-
-	QMap<unsigned int, QStringList> getVPhysVolChildren(const unsigned int id, const QString nodeType, const unsigned int copyN);
-
-	/// methods to dump the DB
-	QHash<QString, QMap<unsigned int, QStringList>> getChildrenTable();
-	QHash<unsigned int, QStringList> getTableFromNodeType(QString nodeType);
-	QHash<unsigned int, QString> getAll_TableIDsNodeTypes();
-	QHash<QString, unsigned int> getAll_NodeTypesTableIDs();
-
-
-private:
-
-	bool initDB();
-	bool createTables();
-
-	void loadTestData(); // for debug only
-
-	void loadTableNamesFromDB();
-	QStringList getTableColNamesFromDB(QString tableName) const;
-
-	QString getTableNameFromTableId(unsigned int tabId);
-	QVariant getTableIdFromNodeType(QString nodeType);
-	void storeNodeType(QString nodeType, QString tableName);
-	QString getTableNameFromNodeType(QString nodeType);
-
-	QSqlQuery selectAllFromTable(QString tableName) const;
-
-
-	void storeTableColumnNames(QStringList input);
-	QStringList getTableColumnNames(QString tableName);
-	void printTableColNamesFromDB(QString tableName) const;
-
-	void printAllRecords(QString tableName) const;
-
-	int getTableColIndex(QString tableName, QString colName);
-
-	bool storeRootVolume(QVariant id, QString nodeType);
-
-	void showError(const QSqlError &err) const;
-
-    QString m_dbpath;
-	QSqlDatabase m_db;
-	bool m_dbIsOK;
-
-	bool m_deepDebug;
-
-	QMap<QString, QStringList> m_tableNames;
-	QMap<QString, QString> m_childType_tableName;
-};
-
-#endif // GMDBManager_H
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/src/GMDBManager.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/src/GMDBManager.cpp
deleted file mode 100644
index 991e821ad189..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager/src/GMDBManager.cpp
+++ /dev/null
@@ -1,1561 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// author: Riccardo.Maria.Bianchi@cern.ch
-// major updates: 
-// - Aug 2018 - Riccardo Maria BIANCHI
-// - Sep 2019 - Riccardo Maria BIANCHI
-
-#include <GeoModelDBManager/GMDBManager.h>
-
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QSqlRecord>
-#include <QSqlDriver>
-#include <QDebug>
-
-
-static std::string dbversion = "0.3.0"; // added GeoElement support (Sep 2019)
-
-
-GMDBManager::GMDBManager(const QString &path) : m_dbpath(path), m_dbIsOK(false),  m_deepDebug(false)
-{
-	qDebug() << "GMDBManager: constructor";
-
-	#ifdef GEOREAD_DEEP_DEBUG
-	  m_deepDebug = true;
- 	#endif
-
-
-	m_dbIsOK = true;
-
-	m_db = QSqlDatabase::addDatabase("QSQLITE");
-	m_db.setDatabaseName(path);
-
-	if (!m_db.open())
-	{
-		qDebug() << "Error: connection with database failed!";
-		showError( m_db.lastError() );
-		m_dbIsOK = false;
-	}
-	else
-	{
-		qDebug() << "Database: connection ok";
-		m_dbIsOK = true;
-	}
-
-
-	// check if DB has tables, if not create them
-	if (m_dbIsOK) {
-		if ( ! (initDB()) ) {
-			std::cout << "Error: database initialization failed" << std::endl;
-			m_dbIsOK = false;
-		}
-	}
-
-	// populate DB with fake data, only for debug
-	//loadTestData();
-}
-
-GMDBManager::~GMDBManager()
-{
-	qDebug() << "GMDBManager: destructor";
-	if (m_db.isOpen())
-	{
-		m_db.close();
-	}
-}
-
-bool GMDBManager::isOpen() const
-{
-	if (! m_dbIsOK )
-		return false;
-	return m_db.isOpen();
-}
-
-
-void GMDBManager::printAllMaterials() const
-{
-	qDebug() << "printAllMaterials()";
-	printAllRecords("Materials");
-}
-void GMDBManager::printAllElements() const
-{
-	qDebug() << "printAllElements()";
-	printAllRecords("Elements");
-}
-void GMDBManager::printAllShapes() const
-{
-	qDebug() << "printAllShapes()";
-	printAllRecords("Shapes");
-}
-
-void GMDBManager::printAllSerialDenominators() const
-{
-	qDebug() << "printAllShapes()";
-	printAllRecords("SerialDenominators");
-}
-
-void GMDBManager::printAllLogVols() const
-{
-	qDebug() << "printAllLogVols()";
-	printAllRecords("LogVols");
-}
-void GMDBManager::printAllPhysVols() const
-{
-	qDebug() << "printAllPhysVols()";
-	printAllRecords("PhysVols");
-}
-void GMDBManager::printAllFullPhysVols() const
-{
-	qDebug() << "printAllFullPhysVols()";
-	printAllRecords("FullPhysVols");
-}
-void GMDBManager::printAllSerialTransformers() const
-{
-	qDebug() << "printAllSerialTransformers()";
-	printAllRecords("SerialTransformers");
-}
-void GMDBManager::printAllFunctions() const
-{
-	qDebug() << "printAllFunctions()";
-	printAllRecords("Functions");
-}
-void GMDBManager::printAllTransforms() const
-{
-	qDebug() << "printAllTransforms()";
-	printAllRecords("Transforms");
-}
-void GMDBManager::printAllAlignableTransforms() const
-{
-	qDebug() << "printAllAlignableTransforms()";
-	printAllRecords("AlignableTransforms");
-}
-void GMDBManager::printAllNameTags() const
-{
-	qDebug() << "printAllNameTags()";
-	printAllRecords("NameTags");
-}
-void GMDBManager::printAllChildrenPositions() const
-{
-	qDebug() << "printAllChildrenPositions()";
-	printAllRecords("ChildrenPositions");
-}
-void GMDBManager::printAllNodeTypes() const
-{
-	qDebug() << "printAllNodeTypes()";
-	printAllRecords("GeoNodesTypes");
-}
-void GMDBManager::printRootVolumeId() const
-{
-	qDebug() << "printRootVolumeId()";
-	printAllRecords("RootVolume");
-}
-void GMDBManager::printDBVersion() const
-{
-	qDebug() << "printDBVersion()";
-	printAllRecords("dbversion");
-}
-
-
-
-
-void GMDBManager::printAllRecords(QString tableName) const
-{
-	std::cout << tableName.toStdString() << " in db:" << std::endl;
-
-	// QSqlQuery query("SELECT * FROM " + tableName);
-	QSqlQuery query = selectAllFromTable(tableName);
-
-	int nCols = (m_tableNames[tableName]).size();
-
-	// print table column names
-	std::cout << "- " << m_tableNames[tableName].join(", ").toStdString() << std::endl;
-	while (query.next())
-	{
-		std::cout << "* "; // TODO: move to a osstream: it's cleaner
-		for( int ii=0; ii<nCols; ++ii)
-		{
-			if (! (ii==0) )
-				std::cout << ", ";
-			std::string valueStr = query.value(ii).toString().toStdString();
-			// if (valueStr == "")
-			// 	std::cout << "NULL"; // removed because we want to save the NULL to the DB, for consistency
-			// else
-				std::cout << valueStr;
-		}
-		std::cout << std::endl;
-	}
-
-	// TODO: I want to have a symbol like '---' to mean empty line when query gives 0 results.
-	// but I guess query.size() is not the right method...
-	//	qDebug() << "query size: " << query.size();
-	//	if (query.size() == 0 || query.size() == -1)
-	//		std::cout << "---" << std::endl;
-
-}
-QHash<unsigned int, QStringList> GMDBManager::getTableFromNodeType(QString nodeType)
-{
-
-	QString tableName = getTableNameFromNodeType(nodeType);
-
-	QHash<unsigned int, QStringList> records;
-	QStringList nodeParams;
-
-	int nCols = (m_tableNames[tableName]).size();
-
-	QSqlQuery query = selectAllFromTable(tableName);
-	while (query.next()) {
-		nodeParams.clear();
-		unsigned int nodeId = query.value(0).toUInt();
-
-		for( int ii=0; ii<nCols; ++ii) {
-			nodeParams << query.value(ii).toString();
-		}
-		records[nodeId] = nodeParams;
-	}
-return records;
-}
-
-
-void GMDBManager::showError(const QSqlError &err) const
-{
-	qWarning() << "Unable to initialize Database" << "Error initializing database: " + err.text();
-}
-
-QVariant GMDBManager::addPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addPhysVol() - is root?" << isRootVolume;
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into PhysVols(logvol, parent) values(?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(logVolId);
-	q.addBindValue(parentPhysVolId);
-	q.exec();
-
-	QVariant lastInserted = q.lastInsertId();
-
-	if (isRootVolume) {
-		storeRootVolume(lastInserted, "GeoPhysVol");
-	}
-
-	return lastInserted;
-
-}
-
-QVariant GMDBManager::addFullPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addFullPhysVol() - is root?" << isRootVolume;
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into FullPhysVols(logvol, parent) values(?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(logVolId);
-	q.addBindValue(parentPhysVolId);
-	q.exec();
-
-	QVariant lastInserted = q.lastInsertId();
-
-	if (isRootVolume) {
-		storeRootVolume(lastInserted, "GeoFullPhysVol");
-	}
-
-	return lastInserted;
-
-}
-
-
-
-QVariant GMDBManager::addLogVol(const QString &name, const QVariant &shapeId, const QVariant &materialId)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addLogVol()";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into LogVols(name, shape, material) values(?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(name);
-	q.addBindValue(shapeId);
-	q.addBindValue(materialId);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addMaterial(const QString &name, const QString &density, const QString &elements)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addMaterial()";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into Materials(name, density, elements) values(?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(name);
-	q.addBindValue(density);
-	q.addBindValue(elements);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addElement(const QString &name, const QString &symbol, const QString &elZ, const QString &elA)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addElement()";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into Elements(name, symbol, Z, A) values(?, ?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(name);
-	q.addBindValue(symbol);
-	q.addBindValue(elZ);
-	q.addBindValue(elA);
-	q.exec();
-	return q.lastInsertId();
-}
-
-bool GMDBManager::addListOfChildrenPositions(const std::vector<QStringList> records)
-{
-    // NOTE: Choose the right function for your version of SQLite!!
-	return addListOfRecordsToTable("ChildrenPositions", records); // newest SQLite versions
-	//return addListOfRecordsToTableOld("ChildrenPositions", records); // old SQLite versions
-}
-
-bool GMDBManager::addListOfRecords(const QString geoType, const std::vector<QStringList> records)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addListOfRecords():" << geoType;
-
-    QString tableName = m_childType_tableName[geoType];
-
-	if (tableName.isEmpty()) {
-        //qWarning() << "m_childType_tableName:" << m_childType_tableName;
-		qWarning() << "ERROR!! could not retrieve tableName for node type " << geoType << "!! Aborting...";
-		exit(1);
-	}
-
-	if (records.size() > 0 ) {
-        // NOTE: Choose the right function!!
-		return addListOfRecordsToTable(tableName, records); // newest SQLite versions
-		//return addListOfRecordsToTableOld(tableName, records); // old SQLite versions
-	}
-	else
-		qWarning() << "Info: no records to save for geoType '" << geoType << "'. Skipping...";
-	return true;
-}
-
-// ***Note***
-// the syntax built here below is more convenient
-// but it is supported only in SQLite >= 3.7.11
-// ...but SLC6 only has 3.7.9!
-// here we build a query like this:
-// queryStr = QString("INSERT INTO Materials (id, name) VALUES  (1,'Air'), (2,'Silicon'), (368,'ShieldSteel');");
-//
-bool GMDBManager::addListOfRecordsToTable(const QString tableName, const std::vector<QStringList> records)
-{
-	// get table columns and format them for query
-	QString tableColString = "(" + m_tableNames[tableName].join(", ") + ")";
-
-    unsigned int nRecords = records.size();
-    qInfo() << "number of " << tableName << "records to insert into the DB:" << nRecords;
-
-	// preparing the SQL query
-	QString queryStr("INSERT INTO %1 %2 VALUES ");
-	queryStr = queryStr.arg(tableName); // insert table name
-	queryStr = queryStr.arg(tableColString); // insert table columns
-
-	unsigned int nMat = nRecords;
-	unsigned int id = 0;
-	foreach(QStringList rec, records) {
-        //qDebug() << "rec:" << rec;
-
-		++id;
-		QStringList items;
-
-		foreach (QString item, rec) {
-			items << '"' + item + '"';
-		}
-		QString values = items.join(",");
-		queryStr += " (" + QString::number(id) + "," + values + ")";
-		if (id != nMat)
-			queryStr += ",";
-		else
-			queryStr += ";";
-
-        }
-    qDebug() << "queryStr:" << queryStr;
-
-	// executing the SQL query
-	QSqlQuery q;
-	if (!q.exec(queryStr)) {
-        qWarning() << "ERROR!!! SQL error:";
-		showError(q.lastError());
-		return false;
-	}
-
-	qDebug() << "DONE. The list of records have been inserted into the DB.";
-	return true;
-}
-
-
-
-// ***Note***
-// old syntax, for SQLite in SLC6
-// here below we build the syntax for multiple INSERT
-// compatible with old SQLite versions
-// see: stackoverflow.com/questions/1609637
-//
-// we want to build a query like this:
-//  queryStr = QString("INSERT INTO Materials (id, name) SELECT 1 as id, 'Air' as name UNION ALL SELECT 2,'Silicon' UNION ALL SELECT 368,'ShieldSteel' ")
-//
-bool GMDBManager::addListOfRecordsToTableOld(const QString tableName, const std::vector<QStringList> records)
-{
-	// get table columns and format them for query
-	QString tableColString = "(" + m_tableNames[tableName].join(", ") + ")";
-
-
-
-    QStringList colNames = m_tableNames[tableName];
-    unsigned int nRecords = records.size();
-    qInfo() << "number of " << tableName << "records to insert into the DB:" << nRecords;
-
-    /*
-     * SQLite has a limit on 'union' items, set at 500. So we have to split the items if we have more.
-     * See: stackoverflow.com/questions/9527851/
-     */
-    unsigned int bunchSize = 500;
-    if ( nRecords > bunchSize ) {
-        qWarning() << "WARNING! " << nRecords << " records of type " << tableName << "to store in the DB in one call! Call limit is " << bunchSize << " --> We split them in bunches...";
-
-        std::vector<QStringList> recordsCopy( records ); // TODO: maybe we should use a deque or queue, which have fast pop of first element?
-
-        std::vector<QStringList>::const_iterator first;
-        std::vector<QStringList>::const_iterator last;
-
-        unsigned int start = 0;
-
-        while ( recordsCopy.size() > 0 ) {
-
-        // preparing the SQL query
-        QString queryStr("INSERT INTO %1 %2 SELECT ");
-	    queryStr = queryStr.arg(tableName); // insert table name
-	    queryStr = queryStr.arg(tableColString); // insert table columns
-
-        first = recordsCopy.begin();
-        last  = recordsCopy.size() > bunchSize ? recordsCopy.begin() + bunchSize : recordsCopy.end();
-
-        std::vector<QStringList> recordsBunch( first, last ); // we take the first 500 records
-        recordsCopy.erase( first, last ); // we delete the first 500 records
-        if (m_deepDebug) qDebug() << "start:" << start << "recordsBunch size:" << recordsBunch.size() << "- recordsCopy size after removal:" << recordsCopy.size();
-
-	    // --- first record
-        // outcome should be like: " 1 as id, 'Air' as name "
-        unsigned int id = start+1; // set the first ID as 'start'
-        QStringList recFirst = recordsBunch.front(); // access first record from vector
-        recordsBunch.erase( recordsBunch.begin() ); // delete first record
-        if (m_deepDebug) qDebug() << "after taking first record - recordsBunch size:" << recordsBunch.size();
-
-        // first item in the first record (it is the ID)
-        QString firstCol = colNames[0];
-        queryStr += QString::number(id) + " as " + firstCol + ", ";
-
-        // the other items in the first record
-        unsigned int ii = 1;
-        unsigned int nRecs = recFirst.size();
-        foreach (QString rec, recFirst) {
-            queryStr += "'" + rec + "'" + " as " + colNames[ii];
-            if (ii != nRecs)
-                queryStr += ","; // add coma, but not on latest
-            queryStr += " "; // add space
-            //qDebug() << "first element:" << ii << nRecs << queryStr;
-            ++ii;
-        }
-        if (m_deepDebug) qDebug() << "first element query:" << queryStr;
-        // --- other records
-        // outcome should be: " UNION ALL SELECT 2,'Silicon' "
-
-
-            foreach(QStringList recs, recordsBunch) {
-
-							// DEBUG
-							if (tableName == "Functions") {
-								if (recs[1].length() > 65000) {
-									std::cout << "LONG STRING! size: " << recs[1].length() << std::endl;
-									std::cout << "LONG STRING! string: " << recs[1].toStdString() << std::endl << std::endl;
-								}
-							}
-							//------
-
-								++id;
-                // put single quotes around items
-                QStringList items;
-                foreach (QString item, recs) {
-			        		items << "'" + item + "'";
-		        		}
-                // join items into a string and add the SQL commands
-                QString itemsStr = items.join(", ");
-                queryStr += " UNION ALL SELECT " + QString::number(id) + ", " + itemsStr;
-            }
-
-        //qDebug() << "queryStr:" << queryStr;
-
-	    // executing the SQL query
-	    QSqlQuery q;
-	    if (!q.exec(queryStr)) {
-            qWarning() << "ERROR!!! SQL error:";
-		    showError(q.lastError());
-		    return false;
-	    }
-        qDebug() << bunchSize << "elements have been saved into the DB, starting at:" << start;
-
-        start += bunchSize; // for the next iteration
-
-      } // end of while
-
-    } // end of if(>500)
-    else {
-    // preparing the SQL query
-    QString queryStr("INSERT INTO %1 %2 SELECT ");
-	queryStr = queryStr.arg(tableName); // insert table name
-	queryStr = queryStr.arg(tableColString); // insert table columns
-
-    unsigned int id = 0;
-    // loop on all records
-	foreach(QStringList recs, records) {
-
-		++id;
-
-        // first record
-        // outcome should be like: " 1 as id, 'Air' as name "
-        if (id == 1) {
-
-            // first item if the record (it is the ID)
-            QString firstCol = colNames.takeFirst();
-            queryStr += QString::number(id) + " as " + firstCol + ", ";
-
-            // the other items in the record
-            unsigned int ii = 0;
-            unsigned int nRecs = recs.size();
-            foreach (QString rec, recs) {
-                queryStr += "'" + rec + "'" + " as " + colNames[ii];
-                if (ii != nRecs-1)
-                    queryStr += ","; // add coma, but not on latest
-                queryStr += " "; // add space
-                //qDebug() << ii << nRecs << queryStr;
-                ++ii;
-            }
-
-         }
-        // other records
-        // outcome should be: " UNION ALL SELECT 2,'Silicon' "
-        else {
-
-            // put single quotes around items
-            QStringList items;
-            foreach (QString item, recs) {
-			    items << "'" + item + "'";
-		    }
-            // join items into a string and add the SQL commands
-            QString itemsStr = items.join(", ");
-            queryStr += " UNION ALL SELECT " + QString::number(id) + ", " + itemsStr;
-        }
-
-	} // end of: foreach(QStringList recs, records)
-
-    //qDebug() << "queryStr:" << queryStr;
-
-	// executing the SQL query
-	QSqlQuery q;
-	if (!q.exec(queryStr)) {
-        qWarning() << "ERROR!!! SQL error:";
-		showError(q.lastError());
-		return false;
-	}
-} // end of (else > 500)
-
-	qDebug() << "DONE. The list of " << nRecords << "records have been inserted into the DB.";
-	return true;
-
-}
-
-
-
-
-
-QVariant GMDBManager::addShape(const QString &type, const QString &parameters)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addShape()";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into Shapes(type, parameters) values(?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(type);
-	q.addBindValue(parameters);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addSerialDenominator(const QString &baseName)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addSerialDenominator("+baseName+")";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into SerialDenominators(baseName) values(?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(baseName);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addNameTag(const QString &name)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addNameTag("+name+")";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into NameTags(name) values(?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-	q.addBindValue(name);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addFunction(const QString expression)
-{
-	if (m_deepDebug) {
-        qDebug() << "GMDBManager::addFunction()";
-	    std::cout << "Function - expression string len: " << expression.length();
-	    std::cout << "Function - expression: " << expression.toStdString() << std::endl << std::endl;
-	    qDebug() << "expression:" << expression;
-    }
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into Functions(expression) values(?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(expression);
-	q.exec();
-	return q.lastInsertId();
-
-
-}
-
-QVariant GMDBManager::addSerialTransformer(const QVariant &funcId, const QVariant &physvolId, const QString physvolType, const unsigned int &copies)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addSerialTransformer()" << funcId << physvolId << copies;
-
-	QVariant volTableId = getTableIdFromNodeType(physvolType);
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into SerialTransformers(funcId, volId, volTable, copies) values(?, ?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(funcId);
-	q.addBindValue(physvolId);
-	q.addBindValue(volTableId);
-	q.addBindValue(copies);
-	q.exec();
-	return q.lastInsertId();
-}
-
-QVariant GMDBManager::addTransform(QVector<double> params)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addTransform()";
-
-	// get the 12 matrix elements
-	double xx = params[0];
-	double xy = params[1];
-	double xz = params[2];
-
-	double yx = params[3];
-	double yy = params[4];
-	double yz = params[5];
-
-	double zx = params[6];
-	double zy = params[7];
-	double zz = params[8];
-
-	double dx = params[9];
-	double dy = params[10];
-	double dz = params[11];
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into Transforms(xx, xy, xz, yx, yy, yz, zx, zy, zz, dx, dy, dz) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(xx);
-	q.addBindValue(xy);
-	q.addBindValue(xz);
-	q.addBindValue(yx);
-	q.addBindValue(yy);
-	q.addBindValue(yz);
-	q.addBindValue(zx);
-	q.addBindValue(zy);
-	q.addBindValue(zz);
-	q.addBindValue(dx);
-	q.addBindValue(dy);
-	q.addBindValue(dz);
-	q.exec();
-	return q.lastInsertId();
-}
-
-
-QVariant GMDBManager::addAlignableTransform(QVector<double> params)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addAlignableTransform()";
-
-	// get the 12 matrix elements
-	double xx = params[0];
-	double xy = params[1];
-	double xz = params[2];
-
-	double yx = params[3];
-	double yy = params[4];
-	double yz = params[5];
-
-	double zx = params[6];
-	double zy = params[7];
-	double zz = params[8];
-
-	double dx = params[9];
-	double dy = params[10];
-	double dz = params[11];
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into AlignableTransforms(xx, xy, xz, yx, yy, yz, zx, zy, zz, dx, dy, dz) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-
-	q.addBindValue(xx);
-	q.addBindValue(xy);
-	q.addBindValue(xz);
-	q.addBindValue(yx);
-	q.addBindValue(yy);
-	q.addBindValue(yz);
-	q.addBindValue(zx);
-	q.addBindValue(zy);
-	q.addBindValue(zz);
-	q.addBindValue(dx);
-	q.addBindValue(dy);
-	q.addBindValue(dz);
-	q.exec();
-	return q.lastInsertId();
-}
-
-
-bool GMDBManager::addRootVolume(const QStringList values)
-{
-	if (values.size() > 0 ) {
-		QVariant volId = QVariant(values[0]);
-		QString nodeType = values[1];
-		return storeRootVolume( volId, nodeType );
-	}
-	else
-		qFatal("Info: no records to save for RootVolume!");
-	return false;
-}
-
-// insert a single parent-child relationship for a given parent volume
-void GMDBManager::addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyNumber, const unsigned int childPos, const QString childType, const unsigned int childCopyN)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::addChildPosition(" << parentId << "," << parentType << "," << QString::number(parentCopyNumber) << "," <<childPos << "," << childType << ", " << childId << ", " << QString::number(childCopyN) << ")";
-
-	// get table name -- which the child ID refers to -- based on the child type
-	QVariant parentTableId = getTableIdFromNodeType(parentType);
-	QVariant childTableId = getTableIdFromNodeType(childType);
-
-	QString tableName = "ChildrenPositions";
-	QStringList cols = getTableColumnNames(tableName);
-
-	QString queryStr = QString("insert into %1(%2, %3, %4, %5, %6, %7, %8) values(?, ?, ?, ?, ?, ?, ?)").arg(tableName);
-	for (int i=0; i < cols.size(); ++i) {
-		if (i != 0) // skip the "id" column
-			queryStr = queryStr.arg( cols.at(i) );
-	}
-	if (m_deepDebug) qDebug() << "queryStr:" << queryStr;
-	QSqlQuery q;
-	if (!q.prepare(queryStr)) {
-		showError(q.lastError());
-		return;
-	}
-	qDebug() << "parent:" << parentId;
-	q.addBindValue(parentId);
-	q.addBindValue(parentTableId);
-	q.addBindValue(parentCopyNumber);
-	q.addBindValue(childPos);
-	q.addBindValue(childTableId);
-	q.addBindValue(childId);
-	q.addBindValue(childCopyN);
-	q.exec();
-	return;
-}
-
-void GMDBManager::addDBversion(const QString version)
-{
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into dbversion(version) values(?)"))) {
-		showError(q.lastError());
-		return;
-	}
-	q.addBindValue(version);
-	q.exec();
-	return;
-}
-
-
-QStringList GMDBManager::getItem(QString geoType, unsigned int id)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::getItem(geoType, id)"<< geoType << QString::number(id);
-
-	/* Get the right DB table */
-	QString tableName = getTableNameFromNodeType(geoType);
-	return getItemFromTableName(tableName, id);
-}
-
-
-QStringList GMDBManager::getItem(unsigned int tableId, unsigned int id)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::getItem(tableId, id)"<< QString::number(tableId) << QString::number(id);
-	/* Get the right DB table */
-	QString tableName = getTableNameFromTableId(tableId);
-	return getItemFromTableName(tableName, id);
-
-}
-
-QStringList GMDBManager::getItemAndType(unsigned int tableId, unsigned int id)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::getItemAndType(tableId, id)"<< QString::number(tableId) << QString::number(id);
-	/* Get the right DB table */
-	QString tableName = getTableNameFromTableId(tableId);
-
-	QString nodeType = getNodeTypeFromTableId(tableId);
-
-	QStringList results;
-	QStringList item =  getItemFromTableName(tableName, id);
-
-	results << nodeType << item;
-
-	return results;
-
-}
-
-
-QStringList GMDBManager::getItemFromTableName(QString tableName, unsigned int id)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::getItemFromTableName(tableName, id)"<< tableName << QString::number(id);
-	/*
-	 * 2. Get the object from DB
-	 */
-	// prepare a SQL string with the right table name
-	QString queryStr = QString("SELECT * FROM %1 WHERE id = (?)").arg(tableName);
-	// prepare the query
-	QSqlQuery q;
-	if (!q.prepare( queryStr )) {
-		showError(q.lastError());
-		return QStringList();
-	}
-	q.addBindValue(id);
-	q.exec();
-
-	QStringList params;
-
-	// get the number of columns of the DB table
-	int nCols = (m_tableNames[tableName]).size();
-
-	while (q.next()) {
-
-		for( int ii=0; ii<nCols; ++ii)
-			params << q.value(ii).toString();
-	}
-	if (params.length()==0) {
-		qWarning() << "WARNING!!" << "Item" << id << "does not exist in table" << tableName << "!!";
-	}
-	return params;
-}
-
-// get the list of children for a single GeoVPhysVol (i.e., GeoPhysVol or GeoFullPhysVol)
-QMap<unsigned int, QStringList> GMDBManager::getVPhysVolChildren(const unsigned int id, const QString nodeType, const unsigned int parentCopyNumber)
-{
-	if (m_deepDebug) qDebug() << "GMDBManager::getVPhysVolChildren() - id:" << QString::number(id) << "- type:" << nodeType << "- copyN:" << QString::number(parentCopyNumber);
-
-	QVariant tableId = getTableIdFromNodeType(nodeType);
-
-	// get children and their positions
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("SELECT * FROM ChildrenPositions WHERE parentId = (?) AND parentTable = (?) AND parentCopyNumber = (?)"))) {
-		showError(q.lastError());
-		return QMap<unsigned int, QStringList>();
-	}
-	q.addBindValue(id);
-	q.addBindValue(tableId);
-	q.addBindValue(parentCopyNumber);
-	q.exec();
-
-	QMap<unsigned int, QStringList> children;
-	QStringList childParams;
-
-	// get the number of columns of the DB table
-	int nCols = m_tableNames["ChildrenPositions"].size();
-
-	while (q.next()) {
-
-		childParams.clear();
-
-		unsigned int childPos = q.value(3).toUInt();
-
-		for( int ii=0; ii<nCols; ++ii)
-			childParams << q.value(ii).toString();
-
-		children[childPos] = childParams;
-	}
-
-	return children;
-}
-
-
-// Get all parent-children data from the database in one go
-QHash<QString, QMap<unsigned int, QStringList>> GMDBManager::getChildrenTable()
-{
-	qDebug() << "GMDBManager::getChildrenTable()";
-
-	QSqlQuery q = selectAllFromTable("ChildrenPositions");
-
-	QHash< QString, QMap<unsigned int, QStringList> > all_children; // to store all children
-	// QMap<unsigned int, QStringList> children; // to temporarily store the children of one parent
-	QStringList childParams; // to temporarily store the children parameters
-
-	// get the number of columns of the DB table
-	int nCols = m_tableNames["ChildrenPositions"].size();
-        qDebug() << "num of columns in childrenPos table" << nCols;
-
-    // loop over all children's positions stored in the DB
-	while (q.next()) {
-
-		childParams.clear();
-
-		QString parentId = q.value(1).toString();
-		QString parentTable = q.value(2).toString();
-		QString parentCopyNumber = q.value(3).toString();
-		unsigned int childPos = q.value(4).toUInt();
-
-		QString key = parentId + ":" + parentTable + ":" + parentCopyNumber;
-
-		for( int ii=0; ii<nCols; ++ii)
-			childParams << q.value(ii).toString();
-
-		all_children[key][childPos] = childParams;
-	}
-	return all_children;
-}
-
-
-
-QVariant GMDBManager::getTableIdFromNodeType(QString nodeType)
-{
-	qDebug() << "GMDBManager::getTableIdFromNodeType("<< nodeType <<")";
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("SELECT id FROM GeoNodesTypes WHERE nodeType = (?)"))) {
-		showError(q.lastError());
-		return QVariant();
-	}
-	q.addBindValue(nodeType);
-	q.exec();
-
-	QVariant id;
-	while (q.next()) {
-		id = q.value(0);
-		qDebug() << "id:" << id;
-	}
-
-	return id;
-}
-
-QString GMDBManager::getTableNameFromNodeType(QString nodeType)
-{
-	qDebug() << "GMDBManager::getTableNameFromNodeType("<< nodeType <<")";
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("SELECT tableName FROM GeoNodesTypes WHERE nodeType = (?)"))) {
-		showError(q.lastError());
-		return QString();
-	}
-	q.addBindValue(nodeType);
-	q.exec();
-
-	QString tableName;
-	while (q.next()) {
-		tableName = q.value(0).toString();
-		qDebug() << "tableName:" << tableName;
-	}
-
-	return tableName;
-}
-
-// TODO: this and other methods could take data from in-memory maps, without asking to the DB all the times
-QString GMDBManager::getTableNameFromTableId(unsigned int tabId)
-{
-	qDebug() << "GMDBManager::getTableNameFromTableId()";
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("SELECT tableName FROM GeoNodesTypes WHERE id = (?)"))) {
-		showError(q.lastError());
-		return QString();
-	}
-	q.addBindValue(tabId);
-	q.exec();
-
-	QString tableName;
-	while (q.next()) {
-		tableName = q.value(0).toString();
-		qDebug() << "tableName:" << tableName;
-	}
-
-	return tableName;
-}
-
-QString GMDBManager::getNodeTypeFromTableId(unsigned int tabId)
-{
-	qDebug() << "GMDBManager::getNodeTypeFromTableId()";
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("SELECT nodeType FROM GeoNodesTypes WHERE id = (?)"))) {
-		showError(q.lastError());
-		return QString();
-	}
-	q.addBindValue(tabId);
-	q.exec();
-
-	QString nodeType;
-	while (q.next()) {
-		nodeType = q.value(0).toString();
-		qDebug() << "tableName:" << nodeType;
-	}
-
-	return nodeType;
-}
-
-
-QHash<unsigned int, QString> GMDBManager::getAll_TableIDsNodeTypes()
-{
-	qDebug() << "GMDBManager::getAll_TableIDsNodeTypes()";
-
-	QHash<unsigned int, QString> output;
-
-	QSqlQuery q = selectAllFromTable("GeoNodesTypes");
-
-	unsigned int id;
-	QString nodeType;
-	// QString tableName;
-	while (q.next()) {
-		id = q.value(0).toUInt();
-		nodeType = q.value(1).toString();
-		output[id] = nodeType;
-	}
-	return output;
-}
-
-
-QHash<QString, unsigned int> GMDBManager::getAll_NodeTypesTableIDs()
-{
-	qDebug() << "GMDBManager::getAll_NodeTypesTableIDs()";
-
-	QHash<QString, unsigned int> output;
-
-	QSqlQuery q = selectAllFromTable("GeoNodesTypes");
-
-	unsigned int id;
-	QString nodeType;
-	// QString tableName;
-	while (q.next()) {
-		id = q.value(0).toUInt();
-		nodeType = q.value(1).toString();
-		output[nodeType] = id;
-	}
-	return output;
-}
-
-
-QSqlQuery GMDBManager::selectAllFromTable(QString tableName) const
-{
-	QSqlQuery q;
-
-	QString queryStr = QString("SELECT * FROM %1");
-	queryStr = queryStr.arg(tableName);
-
-	if (!q.prepare(queryStr)) {
-		showError(q.lastError());
-		return QSqlQuery();
-	}
-	q.exec();
-	return q;
-}
-
-
-bool GMDBManager::initDB()
-{
-	qDebug() << "GMDBManager::initDB()";
-
-
-	// check if DB is empty
-	qDebug() << "checking existing tables...";
-	QSqlDatabase db = QSqlDatabase::database();
-	QStringList tables = db.tables();
-	if (tables.contains("LogVols", Qt::CaseInsensitive)
-			&& tables.contains("PhysVols", Qt::CaseInsensitive)
-			&& tables.contains("Materials", Qt::CaseInsensitive)
-			&& tables.contains("Elements", Qt::CaseInsensitive)
-			&& tables.contains("Shapes", Qt::CaseInsensitive)
-	) {
-		qDebug() << "tables are present already. Skipping tables creation. Loading tables...";
-		loadTableNamesFromDB();
-		return true;
-	}
-
-	// if DB is empty, then create tables
-	qDebug() << "DB file is empty. Creating tables...";
-	bool tablesOK = createTables();
-
-	// store DB version
-	qDebug() << "Storing DB version:" << QString::fromStdString(dbversion);
-	addDBversion(QString::fromStdString(dbversion));
-
-	return tablesOK;
-
-}
-
-bool GMDBManager::createTables()
-{
-	qDebug() << "GMDBManager::createTables()";
-
-	QStringList tab;
-	QSqlQuery q;
-	QString geoNode;
-	QString tableName;
-	QString queryStr;
-
-	// create a table to store the relation between the types of GeoNodes and the name of the table
-	tableName = "dbversion";
-	tab << tableName << "id" << "version";
-	queryStr = QString("create table %1(%2 integer primary key, %3 integer)");
-	for (int i=0; i < tab.size(); ++i) {
-		queryStr = queryStr.arg( tab.at(i) );
-	}
-	//qDebug() << "query:" << queryStr;
-	if (!q.exec(queryStr)) {
-		showError(q.lastError());
-		return false;
-	}
-	storeTableColumnNames(tab);
-	tab.clear();
-
-	// create a table to store the relation between the types of GeoNodes and the name of the table
-	tableName = "GeoNodesTypes";
-	tab << tableName << "id" << "nodeType" << "tableName";
-	storeTableColumnNames(tab);
-	tab.clear();
-	if (!q.exec(QLatin1String("create table GeoNodesTypes(id integer primary key, nodeType varchar, tableName varchar)"))) {
-		showError(q.lastError());
-		return false;
-	}
-
-	// ChildrenPositions table
-	tableName = "ChildrenPositions";
-	tab << tableName << "id" << "parentId" << "parentTable" << "parentCopyNumber" << "position" << "childTable" << "childId" << "childCopyNumber";
-	queryStr = QString("create table %1(%2 integer primary key, %3 integer, %4 integer not null REFERENCES GeoNodesTypes(id), %5 integer, %6 integer, %7 integer not null REFERENCES GeoNodesTypes(id), %8 integer not null, %9 integer)"); // FIXME: add "NOT NULL" to copy numbers
-	for (int i=0; i < tab.size(); ++i) {
-		queryStr = queryStr.arg( tab.at(i) );
-	}
-	// qDebug() << "query:" << queryStr;
-	if (!q.exec(queryStr)) {
-		showError(q.lastError());
-		return false;
-	}
-	storeTableColumnNames(tab);
-	tab.clear();
-
-
-	// RootVolume table
-	tableName = "RootVolume";
-	tab << tableName << "id" << "volId" << "volTable";
-	queryStr = QString("create table %1(%2 integer primary key, %3 integer not null, %4 integer not null REFERENCES GeoNodesTypes(id))");
-	for (int i=0; i < tab.size(); ++i) {
-		queryStr = queryStr.arg( tab.at(i) );
-	}
-	//qDebug() << "query:" << queryStr;
-	if (!q.exec(queryStr)) {
-		showError(q.lastError());
-		return false;
-	}
-	storeTableColumnNames(tab);
-	tab.clear();
-
-
-	// PhysVols table
-	geoNode = "GeoPhysVol";
-	tableName = "PhysVols";
-	tab << tableName << "id" << "logvol" << "parent"; // FIXME: remove "parent" field, it is not used anymore
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table PhysVols(id integer primary key, logvol integer not null, parent integer)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// FullPhysVols table
-	geoNode = "GeoFullPhysVol";
-	tableName = "FullPhysVols";
-	tab << tableName << "id" << "logvol" << "parent";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table FullPhysVols(id integer primary key, logvol integer not null, parent integer)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// LogVols table
-	geoNode = "GeoLogVol";
-	tableName = "LogVols";
-	tab << tableName << "id" << "name" << "shape" << "material";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table LogVols(id integer primary key, name varchar, shape integer not null, material integer not null)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// Materials table
-	geoNode = "GeoMaterial";
-	tableName = "Materials";
-	tab << tableName << "id" << "name" << "density" << "elements";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table Materials(id integer primary key, name varchar, density varchar, elements varchar)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// Elements table
-	geoNode = "GeoElement";
-	tableName = "Elements";
-	tab << tableName << "id" << "name" << "symbol" << "Z" << "A";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table Elements(id integer primary key, name varchar, symbol varchar, Z varchar, A varchar)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// Shapes table
-	geoNode = "GeoShape";
-	tableName = "Shapes";
-	tab << tableName << "id" << "type" << "parameters";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table Shapes(id integer primary key, type varchar, parameters varchar)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// SerialDenominators table
-	geoNode = "GeoSerialDenominator";
-	tableName = "SerialDenominators";
-	tab << tableName << "id" << "baseName";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table SerialDenominators(id integer primary key, baseName varchar)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// Functions table
-	geoNode = "Function";
-	tableName = "Functions";
-	tab << tableName << "id" << "expression";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table Functions(id integer primary key, expression varchar)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// SerialDenominators table
-	geoNode = "GeoSerialTransformer";
-	tableName = "SerialTransformers";
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	tab << tableName << "id" << "funcId" << "volId" << "volTable" << "copies";
-	storeTableColumnNames(tab);
-	queryStr = QString("create table %1(%2 integer primary key, %3 integer not null REFERENCES Functions(id), %4 integer not null, %5 integer not null REFERENCES GeoNodesTypes(id), %6 integer)");
-	for (int i=0; i < tab.size(); ++i) {
-		queryStr = queryStr.arg( tab.at(i) );
-	}
-	tab.clear();
-	// qDebug() << "query:" << queryStr;
-	if (!q.exec(queryStr)) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-
-	// Transforms table
-	geoNode = "GeoTransform";
-	tableName = "Transforms";
-	tab << tableName << "id" << "xx" << "xy" << "xz" << "yx" << "yy" << "yz" << "zx" << "zy" << "zz" << "dx" << "dy" << "dz";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table Transforms(id integer primary key, xx real, xy real, xz real, yx real, yy real, yz real, zx real, zy real, zz real, dx real, dy real, dz real)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// AlignableTransforms table
-	geoNode = "GeoAlignableTransform";
-	tableName = "AlignableTransforms";
-	tab << tableName << "id" << "xx" << "xy" << "xz" << "yx" << "yy" << "yz" << "zx" << "zy" << "zz" << "dx" << "dy" << "dz";
-	storeTableColumnNames(tab);
-	tab.clear();
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	if (!q.exec(QLatin1String("create table AlignableTransforms(id integer primary key, xx real, xy real, xz real, yx real, yy real, yz real, zx real, zy real, zz real, dx real, dy real, dz real)"))) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-	// NameTags table
-	geoNode = "GeoNameTag";
-	tableName = "NameTags";
-	m_childType_tableName[geoNode] = tableName; // store type-table relation
-	tab << tableName << "id" << "name";
-	storeTableColumnNames(tab);
-	queryStr = QString("create table %1(%2 integer primary key, %3 varchar)");
-	for (int i=0; i < tab.size(); ++i) {
-		queryStr = queryStr.arg( tab.at(i) );
-	}
-	tab.clear();
-	// qDebug() << "query:" << queryStr;
-	if (!q.exec(queryStr)) {
-		showError(q.lastError());
-		return false;
-	} else {
-		storeNodeType(geoNode, tableName);
-	}
-
-    qDebug() << "m_childType_tableName:" << m_childType_tableName;
-	qDebug() << "DONE. All tables created successfully.";
-	return true;
-
-}
-
-void GMDBManager::loadTableNamesFromDB()
-{
-	qDebug() << "GMDBManager::loadTableNames()";
-	QSqlDatabase db = QSqlDatabase::database();
-	QStringList tables = db.tables();
-	foreach (QString tab, tables) {
-		QStringList tabColNames = getTableColNamesFromDB(tab);
-		storeTableColumnNames(tabColNames);
-	}
-	// qDebug() << "m_tableNames:" << m_tableNames;
-}
-
-void GMDBManager::storeTableColumnNames(QStringList input)
-{
-	//	qDebug() << "GMDBManager::storeTableColumnNames()";
-	if (! (input.isEmpty()) ) {
-		QString tabName = input.takeFirst();
-		m_tableNames[tabName] = input;
-	}
-}
-
-QStringList GMDBManager::getTableColumnNames(QString tableName)
-{
-	//	qDebug() << "GMDBManager::getTableColumnNames()";
-	return m_tableNames[tableName];
-}
-
-void GMDBManager::storeNodeType(QString nodeType, QString tableName)
-{
-	qDebug() << "GMDBManager::storeNodeType()";
-
-	QSqlQuery q;
-	if (!q.prepare(QLatin1String("insert into GeoNodesTypes(nodeType, tableName) values(?, ?)"))) {
-		showError(q.lastError());
-		return;
-	}
-
-	q.addBindValue(nodeType);
-	q.addBindValue(tableName);
-	q.exec();
-	return;
-}
-
-void GMDBManager::loadTestData()
-{
-
-	qDebug() << "GMDBManager::loadTestData()";
-
-	// create test data
-	QSqlQuery q;
-	//
-	//	qDebug() << "Loading Shapes...";
-	//	if (!q.prepare(QLatin1String("insert into Shapes(name) values(?)"))) {
-	//		showError(q.lastError());
-	//		return;
-	//	}
-	qDebug() << "Loading Shapes...";
-	QVariant boxId    = addShape(QLatin1String("Box"), "");
-	QVariant coneId   = addShape(QLatin1String("Cone"), "");
-	QVariant sphereId = addShape(QLatin1String("Sphere"), "");
-
-	qDebug() << "Loading Elements...";
-	qWarning() << "Sample GeoElement data --> to be implemented!";
-
-	qDebug() << "Loading Materials...";
-	QVariant airId  = addMaterial(QLatin1String("Air"),QLatin1String("density"),QLatin1String("elements"));
-	QVariant ironId = addMaterial(QLatin1String("Iron"),QLatin1String("density"),QLatin1String("elements"));
-	QVariant leadId = addMaterial(QLatin1String("Lead"),QLatin1String("density"),QLatin1String("elements"));
-
-	qDebug() << "Loading LogVols...";
-	QVariant worldLogId = addLogVol(QLatin1String("WorldLog"), boxId, airId);
-	QVariant toyLogId  = addLogVol(QLatin1String("ToyLog"), coneId, leadId);
-
-	qDebug() << "Loading PhysVols...";
-	QVariant rootPhysId = addPhysVol(worldLogId, QVariant()); // no parent
-	QVariant childPhysId = addPhysVol(toyLogId, rootPhysId);
-
-	qDebug() << "DONE. Created and loaded test data.";
-}
-
-
-QStringList GMDBManager::getTableColNamesFromDB(QString tableName) const
-{
-	QStringList colNames;
-	colNames << tableName;
-
-	// fetch the driver
-	QSqlDriver* driver = m_db.driver();
-	QSqlRecord record = driver->record(tableName);
-	int colN = record.count();
-	for (int i = 0; i < colN; ++i)
-		colNames << record.fieldName(i);
-	return colNames;
-}
-
-
-
-void GMDBManager::printTableColNamesFromDB(QString tableName) const
-{
-	qDebug() << "GMDBManager::printTableColNames:" << tableName;
-
-	// fetch the driver
-	qDebug() << getTableColNamesFromDB(tableName);
-}
-
-bool GMDBManager::storeRootVolume(QVariant id, QString nodeType)
-{
-	qDebug() << "GMDBManager::storeRootVolume:" << id << nodeType;
-
-	QVariant typeId = getTableIdFromNodeType(nodeType);
-
-	QString tableName = "RootVolume";
-	QStringList cols = getTableColumnNames(tableName);
-
-	// prepare the query string
-	QString queryStr = QString("insert into %1(%2, %3) values(?, ?)").arg(tableName);
-	for (int i=0; i < cols.size(); ++i) {
-		if (i != 0) // skip the "id" column
-			queryStr = queryStr.arg( cols.at(i) );
-	}
-	//qDebug() << "queryStr:" << queryStr;
-	// prepare the query
-	QSqlQuery q;
-	if (!q.prepare(queryStr)) {
-		showError(q.lastError());
-		return false;
-	}
-	q.addBindValue(id);
-	q.addBindValue(typeId);
-	// run the query
-	q.exec();
-	return true;
-}
-
-QStringList GMDBManager::getRootPhysVol()
-{
-	qDebug() << "GMDBManager::getRootPhysVol()";
-	// get the ID of the ROOT vol from the table "RootVolume"
-	// QSqlQuery query("SELECT * FROM RootVolume");
-	QSqlQuery query = selectAllFromTable("RootVolume");
-
-	QVariant id;
-	QVariant typeId;
-	while (query.next()) {
-		id = query.value(1);
-		typeId = query.value(2);
-	}
-	return getItemAndType(typeId.toUInt(), id.toUInt());
-}
-
-QString GMDBManager::getDBFilePath()
-{
-    return m_dbpath;
-}
-
-
-int GMDBManager::getTableColIndex(QString tableName, QString colName)
-{
-	//qDebug() << "GMDBManager::getTableColIndex()";
-	QStringList colFields = m_tableNames[tableName];
-	return colFields.lastIndexOf(colName);
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/CMakeLists.txt
deleted file mode 100644
index 5808035a7d76..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Package: GeoModelErrorHandler
-################################################################################
-
-# Declare the package name:
-atlas_subdir( GeoModelErrorHandler )
-
-# Install files from the package:
-atlas_install_headers( GeoModelErrorHandler )
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/GeoModelErrorHandler/ErrorHandler.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/GeoModelErrorHandler/ErrorHandler.h
deleted file mode 100644
index e32da54aee8a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoModelErrorHandler/GeoModelErrorHandler/ErrorHandler.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
- * ErrorHandler.h
- *
- *  Created on: May 29, 2016
- *      Author: rbianchi
- *
- *  Source:
- *  - http://brianmilco.blogspot.ch/2011/11/color-debug-output-with-qt-and-qdebug.html
- */
-
-#ifndef ERRORHANDLER_H_
-#define ERRORHANDLER_H_
-
-#include <QtGlobal>
-#include <QString>
-
-//void errorHandler(QtMsgType type, const char *msg)
-void errorHandler(QtMsgType type, const QMessageLogContext &, const QString & msg)
-
-{
-
-	const char* msgChar = msg.toStdString().c_str();
-
-    switch (type) {
-
-        case QtDebugMsg:
-
-            fprintf(stderr, "%s\n", msgChar);
-
-            break;
-
-        case QtWarningMsg:
-
-            fprintf(stderr, "\033[1;33mWarning\033[0m: %s\n", msgChar);
-
-            break;
-
-        case QtCriticalMsg:
-
-            fprintf(stderr, "\033[31mCritical\033[0m: %s\n", msgChar);
-
-            break;
-
-        case QtFatalMsg:
-
-            fprintf(stderr, "\033[31mFatal\033[0m: %s\n", msgChar);
-
-            abort();
-
-        case QtInfoMsg:
-
-            break;
-
-
-    }
-
-}
-
-
-#endif /* ERRORHANDLER_H_ */
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/CMakeLists.txt
deleted file mode 100644
index 073d0e926cc5..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-################################################################################
-# Package: GeoRead
-################################################################################
-
-# Declare the package name:
-atlas_subdir( GeoRead )
-
-# Declare the package's dependencies:
-# TODO: we can skip the dependency on GeoPrimitives when we convert all methods to Eigen (GeoTrf::Transform3D)
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoPrimitives
-                          )
-
-# External dependencies:
-find_package( Qt5 COMPONENTS Core ) # needed for QDebug
-find_package( CLHEP ) # to be dropped when migrated all methods to the new Eigen-based GeoTrf
-find_package( Eigen )
-find_package( GeoModelCore )
-
-
-
-if(CMAKE_BUILD_TYPE MATCHES Release)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment out if you want to get debug messages in Release
-endif(CMAKE_BUILD_TYPE MATCHES Release)
-if(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment out if you want to get debug messages in RelWithDebInfo
-endif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-
-# Component(s) in the package:
-atlas_add_library( GeoRead
-                   src/*.cpp
-                   PUBLIC_HEADERS GeoRead
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GeoModelDBManager TFPersistification)
-                   #LINK_LIBRARIES ${CLHEP_LIBRARIES} Qt5::Widgets GeoModelKernel GeoModelDBManager TFPersistification VP1Base )
-# TODO: we should get rid of VP1Base::VP1Msg dependency, since GeoRead should not depend on VP1 packages. Maybe we can move VP1Msg to a standalone package.
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
deleted file mode 100644
index d6bbdb8fcc35..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
- * GeoModelReadIn.h
- *
- *  Created on: May 20, 2016
- *      Author: Riccardo Maria BIANCHI <rbianchi@cern.ch>
- */
-
-#ifndef GEOMODELREADIN_H_
-#define GEOMODELREADIN_H_
-
-#include "GeoModelDBManager/GMDBManager.h"
-
-#include "GeoModelKernel/GeoXF.h"
-
-
-// C++ includes
-#include <string>
-#include <set>
-
-
-// FWD declarations
-class GeoVPhysVol;
-class GeoPhysVol;
-class GeoLogVol;
-class GeoShape;
-class GeoMaterial;
-class GeoNameTag;
-class GeoSerialDenominator;
-class GeoAlignableTransform;
-class GeoTransform;
-class GeoSerialTransformer;
-class GeoGraphNode;
-//class GeoXF;
-//class GeoXF::Function;
-
-using namespace GeoGenfun;
-using namespace GeoXF;
-
-typedef const Function & TRANSFUNCTION;
-
-
-namespace GeoModelPers {
-
-class GReadIn {
-public:
-
-	GReadIn(GMDBManager* db, unsigned long* progress = nullptr);
-	virtual ~GReadIn();
-
-	// void printRecords();
-	GeoPhysVol* buildGeoModel();
-
-private:
-
-//	static int dbCallbackPrint(void *NotUsed, int nColRow, char **fieldsRow, char **colNamesRow);
-//	static int dbCallbackBuild(void *NotUsed, int nColRow, char **fieldsRow, char **colNamesRow);
-
-	GeoPhysVol* buildGeoModelByCalls();
-	GeoPhysVol* buildGeoModelOneGo();
-
-	GeoPhysVol* loopOverAllChildren();
-
-	GeoPhysVol* getRootVolume();
-
-	GeoVPhysVol* parseChildren(GeoVPhysVol* vol, QMap<unsigned int, QStringList> children, int depth = 0);
-	GeoVPhysVol* parseVPhysVol(QStringList values, QString nodeType, int depth = 0);
-	GeoVPhysVol* buildVPhysVol(QString id, QString tableId, QString copyNumber);
-	//GeoLogVol* parseLogVol(QStringList values);
-	GeoLogVol* buildLogVol(QString id);
-	//GeoShape* parseShape(QStringList values);
-	GeoShape* buildShape(QString id);
-	//GeoMaterial* parseMaterial(QStringList values);
-	GeoMaterial* buildMaterial(QString id);
-	GeoSerialDenominator* parseSerialDenominator(QStringList values);
-	GeoSerialDenominator* buildSerialDenominator(QString id);
-	GeoAlignableTransform* parseAlignableTransform(QStringList values);
-	GeoAlignableTransform* buildAlignableTransform(QString id);
-	GeoTransform* parseTransform(QStringList values);
-	GeoTransform* buildTransform(QString id);
-	GeoSerialTransformer* parseSerialTransformer(QStringList values);
-	GeoSerialTransformer* buildSerialTransformer(QString id);
-	// TRANSFUNCTION parseFunction(QStringList values);
-	// TRANSFUNCTION parseFunction(const QStringList& values);
-	// TRANSFUNCTION parseFunction(const int& id, const std::string& expr);
-	TRANSFUNCTION parseFunction(const std::string& expr);
-	TRANSFUNCTION buildFunction(QString id);
-	GeoNameTag* parseNameTag(QStringList values);
-	GeoNameTag* buildNameTag(QString id);
-
-
-	GeoShape* getShape(QString id);
-
-	void volAddHelper(GeoVPhysVol* vol, GeoGraphNode* volChild);
-
-	bool isNodeBuilt(const QString id, const QString tableId, const QString copyNumber);
-	GeoGraphNode* getNode(const QString id, const QString tableId, const QString copyNumber);
-	void storeNode(const QString id, const QString tableId, const QString copyNumber, GeoGraphNode* node);
-
-	void checkInputString(QString input);
-
-
-
-	// input arguments
-	GeoPhysVol* m_root;
-	GMDBManager* m_dbManager;
-	unsigned long* m_progress;
-	bool m_deepDebug;
-
-
-	// SQLite variables
-//	sqlite3* _db;
-//	char * _zErrMsg;
-//	int _rc;
-//	char const * _sql;
-//	const char* _data;
-
-	// data containers
-
-	QHash<QString, QMap<unsigned int, QStringList>> m_allchildren; // key = "parentId:parentTable", item = list of children parameters, inserted by child position
-
-	QHash<unsigned int, QStringList> m_physVols;
-	QHash<unsigned int, QStringList> m_fullPhysVols;
-	QHash<unsigned int, QStringList> m_logVols;
-	QHash<unsigned int, QStringList> m_shapes;
-	QHash<unsigned int, QStringList> m_materials;
-	QHash<unsigned int, QStringList> m_transforms;
-	QHash<unsigned int, QStringList> m_alignableTransforms;
-	QHash<unsigned int, QStringList> m_serialDenominators;
-	QHash<unsigned int, QStringList> m_serialTransformers;
-	QHash<unsigned int, QStringList> m_functions;
-	QHash<unsigned int, QStringList> m_nameTags;
-
-	QHash<unsigned int, QString> m_tableid_tableName;
-
-	QStringList m_root_vol_data;
-
-	QHash<QString, GeoGraphNode*> m_memMap;
-
-	std::set<std::string> m_unknown_shapes;
-
-};
-
-} /* namespace GeoModelPers */
-#endif /* GEOMODELREADIN_H_ */
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/CMakeLists.txt.example b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/CMakeLists.txt.example
deleted file mode 100644
index ebd59ff7533a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/CMakeLists.txt.example
+++ /dev/null
@@ -1,34 +0,0 @@
-cmake_minimum_required(VERSION 3.1.0)
-
-project(hellogeo)
-
-# Find includes in corresponding build directories
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-# Instruct CMake to run moc automatically when needed
-set(CMAKE_AUTOMOC ON)
-
-
-# Find the Qt5 libraries, used e.g. to interface with the SQlite DB
-find_package(Qt5 COMPONENTS Core Sql Widgets REQUIRED)
-# Instruct CMake to run Qt5 moc automatically when needed
-set(CMAKE_AUTOMOC ON)
-
-# The project needs VP1Light to build against:
-find_package( VP1Light REQUIRED )
-
-
-# Populate a CMake variable with the sources
-set(SRCS
-    main.cpp
-)
-
-# Tell CMake to create the helloworld executable
-add_executable( hellogeo ${SRCS} )
-
-# Linknall needed libraries
-target_link_libraries( hellogeo Qt5::Core Qt5::Sql VP1Light::GeoModelDBManager VP1Light::GeoRead VP1Light::GeoModelKernel VP1Light::GeoModelUtilities ) 
-
-# Add the BUILDVP1Light definition to switch off the compilation of any part of the code which is Athena-specific
-target_compile_definitions( hellogeo PUBLIC BUILDVP1LIGHT )
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/main.cpp.example b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/main.cpp.example
deleted file mode 100644
index 93b644918c5f..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/examples/hellogeo/main.cpp.example
+++ /dev/null
@@ -1,131 +0,0 @@
-
-#include "GeoModelDBManager/GMDBManager.h"
-#include "GeoRead/GReadIn.h"
-
-#include "GeoModelUtilities/GeoModelExperiment.h"
-#include "GeoModelKernel/GeoBox.h"
-#include "GeoModelKernel/GeoPhysVol.h"
-#include "GeoModelKernel/GeoFullPhysVol.h"
-#include "GeoModelKernel/GeoNameTag.h"
-
-#include <QCoreApplication>
-#include <QString>
-#include <QDebug>
-#include <QFileInfo>
-
-#include <iostream>
-
-
-
-GeoModelExperiment* createTheExperiment(GeoPhysVol* world)
-{
-  if (world == nullptr)
-  {
-    // Setup the 'World' volume from which everything else will be suspended
-    double densityOfAir=0.1;
-    const GeoMaterial* worldMat = new GeoMaterial("std::Air", densityOfAir);
-    const GeoBox* worldBox = new GeoBox(1000*CLHEP::cm, 1000*CLHEP::cm, 1000*CLHEP::cm);
-    const GeoLogVol* worldLog = new GeoLogVol("WorldLog", worldBox, worldMat);
-    // GeoPhysVol* worldPhys = new GeoPhysVol(worldLog);
-    world = new GeoPhysVol(worldLog);
-  }
-  // Setup the 'Experiment' manager
-  GeoModelExperiment* theExperiment = new GeoModelExperiment(world);
-  return theExperiment;
-}
-
-
-
-int main(int argc, char *argv[])
-{
-  QCoreApplication app(argc, argv);
-    
-  // GET GEOMETRY FROM LOCAL DB
-  // Set valid db path before first run
-  static const QString path = "../geometry.db";
-  qDebug() << "Using this DB file:" << path;
-
-  // check if DB file exists. If not, return
-  if (! QFileInfo(path).exists() ) {
-        qWarning() << "ERROR!! DB '" << path << "' does not exist!!";
-        qWarning() << "Returning..." << "\n";
-        // return;
-        throw;
-  }
-
-  // open the DB
-  GMDBManager* db = new GMDBManager(path);
-  /* Open database */
-  if (db->isOpen()) { 
-    qDebug() << "OK! Database is open!";
-  }
-  else {
-    qDebug() << "Database is not open!";
-    // return;
-    throw;
-  }
-
-  // -- testing the input database
-  std::cout << "Printing the list of all GeoMaterial nodes" << std::endl;
-  db->printAllMaterials();
-
-  /* setup the GeoModel reader */
-  GeoModelPers::GReadIn readInGeo = GeoModelPers::GReadIn(db);
-  qDebug() << "GReadIn set.";
-  
-
-  /* build the GeoModel geometry */
-  GeoPhysVol* dbPhys = readInGeo.buildGeoModel(); // builds the whole GeoModel tree in memory 
-  qDebug() << "GReadIn::buildGeoModel() done.";
-
-  // create the world volume container and its manager
-  GeoModelExperiment* theExperiment = createTheExperiment(dbPhys);
-  qDebug() << "ATLAS Geometry is built.";
-  
-
-  // --- testing the imported ATLAS Geometry
-  
-  // get the 'world' volume, i.e. the root volume of the GeoModel tree
-  std::cout << "Getting the 'world' GeoPhysVol, i.e. the root volume of the GeoModel tree" << std::endl;  
-  GeoPhysVol* world = theExperiment->getPhysVol();
-  
-  // get the 'world' GeoLogVol
-  std::cout << "Getting the GeoLogVol used by the 'world' volume" << std::endl;
-  const GeoLogVol* logVol = world->getLogVol();
-  std::cout << "'world' GeoLogVol name: " << logVol->getName() << std::endl;
-  std::cout << "'world' GeoMaterial name: " << logVol->getMaterial()->getName() << std::endl;
-
-  // get number of children volumes
-  unsigned int nChil = world->getNChildVols();
-  std:: cout << "'world' number of children: " << nChil << std::endl;
-
-  // loop over all children nodes
-  std::cout << "Looping over all 'volume' children (i.e., GeoPhysVol and GeoFullPhysVol)..." << std::endl;
-  for (unsigned int idx=0; idx<nChil; ++idx) {
-	PVConstLink nodeLink = world->getChildVol(idx);
-
-	if ( dynamic_cast<const GeoVPhysVol*>( &(*( nodeLink ))) ) {
-		std::cout << "\t" << "the child n. " << idx << " ";
-		const GeoVPhysVol *childVolV = &(*( nodeLink ));
-		if ( dynamic_cast<const GeoPhysVol*>(childVolV) ) {
-			const GeoPhysVol* childVol = dynamic_cast<const GeoPhysVol*>(childVolV);
-			std::cout << "is a GeoPhysVol, whose GeoLogVol name is: " << childVol->getLogVol()->getName() << std::endl;
-		} else if ( dynamic_cast<const GeoFullPhysVol*>(childVolV) ) {
-			const GeoFullPhysVol* childVol = dynamic_cast<const GeoFullPhysVol*>(childVolV);
-			std::cout << "is a GeoFullPhysVol, whose GeoLogVol name is: " << childVol->getLogVol()->getName() << std::endl;
-		}
-        } else if ( dynamic_cast<const GeoNameTag*>( &(*( nodeLink ))) ) {
-		qDebug() << "\t" << "the child n. " << idx << " is a GeoNameTag";
-		const GeoNameTag *childVol = dynamic_cast<const GeoNameTag*>(&(*( nodeLink )));
-		std::cout << "\t\tGeoNameTag's name: " << childVol->getName() << std::endl;
-        }
-  }
-
-  qDebug() << "Everything done.";
-
-  return app.exec();
-}
-
-
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
deleted file mode 100644
index 7788ea3ecf79..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
+++ /dev/null
@@ -1,1741 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
- * GeoModelReadIn.cpp
- *
- *  Created on: May 20, 2016
- *      Author: rbianchi
- */
-
-// local includes
-#include "GeoRead/GReadIn.h"
-
-// SQLite
-//#include "sqlite/sqlite3.h"
-//#include <sqlite3.h>
-
-// TFPersistification includes
-#include "TFPersistification/TransFunctionInterpreter.h"
-
-// GeoModelKernel
-#include "GeoModelKernel/GeoTransform.h"
-#include "GeoModelKernel/GeoAlignableTransform.h"
-#include "GeoModelKernel/GeoSerialTransformer.h"
-#include "GeoModelKernel/GeoSerialDenominator.h"
-#include "GeoModelKernel/GeoMaterial.h"
-#include "GeoModelKernel/GeoNameTag.h"
-#include "GeoModelKernel/GeoLogVol.h"
-#include "GeoModelKernel/GeoPhysVol.h"
-#include "GeoModelKernel/GeoFullPhysVol.h"
-#include "GeoModelKernel/GeoGraphNode.h"
-
-// GeoModel shapes
-#include "GeoModelKernel/GeoBox.h"
-#include "GeoModelKernel/GeoCons.h"
-#include "GeoModelKernel/GeoPara.h"
-#include "GeoModelKernel/GeoPcon.h"
-#include "GeoModelKernel/GeoPgon.h"
-#include "GeoModelKernel/GeoSimplePolygonBrep.h"
-#include "GeoModelKernel/GeoTrap.h"
-#include "GeoModelKernel/GeoTrd.h"
-#include "GeoModelKernel/GeoTube.h"
-#include "GeoModelKernel/GeoTubs.h"
-#include "GeoModelKernel/GeoShapeIntersection.h"
-#include "GeoModelKernel/GeoShapeShift.h"
-#include "GeoModelKernel/GeoShapeSubtraction.h"
-#include "GeoModelKernel/GeoShapeUnion.h"
-
-// Units
-#include "GeoModelKernel/Units.h"
-#define SYSTEM_OF_UNITS GeoModelKernelUnits // so we will get, e.g., 'GeoModelKernelUnits::cm'
-
-// TODO: to remove once the migration to Eigen is complete
-#include "CLHEP/Vector/Rotation.h"
-#include "CLHEP/Geometry/Transform3D.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h" // TODO: to be removed when dropping CLHEP
-
-//VP1Base
-// TODO: we should get rid of VP1Base::VP1Msg dependency, since GeoRead should not depend on VP1 packages. Maybe we can move VP1Msg to a standalone package.
-//#include "VP1Base/VP1Msg.h"
-
-// Qt includes
-#include <QDebug>
-
-
-using namespace GeoGenfun;
-using namespace GeoXF;
-
-
-namespace GeoModelPers {
-
-GReadIn::GReadIn(GMDBManager* db, unsigned long* progress) : m_progress(nullptr), m_deepDebug(false)
-{
-	qDebug() << "DumpGeoModelAction: constructor";
-
-	#ifdef GEOREAD_DEEP_DEBUG
-	  m_deepDebug = true;
- 	#endif
-
-        if ( progress != nullptr) {
-	    m_progress = progress;
-	}
-
-	// set the geometry file
-	m_dbManager = db;
-	if (m_dbManager->isOpen()) {
-		qDebug() << "OK! Database is open!";
-	}
-	else {
-		qWarning() << "ERROR!! Database is NOT open!";
-		return;
-	}
-}
-
-GReadIn::~GReadIn() {
-	// TODO Auto-generated destructor stub
-}
-
-
-///*
-// * Arguments:
-// *
-// *   unused - Ignored in this case, see the documentation for sqlite3_exec
-// *    count - The number of columns in the result set
-// *     data - The row's data
-// *  columns - The column names
-// */
-//int GReadIn::dbCallbackBuild(void* unused, int nColRow, char **fieldsRow, char **colNamesRow){
-//
-//	GReadIn* instance = (GReadIn*) unused;
-//
-//	for(int i=0; i<nColRow; i++){
-//
-//		std::string colName = colNamesRow[i];
-//		std::string fieldRow = fieldsRow[i];
-//
-//		printf("Building %s = %s\n", colNamesRow[i], fieldsRow[i] ? fieldsRow[i] : "NULL");
-//
-//		if ( colName == "SHAPE" ) {
-//
-//			if (fieldRow == "Box")
-//				instance->buildShape();
-//		}
-//
-//	}
-//	printf("\n");
-//	return 0;
-//}
-
-// void GReadIn::buildShape()
-// {
-// 	//	const GeoBox *box = new GeoBox(1200*CLHEP::cm,1200*CLHEP::cm, 1200*CLHEP::cm);
-// }
-
-
-
-
-// void GReadIn::printRecords()
-// {
-// 	// FETCH RECORDS AND PRINT THEM
-//
-// }
-
-
-
-GeoPhysVol* GReadIn::buildGeoModel()
-{
-	qDebug() << "GReadIn::buildGeoModel()";
-
-	// return buildGeoModelByCalls();
-
-	GeoPhysVol* rootVolume = buildGeoModelOneGo();
-
-	if (m_unknown_shapes.size() > 0) {
-		qWarning() << "WARNING!! There were unknwon shapes:";
-		for ( auto it = m_unknown_shapes.begin(); it != m_unknown_shapes.end(); it++ ) {
-			std::cout << "---> " << *it << std::endl;
-		}
-		std::cout << "Remember: unknown shapes are rendered with a dummy cube of 30cm side length." << std::endl;
-		}
-
-	return rootVolume;
-}
-
-/*
-GeoPhysVol* GReadIn::buildGeoModelByCalls()
-{
-	QStringList rootValues = m_dbManager->getRootPhysVol();
-	//	qDebug() << "rootValues:" << rootValues;
-
-	QString nodeType = rootValues.takeFirst(); // it takes out the first element
-
-	// get GeoModel node. Depth == -1 means "get all children volumes / all levels"
-	// m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, -1));
-	m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType));
-
-	// TODO: check if shared nodes are restored only one and then used when needed,
-	// or they are restored with a new node in memory every time they are met
-
-	return m_root;
-}
-*/
-
-GeoPhysVol* GReadIn::buildGeoModelOneGo()
-{
-	qDebug() << "GReadIn::buildGeoModelOneGo()";
-
-	// get all objects from the DB
-	m_physVols = m_dbManager->getTableFromNodeType("GeoPhysVol");
-	std::cout << "GeoPhysVol, read in." << std::endl;
-	m_fullPhysVols = m_dbManager->getTableFromNodeType("GeoFullPhysVol");
-	std::cout << "GeoFullPhysVol, read in." << std::endl;
-	m_logVols = m_dbManager->getTableFromNodeType("GeoLogVol");
-	std::cout << "GeoLogVol, read in." << std::endl;
-	m_shapes = m_dbManager->getTableFromNodeType("GeoShape");
-	std::cout << "GeoShape, read in." << std::endl;
-	m_materials = m_dbManager->getTableFromNodeType("GeoMaterial");
-	std::cout << "GeoMaterial, read in." << std::endl;
-	m_functions = m_dbManager->getTableFromNodeType("Function");
-	std::cout << "Function, read in." << std::endl;
-	m_serialDenominators = m_dbManager->getTableFromNodeType("GeoSerialDenominator");
-	std::cout << "GeoSerialDenominator, read in." << std::endl;
-	m_serialTransformers = m_dbManager->getTableFromNodeType("GeoSerialTransformer");
-	std::cout << "GeoSerialTransformer, read in." << std::endl;
-	m_alignableTransforms = m_dbManager->getTableFromNodeType("GeoAlignableTransform");
-	std::cout << "GeoAlignableTransform, read in." << std::endl;
-	m_transforms = m_dbManager->getTableFromNodeType("GeoTransform");
-	std::cout << "GeoTransform, read in." << std::endl;
-	m_nameTags = m_dbManager->getTableFromNodeType("GeoNameTag");
-	std::cout << "GeoNameTag, read in." << std::endl;
-	// qDebug() << "physVols: " << m_physVols;
-	// qDebug() << "fullPhysVols: " << m_fullPhysVols;
-
-	// get DB metadata
-	m_tableid_tableName = m_dbManager->getAll_TableIDsNodeTypes();
-	std::cout << "DB metadata, read in." << std::endl;
-
-	// get the children table from DB
-	m_allchildren = m_dbManager->getChildrenTable();
-	// qDebug() << "all children from DB:" << m_allchildren;
-	std::cout << "children positions, read in." << std::endl;
-
-	// get the root volume data
-	m_root_vol_data = m_dbManager->getRootPhysVol();
-	std::cout << "root volume data, read in." << std::endl;
-
-	return loopOverAllChildren();
-}
-
-
-// //----------------------------------------
-// GeoPhysVol* GReadIn::loopOverAllChildren()
-// {
-// 	QMessageBox msgBox;
-// 	msgBox.setText("The document has been modified.");
-// 	msgBox.exec();
-// }
-
-//----------------------------------------
-GeoPhysVol* GReadIn::loopOverAllChildren()
-{
-
-  std::cout << "Looping over all children to build the GeoModel tree..." << std::endl;
-
-  int nChildrenRecords = m_allchildren.size();
-
-  // This should go in VP1Light, not in this library. The library could be used by standalone apps without a GUI
-  /*
-    QProgressDialog progress("Loading the geometry...", "Abort Loading", 0, nChildrenRecords, 0);
-    progress.setWindowModality(Qt::WindowModal);
-    progress.show();
-  */
-
-  // loop over parents' keys
-  int counter = 0;
-  foreach (const QString &parentKey, m_allchildren.keys() ) {
-
-    /* //This should go in VP1Light as well!
-       if (progress.wasCanceled()) {
-       std::cout << "You aborted the loading of the geometry." << std::endl;
-
-       QMessageBox msgBox;
-       msgBox.setText("You aborted the loading of the geometry.");
-       msgBox.setInformativeText("Do you want to really abort it?");
-       msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
-       msgBox.setDefaultButton(QMessageBox::No);
-       int ret = msgBox.exec();
-
-       switch (ret) {
-       case QMessageBox::Yes:
-       // Abort the loading of the geometry
-       break;
-       case QMessageBox::No:
-       // Continue with the loading of the geometry
-       progress.reset();
-       default:
-       // should never be reached
-       break;
-       }
-       }
-    */
-
-
-
-    ++counter;
-    std::cout.precision(0);
-    if ( nChildrenRecords < 10000 && counter % 500 == 0 ) {
-      float done = ( (float)counter / nChildrenRecords) * 100;
-      std::cout << "\t" << std::fixed << counter << "children records processed [" << done << "%]" << std::endl;
-      if ( m_progress != nullptr  ) {
-        //progress.setValue(counter); // This hould go in VP1Light
-        *m_progress = counter;
-      }
-    }
-    else if ( nChildrenRecords > 10000 && counter % 2000 == 0 ) {
-      float done = ( (float)counter / nChildrenRecords) * 100;
-      std::cout << "\t" << std::fixed << counter << " children records processed [" << done << "%]" << std::endl;
-      if ( m_progress != nullptr ) {
-        //progress.setValue(counter); // This should go in VP1Light
-        *m_progress = counter;
-      }
-    }
-    if (m_deepDebug) qDebug() << "\nparent: " << parentKey << ':' << m_allchildren.value(parentKey) << "[parentId, parentType, parentCopyNumber, childPos, childType, childId, childCopyN]";
-
-    // get the parent's details
-    QStringList parentKeyItems = parentKey.split(":");
-    QString parentId = parentKeyItems[0];
-    QString parentTableId = parentKeyItems[1];
-    QString parentCopyN = parentKeyItems[2];
-    if (m_deepDebug) qDebug() << "parent ID:" << parentId << ", parent table ID:" << parentTableId << ", parent copy number:" << parentCopyN;
-
-    bool isRootVolume = false;
-    if (parentId == "NULL") {
-      isRootVolume = true;
-    }
-
-    GeoVPhysVol* parentVol = nullptr;
-
-    // build or get parent volume.
-    // Using the parentCopyNumber here, to get a given instance of the parent volume
-    if (!isRootVolume) {
-      if (m_deepDebug) qDebug() << "get the parent volume...";
-      parentVol = buildVPhysVol( parentId, parentTableId, parentCopyN);
-    }
-
-
-    // get the parent's children
-    QMap<unsigned int, QStringList> children = m_allchildren.value(parentKey);
-
-
-
-    // loop over children, sorted by child position automatically
-    // "id", "parentId", "parentTable", "parentCopyNumber", "position", "childTable", "childId", "childCopyNumber"
-    if (m_deepDebug) qDebug() << "parent volume has " << children.size() << "children. Looping over them...";
-    foreach(QStringList child, children) {
-
-      if (m_deepDebug) qDebug() << "child:" << child;
-
-      // build or get child node
-      QString childTableId = child[5];
-      QString childId = child[6];
-      QString childCopyN = child[7];
-
-      QString childNodeType = m_tableid_tableName[childTableId.toUInt()];
-
-      if (m_deepDebug) qDebug() << "childTableId:" << childTableId << ", type:" << childNodeType << ", childId:" << childId;
-
-      if (childNodeType.isEmpty()) {
-        qWarning("ERROR!!! childNodeType is empty!!! Aborting...");
-        exit(1);
-      }
-
-      if (childNodeType == "GeoPhysVol") {
-        if (m_deepDebug) qDebug() << "GeoPhysVol child...";
-        GeoVPhysVol* childNode = dynamic_cast<GeoPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoFullPhysVol") {
-        if (m_deepDebug) qDebug() << "GeoFullPhysVol child...";
-        GeoVPhysVol* childNode = dynamic_cast<GeoFullPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoSerialDenominator") {
-        if (m_deepDebug) qDebug() << "GeoSerialDenominator child...";
-        GeoSerialDenominator* childNode = buildSerialDenominator(childId);
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoAlignableTransform") {
-        if (m_deepDebug) qDebug() << "GeoAlignableTransform child...";
-        GeoAlignableTransform* childNode = buildAlignableTransform(childId);
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoTransform") {
-        if (m_deepDebug) qDebug() << "GeoTransform child...";
-        GeoTransform* childNode = buildTransform(childId);
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoSerialTransformer") {
-        if (m_deepDebug) qDebug() << "GeoSerialTransformer child...";
-        GeoSerialTransformer* childNode = buildSerialTransformer(childId);
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else if (childNodeType == "GeoNameTag") {
-        if (m_deepDebug) qDebug() << "GeoNameTag child...";
-        GeoNameTag* childNode = buildNameTag(childId);
-        if (!isRootVolume) volAddHelper(parentVol, childNode);
-      }
-      else {
-        QString msg = "[" + childNodeType + "]" + QString(" ==> ERROR!!! - The conversion for this type of child node needs to be implemented, still!!!");
-        qFatal("%s", msg.toLatin1().constData());
-      }
-
-    } // loop over all children
-  } // loop over childrenPositions records
-
-  // return the root volume
-  return getRootVolume();
-}
-
-
-// GReadIn::buildNode( QStringList volParams, QString nodeType )
-// {
-// 		if( nodeType == "GeoPhysVol") {
-//
-// 		} else {
-// 			qWarning() << "WARNING!! Node type Unknown!!";
-// 		}
-// }
-
-
-
-
-
-// GeoPhysVol* GReadIn::getGeoModelHandle()
-// {
-// 	QStringList rootValues = m_dbManager->getRootPhysVol();
-// 	//	qDebug() << "rootValues:" << rootValues;
-//
-// 	QString nodeType = rootValues.takeFirst(); // it takes out the first element
-//
-// 	// get GeoModel node. Depth == 1 means "get only first level children"
-// 	m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, 1));
-//
-// 	// TODO: check if shared nodes are restored only one and then used when needed,
-// 	// or they are restored with a new node in memory every time they are met
-//
-// 	return m_root;
-// }
-
-/*
-  GeoVPhysVol* GReadIn::parseChildren(GeoVPhysVol* vol, QMap<unsigned int, QStringList> children, int depth)
-  {
-  qDebug() << "GReadIn::parseChildren()";
-
-  //qDebug() << "children:" << children;
-
-  // get parent volume type
-  QString volType;
-  if (dynamic_cast<GeoPhysVol*>(vol))
-  volType = "GeoPhysVol";
-  else if (dynamic_cast<GeoFullPhysVol*>(vol))
-  volType = "GeoFullPhysVol";
-  else
-  qWarning() << "ERROR!! Unknown vol type!!";
-
-  QMap<unsigned int, QStringList>::const_iterator it; // we don't modify the map, so we use a const_iterator, which is is slightly faster as well.
-
-  for ( it = children.begin(); it != children.end(); ++it) {
-  qDebug() << "\nchild item:" << it.key() << ":" << it.value();
-
-  // QString id = it.value()[0];
-  // QString parentId = it.value()[1];
-  // QString parentTableId = it.value()[2];
-  // QString childPosition = it.value()[3];
-  unsigned int childTableId = it.value()[4].toUInt();
-  unsigned int childId = it.value()[5].toUInt();
-
-  // QString parentTable = m_dbManager->getTableNameFromTableId(parentTableId.toUInt());
-
-  QStringList child = m_dbManager->getItemAndType(childTableId, childId );
-  qDebug() << "child:" << child;
-
-  QString nodeType = child.takeFirst(); // it pops out the first element, leaving the other items in the list
-
-  if (depth > 0) {
-  depth = depth - 1; // decrease the depth by one
-  }
-
-  if (nodeType == "GeoPhysVol") {
-  // if ( childId != parentId.toUInt() ) {
-  if (child.length() > 0) {
-  // build the node
-  GeoPhysVol* volChild = dynamic_cast<GeoPhysVol*>(parseVPhysVol(child, nodeType, depth));
-  // add the node to the parent
-  volAddHelper(vol, volChild);
-  } else {
-  qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
-  }
-  // } else {
-  // 	qWarning() << "WARNING!!" << "childId and parentId are the same! That means an infinite loop!! To be investigated! Skipping now...";
-  // }
-  }
-  else if (nodeType == "GeoFullPhysVol") {
-  if (child.length() > 0) {
-  GeoFullPhysVol* volChild = dynamic_cast<GeoFullPhysVol*>(parseVPhysVol(child, nodeType, depth));
-  volAddHelper(vol, volChild);
-  } else {
-  qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
-  }
-  }
-  else if (nodeType == "GeoSerialDenominator") {
-  GeoSerialDenominator* volChild = parseSerialDenominator(child);
-  volAddHelper(vol, volChild);
-  // vol->add(volChild);
-  }
-  else if (nodeType == "GeoAlignableTransform") {
-  GeoAlignableTransform* volChild = parseAlignableTransform(child);
-  volAddHelper(vol, volChild);
-  // vol->add(volChild);
-  }
-  else if (nodeType == "GeoTransform") {
-  GeoTransform* volChild = parseTransform(child);
-  volAddHelper(vol, volChild);
-  // vol->add(volChild);
-  }
-  else if (nodeType == "GeoSerialTransformer") {
-  GeoSerialTransformer* volChild = parseSerialTransformer(child);
-  volAddHelper(vol, volChild);
-  // vol->add(volChild);
-  }
-  else if (nodeType == "GeoNodeTag") { // TODO: implement it!!
-  QString msg = nodeType + QString(" GeoNodeTag needs to be implemented!!!");
-  qWarning() << msg;
-  }
-  else {
-  QString msg = nodeType + QString(" child-->GeoModel conversion for this type still needs to be implemented!!!");
-  qWarning() << msg;
-  }
-
-  }
-  // this below is to suppress the compiler warning,
-  // but it should not be reached, so we use a qFatal
-  qFatal("This code should not be reached!!! Aborting...");
-  GeoVPhysVol* volnull = nullptr;
-  return volnull;
-  }
-*/
-
-void GReadIn::volAddHelper(GeoVPhysVol* vol, GeoGraphNode* volChild)
-{
-  if (dynamic_cast<GeoPhysVol*>(vol)) {
-    GeoPhysVol* volume = dynamic_cast<GeoPhysVol*>(vol);
-    volume->add(volChild);
-  } else if (dynamic_cast<GeoFullPhysVol*>(vol)) {
-    GeoFullPhysVol* volume = dynamic_cast<GeoFullPhysVol*>(vol);
-    volume->add(volChild);
-  }
-}
-
-/*
-// Instantiate a PhysVol and get its children
-GeoVPhysVol* GReadIn::parseVPhysVol(QStringList values, QString nodeType, int depth)
-{
-qDebug() << "GReadIn::parseVPhysVol()";
-
-QString volId = values[0];
-QString logVolId = values[1];
-QString parentId = values[2];
-
-qDebug() << "\tPhysVol-ID:" << volId;
-qDebug() << "\tPhysVol-LogVol:" << logVolId;
-qDebug() << "\tPhysVol-parentId:" << parentId;
-qDebug() << "\tnodeType:" << nodeType;
-
-
-// GET LOGVOL
-// get logVol properties from the DB
-QStringList paramsLog = m_dbManager->getItem("GeoLogVol", logVolId.toUInt());
-qDebug() << "params:" << paramsLog;
-
-// build the LogVol
-GeoLogVol* logVol = parseLogVol(paramsLog);
-
-// a pointer to the VPhysVol
-GeoVPhysVol* vol = nullptr;
-
-// BUILD THE PHYSVOL OR THE FULLPHYSVOL
-if (nodeType == "GeoPhysVol")
-vol = new GeoPhysVol(logVol);
-else if (nodeType == "GeoFullPhysVol")
-vol = new GeoFullPhysVol(logVol);
-else
-qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
-
-
-// if we want to get the volume's children
-if (depth != 0) {
-
-// * check if the volume has children
-// get the IDs of all children of this PhysVol volume
-QMap<unsigned int, QStringList> children = m_dbManager->getVPhysVolChildren( volId.toUInt(), nodeType );
-qDebug() << "children of the " << nodeType << "node with Id:" << volId << " --> " << children;
-// if this PhysVol has children, build them and add them to it
-if (children.size() > 0)
-parseChildren(vol, children, depth);
-else
-qDebug() << "VPhysVol has no children";
-}
-
-return vol;
-}
-*/
-
-
-void GReadIn::checkInputString(QString input)
-{
-  if (input.isEmpty() || input.isNull() || input == "NULL") {
-    qWarning() << "ERROR!!! Input QString is empty or equal to 'NULL'!!! Aborting...";
-    exit(1);
-  }
-}
-
-// Instantiate a PhysVol and get its children
-GeoVPhysVol* GReadIn::buildVPhysVol(QString id, QString tableId, QString copyN)
-{
-  if (m_deepDebug) qDebug() << "GReadIn::buildVPhysVol()" << id << tableId << copyN;
-
-  checkInputString(id);
-  checkInputString(tableId);
-
-  // if previously built, return that
-  if (isNodeBuilt(id, tableId, copyN)) {
-    if (m_deepDebug) qDebug() << "getting the volume from memory...";
-    return dynamic_cast<GeoVPhysVol*>(getNode(id, tableId, copyN));
-  }
-
-  if (m_deepDebug) qDebug() << "building a new volume...";
-
-  // QString nodeType = m_dbManager->getNodeTypeFromTableId(tableId.toUInt());
-  QString nodeType = m_tableid_tableName[tableId.toUInt()];
-
-  // get the parent volume parameters
-  // here we do not need to use copyN, since the actual volume is the same for all instances
-  QStringList values;
-  if (nodeType == "GeoPhysVol")
-    values = m_physVols[id.toUInt()];
-  else if (nodeType == "GeoFullPhysVol")
-    values = m_fullPhysVols[id.toUInt()];
-
-
-
-  QString volId = values[0];
-  QString logVolId = values[1];
-  //QString parentId = values[2]; // FIXME: delete it, it is not used any more
-
-  if (m_deepDebug) {
-    qDebug() << "\tPhysVol-ID:" << volId;
-    qDebug() << "\tPhysVol-LogVol:" << logVolId;
-    //qDebug() << "\tPhysVol-parentId:" << parentId;
-    qDebug() << "\tnodeType:" << nodeType;
-  }
-
-  // GET LOGVOL
-  GeoLogVol* logVol = buildLogVol(logVolId);
-
-  // a pointer to the VPhysVol
-  GeoVPhysVol* vol = nullptr;
-
-  // BUILD THE PHYSVOL OR THE FULLPHYSVOL
-  if (nodeType == "GeoPhysVol")
-    vol = new GeoPhysVol(logVol);
-  else if (nodeType == "GeoFullPhysVol")
-    vol = new GeoFullPhysVol(logVol);
-  else
-    qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
-
-  // storing the address of the newly built node
-  storeNode(id, tableId, copyN, vol);
-
-  return vol;
-}
-
-
-// Get the root volume
-GeoPhysVol* GReadIn::getRootVolume()
-{
-  if (m_deepDebug) qDebug() << "GReadIn::getRootVolume()";
-  QString id = m_root_vol_data[1];
-  QString tableId = m_root_vol_data[2];
-  QString copyNumber = "1"; // the Root volume has only one copy by definition
-  return dynamic_cast<GeoPhysVol*>(buildVPhysVol(id, tableId, copyNumber));
-}
-
-
-
-/*
-  GeoMaterial* GReadIn::parseMaterial(QStringList values)
-  {
-  qDebug() << "GReadIn::parseMaterial()";
-
-  QString matId = values[0];
-  QString matName = values[1];
-
-  qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
-
-  // TODO: Bogus densities.  Later: read from database.
-  double densityOfAir=0.1;
-
-  return new GeoMaterial(matName.toStdString(),densityOfAir);
-
-  }
-*/
-
-
-GeoMaterial* GReadIn::buildMaterial(QString id)
-{
-  if (m_deepDebug) qDebug() << "GReadIn::buildMaterial()";
-  QStringList values = m_materials[id.toUInt()];
-
-  QString matId = values[0];
-  QString matName = values[1];
-
-  if (m_deepDebug) qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
-
-  // TODO: Bogus densities.  Later: read from database.
-  double densityOfAir=0.1;
-
-  return new GeoMaterial(matName.toStdString(),densityOfAir);
-
-}
-
-
-/*
-  GeoShape* GReadIn::parseShape(QStringList values)
-  {
-  qDebug() << "GReadIn::parseShape()";
-
-  QString id = values[0];
-  QString type = values[1];
-  QString parameters = values[2];
-
-  qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
-
-  if (type == "Box") {
-
-  // needed parameters
-  double XHalfLength;
-  double YHalfLength;
-  double ZHalfLength;
-
-  // get parameters from DB string
-  QStringList shapePars = parameters.split(";");
-  foreach( QString par, shapePars) {
-  QStringList vars = par.split("=");
-  QString varName = vars[0];
-  QString varValue = vars[1];
-
-  if (varName == "XHalfLength") XHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  if (varName == "YHalfLength") YHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  }
-
-  // return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
-  return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
-  }
-  else if (type == "Tube") {
-
-  // needed parameters
-  double RMin;
-  double RMax;
-  double ZHalfLength;
-
-  // get parameters from DB string
-  QStringList shapePars = parameters.split(";");
-  foreach( QString par, shapePars) {
-  QStringList vars = par.split("=");
-  QString varName = vars[0];
-  QString varValue = vars[1];
-
-  if (varName == "RMin") RMin = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  if (varName == "RMax") RMax = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-  }
-
-  // return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
-  return new GeoTube(RMin, RMax, ZHalfLength);
-
-  }
-  else if (type == "Shift") {
-
-  // needed parameters
-  unsigned int shapeId;
-  unsigned int transfId;
-
-  // get parameters from DB string
-  QStringList shapePars = parameters.split(";");
-  foreach( QString par, shapePars) {
-  QStringList vars = par.split("=");
-  QString varName = vars[0];
-  QString varValue = vars[1];
-
-  if (varName == "A") shapeId = varValue.toUInt();
-  if (varName == "X") transfId = varValue.toUInt();
-  }
-
-  // get the referenced shape
-  const GeoShape* shapeA = getShape( QString::number(shapeId) );
-
-  // get the referenced HepGeom::Transform3D
-  QStringList transPars = m_dbManager->getItemFromTableName("Transforms", transfId);
-  qDebug() << "child:" << transPars;
-  GeoTransform* transf = parseTransform(transPars);
-  const HepGeom::Transform3D transfX = transf->getTransform();
-
-  // build and return the GeoShapeShift instance
-  return new GeoShapeShift(shapeA, transfX);
-  }
-  else if (type == "Pcon") {
-
-  // needed parameters
-  unsigned int SPhi;
-  unsigned int DPhi;
-
-  // get parameters from DB string
-  QStringList shapePars = parameters.split(";");
-  foreach( QString par, shapePars) {
-  QStringList vars = par.split("=");
-  QString varName = vars[0];
-  QString varValue = vars[1];
-
-  if (varName == "SPhi") SPhi = varValue.toUInt();
-  if (varName == "DPhi") DPhi = varValue.toUInt();
-  }
-
-  // return new shape
-  return new GeoPcon(SPhi, DPhi);
-  }
-  else {
-  QString msg = "WARNING!! - Shape '" + type + "' not implemented yet!!! Returning a dummy cube.";
-  qWarning() << msg;
-  return new GeoBox(30.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm); // FIXME: bogus shape. Use actual shape!
-  }
-
-  }
-*/
-
-GeoShape* GReadIn::buildShape(QString shapeId)
-{
-  if (m_deepDebug) qDebug() << "GReadIn::buildShape()";
-  QStringList paramsShape = m_shapes[ shapeId.toUInt() ];
-
-  QString id = paramsShape[0];
-  QString type = paramsShape[1];
-  QString parameters = paramsShape[2];
-
-  if (m_deepDebug) qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
-
-  if (type == "Box") {
-    // shape parameters
-    double XHalfLength = 0.;
-    double YHalfLength = 0.;
-    double ZHalfLength = 0.;
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-    foreach( QString par, shapePars) {
-      QStringList vars = par.split("=");
-      QString varName = vars[0];
-      QString varValue = vars[1];
-      if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-    }
-    return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
-  }
-  else if (type == "Cons") {
-    // shape parameters
-    double RMin1 = 0.;
-    double RMin2 = 0.;
-    double RMax1 = 0.;
-    double RMax2 = 0.;
-    double DZ = 0.;
-    double SPhi = 0.;
-    double DPhi = 0.;
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-    foreach( QString par, shapePars) {
-      QStringList vars = par.split("=");
-      QString varName = vars[0];
-      QString varValue = vars[1];
-      if (varName == "RMin1") RMin1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "RMin2") RMin2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "RMax1") RMax1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "RMax2") RMax2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "DZ") DZ = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "SPhi") SPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "SPDPhihi") DPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-    }
-    return new GeoCons (RMin1, RMin2, RMax1, RMax2, DZ, SPhi, DPhi);
-  }
-  else if (type == "Para") {
-    // shape parameters
-    double XHalfLength = 0.;
-    double YHalfLength = 0.;
-    double ZHalfLength = 0.;
-    double Alpha = 0.;
-    double Theta = 0.;
-    double Phi = 0.;
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-    foreach( QString par, shapePars) {
-      QStringList vars = par.split("=");
-      QString varName = vars[0];
-      QString varValue = vars[1];
-      if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "Alpha") Alpha = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "Theta") Theta = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-      if (varName == "Phi") Phi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-    }
-    return new GeoPara (XHalfLength, YHalfLength, ZHalfLength, Alpha, Theta, Phi);
-  }
-  else if (type == "Pcon") {
-    // shape parameters
-    double SPhi = 0.;
-    double DPhi = 0.;
-    unsigned int NZPlanes = 0;
-
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-
-    bool error = 0;
-    QString par;
-    QStringList vars;
-    QString varName;
-    QString varValue;
-
-    GeoPcon* pcon = nullptr;
-
-    int sizePars = shapePars.size();
-    // check if we have more than 3 parameters
-    if (sizePars > 3) {
-
-      // get the three first GeoPcon parameters: the SPhi and DPhi angles, plus the number of Z planes
-      for( int it=0; it < 3; it++) {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        if (varName == "SPhi") SPhi = varValue.toDouble();
-        if (varName == "DPhi") DPhi = varValue.toDouble();
-        if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
-      }
-      // build the basic GeoPcon shape
-      pcon = new GeoPcon(SPhi, DPhi);
-
-      // and now loop over the rest of the list, to get the parameters of all Z planes
-      for (int it=3; it < sizePars; it++)
-      {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        // qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
-
-        if (varName == "ZPos") {
-
-          double zpos = varValue.toDouble();
-          double rmin=0., rmax=0.;
-
-          it++; // go to next variable
-
-          par = shapePars[it];
-          vars = par.split("=");
-          varName = vars[0];
-          varValue = vars[1];
-          if (varName == "ZRmin") rmin = varValue.toDouble();
-          else error = 1;
-          it++; // go to next variable
-
-          par = shapePars[it];
-          vars = par.split("=");
-          varName = vars[0];
-          varValue = vars[1];
-          if (varName == "ZRmax") rmax = varValue.toDouble();
-          else error = 1;
-
-          if(error) qWarning() << "ERROR! GeoPcon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
-
-          // add a Z plane to the GeoPcon
-          pcon->addPlane(zpos, rmin, rmax);
-        } else {
-          error = 1;
-          qWarning() << "ERROR! GeoPcon 'ZPos' value is not at the right place! --> " << shapePars;
-        }
-      }
-
-      // sanity check on the resulting Pcon shape
-      if( pcon->getNPlanes() != NZPlanes) {
-        error = 1;
-        qWarning() << "ERROR! GeoPcon number of planes: " << QString::number(pcon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
-      }
-      if(!pcon->isValid()) {
-        error = 1;
-        qWarning() << "ERROR! GeoPcon shape is not valid!! -- input: " << shapePars;
-      }
-    } // end if (size>3)
-    else {
-      qWarning() << "ERROR!! GeoPcon has no Z planes!! --> shape input parameters: " << shapePars;
-      error = 1;
-    }
-
-    if(error) qFatal("GeoPcon shape error!!! Aborting...");
-
-    return pcon;
-  }
-  else if (type == "Pgon") {
-    // shape parameters
-    double SPhi = 0.;
-    double DPhi = 0.;
-    unsigned int NSides = 0;
-    unsigned int NZPlanes = 0;
-
-    bool error = false;
-    GeoPgon* pgon = nullptr;
-    QString par;
-    QStringList vars;
-    QString varName;
-    QString varValue;
-
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-    // qInfo() << "shapePars: " << shapePars; // debug
-
-    int sizePars = shapePars.size();
-    // check if we have more than 3 parameters
-    if (sizePars > 3) {
-
-      // get the first four GeoPgon parameters: the SPhi and DPhi angles, plus the number of Z planes
-      for( int it=0; it < 4; it++) {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        // qInfo() << "vars: " << vars; // for debug only
-        if (varName == "SPhi") SPhi = varValue.toDouble();
-        if (varName == "DPhi") DPhi = varValue.toDouble();
-        if (varName == "NSides") NSides = varValue.toUInt();// * SYSTEM_OF_UNITS::mm;
-        if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
-
-      }
-      // build the basic GeoPgon shape
-      pgon = new GeoPgon(SPhi, DPhi, NSides);
-
-      // and now loop over the rest of the list, to get the parameters of all Z planes
-      for (int it=4; it < sizePars; it++)
-      {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        // qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
-
-        if (varName == "ZPos") {
-
-          double zpos = varValue.toDouble();
-          double rmin=0., rmax=0.;
-
-          it++; // go to next variable
-
-          par = shapePars[it];
-          vars = par.split("=");
-          varName = vars[0];
-          varValue = vars[1];
-          if (varName == "ZRmin") rmin = varValue.toDouble();
-          else error = 1;
-          it++; // go to next variable
-
-          par = shapePars[it];
-          vars = par.split("=");
-          varName = vars[0];
-          varValue = vars[1];
-          if (varName == "ZRmax") rmax = varValue.toDouble();
-          else error = 1;
-
-          if(error) qWarning() << "ERROR! GeoPgon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
-
-          // add a Z plane to the GeoPgon
-          pgon->addPlane(zpos, rmin, rmax);
-        } else {
-          error = 1;
-          qWarning() << "ERROR! GeoPgon 'ZPos' value is not at the right place! --> " << shapePars;
-        }
-      }
-
-      // sanity check on the resulting Pgon shape
-      if( pgon->getNPlanes() != NZPlanes) {
-        error = 1;
-        qWarning() << "ERROR! GeoPgon number of planes: " << QString::number(pgon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
-      }
-      if(!pgon->isValid()) {
-        error = 1;
-        qWarning() << "ERROR! GeoPgon shape is not valid!! -- input: " << shapePars;
-      }
-    } // end if (size>3)
-    else {
-      qWarning() << "ERROR!! GeoPgon has no Z planes!! --> shape input parameters: " << shapePars;
-      error = 1;
-    }
-    if(error) qFatal("GeoPgon shape error!!! Aborting...");
-    return pgon;
-  }
-  else if (type == "SimplePolygonBrep")
-  {
-    //qInfo() << "Reading-in: SimplePolygonBrep: "; // debug
-    // shape parameters
-    double DZ = 0.;
-    unsigned int NVertices = 0;
-    double xV = 0.;
-    double yV = 0.;
-
-    bool error = 0;
-    GeoSimplePolygonBrep* sh = nullptr;
-    QString par;
-    QStringList vars;
-    QString varName;
-    QString varValue;
-
-    // get parameters from DB string
-    QStringList shapePars = parameters.split(";");
-    //qInfo() << "shapePars: " << shapePars; // debug
-
-    int sizePars = shapePars.size();
-    // check if we have more than 2 parameters
-    if (sizePars > 2) {
-
-      // get the first two GeoSimplePolygonBrep parameters: DZ and the number of vertices.
-      for( int it=0; it < 2; it++) {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        // qInfo() << "vars: " << vars; // for debug only
-        if (varName == "DZ") DZ = varValue.toDouble();
-        if (varName == "NVertices") NVertices = varValue.toDouble();
-        //else if (varName == "NVertices") NVertices = varValue.toDouble();
-        //else error = 1;
-        //if(error) qWarning() << "ERROR! GeoSimplePolygonBrep parameters are not correctly stored! -->" << vars;
-
-      }
-      // build the basic GeoSimplePolygonBrep shape
-      sh = new GeoSimplePolygonBrep(DZ);
-
-      // and now loop over the rest of the list, to get the parameters of all vertices
-      for (int it=2; it < sizePars; it++)
-      {
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        if (varName == "xV") xV = varValue.toDouble();
-        else error = 1;
-
-        it++; // go to next variable (they come in pairs)
-
-        par = shapePars[it];
-        vars = par.split("=");
-        varName = vars[0];
-        varValue = vars[1];
-        if (varName == "yV") yV = varValue.toDouble();
-        else error = 1;
-
-        if(error) qWarning() << "ERROR! GeoSimplePolygonBrep 'xVertex' and 'yVertex' values are not at the right place! --> " << shapePars;
-
-        // add a Z plane to the GeoSimplePolygonBrep
-        sh->addVertex(xV, yV);
-      }
-      // sanity check on the resulting shape
-      if( sh->getNVertices() != NVertices) {
-        error = 1;
-        qWarning() << "ERROR! GeoSimplePolygonBrep number of planes: " << QString::number(sh->getNVertices()) << " is not equal to the original size! --> " << shapePars;
-      }
-      if(!sh->isValid()) {
-        error = 1;
-qWarning() << "ERROR! GeoSimplePolygonBrep shape is not valid!! -- input: " << shapePars;
-			}
-		} // end if (size>3)
-		else {
-			qWarning() << "ERROR!! GeoSimplePolygonBrep has no vertices!! --> shape input parameters: " << shapePars;
-			error = 1;
-		}
-		if(error) qFatal("GeoSimplePolygonBrep shape error!!! Aborting...");
-		return sh;
-
-	}
-	else if (type == "Trap") {
-			// shape constructor parameters
-			double ZHalfLength = 0.;
-			double Theta = 0.;
-			double Phi = 0.;
-			double Dydzn = 0.;
-			double Dxdyndzn = 0.;
-			double Dxdypdzn = 0.;
-			double Angleydzn = 0.;
-			double Dydzp = 0.;
-			double Dxdyndzp = 0.;
-			double Dxdypdzp = 0.;
-			double Angleydzp = 0.;
-			// get parameters from DB string
-			QStringList shapePars = parameters.split(";");
-			foreach( QString par, shapePars) {
-					QStringList vars = par.split("=");
-					QString varName = vars[0];
-					QString varValue = vars[1];
-					if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Theta") Theta = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Phi") Phi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dydzn") Dydzn = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dxdyndzn") Dxdyndzn = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dxdypdzn") Dxdypdzn = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Angleydzn") Angleydzn = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dydzp") Dydzp = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dxdyndzp") Dxdyndzp = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Dxdypdzp") Dxdypdzp = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "Angleydzp") Angleydzp = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			}
-		return new GeoTrap (ZHalfLength, Theta, Phi, Dydzn, Dxdyndzn, Dxdypdzn, Angleydzn, Dydzp, Dxdyndzp, Dxdypdzp, Angleydzp);
-	}
-	else if (type == "Trd") {
-			// shape constructor parameters
-			double XHalfLength1 = 0.;
-			double XHalfLength2 = 0.;
-			double YHalfLength1 = 0.;
-			double YHalfLength2 = 0.;
-			double ZHalfLength = 0.;
-			// get parameters from DB string
-			QStringList shapePars = parameters.split(";");
-			foreach( QString par, shapePars) {
-					QStringList vars = par.split("=");
-					QString varName = vars[0];
-					QString varValue = vars[1];
-					if (varName == "XHalfLength1") XHalfLength1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "XHalfLength2") XHalfLength2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "YHalfLength1") YHalfLength1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "YHalfLength2") YHalfLength2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			}
-		return new GeoTrd (XHalfLength1, XHalfLength2, YHalfLength1, YHalfLength2, ZHalfLength);
-	}
-	else if (type == "Tube") {
-		// shape parameters
-		double RMin = 0.;
-		double RMax = 0.;
-		double ZHalfLength = 0.;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "RMin") RMin = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMax") RMax = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-		}
-		return new GeoTube(RMin, RMax, ZHalfLength);
-	}
-	else if (type == "Tubs") {
-		// shape parameters
-		double RMin = 0.;
-		double RMax = 0.;
-		double ZHalfLength = 0.;
-		double SPhi = 0.;
-		double DPhi = 0.;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "RMin") RMin = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMax") RMax = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "SPhi") SPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "DPhi") DPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-		}
-		return new GeoTubs (RMin, RMax, ZHalfLength, SPhi, DPhi);
-	}
-	else if (type == "Intersection") {
-		// shape parameters
-		unsigned int opA = 0;
-		unsigned int opB = 0;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "opA") opA = varValue.toUInt();
-			if (varName == "opB") opB = varValue.toUInt();
-		}
-		// get the referenced shape
-		const GeoShape* shapeA = buildShape( QString::number(opA) );
-		const GeoShape* shapeB = buildShape( QString::number(opB) );
-		// build and return the GeoShapeShift instance
-		return new GeoShapeIntersection(shapeA, shapeB);
-	}
-	else if (type == "Shift") {
-		// shape parameters
-		unsigned int shapeId = 0;
-		unsigned int transfId = 0;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "A") shapeId = varValue.toUInt();
-			if (varName == "X") transfId = varValue.toUInt();
-		}
-		// get the referenced shape
-		// const GeoShape* shapeA = getShape( QString::number(shapeId) );
-		const GeoShape* shapeA = buildShape( QString::number(shapeId) );
-		// get the referenced HepGeom::Transform3D
-		QStringList transPars = m_dbManager->getItemFromTableName("Transforms", transfId);
-		if (m_deepDebug) qDebug() << "child:" << transPars;
-		GeoTransform* transf = parseTransform(transPars);
-		const GeoTrf::Transform3D transfX = transf->getTransform();
-		// build and return the GeoShapeShift instance
-		return new GeoShapeShift(shapeA, transfX);
-	}
-	else if (type == "Subtraction") {
-		// shape parameters
-		unsigned int opA = 0;
-		unsigned int opB = 0;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "opA") opA = varValue.toUInt();
-			if (varName == "opB") opB = varValue.toUInt();
-		}
-		// get the referenced shape
-
-		//if (VP1Msg::debug())
-    		//VP1Msg::messageDebug("GeoSubstraction - building shape A...\n");
-
-		const GeoShape* shapeA = buildShape( QString::number(opA) );
-
-		/*
-		if (VP1Msg::debug()) {
-			QString msg = QString::fromStdString(shapeA->type());
-    			VP1Msg::messageDebug("GeoSubstraction - built shape A: "+msg);
-    			VP1Msg::messageDebug("GeoSubstraction - building shape B...\n");
-    		}
-		*/
-
-		const GeoShape* shapeB = buildShape( QString::number(opB) );
-
-		/*
-		if (VP1Msg::debug()) {
-			QString msg = QString::fromStdString(shapeB->type());
-    			VP1Msg::messageDebug("GeoSubstraction - built shape B: "+msg+"\n");
-    		}
-		*/
-
-		// build and return the GeoShapeShift instance
-		return new GeoShapeSubtraction(shapeA, shapeB);
-	}
-	else if (type == "Union") {
-		// shape parameters
-		unsigned int opA = 0;
-		unsigned int opB = 0;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "opA") opA = varValue.toUInt();
-			if (varName == "opB") opB = varValue.toUInt();
-		}
-		if (opA == 0 || opB == 0) std::cout << "ERROR! 'GeoUnion' shape: opA or opB have not been properly intialized!" << std::endl;
-		// get the referenced shape
-		const GeoShape* shapeA = buildShape( QString::number(opA) );
-		const GeoShape* shapeB = buildShape( QString::number(opB) );
-		// build and return the GeoShapeShift instance
-		return new GeoShapeUnion(shapeA, shapeB);
-	}
-	else {
-		// QString msg = "WARNING!! - Shape '" + type + "' not implemented yet!!! Returning a dummy cube.";
-		// qWarning(msg.toStdString().c_str());
-		m_unknown_shapes.insert(type.toStdString()); // save unknwon shapes for later warning message
-		return new GeoBox(30.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm); // FIXME: bogus shape. Use actual shape!
-	}
-
-}
-
-
-
-/*
-GeoLogVol* GReadIn::parseLogVol(QStringList values)
-{
-	qDebug() << "GReadIn::parseLogVol()";
-
-	QString logVolName = values[1];
-
-	// GET LOGVOL SHAPE
-	QString shapeId = values[2];
-
-	// qDebug() << "shape Id:" << shapeId;
-	// QStringList paramsShape = m_dbManager->getItem("GeoShape", shapeId.toUInt());
-  // qDebug() << "shape parameters from DB: " << paramsShape;
-	// GeoShape* shape = parseShape(paramsShape);
-
-	GeoShape* shape = getShape(shapeId);
-
-	// GET LOGVOL MATERIAL
-	QString matId = values[3];
-	QStringList paramsMat = m_materials[ matId.toUInt() ];
-	GeoMaterial* mat = parseMaterial(paramsMat);
-
-	// instantiate teh GeoLogVol
-	return new GeoLogVol(logVolName.toStdString(), shape, mat);
-
-}
-*/
-
-
-GeoLogVol* GReadIn::buildLogVol(QString logVolId)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildLogVol()";
-
-	// get logVol properties from the DB
-	QStringList values = m_logVols[logVolId.toUInt()];
-	if (m_deepDebug) qDebug() << "params:" << values;
-
-	// build the LogVol
-	QString logVolName = values[1];
-
-	// GET LOGVOL SHAPE
-	QString shapeId = values[2];
-	GeoShape* shape = buildShape(shapeId);
-
-	// GET LOGVOL MATERIAL
-	QString matId = values[3];
-	if (m_deepDebug) qDebug() << "material Id:" << matId;
-	GeoMaterial* mat = buildMaterial(matId);
-
-	return new GeoLogVol(logVolName.toStdString(), shape, mat);
-
-}
-
-/*
-GeoShape* GReadIn::getShape(QString shapeId){
-	qDebug() << "shape Id:" << shapeId;
-	QStringList paramsShape = m_dbManager->getItem("GeoShape", shapeId.toUInt());
-	qDebug() << "shape parameters from DB: " << paramsShape;
-	GeoShape* shape = parseShape(paramsShape);
-	return shape;
-}
-*/
-
-
-GeoSerialDenominator* GReadIn::buildSerialDenominator(QString id)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildSerialDenominator()";
-	return parseSerialDenominator( m_serialDenominators[id.toUInt()] );
-}
-
-GeoSerialDenominator* GReadIn::parseSerialDenominator(QStringList values)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::parseSerialDenominator()";
-	QString id = values[0];
-	QString baseName = values[1];
-	if (m_deepDebug) qDebug() << "\tID:" << id << ", base-name:" << baseName;
-	return new GeoSerialDenominator(baseName.toStdString());
-}
-
-GeoAlignableTransform* GReadIn::buildAlignableTransform(QString id)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildAlignableTransform()";
-	return parseAlignableTransform( m_alignableTransforms[id.toUInt()] );
-}
-
-GeoAlignableTransform* GReadIn::parseAlignableTransform(QStringList values)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::parseAlignableTransform()";
-
-	QString id = values.takeFirst(); // it pops out the first element, leaving the other items in the list
-
-	// get the 12 matrix elements
-	double xx = values[0].toDouble();
-	double xy = values[1].toDouble();
-	double xz = values[2].toDouble();
-
-	double yx = values[3].toDouble();
-	double yy = values[4].toDouble();
-	double yz = values[5].toDouble();
-
-	double zx = values[6].toDouble();
-	double zy = values[7].toDouble();
-	double zz = values[8].toDouble();
-
-	double dx = values[9].toDouble();
-	double dy = values[10].toDouble();
-	double dz = values[11].toDouble();
-
-	// TODO: move to GeoModelKernel::GeoTrf (Eigen)
-	// build a rotation matrix with the first 9 elements
-	CLHEP::HepRotation R;
-	R.set(CLHEP::Hep3Vector(xx,yx,zx),
-			CLHEP::Hep3Vector(xy,yy,zy),
-			CLHEP::Hep3Vector(xz,yz,zz));
-	// build a translation vector with the last 3 elements
-	CLHEP::Hep3Vector D(dx,dy,dz);
-	// build the Transformation
-	const HepGeom::Transform3D xf(R, D);
-
-	return new GeoAlignableTransform( Amg::CLHEPTransformToEigen(xf) );
-}
-
-GeoTransform* GReadIn::buildTransform(QString id)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildTransform()";
-	return parseTransform( m_transforms[id.toUInt()] );
-}
-
-GeoTransform* GReadIn::parseTransform(QStringList values)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::parseTransform()";
-	if (m_deepDebug) qDebug() << "values:" << values;
-
-	QString id = values.takeFirst(); // it pops out the first element, leaving the other items in the list
-
-	// get the 12 matrix elements
-	double xx = values[0].toDouble();
-	double xy = values[1].toDouble();
-	double xz = values[2].toDouble();
-
-	double yx = values[3].toDouble();
-	double yy = values[4].toDouble();
-	double yz = values[5].toDouble();
-
-	double zx = values[6].toDouble();
-	double zy = values[7].toDouble();
-	double zz = values[8].toDouble();
-
-	double dx = values[9].toDouble();
-	double dy = values[10].toDouble();
-	double dz = values[11].toDouble();
-
-	// build a rotation matrix with the first 9 elements
-	// TODO: move to GeoModelKernel GeoTrf (Eigen)
-	CLHEP::HepRotation R;
-	R.set(CLHEP::Hep3Vector(xx,yx,zx),
-			CLHEP::Hep3Vector(xy,yy,zy),
-			CLHEP::Hep3Vector(xz,yz,zz));
-	// build a translation vector with the last 3 elements
-	CLHEP::Hep3Vector D(dx,dy,dz);
-	// build the Transformation
-	const HepGeom::Transform3D xf(R, D);
-
-	return new GeoTransform( Amg::CLHEPTransformToEigen(xf) );
-}
-
-/*
-GeoSerialTransformer* GReadIn::parseSerialTransformer(QStringList values)
-{
-	qDebug() << "GReadIn::parseSerialTransformer()";
-	qDebug() << "values:" << values;
-
-	QString id = values[0];
-	QString functionId = values[1];
-	QString physVolId = values[2];
-	QString physVolTableIdStr = values[3];
-	QString copies = values[4];
-
-	unsigned int physVolTableId = physVolTableIdStr.toUInt();
-
-	// QString physVolType = m_dbManager->getNodeTypeFromTableId(physVolTableId);
-	QString physVolType = m_tableid_tableName[physVolTableId];
-
-	qDebug() << "\tID:" << id << ", functionId:" << functionId << ", physVolId:" << physVolId << ", physVolTableId:" << physVolTableId << ", copies:" << copies;
-
-	// GET FUNCTION
-	qDebug() << "function Id:" << functionId;
-	QStringList paramsFunc = m_dbManager->getItem("Function", functionId.toUInt());
-	// TRANSFUNCTION func = parseFunction(paramsFunc);
-	TRANSFUNCTION func = parseFunction(paramsFunc[1].toStdString());
-
-	// GET PHYSVOL
-	qDebug() << "referenced physVol - Id:" << physVolId << ", type:" << physVolType;
-	QStringList paramsPhysVol = m_dbManager->getItem(physVolTableId, physVolId.toUInt());
-	const GeoVPhysVol* physVol = parseVPhysVol(paramsPhysVol, physVolType);
-	//qDebug() << "physVol:" << physVol << ", function:" << &func;
-
-	// get PhysVol or FullPhysVol pointer and return the SerialTransformer
-	if (dynamic_cast<const GeoFullPhysVol*>(physVol)) {
-		const GeoFullPhysVol* vol = dynamic_cast<const GeoFullPhysVol*>(physVol);
-		return new GeoSerialTransformer(vol, &func, copies.toUInt() );
-	}
-	const GeoPhysVol* vol = dynamic_cast<const GeoPhysVol*>(physVol);
-	return new GeoSerialTransformer(vol, &func, copies.toUInt() );
-
-}
-*/
-
-GeoSerialTransformer* GReadIn::buildSerialTransformer(QString nodeId)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildSerialTransformer()";
-
-	QStringList values = m_serialTransformers[nodeId.toUInt()];
-	if (m_deepDebug) qDebug() << "values:" << values;
-
-	// std::cout <<"ST * " << values[0].toStdString() << " " << values[1].toStdString() << " " << values[2].toStdString() << std::endl;
-	if (m_deepDebug) qDebug() << "ST * " << values[0] << ", " << values[1] << ", " << values[2] << ", " << values[3] << ", " << values[4];
-
-	QString id = values[0];
-	QString functionId = values[1];
-	QString physVolId = values[2];
-	QString physVolTableIdStr = values[3];
-	QString copies = values[4];
-
-	unsigned int physVolTableId = physVolTableIdStr.toUInt();
-
-	QString physVolType = m_tableid_tableName[physVolTableId];
-
-	if (m_deepDebug) qDebug() << "\tID:" << id << ", functionId:" << functionId << ", physVolId:" << physVolId << ", physVolTableId:" << physVolTableId << ", copies:" << copies;
-
-	// GET FUNCTION
-	if (m_deepDebug) qDebug() << "function Id:" << functionId;
-	TRANSFUNCTION func = buildFunction(functionId);
-
-	// GET PHYSVOL
-	if (m_deepDebug) qDebug() << "referenced physVol - Id:" << physVolId << ", type:" << physVolType << "tableId:" << physVolTableIdStr;
-	const GeoVPhysVol* physVol = buildVPhysVol(physVolId, physVolTableIdStr, "1"); // we use "1" as default copyNumber: taking the first copy of the VPhysVol as the referenced volume
-	//qDebug() << "physVol:" << physVol << ", function:" << &func;
-
-	// get PhysVol or FullPhysVol pointer and return the SerialTransformer
-	if (dynamic_cast<const GeoFullPhysVol*>(physVol)) {
-		const GeoFullPhysVol* vol = dynamic_cast<const GeoFullPhysVol*>(physVol);
-		return new GeoSerialTransformer(vol, &func, copies.toUInt() );
-	}
-	const GeoPhysVol* vol = dynamic_cast<const GeoPhysVol*>(physVol);
-	return new GeoSerialTransformer(vol, &func, copies.toUInt() );
-
-}
-
-TRANSFUNCTION GReadIn::buildFunction(QString id)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildFunction()";
-
-	// return parseFunction( m_functions[id.toUInt()] );
-
-	// return parseFunction( m_functions[id.toUInt()] );
-
-	QStringList values = m_functions[id.toUInt()];
-	// return parseFunction( values[0].toUInt(), values[1].toStdString() );
-	return parseFunction( values[1].toStdString() );
-
-
-}
-
-// TRANSFUNCTION GReadIn::parseFunction(QStringList values)
-// {
-// 	qDebug() << "GReadIn::parseFunction()";
-// 	qDebug() << "values:" << values;
-// 	QString id = values[0];
-// 	QString expression = values[1];
-// 	if (expression.size() == 0) {
-// 			qFatal("FATAL ERROR!! Function expression is empty!! Aborting...");
-// 			abort();
-// 	}
-// 	TransFunctionInterpreter interpreter;
-// 	qDebug() << "expression:" << expression;
-// 	TFPTR func=interpreter.interpret( expression.toStdString() );
-// 	qDebug() << "expression interpreted";
-// 	return *(func.release()); // make func returns a pointer to the managed object and releases the ownership, then get the object dereferencing the pointer
-// }
-
-
-// TRANSFUNCTION GReadIn::parseFunction(const QStringList& values)
-// {
-// 	qDebug() << "GReadIn::parseFunction(const QStringList& values)";
-// 	qDebug() << "values:" << values;
-// 	int id = values[0].toUInt();
-// 	std::string expression = values[1].toStdString();
-// 	if (expression.size() == 0) {
-// 			qFatal("FATAL ERROR!! Function expression is empty!! Aborting...");
-// 			abort();
-// 	}
-// 	TransFunctionInterpreter interpreter;
-// 	qDebug() << "expression:" << expression;
-// 	TFPTR func=interpreter.interpret( expression );
-// 	qDebug() << "expression interpreted";
-// 	return *(func.release()); // make func returns a pointer to the managed object and releases the ownership, then get the object dereferencing the pointer
-// }
-
-
-// TRANSFUNCTION GReadIn::parseFunction(const int& id, const std::string& expr)
-TRANSFUNCTION GReadIn::parseFunction(const std::string& expr)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::parseFunction(const std::string& expr)";
-	// qDebug() << "id:" << Qstring::number(id) << " - expression: " << QString::fromStdString(expr);
-	if (m_deepDebug) qDebug() << "expression: " << QString::fromStdString(expr);
-
-	if (expr.empty()) {
-			qFatal("FATAL ERROR!! Function expression is empty!! Aborting...");
-			abort();
-	}
-
-	TransFunctionInterpreter interpreter;
-	if (m_deepDebug) qDebug() << "expression:" << QString::fromStdString(expr);
-	TFPTR func=interpreter.interpret( expr );
-	if (m_deepDebug) qDebug() << "expression interpreted";
-	return *(func.release()); // make func returns a pointer to the managed object and releases the ownership, then get the object dereferencing the pointer
-}
-
-GeoNameTag* GReadIn::buildNameTag(QString id)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::buildNameTag()";
-	return parseNameTag( m_nameTags[id.toUInt()] );
-}
-
-GeoNameTag* GReadIn::parseNameTag(QStringList values)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::parseNameTag()";
-	QString id = values[0];
-	QString name = values[1];
-	if (m_deepDebug) qDebug() << "nameTag:" << name;
-	return new GeoNameTag(name.toStdString());
-}
-
-
-bool GReadIn::isNodeBuilt(const QString id, const QString tableId, const QString copyNumber)
-{
-	// qDebug() << "GReadIn::isNodeBuilt(): " << id << tableId << copyNumber;
-	QString key = id + ":" + tableId + ":" + copyNumber;
-	return m_memMap.contains(key);
-}
-
-
-GeoGraphNode* GReadIn::getNode(const QString id, const QString tableId, const QString copyN)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::getNode(): " << id << tableId << copyN;
-	QString key = id + ":" + tableId + ":" + copyN;
-	return m_memMap[key];
-}
-
-void GReadIn::storeNode(const QString id, const QString tableId, const QString copyN, GeoGraphNode* node)
-{
-	if (m_deepDebug) qDebug() << "GReadIn::storeNode(): " << id << tableId << copyN << node;
-	QString key = id + ":" + tableId + ":" + copyN;
-	m_memMap[key] = node;
-}
-
-
-} /* namespace GeoModelPers */
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/CMakeLists.txt
deleted file mode 100644
index c9908b187618..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-################################################################################
-# Package: GeoWrite
-################################################################################
-
-# Declare the package name:
-atlas_subdir( GeoWrite )
-
-# Declare the package's dependencies:
-# TODO: we can skip the dependency on GeoPrimitives when we convert all methods to Eigen (GeoTrf::Transform3D)
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoPrimitives
-                          )
-
-# External dependencies:
-find_package( Qt5 COMPONENTS Core ) # needed for Qt containers
-find_package( CLHEP )  # to be dropped when migrated to new Eigen-based GeoTrf
-find_package( Eigen )
-find_package( GeoModelCore )
-
-
-if(CMAKE_BUILD_TYPE MATCHES Release)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment if you need debug messages in Release build
-endif(CMAKE_BUILD_TYPE MATCHES Release)
-if(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment if you need debug messages in RelWithDebInfo build
-endif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-    add_definitions(-DQT_NO_DEBUG_OUTPUT) # comment if you need debug messages in Debug build
-endif(CMAKE_BUILD_TYPE MATCHES Debug)
-
-# Component(s) in the package:
-atlas_add_library( GeoWrite
-                   src/*.cpp
-                   PUBLIC_HEADERS GeoWrite
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} Qt5::Core ${GEOMODELCORE_LIBRARIES} GeoModelDBManager TFPersistification VP1Base )
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelAction.h.oldVersion b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelAction.h.oldVersion
deleted file mode 100644
index a0f2b3da9d24..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelAction.h.oldVersion
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef DumpGeoModelAction_H
-#define DumpGeoModelAction_H
-
-// local includes
-
-
-#include "GeoModelDBManager/GMDBManager.h"
-
-// GeoModel includes
-#include "GeoModelKernel/GeoNodeAction.h"
-#include "GeoModelKernel/GeoGraphNode.h"
-#include "GeoModelKernel/GeoShape.h"
-#include "GeoModelKernel/GeoMaterial.h"
-#include "GeoModelKernel/GeoLogVol.h"
-#include "GeoModelKernel/GeoXF.h"
-#include "GeoModelKernel/GeoAlignableTransform.h"
-
-// Qt includes
-//#include <QSqlDatabase>
-#include <QStringList>
-#include <QVariant>
-#include <QString>
-#include <QMap>
-
-/**
- * \class DumpGeoModelAction
- *
- * DumpGeoModelAction acts on objects of the GeoModel tree
- * persitifying them offline.
- */
-class DumpGeoModelAction  : public GeoNodeAction
-{
-public:
-	/**
-	 * @brief Constructor
-	 *
-	 * Constructor sets up connection with db and opens it
-	 * @param path - absolute path to db file
-	 */
-	DumpGeoModelAction(GMDBManager& db);
-
-	/**
-	 * @brief Destructor
-	 */
-	~DumpGeoModelAction();
-
-	virtual void handlePhysVol (const GeoPhysVol *vol); //	Handles a physical volume.
-	virtual void handleFullPhysVol (const GeoFullPhysVol *vol);
-	virtual void handleSerialDenominator (const GeoSerialDenominator *sD); //	Handles a Serial Denominator.
-	virtual void handleSerialTransformer (const GeoSerialTransformer *obj);
-	virtual void handleTransform (const GeoTransform *);
-	virtual void handleNameTag (const GeoNameTag *);
-
-
-
-private:
-
-	// define copy constructor, needed for the GeoModelAction subclass
-	DumpGeoModelAction(const DumpGeoModelAction &right);
-
-	// define assignment operator, needed for the GeoModelAction subclass
-	DumpGeoModelAction & operator=(const DumpGeoModelAction &right);
-
-	void handleVPhysVolObjects(const GeoVPhysVol* vol);
-	void handleReferencedPhysVol (const GeoVPhysVol *vol); // Handles a physical volume referenced by a SerialTrasformer
-
-	void showMemoryMap();
-
-	//	bool isObjectStored(const GeoLogVol* pointer);
-	//	bool isObjectStored(const GeoMaterial* pointer);
-	//	bool isObjectStored(const GeoGraphNode* pointer);
-	//	bool isObjectStored(const GeoShape* pointer);
-
-	QVariant storeShape(const GeoShape* shape);
-	QVariant storeTranform(const GeoTransform* node);
-
-	QVariant storeObj(const GeoMaterial* pointer, const QString name);
-	QVariant storeObj(const GeoShape* pointer, const QString type, const QString parameters);
-	QVariant storeObj(const GeoLogVol* pointer, const QString name, const QVariant shapeId, const QVariant materialId);
-	QVariant storeObj(const GeoPhysVol* pointer, const QVariant logvolId, const QVariant parentId = QVariant(), bool isRootVolume = false );
-	QVariant storeObj(const GeoFullPhysVol* pointer, const QVariant logvolId, const QVariant parentId = QVariant(), bool isRootVolume = false );
-	QVariant storeObj(const GeoSerialDenominator* pointer, const QString baseName);
-	QVariant storeObj(const GeoSerialTransformer* pointer, const QVariant functionId, const QVariant volId, const QString volType, const unsigned int copies);
-	QVariant storeObj(const GeoXF::Function* pointer, const QString expression);
-	QVariant storeObj(const GeoTransform* pointer, const std::vector<double> parameters);
-	QVariant storeObj(const GeoAlignableTransform* pointer, const std::vector<double> parameters);
-	QVariant storeObj(const GeoNameTag* pointer, const QString name);
-
-	int getChildPosition(unsigned int parentId);
-	void storeChildPosition(const QVariant parentId, const QString parentType, const QVariant childVol, const unsigned int childPos, const QString childType);
-
-	//	int storeObj(const GeoGraphNode* pointer, const QVariant logvolId, const QVariant parentId = QVariant() );
-
-	bool isAddressStored(const QString address);
-	void storeAddress(const QString address, QVariant id);
-
-	QVariant getStoredIdFromAddress(QString address);
-
-	//	QVariant getStoredIdFromPointer(const GeoMaterial* pointer);
-	QString getAddressStringFromPointer(const GeoMaterial* pointer);
-	QString getAddressStringFromPointer(const GeoShape* pointer);
-	QString getAddressStringFromPointer(const GeoLogVol* pointer);
-	QString getAddressStringFromPointer(const GeoPhysVol* pointer);
-	QString getAddressStringFromPointer(const GeoVPhysVol* pointer);
-	QString getAddressStringFromPointer(const GeoSerialDenominator* pointer);
-	QString getAddressStringFromPointer(const GeoSerialTransformer* pointer);
-	QString getAddressStringFromPointer(const GeoXF::Function* pointer);
-	QString getAddressStringFromPointer(const GeoTransform* pointer);
-	QString getAddressStringFromPointer(const GeoNameTag* pointer);
-
-	QString getQStringFromOss(std::ostringstream &oss);
-
-	std::vector<double> getTransformParameters(HepGeom::Transform3D); // TODO: to be moved to an Utility class, so we can use it from TransFunctionRecorder as well.
-	QString getShapeParameters(const GeoShape*);
-
-	QString getGeoTypeFromVPhysVol(const GeoVPhysVol* vol);
-
-
-	GMDBManager* m_dbManager;
-
-	QMap<QString, QVariant> m_memMap; // TODO: maybe move to QHash??
-	QMap<QString, QString> m_memMap_Tables; // TODO: maybe move to QHash??
-	QMap<unsigned int, unsigned int> m_parentChildrenMap;
-
-	// keep track of the number of visited tree nodes
-	unsigned int m_len;
-	unsigned int m_len_nChild;
-
-	bool m_rootVolumeFound;
-
-};
-
-#endif // DumpGeoModelAction_H
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
deleted file mode 100644
index bbb8efe945dd..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// author: Riccardo.Maria.Bianchi@cern.ch
-// major updates:
-// - Aug 2018
-// - Sep 2018
-
-#ifndef DumpGeoModelActionLocalLocal_H
-#define DumpGeoModelActionLocalLocal_H
-
-// local includes
-#include "GeoModelDBManager/GMDBManager.h"
-
-// GeoModel includes
-#include "GeoModelKernel/GeoNodeAction.h"
-#include "GeoModelKernel/GeoGraphNode.h"
-#include "GeoModelKernel/GeoShape.h"
-#include "GeoModelKernel/GeoMaterial.h"
-#include "GeoModelKernel/GeoElement.h"
-#include "GeoModelKernel/GeoLogVol.h"
-#include "GeoModelKernel/GeoXF.h"
-#include "GeoModelKernel/GeoAlignableTransform.h"
-
-// Qt includes
-//#include <QSqlDatabase>
-#include <QStringList>
-#include <QVariant>
-#include <QString>
-#include <QMap>
-
-// TODO: to remove once the migration to Eigen is complete
-// fwd declaration
-namespace HepGeom {
-	class Transform3D;
-}
-
-
-/**
- * \class DumpGeoModelActionLocal
- *
- * DumpGeoModelActionLocal acts on objects of the GeoModel tree
- * persitifying them offline.
- */
-class DumpGeoModelActionLocal  : public GeoNodeAction
-{
-public:
-	/**
-	 * @brief Constructor
-	 *
-	 * Constructor sets up connection with db and opens it
-	 * @param path - absolute path to db file
-	 */
-	DumpGeoModelActionLocal(GMDBManager& db);
-
-	/**
-	 * @brief Destructor
-	 */
-	~DumpGeoModelActionLocal();
-
-	virtual void handlePhysVol (const GeoPhysVol *vol); //	Handles a physical volume.
-	virtual void handleFullPhysVol (const GeoFullPhysVol *vol);
-	virtual void handleSerialDenominator (const GeoSerialDenominator *sD); //	Handles a Serial Denominator.
-	virtual void handleSerialTransformer (const GeoSerialTransformer *obj);
-	virtual void handleTransform (const GeoTransform *);
-	virtual void handleNameTag (const GeoNameTag *);
-
-	void saveToDB();
-
-
-private:
-
-	// define copy constructor, needed for the GeoModelAction subclass
-	DumpGeoModelActionLocal(const DumpGeoModelActionLocal &right);
-
-	// define assignment operator, needed for the GeoModelAction subclass
-	DumpGeoModelActionLocal & operator=(const DumpGeoModelActionLocal &right);
-
-	void handleVPhysVolObjects(const GeoVPhysVol* vol);
-	void handleReferencedVPhysVol (const GeoVPhysVol *vol); // Handles a physical volume referenced by a SerialTrasformer
-
-	void showMemoryMap();
-
-	QStringList getParentNode();
-
-	QVariant storeShape(const GeoShape* shape);
-	QVariant storeMaterial(const GeoMaterial* mat);
-	QVariant storeElement(const GeoElement* el);
-	QVariant storeTranform(const GeoTransform* node);
-
-	QVariant storeObj(const GeoMaterial* pointer, const QString name, const QString density, const QString elements);
-	QVariant storeObj(const GeoElement* pointer, const QString name, const QString symbol, const QString elZ, const QString elA);
-	QVariant storeObj(const GeoShape* pointer, const QString type, const QString parameters);
-	QVariant storeObj(const GeoLogVol* pointer, const QString name, const QVariant shapeId, const QVariant materialId);
-	QVariant storeObj(const GeoPhysVol* pointer, const QVariant logvolId, const QVariant parentId = QVariant(), bool isRootVolume = false );
-	QVariant storeObj(const GeoFullPhysVol* pointer, const QVariant logvolId, const QVariant parentId = QVariant(), bool isRootVolume = false );
-	QVariant storeObj(const GeoSerialDenominator* pointer, const QString baseName);
-	QVariant storeObj(const GeoSerialTransformer* pointer, const QVariant functionId, const QVariant volId, const QString volType, const unsigned int copies);
-	QVariant storeObj(const GeoXF::Function* pointer, const QString expression);
-	QVariant storeObj(const GeoTransform* pointer, const std::vector<double> parameters);
-	QVariant storeObj(const GeoAlignableTransform* pointer, const std::vector<double> parameters);
-	QVariant storeObj(const GeoNameTag* pointer, const QString name);
-
-	unsigned int addRecord(std::vector<QStringList>* container, const QStringList values) const;
-	QVariant addMaterial(const QString name, const QString density, const QString elements);
-	QVariant addElement(const QString name, const QString symbol, const QString elZ, const QString elA);
-	QVariant addNameTag(const QString name);
-	QVariant addAlignableTransform(const std::vector<double> params);
-	QVariant addTransform(const std::vector<double> params);
-	QVariant addFunction(const QString expression);
-	QVariant addSerialTransformer(const QVariant &funcId, const QVariant &physvolId, const QString volType, const unsigned int &copies);
-	QVariant addShape(const QString &type, const QString &parameters);
-	QVariant addSerialDenominator(const QString &baseName);
-	QVariant addPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume = false);
-	QVariant addFullPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume = false);
-	QVariant addLogVol(const QString &name, const QVariant &shapeId, const QVariant &materialId);
-    void addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyNumber, const unsigned int childPos, const QString childType, const unsigned int childCopyN);
-
-    unsigned int getChildPosition(QString parentId, QString parentType, unsigned int copyN);
-
-    unsigned int setVolumeCopyNumber(QString volId, QString volType);
-    unsigned int getLatestParentCopyNumber(QString parentId, QString parentType);
-
-	void storeChildPosition(const QVariant parentId, const QString parentType, const QVariant childVol, const unsigned int parentCopyNumber, const unsigned int childPos, const QString childType, const unsigned int childCopyN);
-
-	bool isAddressStored(const QString address);
-	void storeAddress(const QString address, QVariant id);
-
-	QVariant getStoredIdFromAddress(QString address);
-
-	QString getAddressStringFromPointer(const GeoMaterial* pointer);
-	QString getAddressStringFromPointer(const GeoElement* pointer);
-	QString getAddressStringFromPointer(const GeoShape* pointer);
-	QString getAddressStringFromPointer(const GeoLogVol* pointer);
-	QString getAddressStringFromPointer(const GeoPhysVol* pointer);
-	QString getAddressStringFromPointer(const GeoVPhysVol* pointer);
-	QString getAddressStringFromPointer(const GeoSerialDenominator* pointer);
-	QString getAddressStringFromPointer(const GeoSerialTransformer* pointer);
-	QString getAddressStringFromPointer(const GeoXF::Function* pointer);
-	QString getAddressStringFromPointer(const GeoTransform* pointer);
-	QString getAddressStringFromPointer(const GeoNameTag* pointer);
-
-	QString getQStringFromOss(std::ostringstream &oss);
-
-	std::vector<double> getTransformParameters(HepGeom::Transform3D); // TODO: to be moved to Eigen (GeoTrf) and to be moved to an Utility class, so we can use it from TransFunctionRecorder as well.
-	QString getShapeParameters(const GeoShape*);
-
-	QString getGeoTypeFromVPhysVol(const GeoVPhysVol* vol);
-
-	QString getIdFromNodeType(QString nodeType);
-
-    QString m_dbpath;
-	GMDBManager* m_dbManager;
-
-	QMap<QString, QVariant> m_memMap; // TODO: maybe move to QHash??
-	QHash<QString, unsigned int> m_memMap_Tables;
-    QMap<QString, unsigned int> m_parentChildrenMap2; // TODO: clean name!
-    QMap<QString, unsigned int> m_volumeCopiesMap;
-
-	// keep track of the number of visited tree nodes
-	unsigned int m_len;
-	unsigned int m_len_nChild;
-
-	bool m_rootVolumeFound;
-	bool m_unconnectedTree;
-
-	std::vector<QStringList> m_logVols;
-	std::vector<QStringList> m_physVols;
-	std::vector<QStringList> m_fullPhysVols;
-	std::vector<QStringList> m_shapes;
-	std::vector<QStringList> m_materials;
-	std::vector<QStringList> m_elements;
-	std::vector<QStringList> m_transforms;
-	std::vector<QStringList> m_alignableTransforms;
-	std::vector<QStringList> m_serialDenominators;
-	std::vector<QStringList> m_serialTransformers;
-	std::vector<QStringList> m_functions;
-	std::vector<QStringList> m_nameTags;
-
-	std::vector<QStringList> m_childrenPositions;
-	QStringList m_rootVolume;
-
-};
-
-#endif // DumpGeoModelActionLocal_H
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/WriteGeoModelAction.h.oldSqlite b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/WriteGeoModelAction.h.oldSqlite
deleted file mode 100644
index 081c1c107564..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/WriteGeoModelAction.h.oldSqlite
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-//
-//  GeoModel Action class to
-//	write a GeoModel tree to a database
-//
-//	Riccardo Maria BIANCHI
-//	University of Pittsburgh
-//  <rbianchi-AT-cern.ch>
-//
-//	May 2016
-//
-
-#ifndef WriteGeoModelAction_h
-#define WriteGeoModelAction_h 1
-
-// C++
-#include <unordered_map> // C++11
-#include <iostream>
-
-// GeoNodeAction
-#include "GeoModelKernel/GeoGraphNode.h"
-#include "GeoModelKernel/GeoNodeAction.h"
-#include "GeoModelKernel/GeoTraversalState.h"
-
-// Qt includes
-#include <QtSql>
-
-
-//typedef std::unordered_map<int,int> MemMap;
-typedef std::unordered_map<std::string,int> MemMap;
-
-
-// FWD declarations
-//class QSqlError;
-//class QSqlDatabase;
-//class QString;
-//class QVariant;
-//class QSqlQuery;
-
-//	This action prints the node tree.  It can be configured
-//	to print a message on the following types of nodes:
-//
-//	* Transforms
-//	* Physical Volumes and Full Physical Volumes.
-//	* Transforms
-//	* SerialDenominators
-//	* SerialTransforms
-//	* IdentifierTag
-//
-//	These must be switched on (using setNotificationState())
-
-// SQLite
-//#include "sqlite/sqlite3.h"
-#include <sqlite3.h>
-
-class WriteGeoModelAction : public GeoNodeAction  //## Inherits: <unnamed>%3FB0190202B6
-{
-	enum Type { TRANSFORM,
-		VOLUME,
-		NAMETAG,
-		IDENTIFIERTAG};
-
-public:
-
-	//## Constructors (specified)
-	//	Constructor for the print graph action.
-	WriteGeoModelAction (std::ostream &o,	// Constructor.  Takes an output stream.
-			MemMap& m, // and an unordered map.
-			sqlite3 *db = 0//
-	);
-	//## Destructor (generated)
-	virtual ~WriteGeoModelAction();
-
-    bool isOpen() const;
-
-
-	//## Other Operations (specified)
-
-	//	Handles a Transform.
-	virtual void handleTransform (const GeoTransform *xform);
-
-	//	Handles a physical volume.
-	virtual void handlePhysVol (const GeoPhysVol *vol);
-
-	//	Handles a physical volume.
-	virtual void handleFullPhysVol (const GeoFullPhysVol *vol);
-
-	//	Handles a Name Tag.
-	virtual void handleNameTag (const GeoNameTag *nameTag);
-
-	//	Handles a Serial Denominator.
-	virtual void handleSerialDenominator (const GeoSerialDenominator *sD);
-
-	//	Handles a Serial Transformer
-	virtual void handleSerialTransformer (const GeoSerialTransformer  *sT);
-
-	//	Handles an Identifier Tag.
-	virtual void handleIdentifierTag (const GeoIdentifierTag *idTag);
-
-	//	Sets the notification state.  Default: everything on.
-	void setNotification (Type type, bool state);
-
-	// Public SQLite DB methods
-	QSqlError fetchAllRecords();
-
-	QSqlError initDB();
-	QSqlError loadTestData();
-protected:
-
-private:
-	//## Constructors (generated)
-	WriteGeoModelAction(const WriteGeoModelAction &right);
-
-	//## Assignment Operation (generated)
-	WriteGeoModelAction & operator=(const WriteGeoModelAction &right);
-
-
-	//	Indent the print.
-	void indent ();
-
-
-	int storeObj(const GeoLogVol* pointer);
-	int storeObj(const GeoMaterial* pointer);
-	int storeObj(const GeoGraphNode* pointer);
-	int storeObj(const GeoShape* pointer);
-
-	int storeAddress(const std::string address);
-	void persistifyObj(const GeoPhysVol * pointer);
-
-	// Private SQLite DB methods
-//	static int callback(void *NotUsed, int argc, char **argv, char **azColName);
-//	void createTables();
-//	bool executeSQL(char const *sql);
-
-//	QSqlError openDB();
-//	void closeDB();
-
-
-	QVariant addPhysVol(QSqlQuery &q, const QVariant &logVolId, const QVariant &parentPhysVolId);
-	QVariant addLogVol(QSqlQuery &q, const QString &name, const QVariant &shapeId, const QVariant &materialId);
-	QVariant addMaterial(QSqlQuery &q, const QString &name);
-	QVariant addShape(QSqlQuery &q, const QString &name);
-
-
-
-	// Data Members for Class Attributes
-
-	//	A pointer to a name tag.  If the volume is named.
-	const GeoNameTag *m_nameTag;
-
-	//	A pointer to a serial denominator.  If one exists.
-	const GeoSerialDenominator *m_serialDenominator;
-
-	//	A pointer to an identifier tag.  If the volume is identified.
-	const GeoIdentifierTag *m_idTag;
-
-	//	List of Pending Transformations.
-	std::vector<const GeoTransform *>  m_pendingTransformList;
-
-	//	On/off flag for transforms.
-	bool m_transformState;
-
-	//	On/off flag for physical volumes.
-	bool m_volumeState;
-
-	//	On/off flag for name tags.
-	bool m_nametagState;
-
-	//	On/off flag for serial denominators.
-	bool m_serialDenominatorState;
-
-	//	On/off flag for serial transformers.
-	bool m_serialTransformerState;
-
-	//	On/off flag for identifier tags.
-	bool m_identifierState;
-
-	// output stream
-	std::ostream &m_o;
-
-	MemMap & m_map;
-
-//	sqlite3 * m_db;
-
-	QSqlDatabase m_db;
-//	QSqlDatabase* _db;
-
-	unsigned long int m_id; // store index of stored objects
-
-	int rc;
-	char const *sql;
-	char *zErrMsg = 0;
-	const char* data = "Callback function called";
-
-
-	//	Flag for indent (intially 0)
-	mutable bool m_indented;
-
-
-
-private: //## implementation
-
-};
-
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelAction.oldVersion b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelAction.oldVersion
deleted file mode 100644
index 338ff50cac79..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelAction.oldVersion
+++ /dev/null
@@ -1,1600 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-
-
-// local includes
-#include "GeoWrite/DumpGeoModelAction.h"
-
-// TFPersistification includes
-#include "TFPersistification/TransFunctionPersistifier.h"
-
-
-// GeoModelKernel includes
-#include "GeoModelKernel/GeoNodePath.h"
-#include "GeoModelKernel/GeoCountVolAction.h"
-// GeoModelKernel shapes
-#include "GeoModelKernel/GeoBox.h"
-#include "GeoModelKernel/GeoCons.h"
-#include "GeoModelKernel/GeoPara.h"
-#include "GeoModelKernel/GeoPcon.h"
-#include "GeoModelKernel/GeoPgon.h"
-#include "GeoModelKernel/GeoSimplePolygonBrep.h"
-#include "GeoModelKernel/GeoShapeShift.h"
-#include "GeoModelKernel/GeoTrap.h"
-#include "GeoModelKernel/GeoTrd.h"
-#include "GeoModelKernel/GeoTube.h"
-#include "GeoModelKernel/GeoTubs.h"
-
-// CLHEP includes
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Matrix/SymMatrix.h"
-#include "CLHEP/Matrix/Matrix.h"
-
-
-
-// Qt includes
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QSqlRecord>
-#include <QSqlDriver>
-#include <QVector>
-#include <QDebug>
-
-// C++ includes
-#include <sstream>
-
-
-
-int DumpGeoModelAction::getChildPosition(unsigned int parentId)
-{
-	if ( ! (m_parentChildrenMap.contains(parentId)) ) {
-		m_parentChildrenMap[parentId] = 0;
-	}
-	++m_parentChildrenMap[parentId];
-	return m_parentChildrenMap[parentId];
-}
-
-
-void DumpGeoModelAction::handlePhysVol (const GeoPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelAction::handlePhysVol(GeoPhysVol*)";
-	handleVPhysVolObjects( vol );
-}
-
-
-void DumpGeoModelAction::handleFullPhysVol (const GeoFullPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelAction::handleFullPhysVol( GeoFullPhysVol* )";
-	handleVPhysVolObjects( vol );
-}
-
-
-void DumpGeoModelAction::handleVPhysVolObjects(const GeoVPhysVol* vol)
-{
-	qDebug() << "\nDumpGeoModelAction::handleVPhysVolObjects( GeoVPhysVol* )";
-
-
-	// get the address string for the current volume
-	QString address = getAddressStringFromPointer( vol );
-
-	// variables used to persistify the object
-	QVariant parentId;
-	QVariant physId;
-
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "length: " << len;
-	//	std::cout << "path: " << path << std::endl;
-
-	const GeoVPhysVol* parentNode = nullptr;
-
-	// this below is performed until the root volume is found, then "length" is not used anymore,
-	// because not updated when recursively visiting PhysVols
-	bool getParentNode = true;
-	bool storeRootVolume = false;
-	if ( ! m_rootVolumeFound) {
-		if (len > 1) {
-			getParentNode = true;
-		} else{
-			qDebug() << "This is the Root volume!";
-			m_rootVolumeFound = true;
-			storeRootVolume = true;
-			getParentNode = false;
-		}
-	} else {
-		getParentNode = true;
-	}
-
-	// get the parent volume, if this is not the Root volume
-	if (getParentNode) {
-
-		parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() )));
-
-		if (parentNode) {
-			QString parentAddress = getAddressStringFromPointer(parentNode);
-			qDebug() << "parent's address:" << parentNode;
-
-			if (isAddressStored(parentAddress))
-				parentId = getStoredIdFromAddress(parentAddress);
-			//		else
-			//			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-			qDebug() << "parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-		}
-		else {
-			qDebug() << "NULL parent node!!";
-		}
-	}
-
-	// counting children
-	unsigned int nChildren = vol->getNChildVols();
-	qDebug() << "number of child physical volumes:" << nChildren;
-	qDebug() << "[number of PhysVol and SerialTransformer child nodes:" << vol->getNChildVolAndST() << "]";
-
-	//// for debug
-	// GeoCountVolAction cv;
-	// cv.setDepthLimit(1);
-	// vol->exec(&cv);
-	// int nChildCount = cv.getCount();
-	// qDebug() << "number of child volumes:" << nChildCount;
-
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		/*
-		 * VPhysVol features:
-		 * - 1 parent VPhysVol (if any)
-		 * - 1 LogVol
-		 * - 1 Material
-		 * - 1 Shape
-		 */
-
-		// Note: PhysVol has no name. Its LogVol has a name.
-		//	  const std::string name = vol->getLogVol()->getName();
-
-		// LOGVOL
-		const GeoLogVol* logVol = vol->getLogVol();
-		const QString logName = QString::fromStdString(logVol->getName());
-		qDebug() << "LogVol name:"  << logName;
-
-
-		// MATERIAL
-		const GeoMaterial * mat = vol->getLogVol()->getMaterial();
-		const QString matName = QString::fromStdString(mat->getName());
-		qDebug() << "material name:" << matName << ", address:" << mat;
-
-
-		// SHAPE
-		const GeoShape * shape = vol->getLogVol()->getShape();
-		// const QString shapeType = QString::fromStdString(shape->type());
-		// qDebug() << "shape name:" << shapeType  << ", address:" << shape;
-		// // get shape parameters
-		// QString shapePars = getShapeParameters(shape);
-
-
-		/*
-		 * STORE THE OBJECTS IN THE DB
-		 */
-
-		// store/get the Material object into/from the DB
-		QVariant matId;
-		matId = storeObj(mat, matName);
-
-		// store/get the Shape object into/from the DB
-		QVariant shapeId;
-		shapeId = storeShape(shape);
-		// shapeId = storeObj(shape, shapeType, shapePars);
-
-		// store/get the LogVol object into/from the DB
-		QVariant logvolId;
-		logvolId = storeObj(logVol, logName, shapeId, matId);
-
-		if (dynamic_cast<const GeoPhysVol*>(vol)) {
-			qDebug() << "New PhysVol, storing it...";
-			const GeoPhysVol* physVol = dynamic_cast<const GeoPhysVol*>(vol);
-			// store the PhysVol volume into the DB
-			physId = storeObj(physVol, logvolId, parentId, storeRootVolume); // with parent info
-			qDebug() << "PhysVol stored. Id:" << physId.toString();
-		}
-		else if (dynamic_cast<const GeoFullPhysVol*>(vol)) {
-			qDebug() << "New FullPhysVol, storing it...";
-			const GeoFullPhysVol* fullVol = dynamic_cast<const GeoFullPhysVol*>(vol);
-			// store the FullPhysVol volume into the DB
-			physId = storeObj(fullVol, logvolId, parentId, storeRootVolume); // with parent info
-			qDebug() << "FullPhysVol stored. Id:" << physId.toString();
-		} else {
-			qWarning() << "WARNING!! Unknown GeoVPhysVol type!!";
-		}
-
-	} else {
-		//	qDebug() << "Volume stored already. It is a shared volume. Taking ID from memory map and moving to its physical children...";
-		qDebug() << "Volume stored already. It is a shared volume. Taking ID from memory map...";
-		physId = getStoredIdFromAddress(address);
-		qDebug() << "PhysVol Id:" << physId;
-	}
-
-
-	// store the parent-child relationship in the DB
-
-	QString parentType;
-	if (parentNode) parentType = getGeoTypeFromVPhysVol(parentNode);
-	else parentType = "NULL";
-	QString childType  = getGeoTypeFromVPhysVol(vol);
-	storeChildPosition(parentId, parentType, physId, getChildPosition( parentId.toUInt() ), childType);
-
-}
-
-
-QString DumpGeoModelAction::getGeoTypeFromVPhysVol(const GeoVPhysVol* vol)
-{
-	QString geoType;
-	if (dynamic_cast<const GeoPhysVol*>(vol)) {
-		qDebug() << "GeoType: GeoPhysVol";
-		geoType = "GeoPhysVol";
-	}
-	else if (dynamic_cast<const GeoFullPhysVol*>(vol)) {
-		qDebug() << "GeoType: GeoFullPhysVol";
-		geoType = "GeoFullPhysVol";
-	} else {
-		qWarning() << "WARNING!! Unknown GeoVPhysVol type!!";
-	}
-	return geoType;
-}
-
-
-void DumpGeoModelAction::handleSerialDenominator (const GeoSerialDenominator *node)
-{
-	qDebug() << "\nDumpGeoModelAction::handleSerialDenominator(GeoSerialDenominator*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-
-	std::string baseNameStr = node->getBaseName();
-	QString baseName = QString::fromStdString(baseNameStr);
-	qDebug() << "base name:" << baseName << "address:" << address;
-
-	// TODO: check if needed!
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "length: " << len;
-
-	// reset the number of visited node, if len is different than before
-	if (len != m_len) {
-		m_len_nChild = 0;
-		m_len = len;
-	}
-	// update number of visited nodes if len is the same as before
-	else {
-		++m_len_nChild;
-	}
-
-	// variables used to persistify the object
-	QVariant parentId;
-	QVariant sdId;
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = nullptr;
-	if (len > 1) { // TODO: check if needed!
-		parentNode = path->getItem(len-1); // i=(len-1) gives you the parent VPhysVol
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		else
-			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-		qDebug() << "- parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	} else{ // TODO: check if needed!
-		qWarning() << "ERROR!! Len == 1, but this cannot be the Root volume!";
-	}
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New SerialDenominator, storing it...";
-
-
-		/*
-		 * STORE THE OBJECT IN THE DB
-		 */
-
-		// store the Material object in the DB
-		sdId = storeObj(node, baseName);
-		qDebug() << "SerialDenominator stored. Id:" << sdId.toString();
-
-	} else {
-		sdId = getStoredIdFromAddress(address);
-		qDebug() << "SerialDenominator already stored in the DB. Id:" << sdId.toString();
-	}
-
-	QString parentType;
-	if (parentNode) parentType = getGeoTypeFromVPhysVol(parentNode);
-	else parentType = "NULL";
-	storeChildPosition(parentId, parentType, sdId, getChildPosition( parentId.toUInt() ), "GeoSerialDenominator");
-
-}
-
-
-
-void DumpGeoModelAction::handleSerialTransformer (const GeoSerialTransformer *node)
-{
-	qDebug() << "\nDumpGeoModelAction::handleSerialTransformer(GeoSerialTransformer*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "path length: " << len;
-
-	// reset the number of visited node, if len is different than before
-	if (len > m_len) {
-		m_len_nChild = 0;
-		m_len = len;
-	}
-	// update number of visited nodes if len is the same as before
-	else {
-		++m_len_nChild;
-	}
-
-
-	// variables used to persistify the object
-	QVariant parentId;
-	QVariant functionId;
-	QVariant physvolId;
-	QVariant physvolTable;
-	unsigned int nCopies;
-	QVariant stId;
-
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = nullptr;
-	if (len > 1) {
-		parentNode = path->getItem(len-1); // i=(len-1) gives you the parent VPhysVol
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		else
-			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-		qDebug() << "- parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	} else{
-		qWarning() << "ERROR!! Len == 1, but this cannot be the Root volume!";
-	}
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New SerialTransformer, storing it...";
-
-		/*
-		 * Get Node characteristics
-		 *
-		 * SerialTransformer features:
-		 * - 1 parent PhysVol (if any)
-		 * - 1 GENFUNCTION
-		 * - 1 PhysVolId
-		 * - 1 PhysVolType
-		 * - 1 number of copies
-		 */
-		// get linked function and number of copies
-		const GeoXF::Function * func = node->getFunction();
-		nCopies =  node->getNCopies();
-		qDebug() << "n. of copies:" << QString::number(nCopies);
-
-		// get linked VPhysVol volume
-		const GeoVPhysVol *vol = &( *( node->getVolume() ) );
-		// const GeoPhysVol* vol = dynamic_cast<const GeoPhysVol*>(volV);
-		QString volType;
-		if (dynamic_cast<const GeoPhysVol*>(vol))
-			volType = "GeoPhysVol";
-		else if (dynamic_cast<const GeoFullPhysVol*>(vol))
-			volType = "GeoFullPhysVol";
-		else
-			qWarning() << "ERROR!!! Unknown VPhysVol type!!";
-
-		/*
-		 * Persistify the Function
-		 */
-	 	TransFunctionPersistifier persistifier;
-        try {
-            persistifier.persistify(*func);
-        } catch (const std::runtime_error & error) {
-            std::cout << "Handling TransFunctionPersistifier std::runtime_error! -->" << error.what() << std::endl;
-            std::cout << "SEVERE WARNING!! Handling std::runtime_error! -->" << error.what() << std::endl;
-        }
-		QString expression = QString::fromStdString( persistifier.getCodedString() );
-		qDebug() << "FUNCTION:" << expression;
-
-		if (expression.size() == 0) {
-				qFatal("FATAL ERROR!! Function expression is empty!! Aborting...");
-				abort();
-		}
-
-
-		/*
-		 * STORE/GET THE INNER OBJECTS IN THE DB
-		 */
-
-		// store/get the Function object in the DB
-		functionId = storeObj(func, expression);
-
-		// store/get the PhysVol volume in the DB
-
-		/* Concerning the physVol referenced by the SerialTransformer:
-		 *
-		 * - if physvol is not stored in the DB already;
-		 * - if physVol has no parent (==NULL)
-		 * ==> it means that its children will never visited by the NodeAction executed on the root tree
-		 *
-		 * ==> So, we need to persitify it as a new tree, to get all its children visited and persistified
-		 *
-		 */
-		handleReferencedPhysVol(vol);
-
-		QString physvolAddress = getAddressStringFromPointer(vol);
-		physvolId = getStoredIdFromAddress(physvolAddress);
-
-
-		/*
-		 * STORE THE NODE INTO THE DB
-		 */
-		// store the SerialTransformer volume in the DB
-		stId = storeObj(node, functionId, physvolId, volType, nCopies);
-		qDebug() << "SerialTransformer stored. Id:" << stId.toString();
-
-	} else {
-		stId = getStoredIdFromAddress(address);
-		qDebug() << "SerialTransformer already stored in the DB. Id:" << stId.toString();
-	}
-
-	QString parentType;
-	if (parentNode) parentType = getGeoTypeFromVPhysVol(parentNode);
-	else parentType = "NULL";
-	storeChildPosition(parentId, parentType, stId, getChildPosition( parentId.toUInt() ), "GeoSerialTransformer");
-
-}
-
-
-
-
-void DumpGeoModelAction::handleTransform(const GeoTransform* node)
-{
-	qDebug() << "\nDumpGeoModelAction::handleTransform(GeoTransform*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "length: " << len;
-
-	// reset the number of visited node, if len is different than before
-	if (len > m_len) {
-		m_len_nChild = 0;
-		m_len = len;
-	}
-	// update number of visited nodes if len is the same as before
-	else {
-		++m_len_nChild;
-	}
-
-
-	QVariant trId;
-	QVariant parentId;
-
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = nullptr;
-	if (len > 1) {
-		parentNode = path->getItem(len-1); // i=(len-1) gives you the parent VPhysVol
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		else {
-			// qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-			qWarning() << "The parent node of this transform seems to not having be stored in the DB yet. [It is normal if the transformation is used for example only in the definition of a 'GeoShapeShift' instance]";
-		}
-		qDebug() << "- parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	} else{
-		qWarning() << "ERROR!! Len == 1, but this cannot be the Root volume!";
-	}
-
-	/*
-	 * STORE THE OBJECT IN THE DB AND ITS PLACE WITHIN THE TREE
-	 */
-
-	 // store the transformation in the DB
-	 trId = storeTranform(node);
-
-
-	// Store the child-parent relationship
-	QString parentType;
-	if (parentNode) parentType = getGeoTypeFromVPhysVol(parentNode);
-	else parentType = "NULL";
-	if ( dynamic_cast<const GeoAlignableTransform*>(node) ) {
-		qDebug() << "Storing a GeoAlignableTransform...";
-		storeChildPosition(parentId, parentType, trId, getChildPosition( parentId.toUInt() ), "GeoAlignableTransform");
-	}
-	else if ( dynamic_cast<const GeoTransform*>(node) ) {
-		qDebug() << "Storing a GeoTransform...";
-		storeChildPosition(parentId, parentType, trId, getChildPosition( parentId.toUInt() ), "GeoTransform");
-	}
-	else {
-		qWarning("Not implemented yet!!!! ");
-	}
-
-}
-
-
-void DumpGeoModelAction::handleNameTag(const GeoNameTag* node)
-{
-	qDebug() << "\nDumpGeoModelAction::handleNameTag(GeoNameTag*)";
-
-	std::string nameStr = node->getName();
-	QString name = QString::fromStdString(nameStr);
-	qDebug() << "name:" << name;
-
-	QString address = getAddressStringFromPointer( node );
-
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "length: " << len;
-
-	// reset the number of visited node, if len is different than before
-	if (len > m_len) {
-		m_len_nChild = 0;
-		m_len = len;
-	}
-	// update number of visited nodes if len is the same as before
-	else {
-		++m_len_nChild;
-	}
-
-
-	QVariant nameId;
-	QVariant parentId;
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = nullptr;
-	if (len > 1) {
-		parentNode = path->getItem(len-1); // i=(len-1) gives you the parent VPhysVol
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		else {
-			// qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-			qWarning() << "The parent node of this transform seems to not having be stored in the DB yet. [It is normal if the transformation is used for example only in the definition of a 'GeoShapeShift' instance]";
-		}
-		qDebug() << "- parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	} else{
-		qWarning() << "ERROR!! Len == 1, but this cannot be the Root volume!";
-	}
-
-	/*
-	 * STORE THE OBJECT IN THE DB AND ITS PLACE WITHIN THE TREE
-	 */
-
-	 // store the name tag in the DB
-	 nameId = storeObj(node, name);
-
-	// Store the child-parent relationship
-	QString parentType;
-	if (parentNode) parentType = getGeoTypeFromVPhysVol(parentNode);
-	else parentType = "NULL";
-	storeChildPosition(parentId, parentType, nameId, getChildPosition( parentId.toUInt() ), "GeoNameTag");
-
-}
-
-QVariant DumpGeoModelAction::storeShape(const GeoShape* shape){
-	const QString shapeType = QString::fromStdString(shape->type());
-	qDebug() << "shape name:" << shapeType  << ", address:" << shape;
-	// get shape parameters
-	QString shapePars = getShapeParameters(shape);
-	// store the shape in the DB and returns the ID
-	return storeObj(shape, shapeType, shapePars);
-}
-
-QVariant DumpGeoModelAction::storeTranform(const GeoTransform* node){
-	/*
-	 * STORE THE OBJECT IN THE DB
-	 */
-
-	 QString address = getAddressStringFromPointer( node );
-
-	 QVariant trId;
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New Transform, storing it...";
-
-
-		HepGeom::Transform3D tr = node->getTransform();
-
-		std::vector<double> params = getTransformParameters(tr);
-		qDebug() << "Transform parameters:" << QVector<double>::fromStdVector(params);
-
-		/*
-		 * STORE THE OBJECT IN THE DB
-		 */
-
-		// store the object in the DB
-		if ( dynamic_cast<const GeoAlignableTransform*>(node) ) {
-			trId = storeObj(dynamic_cast<const GeoAlignableTransform*>(node), params);
-			qDebug() << "AlignableTransform stored. Id:" << trId.toString();
-		}
-		else if ( dynamic_cast<const GeoTransform*>(node) ) {
-			trId = storeObj(dynamic_cast<const GeoTransform*>(node), params);
-			qDebug() << "Transform stored. Id:" << trId.toString();
-		}
-		else {
-			qDebug() << "WARNING!!! - This type of transformation needs to be customized yet!!";
-		}
-
-	} else {
-		trId = getStoredIdFromAddress(address);
-		qDebug() << "Transform already stored in the DB. Id:" << trId.toString();
-	}
-
-	return trId;
-}
-
-
-void DumpGeoModelAction::handleReferencedPhysVol (const GeoVPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelAction::handleReferencedPhysVol(GeoVPhysVol*)";
-
-	// qDebug() << "PhysVol's LogVol name:" << QString::fromStdString(vol->getLogVol()->getName());
-
-	// get the address string for the current volume
-	QString address = getAddressStringFromPointer( vol );
-
-	QVariant parentId;
-	bool unconnectedTree = false;
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() )));
-
-	if (parentNode) {
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		//		else
-		//			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-		qDebug() << "parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	}
-	else {
-		qDebug() << "NULL parent node!!";
-		unconnectedTree = true;
-	}
-
-	// // counting children
-	// unsigned int nChildren = vol->getNChildVols();
-	// qDebug() << "number of child physical volumes:" << nChildren;
-	// qDebug() << "[number of PhysVol and SerialTransformer child nodes:" << vol->getNChildVolAndST() << "]";
-	//
-	// GeoCountVolAction cv;
-	// cv.setDepthLimit(1);
-	// vol->exec(&cv);
-	// int nChildCount = cv.getCount();
-	// qDebug() << "number of child volumes:" << nChildCount;
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "This is a new root PhysVol node of an 'unconnected' tree, so we start another action on it to dump it into the DB...";
-
-		// Dump tree volumes into a DB
-			vol->exec(this); // TODO: check if the new action overwrites the id of the volumes already in the DB...!!!
-	}
-}
-
-
-// Get shape parameters
-QString DumpGeoModelAction::getShapeParameters(const GeoShape* shape)
-{
-	const QString shapeType = QString::fromStdString(shape->type());
-	qDebug() << "shapeType:" << shapeType;
-
-	QString shapePars = "";
-
-	if (shapeType == "Box") {
-		qDebug() << "get GeoBox parameters";
-		QStringList pars;
-		const GeoBox* box = dynamic_cast<const GeoBox*>(shape);
-		pars << "XHalfLength=" + QString::number(box->getXHalfLength()) ;
-		pars << "YHalfLength=" + QString::number(box->getYHalfLength()) ;
-		pars << "ZHalfLength=" + QString::number(box->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Tube") {
-		QStringList pars;
-		const GeoTube* tube = dynamic_cast<const GeoTube*>(shape);
-		pars << "RMin=" + QString::number(tube->getRMin()) ;
-		pars << "RMax=" + QString::number(tube->getRMax()) ;
-		pars << "ZHalfLength=" + QString::number(tube->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Cons") {
-		QStringList pars;
-		const GeoCons* shapeIn = dynamic_cast<const GeoCons*>(shape);
-		pars << "RMin1=" + QString::number(shapeIn->getRMin1()) ;
-		pars << "RMin2=" + QString::number(shapeIn->getRMin2()) ;
-		pars << "RMax1=" + QString::number(shapeIn->getRMax1()) ;
-		pars << "RMax2=" + QString::number(shapeIn->getRMax2()) ;
-		pars << "DZ=" + QString::number(shapeIn->getDZ()) ;
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Para") {
-		QStringList pars;
-		const GeoPara* shapeIn = dynamic_cast<const GeoPara*>(shape);
-		pars << "XHalfLength=" + QString::number(shapeIn->getXHalfLength()) ;
-		pars << "YHalfLength=" + QString::number(shapeIn->getYHalfLength()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "Alpha=" + QString::number(shapeIn->getAlpha()) ;
-		pars << "Theta=" + QString::number(shapeIn->getTheta()) ;
-		pars << "Phi=" + QString::number(shapeIn->getPhi()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Pcon") {
-		QStringList pars;
-		const GeoPcon* shapeIn = dynamic_cast<const GeoPcon*>(shape);
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Pgon") {
-		QStringList pars;
-		const GeoPgon* shapeIn = dynamic_cast<const GeoPgon*>(shape);
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		pars << "NSides=" + QString::number(shapeIn->getNSides()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "SimplePolygonBrep") {
-		QStringList pars;
-		const GeoSimplePolygonBrep* shapeIn = dynamic_cast<const GeoSimplePolygonBrep*>(shape);
-		pars << "DZ=" + QString::number(shapeIn->getDZ()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Trap") {
-		QStringList pars;
-		const GeoTrap* shapeIn = dynamic_cast<const GeoTrap*>(shape);
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "Theta=" + QString::number(shapeIn->getTheta()) ;
-		pars << "Phi=" + QString::number(shapeIn->getPhi()) ;
-		pars << "Dydzn=" + QString::number(shapeIn->getDydzn()) ;
-		pars << "Dxdyndzn=" + QString::number(shapeIn->getDxdyndzn()) ;
-		pars << "Dxdypdzn=" + QString::number(shapeIn->getDxdypdzn()) ;
-		pars << "Angleydzn=" + QString::number(shapeIn->getAngleydzn()) ;
-		pars << "Dydzp=" + QString::number(shapeIn->getDydzp()) ;
-		pars << "Dxdyndzp=" + QString::number(shapeIn->getDxdyndzp()) ;
-		pars << "Dxdypdzp=" + QString::number(shapeIn->getDxdypdzp()) ;
-		pars << "Angleydzp=" + QString::number(shapeIn->getAngleydzp()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Trd") {
-		QStringList pars;
-		const GeoTrd* shapeIn = dynamic_cast<const GeoTrd*>(shape);
-		pars << "XHalfLength1=" + QString::number(shapeIn->getXHalfLength1()) ;
-		pars << "XHalfLength2=" + QString::number(shapeIn->getXHalfLength2()) ;
-		pars << "YHalfLength1=" + QString::number(shapeIn->getYHalfLength1()) ;
-		pars << "YHalfLength2=" + QString::number(shapeIn->getYHalfLength2()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Tubs") {
-		QStringList pars;
-		const GeoTubs* shapeIn = dynamic_cast<const GeoTubs*>(shape);
-		pars << "RMin=" + QString::number(shapeIn->getRMin()) ;
-		pars << "RMax=" + QString::number(shapeIn->getRMax()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType == "Shift") {
-		qDebug() << "get GeoShapeShift parameters";
-		QStringList pars;
-		const GeoShapeShift* shapeIn = dynamic_cast<const GeoShapeShift*>(shape);
-
-		// get the pointed Shape, store it in the DB
-		const GeoShape* shapeOp = shapeIn->getOp();
-		QVariant shapeId = storeShape(shapeOp);
-
-		// get the Transformation, store it in the DB
-		const HepGeom::Transform3D transfX = shapeIn->getX();
-		GeoTransform* transf = new GeoTransform(transfX);
-		QVariant trId = storeTranform(transf);
-
-		pars << "A=" + QString::number( shapeId.toUInt() ) ;
-		pars << "X=" + QString::number( trId.toUInt() ) ;
-		shapePars = pars.join(";");
-	}
-	else {
-		qDebug() << "WARNING!!! - Shape '" << shapeType << "' needs to be customized!!";
-	}
-
-  return shapePars;
-
-}
-
-
-std::vector<double> DumpGeoModelAction::getTransformParameters(HepGeom::Transform3D tr)
-{
-	std::vector<double> vec;
-
-	vec.push_back(tr.xx());
-	vec.push_back(tr.xy());
-	vec.push_back(tr.xz());
-
-	vec.push_back(tr.yx());
-	vec.push_back(tr.yy());
-	vec.push_back(tr.yz());
-
-	vec.push_back(tr.zx());
-	vec.push_back(tr.zy());
-	vec.push_back(tr.zz());
-
-	vec.push_back(tr.dx());
-	vec.push_back(tr.dy());
-	vec.push_back(tr.dz());
-
-	return vec;
-}
-
-
-DumpGeoModelAction::DumpGeoModelAction(GMDBManager &db)
-{
-	qDebug() << "DumpGeoModelAction: constructor";
-
-	// init variables
-	m_len = 0;
-	m_len_nChild = 0;
-	m_rootVolumeFound = false;
-
-	// init anche check the database handle
-	m_dbManager = &db;
-	if (m_dbManager->isOpen()) {
-		qDebug() << "OK! Database is open!";
-	}
-	else {
-		qDebug() << "Database is not open!";
-	}
-
-	// QString pippo = "pippo";
-
-}
-
-DumpGeoModelAction::~DumpGeoModelAction()
-{
-	// nothing to do so far...
-}
-
-
-void DumpGeoModelAction::showMemoryMap()
-{
-	qDebug() << "DumpGeoModelAction::showMemoryMap()";
-
-	QMap<QString, QVariant>::const_iterator it = m_memMap.constBegin();
-	while (it != m_memMap.constEnd()) {
-		std::cout << it.key().toStdString() << ": " << it.value().toString().toStdString() << std::endl;
-		++it;
-	}
-}
-
-
-
-QVariant DumpGeoModelAction::storeObj(const GeoMaterial* pointer, const QString name)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoMaterial*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant materialId;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New Material! Storing it...";
-
-		materialId = m_dbManager->addMaterial(name);
-		materialId = m_dbManager->addMaterial(name);
-
-		storeAddress( address, materialId );
-	}
-	else {
-		qDebug() << "Material node stored already. Getting ID from the memory map...";
-		materialId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "materialId:" << materialId;
-	return materialId;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoShape* pointer, const QString name, const QString parameters)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoShape*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant shapeId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New Shape! Storing it...";
-		shapeId = m_dbManager->addShape(name, parameters);
-		storeAddress( address, shapeId);
-	}
-	else {
-		qDebug() << "Shape node stored already. Getting ID from the memory map...";
-		shapeId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "shapeId:" << shapeId;
-	return shapeId;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoLogVol* pointer, const QString name, const QVariant shapeId, const QVariant materialId)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoLogVol*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant logvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New LogVol! Storing it...";
-		logvolId = m_dbManager->addLogVol(name, shapeId, materialId);
-		storeAddress( address, logvolId );
-	}
-	else {
-		qDebug() << "LogVol node stored already. Getting ID from the memory map...";
-		logvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "logvolId:" << logvolId;
-	return logvolId;
-}
-
-
-QVariant DumpGeoModelAction::storeObj(const GeoPhysVol* pointer, const QVariant logvolId, const QVariant parentId, bool isRootVolume)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoPhysVol*) - address:" << pointer << "- is root volume?" << isRootVolume;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant physvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New PhysVol! Storing it...";
-		physvolId = m_dbManager->addPhysVol(logvolId, parentId, isRootVolume);
-		storeAddress( address, physvolId );
-	}
-	else {
-		qDebug() << "PhysVol node stored already. Getting ID from the memory map...";
-		physvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "physvolId:" << physvolId;
-	return physvolId;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoFullPhysVol* pointer, const QVariant logvolId, const QVariant parentId, bool isRootVolume)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoFullPhysVol*) - address:" << pointer << "- is root volume?" << isRootVolume;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant physvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New FullPhysVol! Storing it...";
-		physvolId = m_dbManager->addFullPhysVol(logvolId, parentId, isRootVolume);
-		storeAddress( address, physvolId );
-	}
-	else {
-		qDebug() << "FullPhysVol node stored already. Getting ID from the memory map...";
-		physvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "fullphysvolId:" << physvolId;
-	return physvolId;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoSerialDenominator* pointer, const QString baseName)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoSerialDenominator*) - baseName:" << baseName << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialDenominator! Storing it...";
-		id = m_dbManager->addSerialDenominator(baseName);
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialDenominator node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-
-QVariant DumpGeoModelAction::storeObj(const GeoSerialTransformer* pointer, const QVariant functionId, const QVariant volId, const QString volType, const unsigned int copies)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoSerialTransformer*):" << volId << volType << "- n. of copies: " << copies;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialTransformer! Storing it...";
-		id = m_dbManager->addSerialTransformer(functionId, volId, volType, copies);
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialTransformer node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoXF::Function* pointer, const QString expression)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoXF::Function*)";
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-		id = m_dbManager->addFunction(expression);
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoXF::Function node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoTransform* pointer, std::vector<double> parameters)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoTransform*)";
-
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-
-		id = m_dbManager->addTransform( QVector<double>::fromStdVector(parameters) );
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoTransform node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelAction::storeObj(const GeoAlignableTransform* pointer, std::vector<double> parameters)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoAlignableTransform*)";
-
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-
-		id = m_dbManager->addAlignableTransform( QVector<double>::fromStdVector(parameters) );
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoAlignableTransform node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-
-QVariant DumpGeoModelAction::storeObj(const GeoNameTag* pointer, const QString name)
-{
-	qDebug() << "DumpGeoModelAction::storeObj(GeoNameTag*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialDenominator! Storing it...";
-		id = m_dbManager->addNameTag(name);
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialDenominator node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-
-void DumpGeoModelAction::storeChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int childPos, const QString childType)
-{
-	qDebug() << "DumpGeoModelAction::storeChildPosition()";
-
-	m_dbManager->addChildPosition(parentId, parentType, childId, childPos, childType);
-	return;
-
-}
-
-
-void DumpGeoModelAction::storeAddress(const QString address, QVariant id)
-{
-	qDebug() << "DumpGeoModelAction::storeAddress(" << address << "," << id << ")";
-	m_memMap.insert(address, id);
-}
-
-bool DumpGeoModelAction::isAddressStored(const QString address)
-{
-	qDebug() << "DumpGeoModelAction::isAddressStored(): " << address;
-	//showMemoryMap(); // only for Debug
-	return m_memMap.contains(address);
-}
-
-
-QVariant DumpGeoModelAction::getStoredIdFromAddress(QString address)
-{
-	qDebug() << "DumpGeoModelAction::getStoredIdFromAddress(): " << address;
-	return m_memMap.value(address);
-}
-
-// get pointer string
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoMaterial* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoMaterial*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoShape* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoShape*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoLogVol* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoLogVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoPhysVol* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoPhysVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoVPhysVol* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoVPhysVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoSerialDenominator* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoSerialDenominator*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoSerialTransformer* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoSerialTransformer*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoXF::Function* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoXF::Function*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoTransform* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoTransform*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelAction::getAddressStringFromPointer(const GeoNameTag* pointer)
-{
-	qDebug() << "DumpGeoModelAction::getAddressStringFromPointer(GeoNameTag*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelAction::getQStringFromOss(std::ostringstream &oss)
-{
-	qDebug() << "DumpGeoModelAction::getQStringFromOss()";
-	std::string addr = oss.str();
-	QString address = QString::fromStdString(addr);
-	qDebug() << "address string:" << address;
-	return address;
-}
-
-
-//bool DumpGeoModelAction::isObjectStored(const GeoMaterial* pointer)
-//{
-//	qDebug() << "DumpGeoModelAction::isObjectStored(const GeoMaterial*)";
-//	return isAddressStored(getAddressStringFromPointer( pointer) );
-//}
-//
-//bool DumpGeoModelAction::isObjectStored(const GeoGraphNode* pointer)
-//{
-//	qDebug() << "DumpGeoModelAction::isObjectStored(const GeoGraphNode*)";
-////	return isAddressStored(address);
-//}
-
-
-
-// void DumpGeoModelAction::handlePhysVol (const GeoPhysVol *vol)
-// {
-// 	qDebug() << "\nDumpGeoModelAction::handlePhysVol(GeoPhysVol*)";
-//
-// 	// get the address string for the current volume
-// 	QString address = getAddressStringFromPointer( vol );
-//
-// 	// variables used to persistify the object
-// 	QVariant parentId;
-// 	QVariant physId;
-//
-// 	// check the volume position in the geometry tree
-// 	GeoNodePath* path = getPath();
-// 	unsigned int len = path->getLength();
-// 	qDebug() << "length: " << len;
-// 	//	std::cout << "path: " << path << std::endl;
-//
-// //	const GeoVPhysVol* parentNode;
-//
-// 	// this below is performed until the root volume is found, then "length" is not used anymore,
-// 	// because not updated when recursively visiting PhysVols
-// 	bool getParentNode = true;
-// 	bool storeRootVolume = false;
-// 	if ( ! m_rootVolumeFound) {
-// 		if (len > 1) {
-// 			getParentNode = true;
-// 		} else{
-// 			qDebug() << "This is the Root volume!";
-// 			m_rootVolumeFound = true;
-// 			storeRootVolume = true;
-// 			getParentNode = false;
-// 		}
-// 	} else {
-// 		getParentNode = true;
-// 	}
-//
-// 	// get the parent volume, if this is not the Root volume
-// 	if (getParentNode) {
-//
-// 		const GeoPhysVol* parentNode = dynamic_cast<const GeoPhysVol*>( &(*(vol->getParent() )));
-//
-// 		if (parentNode) {
-// 			QString parentAddress = getAddressStringFromPointer(parentNode);
-// 			qDebug() << "parent's address:" << parentNode;
-//
-// 			if (isAddressStored(parentAddress))
-// 				parentId = getStoredIdFromAddress(parentAddress);
-// 			//		else
-// 			//			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-//
-// 			qDebug() << "parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-// 		}
-// 		else {
-// 			qDebug() << "NULL parent node!!";
-// 		}
-// 	}
-//
-// 	// counting children
-// 	unsigned int nChildren = vol->getNChildVols();
-// 	qDebug() << "number of child physical volumes:" << nChildren;
-// 	qDebug() << "[number of PhysVol and SerialTransformer child nodes:" << vol->getNChildVolAndST() << "]";
-//
-// 	GeoCountVolAction cv;
-// 	cv.setDepthLimit(1);
-// 	vol->exec(&cv);
-// 	int nChildCount = cv.getCount();
-// 	qDebug() << "number of child volumes:" << nChildCount;
-//
-//
-//
-// 	// check if this object has been stored already
-// 	if (! isAddressStored(address)) {
-//
-// 		qDebug() << "New PhysVol, storing it...";
-//
-// 		/*
-// 		 * PhysVol features:
-// 		 * - 1 parent PhysVol (if any)
-// 		 * - 1 LogVol
-// 		 * - 1 Material
-// 		 * - 1 Shape
-// 		 */
-//
-// 		// Note: PhysVol has no name. Its LogVol has a name.
-// 		//	  const std::string name = vol->getLogVol()->getName();
-//
-// 		// LOGVOL
-// 		const GeoLogVol* logVol = vol->getLogVol();
-// 		const QString logName = QString::fromStdString(logVol->getName());
-// 		qDebug() << "LogVol name:"  << logName;
-//
-//
-// 		// MATERIAL
-// 		const GeoMaterial * mat = vol->getLogVol()->getMaterial();
-// 		const QString matName = QString::fromStdString(mat->getName());
-// 		qDebug() << "material name:" << matName << ", address:" << mat;
-//
-//
-// 		// SHAPE
-// 		const GeoShape * shape = vol->getLogVol()->getShape();
-// 		const QString shapeType = QString::fromStdString(shape->type());
-// 		qDebug() << "shape name:" << shapeType  << ", address:" << shape;
-//
-// 		// shape parameters
-// 		QString shapePars = "";
-// 		if (shapeType == "Box") {
-// 			QStringList pars;
-// 			const GeoBox* box = dynamic_cast<const GeoBox*>(shape);
-// 			pars << "XHalfLength=" + QString::number(box->getXHalfLength()) ;
-// 			pars << "YHalfLength=" + QString::number(box->getYHalfLength()) ;
-// 			pars << "ZHalfLength=" + QString::number(box->getZHalfLength()) ;
-// 			shapePars = pars.join(";");
-// 		}
-//
-// 		/*
-// 		 * STORE THE OBJECTS IN THE DB
-// 		 */
-//
-// 		// store/get the Material object into/from the DB
-// 		QVariant matId;
-// 		matId = storeObj(mat, matName);
-//
-// 		// store/get the Shape object into/from the DB
-// 		QVariant shapeId;
-// 		shapeId = storeObj(shape, shapeType, shapePars);
-//
-// 		// store/get the LogVol object into/from the DB
-// 		QVariant logvolId;
-// 		logvolId = storeObj(logVol, logName, shapeId, matId);
-//
-// 		// store the PhysVol volume into the DB
-// 		physId = storeObj(vol, logvolId, parentId, storeRootVolume); // with parent info
-// 		qDebug() << "PhysVol stored. Id:" << physId.toString();
-//
-// 	} else {
-// 		//	qDebug() << "Volume stored already. It is a shared volume. Taking ID from memory map and moving to its physical children...";
-// 		qDebug() << "Volume stored already. It is a shared volume. Taking ID from memory map...";
-// 		physId = getStoredIdFromAddress(address);
-// 		qDebug() << "PhysVol Id:" << physId;
-// 	}
-//
-//
-// 	// store the parent-child relationship in the DB
-// 	storeChildPosition(parentId, physId, getChildPosition( parentId.toUInt() ), "GeoPhysVol");
-//
-
-	/* Now we need to loop over children, to be sure all volumes are take.
-	 That's because it seems that the action only goes to children that are 'attached'
-	 to the tree with a parent-child relationship. For example I have a pInnerPassive PhysVol
-	 added to a pPassive PhysVol; the latter is refeneced in a SerialTransformer.
-	 pPassive is visited because of our implementation of the handleSerialTrasformer() method,
-	 but the pInnerPassive is never visited.
-	 */
-	//	if (nChildren > 0) {
-	//		qDebug() << "Looping over the children...";
-	//
-	//		for (unsigned int i=0; i<nChildren; ++i) {
-	//
-	//			unsigned int childPos = i;
-	//
-	//			// get the name of the i-th child volume
-	//			QString childName =  QString::fromStdString(vol->getNameOfChildVol(i));
-	//			qDebug() << "\t" << i << " childName:" << childName;
-	//
-	//			//	Returns the i-th child volume
-	//
-	//			// GEOPHYSVOL child
-	//			if ( dynamic_cast<const GeoPhysVol*>( &(*(vol->getChildVol(i) ))) ) {
-	//				qDebug() << "\t\t" << "the child" << i << "is a GeoPhysVol";
-	//				const GeoVPhysVol *childVolV = &(*(vol->getChildVol(i)));
-	//				const GeoPhysVol* childVol = dynamic_cast<const GeoPhysVol*>(childVolV);
-	//
-	//				handlePhysVol(childVol); // recursive call
-	//
-	//			} else {
-	//				qCritical("\t\tERROR!! the child is not a persistified volume/node!!!");
-	//				return;
-	//			}
-	//		}
-	//	}
-
-	//	if (nChildren > 0) {
-	//		for (unsigned int i=0; i<nChildren; ++i) {
-	//
-	//			unsigned int childPos = i;
-	//
-	//			// get the name of the i-th child volume
-	//			QString childName =  QString::fromStdString(vol->getNameOfChildVol(i));
-	//			qDebug() << "\t" << i << " childName:" << childName;
-	//
-	//			//	Returns the i-th child volume
-	//
-	//			// GEOPHYSVOL child
-	//			if ( dynamic_cast<const GeoPhysVol*>( &(*(vol->getChildVol(i) ))) ) {
-	//				qDebug() << "\t\t" << "the child" << i << "is a GeoPhysVol";
-	//				const GeoVPhysVol *childVolV = &(*(vol->getChildVol(i)));
-	//				const GeoPhysVol* childVol = dynamic_cast<const GeoPhysVol*>(childVolV);
-	//
-	//
-	//				// check if child volume has been stored already. If not, store it.
-	//				if ( ! isAddressStored( getAddressStringFromPointer( childVol )) ) {
-	//
-	//					// MATERIAL
-	//					const GeoMaterial * mat = childVol->getLogVol()->getMaterial();
-	//					const QString matName = QString::fromStdString(mat->getName());
-	//					qDebug() << "Child material name:" << matName;
-	//
-	//					// SHAPE
-	//					const GeoShape * shape = childVol->getLogVol()->getShape();
-	//					const QString shapeType = QString::fromStdString(shape->type());
-	//					qDebug() << "Child shape name:" << shapeType;
-	//
-	//					// LOGVOL
-	//					const GeoLogVol* logVol = childVol->getLogVol();
-	//					const QString logName = QString::fromStdString(logVol->getName());
-	//					qDebug() << "Child LogVol name:"  << logName;
-	//
-	//
-	//					/*
-	//					 * STORE THE OBJECTS IN THE DB
-	//					 */
-	//
-	//					// store the Material object in the DB
-	//					QVariant child_matId = storeObj(mat, matName);
-	//
-	//					// store the Shape object in the DB
-	//					QVariant child_shapeId = storeObj(shape, shapeType);
-	//
-	//					// store the LogVol volume in the DB
-	//					QVariant child_logvolId = storeObj(logVol, logName, child_shapeId, child_matId);
-	//
-	//					// store the PhysVol volume in the DB
-	//					storeObj(childVol, child_logvolId, physId);
-	//
-	//					// store the parent-child relationship in the DB
-	//					storeChildPosition(physId, childVol, childPos);
-	//
-	//				} else {
-	//					qDebug() << "Child volume stored already. Moving to the next one...";
-	//				}
-	//
-	//			}
-	//			// GeoSerialDenominator child
-	//			else if ( dynamic_cast<const GeoSerialDenominator*>( &(*(vol->getChildVol(i) ))) ) {
-	//				qDebug() << "\t\t" << "the child" << i << "is a GeoSerialDenominator";
-	//				//qWarning() << "\t\t" << "to be implemented!!!";
-	//				const GeoVPhysVol *childVolV = &(*(vol->getChildVol(i)));
-	//				const GeoSerialDenominator* childVol = dynamic_cast<const GeoSerialDenominator*>(childVolV);
-	//
-	//				std::string baseNameStr = childVol->getBaseName();
-	//				QString baseName = QString::fromStdString(baseNameStr);
-	//
-	//				QString address = getAddressStringFromPointer( childVol );
-	//
-	//				qDebug() << "base name:" << baseName << "address:" << address;
-	//
-	//				QVariant sdId;
-	//
-	//				// check if this object has been stored already
-	//				if (! isAddressStored(address)) {
-	//					// store the SerialDenominator object in the DB
-	//					qDebug() << "New SerialDenominator, storing it...";
-	//					sdId = storeObj(childVol, baseName);
-	//					qDebug() << "SerialDenominator stored. Id:" << sdId.toString();
-	//
-	//				} else {
-	//					sdId = getStoredIdFromAddress(address);
-	//					qDebug() << "SerialDenominator already stored in the DB. Got id:" << sdId.toString();
-	//				}
-	//
-	//				// store the parent-child relationship in the DB
-	//				storeChildPosition(physId, childVol, childPos);
-	//
-	//			}
-	//			// GEOFULLPHYSVOL child
-	//			else if ( dynamic_cast<const GeoFullPhysVol*>( &(*(vol->getChildVol(i) ))) ) {
-	//				qDebug() << "\t\t" << "the child" << i << "is a GeoFullPhysVol";
-	//				qWarning() << "\t\t" << "to be implemented!!!";
-	//				//				const GeoVFullPhysVol *childVolV = &(*(vol->getChildVol(i)));
-	//				//				const GeoFullPhysVol* childVol = dynamic_cast<const GeoFullPhysVol*>(childVolV);
-	//			}
-	//			else {
-	//				qCritical("\t\tERROR!! the child is not a persistified volume/node!!!");
-	//				return;
-	//			}
-	//
-	//
-	//			// examples:
-	//			//const GeoVPhysVol *child=&(*(pv->getChildVol(i)));
-	//			//
-	//			//if ( dynamic_cast<const GeoLogVol*>( &(*(vol->getChildVol(i) ))) )
-	//			//	qDebug() << "\t\t" << "the child" << i << "is a GeoLogVol";
-	//
-	//
-	//
-	//			/*
-	//				unsigned int nchildvol = pvc->getNChildVols();
-	//				     int lgg = 0;
-	//				     int llay = 0;
-	//				     std::string::size_type npos;
-	//				     for (unsigned ich=0; ich<nchildvol; ++ich) {
-	//				       PVConstLink pc = pvc->getChildVol(ich);
-	//				       std::string childname = (pc->getLogVol())->getName();
-	//				       if ((npos = childname.find("layer")) != std::string::npos ) {
-	//				         llay ++;
-	//				         //std::cerr<<" navigating RPC named "
-	//				         //       <<tname<<" child "
-	//				         //       <<ich<<" is a layer with tag "<<llay<<std::endl;
-	//				         unsigned int nch1 = pc->getNChildVols();
-	//				         lgg = 0;
-	//				         for (unsigned ngv=0; ngv<nch1; ++ngv) {
-	//				           PVConstLink pcgv = pc->getChildVol(ngv);
-	//				           std::string childname1 = (pcgv->getLogVol())->getName();
-	//				           if ((npos = childname1.find("gas volume")) != std::string::npos ) {
-	//				         lgg ++;
-	//				         //std::cerr<<" navigating RPC named "
-	//				         //       <<tname<<" child "
-	//				         //       <<ngv<<" is a gas volume  with tag "<<lgg<<std::endl;
-	//				         PVConstLink pcgg = pcgv->getChildVol(0);
-	//				         HepGeom::Transform3D trans = pvc->getXToChildVol(ich)*pc->getXToChildVol(ngv)*pcgv->getXToChildVol(0);
-	//				         m_Xlg[llay-1][lgg-1] = Amg::CLHEPTransformToEigen(trans);
-	//				           }
-	//				         }
-	//				       }
-	//				     }
-	//			 */
-	//
-	//		}
-	//	}
-
-
-	//	else {
-	//		qDebug() << "Object stored already. Moving to next one...";
-	//	}
-// }
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
deleted file mode 100644
index e2bf7b0be746..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
+++ /dev/null
@@ -1,1700 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// author: Riccardo.Maria.Bianchi@cern.ch
-// major updates: 
-// - Aug 2018 - Riccardo Maria BIANCHI
-// - Sep 2018 - Riccardo Maria BIANCHI
-// - May 2020 - J. Boudreau (write out GeoUnidentifiedShape
-
-// local includes
-#include "GeoWrite/DumpGeoModelActionLocal.h"
-
-// TFPersistification includes
-#include "TFPersistification/TransFunctionPersistifier.h"
-
-
-// GeoModelKernel includes
-#include "GeoModelKernel/GeoNodePath.h"
-#include "GeoModelKernel/GeoCountVolAction.h"
-// GeoModelKernel shapes
-#include "GeoModelKernel/GeoBox.h"
-#include "GeoModelKernel/GeoCons.h"
-#include "GeoModelKernel/GeoPara.h"
-#include "GeoModelKernel/GeoPcon.h"
-#include "GeoModelKernel/GeoPgon.h"
-#include "GeoModelKernel/GeoSimplePolygonBrep.h"
-#include "GeoModelKernel/GeoTrap.h"
-#include "GeoModelKernel/GeoTrd.h"
-#include "GeoModelKernel/GeoTube.h"
-#include "GeoModelKernel/GeoTubs.h"
-#include "GeoModelKernel/GeoShapeIntersection.h"
-#include "GeoModelKernel/GeoShapeShift.h"
-#include "GeoModelKernel/GeoShapeSubtraction.h"
-#include "GeoModelKernel/GeoShapeUnion.h"
-#include "GeoModelKernel/GeoUnidentifiedShape.h"
-// Qt includes
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QSqlRecord>
-#include <QSqlDriver>
-#include <QVector>
-#include <QDebug>
-
-// C++ includes
-#include <sstream>
-
-
-// CLHEP includes // TODO: to remove once the migration to Eigen is complete
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Matrix/SymMatrix.h"
-#include "CLHEP/Matrix/Matrix.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h" // TODO: to be removed when dropping CLHEP
-
-
-
-// int DumpGeoModelActionLocal::getChildPosition(unsigned int parentId)
-// {
-// 	if ( ! (m_parentChildrenMap.contains(parentId)) ) {
-// 		m_parentChildrenMap[parentId] = 0;
-// 	}
-// 	++m_parentChildrenMap[parentId];
-// 	return m_parentChildrenMap[parentId];
-// }
-
-
-
-/// Get next child position available, given the parent type, id and copy number
-unsigned int DumpGeoModelActionLocal::getChildPosition(const QString parentId, const QString parentType, const unsigned int copyN)
-{
-	qDebug() << "DumpGeoModelActionLocal::getChildPosition()";
-	QString tableId = getIdFromNodeType(parentType);
-	QString key = tableId + ":" + parentId + ":" + QString::number(copyN);
-
-	if ( ! (m_parentChildrenMap2.contains(key)) ) {
-		m_parentChildrenMap2[key] = 1;
-	} else {
-	    ++m_parentChildrenMap2[key];
-    }
-
-    qDebug() << "parent key:" << key << " [tableId:parentId:copyN] - pos: " <<  m_parentChildrenMap2[key];
-	return m_parentChildrenMap2[key];
-}
-
-unsigned int DumpGeoModelActionLocal::setVolumeCopyNumber(QString volId, QString volType)
-{
-	qDebug() << "DumpGeoModelActionLocal::setVolumeCopyNumber()";
-	QString tableId = getIdFromNodeType(volType);
-	QString key = tableId + ":" + volId;
-
-	if ( ! (m_volumeCopiesMap.contains(key)) ) {
-		m_volumeCopiesMap[key] = 1;
-	} else {
-    	++m_volumeCopiesMap[key];
-    }
-
-    qDebug() << "volume key:" << key << " [tableId:volumeId] - copy number: " <<  m_volumeCopiesMap[key];
-	return m_volumeCopiesMap[key];
-}
-
-
-unsigned int DumpGeoModelActionLocal::getLatestParentCopyNumber(QString parentId, QString parentType)
-{
-	qDebug() << "DumpGeoModelActionLocal::getLatestParentCopyNumber()";
-	QString tableId = getIdFromNodeType(parentType);
-	QString key = tableId + ":" + parentId;
-    qDebug() << "key:" << key;
-
-	if ( ! (m_volumeCopiesMap.contains(key)) ) {
-		qFatal("ERROR!!! Something's wrong in storing the number of copies!");
-	}
-
-    qDebug() << "get latest parent copy number:" << key << " [tableId:parentId] - copy number: " <<  m_volumeCopiesMap[key];
-	return m_volumeCopiesMap[key];
-}
-
-
-
-// int DumpGeoModelActionLocal::getNewIdByNodeType(QString nodeType)
-// {
-// 	if ( ! (m_idsMap.contains(nodeType)) ) {
-// 		m_idsMap[nodeType] = 0;
-// 	}
-// 	++m_idsMap[nodeType];
-// 	return m_idsMap[nodeType];
-// }
-
-
-void DumpGeoModelActionLocal::handlePhysVol (const GeoPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handlePhysVol(GeoPhysVol*)";
-	handleVPhysVolObjects( vol );
-}
-
-
-void DumpGeoModelActionLocal::handleFullPhysVol (const GeoFullPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleFullPhysVol( GeoFullPhysVol* )";
-	handleVPhysVolObjects( vol );
-}
-
-
-void DumpGeoModelActionLocal::handleVPhysVolObjects(const GeoVPhysVol* vol)
-{
-	qDebug() << "DumpGeoModelActionLocal::handleVPhysVolObjects( GeoVPhysVol* )";
-
-
-	// get the address string for the current volume
-	QString address = getAddressStringFromPointer( vol );
-
-	// variables used to persistify the object
-	QVariant physId;
-
-	// check the volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-    const GeoVPhysVol* tailVol = path->getTail();
-    const GeoVPhysVol* headVol = path->getHead();
-    const GeoVPhysVol* upperVol = nullptr;
-    if (len > 1)
-        upperVol = path->getItem(len-2); // item(len-1) is THIS volume ==> the length is updated when visiting a VPhysVol node
-    else
-        upperVol = path->getItem(len-1); // ROOT volume
-	qDebug() << "path: " << path << " - length: " << len << " - upper vol: " << upperVol << " - tail vol: " << tailVol << " - head vol: " << headVol;
-	//	std::cout << "path: " << path << std::endl;
-
-	// this below is performed until the root volume is found, then "length" is not used anymore,
-	// because not updated when recursively visiting children of PhysVols: it is updated only when a PhysVol node is visited
-
-	bool doGetParentNode = true;
-	bool storeRootVolume = false;
-	bool isRootVolume = false;
-
-
-	if ( ! m_rootVolumeFound) {
-		if (len > 1) {
-			doGetParentNode = true; // TODO: is that needed????
-		} else{
-			qDebug() << "This is the Root volume!";
-            isRootVolume = true;
-			m_rootVolumeFound = true;
-			storeRootVolume = true;
-			doGetParentNode = false;
-		}
-	} else {
-		doGetParentNode = true;
-	}
-
-	// When dumping an unconnected sub-tree, e.g. a PhysVol used only in a SerialTransformer,
-	// we don't want to get the parent ID.
-	// If we do, the ID of the parent of the SerialTransformer is returned, which is wrong.
-	if (m_unconnectedTree) {
-		doGetParentNode = false;
-		qDebug() << "Handling an unconnected tree: we skip the parent-finding step...";
-		// now, we reset the status,
-		// otherwise all the children of the first referenced, unconnected volume
-		// will be treated as unconnected as well
-		qDebug() << "setting 'unconnected' to: false";
-		m_unconnectedTree = false;
-	}
-
-
-	// // get the parent volume
-	// QStringList parentList = getParentNode(); // you can use that, but you have to modify it to get len-2, instead of len-1, for VPhysVol nodes
-	// QString parentId = parentList[0];
-	// QString parentType = parentList[1];
-
-	// get the parent volume, if this is not the Root volume or an unconnected sub-tree
-	const GeoVPhysVol* parentNode = nullptr;
-	QVariant parentId = "NULL";
-
-    QString volTypeStr = "NNN";
-
-	if (doGetParentNode) {
-
-        bool isShared = vol->isShared();
-        qDebug() << "is this node shared?" << isShared;
-
-        //if (isShared)
-            parentNode = upperVol;
-        //else
-		//    parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() ))); // this cannot be trust for shared nodes
-        qDebug() << "parentNode address" << parentNode;
-
-		if (parentNode) {
-			QString parentAddress = getAddressStringFromPointer(parentNode);
-			qDebug() << "==> parent's address:" << parentNode;
-
-			if (isAddressStored(parentAddress))
-				parentId = getStoredIdFromAddress(parentAddress);
-			//		else
-			//			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-			qDebug() << "==> parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-		}
-		else {
-			qDebug() << "NULL parent node!! --> this node appeared unconnected.";
-		}
-	}
-
-	// counting children
-	unsigned int nChildren = vol->getNChildVols();
-	qDebug() << "number of child physical volumes:" << nChildren;
-	qDebug() << "[number of PhysVol and SerialTransformer child nodes:" << vol->getNChildVolAndST() << "]";
-
-	//// for debug
-	// GeoCountVolAction cv;
-	// cv.setDepthLimit(1);
-	// vol->exec(&cv);
-	// int nChildCount = cv.getCount();
-	// qDebug() << "number of child volumes:" << nChildCount;
-
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		/*
-		 * VPhysVol features:
-		 * - 1 parent VPhysVol (if any)
-		 * - 1 LogVol
-		 * - 1 Material
-		 * - 1 Shape
-		 */
-
-		// Note: PhysVol has no name. Its LogVol has a name.
-		//	  const std::string name = vol->getLogVol()->getName();
-
-		// LOGVOL
-		const GeoLogVol* logVol = vol->getLogVol();
-		const QString logName = QString::fromStdString(logVol->getName());
-		qDebug() << "LogVol name:"  << logName;
-
-
-		// MATERIAL
-		const GeoMaterial * mat = vol->getLogVol()->getMaterial();
-		// const QString matName = QString::fromStdString(mat->getName());
-		// qDebug() << "material name:" << matName << ", address:" << mat;
-
-
-		// SHAPE
-		const GeoShape * shape = vol->getLogVol()->getShape();
-		// const QString shapeType = QString::fromStdString(shape->type());
-		// qDebug() << "shape name:" << shapeType  << ", address:" << shape;
-		// // get shape parameters
-		// QString shapePars = getShapeParameters(shape);
-
-
-		/*
-		 * STORE THE OBJECTS IN THE DB
-		 */
-
-		// store/get the Material object into/from the DB
-		QVariant matId;
-		// matId = storeObj(mat, matName);
-		matId = storeMaterial(mat);
-
-		// store/get the Shape object into/from the DB
-		QVariant shapeId;
-		shapeId = storeShape(shape);
-		// shapeId = storeObj(shape, shapeType, shapePars);
-
-		// store/get the LogVol object into/from the DB
-		QVariant logvolId;
-		logvolId = storeObj(logVol, logName, shapeId, matId);
-
-		if (dynamic_cast<const GeoPhysVol*>(vol)) {
-			qDebug() << "New PhysVol, storing it...";
-			const GeoPhysVol* physVol = dynamic_cast<const GeoPhysVol*>(vol);
-			// store the PhysVol volume into the DB
-			physId = storeObj(physVol, logvolId, parentId, storeRootVolume); // with parent info
-            volTypeStr = "GeoPhysVol";
-			qDebug() << "PhysVol stored. Id:" << physId.toString();
-		}
-		else if (dynamic_cast<const GeoFullPhysVol*>(vol)) {
-			qDebug() << "New FullPhysVol, storing it...";
-			const GeoFullPhysVol* fullVol = dynamic_cast<const GeoFullPhysVol*>(vol);
-			// store the FullPhysVol volume into the DB
-			physId = storeObj(fullVol, logvolId, parentId, storeRootVolume); // with parent info
-            volTypeStr = "GeoFullPhysVol";
-			qDebug() << "FullPhysVol stored. Id:" << physId.toString();
-		} else {
-			qWarning() << "WARNING!! Unknown GeoVPhysVol type!!";
-		}
-
-	} else {
-		//	qDebug() << "Volume stored already. It is a shared volume. Taking ID from memory map and moving to its physical children...";
-		qDebug() << "Volume stored already. It is a shared volume. Now, we are handling a 'copy' of it. We take the ID from memory map...";
-		physId = getStoredIdFromAddress(address);
-        volTypeStr = getGeoTypeFromVPhysVol(vol);
-	}
-
-    // Now we get the 'copy number' for this volume,
-    // to distinguish this volume from the other volumes created from the same shared node (if any)
-    if (volTypeStr == "NULL") qFatal("ERROR!! volTypeStr is 'NULL'!!!");
-    const unsigned int volCopyN = setVolumeCopyNumber(physId.toString(), volTypeStr);
-    qDebug() << "physId: " << physId << "- volume copy number: " << volCopyN;
-
-    if ( isRootVolume || parentId == "NULL") {
-        qDebug() << "This is the RootVolume or the volume has 'NULL' parent (unconnected subtree?) - So, we do not store the child position for this volume!";
-    } else {
-	    // store the parent-child relationship in the DB
-	    QString parentType = getGeoTypeFromVPhysVol(parentNode);
-        // get the copy number of the parent
-        const unsigned int parentCopyN = getLatestParentCopyNumber(parentId.toString(), parentType);
-	    qDebug() << "PhysVol Id:" << physId << " - copyNumber:" << QString::number(parentCopyN);
-
-	    QString childType  = getGeoTypeFromVPhysVol(vol);
-
-	    storeChildPosition(parentId, parentType, physId, parentCopyN, getChildPosition( parentId.toString(), parentType, parentCopyN), childType, volCopyN);
-    }
-}
-
-
-QString DumpGeoModelActionLocal::getGeoTypeFromVPhysVol(const GeoVPhysVol* vol)
-{
-	if (!vol)
-		return QString("NULL");
-
-	QString geoType;
-	if (dynamic_cast<const GeoPhysVol*>(vol)) {
-		qDebug() << "GeoType: GeoPhysVol";
-		geoType = "GeoPhysVol";
-	}
-	else if (dynamic_cast<const GeoFullPhysVol*>(vol)) {
-		qDebug() << "GeoType: GeoFullPhysVol";
-		geoType = "GeoFullPhysVol";
-	} else {
-		qWarning() << "WARNING!! Unknown GeoVPhysVol type!!";
-	}
-	return geoType;
-}
-
-
-void DumpGeoModelActionLocal::handleSerialDenominator (const GeoSerialDenominator *node)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleSerialDenominator(GeoSerialDenominator*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-	std::string baseNameStr = node->getBaseName();
-	QString baseName = QString::fromStdString(baseNameStr);
-	qDebug() << "base name:" << baseName << "address:" << address;
-
-	// variables used to persistify the object
-	QVariant sdId;
-
-	// get the parent volume
-	QStringList parentList = getParentNode();
-	QString parentId = parentList[0];
-	QString parentType = parentList[1];
-	unsigned int parentCopyN = getLatestParentCopyNumber(parentId, parentType);
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New SerialDenominator, storing it...";
-
-		/* STORE THE OBJECT IN THE DB */
-		sdId = storeObj(node, baseName);
-		qDebug() << "SerialDenominator stored. Id:" << sdId.toString();
-
-	} else {
-		sdId = getStoredIdFromAddress(address);
-		qDebug() << "SerialDenominator already stored in the DB. Id:" << sdId.toString();
-	}
-
-	storeChildPosition(parentId, parentType, sdId, parentCopyN, getChildPosition( parentId, parentType, parentCopyN ), "GeoSerialDenominator", 0); // TODO: Check if the copyN=0 at the end is OK for nodes as Transforms, which cannot be used as parents, only as children!
-}
-
-
-
-void DumpGeoModelActionLocal::handleSerialTransformer (const GeoSerialTransformer *node)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleSerialTransformer(GeoSerialTransformer*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-	// variables used to persistify the object
-	QVariant functionId;
-	QVariant physvolId;
-	QVariant physvolTable;
-	unsigned int nCopies;
-	QVariant stId;
-
-	// get the parent volume
-	QStringList parentList = getParentNode();
-	QString parentId = parentList[0];
-	QString parentType = parentList[1];
-	unsigned int parentCopyN = getLatestParentCopyNumber(parentId, parentType);
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New SerialTransformer, storing it...";
-
-		/*
-		 * Get Node characteristics
-		 *
-		 * SerialTransformer features:
-		 * - 1 parent PhysVol (if any)
-		 * - 1 GENFUNCTION
-		 * - 1 PhysVolId
-		 * - 1 PhysVolType
-		 * - 1 number of copies
-		 */
-		// get linked function and number of copies
-		const GeoXF::Function * func = node->getFunction();
-		nCopies =  node->getNCopies();
-		qDebug() << "n. of copies:" << QString::number(nCopies);
-
-		// get linked VPhysVol volume
-		const GeoVPhysVol *vol = &( *( node->getVolume() ) );
-		// const GeoPhysVol* vol = dynamic_cast<const GeoPhysVol*>(volV);
-		QString volType;
-		if (dynamic_cast<const GeoPhysVol*>(vol)) {
-			volType = "GeoPhysVol";
-		} else if (dynamic_cast<const GeoFullPhysVol*>(vol)) {
-			volType = "GeoFullPhysVol";
-		} else {
-			qWarning() << "ERROR!!! Unknown VPhysVol type!!";
-		}
-
-		/*
-		 * Persistify the Function
-		 */
-	 	TransFunctionPersistifier persistifier;
-        try {
-            persistifier.persistify(*func);
-        } catch (const std::runtime_error & error) {
-            std::cout << "SEVERE WARNING!! Handling std::runtime_error! -->" << error.what() << std::endl;
-        }
-		QString expression = QString::fromStdString( persistifier.getCodedString() );
-		qDebug() << "FUNCTION:" << expression;
-
-		if (expression.size() == 0) {
-				qFatal("FATAL ERROR!! Function expression is empty!! Aborting...");
-				abort();
-		}
-
-
-		/*
-		 * STORE/GET THE INNER OBJECTS IN THE DB
-		 */
-
-		// store/get the Function object in the DB
-		functionId = storeObj(func, expression);
-
-		// store/get the PhysVol volume in the DB
-
-		/* Concerning the physVol referenced by the SerialTransformer:
-		 *
-		 * - if physvol is not stored in the DB already;
-		 * - if physVol has no parent (==NULL)
-		 * ==> it means that its children will never visited by the NodeAction executed on the root tree
-		 *
-		 * ==> So, we need to persitify it as a new tree, to get all its children visited and persistified
-		 *
-		 */
-		qDebug() << "Handling the referenced VPhysVol, going into the sub-tree, if any...";
-		handleReferencedVPhysVol(vol);
-
-		qDebug() << "Storing the referenced VPhysVol...";
-		QString physvolAddress = getAddressStringFromPointer(vol);
-		physvolId = getStoredIdFromAddress(physvolAddress);
-
-
-		/*
-		 * STORE THE NODE INTO THE DB AND ITS POSITION WITHIN THE TREE
-		 */
-		// store the SerialTransformer volume in the DB
-		stId = storeObj(node, functionId, physvolId, volType, nCopies);
-		qDebug() << "SerialTransformer stored. Id:" << stId.toString();
-
-	} else {
-		stId = getStoredIdFromAddress(address);
-		qDebug() << "SerialTransformer already stored in the DB. Id:" << stId.toString();
-	}
-
-	qDebug() << "Storing:" << parentId << parentType << stId;
-	storeChildPosition(parentId, parentType, stId, parentCopyN, getChildPosition( parentId, parentType, parentCopyN ), "GeoSerialTransformer", 0); // TODO: Check if the copyN=0 at the end is OK for nodes as Transforms, which cannot be used as parents, only as children!
-}
-
-
-
-
-void DumpGeoModelActionLocal::handleTransform(const GeoTransform* node)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleTransform(GeoTransform*)";
-
-	QString address = getAddressStringFromPointer( node );
-
-	// get the parent volume
-	QStringList parentList = getParentNode();
-	QString parentId = parentList[0];
-	QString parentType = parentList[1];
-
-    unsigned int parentCopyN = getLatestParentCopyNumber(parentId, parentType);
-
-	/*
-	 * STORE THE OBJECT IN THE DB AND ITS PLACE WITHIN THE TREE
-	 */
-
-	 // store the transformation in the DB
-	 QVariant trId = storeTranform(node);
-
-	// Store the child-parent relationship
-
-	if ( dynamic_cast<const GeoAlignableTransform*>(node) ) {
-		qDebug() << "Storing a GeoAlignableTransform...";
-		storeChildPosition(parentId, parentType, trId, parentCopyN, getChildPosition( parentId, parentType, parentCopyN ), "GeoAlignableTransform", 0); // TODO: Check if the copyN=0 at the end is OK for nodes as Transforms, which cannot be used as parents, only as children!
-	}
-	else if ( dynamic_cast<const GeoTransform*>(node) ) {
-		qDebug() << "Storing a GeoTransform...";
-		storeChildPosition(parentId, parentType, trId, parentCopyN, getChildPosition( parentId, parentType, parentCopyN ), "GeoTransform", 0); // TODO: Check if the copyN=0 at the end is OK for nodes as Transforms, which cannot be used as parents, only as children!
-	}
-	else {
-		qWarning("Not implemented yet!!!! ");
-	}
-
-}
-
-
-void DumpGeoModelActionLocal::handleNameTag(const GeoNameTag* node)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleNameTag(GeoNameTag*)";
-
-	std::string nameStr = node->getName();
-	QString name = QString::fromStdString(nameStr);
-	qDebug() << "name:" << name;
-
-	QString address = getAddressStringFromPointer( node );
-
-	// get the parent volume
-	QStringList parentList = getParentNode();
-	QString parentId = parentList[0];
-	QString parentType = parentList[1];
-    unsigned int parentCopyN = getLatestParentCopyNumber(parentId, parentType);
-
-    // TODO: add "if stored"...
-
-	/*
-	 * STORE THE OBJECT IN THE DB AND ITS POSITION WITHIN THE TREE
-	 */
-
-	 // store the name tag in the DB
-	 QVariant nameId = storeObj(node, name);
-
-	 // Store the child-parent relationship
-	 storeChildPosition(parentId, parentType, nameId, parentCopyN, getChildPosition( parentId, parentType, parentCopyN ), "GeoNameTag", 0);
-}
-
-
-
-//__________________________________________________
-QStringList DumpGeoModelActionLocal::getParentNode()
-{
-    qDebug() << "DumpGeoModelActionLocal::getParentNode()";
-
-	// check the current volume position in the geometry tree
-	GeoNodePath* path = getPath();
-	unsigned int len = path->getLength();
-	qDebug() << "length: " << len;
-
-	// reset the number of visited node, if len is different than before
-	if (len > m_len) {
-		m_len_nChild = 0;
-		m_len = len;
-	}
-	// update number of visited nodes if len is the same as before
-	else {
-		++m_len_nChild;
-	}
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = nullptr;
-	QVariant parentId = "NULL";
-	QString parentType = "NULL";
-
-		if (len >= 1)
-		{
-			// get the parent node
-			parentNode = path->getItem(len-1); // i=(len-1) gives you the parent VPhysVol
-
-			if (parentNode) {
-
-				// get the parent type
-				parentType = getGeoTypeFromVPhysVol(parentNode);
-
-				// get the parent memory address
-				QString parentAddress = getAddressStringFromPointer(parentNode);
-				qDebug() << "-- parent's address:" << parentNode;
-
-				// get the id of the parent node, which should be stored already in the DB
-				if (isAddressStored(parentAddress)) {
-					parentId = getStoredIdFromAddress(parentAddress);
-				}
-				else {
-					// qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-					qWarning() << "The parent node of this child node seems to not having be stored in the DB yet! [It is normal if it is the root volume or a transformation node used for example only in the definition of a 'GeoShapeShift' instance]";
-				}
-				qDebug() << "-- parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-			}
-		}
-		else{
-			// qWarning() << "ERROR!! Len == 1, but this cannot be the Root volume!";
-			qWarning() << "WARNING!! Len == 0, but this cannot be the Root volume!";
-		}
-
-		QStringList parentList;
-		parentList << parentId.toString() << parentType;
-
-		return  parentList;
-}
-
-
-//__________________________________________________________________
-QVariant DumpGeoModelActionLocal::storeShape(const GeoShape* shape)
-{
-	const QString shapeType = QString::fromStdString(shape->type());
-	qDebug() << "storeShape() - shape name:" << shapeType  << ", address:" << shape;
-	// get shape parameters
-	QString shapePars = getShapeParameters(shape);
-	// store the shape in the DB and returns the ID
-	return storeObj(shape, shapeType, shapePars);
-}
-
-
-//______________________________________________________________________
-QVariant DumpGeoModelActionLocal::storeMaterial(const GeoMaterial* mat)
-{
-	const QString matName = QString::fromStdString(mat->getName());   //The name of the material.
-	const QString matID = QString::number(mat->getID());              //Gives an integral identifier for the material.For convenience.
-	const QString matDensity = QString::number(mat->getDensity());	  //The density of the material.
-	const unsigned int numElements = mat->getNumElements();
-
-	const QString matNumElements = QString::number(numElements);
-	qDebug() << "storeMaterial() - material name:" << matName
-			<< ", address:" << mat
-			<< ", matID:" << matID
-			<< ", matDensity:" << matDensity
-	        << ", matNumElements:" << matNumElements;
-
-	// loop over the elements composing the material
-	QString matElements;
-	QStringList matElementsList;
-	for (unsigned int i=0; i < numElements; i++) {
-
-		//Gets the i-th element.
-	  const GeoElement* element = mat->getElement(i);
-	  std::string elName = element->getName();
-	  /*
-	  std::cout << "\t element n. " << i << std::endl;
-	  std::cout << "\t element address: " << element << std::endl;
-	  std::cout << "\t element name: " << elName << std::endl;
-	  */
-
-	  // Store the element and get its DataBase ID
-	  QVariant elementId = storeElement(element);
-
-	  //Gets the fraction by weight of the i-th element
-	  const QString elementFraction = QString::number( mat->getFraction(i) );
-
-	  qDebug() << "\t--> element ID: " << elementId.toString() << " - getFraction:" << elementFraction;
-
-	  matElementsList << elementId.toString() + ":" + elementFraction;
-	}
-	matElements = matElementsList.join(";");
-
-	qDebug() << "\t==> material's elements:" << matElements;
-
-	// store the material in the DB and returns the ID
-	return storeObj(mat, matName, matDensity, matElements);
-}
-
-//_______________________________________________________________________
-QVariant DumpGeoModelActionLocal::storeElement(const GeoElement* el)
-{
-	//	The name of the element, e.g. "Carbon".
-	const QString elName = QString::fromStdString(el->getName());
-
-	//	The chemical symbol for the element, e.g. C, O, S, Na....
-	const QString elSymbol = QString::fromStdString(el->getSymbol());
-
-	//	The atomic number Z for the material.
-	const QString elZ = QString::number(el->getZ());
-
-	//	The average atomic mass for the element.
-	const QString elA = QString::number(el->getA());
-
-	// store the material in the DB and returns the ID
-	return storeObj(el, elName, elSymbol, elZ, elA);
-}
-
-//_______________________________________________________________________
-QVariant DumpGeoModelActionLocal::storeTranform(const GeoTransform* node)
-{
-	/*
-	 * STORE THE OBJECT IN THE DB
-	 */
-
-	 QString address = getAddressStringFromPointer( node );
-
-	 QVariant trId;
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "New Transform, storing it...";
-
-
-		HepGeom::Transform3D tr = Amg::EigenTransformToCLHEP( node->getTransform() );
-
-		std::vector<double> params = getTransformParameters(tr);
-		qDebug() << "Transform parameters:" << QVector<double>::fromStdVector(params);
-
-		/*
-		 * STORE THE OBJECT IN THE DB
-		 */
-
-		// store the object in the DB
-		if ( dynamic_cast<const GeoAlignableTransform*>(node) ) {
-			trId = storeObj(dynamic_cast<const GeoAlignableTransform*>(node), params);
-			qDebug() << "AlignableTransform stored. Id:" << trId.toString();
-		}
-		else if ( dynamic_cast<const GeoTransform*>(node) ) {
-			trId = storeObj(dynamic_cast<const GeoTransform*>(node), params);
-			qDebug() << "Transform stored. Id:" << trId.toString();
-		}
-		else {
-			qDebug() << "WARNING!!! - This type of transformation needs to be customized yet!!";
-		}
-
-	} else {
-		trId = getStoredIdFromAddress(address);
-		qDebug() << "Transform already stored in the DB. Id:" << trId.toString();
-	}
-
-	return trId;
-}
-
-
-void DumpGeoModelActionLocal::handleReferencedVPhysVol (const GeoVPhysVol *vol)
-{
-	qDebug() << "\nDumpGeoModelActionLocal::handleReferencedVPhysVol(GeoVPhysVol*)";
-
-	// qDebug() << "PhysVol's LogVol name:" << QString::fromStdString(vol->getLogVol()->getName());
-
-	// get the address string for the current volume
-	QString address = getAddressStringFromPointer( vol );
-
-	QVariant parentId = "NULL";
-
-	qDebug() << "setting 'unconnected' to: false";
-	m_unconnectedTree = false;
-
-	// get the parent volume, if this is not the Root volume
-	const GeoVPhysVol* parentNode = dynamic_cast<const GeoVPhysVol*>( &(*(vol->getParent() )));
-
-	if (parentNode) {
-		QString parentAddress = getAddressStringFromPointer(parentNode);
-		qDebug() << "--> parent's address:" << parentNode;
-
-		if (isAddressStored(parentAddress))
-			parentId = getStoredIdFromAddress(parentAddress);
-		//		else
-		//			qFatal("FATAL ERROR!!! - The parent node of this child should has been stored in the DB already, but it was not found!!");
-
-		qDebug() << "--> parent's LogVol name:" << QString::fromStdString(parentNode->getLogVol()->getName());
-	}
-	else {
-		qDebug() << "NULL parent node!! --> it seems to be an unconnected subtree.";
-		qDebug() << "setting 'unconnected' to: true";
-		m_unconnectedTree = true;
-	}
-
-    // *** FOR DEBUG ***
-	// // counting children
-	// unsigned int nChildren = vol->getNChildVols();
-	// qDebug() << "number of child physical volumes:" << nChildren;
-	// qDebug() << "[number of PhysVol and SerialTransformer child nodes:" << vol->getNChildVolAndST() << "]";
-	//
-	// GeoCountVolAction cv;
-	// cv.setDepthLimit(1);
-	// vol->exec(&cv);
-	// int nChildCount = cv.getCount();
-	// qDebug() << "number of child volumes:" << nChildCount;
-    // *****************
-
-
-	// check if this object has been stored already
-	if (! isAddressStored(address)) {
-
-		qDebug() << "This is a new root PhysVol node of an 'unconnected' tree, so we start another action on it to dump it into the DB...";
-
-		// Dump the tree volumes into the DB
-		vol->exec(this); // TODO: check if the new action overwrites the id of the volumes already in the DB...!!!
-
-	} else {
-		qDebug() << "The referenced volume has been stored already. Skipping...";
-	}
-	// at the end, we make sure we reset the status
-	qDebug() << "setting 'unconnected' to: false";
-	m_unconnectedTree = false;
-}
-
-
-// Get shape parameters
-QString DumpGeoModelActionLocal::getShapeParameters(const GeoShape* shape)
-{
-	const QString shapeType = QString::fromStdString(shape->type());
-	qDebug() << "shapeType:" << shapeType;
-
-	QString shapePars = "";
-
-	if (shapeType == "Box") {
-		qDebug() << "get GeoBox parameters";
-		QStringList pars;
-		const GeoBox* box = dynamic_cast<const GeoBox*>(shape);
-		pars << "XHalfLength=" + QString::number(box->getXHalfLength()) ;
-		pars << "YHalfLength=" + QString::number(box->getYHalfLength()) ;
-		pars << "ZHalfLength=" + QString::number(box->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Cons") {
-		QStringList pars;
-		const GeoCons* shapeIn = dynamic_cast<const GeoCons*>(shape);
-		pars << "RMin1=" + QString::number(shapeIn->getRMin1()) ;
-		pars << "RMin2=" + QString::number(shapeIn->getRMin2()) ;
-		pars << "RMax1=" + QString::number(shapeIn->getRMax1()) ;
-		pars << "RMax2=" + QString::number(shapeIn->getRMax2()) ;
-		pars << "DZ=" + QString::number(shapeIn->getDZ()) ;
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Para") {
-		QStringList pars;
-		const GeoPara* shapeIn = dynamic_cast<const GeoPara*>(shape);
-		pars << "XHalfLength=" + QString::number(shapeIn->getXHalfLength()) ;
-		pars << "YHalfLength=" + QString::number(shapeIn->getYHalfLength()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "Alpha=" + QString::number(shapeIn->getAlpha()) ;
-		pars << "Theta=" + QString::number(shapeIn->getTheta()) ;
-		pars << "Phi=" + QString::number(shapeIn->getPhi()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Pcon") {
-		QStringList pars;
-		const GeoPcon* shapeIn = dynamic_cast<const GeoPcon*>(shape);
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi());
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi());
-		// get number of Z planes and loop over them
-		const int nZplanes = shapeIn->getNPlanes();
-		pars << "NZPlanes=" + QString::number(nZplanes);
-		for (int i=0; i<nZplanes; ++i) {
-			pars << "ZPos=" + QString::number(shapeIn->getZPlane(i));
-			pars << "ZRmin=" + QString::number(shapeIn->getRMinPlane(i));
-			pars << "ZRmax=" + QString::number(shapeIn->getRMaxPlane(i));
-		}
-		shapePars = pars.join(";");
-	} else if (shapeType == "Pgon") {
-		QStringList pars;
-		const GeoPgon* shapeIn = dynamic_cast<const GeoPgon*>(shape);
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		pars << "NSides=" + QString::number(shapeIn->getNSides()) ;
-		// get number of Z planes and loop over them
-		const int nZplanes = shapeIn->getNPlanes();
-		pars << "NZPlanes=" + QString::number(nZplanes);
-		for (int i=0; i<nZplanes; ++i) {
-			pars << "ZPos=" + QString::number(shapeIn->getZPlane(i));
-			pars << "ZRmin=" + QString::number(shapeIn->getRMinPlane(i));
-			pars << "ZRmax=" + QString::number(shapeIn->getRMaxPlane(i));
-		}
-		shapePars = pars.join(";");
-	} else if (shapeType == "SimplePolygonBrep") {
-		QStringList pars;
-		const GeoSimplePolygonBrep* shapeIn = dynamic_cast<const GeoSimplePolygonBrep*>(shape);
-		pars << "DZ=" + QString::number(shapeIn->getDZ()) ;
-		// get number of vertices and loop over them
-		const int nVertices = shapeIn->getNVertices();
-		pars << "NVertices=" + QString::number(nVertices);
-		for (int i=0; i<nVertices; ++i) {
-			pars << "xV=" + QString::number(shapeIn->getXVertex(i));
-			pars << "yV=" + QString::number(shapeIn->getYVertex(i));
-		}
-		shapePars = pars.join(";");
-	} else if (shapeType == "Trap") {
-		QStringList pars;
-		const GeoTrap* shapeIn = dynamic_cast<const GeoTrap*>(shape);
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "Theta=" + QString::number(shapeIn->getTheta()) ;
-		pars << "Phi=" + QString::number(shapeIn->getPhi()) ;
-		pars << "Dydzn=" + QString::number(shapeIn->getDydzn()) ;
-		pars << "Dxdyndzn=" + QString::number(shapeIn->getDxdyndzn()) ;
-		pars << "Dxdypdzn=" + QString::number(shapeIn->getDxdypdzn()) ;
-		pars << "Angleydzn=" + QString::number(shapeIn->getAngleydzn()) ;
-		pars << "Dydzp=" + QString::number(shapeIn->getDydzp()) ;
-		pars << "Dxdyndzp=" + QString::number(shapeIn->getDxdyndzp()) ;
-		pars << "Dxdypdzp=" + QString::number(shapeIn->getDxdypdzp()) ;
-		pars << "Angleydzp=" + QString::number(shapeIn->getAngleydzp()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Trd") {
-		QStringList pars;
-		const GeoTrd* shapeIn = dynamic_cast<const GeoTrd*>(shape);
-		pars << "XHalfLength1=" + QString::number(shapeIn->getXHalfLength1()) ;
-		pars << "XHalfLength2=" + QString::number(shapeIn->getXHalfLength2()) ;
-		pars << "YHalfLength1=" + QString::number(shapeIn->getYHalfLength1()) ;
-		pars << "YHalfLength2=" + QString::number(shapeIn->getYHalfLength2()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Tube") {
-		QStringList pars;
-		const GeoTube* tube = dynamic_cast<const GeoTube*>(shape);
-		pars << "RMin=" + QString::number(tube->getRMin()) ;
-		pars << "RMax=" + QString::number(tube->getRMax()) ;
-		pars << "ZHalfLength=" + QString::number(tube->getZHalfLength()) ;
-		shapePars = pars.join(";");
-	} else if (shapeType == "Tubs") {
-		QStringList pars;
-		const GeoTubs* shapeIn = dynamic_cast<const GeoTubs*>(shape);
-		pars << "RMin=" + QString::number(shapeIn->getRMin()) ;
-		pars << "RMax=" + QString::number(shapeIn->getRMax()) ;
-		pars << "ZHalfLength=" + QString::number(shapeIn->getZHalfLength()) ;
-		pars << "SPhi=" + QString::number(shapeIn->getSPhi()) ;
-		pars << "DPhi=" + QString::number(shapeIn->getDPhi()) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType == "Intersection") {
-		qDebug() << "get GeoShapeIntersection parameters";
-		QStringList pars;
-		const GeoShapeIntersection* shapeIn = dynamic_cast<const GeoShapeIntersection*>(shape);
-		// get the referenced Shape used in the 'union' operation, store it in the DB
-		const GeoShape* shapeOpA = shapeIn->getOpA();
-		QVariant shapeIdA = storeShape(shapeOpA);
-		const GeoShape* shapeOpB = shapeIn->getOpB();
-		QVariant shapeIdB = storeShape(shapeOpB);
-		pars << "opA=" + QString::number( shapeIdA.toUInt() ) ;
-		pars << "opB=" + QString::number( shapeIdB.toUInt() ) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType == "Shift") {
-		qDebug() << "get GeoShapeShift parameters";
-		QStringList pars;
-		const GeoShapeShift* shapeIn = dynamic_cast<const GeoShapeShift*>(shape);
-
-		// get the referenced Shape used in the 'shift' operation, store it in the DB
-		const GeoShape* shapeOp = shapeIn->getOp();
-		QVariant shapeId = storeShape(shapeOp);
-
-		// get the Transformation, store it in the DB
-		GeoTransform* transf = new GeoTransform( shapeIn->getX() );
-		QVariant trId = storeTranform(transf);
-
-		pars << "A=" + QString::number( shapeId.toUInt() ) ;
-		pars << "X=" + QString::number( trId.toUInt() ) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType == "Subtraction") {
-		qDebug() << "get GeoShapeSubtraction parameters";
-		QStringList pars;
-		const GeoShapeSubtraction* shapeIn = dynamic_cast<const GeoShapeSubtraction*>(shape);
-		// get the referenced Shape used in the 'union' operation, store it in the DB
-		const GeoShape* shapeOpA = shapeIn->getOpA();
-		QVariant shapeIdA = storeShape(shapeOpA);
-		const GeoShape* shapeOpB = shapeIn->getOpB();
-		QVariant shapeIdB = storeShape(shapeOpB);
-		pars << "opA=" + QString::number( shapeIdA.toUInt() ) ;
-		pars << "opB=" + QString::number( shapeIdB.toUInt() ) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType == "Union") {
-		qDebug() << "get GeoShapeUnion parameters";
-		QStringList pars;
-		const GeoShapeUnion* shapeIn = dynamic_cast<const GeoShapeUnion*>(shape);
-
-		// get the referenced Shape used in the 'union' operation, store it in the DB
-		const GeoShape* shapeOpA = shapeIn->getOpA();
-		QVariant shapeIdA = storeShape(shapeOpA);
-		const GeoShape* shapeOpB = shapeIn->getOpB();
-		QVariant shapeIdB = storeShape(shapeOpB);
-
-		pars << "opA=" + QString::number( shapeIdA.toUInt() ) ;
-		pars << "opB=" + QString::number( shapeIdB.toUInt() ) ;
-		shapePars = pars.join(";");
-	}
-	else if (shapeType=="UnidentifiedShape") {
-	  QStringList pars;
-	  const GeoUnidentifiedShape *shapeIn=dynamic_cast<const GeoUnidentifiedShape*>(shape);
-          pars << "name="+QString::fromStdString(shapeIn->name());
-	  pars << "asciiData="+QString::fromStdString(shapeIn->asciiData());
-	  shapePars=pars.join(";");
-	}
-
-	else {
-		qDebug() << "WARNING!!! - Shape '" << shapeType << "' needs to be customized!!";
-	}
-
-  return shapePars;
-
-}
-
-
-std::vector<double> DumpGeoModelActionLocal::getTransformParameters(HepGeom::Transform3D tr)
-{
-	std::vector<double> vec;
-
-	vec.push_back(tr.xx());
-	vec.push_back(tr.xy());
-	vec.push_back(tr.xz());
-
-	vec.push_back(tr.yx());
-	vec.push_back(tr.yy());
-	vec.push_back(tr.yz());
-
-	vec.push_back(tr.zx());
-	vec.push_back(tr.zy());
-	vec.push_back(tr.zz());
-
-	vec.push_back(tr.dx());
-	vec.push_back(tr.dy());
-	vec.push_back(tr.dz());
-
-	return vec;
-}
-
-
-DumpGeoModelActionLocal::DumpGeoModelActionLocal(GMDBManager &db)
-{
-	qDebug() << "DumpGeoModelActionLocal: constructor";
-
-	// init variables
-	m_len = 0;
-	m_len_nChild = 0;
-	m_rootVolumeFound = false;
-	m_unconnectedTree = false;
-
-	// init anche check the database handle
-	m_dbManager = &db;
-	if (m_dbManager->isOpen()) {
-		qDebug() << "OK! Database is open!";
-	}
-	else {
-		qDebug() << "Database is not open!";
-	}
-
-    m_dbpath = m_dbManager->getDBFilePath();
-
-	// get DB metadata
-	m_memMap_Tables = m_dbManager->getAll_NodeTypesTableIDs();
-	// qDebug() << "m_memMap_Tables:" << m_memMap_Tables;
-
-}
-
-DumpGeoModelActionLocal::~DumpGeoModelActionLocal()
-{
-	// nothing to do so far...
-}
-
-
-void DumpGeoModelActionLocal::showMemoryMap()
-{
-	qDebug() << "DumpGeoModelActionLocal::showMemoryMap()";
-
-	QMap<QString, QVariant>::const_iterator it = m_memMap.constBegin();
-	while (it != m_memMap.constEnd()) {
-		std::cout << it.key().toStdString() << ": " << it.value().toString().toStdString() << std::endl;
-		++it;
-	}
-}
-
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoMaterial* pointer, const QString name, const QString density, const QString elements)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoMaterial*) - name:" << name << "- address:" << pointer << "- density:" << density << "- elements:" << elements;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant materialId;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New Material! Storing it...";
-
-		materialId = addMaterial(name, density, elements);
-
-		storeAddress( address, materialId );
-	}
-	else {
-		qDebug() << "Material node stored already. Getting ID from the memory map...";
-		materialId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "materialId:" << materialId;
-	return materialId;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoElement* pointer, const QString name, const QString symbol, const QString elZ, const QString elA)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoElement*) - name:" << name << "address:" << pointer << " - symbol: " << symbol << " - elZ: " << elZ << " - elA: " << elA;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant elementId;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New Element! Storing it...";
-
-		elementId = addElement(name, symbol, elZ, elA);
-
-		storeAddress( address, elementId );
-	}
-	else {
-		qDebug() << "Element node stored already. Getting ID from the memory map...";
-		elementId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "elementId:" << elementId;
-	return elementId;
-}
-
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoShape* pointer, const QString name, const QString parameters)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoShape*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant shapeId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New Shape! Storing it...";
-
-		shapeId = addShape(name, parameters);
-
-		storeAddress( address, shapeId);
-	}
-	else {
-		qDebug() << "Shape node stored already. Getting ID from the memory map...";
-		shapeId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "shapeId:" << shapeId;
-	return shapeId;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoLogVol* pointer, const QString name, const QVariant shapeId, const QVariant materialId)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoLogVol*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant logvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New LogVol! Storing it...";
-
-		logvolId = addLogVol(name, shapeId, materialId);
-
-		storeAddress( address, logvolId );
-	}
-	else {
-		qDebug() << "LogVol node stored already. Getting ID from the memory map...";
-		logvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "logvolId:" << logvolId;
-	return logvolId;
-}
-
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoPhysVol* pointer, const QVariant logvolId, const QVariant parentId, bool isRootVolume)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoPhysVol*) - address:" << pointer << "- is root volume?" << isRootVolume;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant physvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New PhysVol! Storing it...";
-
-		physvolId = addPhysVol(logvolId, parentId, isRootVolume);
-
-		storeAddress( address, physvolId );
-	}
-	else {
-		qDebug() << "PhysVol node stored already. Getting ID from the memory map...";
-		physvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "physvolId:" << physvolId;
-	return physvolId;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoFullPhysVol* pointer, const QVariant logvolId, const QVariant parentId, bool isRootVolume)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoFullPhysVol*) - address:" << pointer << "- is root volume?" << isRootVolume;
-
-	QString address = getAddressStringFromPointer( pointer );
-
-	QVariant physvolId;
-	if (! isAddressStored(address)) {
-		qDebug() << "New FullPhysVol! Storing it...";
-
-		physvolId = addFullPhysVol(logvolId, parentId, isRootVolume);
-
-		storeAddress( address, physvolId );
-	}
-	else {
-		qDebug() << "FullPhysVol node stored already. Getting ID from the memory map...";
-		physvolId = getStoredIdFromAddress(address);
-	}
-	qDebug() << "fullphysvolId:" << physvolId;
-	return physvolId;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoSerialDenominator* pointer, const QString baseName)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoSerialDenominator*) - baseName:" << baseName << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialDenominator! Storing it...";
-
-		id = addSerialDenominator(baseName);
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialDenominator node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoSerialTransformer* pointer, const QVariant functionId, const QVariant volId, const QString volType, const unsigned int copies)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoSerialTransformer*):" << volId.toUInt() << volType << "- n. of copies: " << copies;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialTransformer! Storing it...";
-
-		id = addSerialTransformer(functionId, volId, volType, copies);
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialTransformer node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoXF::Function* pointer, const QString expression)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoXF::Function*)";
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-
-		id = addFunction(expression);
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoXF::Function node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoTransform* pointer, std::vector<double> parameters)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoTransform*)";
-
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-
-		id = addTransform( parameters );
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoTransform node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoAlignableTransform* pointer, std::vector<double> parameters)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoAlignableTransform*)";
-
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New GeoXF::Function! Storing it...";
-
-		id = addAlignableTransform( parameters );
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "GeoAlignableTransform node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-
-QVariant DumpGeoModelActionLocal::storeObj(const GeoNameTag* pointer, const QString name)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeObj(GeoNameTag*) - name:" << name << "address:" << pointer;
-
-	QString address = getAddressStringFromPointer( pointer );
-	QVariant id;
-
-	if (! isAddressStored(address)) {
-		qDebug() << "New SerialDenominator! Storing it...";
-
-		id = addNameTag(name);
-
-		storeAddress( address, id );
-	}
-	else {
-		qDebug() << "SerialDenominator node stored already. Getting ID from the memory map...";
-		id = getStoredIdFromAddress(address);
-	}
-	qDebug() << "ID:" << id;
-	return id;
-}
-
-void DumpGeoModelActionLocal::storeChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyN, const unsigned int childPos, const QString childType, const unsigned int childCopyN)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeChildPosition()";
-	addChildPosition(parentId, parentType, childId, parentCopyN, childPos, childType, childCopyN); // FIXME: change the positions of the parameters to a more logical order, like: parentID, parentType, parentCopyN, childPos, ChildType, childId, childCopyN
-	return;
-}
-
-
-unsigned int DumpGeoModelActionLocal::addRecord(std::vector<QStringList>* container, const QStringList values) const
-{
-	container->push_back(values);
-	unsigned int idx = container->size(); // index of pushed element = size after pushing, to match ID starting at 1 in the DB
-	return idx;
-}
-
-QVariant DumpGeoModelActionLocal::addMaterial(const QString name, const QString density, const QString elements)
-{
-	qDebug() << "DumpGeoModelActionLocal::addMaterial(QString*) - name:" << name << "- density:" << density << "- elements:" << elements;
-	std::vector<QStringList>* container = &m_materials;
-	QStringList values;
-	values << name << density << elements;
-	return QVariant( addRecord(container, values) );
-}
-
-QVariant DumpGeoModelActionLocal::addElement(const QString name, const QString symbol, const QString elZ, const QString elA)
-{
-	qDebug() << "DumpGeoModelActionLocal::addElement(QString*) - name:" << name << "- symbol: " << symbol << "- elZ:" << elZ << "- elA:" << elA;
-	std::vector<QStringList>* container = &m_elements;
-	QStringList values;
-	values << name << symbol << elZ << elA;
-	return QVariant( addRecord(container, values) );
-}
-
-QVariant DumpGeoModelActionLocal::addNameTag(const QString name)
-{
-	qDebug() << "DumpGeoModelActionLocal::addNameTag(QString*) - name:" << name;
-	std::vector<QStringList>* container = &m_nameTags;
-	QStringList values;
-	values << name;
-	return QVariant( addRecord(container, values) );
-}
-
-QVariant DumpGeoModelActionLocal::addSerialDenominator(const QString &baseName)
-{
-	qDebug() << "DumpGeoModelActionLocal::addSerialDenominator(QString*) - basename:" << baseName;
-	std::vector<QStringList>* container = &m_serialDenominators;
-	QStringList values;
-	values << baseName;
-	return QVariant( addRecord(container, values) );
-}
-
-
-QVariant DumpGeoModelActionLocal::addFunction(const QString expression)
-{
-	qDebug() << "DumpGeoModelActionLocal::addFunction(QString*) - expression:" << expression;
-	std::vector<QStringList>* container = &m_functions;
-	QStringList values;
-	values << expression;
-	return QVariant( addRecord(container, values) );
-}
-
-
-QVariant DumpGeoModelActionLocal::addAlignableTransform(const std::vector<double> params)
-{
-	qDebug() << "DumpGeoModelActionLocal::addAlignableTransform(QString*)";
-	std::vector<QStringList>* container = &m_alignableTransforms;
-	QStringList values;
-	foreach(double par, params) {
-		values << QString::number(par);
-	}
-	return QVariant( addRecord(container, values) );
-}
-
-
-
-QVariant DumpGeoModelActionLocal::addTransform(const std::vector<double> params)
-{
-	qDebug() << "DumpGeoModelActionLocal::addTransform(QString*)";
-	std::vector<QStringList>* container = &m_transforms;
-	QStringList values;
-	foreach(double par, params) {
-		values << QString::number(par);
-	}
-	return QVariant( addRecord(container, values) );
-}
-
-QString DumpGeoModelActionLocal::getIdFromNodeType( QString nodeType )
-{
-        qDebug() << "getIdFromNodeType(" << nodeType <<")";
-		if (m_memMap_Tables.contains(nodeType))
-			return QString::number(m_memMap_Tables.value(nodeType));
-		else
-			return QString("NULL");
-}
-
-QVariant DumpGeoModelActionLocal::addSerialTransformer(const QVariant &funcId, const QVariant &physvolId, const QString volType, const unsigned int &copies)
-{
-	qDebug() << "DumpGeoModelActionLocal::addSerialTransformer()";
-	std::vector<QStringList>* container = &m_serialTransformers;
-	QString volTypeID = getIdFromNodeType(volType);
-
-	QStringList values;
-	values << funcId.toString() << physvolId.toString() << volTypeID << QString::number(copies);
-
-	return QVariant( addRecord(container, values) );
-}
-
-QVariant DumpGeoModelActionLocal::addShape(const QString &type, const QString &parameters)
-{
-	std::vector<QStringList>* container = &m_shapes;
-	QStringList values;
-	values << type << parameters;
-	return QVariant( addRecord(container, values) );
-}
-
-
-QVariant DumpGeoModelActionLocal::addPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
-{
-	std::vector<QStringList>* container = &m_physVols;
-
-	QStringList values;
-	values << logVolId.toString() << parentPhysVolId.toString(); // TODO: we should remove the parent info: it's not complete because the type is missing (PhysVol or FullPhysVol) and it's redundant, because we store the childrenPositions. It's only useful for quick visual debug, by dumping the PhysVol DB table
-
-	unsigned int idx = addRecord(container, values);
-
-	if (isRootVolume) {
-		QStringList rootValues;
-		rootValues << QString::number(idx) << "GeoPhysVol";
-		m_rootVolume = rootValues;
-	}
-	return QVariant(idx);
-}
-
-
-QVariant DumpGeoModelActionLocal::addFullPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
-{
-	std::vector<QStringList>* container = &m_fullPhysVols;
-
-	QStringList values;
-	values << logVolId.toString() << parentPhysVolId.toString(); // TODO: we should remove the parent info: it's not complete because the type is missing (PhysVol or FullPhysVol) and it's redundant, because we store the childrenPositions. It's only useful for quick visual debug, by dumping the PhysVol DB table
-
-	unsigned int idx = addRecord(container, values);
-
-	if (isRootVolume) {
-		QStringList rootValues;
-		rootValues << QString::number(idx) << "GeoFullPhysVol";
-		m_rootVolume = rootValues;
-	}
-	return QVariant(idx);
-}
-
-QVariant DumpGeoModelActionLocal::addLogVol(const QString &name, const QVariant &shapeId, const QVariant &materialId)
-{
-	std::vector<QStringList>* container = &m_logVols;
-	QStringList values;
-	values << name << shapeId.toString() << materialId.toString();
-	return QVariant( addRecord(container, values) );
-}
-
-void DumpGeoModelActionLocal::addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyN, const unsigned int childPos, const QString childType, const unsigned int childCopyN)
-{
-	std::vector<QStringList>* container = &m_childrenPositions;
-
-	QString parentTableID = getIdFromNodeType(parentType);
-	QString childTableID = getIdFromNodeType(childType);
-
-	QStringList values;
-	values << parentId.toString() << parentTableID <<  QString::number(parentCopyN) << QString::number(childPos) << childTableID << childId.toString() << QString::number(childCopyN);
-	addRecord(container, values);
-	return;
-}
-
-
-void DumpGeoModelActionLocal::saveToDB()
-{
-	qDebug() << "DumpGeoModelActionLocal::savetoDB()";
-    std::cout << "saving to file: " << m_dbpath.toStdString() << std::endl;
-
-	m_dbManager->addListOfRecords("GeoMaterial", m_materials);
-	m_dbManager->addListOfRecords("GeoElement", m_elements);
-	m_dbManager->addListOfRecords("GeoNameTag", m_nameTags);
-	m_dbManager->addListOfRecords("GeoAlignableTransform", m_alignableTransforms);
-	m_dbManager->addListOfRecords("GeoTransform", m_transforms);
-	m_dbManager->addListOfRecords("Function", m_functions);
-	m_dbManager->addListOfRecords("GeoSerialTransformer", m_serialTransformers);
-	m_dbManager->addListOfRecords("GeoShape", m_shapes);
-	m_dbManager->addListOfRecords("GeoSerialDenominator", m_serialDenominators);
-	m_dbManager->addListOfRecords("GeoPhysVol", m_physVols);
-	m_dbManager->addListOfRecords("GeoFullPhysVol", m_fullPhysVols);
-	m_dbManager->addListOfRecords("GeoLogVol", m_logVols);
-
-	m_dbManager->addListOfChildrenPositions(m_childrenPositions);
-	m_dbManager->addRootVolume(m_rootVolume);
-
-	return;
-}
-
-
-
-
-
-
-void DumpGeoModelActionLocal::storeAddress(const QString address, QVariant id)
-{
-	qDebug() << "DumpGeoModelActionLocal::storeAddress(" << address << "," << id << ")";
-	m_memMap.insert(address, id);
-}
-
-bool DumpGeoModelActionLocal::isAddressStored(const QString address)
-{
-	qDebug() << "DumpGeoModelActionLocal::isAddressStored(): " << address;
-	//showMemoryMap(); // only for Debug
-	return m_memMap.contains(address);
-}
-
-
-QVariant DumpGeoModelActionLocal::getStoredIdFromAddress(QString address)
-{
-	qDebug() << "DumpGeoModelActionLocal::getStoredIdFromAddress(): " << address;
-	return m_memMap.value(address);
-}
-
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoMaterial* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoMaterial*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoElement* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoElement*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoShape* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoShape*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoLogVol* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoLogVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoPhysVol* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoPhysVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoVPhysVol* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoVPhysVol*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-// get pointer string
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoSerialDenominator* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoSerialDenominator*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoSerialTransformer* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoSerialTransformer*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoXF::Function* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoXF::Function*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoTransform* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoTransform*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelActionLocal::getAddressStringFromPointer(const GeoNameTag* pointer)
-{
-	qDebug() << "DumpGeoModelActionLocal::getAddressStringFromPointer(GeoNameTag*)";
-	std::ostringstream oss;
-	oss << pointer;
-	return getQStringFromOss(oss);
-}
-
-QString DumpGeoModelActionLocal::getQStringFromOss(std::ostringstream &oss)
-{
-	qDebug() << "DumpGeoModelActionLocal::getQStringFromOss()";
-	std::string addr = oss.str();
-	QString address = QString::fromStdString(addr);
-	qDebug() << "address string:" << address;
-	return address;
-}
-
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/WriteGeoModelAction.cxx.oldSqlite b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/WriteGeoModelAction.cxx.oldSqlite
deleted file mode 100644
index 91aee8c405f5..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/WriteGeoModelAction.cxx.oldSqlite
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-// local includes
-#include "GeoWrite/WriteGeoModelAction.h"
-
-// C++ includes
-#include <sstream>
-
-// Qt includes
-//#include <QtSql>
-#include <QtDebug>
-
-
-WriteGeoModelAction::WriteGeoModelAction (std::ostream &o, MemMap& m, sqlite3 *db) // TODO: remove db from signature
-: m_nameTag(NULL),
-  m_serialDenominator(NULL),
-  m_idTag(NULL),
-  m_transformState(true),
-  m_volumeState(true),
-  m_nametagState(true),
-  m_serialDenominatorState(true),
-  m_serialTransformerState(true),
-  m_identifierState(true),
-  m_o(o),
-  m_map(m),
-  //m_db(db),
-  m_id(0),
-  m_indented(false)
-{
-
-	qDebug() << "WriteGeoModelAction::constructor(). Start...";
-
-//	m_db = QSqlDatabase::addDatabase("QSQLITE");
-////	    m_db.setDatabaseName(path);
-//	    m_db.setDatabaseName("test_Qt.db");
-//
-//	    if (!m_db.open())
-//	    {
-//	        qDebug() << "Error: connection with database fail";
-//	    }
-//	    else
-//	    {
-//	        qDebug() << "Database: connection ok";
-//	    }
-
-
-	//	/* Open database */
-	//	rc = sqlite3_open("test.db", &m_db);
-	//
-	//	if( rc ){
-	//		fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
-	//		exit(0);
-	//	}else{
-	//		fprintf(stderr, "Opened database successfully\n");
-	//	}
-	//
-	//	/* Create the database table */
-	//	createTables();
-
-	// initialize the DB
-	//initDB();
-
-	//loadTestData();
-
-	qDebug() << "WriteGeoModelAction::constructor(). DONE.";
-}
-
-
-WriteGeoModelAction::~WriteGeoModelAction() {
-	qDebug() << "WriteGeoModelAction::destructor().";
-//	if (m_db.isOpen())
-//	    {
-//	        m_db.close();
-//	    }
-}
-
-
-bool WriteGeoModelAction::isOpen() const
-{
-    return m_db.isOpen();
-}
-
-
-//## Other Operations (implementation)
-
-
-void WriteGeoModelAction::handleTransform (const GeoTransform *xform)
-{
-	qDebug() << "WriteGeoModelAction::handleTransform(GeoTransform*)";
-
-	m_pendingTransformList.push_back(xform);
-	if (m_transformState) {
-		indent();
-		m_o << "TRANSFORM (" << xform << ") + ";
-	}
-}
-
-void WriteGeoModelAction::handlePhysVol (const GeoPhysVol *vol)
-{
-	qDebug() << "WriteGeoModelAction::handlePhysVol(GeoPhysVol*)";
-
-	const std::string name = vol->getLogVol()->getName();
-
-	const GeoLogVol* logVol = vol->getLogVol();
-
-
-	const GeoMaterial * mat = vol->getLogVol()->getMaterial();
-	const std::string matName = mat->getName();
-
-	const GeoShape * shape = vol->getLogVol()->getShape();
-	const std::string shapeType = shape->type();
-
-	unsigned int length = getPath()->getLength();
-
-	if (m_volumeState) {
-		indent();
-		m_o << "VOLUME(" << vol << ":GeoPhysVol:" << vol->getLogVol()->getName() << ":" << shapeType << ":" << matName << ":" << length << ")" << std::endl;
-	}
-	m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
-	m_indented=false;
-
-
-
-	//	std::ostringstream oss;
-	//	oss << &vol;
-	//	std::string address = oss.str();
-	//
-	//	// check if present in the map; if not, add it
-	//	if ( ! (m_map.count(address) > 0) ) {
-	//		m_map.emplace(address, 1);
-	//	}
-
-
-	// check if present in the map; if not, add it and then persistify it
-//	if ( storeObj(vol) )
-//		persistifyObj(vol);
-
-}
-
-void WriteGeoModelAction::handleFullPhysVol (const GeoFullPhysVol *vol)
-{
-	qDebug() << "WriteGeoModelAction::handleFullPhysVol(GeoFullPhysVol*)";
-
-	if (m_volumeState) {
-
-		const std::string name = vol->getLogVol()->getName();
-		const std::string matName = vol->getLogVol()->getMaterial()->getName();
-		const std::string shapeType = vol->getLogVol()->getShape()->type();
-		unsigned int length = getPath()->getLength();
-
-		indent();
-		m_o << "VOLUME(" << vol << ":GeoFullPhysVol:" << name << ":" << shapeType << ":" << matName << ":" << length << ")" << std::endl;
-	}
-	m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
-	m_indented=false;
-}
-
-void WriteGeoModelAction::handleNameTag (const GeoNameTag *nameTag)
-{
-	qDebug() << "WriteGeoModelAction::handleNameTag(GeoNameTag*)";
-
-	if (m_nametagState) {
-		indent();
-		m_o << "NAMETAG(" << nameTag << ":" << nameTag->getName() << ") + ";
-	}
-}
-
-void WriteGeoModelAction::handleSerialDenominator (const GeoSerialDenominator *sD)
-{
-	qDebug() << "WriteGeoModelAction::handleSerialDenominator(GeoSerialDenominator*)";
-
-	if (m_nametagState) {
-		indent();
-		m_o << "SERIAL DENOMINATOR(" << sD << ":" << sD->getBaseName() << ") + \n";
-	}
-	m_indented=false;
-}
-
-void WriteGeoModelAction::handleSerialTransformer (const GeoSerialTransformer  *sT)
-{
-	qDebug() << "WriteGeoModelAction::handleSerialTransformer(GeoSerialTransformer*)";
-
-	if (m_volumeState) {
-
-		const GeoXF::Function * func = sT->getFunction();
-
-		indent();
-		m_o << "SERIAL_TRANSFORMER: " << sT->getNCopies() << " PARAMETRIZED VOLUMES(" << sT << ":" << sT->getVolume()->getLogVol()->getName() << ":" << func << ")" << std::endl;
-	}
-	m_pendingTransformList.erase(m_pendingTransformList.begin(),m_pendingTransformList.end());
-	m_indented=false;
-}
-
-void WriteGeoModelAction::handleIdentifierTag (const GeoIdentifierTag *idTag)
-{
-	qDebug() << "WriteGeoModelAction::handleIdentifierTag(GeoIdentifierTag*)";
-
-	if (m_identifierState) {
-		indent();
-		m_o << "NAME(" << idTag << ":" << idTag->getIdentifier() << ") + ";
-	}
-}
-//void WriteGeoModelAction::handleGeoShape (const GeoShape *shape)
-//{
-//	//## begin WriteGeoModelAction::handleIdentifierTag%3FB027EA0197.body preserve=yes
-//	if (m_identifierState) {
-//		indent();
-//		m_o << "NAME(" << idTag << ":" << idTag->getIdentifier() << ") + ";
-//	}
-//	//## end WriteGeoModelAction::handleIdentifierTag%3FB027EA0197.body
-//}
-
-void WriteGeoModelAction::setNotification (Type type, bool state)
-{
-	qDebug() << "WriteGeoModelAction::setNotification()";
-
-	std::cout << "setNotification()" << std::endl;
-
-	if (type==TRANSFORM) {
-		m_transformState=state;
-	}
-	else if (type==VOLUME) {
-		m_volumeState=state;
-	}
-	else if (type==NAMETAG) {
-		m_nametagState=state;
-	}
-	else if (type==IDENTIFIERTAG) {
-		m_identifierState=state;
-	}
-	else if (type==IDENTIFIERTAG) {
-		m_identifierState=state;
-	}
-}
-
-void WriteGeoModelAction::indent ()
-{
-	if (!m_indented) {
-		m_indented=true;
-		for (size_t i=0;i<getPath()->getLength(); i++) {
-			m_o << "   ";
-		}
-	}
-}
-
-
-int WriteGeoModelAction::storeObj(const GeoShape* pointer)
-{
-	qDebug() << "WriteGeoModelAction::storeObj(GeoShape*)";
-
-	std::ostringstream oss;
-	oss << &pointer;
-	std::string address = oss.str();
-
-	return storeAddress(address);
-}
-
-int WriteGeoModelAction::storeObj(const GeoLogVol* pointer)
-{
-	qDebug() << "WriteGeoModelAction::storeObj(GeoLogVol*)";
-
-	std::ostringstream oss;
-	oss << &pointer;
-	std::string address = oss.str();
-
-	return storeAddress(address);
-}
-
-int WriteGeoModelAction::storeObj(const GeoMaterial* pointer)
-{
-	qDebug() << "WriteGeoModelAction::storeObj(GeoMaterial*)";
-
-	std::ostringstream oss;
-	oss << &pointer;
-	std::string address = oss.str();
-
-	return storeAddress(address);
-}
-
-int WriteGeoModelAction::storeObj(const GeoGraphNode* pointer)
-{
-	qDebug() << "WriteGeoModelAction::storeObj(GeoGraphNode*)";
-
-	std::ostringstream oss;
-	oss << &pointer;
-	std::string address = oss.str();
-
-	return storeAddress(address);
-}
-
-int WriteGeoModelAction::storeAddress(const std::string address)
-{
-	qDebug() << "WriteGeoModelAction::storeAddress(): " << address.c_str();
-
-	// check if present in the map; if not, add it
-	if ( ! (m_map.count(address) > 0) ) {
-		++m_id;
-		m_map.emplace(address, m_id);
-
-		return m_id; // the object has been added to the map
-	}
-
-	int objId = 0;
-	//	m_map.find( address )
-	//    std::unordered_map<std::string, int>::const_iterator got = m_map.find (input);
-	MemMap::const_iterator got = m_map.find ( address );
-
-	if ( got == m_map.end() ) {
-		std::cout << "not found";
-		return -1; // ERROR!!
-	}
-	else {
-		std::cout << got->first << " is " << got->second;
-		objId = got->second;
-	}
-	return objId;
-
-}
-
-
-void WriteGeoModelAction::persistifyObj(const GeoPhysVol * pointer)
-{
-	qDebug() << "WriteGeoModelAction::persistifyObj()";
-
-
-	const std::string name = pointer->getLogVol()->getName();
-
-	const GeoLogVol* logVol = pointer->getLogVol();
-
-	const GeoMaterial * mat = pointer->getLogVol()->getMaterial();
-	const std::string matName = mat->getName();
-
-	const GeoShape * shape = pointer->getLogVol()->getShape();
-	const std::string shapeType = shape->type();
-
-	int matId = storeObj(mat);
-	if ( matId > 0 ) {
-
-	}
-
-
-	if ( storeObj(logVol) > 0 ) {
-
-		// CREATE RECORD
-
-//		/* Create SQL statement: INSERT */
-//		std::ostringstream os;
-//		os << "INSERT INTO GEOMETRY (ID,NAME,MATERIAL,SHAPE) ";
-//		os << "VALUES (" << m_id << ",'" << name << "','" << matName << "','" << shapeType << "'); ";
-//
-//		std::string s = os.str();
-//		sql = s.c_str();
-//
-//		/* Execute SQL statement */
-//		rc = sqlite3_exec(m_db, sql, callback, 0, &zErrMsg);
-//		if( rc != SQLITE_OK ){
-//			fprintf(stderr, "SQL error: %s\n", zErrMsg);
-//			sqlite3_free(zErrMsg);
-//		}else{
-//			fprintf(stdout, "Records created successfully\n");
-//		}
-	}
-}
-
-
-
-// FETCH ALL RECORDS
-QSqlError WriteGeoModelAction::fetchAllRecords()
-{
-	qDebug() << "WriteGeoModelAction::fetchAllRecords()";
-
-//	openDB();
-
-//	// create and open a default connection to a SQLite database
-//		qDebug() << "creating the 'default' DB connection...";
-//		m_db = QSqlDatabase::addDatabase("QSQLITE");
-//		m_db.setDatabaseName("test_Qt.db");
-//		qDebug() << "opening the DB...";
-//		if (!m_db.open()) {
-//			qWarning() << "DB file could be opened!";
-//			return m_db.lastError();
-//		}
-
-	QSqlQuery query;
-	query.exec("SELECT * FROM Material");
-
-	while (query.next()) {
-		QString name = query.value(0).toString();
-		qDebug() << name;
-		//		int salary = query.value(1).toInt();
-		//		qDebug() << name << salary;
-	}
-
-	query = QSqlQuery("SELECT * FROM Material");
-	int fieldNo = query.record().indexOf("name");
-	while (query.next()) {
-		//	        QString country = query.value(fieldNo).toString();
-		//	        doSomething(country);
-		qDebug() << query.record();
-	}
-
-//	m_db.close();
-
-//	closeDB();
-
-}
-
-//// FETCH ALL RECORDS
-//void WriteGeoModelAction::fetchAllRecords()
-//{
-//	/* Create SQL statement: FETCH */
-//	sql = "SELECT * from GEOMETRY";
-//
-//	/* Execute SQL statement */
-//	rc = sqlite3_exec(m_db, sql, callback, (void*)data, &zErrMsg);
-//	if( rc != SQLITE_OK ){
-//		fprintf(stderr, "SQL error: %s\n", zErrMsg);
-//		sqlite3_free(zErrMsg);
-//	}else{
-//		fprintf(stdout, "FETCH Operation done successfully\n\n");
-//	}
-//}
-
-
-//int WriteGeoModelAction::callback(void *NotUsed, int argc, char **argv, char **azColName){
-//	int i;
-//	for(i=0; i<argc; i++){
-//		printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
-//	}
-//	printf("\n");
-//	return 0;
-//}
-
-//// CREATE TABLES
-//void WriteGeoModelAction::createTables()
-//{
-//	/* Create SQL statements: CREATE */
-//
-//	// create 'LogVol' table
-//	sql = "CREATE TABLE LogVol (" \
-//			"ID       INTEGER PRIMARY KEY UNIQUE NOT NULL," \
-//			"SHAPE            REFERENCES Shape (ID)," \
-//			"MATERIAL         REFERENCES Material (ID), " \
-//			"NAME     STRING  NOT NULL DEFAULT AnonLogVol " \
-//			");";
-//	if( executeSQL(sql) ) std::cout << "LogVol table created successfully." << std::endl;
-//	else std::cout << "ERROR while creating the table LogVol" << std::endl;
-//
-//	// create 'PhysVol' table
-//	sql = "CREATE TABLE PhysVol ("\
-//			"ID     INTEGER PRIMARY KEY UNIQUE NOT NULL,"\
-//			"LOGVOL INTEGER NOT NULL REFERENCES LogVol (ID),"\
-//			"PARENT INTEGER REFERENCES PhysVol (ID)"\
-//			");";
-//	if( executeSQL(sql) ) std::cout << "PhysVol table created successfully." << std::endl;
-//	else std::cout << "ERROR while creating the table PhysVol" << std::endl;
-//
-//	// create 'Material' table
-//	sql = "CREATE TABLE Material (" \
-//			"ID          PRIMARY KEY,"\
-//			"NAME STRING DEFAULT Air NOT NULL"\
-//			");";
-//	if( executeSQL(sql) ) std::cout << "Material table created successfully." << std::endl;
-//	else std::cout << "ERROR while creating the table Material" << std::endl;
-//
-//	// create 'Shape' table
-//	sql = "CREATE TABLE Shape ("\
-//			"ID    INTEGER PRIMARY KEY,"\
-//			"SHAPE STRING  NOT NULL"\
-//			");";
-//	if( executeSQL(sql) ) std::cout << "Shape table created successfully." << std::endl;
-//	else std::cout << "ERROR while creating the table Shape" << std::endl;
-//
-//}
-
-//bool WriteGeoModelAction::executeSQL(const char * sql)
-//{
-//	/* Execute the input SQL statement */
-//	rc = sqlite3_exec(m_db, sql, callback, 0, &zErrMsg);
-//	if( rc != SQLITE_OK ){
-//		fprintf(stderr, "SQL error: %s\n", zErrMsg);
-//		sqlite3_free(zErrMsg);
-//		return false;
-//	}
-//	//else{
-//	//	fprintf(stdout, "SQL query executed successfully\n");
-//	//}
-//	return true;
-//}
-
-
-//QSqlError WriteGeoModelAction::openDB()
-//{
-//	qDebug() << "WriteGeoModelAction::openDB()";
-//
-////// create and open a default connection to a SQLite database
-////	qDebug() << "creating the 'default' DB connection...";
-////	m_db = QSqlDatabase::addDatabase("QSQLITE");
-////	m_db.setDatabaseName("test_Qt.db");
-////	qDebug() << "opening the DB...";
-////	if (!m_db.open()) {
-////		qWarning() << "DB file could be opened!";
-////		return m_db.lastError();
-////	}
-//
-//
-////	QUuid uniqueId = QUuid::createUuid();
-////	_db = new QSqlDatabase();
-////	*_db = QSqlDatabase::addDatabase("QMYSQL", uniqueId.toString());
-////	db->setHostName(...);
-////	db->setDatabaseName(...);
-////	db->setUserName(...);
-////	db->setPassword(...);
-//
-//	_db = new QSqlDatabase();
-//	*_db = QSqlDatabase::addDatabase("QSQLITE");
-//	_db->setDatabaseName("test_Qt.db");
-//	qDebug() << "opening the DB...";
-//	if (!_db->open()) {
-//		qWarning() << "DB file could be opened!";
-//		return _db->lastError();
-//	}
-//
-//}
-//void WriteGeoModelAction::closeDB()
-//{
-//	_db->close();
-//	delete _db;
-////	QSqlDatabase::removeDatabase(_db->connectionName());
-//	QSqlDatabase::removeDatabase("test_Qt.db");
-//}
-
-
-
-
-QSqlError WriteGeoModelAction::initDB()
-{
-	qDebug() << "WriteGeoModelAction::initDB()";
-
-	// create and open a default connection to a SQLite database
-	qDebug() << "creating the 'default' DB connection...";
-	m_db = QSqlDatabase::addDatabase("QSQLITE");
-	m_db.setDatabaseName("test_Qt.db");
-	qDebug() << "opening the DB...";
-	if (!m_db.open()) {
-		qWarning() << "DB file could be opened!";
-		return m_db.lastError();
-	}
-
-//	openDB();
-
-	// check if DB is empty
-	qDebug() << "checking existing tables...";
-    QSqlDatabase db = QSqlDatabase::database();
-	QStringList tables = db.tables();
-	if (tables.contains("LogVols", Qt::CaseInsensitive)
-			&& tables.contains("PhysVols", Qt::CaseInsensitive)
-			&& tables.contains("Materials", Qt::CaseInsensitive)
-			&& tables.contains("Shapes", Qt::CaseInsensitive)
-		) {
-		qDebug() << "tables are present already. Skipping tables creation.";
-//		closeDB();
-		return QSqlError();
-	}
-
-	// create tables
-	qDebug() << "creating tables...";
-	QSqlQuery q;
-	if (!q.exec(QLatin1String("create table LogVols(id integer primary key, name varchar, shape integer, material integer)")))
-		return q.lastError();
-	if (!q.exec(QLatin1String("create table PhysVols(id integer primary key, logvol integer not null, parent integer)")))
-		return q.lastError();
-	if (!q.exec(QLatin1String("create table Materials(id integer primary key, name varchar)")))
-		return q.lastError();
-	if (!q.exec(QLatin1String("create table Shapes(id integer primary key, name varchar)")))
-		return q.lastError();
-	qDebug() << "DONE. Tables created successfully.";
-
-	// load the DB with test data, for debug
-//	loadTestData();
-
-//	_db->close();
-//	closeDB();
-
-}
-
-QSqlError WriteGeoModelAction::loadTestData()
-{
-
-	qDebug() << "WriteGeoModelAction::loadTestData()";
-
-	// create test data
-	QSqlQuery q;
-
-	qDebug() << "Loading Shapes...";
-	if (!q.prepare(QLatin1String("insert into Shapes(name) values(?)")))
-		return q.lastError();
-	QVariant boxId    = addShape(q, QLatin1String("Box"));
-	QVariant coneId   = addShape(q, QLatin1String("Cone"));
-	QVariant sphereId = addShape(q, QLatin1String("Sphere"));
-
-	qDebug() << "Loading Materials...";
-	if (!q.prepare(QLatin1String("insert into Materials(name) values(?)")))
-		return q.lastError();
-	QVariant airId  = addMaterial(q, QLatin1String("Air"));
-	QVariant ironId = addMaterial(q, QLatin1String("Iron"));
-	QVariant leadId = addMaterial(q, QLatin1String("Lead"));
-
-	qDebug() << "Loading LogVols...";
-	if (!q.prepare(QLatin1String("insert into LogVols(name, shape, material) values(?, ?, ?)")))
-		return q.lastError();
-	QVariant worldLogId = addLogVol(q, QLatin1String("WorldLog"), boxId, airId);
-	QVariant toyLogId  = addLogVol(q, QLatin1String("ToyLog and Empire"), coneId, leadId);
-
-	qDebug() << "Loading PhysVols...";
-	if (!q.prepare(QLatin1String("insert into PhysVols(logvol, parent) values(?, ?)")))
-		return q.lastError();
-	QVariant rootPhysId = addPhysVol(q, worldLogId, QVariant()); // no parent
-	QVariant childPhysId = addPhysVol(q, toyLogId, rootPhysId);
-
-	qDebug() << "DONE. Created and loaded test data.";
-}
-
-
-QVariant WriteGeoModelAction::addPhysVol(QSqlQuery &q, const QVariant &logVolId,
-             const QVariant &parentPhysVolId)
-{
-	qDebug() << "WriteGeoModelAction::addPhysVol()";
-    q.addBindValue(logVolId);
-    q.addBindValue(parentPhysVolId);
-    q.exec();
-    return q.lastInsertId();
-}
-
-QVariant WriteGeoModelAction::addLogVol(QSqlQuery &q, const QString &name, const QVariant &shapeId,
-             const QVariant &materialId)
-{
-	qDebug() << "WriteGeoModelAction::addLogVol()";
-    q.addBindValue(name);
-    q.addBindValue(shapeId);
-    q.addBindValue(materialId);
-    q.exec();
-    return q.lastInsertId();
-}
-
-QVariant WriteGeoModelAction::addMaterial(QSqlQuery &q, const QString &name)
-{
-	qDebug() << "WriteGeoModelAction::addMaterial()";
-    q.addBindValue(name);
-    q.exec();
-    return q.lastInsertId();
-}
-
-QVariant WriteGeoModelAction::addShape(QSqlQuery &q, const QString &name)
-{
-	qDebug() << "WriteGeoModelAction::addShape()";
-    q.addBindValue(name);
-    q.exec();
-    return q.lastInsertId();
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/CMakeLists.txt
deleted file mode 100644
index de2daf1c463f..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-################################################################################
-# Package: TFPersistification
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TFPersistification )
-
-# Declare the package's dependencies:
-# TODO: we can skip the dependency on GeoPrimitives when we convert all methods to Eigen (GeoTrf::Transform3D)
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoPrimitives
-                          )
-                          
-# External dependencies:
-find_package( CLHEP ) # TODO: we can skip the dependency on CLHEP when we convert all methods to Eigen (GeoTrf::Transform3D)
-find_package( Eigen )
-find_package( GeoModelCore )
-
-# Component(s) in the package:
-atlas_add_library( TFPersistification
-                   src/*.cpp
-                   TFPersistification/*.h
-                   PUBLIC_HEADERS TFPersistification
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GeoPrimitives )
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ACosIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ACosIO.h
deleted file mode 100644
index 9c0c574c2c22..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ACosIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _ACosIO_h_
-#define _ACosIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class ACosReader: public GenFunctionReader {
-
- public:
-  
-  ACosReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class ACosRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ACosRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ASinIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ASinIO.h
deleted file mode 100644
index dedc5ff8ac9a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ASinIO.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ASinIO_h_
-#define _ASinIO_h_
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class ASinReader: public GenFunctionReader {
-
- public:
-  
-  ASinReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class ASinRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ASinRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ATanIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ATanIO.h
deleted file mode 100644
index 526d8b66f727..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ATanIO.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ATanIO_h_
-#define _ATanIO_h_
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class ATanReader: public GenFunctionReader {
-
- public:
-  
-  ATanReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class ATanRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ATanRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/AbsIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/AbsIO.h
deleted file mode 100644
index 09b351c5c625..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/AbsIO.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _AbsIO_h_
-#define _AbsIO_h_
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class AbsReader: public GenFunctionReader {
-
- public:
-  
-  AbsReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class AbsRecorder: public GenFunctionRecorder {
-
- public:
-  
-  AbsRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ArrayFunctionIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ArrayFunctionIO.h
deleted file mode 100644
index f5ff56c25d50..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ArrayFunctionIO.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ArrayFunctionIO_h_
-#define _ArrayFunctionIO_h_
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class ArrayFunctionReader: public GenFunctionReader {
-
- public:
-  
-  ArrayFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class ArrayFunctionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ArrayFunctionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/CosIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/CosIO.h
deleted file mode 100644
index b507f13e17a6..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/CosIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _CosIO_h_
-#define _CosIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class CosReader: public GenFunctionReader {
-
- public:
-  
-  CosReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class CosRecorder: public GenFunctionRecorder {
-
- public:
-  
-  CosRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/FixedConstantIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/FixedConstantIO.h
deleted file mode 100644
index 84ecbe10e6f6..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/FixedConstantIO.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _FixedConstantIO_h_
-#define _FixedConstantIO_h_
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class FixedConstantReader: public GenFunctionReader {
-
- public:
-  
-  FixedConstantReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class FixedConstantRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FixedConstantRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionInterpreter.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionInterpreter.h
deleted file mode 100644
index 232775518d84..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionInterpreter.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _GENFUNCTIONINTERPRETER_H_
-#define _GENFUNCTIONINTERPRETER_H_
-#include <map>
-#include <string>
-#include <typeinfo>
-#include <sstream>
-#include <memory>
-
-//
-// Forward definition of "Genfunction"
-//
-namespace GeoGenfun {
-  class AbsFunction;
-}
-
-//
-// Forward definition of GenFunctionRecorder;
-//
-class GenFunctionReader;
-
-typedef std::unique_ptr<const GeoGenfun::AbsFunction> GFPTR;
-
-class GenFunctionInterpreter {
-
- public:
-
-  // Constructor
-  GenFunctionInterpreter();
-
-  // Destructor
-  ~GenFunctionInterpreter();
-  
-  // Registers a reader. Assumes ownership and will delete
-  void add(const std::string &str, const GenFunctionReader * reader); 
-
-  // Interprets a string.  
-  GFPTR interpret(std::string::const_iterator begin,
-		  std::string::const_iterator end  ) const;
-
- private:
-
-  // Store the actual interpreters, map them into the type name
-  std::map<std::string, const GenFunctionReader *> m_readerMap;
-
-  // Deleted methods:
-  GenFunctionInterpreter(const GenFunctionInterpreter &)               = delete;
-  GenFunctionInterpreter & operator = (const GenFunctionInterpreter &) = delete;
-  
-};
-
-
-#endif
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionPersistifier.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionPersistifier.h
deleted file mode 100644
index 49fede5c8d8e..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionPersistifier.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef _GENPERSISTIFIER_H_
-#define _GENPERSISTIFIER_H_
-#include <map>
-#include <string>
-#include <typeinfo>
-#include <sstream>
-
-//
-// Forward declaration of GeoGenfun::AbsFunction
-//
-namespace GeoGenfun {
-  class AbsFunction;
-}
-//
-// Forward definition of GenFunctionRecorder;
-//
-class GenFunctionRecorder;
-
-
-
-class GenFunctionPersistifier {
-
- public:
-
-  // Constructor
-  GenFunctionPersistifier();
-
-  // Destructor
-  ~GenFunctionPersistifier();
-
-  // Registers a recorder. Assumes ownership and will delete.
-  void add(const std::type_info & tInfo, const GenFunctionRecorder * recorder);
-
-  // Persistifies the function.  Result goes into the coded string.
-  void persistify(const GeoGenfun::AbsFunction & f) const;
-
-  // Retrieves the coded string after the persistify operation:
-  const std::string & getCodedString() const;
-
-  // Retrieves the stream used to build the expression:
-  std::ostringstream & getStream() const;
-
- private:
-
-  // Store the actual recorders, map them into the type name
-  std::map<std::string, const GenFunctionRecorder *> m_recorderMap;
-
-  // Here is the result:
-  mutable std::string m_codedString;
-
-  // An ostringstream is used to build the coded string:
-  mutable std::ostringstream* m_stream;
-
-  // Deleted methods:
-  GenFunctionPersistifier(const GenFunctionPersistifier &)               = delete;
-  GenFunctionPersistifier & operator = (const GenFunctionPersistifier &) = delete;
-
-};
-
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionReader.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionReader.h
deleted file mode 100644
index e672a1fd05b8..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionReader.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _GENFUNCTIONREADER_H_
-#define _GENFUNCTIONREADER_H_
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-#include <memory>
-#include <tuple>
-#include <string>
-
-typedef std::tuple<std::string::const_iterator, std::string::const_iterator> BeginEnd;
-
-typedef std::unique_ptr<const GeoGenfun::AbsFunction> GFPTR;
-//
-// Forward definition of GenFunctionInterpreter;
-//
-class GenFunctionInterpreter;
-
-class GenFunctionReader {
-
- public:
-
-  // Constructor.  Keep a pointer to the interpreter for purposes of recusion.
-  GenFunctionReader(const std::string & name, GenFunctionInterpreter *interpreter);
-
-  // Destructor
-  virtual ~GenFunctionReader();
-
-  // Execute
-  virtual GFPTR execute(std::string::const_iterator , std::string::const_iterator) const=0;
-
-  // Access to the interpreter:
-  const GenFunctionInterpreter *getInterpreter() const;
-
-  // Access to the input string name;
-  const std::string & getName() const;
-  
- protected:
-
-  // Some of the subclasses require two arguments, separated by a |. This
-  // splits the argument into its two pieces:
-  std::string::const_iterator split(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-  private:
-
-  // Name of the text string found on the input:
-  const std::string                                           m_name;
-
-  // A pointer to the interpreter:
-  const GenFunctionInterpreter                               *m_interpreter;
-
-  // Deleted operations:
-  GenFunctionReader(const GenFunctionReader &)               = delete;
-  GenFunctionReader & operator = (const GenFunctionReader &) = delete;
-
-  
-};
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionRecorder.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionRecorder.h
deleted file mode 100644
index a76b756d36e7..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenFunctionRecorder.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _GENFUNCTIONRECORDER_H_
-#define _GENFUNCTIONRECORDER_H_
-
-#include  <typeinfo>
-
-
-namespace GeoGenfun {
-  class AbsFunction;
-}
-
-
-//
-// Forward definition of GenFunctionPersistifier;
-//
-class GenFunctionPersistifier;
-
-class GenFunctionRecorder {
-
- public:
-
-  // Constructor.  Keep a pointer to the persistifier for purposes of recusion.
-  GenFunctionRecorder(const std::type_info & info, GenFunctionPersistifier *persistifier);
-
-  // Destructor:
-  virtual ~GenFunctionRecorder();
-
-  // Execute
-  virtual void execute(const GeoGenfun::AbsFunction & transfunction) const=0;
-
-  // Access to the persistifier:
-  const GenFunctionPersistifier *getPersistifier() const;
-
- private:
-
-  // A pointer to the persistifier:
-  const GenFunctionPersistifier                               *m_persistifier;
-
-  // Deleted operations:
-  GenFunctionRecorder(const GenFunctionRecorder &)               = delete;
-  GenFunctionRecorder & operator = (const GenFunctionRecorder &) = delete;
-
-
-};
-
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenfunIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenfunIO.h
deleted file mode 100644
index 05f8e41f5191..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/GenfunIO.h
+++ /dev/null
@@ -1,240 +0,0 @@
-#ifndef _GenfunIO_h_
-#define _GenfunIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-
-class ConstTimesFunctionReader: public GenFunctionReader {
-
- public:
-  
-  ConstTimesFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-class ConstTimesFunctionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ConstTimesFunctionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-
-class ConstPlusFunctionReader: public GenFunctionReader {
-
- public:
-  
-  ConstPlusFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class ConstPlusFunctionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ConstPlusFunctionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class ConstMinusFunctionReader: public GenFunctionReader {
-
- public:
-  
-  ConstMinusFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class ConstMinusFunctionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ConstMinusFunctionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class ConstOverFunctionReader: public GenFunctionReader {
-
- public:
-  
-  ConstOverFunctionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class ConstOverFunctionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ConstOverFunctionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-
-class FunctionCompositionReader: public GenFunctionReader {
-
- public:
-  
-  FunctionCompositionReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionCompositionRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionCompositionRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-
-class FunctionNegationReader: public GenFunctionReader {
-
- public:
-  
-  FunctionNegationReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionNegationRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionNegationRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class FunctionNoopReader: public GenFunctionReader {
-
- public:
-  
-  FunctionNoopReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionNoopRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionNoopRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class FunctionProductReader: public GenFunctionReader {
-
- public:
-  
-  FunctionProductReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionProductRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionProductRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class FunctionQuotientReader: public GenFunctionReader {
-
- public:
-  
-  FunctionQuotientReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionQuotientRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionQuotientRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-
-class FunctionSumReader: public GenFunctionReader {
-
- public:
-  
-  FunctionSumReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionSumRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionSumRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-class FunctionDifferenceReader: public GenFunctionReader {
-
- public:
-  
-  FunctionDifferenceReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end ) const;
-  
-};
-
-
-class FunctionDifferenceRecorder: public GenFunctionRecorder {
-
- public:
-  
-  FunctionDifferenceRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-
-
-class VariableReader: public GenFunctionReader {
-
- public:
-  
-  VariableReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class VariableRecorder: public GenFunctionRecorder {
-
- public:
-  
-  VariableRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ModIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ModIO.h
deleted file mode 100644
index cec3e1057b3a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/ModIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _ModIO_h_
-#define _ModIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class ModReader: public GenFunctionReader {
-
- public:
-  
-  ModReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class ModRecorder: public GenFunctionRecorder {
-
- public:
-  
-  ModRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/RectangularIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/RectangularIO.h
deleted file mode 100644
index dd68430562e0..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/RectangularIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _RectangularIO_h_
-#define _RectangularIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class RectangularReader: public GenFunctionReader {
-
- public:
-  
-  RectangularReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class RectangularRecorder: public GenFunctionRecorder {
-
- public:
-  
-  RectangularRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SinIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SinIO.h
deleted file mode 100644
index 02990ca51672..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SinIO.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _SinIO_h_
-#define _SinIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-
-class SinReader: public GenFunctionReader {
-
- public:
-  
-  SinReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class SinRecorder: public GenFunctionRecorder {
-
- public:
-  
-  SinRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SqrtIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SqrtIO.h
deleted file mode 100644
index 7c7f9ecc09d8..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SqrtIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _SqrtIO_h_
-#define _SqrtIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class SqrtReader: public GenFunctionReader {
-
- public:
-  
-  SqrtReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class SqrtRecorder: public GenFunctionRecorder {
-
- public:
-  
-  SqrtRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SquareIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SquareIO.h
deleted file mode 100644
index 082a62c3e520..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/SquareIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _SquareIO_h_
-#define _SquareIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class SquareReader: public GenFunctionReader {
-
- public:
-  
-  SquareReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class SquareRecorder: public GenFunctionRecorder {
-
- public:
-  
-  SquareRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TanIO.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TanIO.h
deleted file mode 100644
index 5d1dcf59667b..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TanIO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _TanIO_h_
-#define _TanIO_h_
-
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-class TanReader: public GenFunctionReader {
-
- public:
-  
-  TanReader(GenFunctionInterpreter * interpreter);
-  virtual GFPTR execute(std::string::const_iterator begin, std::string::const_iterator end) const;
-  
-};
-
-
-class TanRecorder: public GenFunctionRecorder {
-
- public:
-  
-  TanRecorder(GenFunctionPersistifier * persistifier);
-  virtual void execute(const GeoGenfun::AbsFunction & F) const;
-  
-};
-#endif
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionInterpreter.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionInterpreter.h
deleted file mode 100644
index 62d8ba9cf7d5..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionInterpreter.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef _TRANSFUNCTIONINTERPRETER_H_
-#define _TRANSFUNCTIONINTERPRETER_H_
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include <map>
-#include <string>
-#include <typeinfo>
-#include <sstream>
-#include <memory>
-
-//
-// Forward definition of "Transfunction"
-//
-namespace GeoXF {
-  class Function;
-}
-
-//
-// Forward definition of TransFunctionRecorder;
-//
-class TransFunctionReader;
-typedef std::unique_ptr<const GeoXF::Function> TFPTR;
-
-class TransFunctionInterpreter {
-
- public:
-
-  // Constructor
-  TransFunctionInterpreter();
-
-  // Destructor
-  ~TransFunctionInterpreter();
-  
-  // Registers a reader:
-  void add(const std::string &str, const TransFunctionReader * reader); 
-
-  // Interprets a string.  
-  TFPTR interpret(const std::string & str) const;
-
-  // Retrieves the genfunction persistitier:
-  const GenFunctionInterpreter * getGenFunctionInterpreter() const;
-  
- private:
-
-  // Store the actual interpreters, map them into the type name
-  std::map<std::string, const TransFunctionReader *> m_readerMap;
-
-  // A pointer to the GenFunctionInterpreter:
-  const GenFunctionInterpreter m_fInterpreter;
-
-  // Deleted methods:
-  TransFunctionInterpreter(const TransFunctionInterpreter &)               = delete;
-  TransFunctionInterpreter & operator = (const TransFunctionInterpreter &) = delete;
-  
-};
-
-
-#endif
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionPersistifier.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionPersistifier.h
deleted file mode 100644
index 2b9cab9853b3..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionPersistifier.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef _GEOPERSISTIFIER_H_
-#define _GEOPERSISTIFIER_H_
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include <map>
-#include <string>
-#include <typeinfo>
-#include <sstream>
-
-//
-// Forward definition of "Transfunction"
-//
-namespace GeoXF {
-  class Function;
-}
-
-//
-// Forward definition of TransFunctionRecorder;
-//
-class TransFunctionRecorder;
-class GenFunctionPersistifier;
-
-
-class TransFunctionPersistifier {
-
- public:
-
-  // Constructor
-  TransFunctionPersistifier();
-
-  // Destructor
-  ~TransFunctionPersistifier();
-  
-  // Registers a recorder:
-  void add(const std::type_info & tInfo, const TransFunctionRecorder * recorder); 
-
-  // Persistifies the function.  Result goes into the coded string.
-  void persistify(const GeoXF::Function & f) const;
-
-  // Retrieves the coded string after the persistify operation:
-  const std::string & getCodedString() const;
-
-  // Retrieves the stream used to build the expression:
-  std::ostringstream & getStream() const;
-
-  // Retrieves the genfunction persistitier:
-  const GenFunctionPersistifier * getGenFunctionPersistifier() const;
-  
- private:
-
-  // Store the actual recorders, map them into the type name
-  std::map<std::string, const TransFunctionRecorder *> m_recorderMap;
-
-  // Here is the result:
-  mutable std::string m_codedString;
-
-  // An ostringstream is used to build the coded string:
-  mutable std::ostringstream *m_stream;
-
-  // The GenFunctionPersistifier:
-  GenFunctionPersistifier m_persistifier;
-  
-  // Deleted methods:
-  TransFunctionPersistifier(const TransFunctionPersistifier &)               = delete;
-  TransFunctionPersistifier & operator = (const TransFunctionPersistifier &) = delete;
-  
-};
-
-
-#endif
-
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionReader.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionReader.h
deleted file mode 100644
index d4a2aa447be2..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionReader.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef _TRANSFUNCTIONREADER_H_
-#define _TRANSFUNCTIONREADER_H_
-
-#include "GeoModelKernel/GeoXF.h"
-
-#include <memory>
-//
-
-
-// Forward definition of "Transfunction"
-//
-namespace GeoXF {
-  class Function;
-}
-
-typedef std::unique_ptr<const GeoXF::Function> TFPtr;
-
-
-//
-// Forward definition of TransFunctionInterpreter;
-//
-class TransFunctionInterpreter;
-
-class TransFunctionReader {
-
- public:
-
-  // Constructor.  Keep a pointer to the interpreter for purposes of recusion.
-  TransFunctionReader(const std::string & name, TransFunctionInterpreter *interpreter);
-
-  // Destructor
-  virtual ~TransFunctionReader();
-
-  // Execute
-  virtual TFPTR execute(const std::string & arg) const=0;
-
-  // Access to the interpreter:
-  const TransFunctionInterpreter *getInterpreter() const;
-
- protected:
-
-  // Some of the subclasses require two arguments, separated by a |. This
-  // splits the argument into its two pieces:
-  std::pair<std::string, std::string> split(const std::string & arg) const;
-  
-  // Help scan transforms
-  GeoTrf::Transform3D scanT(const std::string & exprString) const;
-
-  private:
-
-
-  // A pointer to the interpreter:
-  const TransFunctionInterpreter* m_interpreter;
-
-  // Deleted operations:
-  TransFunctionReader(const TransFunctionReader &)               = delete;
-  TransFunctionReader & operator = (const TransFunctionReader &) = delete;
-
-  
-};
-
-// Now we add the pre-existing types of transfunction (=GeoXF::Function).  These
-// may well be the only types we ever need!.
-
-class ProductReader: public TransFunctionReader {
-
- public:
-  
-  ProductReader(TransFunctionInterpreter * interpreter);
-  virtual TFPTR execute(const std::string & arg) const;
-  
-};
-
-
-class PreMultReader: public TransFunctionReader {
-
- public:
-  
-  PreMultReader(TransFunctionInterpreter * interpreter);
-  virtual TFPTR execute(const std::string & arg) const;
-  
-};
-
-class PostMultReader: public TransFunctionReader {
-
- public:
-  
-  PostMultReader(TransFunctionInterpreter * interpreter);
-  virtual TFPTR  execute(const std::string & arg) const;
-  
-};
-
-
-class PowReader: public TransFunctionReader {
-
- public:
-  
-  PowReader(TransFunctionInterpreter * interpreter);
-  virtual TFPTR execute(const std::string & arg) const;
-  
-};
-
-
-
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionRecorder.h b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionRecorder.h
deleted file mode 100644
index d83f7cd5a87b..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/TFPersistification/TransFunctionRecorder.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef _TRANSFUNCTIONRECORDER_H_
-#define _TRANSFUNCTIONRECORDER_H_
-#include <typeinfo>
-
-//
-// Forward definition of "Transfunction"
-//
-namespace GeoXF {
-  class Function;
-}
-
-//
-// Forward definition of TransFunctionPersistifier;
-//
-class TransFunctionPersistifier;
-
-class TransFunctionRecorder {
-
- public:
-
-  // Constructor.  Keep a pointer to the persistifier for purposes of recusion.
-  TransFunctionRecorder(const std::type_info & info, TransFunctionPersistifier *persistifier);
-
-  // Destructor
-  virtual ~TransFunctionRecorder();
-
-  // Execute
-  virtual void execute(const GeoXF::Function & transfunction) const=0;
-
-  // Access to the persistifier:
-  const TransFunctionPersistifier *getPersistifier() const;
-  
- private:
-
-  // A pointer to the persistifier:
-  const TransFunctionPersistifier                               *m_persistifier;
-
-  // Deleted operations:
-  TransFunctionRecorder(const TransFunctionRecorder &)               = delete;
-  TransFunctionRecorder & operator = (const TransFunctionRecorder &) = delete;
-
-  
-};
-
-// Now we add the pre-existing types of transfunction (=GeoXF::Function).  These
-// may well be the only types we ever need!.
-
-class ProductRecorder: public TransFunctionRecorder {
-
- public:
-  
-  ProductRecorder(TransFunctionPersistifier * persistifier);
-  virtual void execute(const GeoXF::Function &) const;
-  
-};
-
-
-class PreMultRecorder: public TransFunctionRecorder {
-
- public:
-  
-  PreMultRecorder(TransFunctionPersistifier * persistifier);
-  virtual void execute(const GeoXF::Function & ) const;
-  
-};
-
-class PostMultRecorder: public TransFunctionRecorder {
-
- public:
-  
-  PostMultRecorder(TransFunctionPersistifier * persistifier);
-  virtual void execute(const GeoXF::Function & ) const;
-  
-};
-
-
-class PowRecorder: public TransFunctionRecorder {
-
- public:
-  
-  PowRecorder(TransFunctionPersistifier * persistifier);
-  virtual void execute(const GeoXF::Function &) const;
-  
-};
-
-
-
-
-#endif
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ACosIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ACosIO.cpp
deleted file mode 100644
index 6679930302c4..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ACosIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/ACosIO.h"
-
-#include "GeoGenericFunctions/ACos.h"
-
-ACosReader::ACosReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ACos", interpreter) {}
-
-
-GFPTR  ACosReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::ACos());
-}
-
-
-ACosRecorder::ACosRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ACos),persistifier) {}
-
-void ACosRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ACos * ptr = dynamic_cast<const GeoGenfun::ACos *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ACosRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "ACos";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ASinIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ASinIO.cpp
deleted file mode 100644
index c4a2e0c14543..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ASinIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/ASinIO.h"
-
-#include "GeoGenericFunctions/ASin.h"
-
-ASinReader::ASinReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ASin", interpreter) {}
-
-
-GFPTR  ASinReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::ASin());
-}
-
-
-ASinRecorder::ASinRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ASin),persistifier) {}
-
-void ASinRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ASin * ptr = dynamic_cast<const GeoGenfun::ASin *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ASinRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "ASin";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ATanIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ATanIO.cpp
deleted file mode 100644
index 33df878f45ba..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ATanIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/ATanIO.h"
-
-#include "GeoGenericFunctions/ATan.h"
-
-ATanReader::ATanReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ATan", interpreter) {}
-
-
-GFPTR  ATanReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::ATan());
-}
-
-
-ATanRecorder::ATanRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ATan),persistifier) {}
-
-void ATanRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ATan * ptr = dynamic_cast<const GeoGenfun::ATan *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ATanRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "ATan";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/AbsIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/AbsIO.cpp
deleted file mode 100644
index cb8039fca032..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/AbsIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/AbsIO.h"
-
-#include "GeoGenericFunctions/Abs.h"
-
-AbsReader::AbsReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Abs", interpreter) {}
-
-
-GFPTR  AbsReader::execute(std::string::const_iterator, std::string::const_iterator) const {
-  return GFPTR(new GeoGenfun::Abs());
-}
-
-
-AbsRecorder::AbsRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Abs),persistifier) {}
-
-void AbsRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Abs * ptr = dynamic_cast<const GeoGenfun::Abs *> (&F);
-  if (!ptr) throw std::runtime_error("Error in AbsRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Abs";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ArrayFunctionIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ArrayFunctionIO.cpp
deleted file mode 100644
index f0ff7ea19772..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ArrayFunctionIO.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "GeoGenericFunctions/ArrayFunction.h"
-
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/ArrayFunctionIO.h"
-ArrayFunctionReader::ArrayFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ArrayFunction", interpreter) {}
-
-
-GFPTR  ArrayFunctionReader::execute(std::string::const_iterator cStart, std::string::const_iterator cEnd) const {
-  std::vector<double> elements;
-  auto cNext=std::find(cStart, cEnd,',');
-  while (cNext!=cEnd) {
-    std::string aNumberStr(cStart,cNext);
-    std::istringstream stream(aNumberStr);
-    double d;
-    stream >> d;
-    elements.push_back(d);
-    cStart=cNext+1;
-    cNext=std::find(cStart, cEnd,',');
-  }
-
-  std::string aNumberStr(cStart,cNext);
-  std::istringstream stream(aNumberStr);
-  double d;
-  stream >> d;
-  elements.push_back(d);
-  
-  return GFPTR(new GeoGenfun::ArrayFunction(&elements.front(), &elements.back() + 1));
-}
-
-
-ArrayFunctionRecorder::ArrayFunctionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ArrayFunction),persistifier) {}
-
-void ArrayFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ArrayFunction * ptr = dynamic_cast<const GeoGenfun::ArrayFunction *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ArrayFunctionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "ArrayFunction";
-  stream << "(";
-  for (size_t i=0;i<ptr->values().size();i++){
-    stream<<ptr->values()[i];
-    if (i!=ptr->values().size()-1) stream << ",";
-  }
-  stream << ")";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/CosIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/CosIO.cpp
deleted file mode 100644
index 15c055a8991f..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/CosIO.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/CosIO.h"
-
-#include "GeoGenericFunctions/Cos.h"
-
-CosReader::CosReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Cos",interpreter) {}
-
-
-GFPTR  CosReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::Cos());
-}
-
-CosRecorder::CosRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Cos), persistifier) {}
-
-void CosRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Cos * ptr = dynamic_cast<const GeoGenfun::Cos *> (&F);
-  if (!ptr) throw std::runtime_error("Error in CosRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Cos";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/FixedConstantIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/FixedConstantIO.cpp
deleted file mode 100644
index c57ddd8b1adc..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/FixedConstantIO.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "GeoGenericFunctions/FixedConstant.h"
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/FixedConstantIO.h"
-FixedConstantReader::FixedConstantReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FixedConstant", interpreter) {}
-
-
-GFPTR  FixedConstantReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  double v;
-  std::string aNumberStr(begin,end);
-  std::istringstream stream(aNumberStr);
-  stream >> v;
-  return GFPTR(new GeoGenfun::FixedConstant(v));
-}
-
-
-FixedConstantRecorder::FixedConstantRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FixedConstant),persistifier) {}
-
-void FixedConstantRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FixedConstant * ptr = dynamic_cast<const GeoGenfun::FixedConstant *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FixedConstantRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FixedConstant";
-  stream << "(";
-  stream<<(*ptr)(0);
-  stream << ")";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionInterpreter.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionInterpreter.cpp
deleted file mode 100644
index 647e6fc70a96..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionInterpreter.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/GenFunctionReader.h"
-#include "TFPersistification/ArrayFunctionIO.h"
-#include "TFPersistification/ModIO.h"
-#include "TFPersistification/FixedConstantIO.h"
-#include "TFPersistification/RectangularIO.h"
-#include "TFPersistification/AbsIO.h"
-#include "TFPersistification/SinIO.h"
-#include "TFPersistification/ASinIO.h"
-#include "TFPersistification/CosIO.h"
-#include "TFPersistification/ACosIO.h"
-#include "TFPersistification/TanIO.h"
-#include "TFPersistification/ATanIO.h"
-#include "TFPersistification/SqrtIO.h"
-#include "TFPersistification/SquareIO.h"
-#include "TFPersistification/GenfunIO.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-#include "GeoGenericFunctions/Argument.h"
-#include "GeoModelKernel/GeoDefinitions.h"
-#include "GeoModelKernel/GeoXF.h"
-
-#include <iterator>
-
-GenFunctionInterpreter::~GenFunctionInterpreter() {
-  for (auto i=m_readerMap.begin();i!=m_readerMap.end();i++) delete (*i).second;
-}
-
-GenFunctionInterpreter::GenFunctionInterpreter() {
-  new ArrayFunctionReader(this);
-  new ModReader(this);
-  new FixedConstantReader(this);
-  new RectangularReader(this);
-  new SinReader(this);
-  new CosReader(this);
-  new TanReader(this);
-  new ASinReader(this);
-  new ACosReader(this);
-  new ATanReader(this);
-  new AbsReader(this);
-  new SqrtReader(this);
-  new SquareReader(this);
-  new VariableReader(this);
-  new ConstTimesFunctionReader(this);
-  new ConstPlusFunctionReader(this);
-  new ConstMinusFunctionReader(this);
-  new ConstOverFunctionReader(this);
-  new FunctionCompositionReader(this);
-  new FunctionProductReader(this);
-  new FunctionSumReader(this);
-  new FunctionQuotientReader(this);
-  new FunctionDifferenceReader(this);
-  new FunctionNegationReader(this);
-  new FunctionNoopReader(this);
-}
-
-void GenFunctionInterpreter::add(const std::string & str, const GenFunctionReader * reader) {
-  reader=m_readerMap[str]=reader;
-}
-
-
-GFPTR GenFunctionInterpreter::interpret(std::string::const_iterator sBegin, std::string::const_iterator sEnd) const {
-
-  auto begin=std::find(sBegin, sEnd, '(');
-  std::reverse_iterator<std::string::const_iterator> rBegin(sEnd);
-  std::reverse_iterator<std::string::const_iterator> rEnd(sBegin);
-  auto end=std::find(rBegin, rEnd, ')').base();
-  
-
-  if (end==sBegin || begin==sEnd) {
-    // Base case. This is the bottom of the tree!
-    std::string exprString(sBegin,sEnd);
-    auto rIter = m_readerMap.find(exprString);
-    if (rIter==m_readerMap.end()) {
-      std::ostringstream stream;
-      stream << "Ominous warning in GenFunctionInterpreter: cannot parse function " << exprString;
-      throw std::runtime_error (stream.str());
-    }
-    const GenFunctionReader *reader = (*rIter).second;
-    return reader->execute(begin,begin);//exec w/null expression
-  }
-  std::string op(sBegin,begin);
-  auto argBegin=begin+1, argEnd=end-1;
-  auto rIter = m_readerMap.find(op);
-  if (rIter==m_readerMap.end()) {
-    std::ostringstream stream;
-    stream << "Ominous warning in GenFunctionInterpreter: cannot interpret function " << op;
-    throw std::runtime_error (stream.str());
-  }
-  const GenFunctionReader *reader = (*rIter).second;
-  return reader->execute(argBegin,argEnd);
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionPersistifier.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionPersistifier.cpp
deleted file mode 100644
index 0e2d4782aced..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionPersistifier.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionRecorder.h"
-#include "TFPersistification/SinIO.h"
-#include "TFPersistification/TanIO.h"
-#include "TFPersistification/CosIO.h"
-#include "TFPersistification/ASinIO.h"
-#include "TFPersistification/ATanIO.h"
-#include "TFPersistification/ACosIO.h"
-#include "TFPersistification/SqrtIO.h"
-#include "TFPersistification/SquareIO.h"
-#include "TFPersistification/AbsIO.h"
-#include "TFPersistification/ArrayFunctionIO.h"
-#include "TFPersistification/ModIO.h"
-#include "TFPersistification/FixedConstantIO.h"
-#include "TFPersistification/RectangularIO.h"
-#include "TFPersistification/GenfunIO.h"
-
-#include "GeoGenericFunctions/AbsFunction.h"
-
-
-#include <sstream>
-const std::string & GenFunctionPersistifier::getCodedString() const {
-  m_codedString=getStream().str();
-  delete m_stream;
-  m_stream=NULL;
-  return m_codedString;
-}
-
-
-GenFunctionPersistifier::~GenFunctionPersistifier() {
-  delete m_stream;
-  for (auto i=m_recorderMap.begin();i!=m_recorderMap.end();i++) {
-    delete (*i).second;
-  }
-}
-GenFunctionPersistifier::GenFunctionPersistifier():m_stream(NULL) {
-  new ConstPlusFunctionRecorder(this);
-  new ConstTimesFunctionRecorder(this);
-  new ConstMinusFunctionRecorder(this);
-  new ConstOverFunctionRecorder(this);
-  new FunctionNegationRecorder(this);
-  new FunctionNoopRecorder(this);
-  new FunctionProductRecorder(this);
-  new FunctionQuotientRecorder(this);
-  new FunctionCompositionRecorder(this);
-  new FunctionSumRecorder(this);
-  new FunctionDifferenceRecorder(this);
-  new SinRecorder(this);
-  new CosRecorder(this);
-  new TanRecorder(this);
-  new ASinRecorder(this);
-  new ACosRecorder(this);
-  new ATanRecorder(this);
-  new AbsRecorder(this);
-  new SqrtRecorder(this);
-  new SquareRecorder(this);
-  new ArrayFunctionRecorder(this);
-  new ModRecorder(this);
-  new FixedConstantRecorder(this);
-  new RectangularRecorder(this);
-  new VariableRecorder(this);
-}
-
-void GenFunctionPersistifier::add(const std::type_info & tInfo, const GenFunctionRecorder * recorder) {
-  m_recorderMap[tInfo.name()]=recorder;
-}
-
-std::ostringstream & GenFunctionPersistifier::getStream() const {
-  if (!m_stream) m_stream = new std::ostringstream();
-  return *m_stream;
-}
-
-void GenFunctionPersistifier::persistify(const GeoGenfun::AbsFunction & f) const {
-
-  auto rIter = m_recorderMap.find(typeid(f).name());
-  if (rIter!=m_recorderMap.end()) {
-    const GenFunctionRecorder *recorder = (*rIter).second;
-    recorder->execute(f);
-  }
-  else {
-    std::ostringstream message;
-    message << "Ominous warning in GenFunctionPersistifier: cannot persistify function with type id: " << typeid(f).name();
-    throw std::runtime_error (message.str());
-  }
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionReader.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionReader.cpp
deleted file mode 100644
index 521f8abeaf9e..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionReader.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/GenFunctionReader.h"
-
-#include <stdexcept>
-
-
-
-GenFunctionReader::GenFunctionReader(const std::string & name, GenFunctionInterpreter * interpreter):
-  m_name(name),m_interpreter(interpreter) {
-  interpreter->add(name, this);
-}
-
-const std::string & GenFunctionReader::getName() const {
-  return m_name;
-}
-
-const GenFunctionInterpreter *GenFunctionReader::getInterpreter() const {
-  return m_interpreter;
-}
-#ifdef NOT_THIS_ONE
-std::string::const_iterator GenFunctionReader::split(std::string::const_iterator begin, std::string::const_iterator end) const {
-  auto cSearch=begin;
-  
-  while (1) {
-    auto cComma=std::find(cSearch,end,',');
-    int cOpen=std::count(begin,cComma,'(');
-    int cClose=std::count(begin,cComma,')');
-    if (cOpen==cClose) return cComma;
-    cSearch = ++cComma;
-  }
-  //
-  // Make the compiler happy, but the statement should never occur.
-  //
-  return end; 
-}
-
-#endif
-std::string::const_iterator GenFunctionReader::split(std::string::const_iterator begin, std::string::const_iterator end) const {
-  using namespace std;
-
-  auto cSearch=begin;
-  std::string::const_iterator cComma=end;
-
-  int pCount=0;
-  while (1) {
-    for (auto i=cSearch;i!=end;i++) {
-      char c=*i;
-      if (c==',') {
-	cComma=i;
-	if (pCount==0) {
-	  return cComma;
-	}
-	else {
-	  break;
-	}
-      }
-      else if (c==')') {
-	pCount--;
-      }
-      else if (c=='(') {
-	pCount++;
-      }
-    }
-    cSearch = ++cComma;
-  }
-  return end;
-}
-
-GenFunctionReader::~GenFunctionReader () {}
-
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionRecorder.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionRecorder.cpp
deleted file mode 100644
index b19c202a2539..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenFunctionRecorder.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "TFPersistification/GenFunctionRecorder.h"
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include <stdexcept>
-#include <typeinfo>
-
-
-GenFunctionRecorder::GenFunctionRecorder(const std::type_info & info, GenFunctionPersistifier * persistifier):
-  m_persistifier(persistifier) {
-  persistifier->add(info, this);
-}
-
-const GenFunctionPersistifier *GenFunctionRecorder::getPersistifier() const {
-  return m_persistifier;
-}
-
-GenFunctionRecorder::~GenFunctionRecorder () {}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenfunIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenfunIO.cpp
deleted file mode 100644
index 75012eb6c561..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/GenfunIO.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-#include "GeoGenericFunctions/AbsFunction.h"
-
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenfunIO.h"
-
-#include "GeoGenericFunctions/Variable.h"
-
-#include <sstream>
-
-ConstTimesFunctionReader::ConstTimesFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstTimesFunction", interpreter) {}
-
-inline double atof(std::string::const_iterator begin, std::string::const_iterator end) {
-
-  std::string atom(begin,end);
-  std::istringstream stream(atom);
-  double x=0;
-  stream >> x;
-  return x;
-  
-}
-
-GFPTR  ConstTimesFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstTimesFunction(c,getInterpreter()->interpret(sep+1,end).get()));
-}
-
-
-ConstTimesFunctionRecorder::ConstTimesFunctionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ConstTimesFunction), persistifier) {}
-
-void ConstTimesFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ConstTimesFunction * ptr = dynamic_cast<const GeoGenfun::ConstTimesFunction *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ConstTimesFunctionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  double c1=ptr->_constant;
-  stream << "ConstTimesFunction" << "(";
-  stream << c1;
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg);
-  stream << ")";
-}
-
-ConstPlusFunctionReader::ConstPlusFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstPlusFunction", interpreter) {}
-
-
-GFPTR  ConstPlusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin, end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstPlusFunction(c,getInterpreter()->interpret(sep+1,end).get()));
-}
-
-ConstPlusFunctionRecorder::ConstPlusFunctionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ConstPlusFunction),persistifier) {}
-
-void ConstPlusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ConstPlusFunction * ptr = dynamic_cast<const GeoGenfun::ConstPlusFunction *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ConstPlusFunctionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  double c1=ptr->_constant;
-  stream << "ConstPlusFunction" << "(";
-  stream << c1;
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg);
-  stream << ")";
-}
-
-ConstMinusFunctionReader::ConstMinusFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstMinusFunction", interpreter) {}
-
-
-GFPTR  ConstMinusFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstMinusFunction(c,getInterpreter()->interpret(sep+1,end).get()));
-}
-
-ConstMinusFunctionRecorder::ConstMinusFunctionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ConstMinusFunction),persistifier) {}
-
-void ConstMinusFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ConstMinusFunction * ptr = dynamic_cast<const GeoGenfun::ConstMinusFunction *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ConstMinusFunctionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  double c1=ptr->_constant;
-  stream << "ConstMinusFunction" << "(";
-  stream << c1;
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg);
-  stream << ")";
-}
-
-ConstOverFunctionReader::ConstOverFunctionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("ConstOverFunction", interpreter) {}
-
-
-GFPTR  ConstOverFunctionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  double c=atof(begin,sep);
-  return GFPTR(new GeoGenfun::ConstOverFunction(c,getInterpreter()->interpret(sep+1,end).get()));
-}
-
-ConstOverFunctionRecorder::ConstOverFunctionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::ConstOverFunction),persistifier) {}
-
-void ConstOverFunctionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::ConstOverFunction * ptr = dynamic_cast<const GeoGenfun::ConstOverFunction *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ConstOverFunctionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  double c1=ptr->_constant;
-  stream << "ConstOverFunction" << "(";
-  stream << c1;
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg);
-  stream << ")";
-}
-
-FunctionCompositionReader::FunctionCompositionReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionComposition", interpreter) {}
-
-
-GFPTR  FunctionCompositionReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionComposition(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
-}
-
-FunctionCompositionRecorder::FunctionCompositionRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionComposition), persistifier) {}
-
-void FunctionCompositionRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionComposition * ptr = dynamic_cast<const GeoGenfun::FunctionComposition *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionCompositionRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FunctionComposition(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg2);
-  stream << ")";
-}
-
-FunctionNegationReader::FunctionNegationReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionNegation",interpreter) {}
-
-
-GFPTR  FunctionNegationReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  return GFPTR(new GeoGenfun::FunctionNegation(getInterpreter()->interpret(begin,end).get()));
-}
-
-FunctionNegationRecorder::FunctionNegationRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionNegation),persistifier) {}
-
-void FunctionNegationRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionNegation * ptr = dynamic_cast<const GeoGenfun::FunctionNegation *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionNegationRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream  << "FunctionNegation(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ")";
-}
-
-FunctionNoopReader::FunctionNoopReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionNoop",interpreter) {}
-
-
-GFPTR  FunctionNoopReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  return GFPTR(new GeoGenfun::FunctionNoop(getInterpreter()->interpret(begin,end).get()));
-}
-
-FunctionNoopRecorder::FunctionNoopRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionNoop),persistifier) {}
-
-void FunctionNoopRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionNoop * ptr = dynamic_cast<const GeoGenfun::FunctionNoop *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionNoopRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream  << "FunctionNoop(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ")";
-}
-
-FunctionProductReader::FunctionProductReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionProduct",interpreter) {}
-
-
-GFPTR  FunctionProductReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionProduct(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
-}
-
-FunctionProductRecorder::FunctionProductRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionProduct), persistifier) {}
-
-void FunctionProductRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionProduct * ptr = dynamic_cast<const GeoGenfun::FunctionProduct *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionProductRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FunctionProduct(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg2);
-  stream << ")";
-}
-
-FunctionSumReader::FunctionSumReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionSum",interpreter) {}
-
-
-GFPTR  FunctionSumReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionSum(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
-}
-
-FunctionSumRecorder::FunctionSumRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionSum), persistifier) {}
-
-void FunctionSumRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionSum * ptr = dynamic_cast<const GeoGenfun::FunctionSum *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionSumRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FunctionSum(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg2);
-  stream << ")";
-}
-
-
-
-
-
-
-FunctionQuotientReader::FunctionQuotientReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionQuotient",interpreter) {}
-
-
-GFPTR  FunctionQuotientReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionQuotient(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
-}
-
-FunctionQuotientRecorder::FunctionQuotientRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionQuotient), persistifier) {}
-
-void FunctionQuotientRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionQuotient * ptr = dynamic_cast<const GeoGenfun::FunctionQuotient *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionQuotientRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FunctionQuotient(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg2);
-  stream << ")";
-}
-
-FunctionDifferenceReader::FunctionDifferenceReader(GenFunctionInterpreter *interpreter):GenFunctionReader("FunctionDifference",interpreter) {}
-
-
-GFPTR  FunctionDifferenceReader::execute(std::string::const_iterator begin, std::string::const_iterator end ) const {
-  auto sep=split(begin,end);
-  return GFPTR(new GeoGenfun::FunctionDifference(getInterpreter()->interpret(begin,sep).get(),getInterpreter()->interpret(sep+1,end).get()));
-}
-
-FunctionDifferenceRecorder::FunctionDifferenceRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::FunctionDifference), persistifier) {}
-
-void FunctionDifferenceRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::FunctionDifference * ptr = dynamic_cast<const GeoGenfun::FunctionDifference *> (&F);
-  if (!ptr) throw std::runtime_error("Error in FunctionDifferenceRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "FunctionDifference(";
-  getPersistifier()->persistify(*ptr->_arg1);
-  stream << ",";
-  getPersistifier()->persistify(*ptr->_arg2);
-  stream << ")";
-}
-
-
-
-
-
-VariableReader::VariableReader(GenFunctionInterpreter *interpreter):GenFunctionReader("X",interpreter) {}
-
-
-GFPTR  VariableReader::execute(std::string::const_iterator, std::string::const_iterator) const {
-  return GFPTR(new GeoGenfun::Variable());
-}
-
-
-VariableRecorder::VariableRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Variable), persistifier) {}
-
-void VariableRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Variable * ptr = dynamic_cast<const GeoGenfun::Variable *> (&F);
-  if (!ptr) throw std::runtime_error("Error in VariableRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "X";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ModIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ModIO.cpp
deleted file mode 100644
index 683eab7d9e6d..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/ModIO.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "GeoGenericFunctions/Mod.h"
-
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/ModIO.h"
-
-ModReader::ModReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Mod", interpreter) {}
-
-
-GFPTR  ModReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  double y;
-  std::string aNumberStr(begin,end);
-  std::istringstream stream(aNumberStr);
-  stream >> y;
-  return GFPTR(new GeoGenfun::Mod(y));
-}
-
-
-ModRecorder::ModRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Mod),persistifier) {}
-
-void ModRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Mod * ptr = dynamic_cast<const GeoGenfun::Mod *> (&F);
-  if (!ptr) throw std::runtime_error("Error in ModRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Mod";
-  stream << "(";
-  stream<<ptr->modulus();
-  stream << ")";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/RectangularIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/RectangularIO.cpp
deleted file mode 100644
index eb521dad9aae..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/RectangularIO.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "GeoGenericFunctions/Rectangular.h"
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/RectangularIO.h"
-
-RectangularReader::RectangularReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Rectangular", interpreter) {}
-
-
-GFPTR  RectangularReader::execute(std::string::const_iterator begin, std::string::const_iterator end) const {
-  std::vector<double> elements;
-  auto cStart=begin;
-  auto cNext=std::find(cStart, end,',');
-  while (cNext!=end) {
-    std::string aNumberStr(cStart,cNext);
-    std::istringstream stream(aNumberStr);
-    double d;
-    stream >> d;
-    elements.push_back(d);
-    cStart=cNext+1;
-    cNext=std::find(cStart, end,',');
-  }
-  std::string aNumberStr(cStart,cNext);
-  std::istringstream stream(aNumberStr);
-  double d;
-  stream >> d;
-  elements.push_back(d);
-  if (elements.size()!=4) throw std::runtime_error("Error in Rectangular: illegal value list");
-  
-  GeoGenfun::Rectangular *ptr=new GeoGenfun::Rectangular();
-  ptr->x0().setValue(elements[0]);
-  ptr->x1().setValue(elements[1]);
-  ptr->baseline().setValue(elements[2]);
-  ptr->height().setValue(elements[3]);
-  return GFPTR(ptr);
-}
-
-
-RectangularRecorder::RectangularRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Rectangular),persistifier) {}
-
-void RectangularRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Rectangular * ptr = dynamic_cast<const GeoGenfun::Rectangular *> (&F);
-  if (!ptr) throw std::runtime_error("Error in RectangularRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Rectangular";
-  stream << "(";
-  stream << ptr->x0().getValue();
-  stream << ",";
-  stream << ptr->x1().getValue();
-  stream << ",";
-  stream << ptr->baseline().getValue();
-  stream << ",";
-  stream << ptr->height().getValue();
-  stream << ")";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SinIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SinIO.cpp
deleted file mode 100644
index 4a450d3af62f..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SinIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/SinIO.h"
-
-#include "GeoGenericFunctions/Sin.h"
-
-SinReader::SinReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Sin", interpreter) {}
-
-
-GFPTR  SinReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::Sin());
-}
-
-
-SinRecorder::SinRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Sin),persistifier) {}
-
-void SinRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Sin * ptr = dynamic_cast<const GeoGenfun::Sin *> (&F);
-  if (!ptr) throw std::runtime_error("Error in SinRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Sin";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SqrtIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SqrtIO.cpp
deleted file mode 100644
index a06a58e10519..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SqrtIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/SqrtIO.h"
-
-#include "GeoGenericFunctions/Sqrt.h"
-
-SqrtReader::SqrtReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Sqrt", interpreter) {}
-
-
-GFPTR  SqrtReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::Sqrt());
-}
-
-
-SqrtRecorder::SqrtRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Sqrt),persistifier) {}
-
-void SqrtRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Sqrt * ptr = dynamic_cast<const GeoGenfun::Sqrt *> (&F);
-  if (!ptr) throw std::runtime_error("Error in SqrtRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Sqrt";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SquareIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SquareIO.cpp
deleted file mode 100644
index 1f70c16e042d..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/SquareIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/SquareIO.h"
-
-#include "GeoGenericFunctions/Square.h"
-
-SquareReader::SquareReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Square", interpreter) {}
-
-
-GFPTR  SquareReader::execute(std::string::const_iterator, std::string::const_iterator ) const {
-  return GFPTR(new GeoGenfun::Square());
-}
-
-
-SquareRecorder::SquareRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Square),persistifier) {}
-
-void SquareRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Square * ptr = dynamic_cast<const GeoGenfun::Square *> (&F);
-  if (!ptr) throw std::runtime_error("Error in SquareRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Square";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TanIO.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TanIO.cpp
deleted file mode 100644
index ad57db23d0db..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TanIO.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/TanIO.h"
-
-#include "GeoGenericFunctions/Tan.h"
-
-TanReader::TanReader(GenFunctionInterpreter *interpreter):GenFunctionReader("Tan", interpreter) {}
-
-
-GFPTR  TanReader::execute(std::string::const_iterator, std::string::const_iterator) const {
-  return GFPTR(new GeoGenfun::Tan());
-}
-
-
-TanRecorder::TanRecorder(GenFunctionPersistifier *persistifier):
-  GenFunctionRecorder(typeid(GeoGenfun::Tan),persistifier) {}
-
-void TanRecorder::execute(const GeoGenfun::AbsFunction & F) const {
-  const GeoGenfun::Tan * ptr = dynamic_cast<const GeoGenfun::Tan *> (&F);
-  if (!ptr) throw std::runtime_error("Error in TanRecorder:: wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "Tan";
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionInterpreter.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionInterpreter.cpp
deleted file mode 100644
index b30b6cc9ea35..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionInterpreter.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "TFPersistification/TransFunctionInterpreter.h"
-#include "TFPersistification/TransFunctionReader.h"
-#include "GeoModelKernel/GeoXF.h"
-
-const GenFunctionInterpreter * TransFunctionInterpreter::getGenFunctionInterpreter() const {
-  return &m_fInterpreter;
-}
-
-
-
-TransFunctionInterpreter::~TransFunctionInterpreter() {
-  for (auto i=m_readerMap.begin();i!=m_readerMap.end();i++) {
-    delete (*i).second;
-  }
-}
-
-TransFunctionInterpreter::TransFunctionInterpreter(){
-  new PowReader(this);
-  new PreMultReader(this);
-  new PostMultReader(this);
-  new ProductReader(this);
-}
-
-void TransFunctionInterpreter::add(const std::string & str, const TransFunctionReader * reader) {
-  reader=m_readerMap[str]=reader;
-}
-
-
-TFPTR TransFunctionInterpreter::interpret(const std::string &exprString) const {
-  size_t begin = exprString.find_first_of("{");
-  size_t end = exprString.find_last_of("}");
-  if (!((begin!=std::string::npos) && (end!=std::string::npos))) {
-    throw std::runtime_error ("Ominous warning in TransFunctionPersistier:  cannot parse function");
-  }
-  std::string op = exprString.substr(0,begin);
-  std::string argument = exprString.substr(begin+1,end-begin-1);
-  // for debug only!
-  // std::cout << begin << " " << end << " " << op << " " << argument << std::endl;
-  // for (auto const& x : readerMap) {
-  //     std::cout << x.first  // string (key)
-  //               << " : "
-  //               << x.second // string's value
-  //               << std::endl ;
-  // }
-  auto rIter = m_readerMap.find(op);
-  if (rIter==m_readerMap.end()) {
-    throw std::runtime_error ("Ominous warning in TransFunctionPersistier:  cannot interpret function");
-  }
-  const TransFunctionReader *reader = (*rIter).second;
-  return reader->execute(argument);
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionPersistifier.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionPersistifier.cpp
deleted file mode 100644
index f1f2875efc2c..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionPersistifier.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "TFPersistification/TransFunctionPersistifier.h"
-#include "TFPersistification/TransFunctionRecorder.h"
-#include "GeoModelKernel/GeoXF.h"
-
-const GenFunctionPersistifier * TransFunctionPersistifier::getGenFunctionPersistifier() const {
-  return &m_persistifier;
-}
-
-const std::string & TransFunctionPersistifier::getCodedString() const {
-  
-  m_codedString=getStream().str();
-  delete m_stream;
-  m_stream=NULL;
-  return m_codedString;
-}
-
-
-TransFunctionPersistifier::~TransFunctionPersistifier() {
-  delete m_stream;
-  for (auto i=m_recorderMap.begin(); i!=m_recorderMap.end();i++) {
-    delete (*i).second;
-  }
-}
-TransFunctionPersistifier::TransFunctionPersistifier():m_stream(NULL) {
-  new PreMultRecorder(this);
-  new PostMultRecorder(this);
-  new PowRecorder(this);
-  new ProductRecorder(this);
-}
-
-void TransFunctionPersistifier::add(const std::type_info & tInfo, const TransFunctionRecorder * recorder) {
-  m_recorderMap[tInfo.name()]=recorder;
-}
-
-std::ostringstream & TransFunctionPersistifier::getStream() const {
-  if (!m_stream) m_stream = new std::ostringstream();
-  return *m_stream;
-}
-
-void TransFunctionPersistifier::persistify( const GeoXF::Function & f) const {
-  
-  auto rIter = m_recorderMap.find(typeid(f).name());
-  if (rIter!=m_recorderMap.end()) {
-    const TransFunctionRecorder *recorder = (*rIter).second;
-    recorder->execute(f);
-  }
-  else {
-      std::ostringstream message;
-    message << "Ominous warning in TransFunctionPersistier: cannot persistify function with type id: " << typeid(f).name();
-    throw std::runtime_error (message.str());
-  }
-    
-    //throw std::runtime_error ("Ominous warning in TransFunctionPersistier:  cannot persistify function");
- 
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionReader.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionReader.cpp
deleted file mode 100644
index 56c402f3300a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionReader.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "TFPersistification/TransFunctionInterpreter.h"
-#include "TFPersistification/GenFunctionInterpreter.h"
-#include "TFPersistification/TransFunctionReader.h"
-
-#include "GeoModelKernel/GeoXF.h"
-
-#include "GeoGenericFunctions/FixedConstant.h"
-#include "GeoGenericFunctions/FunctionProduct.h"
-#include "GeoGenericFunctions/FunctionComposition.h"
-
-#include "GeoPrimitives/CLHEPtoEigenConverter.h" // TODO: to be removed when dropping CLHEP
-
-#include <stdexcept>
-#include <sstream>
-
-TransFunctionReader::TransFunctionReader(const std::string & name, TransFunctionInterpreter * interpreter):
-  m_interpreter(interpreter) {
-  interpreter->add(name, this);
-}
-
-const TransFunctionInterpreter *TransFunctionReader::getInterpreter() const {
-  return m_interpreter;
-}
-
-std::pair<std::string, std::string> TransFunctionReader::split(const std::string & arg) const {
-  size_t comma=0;
-  auto cSearch=arg.begin();
-  while (1) {
-    auto cComma=std::find(cSearch,arg.end(),'|');
-    int cOpen=std::count(arg.begin(),cComma,'{');
-    int cClose=std::count(arg.begin(),cComma,'}');
-    comma=cComma-arg.begin();
-    if (cOpen==cClose) break;
-    cSearch = ++cComma;
-  }
-  std::string op1=arg.substr(0,comma);
-  std::string op2=arg.substr(comma+1);  
-  return std::make_pair(op1,op2);
-}
-TransFunctionReader::~TransFunctionReader () {}
-
-#include "GeoModelKernel/GeoXF.h"                          
-#include "GeoModelKernel/GeoDefinitions.h"
-
-#include <iostream>
-#include <typeinfo>
-
-
-//===========Now come implementations of specific types of transfunction:
-ProductReader::ProductReader(TransFunctionInterpreter *interpreter):TransFunctionReader("GeoXF::Product", interpreter) {}
-PreMultReader::PreMultReader(TransFunctionInterpreter *interpreter):TransFunctionReader("GeoXF::PreMult", interpreter) {}
-PostMultReader::PostMultReader(TransFunctionInterpreter *interpreter):TransFunctionReader("GeoXF::PostMult", interpreter) {}
-PowReader::PowReader(TransFunctionInterpreter *interpreter):TransFunctionReader("GeoXF::Pow", interpreter) {}
-
-
-TFPTR  ProductReader::execute(const std::string & arg) const {
-  auto pair=split(arg);
-  return TFPTR(GeoXF::Product(getInterpreter()->interpret(pair.first).get(), getInterpreter()->interpret(pair.second).get()).clone());
-}
-
-
-TFPTR  PreMultReader::execute(const std::string & arg ) const {
-  auto pair=split(arg);
-  TFPTR p2=getInterpreter()->interpret(pair.second);
-  GeoTrf::Transform3D t1 = scanT(pair.first);
-  return TFPTR(GeoXF::PreMult(t1, p2.get()).clone());
-}
-
-
-TFPTR  PostMultReader::execute(const std::string & arg) const {
-  auto pair=split(arg);
-  TFPTR p1=getInterpreter()->interpret(pair.first);
-  GeoTrf::Transform3D t2=scanT(pair.second);
-  return TFPTR(GeoXF::PostMult(p1.get(), t2).clone());
-}
-
-TFPTR  PowReader::execute(const std::string & arg) const {
-  auto pair=split(arg);
-  return TFPTR(GeoXF::Pow((scanT(pair.first)),*getInterpreter()->getGenFunctionInterpreter()->interpret(pair.second.begin(), pair.second.end())).clone());
-}
-
-GeoTrf::Transform3D TransFunctionReader::scanT(const std::string & exprString) const {
-  size_t start = exprString.find_first_of("[");
-  double x[12];
-  int i=0;
-  while (1) {
-    size_t end   = exprString.find_first_of(";",start+1);
-    std::string atomic=exprString.substr(start+1,end-start);
-    std::istringstream stream(atomic.substr(0,atomic.size()-1));
-    stream >> x[i];
-    start=end;
-    if (atomic.find("]")!=std::string::npos) break;
-    i++;
-  }
-  double & xx=x[0], & xy=x[1], & xz=x[2];
-  double & yx=x[3], & yy=x[4], & yz=x[5];
-  double & zx=x[6], & zy=x[7], & zz=x[8];
-  double & dx=x[9], & dy=x[10], & dz=x[11];
-
-  // TODO: to drop CLHEP, this below should be replaced with Eigen-based Amg objects
-  CLHEP::HepRotation R;
-  R.set(CLHEP::Hep3Vector(xx,yx,zx),
-		  CLHEP::Hep3Vector(xy,yy,zy),
-		  CLHEP::Hep3Vector(xz,yz,zz));
-  CLHEP::Hep3Vector D(dx,dy,dz);
-  HepGeom::Transform3D xf(R, D);
-
-  return Amg::CLHEPTransformToEigen(xf);
-}
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionRecorder.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionRecorder.cpp
deleted file mode 100644
index 9263194e25b3..000000000000
--- a/DetectorDescription/GeoModel/GeoModelStandalone/TFPersistification/src/TransFunctionRecorder.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#include "TFPersistification/TransFunctionPersistifier.h"
-#include "TFPersistification/GenFunctionPersistifier.h"
-#include "TFPersistification/TransFunctionRecorder.h"
-
-// This is a data recorder. It breaks encapsulation. Normal. ==========//
-#include "GeoModelKernel/GeoXF.h"
-//=====================================================================//
-
-
-#include <stdexcept>
-TransFunctionRecorder::TransFunctionRecorder(const std::type_info & info, TransFunctionPersistifier * persistifier):
-  m_persistifier(persistifier) {
-  persistifier->add(info, this);
-}
-
-const TransFunctionPersistifier *TransFunctionRecorder::getPersistifier() const {
-  return m_persistifier;
-}
-
-TransFunctionRecorder::~TransFunctionRecorder () {}
-
-#include "GeoModelKernel/GeoXF.h"                          //
-
-#include "GeoModelKernel/GeoDefinitions.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
-
-#include <iostream>
-#include <typeinfo>
-
-
-//===========Now come implementations of specific types of transfunction:
-ProductRecorder::ProductRecorder(TransFunctionPersistifier *persistifier):TransFunctionRecorder(typeid(GeoXF::Product),persistifier) {}
-PreMultRecorder::PreMultRecorder(TransFunctionPersistifier *persistifier):TransFunctionRecorder(typeid(GeoXF::PreMult),persistifier) {}
-PostMultRecorder::PostMultRecorder(TransFunctionPersistifier *persistifier):TransFunctionRecorder(typeid(GeoXF::PostMult),persistifier) {}
-PowRecorder::PowRecorder(TransFunctionPersistifier *persistifier):TransFunctionRecorder(typeid(GeoXF::Pow),persistifier) {}
-
-void ProductRecorder::execute( const GeoXF::Function & function) const {
-  const GeoXF::Product * ptr= dynamic_cast<const GeoXF::Product *> (&function);
-  if (!ptr) throw std::runtime_error("Error in ProductRecorder:  wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-
-  stream << "GeoXF::Product" << "{";
-  getPersistifier()->persistify(*ptr->arg1());
-  stream << "|";
-  getPersistifier()->persistify(*ptr->arg2());
-  stream << "}";
-  return;
-}
-
-
-void PreMultRecorder::execute( const GeoXF::Function & function) const {
-  const GeoXF::PreMult * ptr= dynamic_cast<const GeoXF::PreMult *> (&function);
-  if (!ptr) throw std::runtime_error("Error in PreMultRecorder:  wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "GeoXF::PreMult" << "{";
-  const HepGeom::Transform3D & tPtr = Amg::EigenTransformToCLHEP(ptr->arg1());
-  stream << "Transform["
-	 << tPtr.xx() << ";" << tPtr.xy() << ";" << tPtr.xz() << ";"
-	 << tPtr.yx() << ";" << tPtr.yy() << ";" << tPtr.yz() << ";"
-	 << tPtr.zx() << ";" << tPtr.zy() << ";" << tPtr.zz() << ";"
-	 << tPtr.dx() << ";" << tPtr.dy() << ";" << tPtr.dz() << "]";
-  stream << "|";
-  getPersistifier()->persistify(*ptr->arg2());
-  stream << "}";
-  return;
-}
-
-
-void PostMultRecorder::execute( const GeoXF::Function & function) const {
-  const GeoXF::PostMult * ptr= dynamic_cast<const GeoXF::PostMult *> (&function);
-  if (!ptr) throw std::runtime_error("Error in PostMultRecorder:  wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "GeoXF::PostMult" << "{";
-  getPersistifier()->persistify(*ptr->arg1());
-  stream << "|";
-  const HepGeom::Transform3D & tPtr = Amg::EigenTransformToCLHEP(ptr->arg2());
-  stream << "Transform["
-	 << tPtr.xx() << ";" << tPtr.xy() << ";" << tPtr.xz() << ";"
-	 << tPtr.yx() << ";" << tPtr.yy() << ";" << tPtr.yz() << ";"
-	 << tPtr.zx() << ";" << tPtr.zy() << ";" << tPtr.zz() << ";"
-	 << tPtr.dx() << ";" << tPtr.dy() << ";" << tPtr.dz() << "]";
-  stream << "}";
-  return;
-}
-
-
-
-void PowRecorder::execute( const GeoXF::Function & function) const {
-  const GeoXF::Pow * ptr= dynamic_cast<const GeoXF::Pow *> (&function);
-  if (!ptr) throw std::runtime_error("Error in PowRecorder:  wrong function type");
-  std::ostringstream & stream = getPersistifier()->getStream();
-  stream << "GeoXF::Pow" << "{";
-  const HepGeom::Transform3D & tPtr = Amg::EigenTransformToCLHEP(ptr->transform());
-  stream << "Transform["
-	 << tPtr.xx() << ";" << tPtr.xy() << ";" << tPtr.xz() << ";"
-	 << tPtr.yx() << ";" << tPtr.yy() << ";" << tPtr.yz() << ";"
-	 << tPtr.zx() << ";" << tPtr.zy() << ";" << tPtr.zz() << ";"
-	 << tPtr.dx() << ";" << tPtr.dy() << ";" << tPtr.dz() << "]";
-  stream << "|";
-  getPersistifier()->getGenFunctionPersistifier()->persistify(*ptr->function());
-  stream << getPersistifier()->getGenFunctionPersistifier()->getCodedString();
-  stream << "}";
-  return;
-}
-- 
GitLab


From 4d9c6e7a0e4848aa2c5a58749ab0bd74d78f8156 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 3 Jul 2020 23:45:18 +0200
Subject: [PATCH 036/217] InDetCompetingRIOsOnTrackTool: cmake fixes

Declare an interface library for exported headers.
---
 .../InDetCompetingRIOsOnTrackTool/CMakeLists.txt       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/CMakeLists.txt
index ad2e7fd33ed6..794088b70409 100644
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/CMakeLists.txt
@@ -23,13 +23,17 @@ atlas_depends_on_subdirs( PUBLIC
 # External dependencies:
 find_package( Eigen )
 
+atlas_add_library( InDetCompetingRIOsOnTrackToolLib
+                   InDetCompetingRIOsOnTrackTool/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS InDetCompetingRIOsOnTrackTool
+                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkParameters EventPrimitives GeoPrimitives TrkToolInterfaces InDetCompetingRIOsOnTrack )
+
 # Component(s) in the package:
 atlas_add_component( InDetCompetingRIOsOnTrackTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventPrimitives GaudiKernel InDetCompetingRIOsOnTrack TrkParameters TrkToolInterfaces InDetPrepRawData TrkSurfaces TrkEventPrimitives TrkExInterfaces )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} InDetCompetingRIOsOnTrackToolLib InDetPrepRawData TrkSurfaces TrkEventPrimitives TrkExInterfaces )
 
-# Install files from the package:
-atlas_install_headers( InDetCompetingRIOsOnTrackTool )
 
-- 
GitLab


From 6d337e7d66ca5627374185f136b355e7208f5cf9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 3 Jul 2020 23:58:37 +0200
Subject: [PATCH 037/217] TrkTruthTrackInterfaces: cmake fixes

Declare an interface library for exported headers.
---
 .../TrkTruthTracks/TrkTruthTrackInterfaces/CMakeLists.txt  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkTruthTracks/TrkTruthTrackInterfaces/CMakeLists.txt b/Tracking/TrkTruthTracks/TrkTruthTrackInterfaces/CMakeLists.txt
index 9782800d65e3..b84953c40339 100644
--- a/Tracking/TrkTruthTracks/TrkTruthTrackInterfaces/CMakeLists.txt
+++ b/Tracking/TrkTruthTracks/TrkTruthTrackInterfaces/CMakeLists.txt
@@ -10,6 +10,9 @@ atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           Tracking/TrkEvent/TrkSegment )
 
-# Install files from the package:
-atlas_install_headers( TrkTruthTrackInterfaces )
+atlas_add_library( TrkTruthTrackInterfaces
+                   TrkTruthTrackInterfaces/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS TrkTruthTrackInterfaces
+                   LINK_LIBRARIES GaudiKernel AtlasHepMCLib TrkSegment )
 
-- 
GitLab


From 5c19eaa6a093732a068a8ad59082c77eccf12b76 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 3 Jul 2020 23:59:03 +0200
Subject: [PATCH 038/217] BCM_CollisionTime: cmake fixes

Declare an interface library for exported headers.
---
 .../InDetRecEvent/BCM_CollisionTime/CMakeLists.txt        | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/BCM_CollisionTime/CMakeLists.txt b/InnerDetector/InDetRecEvent/BCM_CollisionTime/CMakeLists.txt
index 3522a090321d..8ca459adad7a 100644
--- a/InnerDetector/InDetRecEvent/BCM_CollisionTime/CMakeLists.txt
+++ b/InnerDetector/InDetRecEvent/BCM_CollisionTime/CMakeLists.txt
@@ -11,6 +11,10 @@ atlas_depends_on_subdirs( PUBLIC
                           PRIVATE
                           GaudiKernel )
 
-# Install files from the package:
-atlas_install_headers( BCM_CollisionTime )
+atlas_add_library( BCM_CollisionTimeLib
+                   BCM_CollisionTime/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS BCM_CollisionTime
+                   LINK_LIBRARIES AthenaKernel )
+
 
-- 
GitLab


From 4df4a5e8e67993e48141879bcdcb8d787fa2fea5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 3 Jul 2020 23:46:45 +0200
Subject: [PATCH 039/217] TrkGaussianSumFilter: cmake fix

Library dependency fixes.
---
 Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
index 6a5436c4e1da..eebd6b6775dc 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt
@@ -56,13 +56,15 @@ atlas_install_runtime( Data/*.par )
 
 #Executables for tests
 atlas_add_executable( GSF_testFindMinimumIndex
-	test/testFindMinimumIndex.cxx src/KLGaussianMixtureReduction.cxx)
+	test/testFindMinimumIndex.cxx src/KLGaussianMixtureReduction.cxx
+        LINK_LIBRARIES CxxUtils )
 
 atlas_add_executable( GSF_testAlignedDynArray
 	test/testAlignedDynArray.cxx)
 
 atlas_add_executable( GSF_testMergeComponents
-	test/testMergeComponents.cxx src/KLGaussianMixtureReduction.cxx)
+	test/testMergeComponents.cxx src/KLGaussianMixtureReduction.cxx
+        LINK_LIBRARIES CxxUtils )
 
 #Tests
 atlas_add_test(ut_GSF_testFindMinimumIndex
-- 
GitLab


From b3514fc6cdf7f870e26e651dd202ca68c59e4e01 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 4 Jul 2020 00:00:38 +0200
Subject: [PATCH 040/217] ZDC_GeoM: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 ForwardDetectors/ZDC/ZDC_GeoM/src/ZDC_DetTool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ForwardDetectors/ZDC/ZDC_GeoM/src/ZDC_DetTool.h b/ForwardDetectors/ZDC/ZDC_GeoM/src/ZDC_DetTool.h
index 61320091ba84..2f18664ea95a 100644
--- a/ForwardDetectors/ZDC/ZDC_GeoM/src/ZDC_DetTool.h
+++ b/ForwardDetectors/ZDC/ZDC_GeoM/src/ZDC_DetTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ZDCDETTOOL_H
@@ -8,7 +8,7 @@
 #include "GeoModelUtilities/GeoModelTool.h"
 #include "AthenaKernel/MsgStreamMember.h"
 
-class ZDC_DetTool : public GeoModelTool 
+class ZDC_DetTool final : public GeoModelTool 
 {
 
 public:
-- 
GitLab


From f0d28a409bdca474366b667278722c2c527d2a70 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 4 Jul 2020 00:04:56 +0200
Subject: [PATCH 041/217] BeamPipeGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 .../BeamPipeGeoModel/src/BeamPipeDetectorTool.h               | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorTool.h b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorTool.h
index b6a3ecd49b22..bfcc548967c8 100755
--- a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorTool.h
+++ b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef BEAMPIPEDETECTORTOOL_H
@@ -8,7 +8,7 @@
 #include "GeoModelUtilities/GeoModelTool.h"
 class BeamPipeDetectorManager;
 
-class BeamPipeDetectorTool : public GeoModelTool 
+class BeamPipeDetectorTool final : public GeoModelTool 
 {
  public:
 
-- 
GitLab


From e4274ced4770b212c823ee2851c256a0bb094f1c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 4 Jul 2020 00:05:09 +0200
Subject: [PATCH 042/217] CavernInfraGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 .../CavernInfraGeoModel/src/CavernInfraDetectorTool.h         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/AtlasGeometryCommon/CavernInfraGeoModel/src/CavernInfraDetectorTool.h b/AtlasGeometryCommon/CavernInfraGeoModel/src/CavernInfraDetectorTool.h
index eed4b4ec3eda..588292859494 100755
--- a/AtlasGeometryCommon/CavernInfraGeoModel/src/CavernInfraDetectorTool.h
+++ b/AtlasGeometryCommon/CavernInfraGeoModel/src/CavernInfraDetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CAVERNINFRADETECTORTOOL_H
@@ -8,7 +8,7 @@
 #include "GeoModelUtilities/GeoModelTool.h"
 class CavernInfraDetectorManager;
 
-class CavernInfraDetectorTool : public GeoModelTool 
+class CavernInfraDetectorTool final : public GeoModelTool 
 {
  public:
 
-- 
GitLab


From 849ebfcb39b3360cde257d45fd569ad46c623cee Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 4 Jul 2020 00:01:32 +0200
Subject: [PATCH 043/217] TrigConfStorage: Fix clang 10 warnings.

Avoid spurious object copies in range for.
---
 .../TrigConfStorage/src/ConfigurationCheck.cxx            | 8 ++++----
 .../TrigConfStorage/src/test/ConsistencyChecker.cxx       | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
index 0c2cd6d4491a..2033a433adf3 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -478,7 +478,7 @@ public:
         if( matches_any(exc_regex, ch->chain_name()) ) continue; // excempt
       
         bool bwgroup=false;
-        for( const string it : ch->groups()) {
+        for( const string& it : ch->groups()) {
            if ( it.find("BW:") == 0 ) { bwgroup=true; break; }
         }
         if(!bwgroup)
@@ -661,7 +661,7 @@ public:
 	 
             // check for excempt chains
             bool chain_is_excempt = false;
-            for(const boost::regex e : exc_regex ) {
+            for(const boost::regex& e : exc_regex ) {
                if(regex_match(ch->chain_name(), e)) {
                   chain_is_excempt = true;
                   break;
@@ -686,7 +686,7 @@ public:
 
             // check for exceptions
             bool item_is_excempt = false;
-            for(const boost::regex e : exc_regex ) {
+            for(const boost::regex& e : exc_regex ) {
                if(regex_match(item->name(), e)) {
                   item_is_excempt = true;
                   break;
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
index 1e2b1ae096e7..6bca2bd743a9 100755
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////////
@@ -341,7 +341,7 @@ void JobConfig::PrintCompleteSetup(std::ostream & log) {
 
 typedef std::pair<std::string,std::string> Key_t;
 typedef std::map< Key_t, std::vector<std::string> > ExcMap_t;
-typedef std::pair< Key_t, std::vector<std::string> > ExcMapPair_t;
+typedef std::pair< const Key_t, std::vector<std::string> > ExcMapPair_t;
 
 namespace {
    void parseExceptionsFile( const std::string& filename, std::map< Key_t, std::vector<std::string> >& exc, std::ostream & log ) {
-- 
GitLab


From 8f6d8f07200165474ac6eb8089e3bec8039a8743 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 4 Jul 2020 00:04:44 +0200
Subject: [PATCH 044/217] TrkDetDescrUtils: Fix compilation with clang 10.

CompactBinnedArray2D has an assignment operator,
so membes should not be const.
---
 .../TrkDetDescrUtils/TrkDetDescrUtils/CompactBinnedArray2D.h  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/CompactBinnedArray2D.h b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/CompactBinnedArray2D.h
index e85893181d3e..867167d0a752 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/CompactBinnedArray2D.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrUtils/TrkDetDescrUtils/CompactBinnedArray2D.h
@@ -189,10 +189,10 @@ public:
   size_t layerBin(const Amg::Vector3D& pos) const { return (layerBinUtility(pos)->bin(pos)); }
 
 private:
-  const std::vector<std::vector<size_t>> m_array; //!< vector of indices to objects
+  std::vector<std::vector<size_t>> m_array; //!< vector of indices to objects
   const std::vector<T*> m_arrayObjects;     //!< objects
   const BinUtility* m_binUtility;                 //!< binUtility
-  const std::vector<BinUtility*> m_buVec;         //!< vector of bin utilities for 2nd dim
+  std::vector<BinUtility*> m_buVec;         //!< vector of bin utilities for 2nd dim
 };
 
 template<class T>
-- 
GitLab


From bb3d5375bbeb58b75742af172934e974734d28e5 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 5 Jul 2020 00:38:48 +0100
Subject: [PATCH 045/217] Not sure we want both pre and post increment

---
 Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
index 680f1c07b6fb..6fd0d925e5a5 100755
--- a/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExTools/src/Extrapolator.cxx
@@ -830,7 +830,7 @@ Trk::Extrapolator::extrapolateToNextMaterialLayer(const EventContext& ctx,
             }
           } else if (confLays) {
             std::vector<const Trk::Layer*>::const_iterator lIt = confLays->begin();
-            for (; lIt != confLays->end(); ++lIt++) {
+            for (; lIt != confLays->end(); ++lIt) {
               cache.m_layers.emplace_back(&((*lIt)->surfaceRepresentation()), true);
               cache.m_navigLays.emplace_back((*iTer)->trackingVolume(), *lIt);
             }
-- 
GitLab


From 09ea7a1b940afaa6ac775d89b4ae49f896faa4c4 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sun, 5 Jul 2020 07:37:36 +0200
Subject: [PATCH 046/217] Add missing ATLAS_CHECK_THREAD_SAFETY to
 InDetIncSecVxFinderTool package.

---
 .../InDetIncSecVxFinderTool/ATLAS_CHECK_THREAD_SAFETY            | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..0ca8bccfe5e6
--- /dev/null
+++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/InDetIncSecVxFinderTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/InDetIncSecVxFinderTool
-- 
GitLab


From 70f809d6f7a55f57eb5dacefd3ac6a091d6dfd3d Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 5 Jul 2020 17:43:56 +0100
Subject: [PATCH 047/217] TrkVertexKinematicFitterUtils add
 ATLAS_CHECK_THREAD_SAFETY

---
 .../IKinematicConstraint.h                    |  65 ++---
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../CollinearityConstraint.h                  |  47 ++--
 .../MassConstraint.h                          | 126 +++++-----
 .../src/CollinearityConstraint.cxx            | 227 ++++++++++--------
 .../src/MassConstraint.cxx                    | 129 +++++-----
 6 files changed, 320 insertions(+), 275 deletions(-)
 create mode 100644 Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IKinematicConstraint.h b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IKinematicConstraint.h
index 5e3fdbb6907e..c68a3bdad037 100644
--- a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IKinematicConstraint.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IKinematicConstraint.h
@@ -1,12 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef TrkVertexFitterInterfaces_IKinematicConstraint_h 
-#define TrkVertexFitterInterfaces_IKinematicConstraint_h 
-
-#include "CLHEP/Matrix/SymMatrix.h"
-#include "CLHEP/Matrix/Vector.h"
+#ifndef TrkVertexFitterInterfaces_IKinematicConstraint_h
+#define TrkVertexFitterInterfaces_IKinematicConstraint_h
 
 #include "EventPrimitives/EventPrimitives.h"
 #include "GeoPrimitives/GeoPrimitives.h"
@@ -14,41 +11,45 @@
 /**
  * @class IKinematicConstraint
  *
- * Kinematic constraints are implemented as a set of equation that depend on the cartesian coordinates
- * of the kinematic particles, is it an interface? I'm not sure?
- * Constraint-equations used by the KinematicVertexFitter are implemented in a general form which contains:
- * a vector with the current values of each constraint-equation for a given set of KinematicParticle
- * and a matrix with the derivatives of the constraint-equations vs the cartesian coordinates of the particles 
+ * Kinematic constraints are implemented as a set of equation that depend on the
+ * cartesian coordinates of the kinematic particles. Constraint-equations used
+ * by the KinematicVertexFitter are implemented in a general form which
+ * contains: a vector with the current values of each constraint-equation for a
+ * given set of KinematicParticle and a matrix with the derivatives of the
+ * constraint-equations vs the cartesian coordinates of the particles
  *
  * @author Maaike.Limper@cern.ch
  * @author Kirill.Prokofiev@cern.ch
  * March 2008
  */
 
-namespace Trk{
+namespace Trk {
+
+// class KinematicParticle;
+
+class IKinematicConstraint
+{
 
-  //class KinematicParticle;
+public:
+  /*** Virtual destructor */
+  virtual ~IKinematicConstraint() = default;
 
- class IKinematicConstraint
- {
+  /*** Actual access methods: */
+  virtual Amg::VectorX vectorOfValues(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const = 0;
 
-  public:
+  virtual Amg::MatrixX matrixOfDerivatives(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const = 0;
 
-   /*** Virtual destructor */
-   virtual ~IKinematicConstraint() {}
-   
-   /*** Actual access methods: */   
-   virtual const Amg::VectorX vectorOfValues(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla) const = 0;
-   
-   virtual const Amg::MatrixX matrixOfDerivatives(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla) const = 0;
-   
-   virtual int numberOfEquations() const = 0;
-     
- private:  
- 
+  virtual int numberOfEquations() const = 0;
 
-    
- }; //end of class definitions
-}//end of namespace definitions
+}; // end of class definitions
+} // end of namespace definitions
 
-#endif //TrkVertexKinematicFitInterfaces_IKinematicConstraint_h 
+#endif // TrkVertexKinematicFitInterfaces_IKinematicConstraint_h
diff --git a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..d67bb806a0f7
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils
diff --git a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/CollinearityConstraint.h b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/CollinearityConstraint.h
index 7a318e264c1c..9b40eb0412b0 100644
--- a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/CollinearityConstraint.h
+++ b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/CollinearityConstraint.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrkVertexKinematicFitterUtils_CollinearityConstraint_h 
@@ -10,27 +10,32 @@
 
 #include "TrkVertexFitterInterfaces/IKinematicConstraint.h"
 
-
-namespace Trk
+namespace Trk {
+class CollinearityConstraint : public IKinematicConstraint
 {
-  class CollinearityConstraint : public IKinematicConstraint
-  {
-  public:
-
-    CollinearityConstraint() ;
-    
-    ~CollinearityConstraint();
-
-   virtual const Amg::VectorX vectorOfValues(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const;
-   
-   virtual const Amg::MatrixX matrixOfDerivatives(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const;
-   
-   virtual int numberOfEquations() const { return m_eqno; } 
-
-  private:
-    
-   int m_eqno; // number of constraint-equations used
-   };
+public:
+
+
+  CollinearityConstraint() = default;
+  virtual ~CollinearityConstraint() = default;
+
+  virtual Amg::VectorX vectorOfValues(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const override final;
+
+  virtual Amg::MatrixX matrixOfDerivatives(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const override final;
+
+  virtual int numberOfEquations() const override final { return s_eqno; }
+
+private:
+  static constexpr int s_eqno = 2; // number of constraint-equations used
+};
 }
 
 #endif //TrkVertexKinematicFitterUtils_CollinearityConstraint_h 
diff --git a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/MassConstraint.h b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/MassConstraint.h
index fafa252d4f5d..44e811b18352 100644
--- a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/MassConstraint.h
+++ b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/TrkVertexKinematicFitterUtils/MassConstraint.h
@@ -1,79 +1,85 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef TrkVertexKinematicFitterUtils_MassConstraint_h 
-#define TrkVertexKinematicFitterUtils_MassConstraint_h 
+#ifndef TrkVertexKinematicFitterUtils_MassConstraint_h
+#define TrkVertexKinematicFitterUtils_MassConstraint_h
 
-// This object defines a MASS constraint to be used with the constrained vertex fitter
+// This object defines a MASS constraint to be used with the constrained vertex
+// fitter
 
 #include "TrkVertexFitterInterfaces/IKinematicConstraint.h"
 
+namespace Trk {
+/** @class MassConstraint
+    @brief Concrete implementation of Trk::IKinematicConstraint to formulate
+           a mass constraint in kinematic vertex fits.
 
-namespace Trk
-{
-  /** @class MassConstraint
-      @brief Concrete implementation of Trk::IKinematicConstraint to formulate
-             a mass constraint in kinematic vertex fits.
+    The constraint is constructed with a mass value (in MeV), to which the
+    invariant mass of the particles emerging from a vertex will be constrained.
+    It calculates the values and derivatives for a list of particles,
+    given by their parameters and charges.
 
-      The constraint is constructed with a mass value (in MeV), to which the
-      invariant mass of the particles emerging from a vertex will be constrained.
-      It calculates the values and derivatives for a list of particles,
-      given by their parameters and charges.
+    @author Maaike Limper
+*/
 
-      @author Maaike Limper
-  */
+class MassConstraint : public IKinematicConstraint
+{
+public:
+  //! empty constructor
+  MassConstraint() = default;
 
-  class MassConstraint : public IKinematicConstraint
-  {
-  public:
+  /** standard constructor
+      @param[in] mass Invariant mass in MeV to which particles shall be
+     constrained
+  */
+  MassConstraint(double mass);
 
-    //! empty constructor
-    MassConstraint() ;
+  virtual ~MassConstraint() = default;
 
-    /** standard constructor
-        @param[in] mass Invariant mass in MeV to which particles shall be constrained
-    */
-    MassConstraint( double mass ) ;
-    
-    ~MassConstraint();
+  /** method returning the vector of parameters values. Method defined through
+      the \<nop\>IKinematicConstraint base class
+      @param[in] cart_coordList vector of particles represented in cartesian
+     frame, that is through the parameters (px, py, pz, E, x, y, z).
+      @param[in] charges charge information for the vector of particles
+      @param[in] refPoint reference point for cartesian coordinates
+      @param[in] b_fieldTesla local solenoidal approximation of field
+      @param[out] vector of values to enter the constrained-fit equation
+  */
+  virtual Amg::VectorX vectorOfValues(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const override final;
 
-    /** method returning the vector of parameters values. Method defined through
-        the \<nop\>IKinematicConstraint base class 
-        @param[in] cart_coordList vector of particles represented in cartesian frame,
-               that is through the parameters (px, py, pz, E, x, y, z).
-        @param[in] charges charge information for the vector of particles
-        @param[in] refPoint reference point for cartesian coordinates
-        @param[in] b_fieldTesla local solenoidal approximation of field
-        @param[out] vector of values to enter the constrained-fit equation
-    */
-   const Amg::VectorX vectorOfValues(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const;
-   
-    /** method returning the matrix of derivatives. Method defined through the
-        \<nop\>IKinematicConstraint base class
-        @param[in] cart_coordList vector of particles represented in cartesian frame,
-               that is through the parameters (px, py, pz, E, x, y, z).
-        @param[in] charges charge information for the vector of particles
-        @param[in] refPoint reference point for cartesian coordinates
-        @param[in] b_fieldTesla local solenoidal approximation of field
-        @param[out] matrix of derivatives to enter the constrained-fit equation
-    */
-   const Amg::MatrixX matrixOfDerivatives(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const;
-   
-   //! tells the number of equations needed for this type of constraint, that is 1
-   int numberOfEquations() const { return m_eqno; } 
+  /** method returning the matrix of derivatives. Method defined through the
+      \<nop\>IKinematicConstraint base class
+      @param[in] cart_coordList vector of particles represented in cartesian
+     frame, that is through the parameters (px, py, pz, E, x, y, z).
+      @param[in] charges charge information for the vector of particles
+      @param[in] refPoint reference point for cartesian coordinates
+      @param[in] b_fieldTesla local solenoidal approximation of field
+      @param[out] matrix of derivatives to enter the constrained-fit equation
+  */
+  virtual Amg::MatrixX matrixOfDerivatives(
+    std::vector<Amg::VectorX>& cart_coordList,
+    std::vector<int>& charges,
+    Amg::Vector3D refPoint,
+    double b_fieldTesla) const override final;
 
-   //! tells the mass value used for the constraint
-   double mass() { return m_mass; }
+  //! tells the number of equations needed for this type of constraint, that is
+  //! 1
+  virtual int numberOfEquations() const override final { return s_eqno; }
 
-  private:
-   
-   //! value of mass to be constrained in MeV
-   double m_mass;
-   //! number of constraint-equations used by this type of constraint
-   int m_eqno;
+  //! tells the mass value used for the constraint
+  double mass() { return m_mass; }
 
-  };
+private:
+  //! value of mass to be constrained in MeV
+  double m_mass = 0.;
+  //! number of constraint-equations used by this type of constraint
+  static constexpr int s_eqno = 1;
+};
 }
 
-#endif //TrkVertexKinematicFitterUtils_MassConstraint_h 
+#endif // TrkVertexKinematicFitterUtils_MassConstraint_h
diff --git a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/CollinearityConstraint.cxx b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/CollinearityConstraint.cxx
index 21c46eb32ac1..de9d81a01ead 100644
--- a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/CollinearityConstraint.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/CollinearityConstraint.cxx
@@ -1,130 +1,153 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
-                        CollinearityConstraint.cxx  
+                        CollinearityConstraint.cxx
                              Veerle Heijne
  ***************************************************************************/
 
 #include "TrkVertexKinematicFitterUtils/CollinearityConstraint.h"
 
+Amg::VectorX
+Trk::CollinearityConstraint::vectorOfValues(
+  std::vector<Amg::VectorX>& cart_coordList,
+  std::vector<int>& charges,
+  Amg::Vector3D refPoint,
+  double b_fieldTesla) const
+{
 
-Trk::CollinearityConstraint::CollinearityConstraint() :
-  m_eqno(2)
-{}
-
-Trk::CollinearityConstraint::~CollinearityConstraint(){}
+  unsigned int ntrack = cart_coordList.size();
 
-const Amg::VectorX Trk::CollinearityConstraint::vectorOfValues(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const {
+  Amg::VectorX vectorOfValues2(2, 0);
 
-  unsigned int ntrack = cart_coordList.size();
-  
-  Amg::VectorX vectorOfValues2(2,0);
-  
-  if( ntrack != 2 ){
-    return vectorOfValues2; //returning vector with zero's
+  if (ntrack != 2) {
+    return vectorOfValues2; // returning vector with zero's
   }
-  
-  double bend_factor = -0.299792458*b_fieldTesla ;
-  
-  double& px1 = cart_coordList[0][0];
-  double& py1 = cart_coordList[0][1];
-  double& pz1 = cart_coordList[0][2];
- 
-  double pt1 = sqrt(px1*px1 + py1*py1);
 
-  double& px2 = cart_coordList[1][0];
-  double& py2 = cart_coordList[1][1];
-  double& pz2 = cart_coordList[1][2];
+  const  double bend_factor = -0.299792458 * b_fieldTesla;
+
+  const double px1 = cart_coordList[0][0];
+  const double py1 = cart_coordList[0][1];
+  const double pz1 = cart_coordList[0][2];
+
+  const double pt1 = sqrt(px1 * px1 + py1 * py1);
 
-  double pt2 = sqrt(px2*px2 + py2*py2);
+  const double px2 = cart_coordList[1][0];
+  const double py2 = cart_coordList[1][1];
+  const double pz2 = cart_coordList[1][2];
 
-  double deltaX1 = refPoint[0] - cart_coordList[0][4];
-  double deltaY1 = refPoint[1] - cart_coordList[0][5];
-  double deltaX2 = refPoint[0] - cart_coordList[1][4];
-  double deltaY2 = refPoint[1] - cart_coordList[1][5];
+  double pt2 = sqrt(px2 * px2 + py2 * py2);
 
-  double a1 = charges[0]*bend_factor;
-  double a2 = charges[1]*bend_factor;
+  const double deltaX1 = refPoint[0] - cart_coordList[0][4];
+  const double deltaY1 = refPoint[1] - cart_coordList[0][5];
+  const double deltaX2 = refPoint[0] - cart_coordList[1][4];
+  const double deltaY2 = refPoint[1] - cart_coordList[1][5];
 
-  //constraint equations, using scalar product:
-  vectorOfValues2[0] = 1 - ((px1-a1*deltaY1)*(px2-a2*deltaY2)+(py1+a1*deltaX1)*(py2+a2*deltaX2))/(pt1*pt2) ;
-  vectorOfValues2[1] = pz1*pt2 - pz2*pt1;
+  const double a1 = charges[0] * bend_factor;
+  const double a2 = charges[1] * bend_factor;
+
+  // constraint equations, using scalar product:
+  vectorOfValues2[0] = 1 - ((px1 - a1 * deltaY1) * (px2 - a2 * deltaY2) +
+                            (py1 + a1 * deltaX1) * (py2 + a2 * deltaX2)) /
+                             (pt1 * pt2);
+  vectorOfValues2[1] = pz1 * pt2 - pz2 * pt1;
 
   return vectorOfValues2;
 }
-      
-const Amg::MatrixX Trk::CollinearityConstraint::matrixOfDerivatives(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const {
 
-  unsigned int ntrack = cart_coordList.size();
+Amg::MatrixX
+Trk::CollinearityConstraint::matrixOfDerivatives(
+  std::vector<Amg::VectorX>& cart_coordList,
+  std::vector<int>& charges,
+  Amg::Vector3D refPoint,
+  double b_fieldTesla) const
+{
+
+  const unsigned int ntrack = cart_coordList.size();
 
-  Amg::MatrixX matrixDeriv2(2,ntrack*7);
+  Amg::MatrixX matrixDeriv2(2, ntrack * 7);
 
-  if( ntrack != 2 ){
-    return matrixDeriv2; //returning matrix with zero's 
+  if (ntrack != 2) {
+    return matrixDeriv2; // returning matrix with zero's
   }
-  
-  double bend_factor = -0.299792458*b_fieldTesla ;
-  
-  double& px1 = cart_coordList[0][0];
-  double& py1 = cart_coordList[0][1];
-  double& pz1 = cart_coordList[0][2];
- 
-  double pt1 = sqrt(px1*px1 + py1*py1);
-
-  double& px2 = cart_coordList[1][0];
-  double& py2 = cart_coordList[1][1];
-  double& pz2 = cart_coordList[1][2];
-
-  double pt2 = sqrt(px2*px2 + py2*py2);
-
-  double deltaX1 = refPoint[0] - cart_coordList[0][4];
-  double deltaY1 = refPoint[1] - cart_coordList[0][5];
-  double deltaX2 = refPoint[0] - cart_coordList[1][4];
-  double deltaY2 = refPoint[1] - cart_coordList[1][5];
-
-  double a1 = charges[0]*bend_factor;
-  double a2 = charges[1]*bend_factor;
-
-  //derivatives to first constraint-equation:  
-  matrixDeriv2(0,0) = -(px2-a2*deltaY2)/(pt1*pt2) + px1*((px1-a1*deltaY1)*(px2-a2*deltaY2)+(py1+a1*deltaX1)*(py2+a2*deltaX2))/(pt1*pt1*pt1*pt2); //vs px1
-  matrixDeriv2(0,1) = -(py2+a2*deltaX2)/(pt1*pt2) + py1*((px1-a1*deltaY1)*(px2-a2*deltaY2)+(py1+a1*deltaX1)*(py2+a2*deltaX2))/(pt1*pt1*pt1*pt2); //vs py1
-  matrixDeriv2(0,2) = 0.; //vs pz1
-  matrixDeriv2(0,3) = 0.; //vs E1 
-  
-  matrixDeriv2(0,4) = a1*(py2+a2*deltaX2)/(pt1*pt2); // vs x1
-  matrixDeriv2(0,5) = -a1*(px2-a2*deltaY2)/(pt1*pt2); // vs y1     
-  matrixDeriv2(0,6) = 0.; // vs z1
-
-  matrixDeriv2(0,7) = -(px1-a1*deltaY1)/(pt1*pt2) + px2*((px1-a1*deltaY1)*(px2-a2*deltaY2)+(py1+a1*deltaX1)*(py2+a2*deltaX2))/(pt1*pt2*pt2*pt2);  //vs px2 
-  matrixDeriv2(0,8) = -(py1+a1*deltaX1)/(pt1*pt2) + py2*((px1-a1*deltaY1)*(px2-a2*deltaY2)+(py1+a1*deltaX1)*(py2+a2*deltaX2))/(pt1*pt2*pt2*pt2) ; //vs py2 
-  matrixDeriv2(0,9) = 0.; //vs pz2
-  matrixDeriv2(0,10) = 0.; //vs E2 
-   
-  matrixDeriv2(0,11) = a2*(py1+a1*deltaX1)/(pt1*pt2); // vs x2
-  matrixDeriv2(0,12) = -a2*(px1-a1*deltaY1)/(pt1*pt2); // vs y2     
-  matrixDeriv2(0,13) = 0.; // vs z2
-   
-  //derivatives to second constraint-equation:
-  matrixDeriv2(1,0) = -(px1*pz2)/pt1; //vs px1  
-  matrixDeriv2(1,1) = -(py1*pz2)/pt1; //vs py1  
-  matrixDeriv2(1,2) = pt2;        //vs pz1
-  matrixDeriv2(1,3) = 0.; //vs E1 
-
-  matrixDeriv2(1,4) = 0.; // vs x1
-  matrixDeriv2(1,5) = 0.; // vs y1     
-  matrixDeriv2(1,6) = 0.; // vs z1
-
-  matrixDeriv2(1,7) = (px2*pz1)/pt2; //vs px2  
-  matrixDeriv2(1,8) = (py2*pz1)/pt2; //vs py2  
-  matrixDeriv2(1,9) = -pt1; //vs pz2
-  matrixDeriv2(1,10) = 0; //vs E2 
-   
-  matrixDeriv2(1,11) = 0.; // vs x2
-  matrixDeriv2(1,12) = 0.; // vs y2     
-  matrixDeriv2(1,13) = 0.; // vs z2 
-   
+
+  const double bend_factor = -0.299792458 * b_fieldTesla;
+
+  const double px1 = cart_coordList[0][0];
+  const double py1 = cart_coordList[0][1];
+  const double pz1 = cart_coordList[0][2];
+
+  const double pt1 = sqrt(px1 * px1 + py1 * py1);
+
+  const double px2 = cart_coordList[1][0];
+  const double py2 = cart_coordList[1][1];
+  const double pz2 = cart_coordList[1][2];
+
+  const double pt2 = sqrt(px2 * px2 + py2 * py2);
+
+  const double deltaX1 = refPoint[0] - cart_coordList[0][4];
+  const double deltaY1 = refPoint[1] - cart_coordList[0][5];
+  const double deltaX2 = refPoint[0] - cart_coordList[1][4];
+  const double deltaY2 = refPoint[1] - cart_coordList[1][5];
+
+  const double a1 = charges[0] * bend_factor;
+  const double a2 = charges[1] * bend_factor;
+
+  // derivatives to first constraint-equation:
+  matrixDeriv2(0, 0) = -(px2 - a2 * deltaY2) / (pt1 * pt2) +
+                       px1 *
+                         ((px1 - a1 * deltaY1) * (px2 - a2 * deltaY2) +
+                          (py1 + a1 * deltaX1) * (py2 + a2 * deltaX2)) /
+                         (pt1 * pt1 * pt1 * pt2); // vs px1
+  matrixDeriv2(0, 1) = -(py2 + a2 * deltaX2) / (pt1 * pt2) +
+                       py1 *
+                         ((px1 - a1 * deltaY1) * (px2 - a2 * deltaY2) +
+                          (py1 + a1 * deltaX1) * (py2 + a2 * deltaX2)) /
+                         (pt1 * pt1 * pt1 * pt2); // vs py1
+  matrixDeriv2(0, 2) = 0.;                        // vs pz1
+  matrixDeriv2(0, 3) = 0.;                        // vs E1
+
+  matrixDeriv2(0, 4) = a1 * (py2 + a2 * deltaX2) / (pt1 * pt2);  // vs x1
+  matrixDeriv2(0, 5) = -a1 * (px2 - a2 * deltaY2) / (pt1 * pt2); // vs y1
+  matrixDeriv2(0, 6) = 0.;                                       // vs z1
+
+  matrixDeriv2(0, 7) = -(px1 - a1 * deltaY1) / (pt1 * pt2) +
+                       px2 *
+                         ((px1 - a1 * deltaY1) * (px2 - a2 * deltaY2) +
+                          (py1 + a1 * deltaX1) * (py2 + a2 * deltaX2)) /
+                         (pt1 * pt2 * pt2 * pt2); // vs px2
+  matrixDeriv2(0, 8) = -(py1 + a1 * deltaX1) / (pt1 * pt2) +
+                       py2 *
+                         ((px1 - a1 * deltaY1) * (px2 - a2 * deltaY2) +
+                          (py1 + a1 * deltaX1) * (py2 + a2 * deltaX2)) /
+                         (pt1 * pt2 * pt2 * pt2); // vs py2
+  matrixDeriv2(0, 9) = 0.;                        // vs pz2
+  matrixDeriv2(0, 10) = 0.;                       // vs E2
+
+  matrixDeriv2(0, 11) = a2 * (py1 + a1 * deltaX1) / (pt1 * pt2);  // vs x2
+  matrixDeriv2(0, 12) = -a2 * (px1 - a1 * deltaY1) / (pt1 * pt2); // vs y2
+  matrixDeriv2(0, 13) = 0.;                                       // vs z2
+
+  // derivatives to second constraint-equation:
+  matrixDeriv2(1, 0) = -(px1 * pz2) / pt1; // vs px1
+  matrixDeriv2(1, 1) = -(py1 * pz2) / pt1; // vs py1
+  matrixDeriv2(1, 2) = pt2;                // vs pz1
+  matrixDeriv2(1, 3) = 0.;                 // vs E1
+
+  matrixDeriv2(1, 4) = 0.; // vs x1
+  matrixDeriv2(1, 5) = 0.; // vs y1
+  matrixDeriv2(1, 6) = 0.; // vs z1
+
+  matrixDeriv2(1, 7) = (px2 * pz1) / pt2; // vs px2
+  matrixDeriv2(1, 8) = (py2 * pz1) / pt2; // vs py2
+  matrixDeriv2(1, 9) = -pt1;              // vs pz2
+  matrixDeriv2(1, 10) = 0;                // vs E2
+
+  matrixDeriv2(1, 11) = 0.; // vs x2
+  matrixDeriv2(1, 12) = 0.; // vs y2
+  matrixDeriv2(1, 13) = 0.; // vs z2
+
   return matrixDeriv2;
 }
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/MassConstraint.cxx b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/MassConstraint.cxx
index 48b280a8b348..5133c57e38ba 100644
--- a/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/MassConstraint.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexKinematicFitterUtils/src/MassConstraint.cxx
@@ -1,97 +1,106 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
-                        MassConstraint.cxx  
+                        MassConstraint.cxx
                         maaike.limper@cern.ch
  ***************************************************************************/
 
 #include "TrkVertexKinematicFitterUtils/MassConstraint.h"
 
-Trk::MassConstraint::MassConstraint() :
-  m_mass( 0. ),
-  m_eqno(1)
+Trk::MassConstraint::MassConstraint(double mass)
+  : m_mass(mass)
 {}
 
-Trk::MassConstraint::MassConstraint( double mass ) :
-  m_mass(mass),
-  m_eqno(1)
-{}
-
-Trk::MassConstraint::~MassConstraint(){}
-
-const Amg::VectorX Trk::MassConstraint::vectorOfValues(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const {
+Amg::VectorX
+Trk::MassConstraint::vectorOfValues(std::vector<Amg::VectorX>& cart_coordList,
+                                    std::vector<int>& charges,
+                                    Amg::Vector3D refPoint,
+                                    double b_fieldTesla) const
+{
 
   unsigned int ntrack = cart_coordList.size();
 
-  Amg::VectorX vectorOfValues2(1,0);
+  Amg::VectorX vectorOfValues2(1, 0);
+
+  const double bend_factor = -0.299792458 * b_fieldTesla;
 
-  double bend_factor = -0.299792458*b_fieldTesla ;
-  
   double Etot = 0.;
   double Px = 0.;
   double Py = 0.;
   double Pz = 0.;
 
-  for( unsigned int i = 0 ; i < ntrack ; i++ ){
-    double& E = cart_coordList[i][3];
-    double& px = cart_coordList[i][0];
-    double& py = cart_coordList[i][1];
-    double& pz = cart_coordList[i][2];
+  for (unsigned int i = 0; i < ntrack; i++) {
+    const double E = cart_coordList[i][3];
+    const double px = cart_coordList[i][0];
+    const double py = cart_coordList[i][1];
+    const double pz = cart_coordList[i][2];
 
-    double deltaX = refPoint[0] - cart_coordList[i][4];
-    double deltaY = refPoint[1] - cart_coordList[i][5];
-        
-    double a = charges[i]*bend_factor;
+    const double deltaX = refPoint[0] - cart_coordList[i][4];
+    const double deltaY = refPoint[1] - cart_coordList[i][5];
+
+    const double a = charges[i] * bend_factor;
 
     // sum of values of cartesian coordinates at given reference-point
     Etot += E;
-    Px += (px - a*deltaY);
-    Py += (py + a*deltaX);
+    Px += (px - a * deltaY);
+    Py += (py + a * deltaX);
     Pz += pz;
   }
 
-  vectorOfValues2[0] =  Etot*Etot - Px*Px - Py*Py - Pz*Pz - m_mass*m_mass ; // fill vector using sums made in track-loop
+  vectorOfValues2[0] =
+    Etot * Etot - Px * Px - Py * Py - Pz * Pz -
+    m_mass * m_mass; // fill vector using sums made in track-loop
 
   return vectorOfValues2;
 }
-      
-const Amg::MatrixX Trk::MassConstraint::matrixOfDerivatives(std::vector<Amg::VectorX> & cart_coordList, std::vector<int> &charges, Amg::Vector3D refPoint, double b_fieldTesla ) const {
-
-  unsigned int ntrack = cart_coordList.size();
 
-  Amg::MatrixX matrixDeriv2(1,ntrack*7);
-
-  double bend_factor = -0.299792458*b_fieldTesla ;
-
-  for( unsigned int i = 0 ; i < ntrack ; i++ ){
-    double& E = cart_coordList[i][3];
-    double& px = cart_coordList[i][0];
-    double& py = cart_coordList[i][1];
-    double& pz = cart_coordList[i][2];
-
-    double deltaX = refPoint[0] - cart_coordList[i][4];
-    double deltaY = refPoint[1] - cart_coordList[i][5];
-        
-    double a = charges[i]*bend_factor;
-
-    for(unsigned int jtrack=0; jtrack < ntrack; jtrack++){
-      unsigned int joff = jtrack*7;
-      matrixDeriv2(0,joff+0) = matrixDeriv2(0,joff+0) - 2*(px - a*deltaY); 
-      matrixDeriv2(0,joff+1) = matrixDeriv2(0,joff+1) - 2*(py + a*deltaX); 
-      matrixDeriv2(0,joff+2) = matrixDeriv2(0,joff+2) - 2*pz; 
-      matrixDeriv2(0,joff+3) = matrixDeriv2(0,joff+3) + 2*E; 
-
-      // shouldn't this go to 0 when deltaX = 0 ?! no! when vertex moves px,py moves and vice-versa
-      // so derivative of vertex should depend on px,py 
-      matrixDeriv2(0,joff+4) = matrixDeriv2(0,joff+4) + 2*a*(py + a*deltaX); 
-      matrixDeriv2(0,joff+5) = matrixDeriv2(0,joff+5) - 2*a*(px - a*deltaY);      
-      //(*p_matrixDeriv)[0][joff+6] = (*p_matrixDeriv)[0][joff+6] + 0.; // no dependence on z!
+Amg::MatrixX
+Trk::MassConstraint::matrixOfDerivatives(
+  std::vector<Amg::VectorX>& cart_coordList,
+  std::vector<int>& charges,
+  Amg::Vector3D refPoint,
+  double b_fieldTesla) const
+{
+
+  const unsigned int ntrack = cart_coordList.size();
+
+  Amg::MatrixX matrixDeriv2(1, ntrack * 7);
+
+  const double bend_factor = -0.299792458 * b_fieldTesla;
+
+  for (unsigned int i = 0; i < ntrack; i++) {
+    const double E = cart_coordList[i][3];
+    const double px = cart_coordList[i][0];
+    const double py = cart_coordList[i][1];
+    const double pz = cart_coordList[i][2];
+
+    const double deltaX = refPoint[0] - cart_coordList[i][4];
+    const double deltaY = refPoint[1] - cart_coordList[i][5];
+
+    const double a = charges[i] * bend_factor;
+
+    for (unsigned int jtrack = 0; jtrack < ntrack; jtrack++) {
+      const unsigned int joff = jtrack * 7;
+      matrixDeriv2(0, joff + 0) =
+        matrixDeriv2(0, joff + 0) - 2 * (px - a * deltaY);
+      matrixDeriv2(0, joff + 1) =
+        matrixDeriv2(0, joff + 1) - 2 * (py + a * deltaX);
+      matrixDeriv2(0, joff + 2) = matrixDeriv2(0, joff + 2) - 2 * pz;
+      matrixDeriv2(0, joff + 3) = matrixDeriv2(0, joff + 3) + 2 * E;
+
+      // shouldn't this go to 0 when deltaX = 0 ?! no! when vertex moves px,py
+      // moves and vice-versa so derivative of vertex should depend on px,py
+      matrixDeriv2(0, joff + 4) =
+        matrixDeriv2(0, joff + 4) + 2 * a * (py + a * deltaX);
+      matrixDeriv2(0, joff + 5) =
+        matrixDeriv2(0, joff + 5) - 2 * a * (px - a * deltaY);
+      //(*p_matrixDeriv)[0][joff+6] = (*p_matrixDeriv)[0][joff+6] + 0.; // no
+      //dependence on z!
     }
   }
 
   return matrixDeriv2;
 }
-      
 
-- 
GitLab


From 6e5c7a4e434c7fb361329ada79a86998d2a91c4e Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 5 Jul 2020 18:27:14 +0100
Subject: [PATCH 048/217] TrkVertexFitters add ATLAS_CHECK_THREAD_SAFETY

---
 .../TrkVertexFitters/CMakeLists.txt           |  4 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../TrkVertexFitters/AdaptiveVertexFitter.h   | 13 +---
 .../TrkVertexFitters/DummyVertexSmoother.h    |  5 +-
 .../src/AdaptiveVertexFitter.cxx              | 61 +------------------
 .../src/DummyVertexSmoother.cxx               | 49 ++-------------
 6 files changed, 13 insertions(+), 120 deletions(-)
 create mode 100644 Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexFitters/CMakeLists.txt
index 22c95e15fad7..ae9725ce305e 100644
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/CMakeLists.txt
@@ -3,14 +3,14 @@
 # Declare the package name.
 atlas_subdir( TrkVertexFitters )
 
-# Component(s) in the package.
+#Component(s) in the package.
 atlas_add_library( TrkVertexFittersLib
    TrkVertexFitters/*.h src/*.h src/*.cxx
    PUBLIC_HEADERS TrkVertexFitters
    LINK_LIBRARIES AthenaBaseComps xAODTracking GaudiKernel TrkParameters
    TrkParametersBase TrkParticleBase TrkVertexFitterInterfaces
    PRIVATE_LINK_LIBRARIES VxVertex TrkSurfaces TrkLinks TrkTrack VxMultiVertex
-   TrkExInterfaces TestTools )
+   TrkExInterfaces TestTools CxxUtils)
 
 atlas_add_component( TrkVertexFitters
    src/components/*.cxx
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..24a4ceb99627
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexFitters
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/AdaptiveVertexFitter.h b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/AdaptiveVertexFitter.h
index 33ba1009db18..4f79ed3c139d 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/AdaptiveVertexFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/AdaptiveVertexFitter.h
@@ -218,18 +218,7 @@ namespace Trk
                        bool IsConstraint=false,
                        bool IsStartingPoint=false) const;
  
-    /**
-     * Internal method for fitting a list of Tracks, with or without constraint and 
-     * starting point
-     */
-    
-    xAOD::Vertex * _fit(const std::vector<const Trk::TrackParticleBase*> & VectorTrk,
-                       const xAOD::Vertex& constraint=xAOD::Vertex(),
-                       const Amg::Vector3D & startingPoint=Amg::Vector3D(),
-                       bool IsConstraint=false,
-                       bool IsStartingPoint=false) const;
-
-    /**
+   /**
      * Internal method, called by the two _fit internal functions, in order to perform the fit, 
      * after having initialized the input (constraint + seed). The real fit happens here.
      */
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
index 3b53f42052f0..a48d3de9e74c 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/TrkVertexFitters/DummyVertexSmoother.h
@@ -8,7 +8,7 @@
 #include "TrkVertexFitterInterfaces/IVertexSmoother.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TrkParametersBase/ParametersBase.h"
-
+#include "CxxUtils/checker_macros.h"
 namespace Trk
 {
   class IExtrapolator;
@@ -39,7 +39,8 @@ namespace Trk
    *
    */ 
 
-  class DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
+  //Not THREAD_SAFE due to const_cast 
+  class ATLAS_NOT_THREAD_SAFE DummyVertexSmoother : public AthAlgTool, virtual public IVertexSmoother
   {
   public:
   
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/src/AdaptiveVertexFitter.cxx b/Tracking/TrkVertexFitter/TrkVertexFitters/src/AdaptiveVertexFitter.cxx
index 84f4953b2d7c..cfff8d017601 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/src/AdaptiveVertexFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/src/AdaptiveVertexFitter.cxx
@@ -327,7 +327,7 @@ namespace Trk
         {
 
           ElementLink<TrackCollection> link;
-          link.setElement(const_cast<Trk::Track*>(*trkiter));
+          link.setElement(*trkiter);
           LinkToTrack * linkTT = new LinkToTrack(link);
           (*vtxiter).setOrigTrack(linkTT);
         }
@@ -344,65 +344,6 @@ namespace Trk
     return FittedVertex;
   }
 
-  xAOD::Vertex * AdaptiveVertexFitter::_fit(const std::vector<const Trk::TrackParticleBase*> & VectorTrk,
-                                            const xAOD::Vertex& constraint,//initialized to xAOD::Vertex()
-                                            const Amg::Vector3D & startingPoint,//initialized to Amg::Vector3D()
-                                            bool IsConstraint,//initialized to false
-                                            bool IsStartingPoint) const {//initialized to false
-
-    std::vector<const Trk::TrackParameters*> perigeeList;
-    for (std::vector<const Trk::TrackParticleBase*>::const_iterator iter=VectorTrk.begin();
-         iter!=VectorTrk.end();++iter) {
-      if (std::isnan((*iter)->perigee()->parameters()[Trk::d0])) {
-        continue;
-      }
-      perigeeList.push_back((*iter)->perigee());
-    }
-
-    xAOD::Vertex * FittedVertex = _fit(perigeeList,constraint,startingPoint,IsConstraint,IsStartingPoint);
-
-    if (FittedVertex==nullptr) {
-      return FittedVertex;
-    }
-
-    //these following lines are really absurd... Why has this to be the case... <19-06-2006>
-    //We need a link which can be dynamically to a Track or a TrackParticle....... )-:
-
-    const std::vector<const Trk::TrackParticleBase*>::const_iterator trkbegin=VectorTrk.begin();
-    const std::vector<const Trk::TrackParticleBase*>::const_iterator trkend=VectorTrk.end();
-
-    const std::vector<VxTrackAtVertex>::iterator vtxbegin=FittedVertex->vxTrackAtVertex().begin();
-    const std::vector<VxTrackAtVertex>::iterator vtxend=FittedVertex->vxTrackAtVertex().end();
-
-
-    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trkiter=trkbegin;trkiter!=trkend;++trkiter)
-    {
-      for (std::vector<Trk::VxTrackAtVertex>::iterator vtxiter=vtxbegin;vtxiter!=vtxend;++vtxiter)
-      {
-        if(((*trkiter)->perigee()->momentum() -
-            (*vtxiter).initialPerigee()->momentum()).mag()< 1e-8  &&
-            ((*trkiter)->perigee()->position() -
-            (*vtxiter).initialPerigee()->position()).mag()< 1e-8)
-        {
-
-          ElementLink<TrackParticleBaseCollection> link;
-          link.setElement(const_cast<Trk::TrackParticleBase*>(*trkiter));
-          LinkToTrackParticleBase * linkTT = new LinkToTrackParticleBase(link);
-          (*vtxiter).setOrigTrack(linkTT);
-        }
-      }
-    }
-
-    //******************************************************************************
-    // TODO: Starting from a vector of Trk::TrackParticleBase, can't currently store
-    // separately from the vxTrackAtVertex vector the links to the
-    // original tracks in xAOD::Vertex (only links to xAOD::TrackParticles and
-    // xAOD::NeutralParticles can be stored)
-    //******************************************************************************
-
-    return FittedVertex;
-
-  }
   xAOD::Vertex*
   AdaptiveVertexFitter::dothefit(
     const xAOD::Vertex& ConstraintVertex,
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
index b9574de1c04c..bad68a45f101 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx
@@ -75,7 +75,11 @@ namespace Trk
 
           if(initPar != nullptr)
           {
-            const Trk::TrackParameters * extrapolatedPerigee(m_extrapolator->extrapolate(*initPar,perigeeSurface));
+            //This does not play well with const correctness
+            //Either we should return non-const parameters from the extrapolator
+            //as the owner here has to delete them
+            //Or we need to clone  
+            const Trk::TrackParameters* extrapolatedPerigee(m_extrapolator->extrapolate(*initPar,perigeeSurface));
             if(extrapolatedPerigee != nullptr)
             {
               (*t_it).setPerigeeAtVertex(const_cast<Trk::TrackParameters*>(extrapolatedPerigee));
@@ -86,49 +90,6 @@ namespace Trk
             msg(MSG::WARNING) << " The VxTrackAtVertex passed has no initial Parameters? This track will not be refitted" << endmsg;
           }//end of initial parameters protection check
 
-          /*     
-          LinearizedTrack * linState = (*t_it)->linState();     
-          
-          if(linState != 0)
-          {
-            //taking the last perigee parameters used in calculation and extrapolating them 
-            //toawrds the fitted vertex. This saves calculation time.
-            // MeasuredPerigee lastPerigee = linState->expectedPerigeeAtPCA(); 
-            TrackParameters * lastPerigee = linState->expectedParametersAtPCA();
- 	
-            //here the extrapolation extrapolation finally happens
-            // const MeasuredPerigee * extrapolatedPerigee(dynamic_cast<const Trk::MeasuredPerigee*>(m_extrapolator->extrapolateDirectly(lastPerigee,perigeeSurface)));
-            const TrackParameters * extrapolatedPerigee(m_extrapolator->extrapolateDirectly(*lastPerigee,perigeeSurface));
-  
-            if(extrapolatedPerigee != 0)
-	    {
-	      (*t_it)->setPerigeeAtVertex(const_cast<Trk::TrackParameters*>(extrapolatedPerigee));
-	    }else{
-	      MsgStream msg(msgSvc(), name());
-              msg(MSG::ERROR)  << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg;
-	    }//end of successfull extrapolation check	
-          }else{
-       
-            //there is no linearized state available; taking initial MeasuredPerigee
-            //and trying to work with it       
-            const Trk::MeasuredPerigee * inPerigee = (*t_it)->initialPerigee(); 
-	    if(inPerigee !=0 )
-	    {
-	      const MeasuredPerigee * extrapolatedPerigee(dynamic_cast<const Trk::MeasuredPerigee*>(m_extrapolator->extrapolateDirectly(*inPerigee,perigeeSurface)));
-	      if(extrapolatedPerigee != 0)
-              {
-	        (*t_it)->setPerigeeAtVertex(const_cast<Trk::MeasuredPerigee*>(extrapolatedPerigee));
-	      }else{
-	        MsgStream msg(msgSvc(), name());
-                msg(MSG::ERROR)  << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg;
-	      }//end of non-zero extrapolated perigee check
-	    }else{
-	      MsgStream msg(msgSvc(), name());
-              msg(MSG::ERROR)  << " The VxTrackAtVertex passed has no LinearizedTrack neither Initial perigee???" << endmsg;
-	    }//end of non-zero initial perigee check 
-          }//end of non zero linearized state check
-          */
-
         }//end of loop over all fitted tracks
       } else {
         msg(MSG::ERROR)  << "xAOD::Vertex with empty vector of tracks is passed to the Vertex Smoother" << endmsg;
-- 
GitLab


From 7c834decf83033886a5b0ee6a9ff2a2df0a14b6d Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 5 Jul 2020 19:01:52 +0100
Subject: [PATCH 049/217] un-needed const_cast

---
 .../src/JetFitterInitializationHelper.cxx     | 109 +-----------------
 1 file changed, 1 insertion(+), 108 deletions(-)

diff --git a/Tracking/TrkVertexFitter/TrkJetVxFitter/src/JetFitterInitializationHelper.cxx b/Tracking/TrkVertexFitter/TrkJetVxFitter/src/JetFitterInitializationHelper.cxx
index e7d24a1c8d6f..b8639627f9dc 100755
--- a/Tracking/TrkVertexFitter/TrkJetVxFitter/src/JetFitterInitializationHelper.cxx
+++ b/Tracking/TrkVertexFitter/TrkJetVxFitter/src/JetFitterInitializationHelper.cxx
@@ -39,113 +39,6 @@ namespace Trk
       return numVertex+5;
     }
 
-#if 0
-    std::pair<double,double> getPhiAndThetaError(const Amg::Vector3D & jetdirection)
-    {
-      double pT=jetdirection.perp();
-      double eta=jetdirection.eta();
-      
-      if (pT<30000.) 
-      {
-        if (fabs(eta)<0.5)
-        {
-          return std::pair<double,double>(0.0745324,0.0707118);
-        }
-        else if (fabs(eta)>0.5 && fabs(eta)<1.5) 
-        {
-          return std::pair<double,double>(0.0706129,0.0700991);
-        }
-        else
-        {
-          return std::pair<double,double>(0.0637408,0.0625573);
-        }
-      } 
-      else if (pT>30000.&&pT<50000.) 
-      {
-        if (fabs(eta)<0.5)
-        {
-          return std::pair<double,double>(0.0471643,0.0522802);
-        }
-        else if (fabs(eta)>0.5 && fabs(eta)<1.5) 
-        {
-          return std::pair<double,double>(0.0481275,0.0496884);
-        }
-        else
-        {
-          return std::pair<double,double>(0.0424792,0.0430283);
-        }
-      } else if (pT>50000.&&pT<80000.) 
-      {
-        if (fabs(eta)<0.5)
-        {
-          return std::pair<double,double>(0.0413781,0.0483138);
-        }
-        else if (fabs(eta)>0.5 && fabs(eta)<1.5) 
-        {
-          return std::pair<double,double>(0.0403793,0.0446019);
-        }
-        else
-        {
-          return std::pair<double,double>(0.0386421,0.040443);
-        }
-      } else if (pT>80000.&&pT<120000.) 
-      {
-        if (fabs(eta)<0.5)
-        {
-          return std::pair<double,double>(0.0418976,0.0513061);
-        }
-        else if (fabs(eta)>0.5 && fabs(eta)<1.5) 
-        {
-          return std::pair<double,double>(0.0421726,0.0463102);
-        }
-        else
-        {
-          return std::pair<double,double>(0.0400686,0.0432175);
-        }
-      } else if (pT>120000.) 
-      {
-        if (fabs(eta)<0.5)
-        {
-          return std::pair<double,double>(0.0477842,0.0562935);
-        }
-        else if (fabs(eta)>0.5 && fabs(eta)<1.5) 
-        {
-          return std::pair<double,double>(0.0489627,0.0511563);
-        }
-        else
-        {
-          return std::pair<double,double>(0.0465861,0.0463104);
-        }
-      }
-      std::cout << " HELP HELP error found" << std::endl;
-      throw;
-      //      return std::pair<double,double>(0,0);
-    }
-    
-        
-      
-      
-
-    Amg::Vector3D getSingleVtxPosition(const Amg::VectorX & myPosition,int numVertex) {
-      int numbRow=numRow(numVertex);
-      double xv=myPosition[Trk::jet_xv];
-      double yv=myPosition[Trk::jet_yv];
-      double zv=myPosition[Trk::jet_zv];
-      double phi=myPosition[Trk::jet_phi];
-      double theta=myPosition[Trk::jet_theta];
-      double dist=0.;
-      if (numbRow>=0) {
-	dist=myPosition[numbRow];
-	if (fabs(dist)>1000.) {//MAX 1m
-	  dist=dist/fabs(dist)*1000.;
-	}
-      }
-      return Amg::Vector3D(xv+dist*cos(phi)*sin(theta),
-			   yv+dist*sin(phi)*sin(theta),
-			   zv+dist*cos(theta));
-    }
-#endif
-
     Amg::Vector3D getSingleVtxPositionWithSignFlip(const Amg::VectorX & myPosition,
 					           int numVertex,
 					           bool signfliptreatment) {
@@ -245,7 +138,7 @@ namespace Trk
          vectorOfLinkIter!=vectorOfLinkEnd;++vectorOfLinkIter)
     {
       std::vector<Trk::VxTrackAtVertex*> temp_vector_tracksAtVertex;
-      Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex(const_cast<Trk::ITrackLink*>((*vectorOfLinkIter)->clone()));
+      Trk::VxTrackAtVertex* newVxTrack=new Trk::VxTrackAtVertex((*vectorOfLinkIter)->clone());
       temp_vector_tracksAtVertex.push_back(newVxTrack);
       setOfTracks->push_back(newVxTrack);
       setOfVertices.push_back(new Trk::VxVertexOnJetAxis(temp_vector_tracksAtVertex));
-- 
GitLab


From 85909ff1ac42dff161c160bd07b483980f181f82 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 5 Jul 2020 19:36:28 +0100
Subject: [PATCH 050/217] TrkVertexSeedFinderUtils remove un-needed const_cast

---
 .../TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx     | 2 +-
 .../TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
index 24c52b0a50dc..72009b197ec2 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianDensityTestAlg.cxx
@@ -162,7 +162,7 @@ void GaussianDensityTestAlg::selectTracks(const xAOD::TrackParticleContainer* tr
     if (selectionPassed)
     {
       ElementLink<xAOD::TrackParticleContainer> link;
-      link.setElement(const_cast<xAOD::TrackParticle*>(*itr));
+      link.setElement(*itr);
       Trk::LinkToXAODTrackParticle * linkTT = new Trk::LinkToXAODTrackParticle(link);
       linkTT->setStorableObject(*trackParticles);
       trackVector.push_back(linkTT);
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
index c934e4511391..ad54009b7968 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/ImagingSeedTuningAlg.cxx
@@ -495,7 +495,7 @@ void ImagingSeedTuningAlg::selectTracks(const xAOD::TrackParticleContainer* trac
     if (selectionPassed)
     {
       ElementLink<xAOD::TrackParticleContainer> link;
-      link.setElement(const_cast<xAOD::TrackParticle*>(*itr));
+      link.setElement(*itr);
       Trk::LinkToXAODTrackParticle * linkTT = new Trk::LinkToXAODTrackParticle(link);
       linkTT->setStorableObject(*trackParticles);
       trackVector.push_back(linkTT);
-- 
GitLab


From 6c8e280cb8b6f6b9334b19289e8d8e728b19a5f6 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Fri, 3 Jul 2020 20:29:27 +0200
Subject: [PATCH 051/217] Fix piping of meta-reader output

---
 Tools/PyUtils/bin/meta-reader.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tools/PyUtils/bin/meta-reader.py b/Tools/PyUtils/bin/meta-reader.py
index 24e62e348776..d7a26921a4fc 100755
--- a/Tools/PyUtils/bin/meta-reader.py
+++ b/Tools/PyUtils/bin/meta-reader.py
@@ -166,8 +166,8 @@ def _main():
 		if is_json:
 			print(json.dumps(metadata, indent=indent))
 		else:
-			enc = sys.stdout.encoding.lower()
-			ascii = not sys.stdout.isatty() or enc.find('ansi') >= 0 or enc.find('ascii') >= 0
+			enc = sys.stdout.encoding
+			ascii = not sys.stdout.isatty() or not enc or enc.lower().find('ansi') >= 0 or enc.lower().find('ascii') >= 0
 			_tree_print(metadata, indent= indent, pad= 18, dict_sort='key', list_max_items = 8, ascii = True)
 			print(_tree_print(metadata, indent= indent, pad= 18, dict_sort='key', list_max_items = 8, ascii = ascii))
 
-- 
GitLab


From 2fb98d33a9c3c199abb2e81d20fd7a49d038068e Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Mon, 6 Jul 2020 09:58:10 +0200
Subject: [PATCH 052/217] remove print statement

---
 .../LArMonitoring/share/LArMonitoring_jobOption.py          | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/LArCalorimeter/LArMonitoring/share/LArMonitoring_jobOption.py b/LArCalorimeter/LArMonitoring/share/LArMonitoring_jobOption.py
index 22a18d270a69..c00b0213a308 100644
--- a/LArCalorimeter/LArMonitoring/share/LArMonitoring_jobOption.py
+++ b/LArCalorimeter/LArMonitoring/share/LArMonitoring_jobOption.py
@@ -5,9 +5,6 @@ include.block("LArMonitoring/LArMonitoring_jobOption.py")
 from AthenaMonitoring.DQMonFlags import DQMonFlags
 from AthenaCommon.GlobalFlags import globalflags
 
-#Add colltime algo to sequence
-print "LArMonitoring_jobOption ", DQMonFlags.monManEnvironment()
-
 from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault
 BunchCrossingCondAlgDefault()
 
@@ -40,6 +37,3 @@ if 'ESD' not in DQMonFlags.monManEnvironment() and globalflags.DataSource == 'da
     from LArMonitoring.LArCoverageAlg import LArCoverageConfigOld
     topSequence +=LArCoverageConfigOld(DQMonFlags)
 
-#print topSequence
-
-
-- 
GitLab


From 807f832e667481df993d8c510352b3605a875932 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Mon, 6 Jul 2020 15:04:56 +0200
Subject: [PATCH 053/217] Explicitly load data for muon trigger views

Explicitly loading event-level data into the muon trigger event views. Fixes the muon related failures in ATR-21685.
---
 .../python/HLTMenuConfig/Muon/MuonSetup.py    | 26 ++++++++++++++++---
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index a97834efec06..8866762a28d1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -67,12 +67,19 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False):
 
   viewAlgs_MuonPRD = []  # These algs should be executed to prepare muon PRDs for muFast and muEF steps.
 
+  # Make sure required objects are still available at whole-event level
+  from AthenaCommon.AlgSequence import AlgSequence
+  topSequence = AlgSequence()
+
   # Load data into the view
   import AthenaCommon.CfgMgr as CfgMgr
   muDataPrepVDV = CfgMgr.AthViews__ViewDataVerifier( "muDataPrepVDV" + postFix )
   muDataPrepVDV.DataObjects = [( 'MdtPrepDataCollection_Cache' , MuonPrdCacheNames.MdtCache ),
                                ( 'RpcPrepDataCollection_Cache' , MuonPrdCacheNames.RpcCache ),
-                               ( 'RpcCoinDataCollection_Cache' , MuonPrdCacheNames.RpcCoinCache )]
+                               ( 'RpcCoinDataCollection_Cache' , MuonPrdCacheNames.RpcCoinCache ),
+                               ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]
+
+  topSequence.SGInputLoader.Load += [ ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]
 
   if MuonGeometryFlags.hasCSC():
     muDataPrepVDV.DataObjects += [( 'CscStripPrepDataCollection_Cache' , MuonPrdCacheNames.CscStripCache )]
@@ -106,6 +113,9 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False):
     from MuonRdoToPrepData.MuonRdoToPrepDataConf import StgcRdoToStgcPrepData
     StgcRdoToStgcPrepData = StgcRdoToStgcPrepData(name                    = "StgcRdoToStgcPrepData" + postFix)
 
+    muDataPrepVDV.DataObjects += [( 'Muon::STGC_RawDataContainer' , 'StoreGateSvc+sTGCRDO' )]
+    topSequence.SGInputLoader.Load += [( 'Muon::STGC_RawDataContainer' , 'StoreGateSvc+sTGCRDO' )]
+
     viewAlgs_MuonPRD.append( StgcRdoToStgcPrepData )
 
     ### MM RDO data ###
@@ -123,6 +133,9 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False):
     MM_RdoToMM_PrepData = MM_RdoToMM_PrepData(name                    = "MMRdoToMMPrepData" + postFix,
                                             PrintInputRdo = True  )
 
+    muDataPrepVDV.DataObjects += [( 'Muon::MM_RawDataContainer' , 'StoreGateSvc+MMRDO' )]
+    topSequence.SGInputLoader.Load += [( 'Muon::MM_RawDataContainer' , 'StoreGateSvc+MMRDO' )]
+
     viewAlgs_MuonPRD.append(  MM_RdoToMM_PrepData )
 
   if MuonGeometryFlags.hasCSC():
@@ -170,9 +183,6 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False):
     CscClusterBuilder = CscThresholdClusterBuilder(name            = "CscThresholdClusterBuilder",
                                                    cluster_builder = CscClusterBuilderTool)
 
-  # Make sure required objects are still available at whole-event level
-  from AthenaCommon.AlgSequence import AlgSequence
-  topSequence = AlgSequence()
 
   if MuonGeometryFlags.hasCSC():
     if globalflags.InputFormat.is_bytestream():
@@ -461,6 +471,14 @@ def muCombRecoSequence( RoIs, name ):
   import AthenaCommon.CfgMgr as CfgMgr
   ViewVerify = CfgMgr.AthViews__ViewDataVerifier("muFastViewDataVerifier")
   ViewVerify.DataObjects = [('xAOD::L2StandAloneMuonContainer','StoreGateSvc+'+muNames.L2SAName)]
+
+  # These objects must be loaded from SGIL if not from CondInputLoader
+  from AthenaCommon.AlgSequence import AlgSequence
+  topSequence = AlgSequence()
+  from IOVDbSvc.CondDB import conddb
+  if not conddb.folderRequested( '/TDAQ/Resources/ATLAS/PIXEL/Modules' ):
+    ViewVerify.DataObjects += [( 'CondAttrListCollection', 'ConditionStore+/TDAQ/Resources/ATLAS/PIXEL/Modules' )]
+    topSequence.SGInputLoader.Load += [( 'CondAttrListCollection', 'ConditionStore+/TDAQ/Resources/ATLAS/PIXEL/Modules' )]
   muCombRecoSequence+=ViewVerify
 
   ### please read out TrigmuCombMTConfig file ###
-- 
GitLab


From 6a0e193979a4936bb10dfd44ea64b9fed28708f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Mon, 6 Jul 2020 16:40:34 +0200
Subject: [PATCH 054/217] use private tools in MuGirl and MuGirlStau

---
 .../src/MuonInsideOutRecoTool.cxx             | 24 +------
 .../src/MuonInsideOutRecoTool.h               | 41 ++++++------
 .../src/MuonStauRecoTool.cxx                  | 43 +-----------
 .../src/MuonStauRecoTool.h                    | 66 +++++++++----------
 4 files changed, 54 insertions(+), 120 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.cxx
index 5270c8461784..ba56d676b8f6 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.cxx
@@ -16,32 +16,10 @@
 namespace MuonCombined {
 
   MuonInsideOutRecoTool::MuonInsideOutRecoTool(const std::string& type, const std::string& name, const IInterface* parent):
-    AthAlgTool(type,name,parent),
-    m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
-    m_segmentFinder("Muon::MuonLayerSegmentFinderTool/MuonLayerSegmentFinderTool"),
-    m_segmentMatchingTool("Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"),
-    m_ambiguityResolver("Muon::MuonLayerAmbiguitySolverTool/MuonLayerAmbiguitySolverTool"),
-    m_candidateTrackBuilder("Muon::MuonCandidateTrackBuilderTool/MuonCandidateTrackBuilderTool"),
-    m_recoValidationTool(""),
-    m_trackFitter("Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"),
-    m_trackAmbiguityResolver("Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"),
-    m_layerHashProvider("Muon::MuonLayerHashProviderTool"),
-    m_trackSummaryTool("MuonTrackSummaryTool")
+    AthAlgTool(type,name,parent)
   {
     declareInterface<IMuonCombinedInDetExtensionTool>(this);
     declareInterface<MuonInsideOutRecoTool>(this);
-
-    declareProperty("MuonEDMPrinterTool",m_printer );    
-    declareProperty("MuonLayerSegmentFinderTool",m_segmentFinder );    
-    declareProperty("MuonLayerSegmentMatchingTool",m_segmentMatchingTool );    
-    declareProperty("MuonLayerAmbiguitySolverTool",m_ambiguityResolver );    
-    declareProperty("MuonCandidateTrackBuilderTool",m_candidateTrackBuilder );    
-    declareProperty("MuonRecoValidationTool",m_recoValidationTool );    
-    declareProperty("MuonTrackBuilder",           m_trackFitter );    
-    declareProperty("TrackAmbiguityProcessor",m_trackAmbiguityResolver );    
-    declareProperty("IDTrackMinPt", m_idTrackMinPt = 2500.0 );
-    declareProperty("IgnoreSiAssociatedCandidates", m_ignoreSiAssocated = true );
-    declareProperty("TrackSummaryTool", m_trackSummaryTool );
   }
 
   StatusCode MuonInsideOutRecoTool::initialize() {
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.h b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.h
index c49809fec9d4..0d9ab3fb559c 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonInsideOutRecoTool.h
@@ -5,18 +5,14 @@
 #ifndef MUON_MUONINSIDEOUTRECOTOOL_H
 #define MUON_MUONINSIDEOUTRECOTOOL_H
 
-#include "MuonLayerEvent/MuonLayerRecoData.h"
-#include "MuonPrepRawDataProviderTools/MuonLayerHashProviderTool.h"
-#include "xAODTracking/VertexContainer.h"
-
-
-
-#include <vector>
-
+#include "MuonCombinedToolInterfaces/IMuonCombinedInDetExtensionTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
+#include "MuonLayerEvent/MuonLayerRecoData.h"
+#include "MuonPrepRawDataProviderTools/MuonLayerHashProviderTool.h"
+#include "xAODTracking/VertexContainer.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "MuonSegmentMakerToolInterfaces/IMuonLayerSegmentFinderTool.h"
 #include "MuonCombinedToolInterfaces/IMuonLayerSegmentMatchingTool.h"
@@ -27,9 +23,11 @@
 #include "TrkToolInterfaces/IExtendedTrackSummaryTool.h"
 #include "TrkTrackSummary/MuonTrackSummary.h"
 #include "TrkToolInterfaces/ITrackAmbiguityProcessorTool.h"
-#include "MuonCombinedToolInterfaces/IMuonCombinedInDetExtensionTool.h"
 #include "MuonRecHelperTools/MuonEDMPrinterTool.h"
 
+#include <string>
+#include <vector>
+
 namespace Muon {
   struct MuonCandidate;
   struct MuonLayerPrepRawData;
@@ -86,20 +84,19 @@ namespace MuonCombined {
 			     Muon::MuonStationIndex::LayerIndex layerIndex, const Muon::MuonPrepDataContainer< COL >* input, std::vector<const COL*>& output ) const;
 
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-    ToolHandle<Muon::MuonEDMPrinterTool>             m_printer; 
-    ToolHandle<Muon::IMuonLayerSegmentFinderTool>    m_segmentFinder;
-    ToolHandle<Muon::IMuonLayerSegmentMatchingTool>  m_segmentMatchingTool;
-    ToolHandle<Muon::IMuonLayerAmbiguitySolverTool>  m_ambiguityResolver;
-    ToolHandle<Muon::IMuonCandidateTrackBuilderTool> m_candidateTrackBuilder;
-    ToolHandle<Muon::IMuonRecoValidationTool>        m_recoValidationTool;
-    ToolHandle<Rec::ICombinedMuonTrackBuilder>       m_trackFitter;
-    ToolHandle<Trk::ITrackAmbiguityProcessorTool>    m_trackAmbiguityResolver;
-    ToolHandle<Muon::MuonLayerHashProviderTool>      m_layerHashProvider;
-    ToolHandle<Trk::IExtendedTrackSummaryTool>       m_trackSummaryTool;    
+    ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this,"MuonEDMPrinterTool","Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
+    ToolHandle<Muon::IMuonLayerSegmentFinderTool>    m_segmentFinder{this,"MuonLayerSegmentFinderTool","Muon::MuonLayerSegmentFinderTool/MuonLayerSegmentFinderTool"};
+    ToolHandle<Muon::IMuonLayerSegmentMatchingTool>  m_segmentMatchingTool{this,"MuonLayerSegmentMatchingTool","Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"};
+    ToolHandle<Muon::IMuonLayerAmbiguitySolverTool>  m_ambiguityResolver{this,"MuonLayerAmbiguitySolverTool","Muon::MuonLayerAmbiguitySolverTool/MuonLayerAmbiguitySolverTool"};
+    ToolHandle<Muon::IMuonCandidateTrackBuilderTool> m_candidateTrackBuilder{this,"MuonCandidateTrackBuilderTool","Muon::MuonCandidateTrackBuilderTool/MuonCandidateTrackBuilderTool"};
+    ToolHandle<Muon::IMuonRecoValidationTool>        m_recoValidationTool{this,"MuonRecoValidationTool",""};
+    ToolHandle<Rec::ICombinedMuonTrackBuilder>       m_trackFitter{this,"MuonTrackBuilder","Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"};
+    ToolHandle<Trk::ITrackAmbiguityProcessorTool>    m_trackAmbiguityResolver{this,"TrackAmbiguityProcessor","Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"};
+    ToolHandle<Muon::MuonLayerHashProviderTool>      m_layerHashProvider{this,"MuonLayerHashProviderTool","Muon::MuonLayerHashProviderTool"};
+    ToolHandle<Trk::IExtendedTrackSummaryTool>       m_trackSummaryTool{this,"TrackSummaryTool","MuonTrackSummaryTool"};
     
-    /** id pt cut */
-    double m_idTrackMinPt;
-    bool m_ignoreSiAssocated;
+    Gaudi::Property<double> m_idTrackMinPt{this,"IDTrackMinPt",2500};
+    Gaudi::Property<bool> m_ignoreSiAssocated{this,"IgnoreSiAssociatedCandidates",true};
 
     // vertex container key
     SG::ReadHandleKey<xAOD::VertexContainer> m_vertexKey { this, "VertexContainer", "PrimaryVertices", "vertex container key" };
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
index 33db0ccee67a..c15b460b1ad2 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.cxx
@@ -41,49 +41,8 @@ namespace MuonCombined {
   }
 
   MuonStauRecoTool::MuonStauRecoTool(const std::string& type, const std::string& name, const IInterface* parent):
-    AthAlgTool(type,name,parent),
-    m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
-    m_segmentMaker("Muon::DCMathSegmentMaker/DCMathSegmentMaker"),
-    m_segmentMakerT0Fit("Muon::DCMathSegmentMaker/DCMathT0FitSegmentMaker"),
-    m_segmentMatchingTool("Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"),
-    m_recoValidationTool(""),
-    m_trackAmbibuityResolver("Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"),
-    m_hitTimingTool("Muon::MuonHitTimingTool/MuonHitTimingTool"),
-    m_muonPRDSelectionTool("Muon::MuonPRDSelectionTool/MuonPRDSelectionTool"),
-    m_muonPRDSelectionToolStau("Muon::MuonPRDSelectionTool/MuonPRDSelectionToolStau"),
-    m_mdtCreator("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator"),
-    m_mdtCreatorStau("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreatorStau"),
-    m_insideOutRecoTool("MuonCombined::MuonInsideOutRecoTool/MuonInsideOutRecoTool"),
-    m_updator("Trk::KalmanUpdator/KalmanUpdator"),
-    m_calibrationDbTool("MdtCalibrationDbTool", this)
+    AthAlgTool(type,name,parent)
   {
-    declareInterface<IMuonCombinedInDetExtensionTool>(this);
-
-    declareProperty("MuonEDMPrinterTool",m_printer );
-    declareProperty("MuonSegmentMaker",m_segmentMaker );    
-    declareProperty("MuonSegmentMakerT0Fit",m_segmentMakerT0Fit );    
-    declareProperty("MuonLayerSegmentMatchingTool",m_segmentMatchingTool );    
-    declareProperty("MuonRecoValidationTool",m_recoValidationTool );    
-    declareProperty("TrackAmbiguityProcessor",m_trackAmbibuityResolver );    
-    declareProperty("MuonHitTimingTool",m_hitTimingTool);
-    declareProperty("MuonPRDSelectionTool", m_muonPRDSelectionTool );
-    declareProperty("MuonPRDSelectionToolStau", m_muonPRDSelectionToolStau );
-    declareProperty("MdtDriftCircleOnTrackCreator", m_mdtCreator );
-    declareProperty("MdtDriftCircleOnTrackCreatorStau", m_mdtCreatorStau );
-    declareProperty("Updator", m_updator );
-    declareProperty("MuonInsideOutRecoTool", m_insideOutRecoTool );
-    declareProperty("MdtCalibrationDbTool", m_calibrationDbTool );
-    declareProperty("DoSummary", m_doSummary = false );
-    declareProperty("ConsideredPDGs", m_pdgsToBeConsidered );
-    declareProperty("UseTruthMatching", m_useTruthMatching = false );
-    declareProperty("DoTruth", m_doTruth = false );
-    declareProperty("PtThreshold", m_ptThreshold = 10000. );
-    declareProperty("HoughAssociationPullCut", m_houghAssociationPullCut = 5);
-    declareProperty("UseSegmentMDTT", m_segmentMDTT = true );
-    declareProperty("MDTTAssocationCut", m_mdttBetaAssociationCut = 0.4 );
-    declareProperty("RPCAssocationCut", m_rpcBetaAssociationCut = 0.2 );
-    declareProperty("SegmentAssocationCut", m_segmentBetaAssociationCut = 0.2 );
-    declareProperty("IgnoreSiAssociatedCandidates", m_ignoreSiAssocated = true );
   }
 
   StatusCode MuonStauRecoTool::initialize() {
diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.h b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.h
index e7ed7c20391b..5559fa2e2393 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonStauRecoTool.h
@@ -5,12 +5,11 @@
 #ifndef MUON_MUONSTAURECOTOOL_H
 #define MUON_MUONSTAURECOTOOL_H
 
+#include "MuonCombinedToolInterfaces/IMuonCombinedInDetExtensionTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "MuonCombinedToolInterfaces/IMuonCombinedInDetExtensionTool.h"
-
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "MuonRecHelperTools/MuonEDMPrinterTool.h"
 #include "MuonRecHelperTools/IMuonEDMHelperSvc.h"
@@ -24,7 +23,6 @@
 #include "TrkToolInterfaces/IUpdator.h"
 #include "MuidInterfaces/ICombinedMuonTrackBuilder.h"
 #include "MdtCalibSvc/MdtCalibrationDbTool.h"
-
 #include "MuonLayerEvent/MuonSystemExtension.h"
 #include "MuonHoughPatternTools/MuonLayerHoughTool.h" 
 #include "MuonLayerHough/MuonLayerHough.h"
@@ -39,6 +37,7 @@
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "GaudiKernel/PhysicalConstants.h"
 
+#include <string>
 #include <vector>
 #include <iostream>
 
@@ -230,25 +229,25 @@ namespace MuonCombined {
     SG::ReadHandleKey<Muon::MuonLayerHoughTool::HoughDataPerSectorVec> m_houghDataPerSectorVecKey {this, 
         "Key_MuonLayerHoughToolHoughDataPerSectorVec", "HoughDataPerSectorVec", "HoughDataPerSectorVec key"};
 
-    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-    ToolHandle<Muon::MuonEDMPrinterTool>             m_printer; 
-    ServiceHandle<Muon::IMuonEDMHelperSvc>           m_edmHelperSvc {this, "edmHelper", 
-      "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc", 
-      "Handle to the service providing the IMuonEDMHelperSvc interface" };
-    ToolHandle<Muon::IMuonSegmentMaker>              m_segmentMaker;
-    ToolHandle<Muon::IMuonSegmentMaker>              m_segmentMakerT0Fit;
-    ToolHandle<Muon::IMuonLayerSegmentMatchingTool>  m_segmentMatchingTool;
-    ToolHandle<Muon::IMuonRecoValidationTool>        m_recoValidationTool;
-    ToolHandle<Trk::ITrackAmbiguityProcessorTool>    m_trackAmbibuityResolver;
-    ToolHandle<Muon::IMuonHitTimingTool>             m_hitTimingTool;
-    ToolHandle<Muon::IMuonPRDSelectionTool>          m_muonPRDSelectionTool;
-    ToolHandle<Muon::IMuonPRDSelectionTool>          m_muonPRDSelectionToolStau;
-    ToolHandle<Muon::IMdtDriftCircleOnTrackCreator>  m_mdtCreator;
-    ToolHandle<Muon::IMdtDriftCircleOnTrackCreator>  m_mdtCreatorStau;
-    ToolHandle<MuonCombined::MuonInsideOutRecoTool>  m_insideOutRecoTool;
-    ToolHandle<Trk::IUpdator>                        m_updator;
-    ToolHandle<MdtCalibrationDbTool> m_calibrationDbTool;
-    Muon::MuonSectorMapping                          m_muonSectorMapping;
+    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc","Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+    ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc {this, "edmHelper","Muon::MuonEDMHelperSvc/MuonEDMHelperSvc","Handle to the service providing the IMuonEDMHelperSvc interface"};
+
+    ToolHandle<Muon::MuonEDMPrinterTool>            m_printer{this,"MuonEDMPrinterTool","Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
+    ToolHandle<Muon::IMuonSegmentMaker>             m_segmentMaker{this,"MuonSegmentMaker","Muon::DCMathSegmentMaker/DCMathSegmentMaker"};
+    ToolHandle<Muon::IMuonSegmentMaker>             m_segmentMakerT0Fit{this,"MuonSegmentMakerT0Fit","Muon::DCMathSegmentMaker/DCMathT0FitSegmentMaker"};
+    ToolHandle<Muon::IMuonLayerSegmentMatchingTool> m_segmentMatchingTool{this,"MuonLayerSegmentMatchingTool","Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"};
+    ToolHandle<Muon::IMuonRecoValidationTool>       m_recoValidationTool{this,"MuonRecoValidationTool",""};
+    ToolHandle<Trk::ITrackAmbiguityProcessorTool>   m_trackAmbibuityResolver{this,"TrackAmbiguityProcessor","Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"};
+    ToolHandle<Muon::IMuonHitTimingTool>            m_hitTimingTool{this,"MuonHitTimingTool","Muon::MuonHitTimingTool/MuonHitTimingTool"};
+    ToolHandle<Muon::IMuonPRDSelectionTool>         m_muonPRDSelectionTool{this,"MuonPRDSelectionTool","Muon::MuonPRDSelectionTool/MuonPRDSelectionTool"};
+    ToolHandle<Muon::IMuonPRDSelectionTool>         m_muonPRDSelectionToolStau{this,"MuonPRDSelectionToolStau","Muon::MuonPRDSelectionTool/MuonPRDSelectionToolStau"};
+    ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> m_mdtCreator{this,"MdtDriftCircleOnTrackCreator","Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator"};
+    ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> m_mdtCreatorStau{this,"MdtDriftCircleOnTrackCreatorStau","Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreatorStau"};
+    ToolHandle<MuonCombined::MuonInsideOutRecoTool> m_insideOutRecoTool{this,"MuonInsideOutRecoTool","MuonCombined::MuonInsideOutRecoTool/MuonInsideOutRecoTool"};
+    ToolHandle<Trk::IUpdator>                       m_updator{this,"Updator","Trk::KalmanUpdator/KalmanUpdator"};
+    ToolHandle<MdtCalibrationDbTool>                m_calibrationDbTool{this,"MdtCalibrationDbTool","MdtCalibrationDbTool"};
+
+    Muon::MuonSectorMapping m_muonSectorMapping;
 
     struct TruthMatchingCounters {
       TruthMatchingCounters() : ntruth(0) {}
@@ -272,19 +271,20 @@ namespace MuonCombined {
       }
     };
 
-    bool m_doSummary; // enable summary output
-    bool m_useTruthMatching; // enable usage of truth info for reconstruction
-    bool m_doTruth; // enable truth matching
-    IntegerArrayProperty m_pdgsToBeConsidered; // pdg's considered in truth matching
+    Gaudi::Property<bool> m_doSummary{this,"DoSummary",false,"enable summary output"};
+    Gaudi::Property<bool> m_useTruthMatching{this,"UseTruthMatching",false,"enable usage of truth info for reconstruction"};
+    Gaudi::Property<bool> m_doTruth{this,"DoTruth",false,"enable truth matching"};
+    Gaudi::Property<bool> m_segmentMDTT{this,"UseSegmentMDTT",true};
+    Gaudi::Property<bool> m_ignoreSiAssocated{this,"IgnoreSiAssociatedCandidates",true};
+    Gaudi::Property<std::vector<int>> m_pdgsToBeConsidered{this,"ConsideredPDGs",{},"PDG IDs considered in truth matching"};
+    Gaudi::Property<double> m_ptThreshold{this,"PtThreshold",10000};
+    Gaudi::Property<double> m_houghAssociationPullCut{this,"HoughAssociationPullCut",5};
+    Gaudi::Property<double> m_mdttBetaAssociationCut{this,"MDTTAssocationCut",0.4};
+    Gaudi::Property<double> m_rpcBetaAssociationCut{this,"RPCAssocationCut",0.2};
+    Gaudi::Property<double> m_segmentBetaAssociationCut{this,"SegmentAssocationCut",0.2};
+
     std::set<int> m_selectedPdgs; // set storing particle PDG's considered for matching
     
-    bool m_segmentMDTT;
-    double m_ptThreshold;
-    double m_houghAssociationPullCut;
-    double m_mdttBetaAssociationCut;
-    double m_rpcBetaAssociationCut;
-    double m_segmentBetaAssociationCut;
-    bool m_ignoreSiAssocated;
     const double m_inverseSpeedOfLight = 1 / Gaudi::Units::c_light; // need 1/299.792458 inside calculateTof()/calculateBeta()
   };
 
-- 
GitLab


From f0a75f04d40f6d4562129751829aae98ea65647d Mon Sep 17 00:00:00 2001
From: Anil Sonay <anil.sonay@cern.ch>
Date: Mon, 6 Jul 2020 15:09:26 +0000
Subject: [PATCH 055/217] L1Topo Simulation thread-safety ATR-19783

---
 .../InvariantMassDeltaPhiInclusive2.h         |   9 +-
 .../L1TopoAlgorithms/Root/ExclusiveJets.cxx   |   4 +-
 .../Root/InvariantMassDeltaPhiInclusive2.cxx  |  45 +++----
 .../Root/StandaloneL1TopoHistSvc.cxx          |  16 +--
 .../L1TopoInterfaces/ConfigurableAlg.h        |   4 +
 .../L1TopoInterfaces/Root/ConfigurableAlg.cxx | 118 +++++++++++++++++-
 .../share/L1TopoSimulationTest.py             |   4 +-
 .../src/AthenaL1TopoHistSvc.cxx               |  42 ++++---
 8 files changed, 167 insertions(+), 75 deletions(-)

diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h
index d2f8ad41c6e3..d00c38f82c02 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassDeltaPhiInclusive2.h
@@ -48,10 +48,11 @@ namespace TCS {
       parType_t      p_DeltaPhiMin[6] = { 0,0,0,0,0,0 };
       parType_t      p_DeltaPhiMax[6] = { 0,0,0,0,0,0 };
 
-      TH2 * m_histAcceptM[6] = {};
-      TH2 * m_histRejectM[6] = {};
-      TH2 * m_histAcceptEta1Eta2[6] = {};
-      TH2 * m_histRejectEta1Eta2[6] = {};
+      std::vector<std::string> m_histAcceptM;
+      std::vector<std::string> m_histRejectM;
+      std::vector<std::string> m_histAcceptEta1Eta2;
+      std::vector<std::string> m_histRejectEta1Eta2;
+
    };
    
 }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
index 31341667e561..2bc20b4478b4 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/ExclusiveJets.cxx
@@ -157,7 +157,7 @@ TCS::ExclusiveJets::processBitCorrect( const vector<TCS::TOBArray const *> & inp
 		  fillHist2D(m_histRejectExclusiveJets[i]->GetName(),xi_1,xi_2);
 		  fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2);
 		}
-		TRG_MSG_INFO("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1);
+		TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1);
 		
 	      }
 	    }
@@ -216,7 +216,7 @@ TCS::ExclusiveJets::process( const vector<TCS::TOBArray const *> & input,
 		  fillHist2D(m_histRejectExclusiveJets[i]->GetName(),xi_1,xi_2);
 		  fillHist2D(m_histRejectEta1Eta2[i]->GetName(),eta1, eta2);
 		}
-		TRG_MSG_INFO("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1);
+		TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " xi_1 = " << xi_1);
 		  
 	      }
 	    }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx
index 6684d5863f05..44de5924af60 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassDeltaPhiInclusive2.cxx
@@ -127,31 +127,14 @@ TCS::InvariantMassDeltaPhiInclusive2::initialize() {
 
    // book histograms
    for(unsigned int i=0; i<numberOutputBits(); ++i) {
-       const int buf_len = 512;
-       char hname_accept[buf_len], hname_reject[buf_len];
-       int n_bin = 100;
-       int MassEta_min = 0;
-       int EtaEta_min = -50;
-       int EtaEta_max = 50;
-       int mass_min = sqrt(p_InvMassMin[i]);
-       int mass_max = sqrt(p_InvMassMax[i]);
-       // if minimum mass requirement less than twice of bin length,
-       // adjust to range by changing maximum mass with the 10 time of bin length.
-       // This is necessary when range is too wide and minimum cut unvisible.
-       // Later will be changed with more automated way.
-       if ( 2*(mass_max-mass_min)/n_bin > mass_min && mass_min != 0.0 )
-	 { mass_max=10*(mass_max-mass_min)/n_bin; }
-       int delta_phi_max = p_DeltaPhiMax[i];
+       string hname_accept = "hInvariantMassDeltaPhiInclusive2_accept_bit"+to_string((int)i);
+       string hname_reject = "hInvariantMassDeltaPhiInclusive2_reject_bit"+to_string((int)i);
        // mass
-       snprintf(hname_accept, buf_len, "Accept_InvariantMassDeltaPhiInclusive2_bit%d_%dM%d_Mass", i, mass_min, mass_max);
-       snprintf(hname_reject, buf_len, "Reject_InvariantMassDeltaPhiInclusive2_bit%d_%dM%d_Mass", i, mass_min, mass_max);
-       registerHist(m_histAcceptM[i] = new TH2F(hname_accept, hname_accept, n_bin, MassEta_min, 2*mass_max, 2*delta_phi_max, MassEta_min, 2*delta_phi_max));
-       registerHist(m_histRejectM[i] = new TH2F(hname_reject, hname_reject, n_bin, MassEta_min, 2*mass_max, 2*delta_phi_max, MassEta_min, 2*delta_phi_max));
+       bookHist(m_histAcceptM, hname_accept, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]);
+       bookHist(m_histRejectM, hname_reject, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]);
        // eta2 vs. eta1
-       snprintf(hname_accept, buf_len, "Accept_InvariantMassDeltaPhiInclusive2_bit%d_%dM%d_Eta1Eta2", i, mass_min, mass_max);
-       snprintf(hname_reject, buf_len, "Reject_InvariantMassDeltaPhiInclusive2_bit%d_%dM%d_Eta1Eta2", i, mass_min, mass_max);
-       registerHist(m_histAcceptEta1Eta2[i] = new TH2F(hname_accept, hname_accept, n_bin, EtaEta_min, EtaEta_max, n_bin, EtaEta_min, EtaEta_max));
-       registerHist(m_histRejectEta1Eta2[i] = new TH2F(hname_reject, hname_reject, n_bin, EtaEta_min, EtaEta_max, n_bin, EtaEta_min, EtaEta_max));
+       bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2);
+       bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2);
    }
    return StatusCode::SUCCESS;
 }
@@ -198,11 +181,11 @@ TCS::InvariantMassDeltaPhiInclusive2::processBitCorrect( const std::vector<TCS::
                        output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
                    }
                    if(fillAccept and not alreadyFilled) {
-		       fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),(float)deltaPhi);
-		       fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2);
+		       fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),(float)deltaPhi);
+		       fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2);
                    } else if(fillReject) {
-		       fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),(float)deltaPhi);
-		       fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2);
+		       fillHist2D(m_histRejectM[i],sqrt((float)invmass2),(float)deltaPhi);
+		       fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2);
                    }
                    TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2);
                }
@@ -255,11 +238,11 @@ TCS::InvariantMassDeltaPhiInclusive2::process( const std::vector<TCS::TOBArray c
                        output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
                    }
                    if(fillAccept and not alreadyFilled) {
-		       fillHist2D(m_histAcceptM[i]->GetName(),sqrt((float)invmass2),(float)deltaPhi);
-		       fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2);
+		       fillHist2D(m_histAcceptM[i],sqrt((float)invmass2),(float)deltaPhi);
+		       fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2);
                    } else if(fillReject) {
-		       fillHist2D(m_histRejectM[i]->GetName(),sqrt((float)invmass2),(float)deltaPhi);
-		       fillHist2D(m_histAcceptEta1Eta2[i]->GetName(),eta1, eta2);
+		       fillHist2D(m_histRejectM[i],sqrt((float)invmass2),(float)deltaPhi);
+		       fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2);
                    }
                   TRG_MSG_DEBUG("Decision " << i << ": " << (accept ?"pass":"fail") << " invmass2 = " << invmass2);
                }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/StandaloneL1TopoHistSvc.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/StandaloneL1TopoHistSvc.cxx
index 54f762f56325..77a2a14059ab 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/StandaloneL1TopoHistSvc.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/StandaloneL1TopoHistSvc.cxx
@@ -32,8 +32,6 @@ public:
 
    void registerHist(TH1 * h) {
       if(h != nullptr) {
-	//cout << "JOERG registering histogram " << h->GetName() << " at " << h << endl;
-         h->SetDirectory(0);
          TRG_MSG_DEBUG("Registering histogram " << h->GetName());
          const string key = h->GetName();
          if( m_hists1D.find(key)  == end(m_hists1D) ) {
@@ -47,8 +45,6 @@ public:
 
    void registerHist(TH2 * h) {
       if(h != nullptr) {
-	//cout << "JOERG registering histogram " << h->GetName() << " at " << h << endl;
-         h->SetDirectory(0);
          TRG_MSG_DEBUG("Registering histogram " << h->GetName());
          const string key = h->GetName();
          if( m_hists2D.find(key)  == end(m_hists2D) ) {
@@ -72,21 +68,17 @@ public:
    }
 
    void fillHist1D(const std::string & histName,double x) {
-     auto colPos = histName.find_first_of('/');
-     string realhistName = histName.substr(colPos+1);
-     auto h = m_hists1D.find(realhistName);
+     auto h = m_hists1D.find(histName);
      if( h == end(m_hists1D) ) {
-       TRG_MSG_WARNING("No histogram founded for " << histName);
+       TRG_MSG_WARNING("No histogram found for " << histName);
      } else 
        h->second->Fill(x);
    }
 
    void fillHist2D(const std::string & histName,double x,double y) {
-     auto colPos = histName.find_first_of('/');
-     string realhistName = histName.substr(colPos+1);
-     auto h = m_hists2D.find(realhistName);
+     auto h = m_hists2D.find(histName);
      if( h == end(m_hists2D) ) {
-       TRG_MSG_WARNING("No histogram founded for " << histName);
+       TRG_MSG_WARNING("No histogram found for " << histName);
      } else 
        h->second->Fill(x,y);
    }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
index 72ccd4f60bdc..2cc791c0d837 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
@@ -76,6 +76,10 @@ namespace TCS {
        */
       void setL1TopoHistSvc(std::shared_ptr<IL1TopoHistSvc>);
 
+      void bookHist(std::vector<std::string> &regName, const std::string name,const std::string title, const int binx, const float xmin, const float xmax);
+      void bookHist(std::vector<std::string> &regName, const std::string name,const std::string title, const int binx, const float xmin, const float xmax, const int biny, const float ymin, const float ymax);
+
+
    protected:
 
       // define parameters by developer
diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
index 2e0f04b31a0c..04beaa2184ec 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
@@ -37,7 +37,7 @@ public:
    }
 
    void registerHist(TH1 * h) {
-      // histograms in the L1Topo framework are put in a algorith specific folder
+      // histograms in the L1Topo framework are put in a algorithm specific folder
       string newHistName = m_name + "/" + h->GetName();
       h->SetName(newHistName.c_str());
 
@@ -49,7 +49,7 @@ public:
    }
   
    void registerHist(TH2 * h) {
-      // histograms in the L1Topo framework are put in a algorith specific folder
+      // histograms in the L1Topo framework are put in a algorithm specific folder
       string newHistName = m_name + "/" + h->GetName();
       h->SetName(newHistName.c_str());
 
@@ -61,14 +61,22 @@ public:
    }
   
    void fillHist1D(const std::string & histName, double x) {
-      string newHistName = m_name + "/" + histName;
-      m_histSvc->fillHist1D(newHistName,x);
+     if ( m_histSvc ) {
+       m_histSvc->fillHist1D(histName,x);
+     } else {
+       //Implement here to fill local histograms or something.
+       return;
+     }
    }
   
   
    void fillHist2D(const std::string & histName, double x, double y) {
-      string newHistName = m_name + "/" + histName;
-      m_histSvc->fillHist2D(newHistName,x,y);
+     if ( m_histSvc ) {
+       m_histSvc->fillHist2D(histName,x,y);
+     } else {
+       //Implement here to fill local histograms or something.
+       return;
+     }
    }
   
    
@@ -172,6 +180,104 @@ void ConfigurableAlg::registerHist(TH2 * h) {
    m_impl->registerHist(h);
 }
 
+void ConfigurableAlg::bookHist(std::vector<std::string> &regName, const std::string name,const std::string title, const int binx, const float xmin, const float xmax) {
+  string newTitle = to_string((int)xmin)+title+to_string((int)xmax);
+  std::string newname=name+"_"+to_string((int)xmin)+title+to_string((int)xmax);
+  std::replace( newname.begin(), newname.end(), '-', 'n');
+  std::replace( newname.begin(), newname.end(), ' ', '_');
+  regName.push_back(m_name+"/"+newname);
+
+  float xmin_new,xmax_new;
+  if ( xmin > 0.0)
+    { xmin_new=0.0; }
+  else
+    { xmin_new=1.5*xmin; }
+  // if minimum mass requirement less than twice of bin length,
+  // adjust to range by changing maximum mass with the 10 time of bin length.
+  // This is necessary when range is too wide and minimum cut unvisible.
+  // Later will be changed with more automated way.
+  if ( 2*(xmax-xmin)/binx > xmin && xmin > 0.0 )
+    { xmax_new=10*(xmax-xmin)/binx; }
+  else
+    { xmax_new=1.5*xmax; }
+  
+  // if angular kinematics, use fixed range
+  if ( title.find("ETA") != std::string::npos || title.find("PHI") != std::string::npos ){
+    xmin_new=-70;
+    xmax_new=70;
+  }
+  if ( title.find("DETA") != std::string::npos || title.find("DPHI") != std::string::npos ){
+    xmin_new=0;
+    xmax_new=70;
+  }
+
+  TH1 *h = new TH1F(newname.c_str(),newTitle.c_str(),binx,xmin_new,xmax_new);
+  h->GetXaxis()->SetTitle(title.c_str());
+  m_impl->registerHist(h);
+}
+
+void ConfigurableAlg::bookHist(std::vector<std::string> &regName, const std::string name,const std::string title, const int binx, const float xmin, const float xmax, const int biny, const float ymin, const float ymax) {
+  auto usPos = title.find(" vs ");
+  string xName = title.substr(0,usPos);
+  string yName = title.substr(usPos+4);
+  string newTitle = to_string((int)xmin)+xName+to_string((int)xmax)+" vs "+to_string((int)ymin)+yName+to_string((int)ymax);
+  std::string newname=name+"_"+to_string((int)xmin)+xName+to_string((int)xmax)+"_"+to_string((int)ymin)+yName+to_string((int)ymax);
+  std::replace( newname.begin(), newname.end(), '-', 'n');
+  std::replace( newname.begin(), newname.end(), ' ', '_');
+  regName.push_back(m_name+"/"+newname);
+
+  float xmin_new,xmax_new;
+  if ( xmin > 0.0)
+    { xmin_new=0.0; }
+  else
+    { xmin_new=1.5*xmin; }
+  // if minimum x requirement less than twice of bin length,
+  // adjust to range by changing maximum mass with the 10 time of bin length.
+  // This is necessary when range is too wide and minimum cut unvisible.
+  // Later will be changed with more automated way.
+  if ( 2*(xmax-xmin)/binx > xmin && xmin > 0.0 )
+    { xmax_new=10*(xmax-xmin)/binx; }
+  else
+    { xmax_new=1.5*xmax; }
+
+  float ymin_new,ymax_new;
+  if ( ymin > 0.0)
+    { ymin_new=0.0; }
+  else
+    { ymin_new=1.5*ymin; }
+  // if minimum y requirement less than twice of bin length,
+  // adjust to range by changing maximum mass with the 10 time of bin length.
+  // This is necessary when range is too wide and minimum cut unvisible.
+  // Later will be changed with more automated way.
+  if ( 2*(ymax-ymin)/biny > ymin && ymin > 0.0 )
+    { ymax_new=10*(ymax-ymin)/biny; }
+  else
+    { ymax_new=1.5*ymax; }
+
+  // if angular kinematics, use fixed range
+  if ( xName.find("ETA") != std::string::npos || xName.find("PHI") != std::string::npos ){
+    xmin_new=-70;
+    xmax_new=70;
+  }
+  if ( yName.find("ETA") != std::string::npos || yName.find("PHI") != std::string::npos ){
+    ymin_new=-70;
+    ymax_new=70;
+  }
+  if ( xName.find("DETA") != std::string::npos || xName.find("DPHI") != std::string::npos ){
+    xmin_new=0;
+    xmax_new=70;
+  }
+  if ( yName.find("DETA") != std::string::npos || yName.find("DPHI") != std::string::npos ){
+    ymin_new=0;
+    ymax_new=70;
+  }
+
+  TH2 *h = new TH2F(newname.c_str(),newTitle.c_str(),binx,xmin_new,xmax_new,biny,ymin_new,ymax_new);
+  h->GetXaxis()->SetTitle(xName.c_str());
+  h->GetYaxis()->SetTitle(yName.c_str());
+  m_impl->registerHist(h);
+}
+  
 void ConfigurableAlg::fillHist1D(const std::string & histName, double x) {
   m_impl->fillHist1D(histName,x);
 }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
index f2f9f3000032..3819f20cb9cc 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
@@ -77,10 +77,10 @@ algCardinality = nThreads
 if (algCardinality > 1):   
    for alg in topSequence:      
       name = alg.name()
-      if name in ["SGInputLoader"] :
+      if name in ["L1TopoSimulation"] :
          # suppress INFO message about Alg unclonability
          # set alg.Cardinality = 1 to disable cloning for specific Alg
-         alg.Cardinality = nThreads
+         alg.Cardinality = 1
       else:
          alg.Cardinality = algCardinality
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx
index e5d88c86b194..425c475ff086 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/AthenaL1TopoHistSvc.cxx
@@ -39,12 +39,12 @@ public:
   void registerHist(TH1 * h) {
      TRG_MSG_DEBUG("Registration of " << h->GetName() );
      if(m_histSvc) {
-       string fullName( m_baseDir + h->GetName() );
-       auto colPos = fullName.find_last_of('/');
-       auto colPos2 = fullName.find_last_of('/',colPos-1);
-       string histName = fullName.substr(colPos+1);
-       string key = fullName.substr(colPos2+1);
-       h->SetName(histName.c_str());
+       string histName = h->GetName();
+       auto colPos = histName.find_first_of('/');
+       //Key will use original name when all algorithms changed with bookHist()
+       const string key = histName.substr(colPos+1);
+       const string fullName( m_baseDir + histName );
+       h->SetName(key.c_str());
        std::unique_ptr<TH1> uhist(h);
        LockedHandle<TH1> lh;
        if( ! m_histSvc->regShared(fullName, std::move(uhist), lh).isSuccess() ) {
@@ -60,12 +60,12 @@ public:
    void registerHist(TH2 * h) {
       TRG_MSG_DEBUG("Registration of " << h->GetName() );
       if(m_histSvc) {
-        string fullName( m_baseDir + h->GetName() );
-        auto colPos = fullName.find_last_of('/');
-        auto colPos2 = fullName.find_last_of('/',colPos-1);
-        string histName = fullName.substr(colPos+1);
-        string key = fullName.substr(colPos2+1);
-        h->SetName(histName.c_str());
+        string histName = h->GetName();
+        auto colPos = histName.find_first_of('/');
+	//Key will use original name when all algorithms changed with bookHist()
+        const string key = histName.substr(colPos+1);
+        const string fullName( m_baseDir + histName );
+        h->SetName(key.c_str());
         std::unique_ptr<TH2> uhist(h);
         LockedHandle<TH2> lh;
         if( ! m_histSvc->regShared(fullName, std::move(uhist), lh).isSuccess() ) {
@@ -89,18 +89,24 @@ public:
    }
 
    void fillHist1D(const std::string & histName,double x) {
-      if(m_hist1D.find(histName) == m_hist1D.end()) {
-	TRG_MSG_ERROR("1D-hist with registration key " << histName << " does not exist");
+     //This will be removed when all algorithms changed with bookHist()
+      auto colPos = histName.find_first_of('/');
+      const string key = histName.substr(colPos+1);
+      if(m_hist1D.find(key) == m_hist1D.end()) {
+	TRG_MSG_ERROR("1D-hist with registration key " << key << " does not exist");
       }
-      else { m_hist1D[histName]->Fill(x); }
+      else { m_hist1D[key]->Fill(x); }
    }
 
    void fillHist2D(const std::string & histName,double x,double y) {
-      if(m_hist2D.find(histName) == m_hist2D.end()) {
-	TRG_MSG_ERROR("2D-hist with registration key " << histName << " does not exist");
+     //This will be removed when all algorithms changed with bookHist()
+      auto colPos = histName.find_first_of('/');
+      const string key = histName.substr(colPos+1);
+      if(m_hist2D.find(key) == m_hist2D.end()) {
+	TRG_MSG_ERROR("2D-hist with registration key " << key << " does not exist");
       }
       else
-	{ m_hist2D[histName]->Fill(x,y); }
+	{ m_hist2D[key]->Fill(x,y); }
    }
 
    void setBaseDir(const std::string & baseDir) {
-- 
GitLab


From b2eb7887641283b3b90eb9fd036c2da366649a5f Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Mon, 6 Jul 2020 15:10:34 +0000
Subject: [PATCH 056/217] Add ATLAS_CHECK_THREAD_SAFETY to InDetBeamSpotService
 package to check and keep thread safety. Add ATLAS_NOT_THREAD_SAFE of
 CxxUtils/checker_macros.h to BeamCondSvc::initialize and BeamCondSvc::fillRec
 because these use thread unsafe AthenaAttributeList::AthenaAttributeList and
 StoreGateSvc::regFcn.

---
 .../LArCnv/LArAthenaPool/CMakeLists.txt       |  2 +-
 .../src/LArLATOMEHeaderContainerCnv.cxx       | 55 ++++++++++++
 .../src/LArLATOMEHeaderContainerCnv.h         | 30 +++++++
 LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt |  6 ++
 .../LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h | 24 ++++++
 .../LArTPCnv/LArLATOMEHeaderContainer_p1.h    | 25 ++++++
 .../LArCnv/LArTPCnv/LArTPCnv/LArTPCnvDict.h   |  4 +-
 .../LArCnv/LArTPCnv/LArTPCnv/selection.xml    |  1 +
 .../src/LArLATOMEHeaderContainerCnv_p1.cxx    | 51 +++++++++++
 .../LArCnv/LArTPCnv/src/LArTPCnv.cxx          |  7 ++
 .../LArLATOMEHeaderContainerCnv_p1_test.cxx   | 75 ++++++++++++++++
 .../LArRawEvent/LArRawEvent/LArLATOMEHeader.h | 85 +++++++++++++++++++
 .../LArRawEvent/LArLATOMEHeaderContainer.h    | 36 ++++++++
 .../LArRawEvent/LArRawEvent/LArRawEventDict.h |  3 +-
 .../LArRawEvent/src/LArLATOMEHeader.cxx       | 12 +++
 15 files changed, 413 insertions(+), 3 deletions(-)
 create mode 100644 LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.cxx
 create mode 100644 LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
 create mode 100644 LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h
 create mode 100644 LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainer_p1.h
 create mode 100644 LArCalorimeter/LArCnv/LArTPCnv/src/LArLATOMEHeaderContainerCnv_p1.cxx
 create mode 100644 LArCalorimeter/LArCnv/LArTPCnv/test/LArLATOMEHeaderContainerCnv_p1_test.cxx
 create mode 100755 LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeader.h
 create mode 100755 LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeaderContainer.h
 create mode 100755 LArCalorimeter/LArRawEvent/src/LArLATOMEHeader.cxx

diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt b/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
index 5944a121ce54..4aaae8c42d31 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/CMakeLists.txt
@@ -7,7 +7,7 @@ atlas_subdir( LArAthenaPool )
 atlas_add_poolcnv_library( LArAthenaPoolPoolCnv
    src/*.h src/*.cxx
    FILES LArRawEvent/LArRawChannelContainer.h LArRawEvent/LArDigitContainer.h
-         LArRawEvent/LArTTL1Container.h LArRawEvent/LArFebErrorSummary.h
+         LArRawEvent/LArTTL1Container.h LArRawEvent/LArFebErrorSummary.h LArRawEvent/LArLATOMEHeaderContainer.h
          LArRecEvent/LArNoisyROSummary.h
    LINK_LIBRARIES AthenaPoolUtilities CaloDetDescrLib AthenaKernel StoreGateLib
                   AthenaPoolCnvSvcLib GaudiKernel LArTPCnv LArRawEvent
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.cxx b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.cxx
new file mode 100644
index 000000000000..48163ef8da4e
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.cxx
@@ -0,0 +1,55 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArLATOMEHeaderContainerCnv.h"
+#include "LArTPCnv/LArLATOMEHeaderContainer_p1.h"
+#include "LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h"
+#include "StoreGate/StoreGateSvc.h"
+#include <memory>
+
+LArLATOMEHeaderContainerCnv::LArLATOMEHeaderContainerCnv(ISvcLocator* svcLoc) : 
+  LArLATOMEHeaderContainerCnvBase(svcLoc),
+  m_p1_guid("7FE06234-8574-4514-86C7-1FD09E97D713")
+{}
+  
+StatusCode LArLATOMEHeaderContainerCnv::initialize() {
+
+  MsgStream log(msgSvc(), "LArLATOMEHeaderContainerCnv");
+  StoreGateSvc *detStore=nullptr;
+  StatusCode sc=service("DetectorStore",detStore);
+  if (sc.isFailure()) {
+    ATH_MSG_FATAL("DetectorStore service not found !");
+    return StatusCode::FAILURE;
+  } 
+  return LArLATOMEHeaderContainerCnvBase::initialize();
+}
+
+
+LArLATOMEHeaderContainerPERS* LArLATOMEHeaderContainerCnv::createPersistent(LArLATOMEHeaderContainer* trans) {
+    MsgStream log(msgSvc(), "LArLATOMEHeaderContainerCnv");
+    log << MSG::DEBUG << "Writing LArDigitContainer_p2" << endmsg;
+    LArLATOMEHeaderContainerPERS* pers=new LArLATOMEHeaderContainerPERS();
+    LArLATOMEHeaderContainerCnv_p1 converter;
+    converter.transToPers(trans,pers,log); 
+    return pers;
+}
+    
+
+
+LArLATOMEHeaderContainer* LArLATOMEHeaderContainerCnv::createTransient() {
+   MsgStream log(msgSvc(), "LArLATOMEHeaderContainerCnv" );
+   if (compareClassGuid(m_p1_guid)) {
+     log << MSG::DEBUG << "Reading LArLATOMEHeaderContainer_p1. GUID=" 
+	 << m_classID.toString() << endmsg;
+     LArLATOMEHeaderContainer* trans=new LArLATOMEHeaderContainer();
+     std::unique_ptr<LArLATOMEHeaderContainer_p1> pers(poolReadObject<LArLATOMEHeaderContainer_p1>());
+     LArLATOMEHeaderContainerCnv_p1 converter;
+     converter.persToTrans(pers.get(),trans, log);
+     return trans;
+   } 
+   log << MSG::ERROR << "Unsupported persistent version of LArLATOMEHeaderContainer. GUID="
+       << m_classID.toString() << endmsg;
+   throw std::runtime_error("Unsupported persistent version of Data Collection");
+   // not reached
+}
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
new file mode 100644
index 000000000000..224d735a14b2
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+//Dear emacs, this is -*-c++-*- 
+#ifndef LARATHENAPOOL_LARLATOMEHEADERCONTAINERCNV_H
+#define LARATHENAPOOL_LARLATOMECONTAINERCNV_H
+
+#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
+#include "LArRawEvent/LArLATOMEHeaderContainer.h"
+#include "LArTPCnv/LArLATOMEHeaderContainer_p1.h"
+
+typedef LArLATOMEHeaderContainer_p1 LArLATOMEHeaderContainerPERS;
+
+typedef T_AthenaPoolCustomCnv<LArLATOMEHeaderContainer,LArLATOMEHeaderContainerPERS> LArLATOMEHeaderContainerCnvBase;
+
+class LArLATOMEHeaderContainerCnv : public LArLATOMEHeaderContainerCnvBase 
+{
+public:
+  LArLATOMEHeaderContainerCnv(ISvcLocator*);
+  StatusCode initialize();
+protected:
+  virtual LArLATOMEHeaderContainer* createTransient() override final;
+  virtual LArLATOMEHeaderContainerPERS* createPersistent(LArLATOMEHeaderContainer*);
+private:
+  pool::Guid   m_p1_guid;
+  
+};
+
+#endif
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt b/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt
index 9b10d9424f9b..860e72a1a086 100644
--- a/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt
+++ b/LArCalorimeter/LArCnv/LArTPCnv/CMakeLists.txt
@@ -93,3 +93,9 @@ atlas_add_test( LArRawChannelContainerCnv_p4_test
                 INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                 LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv )
 
+atlas_add_test( LArLATOMEHeaderContainerCnv_p1_test
+                SOURCES
+                test/LArLATOMEHeaderContainerCnv_p1_test.cxx
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LArRawEvent LArRecEvent TestTools CaloIdentifier AthenaKernel Identifier LArTPCnv )
+
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h
new file mode 100644
index 000000000000..e6205ca2977f
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h
@@ -0,0 +1,24 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARTPCNV_LARLATOMEHEADERCONTAINERCNV_P1_H
+#define LARTPCNV_LARLATOMEHEADERCONTAINERCNV_P1_H
+
+#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
+#include "LArTPCnv/LArLATOMEHeaderContainer_p1.h"
+#include "LArRawEvent/LArLATOMEHeaderContainer.h"
+
+class MsgStream;
+
+class LArLATOMEHeaderContainerCnv_p1  : public T_AthenaPoolTPCnvBase<LArLATOMEHeaderContainer, LArLATOMEHeaderContainer_p1>
+{
+public:
+
+  LArLATOMEHeaderContainerCnv_p1() {}
+
+  virtual void          persToTrans(const LArLATOMEHeaderContainer_p1* pers, LArLATOMEHeaderContainer* trans, MsgStream &log);
+  virtual void          transToPers(const LArLATOMEHeaderContainer* trans, LArLATOMEHeaderContainer_p1* pers, MsgStream &log);
+};
+
+#endif
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainer_p1.h b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainer_p1.h
new file mode 100644
index 000000000000..d9a6dc73f2c0
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArLATOMEHeaderContainer_p1.h
@@ -0,0 +1,25 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARLATOMEHEADERCONTAINER_P1_H
+#define LARLATOMEHEADERCONTAINER_P1_H
+
+#include <vector>
+
+
+class LArLATOMEHeaderContainer_p1   
+{
+
+public:
+
+    std::vector<unsigned int> m_sourceID;
+    std::vector<unsigned int> m_latomeID;
+    std::vector<unsigned short> m_nChannels;
+    std::vector<unsigned short> m_BCID;
+    std::vector<unsigned int> m_l1ID;
+    
+};
+
+
+#endif
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArTPCnvDict.h b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArTPCnvDict.h
index 2b2a964ccf8c..d8e498d5329d 100644
--- a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArTPCnvDict.h
+++ b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/LArTPCnvDict.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -25,6 +25,8 @@
 #include "LArTPCnv/LArNoisyROSummary_p4.h" 
 #include "LArTPCnv/LArNoisyROSummary_p5.h" 
 
+#include "LArTPCnv/LArLATOMEHeaderContainer_p1.h"
+
 #include "Identifier/HWIdentifier.h"
 
 struct GCCXML_DUMMY_INSTANTIATION_LARTPCNV {
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
index 1c508a2baa50..dafdea8727d2 100644
--- a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
+++ b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
@@ -12,6 +12,7 @@
   <class name="LArNoisyROSummary_p3" id="7801CF21-F2F2-4E87-9B87-744F31A37D1B"/>
   <class name="LArNoisyROSummary_p4" id="8F9E9A44-699E-4056-96CC-555ADA1179D4"/>
   <class name="LArNoisyROSummary_p5" id="4AE11DAE-F40C-4B90-B105-0A7BA5D29C1D"/>
+  <class name="LArLATOMEHeaderContainer_p1" id="7FE06234-8574-4514-86C7-1FD09E97D713" />
   <class name="std::vector<std::pair<unsigned int, std::vector<int> > >" />
   <!-- pair<unsigned,vector<int> > and associated pair_base -->
   <class pattern="std::*pair*<unsigned int*std::vector<int*> >" />
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/src/LArLATOMEHeaderContainerCnv_p1.cxx b/LArCalorimeter/LArCnv/LArTPCnv/src/LArLATOMEHeaderContainerCnv_p1.cxx
new file mode 100644
index 000000000000..f339a1c48888
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArTPCnv/src/LArLATOMEHeaderContainerCnv_p1.cxx
@@ -0,0 +1,51 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h"
+#include "LArTPCnv/LArLATOMEHeaderContainer_p1.h"
+
+
+
+void
+LArLATOMEHeaderContainerCnv_p1::persToTrans(const LArLATOMEHeaderContainer_p1* pers, 
+				     LArLATOMEHeaderContainer* trans, MsgStream &log)
+{
+  const unsigned nchan=pers->m_sourceID.size();
+  if (nchan != pers->m_nChannels.size() || nchan != pers->m_BCID.size()) {
+    log << MSG::ERROR << "LArLATOMEHeaderContainer_p1 is inconsistent! " << std::endl;
+    return;
+  }
+
+  trans->clear();
+  trans->reserve(nchan);
+
+  for (unsigned i=0;i<nchan;i++) {
+
+    trans->push_back (new LArLATOMEHeader (pers->m_sourceID[i], pers->m_latomeID[i], pers->m_nChannels[i], pers->m_BCID[i],pers->m_l1ID[i]));
+
+  }
+}
+
+
+void
+LArLATOMEHeaderContainerCnv_p1::transToPers(const LArLATOMEHeaderContainer* trans, 
+				     LArLATOMEHeaderContainer_p1* pers, MsgStream &/*log*/)
+{
+  
+  unsigned int nlatome=trans->size();
+  pers->m_sourceID.reserve(nlatome);
+  pers->m_latomeID.reserve(nlatome);
+  pers->m_nChannels.reserve(nlatome);
+  pers->m_BCID.reserve(nlatome);
+  pers->m_l1ID.reserve(nlatome);
+
+  for (const LArLATOMEHeader* transHeader : *trans) {
+    pers->m_sourceID.push_back(transHeader->SourceId());
+    pers->m_latomeID.push_back(transHeader->LatomeId());
+    pers->m_nChannels.push_back(transHeader->NChans());
+    pers->m_BCID.push_back(transHeader->BCId());
+    pers->m_l1ID.push_back(transHeader->L1Id());
+  }
+}
+
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/src/LArTPCnv.cxx b/LArCalorimeter/LArCnv/LArTPCnv/src/LArTPCnv.cxx
index a8a4f6379486..aa33f155bf76 100644
--- a/LArCalorimeter/LArCnv/LArTPCnv/src/LArTPCnv.cxx
+++ b/LArCalorimeter/LArCnv/LArTPCnv/src/LArTPCnv.cxx
@@ -41,6 +41,7 @@
 #include "LArTPCnv/LArNoisyROSummary_p5.h"
 #include "LArTPCnv/LArNoisyROSummaryCnv_p5.h"
 
+#include "LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h"
 
 DECLARE_TPCNV_FACTORY(LArDigitContainerCnv_p1,
                       LArDigitContainer,
@@ -96,3 +97,9 @@ DECLARE_TPCNV_FACTORY(LArRawChannelContainerCnv_p4,
                       LArRawChannelContainer,
                       LArRawChannelContainer_p4,
                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY(LArLATOMEHeaderContainerCnv_p1,
+                      LArLATOMEHeaderContainer,
+                      LArLATOMEHeaderContainer_p1,
+                      Athena::TPCnvVers::Current)
+                      
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/test/LArLATOMEHeaderContainerCnv_p1_test.cxx b/LArCalorimeter/LArCnv/LArTPCnv/test/LArLATOMEHeaderContainerCnv_p1_test.cxx
new file mode 100644
index 000000000000..35ca7f70958e
--- /dev/null
+++ b/LArCalorimeter/LArCnv/LArTPCnv/test/LArLATOMEHeaderContainerCnv_p1_test.cxx
@@ -0,0 +1,75 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id$
+/**
+ * @file LArTPCnv/test/LArLATOMEHeaderContainerCnv_p1_test.cxx
+ * @author Pavol Strizenec
+ * @brief based on test LArDigitContainerCnv_p1_test.cxx by Scott
+ */
+
+
+#undef NDEBUG
+#include "LArTPCnv/LArLATOMEHeaderContainerCnv_p1.h"
+#include "LArRawEvent/LArLATOMEHeader.h"
+#include "LArRawEvent/LArLATOMEHeaderContainer.h"
+#include "TestTools/leakcheck.h"
+#include "GaudiKernel/MsgStream.h"
+#include <cassert>
+#include <iostream>
+
+
+void compare (const LArLATOMEHeader& p1,
+              const LArLATOMEHeader& p2)
+{
+  assert (p1.SourceId() == p2.SourceId());
+  assert (p1.LatomeId() == p2.LatomeId());
+  assert (p1.NChans() == p2.NChans());
+  assert (p1.BCId() == p2.BCId());
+  assert (p1.L1Id() == p2.L1Id());
+}
+
+
+void compare (const LArLATOMEHeaderContainer& p1,
+              const LArLATOMEHeaderContainer& p2)
+{
+  assert (p1.size() == p2.size());
+  for (size_t i=0; i < p1.size(); i++)
+    compare (*p1[i], *p2[i]);
+}
+
+
+void testit (const LArLATOMEHeaderContainer& trans1)
+{
+  MsgStream log (0, "test");
+  LArLATOMEHeaderContainerCnv_p1 cnv;
+  LArLATOMEHeaderContainer_p1 pers;
+  cnv.transToPers (&trans1, &pers, log);
+  LArLATOMEHeaderContainer trans2;
+  cnv.persToTrans (&pers, &trans2, log);
+
+  compare (trans1, trans2);
+}
+
+
+void test1()
+{
+  std::cout << "test1\n";
+  Athena_test::Leakcheck check;
+
+  LArLATOMEHeaderContainer trans1;
+  for (int i=0; i < 10; i++) {
+    short o = i*100;
+    trans1.push_back (new LArLATOMEHeader (1234+o,1235+o, 24+i, 1122+i,2211+i));
+  }
+    
+  testit (trans1);
+}
+
+
+int main()
+{
+  test1();
+  return 0;
+}
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeader.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeader.h
new file mode 100755
index 000000000000..27fc3b7f513b
--- /dev/null
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeader.h
@@ -0,0 +1,85 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARLATOMEHEADER_H
+#define LARLATOMEHEADER_H
+
+#include "Identifier/HWIdentifier.h"
+#include <vector>
+
+/** 
+@class LArLATOMEHeader
+@brief Holds information from the LATOME Header
+
+@author Pavol Strizenec
+*/
+
+class LArLATOMEHeader
+{
+ public: 
+  
+  /** @brief Constructor with Id*/
+  LArLATOMEHeader(const uint32_t lid);
+
+  /** @brief Constructor with all numbers*/
+  LArLATOMEHeader(const uint32_t sourceid, const uint32_t latomeId, const uint16_t nchan, const uint16_t bcid, const uint32_t l1Id);
+
+  /** @brief Destructor */
+  ~LArLATOMEHeader(){ }
+
+  /** @brief get the source Id */
+  inline uint32_t SourceId() const {return m_sourceId;}
+
+  /** @brief get the latome Id */
+  inline uint32_t LatomeId() const {return m_latomeId;}
+
+  /** @brief get the number of channels*/
+  inline uint16_t NChans() const {return m_nChannels;}
+
+  /** @brief get the Bunch Crossing IDs*/
+  inline uint16_t BCId() const {return m_BCId;}
+
+  /** @brief get the L1 Id */
+  inline uint32_t L1Id() const {return m_l1Id;}
+
+  /** @brief set the LATOME Bunch Crossing ID*/
+  inline void SetBCId(const uint16_t bcid)
+    { m_BCId=bcid; return; }
+
+  /** @brief set the LATOME Channel*/
+  inline void SetNChan(const uint16_t nchan)
+    { m_nChannels=nchan; return; }
+
+  /** @brief set the LATOME SourceId*/
+  inline void SetSourceId(const uint32_t source)
+    { m_sourceId=source; return; }
+
+  /** @brief set the latome Id*/
+  inline void SetLatomeId(const uint32_t source)
+    { m_latomeId=source; return; }
+
+  /** @brief set the latome Id*/
+  inline void SetL1Id(const uint32_t source)
+    { m_l1Id=source; return; }
+
+ private:
+
+  /** @brief LATOME sourceId */
+  uint32_t m_sourceId; 
+
+  /** @brief LATOME Id */
+  uint32_t m_latomeId; 
+
+  /** @brief LATOME channels */
+  uint16_t m_nChannels; 
+
+  /** @brief LATOME BCId from TTC*/
+  uint16_t m_BCId;    
+
+  /** @brief extended LVL1 Id */
+  uint32_t m_l1Id; 
+
+};
+
+#endif
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeaderContainer.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeaderContainer.h
new file mode 100755
index 000000000000..ddc8ac7192ea
--- /dev/null
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArLATOMEHeaderContainer.h
@@ -0,0 +1,36 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARLATOMEHEADERCONTAINER_H
+#define LARLATOMEHEADERCONTAINER_H
+
+#include "AthContainers/DataVector.h"
+#include "AthenaKernel/CLASS_DEF.h"
+#include "LArRawEvent/LArLATOMEHeader.h"
+
+/**
+   @class LArLATOMEHeaderContainer
+   @brief Container class for LArLATOMEHeader
+   * 
+   * @author Pavol Strizenec
+   
+*/
+class LArLATOMEHeaderContainer : public DataVector<LArLATOMEHeader> {
+
+ public :
+ 
+  /** @brief Constructor */
+   LArLATOMEHeaderContainer() : DataVector<LArLATOMEHeader>() { }
+   
+/**
+  * destructor 
+  */
+  virtual ~LArLATOMEHeaderContainer() { }
+
+};
+
+
+CLASS_DEF(LArLATOMEHeaderContainer,1107348203, 1)
+
+#endif
diff --git a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawEventDict.h b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawEventDict.h
index 70280fc789fe..66d925be54e0 100755
--- a/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawEventDict.h
+++ b/LArCalorimeter/LArRawEvent/LArRawEvent/LArRawEventDict.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -9,4 +9,5 @@
 #include "LArRawEvent/LArTTL1.h" 
 #include "LArRawEvent/LArTTL1Container.h" 
 #include "LArRawEvent/LArFebErrorSummary.h" 
+#include "LArRawEvent/LArLATOMEHeaderContainer.h" 
 //#include "LArRawEvent/LArRawChannelContainer.h" 
diff --git a/LArCalorimeter/LArRawEvent/src/LArLATOMEHeader.cxx b/LArCalorimeter/LArRawEvent/src/LArLATOMEHeader.cxx
new file mode 100755
index 000000000000..a56873e4bbad
--- /dev/null
+++ b/LArCalorimeter/LArRawEvent/src/LArLATOMEHeader.cxx
@@ -0,0 +1,12 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArRawEvent/LArLATOMEHeader.h"
+
+//Constructor
+LArLATOMEHeader::LArLATOMEHeader(const uint32_t id):m_sourceId(id),m_latomeId(0),m_nChannels(0),m_BCId(0),m_l1Id(0) {
+} 
+
+LArLATOMEHeader::LArLATOMEHeader(const uint32_t id, const uint32_t latomeid, const uint16_t nchan, const uint16_t bcid, const uint32_t l1id):m_sourceId(id),m_latomeId(latomeid),m_nChannels(nchan),m_BCId(bcid),m_l1Id(l1id) {
+} 
-- 
GitLab


From b3d9146ca87bc9d0b226233931decd177f166414 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 6 Jul 2020 15:15:41 +0000
Subject: [PATCH 057/217] Add ATLAS_CHECK_THREAD_SAFETY to
 InDetTrackingGeometry package. Add ATLAS_NOT_THREAD_SAFE to
 SiLayerBuilder(Cond) classes because static variables are used. Add
 ATLAS_NOT_THREAD_SAFE to methods using thread unsafe
 TrackingGeometry::indexStaticLayers and TrackingVolume::registerColorCode
 methods. Use CxxUtils::CachedUniquePtrT for mutable Trk::Material*
 m_materialProperties in Robust/StagedTrackingGeometryBuilder(Cond) classes. 
 Remove unused Trk::MagneticFieldProperties from
 Robust/StagedTrackingGeometryBuilder(Cond) classes. Remove unnecessary
 mutable keyword from TRT_OverlapDescriptor::m_trtIdHelper.

---
 .../InDetTrackingGeometry/CMakeLists.txt      |  3 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../RobustTrackingGeometryBuilder.h           | 12 ++++----
 .../RobustTrackingGeometryBuilderCond.h       | 10 +++----
 .../InDetTrackingGeometry/SiLayerBuilder.h    |  6 ++--
 .../SiLayerBuilderCond.h                      |  7 +++--
 .../StagedTrackingGeometryBuilder.h           | 12 ++++----
 .../StagedTrackingGeometryBuilderCond.h       | 10 +++----
 .../src/RobustTrackingGeometryBuilder.cxx     | 22 +++++++-------
 .../src/RobustTrackingGeometryBuilderCond.cxx | 20 ++++++-------
 .../src/StagedTrackingGeometryBuilder.cxx     | 29 +++++++++----------
 .../src/StagedTrackingGeometryBuilderCond.cxx | 27 ++++++++---------
 12 files changed, 77 insertions(+), 82 deletions(-)
 create mode 100644 InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/CMakeLists.txt
index 4768766d2369..c64e06224ffd 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( InDetTrackingGeometry )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
+                          Control/CxxUtils
                           DetectorDescription/GeoPrimitives
                           GaudiKernel
                           InnerDetector/InDetDetDescr/InDetIdentifier
@@ -37,7 +38,7 @@ atlas_add_component( InDetTrackingGeometry
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps GeoPrimitives GaudiKernel InDetIdentifier TrkDetDescrInterfaces TrkDetDescrUtils TrkGeometry BeamPipeGeoModelLib StoreGateLib SGtests Identifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry TrkDetDescrGeoModelCnv TrkSurfaces TrkVolumes SubDetectorEnvelopesLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps CxxUtils GeoPrimitives GaudiKernel InDetIdentifier TrkDetDescrInterfaces TrkDetDescrUtils TrkGeometry BeamPipeGeoModelLib StoreGateLib SGtests Identifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry TrkDetDescrGeoModelCnv TrkSurfaces TrkVolumes SubDetectorEnvelopesLib )
 
 # Install files from the package:
 atlas_install_headers( InDetTrackingGeometry )
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..af37e58ef947
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/InDetTrackingGeometry
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
index a6717c6ee910..824463825727 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,8 +13,10 @@
 #include "TrkDetDescrInterfaces/IGeometryBuilder.h"
 #include "TrkDetDescrUtils/BinningType.h"
 #include "TrkGeometry/TrackingVolumeManipulator.h"
-// Gaudi
+// Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/CachedUniquePtr.h"
+// Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 // STL
@@ -37,7 +39,6 @@ namespace Trk {
  class IMagneticFieldTool;
  class Layer;
  class Material;
- class MagneticFieldProperties;
 }
  
 class IEnvelopeDefSvc; 
@@ -117,9 +118,8 @@ namespace InDet {
       bool                                           m_buildBoundaryLayers;      //!< create boundary layers 
       bool                                           m_replaceJointBoundaries;   //!< run with replacement of all joint boundaries 
       
-      // magnetic & material field configuration
-      mutable Trk::Material*                         m_materialProperties;       //!< overal material properties of the ID
-      mutable Trk::MagneticFieldProperties*          m_magneticFieldProperties;  //!< overal mag field properties of the ID
+      // material configuration
+      CxxUtils::CachedUniquePtrT<Trk::Material>      m_materialProperties;       //!< overal material properties of the ID
       // outer envelope        
       double                                         m_outwardsFraction;         //!< defines how much you orient yourself in an outwards way (see above)                                    
       // robust layer indexing                                                   
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
index e92774b734cc..f0f9f84acb95 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
@@ -13,8 +13,10 @@
 #include "TrkDetDescrInterfaces/IGeometryBuilderCond.h"
 #include "TrkDetDescrUtils/BinningType.h"
 #include "TrkGeometry/TrackingVolumeManipulator.h"
-// Gaudi
+// Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/CachedUniquePtr.h"
+// Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 // STL
@@ -37,7 +39,6 @@ namespace Trk {
  class IMagneticFieldTool;
  class Layer;
  class Material;
- class MagneticFieldProperties;
 }
  
 class IEnvelopeDefSvc; 
@@ -117,9 +118,8 @@ namespace InDet {
       bool                                           m_buildBoundaryLayers;      //!< create boundary layers 
       bool                                           m_replaceJointBoundaries;   //!< run with replacement of all joint boundaries 
       
-      // magnetic & material field configuration
-      mutable Trk::Material*                         m_materialProperties;       //!< overal material properties of the ID
-      mutable Trk::MagneticFieldProperties*          m_magneticFieldProperties;  //!< overal mag field properties of the ID
+      // material configuration
+      CxxUtils::CachedUniquePtrT<Trk::Material>      m_materialProperties;       //!< overal material properties of the ID
       // outer envelope        
       double                                         m_outwardsFraction;         //!< defines how much you orient yourself in an outwards way (see above)                                    
       // robust layer indexing                                                   
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
index bebca39af7f0..346544a8ce6d 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -11,6 +11,7 @@
 
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/checker_macros.h"
 // Amg
 #include "GeoPrimitives/GeoPrimitives.h"
 // Trk
@@ -62,7 +63,8 @@ namespace InDet {
 
      @author Andreas.Salzburger@cern.ch
     */
-  class SiLayerBuilder : public AthAlgTool, virtual public Trk::ILayerBuilder {
+  class ATLAS_NOT_THREAD_SAFE SiLayerBuilder : // static member variables are used.
+    public AthAlgTool, virtual public Trk::ILayerBuilder {
     
     public:
     
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
index 62869355d35c..1a839afb3b5f 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
@@ -11,6 +11,8 @@
 
 // Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/checker_macros.h"
+#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 // Amg
 #include "GeoPrimitives/GeoPrimitives.h"
 // Trk
@@ -20,8 +22,6 @@
 #include <vector>
 #include <utility> //for std::pair
 
-#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
-
 class PixelID;
 class SCT_ID;
 
@@ -64,7 +64,8 @@ namespace InDet {
 
      @author Andreas.Salzburger@cern.ch
     */
-  class SiLayerBuilderCond : public AthAlgTool, virtual public Trk::ILayerBuilderCond {
+  class ATLAS_NOT_THREAD_SAFE SiLayerBuilderCond : // static member variables are used.
+    public AthAlgTool, virtual public Trk::ILayerBuilderCond {
     
     public:
     
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
index af02d295f0b0..4c6b835b50ab 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,8 +13,10 @@
 #include "TrkDetDescrInterfaces/IGeometryBuilder.h"
 #include "TrkDetDescrUtils/BinningType.h"
 #include "TrkGeometry/TrackingVolumeManipulator.h"
-// Gaudi
+// Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/CachedUniquePtr.h"
+// Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 // STL
@@ -37,7 +39,6 @@ namespace Trk {
  class IMagneticFieldTool;
  class Layer;
  class Material;
- class MagneticFieldProperties;
 }
  
 class IEnvelopeDefSvc; 
@@ -213,9 +214,8 @@ namespace InDet {
       bool                                           m_buildBoundaryLayers;      //!< create boundary layers 
       bool                                           m_replaceJointBoundaries;   //!< run with replacement of all joint boundaries 
       
-      // magnetic & material field configuration
-      mutable Trk::Material*                         m_materialProperties;       //!< overal material properties of the ID
-      mutable Trk::MagneticFieldProperties*          m_magneticFieldProperties;  //!< overal mag field properties of the ID
+      // material configuration
+      CxxUtils::CachedUniquePtrT<Trk::Material>      m_materialProperties;       //!< overal material properties of the ID
                     
       // robust layer indexing                                                   
       bool                                           m_indexStaticLayers;        //!< forces robust indexing for layers
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
index 7eeddeb3a88f..600faa007fa9 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
@@ -15,8 +15,10 @@
 #include "TrkGeometry/TrackingVolumeManipulator.h"
 //InDet
 #include "StagedTrackingGeometryBuilder.h"
-// Gaudi
+// Athena
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "CxxUtils/CachedUniquePtr.h"
+// Gaudi
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 // STL
@@ -39,7 +41,6 @@ namespace Trk {
  class IMagneticFieldTool;
  class Layer;
  class Material;
- class MagneticFieldProperties;
 }
  
 class IEnvelopeDefSvc; 
@@ -216,9 +217,8 @@ namespace InDet {
       bool                                           m_buildBoundaryLayers;      //!< create boundary layers 
       bool                                           m_replaceJointBoundaries;   //!< run with replacement of all joint boundaries 
       
-      // magnetic & material field configuration
-      mutable Trk::Material*                         m_materialProperties;       //!< overal material properties of the ID
-      mutable Trk::MagneticFieldProperties*          m_magneticFieldProperties;  //!< overal mag field properties of the ID
+      // material configuration
+      CxxUtils::CachedUniquePtrT<Trk::Material>      m_materialProperties;       //!< overal material properties of the ID
                     
       // robust layer indexing                                                   
       bool                                           m_indexStaticLayers;        //!< forces robust indexing for layers
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
index ba003a067fd1..4252dae946b9 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////
@@ -20,12 +20,13 @@
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/TrackingGeometry.h"
-#include "TrkGeometry/MagneticFieldProperties.h"
 #include "TrkGeometry/Material.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkGeometry/CylinderLayer.h"
 #include "TrkGeometry/DiscLayer.h"
 #include "TrkSurfaces/DiscBounds.h"
+// Athena
+#include "CxxUtils/checker_macros.h"
 //Gaudi
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/MsgStream.h"
@@ -41,8 +42,6 @@ InDet::RobustTrackingGeometryBuilder::RobustTrackingGeometryBuilder(const std::s
   m_layerEnvelopeCover(2*Gaudi::Units::mm),
   m_buildBoundaryLayers(true),
   m_replaceJointBoundaries(true),
-  m_materialProperties(0),
-  m_magneticFieldProperties(0),
   m_outwardsFraction(0.75),
   m_indexStaticLayers(true),
   m_namespace("InDet::"),
@@ -78,8 +77,6 @@ InDet::RobustTrackingGeometryBuilder::RobustTrackingGeometryBuilder(const std::s
 // destructor
 InDet::RobustTrackingGeometryBuilder::~RobustTrackingGeometryBuilder()
 {
-  delete m_materialProperties;
-  delete m_magneticFieldProperties;
 }
 
 // Athena standard methods
@@ -125,16 +122,17 @@ StatusCode InDet::RobustTrackingGeometryBuilder::initialize()
    } else
       ATH_MSG_INFO( "Retrieved tool " << m_layerArrayCreator );      
 
-    // Dummy MaterialProerties
-    m_materialProperties = new Trk::Material;
+   // Dummy MaterialProerties
+   m_materialProperties.set(std::make_unique<Trk::Material>());
 
-    ATH_MSG_INFO( "initialize() succesful" );
+   ATH_MSG_INFO( "initialize() succesful" );
     
-  return StatusCode::SUCCESS;
+   return StatusCode::SUCCESS;
 }
 
 
-const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeometry(const Trk::TrackingVolume*) const
+const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeometry ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingGeometry::indexStaticLayers and TrackingVolume::registerColorCode methods are used.
+(const Trk::TrackingVolume*) const
 {
    // only one assumption: 
    // layer builders are ordered in increasing r
@@ -632,7 +630,7 @@ StatusCode InDet::RobustTrackingGeometryBuilder::finalize()
 }
 
 
-const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilder::packVolumeTriple(
+const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilder::packVolumeTriple ATLAS_NOT_THREAD_SAFE ( // Thread unsafe TrackingVolume::registerColorCode method is use.
                                      const std::vector<const Trk::Layer*>& negLayers,
                                      const std::vector<const Trk::Layer*>& centralLayers,
                                      const std::vector<const Trk::Layer*>& posLayers,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
index 421341527794..fc37f3dd3106 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
@@ -20,12 +20,13 @@
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/TrackingGeometry.h"
-#include "TrkGeometry/MagneticFieldProperties.h"
 #include "TrkGeometry/Material.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkGeometry/CylinderLayer.h"
 #include "TrkGeometry/DiscLayer.h"
 #include "TrkSurfaces/DiscBounds.h"
+// Athena
+#include "CxxUtils/checker_macros.h"
 //Gaudi
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/MsgStream.h"
@@ -41,8 +42,6 @@ InDet::RobustTrackingGeometryBuilderCond::RobustTrackingGeometryBuilderCond(cons
   m_layerEnvelopeCover(2*Gaudi::Units::mm),
   m_buildBoundaryLayers(true),
   m_replaceJointBoundaries(true),
-  m_materialProperties(0),
-  m_magneticFieldProperties(0),
   m_outwardsFraction(0.75),
   m_indexStaticLayers(true),
   m_namespace("InDet::"),
@@ -78,8 +77,6 @@ InDet::RobustTrackingGeometryBuilderCond::RobustTrackingGeometryBuilderCond(cons
 // destructor
 InDet::RobustTrackingGeometryBuilderCond::~RobustTrackingGeometryBuilderCond()
 {
-  delete m_materialProperties;
-  delete m_magneticFieldProperties;
 }
 
 // Athena standard methods
@@ -125,16 +122,17 @@ StatusCode InDet::RobustTrackingGeometryBuilderCond::initialize()
    } else
       ATH_MSG_INFO( "Retrieved tool " << m_layerArrayCreator );      
 
-    // Dummy MaterialProerties
-    m_materialProperties = new Trk::Material;
+   // Dummy MaterialProerties
+   m_materialProperties.set(std::make_unique<Trk::Material>());
 
-    ATH_MSG_INFO( "initialize() succesful" );
+   ATH_MSG_INFO( "initialize() succesful" );
     
-  return StatusCode::SUCCESS;
+   return StatusCode::SUCCESS;
 }
 
 
-std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeometryBuilderCond::trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*>) const
+std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeometryBuilderCond::trackingGeometry ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingGeometry::indexStaticLayers method is used.
+(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*>) const
 {
    // only one assumption: 
    // layer builders are ordered in increasing r
@@ -644,7 +642,7 @@ StatusCode InDet::RobustTrackingGeometryBuilderCond::finalize()
 }
 
 
-const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilderCond::packVolumeTriple(
+const Trk::TrackingVolume* InDet::RobustTrackingGeometryBuilderCond::packVolumeTriple ATLAS_NOT_THREAD_SAFE ( // Thread unsafe TrackingVolume::registerColorCode method is used.
                                      const std::vector<const Trk::Layer*>& negLayers,
                                      const std::vector<const Trk::Layer*>& centralLayers,
                                      const std::vector<const Trk::Layer*>& posLayers,
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index e7b97b0f43c1..ff798f6dfb71 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ////////////////////////////////////////////////////////////////////
@@ -20,12 +20,13 @@
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/TrackingGeometry.h"
-#include "TrkGeometry/MagneticFieldProperties.h"
 #include "TrkGeometry/Material.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkGeometry/CylinderLayer.h"
 #include "TrkGeometry/DiscLayer.h"
 #include "TrkSurfaces/DiscBounds.h"
+// Athena
+#include "CxxUtils/checker_macros.h"
 //Gaudi
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/MsgStream.h"
@@ -40,8 +41,6 @@ InDet::StagedTrackingGeometryBuilder::StagedTrackingGeometryBuilder(const std::s
   m_layerEnvelopeCover(2*Gaudi::Units::mm),
   m_buildBoundaryLayers(true),
   m_replaceJointBoundaries(true),
-  m_materialProperties(0),
-  m_magneticFieldProperties(0),
   m_indexStaticLayers(true),
   m_checkForRingLayout(false),
   m_ringTolerance(10*Gaudi::Units::mm),
@@ -76,8 +75,6 @@ InDet::StagedTrackingGeometryBuilder::StagedTrackingGeometryBuilder(const std::s
 // destructor
 InDet::StagedTrackingGeometryBuilder::~StagedTrackingGeometryBuilder()
 {
-  delete m_materialProperties;
-  delete m_magneticFieldProperties;
 }
 
 // Athena standard methods
@@ -115,16 +112,17 @@ StatusCode InDet::StagedTrackingGeometryBuilder::initialize()
    } else
       ATH_MSG_INFO( "Retrieved tool " << m_layerArrayCreator );      
 
-    // Dummy MaterialProerties
-    m_materialProperties = new Trk::Material;
+   // Dummy MaterialProerties
+   m_materialProperties.set(std::make_unique<Trk::Material>());
 
-    ATH_MSG_INFO( "initialize() succesful" );
+   ATH_MSG_INFO( "initialize() succesful" );
     
-  return StatusCode::SUCCESS;
+   return StatusCode::SUCCESS;
 }
 
 
-const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeometry(const Trk::TrackingVolume*) const
+const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeometry ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingGeometry::indexStaticLayers method is used.
+(const Trk::TrackingVolume*) const
 {
    // only one assumption: 
    // layer builders are ordered in increasing r
@@ -287,9 +285,8 @@ StatusCode InDet::StagedTrackingGeometryBuilder::finalize()
 }
 
 
-const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTriple(const InDet::LayerSetup& layerSetup,
-                                                                                  double rMin, double& rMax,
-                                                                                  double zMax, double zPosCentral) const
+const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTriple ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingVolume::registerColorCode method is used.
+(const InDet::LayerSetup& layerSetup, double rMin, double& rMax, double zMax, double zPosCentral) const
 {
 
 
@@ -576,8 +573,8 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createTrackingV
  
                              
 /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
-                                                                                   double innerRadius, double& outerRadius, double extendZ) const
+const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createFlushVolume ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingVolume::registerColorCode method is used.
+(std::vector<InDet::LayerSetup>& layerSetupCache, double innerRadius, double& outerRadius, double extendZ) const
 {
   // the return volume 
   const Trk::TrackingVolume* flushVolume = 0;
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
index 9ef48138b051..c297b686c964 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
@@ -20,12 +20,13 @@
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/TrackingGeometry.h"
-#include "TrkGeometry/MagneticFieldProperties.h"
 #include "TrkGeometry/Material.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkGeometry/CylinderLayer.h"
 #include "TrkGeometry/DiscLayer.h"
 #include "TrkSurfaces/DiscBounds.h"
+//Athena
+#include "CxxUtils/checker_macros.h"
 //Gaudi
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/MsgStream.h"
@@ -41,8 +42,6 @@ InDet::StagedTrackingGeometryBuilderCond::StagedTrackingGeometryBuilderCond(cons
   m_layerEnvelopeCover(2*Gaudi::Units::mm),
   m_buildBoundaryLayers(true),
   m_replaceJointBoundaries(true),
-  m_materialProperties(0),
-  m_magneticFieldProperties(0),
   m_indexStaticLayers(true),
   m_checkForRingLayout(false),
   m_ringTolerance(10*Gaudi::Units::mm),
@@ -77,8 +76,6 @@ InDet::StagedTrackingGeometryBuilderCond::StagedTrackingGeometryBuilderCond(cons
 // destructor
 InDet::StagedTrackingGeometryBuilderCond::~StagedTrackingGeometryBuilderCond()
 {
-  delete m_materialProperties;
-  delete m_magneticFieldProperties;
 }
 
 // Athena standard methods
@@ -116,16 +113,17 @@ StatusCode InDet::StagedTrackingGeometryBuilderCond::initialize()
    } else
       ATH_MSG_INFO( "Retrieved tool " << m_layerArrayCreator );      
 
-    // Dummy MaterialProerties
-    m_materialProperties = new Trk::Material;
+   // Dummy MaterialProerties
+   m_materialProperties.set(std::make_unique<Trk::Material>());
 
-    ATH_MSG_INFO( "initialize() succesful" );
+   ATH_MSG_INFO( "initialize() succesful" );
     
-  return StatusCode::SUCCESS;
+   return StatusCode::SUCCESS;
 }
 
 //FIXME: ctx, tVolPair not used yet, range not created
-std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeometryBuilderCond::trackingGeometry(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> /*tVolPair*/) const
+std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::StagedTrackingGeometryBuilderCond::trackingGeometry ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingGeometry::indexStaticLayers method is used.
+(const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> /*tVolPair*/) const
 {
    // only one assumption: 
    // layer builders are ordered in increasing r
@@ -290,9 +288,8 @@ StatusCode InDet::StagedTrackingGeometryBuilderCond::finalize()
 }
 
 
-const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::packVolumeTriple(const InDet::LayerSetup& layerSetup,
-                                                                                  double rMin, double& rMax,
-                                                                                  double zMax, double zPosCentral) const
+const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::packVolumeTriple ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingVolume::registerColorCode method is used.
+(const InDet::LayerSetup& layerSetup, double rMin, double& rMax, double zMax, double zPosCentral) const
 {
 
 
@@ -579,8 +576,8 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createTrack
  
                              
 /** Private helper method to flush the cache into the id volumes - return volume is the one to be provided */
-const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createFlushVolume(std::vector<InDet::LayerSetup>& layerSetupCache,
-                                                                                   double innerRadius, double& outerRadius, double extendZ) const
+const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createFlushVolume ATLAS_NOT_THREAD_SAFE // Thread unsafe TrackingVolume::registerColorCode method is used.
+(std::vector<InDet::LayerSetup>& layerSetupCache, double innerRadius, double& outerRadius, double extendZ) const
 {
   // the return volume 
   const Trk::TrackingVolume* flushVolume = 0;
-- 
GitLab


From 8a36097f11083a4afd9d3dc5935775d984403d32 Mon Sep 17 00:00:00 2001
From: Benjamin Michael Wynne <b.m.wynne@ed.ac.uk>
Date: Mon, 6 Jul 2020 15:21:23 +0000
Subject: [PATCH 058/217] Make some T0 conditions handles optional

---
 .../python/MuonTopCondAlgConfigRUN2.py        |  3 +++
 .../MuonCondAlg/src/CscCondDbAlg.cxx          |  6 +++---
 .../MuonConfig/python/MuonCondAlgConfig.py    |  3 +++
 .../python/HLTMenuConfig/Muon/MuonSetup.py    | 19 -------------------
 4 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/python/MuonTopCondAlgConfigRUN2.py b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/python/MuonTopCondAlgConfigRUN2.py
index 9de613a942a8..89b01c633b29 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/python/MuonTopCondAlgConfigRUN2.py
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/python/MuonTopCondAlgConfigRUN2.py
@@ -70,6 +70,7 @@ class RpcCondDbAlg(CfgMgr.RpcCondDbAlg):
 
 class CscCondDbAlg(CfgMgr.CscCondDbAlg):
     def __init__(self,name="CscCondDbAlg",**kwargs):
+        kwargs['ReadKey_HV'] = '' # Never used at present
         if athenaCommonFlags.isOnline:
             kwargs['isOnline'  ] = True  # COOL folders not available online
             kwargs['isData'    ] = True
@@ -79,6 +80,8 @@ class CscCondDbAlg(CfgMgr.CscCondDbAlg):
             kwargs['ReadKey_PS'] = '/CSC/PSLOPE'
             kwargs['ReadKey_RM'] = '/CSC/RMS'
             kwargs['ReadKey_ST'] = '/CSC/STAT'
+            kwargs['ReadKey_TB'] = ''
+            kwargs['ReadKey_TP'] = ''
         else:    
             kwargs['isOnline'] = False # COOL folders not available online
             if globalflags.DataSource != 'data':
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
index acf4c0857987..8f14ce708b64 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
@@ -40,11 +40,11 @@ CscCondDbAlg::initialize(){
     ATH_CHECK(m_readKey_folder_da_f001   .initialize());
     ATH_CHECK(m_readKey_folder_da_noise  .initialize());
     ATH_CHECK(m_readKey_folder_da_ped    .initialize());
-    if (m_pslopeFromDB) ATH_CHECK(m_readKey_folder_da_pslope .initialize());
+    ATH_CHECK(m_readKey_folder_da_pslope .initialize(m_pslopeFromDB));
     ATH_CHECK(m_readKey_folder_da_rms    .initialize());
     ATH_CHECK(m_readKey_folder_da_status .initialize());
-    ATH_CHECK(m_readKey_folder_da_t0base .initialize());
-    ATH_CHECK(m_readKey_folder_da_t0phase.initialize());
+    ATH_CHECK(m_readKey_folder_da_t0base .initialize(!m_readKey_folder_da_t0base.empty()));
+    ATH_CHECK(m_readKey_folder_da_t0phase.initialize(!m_readKey_folder_da_t0phase.empty()));
 
     if(m_condSvc->regHandle(this, m_writeKey).isFailure()) {
       ATH_MSG_FATAL("Unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
diff --git a/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py b/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
index b4b41b6759e8..ab3b1e22366c 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
@@ -98,6 +98,7 @@ def CscCondDbAlgCfg(flags, **kwargs):
     result  = ComponentAccumulator()
     folders = ["/CSC/FTHOLD", "/CSC/NOISE", "/CSC/PED", "/CSC/PSLOPE", "/CSC/RMS", "/CSC/STAT", "/CSC/T0BASE", "/CSC/T0PHASE"]
     scheme  = "CSC_OFL"
+    kwargs['ReadKey_HV'] = '' # Never used at present 
     if flags.Common.isOnline:
         kwargs["isOnline"  ] = True
         kwargs['isData'    ] = True
@@ -107,6 +108,8 @@ def CscCondDbAlgCfg(flags, **kwargs):
         kwargs['ReadKey_PS'] = '/CSC/PSLOPE'
         kwargs['ReadKey_RM'] = '/CSC/RMS'
         kwargs['ReadKey_ST'] = '/CSC/STAT'
+        kwargs['ReadKey_TB'] = ''
+        kwargs['ReadKey_TP'] = ''
         folders = ["/CSC/ONL/FTHOLD", "/CSC/ONL/NOISE", "/CSC/ONL/PED", "/CSC/ONL/PSLOPE", "/CSC/ONL/RMS", "/CSC/ONL/STAT"]
         scheme  = "CSC_ONL"
     else:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index a97834efec06..a741b6e222df 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -77,15 +77,6 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False):
   if MuonGeometryFlags.hasCSC():
     muDataPrepVDV.DataObjects += [( 'CscStripPrepDataCollection_Cache' , MuonPrdCacheNames.CscStripCache )]
 
-    # Only load these objects if they aren't available in conddb
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( "/CSC/DCS/LAYERSTATE" ):
-      muDataPrepVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/DCS/LAYERSTATE' )]
-    if not conddb.folderRequested( "/CSC/T0PHASE" ):
-      muDataPrepVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )]
-    if not conddb.folderRequested( "/CSC/T0BASE" ):
-      muDataPrepVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )]
-
   viewAlgs_MuonPRD.append( muDataPrepVDV )
 
 
@@ -347,16 +338,6 @@ def muFastRecoSequence( RoIs, doFullScanID = False ):
                                ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                ( 'DataVector< LVL1::RecMuonRoI >' , 'StoreGateSvc+HLT_RecMURoIs' )]
 
-  if MuonGeometryFlags.hasCSC():
-    # Only load these objects if they aren't available in conddb
-    from IOVDbSvc.CondDB import conddb
-    if not conddb.folderRequested( "/CSC/DCS/LAYERSTATE" ):
-      muFastRecoVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/DCS/LAYERSTATE' )]
-    if not conddb.folderRequested( "/CSC/T0PHASE" ):
-      muFastRecoVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' )]
-    if not conddb.folderRequested( "/CSC/T0BASE" ):
-      muFastRecoVDV.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' )]
-
   muFastRecoSequence += muFastRecoVDV
 
   if MuonGeometryFlags.hasCSC():
-- 
GitLab


From 500b11ffa03a9fee8a3c37702125f03bbd77ea02 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 6 Jul 2020 15:34:11 +0000
Subject: [PATCH 059/217] change meaning of bins to start always from eta=0. ,
 and introduce more complex job options for test

---
 .../InDetEtaDependentCutsSvc.h                | 12 ++++----
 .../InDetEtaDependentCutsTestJobOpts.txt      |  2 ++
 .../src/InDetEtaDependentCutsSvc.cxx          | 29 ++++++-------------
 .../test/InDetEtaDependentCutsSvc_test.cxx    |  9 +-----
 .../IInDetEtaDependentCutsSvc.h               |  7 ++---
 5 files changed, 20 insertions(+), 39 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/InDetEtaDependentCuts/InDetEtaDependentCutsSvc.h b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/InDetEtaDependentCuts/InDetEtaDependentCutsSvc.h
index b9105c840ebd..11e8edb932bd 100644
--- a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/InDetEtaDependentCuts/InDetEtaDependentCutsSvc.h
+++ b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/InDetEtaDependentCuts/InDetEtaDependentCutsSvc.h
@@ -40,12 +40,6 @@ namespace InDet {
       void getValue(const InDet::CutName cutName, std::vector < double >& cut) override final;
       void getValue(const InDet::CutName cutName,    std::vector < int >& cut) override final;
       
-      template <class T>
-      T getValueAtEta(const std::vector< T > cuts, const double eta) const;
-    
-      template <class T>    
-      void getValue(const InDet::CutName cutName, T& cut, const double eta);
-      
       double  getMaxEta() const override final;
       double  getMinPtAtEta           (const double eta) const override final;
       double  getMaxZImpactAtEta      (const double eta) const override final;
@@ -64,10 +58,14 @@ namespace InDet {
     // Private data: 
     /////////////////////////////////////////////////////////////////// 
     private: 
+      template <class T>
+      T getValueAtEta(const std::vector< T > cuts, const double eta) const{
+        return cuts.at(getIndexByEta(eta)); //will throw a range error if eta > maxEta
+      }
       
       int getIndexByEta(const double eta) const;
       
-      DoubleArrayProperty   m_etaBins              {this, "etaBins"             , {0.0, 4.0}, "eta bins (highest eta is maxEta)"         };
+      DoubleArrayProperty   m_etaBins              {this, "etaBins"             , {4.0}     , "eta bins (highest eta is maxEta)"         };
       DoubleArrayProperty   m_minPT                {this, "minPT"               , {900.0}   , "min pT [MeV]"                             };
       DoubleArrayProperty   m_maxPrimaryImpact     {this, "maxPrimaryImpact"    , {2.0}     , "max Rphi IP (primaries) [mm]"             };
       DoubleArrayProperty   m_maxZImpact           {this, "maxZImpact"          , {200.0}   , "max Z IP [mm]"                            };
diff --git a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/share/InDetEtaDependentCutsTestJobOpts.txt b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/share/InDetEtaDependentCutsTestJobOpts.txt
index a6c30adcc5e2..d6ff657f1a09 100644
--- a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/share/InDetEtaDependentCutsTestJobOpts.txt
+++ b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/share/InDetEtaDependentCutsTestJobOpts.txt
@@ -1,3 +1,5 @@
 ApplicationMgr.OutputLevel = 5;
 ApplicationMgr.CreateSvc += { "InDet::InDetEtaDependentCutsSvc" };
+InDet::InDetEtaDependentCutsSvc.etaBins = {1.1, 2.1, 4.0};
+InDet::InDetEtaDependentCutsSvc.minPt = {100., 900., 300.};
 MessageSvc.OutputLevel = 5;
diff --git a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/src/InDetEtaDependentCutsSvc.cxx b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/src/InDetEtaDependentCutsSvc.cxx
index 7b6bd2af7e66..bac646d508bd 100644
--- a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/src/InDetEtaDependentCutsSvc.cxx
+++ b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/src/InDetEtaDependentCutsSvc.cxx
@@ -45,7 +45,7 @@ namespace InDet {
     StatusCode 
     InDetEtaDependentCutsSvc::initialize() {
       ATH_MSG_DEBUG ("Initializing " << name() << "...");
-      if ((m_etaBins.size()-1) <= 0) {
+      if (m_etaBins.empty()) {
         ATH_MSG_ERROR( "Wrong initialisation of eta bins. Check the eta bin values in " << name() );
         return StatusCode::FAILURE;
       }
@@ -58,7 +58,7 @@ namespace InDet {
       
       using setOfCuts = std::variant< std::reference_wrapper<std::vector <double>>, std::reference_wrapper<std::vector <int>> >;
       
-      std::vector < setOfCuts > allCuts = { m_etaWidthBrem.value()        , 
+      std::vector < setOfCuts> allCuts    { m_etaWidthBrem.value()        , 
                                             m_maxdImpactSSSSeeds.value()  ,
                                             m_maxPrimaryImpact.value()    ,
                                             m_maxZImpact.value()          ,
@@ -80,7 +80,7 @@ namespace InDet {
                                             m_nWeightedClustersMin.value()};
       
       // checking if the set of cuts makes sense
-      size_t noOfEtaBins = m_etaBins.size()-1;
+      size_t noOfEtaBins = m_etaBins.size();
                                             
       for (setOfCuts& cuts : allCuts) {
         auto sCode = std::visit([noOfEtaBins] (auto & testingCuts) -> StatusCode { 
@@ -105,7 +105,7 @@ namespace InDet {
       
       // printing all the cuts
       ATH_MSG_DEBUG ("--- Dynamic cuts ---");
-      ATH_MSG_DEBUG ("Eta bins (size=" << (m_etaBins.size()-1) << "): " << m_etaBins);
+      ATH_MSG_DEBUG ("Eta bins (size=" << (m_etaBins.size()) << "): " << m_etaBins);
       ATH_MSG_DEBUG ("etaWidthBrem: " << m_etaWidthBrem);
       ATH_MSG_DEBUG ("maxdImpactSSSSeeds: " << m_maxdImpactSSSSeeds);
       ATH_MSG_DEBUG ("maxDoubleHoles: " << m_maxDoubleHoles);
@@ -138,15 +138,15 @@ namespace InDet {
       return StatusCode::SUCCESS;
     }
 
-    int InDetEtaDependentCutsSvc::getIndexByEta(const double eta) const {
+    int 
+    InDetEtaDependentCutsSvc::getIndexByEta(const double eta) const {
       const double absEta = std::abs(eta);
       if (absEta > m_etaBins.value().back()) {
         ATH_MSG_ERROR("Requesting cut value for eta outside expected range!! ");
         return -1;
       }
-      
       const auto pVal =  std::lower_bound(m_etaBins.value().begin(), m_etaBins.value().end(), absEta);
-      const int bin = std::distance(m_etaBins.value().begin(), pVal) - 1;
+      const int bin = std::distance(m_etaBins.value().begin(), pVal);
       ATH_MSG_DEBUG("Checking (abs(eta)/bin) = (" << absEta << "," << bin << ")");
       return bin;
     }
@@ -154,7 +154,7 @@ namespace InDet {
 
     void InDetEtaDependentCutsSvc::getValue(const InDet::CutName cutName, std::vector < double >& cuts) {
       // getting the number of eta bins
-      size_t noOfEtaBins = m_etaBins.size()-1;
+      size_t noOfEtaBins = m_etaBins.size();
       
       // resize the cuts vector before setting it
       cuts.resize(noOfEtaBins);
@@ -209,7 +209,7 @@ namespace InDet {
     void InDetEtaDependentCutsSvc::getValue(const InDet::CutName cutName,    std::vector < int >& cuts) {
 
       // getting the number of eta bins
-      size_t noOfEtaBins = m_etaBins.size()-1;
+      size_t noOfEtaBins = m_etaBins.size();
       
       // resize the cuts vector before setting it
       cuts.resize(noOfEtaBins);
@@ -265,17 +265,6 @@ namespace InDet {
       }
     }
   
-    template <class T>
-    T InDetEtaDependentCutsSvc::getValueAtEta(const std::vector< T > cuts, const double eta) const {
-     return cuts.at(getIndexByEta(eta));
-    }
-    
-    template <class T>
-    void InDetEtaDependentCutsSvc::getValue(InDet::CutName cutName, T& cut, double eta) {
-      std::vector < T > cuts; 
-      getValue(cutName, cuts);
-      cut = getValueAtEta< T >(cuts, eta);
-    }
     
     double  InDetEtaDependentCutsSvc::getMaxEta() const {
       return m_etaBins.value().back();
diff --git a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/InDetEtaDependentCutsSvc_test.cxx b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/InDetEtaDependentCutsSvc_test.cxx
index 80f38b69790f..4b56519fd0e8 100644
--- a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/InDetEtaDependentCutsSvc_test.cxx
+++ b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/InDetEtaDependentCutsSvc_test.cxx
@@ -55,8 +55,7 @@ BOOST_AUTO_TEST_SUITE(EtaDependentCutsSvcTest)
     BOOST_TEST(idEDCSvc->interfaceID()==testId);
   }
   
-  //two failures related to use of template getValue() with the eta argument
-  BOOST_AUTO_TEST_CASE(publicMethods, * utf::expected_failures(2)){
+  BOOST_AUTO_TEST_CASE(publicMethods){
     ServiceHandle<IInDetEtaDependentCutsSvc> idEDCSvc ("InDet::InDetEtaDependentCutsSvc", "test");
     //for default constructed service, and choosing a nominal (valid) eta
     const double eta=2.0;
@@ -101,12 +100,6 @@ BOOST_AUTO_TEST_SUITE(EtaDependentCutsSvcTest)
     BOOST_CHECK_NO_THROW(idEDCSvc->getValue(dblCutEnum, intCutReturnValue));//doesn't throw
     //
     BOOST_TEST(intCutReturnValue.at(0) == 9);//i.e. should remain unchanged
-    //something wrong here, needs fixing in the code?
-    double etaBinCut{1.};
-    // T getValueAtEta(const std::vector< T > cuts, const double eta)
-    BOOST_CHECK_NO_THROW(idEDCSvc->getValue(InDet::CutName::etaBins, etaBinCut, eta));
-    BOOST_TEST( etaBinCut == 0.0); //failure
-    BOOST_CHECK_THROW(idEDCSvc->getValue(InDet::CutName::etaBins, etaBinCut, invalidEta), std::out_of_range); //failure
     
   }
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/IInDetEtaDependentCutsSvc.h b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/IInDetEtaDependentCutsSvc.h
index 2d405b4c6dfd..fea6077e809f 100644
--- a/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/IInDetEtaDependentCutsSvc.h
+++ b/InnerDetector/InDetRecTools/InDetRecToolInterfaces/InDetRecToolInterfaces/IInDetEtaDependentCutsSvc.h
@@ -16,7 +16,8 @@ namespace InDet {
     maxHoles, maxPixelHoles, maxPrimaryImpact, maxSctHoles, 
     maxShared, maxZImpact, minClusters, minPixelHits, minPT,
     minPTBrem, minSiNotShared, maxHolesGapPattern, maxHolesPattern,
-    nWeightedClustersMin, phiWidthBrem, Xi2max, Xi2maxNoAdd
+    nWeightedClustersMin, phiWidthBrem, Xi2max, Xi2maxNoAdd,
+    numberOfCutCategories
   };
   
   class IInDetEtaDependentCutsSvc : virtual public IInterface {
@@ -33,10 +34,8 @@ namespace InDet {
     virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIF)=0;
     
     virtual void getValue(const InDet::CutName cutName, std::vector < double >& cut) = 0;
-    virtual void getValue(const InDet::CutName cutName,    std::vector < int >& cut) = 0;
+    virtual void getValue(const InDet::CutName cutName, std::vector < int >& cut) = 0;
 
-    template <class T>    
-      void getValue(const InDet::CutName /*cutName*/, T& /*cut*/, const double /*eta*/) {}
     
     virtual double  getMaxEta() const                         = 0;
     virtual double  getMinPtAtEta           (const double eta) const = 0;
-- 
GitLab


From cf06c92b8673b71e0a5b76b810657e44e6a273cf Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 6 Jul 2020 15:38:51 +0000
Subject: [PATCH 060/217] TrigVertexFitter: Package cleanup

- move headers to src directroy
- cleanup cmake dependencies
- delete README (same content as in doc/)
- delete obsolete job options file
---
 .../TrigTools/IDScanHitFilter/CMakeLists.txt  |  15 +-
 .../TrigTools/IDScanZFinder/CMakeLists.txt    |  14 +-
 Trigger/TrigTools/TrigIDUtils/CMakeLists.txt  |  16 +-
 .../TrigInDetPattRecoTools/CMakeLists.txt     |  16 +-
 .../TrigInDetToolInterfaces/CMakeLists.txt    |  23 +-
 .../TrigParticleTable.h                       |  25 ++-
 .../ATLAS_CHECK_THREAD_SAFETY                 |   0
 .../TrigInDetTrackExtrapolator/CMakeLists.txt |  23 +-
 ...jobOfragment_TrigInDetTrackExtrapolator.py |  14 --
 .../src/TrigInDetTrackExtrapolator.cxx        |   2 +-
 .../TrigInDetTrackExtrapolator.h              |   0
 .../TrigInDetTrackExtrapolator_entries.cxx    |   2 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../TrigOnlineSpacePointTool/CMakeLists.txt   |  40 +---
 .../ATLAS_CHECK_THREAD_SAFETY                 |   0
 .../TrigTools/TrigVertexFitter/CMakeLists.txt |  23 +-
 Trigger/TrigTools/TrigVertexFitter/README     | 199 ------------------
 .../share/jobOfragment_TrigVertexFitter.py    |   6 -
 .../src/TrigL2VertexFitter.cxx                |   2 +-
 .../TrigL2VertexFitter.h                      |   0
 .../src/TrigPrimaryVertexFitter.cxx           |   4 +-
 .../TrigPrimaryVertexFitter.h                 |   0
 .../src/TrigPrimaryVertexTrack.cxx            |   2 +-
 .../TrigPrimaryVertexTrack.h                  |   0
 .../TrigVertexFitter/src/TrigVertexFitter.cxx |   2 +-
 .../TrigVertexFitter.h                        |   0
 .../src/TrigVertexingTool.cxx                 |   2 +-
 .../TrigVertexingTool.h                       |   0
 .../components/TrigVertexFitter_entries.cxx   |   8 +-
 29 files changed, 42 insertions(+), 397 deletions(-)
 rename Trigger/TrigTools/TrigInDetTrackExtrapolator/{TrigInDetTrackExtrapolator => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 delete mode 100755 Trigger/TrigTools/TrigInDetTrackExtrapolator/share/jobOfragment_TrigInDetTrackExtrapolator.py
 rename Trigger/TrigTools/TrigInDetTrackExtrapolator/{TrigInDetTrackExtrapolator => src}/TrigInDetTrackExtrapolator.h (100%)
 mode change 100755 => 100644
 create mode 100644 Trigger/TrigTools/TrigOnlineSpacePointTool/ATLAS_CHECK_THREAD_SAFETY
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 delete mode 100755 Trigger/TrigTools/TrigVertexFitter/README
 delete mode 100755 Trigger/TrigTools/TrigVertexFitter/share/jobOfragment_TrigVertexFitter.py
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => src}/TrigL2VertexFitter.h (100%)
 mode change 100755 => 100644
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => src}/TrigPrimaryVertexFitter.h (100%)
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => src}/TrigPrimaryVertexTrack.h (100%)
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => src}/TrigVertexFitter.h (100%)
 mode change 100755 => 100644
 rename Trigger/TrigTools/TrigVertexFitter/{TrigVertexFitter => src}/TrigVertexingTool.h (100%)
 mode change 100755 => 100644

diff --git a/Trigger/TrigTools/IDScanHitFilter/CMakeLists.txt b/Trigger/TrigTools/IDScanHitFilter/CMakeLists.txt
index 3b7ddeae822c..215a0e7e35fa 100644
--- a/Trigger/TrigTools/IDScanHitFilter/CMakeLists.txt
+++ b/Trigger/TrigTools/IDScanHitFilter/CMakeLists.txt
@@ -1,20 +1,9 @@
-################################################################################
-# Package: IDScanHitFilter
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( IDScanHitFilter )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          DetectorDescription/IRegionSelector )
-
 # Component(s) in the package:
 atlas_add_component( IDScanHitFilter
                      src/*.cxx src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel TrigInDetEvent TrigSteeringEvent IRegionSelector )
+                     LINK_LIBRARIES AthenaBaseComps CxxUtils GaudiKernel IRegionSelector TrigInDetEvent TrigInDetToolInterfacesLib )
diff --git a/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt b/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
index 2ccca418ca61..8870ce53d8ca 100644
--- a/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
+++ b/Trigger/TrigTools/IDScanZFinder/CMakeLists.txt
@@ -1,18 +1,8 @@
-################################################################################
-# Package: IDScanZFinder
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( IDScanZFinder )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaBaseComps
-                          DetectorDescription/IRegionSelector
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigTools/TrigInDetToolInterfaces )
-
 # External dependencies:
 find_package( CLHEP )
 
@@ -20,4 +10,4 @@ find_package( CLHEP )
 atlas_add_component( IDScanZFinder
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IRegionSelector GaudiKernel TrigInDetEvent )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel IRegionSelector TrigInDetEvent TrigInDetToolInterfacesLib )
diff --git a/Trigger/TrigTools/TrigIDUtils/CMakeLists.txt b/Trigger/TrigTools/TrigIDUtils/CMakeLists.txt
index 82cb86e6986d..9865b1368cf4 100644
--- a/Trigger/TrigTools/TrigIDUtils/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigIDUtils/CMakeLists.txt
@@ -1,22 +1,10 @@
-################################################################################
-# Package: TrigIDUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigIDUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Control/StoreGate
-                          InnerDetector/InDetConditions/PixelConditionsTools
-                          InnerDetector/InDetDetDescr/InDetIdentifier )
-
 # Component(s) in the package:
 atlas_add_component( TrigIDUtils
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES GaudiKernel AthenaBaseComps StoreGateLib SGtests InDetIdentifier )
-
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel Identifier InDetIdentifier StoreGateLib )
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
index 7763aa07e03b..0d9fb20b5946 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
@@ -1,21 +1,11 @@
-################################################################################
-# Package: TrigInDetPattRecoTools
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetPattRecoTools )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigInDetPattRecoEvent
-                          PRIVATE
-                          DetectorDescription/IRegionSelector )
-
 # Component(s) in the package:
 atlas_add_library( TrigInDetPattRecoTools
                    src/*.cxx
                    PUBLIC_HEADERS TrigInDetPattRecoTools
-                   LINK_LIBRARIES TrigInDetEvent TrigInDetPattRecoEvent
-                   PRIVATE_LINK_LIBRARIES IRegionSelector )
-
+                   LINK_LIBRARIES TrigInDetPattRecoEvent
+                   PRIVATE_LINK_LIBRARIES IRegionSelector TrigInDetEvent )
diff --git a/Trigger/TrigTools/TrigInDetToolInterfaces/CMakeLists.txt b/Trigger/TrigTools/TrigInDetToolInterfaces/CMakeLists.txt
index 163760df14d2..d15db0734e47 100644
--- a/Trigger/TrigTools/TrigInDetToolInterfaces/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetToolInterfaces/CMakeLists.txt
@@ -1,30 +1,11 @@
-################################################################################
-# Package: TrigInDetToolInterfaces
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetToolInterfaces )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/IRegionSelector
-                          DetectorDescription/Identifier
-                          Event/ByteStreamData
-                          GaudiKernel
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Tracking/TrkEvent/TrkTrack
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigInDetPattRecoEvent
-                          Trigger/TrigEvent/TrigSteeringEvent )
-
-# External dependencies:
-find_package( CLHEP )
-
 # Component(s) in the package:
 atlas_add_library( TrigInDetToolInterfacesLib
                    TrigInDetToolInterfaces/*.h
                    INTERFACE
                    PUBLIC_HEADERS TrigInDetToolInterfaces
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ByteStreamData GaudiKernel IRegionSelector Identifier InDetPrepRawData TrigInDetEvent TrigInDetPattRecoEvent TrigSteeringEvent TrkEventPrimitives TrkTrack )
+                   LINK_LIBRARIES LINK_LIBRARIES ByteStreamData GaudiKernel IRegionSelector Identifier InDetPrepRawData TrigInDetEvent TrigInDetPattRecoEvent TrkEventPrimitives TrkTrack )
diff --git a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/TrigParticleTable.h b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/TrigParticleTable.h
index 6a0769f3a62d..2e84d1a8edfd 100755
--- a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/TrigParticleTable.h
+++ b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/TrigParticleTable.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -11,8 +11,8 @@
 #ifndef __TRIG_PARTICLE_TABLE__
 #define __TRIG_PARTICLE_TABLE__
 
-#include <vector>
-#include "CLHEP/Units/SystemOfUnits.h"
+#include <array>
+#include "GaudiKernel/SystemOfUnits.h"
 
 namespace TrigVtx
 {
@@ -28,16 +28,15 @@ namespace TrigVtx
   
   struct TrigParticleMasses 
   {
-    std::vector<double> mass;   
-    TrigParticleMasses()
-    {
-      mass.push_back(0.5109989*CLHEP::MeV); // electron mass
-      mass.push_back(105.65837*CLHEP::MeV); // muon mass
-      mass.push_back(139.57019*CLHEP::MeV); // charged pion mass
-      mass.push_back(493.67700*CLHEP::MeV); // charged kaon mass
-      mass.push_back(938.27203*CLHEP::MeV); // proton mass
-      mass.push_back(0.*CLHEP::MeV); // photon mass
-    }    
+    constexpr TrigParticleMasses() = default;
+    std::array<double,6> mass{
+      0.5109989*Gaudi::Units::MeV, // electron mass
+      105.65837*Gaudi::Units::MeV, // muon mass
+      139.57019*Gaudi::Units::MeV, // charged pion mass
+      493.67700*Gaudi::Units::MeV, // charged kaon mass
+      938.27203*Gaudi::Units::MeV, // proton mass
+      0                            // photon mass
+    };
   };
 }
 
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigInDetTrackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigInDetTrackExtrapolator/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/CMakeLists.txt b/Trigger/TrigTools/TrigInDetTrackExtrapolator/CMakeLists.txt
index cd830a7cae42..f64dde392bd6 100644
--- a/Trigger/TrigTools/TrigInDetTrackExtrapolator/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetTrackExtrapolator/CMakeLists.txt
@@ -1,29 +1,10 @@
-################################################################################
-# Package: TrigInDetTrackExtrapolator
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetTrackExtrapolator )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          PRIVATE
-                          MagneticField/MagFieldInterfaces
-                          Tracking/TrkFitter/TrkDistributedKalmanFilter
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # Component(s) in the package:
 atlas_add_component( TrigInDetTrackExtrapolator
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel TrigInDetEvent TrigSteeringEvent MagFieldInterfaces TrkDistributedKalmanFilterLib TrigTimeAlgsLib )
-
-# Install files from the package:
-atlas_install_headers( TrigInDetTrackExtrapolator )
-atlas_install_joboptions( share/*.py )
-
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MagFieldInterfaces TrigInDetEvent TrigInDetToolInterfacesLib TrigSteeringEvent TrigTimeAlgsLib TrkDistributedKalmanFilterLib )
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/share/jobOfragment_TrigInDetTrackExtrapolator.py b/Trigger/TrigTools/TrigInDetTrackExtrapolator/share/jobOfragment_TrigInDetTrackExtrapolator.py
deleted file mode 100755
index 0b16905bcbe0..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackExtrapolator/share/jobOfragment_TrigInDetTrackExtrapolator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-
-from TrigInDetTrackExtrapolator.TrigInDetTrackExtrapolatorConf import TrigInDetTrackExtrapolator
-
-TrigExtrap = TrigInDetTrackExtrapolator(name="ConfiguredTrigInDetTrackExtrapolator",
-                                        UseAthenaFieldService=True,
-                                        MinPt=1000.0)
-
-ToolSvc+=TrigExtrap
-
-
-
-
-
-
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.cxx b/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.cxx
index 29b6906884ac..1eacb36dc435 100755
--- a/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.cxx
@@ -28,7 +28,7 @@
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
 #include "TrigInDetToolInterfaces/ITrigInDetTrackExtrapolator.h"
-#include "TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator.h"
+#include "TrigInDetTrackExtrapolator.h"
 
 TrigInDetTrackExtrapolator::TrigInDetTrackExtrapolator(const std::string& t, 
 						       const std::string& n,
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator.h b/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator.h
rename to Trigger/TrigTools/TrigInDetTrackExtrapolator/src/TrigInDetTrackExtrapolator.h
diff --git a/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/components/TrigInDetTrackExtrapolator_entries.cxx b/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/components/TrigInDetTrackExtrapolator_entries.cxx
index 35ca83b0c7ff..0e5eaa7af6c9 100644
--- a/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/components/TrigInDetTrackExtrapolator_entries.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackExtrapolator/src/components/TrigInDetTrackExtrapolator_entries.cxx
@@ -1,4 +1,4 @@
-#include "TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator.h"
+#include "../TrigInDetTrackExtrapolator.h"
 
 DECLARE_COMPONENT( TrigInDetTrackExtrapolator )
 
diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigOnlineSpacePointTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..c68db758f06e
--- /dev/null
+++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigTools/TrigOnlineSpacePointTool
diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/CMakeLists.txt b/Trigger/TrigTools/TrigOnlineSpacePointTool/CMakeLists.txt
index 55ae15564878..2378cc2ae2a9 100644
--- a/Trigger/TrigTools/TrigOnlineSpacePointTool/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/CMakeLists.txt
@@ -1,46 +1,10 @@
-################################################################################
-# Package: TrigOnlineSpacePointTool
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigOnlineSpacePointTool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaBaseComps
-                          DetectorDescription/IRegionSelector
-                          DetectorDescription/Identifier
-                          Event/ByteStreamData
-                          InnerDetector/InDetConditions/InDetByteStreamErrors
-                          InnerDetector/InDetConditions/InDetCondTools
-                          InnerDetector/InDetConditions/PixelConditionsTools
-                          InnerDetector/InDetConditions/SCT_ConditionsTools
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetDetDescr/InDetReadoutGeometry
-			  InnerDetector/InDetDetDescr/PixelReadoutGeometry
-			  InnerDetector/InDetDetDescr/SCT_ReadoutGeometry
-                          InnerDetector/InDetDetDescr/PixelCabling
-                          InnerDetector/InDetDetDescr/SCT_Cabling
-                          InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv
-                          InnerDetector/InDetRawEvent/InDetRawData
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          InnerDetector/InDetRecTools/SiClusterizationTool
-                          Tracking/TrkEvent/TrkPrepRawData
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTools/TrigSiSpacePointTool
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          Control/StoreGate
-                          DetectorDescription/AtlasDetDescr
-                          Event/ByteStreamCnvSvcBase
-                          InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv
-                          Tracking/TrkEvent/TrkSpacePoint
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # Component(s) in the package:
 atlas_add_component( TrigOnlineSpacePointTool
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps IRegionSelector InDetByteStreamErrors ByteStreamData ByteStreamData_test GaudiKernel InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry SCT_CablingLib InDetRawData InDetPrepRawData SiClusterizationToolLib TrkPrepRawData TrigInDetEvent TrigSteeringEvent AtlasDetDescr ByteStreamCnvSvcBaseLib SCT_ConditionsData TrkSpacePoint TrigTimeAlgsLib PixelCablingLib TrigInDetToolInterfacesLib )
-
+                     LINK_LIBRARIES AthenaBaseComps AtlasDetDescr BeamSpotConditionsData GaudiKernel IRegionSelector InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry StoreGateLib TrigInDetEvent TrigInDetToolInterfacesLib TrkSpacePoint )
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigVertexFitter/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigVertexFitter/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigVertexFitter/CMakeLists.txt b/Trigger/TrigTools/TrigVertexFitter/CMakeLists.txt
index e3ca3a356cbf..3f44318e8fc5 100644
--- a/Trigger/TrigTools/TrigVertexFitter/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigVertexFitter/CMakeLists.txt
@@ -1,29 +1,10 @@
-################################################################################
-# Package: TrigVertexFitter
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigVertexFitter )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          PRIVATE
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkTrack
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # Component(s) in the package:
 atlas_add_component( TrigVertexFitter
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkEventPrimitives TrkParameters TrkTrack TrigInDetEvent TrigTimeAlgsLib )
-
-# Install files from the package:
-atlas_install_headers( TrigVertexFitter )
-atlas_install_joboptions( share/*.py )
-
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel TrigInDetEvent TrigInDetToolInterfacesLib TrigTimeAlgsLib TrkEventPrimitives TrkParameters TrkTrack )
diff --git a/Trigger/TrigTools/TrigVertexFitter/README b/Trigger/TrigTools/TrigVertexFitter/README
deleted file mode 100755
index ff6df3dafabf..000000000000
--- a/Trigger/TrigTools/TrigVertexFitter/README
+++ /dev/null
@@ -1,199 +0,0 @@
-       ++++++ CONTENTS ++++++
-
-1. Vertexing tools provided by this package
-2. How to use TrigVertexFitter
-3. How to use TrigL2VertexFitter and TrigVertexingTool
-4. Mass-constrained vertex fitting
-5. Primary vertex fitting
-
-
-1. TrigVertexFitter package is a factory for the following tools:
-
-   - TrigVertexFitter this a first  prototype of the LVL2 vertex fitter 
-     based on ITrigVertexFitter abstract interface. Note that this tool 
-     will become obsolete soon as it will be replaced by TrigL2VertexFitter
-
-   - TrigL2VertexFitter - an improved and extended fitter with capability of 
-     mass-constrained fitting. It uses TrigL2Vertex class as input/output
-
-   - TrigVertexingTool - a toolbox to facilitate handling of TrigL2Vertex class
-
-   - TrigPrimaryVertexFitter - a fast algorithms for primary vertex fitting
-
-
-2. How to use TrigVertexFitter: fitting Jpsi(mu mu) vertex 
-
-   
-#include "TrigInDetToolInterfaces/ITrigVertexFitter.h"
-#include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
-
-// retrieving the vertex fitting tool
-
-ITrigVertexFitter* m_vertFitter;
-
-StatusCode sc = toolSvc()->retrieveTool("TrigVertexFitter","TrigVertexFitter",m_vertFitter);
-if ( sc.isFailure() ) {
-    log << MSG::FATAL << "Unable to locate TrigVertexFitter tool " << endreq;
-    return StatusCode::FAILURE;
-} 
-
-// fitting two TrigInDetTracks to a common vertex
-// and evaluation of vertex mass after the fit
-
-TrigInDetTracks *trigMuon1, * trigMuon2;
-
-TrackInVertexList* tList=new TrackInVertexList;
-tList->clear();	
-tList->push_back(trigMuon1);
-tList->push_back(trigMuon2);
-
-// creating a list of particle hypothesis, i.e. both tracks are muons
-// other options can be found in TrigInDetToolInterfaces/ITrigVertexFitter.h
-
-std::vector<TrigVtx::TrigParticleName> vPH;
-vPH.clear();
-vPH.push_back(TrigVtx::muon);
-vPH.push_back(TrigVtx::muon);
-
-// vertex fitting
-
-TrigVertex* pV=m_vertFitter->fit(tList,vPH);
-
-// note that fitter creates a new TrigVertex if the fit is successful
-// the new vertex owns the TrackInVertexList passed to the fitter
-
-if(pV!=NULL)
-{
-  printf("Jpsi vertex Fit: x=%f y=%f z=%f\n",pV->x(),pV->y(),pV->z());
-  printf("Jpsi mass = %f\n",pV->mass());
-  printf("Jpsi mass pull = %f\n",(pV->mass()-3094.0)/pV->massVariance());
-  double chi2prob=1.0-Genfun::CumulativeChiSquare(pV->ndof())(pV->chi2());
-  printf("Chi2 probability of the fit = %f\n",chi2prob);
-  printf("SigmaX = %f SigmaY = %f SigmaZ = %f\n",
-		     sqrt(pV->cov()[0]),
-		     sqrt(pV->cov()[2]),
-		     sqrt(pV->cov()[5]));
-  delete pV;
-}
-else delete tList;// vertex is not created and we have to delete tList 
-
-
-3. How to use TrigL2VertexFitter and TrigVertexingTool: fitting Ds(phi pi) vertex with phi(KK)
-
-
-#include "TrigInDetToolInterfaces/ITrigL2VertexFitter.h"
-#include "TrigVertexFitter/TrigVertexingTool.h"
-
-
-// retrieving tools 
-
-StatusCode sc = toolSvc()->retrieveTool("TrigL2VertexFitter","TrigL2VertexFitter",m_L2vertFitter);
-if ( sc.isFailure() ) {
-    log << MSG::FATAL << "Unable to locate TrigL2VertexFitter tool " << endreq;
-    return sc;
-}
-
-sc = toolSvc()->retrieveTool("TrigVertexingTool","TrigVertexingTool",m_vertexingTool);
-if ( sc.isFailure() ) {
-    log << MSG::FATAL << "Unable to locate TrigVertexingTool tool " << endreq;
-    return sc;
-} 
-
-
-// creating empty TrigL2Vertex
-
-TrigL2Vertex* pL2Ds=new TrigL2Vertex();
-
-// adding TrigInDetTrack* to the vertex 
-
-m_vertexingTool->addTrack((*track1),pL2Ds,Trk::kaon);
-m_vertexingTool->addTrack((*track2),pL2Ds,Trk::kaon);
-m_vertexingTool->addTrack((*track3),pL2Ds,Trk::pion);
-
-// vertex fit
-
-StatusCode sc=m_L2vertFitter->fit(pL2Ds);
-			  
-if(sc.isSuccess()) {
-    //invariant mass calculation
-    sc=m_vertexingTool->calculateInvariantMass(pL2Ds);
-    if(sc.isSuccess()) {
-        // estimation of Ds meson perigee parameters 
-        sc=m_vertexingTool->createMotherParticle(pL2Ds);
-        if(sc.isSuccess()) {
-           log<<MSG::DEBUG<<"Ds created:"<<endreq;
-	   log << MSG::DEBUG << "Ds particle parameters"<<endreq;
-	   log << MSG::DEBUG << "d0="<<pL2Ds->m_getMotherTrack()->a0()<<
-		              "  z0="<<pL2Ds->m_getMotherTrack()->z0()<<
-			      "  phi0="<<pL2Ds->m_getMotherTrack()->phi0()<<
-			      "  eta="<<pL2Ds->m_getMotherTrack()->eta()<<
-			      "  pT="<<pL2Ds->m_getMotherTrack()->pT()<<endreq;
-           // now we can create TrigVertex ("simplified" vertex) from fitted 
-           // TrigL2Vertex
-           TrigVertex* p_DsV=m_vertexingTool->createTrigVertex(pL2Ds);
-	   if(p_DsV!=NULL){
-
-                                log << MSG::DEBUG << "Ds vertex Fit: x= y= z=" << p_DsV->x() << " " << p_DsV->y() << " " << p_DsV->z() << endreq;
-                                log << MSG::DEBUG << "Ds mass = " << p_DsV->mass() << endreq;
-                                double chi2prob=1.0-Genfun::CumulativeChiSquare(p_DsV->ndof())(p_DsV->chi2());
-                                log << MSG::DEBUG << "Chi2 probability of the Ds fit = " << chi2prob << endreq;
-          }
-	}
-    }
-}
-delete pL2Ds;
-
-4. Fitting vertex with a mass constraint: Ds -> phi(KK) + pi, 
-   mass constraint (with phi mass) is imposed on KK pair 
-
-TrigL2Vertex* pL2V=new TrigL2Vertex();
-
-m_vertexingTool->addTrack((*track1),pL2V,Trk::kaon);
-m_vertexingTool->addTrack((*track2),pL2V,Trk::kaon);
-m_vertexingTool->addTrack((*track3),pL2V,Trk::pion);
-
-// setting up the constraint
-
-m_vertexingTool->setMassConstraint(pL2V,(*track1),(*track2),PHIMASS);
-
-// mass constrained fit
-
-StatusCode sc=m_L2vertFitter->fitWithConstraints(pL2V);
-
-
-5. Primary vertex fitting
-
-#include "TrigVertexFitter/ITrigPrimaryVertexFitter.h"
-
-
-// retrieving tool 
-
-StatusCode sc = toolSvc()->retrieveTool("TrigPrimaryVertexFitter","TrigPrimaryVertexFitter",m_primVertFitter);
-if ( sc.isFailure() ) {	
-    log << MSG::FATAL << "Unable to locate TrigPrimaryVertexFitter tool " << endreq;
-    return sc;
-}
-
-// using the fitter
-// input: a pointer to a TrigInDetTrackCollection e.g. tracks reconstructed within RoI, or selected set of tracks
-// input: initial approximation of z-vertex position, accuracy of this approximation can be set via zVariance 
-// property of the tool
-// output: a pointer to a TrigVertex containing results of the fit: vertex position, vertex covariance , chi2 and 
-// number-of-degree-of-freedom of the fit
-// if the pointer is NULL it means that fit failure
-
-TrigInDetTracks *track1, *track2;//.... *trackn
-
-TrigInDetTrackCollection myTracks;
-
-myTracks.push_back(track1);
-myTracks.push_back(track2);
-[...]
-myTracks.push_back(trackn);
-
-double myZ=0.0;
-
-TrigVertex* pV = m_primVertFitter->fit(myTracks,myZ);
-
-if(pV!=NULL) std::cout<<"Successful vertex fit !"<<std::endl;
-
diff --git a/Trigger/TrigTools/TrigVertexFitter/share/jobOfragment_TrigVertexFitter.py b/Trigger/TrigTools/TrigVertexFitter/share/jobOfragment_TrigVertexFitter.py
deleted file mode 100755
index 01ca88532d72..000000000000
--- a/Trigger/TrigTools/TrigVertexFitter/share/jobOfragment_TrigVertexFitter.py
+++ /dev/null
@@ -1,6 +0,0 @@
-theApp.Dlls += [ "TrigVertexFitter" ]
-#ToolSvc      = Service( "ToolSvc" )
-#TrigVtxFit = Algorithm( "ToolSvc.TrigVertexFitter" )
-#TrigVtxFit.OutputLevel=VERBOSE
-#TrigVtxFit.numberOfInterations=3
-
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx
index 145e0bb1d232..9b7c4b45b0b0 100755
--- a/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx
@@ -29,7 +29,7 @@
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
 #include "TrigInDetToolInterfaces/ITrigVertexingTool.h"
-#include "TrigVertexFitter/TrigL2VertexFitter.h"
+#include "TrigL2VertexFitter.h"
 
 TrigL2VertexFitter::TrigL2VertexFitter(const std::string& t, 
 				       const std::string& n,
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigL2VertexFitter.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigL2VertexFitter.h
rename to Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.h
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx
index 1fa77d31cb10..54263f408b25 100644
--- a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx
@@ -27,8 +27,8 @@
 #include "TrkTrack/TrackCollection.h"
 
 #include "TrigInDetToolInterfaces/ITrigPrimaryVertexFitter.h"
-#include "TrigVertexFitter/TrigPrimaryVertexFitter.h"
-#include "TrigVertexFitter/TrigPrimaryVertexTrack.h"
+#include "TrigPrimaryVertexFitter.h"
+#include "TrigPrimaryVertexTrack.h"
 
 
 TrigPrimaryVertexFitter::TrigPrimaryVertexFitter(const std::string& t, 
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigPrimaryVertexFitter.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigPrimaryVertexFitter.h
rename to Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.cxx
index 8816dcfe7bce..34cd98186513 100644
--- a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.cxx
@@ -4,7 +4,7 @@
 
 #include "TrigInDetEvent/TrigInDetTrack.h"
 #include "TrigInDetEvent/TrigL2Vertex.h"
-#include "TrigVertexFitter/TrigPrimaryVertexTrack.h"
+#include "TrigPrimaryVertexTrack.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkTrack/Track.h"
 
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigPrimaryVertexTrack.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.h
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigPrimaryVertexTrack.h
rename to Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexTrack.h
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.cxx
index 72fd98e4da53..0076982e2987 100755
--- a/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.cxx
@@ -22,7 +22,7 @@
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
 #include "TrigInDetToolInterfaces/ITrigVertexFitter.h"
-#include "TrigVertexFitter/TrigVertexFitter.h"
+#include "TrigVertexFitter.h"
 
 
 TrigVertexFitter::TrigVertexFitter(const std::string& t, 
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigVertexFitter.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigVertexFitter.h
rename to Trigger/TrigTools/TrigVertexFitter/src/TrigVertexFitter.h
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.cxx
index 93c69db083be..422a6910744f 100755
--- a/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.cxx
@@ -32,7 +32,7 @@
 #include "TrigInDetEvent/TrigInDetTrackCollection.h"
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 
-#include "TrigVertexFitter/TrigVertexingTool.h"
+#include "TrigVertexingTool.h"
 
 TrigVertexingTool::TrigVertexingTool(const std::string& t, 
 				     const std::string& n,
diff --git a/Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigVertexingTool.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigVertexFitter/TrigVertexFitter/TrigVertexingTool.h
rename to Trigger/TrigTools/TrigVertexFitter/src/TrigVertexingTool.h
diff --git a/Trigger/TrigTools/TrigVertexFitter/src/components/TrigVertexFitter_entries.cxx b/Trigger/TrigTools/TrigVertexFitter/src/components/TrigVertexFitter_entries.cxx
index 01c9646b94b5..b2bbfbe1562d 100644
--- a/Trigger/TrigTools/TrigVertexFitter/src/components/TrigVertexFitter_entries.cxx
+++ b/Trigger/TrigTools/TrigVertexFitter/src/components/TrigVertexFitter_entries.cxx
@@ -1,7 +1,7 @@
-#include "TrigVertexFitter/TrigVertexFitter.h"
-#include "TrigVertexFitter/TrigPrimaryVertexFitter.h"
-#include "TrigVertexFitter/TrigL2VertexFitter.h"
-#include "TrigVertexFitter/TrigVertexingTool.h"
+#include "../TrigVertexFitter.h"
+#include "../TrigPrimaryVertexFitter.h"
+#include "../TrigL2VertexFitter.h"
+#include "../TrigVertexingTool.h"
 
 DECLARE_COMPONENT( TrigVertexFitter )
 DECLARE_COMPONENT( TrigPrimaryVertexFitter )
-- 
GitLab


From ad3c0e50e1d1096f480d6ba470f4cb993473138c Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Mon, 6 Jul 2020 16:11:06 +0000
Subject: [PATCH 061/217] increase memory needed to run MooPerformance ART
 tests

---
 .../MooPerformance/test/test_singlemuon-mc12-pt100gev.sh        | 2 +-
 .../MooPerformance/test/test_singlemuon-mc12-pt10gev.sh         | 2 +-
 .../MooPerformance/test/test_singlemuon-mc12-pt1tev.sh          | 2 +-
 .../MooPerformance/test/test_singlemuon-mc12-pt2tev.sh          | 2 +-
 .../MooPerformance/test/test_singlemuon-mc12-pt5gev.sh          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt100gev.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt100gev.sh
index da948de8f5ad..c19c66686323 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt100gev.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt100gev.sh
@@ -6,7 +6,7 @@
 # art-include: master/Athena
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-#
+# art-memory: 4096
 # art-input: user.zhidong.SingleMuon_100GeV_task12089641.nopileup.HITStoRDO.r9707.20170907.v01_EXT0
 # art-input-nfiles: 3
 # art-output: trk*.txt
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt10gev.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt10gev.sh
index cc518257f9c9..46cd354a7612 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt10gev.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt10gev.sh
@@ -6,7 +6,7 @@
 # art-include: master/Athena
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-#
+# art-memory: 4096
 # art-input: user.zhidong.SingleMuon_10GeV_task12089631.nopileup.HITStoRDO.r9707.20170907.v01_EXT0
 # art-input-nfiles: 3
 # art-output: trk*.txt
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt1tev.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt1tev.sh
index 9250943e8584..9275ae445cc0 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt1tev.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt1tev.sh
@@ -6,7 +6,7 @@
 # art-include: master/Athena
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-#
+# art-memory: 4096
 # art-input: user.zhidong.SingleMuon_1TeV_task12089645.nopileup.HITStoRDO.r9707.20170907.v01_EXT0
 # art-input-nfiles: 3
 # art-output: trk*.txt
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt2tev.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt2tev.sh
index 48a4692c7477..630089822eba 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt2tev.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt2tev.sh
@@ -6,7 +6,7 @@
 # art-include: master/Athena
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-#
+# art-memory: 4096
 # art-input: user.zhidong.SingleMuon_2TeV_task12089647.nopileup.HITStoRDO.r9707.20170907.v01_EXT0
 # art-input-nfiles: 3
 # art-output: trk*.txt
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt5gev.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt5gev.sh
index 74b35812d0d1..7d92fdc9910d 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt5gev.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MooPerformance/test/test_singlemuon-mc12-pt5gev.sh
@@ -6,7 +6,7 @@
 # art-include: master/Athena
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-#
+# art-memory: 4096
 # art-input: user.zhidong.SingleMuon_5GeV_task12089629.nopileup.HITStoRDO.r9707.20170907.v01_EXT0
 # art-input-nfiles: 3
 # art-output: trk*.txt
-- 
GitLab


From ce73252f4c46b6ec94345cb67098a54633860905 Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Mon, 6 Jul 2020 16:15:48 +0000
Subject: [PATCH 062/217] IVertexFitter new interfaces return unique_ptr

---
 .../src/InDetConversionFinderTools.cxx        | 60 +++++++-----
 .../TrkVKalVrtFitter/TrkVKalVrtFitter.h       |  2 +-
 .../TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx | 97 +++----------------
 .../TrkVertexFitterInterfaces/IVertexFitter.h | 75 ++++++++------
 4 files changed, 90 insertions(+), 144 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/InDetConversionFinderTools.cxx b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/InDetConversionFinderTools.cxx
index 17c72c72a763..d58aba273e4d 100755
--- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/InDetConversionFinderTools.cxx
+++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/InDetConversionFinderTools.cxx
@@ -182,7 +182,7 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
         ATH_MSG_DEBUG("Track failed preselection");
     } // end pt,d0.z0-cuts
 
-    // Make track pairs.
+    // Make track pairs. To be used for double leg conversions
     std::vector<const xAOD::TrackParticle*>::const_iterator iter_pos;
     std::vector<const xAOD::TrackParticle*>::const_iterator iter_neg;
     std::vector<Amg::Vector3D> positionList;
@@ -206,7 +206,6 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
         ineg++;
         int flag = 0;
 
-       
         std::map<std::string, float> intersectionDecors;
         if (!passPreSelection(cache,
                               *iter_pos,
@@ -229,40 +228,38 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
         trackParticleList.push_back(*iter_pos);
         trackParticleList.push_back(*iter_neg);
 
-        xAOD::Vertex* myVertex = nullptr;
-        myVertex = m_iVertexFitter->fit(ctx, trackParticleList, initPos);
+        std::unique_ptr<xAOD::Vertex> myVertex =
+          m_iVertexFitter->fit(ctx, trackParticleList, initPos);
         trackParticleList.clear();
+
+        // We have a new vertex
         if (myVertex) {
           ATH_MSG_DEBUG("VertexFit successful!");
           int type = -1;
           if ((m_isConversion && m_postSelector->selectConversionCandidate(
-                                   myVertex, flag, positionList)) ||
-              (!m_isConversion && m_postSelector->selectSecVtxCandidate(
-                                    myVertex, flag, positionList, type))) {
+                                   myVertex.get(), flag, positionList)) ||
+              (!m_isConversion &&
+               m_postSelector->selectSecVtxCandidate(
+                 myVertex.get(), flag, positionList, type))) {
 
             ATH_MSG_DEBUG(" Conversion passed postselection cuts");
-
-            // Really need to check that this correct.
             // Remove old element links
             myVertex->clearTracks();
 
-            if (m_isConversion) {
-              myVertex->setVertexType(xAOD::VxType::ConvVtx);
-              InDetConversionContainer->push_back(myVertex);
-            } else if (type == 101 || type == 110 || type == 11) { // V0
-              myVertex->setVertexType(xAOD::VxType::V0Vtx);
-              InDetConversionContainer->push_back(myVertex);
-            } else {
-              ATH_MSG_WARNING("Unknown type of vertex");
-              delete myVertex;
-              myVertex = nullptr;
+            // If we do not have a valid type just reset
+            if (!m_isConversion && !(type == 101) && !(type == 110) &&
+                !(type == 11)) {
+              myVertex.reset();
             }
 
+            // If we have the right type (not reset above) lets fill information
+            // and then push to the containers
             if (myVertex) {
               if (m_decorateVertices) {
                 ATH_MSG_DEBUG(
                   "Decorating vertex with values used in track pair selector");
-                for (const auto& kv : m_trackPairsSelector->getLastValues(cache)) {
+                for (const auto& kv :
+                     m_trackPairsSelector->getLastValues(cache)) {
                   myVertex->auxdata<float>(kv.first) = kv.second;
                 }
                 ATH_MSG_DEBUG("Decorating vertex with values used in vertex "
@@ -271,22 +268,33 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
                   myVertex->auxdata<float>(kv.first) = kv.second;
                 }
               }
+
               ElementLink<xAOD::TrackParticleContainer> newLinkPos(*iter_pos,
                                                                    *trk_coll);
               ElementLink<xAOD::TrackParticleContainer> newLinkNeg(*iter_neg,
                                                                    *trk_coll);
               myVertex->addTrackAtVertex(newLinkPos);
               myVertex->addTrackAtVertex(newLinkNeg);
-            }
+
+              // Now fill in the containers depending on the 2 possible
+              // cases
+              if (m_isConversion) {
+                myVertex->setVertexType(xAOD::VxType::ConvVtx);
+                InDetConversionContainer->push_back(std::move(myVertex));
+              }
+              else if (type == 101 || type == 110 || type == 11) { // V0
+                myVertex->setVertexType(xAOD::VxType::V0Vtx);
+                InDetConversionContainer->push_back(std::move(myVertex));
+              }
+
+           } // End if on right type
 
             negIndx[ineg] = 1;
             posIndx[ipos] = 1;
-            numConversions++;
-
+            ++numConversions;
           } else {
             ATH_MSG_DEBUG("VxCandidate failed the post selection cuts!");
-            delete myVertex;
-            myVertex = nullptr;
+            myVertex.reset();
           }
         } else {
           ATH_MSG_DEBUG("VertexFit was NOT successful!");
@@ -297,8 +305,8 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
     ATH_MSG_DEBUG("Number of conversions found passing post selection cuts: "
                   << numConversions);
 
+    // single track conversions
     if (m_isConversion) {
-      // single track conversions
       for (int ip = 0; ip < int(posIndx.size()); ++ip) {
         if (posIndx[ip] == 0)
           singleTrackConvList.push_back(posSelectedTracks[ip]);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
index 494ba0fc42b6..3af241eb0c9d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
@@ -102,7 +102,7 @@ namespace Trk{
           const std::vector<const NeutralParameters*>& /*neutralPerigeeList*/,
           const xAOD::Vertex& constraint) const override;
 
-        virtual xAOD::Vertex* fit(
+        virtual std::unique_ptr<xAOD::Vertex> fit(
           const EventContext& ctx,
           const std::vector<const xAOD::TrackParticle*>& vectorTrk,
           const Amg::Vector3D& startingPoint) const override;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
index 364ccda9abd9..726e3ceb315e 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
@@ -109,15 +109,14 @@ TrkVKalVrtFitter::~TrkVKalVrtFitter(){
     if(m_fitPropagator) delete m_fitPropagator;
 }
 
-
-std::unique_ptr<IVKalState> TrkVKalVrtFitter::makeState(const EventContext& ctx) const
+std::unique_ptr<IVKalState>
+TrkVKalVrtFitter::makeState(const EventContext& ctx) const
 {
   auto state = std::make_unique<State>();
-  initState (ctx, *state);
+  initState(ctx, *state);
   return state;
 }
 
-
 StatusCode TrkVKalVrtFitter::finalize()
 {
     if(msgLvl(MSG::INFO))msg(MSG::INFO)<<"TrkVKalVrtFitter finalize() successful" << endmsg;
@@ -132,20 +131,6 @@ StatusCode TrkVKalVrtFitter::initialize()
     if(m_Robustness<0 || m_Robustness>7 ) m_Robustness=0; 
 
 
-// Setting constraint type - not used anymore, left for old code reference here....
-//    if( m_Constraint == 2)  m_usePointingCnst   = true;    
-//    if( m_Constraint == 3)  m_useZPointingCnst  = true;    
-//    if( m_Constraint == 4)  m_usePointingCnst   = true;    
-//    if( m_Constraint == 5)  m_useZPointingCnst  = true;    
-//    if( m_Constraint == 6)  m_useAprioriVertex  = true;    
-//    if( m_Constraint == 7)  m_usePassWithTrkErr = true;    
-//    if( m_Constraint == 8)  m_usePassWithTrkErr = true;    
-//    if( m_Constraint == 9)  m_usePassNear       = true;    
-//    if( m_Constraint == 10) m_usePassNear       = true;    
-//    if( m_Constraint == 11) m_usePhiCnst = true;    
-//    if( m_Constraint == 12) { m_usePhiCnst = true; m_useThetaCnst = true;}
-//    setCnstType((int)m_Constraint);
-
     if(!m_useFixedField){
       // Read handle for AtlasFieldCacheCondObj
       if (!m_fieldCacheCondObjInputKey.key().empty()){
@@ -420,16 +405,17 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const TrackParameters*>
     return tmpVertex;
 }
 
-
-
-     /** Interface for xAOD::TrackParticle with starting point */
-xAOD::Vertex * TrkVKalVrtFitter::fit(const EventContext& ctx,
-                                     const std::vector<const xAOD::TrackParticle*> & xtpListC,
-                                     const Amg::Vector3D & startingPoint) const
+/** Interface for xAOD::TrackParticle with starting point 
+ *  Implements the new style (unique_ptr,EventContext)
+ * */
+std::unique_ptr<xAOD::Vertex>
+TrkVKalVrtFitter::fit(const EventContext& ctx,
+                      const std::vector<const xAOD::TrackParticle*>& xtpListC,
+                      const Amg::Vector3D& startingPoint) const
 {
   State state;
-  initState (ctx, state);
-  return fit (xtpListC, startingPoint, state);
+  initState(ctx, state);
+  return std::unique_ptr<xAOD::Vertex>(fit(xtpListC, startingPoint, state));
 }
 
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const xAOD::TrackParticle*> & xtpListC,
@@ -720,65 +706,6 @@ Amg::MatrixX * TrkVKalVrtFitter::GiveFullMatrix(int NTrk, std::vector<double> &
 }
 
 
-/*-------------  End of VxCandidate lifetime
-VxCandidate * TrkVKalVrtFitter::makeVxCandidate( int Neutrals,
-        const Amg::Vector3D& Vertex, const std::vector<double> & fitErrorMatrix, 
-	const std::vector<double> & Chi2PerTrk,  const std::vector< std::vector<double> >& TrkAtVrt,
-	double Chi2, const State& state ) 
-{
-    long int NTrk = state.m_FitStatus;
-    long int Ndf = VKalGetNDOF(state)+state.m_planeCnstNDOF;
-    AmgSymMatrix(3) CovMtxV;  
-    std::vector<VxTrackAtVertex*> * tmpVTAV;
-    RecVertex                     * tmpRecV; 
-
-    CovMtxV(0,0)                = fitErrorMatrix[0];
-    CovMtxV(1,0) = CovMtxV(0,1) = fitErrorMatrix[1]; 
-    CovMtxV(1,1)                = fitErrorMatrix[2];
-    CovMtxV(2,0) = CovMtxV(0,2) = fitErrorMatrix[3]; 
-    CovMtxV(2,1) = CovMtxV(1,2) = fitErrorMatrix[4]; 
-    CovMtxV(2,2)                = fitErrorMatrix[5];
-
-    std::vector <double> CovFull;
-    StatusCode sc = VKalGetFullCov( NTrk, CovFull, state); 
-    int covarExist=0; if( sc.isSuccess() ) covarExist=1;
-    tmpVTAV = new std::vector<VxTrackAtVertex*>();
-    tmpRecV = new RecVertex( Vertex, CovMtxV, Ndf, Chi2 );
-    for(int ii=0; ii<NTrk ; ii++) {
-      AmgSymMatrix(5) *CovMtxP=new AmgSymMatrix(5);
-      if(covarExist){ FillMatrixP( ii, (*CovMtxP), CovFull );}
-      else          { (*CovMtxP).setIdentity();}
-      Perigee *        tmpChargPer=0;
-      NeutralPerigee * tmpNeutrPer=0;
-      if(ii<NTrk-Neutrals){
-        tmpChargPer  =  new Perigee( 0.,0., TrkAtVrt[ii][0],
-	                                                TrkAtVrt[ii][1],
-							TrkAtVrt[ii][2],
-							PerigeeSurface(Vertex),
-					                    CovMtxP );
-      }else{
-        tmpNeutrPer  =  new NeutralPerigee( 0.,0., TrkAtVrt[ii][0],
-	                                           TrkAtVrt[ii][1],
-						   TrkAtVrt[ii][2],
-						    PerigeeSurface(Vertex),
-					                    CovMtxP );
-      }
-      VxTrackAtVertex* trkV = new VxTrackAtVertex(Chi2PerTrk[ii], tmpChargPer, tmpNeutrPer);
-      tmpVTAV->push_back(trkV);
-    }
-    VxCandidate * tmpVertex;
-    if( m_makeExtendedVertex && covarExist ){
-       tmpVertex = new ExtendedVxCandidate(*tmpRecV,*tmpVTAV, 
-	           GiveFullMatrix(NTrk,CovFull) );
-	           ///new ErrorMatrix(new CovarianceMatrix(SetFullMatrix(NTrk,CovFull)))  ); //VK -Old version
-    }else{
-       tmpVertex = new VxCandidate(*tmpRecV,*tmpVTAV);
-    }
-    delete tmpRecV; delete tmpVTAV;
-    return tmpVertex;
-}
-*/
-
 
 xAOD::Vertex * TrkVKalVrtFitter::makeXAODVertex( int Neutrals,
         const Amg::Vector3D& Vertex, const std::vector<double> & fitErrorMatrix, 
diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexFitter.h b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexFitter.h
index 73a2dea10ad5..b9bd830dc9d7 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexFitter.h
@@ -15,9 +15,10 @@
 #include <vector>
 
 // xAOD includes
+#include "memory"
 #include "xAODTracking/NeutralParticle.h"
 #include "xAODTracking/TrackParticleFwd.h"
-#include "xAODTracking/VertexFwd.h"
+#include "xAODTracking/Vertex.h"
 
 /**
  * @class Trk::IVertexFitter
@@ -72,13 +73,13 @@ public:
    * Interface for xAOD::TrackParticle with starting point
    * Event Context aware interface
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const Amg::Vector3D& startingPoint) const
   {
     (void)(ctx);
-    return fit(vectorTrk, startingPoint);
+    return std::unique_ptr<xAOD::Vertex>(fit(vectorTrk, startingPoint));
   }
 
   // 2
@@ -86,14 +87,15 @@ public:
    *Interface for xAOD::TrackParticle and xAOD::NeutralParticle with starting
    *point. Event Context aware method
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const std::vector<const xAOD::NeutralParticle*>& vectorNeu,
     const Amg::Vector3D& startingPoint) const
   {
     (void)(ctx);
-    return fit(vectorTrk, vectorNeu, startingPoint);
+    return std::unique_ptr<xAOD::Vertex>(
+      fit(vectorTrk, vectorNeu, startingPoint));
   }
 
   // 3
@@ -102,14 +104,14 @@ public:
    * constraint the position of the constraint is ALWAYS the starting point
    * Event Context aware method
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const std::vector<const xAOD::NeutralParticle*>& vectorNeu,
     const xAOD::Vertex& constraint) const
   {
     (void)(ctx);
-    return fit(vectorTrk, vectorNeu, constraint);
+    return std::unique_ptr<xAOD::Vertex>(fit(vectorTrk, vectorNeu, constraint));
   }
 
   // 4
@@ -118,13 +120,13 @@ public:
    * the position of the constraint is ALWAYS the starting point
    * Event Context aware method
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const xAOD::Vertex& constraint) const
   {
     (void)(ctx);
-    return fit(vectorTrk, constraint);
+    return std::unique_ptr<xAOD::Vertex>(fit(vectorTrk, constraint));
   }
 
   // 5
@@ -132,14 +134,15 @@ public:
    * Interface for TrackParameters and NeutralParameters with starting point
    * Event Context aware method
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const std::vector<const Trk::NeutralParameters*>& neutralPerigeeList,
     const Amg::Vector3D& startingPoint) const
   {
     (void)(ctx);
-    return fit(perigeeList, neutralPerigeeList, startingPoint);
+    return std::unique_ptr<xAOD::Vertex>(
+      fit(perigeeList, neutralPerigeeList, startingPoint));
   }
 
   // 6
@@ -147,13 +150,13 @@ public:
    * Interface for TrackParameters with starting point
    * Event Context aware method
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const Amg::Vector3D& startingPoint) const
   {
     (void)(ctx);
-    return fit(perigeeList, startingPoint);
+    return std::unique_ptr<xAOD::Vertex>(fit(perigeeList, startingPoint));
   }
 
   // 7
@@ -162,14 +165,15 @@ public:
    * the position of the constraint is ALWAYS the starting point
    * EventContext aware method.
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const std::vector<const Trk::NeutralParameters*>& neutralPerigeeList,
     const xAOD::Vertex& constraint) const
   {
     (void)(ctx);
-    return fit(perigeeList, neutralPerigeeList, constraint);
+    return std::unique_ptr<xAOD::Vertex>(
+      fit(perigeeList, neutralPerigeeList, constraint));
   }
   // 8
   /**
@@ -177,29 +181,28 @@ public:
    * the position of the constraint is ALWAYS the starting point
    * EventContext aware method.
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const xAOD::Vertex& constraint) const
   {
     (void)(ctx);
-    return fit(perigeeList, constraint);
+    return std::unique_ptr<xAOD::Vertex>(fit(perigeeList, constraint));
   }
 
-
   // 9
   /**
    * Fit method using the VertexSeedFinder to estimate initial
    * position of the vertex and taking it as a first linearization point
    * (in iterative fitters). EventContext aware method.
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const std::vector<const Trk::NeutralParameters*>& neutralPerigeeList) const
   {
     (void)(ctx);
-    return fit(perigeeList, neutralPerigeeList);
+    return std::unique_ptr<xAOD::Vertex>(fit(perigeeList, neutralPerigeeList));
   }
 
   // 10
@@ -208,12 +211,12 @@ public:
    * position of the vertex and taking it as a first linearization point
    * (in iterative fitters). EventContext aware method.
    */
-  virtual xAOD::Vertex* fit(
+  virtual std::unique_ptr<xAOD::Vertex> fit(
     const EventContext& ctx,
     const std::vector<const Trk::TrackParameters*>& perigeeList) const
   {
     (void)(ctx);
-    return fit(perigeeList);
+    return std::unique_ptr<xAOD::Vertex>(fit(perigeeList));
   }
 
   //------------ Event Context unaware methods ---------
@@ -226,7 +229,8 @@ public:
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const Amg::Vector3D& startingPoint) const
   {
-    return fit(Gaudi::Hive::currentContext(), vectorTrk, startingPoint);
+    return fit(Gaudi::Hive::currentContext(), vectorTrk, startingPoint)
+      .release();
   }
 
   // 2
@@ -240,7 +244,8 @@ public:
     const Amg::Vector3D& startingPoint) const
   {
     return fit(
-      Gaudi::Hive::currentContext(), vectorTrk, vectorNeu, startingPoint);
+             Gaudi::Hive::currentContext(), vectorTrk, vectorNeu, startingPoint)
+      .release();
   }
 
   // 3
@@ -253,7 +258,8 @@ public:
     const std::vector<const xAOD::NeutralParticle*>& vectorNeu,
     const xAOD::Vertex& constraint) const
   {
-    return fit(Gaudi::Hive::currentContext(), vectorTrk, vectorNeu, constraint);
+    return fit(Gaudi::Hive::currentContext(), vectorTrk, vectorNeu, constraint)
+      .release();
   }
 
   // 4
@@ -265,7 +271,7 @@ public:
     const std::vector<const xAOD::TrackParticle*>& vectorTrk,
     const xAOD::Vertex& constraint) const
   {
-    return fit(Gaudi::Hive::currentContext(), vectorTrk, constraint);
+    return fit(Gaudi::Hive::currentContext(), vectorTrk, constraint).release();
   }
 
   // 5
@@ -280,7 +286,8 @@ public:
     return fit(Gaudi::Hive::currentContext(),
                perigeeList,
                neutralPerigeeList,
-               startingPoint);
+               startingPoint)
+      .release();
   }
 
   // 6
@@ -291,7 +298,8 @@ public:
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const Amg::Vector3D& startingPoint) const
   {
-    return fit(Gaudi::Hive::currentContext(), perigeeList, startingPoint);
+    return fit(Gaudi::Hive::currentContext(), perigeeList, startingPoint)
+      .release();
   }
 
   // 7
@@ -307,7 +315,8 @@ public:
     return fit(Gaudi::Hive::currentContext(),
                perigeeList,
                neutralPerigeeList,
-               constraint);
+               constraint)
+      .release();
   }
 
   // 8
@@ -319,7 +328,8 @@ public:
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const xAOD::Vertex& constraint) const
   {
-    return fit(Gaudi::Hive::currentContext(), perigeeList, constraint);
+    return fit(Gaudi::Hive::currentContext(), perigeeList, constraint)
+      .release();
   }
 
   // 9
@@ -332,7 +342,8 @@ public:
     const std::vector<const Trk::TrackParameters*>& perigeeList,
     const std::vector<const Trk::NeutralParameters*>& neutralPerigeeList) const
   {
-    return fit(Gaudi::Hive::currentContext(), perigeeList, neutralPerigeeList);
+    return fit(Gaudi::Hive::currentContext(), perigeeList, neutralPerigeeList)
+      .release();
   }
 
   // 10
@@ -344,7 +355,7 @@ public:
   virtual xAOD::Vertex* fit(
     const std::vector<const Trk::TrackParameters*>& perigeeList) const
   {
-    return fit(Gaudi::Hive::currentContext(), perigeeList);
+    return fit(Gaudi::Hive::currentContext(), perigeeList).release();
   }
 };
 }
-- 
GitLab


From 69b9e0e608bb91410b75015567d7cacdfe2986ab Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 6 Jul 2020 16:17:46 +0000
Subject: [PATCH 063/217] Add ATLAS_NOT_THREAD_SAFE to
 PixelChargeInterpolationPlot and PixelClusterOnTrackErrorPlot classes because
 static variables are used.

---
 .../PlotChargeSharingConstants.cxx            |  5 +++--
 .../PlotPixelClusterOnTrackErrors.cxx         |  5 +++--
 .../Application/createDeadModuleList.C        | 11 +++++-----
 .../Application/doPixelOfflineCalib.cxx       |  7 ++++---
 .../Application/doPixelOfflineCalibG4.cxx     |  7 ++++---
 .../Application/hackNoiseMapsForStudyCP.C     |  9 ++++----
 .../Application/updateDeadMaps.C              |  9 ++++----
 .../Application/updateNoiseMaps.C             |  9 ++++----
 .../PixelCalibAlgs/CMakeLists.txt             |  3 ++-
 .../PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY  |  1 +
 .../PixelCalibAlgs/MultiHisto.icc             |  5 +++--
 .../PixelCalibAlgs/OfflineCalibrationLoop.h   |  5 +++--
 .../PixelChargeInterpolationCalibration.h     |  6 ++++--
 .../PixelChargeInterpolationPlot.h            |  6 ++++--
 .../PixelClusterOnTrackErrorPlot.h            |  6 ++++--
 .../PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h |  6 ++++--
 .../src/DepletionDepthCalibration.cxx         |  4 ++--
 .../src/LorentzAngleCalibration.cxx           |  4 ++--
 .../PixelCalibAlgs/src/NoiseMapBuilder.cxx    |  5 ++++-
 .../PixelCalibAlgs/src/PixMapDBWriter.cxx     |  4 +++-
 .../src/PixMapOverlayWriter.cxx               |  6 ++++--
 .../PixelChargeInterpolationHistograms.cxx    |  4 ++--
 .../PixelChargeInterpolationValidation.cxx    |  8 +++----
 .../src/PixelChargeToTConversion.cxx          |  4 ++--
 .../PixelCalibAlgs/src/PixelConvert.cxx       |  7 ++++---
 .../PixelConditionsData/CMakeLists.txt        |  3 ++-
 .../PixelConditionsData/SpecialPixelMap.h     |  7 ++++---
 .../PixelCoralClientUtils/CMakeLists.txt      | 21 ++++++++++---------
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../AnalysisResultList_t.hh                   |  9 ++++----
 .../PixelCoralClientUtils/CoralClient.hh      | 10 ++++-----
 .../PixelCoralClientUtils/PCDio.h             |  5 +++--
 .../PixelCoralClientUtils/SpecialPixelMap.hh  |  7 ++++---
 .../PixelCoralClientUtils/src/CORAL-create.cc |  5 +++--
 .../PixelCoralClientUtils/src/CORAL-fill.cc   |  5 +++--
 .../src/CORAL-listVariables.cc                |  5 +++--
 .../PixelCoralClientUtils/src/CORAL-read.cc   |  5 +++--
 .../PixelCoralClientUtils/src/CoralClient.cc  |  9 ++++----
 .../PixelCoralClientUtils/src/PCDDb.cxx       |  6 ++++--
 .../src/PixCalibCoralCoolDb.cc                |  6 ++++--
 .../src/PixCalibKnowledgeDb.cc                | 15 +++++++------
 .../src/extractAnalysis.cc                    |  5 +++--
 .../PixelCoralClientUtils/src/extractSPM.cc   |  5 +++--
 .../PixelCoralClientUtils/src/talkToPCDDb.cc  |  5 +++--
 .../Application/doPixelValidation.cxx         |  7 ++++---
 .../PixelRTT/OfflineCalibOutputTrack.h        |  5 +++--
 46 files changed, 172 insertions(+), 120 deletions(-)
 create mode 100644 InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
index 61f643468c59..902b4225c197 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotChargeSharingConstants.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -8,12 +8,13 @@
 
 #include <TApplication.h>
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelChargeInterpolationPlot.h"
 #include "PixelConditionsData/PixelChargeInterpolationParameters.h"
 
 using namespace PixelCalib;
 
-int main(int argc, char *argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe PixelChargeInterpolationPlot class is used.
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
index 3a35fd458a59..a19e1af68d27 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/PlotPixelClusterOnTrackErrors.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
@@ -8,12 +8,13 @@
 
 #include <TApplication.h>
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h"
 #include "PixelConditionsData/PixelClusterOnTrackErrorData.h"
 
 using namespace PixelCalib;
 
-int main(int argc, char *argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread usnafe PixelClusterOnTrackErrorPlot class is used.
 
 	TApplication myapp("application", 0 , 0);
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
index 58c04eea6468..12cda424d708 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/createDeadModuleList.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <vector>
@@ -17,6 +17,7 @@
 #include "TKey.h"
 #include "Riostream.h"
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
@@ -50,7 +51,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main(int argc, char* argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
   const bool isIBL = true;
 
   //-----------------------------------
@@ -517,7 +518,7 @@ delete hitMapFile;
 return 0;
 }
 
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta){
+std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -533,7 +534,7 @@ std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int
   return std::string("Error!");
 }
 
-int getHashFromPosition (int barrel_ec, int layer, int module_phi, int module_eta){
+int getHashFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
   for(unsigned int ii = 0; ii < hashMapping.size(); ii++) {
     if (hashMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -549,7 +550,7 @@ int getHashFromPosition (int barrel_ec, int layer, int module_phi, int module_et
   return 0;
 }
 
-std::vector<int> getPositionFromDCSID (const std::string& module_name){
+std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
       return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
index e4b6b65b3ad7..7e053795a162 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalib.cxx
@@ -1,16 +1,17 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/OfflineCalibrationLoop.h"
 
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll(std::string input_file, std::string input_tag,
+int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe OfflineCalibrationLoop class is used.
 	  std::string output_tag,
 		std::string collection,
 	  std::string reference_file, std::string reference_tag,
@@ -37,7 +38,7 @@ int doAll(std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main(int argc, char *argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
 
 std::cout << "ciao" << std::endl;
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
index bcd6b06558d4..046b142859a0 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/doPixelOfflineCalibG4.cxx
@@ -1,17 +1,18 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
 #include <string>
 #include <cstdlib>
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelRIOs.h"
 
 using namespace PixelCalib;
 
 /// the function that does the job!
-int doAll(std::string input_file, std::string input_tag,
+int doAll ATLAS_NOT_THREAD_SAFE (std::string input_file, std::string input_tag, // Thread unsafe PixelRIOs class is used.
 	  std::string output_tag,
 	  std::string reference_file, std::string reference_tag,
 	  int maxentries){
@@ -37,7 +38,7 @@ int doAll(std::string input_file, std::string input_tag,
 }
 
 /// main does include the input interpretation
-int main(int argc, char *argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
 
 	if(argc < 4 || argc > 5){
 		std::cout << std::endl;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
index d62c85fbe89c..51a217b1f0bb 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/hackNoiseMapsForStudyCP.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<vector>
@@ -21,6 +21,7 @@
 #include "TString.h"
 #include "Math/ProbFuncMathCore.h"
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
@@ -121,7 +122,7 @@ int ComputePoisson(double probcut, double mu) {
   return nhits;
 }
 
-int main(int argc, char* argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
 
   //std::string option;
 
@@ -983,7 +984,7 @@ int main(int argc, char* argv[]){
   return 0;
 }
 
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta){
+std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -999,7 +1000,7 @@ std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID (const std::string& module_name){
+std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
index b82461fb9ac8..026c1bfca796 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateDeadMaps.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<vector>
@@ -17,6 +17,7 @@
 #include "TKey.h"
 #include "Riostream.h"
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
@@ -48,7 +49,7 @@ bool is_file_exist(const char *fileName)
 
 using namespace std;
 
-int main(int argc, char* argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
   bool isIBL = true;
 
   int minEventNumber = 2000000;
@@ -792,7 +793,7 @@ int main(int argc, char* argv[]){
   return 0;
 }
 
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta){
+std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -808,7 +809,7 @@ std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID (const std::string& module_name){
+std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
index 2ae8e6e2966e..dfd11aa47515 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/Application/updateNoiseMaps.C
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include<vector>
@@ -19,6 +19,7 @@
 #include "TString.h"
 #include "Math/ProbFuncMathCore.h"
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelConvert.h"
 #include "PixelConditionsData/SpecialPixelMap.h"
 
@@ -135,7 +136,7 @@ int ComputePoisson(double probcut, double mu) {
 }
 
 
-int main(int argc, char* argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char* argv[]){ // Global variable is used.
 
   std::string option;
 
@@ -876,7 +877,7 @@ int main(int argc, char* argv[]){
   return 0;
 }
 
-std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int module_eta){
+std::string getDCSIDFromPosition ATLAS_NOT_THREAD_SAFE (int barrel_ec, int layer, int module_phi, int module_eta){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].second.size() != 4) {
       std::cout << "getDCSIDFromPosition: Vector size is not 4!" << std::endl;
@@ -892,7 +893,7 @@ std::string getDCSIDFromPosition (int barrel_ec, int layer, int module_phi, int
   return std::string("Error!");
 }
 
-std::vector<int> getPositionFromDCSID (const std::string& module_name){
+std::vector<int> getPositionFromDCSID ATLAS_NOT_THREAD_SAFE (const std::string& module_name){ // Global variable is used.
   for(unsigned int ii = 0; ii < pixelMapping.size(); ii++) {
     if (pixelMapping[ii].first == module_name)
     return pixelMapping[ii].second;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt
index 08adb040b5d1..8ddc91a184b9 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/CMakeLists.txt
@@ -9,6 +9,7 @@ atlas_subdir( PixelCalibAlgs )
 atlas_depends_on_subdirs(
    PUBLIC
    Control/AthenaBaseComps
+   Control/CxxUtils
    GaudiKernel
    InnerDetector/InDetRecEvent/InDetPrepRawData
    PRIVATE
@@ -42,7 +43,7 @@ atlas_add_library( PixelCalibAlgsLib
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
    PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
    DEFINITIONS ${CLHEP_DEFINITIONS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps CxxUtils
    GaudiKernel InDetPrepRawData
    PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaPoolUtilities CoralDB
    DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..3e6ddbf75612
--- /dev/null
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetCalibAlgs/PixelCalibAlgs
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/MultiHisto.icc b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/MultiHisto.icc
index 22960a446632..56b206d0ce8f 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/MultiHisto.icc
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/MultiHisto.icc
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MultiHisto_cxx
 #define MultiHisto_cxx
 
 #include "PixelCalibAlgs/MultiHisto.h"
+#include "CxxUtils/checker_macros.h"
 #include "sstream"
 #include <vector>
 #include <string>
@@ -140,7 +141,7 @@ int MultiHisto<ht>::Write(const char* name, Int_t option, Int_t bufsize) const {
 }
 
 template <class ht>
-int MultiHisto<ht>::Write(const char* name, Int_t option, Int_t bufsize) {
+int MultiHisto<ht>::Write ATLAS_NOT_THREAD_SAFE (const char* name, Int_t option, Int_t bufsize) { // const_cast is used.
   return const_cast<const MultiHisto<ht>*>(this)->Write(name,option,bufsize);
 }
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
index 9778dd0bb810..8ff1054824b5 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/OfflineCalibrationLoop.h
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef OfflineCalibrationLoop_h
 #define OfflineCalibrationLoop_h
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelNtupleTracks.h"
 
 class string;
@@ -18,7 +19,7 @@ class PixelChargeInterpolationValidation;
 
 class OfflineCalibrationLoop;
 
-class OfflineCalibrationLoop: public PixelNtupleTracks {
+class ATLAS_NOT_THREAD_SAFE OfflineCalibrationLoop: public PixelNtupleTracks { // Thread unsafe PixelChargeInterpolationCalibration class is used.
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
index 02793cc03735..20c37bb7403c 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationCalibration.h
@@ -1,10 +1,12 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationCalibration_h
 #define PixelChargeInterpolationCalibration_h
 
+#include "CxxUtils/checker_macros.h"
+
 class string;
 template < class T, class Allocator > class vector;
 class TDirectory;
@@ -17,7 +19,7 @@ class PixelChargeInterpolationParameters;
 
 class PixelChargeInterpolationCalibration;
 
-class PixelChargeInterpolationCalibration{
+class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationCalibration{ // Thread unsafe PixelChargeInterpolationPlot class is used.
 
 public :
 	// Modified stuff
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
index c2be7d096b16..10dcd3620bb1 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelChargeInterpolationPlot.h
@@ -1,10 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationPlot_h
 #define PixelChargeInterpolationPlot_h
 
+#include "CxxUtils/checker_macros.h"
+
 class string;
 template < class T, class Allocator > class vector;
 class TH1F;
@@ -17,7 +19,7 @@ class PixelChargeInterpolationParameters;
 
 class PixelChargeInterpolationPlot;
 
-class PixelChargeInterpolationPlot{
+class ATLAS_NOT_THREAD_SAFE PixelChargeInterpolationPlot{ // static variable is used.
 
 public :
   PixelChargeInterpolationPlot(const PixelChargeInterpolationParameters &parameters, bool oneconst = false);
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
index a72bf111e482..d292a867ff95 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelClusterOnTrackErrorPlot.h
@@ -1,10 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelClusterOnTrackErrorPlot_h
 #define PixelClusterOnTrackErrorPlot_h
 
+#include "CxxUtils/checker_macros.h"
+
 class string;
 template < class T, class Allocator > class vector;
 class TH1F;
@@ -17,7 +19,7 @@ class PixelClusterOnTrackErrorData;
 
 class PixelClusterOnTrackErrorPlot;
 
-class PixelClusterOnTrackErrorPlot{
+class ATLAS_NOT_THREAD_SAFE PixelClusterOnTrackErrorPlot{ // static variable is used.
 
 public :
 	PixelClusterOnTrackErrorPlot(PixelClusterOnTrackErrorData &parameters,
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
index bd5e0d151ee9..fe8da3838d08 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/PixelCalibAlgs/PixelRIOs.h
@@ -1,10 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelRIOs_h
 #define PixelRIOs_h
 
+#include "CxxUtils/checker_macros.h"
+
 #include <TROOT.h>
 #include <TChain.h>
 #include <vector>
@@ -18,7 +20,7 @@ class PixelChargeInterpolationCalibration;
 class PixelChargeInterpolationValidation;
 
 
-class PixelRIOs {
+class ATLAS_NOT_THREAD_SAFE PixelRIOs { // Thread unsafe PixelChargeInterpolationCalibration class is used.
 public :
    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
    Int_t           fCurrent; //!current Tree number in a TChain
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx
index d7e5849161e1..6e49e3a77fca 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/DepletionDepthCalibration.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DepletionDepthCalibration_C
@@ -148,7 +148,7 @@ bool DepletionDepthCalibration::Fill(Int_t Layer, Int_t EtaIndex, Int_t PhiIndex
 	double theta = 180.* 2. * atan(exp(- Eta)) / M_PI;
 	if(  Layer == m_curLayer ){
 		passed = kTRUE;
-		static std::vector<Double_t> Pars(2);
+                std::vector<Double_t> Pars(2);
 		Pars[1] = PhiIndex;
 		Pars[0] = EtaIndex;
 			
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx
index 2511b86d0f0f..620ea36c83e1 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/LorentzAngleCalibration.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef LorentzAngleCalibration_C
@@ -143,7 +143,7 @@ bool LorentzAngleCalibration::Fill(Int_t Layer, Int_t EtaIndex, Int_t PhiIndex,
 	bool passed = kFALSE;
 	if( Layer == m_curLayer ){
 		passed = kTRUE;
-		static std::vector<Double_t> Pars(2);
+                std::vector<Double_t> Pars(2);
 		Pars[1] = PhiIndex;
 		Pars[0] = EtaIndex;
 
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
index ecf3ed5321b9..54f8eb4e6ddc 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/NoiseMapBuilder.cxx
@@ -17,6 +17,9 @@
 // geometry
 #include "InDetIdentifier/PixelID.h"
 
+// Thread safety check
+#include "CxxUtils/checker_macros.h"
+
 // ROOT
 #include "TH2.h"
 #include "TString.h" 
@@ -311,7 +314,7 @@ StatusCode NoiseMapBuilder::registerHistograms(){
 // execute
 //
 //=========================================================
-StatusCode NoiseMapBuilder::execute(){
+StatusCode NoiseMapBuilder::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DataHandle template is used.
   ATH_MSG_DEBUG( "Executing NoiseMapBuilder" );
 
   // retrieve EventInfo
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
index 04d482b9e1fb..d05f7c08efeb 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapDBWriter.cxx
@@ -15,6 +15,8 @@
 #include "InDetReadoutGeometry/SiDetectorElement.h" // kazuki
 #include "PixelReadoutGeometry/PixelModuleDesign.h" // kazuki
 
+#include "CxxUtils/checker_macros.h"
+
 // ROOT
 #include "TFile.h"
 #include "TKey.h"
@@ -88,7 +90,7 @@ StatusCode PixMapDBWriter::execute(){
 }
 
 
-StatusCode PixMapDBWriter::finalize(){
+StatusCode PixMapDBWriter::finalize ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe DetectorSpecialPixelMap and ModuleSpecialPixelMap classes are used.
   ATH_MSG_INFO( "Finalizing PixMapDBWriter" );
 
   ATH_MSG_DEBUG( "Reading map of special pixels from file" );
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
index e0d85368285a..52d1c1f07de7 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixMapOverlayWriter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // conditions
@@ -12,6 +12,8 @@
 // geometry
 #include "InDetIdentifier/PixelID.h"
 
+#include "CxxUtils/checker_macros.h"
+
 // CoralDB
 #include "CoralDB/CoralDB.h"
 #include "CoralDB/Alias.h"
@@ -69,7 +71,7 @@ StatusCode PixMapOverlayWriter::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixMapOverlayWriter::execute(){
+StatusCode PixMapOverlayWriter::execute ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe ModuleSpecialPixelMap class is used.
 
   auto spm = std::make_unique<DetectorSpecialPixelMap>();
   for(unsigned int i = 0; i < m_pixelID->wafer_hash_max(); i++){
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationHistograms.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationHistograms.cxx
index 52afd84b0d95..7e2b78940751 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationHistograms.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationHistograms.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationHistograms_C
@@ -152,7 +152,7 @@ int PixelChargeInterpolationHistograms::Fill(int DetType, double GeVTrkPt,
 		double alpha, double DeltaRow, double resphi, double OmegaPhi){
 	
 		
-	static std::vector<double> Pars(3);
+	std::vector<double> Pars(3);
 	if(GeVTrkPt == 0) return -1; 
 
 	if( DeltaCol > 1){ // otherwise none to share with!
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
index 3ce344e40572..f3db9d975ebe 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelChargeInterpolationValidation_C
@@ -598,7 +598,7 @@ void PixelChargeInterpolationValidation::Fill(int Layer, double GeVTrkPt,
 		double Phi, double CSphi, double digResPhi, double ResPhi, double ErrPhi, Double_t PullPhi,
 		double Eta, double CSeta, double digResEta, double ResEta, double ErrEta, Double_t PullEta, double Charge){
 
-	static std::vector< float >parameters(3);
+        std::vector< float >parameters(3);
 	parameters[LayerIndex] = Layer;
 	parameters[AngleIndex] = Eta;
 	parameters[ClustersizeIndex] = CSeta;
@@ -625,7 +625,7 @@ void PixelChargeInterpolationValidation::Fill(int Layer, double GeVTrkPt,
 	m_charge_phi->Fill(float(Charge), parameters);
 
 	if( Layer < NLAYERS){ 
-		static std::vector< float >parameters_Layer(2);
+                std::vector< float >parameters_Layer(2);
 		if(GeVTrkPt < 10E10) parameters_Layer[0] = GeVTrkPt;
 		else parameters_Layer[0] = 1.;
 
@@ -640,7 +640,7 @@ void PixelChargeInterpolationValidation::Fill(int Layer, double GeVTrkPt,
 		m_phiPull_Layer[Layer]->Fill(float(PullPhi), parameters_Layer);
 	}
 
-	static std::vector< float >parameters_Clustersize(1);
+	std::vector< float >parameters_Clustersize(1);
 
 	if( int(CSeta)-1 < NCLUSSIZES){ 
 		parameters_Clustersize[0] = Eta;
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
index b65cb83002c7..767740d200ba 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeToTConversion.cxx
@@ -5,7 +5,7 @@
 // conditions
 #include "PixelCalibAlgs/PixelChargeToTConversion.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h" 
-
+#include "CxxUtils/checker_macros.h"
 #include "PixelGeoModel/IBLParameterSvc.h" 
 #include "InDetIdentifier/PixelID.h"
 #include "InDetPrepRawData/PixelCluster.h"
@@ -42,7 +42,7 @@ StatusCode PixelChargeToTConversion::initialize(){
   return StatusCode::SUCCESS;
 }
 
-StatusCode PixelChargeToTConversion::execute(){
+StatusCode PixelChargeToTConversion::execute ATLAS_NOT_THREAD_SAFE (){ // const_cast is used.
   const EventContext &ctx = Gaudi::Hive::currentContext();
   SG::ReadHandle<InDet::PixelClusterContainer> pixel_container( m_pixelsClustersKey, ctx);
   if (!pixel_container.isValid())
diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
index a204a1dc9fa6..a27ea5f63d73 100755
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelConvert.cxx
@@ -1,8 +1,9 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelCalibAlgs/PixelConvert.h"
+#include "CxxUtils/checker_macros.h"
 #include <algorithm>
 
 namespace PixelConvert {
@@ -399,7 +400,7 @@ namespace PixelConvert {
    * file named as in the string datafile initialized above.
    */
 
-  int ReadMap(const std::string& filename ) {
+  int ReadMap ATLAS_NOT_THREAD_SAFE (const std::string& filename ) {
 // Global variables are used.
     std::cerr << "INFO: Opening data file " << filename << std::endl; 
     std::ifstream f(filename.c_str());
     if ( !f.good() ) {
@@ -432,7 +433,7 @@ namespace PixelConvert {
     return 0;
   }
 
-  unsigned int GetID(const unsigned int moduleID) {
+  unsigned int GetID ATLAS_NOT_THREAD_SAFE (const unsigned int moduleID) {
 // Global variables are used.
     // if maps are not previously loaded, read in the file 
     if ( !hashIndex || !SNIndex ) ReadMap(datafile);
     if ( moduleID>=510000 && moduleID<=519999 ) 
diff --git a/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt
index b0e16ac755d1..bedb6e10aca4 100644
--- a/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/PixelConditionsData/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( PixelConditionsData )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( 
   PUBLIC
+  Control/CxxUtils
   DetectorDescription/Identifier
   DetectorDescription/GeoPrimitives
   Database/AthenaPOOL/AthenaPoolUtilities
@@ -26,6 +27,6 @@ atlas_add_library( PixelConditionsData
                    PUBLIC_HEADERS PixelConditionsData
                    PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES Identifier GeoPrimitives PixelCoralClientUtils
+                   LINK_LIBRARIES CxxUtils Identifier GeoPrimitives PixelCoralClientUtils
                    PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel AthenaPoolUtilities GaudiKernel )
 
diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h
index d186d2546eb6..697c7eaad2be 100755
--- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h
+++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/SpecialPixelMap.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PIXELCONDITIONSDATA_SPECIALPIXELMAP_H
@@ -9,6 +9,7 @@
 
 #include "AthenaKernel/CLASS_DEF.h"
 #include "AthenaKernel/CondCont.h"
+#include "CxxUtils/checker_macros.h"
 #include<map>
 #include<string>
 
@@ -34,7 +35,7 @@ class ModuleSpecialPixelMap;
     status codes. A ModuleSpecialPixelMap is accessed by its IdentifierHash.
  */
 
-class DetectorSpecialPixelMap : public PixelCoralClientUtils::DetectorSpecialPixelMap{
+class ATLAS_NOT_THREAD_SAFE DetectorSpecialPixelMap : public PixelCoralClientUtils::DetectorSpecialPixelMap{ // Thread unsafe PixelCoralClientUtils::DetectorSpecialPixelMap class is used.
 
  public: 
   DetectorSpecialPixelMap();
@@ -61,7 +62,7 @@ class DetectorSpecialPixelMap : public PixelCoralClientUtils::DetectorSpecialPix
  */
 
 
-class ModuleSpecialPixelMap : public PixelCoralClientUtils::ModuleSpecialPixelMap{
+class ATLAS_NOT_THREAD_SAFE ModuleSpecialPixelMap : public PixelCoralClientUtils::ModuleSpecialPixelMap{ // Thread unsafe PixelCoralClientUtils::ModuleSpecialPixelMap class is used.
 
  public:
    ModuleSpecialPixelMap();
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt b/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt
index 4503f63812e2..e683f06057c3 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/CMakeLists.txt
@@ -7,6 +7,7 @@ atlas_subdir( PixelCoralClientUtils )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
+                          Control/CxxUtils
                           Database/CoraCool )
 
 # External dependencies:
@@ -25,51 +26,51 @@ atlas_add_library( PixelCoralClientUtils
                    PUBLIC_HEADERS PixelCoralClientUtils
                    INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${CORAL_LIBRARIES} CoraCool
+                   LINK_LIBRARIES ${CORAL_LIBRARIES} CxxUtils CoraCool
                    PRIVATE_LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} )
 
 atlas_add_executable( CORAL-read
                       src/CORAL-read.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( CORAL-create
                       src/CORAL-create.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( CORAL-fill
                       src/CORAL-fill.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( CORAL-listVariables
                       src/CORAL-listVariables.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( extractAnalysis
                       src/extractAnalysis.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( fixTimewalk
                       src/fixTimewalk.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( extractSPM
                       src/extractSPM.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( talkToPCDDb
                       src/talkToPCDDb.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
 atlas_add_executable( calibDbInterface
                       src/calibDbInterface.cc
                       INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CoraCool PixelCoralClientUtils )
+                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} CxxUtils CoraCool PixelCoralClientUtils )
 
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..67cfcbd2e284
--- /dev/null
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/PixelCoralClientUtils
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh
index 375928504670..0cdd3bb18b53 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/AnalysisResultList_t.hh
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef _CAN_AnalysisResultList_t_hh_
 #define _CAN_AnalysisResultList_t_hh_
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/PixResultsException.hh"
 #include <map>
 #include <vector>
@@ -81,7 +82,7 @@ namespace CAN {
     std::map<std::string, std::map<std::string, T> > &getMap();
 
     template <class T>
-    const std::map<std::string, std::map<std::string, T> > &getMap() const
+    const std::map<std::string, std::map<std::string, T> > &getMap ATLAS_NOT_THREAD_SAFE () const // const_cast is used.
       {return const_cast<AnalysisResultList_t*>(this)->getMap<T>();}
 
     void throwValueDoesNotExist(const std::string &var_name, const std::string conn_name) const {
@@ -133,11 +134,11 @@ namespace CAN {
       { return getMap<T>().begin(); }
 
     template <class T>
-    typename std::map< std::string, std::map<std::string, T> >::const_iterator begin() const
+    typename std::map< std::string, std::map<std::string, T> >::const_iterator begin ATLAS_NOT_THREAD_SAFE () const // Thread unsafe getMap method is used.
       { return getMap<T>().begin(); }
 
     template <class T>
-    typename std::map< std::string, std::map<std::string, T> >::const_iterator end() const
+    typename std::map< std::string, std::map<std::string, T> >::const_iterator end ATLAS_NOT_THREAD_SAFE () const // Thread unsafe getMap method is used.
       { return getMap<T>().end(); }
 
   protected:
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh
index 52a5ab88edb0..238a69e86844 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/CoralClient.hh
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CORALCLIENT
@@ -75,7 +75,7 @@ namespace PixelCalib {
   class PixelCalibData;
 }
 
-class PixCoralClient {
+class ATLAS_NOT_THREAD_SAFE PixCoralClient { // Thread unsafe coral::AttributeList is used in many places.
 
 private:
   std::string m_connString;
@@ -167,16 +167,16 @@ public:
   
 
   // Convert local time t to GMT (UTC)
-  std::time_t LocalToGMTTime(std::time_t t) {
+  std::time_t LocalToGMTTime ATLAS_NOT_THREAD_SAFE (std::time_t t) { // Thread unsafe gmtime is used.
     std::time_t rawtime = t ? t : time(0);
     tm * ptm;
     ptm = gmtime(&rawtime);
     return mktime(ptm);
   }
   // Get current time in GMT (UTC)
-  std::time_t GMTCurrentTime() { return LocalToGMTTime(0); }
+  std::time_t GMTCurrentTime() { return LocalToGMTTime(0); } // Thread unsafe LocalToGMTTime method is used.
   // Convert GMT (UTC) time to local time
-  std::time_t GMTtoLocalTime(std::time_t gmttime) {
+  std::time_t GMTtoLocalTime ATLAS_NOT_THREAD_SAFE (std::time_t gmttime) { // Thread unsafe gmtime is used.
     return 2*gmttime - mktime (gmtime(&gmttime));
   }
 };
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h
index 8f53d9bcbaf7..1b2869836cd3 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/PCDio.h
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef _PCDio_h_
 #define _PCDio_h_
 
+#include "CxxUtils/checker_macros.h"
 #include "RelationalAccess/AccessMode.h"
 
 #include <string>
@@ -13,7 +14,7 @@ namespace coral {
   class ISessionProxy;
 }
 
-class PCDio
+class ATLAS_NOT_THREAD_SAFE PCDio // global static variable is used.
 {
  public:
   PCDio(std::string connString, std::string tableName, int verbose);
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
index 82e8af8f0d07..31ef77c10a00 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -15,6 +15,7 @@
 #define SPECIALPIXELMAP_HH
 
 #include "CoralBase/Blob.h"
+#include "CxxUtils/checker_macros.h"
 
 #include<map>
 #include<vector>
@@ -45,7 +46,7 @@ class ModuleSpecialPixelMap;
     its IdentifierHash.
 */
 
-class DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{
+class ATLAS_NOT_THREAD_SAFE DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{ // Thread unsafe ModuleSpecialPixelMap class is used.
    
  public: 
    DetectorSpecialPixelMap();
@@ -99,7 +100,7 @@ class DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{
 
 **/
 
-class ModuleSpecialPixelMap : private std::map<unsigned int, unsigned int>{
+class ATLAS_NOT_THREAD_SAFE ModuleSpecialPixelMap : private std::map<unsigned int, unsigned int>{ // static member variable is used.
 
  public:
    friend class ::ModuleSpecialPixelMap;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc
index 55a296b40a42..1149bbe7c5ec 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-create.cc
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe CoralClient class is used.
 //printf("COOL-create starting \n");
 
 
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc
index 093be4bf3da7..babcff45b5fa 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-fill.cc
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe PixCoralClient class is used.
   //printf("CORAL-fill starting \n");
 
     CAN::SerialNumber_t anal_id = 123456789;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc
index 62d6e7c6e9a9..1584940aba18 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-listVariables.cc
@@ -1,7 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 #include <string>
 #include <vector>
@@ -40,7 +41,7 @@
   };
 
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe PixCoralClient class is used.
 
   CAN::SerialNumber_t analysis_id = 0;
   std::vector<std::string> connectivity_name;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc
index d11d6db09117..f7987a3e6bb1 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CORAL-read.cc
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe PixCoralClient class is used.
   //printf("CORAL-create starting \n");
 
     CAN::SerialNumber_t anal_id = 123456789;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc
index 931b9a33667b..ba635e674c67 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/CoralClient.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //////////////////////////////////////////////////
@@ -18,10 +18,11 @@ fill the DB, read it back
 
 #include <assert.h>
 #include <cstring>
+#include <string>
 
 // definition of table types
 enum ETableTypeId {kBoolType, kUIntType, kFloatType, kAvresType, kPixelMapType, kCalibData, kNTableTypes};
-const char *s_tableTypeName[kNTableTypes]={"BOOL","UINT","FLOAT","AVRES","SPECIALPIXELS","CALIBDATA"};
+const std::string s_tableTypeName[kNTableTypes]={"BOOL","UINT","FLOAT","AVRES","SPECIALPIXELS","CALIBDATA"};
 
 /** Returns the string used to identify a particular type
  */
@@ -1154,7 +1155,7 @@ template <> inline void extendAttributeList<CAN::AverageResult_t>(coral::Attribu
 
 
 // special handling for PixelMap_t
-template <> inline void addValueToRow<PixelMap_t>(coral::AttributeList &attribute_list, const PixelMap_t &value) {
+template <> inline void addValueToRow<PixelMap_t> ATLAS_NOT_THREAD_SAFE (coral::AttributeList &attribute_list, const PixelMap_t &value) { // Thread unsafe PixCoralClient class is used.
   attribute_list["VALUE"].setValue(PixCoralClient::PixelMapToCLOB(value));
 }
 
@@ -1949,7 +1950,7 @@ namespace PixA {
 
 
 
-  unsigned int encodePixelID(unsigned int mod_column, unsigned int mod_row) {
+  unsigned int encodePixelID ATLAS_NOT_THREAD_SAFE (unsigned int mod_column, unsigned int mod_row) { // Thread unsafe ModuleSpecialPixelMap class is used.
     unsigned int chip = 0, column = 0, row = 0;
 
     PixelCoord_t pix(mod_column, mod_row);
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx
index 06529283c1c3..faf5406a9322 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PCDDb.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelCoralClientUtils/PCDDb.h"
@@ -28,6 +28,8 @@
 #include "RelationalAccess/IBulkOperation.h"
 #include "RelationalAccess/SchemaException.h"
 
+#include "CxxUtils/checker_macros.h"
+
 // std lib
 #include <fstream>
 #include <iostream>
@@ -80,7 +82,7 @@ PCDDb::~PCDDb()
   }
 }
 
-bool PCDDb::init(std::string tag, int revision)
+bool PCDDb::init ATLAS_NOT_THREAD_SAFE (std::string tag, int revision) // Thread unsafe coral::AttributeList class is used.
 {
   if (m_verbose) cout << "PCDDb::init(" << tag << ", " << revision << ")" << endl;
 
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc
index e4aec7d6bc36..11a5f32b58ec 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibCoralCoolDb.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelCoralClientUtils/PixCalibCoralCoolDb.h"
@@ -13,6 +13,8 @@
 #include "CoraCool/CoraCoolObjectIter.h"
 #include "CoraCool/CoraCoolObject.h"
 
+#include "CxxUtils/checker_macros.h"
+
 // std lib
 #include <fstream>
 #include <iostream>
@@ -102,7 +104,7 @@ bool PixCalibCoralCoolDb::load(cool::ValidityKey vkx)
   return true;
 }
 
-bool PixCalibCoralCoolDb::saveCalibData( string textfile , long long FK )
+bool PixCalibCoralCoolDb::saveCalibData ATLAS_NOT_THREAD_SAFE ( string textfile , long long FK ) // Thread unsafe coral::AttributeList class is used.
 {
   cool::RecordSpecification payloadspec;
   // primary / foreign keys
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc
index 84f789995b4e..151e8b8c4690 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/PixCalibKnowledgeDb.cc
@@ -1,9 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelCoralClientUtils/PixCalibKnowledgeDb.h"
 
+#include "CxxUtils/checker_macros.h"
+
 // CORAL API
 #include "CoralKernel/Context.h"
 #include "CoralBase/Attribute.h"
@@ -67,7 +69,8 @@ void PixCalibKnowledgeDb::init(coral::AccessMode access_mode)
   if (m_verbose) cout << "Connection established" << endl;
 }
 
-void PixCalibKnowledgeDb::saveCorrespondingConfig(long int UNIXTimeInSeconds, long int RunNumber, std::string calibtags_in_string, std::string idTag, std::string connTag, std::string cfgTag, std::string cfgModTag )
+void PixCalibKnowledgeDb::saveCorrespondingConfig ATLAS_NOT_THREAD_SAFE // Thread unsafe coral::AttributeList class and createTable method are used.
+(long int UNIXTimeInSeconds, long int RunNumber, std::string calibtags_in_string, std::string idTag, std::string connTag, std::string cfgTag, std::string cfgModTag )
 {
 
    // create tables if needed
@@ -116,7 +119,7 @@ void PixCalibKnowledgeDb::saveCorrespondingConfig(long int UNIXTimeInSeconds, lo
 }
 
 //for reading back calibrationTags corresponding to a given time, not sure if this is needed
-void PixCalibKnowledgeDb::readCorrespondingCalibTag(long int Utime){
+void PixCalibKnowledgeDb::readCorrespondingCalibTag ATLAS_NOT_THREAD_SAFE (long int Utime){ // Thread unsafe coral::AttributeList class is used.
 
   transactionStartReadOnly();
   //build a query
@@ -169,7 +172,7 @@ void PixCalibKnowledgeDb::readCorrespondingCalibTag(long int Utime){
 
 /** part of save(): create new tables
  */
-void PixCalibKnowledgeDb::createTable()
+void PixCalibKnowledgeDb::createTable ATLAS_NOT_THREAD_SAFE () // Thread unsafe createAuxTables method is used.
 {
   createConfigurationTable();
   createAuxTables();
@@ -201,7 +204,7 @@ void PixCalibKnowledgeDb::createConfigurationTable()
 
 /** part of save(): create key table
  */
-void PixCalibKnowledgeDb::createAuxTables()
+void PixCalibKnowledgeDb::createAuxTables ATLAS_NOT_THREAD_SAFE () // Thread unsafe coral::AttributeList class is used.
 {
   transactionStartUpdate();
   string FK_TABLE = "CALIB_KEYGEN";
@@ -224,7 +227,7 @@ void PixCalibKnowledgeDb::createAuxTables()
 
 /** part of save(): update the key
  */
-long long PixCalibKnowledgeDb::updateKey()
+long long PixCalibKnowledgeDb::updateKey ATLAS_NOT_THREAD_SAFE () // Thread unsafe coral::AttributeList class is used.
 {
   std::string FK_TABLE = "CALIB_KEYGEN";
   transactionStartUpdate();
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc
index 3737586252f4..754538be9967 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractAnalysis.cc
@@ -1,7 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 #include "PixelCoralClientUtils/PixelCalibData.hh"
 
@@ -12,7 +13,7 @@
 #include<fstream>
 using namespace std;
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe const_iterator end is used.
 
   int iarg = 1;
   bool verbose = false;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc
index dd56a6e3efd5..a978c8e19d1f 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/extractSPM.cc
@@ -1,7 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/CoralClient.hh"
 #include "PixelCoralClientUtils/SpecialPixelMap.hh"
 
@@ -12,7 +13,7 @@
 #include<fstream>
 using namespace std;
 
-int main(int argc, char **argv){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv){ // Thread unsafe const_iterator end is used.
 
   int iarg = 1;
   bool verbose = false;
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc
index 5a8955d6a85e..c79e79ca491c 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/talkToPCDDb.cc
@@ -1,7 +1,8 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCoralClientUtils/PCDio.h"
 ////#include "PixelCoralClientUtils/PixelCalibData.hh"
 
@@ -11,7 +12,7 @@
 
 using namespace std;
 
-int main(int argc, char **argv)
+int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv) // Thread unsafe PCDio class is used.
 {
   if (argc<3 || argv[1][0]!='-') {
     cout << argv[0] << ": tool to talk to pixel coral database." << endl;
diff --git a/InnerDetector/InDetValidation/PixelRTT/Application/doPixelValidation.cxx b/InnerDetector/InDetValidation/PixelRTT/Application/doPixelValidation.cxx
index caacdfc1abf8..09979ea10489 100644
--- a/InnerDetector/InDetValidation/PixelRTT/Application/doPixelValidation.cxx
+++ b/InnerDetector/InDetValidation/PixelRTT/Application/doPixelValidation.cxx
@@ -1,17 +1,18 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <iostream>
 #include <string>
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelRTT/OfflineCalibOutputTrack.h"
 
 using namespace PixelValid;
 
 int doAll(std::string input, std::string output, std::string reference, int maxentries);
 
-int main(int argc, char *argv[]){
+int main ATLAS_NOT_THREAD_SAFE (int argc, char *argv[]){ // Thread unsafe doAll function is used.
 
 	if(argc < 3 || argc > 5){
 		std::cout << std::endl;
@@ -43,7 +44,7 @@ int main(int argc, char *argv[]){
 
 
 /// the function that actually implements things!!
-int doAll(std::string input, std::string output, std::string reference, int maxentries){
+int doAll ATLAS_NOT_THREAD_SAFE (std::string input, std::string output, std::string reference, int maxentries){ // Thread unsafe OfflineCalibOutputTrack class is used.
 
 	OfflineCalibOutputTrack *s = 0;
 
diff --git a/InnerDetector/InDetValidation/PixelRTT/PixelRTT/OfflineCalibOutputTrack.h b/InnerDetector/InDetValidation/PixelRTT/PixelRTT/OfflineCalibOutputTrack.h
index 90f985d19866..3e036c3edcd5 100644
--- a/InnerDetector/InDetValidation/PixelRTT/PixelRTT/OfflineCalibOutputTrack.h
+++ b/InnerDetector/InDetValidation/PixelRTT/PixelRTT/OfflineCalibOutputTrack.h
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef OfflineCalibOutputTrack_h
 #define OfflineCalibOutputTrack_h
 
+#include "CxxUtils/checker_macros.h"
 #include "PixelCalibAlgs/PixelNtupleTracks.h"
 
 class string;
@@ -20,7 +21,7 @@ namespace PixelValid{
 
 class ResPullValidation;
 
-class OfflineCalibOutputTrack: public PixelNtupleTracks {
+class ATLAS_NOT_THREAD_SAFE OfflineCalibOutputTrack: public PixelNtupleTracks { // Thread unsafe PixelChargeInterpolationCalibration class is used.
 
   //forbid copying
   OfflineCalibOutputTrack(const OfflineCalibOutputTrack &) = delete;
-- 
GitLab


From f225e2c10d192e81153f5b6cdf9d7da7e1575e96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Mon, 6 Jul 2020 19:22:53 +0200
Subject: [PATCH 064/217] use MuonDetectorManager from conditions store in
 TrigL2MuonSA and TrigT1RPCsteering

---
 .../TrigL2MuonSA/src/CscSegmentMaker.cxx      | 52 +++++++++----------
 .../TrigL2MuonSA/src/CscSegmentMaker.h        | 19 +++----
 .../TrigL2MuonSA/src/MdtDataPreparator.cxx    | 39 +++++++-------
 .../TrigL2MuonSA/src/MdtDataPreparator.h      | 17 +++---
 .../TrigL2MuonSA/src/MdtRegionDefiner.cxx     | 15 +++---
 .../TrigL2MuonSA/src/MdtRegionDefiner.h       |  8 +--
 .../TrigT1RPCsteering/TrigT1RPC.h             |  4 +-
 .../TrigT1RPCsteering/src/TrigT1RPC.cxx       | 17 +++---
 8 files changed, 81 insertions(+), 90 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx
index adf9767950ad..9a42898f10b7 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx
@@ -24,22 +24,22 @@ CscSegmentMaker::CscSegmentMaker(const std::string& type, const std::string& nam
 }
 
 
-StatusCode CscSegmentMaker :: initialize(){
-
-  ATH_CHECK( m_cscregdict.retrieve() );
-
-  ATH_CHECK( detStore()->retrieve(m_muonMgr) );
-
+StatusCode CscSegmentMaker::initialize(){
+  ATH_CHECK(m_cscregdict.retrieve());
+  ATH_CHECK(m_muDetMgrKey.initialize());
+  ATH_CHECK(m_idHelperSvc.retrieve());
   return StatusCode::SUCCESS;
 }
 
 
-ReturnCode CscSegmentMaker :: FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits,
+ReturnCode CscSegmentMaker::FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits,
                                                 std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns,
                                                 const TrigL2MuonSA::TgcFitResult &tgcFitResult,
                                                 const TrigL2MuonSA::MuonRoad &muroad)
 {
   ATH_MSG_DEBUG( "FindSuperPointCsc" );
+  SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+  const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
   
   if( !cscHits.empty() ){
     
@@ -83,7 +83,7 @@ ReturnCode CscSegmentMaker :: FindSuperPointCsc( const TrigL2MuonSA::CscHits &cs
           
 	  //making segment
 	  CscSegment cscsegment, cscsegment_noip;
-	  if (this->make_segment(hashSP, clusters[hashSP] , cscsegment, cscsegment_noip) != ReturnCode::FAILURE  ){
+	  if (this->make_segment(hashSP, clusters[hashSP] , cscsegment, cscsegment_noip, muDetMgr) != ReturnCode::FAILURE  ){
 	    found_segment=true;
 	    (*itTrack).hashID_CSC = hashSP;
 
@@ -141,9 +141,9 @@ ReturnCode CscSegmentMaker :: FindSuperPointCsc( const TrigL2MuonSA::CscHits &cs
 
 
 
-ReturnCode  CscSegmentMaker :: make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8],
+ReturnCode  CscSegmentMaker::make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8],
                                             CscSegment &cscsegment,
-                                            CscSegment &cscsegment_noip)
+                                            CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr)
 {
   ATH_MSG_DEBUG("################################## make_segment #####################################");
   
@@ -158,10 +158,8 @@ ReturnCode  CscSegmentMaker :: make_segment(int mod_hash, TrigL2MuonSA::CscHits
  
   Amg::Transform3D gToLocal;
   if(m_use_geometry){
-    const CscIdHelper *idHelper = m_muonMgr->cscIdHelper();
-
-    Identifier Id = idHelper->channelID(m_cscregdict->stationName(mod_hash), m_cscregdict->stationEta(mod_hash),m_cscregdict->stationPhi(mod_hash),2/*chamberLayer*/, 1, 0, 1);
-    const MuonGM::CscReadoutElement *csc = m_muonMgr->getCscReadoutElement(Id);
+    Identifier Id = m_idHelperSvc->cscIdHelper().channelID(m_cscregdict->stationName(mod_hash), m_cscregdict->stationEta(mod_hash),m_cscregdict->stationPhi(mod_hash),2/*chamberLayer*/, 1, 0, 1);
+    const MuonGM::CscReadoutElement *csc = muDetMgr->getCscReadoutElement(Id);
     if (csc == NULL){
       ATH_MSG_DEBUG( "Csc Readout Element not found ---- skip");
       return ReturnCode::FAILURE;
@@ -260,7 +258,7 @@ ReturnCode  CscSegmentMaker :: make_segment(int mod_hash, TrigL2MuonSA::CscHits
 }
 
 
-  ReturnCode CscSegmentMaker :: make_2dsegment(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4],
+  ReturnCode CscSegmentMaker::make_2dsegment(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4],
                                              local2dSegment &seg2d,
                                              local2dSegment &seg2d_ipremoved,
                                              int &nhit)
@@ -321,11 +319,11 @@ ReturnCode  CscSegmentMaker :: make_segment(int mod_hash, TrigL2MuonSA::CscHits
   
   if( this->fit_clusters(measphi,seg2d.localHits,seg2d_ipremoved)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
   
-  return ReturnCode :: SUCCESS;
+  return ReturnCode::SUCCESS;
   
 }
 
-ReturnCode CscSegmentMaker :: make_2dseg4hit(int measphi, const localCscHit &ip_loc,
+ReturnCode CscSegmentMaker::make_2dseg4hit(int measphi, const localCscHit &ip_loc,
                                              std::vector<localCscHit>  hits_loc[4], //removing hits used in fit with 4 hits
                                              std::vector<local2dSegment> &seg2d_4hitCollection,
                                              int &nhit)
@@ -392,7 +390,7 @@ ReturnCode CscSegmentMaker :: make_2dseg4hit(int measphi, const localCscHit &ip_
 }
 
 
-ReturnCode CscSegmentMaker :: make_2dseg3hit(int measphi, const localCscHit &ip_loc,
+ReturnCode CscSegmentMaker::make_2dseg3hit(int measphi, const localCscHit &ip_loc,
                                              const std::vector<localCscHit> hits_loc[4],
                                              std::vector<local2dSegment> &seg2d_3hitCollection,
                                              int &nhit)
@@ -453,7 +451,7 @@ ReturnCode CscSegmentMaker :: make_2dseg3hit(int measphi, const localCscHit &ip_
 }
 
 
-ReturnCode CscSegmentMaker :: fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d){
+ReturnCode CscSegmentMaker::fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d){
   
   
   double S=0.;
@@ -533,7 +531,7 @@ ReturnCode CscSegmentMaker :: fit_clusters(int measphi, const std::vector<localC
 
 
 
-ReturnCode CscSegmentMaker :: make_4dsegment(const local2dSegment &seg2d_eta,
+ReturnCode CscSegmentMaker::make_4dsegment(const local2dSegment &seg2d_eta,
                                              const local2dSegment &seg2d_phi,
                                              Amg::Vector3D &seg_pos,
                                              Amg::Vector3D &seg_dir)
@@ -580,7 +578,7 @@ ReturnCode CscSegmentMaker :: make_4dsegment(const local2dSegment &seg2d_eta,
 
 
 
-ReturnCode CscSegmentMaker :: getModuleSP(int mod_hashes[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const MuonRoad &muroad, const int hash_clusters[32]){
+ReturnCode CscSegmentMaker::getModuleSP(int mod_hashes[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const MuonRoad &muroad, const int hash_clusters[32]){
   ATH_MSG_DEBUG("getModuleSP()");
   
   
@@ -625,7 +623,7 @@ ReturnCode CscSegmentMaker :: getModuleSP(int mod_hashes[2], const TrigL2MuonSA:
 }
 
 
-CscSegment CscSegmentMaker :: segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg){
+CscSegment CscSegmentMaker::segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg){
   
   
   double alpha = m_cscregdict->displacement(mod_hash);
@@ -647,7 +645,7 @@ CscSegment CscSegmentMaker :: segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::Cs
 
 
 
-ReturnCode CscSegmentMaker :: display_hits(const std::vector<localCscHit> localHits[4]){
+ReturnCode CscSegmentMaker::display_hits(const std::vector<localCscHit> localHits[4]){
   
   
   for(unsigned int ilyr=0; ilyr<4; ++ilyr){
@@ -665,7 +663,7 @@ ReturnCode CscSegmentMaker :: display_hits(const std::vector<localCscHit> localH
 
 
 
-CscSegment :: CscSegment(){
+CscSegment::CscSegment(){
 
   m_x=0.;
   m_y=0.;
@@ -681,7 +679,7 @@ CscSegment :: CscSegment(){
   m_chisquare_phi=0.;
 }
 
-ReturnCode CscSegment :: set(double x, double y, double z, double px, double py, double pz, double chisquare, double chisquare_phi)
+ReturnCode CscSegment::set(double x, double y, double z, double px, double py, double pz, double chisquare, double chisquare_phi)
 {
   
   m_x=x;
@@ -700,7 +698,7 @@ ReturnCode CscSegment :: set(double x, double y, double z, double px, double py,
   
 }
 
-ReturnCode CscSegment :: set( Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir, double chisquare, double chisquare_phi)
+ReturnCode CscSegment::set( Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir, double chisquare, double chisquare_phi)
 {
   
   m_x = seg_pos(Amg::x);
@@ -721,7 +719,7 @@ ReturnCode CscSegment :: set( Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir, do
 
 
 
-bool CscSegment :: isClean(){
+bool CscSegment::isClean(){
   
   bool eta_clean=false;
   bool phi_clean=false;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h
index 932f2cb1d6cc..6fb3b3bba95c 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h
@@ -7,10 +7,12 @@
 
 
 #include "AthenaBaseComps/AthAlgTool.h"
-
-#include "GaudiKernel/Service.h"
+#include "GaudiKernel/ServiceHandle.h"
 
 #include "GeoPrimitives/GeoPrimitives.h"
+#include "MuonIdHelpers/IMuonIdHelperSvc.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
 
 #include "TrackData.h"
 #include "TgcFitResult.h"
@@ -18,14 +20,9 @@
 #include "CscData.h"
 #include "CscRegUtils.h"
 
+#include <string>
 #include <vector>
 
-
-namespace MuonGM{
-  class MuonDetectorManager;
-}
-
-
 namespace TrigL2MuonSA{
 
   class CscSegment;
@@ -69,7 +66,7 @@ namespace TrigL2MuonSA{
     ReturnCode	FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits, std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MuonRoad &muroad);
 
 
-    ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip );
+    ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr);
 
     ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc,const std::vector<localCscHit> hits_loc[4], local2dSegment &seg2d_eta,local2dSegment &local2d_noip, int &nhite);
 
@@ -92,8 +89,8 @@ namespace TrigL2MuonSA{
     UtilTools m_util;
     ToolHandle<CscRegDict> m_cscregdict {
       this, "CscRegDict", "TrigL2MuonSA::CscRegDict", ""};
-    const MuonGM::MuonDetectorManager *m_muonMgr {nullptr};
-
+    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; 
 
     //properties
     Gaudi::Property< bool > m_use_geometry {
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
index 14b5ccceda87..c51e1bbd63fe 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx
@@ -83,8 +83,10 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::initialize()
 
   ATH_CHECK( m_readKey.initialize() );
 
-  // retrieve the mdtidhelper
-  ATH_CHECK( detStore()->retrieve(m_muonMgr,"Muon") );
+  ATH_CHECK(m_muDetMgrKey.initialize());
+
+  const MuonGM::MuonDetectorManager* muonDetMgr=nullptr;
+  ATH_CHECK( detStore()->retrieve(muonDetMgr,"Muon") );
   ATH_MSG_DEBUG("Retrieved GeoModel from DetectorStore.");
   ATH_CHECK( m_idHelperSvc.retrieve() );
 
@@ -99,10 +101,10 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::initialize()
     for(int phi=6; phi<8; phi++) { // phi sectors - BMGs are ony in (6 aka 12) and (7 aka 14)
       for(int eta=1; eta<4; eta++) { // eta sectors - BMGs are in eta 1 to 3
 	for(int side=-1; side<2; side+=2) { // side - both sides have BMGs
-	  if( !m_muonMgr->getMuonStation("BMG", side*eta, phi) ) continue;
-	  for(int roe=1; roe<=( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
+	  if( !muonDetMgr->getMuonStation("BMG", side*eta, phi) ) continue;
+	  for(int roe=1; roe<=( muonDetMgr->getMuonStation("BMG", side*eta, phi) )->nMuonReadoutElements(); roe++) { // iterate on readout elemets
 	    const MuonGM::MdtReadoutElement* mdtRE =
-	      dynamic_cast<const MuonGM::MdtReadoutElement*> ( ( m_muonMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
+	      dynamic_cast<const MuonGM::MdtReadoutElement*> ( ( muonDetMgr->getMuonStation("BMG", side*eta, phi) )->getMuonReadoutElement(roe) ); // has to be an MDT
 	    if(mdtRE) initDeadChannels(mdtRE);
 	  }
 	}
@@ -130,9 +132,6 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::prepareData(const LVL1::RecMuonRoI*
 							TrigL2MuonSA::MdtHits&   mdtHits_normal,
 							TrigL2MuonSA::MdtHits&   mdtHits_overlap)
 {
-
-  m_mdtRegionDefiner->setMdtGeometry(m_muonMgr);
-
   // define regions
   ATH_CHECK( m_mdtRegionDefiner->getMdtRegions(p_roi, rpcFitResult, muonRoad, mdtRegion) );
 
@@ -152,9 +151,6 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::prepareData(const LVL1::RecMuonRoI*
 							TrigL2MuonSA::MdtHits&            mdtHits_normal,
 							TrigL2MuonSA::MdtHits&            mdtHits_overlap)
 {
-
-  m_mdtRegionDefiner->setMdtGeometry(m_muonMgr);
-  
   // define regions
   ATH_CHECK( m_mdtRegionDefiner->getMdtRegions(p_roi, tgcFitResult, muonRoad, mdtRegion) );
 
@@ -174,6 +170,8 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::getMdtHits(const LVL1::RecMuonRoI*
 						       TrigL2MuonSA::MdtHits& mdtHits_normal,
 						       TrigL2MuonSA::MdtHits& mdtHits_overlap)
 {
+  SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+  const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
   if (m_use_mdtcsm) {
 
     // preload ROBs
@@ -277,7 +275,7 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::getMdtHits(const LVL1::RecMuonRoI*
     ATH_MSG_DEBUG("decoding MdtCsm (normal)...");
     bool Endcap_Mid=false;
     for(unsigned int i=0; i<v_mdtCsms_normal.size(); i++) {
-      if (!decodeMdtCsm(v_mdtCsms_normal[i], mdtHits_normal, muonRoad)) return StatusCode::FAILURE;
+      if (!decodeMdtCsm(v_mdtCsms_normal[i], mdtHits_normal, muonRoad, muDetMgr)) return StatusCode::FAILURE;
       if(muonRoad.isEndcap){
         int midN=0;
         for(unsigned int ti=0; ti<mdtHits_normal.size(); ti++){
@@ -288,12 +286,12 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::getMdtHits(const LVL1::RecMuonRoI*
     }
     ATH_MSG_DEBUG("decoding MdtCsm (overlap)...");
     for(unsigned int i=0; i<v_mdtCsms_overlap.size(); i++) {
-      if (!decodeMdtCsm(v_mdtCsms_overlap[i],mdtHits_overlap, muonRoad)) return StatusCode::FAILURE;
+      if (!decodeMdtCsm(v_mdtCsms_overlap[i],mdtHits_overlap, muonRoad, muDetMgr)) return StatusCode::FAILURE;
     }
     
     if(Endcap_Mid || v_mdtCsms_normal.size() == 0){
       for(unsigned int i=0; i<v_mdtCsms_overlap.size(); i++) {
-        if (!decodeMdtCsm(v_mdtCsms_overlap[i],mdtHits_normal, muonRoad)) return StatusCode::FAILURE;
+        if (!decodeMdtCsm(v_mdtCsms_overlap[i],mdtHits_normal, muonRoad, muDetMgr)) return StatusCode::FAILURE;
       }
     }
 
@@ -323,7 +321,7 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::getMdtHits(const LVL1::RecMuonRoI*
       m_regionSelector->DetROBIDListUint(MDT, v_robIds);
     }
 
-    ATH_CHECK( collectMdtHitsFromPrepData(mdtHashList, v_robIds, mdtHits_normal, muonRoad) );
+    ATH_CHECK( collectMdtHitsFromPrepData(mdtHashList, v_robIds, mdtHits_normal, muonRoad, muDetMgr) );
 
   }
 
@@ -427,7 +425,7 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::getMdtCsm(const MdtCsmContainer* pMd
 
 bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm,
 						   TrigL2MuonSA::MdtHits& mdtHits,
-						   const TrigL2MuonSA::MuonRoad& muonRoad)
+						   const TrigL2MuonSA::MuonRoad& muonRoad, const MuonGM::MuonDetectorManager* muDetMgr)
 {    
 
    if( csm->empty() ) return true;
@@ -502,7 +500,7 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm,
        continue;
      }
      
-     m_mdtReadout = m_muonMgr->getMdtRElement_fromIdFields(StationName, StationEta, StationPhi,MultiLayer);
+     m_mdtReadout = muDetMgr->getMdtRElement_fromIdFields(StationName, StationEta, StationPhi,MultiLayer);
      if (!m_mdtReadout) {
        ++amt;
        continue;
@@ -541,7 +539,7 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm,
      if(m_BMGpresent) {
        Identifier tubeId = m_idHelperSvc->mdtIdHelper().channelID(StationName, StationEta, StationPhi, MultiLayer, Layer, Tube);
        if(m_idHelperSvc->mdtIdHelper().stationName(tubeId) == m_BMGid ) {
-         std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( m_muonMgr->getMdtReadoutElement(tubeId)->identify() );
+         std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( muDetMgr->getMdtReadoutElement(tubeId)->identify() );
          if( myIt != m_DeadChannels.end() ){
            if( std::find( (myIt->second).begin(), (myIt->second).end(), tubeId) != (myIt->second).end() ) {
              ATH_MSG_DEBUG("Skipping tube with identifier " << m_idHelperSvc->mdtIdHelper().show_to_string(tubeId) );
@@ -815,7 +813,8 @@ void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesEndcap(const TrigL2MuonSA::M
 StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std::vector<IdentifierHash>& v_idHash,
 								       std::vector<uint32_t>& v_robIds,
 								       TrigL2MuonSA::MdtHits& mdtHits,
-								       const TrigL2MuonSA::MuonRoad& muonRoad)
+								       const TrigL2MuonSA::MuonRoad& muonRoad,
+                       const MuonGM::MuonDetectorManager* muDetMgr)
 {
   if(m_doDecoding) {
     if(m_decodeBS) {
@@ -918,7 +917,7 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std
 
       double R = -99999., Z = -99999.;
       if(m_BMGpresent && m_idHelperSvc->mdtIdHelper().stationName(id) == m_BMGid ) {
-        std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( m_muonMgr->getMdtReadoutElement(id)->identify() );
+        std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find( muDetMgr->getMdtReadoutElement(id)->identify() );
         if( myIt != m_DeadChannels.end() ){
           if( std::find( (myIt->second).begin(), (myIt->second).end(), id) != (myIt->second).end() ) {
             ATH_MSG_DEBUG("Skipping tube with identifier " << m_idHelperSvc->mdtIdHelper().show_to_string(id) );
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h
index 8e97d675adef..f8a1230c4b76 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h
@@ -18,6 +18,10 @@
 #include "MuonRDO/MdtCsmContainer.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
+#include "MuonCablingData/MuonMDT_CablingMap.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
 
 #include "TgcData.h"
 #include "MdtData.h"
@@ -27,13 +31,7 @@
 #include "RpcFitResult.h"
 #include "TgcFitResult.h"
 
-#include "MuonCablingData/MuonMDT_CablingMap.h"
-#include "StoreGate/ReadCondHandleKey.h"
-
-#include "MuonPrepRawData/MuonPrepDataContainer.h"
-
 namespace MuonGM{
-     class MuonDetectorManager;
      class MdtReadoutElement;
      class MuonStation;
 }
@@ -104,13 +102,14 @@ namespace TrigL2MuonSA {
 			 const std::vector<IdentifierHash>& v_idHash,
 			 std::vector<const MdtCsm*>& v_mdtCsms);
 
-    bool decodeMdtCsm(const MdtCsm* csm, TrigL2MuonSA::MdtHits& mdtHits, const TrigL2MuonSA::MuonRoad& muonRoad);
+    bool decodeMdtCsm(const MdtCsm* csm, TrigL2MuonSA::MdtHits& mdtHits, const TrigL2MuonSA::MuonRoad& muonRoad, const MuonGM::MuonDetectorManager* muDetMgr);
     uint32_t get_system_id (unsigned short int SubsystemId) const;
 
     StatusCode collectMdtHitsFromPrepData(const std::vector<IdentifierHash>& v_idHash,
 					  std::vector<uint32_t>& v_robIds,
 					  TrigL2MuonSA::MdtHits& mdtHits,
-					  const TrigL2MuonSA::MuonRoad& muonRoad);
+					  const TrigL2MuonSA::MuonRoad& muonRoad,
+            const MuonGM::MuonDetectorManager* muDetMgr);
 
     void initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl);
 
@@ -122,7 +121,6 @@ namespace TrigL2MuonSA {
 
 
     // Geometry Services
-    const MuonGM::MuonDetectorManager* m_muonMgr {nullptr};
     const MuonGM::MdtReadoutElement* m_mdtReadout {nullptr};
     const MuonGM::MuonStation* m_muonStation {nullptr};
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
@@ -149,6 +147,7 @@ namespace TrigL2MuonSA {
 	this, "MDTCSMContainer", "MDTCSM", "Name of the MDTRDO to read in"};
     SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_mdtPrepContainerKey{
 	this, "MDTPrepDataContainer","MDT_DriftCircles", "Name of the MDTContainer to read in"};
+    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; 
 
     // Flag to decide if we need to run the actual decoding (in MT setup, we can use offline code for this)
     Gaudi::Property<bool> m_doDecoding{ this, "DoDecoding", true, "Flag to decide if we need to do decoding of the MDTs" };
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
index fa2ab5677d25..a6946c94e455 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx
@@ -27,6 +27,7 @@ TrigL2MuonSA::MdtRegionDefiner::MdtRegionDefiner(const std::string& type,
 
 StatusCode TrigL2MuonSA::MdtRegionDefiner::initialize()
 {
+  ATH_CHECK(m_muDetMgrKey.initialize());
   ATH_CHECK(m_idHelperSvc.retrieve());
   return StatusCode::SUCCESS;
 }
@@ -48,6 +49,9 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
 
   int endcap_inner = xAOD::L2MuonParameters::Chamber::EndcapInner;
 
+  SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+  const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
+
   for(int i_station=0; i_station<6; i_station++) {
     int chamber = 0;
     if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::BarrelInner;
@@ -96,15 +100,13 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
 	    ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
 	  else if(ty2 == -1)
 	    ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
-	  m_mdtReadout = m_muonMgr->getMdtReadoutElement(id);
+	  m_mdtReadout = muDetMgr->getMdtReadoutElement(id);
 	  m_muonStation = m_mdtReadout->parentMuonStation();
 	  
 	  Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal());
-	  //HepGeom::Transform3D* trans = m_muonStation->getNominalAmdbLRSToGlobal();
 	  
 	  Amg::Vector3D OrigOfMdtInAmdbFrame = 
 	    Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() );
-	  //	    HepPoint3D OrigOfMdtInAmdbFrame = m_muonStation->getBlineFixedPointInAmdbLRS();
 	  
 	  tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp();
 	  tmp_rMax = tmp_rMin+m_muonStation->Rsize();
@@ -205,6 +207,9 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
   int barrel_inner = xAOD::L2MuonParameters::Chamber::BarrelInner;
   int bee = xAOD::L2MuonParameters::Chamber::BEE;
 
+  SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+  const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
+
   for(int i_station=0; i_station<7; i_station++) {
     int chamber = 0;
     if (i_station==0) chamber = xAOD::L2MuonParameters::Chamber::EndcapInner;
@@ -256,16 +261,14 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI*
 	    ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
 	  else if(ty2 == -1)
 		ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1;
-	  m_mdtReadout = m_muonMgr->getMdtReadoutElement(id);
+	  m_mdtReadout = muDetMgr->getMdtReadoutElement(id);
 	  m_muonStation = m_mdtReadout->parentMuonStation();
 	  float scale = 10.;
 	  
 	  Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal());
-	  //HepGeom::Transform3D* trans = m_muonStation->getNominalAmdbLRSToGlobal();
 	  
 	  Amg::Vector3D OrigOfMdtInAmdbFrame = 
 	    Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() );
-	  //	    HepPoint3D OrigOfMdtInAmdbFrame = m_muonStation->getBlineFixedPointInAmdbLRS();
 	  
 	  tmp_zMin = (trans*OrigOfMdtInAmdbFrame).z();
 	  if(tmp_zMin < 0) sign = -1;
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h
index 505731a7471e..4e5e8ac0f4da 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h
@@ -10,6 +10,8 @@
 
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "TrigT1Interfaces/RecMuonRoI.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
 
 #include "TgcFit.h"
 #include "TgcData.h"
@@ -22,7 +24,6 @@
 #include <string>
 
 namespace MuonGM {
-     class MuonDetectorManager;
      class MdtReadoutElement;
      class MuonStation;
 }
@@ -43,8 +44,6 @@ namespace TrigL2MuonSA {
     
     virtual StatusCode initialize() override;
 
-    // function using the new cabling/geometry
-    void setMdtGeometry(const MuonGM::MuonDetectorManager* muonMgr) {m_muonMgr = muonMgr;};
     void setRpcGeometry(bool use_rpc){m_use_rpc = use_rpc;};
     
   public:
@@ -83,7 +82,8 @@ namespace TrigL2MuonSA {
 
   private:
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-    const MuonGM::MuonDetectorManager* m_muonMgr {nullptr}; // assined by setMdtGeometry()
+    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; 
+
     const MuonGM::MdtReadoutElement* m_mdtReadout {nullptr};
     const MuonGM::MuonStation* m_muonStation {nullptr};
     
diff --git a/Trigger/TrigT1/TrigT1RPCsteering/TrigT1RPCsteering/TrigT1RPC.h b/Trigger/TrigT1/TrigT1RPCsteering/TrigT1RPCsteering/TrigT1RPC.h
index 23749760489b..60da647d2647 100755
--- a/Trigger/TrigT1/TrigT1RPCsteering/TrigT1RPCsteering/TrigT1RPC.h
+++ b/Trigger/TrigT1/TrigT1RPCsteering/TrigT1RPCsteering/TrigT1RPC.h
@@ -71,10 +71,10 @@ private:
   
   BooleanProperty m_useRun3Config{this,"useRun3Config",false};         // flag for using switch between Run3 and Run2 configurations
   
-  StatusCode fill_RPCdata(RPCsimuData&, const RpcCablingCondData* readCdo);
+  StatusCode fill_RPCdata(RPCsimuData&, const RpcCablingCondData* readCdo, const MuonGM::MuonDetectorManager* muDetMgr);
 
  private:
-  const MuonGM::MuonDetectorManager* m_MuonMgr;
+  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; 
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
   SG::ReadCondHandleKey<RpcCablingCondData> m_readKey{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
diff --git a/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx b/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
index 7db2f2d96118..cd5d5e053d1b 100755
--- a/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
+++ b/Trigger/TrigT1/TrigT1RPCsteering/src/TrigT1RPC.cxx
@@ -29,7 +29,6 @@ static int digit_out = 0;
 
 TrigT1RPC::TrigT1RPC(const std::string& name, ISvcLocator* pSvcLocator) :
   AthAlgorithm(name, pSvcLocator),
-  m_MuonMgr(nullptr),
   m_cabling_getter("RPCcablingServerSvc/RPCcablingServerSvc","TrigT1RPC"),
   m_cabling(nullptr) {
 }
@@ -38,20 +37,14 @@ TrigT1RPC::TrigT1RPC(const std::string& name, ISvcLocator* pSvcLocator) :
 
 StatusCode TrigT1RPC::initialize(){
     ATH_MSG_INFO("Initializing");
-    
-    ATH_CHECK(detStore()->retrieve( m_MuonMgr ));
     ATH_CHECK(m_idHelperSvc.retrieve());
-    
     ATH_CHECK(m_cabling_getter.retrieve());
     ATH_CHECK(m_cabling_getter->giveCabling(m_cabling));
-
     ATH_CHECK(m_readKey.initialize());
-    
     ATH_CHECK(m_rpcDigitKey.initialize());
-
     ATH_CHECK(m_muctpiPhase1Key.initialize(m_useRun3Config));
     ATH_CHECK(m_muctpiKey.initialize(!m_useRun3Config));
-    
+    ATH_CHECK(m_muDetMgrKey.initialize());
     return StatusCode::SUCCESS;
 }
  
@@ -67,9 +60,11 @@ StatusCode TrigT1RPC::execute() {
 
     SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey, Gaudi::Hive::currentContext()};
     const RpcCablingCondData* readCdo{*readHandle};
+    SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+    const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
     
     RPCsimuData data;         // instanciate the container for the RPC digits
-    CHECK(fill_RPCdata(data, readCdo));  // fill the data with RPC simulated digts
+    CHECK(fill_RPCdata(data, readCdo, muDetMgr));  // fill the data with RPC simulated digts
     
     ATH_MSG_DEBUG(
         "RPC data loaded from G3:" << std::endl
@@ -264,7 +259,7 @@ StatusCode TrigT1RPC::execute() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode TrigT1RPC::fill_RPCdata(RPCsimuData& data, const RpcCablingCondData* readCdo)
+StatusCode TrigT1RPC::fill_RPCdata(RPCsimuData& data, const RpcCablingCondData* readCdo, const MuonGM::MuonDetectorManager* muDetMgr)
 {
     std::string space = "                          ";
 
@@ -314,7 +309,7 @@ StatusCode TrigT1RPC::fill_RPCdata(RPCsimuData& data, const RpcCablingCondData*
                     int Strip               = m_idHelperSvc->rpcIdHelper().strip(channelId);
                     
                     const MuonGM::RpcReadoutElement* descriptor =
-                                    m_MuonMgr->getRpcReadoutElement(channelId);
+                                    muDetMgr->getRpcReadoutElement(channelId);
 
 		    //Get the global position of RPC strip from MuonDetDesc
 		    Amg::Vector3D pos = descriptor->stripPos(channelId);		    
-- 
GitLab


From c84af12215e69a41574f374c3db0bd63ab208b21 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Mon, 6 Jul 2020 18:25:40 +0100
Subject: [PATCH 065/217] TrkParametersBase : Add / fix comments, make obvious
 that the default copy for the base is deleted

---
 .../CurvilinearParametersT.h                  |  2 +-
 .../TrkParametersBase/ParametersBase.h        | 36 ++++++++++++++-----
 .../TrkParametersBase/ParametersT.h           |  2 +-
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
index 580e7eed736a..718216f5848d 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
@@ -115,7 +115,7 @@ public:
   /** Return the ParametersType enum */
   virtual ParametersType type() const override final;
 
-  /** Return the Surface Type (check SurfaceType enums)*/
+  /** Return the Surface Type enum*/
   virtual int surfaceType() const override final;
 
   /** Return the measurementFrame of the parameters */
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
index b34f143af332..d9f1550370a4 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
@@ -97,7 +97,7 @@ public:
 
   /** Returns true if Charged or false if Neutral
    */
-  constexpr bool isCharged () const;
+  constexpr bool isCharged() const;
   /** Returns the charge
    * */
   double charge() const;
@@ -107,7 +107,8 @@ public:
   Amg::Vector2D localPosition() const;
 
   /** Update parameters and covariance.
-   * Uses NVI: Derived classes override the
+   * 
+   * Derived classes override the
    * implementation via updateParametersHelper
    */
   void updateParameters(const AmgVector(DIM) &, AmgSymMatrix(DIM) * = nullptr);
@@ -115,7 +116,8 @@ public:
   /** Update parameters  and covariance , passing covariance by ref. A
    * covariance is created if one does not exist.  Otherwise in place update
    * occurs via assignment.
-   * Uses NVI: Derived classes override the
+   *
+   * Derived classes override the
    * implementation via updateParametersHelper
    */
   void updateParameters(const AmgVector(DIM) &, const AmgSymMatrix(DIM) &);
@@ -123,10 +125,10 @@ public:
   //** equality operator */
   virtual bool operator==(const ParametersBase<DIM, T>&) const;
 
-  /** Test to see if there's a surface there. */
+  /** Test to see if there's a not null surface ptr. */
   virtual bool hasSurface() const = 0;
 
-  /** Access to the Surface method */
+  /** Access to the Surface associated to the Parameters*/
   virtual const Surface& associatedSurface() const = 0;
 
   /** Return the measurement frame - this is needed for alignment, in
@@ -135,17 +137,17 @@ public:
      transform */
   virtual Amg::RotationMatrix3D measurementFrame() const = 0;
 
-  /** Pseudo constructor - avoids excessive type-casting.
+  /** clone method for polymorphic deep copy 
        @return new object copied from the concrete type of this object.*/
   virtual ParametersBase<DIM, T>* clone() const = 0;
 
   /** Return the ParametersType enum */
   virtual ParametersType type() const = 0;
 
-  /** Return the ParametersType enum */
+  /** Returns the Surface Type enum for the surface used
+   * to define the derived class*/
   virtual int surfaceType() const = 0;
 
- 
   /** Dumps relevant information about the track parameters into the ostream */
   virtual MsgStream& dump(MsgStream& out) const;
   virtual std::ostream& dump(std::ostream& out) const;
@@ -172,10 +174,26 @@ protected:
   ParametersBase(const AmgVector(DIM) & parameters,
                  AmgSymMatrix(DIM) * covariance = nullptr);
 
+  /*
+   * Default Move ctor/assignment, private can be used
+   * only by derived classes.
+   */
   ParametersBase(ParametersBase&&) = default;
   ParametersBase& operator=(ParametersBase&&) = default;
 
-  /* Helper to factor in update of parameters*/
+  /*
+   * Default copy ctor/assignment
+   * Deleted due unique_ptr.
+   *
+   * Derived classes can implement them explicitly.
+   * Polymorphic deep copy can happen via the clone
+   * method
+   */
+  ParametersBase(const ParametersBase&) = delete;
+  ParametersBase& operator=(const ParametersBase&) = delete;
+
+  /* Helper implementing the specific per derived class logic for
+   * the update of parameters*/
   virtual void updateParametersHelper(const AmgVector(DIM) &) = 0;
 
   AmgVector(DIM) m_parameters; //!< contains the n parameters
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
index 34954d7bde69..422614b04005 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
@@ -119,7 +119,7 @@ public:
   /** Return the ParametersType enum */
   virtual ParametersType type() const override final;
 
-  /** Return the Surface Type (check SurfaceType enums)*/
+  /** Return the Surface Type enum */
   virtual int surfaceType() const override final;
 
   /** Return the measurementFrame of the parameters */
-- 
GitLab


From e0cac9bc95dc89f1dac6b6c09b247e4e2694f977 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Fri, 3 Jul 2020 19:17:35 +0200
Subject: [PATCH 066/217] TriggerJobOpts: extend flake8 checks and clean up
 code

---
 .../share/RecExCommon_topOptions.py           |  4 +-
 .../TriggerJobOpts/CMakeLists.txt             | 10 +--
 .../TriggerJobOpts/python/TriggerFlags.py     |  1 -
 .../TriggerJobOpts/share/BStoBS_post.py       | 10 ++-
 .../BStoESD_Tier0_HLTConfig_jobOptions.py     |  1 -
 .../share/TransientBS_DetFlags.py             |  7 +-
 .../TriggerOutputItemListAOD_jobOptions.py    | 18 -----
 .../share/TriggerOutputItemList_jobOptions.py | 16 ----
 .../share/Trigger_topOptions_standalone.py    | 69 ++++++++++-------
 .../share/Trigger_topOptions_writeBS.py       | 74 -------------------
 .../share/dbmod_BFieldAutoConfig.py           |  6 +-
 .../share/dbmod_chronoAuditor.py              |  1 +
 .../TriggerJobOpts/share/dbmod_nameAuditor.py |  1 +
 .../share/jobOfragment_TransBS_standalone.py  |  8 +-
 .../TriggerJobOpts/share/runHLT_standalone.py | 39 ++++------
 .../share/runHLT_standalone_run2.py           |  2 +
 .../share/test_hltConditions.py               | 23 ++++--
 .../test/test_TriggerFlags_autoconf.py        |  3 +-
 18 files changed, 104 insertions(+), 189 deletions(-)
 delete mode 100644 Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
 delete mode 100755 Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemListAOD_jobOptions.py
 delete mode 100755 Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemList_jobOptions.py
 delete mode 100755 Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_writeBS.py

diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 9e67abc9d9f8..1c556f7298bb 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -557,9 +557,9 @@ if rec.readESD() and rec.doESD():
 if rec.doTrigger:
     if globalflags.DataSource() == 'data'and globalflags.InputFormat == 'bytestream':
         try:
-            include("TriggerJobOpts/BStoESD_Tier0_HLTConfig_jobOptions.py")
+            include("TrigTier0/BStoESD_Tier0_HLTConfig_jobOptions.py")
         except Exception:
-            treatException("Could not import TriggerJobOpts/BStoESD_Tier0_HLTConfig_jobOptions.py . Switching trigger off !" )
+            treatException("Could not import TrigTier0/BStoESD_Tier0_HLTConfig_jobOptions.py . Switching trigger off !" )
             recAlgs.doTrigger=False
     else:
         try:
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt b/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt
index 83b7754a5491..bccc718fe228 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerJobOpts/CMakeLists.txt
@@ -11,9 +11,9 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TriggerCommon/TrigTier0 )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_scripts( test/*.py )
-atlas_install_joboptions( share/*.py )
+atlas_install_python_modules( python/*.py ${ATLAS_FLAKE8} )
+atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
+atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 atlas_add_test( TriggerConfigFlagsTest
    SCRIPT python -m unittest TriggerJobOpts.TriggerConfigFlags
@@ -26,7 +26,3 @@ atlas_add_test( TriggerMenuFlagsTest
 atlas_add_test( TriggerConfigTest
    SCRIPT python -m TriggerJobOpts.TriggerConfig
    POST_EXEC_SCRIPT nopost.sh )
-
-atlas_add_test( flake8
-   SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python
-   POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index 193b34e9fa43..f84b0849ca2c 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -954,7 +954,6 @@ def sync_Trigger2Reco():
     if  recAlgs.doTrigger() and rec.readRDO() and not globalflags.InputFormat()=='bytestream':
         include( "TriggerJobOpts/TransientBS_DetFlags.py" )
 
-    from RecExConfig.RecFlags import rec
     if globalflags.InputFormat() == 'bytestream':
         TriggerFlags.readBS = True
         TriggerFlags.doLVL1 = False
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoBS_post.py b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoBS_post.py
index b81266317c45..4895494e2313 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoBS_post.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoBS_post.py
@@ -1,8 +1,8 @@
-##
-## Job option fragment to merge input bytestream with HLT result
-##
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+#
+# Job option fragment to merge input bytestream with HLT result
+#
 
-from RecExConfig.RecFlags import rec
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
 from TriggerJobOpts.TriggerFlags import TriggerFlags
 
@@ -23,6 +23,8 @@ from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamMergeOutputSvc
 mergeSvc=ByteStreamMergeOutputSvc(ByteStreamOutputSvc='ByteStreamEventStorageOutputSvc',
                                   ByteStreamInputSvc='ByteStreamInputSvc',
                                   overWriteHeader=True)
+
+from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 svcMgr+=mergeSvc
 
 StreamBSFileOutput.OutputFile = "ByteStreamMergeOutputSvc"
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
deleted file mode 100644
index c32f7e62cf75..000000000000
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
+++ /dev/null
@@ -1 +0,0 @@
-include("TrigTier0/BStoESD_Tier0_HLTConfig_jobOptions.py")
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
index 3cc81603c251..d27dd7f1230e 100755
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 from AthenaCommon.DetFlags import DetFlags
 from RecExConfig.RecFlags import rec
 from TriggerJobOpts.TriggerFlags import TriggerFlags
@@ -32,6 +34,7 @@ if (not rec.readESD()) and jobproperties.Global.InputFormat() == "pool" and DetF
 # Switch off direct formation of Cells from hits
 #    
 if not rec.readESD() and TriggerFlags.doCalo():
+    from AthenaCommon.Include import include
     include ("CaloRec/CaloCellMaker_config.py")
-    CaloCellMakerFlags.doLArHitToCellDirect=False
-    CaloCellMakerFlags.doTileHitToRawChannelDirect=False
+    CaloCellMakerFlags.doLArHitToCellDirect=False  # noqa: F821 old job options, flags from include above
+    CaloCellMakerFlags.doTileHitToRawChannelDirect=False  # noqa: F821 old job options, flags from include above
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemListAOD_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemListAOD_jobOptions.py
deleted file mode 100755
index a7b6b91acee6..000000000000
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemListAOD_jobOptions.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# This is TriggerOutputItemListAOD_joboptions.py
-# It is included from ParticleBuilderOptions/share/AOD_OutputList_jobOptions.py
-# when doWriteAOD=True and doTrigger=True
-
-# add LVL1 and HLT output objects for AOD
-
-def TriggerOutputItemListAOD():
-    from RecExConfig.RecFlags import rec
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger( 'TriggerOutputItemListAOD_joboptions' )
-    log.error("this file is deprecated by the Object Key Store and should no longer be used")
-    TriggerAODList = []
-    if rec.doWriteAOD():
-        print "TriggerAODList: "
-        print TriggerAODList
-
-TriggerOutputItemListAOD()
-
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemList_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemList_jobOptions.py
deleted file mode 100755
index 494590299788..000000000000
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/TriggerOutputItemList_jobOptions.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# This is TriggerOutputItemListESD_joboptions.py
-# It is included from RecoOutputItemList_jobOptions.py
-# when doWriteESD=True and doTrigger=True
-
-def TriggerOutputItemListESD():
-        from RecExConfig.RecFlags import rec
-        from AthenaCommon.Logging import logging
-        log = logging.getLogger( 'TriggerOutputItemList_joboptions' )
-        log.error("this file is deprecated by the Object Key Store and should no longer be used")
-        if rec.doWriteESD():
-            print "TriggerESDList: "
-            print TriggerESDList
-
-# empty list to avoid breaking RecExPers/RecoOutputESDList_jobOptions.py
-TriggerESDList = [] 
-TriggerOutputItemListESD()
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_standalone.py
index f14c69448623..1c3cfe8f9082 100755
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_standalone.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'Trigger_topOptions_standalone.py' )
 
@@ -10,6 +12,7 @@ if globalflags.InputFormat() == 'bytestream':
     TriggerFlags.doLVL1=False
 
 # Common alias for online EventLoopMgr used below
+from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 if hasattr(svcMgr,"HltEventLoopMgr"):
     onlEventLoopMgr = svcMgr.HltEventLoopMgr
 else:
@@ -37,15 +40,17 @@ else:
     DetFlags.Calo_setOff()
 
 # Always enable AtlasFieldSvc
-if hasattr(DetFlags,'BField_on'): DetFlags.BField_setOn()
+if hasattr(DetFlags,'BField_on'):
+    DetFlags.BField_setOn()
 
 # Setup IOVDbSvc
-from IOVDbSvc.CondDB import conddb
+from IOVDbSvc.CondDB import conddb  # noqa: F401 configuration by import, old Run-2 job options
 svcMgr.IOVDbSvc.GlobalTag=globalflags.ConditionsTag()
 
 # ----------------------------------------------------------------
 # Setting detector geometry 
 # ----------------------------------------------------------------
+from AthenaCommon.Include import include
 include ("RecExCond/AllDet_detDescr.py")
 
 #we have to reset these flags since the muons do a sync of flags in above fragment
@@ -64,13 +69,14 @@ svcMgr.AtlasFieldSvc.LockMapCurrents = True  # no field scaling
 svcMgr.AtlasFieldSvc.SoleMinCurrent = 160  # Standby current is 150A
 svcMgr.AtlasFieldSvc.ToroMinCurrent = 210  # Standby current is 200A
 # Read currents from IS if available
-if onlEventLoopMgr: onlEventLoopMgr.setMagFieldFromPtree = True
+if onlEventLoopMgr:
+    onlEventLoopMgr.setMagFieldFromPtree = True
             
 # ----------------------------------------------------------------
 # Pool input
 # ----------------------------------------------------------------
 if globalflags.InputFormat()=='pool':
-    import AthenaPoolCnvSvc.ReadAthenaPool
+    import AthenaPoolCnvSvc.ReadAthenaPool  # noqa: F401 configuration by import, old Run-2 job options
     svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ "DEFAULT_BUFFERSIZE = '2048'" ]
     svcMgr.EventSelector.InputCollections = athenaCommonFlags.PoolRDOInput()
     svcMgr.PoolSvc.AttemptCatalogPatch=True 
@@ -85,9 +91,10 @@ if globalflags.InputFormat()=='bytestream':
 
     # This is only needed running athena (as opposed to athenaMT/PT)
     if not hasattr(svcMgr,"ByteStreamCnvSvc"):
-        from ByteStreamCnvSvc import ReadByteStream
+        from ByteStreamCnvSvc import ReadByteStream  # noqa: F401 configuration by import, old Run-2 job options
         # Define the input
         svcMgr.EventSelector.Input = athenaCommonFlags.BSRDOInput()
+        from AthenaCommon.AppMgr import theApp
         theApp.ExtSvc += [ "ByteStreamCnvSvc"]
 
 
@@ -119,8 +126,8 @@ if TriggerFlags.doCalo():
 
 if TriggerFlags.doMuon():
     # load services needed for converters
-    import MuonCnvExample.MuonCablingConfig
-    import MuonRecExample.MuonReadCalib
+    import MuonCnvExample.MuonCablingConfig  # noqa: F401 configuration by import, old Run-2 job options
+    import MuonRecExample.MuonReadCalib  # noqa: F401 configuration by import, old Run-2 job options
     if (TriggerFlags.doEF() or TriggerFlags.doHLT()) and 'forceMuonDataPrep' in dir():
         if (TriggerFlags.MuonSlice.doEFRoIDrivenAccess()):
             include("MuonRdoToPrepData/CscRdoToCscPrepData_jobOptions.py")
@@ -186,13 +193,13 @@ else:
 
 try:
     svc.SetStates( ["xml"] )
-except:
-    log.error( 'failed to set state of TrigConfigSvc ...')
+except Exception as ex:
+    log.error('failed to set state of TrigConfigSvc, %s', str(ex))
 
 try:
     svc.InitialiseSvc()
-except:
-    log.error( 'failed to activate TrigConfigSvc ...')
+except Exception as ex:
+    log.error('failed to activate TrigConfigSvc, %s', str(ex))
 
 # Enable PSK/LB monitoring
 if 'doMonitoring' in svcMgr.HLTConfigSvc.getProperties():
@@ -203,19 +210,19 @@ from TriggerJobOpts.HLTTriggerGetter import HLTSimulationGetter
 hlt = HLTSimulationGetter(g)
 
 
-if 'stopAfterMenuGeneration' in dir() and stopAfterMenuGeneration is True:
+if 'stopAfterMenuGeneration' in globals() and globals()['stopAfterMenuGeneration'] is True:
     theApp.exit()
 
 
 # setup writing of temporary cool db for a possible reco-step afterwards
-log.info("Will create temporary cool file, sources are '%s' and '%s'" % (svc.l1XmlFile,svc.hltXmlFile) )
+log.info("Will create temporary cool file, sources are '%s' and '%s'", svc.l1XmlFile, svc.hltXmlFile )
 from TrigConfigSvc.TrigConf2COOL import theConfCOOLWriter
 theConfCOOLWriter.lvl1menu = svc.l1XmlFile
 theConfCOOLWriter.hltmenu  = svc.hltXmlFile
 theConfCOOLWriter.isWritingNeeded = True
 import re
 TrigCoolDbConnection = re.match(".*;schema=(.*);dbname=.*",theConfCOOLWriter.dbConnection).group(1)
-log.info("Start writing with TrigCoolDbConnection %s" % TrigCoolDbConnection )
+log.info("Start writing with TrigCoolDbConnection %s", TrigCoolDbConnection )
 theConfCOOLWriter.writeConf2COOL()
 f = open("MenuCoolDbLocation.txt","w")
 f.write(TrigCoolDbConnection)
@@ -225,37 +232,44 @@ del f
 # -------------------------------------------------------------
 # Message formatting and OutputLevel
 # -------------------------------------------------------------
-MessageSvc.Format = "% F%48W%S%7W%R%T %0W%M"
+msgSvc = svcMgr.MessageSvc
+msgSvc.Format = "% F%48W%S%7W%R%T %0W%M"
 
 if TriggerFlags.Online.doValidation():
     TriggerFlags.enableMonitoring = TriggerFlags.enableMonitoring.get_Value()+['Log']
 else:
-    MessageSvc.Format = "%t  " + MessageSvc.Format   # add time stamp
-    if hasattr(MessageSvc,'useErsError'):   # ERS forwarding with TrigMessageSvc
-        MessageSvc.useErsError = ['*']
+    msgSvc.Format = "%t  " + msgSvc.Format   # add time stamp
+    if hasattr(msgSvc,'useErsError'):   # ERS forwarding with TrigMessageSvc
+        msgSvc.useErsError = ['*']
 
 # ----------------------------------------------------------------
 # Setting individual OutputLevel 
 # ----------------------------------------------------------------
 trigSteerConf = []
-if TriggerFlags.doHLT(): trigSteerConf += [topSequence.TrigSteer_HLT]
-    
+if TriggerFlags.doHLT():
+    trigSteerConf += [topSequence.TrigSteer_HLT]
+
+HLTOutputLevel = globals()['HLTOutputLevel'] if 'HLTOutputLevel' in globals() else msgSvc.OutputLevel
 for s in trigSteerConf:
     s.OutputLevel = HLTOutputLevel
-    for algo in s.getChildren(): algo.OutputLevel = HLTOutputLevel
+    for algo in s.getChildren():
+        algo.OutputLevel = HLTOutputLevel
+
+if onlEventLoopMgr:
+    onlEventLoopMgr.OutputLevel = HLTOutputLevel
 
-if onlEventLoopMgr: onlEventLoopMgr.OutputLevel = HLTOutputLevel
+from AthenaCommon import Constants
 
 if hasattr(topSequence,'CTPSimulation'):
-    topSequence.CTPSimulation.OutputLevel = INFO
+    topSequence.CTPSimulation.OutputLevel = Constants.INFO
 
 # Special settings of random number service for online
-svcMgr.AtRanluxGenSvc.OutputLevel = WARNING
+svcMgr.AtRanluxGenSvc.OutputLevel = Constants.WARNING
 svcMgr.AtRanluxGenSvc.SaveToFile = False
 
 # Re-seed the RNG on every event
-if hasattr(ToolSvc,'HLT::RandomScaler'):
-    rng = getattr(ToolSvc,'HLT::RandomScaler')
+if hasattr(svcMgr.ToolSvc,'HLT::RandomScaler'):
+    rng = getattr(svcMgr.ToolSvc,'HLT::RandomScaler')
     rng.useEventSeed = True
     rng.config(seed=0, luxury=2)
 
@@ -270,7 +284,8 @@ if TriggerFlags.doHLT():
 
     # Enable timing except for hypos
     for alg in topSequence.TrigSteer_HLT.getChildren():
-        if not 'forceAccept' in alg.properties(): alg.doTiming = True
+        if 'forceAccept' not in alg.properties():
+            alg.doTiming = True
 
     steertime = topSequence.TrigSteer_HLT.MonTools['HLTSteeringTime']
     steertime.NumberOfHistBins = 200
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_writeBS.py b/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_writeBS.py
deleted file mode 100755
index aa5dd473539c..000000000000
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/Trigger_topOptions_writeBS.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Trigger_topOptions_writeBS.py
-# simple jO based on rdotobs.py for doing RDO->BS with just Level-1 trigger
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-from AthenaCommon.GlobalFlags import globalflags
-    
-if not ('EvtMax' in dir()):
-    acf.EvtMax=-1
-if (not "doFiltering" in dir()):
-    doFiltering=True
-if (not "OutputLevel" in dir()):
-    rec.OutputLevel=INFO
-
-if not "PhysicsLArFormat" in dir():
-    PhysicsLArFormat=False
-
-if (not "setLVL1XML" in dir()):
-    setLVL1XML=None 
-if (not "myBSRDOOutput" in dir()):
-    acf.BSRDOOutput='AppName='+setMenu+', OutputDirectory=./, Run=105200'
-else:
-    acf.BSRDOOutput=myBSRDOOutput
-    
-if 'PoolRDOInput' in dir():
-    acf.PoolRDOInput = PoolRDOInput
-    del PoolRDOInput
-
-if 'setDetDescr' in dir():
-    globalflags.DetDescrVersion = setDetDescr
-else:
-    rec.AutoConfiguration += ['Geo']
-    
-if "setGlobalTag" in dir():
-    globalflags.ConditionsTag = setGlobalTag
-else:
-    rec.AutoConfiguration += ['ConditionsTag']
-   
-doTrigger=True
-rec.doESD=False
-rec.doCBNT=False
-rec.doWriteRDO=False
-rec.doTruth=False
-rec.doESD=False
-rec.doWriteESD=False 
-rec.doWriteAOD=False 
-rec.doAOD=False 
-rec.doWriteTAG=False 
-rec.doPerfMon=False
-rec.doWriteBS=True # enable BS writing
-
-#Set trigger menu
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.triggerMenuSetup = setMenu
-if setLVL1XML:
-    TriggerFlags.readLVL1configFromXML=True
-    TriggerFlags.inputLVL1configFile=setLVL1XML
-    TriggerFlags.outputLVL1configFile=None
-else:
-    TriggerFlags.readLVL1configFromXML=False
-TriggerFlags.doLVL2=False
-TriggerFlags.doEF=False
-TriggerFlags.doHLT=False
-
-# main jobOption
-include ("RecExCommon/RecExCommon_topOptions.py")
-
-if PhysicsLArFormat:
-    ToolSvc.LArRawDataContByteStreamTool.DSPRunMode=4
-    ToolSvc.LArRawDataContByteStreamTool.RodBlockVersion=10
-    ToolSvc.LArRawDataContByteStreamTool.IncludeDigits=True
-
-if doFiltering:
-    StreamBSFileOutput.AcceptAlgs = ["RoIBuilder"]
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_BFieldAutoConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_BFieldAutoConfig.py
index becf76d8d5fe..6c7555464af3 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_BFieldAutoConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_BFieldAutoConfig.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 # TrigDB modifier
 # Usage: athenaHLT.py --postcommand 'include("TriggerJobOpts/dbmod_BFieldAutoConfig.py")' ...
 #
@@ -8,10 +9,11 @@ from AthenaCommon.Logging import logging
 log = logging.getLogger('dbmod_BFieldAutoConfig.py')
 
 db = 'CONDBR2'
-if '_run_number' in dir() and _run_number<222222: db = 'COMP200'
+if '_run_number' in globals() and globals()['_run_number']<222222:
+  db = 'COMP200'
 
 # Add the DCS folder (note the double-use of quotes)
 f = "'<db>COOLOFL_DCS/%s</db> /EXT/DCS/MAGNETS/SENSORDATA'" % db
-log.info("Adding folder %s to IOVDbSvc" % f)
+log.info("Adding folder %s to IOVDbSvc", f)
 iProperty('IOVDbSvc').Folders.push_back(f)
 iProperty('AtlasFieldSvc').UseDCS = True
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_chronoAuditor.py b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_chronoAuditor.py
index e5e311509e35..a9eb508d2881 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_chronoAuditor.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_chronoAuditor.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 # TrigDB modifier
 # Usage: athenaMT/PT -C 'include("TriggerJobOpts/dbmod_chronoAuditor.py")' ...
 #
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_nameAuditor.py b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_nameAuditor.py
index 6e3dfbb0cd55..2aa04bbc37a4 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_nameAuditor.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/dbmod_nameAuditor.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 # TrigDB modifier
 # Usage: athenaMT/PT -C 'include("TriggerJobOpts/dbmod_nameAuditor.py")' ...
 #
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
index e7c7ecb009fc..ba3154fe4be9 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
@@ -1,6 +1,13 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #--------------------------------------------------------------
 # Write to Transient BS
 #--------------------------------------------------------------
+
+from AthenaCommon.AppMgr import theApp, ServiceMgr
+from AthenaCommon.Include import include
+from AthenaServices.AthenaServicesConf import AthenaOutputStream
+from TriggerJobOpts.TriggerFlags import TriggerFlags
+
 include( "ByteStreamCnvSvc/RDP_ByteStream_jobOptions.py" )
 
 # Configure Transient BS Output Stream. ExtraInputs make sure all data (e.g. conditions)
@@ -13,7 +20,6 @@ StreamBS = AthenaOutputStream("StreamBS",
 transTypeKey = ("TransientBSOutType","StoreGateSvc+TransientBSOutKey")
 StreamBS.ExtraOutputs += [transTypeKey]
 
-
 if not TriggerFlags.fakeLVL1():
    from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamEncodersRecExSetup
    L1ByteStreamEncodersRecExSetup()
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 120161eec1b7..cba0667f1904 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -70,6 +70,7 @@ from TriggerJobOpts.TriggerFlags import TriggerFlags
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper, conf2toConfigurable
 from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
+from AthenaCommon.Include import include
 from AthenaCommon.Logging import logging
 log = logging.getLogger('runHLT_standalone.py')
 
@@ -242,13 +243,14 @@ from TrigConfigSvc.TrigConfMetaData import TrigConfMetaData
 meta = TrigConfMetaData()
     
 for mod in dir(TriggerJobOpts.Modifiers):
-    if not hasattr(getattr(TriggerJobOpts.Modifiers,mod),'preSetup'): continue
+    if not hasattr(getattr(TriggerJobOpts.Modifiers,mod),'preSetup'):
+        continue
     if mod in dir():  #allow turning on and off modifiers by variable of same name
         if globals()[mod]:
             if mod not in setModifiers:
                 setModifiers+=[mod]
-        else:
-            if mod in setModifiers: setModifiers.remove(mod)
+        elif mod in setModifiers:
+                setModifiers.remove(mod)
     if mod in setModifiers:
         modifierList+=[getattr(TriggerJobOpts.Modifiers,mod)()]
         meta.Modifiers += [mod]    # store in trig conf meta data
@@ -384,7 +386,6 @@ if TriggerFlags.doMuon():
 # ---------------------------------------------------------------
 # ID conditions
 # ---------------------------------------------------------------
-
 if TriggerFlags.doID:
     from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
     InDetTrigFlags.doPixelClusterSplitting = False
@@ -393,10 +394,6 @@ if TriggerFlags.doID:
     from AthenaCommon.Include import include
     include("InDetRecExample/InDetRecConditionsAccess.py")
 
-
-
-isPartition = len(ConfigFlags.Trigger.Online.partitionName) > 0
-
 # ----------------------------------------------------------------
 # Pool input
 # ----------------------------------------------------------------
@@ -433,10 +430,8 @@ from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu, createL1PrescalesFile
 generateL1Menu()
 createL1PrescalesFileFromMenu()
 
-from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc,L1ConfigSvcCfg
+from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
 CAtoGlobalWrapper(L1ConfigSvcCfg,None)
-#svcMgr += getL1ConfigSvc()
-
 
 # ---------------------------------------------------------------
 # Level 1 simulation
@@ -445,9 +440,6 @@ if opt.doL1Sim:
     from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence
     topSequence += Lvl1SimulationSequence(ConfigFlags)
 
-
-
-
 # ---------------------------------------------------------------
 # HLT prep: RoIBResult and L1Decoder
 # ---------------------------------------------------------------
@@ -476,11 +468,9 @@ if opt.doL1Unpacking:
         from TrigUpgradeTest.TestUtils import L1EmulationTest
         topSequence += L1EmulationTest()
 
-
 # ---------------------------------------------------------------
 # HLT generation
 # ---------------------------------------------------------------
-
 if not opt.createHLTMenuExternally:
 
     from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT
@@ -544,19 +534,16 @@ if len(opt.condOverride)>0:
         log.warning('Overriding folder %s with tag %s', folder, tag)
         conddb.addOverride(folder,tag)
 
-if svcMgr.MessageSvc.OutputLevel<INFO:
+if svcMgr.MessageSvc.OutputLevel < logging.INFO:
     from AthenaCommon.JobProperties import jobproperties
     jobproperties.print_JobProperties('tree&value')
     print(svcMgr)
 
 #-------------------------------------------------------------
-# Use parts of NewJO
-#-------------------------------------------------------------
-from AthenaCommon.Configurable import Configurable
-
 # Output flags
+#-------------------------------------------------------------
 if opt.doWriteRDOTrigger:
-    if isPartition:
+    if ConfigFlags.Trigger.Online.isPartition:
         log.error('Cannot use doWriteRDOTrigger in athenaHLT or partition')
         theApp.exit(1)
     rec.doWriteRDO = False  # RecExCommon flag
@@ -568,14 +555,16 @@ if opt.doWriteBS:
     ConfigFlags.Output.doWriteBS = True  # new JO flag
     ConfigFlags.Trigger.writeBS = True  # new JO flag
 
-ConfigFlags.Input.Files = athenaCommonFlags.FilesInput()
+#-------------------------------------------------------------
 # ID Cache Creators
+#-------------------------------------------------------------
 ConfigFlags.lock()
 from TriggerJobOpts.TriggerConfig import triggerIDCCacheCreatorsCfg
 CAtoGlobalWrapper(triggerIDCCacheCreatorsCfg,ConfigFlags)
 
-
-# Trigger output
+#-------------------------------------------------------------
+# Output configuration
+#-------------------------------------------------------------
 if opt.doWriteBS or opt.doWriteRDOTrigger:
     from TriggerJobOpts.TriggerConfig import collectHypos, collectFilters, collectDecisionObjects, collectHypoDecisionObjects, triggerOutputCfg
     from AthenaCommon.CFElements import findAlgorithm,findSubSequence
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_run2.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_run2.py
index 1c03c7fb7555..0a92e0bc364c 100755
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_run2.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_run2.py
@@ -1,3 +1,5 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# flake8: noqa (obsolete Run-2 job options)
 ##############################################################
 # TriggerJobOpts/runHLT_standalone.py
 #
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/test_hltConditions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/test_hltConditions.py
index 84f9076dbdf6..550b02b03a14 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/test_hltConditions.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/test_hltConditions.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 ###########################################################################
 # Job options to test HLT conditions updates based on local sqlite file
 #
@@ -13,21 +14,25 @@
 
 
 # Update these values to your need:
-if 'sqlite' not in dir(): sqlite = 'noise.db'
-if 'onldb' not in dir(): onldb = 'ATLAS_COOLONL_CALO'
-if 'folder' not in dir(): folder = '/CALO/Noise/CellNoise'
+if 'sqlite' not in dir():
+   sqlite = 'noise.db'
+if 'onldb' not in dir():
+   onldb = 'ATLAS_COOLONL_CALO'
+if 'folder' not in dir():
+   folder = '/CALO/Noise/CellNoise'
 
 # No updates required past this point
 testCurrentMenu=True
 EvtMax=10
 BSRDOInput='/afs/cern.ch/atlas/project/trigger/pesa-sw/validation/atn-test/data16_13TeV.00307126.physics_eb_zmm_egz.merged.RAW.selected._0001.data'
 
-myfolder = folder     # 'folder' seesm to be overwritten somwhere in the include
+from AthenaCommon.Include import include
+myfolder = folder  # 'folder' seems to be overwritten somewhere in the include
 include('TriggerJobOpts/runHLT_standalone.py')
 folder = myfolder
 
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from IOVDbSvc.CondDB import conddb
+from IOVDbSvc.CondDB import conddb  # noqa: F401 configuration by import, old Run-2 job options
 svcMgr.IOVDbSvc.forceRunNumber = 9999999
 
 sqlite_tmp = 'cool_tmp.db'
@@ -39,13 +44,15 @@ import sys
 # Delete temporary file
 try:
    os.remove(sqlite_tmp)
-except:
+except Exception:
    pass
 
 # Copy folder from online DB
 rc = os.system("AtlCoolCopy 'oracle://ATLAS_COOLPROD;schema=%s;dbname=CONDBR2' 'sqlite://;schema=%s;dbname=CONDBR2' -create -tag %s -hitag -prunetags -folder %s -r 9999999" % (onldb,sqlite_tmp,tag,folder))
-if rc!=0: sys.exit(rc)
+if rc!=0:
+   sys.exit(rc)
 
 # Merge with user given sqlite file (in case only some channels have been updated)
 rc = os.system("AtlCoolCopy 'sqlite://;schema=%s;dbname=CONDBR2' 'sqlite://;schema=%s;dbname=CONDBR2' -folder %s -r 9999999" % (sqlite,sqlite_tmp,folder))
-if rc!=0: sys.exit(rc)
+if rc!=0:
+   sys.exit(rc)
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/test/test_TriggerFlags_autoconf.py b/Trigger/TriggerCommon/TriggerJobOpts/test/test_TriggerFlags_autoconf.py
index 3e422d56011b..56c6284a3762 100755
--- a/Trigger/TriggerCommon/TriggerJobOpts/test/test_TriggerFlags_autoconf.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/test/test_TriggerFlags_autoconf.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Test of Trigger config flags autoconfiguration
 # Exercised on BS data and MC POOL file formats
@@ -25,7 +26,7 @@ inputfiles = {
     "Run2_Data": "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00360026.physics_EnhancedBias.merge.RAW._lb0151._SFO-1._0001.1",
     "Run3_Data": nightlydir+"/TrigP1Test/test_trigP1_v1PhysP1_T0Mon_build/data18_13TeV.00360026.physics_Main.unknown.RAW._lb0151._athenaHLT._0001.data",
     #
-    "Run2_MC_r21": nightlydir+"TrigAnalysisTest/test_trigAna_RDOtoAOD_build/AOD.pool.root",
+    "Run2_MC_r22": nightlydir+"TrigAnalysisTest/test_trigAna_RDOtoAOD_build/AOD.pool.root",
     "Run2_MC_r21": getRun2MCFile(),
     #
     "Run3_MC": nightlydir+"TrigAnalysisTest/test_trigAna_RDOtoAOD_mt1_build/AOD.pool.root",
-- 
GitLab


From 16b6fcf4d4ab641011e59a9f25f6b928bdff3bd4 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 2 Jul 2020 16:26:36 +0200
Subject: [PATCH 067/217] MuonPatternSegmentMaker: cmake fixes

Declare an interface library for exported headers.

Library dependency fixes.
---
 .../MuonPatternSegmentMaker/CMakeLists.txt           | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonPatternSegmentMaker/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonPatternSegmentMaker/CMakeLists.txt
index cf533ec19c19..3249c23807a3 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonPatternSegmentMaker/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonPatternSegmentMaker/CMakeLists.txt
@@ -29,13 +29,15 @@ atlas_depends_on_subdirs( PUBLIC
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
+atlas_add_library( MuonPatternSegmentMakerLib
+                   MuonPatternSegmentMaker/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS MuonPatternSegmentMaker
+                   LINK_LIBRARIES GaudiKernel AthenaBaseComps MuonSegmentMakerToolInterfaces MuonRecToolInterfaces MuonPattern MuonPrepRawData MuonIdHelpersLib StoreGateLib MuonSegment Identifier )
+
 # Component(s) in the package:
 atlas_add_component( MuonPatternSegmentMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests Identifier GaudiKernel MuonPattern MuonPrepRawData MuonSegment MuonRecToolInterfaces MuonReadoutGeometry MuonIdHelpersLib MuonRIO_OnTrack MuonRecHelperToolsLib MuonEDM_AssociationObjects TrkParameters TrkSegment TrkToolInterfaces )
-
-# Install files from the package:
-atlas_install_headers( MuonPatternSegmentMaker )
-
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} MuonPatternSegmentMakerLib SGtests MuonReadoutGeometry MuonRIO_OnTrack MuonRecHelperToolsLib MuonEDM_AssociationObjects TrkParameters TrkSegment TrkToolInterfaces )
-- 
GitLab


From a4a6ae523b751fba40759c154362d59b86c61c8e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 18:14:17 +0200
Subject: [PATCH 068/217] TrkCompetingRIOsOnTrackTool: cmake fixes

Declare an interface library for exported headers.
---
 .../TrkCompetingRIOsOnTrackTool/CMakeLists.txt        | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Tracking/TrkTools/TrkCompetingRIOsOnTrackTool/CMakeLists.txt b/Tracking/TrkTools/TrkCompetingRIOsOnTrackTool/CMakeLists.txt
index 02c651d4f04e..68348b5934f5 100644
--- a/Tracking/TrkTools/TrkCompetingRIOsOnTrackTool/CMakeLists.txt
+++ b/Tracking/TrkTools/TrkCompetingRIOsOnTrackTool/CMakeLists.txt
@@ -22,13 +22,16 @@ atlas_depends_on_subdirs( PUBLIC
 # External dependencies:
 find_package( ROOT COMPONENTS Gpad Graf )
 
+atlas_add_library( TrkCompetingRIOsOnTrackToolLib
+                   TrkCompetingRIOsOnTrackTool/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS TrkCompetingRIOsOnTrackTool
+                   LINK_LIBRARIES GaudiKernel AthenaKernel TrkToolInterfaces TrkParameters )
+
 # Component(s) in the package:
 atlas_add_component( TrkCompetingRIOsOnTrackTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel TrkParameters TrkToolInterfaces AtlasDetDescr TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkPrepRawData TrkRIO_OnTrack )
-
-# Install files from the package:
-atlas_install_headers( TrkCompetingRIOsOnTrackTool )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} TrkCompetingRIOsOnTrackToolLib AthenaBaseComps TrkToolInterfaces AtlasDetDescr TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkPrepRawData TrkRIO_OnTrack )
 
-- 
GitLab


From 113da60346c839f57c59f6c336c7d952571f9b6c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 2 Jul 2020 16:29:10 +0200
Subject: [PATCH 069/217] MuonSegmentOverlapRemovalTools: cmake fixes

Library dependency fixes.
---
 .../MuonSegmentOverlapRemovalTools/CMakeLists.txt               | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentOverlapRemovalTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentOverlapRemovalTools/CMakeLists.txt
index 8626e6763cf3..f1bc306eb838 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentOverlapRemovalTools/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentOverlapRemovalTools/CMakeLists.txt
@@ -26,5 +26,5 @@ atlas_depends_on_subdirs( PRIVATE
 atlas_add_component( MuonSegmentOverlapRemovalTools
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MuonIdHelpersLib MuonClusterizationLib MuonCompetingRIOsOnTrack MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSegmentMakerUtils TrkEventPrimitives )
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MuonIdHelpersLib MuonClusterizationLib MuonCompetingRIOsOnTrack MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSegmentMakerUtils TrkEventPrimitives MuonSegmentCombinerToolInterfaces MuonSegmentMakerToolInterfaces )
 
-- 
GitLab


From 5ec62eb2002cce020b4a6e3bb7b6bda7587afa83 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 2 Jul 2020 16:25:15 +0200
Subject: [PATCH 070/217] MuonCurvedSegmentCombiner: cmake fixes

Library dependency fixes.
---
 .../MuonCurvedSegmentCombiner/CMakeLists.txt                    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MuonCurvedSegmentCombiner/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MuonCurvedSegmentCombiner/CMakeLists.txt
index 47686e0829f0..f0ad2c401a51 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MuonCurvedSegmentCombiner/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MuonCurvedSegmentCombiner/CMakeLists.txt
@@ -32,7 +32,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_component( MuonCurvedSegmentCombiner
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MuonEDM_AssociationObjects StoreGateLib SGtests Identifier MuonReadoutGeometry MuonIdHelpersLib MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack )
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MuonEDM_AssociationObjects StoreGateLib SGtests Identifier MuonReadoutGeometry MuonIdHelpersLib MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces TrkCompetingRIOsOnTrack TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack MuonSegmentCombinerToolInterfaces MuonSegmentMakerToolInterfaces )
 
 # Install files from the package:
 atlas_install_headers( MuonCurvedSegmentCombiner )
-- 
GitLab


From f648aa9da205b8db667d424f96ff9733d1e8f876 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 2 Jul 2020 16:29:34 +0200
Subject: [PATCH 071/217] MuonSegmentSelectionTools: cmake fixes

Library dependency fixes.
---
 .../MuonSegmentSelectionTools/CMakeLists.txt                    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentSelectionTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentSelectionTools/CMakeLists.txt
index bd292ab701e9..0b3a45c5ea5f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentSelectionTools/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MuonSegmentSelectionTools/CMakeLists.txt
@@ -23,5 +23,5 @@ atlas_depends_on_subdirs( PRIVATE
 atlas_add_component( MuonSegmentSelectionTools
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests Identifier GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib )
+                     LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests Identifier GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonSegmentMakerToolInterfaces )
 
-- 
GitLab


From 7d7a2cf01e20229180fb44ec41b44c6cd12e6e0b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:49:06 +0200
Subject: [PATCH 072/217] MdtSegmentT0Fitter: cmake fixes

Library dependency fixes.
---
 .../MuonSegmentMakerTools/MdtSegmentT0Fitter/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MdtSegmentT0Fitter/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MdtSegmentT0Fitter/CMakeLists.txt
index 92ec55508679..a10513d9f89a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MdtSegmentT0Fitter/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/MdtSegmentT0Fitter/CMakeLists.txt
@@ -28,7 +28,7 @@ atlas_add_component( MdtSegmentT0Fitter
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel MdtCalibSvcLib TrkDriftCircleMath MdtCalibData MuonCalibToolsLib MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel MdtCalibSvcLib TrkDriftCircleMath MdtCalibData MuonCalibToolsLib MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData MuonRIO_OnTrack MuonSegmentMakerInterfacesLib )
 
 # Install files from the package:
 atlas_install_headers( MdtSegmentT0Fitter )
-- 
GitLab


From 8b80d50871f170b6b51da4ba386daf9e9b4fe0c9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:49:19 +0200
Subject: [PATCH 073/217] TrackToVertex: cmake fixes

Library dependency fixes.
---
 Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt b/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt
index ac0cb682b705..1a14e8403ac8 100644
--- a/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt
+++ b/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt
@@ -34,7 +34,7 @@ atlas_add_component( TrackToVertex
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventPrimitives GaudiKernel ITrackToVertex TrkNeutralParameters StoreGateLib SGtests Particle TrkDetDescrUtils TrkSurfaces TrkEventPrimitives TrkParameters TrkParticleBase TrkTrack VxVertex TrkExInterfaces )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives EventPrimitives GaudiKernel ITrackToVertex TrkNeutralParameters StoreGateLib SGtests Particle TrkDetDescrUtils TrkSurfaces TrkEventPrimitives TrkParameters TrkParticleBase TrkTrack VxVertex TrkExInterfaces BeamSpotConditionsData )
 
 # Install files from the package:
 atlas_install_headers( TrackToVertex )
-- 
GitLab


From 97c00137edaf97299f44e6b605fd2d83015bf38e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:49:32 +0200
Subject: [PATCH 074/217] DCMathSegmentMaker: cmake fixes

Library dependency fixes.
---
 .../MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
index 33a04ad1e1bc..9f7b43e3340f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
@@ -46,4 +46,4 @@ atlas_add_component( DCMathSegmentMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives EventPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonStationIntersectSvcLib TrkGeometry TrkSurfaces TrkEventPrimitives TrkParameters TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkRoad TrkTrack TrkExInterfaces TrkFitterInterfaces TrkToolInterfaces TrkDriftCircleMath MuonCondData )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives EventPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonStationIntersectSvcLib TrkGeometry TrkSurfaces TrkEventPrimitives TrkParameters TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkRoad TrkTrack TrkExInterfaces TrkFitterInterfaces TrkToolInterfaces TrkDriftCircleMath MuonCondData MuonSegmentMakerToolInterfaces MuonSegmentMakerInterfaces )
-- 
GitLab


From 9276c646f501983d6aab264b415b69648cf7ff3d Mon Sep 17 00:00:00 2001
From: Marcin Nowak <Marcin.Nowak@cern.ch>
Date: Mon, 6 Jul 2020 20:33:51 +0200
Subject: [PATCH 075/217] Remove resets of Aux Selection to fix multi-stream MT
 writing

Resetting Aux Selection in one stream would cause other stream to write
all attributes. Now selection is only >set< to what it should be.
Aux Selection dtill needs to be identical between steams in MT.
To be fixed later(?).
---
 Control/AthenaServices/src/AthenaOutputStream.cxx   | 13 ++++++-------
 .../APR/RootStorageSvc/src/RootTreeContainer.cpp    |  6 +++---
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 858bc3066f09..70644ec3b435 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -928,10 +928,6 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item)
                   if( auxio ) {
                      // collect dynamic Aux selection (parse the line, attributes separated by dot)
                      std::set<std::string> attributes;
-                     // Start by resetting the object. This is needed in case a
-                     // previous stream set some selection on it that we don't
-                     // need here.
-                     auxio->selectAux( attributes );
                      if( aux_attr.size() ) {
                         std::stringstream ss(aux_attr);
                         std::string attr;
@@ -944,10 +940,13 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item)
                            }
                         }
                         // don't let keys with wildcard overwrite existing selections
-                        if( auxio->getSelectedAuxIDs().size() == auxio->getDynamicAuxIDs().size()
-                            || item_key.find('*') == string::npos )
-                           auxio->selectAux(attributes);
+                        // MN: TODO: this condition was always true - need a better check
+                        //if( auxio->getSelectedAuxIDs().size() == auxio->getDynamicAuxIDs().size()
+                        //    || item_key.find('*') == string::npos )
+                        //   auxio->selectAux(attributes);
                      }
+                     // Reset selection even if empty - in case we write multiple streams 
+                     auxio->selectAux( attributes );
                   }
                   // Here comes the compression logic using SG::IAuxStoreCompression
                   // similar to that of SG::IAuxStoreIO above
diff --git a/Database/APR/RootStorageSvc/src/RootTreeContainer.cpp b/Database/APR/RootStorageSvc/src/RootTreeContainer.cpp
index d973efb78414..ef29476bcdd3 100755
--- a/Database/APR/RootStorageSvc/src/RootTreeContainer.cpp
+++ b/Database/APR/RootStorageSvc/src/RootTreeContainer.cpp
@@ -189,8 +189,9 @@ DbStatus RootTreeContainer::writeObject( ActionList::value_type& action )
              auto *store = reinterpret_cast<SG::IAuxStoreIO*>( (char*)dsc.object + dsc.aux_iostore_IFoffset );
              // cout << "---    store object= " <<hex << store <<dec << " in " << dsc.branch->GetName()  <<endl;
              // cout << "       obj=" << hex << dsc.object << dec << "  offset=" <<  dsc.aux_iostore_IFoffset << endl;
-             log << DbPrintLvl::Debug << "       Attributes= " << store->getSelectedAuxIDs().size() << DbPrint::endmsg;
-             for(SG::auxid_t id : store->getSelectedAuxIDs()) {
+             const SG::auxid_set_t selection = store->getSelectedAuxIDs(); 
+             log << DbPrintLvl::Debug << "       Attributes= " << selection.size() << DbPrint::endmsg;
+             for(SG::auxid_t id : selection) {
                 BranchDesc&       newBrDsc( m_auxBranchMap[id] );
                 if( !newBrDsc.branch ) {
                    auto &reg = SG::AuxTypeRegistry::instance();
@@ -219,7 +220,6 @@ DbStatus RootTreeContainer::writeObject( ActionList::value_type& action )
                    num_bytes += bytes_out;
                 }
              }
-             store->selectAux( std::set<std::string>() );
           }
           dsc.rows_written++;
           break;
-- 
GitLab


From 76801b428fdf0ad8ea2f37cd1b575aeaabd568c5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:50:31 +0200
Subject: [PATCH 076/217] SCT_ConditionsTools: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../SCT_ConditionsTools/src/SCT_SensorsTool.cxx               | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_SensorsTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_SensorsTool.cxx
index f808d814d562..a813f52d63e2 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_SensorsTool.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_SensorsTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
@@ -72,7 +72,7 @@ void SCT_SensorsTool::printManufacturers(const EventContext& ctx) const {
   const SCT_SensorsCondData* condData{getCondData(ctx)};
   if (condData==nullptr) return;
 
-  for (const std::pair<CondAttrListCollection::ChanNum, SCT_SensorCondData>& it: *condData) {
+  for (const std::pair<const CondAttrListCollection::ChanNum, SCT_SensorCondData>& it: *condData) {
     ATH_MSG_ALWAYS("channel " << it.first << " manufacturer " << (it.second).getManufacturer());
   }
 }
-- 
GitLab


From b2f49a9614a4b02aadffd6fe19c68c98cf268824 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:51:42 +0200
Subject: [PATCH 077/217] InDetPrepRawDataToxAOD: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
index 0b2e20a09ed4..a5aee3a459b6 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -528,7 +528,7 @@ std::vector<SiHit> PixelPrepDataToxAOD::findAllHitsCompatibleWithCluster( const
     else
     {
 	bool foundHit = false;
-	for ( const auto barcodeSDOColl : trkBCs )
+	for ( const auto& barcodeSDOColl : trkBCs )
 	{
 	    for ( const auto barcode : barcodeSDOColl )
 	    {
-- 
GitLab


From 587a58ff32136c128515c435f4cfb2085955f670 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:50:56 +0200
Subject: [PATCH 078/217] InDetServMatGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 .../InDetServMatGeoModel/InDetServMatTool.h                   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatTool.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatTool.h
index e044dccf35a6..3cd06f04d1fc 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatTool.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETSERVMATGEOMODEL_INDETSERVMATTOOL_H
@@ -22,7 +22,7 @@ namespace InDetDD {
   class InDetServMatManager;
 }
 
-class InDetServMatTool : public GeoModelTool {
+class InDetServMatTool final : public GeoModelTool {
 
  public: 
   // Standard Constructor
-- 
GitLab


From 84b75b7e4a361d90dbe28638b06fce3c3fcca55a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:51:11 +0200
Subject: [PATCH 079/217] PixelGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 .../InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
index 31e26bd63ed9..4f1c4b43bb44 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PIXELGEOMODEL_PIXELDETECTORTOOL_H
@@ -22,7 +22,7 @@ namespace InDetDD {
   class PixelDetectorManager;
 }
 
-class PixelDetectorTool : public GeoModelTool {
+class PixelDetectorTool final : public GeoModelTool {
 
  public:
   // Standard Constructor
-- 
GitLab


From 482a5c99918c9d0572f2470899d9eb6f47865f78 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:51:28 +0200
Subject: [PATCH 080/217] TRT_GeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
index f79c7b2da6a5..df96a5f6705b 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.h
@@ -24,7 +24,7 @@ namespace InDetDD {
   class AthenaComps;
 }
 
-class TRT_DetectorTool : public GeoModelTool {
+class TRT_DetectorTool final : public GeoModelTool {
 
 public:
 
-- 
GitLab


From 0747383594c600de796cb74e3caab1b9a992bcde Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Tue, 7 Jul 2020 02:15:03 +0200
Subject: [PATCH 081/217] Fix L1 config in MTCalibPeb test

---
 .../python/MTCalibPebConfig.py                | 30 +++++++++++++------
 .../TrigExPartialEB/share/MTCalibPeb.py       |  7 +++++
 .../python/TrigT1ResultByteStreamConfig.py    | 16 +++++-----
 3 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
index 76366c4fe9d7..0505712f88c8 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py
@@ -3,6 +3,7 @@
 #
 
 from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaCommon.Logging import logging
 log = logging.getLogger('MTCalibPebConfig.py')
 
@@ -94,20 +95,30 @@ class MTCalibPebHypoOptions:
         self.PEBROBList = []
         self.PEBSubDetList = []
         self.CreateRandomData = {}
+        self.EnableL1Phase1 = False  # Sets ConfigFlags.Trigger.enableL1Phase1
+        self.EnableL1CaloLegacy = True  # Sets ConfigFlags.Trigger.enableL1CaloLegacy
 
 
 default_options = MTCalibPebHypoOptions()
 
 
-def make_l1_seq():
-    all_algs = []
+def make_l1_seq(options=default_options):
+    from AthenaCommon.CFElements import seqOR
+    l1_seq = seqOR('l1Seq')
+
+    # Configure L1 decoding flags
+    ConfigFlags.Trigger.enableL1Phase1 = options.EnableL1Phase1
+    ConfigFlags.Trigger.enableL1CaloLegacy = options.EnableL1CaloLegacy
 
     # Create inputs for L1Decoder from ByteStream
-    from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup
-    L1ByteStreamDecodersRecExSetup()
+    from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
+    acc = L1TriggerByteStreamDecoderCfg(ConfigFlags)
+    l1_seq += conf2toConfigurable(acc.getPrimary())
+    acc.wasMerged()
 
-    from L1Decoder.L1DecoderConfig import getL1TriggerResultMaker
-    all_algs.append(conf2toConfigurable(getL1TriggerResultMaker()))
+    if ConfigFlags.Trigger.enableL1Phase1:
+        from L1Decoder.L1DecoderConfig import getL1TriggerResultMaker
+        l1_seq += conf2toConfigurable(getL1TriggerResultMaker())
 
     # Set menu for L1ConfigSvc
     from TriggerJobOpts.TriggerFlags import TriggerFlags
@@ -132,10 +143,11 @@ def make_l1_seq():
     l1decoder = L1Decoder()
     l1decoder.ctpUnpacker = ctpUnpacker
     l1decoder.prescaler = psEmulation
-    all_algs.append(l1decoder)
+    l1decoder.RoIBResult = "RoIBResult" if ConfigFlags.Trigger.enableL1CaloLegacy or not ConfigFlags.Trigger.enableL1Phase1 else ""
+    l1decoder.L1TriggerResult = "L1TriggerResult" if ConfigFlags.Trigger.enableL1Phase1 else ""
+    l1_seq += l1decoder
 
-    from AthenaCommon.CFElements import seqOR
-    return seqOR('l1Seq', all_algs)
+    return l1_seq
 
 
 def make_hypo_alg(name):
diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
index 6308dc4649d3..def03037a9bf 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
@@ -25,11 +25,18 @@ MTCalibPebConfig.default_options.TimeBetweenROBReqMillisec = get_opt('TimeBetwee
 MTCalibPebConfig.default_options.PEBROBList = get_opt('PEBROBList', [])
 MTCalibPebConfig.default_options.PEBSubDetList = get_opt('PEBSubDetList', [])
 MTCalibPebConfig.default_options.CreateRandomData = get_opt('CreateRandomData', {})
+MTCalibPebConfig.default_options.EnableL1Phase1 = get_opt('EnableL1Phase1', False)
+MTCalibPebConfig.default_options.EnableL1CaloLegacy = get_opt('EnableL1CaloLegacy', True)
 
 # SGInputLoader takes care of unmet input dependencies (e.g. triggering conversion from BS)
 from AthenaCommon.AlgScheduler import AlgScheduler
 AlgScheduler.setDataLoaderAlg('SGInputLoader')
 
+# Increase scheduler checks and verbosity
+AlgScheduler.CheckDependencies( True )
+AlgScheduler.ShowControlFlow( True )
+AlgScheduler.ShowDataDependencies( True )
+
 # The top algo sequence
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py
index 4dbf27eb1f47..5f35a77e8c35 100644
--- a/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py
+++ b/Trigger/TrigT1/TrigT1ResultByteStream/python/TrigT1ResultByteStreamConfig.py
@@ -2,7 +2,8 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 from AthenaConfiguration.ComponentFactory import CompFactory
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, CAtoGlobalWrapper
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
 def RoIBResultByteStreamToolCfg(name, writeBS=False):
   tool = CompFactory.RoIBResultByteStreamTool(name)
@@ -34,6 +35,10 @@ def ExampleL1TriggerByteStreamToolCfg(name, writeBS=False):
   return tool
 
 def L1TriggerByteStreamDecoderCfg(flags):
+  from AthenaCommon.Configurable import Configurable
+  cb = Configurable.configurableRun3Behavior
+  Configurable.configurableRun3Behavior += 1
+
   decoderTools = []
   if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1:
     roibResultTool = RoIBResultByteStreamToolCfg(name="RoIBResultBSDecoderTool", writeBS=False)
@@ -48,11 +53,12 @@ def L1TriggerByteStreamDecoderCfg(flags):
                                                          DecoderTools=decoderTools)
 
   acc = ComponentAccumulator()
-  acc.addEventAlgo(decoderAlg)
+  acc.addEventAlgo(decoderAlg, primary=True)
+
+  Configurable.configurableRun3Behavior = cb
   return acc
 
 def L1TriggerByteStreamEncoderCfg(flags):
-  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
   acc = ComponentAccumulator()
 
   if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1:
@@ -68,12 +74,8 @@ def L1TriggerByteStreamEncoderCfg(flags):
 
 def L1ByteStreamDecodersRecExSetup():
   # Use new-style config from the above functions and import into old-style JO
-  from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
-  from AthenaConfiguration.AllConfigFlags import ConfigFlags
   CAtoGlobalWrapper(L1TriggerByteStreamDecoderCfg,ConfigFlags)
 
 def L1ByteStreamEncodersRecExSetup():
   # Use new-style config from the above functions and import into old-style JO
-  from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
-  from AthenaConfiguration.AllConfigFlags import ConfigFlags
   CAtoGlobalWrapper(L1TriggerByteStreamEncoderCfg,ConfigFlags)
-- 
GitLab


From 995f3423710dd972e98dd1b0b67c0186761b1970 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Tue, 7 Jul 2020 05:26:45 +0200
Subject: [PATCH 082/217] Code cleanup

1. Cleaned CMakeLists.txt in several LArGeoModel packages by dropping atlas_depends_on_subdirs(),
and dropping redundant dependencies on BOOST and CORAL

2. Dropped redundant GeoModelUtilities/LArCustomShape.h
---
 .../GeoModelUtilities/LArCustomShape.h        | 74 -------------------
 .../LArGeoModel/LArGeoAlgsNV/CMakeLists.txt   | 27 +------
 .../LArGeoAlgsNV/src/LArDetectorFactory.cxx   |  2 -
 .../LArGeoModel/LArGeoBarrel/CMakeLists.txt   | 16 +---
 .../LArGeoModel/LArGeoCode/CMakeLists.txt     | 13 +---
 .../LArGeoModel/LArGeoEndcap/CMakeLists.txt   | 22 +-----
 .../LArGeoModel/LArGeoFcal/CMakeLists.txt     | 16 +---
 .../LArGeoModel/LArGeoHec/CMakeLists.txt      | 15 +---
 .../LArReadoutGeometry/CMakeLists.txt         | 18 +----
 9 files changed, 13 insertions(+), 190 deletions(-)
 delete mode 100755 DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/LArCustomShape.h

diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/LArCustomShape.h b/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/LArCustomShape.h
deleted file mode 100755
index e062f908943a..000000000000
--- a/DetectorDescription/GeoModel/GeoModelUtilities/GeoModelUtilities/LArCustomShape.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LArCustomShape_h
-#define LArCustomShape_h
-
-#include <string>
-
-#include "GeoModelKernel/GeoShape.h"
-
-// Forward declaration
-class GeoShapeAction;
-
-class LArCustomShape : public GeoShape
-{
- public:
-
-  // The custom shape has only one property: a string that contains
-  // the name of the particular shape.  In the GeoModel->Geant4
-  // conversion, this name will be matched against a list of custom
-  // classes that inherit from G4VSolid to get the correct custom
-  // solid.
-  LArCustomShape(const std::string& shapeName);
-
-  //	Returns the volume of the shape, for mass inventory
-  virtual double volume() const;
-
-  //	Returns the shape type, as a string.
-  virtual const std::string& type() const;
-
-  //	Returns the shape type, as a coded integer.
-  virtual ShapeType typeID() const;
-
-  //        For type identification.
-  static const std::string& getClassType();
-
-  //        For type identification.
-  static const ShapeType getClassTypeID();
-
-  // Return the shape name, supplied in the constructor.
-  virtual const std::string& name() const;
-
-  //	Executes a GeoShapeAction
-  virtual void exec(GeoShapeAction* action) const;
-
- protected:
-  virtual ~LArCustomShape();
-  
- private:
-  
-  // Prohibited operations.
-  LArCustomShape(const LArCustomShape &right);
-  const LArCustomShape & operator=(const LArCustomShape &right);
-
-  // General GeoModel shape attributes.
-  static const std::string classType;
-  static const ShapeType classTypeID;
-
-  // Properties of the custom shape.
-  const std::string m_shapeName;
-};
-
-inline const std::string& LArCustomShape::getClassType()
-{
-  return classType;
-}
-
-inline const ShapeType LArCustomShape::getClassTypeID()
-{
-  return classTypeID;
-}
-
-#endif 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt
index 4d5bc4fbe506..b377202b33f3 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/CMakeLists.txt
@@ -5,30 +5,7 @@
 # Declare the package name:
 atlas_subdir( LArGeoAlgsNV )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          LArCalorimeter/LArGeoModel/LArReadoutGeometry
-                          PRIVATE
-                          Control/AthenaKernel
-                          Control/SGTools
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          DetectorDescription/DetDescrCond/DetDescrConditions
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-			              DetectorDescription/GeoPrimitives
-                          GaudiKernel
-                          LArCalorimeter/LArGeoModel/LArGeoBarrel
-                          LArCalorimeter/LArGeoModel/LArGeoCode
-                          LArCalorimeter/LArGeoModel/LArGeoEndcap
-                          LArCalorimeter/LArGeoModel/LArGeoRAL
-                          LArCalorimeter/LArGeoModel/LArGeoTBBarrel
-                          LArCalorimeter/LArGeoModel/LArHV )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CLHEP )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -36,8 +13,8 @@ find_package( GeoModelCore )
 atlas_add_component( LArGeoAlgsNV
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ${EIGEN_LIBRARIES} GeoModelUtilities LArReadoutGeometry SGTools StoreGateLib SGtests DetDescrConditions GaudiKernel LArGeoBarrel LArGeoCode LArGeoEndcap LArGeoRAL LArGeoTBBarrel LArHV RDBAccessSvcLib )
+                     INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} ${EIGEN_LIBRARIES} GeoModelUtilities LArReadoutGeometry SGTools StoreGateLib SGtests DetDescrConditions GaudiKernel LArGeoBarrel LArGeoCode LArGeoEndcap LArGeoRAL LArGeoTBBarrel LArHV RDBAccessSvcLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
index 146b27b9fe89..c71f6e368c5c 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
@@ -19,8 +19,6 @@
 #include "GeoModelKernel/GeoDefinitions.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
-#include "CLHEP/Geometry/Transform3D.h"
-
 #include "LArGeoCode/LArMaterialManager.h"
 #include "GeoModelInterfaces/StoredMaterialManager.h"
 #include "GeoModelUtilities/GeoDBUtils.h"
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoBarrel/CMakeLists.txt
index 9eebf3f4d9fa..605a22567505 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/CMakeLists.txt
@@ -5,20 +5,7 @@
 # Declare the package name:
 atlas_subdir( LArGeoBarrel )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          LArCalorimeter/LArGeoModel/LArGeoCode
-                          PRIVATE
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          GaudiKernel
-                          LArCalorimeter/LArGeoModel/LArReadoutGeometry )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -27,7 +14,6 @@ atlas_add_library( LArGeoBarrel
                    src/*.cxx
                    PUBLIC_HEADERS LArGeoBarrel
                    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
                    LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} LArGeoCode StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} GeoModelUtilities GaudiKernel LArReadoutGeometry RDBAccessSvcLib )
+                   PRIVATE_LINK_LIBRARIES GeoModelUtilities GaudiKernel LArReadoutGeometry RDBAccessSvcLib )
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoCode/CMakeLists.txt
index 5bf5a124e0c9..9c90099e7495 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoCode/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/CMakeLists.txt
@@ -5,23 +5,14 @@
 # Declare the package name:
 atlas_subdir( LArGeoCode )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          GaudiKernel )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( GeoModelCore )
 
 # Component(s) in the package:
 atlas_add_library( LArGeoCode
                    src/*.cxx
                    PUBLIC_HEADERS LArGeoCode
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS}
                    LINK_LIBRARIES StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GaudiKernel GeoModelInterfaces RDBAccessSvcLib )
+                   PRIVATE_LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} GaudiKernel GeoModelInterfaces RDBAccessSvcLib )
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoEndcap/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoEndcap/CMakeLists.txt
index da3a35cf1794..bd34b62ceef5 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoEndcap/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoEndcap/CMakeLists.txt
@@ -5,25 +5,7 @@
 # Declare the package name:
 atlas_subdir( LArGeoEndcap )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          LArCalorimeter/LArGeoModel/LArGeoFcal
-                          LArCalorimeter/LArGeoModel/LArGeoHec
-                          PRIVATE
-                          Calorimeter/CaloDetDescr
-                          Calorimeter/CaloIdentifier
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          DetectorDescription/GeoModel/GeoSpecialShapes
-                          GaudiKernel
-                          LArCalorimeter/LArGeoModel/LArGeoCode
-                          LArCalorimeter/LArGeoModel/LArGeoMiniFcal )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -31,7 +13,7 @@ find_package( GeoModelCore )
 atlas_add_library( LArGeoEndcap
                    src/*.cxx
                    PUBLIC_HEADERS LArGeoEndcap
-                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} LArGeoFcal LArGeoHec StoreGateLib SGtests CaloDetDescrLib
+                   INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                   LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} LArGeoFcal LArGeoHec StoreGateLib SGtests CaloDetDescrLib
                    PRIVATE_LINK_LIBRARIES CaloIdentifier GeoModelUtilities GeoSpecialShapes GaudiKernel LArGeoCode LArGeoMiniFcal RDBAccessSvcLib )
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoFcal/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoFcal/CMakeLists.txt
index 3b5bc155b63c..c201654de36a 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoFcal/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoFcal/CMakeLists.txt
@@ -5,19 +5,7 @@
 # Declare the package name:
 atlas_subdir( LArGeoFcal )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Database/RDBAccessSvc
-                          PRIVATE
-                          Control/StoreGate
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          GaudiKernel
-                          LArCalorimeter/LArGeoModel/LArReadoutGeometry )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -27,8 +15,8 @@ find_package( GeoModelCore )
 atlas_add_library( LArGeoFcal
                    src/*.cxx
                    PUBLIC_HEADERS LArGeoFcal
-                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                   INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests
+                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests
                    PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoModelUtilities GaudiKernel LArReadoutGeometry RDBAccessSvcLib  )
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoHec/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArGeoHec/CMakeLists.txt
index 9dd517c31272..998da7a407b6 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoHec/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArGeoHec/CMakeLists.txt
@@ -5,18 +5,7 @@
 # Declare the package name:
 atlas_subdir( LArGeoHec )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaKernel
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          GaudiKernel )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -24,7 +13,7 @@ find_package( GeoModelCore )
 atlas_add_library( LArGeoHec
                    src/*.cxx
                    PUBLIC_HEADERS LArGeoHec
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
                    LINK_LIBRARIES StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel RDBAccessSvcLib )
+                   PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel RDBAccessSvcLib )
 
diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt
index 1e89f66fb92f..65e1a56fc48f 100644
--- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/CMakeLists.txt
@@ -5,23 +5,9 @@
 # Declare the package name:
 atlas_subdir( LArReadoutGeometry )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaKernel
-                          DetectorDescription/GeoPrimitives
-                          DetectorDescription/Identifier
-                          LArCalorimeter/LArGeoModel/LArHV
-                          PRIVATE
-                          Control/StoreGate
-                          Database/RDBAccessSvc
-                          DetectorDescription/GeoModel/GeoModelInterfaces
-                          DetectorDescription/GeoModel/GeoModelUtilities
-                          GaudiKernel )
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( CLHEP )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -30,8 +16,8 @@ atlas_add_library( LArReadoutGeometry
                    src/*.cxx
                    PUBLIC_HEADERS LArReadoutGeometry
                    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
                    LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoPrimitives Identifier LArHV StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelUtilities GaudiKernel RDBAccessSvcLib GeoModelInterfaces )
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelUtilities GaudiKernel RDBAccessSvcLib GeoModelInterfaces )
 
-- 
GitLab


From f74ced33e205e80337c2906830f74e48272e87da Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 7 Jul 2020 05:44:43 +0200
Subject: [PATCH 083/217] Fix library reference.

---
 .../MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
index 9f7b43e3340f..a8604c5a32c3 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/CMakeLists.txt
@@ -46,4 +46,4 @@ atlas_add_component( DCMathSegmentMaker
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives EventPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonStationIntersectSvcLib TrkGeometry TrkSurfaces TrkEventPrimitives TrkParameters TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkRoad TrkTrack TrkExInterfaces TrkFitterInterfaces TrkToolInterfaces TrkDriftCircleMath MuonCondData MuonSegmentMakerToolInterfaces MuonSegmentMakerInterfaces )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives EventPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonStationIntersectSvcLib TrkGeometry TrkSurfaces TrkEventPrimitives TrkParameters TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkRoad TrkTrack TrkExInterfaces TrkFitterInterfaces TrkToolInterfaces TrkDriftCircleMath MuonCondData MuonSegmentMakerToolInterfaces MuonSegmentMakerInterfacesLib )
-- 
GitLab


From 9271e1ca88f76dab9e64f9c8401ba694e8e7668d Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Tue, 7 Jul 2020 11:43:39 +0200
Subject: [PATCH 084/217] Removed the usage of TBB task priorities.

In the current implementations these are unnecessary anyway (a high priority
was only assigned in my original code for "post-execute" tasks, but those are
not part of this implementation), and in the current TBB version they are
already marked as deprecated.
---
 Control/AthCUDA/AthCUDACore/src/Memory.cu      | 18 +++---------------
 .../AthCUDAServices/src/KernelRunnerSvcImpl.cu |  6 +-----
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/Control/AthCUDA/AthCUDACore/src/Memory.cu b/Control/AthCUDA/AthCUDACore/src/Memory.cu
index 94305f8b3377..476008d37593 100644
--- a/Control/AthCUDA/AthCUDACore/src/Memory.cu
+++ b/Control/AthCUDA/AthCUDACore/src/Memory.cu
@@ -76,11 +76,7 @@ namespace AthCUDA {
 
          // If a device is available, then free up the memory using CUDA.
          if( Info::instance().nDevices() != 0 ) {
-            taskArena().enqueue( ::DeviceDeleterTask( ptr )
-#if __TBB_TASK_PRIORITY
-                                 , tbb::priority_normal
-#endif // __TBB_TASK_PRIORITY
-                                );
+            taskArena().enqueue( ::DeviceDeleterTask( ptr ) );
             return;
          }
 
@@ -98,11 +94,7 @@ namespace AthCUDA {
 
          // If a device is available, then free up the memory using CUDA.
          if( Info::instance().nDevices() != 0 ) {
-            taskArena().enqueue( ::DeviceDeleterTask( ptr )
-#if __TBB_TASK_PRIORITY
-                                 , tbb::priority_normal
-#endif // __TBB_TASK_PRIORITY
-                                );
+            taskArena().enqueue( ::DeviceDeleterTask( ptr ) );
             return;
          }
 
@@ -120,11 +112,7 @@ namespace AthCUDA {
 
          // If a device is available, then free up the memory using CUDA.
          if( Info::instance().nDevices() != 0 ) {
-            taskArena().enqueue( ::HostDeleterTask( ptr )
-#if __TBB_TASK_PRIORITY
-                                , tbb::priority_normal
-#endif // __TBB_TASK_PRIORITY
-                                );
+            taskArena().enqueue( ::HostDeleterTask( ptr ) );
             return;
          }
 
diff --git a/Control/AthCUDA/AthCUDAServices/src/KernelRunnerSvcImpl.cu b/Control/AthCUDA/AthCUDAServices/src/KernelRunnerSvcImpl.cu
index d8e6335ead30..909feb7db782 100644
--- a/Control/AthCUDA/AthCUDAServices/src/KernelRunnerSvcImpl.cu
+++ b/Control/AthCUDA/AthCUDAServices/src/KernelRunnerSvcImpl.cu
@@ -114,11 +114,7 @@ namespace AthCUDA {
       // kernel.
       taskArena().enqueue( ::KernelSchedulerTask( m_callback,
                                                   std::move( task ),
-                                                  *this )
-#if __TBB_TASK_PRIORITY
-                           , tbb::priority_normal
-#endif // __TBB_TASK_PRIORITY
-                           );
+                                                  *this ) );
 
       // Return gracefully.
       return;
-- 
GitLab


From 1c3b8142b1b25acf4eee75aa3fe138019deb2eac Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Tue, 7 Jul 2020 11:45:32 +0200
Subject: [PATCH 085/217] Fixes for warnings when using GCC for the CUDA
 compilation.

When not having CUDA available, the CheckerGccPlugins code would print
a warning about a local variable that did not show up with nvcc.

When using GCC a number of function arguments also go unused, which
provided a lot of warnings while compiling AthExCUDA.
---
 .../AthCUDAKernel/ArrayKernelTaskImpl.cuh     | 62 ++++++++++++++-----
 1 file changed, 47 insertions(+), 15 deletions(-)

diff --git a/Control/AthCUDA/AthCUDAKernel/AthCUDAKernel/ArrayKernelTaskImpl.cuh b/Control/AthCUDA/AthCUDAKernel/AthCUDAKernel/ArrayKernelTaskImpl.cuh
index 5ff7c50d3aec..234c83fd70a2 100644
--- a/Control/AthCUDA/AthCUDAKernel/AthCUDAKernel/ArrayKernelTaskImpl.cuh
+++ b/Control/AthCUDA/AthCUDAKernel/AthCUDAKernel/ArrayKernelTaskImpl.cuh
@@ -20,11 +20,11 @@
 /// Helper macro for status code checks inside of these functions
 #define AKT_CHECK( EXP )                                                 \
    do {                                                                  \
-      const int _result = EXP;                                           \
-      if( _result != 0 ) {                                               \
+      const int exp_result = EXP;                                        \
+      if( exp_result != 0 ) {                                            \
          std::cerr << __FILE__ << ":" << __LINE__                        \
                    << " Failed to execute: " << #EXP << std::endl;       \
-         return _result;                                                 \
+         return exp_result;                                              \
       }                                                                  \
    } while( false )
 
@@ -385,11 +385,23 @@ namespace {
                      "Only trivial arrays are supported" );
    public:
       /// Operator scheduling the host->device copy of one array
-      int operator()( cudaStream_t stream, std::size_t arraySizes,
-                      typename ArrayKernelTaskHostVariables< ARGS... >::type&
-                         hostArgs,
-                      typename ArrayKernelTaskDeviceVariables< ARGS... >::type&
-                         deviceArgs ) {
+      int operator()( cudaStream_t
+#ifdef __CUDACC__
+                         stream
+#endif // __CUDACC__
+                      , std::size_t
+#ifdef __CUDACC__
+                         arraySizes
+#endif // __CUDACC__
+                      , typename ArrayKernelTaskHostVariables< ARGS... >::type&
+#ifdef __CUDACC__
+                         hostArgs
+#endif // __CUDACC__
+                      , typename ArrayKernelTaskDeviceVariables< ARGS... >::type&
+#ifdef __CUDACC__
+                         deviceArgs
+#endif // __CUDACC__
+                      ) {
          // Schedule the H->D copy.
          CUDA_EXP_CHECK( cudaMemcpyAsync( std::get< Index >( deviceArgs ).get(),
                                           std::get< Index >( hostArgs ).get(),
@@ -502,11 +514,23 @@ namespace {
                      "Only trivial arrays are supported" );
    public:
       /// Operator scheduling the device->host copy of one array
-      int operator()( cudaStream_t stream, std::size_t arraySizes,
-                      typename ArrayKernelTaskDeviceVariables< ARGS... >::type&
-                         deviceObjs,
-                      typename ArrayKernelTaskHostVariables< ARGS... >::type&
-                         hostObjs ) {
+      int operator()( cudaStream_t
+#ifdef __CUDACC__
+                         stream
+#endif // __CUDACC__
+                      , std::size_t
+#ifdef __CUDACC__
+                         arraySizes
+#endif // __CUDACC__
+                      , typename ArrayKernelTaskDeviceVariables< ARGS... >::type&
+#ifdef __CUDACC__
+                         deviceObjs
+#endif // __CUDACC__
+                      , typename ArrayKernelTaskHostVariables< ARGS... >::type&
+#ifdef __CUDACC__
+                         hostObjs
+#endif // __CUDACC__
+                      ) {
          // Schedule the D->H copy.
          CUDA_EXP_CHECK( cudaMemcpyAsync( std::get< Index >( hostObjs ).get(),
                                           std::get< Index >( deviceObjs ).get(),
@@ -801,8 +825,16 @@ namespace {
       /// Function called at the end of the recursive function calls. This
       /// is the function that actually does something.
       template< typename... ARGS1 >
-      static int execute( cudaStream_t stream, std::size_t arraySizes,
-                          const std::tuple<>&, ARGS1... args ) {
+      static int execute( cudaStream_t
+#ifdef __CUDACC__
+                             stream
+#endif // __CUDACC__
+                          , std::size_t arraySizes, const std::tuple<>&,
+                          ARGS1...
+#ifdef __CUDACC__
+                             args
+#endif // __CUDACC__
+                          ) {
 
          // If the arrays are empty, return right away.
          if( arraySizes == 0 ) {
-- 
GitLab


From 5737b4c36643caa305529bdae8d2d49c8517d845 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Tue, 7 Jul 2020 13:34:39 +0200
Subject: [PATCH 086/217] Update configuration of NSW segment finding for muon
 triggers

Updating the ClusterSegmentFinderTool to use the MuonTrackSummary instead of the COmbinedMuonTrackSummary for the trigger, since we don't have ID tracks available in the trigger when running the segment finding.
---
 .../MuonReconstruction/MuonRecExample/python/MuonRecTools.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
index 082e184d6357..b1f4ca7f6a60 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
@@ -385,7 +385,10 @@ def MuonClusterSegmentFinderTool(name="MuonClusterSegmentFinderTool", extraFlags
     kwargs.setdefault("SLFitter","Trk::GlobalChi2Fitter/MCTBSLFitterMaterialFromTrack")
     import MuonCombinedRecExample.CombinedMuonTrackSummary
     from AthenaCommon.AppMgr import ToolSvc
-    kwargs.setdefault("TrackSummaryTool", ToolSvc.CombinedMuonTrackSummary)
+    if TriggerFlags.MuonSlice.doTrigMuonConfig:
+        kwargs.setdefault("TrackSummaryTool", "MuonTrackSummaryTool" )
+    else:
+        kwargs.setdefault("TrackSummaryTool", ToolSvc.CombinedMuonTrackSummary)
     return CfgMgr.Muon__MuonClusterSegmentFinderTool(name,**kwargs)
 
 def DCMathSegmentMaker(name='DCMathSegmentMaker',extraFlags=None,**kwargs):
-- 
GitLab


From 09ecb5adead7841343eefff01760f49801e26b55 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 7 Jul 2020 12:36:54 +0000
Subject: [PATCH 087/217] Add ATLAS_CHECK_THREAD_SAFETY to InDetGeoModelUtils
 package. Add ATLAS_THREAD_SAFE to mutable Athena::MsgStreamMember m_msg.

---
 .../InDetGeoModelUtils/CMakeLists.txt         |  3 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../InDetGeoModelUtils/InDetDDAthenaComps.h   | 42 +++++++++++++++----
 .../InDetDetectorFactoryBase.h                | 11 ++---
 .../InDetGeoModelUtils/InDetMaterialManager.h | 10 +++--
 .../InDetSubDetectorFactoryBase.h             | 11 ++---
 .../InDetGeoModelUtils/ServiceVolume.h        | 14 +++++--
 .../InDetGeoModelUtils/ServiceVolumeMaker.h   |  3 +-
 .../InDetGeoModelUtils/VolumeBuilder.h        |  5 ++-
 .../src/InDetMaterialManager.cxx              |  2 +-
 .../InDetGeoModelUtils/src/ServiceVolume.cxx  | 42 ++++++++++++++++++-
 .../src/ServiceVolumeMaker.cxx                |  6 +--
 .../InDetServMatGeometryManager.h             |  5 ++-
 .../src/EndPlateFactory.cxx                   |  6 ++-
 .../src/InDetServMatBuilderToolSLHC.cxx       | 10 +++--
 .../src/InDetServMatFactory.cxx               |  6 ++-
 .../src/InDetServMatFactoryDC3.cxx            |  6 ++-
 .../src/InDetServMatFactorySLHC.cxx           |  8 ++--
 .../src/InDetServMatGeometryManager.cxx       |  4 +-
 .../src/PixelServMatFactory.cxx               |  5 ++-
 .../src/PixelServMatFactoryDC3.cxx            |  7 +++-
 .../src/SCT_ServMatFactory.cxx                |  4 +-
 .../src/SCT_ServMatFactoryDC3.cxx             |  9 ++--
 .../src/SquirrelCageFactory.cxx               |  6 ++-
 .../src/SupportRailFactory.cxx                |  6 ++-
 .../src/TRT_ServMatFactory.cxx                |  4 +-
 .../src/TRT_ServMatFactoryDC3.cxx             |  9 ++--
 .../PixelGeoModel/CMakeLists.txt              |  3 +-
 .../PixelGeoModel/ATLAS_CHECK_THREAD_SAFETY   |  1 +
 .../InDetDetDescr/PixelGeoModel/src/DBM_Det.h |  4 +-
 .../PixelGeoModel/src/DBM_Module.h            |  4 +-
 .../PixelGeoModel/src/DBM_ModuleCage.h        |  4 +-
 .../PixelGeoModel/src/DBM_Services.h          |  4 +-
 .../PixelGeoModel/src/DBM_Telescope.h         |  4 +-
 .../PixelGeoModel/src/GeoPixelBarrel.h        |  4 +-
 .../PixelGeoModel/src/GeoPixelCable.h         |  4 +-
 .../PixelGeoModel/src/GeoPixelChip.h          |  4 +-
 .../src/GeoPixelDetailedStaveSupport.cxx      |  4 +-
 .../src/GeoPixelDetailedStaveSupport.h        |  6 +--
 .../PixelGeoModel/src/GeoPixelDisk.h          |  4 +-
 .../PixelGeoModel/src/GeoPixelDiskSLHC.h      |  4 +-
 .../PixelGeoModel/src/GeoPixelDiskSupports.h  |  4 +-
 .../PixelGeoModel/src/GeoPixelECCable.h       |  4 +-
 .../PixelGeoModel/src/GeoPixelEndCap.h        |  4 +-
 .../PixelGeoModel/src/GeoPixelEnvelope.h      |  4 +-
 .../PixelGeoModel/src/GeoPixelFluid.h         |  4 +-
 .../PixelGeoModel/src/GeoPixelFrame.h         |  4 +-
 .../PixelGeoModel/src/GeoPixelHybrid.h        |  4 +-
 .../src/GeoPixelIBLFwdServices.h              |  4 +-
 .../src/GeoPixelIBLFwdSvcCADModel.h           |  4 +-
 .../src/GeoPixelIBLFwdSvcModel1.h             |  4 +-
 .../PixelGeoModel/src/GeoPixelIFlexServices.h |  4 +-
 .../PixelGeoModel/src/GeoPixelLadder.h        |  4 +-
 .../src/GeoPixelLadderServices.h              |  2 +-
 .../PixelGeoModel/src/GeoPixelLayer.h         |  4 +-
 .../PixelGeoModel/src/GeoPixelModule.h        |  4 +-
 .../PixelGeoModel/src/GeoPixelOldFrame.h      |  4 +-
 .../PixelGeoModel/src/GeoPixelPigtail.h       |  4 +-
 .../PixelGeoModel/src/GeoPixelRingSLHC.h      |  4 +-
 .../PixelGeoModel/src/GeoPixelServices.h      |  4 +-
 .../PixelGeoModel/src/GeoPixelSiCrystal.h     |  4 +-
 .../src/GeoPixelSimpleStaveSupport.h          |  4 +-
 .../PixelGeoModel/src/GeoPixelStaveRing.h     |  4 +-
 .../src/GeoPixelStaveRingServices.h           |  4 +-
 .../PixelGeoModel/src/GeoPixelStaveSupport.h  |  6 +--
 .../PixelGeoModel/src/GeoPixelTMT.h           |  7 ++--
 .../PixelGeoModel/src/GeoVPixelFactory.h      |  5 ++-
 .../PixelGeoModel/src/OraclePixGeoManager.cxx | 12 +++---
 .../PixelGeoModel/src/OraclePixGeoManager.h   |  5 ++-
 .../PixelGeoModel/src/PixelDetectorDC1DC2.cxx |  1 +
 .../PixelGeoModel/src/PixelDetectorDC1DC2.h   |  5 ++-
 .../src/PixelDetectorFactory.cxx              |  2 +-
 .../PixelGeoModel/src/PixelDetectorFactory.h  |  5 ++-
 .../src/PixelDetectorFactoryDC2.h             |  5 ++-
 .../src/PixelDetectorFactorySR1.cxx           |  2 +-
 .../src/PixelDetectorFactorySR1.h             |  6 +--
 .../PixelGeoModel/src/PixelDetectorTool.cxx   |  8 ++--
 .../src/PixelGeoModelAthenaComps.cxx          |  9 ++--
 .../SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h  |  5 ++-
 .../SCT_GeoModel/SCT_DetectorFactory.h        |  3 +-
 .../SCT_GeoModel/src/SCT_DataBase.cxx         |  4 +-
 .../SCT_GeoModel/src/SCT_DetectorTool.cxx     |  4 +-
 .../TRT_GeoModel/ATLAS_CHECK_THREAD_SAFETY    |  1 +
 .../src/TRTDetectorFactory_Full.h             |  3 +-
 .../src/TRT_DetDescrDB_ParameterInterface.cxx |  2 +-
 .../src/TRT_DetDescrDB_ParameterInterface.h   |  5 ++-
 .../TRT_GeoModel/src/TRT_DetectorTool.cxx     |  4 +-
 87 files changed, 313 insertions(+), 185 deletions(-)
 create mode 100644 InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetDetDescr/PixelGeoModel/PixelGeoModel/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetDetDescr/TRT_GeoModel/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/CMakeLists.txt
index 0998952d266b..e47c4885b376 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( InDetGeoModelUtils )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaKernel
+                          Control/CxxUtils
                           Database/RDBAccessSvc
                           GaudiKernel
                           PRIVATE
@@ -28,6 +29,6 @@ atlas_add_library( InDetGeoModelUtils
                    PUBLIC_HEADERS InDetGeoModelUtils
                    INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel GaudiKernel StoreGateLib SGtests RDBAccessSvcLib GeoPrimitives
+                   LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaKernel CxxUtils GaudiKernel StoreGateLib SGtests RDBAccessSvcLib GeoPrimitives
                    PRIVATE_LINK_LIBRARIES GeoModelUtilities GeometryDBSvcLib )
 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..c0074e329a8b
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/InDetGeoModelUtils
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
index f0146b75c8dc..7dd8641b422f 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDDAthenaComps.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetGeoModelUtils_InDetDDAthenaComps_H
@@ -7,6 +7,7 @@
 
 // Message Stream Member
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 class  StoreGateSvc;
 class  IGeoDbTagSvc;
 class  IRDBAccessSvc;
@@ -34,13 +35,18 @@ public:
   void setGeometryDBSvc(IGeometryDBSvc *);
 
   StoreGateSvc * detStore() const;
-  IGeoDbTagSvc * geoDbTagSvc() const;
+  const IGeoDbTagSvc * geoDbTagSvc() const;
   IRDBAccessSvc * rdbAccessSvc() const;
-  IGeometryDBSvc * geomDB() const;
+  const IGeometryDBSvc * geomDB() const;
+  
+  StoreGateSvc * detStore();
+  IGeoDbTagSvc * geoDbTagSvc();
+  IRDBAccessSvc * rdbAccessSvc();
+  IGeometryDBSvc * geomDB();
   
 private:
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg;
+  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
   
   StoreGateSvc * m_detStore;
   IGeoDbTagSvc * m_geoDbTagSvc;
@@ -49,22 +55,42 @@ private:
 
 };
 
-inline StoreGateSvc * AthenaComps::detStore() const
+inline StoreGateSvc * AthenaComps::detStore ATLAS_NOT_THREAD_SAFE () const
+{
+  return m_detStore;
+}
+
+inline const IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
+{
+  return m_geoDbTagSvc;
+}
+
+inline IRDBAccessSvc * AthenaComps::rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const
+{
+  return m_rdbAccessSvc;
+}
+
+inline const IGeometryDBSvc * AthenaComps::geomDB() const
+{
+  return m_geometryDBSvc;
+}
+
+inline StoreGateSvc * AthenaComps::detStore()
 {
   return m_detStore;
 }
 
-inline IGeoDbTagSvc * AthenaComps::geoDbTagSvc() const
+inline IGeoDbTagSvc * AthenaComps::geoDbTagSvc()
 {
   return m_geoDbTagSvc;
 }
 
-inline IRDBAccessSvc * AthenaComps::rdbAccessSvc() const
+inline IRDBAccessSvc * AthenaComps::rdbAccessSvc()
 {
   return m_rdbAccessSvc;
 }
 
-inline IGeometryDBSvc * AthenaComps::geomDB() const
+inline IGeometryDBSvc * AthenaComps::geomDB()
 {
   return m_geometryDBSvc;
 }
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
index 936fc3bc3707..dfd46b3e9d47 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetDetectorFactoryBase.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetGeoModelUtils_DetectorFactoryBase_H
 #define InDetGeoModelUtils_DetectorFactoryBase_H
 
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 #include "GeoModelKernel/GeoVDetectorFactory.h" 
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 
@@ -23,13 +24,13 @@ public:
     : m_athenaComps(athenaComps)
   {}
 
-  StoreGateSvc * detStore() const {return m_athenaComps->detStore();}
+  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();}
 
-  IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
+  const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc() const {return m_athenaComps->rdbAccessSvc();}
+  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();}
   
-  IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
+  const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
  //Declaring the Message method for further use
   MsgStream& msg (MSG::Level lvl) const { return m_athenaComps->msg(lvl); }
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
index daec292a8fe3..701107f6f543 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetMaterialManager.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef INDETMATERIALMANAGER_H
@@ -9,6 +9,8 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+
 class GeoMaterial;
 class GeoElement;
 class AbsMaterialManager;
@@ -45,7 +47,7 @@ public:
 		       IRDBRecordset_ptr compositionTable,
 		       const std::string & space = "");
   InDetMaterialManager(const std::string & managerName, 
-		       const InDetDD::AthenaComps *);
+		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::detStore() const is used.
   ~InDetMaterialManager();
 
   void addWeightTable(IRDBRecordset_ptr weightTable, const std::string & space = "");
@@ -184,7 +186,7 @@ private:
   };
   
   
-  const AbsMaterialManager * retrieveManager(StoreGateSvc* detStore);
+  const AbsMaterialManager * retrieveManager(const StoreGateSvc* detStore);
   const GeoMaterial* getAdditionalMaterial(const std::string & materialName) const; 
   bool compareDensity(double d1, double d2) const;
   void addWeightTableOld(IRDBRecordset_ptr weightTable, const std::string & space);
@@ -231,7 +233,7 @@ private:
   ExtraScaleFactorMap m_scalingMap;
 
   //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg;
+  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
 
   // Has linear weight flag. 
   bool m_extraFunctionality;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
index b87b19bc8d2e..d09860ce6f81 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/InDetSubDetectorFactoryBase.h
@@ -6,6 +6,7 @@
 #define InDetGeoModelUtils_SubDetectorFactoryBase_H
 
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 
 #include <memory>
@@ -36,15 +37,15 @@ public:
       m_materialManager(matManager)
   {}
 
-  StoreGateSvc * detStore() const {return m_athenaComps->detStore();}
+  StoreGateSvc * detStore ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->detStore();} // const method returns non-const pointer
 
-  IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
+  const IGeoDbTagSvc * geoDbTagSvc() const {return m_athenaComps->geoDbTagSvc();}
 
-  IRDBAccessSvc * rdbAccessSvc() const {return m_athenaComps->rdbAccessSvc();}
+  IRDBAccessSvc * rdbAccessSvc ATLAS_NOT_THREAD_SAFE () const {return m_athenaComps->rdbAccessSvc();} // const method returns non-const pointer
   
-  IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
+  const IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();}
 
-  InDetMaterialManager * materialManager() const {return m_materialManager;}
+  InDetMaterialManager * materialManager ATLAS_NOT_THREAD_SAFE () const {return m_materialManager;} // const method returns non-const pointer
 
  //Declaring the Message method for further use
   MsgStream& msg (MSG::Level lvl) const { return m_athenaComps->msg(lvl); }
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h
index c19e54b0a65b..888c8fc667bb 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolume.h
@@ -1,12 +1,15 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetDD_ServiceVolume_H
 #define InDetDD_ServiceVolume_H
 
-#include <string>
+#include "CxxUtils/checker_macros.h"
+
 #include <cmath>
+#include <mutex>
+#include <string>
 
 class GeoMaterial;
 class GeoShape;
@@ -34,6 +37,7 @@ namespace InDetDD {
 
   public: 
     ServiceVolume();
+    ServiceVolume(const ServiceVolume&);
     void setRmin(double rmin) {m_rmin = rmin; resetGeoShape();} 
     void setRmax(double rmax) {m_rmax = rmax; resetGeoShape();} 
     void setRmin2(double rmin2) {m_rmin2 = rmin2; resetGeoShape();} 
@@ -114,7 +118,7 @@ namespace InDetDD {
     double m_zmax;
     //int m_volId;
     bool m_zsymm;
-    mutable GeoShapeHolder m_geoShape;
+    mutable GeoShapeHolder m_geoShape ATLAS_THREAD_SAFE; // Guarded by m_mutex
     const GeoMaterial * m_material;
     std::string m_materialName;
     std::string m_volName;
@@ -126,7 +130,7 @@ namespace InDetDD {
     int m_nCopies;
     //double m_origLength;
     double m_origVolume;
-    mutable double m_volume;
+    mutable double m_volume ATLAS_THREAD_SAFE; // Guarded by m_mutex
     double m_safety;
     std::string m_region;
     std::string m_label;
@@ -137,6 +141,8 @@ namespace InDetDD {
     int m_envNum;
     int m_envParentNum; 
     double m_zShift;
+
+    mutable std::mutex m_mutex;
   };
   
 } // End namespace 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
index 5d60d77aa6b5..39d2dae48557 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/ServiceVolumeMaker.h
@@ -8,6 +8,7 @@
 #include <string>
 #include <vector>
 #include "RDBAccessSvc/IRDBAccessSvc.h"
+#include "CxxUtils/checker_macros.h"
 
 class IGeometryDBSvc;
 
@@ -137,7 +138,7 @@ namespace InDetDD {
     ServiceVolumeMaker(const std::string & label,
 		       IRDBRecordset_ptr table, 
 		       const ServiceVolumeSchema & schema,
-		       const InDetDD::AthenaComps *);
+		       const InDetDD::AthenaComps *) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe ServiceVolumeMakerMgr::readLayerShift method is used.
 		ServiceVolumeMaker(const ServiceVolumeMaker &) = delete;
 		ServiceVolumeMaker & operator =(const ServiceVolumeMaker &) = delete;
     ~ServiceVolumeMaker();
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
index 8320b41bbe06..39e1be7b0d97 100644
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/VolumeBuilder.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetGeoModelUtils_VolumeBuilder_H
@@ -8,6 +8,7 @@
 #include "InDetGeoModelUtils/VolumeSplitterUtils.h"
 #include "InDetGeoModelUtils/VolumeSplitter.h"
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 
 #include <string>
 #include <vector>
@@ -58,7 +59,7 @@ namespace InDetDD {
   private:
     //const GeoShape * getShape(const ServiceVolume & param, double & volume);
     
-    mutable Athena::MsgStreamMember m_msg;
+    mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
     std::string m_region;
     double m_zcenter;
     const std::vector<const ServiceVolume *>* m_services;
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
index 5928aa25c2a2..71394b1ec6e4 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/InDetMaterialManager.cxx
@@ -84,7 +84,7 @@ InDetMaterialManager::~InDetMaterialManager() {
 }
 
 const AbsMaterialManager*
-InDetMaterialManager::retrieveManager(StoreGateSvc* detStore) {
+InDetMaterialManager::retrieveManager(const StoreGateSvc* detStore) {
   const StoredMaterialManager* theGeoMaterialManager = nullptr;
 
   if (StatusCode::SUCCESS != detStore->retrieve(theGeoMaterialManager, "MATERIALS")) {
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx
index f56e26a48c27..90e12319d193 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolume.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 //
@@ -119,9 +119,43 @@ namespace InDetDD {
     m_splittableZ(true),
     m_envNum(0),
     m_envParentNum(0),
-    m_zShift(0.)
+    m_zShift(0.),
+    m_mutex()
   {}
 
+  ServiceVolume::ServiceVolume(const ServiceVolume& rhs)
+    : m_rmin(rhs.m_rmin),
+      m_rmax(rhs.m_rmax),
+      m_rmin2(rhs.m_rmin2),
+      m_rmax2(rhs.m_rmax2),
+      m_zmin(rhs.m_zmin),
+      m_zmax(rhs.m_zmax),
+      //m_volId(rhs.m_volId),
+      m_zsymm(rhs.m_zsymm),
+      m_geoShape(rhs.m_geoShape),
+      m_material(rhs.m_material),
+      m_materialName(rhs.m_materialName),
+      m_volName(rhs.m_volName),
+      m_shapeType(rhs.m_shapeType),
+      m_phiLoc(rhs.m_phiLoc),
+      m_phiWidth(rhs.m_phiWidth),
+      m_needsRotation(rhs.m_needsRotation),
+      m_sides(rhs.m_sides),
+      m_nCopies(rhs.m_nCopies),
+      //m_origLength(rhs.m_origLength),
+      m_origVolume(rhs.m_origVolume),
+      m_volume(rhs.m_volume),
+      m_safety(rhs.m_safety),
+      m_region(rhs.m_region),
+      m_label(rhs.m_label),
+      m_lockGeoShape(rhs.m_lockGeoShape),
+      m_splittableR(rhs.m_splittableR),
+      m_splittableZ(rhs.m_splittableZ),
+      m_envNum(rhs.m_envNum),
+      m_envParentNum(rhs.m_envParentNum),
+      m_zShift(rhs.m_zShift),
+      m_mutex()
+  {}
 
   void
   ServiceVolume::reduceSize(double safety) {
@@ -130,6 +164,7 @@ namespace InDetDD {
       if (m_zmax < m_zmin) std::swap(m_zmin, m_zmax);
       m_safety = safety;
     }
+    std::lock_guard<std::mutex> lock(m_mutex);
     m_geoShape = 0;
   }
 
@@ -161,6 +196,8 @@ namespace InDetDD {
 
   const GeoShape*
   ServiceVolume::getShape() const {
+    std::lock_guard<std::mutex> lock(m_mutex);
+
     // If prebuilt then return
     if (m_geoShape.get()) return m_geoShape.get();
 
@@ -291,6 +328,7 @@ namespace InDetDD {
   ServiceVolume::volume() const {
     // Make sure shape is already built.
     getShape();
+    std::lock_guard<std::mutex> lock(m_mutex);
     return m_volume;
   }
 
diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
index 12d569b60288..00ee4b9fc97e 100755
--- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
+++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/src/ServiceVolumeMaker.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 #include "InDetGeoModelUtils/ServiceVolumeMaker.h"
@@ -218,11 +218,11 @@ namespace InDetDD {
   }
 
   std::vector<double>
-  ServiceVolumeMakerMgr::readLayerShift() const {
+  ServiceVolumeMakerMgr::readLayerShift ATLAS_NOT_THREAD_SAFE () const { // Thread unsafe IRDBAccessSvc* InDetDD::AthenaComps::rdbAccessSvc() const is used.
     std::vector<double> layerShift;
 
     IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc();
-    IGeoDbTagSvc* geoDbTag = m_athenaComps->geoDbTagSvc();
+    const IGeoDbTagSvc* geoDbTag = m_athenaComps->geoDbTagSvc();
 
     DecodeVersionKey versionKey(geoDbTag, "Pixel");
     std::string detectorKey = versionKey.tag();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
index 100f00b8847a..0155f5478548 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef InDetServMatGeometryManager_H
 #define InDetServMatGeometryManager_H
 
+#include "CxxUtils/checker_macros.h"
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
@@ -14,7 +15,7 @@ class InDetMaterialManager;
 class InDetServMatGeometryManager
 {
 public:
-  InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps);
+  InDetServMatGeometryManager(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
  
   ~InDetServMatGeometryManager();
   
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
index c70c11f80613..e8213943495a 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/EndPlateFactory.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/EndPlateFactory.h"
@@ -23,6 +23,8 @@
 #include "GeoModelInterfaces/IGeoDbTagSvc.h"
 #include "GeoModelUtilities/DecodeVersionKey.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/SystemOfUnits.h"
 
 #include <iostream>
@@ -41,7 +43,7 @@ EndPlateFactory::~EndPlateFactory()
 
 
 //## Other Operations (implementation)
-void EndPlateFactory::create(GeoPhysVol *mother)
+void EndPlateFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother)
 {
    DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
    IRDBRecordset_ptr shell  = rdbAccessSvc()->getRecordsetPtr("EPShell",  indetVersionKey.tag(), indetVersionKey.node());
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx
index c30a08e87c44..c98f38a78497 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/InDetServMatBuilderToolSLHC.h"
@@ -19,6 +19,8 @@
 #include "InDetServMatGeoModel/ServicesTrackerBuilder.h"
 #include "InDetServMatGeoModel/ServiceVolume.h"
 
+#include "CxxUtils/checker_macros.h"
+
 //================ Constructor =================================================
 InDetServMatBuilderToolSLHC::InDetServMatBuilderToolSLHC(const std::string& t,
 						 const std::string& name,
@@ -51,7 +53,7 @@ InDetServMatBuilderToolSLHC::~InDetServMatBuilderToolSLHC()
 
 
 //================ Initialize =================================================
-StatusCode InDetServMatBuilderToolSLHC::initialize()
+StatusCode InDetServMatBuilderToolSLHC::initialize ATLAS_NOT_THREAD_SAFE () // Thread unsafe build method is used.
 {
   
   StatusCode sc = AlgTool::initialize();
@@ -104,13 +106,13 @@ const std::vector<const InDetDD::ServiceVolume *> & InDetServMatBuilderToolSLHC:
   return m_services;
 }
 
-void InDetServMatBuilderToolSLHC::geoInit()
+void InDetServMatBuilderToolSLHC::geoInit ATLAS_NOT_THREAD_SAFE () // Thread unsafe InDetServMatGeometryManager constructor is used.
 {
   m_geoMgr = new InDetServMatGeometryManager(m_athenaComps);
 }
 
 
-void InDetServMatBuilderToolSLHC::build()
+void InDetServMatBuilderToolSLHC::build ATLAS_NOT_THREAD_SAFE () // 
 {
   // Do nothing if services are not to be built.
   geoInit();
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
index b69e6c15e7d0..d6131c8fd554 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactory.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/InDetServMatFactory.h"
@@ -37,6 +37,8 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "GaudiKernel/PhysicalConstants.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <iostream>
 
 InDetServMatFactory::InDetServMatFactory(const InDetDD::AthenaComps * athenaComps)
@@ -54,7 +56,7 @@ InDetServMatFactory::~InDetServMatFactory()
 
 
 //## Other Operations (implementation)
-void InDetServMatFactory::create(GeoPhysVol *world )
+void InDetServMatFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *world ) // Thread unsafe rdbAccessSvc method and InDetMaterialManager constructor are used.
 {
 
   // create a new det manager
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
index 010bd1058f32..7940808e20f6 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactoryDC3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/InDetServMatFactoryDC3.h"
@@ -35,6 +35,8 @@
 #include "RDBAccessSvc/IRDBRecordset.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
@@ -52,7 +54,7 @@ InDetServMatFactoryDC3::~InDetServMatFactoryDC3()
 
 
 //## Other Operations (implementation)
-void InDetServMatFactoryDC3::create(GeoPhysVol *world )
+void InDetServMatFactoryDC3::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *world ) // Thread unsafe rdbAccessSvc method is used.
 {
 
 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
index 67ae46d9494b..a6fb9a02b8bb 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatFactorySLHC.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/InDetServMatFactorySLHC.h"
@@ -35,6 +35,8 @@
 #include "RDBAccessSvc/IRDBRecordset.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include "GaudiKernel/PhysicalConstants.h"
 #include <iostream>
 
@@ -57,7 +59,7 @@ InDetServMatFactorySLHC::~InDetServMatFactorySLHC()
 
 
 //## Other Operations (implementation)
-void InDetServMatFactorySLHC::create(GeoPhysVol *world )
+void InDetServMatFactorySLHC::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *world ) // Thread unsafe InDetMaterialManager constructor and fetchTables method are used.
 {
 
   // Get the material manager:  
@@ -131,7 +133,7 @@ const InDetDD::InDetServMatManager* InDetServMatFactorySLHC::getDetectorManager
 }
 
 void
-InDetServMatFactorySLHC::fetchTables() 
+InDetServMatFactorySLHC::fetchTables ATLAS_NOT_THREAD_SAFE ()  // Thread unsafe rdbAccessSvc method is used.
 {
   DecodeVersionKey indetVersionKey(geoDbTagSvc(), "InnerDetector");
 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
index 774517d103b0..f5e9a48132ad 100644
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatGeometryManager.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/InDetServMatGeometryManager.h"
@@ -19,7 +19,7 @@ InDetServMatGeometryManager::InDetServMatGeometryManager(const InDetDD::AthenaCo
   
   if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Initializing InDetServMatGeometryManager" << endmsg;
    
-  IGeoDbTagSvc *geoDbTag = m_athenaComps->geoDbTagSvc();
+  const IGeoDbTagSvc *geoDbTag = m_athenaComps->geoDbTagSvc();
   IRDBAccessSvc *rdbSvc = m_athenaComps->rdbAccessSvc();
 
   // Get version tag and node for Pixel.
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
index d4345d719eb2..1cd41e4df1a7 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactory.cxx
@@ -24,6 +24,9 @@
 #include "RDBAccessSvc/IRDBAccessSvc.h"
 #include "GeoModelInterfaces/IGeoDbTagSvc.h"
 #include "GeoModelUtilities/DecodeVersionKey.h"
+
+#include "CxxUtils/checker_macros.h"
+
 #include <iostream>
 
 
@@ -38,7 +41,7 @@ PixelServMatFactory::~PixelServMatFactory()
 
 
 //## Other Operations (implementation)
-void PixelServMatFactory::create(GeoPhysVol *mother)
+void PixelServMatFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc and materialManager methods are used.
 {
   msg(MSG::DEBUG) << "Building Pixel Service Material" << endmsg; 
   
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
index 0fe4bd0dc21b..90351e689cd3 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/PixelServMatFactoryDC3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/PixelServMatFactoryDC3.h"
@@ -24,6 +24,9 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/SystemOfUnits.h"
+
+#include "CxxUtils/checker_macros.h"
+
 #include <iostream>
 
 #define SKIPCYLINDER 3
@@ -43,7 +46,7 @@ PixelServMatFactoryDC3::~PixelServMatFactoryDC3()
 
 
 //## Other Operations (implementation)
-void PixelServMatFactoryDC3::create(GeoPhysVol *mother)
+void PixelServMatFactoryDC3::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc method is used.
 {
   msg(MSG::DEBUG) << "Building Pixel Service Material" << endmsg;
 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
index 2a5e7b46f230..e6eb4ee1b487 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactory.cxx
@@ -27,6 +27,8 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <sstream>
 #include <iostream>
 
@@ -42,7 +44,7 @@ SCT_ServMatFactory::~SCT_ServMatFactory()
 
 
 //## Other Operations (implementation)
-void SCT_ServMatFactory::create(GeoPhysVol *mother)
+void SCT_ServMatFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc method and InDetMaterialManager constructor are used.
 {
 
   msg(MSG::DEBUG) << "Building SCT Service Material" << endmsg;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
index d9686cdeb56c..fd3a7bd810d0 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SCT_ServMatFactoryDC3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/SCT_ServMatFactoryDC3.h"
@@ -28,6 +28,8 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/PhysicalConstants.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #define TRTELEMENTSINEL 9
 #define SCTELEMENTSINEL 8
 
@@ -40,7 +42,7 @@ SCT_ServMatFactoryDC3::SCT_ServMatFactoryDC3(const InDetDD::AthenaComps * athena
 }
 
 //## Other Operations (implementation)
-void SCT_ServMatFactoryDC3::create(GeoPhysVol *mother)
+void SCT_ServMatFactoryDC3::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc and materialManager methods are used.
 {
 
   msg(MSG::DEBUG) << "Building SCT Service Material" << endmsg;
@@ -242,7 +244,8 @@ const GeoShape* SCT_ServMatFactoryDC3::createShape(int volType,
   return IDShape;
 }
 
-const GeoMaterial* SCT_ServMatFactoryDC3::createMaterial(const std::string & name,
+const GeoMaterial* SCT_ServMatFactoryDC3::createMaterial ATLAS_NOT_THREAD_SAFE // Thread unsafe materialManager method is used.
+                                                  (const std::string & name,
 						   int volType, 
 						   double fractionRL,
 						   double rmin1, 
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
index 5e82ef6e382f..083a0be6babd 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SquirrelCageFactory.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/SquirrelCageFactory.h"
@@ -25,6 +25,8 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GaudiKernel/PhysicalConstants.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <iostream>
 
 
@@ -42,7 +44,7 @@ SquirrelCageFactory::~SquirrelCageFactory()
 
 
 //## Other Operations (implementation)
-void SquirrelCageFactory::create(GeoPhysVol *mother)
+void SquirrelCageFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc method is used.
 {
 
   DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
index 1d4404b39b6e..d7dd2a222df1 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/SupportRailFactory.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/SupportRailFactory.h"
@@ -26,6 +26,8 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <iostream>
 #include <math.h>
 
@@ -43,7 +45,7 @@ SupportRailFactory::~SupportRailFactory()
 
 
 //## Other Operations (implementation)
-void SupportRailFactory::create(GeoPhysVol *mother)
+void SupportRailFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread usnafe rdbAccessSvc and materialManager methods are used.
 {
 
   DecodeVersionKey atlasVersionKey(geoDbTagSvc(),"ATLAS");
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
index 65526925cd7e..274ee7b48c7b 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactory.cxx
@@ -28,6 +28,8 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #include <sstream>
 #include <iostream>
 
@@ -44,7 +46,7 @@ TRT_ServMatFactory::~TRT_ServMatFactory()
 
 
 //## Other Operations (implementation)
-void TRT_ServMatFactory::create(GeoPhysVol *mother)
+void TRT_ServMatFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc method is used.
 {
 
   msg(MSG::DEBUG) << "Building TRT Service Material" << endmsg;
diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
index 6975efb97484..493d0eb15808 100755
--- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
+++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/TRT_ServMatFactoryDC3.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetServMatGeoModel/TRT_ServMatFactoryDC3.h"
@@ -25,6 +25,8 @@
 #include "GeoModelUtilities/DecodeVersionKey.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
+#include "CxxUtils/checker_macros.h"
+
 #define NUMBEROFPANEL 2
 #define TRTELEMENTSINEL 9  // VK - now number of record is determined automatically
 
@@ -46,7 +48,7 @@ TRT_ServMatFactoryDC3::~TRT_ServMatFactoryDC3()
 
 
 //## Other Operations (implementation)
-void TRT_ServMatFactoryDC3::create(GeoPhysVol *mother)
+void TRT_ServMatFactoryDC3::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *mother) // Thread unsafe rdbAccessSvc and materialManager methods are used.
 {
 
   msg(MSG::DEBUG) << "Building TRT Service Material" << endmsg;
@@ -227,7 +229,8 @@ void TRT_ServMatFactoryDC3::create(GeoPhysVol *mother)
   return IDShape;
 }
 
-const GeoMaterial* TRT_ServMatFactoryDC3::createMaterial(const std::string & name,
+const GeoMaterial* TRT_ServMatFactoryDC3::createMaterial ATLAS_NOT_THREAD_SAFE // Thread unsafe materialManager method is used.
+                                                  (const std::string & name,
 						   int volType, 
 						   double fractionRL,
 						   double rmin1, 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt
index 3be08e6b3985..a502cacda395 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/CMakeLists.txt
@@ -10,6 +10,7 @@ atlas_depends_on_subdirs(
    PUBLIC
    Control/AthenaBaseComps
    Control/AthenaKernel
+   Control/CxxUtils
    Database/RDBAccessSvc
    DetectorDescription/GeoModel/GeoModelInterfaces
    DetectorDescription/GeoModel/GeoModelUtilities
@@ -35,7 +36,7 @@ atlas_add_library( PixelGeoModelLib
    PixelGeoModel/*.h src/*.cxx
    PUBLIC_HEADERS PixelGeoModel
    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-   LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AthenaKernel 
+   LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils
    GeoModelUtilities Identifier GaudiKernel InDetGeoModelUtils
    InDetReadoutGeometry PixelReadoutGeometry
    PRIVATE_LINK_LIBRARIES SGTools StoreGateLib DetDescrConditions
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/PixelGeoModel/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/PixelGeoModel/PixelGeoModel/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..543d925b1312
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/PixelGeoModel/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/PixelGeoModel
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Det.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Det.h
index eff928892053..5c3292fc41f0 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Det.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Det.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -20,7 +20,7 @@
   Diamond Beam Monitor detector builder
   */  
 
-class DBM_Det : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE DBM_Det : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   DBM_Det();
   virtual  GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.h
index a91a81beb563..f08cbd321ff9 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Module.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DBMModule_H
@@ -24,7 +24,7 @@ namespace InDetDD {
   class PixelDiodeMatrix;
 }
 
-class DBM_Module : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE DBM_Module : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
   public:
 
   DBM_Module();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_ModuleCage.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_ModuleCage.h
index a4db870afa1b..cf3c89d44c49 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_ModuleCage.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_ModuleCage.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DBMModuleCage_h
@@ -17,7 +17,7 @@
  *
  */
 
-class DBM_ModuleCage : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE DBM_ModuleCage : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
   public:
     GeoVPhysVol* Build();
   private:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Services.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Services.h
index 07d1c75beb69..92b7c9934a98 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Services.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Services.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef DBMSERVICES_h
@@ -15,7 +15,7 @@
  *
  */
 
-class DBM_PP0 : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE DBM_PP0 : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
   public:
     GeoVPhysVol* Build();
   private:
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Telescope.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Telescope.h
index 7a9570249d55..9657e57a83db 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Telescope.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/DBM_Telescope.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -16,7 +16,7 @@
  *
  */
 
-class DBM_Telescope : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE DBM_Telescope : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoVPhysVol* Build();
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelBarrel.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelBarrel.h
index 16f097816ab7..652779eeb5bd 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelBarrel.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelBarrel.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELBARREL_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoPixelServices;
 
-class GeoPixelBarrel : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelBarrel : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelBarrel(const GeoPixelServices * pixServices);
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelCable.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelCable.h
index c27414f2d6d2..86fc77bbc94a 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelCable.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelCable.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELCABLE_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 #include <vector>
 
-class GeoPixelCable : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelCable : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelCable();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelChip.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelChip.h
index 57c7e6ec0788..fac2b01bbe8a 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelChip.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelChip.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELCHIP_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelChip : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelChip : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelChip(bool isModule3D): m_isModule3D(isModule3D) {};
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx
index f78c47d28368..2f76844d03dd 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -36,7 +36,7 @@ GeoPixelDetailedStaveSupport::GeoPixelDetailedStaveSupport()
 
 }
 
-GeoVPhysVol* GeoPixelDetailedStaveSupport::Build() {
+GeoVPhysVol* GeoPixelDetailedStaveSupport::Build ATLAS_NOT_THREAD_SAFE () { // Thread unsafe GeoPixelSiCrystal and GeoPixelModule classes are used.
 
   m_gmt_mgr->msg(MSG::INFO) <<"Build detailed stave support description :  layout "<<m_gmt_mgr->PixelStaveLayout()<<endmsg;
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.h
index cf65e714dec5..cca49aab4d27 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDetailedStaveSupport.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELDETAILEDSTAVESUPPORT_H
@@ -14,9 +14,9 @@
 class GeoPixelDetailedStaveSupport : public GeoPixelStaveSupport {
 
 public:  
-  GeoPixelDetailedStaveSupport();
+  GeoPixelDetailedStaveSupport() ATLAS_CTORDTOR_NOT_THREAD_SAFE;
   virtual GeoVPhysVol* Build();
-  virtual GeoVPhysVol* getPhysVol() const {return m_physVol;}
+  virtual GeoVPhysVol* getPhysVol ATLAS_NOT_THREAD_SAFE () const {return m_physVol;}
   virtual const GeoTrf::Transform3D & transform() const {return m_transform;}
   virtual double thicknessP() const {return m_thicknessP;}
   virtual double thicknessN() const {return m_thicknessN;}
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.h
index 484e5919ae59..2a60e19d529b 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDisk.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELDISK_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelDisk : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelDisk : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelDisk();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSLHC.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSLHC.h
index d3b882e6d1cb..a0139742053e 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSLHC.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSLHC.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELDISKSLHC_H
@@ -7,7 +7,7 @@
 
 #include "GeoVPixelFactory.h"
 
-class GeoPixelDiskSLHC : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelDiskSLHC : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelDiskSLHC();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSupports.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSupports.h
index c60302eac1ae..32cefb95ae54 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSupports.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelDiskSupports.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELDISKSUPPORTS_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelDiskSupports : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelDiskSupports : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
  public:
   GeoPixelDiskSupports();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelECCable.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelECCable.h
index ec4bf77bb4e0..a54c3cfb28ce 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelECCable.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelECCable.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELECCABLE_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelECCable : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelECCable : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelECCable();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.h
index eba497217a34..e2b7a6821251 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEndCap.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELENDCAP_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoPixelServices;
 
-class GeoPixelEndCap : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelEndCap : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelEndCap(const GeoPixelServices * pixServices);
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.h
index da67c0c8e462..1cb4ad66cc21 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelEnvelope.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELENVELOPE_H
@@ -7,7 +7,7 @@
 
 #include "GeoVPixelFactory.h"
 
-class GeoPixelEnvelope : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelEnvelope : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   virtual GeoVPhysVol* Build();
 };
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFluid.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFluid.h
index 06909551298b..9b2515565f44 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFluid.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFluid.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELFLUID_H
@@ -10,7 +10,7 @@
 
 class GeoLogVol;
 
-class GeoPixelFluid : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelFluid : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 public:
   GeoPixelFluid(int type);
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.h
index 6648da6ba285..1bb32167488f 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelFrame.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELFRAME_H
@@ -7,7 +7,7 @@
 
 #include "GeoVPixelFactory.h"
 
-class GeoPixelFrame : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelFrame : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
   GeoPixelFrame();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelHybrid.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelHybrid.h
index ed159c5257e5..6215c7d7c364 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelHybrid.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelHybrid.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELHYBRID_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelHybrid : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelHybrid : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
     GeoPixelHybrid(bool isModule3D): m_isModule3D(isModule3D) {};
     virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.h
index 9b23be3728c3..09ac539d980e 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdServices.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELIBLFWDSERVICES_H
@@ -14,7 +14,7 @@
 
 class GeoTransform;
 
-class GeoPixelIBLFwdServices :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelIBLFwdServices :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.h
index 63a6ddb10b6f..d612e3a8ea53 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcCADModel.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELIBLFWDSVC_CADMODEL_H
@@ -16,7 +16,7 @@
 
 class GeoTransform;
 
-class GeoPixelIBLFwdSvcCADModel :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelIBLFwdSvcCADModel :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.h
index e931d2105b5b..2918f2eff8aa 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIBLFwdSvcModel1.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELIBLFWDSVCMODEL1_H
@@ -16,7 +16,7 @@
 
 class GeoTransform;
 
-class GeoPixelIBLFwdSvcModel1 :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelIBLFwdSvcModel1 :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.h
index bc929cde3cf8..257ef05e75a3 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelIFlexServices.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELIFLEXSERVICES_H
@@ -14,7 +14,7 @@
 
 class GeoTransform;
 
-class GeoPixelIFlexServices :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelIFlexServices :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.h
index 8f3486bae637..253d936fef43 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadder.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELLADDER_H
@@ -10,7 +10,7 @@ class GeoLogVol;
 class GeoPixelSiCrystal;
 class GeoPixelStaveSupport;
 
-class GeoPixelLadder : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelLadder : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelLadder(GeoPixelSiCrystal& theSensor,
 		 GeoPixelStaveSupport * staveSupport);
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadderServices.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadderServices.h
index 84fb11c61b4b..b399be1079c7 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadderServices.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLadderServices.h
@@ -12,7 +12,7 @@
 class GeoLogVol;
 class GeoPhysVol;
 
-class GeoPixelLadderServices : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelLadderServices : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelLadderServices(int ladderType);
   virtual ~GeoPixelLadderServices();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.h
index 317b1207ddcb..46de417e2d3d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelLayer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PIXELGEOMODEL_GEOPIXELLAYER_H
@@ -10,7 +10,7 @@
 class GeoPhysVol;
 class GeoTransform;
 
-class GeoPixelLayer : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelLayer : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
  public:
   GeoPixelLayer();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.h
index 74ca2f44fb00..4a2d68dc3826 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelModule.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELMODULE_H
@@ -9,7 +9,7 @@
 class GeoLogVol;
 class GeoPixelSiCrystal;
 
-class GeoPixelModule : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelModule : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
  public:
   GeoPixelModule(GeoPixelSiCrystal &theSensor);
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.h
index 2a4d9a5d71bd..71cf364489f6 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelOldFrame.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELOLDFRAME_H
@@ -11,7 +11,7 @@ class GeoFullPhysVol;
 class GeoVPhysVol;
 class PixelLegacyManager;
 
-class GeoPixelOldFrame : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelOldFrame : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelOldFrame();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelPigtail.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelPigtail.h
index f21415b6d678..19e219fdd5b4 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelPigtail.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelPigtail.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELPIGTAIL_H
@@ -8,7 +8,7 @@
 #include "GeoVPixelFactory.h"
 class GeoLogVol;
 
-class GeoPixelPigtail : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelPigtail : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelPigtail();
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelRingSLHC.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelRingSLHC.h
index 397d1ba5200e..6df4202b0750 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelRingSLHC.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelRingSLHC.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELRINGSLHC_H
@@ -9,7 +9,7 @@
 class GeoPixelSiCrystal;
 class GeoLogVol;
 
-class GeoPixelRingSLHC : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelRingSLHC : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelRingSLHC(GeoPixelSiCrystal& sensor);
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.h
index de701826a8ad..0732baaa2f73 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelServices.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSERVICES_H
@@ -14,7 +14,7 @@ namespace InDetDD {
   class ServiceVolume;
 }
 
-class GeoPixelServices : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelServices : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 public:
   GeoPixelServices(InDetDD::Zone * envelopeZone = 0);
   ~GeoPixelServices();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.h
index 1607f644d1fe..4ae58de87337 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSiCrystal.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSICRYSTAL_H
@@ -17,7 +17,7 @@ namespace InDetDD {
   class PixelDiodeMatrix;
 }
 
-class GeoPixelSiCrystal : public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelSiCrystal : public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
  public:
   GeoPixelSiCrystal(bool isBLayer, bool isModule3D=false);
   virtual GeoVPhysVol* Build();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSimpleStaveSupport.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSimpleStaveSupport.h
index 3086935ef9d2..cb7903f55e37 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSimpleStaveSupport.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelSimpleStaveSupport.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSIMPLESTAVESUPPORT_H
@@ -15,7 +15,7 @@ public:
   GeoPixelSimpleStaveSupport();
   virtual ~GeoPixelSimpleStaveSupport();
   virtual GeoVPhysVol* Build();
-  virtual GeoVPhysVol* getPhysVol() const {return m_physVol;}
+  virtual GeoVPhysVol* getPhysVol ATLAS_NOT_THREAD_SAFE () const {return m_physVol;}
   virtual const GeoTrf::Transform3D & transform() const {return m_transform;}
   virtual double thicknessP() const {return m_thicknessP;}
   virtual double thicknessN() const {return m_thicknessN;}
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.h
index 0a1510e18ca6..4fe45aefa75d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRing.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSTAVERING_H
@@ -7,7 +7,7 @@
 
 #include "GeoVPixelFactory.h"
 
-class GeoPixelStaveRing :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelStaveRing :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
   GeoPixelStaveRing();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.h
index e4ebb9393c97..e413788cfacf 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveRingServices.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSTAVERINGSERVICES_H
@@ -14,7 +14,7 @@
 
 class GeoTransform;
 
-class GeoPixelStaveRingServices :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelStaveRingServices :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveSupport.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveSupport.h
index 0b077797b64d..319e330835d4 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveSupport.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelStaveSupport.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELSTAVESUPPORT_H
@@ -11,10 +11,10 @@
 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
 #include "GeoModelKernel/GeoTransform.h"
 
-class GeoPixelStaveSupport :  public GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoPixelStaveSupport :  public GeoVPixelFactory { // Thread unsafe GeoVPixelFactory class is used.
 
 public:  
-  virtual GeoVPhysVol* getPhysVol() const = 0;
+  virtual GeoVPhysVol* getPhysVol ATLAS_NOT_THREAD_SAFE () const = 0; // const method returns non-const pointer.
   virtual const GeoTrf::Transform3D & transform() const = 0;
   virtual double thicknessP() const = 0;
   virtual double thicknessN() const = 0;
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.h
index 40c1c9ef7750..677cc59a10fb 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoPixelTMT.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOPIXELTMT_H
@@ -9,6 +9,7 @@
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoDefinitions.h"
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 
 class GeoShape;
 
@@ -18,7 +19,7 @@ public:
   GeoPixelTMT();
   virtual ~GeoPixelTMT();
   virtual GeoVPhysVol* Build();
-  virtual GeoVPhysVol* getPhysVol() const {return m_physVol;}
+  virtual GeoVPhysVol* getPhysVol ATLAS_NOT_THREAD_SAFE () const {return m_physVol;} // const method returns non-const pointer.
   virtual const GeoTrf::Transform3D & transform() const {return m_transform;}
   virtual double thicknessP() const {return 0;} // Use ladder thickness from database
   virtual double thicknessN() const {return 0;} // Use ladder thickness from database
@@ -40,7 +41,7 @@ private:
 
   GeoVPhysVol* m_physVol;
   GeoTrf::Transform3D m_transform;
-  mutable Athena::MsgStreamMember m_msg;
+  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
 };
 
 #endif
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoVPixelFactory.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoVPixelFactory.h
index 9cbb97057a93..d0dbc8b34d14 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoVPixelFactory.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/GeoVPixelFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //
@@ -13,11 +13,12 @@
 #include "GeoModelKernel/GeoLogVol.h"
 #include "PixelGeometryManager.h"
 #include "InDetGeoModelUtils/InDetMaterialManager.h"
+#include "CxxUtils/checker_macros.h"
 
 // fwd declaration
 namespace InDetDD {class PixelDetectorManager;}
 
-class GeoVPixelFactory {
+class ATLAS_NOT_THREAD_SAFE GeoVPixelFactory { // static member variables are used.
  public:
   GeoVPixelFactory();
   virtual ~GeoVPixelFactory();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
index ffe2b8a8a565..5ddd97ad6741 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "OraclePixGeoManager.h"
@@ -74,12 +74,12 @@ OraclePixGeoManager::OraclePixGeoManager(const PixelGeoModelAthenaComps * athena
 }
 
 void
-OraclePixGeoManager::init()
+OraclePixGeoManager::init ATLAS_NOT_THREAD_SAFE () // Thread unsafe InDetDD::AthenaComps::rdbAccessSvc method is used.
 {
   if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Using ORACLE PIXEL GEOMETRY MANAGER" << endmsg;
 
   IRDBAccessSvc *rdbSvc = athenaComps()->rdbAccessSvc();
-  IGeoDbTagSvc *geoDbTag = athenaComps()->geoDbTagSvc();
+  const IGeoDbTagSvc *geoDbTag = athenaComps()->geoDbTagSvc();
 
   // Get version tag and node for Pixel.
   DecodeVersionKey versionKey(geoDbTag,"Pixel");
@@ -222,7 +222,7 @@ InDetMaterialManager* OraclePixGeoManager::getMaterialManager()
   return m_pMatMgr;
 }
 
-PixelLegacyManager * OraclePixGeoManager::legacyManager() const
+PixelLegacyManager * OraclePixGeoManager::legacyManager ATLAS_NOT_THREAD_SAFE () const // const method returns non-const pointer.
 {
   return m_legacyManager;
 }
@@ -244,7 +244,7 @@ OraclePixGeoManager::~OraclePixGeoManager()
 
 
 InDetDD::SiCommonItems * 
-OraclePixGeoManager::commonItems() const
+OraclePixGeoManager::commonItems ATLAS_NOT_THREAD_SAFE () const // const method returns non-const pointer.
 {
   return m_commonItems;
 }
@@ -415,7 +415,7 @@ bool OraclePixGeoManager::Alignable() const {
 }
 
 
-PixelDetectorManager* OraclePixGeoManager::GetPixelDDManager() {
+PixelDetectorManager* OraclePixGeoManager::GetPixelDDManager ATLAS_NOT_THREAD_SAFE () { // Thread unsafe InDetDD::AthenaComps::detStore method is used.
   if(m_pDDmgr == NULL) {
     //
     // retrieve the pointer to the DD manager
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
index 97fc3917207d..1ad1b7df82d5 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/OraclePixGeoManager.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef OraclePixelGeoManager_H
@@ -12,6 +12,7 @@
 #include <map>
 #include <vector>
 #include "RDBAccessSvc/IRDBAccessSvc.h"
+#include "CxxUtils/checker_macros.h"
 
 class IRDBRecord;
 class IRDBAccessSvc;
@@ -173,7 +174,7 @@ class OraclePixGeoManager : public PixelGeometryManager {
 
  public:
 
-  OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps);
+  OraclePixGeoManager(const PixelGeoModelAthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe init method is used.
   ~OraclePixGeoManager();
   
   void init();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx
index 3d60f10212cd..98ed2682f6d8 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.cxx
@@ -42,6 +42,7 @@
 #include <memory>
 #include <vector>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Legacy code
 
 using namespace PixelGeoDC2;
 
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
index 4a5337eeca16..04a0bfdf119d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -12,10 +12,13 @@
 #include "RDBAccessSvc/IRDBRecordset.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h" //for IRDBRecordset_ptr typedef
 #include "AthenaKernel/MsgStreamMember.h"
+#include "CxxUtils/checker_macros.h"
 
 #include <string>
 #include <vector>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Legacy code
+
 class GeoLogVol;
 class GeoVPhysVol;
 class StoredMaterialManager;
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
index 778a81bb754d..4dd77253ff85 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.cxx
@@ -114,7 +114,7 @@ PixelDetectorFactory::~PixelDetectorFactory()
 
 
 //## Other Operations (implementation)
-void PixelDetectorFactory::create(GeoPhysVol *world)
+void PixelDetectorFactory::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *world) // Thread usnafe GeoPixelEnvelope class is used.
 {
   if(msgLvl(MSG::INFO)) {
     msg(MSG::INFO) << "Building Pixel Detector" << endmsg;
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
index 80258642bde1..f24855015125 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactory.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelDetectorFactory_h
@@ -10,6 +10,7 @@
 // readout includes:
 #include "PixelReadoutGeometry/PixelDetectorManager.h"
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
+#include "CxxUtils/checker_macros.h"
 
 class PixelSwitches;
 class PixelGeometryManager;
@@ -21,7 +22,7 @@ class PixelDetectorFactory : public InDetDD::DetectorFactoryBase {
   
   // Constructor:
   PixelDetectorFactory(const PixelGeoModelAthenaComps * athenaComps,
-		       const PixelSwitches & switches);
+		       const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
   
   // Destructor:
   ~PixelDetectorFactory();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
index e951ac7c3b87..3f30fb601be5 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactoryDC2.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelDetectorFactoryDC2_h
@@ -9,6 +9,7 @@
 #include "InDetGeoModelUtils/InDetDetectorFactoryBase.h" 
 // readout includes:
 #include "PixelReadoutGeometry/PixelDetectorManager.h"
+#include "CxxUtils/checker_macros.h"
 
 class PixelSwitches;
 class PixelGeoModelAthenaComps;
@@ -19,7 +20,7 @@ class PixelDetectorFactoryDC2 : public InDetDD::DetectorFactoryBase {
   
   // Constructor:
   PixelDetectorFactoryDC2(const PixelGeoModelAthenaComps * athenaComps,
-			  const PixelSwitches & switches);
+			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::detStore method is used.
   
   // Destructor:
   ~PixelDetectorFactoryDC2();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
index 9cd82676e113..be566a3cdcd8 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.cxx
@@ -104,7 +104,7 @@ PixelDetectorFactorySR1::~PixelDetectorFactorySR1()
 
 
 //## Other Operations (implementation)
-void PixelDetectorFactorySR1::create(GeoPhysVol *world)
+void PixelDetectorFactorySR1::create ATLAS_NOT_THREAD_SAFE (GeoPhysVol *world) // Thread unsafe GeoPixelServices, GeoPixelBarrel, GeoPixelEndCap classes are used.
 {
   m_geometryManager->SetCurrentLD(0);
   m_geometryManager->SetBarrel();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
index b0bc4ed6da8e..56e72a015ed0 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorFactorySR1.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PixelDetectorFactorySR1_h
@@ -9,7 +9,7 @@
 #include "InDetGeoModelUtils/InDetDetectorFactoryBase.h" 
 // readout includes:
 #include "PixelReadoutGeometry/PixelDetectorManager.h"
-
+#include "CxxUtils/checker_macros.h"
 
 class PixelSwitches;
 class PixelGeometryManager;
@@ -21,7 +21,7 @@ class PixelDetectorFactorySR1 : public InDetDD::DetectorFactoryBase {
   
   // Constructor:
   PixelDetectorFactorySR1(const PixelGeoModelAthenaComps * athenaComps,
-			  const PixelSwitches & switches);
+			  const PixelSwitches & switches) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe GeoVPixelFactory class is used.
     
   // Destructor:
   ~PixelDetectorFactorySR1();
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
index 1f18e34a51c6..ada6aff33bb4 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -25,6 +25,8 @@
 #include "AthenaKernel/ClassID_traits.h"
 #include "SGTools/DataProxy.h"
 
+#include "CxxUtils/checker_macros.h"
+
 using InDetDD::PixelDetectorManager; 
 using InDetDD::SiDetectorManager; 
 
@@ -70,7 +72,7 @@ StatusCode PixelDetectorTool::initialize()
 /**
  ** Create the Detector Node corresponding to this tool
  **/
-StatusCode PixelDetectorTool::create()
+StatusCode PixelDetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe PixelDetectorFactorySR1 and PixelDetectorFactory constructors are used.
 { 
   StatusCode result = StatusCode::SUCCESS;
 
@@ -341,7 +343,7 @@ StatusCode PixelDetectorTool::clear()
 }
   
 StatusCode   
-PixelDetectorTool::registerCallback()
+PixelDetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE () // Thread unsafe DataHandle template and StoreGateSvc::regFcn method are used.
 {
 
   StatusCode sc = StatusCode::FAILURE;
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx
index b981d5269181..e7efc0b56343 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelGeoModelAthenaComps.cxx
@@ -1,8 +1,9 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelGeoModelAthenaComps.h"
+#include "CxxUtils/checker_macros.h"
 
 PixelGeoModelAthenaComps::PixelGeoModelAthenaComps()
   : InDetDD::AthenaComps("PixelGeoModel"),
@@ -19,7 +20,7 @@ PixelGeoModelAthenaComps::setBCM(IGeoSubDetTool * bcmTool)
 }
 
 IGeoSubDetTool * 
-PixelGeoModelAthenaComps::bcm() const 
+PixelGeoModelAthenaComps::bcm ATLAS_NOT_THREAD_SAFE () const // const method returns non-const pointer.
 {
   return m_bcmTool;
 }
@@ -31,7 +32,7 @@ PixelGeoModelAthenaComps::setBLM(IGeoSubDetTool * blmTool)
 }
 
 IGeoSubDetTool * 
-PixelGeoModelAthenaComps::blm() const 
+PixelGeoModelAthenaComps::blm ATLAS_NOT_THREAD_SAFE () const // const method returns non-const pointer.
 {
   return m_blmTool;
 }
@@ -43,7 +44,7 @@ PixelGeoModelAthenaComps::setServiceBuilderTool(IInDetServMatBuilderTool * servi
 }
 
 IInDetServMatBuilderTool * 
-PixelGeoModelAthenaComps::serviceBuilderTool() const 
+PixelGeoModelAthenaComps::serviceBuilderTool ATLAS_NOT_THREAD_SAFE () const // const method returns non-const pointer.
 {
   return m_serviceBuilderTool;
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
index c1c561ef67e3..f59eee96d252 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SCT_GeoModel_SCT_DataBase_H
 #define SCT_GeoModel_SCT_DataBase_H
 
 #include "SCT_GeoModel/SCT_GeoModelAthenaComps.h"
+#include "CxxUtils/checker_macros.h"
 #include <string>
 
 #include "RDBAccessSvc/IRDBAccessSvc.h"
@@ -18,7 +19,7 @@ class SCT_DataBase
   
 public:
 
-  SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps);
+  SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
 
   const SCT_GeoModelAthenaComps* athenaComps() const;
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
index 10931dc62849..be3d76c245d8 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
@@ -8,6 +8,7 @@
 #include "InDetGeoModelUtils/InDetDetectorFactoryBase.h" 
 #include "SCT_ReadoutGeometry/SCT_DetectorManager.h"
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
+#include "CxxUtils/checker_macros.h"
 
 #include <memory>
 
@@ -24,7 +25,7 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase
  public: 
   // Constructor
   SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaComps, 
-		      const SCT_Options & options); 
+		      const SCT_Options & options) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe InDetDD::DetectorFactoryBase::rdbAccessSvc() method is used.
 
   // Destructor
   virtual ~SCT_DetectorFactory(); 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
index ef69ebbaa5a9..8b211df7544e 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "SCT_GeoModel/SCT_DataBase.h"
@@ -19,7 +19,7 @@ SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
 {
   m_athenaComps = athenaComps;
 
-  IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc();
+  const IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc();
 
   // Get version tag and node for SCT
   DecodeVersionKey versionKey(geoDbTag,"SCT");
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
index 3eaf8aeac091..2fc7636e39f2 100644
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
@@ -48,8 +48,8 @@ SCT_DetectorTool::SCT_DetectorTool(const std::string& type,
 //
 
 StatusCode
-SCT_DetectorTool::create()
-{ 
+SCT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe SCT_DetectorFactory constructor is used.
+{
   // Get the detector configuration.
   ATH_CHECK(m_geoDbTagSvc.retrieve());
   
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/TRT_GeoModel/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..92206189636e
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/TRT_GeoModel
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
index f7230ed439b3..561fa50e21b7 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRTDetectorFactory_Full.h
@@ -20,6 +20,7 @@
 #include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h" //for Argon
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoDefinitions.h"
+#include "CxxUtils/checker_macros.h"
 
 #include <string>
 
@@ -28,7 +29,7 @@ class GeoFullPhysVol;
 class TRTParameterInterface;
 class InDetMaterialManager;
 
-class TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  {
+class ATLAS_NOT_THREAD_SAFE TRTDetectorFactory_Full : public InDetDD::DetectorFactoryBase  { // Static variables are used.
 
  public:
   
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
index d8e1f3c52231..09c2173e1872 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.cxx
@@ -53,7 +53,7 @@ TRT_DetDescrDB_ParameterInterface::~TRT_DetDescrDB_ParameterInterface() {
 }
 
 //_________________________________________________________________________________________
-void TRT_DetDescrDB_ParameterInterface::SetValues() {
+void TRT_DetDescrDB_ParameterInterface::SetValues ATLAS_NOT_THREAD_SAFE () { // Thread unsafe AthenaComps::rdbAccessSvc const method is used.
 
   /////////////////////////////////////////////////////////////////////////////////////////
   //                                 Initialize Services                                 //
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
index bf9e5a4aec34..704469026c05 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetDescrDB_ParameterInterface.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_GEOMODEL_TRT_DETDESCRDB_PARAMETERINTERFACE_H
@@ -10,6 +10,7 @@
 #include "AthenaKernel/MsgStreamMember.h"
 #include "InDetGeoModelUtils/InDetDDAthenaComps.h"
 #include "RDBAccessSvc/IRDBAccessSvc.h"
+#include "CxxUtils/checker_macros.h"
 
 class IRDBRecord;
 class TopLevelPlacements;
@@ -22,7 +23,7 @@ public:
 
    
   // Only allowed constructor
-  TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps);
+  TRT_DetDescrDB_ParameterInterface(const InDetDD::AthenaComps * athenaComps) ATLAS_CTORDTOR_NOT_THREAD_SAFE; // Thread unsafe SetValues method is used.
 
   ~TRT_DetDescrDB_ParameterInterface();
   // delete copy c'tor
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
index e842093a2fd4..b14adda18339 100755
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/src/TRT_DetectorTool.cxx
@@ -68,7 +68,7 @@ TRT_DetectorTool::~TRT_DetectorTool()
 
 //////////////  Create the Detector Node corresponding to this tool //////////////
 //
-StatusCode TRT_DetectorTool::create()
+StatusCode TRT_DetectorTool::create ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTDetectorFactory_Full class is used.
 { 
 
   // Get the detector configuration.
@@ -222,7 +222,7 @@ StatusCode TRT_DetectorTool::create()
 
 
 StatusCode 
-TRT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE ()
+TRT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE () // Thread unsafe StoreGateSvc::regFcn method and DataHandle template are used.
 {
   // This callback is kept because the folder never changes.
 
-- 
GitLab


From 724c9ae4e058aba9f14d6ab5cd2a608ca997c63e Mon Sep 17 00:00:00 2001
From: Frank Berghaus <frank.berghaus@cern.ch>
Date: Tue, 7 Jul 2020 14:54:50 +0000
Subject: [PATCH 088/217] Rework meta-data test suite

Move meta-data test suite into RecExRecoTest as discussed at the core
meeting. Use a configuration class to manage how to run the transforms
and test metadata. Allow user to specify inputs and references.
---
 .../AthenaServices/test/RecoMetadata_test.py  | 258 ----------
 .../RecExample/RecExRecoTest/CMakeLists.txt   |   2 +
 .../RecExRecoTest/test/MetaDataTest.py        | 478 ++++++++++++++++++
 Tools/PyUtils/python/MetaDiff.py              | 141 +++++-
 4 files changed, 598 insertions(+), 281 deletions(-)
 delete mode 100755 Control/AthenaServices/test/RecoMetadata_test.py
 create mode 100755 Reconstruction/RecExample/RecExRecoTest/test/MetaDataTest.py

diff --git a/Control/AthenaServices/test/RecoMetadata_test.py b/Control/AthenaServices/test/RecoMetadata_test.py
deleted file mode 100755
index acee94898c3e..000000000000
--- a/Control/AthenaServices/test/RecoMetadata_test.py
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# art-description: Validate in-file metadata in MT q431
-# art-type: grid
-# art-athena-mt: 8
-#
-import argparse
-import json
-import os
-from subprocess import Popen, STDOUT
-import sys
-
-from AthenaCommon.Logging import logging
-from PyUtils.MetaDiff import meta_diff
-
-
-MSG = logging.getLogger('RecoMetadata_test')
-
-STEPS = ["BStoRAW", "BStoESD", "ESDtoAOD"]
-
-CONFIG = {
-    "execOnly": True,
-    "preInclude": ["mt.py"],
-    "AMI": "q431",
-    "inputBSFile": [
-        "/eos/user/g/goetz/data/data17/data17_13TeV.00330470.physics_Main.daq.RAW.mix._0001.data",
-        "/eos/user/g/goetz/data/data17/data17_13TeV.00337215.physics_Main.daq.RAW.mix._0001.data",
-        "/eos/user/g/goetz/data/data18/data18_13TeV.00363979.physics_Main.daq.RAW.0250._0001.data"]
-}
-
-SERIAL = {step: CONFIG.copy() for step in STEPS}
-for k, v in SERIAL.items():
-    if k == "BStoRAW":
-        v.update(outputDRAW_ZMUMUFile=["serial_DRAW"])
-    if k == "BStoESD":
-        v.update(outputESDFile=["serial_ESD.pool.root"])
-    if k == "ESDtoAOD":
-        v.update(
-            inputESDFile=SERIAL["BStoESD"]["outputESDFile"],
-            outputAODFile=["serial_AOD.pool.root"])
-        del v["inputBSFile"]
-
-THREAD = {step: CONFIG.copy() for step in STEPS}
-for k, v in THREAD.items():
-    v["multithreaded"] = True
-    if k == "BStoRAW":
-        v.update(outputDRAW_ZMUMUFile=["threaded_DRAW"])
-    if k == "BStoESD":
-        v.update(outputESDFile=["threaded_ESD.pool.root"])
-    if k == "ESDtoAOD":
-        v.update(
-            inputESDFile=SERIAL["BStoESD"]["outputESDFile"],
-            outputAODFile=["threaded_AOD.pool.root"])
-        del v["inputBSFile"]
-
-
-PRE_INCLUDE = '''\
-rec.doMonitoring.set_Value_and_Lock(True);
-from AthenaMonitoring.DQMonFlags import DQMonFlags;
-DQMonFlags.doStreamAwareMon=False;
-DQMonFlags.doMuonRawMon=False;
-DQMonFlags.doMuonSegmentMon=False;
-DQMonFlags.doMuonTrackMon=False;
-DQMonFlags.doMuonAlignMon=False;
-DQMonFlags.doMuonTrkPhysMon=False;
-DQMonFlags.doMuonPhysicsMon=False;
-DQMonFlags.doGlobalMon.set_Value_and_Lock(False);
-DQMonFlags.doMonitoring.set_Value_and_Lock(False);
-
-rec.doTrigger = False
-
-# rec.doMuon = True
-# rec.doMuonCombined = True
-# from DiTauRec.DiTauRecFlags import jobproperties
-# jobproperties.DiTauRecFlags.doDiTauRec = True
-
-from ParticleBuilderOptions.AODFlags import AODFlags
-AODFlags.ThinInDetForwardTrackParticles.set_Value_and_Lock(False)
-
-if True :
-    from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
-    pmon_properties.PerfMonFlags.doSemiDetailedMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doFastMon.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doSemiDetailedMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doSemiDetailedMonitoringFullPrint.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doFullMon.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doMallocMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doExtraPrintouts.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doHephaestusMon.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doDsoMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doPersistencyMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doDataProxySizeMonitoring.set_Value_and_Lock(False)
-    pmon_properties.PerfMonFlags.doPostProcessing.set_Value_and_Lock(False)
-'''
-
-
-def build_transform_command(config):
-    """
-    build command to hand to subproccess from configuration
-    """
-    command = ["Reco_tf.py"]
-
-    for key, value in config.items():
-        MSG.debug("adding %s and %s to command", key, value)
-
-        if isinstance(value, bool):
-            if value:
-                command.append("--{}".format(key))
-        elif isinstance(value, list):
-            command.append("--{}".format(key))
-            command += value
-        else:
-            command.append("--{}".format(key))
-            command.append(value)
-
-        MSG.debug("command list: %s", command)
-
-    return command
-
-
-def serial(config, verbose=False):
-    """
-    Run threaded Reconstruction transform based on parameters provided in
-    config parameter
-    :param: config: configuration dictionary to hand to transform
-    :param: threads: number of threads to use
-    :param: verbose: whether to be laconic or not
-    :return: transform exit code
-    """
-    return run_transform(config, env=os.environ, verbose=verbose)
-
-
-def thread(config, threads=8, verbose=False):
-    """
-    Run threaded Reconstruction transform based on parameters provided in
-    config parameter
-    :param: config: configuration dictionary to hand to transform
-    :param: threads: number of threads to use
-    :param: verbose: whether to be laconic or not
-    :return: transform exit code
-    """
-    env = os.environ.copy()
-    env["ATHENA_CORE_NUMBER"] = str(threads)
-
-    return run_transform(config, env=env, verbose=verbose)
-
-
-def run_transform(config, env, verbose=False):
-    """
-    run Reco_tf.py with given configuration
-
-    :return: return value of transform
-    """
-    # MSG.debug("job environment: %s", json.dumps(env, indent=2))
-    MSG.debug("job config: %s", json.dumps(config))
-    MSG.debug("job config: %s", json.dumps(config))
-
-    command = build_transform_command(config)
-    MSG.info('running: %s', ' '.join(command))
-
-    try:
-        if verbose:
-            proc = Popen(command, env=env)
-        else:
-            with open(os.devnull, 'w') as dev_null:
-                proc = Popen(command, env=env, stdout=dev_null, stderr=STDOUT)
-
-        return proc.wait()
-
-    except KeyboardInterrupt:
-        proc.kill()
-        MSG.debug('comparison cancelled')
-        sys.exit(0)
-
-
-def get_args():
-    """
-    handle command line arguments
-    """
-    parser = argparse.ArgumentParser(description='''\
-            Run q431 reconstruction transform on the given input (default are
-            some of Goetz's files on EOS). Compare the in-file metadata of the
-            output files.
-            ''')
-    parser.add_argument('-v', '--verbose', action='store_true',
-                        help='do not be laconic')
-    parser.add_argument('inputBS', metavar='FILE', type=str, nargs='*',
-                        help='bytestream file(s) to use as input')
-
-    args = parser.parse_args()
-    MSG.setLevel(logging.DEBUG if args.verbose else logging.INFO)
-
-    input_files = args.inputBS if args.inputBS else CONFIG['inputBSFile']
-    MSG.info("input files:")
-    MSG.info(' '.join(input_files))
-
-    for step, config in SERIAL.items():
-        for key in config:
-            if key == "inputBSFile":
-                SERIAL[step][key] = input_files
-
-    for step, config in THREAD.items():
-        for key in config:
-            if key == "inputBSFile":
-                THREAD[step][key] = input_files
-
-    return args
-
-
-def main():
-    """write pre-include to file, run transforms, compare results, report
-    """
-    args = get_args()
-
-    for file_name in CONFIG["preInclude"]:
-        with open(file_name, 'w') as handle:
-            handle.write(PRE_INCLUDE)
-
-    for step in STEPS:
-        MSG.info('%s in serial mode', step)
-        s_status = serial(SERIAL[step], verbose=args.verbose)
-        print("art-result: {} {}_serial_transform".format(s_status, step))
-
-        MSG.info('%s in threaded mode', step)
-        t_status = thread(THREAD[step], verbose=args.verbose)
-        print("art-result: {} {}_threaded_transform".format(t_status, step))
-
-        try:
-            s_file = [value for key, value in SERIAL[step].items() if "output" in key.lower()]
-            s_file = s_file[0][0]
-
-            t_file = [value for key, value in THREAD[step].items() if "output" in key.lower()]
-            t_file = t_file[0][0]
-        except IndexError:
-            MSG.error("missing output found for steo %s", step)
-            print("art-result: 1 can_read_metadata")
-            print("art-result: 1 {}".format(step))
-            continue
-
-        MSG.info('Comparing metadata in %s and %s', s_file, t_file)
-        try:
-            diff = meta_diff([s_file, t_file], mode='full', drop=['file_guid'])
-
-            print("art-result: 0 can_read_metadata")
-            if diff:
-                MSG.warning(''.join(diff))
-            print("art-result: {} {}".format(0 if len(diff) < 2 else 1, step))
-        except (ReferenceError, StopIteration):
-            MSG.error('failed to read metadata from: %s and/or %s', s_file, t_file)
-            print("art-result: 1 can_read_metadata")
-            print("art-result: 1 {}".format(step))
-            continue
-
-
-if __name__ == "__main__":
-    main()
diff --git a/Reconstruction/RecExample/RecExRecoTest/CMakeLists.txt b/Reconstruction/RecExample/RecExRecoTest/CMakeLists.txt
index 03e9fb2d0251..b1dfbde7cb87 100644
--- a/Reconstruction/RecExample/RecExRecoTest/CMakeLists.txt
+++ b/Reconstruction/RecExample/RecExRecoTest/CMakeLists.txt
@@ -10,3 +10,5 @@ atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
 atlas_install_runtime( test/RecExRecoTest_TestConfiguration.xml python/PostProcessRecoRTTTests.py python/PostProcessIgprofWeb.py share/slurpRecoRTTTests.pl share/dumpPoolFileInchunks.sh share/diffPoolFilesRERT.sh share/run_memleak_rert.sh test/*.sh )
 
+atlas_install_scripts( test/MetaDataTest.py )
+atlas_add_alias( metadata-test "MetaDataTest.py" )
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/MetaDataTest.py b/Reconstruction/RecExample/RecExRecoTest/test/MetaDataTest.py
new file mode 100755
index 000000000000..bce92da1afa0
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/test/MetaDataTest.py
@@ -0,0 +1,478 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+"""Run transforms and compare in-file metadata
+
+This helper script runs the the q431 transfor step by step.  The input
+bytestream and ESD files may optionally be specified. Each step is first run
+serial then in threaded mode. If both succeed the in-file metadata of the two
+transform ouputs are compared. Any differences are reported. If you specify
+input By default inputs are from three different runs with different
+conditions. The files reside in CVMFS. You can specify any other input file
+that a transform would understand.
+
+
+    Example
+
+        $ MetaDataTest.py -h
+
+    Attributes:
+        STEPS (list): The transform steps to execute,
+                      e.g ["RAWtoRAW", "RAWtoESD"]
+        MSG   (logger): progress of the script is reported here
+
+    Todo:
+        * Support other q-tests, e.g. q221
+"""
+#
+# art-description: Validate in-file metadata in MT q431
+# art-type: grid
+# art-athena-mt: 8
+#
+import argparse
+import copy
+import json
+import os
+import shutil
+from subprocess import Popen, STDOUT
+import sys
+import textwrap
+
+from AthenaCommon.Logging import logging
+from PyUtils.MetaDiff import meta_diff
+
+
+MSG = logging.getLogger("MetaDataTest")
+
+STEPS = ["RAWtoRAW", "RAWtoESD", "ESDtoAOD"]
+
+
+class TestConfiguration:
+    """configuration information and setup routines for metadata test
+    """
+
+    def __init__(self):
+        self.options = {
+            "execOnly": True,
+            "outputRAWFile": "../draw.root",
+            "outputESDFile": "../esd.root",
+            "outputAODFile": "../aod.root",
+        }
+        self.preIncludeContent = textwrap.dedent("""\
+        from AthenaCommon.JobProperties import jobproperties
+        from AthenaMonitoring.DQMonFlags import DQMonFlags;
+        from ParticleBuilderOptions.AODFlags import AODFlags
+        from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
+
+
+        jobproperties.PrimaryDPDFlags.WriteDRAW_BCID1.RejectBCIDs = [0]
+
+        rec.doTrigger = False
+        rec.doMonitoring.set_Value_and_Lock(True);
+
+        DQMonFlags.doStreamAwareMon=False;
+        DQMonFlags.doMuonRawMon=False;
+        DQMonFlags.doMuonSegmentMon=False;
+        DQMonFlags.doMuonTrackMon=False;
+        DQMonFlags.doMuonAlignMon=False;
+        DQMonFlags.doMuonTrkPhysMon=False;
+        DQMonFlags.doMuonPhysicsMon=False;
+        DQMonFlags.doGlobalMon.set_Value_and_Lock(False);
+        DQMonFlags.doMonitoring.set_Value_and_Lock(False);
+
+        AODFlags.ThinInDetForwardTrackParticles.set_Value_and_Lock(False)
+
+        pmon_properties.PerfMonFlags.doSemiDetailedMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doFastMon.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doSemiDetailedMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doSemiDetailedMonitoringFullPrint.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doFullMon.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doMallocMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doExtraPrintouts.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doHephaestusMon.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doDsoMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doPersistencyMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doDataProxySizeMonitoring.set_Value_and_Lock(False)
+        pmon_properties.PerfMonFlags.doPostProcessing.set_Value_and_Lock(False)
+        """)
+
+    def setupWorkDir(self):
+        """write pre_include and set up directories to run tests in"""
+        self._writePreInclude()
+
+    def getCmdConfig(self, step, threaded=True):
+        """build dictionary construct transform command from"""
+        assert step in STEPS, "{} not one of {}".format(step, STEPS)
+
+        common_opts = ["AMI", "preInclude"]
+        cmd_config = {
+            k: self.options[k] for k in common_opts if k in self.options
+        }
+
+        if threaded:
+            cmd_config["multithreaded"] = True
+
+        if step == "ESDtoAOD":
+            cmd_config["inputESDFile"] = self.options["inputESDFile"]
+        else:
+            cmd_config["inputBSFile"] = self.options["inputBSFile"]
+
+        if step == "RAWtoRAW":
+            cmd_config["outputDRAW_BCID1File"] = self.options["outputRAWFile"]
+        elif step == "RAWtoESD":
+            cmd_config["outputESDFile"] = self.options["outputESDFile"]
+        elif step == "ESDtoAOD":
+            cmd_config["outputAODFile"] = self.options["outputAODFile"]
+
+        return cmd_config
+
+    def _writePreInclude(self):
+        """write pre include content to file"""
+        file_name = "{}/pre_include.py".format(os.getcwd())
+        try:
+            self.options["preInclude"] = [file_name]
+            with open(file_name, "w") as handle:
+                handle.write(self.preIncludeContent)
+        except IOError:
+            MSG.error("failed to write {} ... aborting".format(file_name))
+            self.options["preInclude"] = None
+            sys.exit(1)
+
+
+def getCmdEnv(threads=4):
+    """add ATHENA_CORE_NUMBER to environment if needed"""
+    env = os.environ.copy()
+    if "ATHENA_CORE_NUMBER" not in env:
+        env["ATHENA_CORE_NUMBER"] = str(threads)
+    return env
+
+
+def getCmdPath(step, threaded):
+    """make directory to execute command in and return it"""
+    parent = "thread" if threaded else "serial"
+    if not os.path.exists(parent):
+        os.mkdir(parent)
+
+    path = "{}/{}".format(parent, step)
+    if os.path.exists(path):
+        shutil.rmtree(path)
+    os.mkdir(path)
+
+    return path
+
+
+def buildTransformCommand(config):
+    """build command to hand to subproccess from configuration
+
+    Appends options supplied in config to Reco_tf.py in a list formatted
+    to be handed to subprocess' run or Popen.
+
+    Args:
+        config  (dict): Key, value paris of options for Reco_tf.py
+
+    Returns:
+        list: List containing Reco_tf.py command to execute
+    """
+    command = ["Reco_tf.py"]
+
+    for key, value in config.items():
+        MSG.debug("adding %s and %s to command", key, value)
+
+        if isinstance(value, bool):
+            if value:
+                command.append("--{}".format(key))
+        elif isinstance(value, list):
+            command.append("--{}".format(key))
+            command += value
+        else:
+            command.append("--{}".format(key))
+            command.append(value)
+
+        MSG.debug("command list: %s", command)
+
+    return command
+
+
+def serial(config, path=None, verbose=False):
+    """Run athena in inherited environmnt
+
+    Transparently passes everything on to runTransform
+
+    Args:
+        config  (dict): Key, value paris of options for Reco_tf.py
+        path    (str):  Path where to execute transform
+        verbose (bool): Whether to be terse
+
+    Returns:
+        (int, str) transform exit code and output file name
+    """
+    return runTransform(config, path=path, env=os.environ, verbose=verbose)
+
+
+def thread(config, path=None, threads=4, verbose=False):
+    """Adjust environment to run athenaMT
+
+    Add ATHENA_CORE_NUMBER to the environment if needed. Then run the transform
+    in the adjusted environment
+
+    Args:
+        config  (dict): Key, value paris of options for Reco_tf.py
+        path    (str):  Path where to execute transform
+        threads (int):  Number of threads to use
+        verbose (bool): Whether to be terse
+
+    Returns:
+        (int, str) transform exit code and output file name
+    """
+    env = getCmdEnv(threads=threads)
+
+    return runTransform(config, path=path, env=env, verbose=verbose)
+
+
+def runTransform(config, path=None, env=None, verbose=False):
+    """run Reco_tf.py with given configuration
+
+    Assemble command from config print it as informational message and run it.
+    The transform will be executed in the directory specified by path with the
+    environment given in env.
+
+    Args:
+        config  (dict): Key, value paris of options for Reco_tf.py
+        path    (str):  Path where to execute transform
+        env     (dict): Key, value pairs of evars for transform
+        verbose (bool): whether to be terse
+
+    Retruns:
+        (int, str) return value of transform, output file name
+    """
+    # MSG.debug("job environment: %s", json.dumps(env, indent=2))
+    MSG.debug("job config: %s", json.dumps(config))
+    MSG.debug("job config: %s", json.dumps(config))
+
+    command = buildTransformCommand(config)
+    MSG.info("running: %s", " ".join(command))
+
+    MSG.debug("in directory: %s", path)
+
+    try:
+        for key, value in config.items():
+            if "output" in key.lower():
+                out_file = value
+        out_file = "{}/{}".format(path, out_file)
+    except IndexError:
+        MSG.error("no output file specified")
+        return 1, ""
+
+    try:
+        if verbose:
+            proc = Popen(command, cwd=path, env=env)
+        else:
+            with open(os.devnull, "w") as dev_null:
+                proc = Popen(
+                    command, cwd=path, env=env, stdout=dev_null, stderr=STDOUT
+                )
+
+        return proc.wait(), out_file
+
+    except KeyboardInterrupt:
+        proc.kill()
+        MSG.debug("comparison cancelled")
+        sys.exit(0)
+
+
+def getArgs():
+    """handle command line arguments"""
+    parser = argparse.ArgumentParser(
+        description="""\
+            Run q431 reconstruction transform on the given input (defaults are
+            single event bytestream files on CVMFS). Compare the in-file
+            metadata of the output files from serial and threaded running.
+            """
+    )
+
+    parser.add_argument(
+        "-v", "--verbose", action="store_true", help="do not be laconic"
+    )
+
+    input_bs = [
+        ("/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MetadataTests/"
+         "data17/data17_13TeV.00330470.physics_Main.daq.RAW.mix._0001.data"),
+        ("/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MetadataTests/"
+         "data17/data17_13TeV.00337215.physics_Main.daq.RAW.mix._0001.data"),
+        ("/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MetadataTests/"
+         "data18/data18_13TeV.00363979.physics_Main.daq.RAW.0250._0001.data"),
+    ]
+    parser.add_argument(
+        "--inputBSFile",
+        metavar="BS",
+        type=str,
+        nargs="*",
+        help="bytestream file(s) to use as input",
+        default=input_bs,
+    )
+
+    parser.add_argument(
+        "--inputESDFile",
+        metavar="ESD",
+        type=str,
+        nargs="*",
+        help="bytestream file(s) to use as input",
+        # default=input_esds,
+    )
+
+    parser.add_argument(
+        "--AMI",
+        metavar="TAG",
+        type=str,
+        nargs=1,
+        help="transform to run (e.g. q431)",
+        default="q431",
+    )
+
+    args = parser.parse_args()
+    MSG.setLevel(logging.DEBUG if args.verbose else logging.INFO)
+
+    return args
+
+
+def makeConfig(args):
+    """build job configuration"""
+    config = TestConfiguration()
+
+    config.options["AMI"] = args.AMI
+    config.options["inputBSFile"] = args.inputBSFile
+
+    MSG.debug("input bytestream files:")
+    MSG.debug(" ".join(config.options["inputBSFile"]))
+
+    config.setupWorkDir()
+
+    if args.inputESDFile:
+        config.options["inputESDFile"] = args.inputESDFile
+    else:
+        MSG.info("generating ESDtoAOD input")
+        for input_config in makeInputConfig(config):
+            status, esd_file = serial(
+                input_config.getCmdConfig("RAWtoESD", threaded=False),
+                path=os.getcwd(),
+            )
+            if status == 0:
+                MSG.debug("Generated ESDtoAOD input %s", esd_file)
+                try:
+                    config.options["inputESDFile"] += [esd_file]
+                except KeyError:
+                    config.options["inputESDFile"] = [esd_file]
+
+    try:
+        MSG.debug("input ESD files:")
+        MSG.debug(" ".join(config.options["inputESDFile"]))
+    except KeyError:
+        MSG.info("no input for ESDtoAOD avialable")
+        STEPS.remove('ESDtoAOD')
+
+    return config
+
+
+def makeInputConfig(test_config):
+    """build configuration to generate ESD inputs from test configuration"""
+    result = []
+    for input_file in test_config.options["inputBSFile"]:
+        input_config = copy.deepcopy(test_config)
+        input_config.options["inputBSFile"] = [input_file]
+        input_config.options["outputESDFile"] = None
+        # TODO: make this less fugly
+        output_file = os.path.basename(input_file)
+        array = output_file.split('.')
+        array[-1] = 'pool.root'
+        output_file = '.'.join(array)
+        output_file = output_file.replace('RAW', 'ESD')
+        input_config.options["outputESDFile"] = "{}/{}".format(
+            os.getcwd(),
+            output_file,
+        )
+        result += [input_config]
+    return result
+
+
+def compareMetadata(step, target, reference):
+    """Compare metadata in target to reference
+
+    Compare metadata in target file produce in transform step to reference
+    specified in job configuration. Report the result.
+
+    Args:
+        step      (str):  The transform step to run, e.g. ESDtoAOD
+        target    (str):  File to compare to reference
+        reference (str):  Reference file
+    """
+    try:
+        diff = meta_diff(
+            [target, reference], mode="full", drop=["file_guid", "file_size"],
+            diff_format="diff"
+        )
+
+        if diff:
+            MSG.info("".join(diff))
+
+        print("art-result: {} {}".format(1 if diff else 0, step))
+
+    except (ReferenceError, StopIteration):
+        MSG.error(
+            "failed to read metadata from: %s and/or %s", target, reference
+        )
+
+
+def runTest(config, step, verbose):
+    """Run a transform step and compare metadata of the output
+
+    Run the transform step as set up in the config, either in serial or threaded
+    mode. If the transorm reports success compare the metadata of the resulting
+    file to the supplied referenc files.
+
+    Args:
+        config    (TestConfiguration): The config object set up for the test
+        step      (str):               The transform step to run, e.g. ESDtoAOD
+        verbose   (bool):              Whether to print out debug info
+    """
+    MSG.info("%s in serial mode", step)
+    serial_status, serial_file = serial(
+        config.getCmdConfig(step, threaded=False),
+        path=getCmdPath(step=step, threaded=False),
+        verbose=verbose,
+    )
+
+    if not serial_status == 0:
+        print("art-result: {} {}_transform".format(serial_status, step))
+        MSG.info(("serial transform failed ... skipping threaded transform "
+                  "and test"))
+        return
+
+    MSG.info("%s in threaded mode", step)
+    thread_status, thread_file = thread(
+        config.getCmdConfig(step, threaded=True),
+        path=getCmdPath(step=step, threaded=True),
+        verbose=verbose,
+    )
+
+    print("art-result: {} {}_transform".format(thread_status, step))
+
+    if thread_status == 0:
+        compareMetadata(step, thread_file, serial_file)
+    else:
+        MSG.info("transform failed ... skipping metadata comparison")
+
+
+def main():
+    """fetch arguments, set up for the tests, then run the requested tests."""
+    args = getArgs()
+    config = makeConfig(args)
+
+    for step in STEPS:
+        runTest(
+            config=config, step=step, verbose=args.verbose
+        )
+
+
+if __name__ == "__main__":
+    main()
diff --git a/Tools/PyUtils/python/MetaDiff.py b/Tools/PyUtils/python/MetaDiff.py
index c21c9756afcb..6df41e7eee26 100644
--- a/Tools/PyUtils/python/MetaDiff.py
+++ b/Tools/PyUtils/python/MetaDiff.py
@@ -9,14 +9,56 @@ import logging
 from PyUtils.MetaReader import read_metadata
 
 
+def summary(content):
+    """Create a summary string for an object"""
+    if isinstance(content, str):
+        return content
+
+    try:
+        try:
+            working_copy = content.items()
+        except AttributeError:
+            working_copy = content
+        result = ''
+        for key, value in working_copy:
+            result += "{}: {}, ".format(key, summary(value))
+        return result
+    except (TypeError, ValueError,):
+        pass
+
+    try:
+        if len(content) < 3:
+            return str(content)
+        return "[{}, {}, ..., {}]".format(
+            summary(content[0]), summary(content[1]), summary(content[-1])
+        )
+    except TypeError:
+        pass
+
+    return str(content)
+
+
+def truncateDict(value):
+    """Create truncted string replaceing dicts with {...}"""
+    return ', '.join(
+        [
+            '{}: {}'.format(
+                k,
+                '{...}' if isinstance(v, dict) else v
+            )
+            for k, v in sorted(value.items())
+        ]
+    )
+
+
 def print_diff(parent_key, obj1, obj2, diff_format):
     """build comparison string for two non-dictionary objects"""
     result = "\n"
 
     if diff_format == "simple":
-        if obj1 is None:
+        if not obj1:
             result += "{} has been inserted".format(parent_key)
-        elif obj2 is None:
+        elif not obj2:
             result += "{} has been deleted".format(parent_key)
         else:
             result += "{} has changed from '{}' to '{}'".format(
@@ -26,12 +68,19 @@ def print_diff(parent_key, obj1, obj2, diff_format):
     else:
         if parent_key is not None:
             result += "{}:\n".format(parent_key)
+        try:
+            overlap = set(obj1).intersection(set(obj2))
+            for item in overlap:
+                obj1.remove(item)
+                obj2.remove(item)
+        except (AttributeError, TypeError,):
+            pass
         result += """\
         > {}
         ----------
         < {}
         """.format(
-            obj1, obj2
+            summary(obj1), summary(obj2)
         )
 
     return result
@@ -50,7 +99,9 @@ def print_diff_type(parent_key, obj1, obj2, diff_format):
             result += (
                 "{} has changed changed type from {} (value: '{}') to "
                 "{} (value: '{}')"
-            ).format(parent_key, type(obj1), obj1, type(obj2), obj2)
+            ).format(parent_key,
+                     type(obj1), obj1,
+                     type(obj2), obj2)
         result += "\n"
     else:
         if parent_key is not None:
@@ -60,7 +111,7 @@ def print_diff_type(parent_key, obj1, obj2, diff_format):
         ----------
         < {} (type: {})
         """.format(
-            obj1, type(obj1), obj2, type(obj2)
+            summary(obj1), type(obj1), summary(obj2), type(obj2)
         )
 
     return result
@@ -69,27 +120,37 @@ def print_diff_type(parent_key, obj1, obj2, diff_format):
 def print_diff_dict_keys(parent_key, obj1, obj2, diff_format):
     """build diff style string for dictionary objects"""
     result = '\n'
+    if diff_format != 'simple':
+        shared_keys = set(obj1.keys()).intersection(obj2.keys())
+        for k in shared_keys:
+            if obj1[k] == obj2[k]:
+                try:
+                    obj1.pop(k, None)
+                    obj2.pop(k, None)
+                except TypeError:
+                    pass
 
-    value1 = ', '.join(['{}: {}'.format(k, '{...}' if isinstance(v, dict) else v)
-                        for k, v in sorted(obj1.items())])
-    value2 = ', '.join(['{}: {}'.format(k, '{...}' if isinstance(v, dict) else v)
-                        for k, v in sorted(obj2.items())])
-    
     if diff_format == 'simple':
         if obj1 is None:
             result += "{} has been inserted".format(parent_key)
         elif obj2 is None:
             result += "{} has been deleted".format(parent_key)
         else:
+            value1 = truncateDict(obj1)
+            value2 = truncateDict(obj2)
             result += "{} has changed from '{}' to '{}'".format(
                 parent_key, value1, value2
             )
     else:
         if parent_key is not None:
             result += "{}:\n".format(parent_key)
-        result += "> " + value1
-        result += "\n----------\n"
-        result += "< " + value2
+        result += """\
+        > {}
+        ----------
+        < {}
+        """.format(
+            summary(obj1), summary(obj2)
+        )
 
     result += "\n"
 
@@ -143,16 +204,48 @@ def compare(obj1, obj2, parent_key=None, ordered=False, diff_format="simple"):
     return result
 
 
+def compare_dicts(test, reference, ordered=False, diff_format="simple"):
+    """Show the differences between two dictionaries
+
+    Args:
+        test          (dict): first object in comparision
+        reference     (dict): second object in comparision
+        ordered       (bool): whether to check order of list content
+        diff_format (string): specify a format to display the difference in
+    """
+    result = list()
+
+    keys = set(test.keys()).union(reference.keys())
+    for key in keys:
+        try:
+            val1 = test[key]
+        except KeyError:
+            val1 = None
+        try:
+            val2 = reference[key]
+        except KeyError:
+            val2 = None
+
+        result += compare(
+            obj1=val1,
+            obj2=val2,
+            parent_key=key,
+            ordered=ordered,
+            diff_format=diff_format
+        )
+    return result
+
+
 def meta_diff(
-    files,
-    verbose=False,
-    ordered=False,
-    drop=None,
-    mode="lite",
-    meta_key_filter=None,
-    file_type=None,
-    promote=False,
-    diff_format="simple",
+        files,
+        verbose=False,
+        ordered=False,
+        drop=None,
+        mode="lite",
+        meta_key_filter=None,
+        file_type=None,
+        promote=False,
+        diff_format="simple",
 ):
     """
     Compare the in-file metadata in two given files. Uses PyUtils.MetaReader
@@ -181,6 +274,8 @@ def meta_diff(
     msg = logging.getLogger("MetaDiff")
     msg.setLevel(logging.DEBUG if verbose else logging.INFO)
 
+    msg.debug("Reading from %s and %s", files[0], files[1])
+
     metadata = read_metadata(
         files,
         file_type,
@@ -196,7 +291,7 @@ def meta_diff(
     except TypeError:
         pass
 
-    result = compare(
+    result = compare_dicts(
         metadata[files[0]],
         metadata[files[1]],
         ordered=ordered,
-- 
GitLab


From 0de41b120f060a27ff8dba766d2605deaaac363b Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Tue, 7 Jul 2020 17:00:08 +0200
Subject: [PATCH 089/217] Fix configuration of tracksummary tool in legacy
 trigger

Updating the configuration of the track summary tool used by various tools in the legacy trigger. This removes warnings along the lines of `ToolSvc.MuonTrackSummaryTool                    WARNING getTool: Identifier is from ID but have no ID tool`.
---
 Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
index 2c45e522e8a2..943a628ad75a 100755
--- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFConfig.py
@@ -147,6 +147,7 @@ def TMEF_iPatFitter(name='TMEF_iPatFitter',**kwargs):
     kwargs.setdefault("MaterialAllocator", "TMEF_MaterialAllocator")
     from InDetRecExample import TrackingCommon
     kwargs.setdefault("SolenoidalIntersector",TrackingCommon.getSolenoidalIntersector())
+    kwargs.setdefault("TrackSummaryTool", 'TMEF_TrackSummaryTool')
     return CfgMgr.Trk__iPatFitter(name,**kwargs)
 
 
@@ -375,6 +376,7 @@ def TMEF_MuonCreatorTool(name="TMEF_MuonCreatorTool",**kwargs):
     kwargs.setdefault("FillTimingInformation",False)
     kwargs.setdefault("MuonSelectionTool", "")
     kwargs.setdefault("TrackQuery", "TMEF_MuonTrackQuery")
+    kwargs.setdefault("TrackSummaryTool", "TMEF_TrackSummaryTool")
     return CfgMgr.MuonCombined__MuonCreatorTool(name,**kwargs)
 
 def TMEF_MuonCandidateTrackBuilderTool(name="TMEF_MuonCandidateTrackBuilderTool",**kwargs):
@@ -391,8 +393,7 @@ def TMEF_MuonClusterSegmentFinder(name="TMEF_MuonClusterSegmentFinder", **kwargs
 
 def TMEF_MuonClusterSegmentFinderTool(name="TMEF_MuonClusterSegmentFinderTool", extraFlags=None,**kwargs):
     import MuonCombinedRecExample.CombinedMuonTrackSummary
-    from AthenaCommon.AppMgr import ToolSvc
-    kwargs.setdefault("TrackSummaryTool", ToolSvc.CombinedMuonTrackSummary)
+    kwargs.setdefault("TrackSummaryTool", "TMEF_TrackSummaryTool")
     return CfgMgr.Muon__MuonClusterSegmentFinderTool(name,**kwargs)
 
 def TMEF_MuonLayerSegmentFinderTool(name="TMEF_MuonLayerSegmentFinderTool",**kwargs):
-- 
GitLab


From 552a3cea3463f4df8223718b2cfef3a44dff174f Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Tue, 7 Jul 2020 17:30:32 +0200
Subject: [PATCH 090/217] New unit test

---
 .../TrigInDetPattRecoTools/CMakeLists.txt     |   7 +
 .../TrigTrackSeedGenerator.h                  |   2 +-
 .../TrigInDetPattRecoTools/test/mockSeeds.cxx | 254 ++++++++++++++++++
 3 files changed, 262 insertions(+), 1 deletion(-)
 create mode 100644 Trigger/TrigTools/TrigInDetPattRecoTools/test/mockSeeds.cxx

diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
index 0d9fb20b5946..e6dcc1b165aa 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/CMakeLists.txt
@@ -9,3 +9,10 @@ atlas_add_library( TrigInDetPattRecoTools
                    PUBLIC_HEADERS TrigInDetPattRecoTools
                    LINK_LIBRARIES TrigInDetPattRecoEvent
                    PRIVATE_LINK_LIBRARIES IRegionSelector TrigInDetEvent )
+
+find_package(Boost)
+
+atlas_add_test( mockSeeds
+                SOURCES test/mockSeeds.cxx
+                LINK_LIBRARIES PathResolver TrigInDetEvent TrigInDetPattRecoEvent TrigInDetPattRecoTools TrigSteeringEvent IRegionSelector )
+
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h b/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
index 8497c8cd7b29..478d6a4e1e90 100644
--- a/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/TrigInDetPattRecoTools/TrigTrackSeedGenerator.h
@@ -9,8 +9,8 @@
 #include<algorithm>
 
 #include "TrigInDetPattRecoTools/TrigCombinatorialSettings.h"
+#include "TrigInDetEvent/TrigSiSpacePointBase.h"
 
-class TrigSiSpacePointBase;
 class TrigInDetTriplet;
 
 
diff --git a/Trigger/TrigTools/TrigInDetPattRecoTools/test/mockSeeds.cxx b/Trigger/TrigTools/TrigInDetPattRecoTools/test/mockSeeds.cxx
new file mode 100644
index 000000000000..bc82032b0471
--- /dev/null
+++ b/Trigger/TrigTools/TrigInDetPattRecoTools/test/mockSeeds.cxx
@@ -0,0 +1,254 @@
+#include <boost/tokenizer.hpp>
+#include <string>
+#include <vector>
+#include <iostream>
+#include "TrigInDetPattRecoTools/TrigTrackSeedGenerator.h"
+#include "TrigInDetPattRecoTools/TrigCombinatorialSettings.h"
+#include "TrigInDetPattRecoEvent/TrigInDetTriplet.h"
+#include "TrigSteeringEvent/TrigRoiDescriptor.h"
+#include "PathResolver/PathResolver.h"
+#include <fstream>
+#include <chrono>
+
+
+//Use spacepoints from a real event, run triplet making outside Athena
+int main()
+{
+  typedef boost::tokenizer<boost::escaped_list_separator<char>> tokenizer;
+  std::string file_name = "TrigInDetPattRecoTools/spacepoints.csv";
+  std::ifstream in(PathResolver::find_file(file_name, "DATAPATH"));
+  if (!in.is_open()) {
+    std::cout << "ERROR: Cannot find " << file_name << std::endl;
+    return 1;
+  }
+  std::vector<TrigSiSpacePointBase> convertedSpacePoints;
+
+  std::string fline;
+  while (getline(in,fline)) {
+    std::vector<std::string> line_sep;
+    tokenizer tok{fline};
+    for (const auto &t : tok) {
+      line_sep.push_back(std::string(t));
+    }
+    if (line_sep.size() == 5) {
+      int layer = std::stoi(line_sep[0]);
+      float r = std::stof(line_sep[1]);
+      float phi = std::stof(line_sep[2]);
+      float z = std::stof(line_sep[3]);
+      bool isPixel = std::stoi(line_sep[4]);
+      convertedSpacePoints.push_back(TrigSiSpacePointBase(layer, r, phi, z, isPixel));
+    }
+  }
+  TrigCombinatorialSettings tcs;
+  tcs.m_tripletPtMin = 0.3*1000.0;
+  tcs.m_doubletFilterRZ = true;
+  tcs.m_doublet_dR_Max = 270.0;
+  tcs.m_seedRadBinWidth = 2.0;
+  tcs.m_tripletD0Max      = 4.0;
+  tcs.m_tripletD0_PPS_Max = 1.7;
+  tcs.m_nMaxPhiSlice = 53;
+  tcs.m_maxTripletBufferLength = 3;
+  tcs.m_tripletDoPSS = false;
+  tcs.m_tripletDtCut      = 10.0;
+  tcs.m_zvError = 10.0;
+  tcs.m_maxBarrelPix    = -1;
+  tcs.m_minEndcapPix    = 8;
+  tcs.m_maxEndcapPix    = -1;
+  tcs.m_maxSiliconLayer = 32;
+
+  std::vector<TRIG_INDET_SI_LAYER> pVL;
+  pVL.resize(32);
+  pVL.at(0).m_subdet = 1;
+  pVL.at(0).m_type = 0;
+  pVL.at(0).m_refCoord = 33.2443;
+  pVL.at(0).m_minBound = -333.323;
+  pVL.at(0).m_maxBound = 329.323;
+  pVL.at(1).m_subdet = 1;
+  pVL.at(1).m_type = 0;
+  pVL.at(1).m_refCoord = 50.4567;
+  pVL.at(1).m_minBound = -400.702;
+  pVL.at(1).m_maxBound = 400.702;
+  pVL.at(2).m_subdet = 1;
+  pVL.at(2).m_type = 0;
+  pVL.at(2).m_refCoord = 88.4566;
+  pVL.at(2).m_minBound = -400.702;
+  pVL.at(2).m_maxBound = 400.702;
+  pVL.at(3).m_subdet = 1;
+  pVL.at(3).m_type = 0;
+  pVL.at(3).m_refCoord = 122.457;
+  pVL.at(3).m_minBound = -400.702;
+  pVL.at(3).m_maxBound = 400.702;
+  pVL.at(4).m_subdet = 2;
+  pVL.at(4).m_type = 0;
+  pVL.at(4).m_refCoord = 299.501;
+  pVL.at(4).m_minBound = -743.273;
+  pVL.at(4).m_maxBound = 743.273;
+  pVL.at(5).m_subdet = 2;
+  pVL.at(5).m_type = 0;
+  pVL.at(5).m_refCoord = 371;
+  pVL.at(5).m_minBound = -743.273;
+  pVL.at(5).m_maxBound = 743.273;
+  pVL.at(6).m_subdet = 2;
+  pVL.at(6).m_type = 0;
+  pVL.at(6).m_refCoord = 443;
+  pVL.at(6).m_minBound = -743.273;
+  pVL.at(6).m_maxBound = 743.273;
+  pVL.at(7).m_subdet = 2;
+  pVL.at(7).m_type = 0;
+  pVL.at(7).m_refCoord = 514;
+  pVL.at(7).m_minBound = -743.273;
+  pVL.at(7).m_maxBound = 743.273;
+  pVL.at(8).m_subdet = 1;
+  pVL.at(8).m_type = -2;
+  pVL.at(8).m_refCoord = -495;
+  pVL.at(8).m_minBound = 89.1479;
+  pVL.at(8).m_maxBound = 149.795;
+  pVL.at(9).m_subdet = 1;
+  pVL.at(9).m_type = -2;
+  pVL.at(9).m_refCoord = -580;
+  pVL.at(9).m_minBound = 89.1479;
+  pVL.at(9).m_maxBound = 149.795;
+  pVL.at(10).m_subdet = 1;
+  pVL.at(10).m_type = -2;
+  pVL.at(10).m_refCoord = -650;
+  pVL.at(10).m_minBound = 89.1479;
+  pVL.at(10).m_maxBound = 149.795;
+  pVL.at(11).m_subdet = 2;
+  pVL.at(11).m_type = -2;
+  pVL.at(11).m_refCoord = -856.843;
+  pVL.at(11).m_minBound = 337.464;
+  pVL.at(11).m_maxBound = 562.272;
+  pVL.at(12).m_subdet = 2;
+  pVL.at(12).m_type = -2;
+  pVL.at(12).m_refCoord = -933.091;
+  pVL.at(12).m_minBound = 274.928;
+  pVL.at(12).m_maxBound = 562.272;
+  pVL.at(13).m_subdet = 2;
+  pVL.at(13).m_type = -2;
+  pVL.at(13).m_refCoord = -1090.59;
+  pVL.at(13).m_minBound = 274.928;
+  pVL.at(13).m_maxBound = 562.272;
+  pVL.at(14).m_subdet = 2;
+  pVL.at(14).m_type = -2;
+  pVL.at(14).m_refCoord = -1298.99;
+  pVL.at(14).m_minBound = 274.928;
+  pVL.at(14).m_maxBound = 562.272;
+  pVL.at(15).m_subdet = 2;
+  pVL.at(15).m_type = -2;
+  pVL.at(15).m_refCoord = -1398.79;
+  pVL.at(15).m_minBound = 274.928;
+  pVL.at(15).m_maxBound = 562.272;
+  pVL.at(16).m_subdet = 2;
+  pVL.at(16).m_type = -2;
+  pVL.at(16).m_refCoord = -1770.49;
+  pVL.at(16).m_minBound = 274.928;
+  pVL.at(16).m_maxBound = 562.272;
+  pVL.at(17).m_subdet = 2;
+  pVL.at(17).m_type = -2;
+  pVL.at(17).m_refCoord = -2118.25;
+  pVL.at(17).m_minBound = 337.464;
+  pVL.at(17).m_maxBound = 562.272;
+  pVL.at(18).m_subdet = 2;
+  pVL.at(18).m_type = -2;
+  pVL.at(18).m_refCoord = -2508.04;
+  pVL.at(18).m_minBound = 402.836;
+  pVL.at(18).m_maxBound = 562.272;
+  pVL.at(19).m_subdet = 2;
+  pVL.at(19).m_type = -2;
+  pVL.at(19).m_refCoord = -2740.2;
+  pVL.at(19).m_minBound = 438.426;
+  pVL.at(19).m_maxBound = 562.272;
+  pVL.at(20).m_subdet = 1;
+  pVL.at(20).m_type = 2;
+  pVL.at(20).m_refCoord = 495;
+  pVL.at(20).m_minBound = 89.1479;
+  pVL.at(20).m_maxBound = 149.795;
+  pVL.at(21).m_subdet = 1;
+  pVL.at(21).m_type = 2;
+  pVL.at(21).m_refCoord = 580;
+  pVL.at(21).m_minBound = 89.1479;
+  pVL.at(21).m_maxBound = 149.795;
+  pVL.at(22).m_subdet = 1;
+  pVL.at(22).m_type = 2;
+  pVL.at(22).m_refCoord = 650;
+  pVL.at(22).m_minBound = 89.1479;
+  pVL.at(22).m_maxBound = 149.795;
+  pVL.at(23).m_subdet = 2;
+  pVL.at(23).m_type = 2;
+  pVL.at(23).m_refCoord = 856.843;
+  pVL.at(23).m_minBound = 337.464;
+  pVL.at(23).m_maxBound = 562.272;
+  pVL.at(24).m_subdet = 2;
+  pVL.at(24).m_type = 2;
+  pVL.at(24).m_refCoord = 933.091;
+  pVL.at(24).m_minBound = 274.928;
+  pVL.at(24).m_maxBound = 562.272;
+  pVL.at(25).m_subdet = 2;
+  pVL.at(25).m_type = 2;
+  pVL.at(25).m_refCoord = 1090.59;
+  pVL.at(25).m_minBound = 274.928;
+  pVL.at(25).m_maxBound = 562.272;
+  pVL.at(26).m_subdet = 2;
+  pVL.at(26).m_type = 2;
+  pVL.at(26).m_refCoord = 1298.99;
+  pVL.at(26).m_minBound = 274.928;
+  pVL.at(26).m_maxBound = 562.272;
+  pVL.at(27).m_subdet = 2;
+  pVL.at(27).m_type = 2;
+  pVL.at(27).m_refCoord = 1398.79;
+  pVL.at(27).m_minBound = 274.928;
+  pVL.at(27).m_maxBound = 562.272;
+  pVL.at(28).m_subdet = 2;
+  pVL.at(28).m_type = 2;
+  pVL.at(28).m_refCoord = 1770.49;
+  pVL.at(28).m_minBound = 274.928;
+  pVL.at(28).m_maxBound = 562.272;
+  pVL.at(29).m_subdet = 2;
+  pVL.at(29).m_type = 2;
+  pVL.at(29).m_refCoord = 2118.25;
+  pVL.at(29).m_minBound = 337.464;
+  pVL.at(29).m_maxBound = 562.272;
+  pVL.at(30).m_subdet = 2;
+  pVL.at(30).m_type = 2;
+  pVL.at(30).m_refCoord = 2508.04;
+  pVL.at(30).m_minBound = 402.836;
+  pVL.at(30).m_maxBound = 562.272;
+  pVL.at(31).m_subdet = 2;
+  pVL.at(31).m_type = 2;
+  pVL.at(31).m_refCoord = 2740.2;
+  pVL.at(31).m_minBound = 438.426;
+  pVL.at(31).m_maxBound = 562.272;
+  tcs.m_layerGeometry = pVL;
+
+  std::vector<int> times;
+  for (unsigned int i = 0; i < 10; ++i) {
+    auto t0 = std::chrono::high_resolution_clock::now();
+    TRIG_TRACK_SEED_GENERATOR seedGen(tcs);
+
+    seedGen.loadSpacePoints(convertedSpacePoints);
+
+    std::unique_ptr<TrigRoiDescriptor> tmpRoi = std::make_unique<TrigRoiDescriptor>(true);
+    seedGen.createSeeds(tmpRoi.get());
+    std::vector<TrigInDetTriplet*> triplets;
+    seedGen.getSeeds(triplets);
+    if (triplets.size() != 24511) {
+      std::cout << "ERROR: change in number of triplets created" << std::endl;
+      std::cout << "ERROR: expected: 24511, actual " << triplets.size() << std::endl;
+      return 1;
+    }
+    auto t1 = std::chrono::high_resolution_clock::now();
+    times.push_back(std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count());
+  }
+  float mean_time = std::accumulate(times.begin(), times.end(), 0)/float(times.size());
+  
+  float dev_time = 0;
+  for (unsigned int i = 0; i < times.size(); i++) {
+    dev_time += (times[i] - mean_time)*(times[i] - mean_time);
+  }
+  dev_time = sqrt(dev_time/times.size());
+    
+  std::cout << "Seed making time: " << mean_time  << " +/- " << dev_time << " microseconds" << std::endl;
+  
+  return 0;
+}
+
-- 
GitLab


From 379acfd425442ae769877f89ab79d626043b055d Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 6 Jul 2020 18:20:57 +0200
Subject: [PATCH 091/217] Update property declaration syntax in G4AtlasTools
 components

This commit updates the configurable properties of components in the `G4AtlasTools`
packages to be declared in the header file rather than via the `declareProperty`
macro in the implementation of the constructor. Some dervived classes in other packages
also required syntax updates to compile after this change.
---
 .../LArG4H6SD/src/LArG4H62004DeadSDTool.cc    |  4 +-
 .../LArG4H6SD/src/LArG4H62004EMECSDTool.cc    |  4 +-
 .../LArG4H6SD/src/LArG4H62004HECSDTool.cc     |  4 +-
 .../src/TBECBackOuterBarretteTool.cc          | 16 +++----
 .../LArG4H6SD/src/TBECInnerModuleTool.cc      | 16 +++----
 .../LArG4H6SD/src/TBECOuterModuleTool.cc      | 16 +++----
 .../G4AtlasTools/AddPhysicsDecayTool.h        |  8 ++--
 .../G4AtlasTools/G4AtlasTools/BoxEnvelope.h   | 31 ++++++-------
 .../G4AtlasTools/CylindricalEnvelope.h        | 20 +++++----
 .../G4AtlasTools/DetectorFieldManagerTool.h   |  6 +--
 .../G4AtlasTools/DetectorGeometryBase.h       | 24 +++++-----
 .../G4AtlasTools/FastSimulationBase.h         |  8 ++--
 .../G4AtlasTools/G4FieldManagerToolBase.h     | 22 +++++-----
 .../G4AtlasTools/GlobalFieldManagerTool.h     |  5 ++-
 .../G4AtlasTools/PolyconicalEnvelope.h        | 19 ++++----
 .../G4AtlasTools/G4AtlasTools/RegionCreator.h | 28 ++++++------
 .../G4AtlasTools/SensitiveDetectorBase.h      | 10 ++---
 .../G4AtlasTools/src/AddPhysicsDecayTool.cxx  | 15 +++----
 .../G4Atlas/G4AtlasTools/src/BoxEnvelope.cxx  | 38 +++++-----------
 .../G4AtlasTools/src/CylindricalEnvelope.cxx  | 24 ++--------
 .../src/DetectorFieldManagerTool.cxx          |  4 --
 .../G4AtlasTools/src/DetectorGeometryBase.cxx | 44 +++++--------------
 .../G4Atlas/G4AtlasTools/src/EnvelopeTool.cxx | 20 ++++-----
 .../G4AtlasTools/src/FastSimulationBase.cxx   |  9 +---
 .../src/FastSimulationMasterTool.cxx          |  4 +-
 .../src/FastSimulationMasterTool.h            |  4 +-
 .../src/G4FieldManagerToolBase.cxx            | 25 +----------
 .../src/GlobalFieldManagerTool.cxx            |  2 -
 .../G4AtlasTools/src/PolyconicalEnvelope.cxx  | 19 ++------
 .../G4AtlasTools/src/RegionCreator.cxx        | 38 +++++++---------
 .../src/SensitiveDetectorBase.cxx             | 12 ++---
 .../src/SensitiveDetectorMasterTool.cxx       |  5 +--
 .../src/SensitiveDetectorMasterTool.h         |  4 +-
 .../src/SimpleFastKillerTool.cxx              |  4 +-
 .../Geo2G4/src/GDMLDetectorTool.cxx           | 18 ++++----
 .../Geo2G4/src/GeoDetectorTool.cxx            | 16 +++----
 .../src/TrackFastSimSDTool.cxx                |  8 ++--
 37 files changed, 217 insertions(+), 337 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004DeadSDTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004DeadSDTool.cc
index ac8eb62bbb79..92a5e81115c7 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004DeadSDTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004DeadSDTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArG4H62004DeadSDTool.h"
@@ -35,7 +35,7 @@ StatusCode LArG4H62004DeadSDTool::initializeSD()
   if (m_do_eep) m_uninstSD    = new LArG4H62004CalibSD( "Default::Dead::Uninstrumented::Calibration::H6" , &*m_calculator, m_doPID );
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_deadSD]  = &m_volumeNames;
+  configuration[m_deadSD]  = &(m_volumeNames.value());
   if (m_do_eep) configuration[m_uninstSD]    = new std::vector<std::string>; // No volumes for this guy
   setupAllSDs(configuration);
 
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004EMECSDTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004EMECSDTool.cc
index 08f222ea9da7..36fc9bd45282 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004EMECSDTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004EMECSDTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArG4H62004EMECSDTool.h"
@@ -26,7 +26,7 @@ StatusCode LArG4H62004EMECSDTool::initializeSD()
   m_emecSD = new LArG4H62004SD( "LAr::EMEC::InnerModule::H6" , &*m_calculator , m_timeBinType , m_timeBinWidth );
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_emecSD] = &m_volumeNames;
+  configuration[m_emecSD] = &(m_volumeNames.value());
   setupAllSDs(configuration);
 
   // Make sure the ID helpers are all set up
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004HECSDTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004HECSDTool.cc
index 6a2d8482c993..518c1e2fbfea 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004HECSDTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArG4H62004HECSDTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArG4H62004HECSDTool.h"
@@ -25,7 +25,7 @@ StatusCode LArG4H62004HECSDTool::initializeSD()
   m_wheelSD = new LArG4H62004SD( "LAr::HEC::Module::Depth::Slice::Local::H6" , &*m_calculator , m_timeBinType , m_timeBinWidth );
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_wheelSD] = &m_volumeNames;
+  configuration[m_wheelSD] = &(m_volumeNames.value());
   setupAllSDs(configuration);
 
   // Make sure the ID helpers are all set up
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECBackOuterBarretteTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECBackOuterBarretteTool.cc
index 2c01080dc8c8..11ad28662f7b 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECBackOuterBarretteTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECBackOuterBarretteTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TBECBackOuterBarretteTool.h"
@@ -69,13 +69,13 @@ StatusCode TBECBackOuterBarretteTool::initializeSD()
   m_roptSD   = new LArG4SimpleSD("LAr::EMEC::BackOuterBarrette::Module::Phidiv::SDout_ropt", &*m_emecbobcalc, m_timeBinType , m_timeBinWidth);
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_gapadjSD] = &m_volumeNames;
-  configuration[m_gapoldSD] = &m_volumeNames;
-  configuration[m_gap_eSD]  = &m_volumeNames;
-  configuration[m_gap_sSD]  = &m_volumeNames;
-  configuration[m_gap_seSD] = &m_volumeNames;
-  configuration[m_chcollSD] = &m_volumeNames;
-  configuration[m_roptSD]   = &m_volumeNames;
+  configuration[m_gapadjSD] = &(m_volumeNames.value());
+  configuration[m_gapoldSD] = &(m_volumeNames.value());
+  configuration[m_gap_eSD]  = &(m_volumeNames.value());
+  configuration[m_gap_sSD]  = &(m_volumeNames.value());
+  configuration[m_gap_seSD] = &(m_volumeNames.value());
+  configuration[m_chcollSD] = &(m_volumeNames.value());
+  configuration[m_roptSD]   = &(m_volumeNames.value());
   setupAllSDs(configuration);
     
   // Make sure the helpers are all set up
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECInnerModuleTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECInnerModuleTool.cc
index 5e6c1e531f24..48fe34d5a705 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECInnerModuleTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECInnerModuleTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TBECInnerModuleTool.h"
@@ -68,13 +68,13 @@ StatusCode TBECInnerModuleTool::initializeSD()
   m_roptSD   = new LArG4SimpleSD("LAr::EMEC::InnerModule::SDin_ropt", &*m_emecinnercalc, m_timeBinType , m_timeBinWidth);
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_gapadjSD] = &m_volumeNames;
-  configuration[m_gapoldSD] = &m_volumeNames;
-  configuration[m_gap_eSD]  = &m_volumeNames;
-  configuration[m_gap_sSD]  = &m_volumeNames;
-  configuration[m_gap_seSD] = &m_volumeNames;
-  configuration[m_chcollSD] = &m_volumeNames;
-  configuration[m_roptSD]   = &m_volumeNames;
+  configuration[m_gapadjSD] = &(m_volumeNames.value());
+  configuration[m_gapoldSD] = &(m_volumeNames.value());
+  configuration[m_gap_eSD]  = &(m_volumeNames.value());
+  configuration[m_gap_sSD]  = &(m_volumeNames.value());
+  configuration[m_gap_seSD] = &(m_volumeNames.value());
+  configuration[m_chcollSD] = &(m_volumeNames.value());
+  configuration[m_roptSD]   = &(m_volumeNames.value());
   setupAllSDs(configuration);
     
   // Make sure the helpers are all set up
diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECOuterModuleTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECOuterModuleTool.cc
index cec7df37ff08..3e203e1f5426 100644
--- a/LArCalorimeter/LArG4/LArG4H6SD/src/TBECOuterModuleTool.cc
+++ b/LArCalorimeter/LArG4/LArG4H6SD/src/TBECOuterModuleTool.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TBECOuterModuleTool.h"
@@ -69,13 +69,13 @@ StatusCode TBECOuterModuleTool::initializeSD()
   m_roptSD   = new LArG4SimpleSD("LAr::EMEC::OuterModule::SDout_ropt", &*m_emecoutercalc, m_timeBinType , m_timeBinWidth);
 
   std::map<G4VSensitiveDetector*,std::vector<std::string>*> configuration;
-  configuration[m_gapadjSD] = &m_volumeNames;
-  configuration[m_gapoldSD] = &m_volumeNames;
-  configuration[m_gap_eSD]  = &m_volumeNames;
-  configuration[m_gap_sSD]  = &m_volumeNames;
-  configuration[m_gap_seSD] = &m_volumeNames;
-  configuration[m_chcollSD] = &m_volumeNames;
-  configuration[m_roptSD]   = &m_volumeNames;
+  configuration[m_gapadjSD] = &(m_volumeNames.value());
+  configuration[m_gapoldSD] = &(m_volumeNames.value());
+  configuration[m_gap_eSD]  = &(m_volumeNames.value());
+  configuration[m_gap_sSD]  = &(m_volumeNames.value());
+  configuration[m_gap_seSD] = &(m_volumeNames.value());
+  configuration[m_chcollSD] = &(m_volumeNames.value());
+  configuration[m_roptSD]   = &(m_volumeNames.value());
   setupAllSDs(configuration);
     
   // Make sure the helpers are all set up
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/AddPhysicsDecayTool.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/AddPhysicsDecayTool.h
index 474ab1071e78..2ed102ed2218 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/AddPhysicsDecayTool.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/AddPhysicsDecayTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_ADDPHYSICSDECAYTOOL_H
@@ -38,9 +38,9 @@ public:
   virtual void ConstructParticle() override;
 
 protected:
-  std::string m_ParticleName;
-  double m_BR;
-  std::string m_Daughters;
+  Gaudi::Property<std::string> m_ParticleName{this, "ParticleName", "NoFile", "Particle name"};
+  Gaudi::Property<double> m_BR{this, "BR", 0, "Branching Ratio"};
+  Gaudi::Property<std::string> m_Daughters{this, "Daughters", "NoFile", "Daughters"};
   std::vector<std::string> m_Daughters_vec;
 
 };
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/BoxEnvelope.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/BoxEnvelope.h
index ca414f551822..17d7caba001e 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/BoxEnvelope.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/BoxEnvelope.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_BoxEnvelope_H
@@ -23,28 +23,25 @@ class BoxEnvelope final : public DetectorGeometryBase
  public:
   /// Basic constructor and destructor
   BoxEnvelope(const std::string& type, const std::string& name, const IInterface *parent);
-  ~BoxEnvelope() {}
-
-  /** Athena method. called at initialization time, being customized here */
-  //StatusCode initialize() override final;
+  ~BoxEnvelope() = default;
 
   /** virtual methods being implemented here */
 
   virtual void BuildGeometry() override final;
 
  private:
-  double m_dX;
-  double m_dY;
-  double m_dZ;
-  std::string m_materialName;
-  unsigned int m_numberOfHoles;
-  std::vector<std::string> m_holeNames;
-  std::vector<double> m_hole_dX;
-  std::vector<double> m_hole_dY;
-  std::vector<double> m_hole_dZ;
-  std::vector<double> m_holePosX;
-  std::vector<double> m_holePosY;
-  std::vector<double> m_holePosZ;
+  Gaudi::Property<double> m_dX{this, "dX", 0., "Envelope dX"};
+  Gaudi::Property<double> m_dY{this, "dY", 0., "Envelope dY"};
+  Gaudi::Property<double> m_dZ{this, "dZ", 0., "Envelope dZ"};
+  Gaudi::Property<std::string> m_materialName{this, "Material", "Air", "Envelope Material"};
+  Gaudi::Property<unsigned int> m_numberOfHoles{this, "NumberOfHoles", 0, "Number of hole volumes to subtract from the initial envelope volume."};
+  Gaudi::Property<std::vector<std::string> > m_holeNames{this, "HoleNames", {} };
+  Gaudi::Property<std::vector<double> > m_hole_dX{this, "Hole_dX", {} };
+  Gaudi::Property<std::vector<double> > m_hole_dY{this, "Hole_dY", {} };
+  Gaudi::Property<std::vector<double> > m_hole_dZ{this, "Hole_dZ", {} };
+  Gaudi::Property<std::vector<double> > m_holePosX{this, "HolePosX", {} };
+  Gaudi::Property<std::vector<double> > m_holePosY{this, "HolePosY", {} };
+  Gaudi::Property<std::vector<double> > m_holePosZ{this, "HolePosZ", {} };
 };
 
 #endif
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/CylindricalEnvelope.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/CylindricalEnvelope.h
index 079398c077ac..3612dae775eb 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/CylindricalEnvelope.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/CylindricalEnvelope.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_CylindricalEnvelope_H
@@ -9,6 +9,9 @@
 #include "G4AtlasTools/DetectorGeometryBase.h"
 #include "G4AtlasInterfaces/IDetectorGeometrySvc.h"
 
+// CLHEP includes
+#include "CLHEP/Units/SystemOfUnits.h"
+
 // STL library
 #include <string>
 #include <vector>
@@ -21,20 +24,19 @@ class CylindricalEnvelope final : public DetectorGeometryBase
   /// Basic constructor and destructor
   CylindricalEnvelope(const std::string& type, const std::string& name, const IInterface *parent);
 
-  ~CylindricalEnvelope() {}
+  ~CylindricalEnvelope() = default;
 
   /** virtual methods being implemented here */
 
   virtual void BuildGeometry();
 
  private:
-  std::string m_materialName;
-  double m_innerRadius;
-  double m_outerRadius;
-  double m_dZ;
-  double m_startphi;
-  double m_deltaphi;
-
+  Gaudi::Property<std::string> m_materialName{this, "Material", "Air", "Envelope Material"};
+  Gaudi::Property<double> m_innerRadius{this, "InnerRadius", 0., "Envelope inner radius"};
+  Gaudi::Property<double> m_outerRadius{this, "OuterRadius", 0., "Envelope outer radius"};
+  Gaudi::Property<double> m_dZ{this, "dZ", 0., "Envelope dZ"};
+  Gaudi::Property<double> m_startphi{this, "StartPhi", 0., ""};
+  Gaudi::Property<double> m_deltaphi{this, "DeltaPhi", 360.*CLHEP::deg, ""};
 };
 
 #endif
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorFieldManagerTool.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorFieldManagerTool.h
index 8fe96097edd4..a05679bf02c0 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorFieldManagerTool.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorFieldManagerTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_DetectorFieldManagerTool_H
@@ -37,10 +37,10 @@ class DetectorFieldManagerTool : public G4FieldManagerToolBase
   protected:
 
     /// List of volumes to assign this field configuration to
-    std::vector<std::string> m_volumeList;
+    Gaudi::Property<std::vector<std::string> > m_volumeList{this, "LogicalVolumes", {}, "List of volumes to which the field will be applied"};
 
     /// Option for muons feeling the B-field only
-    bool m_muonOnlyField;
+    Gaudi::Property<bool> m_muonOnlyField{this, "MuonOnlyField", false, "Only muons experience the magnetic field"};
 
     /// My field manager
     thread_utils::ThreadLocalOwner<G4FieldManager> m_fieldMgrHolder;
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
index 802e6217f14f..e62faf61727d 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/DetectorGeometryBase.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_DETECTORGEOMETRYBASE_H
@@ -61,21 +61,21 @@ public:
   G4VPhysicalVolume* GetWorldVolume() override final;
 
 protected:
-  ToolHandleArray<IDetectorGeometryTool> m_subDetTools;
+  ToolHandleArray<IDetectorGeometryTool> m_subDetTools{this, "SubDetectors", {}, "Tool handle array of all subdetector tools"};
 
-  ServiceHandle<IG4GeometryNotifierSvc> m_notifierSvc;
+  ServiceHandle<IG4GeometryNotifierSvc> m_notifierSvc{this, "GeometryNotifierSvc", "G4GeometryNotifierSvc", "Detector name (same as the Tool name if not set"};
 
-  IDetectorGeometryTool *m_theParent;
+  IDetectorGeometryTool *m_theParent{};
 
   Envelope m_envelope;
-  std::string m_detectorName;
-  bool m_isWorld;
-  double m_rotateX;
-  double m_rotateY;
-  double m_rotateZ;
-  double m_offsetX;
-  double m_offsetY;
-  double m_offsetZ;
+  Gaudi::Property<std::string> m_detectorName{this, "DetectorName", "", "Detector name (same as the Tool name if not set"};
+  bool m_isWorld{false};
+  Gaudi::Property<double> m_rotateX{this, "RotateX" , 0.0, "Rotation around the X-axis"};
+  Gaudi::Property<double> m_rotateY{this, "RotateY" , 0.0, "Rotation around the Y-axis"};
+  Gaudi::Property<double> m_rotateZ{this, "RotateZ" , 0.0, "Rotation around the Z-axis"};
+  Gaudi::Property<double> m_offsetX{this, "OffsetX" , 0.0, "Offset in the X-direction"};
+  Gaudi::Property<double> m_offsetY{this, "OffsetY" , 0.0, "Offset in the Y-direction"};
+  Gaudi::Property<double> m_offsetZ{this, "OffsetZ" , 0.0, "Offset in the Z-direction"};
 
 };
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h
index c8d4d2a99d3c..911ad3554dc4 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/FastSimulationBase.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_FASTSIMULATIONBASE_H
@@ -48,9 +48,9 @@ class FastSimulationBase : public extends<AthAlgTool, IFastSimulation> {
   G4VFastSimulationModel* getFastSimModel();
 
   /// All the regions to which this fast sim is assigned
-  std::vector<std::string> m_regionNames;
+  Gaudi::Property<std::vector<std::string> > m_regionNames{this, "RegionNames", {}};
   /// This Fast Simulation has no regions associated with it.
-  bool m_noRegions;
+  Gaudi::Property<bool> m_noRegions{this, "NoRegions", false};
 
  private:
 
@@ -66,7 +66,7 @@ class FastSimulationBase : public extends<AthAlgTool, IFastSimulation> {
   FastSimModelThreadMap_t m_fastsimmodelThreadMap;
 #else
   /// The Fast Simulation Model to which this thing corresponds
-  G4VFastSimulationModel* m_FastSimModel;
+  G4VFastSimulationModel* m_FastSimModel{};
 #endif
 };
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
index ab9d05e349f4..64e3149c22bf 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/G4FieldManagerToolBase.h
@@ -62,27 +62,27 @@ class G4FieldManagerToolBase : public extends<AthAlgTool, IFieldManagerTool>
     StatusCode setFieldParameters(G4FieldManager* fieldMgr) const;
 
     /// Handle to the G4 field service
-    ServiceHandle<IG4FieldSvc> m_fieldSvc;
+    ServiceHandle<IG4FieldSvc> m_fieldSvc{this, "FieldSvc", "G4FieldSvc", "Service providing a G4MagneticField"};
 
     /// @todo TODO why is this duplicated in the g4 field svc?
-    bool m_fieldOn;
+    Gaudi::Property<bool> m_fieldOn{this, "FieldOn", true, "Toggles field on/off"};
 
     /// The type of stepper to use
-    std::string m_integratorStepper;
+    Gaudi::Property<std::string> m_integratorStepper{this, "IntegratorStepper", "AtlasRK4", "Integrator stepper name"};
 
     /// The type of equation of motion to use
-    ToolHandle<IEquationOfMotionTool> m_equationOfMotion;
+    ToolHandle<IEquationOfMotionTool> m_equationOfMotion{this, "EquationOfMotion", "", ""};
     //std::string m_equationOfMotion;
 
     /// @name Field parameters
     /// @{
-    double m_minEps;
-    double m_maxEps;
-    double m_deltaChord;
-    double m_deltaOneStep;
-    double m_deltaIntersection;
-    double m_maxStep;
-    double m_minStep;
+    Gaudi::Property<double> m_minEps{this, "MinimumEpsilonStep", -1.0, "Minimum epsilon (see G4 documentation)"};
+    Gaudi::Property<double> m_maxEps{this, "MaximumEpsilonStep", -1.0, "Maximum epsilon (see G4 documentation)"};
+    Gaudi::Property<double> m_deltaChord{this, "DeltaChord", -1.0, "Missing distance for the chord finder"};
+    Gaudi::Property<double> m_deltaOneStep{this, "DeltaOneStep", -1.0, "Delta(one-step)"};
+    Gaudi::Property<double> m_deltaIntersection{this, "DeltaIntersection", -1.0, "Accuracy for boundary intersection"};
+    Gaudi::Property<double> m_maxStep{this, "MaximumStep", -1.0, "Maximum step length in field (see G4 documentation)"};
+    Gaudi::Property<double> m_minStep{this, "MinimumStep",1e-2, "Minimum step length in field (see G4 documentation)"};
     /// @}
 
 };
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/GlobalFieldManagerTool.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/GlobalFieldManagerTool.h
index c9b35c66a7f5..21b2d1b47af2 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/GlobalFieldManagerTool.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/GlobalFieldManagerTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_GlobalFieldManagerTool_H
@@ -35,7 +35,8 @@ class GlobalFieldManagerTool : public G4FieldManagerToolBase
   protected:
 
     /// Tight muon stepping parameters via the field manager's configure for track
-    bool m_useTightMuonStepping;
+    Gaudi::Property<bool> m_useTightMuonStepping{this, "UseTightMuonStepping", false,
+        "Use tight muon stepping parameters by default"};
 
     /// My field manager -- populated only in the case that we use tight muon stepping
     thread_utils::ThreadLocalOwner<G4FieldManager> m_fieldMgrHolder;
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PolyconicalEnvelope.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PolyconicalEnvelope.h
index aa0ffd83519c..6c6ce571fab9 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PolyconicalEnvelope.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PolyconicalEnvelope.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_PolyconicalEnvelope_H
@@ -20,21 +20,20 @@ class PolyconicalEnvelope final : public DetectorGeometryBase
  public:
   // Basic constructor and destructor
   PolyconicalEnvelope(const std::string& type, const std::string& name, const IInterface *parent);
-  ~PolyconicalEnvelope() {}
+  ~PolyconicalEnvelope() = default;
 
   /** virtual methods being implemented here */
 
   virtual void BuildGeometry() override final;
 
  private:
-  std::string m_materialName;
-  unsigned int m_surfaceNr;
-  std::vector<double> m_innerRadii;
-  std::vector<double> m_outerRadii;
-  std::vector<double> m_ZSurfaces;
-  double m_startphi;
-  double m_deltaphi;
-
+  Gaudi::Property<std::string> m_materialName{this, "Material", "Air", "Envelope Material"};
+  Gaudi::Property<unsigned int> m_surfaceNr{this, "NSurfaces", 0, "Number of surfaces in Z"};
+  Gaudi::Property<std::vector<double> > m_innerRadii{this, "InnerRadii", {}, "Envelope inner radii"};
+  Gaudi::Property<std::vector<double> > m_outerRadii{this, "OuterRadii", {}, "Envelope outer radii"};
+  Gaudi::Property<std::vector<double> > m_ZSurfaces{this, "ZSurfaces", {}, "Envelope surface Zs"};
+  Gaudi::Property<double> m_startphi{this, "StartPhi", 0., ""};
+  Gaudi::Property<double> m_deltaphi{this, "DeltaPhi", 360.*CLHEP::deg, ""};
 };
 
 #endif
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/RegionCreator.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/RegionCreator.h
index bf75bfaec7ae..388ed7115475 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/RegionCreator.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/RegionCreator.h
@@ -1,21 +1,23 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef G4ATLASTOOLS_REGIONCREATOR_H 
+#ifndef G4ATLASTOOLS_REGIONCREATOR_H
 #define G4ATLASTOOLS_REGIONCREATOR_H
 
 // Base classes
 #include "G4AtlasInterfaces/IRegionCreator.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 
+#include "GaudiKernel/SystemOfUnits.h"
+
 // STL library
 #include <string>
 
 /** @class RegionCreator RegionCreator.h "G4AtlasTools/RegionCreator.h"
- *  
+ *
  *  Concrete Tool to create G4 Physics Regions
- * 
+ *
  *  @author ADA
  *  @date   2015-03-23
  */
@@ -27,18 +29,16 @@ public:
   ~RegionCreator() {}
 
   StatusCode initialize();
-  
+
   void Dump();
-  
+
 private:
-  std::string m_regionName;
-
-  double m_gammaCut=1.;
-  double m_electronCut=1.;
-  double m_positronCut=1.;
-  double m_protonCut=1.;
-  
-  std::vector<std::string> m_logicalVolumes;
+   Gaudi::Property<std::string> m_regionName{this, "RegionName", "", "Region name (same as the Tool name if not set)"};
+  Gaudi::Property<double> m_gammaCut{this, "GammaCut", 1.*Gaudi::Units::mm, "Cut to be applied for gammas"};
+  Gaudi::Property<double> m_electronCut{this, "ElectronCut", 1., "Cut to be applied for electrons"};
+  Gaudi::Property<double> m_positronCut{this, "PositronCut", 1., "Cut to be applied for positrons"};
+  Gaudi::Property<double> m_protonCut{this, "ProtonCut", 1., "Cut to be applied for gammas"};
+  Gaudi::Property<std::vector<std::string> > m_logicalVolumes{this, "VolumeList", {}, "List of volumes to be included in this region"};
 };
 
 #endif
diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h
index bcdb36ac44b5..959326df12bc 100644
--- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h
+++ b/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/SensitiveDetectorBase.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASTOOLS_SENSITIVEDETECTORBASE_H
@@ -79,12 +79,12 @@ class SensitiveDetectorBase : public extends<AthAlgTool, ISensitiveDetector>
   G4VSensitiveDetector* getSD();
 
   /// All the volumes to which this SD is assigned
-  std::vector<std::string> m_volumeNames;
+  Gaudi::Property<std::vector<std::string> > m_volumeNames{this, "LogicalVolumeNames", {}};
   /// Names of all output collections written out by this SD.
-  std::vector<std::string> m_outputCollectionNames;
+  Gaudi::Property<std::vector<std::string> > m_outputCollectionNames{this, "OutputCollectionNames", {}};
 
   /// This SensitiveDetector has no volumes associated with it.
-  bool m_noVolumes;
+  Gaudi::Property<bool> m_noVolumes{this, "NoVolumes", false};
 
   /// Method stolen from G4VUserDetectorConstruction in G4 10.2
   void SetSensitiveDetector(G4LogicalVolume*, G4VSensitiveDetector*) const;
@@ -103,7 +103,7 @@ class SensitiveDetectorBase : public extends<AthAlgTool, ISensitiveDetector>
   SDThreadMap_t m_sdThreadMap;
 #else
   /// The sensitive detector to which this thing corresponds
-  G4VSensitiveDetector* m_SD;
+  G4VSensitiveDetector* m_SD{};
 #endif
 
 }; // class SensitiveDetectorBase
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/AddPhysicsDecayTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/AddPhysicsDecayTool.cxx
index a9836a15b796..4619fda9ca82 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/AddPhysicsDecayTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/AddPhysicsDecayTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Include files
@@ -38,9 +38,6 @@ AddPhysicsDecayTool::AddPhysicsDecayTool( const std::string& type,
                                           const std::string& nam,const IInterface* parent )
   : base_class ( type, nam , parent )
 {
-  declareProperty("ParticleName",m_ParticleName="NoFile","Particle name");
-  declareProperty("BR",m_BR=0,"Branching Ratio");
-  declareProperty("Daughters",m_Daughters="NoFile","Daughters");
 }
 
 //=============================================================================
@@ -76,7 +73,7 @@ void AddPhysicsDecayTool::ConstructProcess()
   while( (*PARTICLEITERATOR)() )
     {
       G4ParticleDefinition *particle = PARTICLEITERATOR->value();
-      if (m_ParticleName== static_cast<const std::string&>(particle->GetParticleName()))
+      if (m_ParticleName.value()== static_cast<const std::string&>(particle->GetParticleName()))
         {
 
           G4DecayTable *table = particle->GetDecayTable();
@@ -89,15 +86,15 @@ void AddPhysicsDecayTool::ConstructProcess()
 
           if (m_Daughters_vec.size()==2)
             {
-              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName,m_BR,2,m_Daughters_vec[0],m_Daughters_vec[1]);
+              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,2,m_Daughters_vec[0],m_Daughters_vec[1]);
             }
           else if (m_Daughters_vec.size()==3)
             {
-              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName,m_BR,3,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2]);
+              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,3,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2]);
             }
           else if (m_Daughters_vec.size()==4)
             {
-              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName,m_BR,4,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2],m_Daughters_vec[3]);
+              mode_vec = new G4PhaseSpaceDecayChannel(m_ParticleName.value(),m_BR,4,m_Daughters_vec[0],m_Daughters_vec[1],m_Daughters_vec[2],m_Daughters_vec[3]);
             }
           else
             {
@@ -118,7 +115,7 @@ void AddPhysicsDecayTool::ConstructProcess()
 
           table->Insert(mode_vec);
 
-          ATH_MSG_DEBUG( "Adding decay to "<<m_ParticleName );
+          ATH_MSG_DEBUG( "Adding decay to "<<m_ParticleName.value() );
           particle->SetDecayTable(table);
         }
     }
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/BoxEnvelope.cxx b/Simulation/G4Atlas/G4AtlasTools/src/BoxEnvelope.cxx
index 0b1595524977..7fbd8c01a890 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/BoxEnvelope.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/BoxEnvelope.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -16,39 +16,21 @@
 // Geant4 includes used in functions
 
 BoxEnvelope::BoxEnvelope(const std::string& type, const std::string& name, const IInterface* parent)
-  : DetectorGeometryBase(type,name,parent),m_materialName("Air"),m_numberOfHoles(0)
+  : DetectorGeometryBase(type,name,parent)
 {
-  ATH_MSG_VERBOSE( "BoxEnvelope constructor for " << name );
-  declareProperty("dX",m_dX=0.,"Envelope dX");
-  declareProperty("dY",m_dY=0.,"Envelope dY");
-  declareProperty("dZ",m_dZ=0.,"Envelope dZ");
-  declareProperty("Material",m_materialName,"Envelope Material");
-  declareProperty("NumberOfHoles",m_numberOfHoles,"Number of hole volumes to subtract from the initial envelope volume.");
-  declareProperty("HoleNames", m_holeNames,"");
-  declareProperty("Hole_dX",   m_hole_dX,"");
-  declareProperty("Hole_dY",   m_hole_dY,"");
-  declareProperty("Hole_dZ",   m_hole_dZ,"");
-  declareProperty("HolePosX",  m_holePosX,"");
-  declareProperty("HolePosY",  m_holePosY,"");
-  declareProperty("HolePosZ",  m_holePosZ,"");
 }
 
-// StatusCode BoxEnvelope::initialize()
-// {
-//   return StatusCode::SUCCESS;
-// }
-
-
 void BoxEnvelope::BuildGeometry()
 {
+  ATH_MSG_VERBOSE( "BoxEnvelope::BuildGeometry: Name " << this->name() );
   ATH_MSG_VERBOSE( "BoxEnvelope::BuildGeometry: "<<m_dX<<" "<<m_dY<<" "<<m_dZ );
 
   // Get nist material manager
   G4NistManager *nist = G4NistManager::Instance();
 
-  G4Material *mat = nist->FindOrBuildMaterial(m_materialName);
+  G4Material *mat = nist->FindOrBuildMaterial(m_materialName.value());
 
-  G4VSolid *solid = new G4Box(m_detectorName,m_dX,m_dY,m_dZ);
+  G4VSolid *solid = new G4Box(m_detectorName.value(),m_dX,m_dY,m_dZ);
   if (m_numberOfHoles)
     {
       if(m_holeNames.size() != m_numberOfHoles)
@@ -82,14 +64,14 @@ void BoxEnvelope::BuildGeometry()
       for(unsigned int nSub(0); nSub<m_numberOfHoles; ++nSub)
         {
           G4ThreeVector size=G4ThreeVector();
-          std::string n=m_holeNames.at(nSub);
-          G4VSolid *temp=new G4Box("",m_hole_dX.at(nSub), m_hole_dY.at(nSub), m_hole_dZ.at(nSub));
-          G4ThreeVector tPos=G4ThreeVector(m_holePosX.at(nSub), m_holePosY.at(nSub), m_holePosZ.at(nSub));
-          solid=new G4SubtractionSolid(m_detectorName,solid,temp,0,tPos);
+          std::string n=m_holeNames.value().at(nSub);
+          G4VSolid *temp=new G4Box("",m_hole_dX.value().at(nSub), m_hole_dY.value().at(nSub), m_hole_dZ.value().at(nSub));
+          G4ThreeVector tPos=G4ThreeVector(m_holePosX.value().at(nSub), m_holePosY.value().at(nSub), m_holePosZ.value().at(nSub));
+          solid=new G4SubtractionSolid(m_detectorName.value(),solid,temp,0,tPos);
         }
     }
 
-  G4LogicalVolume* logicWorld = new G4LogicalVolume(solid,mat,m_detectorName);
+  G4LogicalVolume* logicWorld = new G4LogicalVolume(solid,mat,m_detectorName.value());
 
   m_envelope.theEnvelope=logicWorld;
 }
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/CylindricalEnvelope.cxx b/Simulation/G4Atlas/G4AtlasTools/src/CylindricalEnvelope.cxx
index 3a0e089a82b7..e74b1dbb64b6 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/CylindricalEnvelope.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/CylindricalEnvelope.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // class header
@@ -12,26 +12,10 @@
 #include "G4SystemOfUnits.hh"
 #include "G4Tubs.hh"
 
-// CLHEP includes
-#include "CLHEP/Units/SystemOfUnits.h"
-
 CylindricalEnvelope::CylindricalEnvelope(const std::string& type, const std::string& name, const IInterface* parent)
   : DetectorGeometryBase(type,name,parent)
-  , m_materialName("Air")
-  , m_innerRadius(0.)
-  , m_outerRadius(0.)
-  , m_dZ(0.)
-  , m_startphi(0.)
-  , m_deltaphi(360.*CLHEP::deg)
-
 {
   ATH_MSG_DEBUG( "CylindricalEnvelope constructor for " << name );
-  declareProperty("Material",m_materialName,"Envelope Material");
-  declareProperty("InnerRadius",m_innerRadius,"Envelope inner radius");
-  declareProperty("OuterRadius",m_outerRadius,"Envelope outer radius");
-  declareProperty("dZ",m_dZ,"Envelope dZ");
-  declareProperty("StartPhi", m_startphi, "");
-  declareProperty("DeltaPhi", m_deltaphi, "");
 }
 
 void CylindricalEnvelope::BuildGeometry()
@@ -41,11 +25,11 @@ void CylindricalEnvelope::BuildGeometry()
   // Get nist material manager
   G4NistManager* nist = G4NistManager::Instance();
 
-  G4Material* mat = nist->FindOrBuildMaterial(m_materialName);
+  G4Material* mat = nist->FindOrBuildMaterial(m_materialName.value());
 
-  G4Tubs* envSolid=new G4Tubs(m_detectorName,m_innerRadius,m_outerRadius,m_dZ,m_startphi,m_deltaphi);
+  G4Tubs* envSolid=new G4Tubs(m_detectorName.value(),m_innerRadius,m_outerRadius,m_dZ,m_startphi,m_deltaphi);
 
-  G4LogicalVolume* logicWorld = new G4LogicalVolume(envSolid,mat,m_detectorName);
+  G4LogicalVolume* logicWorld = new G4LogicalVolume(envSolid,mat,m_detectorName.value());
 
   m_envelope.theEnvelope=logicWorld;
 }
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/DetectorFieldManagerTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/DetectorFieldManagerTool.cxx
index 88a5b5a83728..1c4f13a416d4 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/DetectorFieldManagerTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/DetectorFieldManagerTool.cxx
@@ -25,10 +25,6 @@ DetectorFieldManagerTool::DetectorFieldManagerTool(const std::string& type,
                                                    const IInterface* parent)
   : G4FieldManagerToolBase(type, name, parent)
 {
-  declareProperty("LogicalVolumes", m_volumeList,
-                  "List of volumes to which the field will be applied");
-  declareProperty("MuonOnlyField", m_muonOnlyField,
-                  "Only muons experience the magnetic field");
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
index d0897a753a15..08764aa429ce 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/DetectorGeometryBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -10,28 +10,8 @@
 #include "G4RotationMatrix.hh"
 
 DetectorGeometryBase::DetectorGeometryBase(const std::string& type, const std::string& name, const IInterface* parent)
-  : base_class(type,name,parent),
-    m_subDetTools(this),
-    m_notifierSvc("G4GeometryNotifierSvc", name),
-    m_theParent(nullptr),
-    m_detectorName(""),
-    m_isWorld(0),
-    m_rotateX(0.0),
-    m_rotateY(0.0),
-    m_rotateZ(0.0),
-    m_offsetX(0.0),
-    m_offsetY(0.0),
-    m_offsetZ(0.0)
+  : base_class(type,name,parent)
 {
-  declareProperty( "GeometryNotifierSvc", m_notifierSvc, "");
-  declareProperty( "SubDetectors" , m_subDetTools , "Tool handle array of all subdetector tools" );
-  declareProperty( "DetectorName" , m_detectorName , "Detector name (same as the Tool name if not set");
-  declareProperty( "RotateX" , m_rotateX , "Rotation around the X-axis");
-  declareProperty( "RotateY" , m_rotateY , "Rotation around the Y-axis");
-  declareProperty( "RotateZ" , m_rotateZ , "Rotation around the Z-axis");
-  declareProperty( "OffsetX" , m_offsetX , "Offset in the X-direction");
-  declareProperty( "OffsetY" , m_offsetY , "Offset in the Y-direction");
-  declareProperty( "OffsetZ" , m_offsetZ , "Offset in the Z-direction");
 }
 
 // Athena method, called at initialization time
@@ -42,16 +22,16 @@ StatusCode DetectorGeometryBase::initialize()
     {
       m_detectorName = this->name();
       // re-initialize m_detectorName in order to take the real detector name rather than the path to it
-      size_t ipos=m_detectorName.find_last_of(".");
-      size_t length=m_detectorName.size();
+      size_t ipos=m_detectorName.value().find_last_of(".");
+      size_t length=m_detectorName.value().size();
       if (ipos<length)
         {
-          ATH_MSG_VERBOSE( "m_detectorName: " << m_detectorName << " needs to be reset.");
-          m_detectorName=m_detectorName.substr(ipos+1,length-ipos-1);
-          ATH_MSG_VERBOSE( "m_detectorName default value reset to " << m_detectorName);
+          ATH_MSG_VERBOSE( "m_detectorName: " << m_detectorName.value() << " needs to be reset.");
+          m_detectorName=m_detectorName.value().substr(ipos+1,length-ipos-1);
+          ATH_MSG_VERBOSE( "m_detectorName default value reset to " << m_detectorName.value());
         }
     }
-  ATH_MSG_DEBUG( name() << "::initialize() (Base class method): Detector name = " << m_detectorName );
+  ATH_MSG_DEBUG( name() << "::initialize() (Base class method): Detector name = " << m_detectorName.value() );
   CHECK(m_notifierSvc.retrieve());
 
   //  This fires initialize() for each of those tools
@@ -73,7 +53,7 @@ void DetectorGeometryBase::Build()
 {
   ATH_MSG_VERBOSE( name() << "::Build() (Base class method): Starting" );
   SetEnvelope();
-  m_notifierSvc->SetCurrentDetectorName(m_detectorName);
+  m_notifierSvc->SetCurrentDetectorName(m_detectorName.value());
   BuildGeometry();
   SetRotationAndOffset();
   PositionInParent();
@@ -145,7 +125,7 @@ void DetectorGeometryBase::PositionInParent()
       // check that there is a parent
       if (!m_theParent)
         {
-          ATH_MSG_ERROR("Parent not set for "<<m_detectorName<<"!!!!!!!!!!");
+          ATH_MSG_ERROR("Parent not set for "<<m_detectorName.value()<<"!!!!!!!!!!");
         }
       else
         {
@@ -167,7 +147,7 @@ void DetectorGeometryBase::BuildSubDetectors()
   ATH_MSG_VERBOSE( name() << "::BuildSubDetectors() (Base class method): Starting");
   for (auto& subDetTool: m_subDetTools)
     {
-      ATH_MSG_VERBOSE(name() << "::BuildSubDetectors() (Base class method):  Positioning "<<subDetTool->GetDetectorName()<<" within "<<m_detectorName);
+      ATH_MSG_VERBOSE(name() << "::BuildSubDetectors() (Base class method):  Positioning "<<subDetTool->GetDetectorName()<<" within "<<m_detectorName.value());
       subDetTool->SetParent(this);
       subDetTool->Build();
     }
@@ -189,7 +169,7 @@ void DetectorGeometryBase::SetDetectorName(const std::string s)
 
 std::string DetectorGeometryBase::GetDetectorName() const
 {
-  return m_detectorName;
+  return m_detectorName.value();
 }
 
 void DetectorGeometryBase::SetAsWorld()
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/EnvelopeTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/EnvelopeTool.cxx
index f5118149ea28..8957ba34580d 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/EnvelopeTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/EnvelopeTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -39,21 +39,21 @@ void EnvelopeTool::BuildGeometry()
 {
   ATH_MSG_INFO( "this is EnvelopeTool::BuildGeometry: " );
 
-  ATH_MSG_INFO("Building '" << m_detectorName << "' Envelope using the envelope definition service '");
+  ATH_MSG_INFO("Building '" << m_detectorName.value() << "' Envelope using the envelope definition service '");
 
   // retrieve the vector of (r,z) values from the EnvelopeDefSvc
   const RZPairVector *rz = 0;
-  if ( m_detectorName == "BeamPipe")
+  if ( m_detectorName.value() == "BeamPipe")
     rz = &( m_envelopeDefSvc->getBeamPipeRZBoundary() );
-  else if ( m_detectorName == "IDET")
+  else if ( m_detectorName.value() == "IDET")
     rz = &( m_envelopeDefSvc->getInDetRZBoundary() );
-  else if ( m_detectorName == "CALO")
+  else if ( m_detectorName.value() == "CALO")
     rz = &( m_envelopeDefSvc->getCaloRZBoundary() );
-  else if ( m_detectorName == "MUON")
+  else if ( m_detectorName.value() == "MUON")
     rz = &( m_envelopeDefSvc->getMuonRZBoundary() );
   else
     {
-      ATH_MSG_ERROR("Unknown envelope volume name '"<< m_detectorName << "'. Unable to build envelope.");
+      ATH_MSG_ERROR("Unknown envelope volume name '"<< m_detectorName.value() << "'. Unable to build envelope.");
       return;
     }
 
@@ -62,7 +62,7 @@ void EnvelopeTool::BuildGeometry()
   size_t numPoints = rz->size();
   if ( !numPoints)
     {
-      ATH_MSG_ERROR("No entries for " << m_detectorName << " envelope in envelope definition service. Unable to build envelope.");
+      ATH_MSG_ERROR("No entries for " << m_detectorName.value() << " envelope in envelope definition service. Unable to build envelope.");
       return;
     }
 
@@ -83,8 +83,8 @@ void EnvelopeTool::BuildGeometry()
   // create the G4 Volume
   double phimin    = 0.;
   double deltaphi  = 360.*CLHEP::deg;
-  G4Polycone *pcone = new G4Polycone( m_detectorName, phimin, deltaphi, numPoints, r, z);
-  G4LogicalVolume* logVolume = new G4LogicalVolume( pcone, 0, m_detectorName);
+  G4Polycone *pcone = new G4Polycone( m_detectorName.value(), phimin, deltaphi, numPoints, r, z);
+  G4LogicalVolume* logVolume = new G4LogicalVolume( pcone, 0, m_detectorName.value());
 
   G4NistManager* nist = G4NistManager::Instance();
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationBase.cxx
index 8281e975aa0c..dea8bef280b7 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "G4AtlasTools/FastSimulationBase.h"
@@ -10,12 +10,7 @@
 
 FastSimulationBase::FastSimulationBase(const std::string& type, const std::string& name, const IInterface* parent)
   : base_class(type,name,parent)
-#ifndef G4MULTITHREADED
-  , m_FastSimModel(nullptr)
-#endif
 {
-  declareProperty("RegionNames" , m_regionNames );
-  declareProperty("NoRegions", m_noRegions=false );
 }
 
 // Athena method, used to get out the G4 geometry and set up the Fast Simulation Models
@@ -39,7 +34,7 @@ StatusCode FastSimulationBase::initializeFastSim(){
   // Go through the regions and hook the fast simulation up
   G4RegionStore* regionStore = G4RegionStore::GetInstance();
   bool missedOne = false;
-  for (const auto& myreg : m_regionNames){
+  for (const auto& myreg : m_regionNames.value()){
     int found=0; // Regions with more than one name...
     for (auto* areg : *regionStore){
       if (myreg.data()==areg->GetName()){
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.cxx
index 37f8af06b2da..4ffb49f4bcd3 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -12,9 +12,7 @@
 
 FastSimulationMasterTool::FastSimulationMasterTool(const std::string& type, const std::string& name, const IInterface* parent)
   : base_class(type,name,parent)
-  , m_FastSimList(this)
 {
-  declareProperty( "FastSimulations" , m_FastSimList , "Tool handle array of fast simulation tools" );
 }
 
 StatusCode FastSimulationMasterTool::initializeFastSims(){
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.h b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.h
index 022e3fc7b20c..fe6f8189bb35 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.h
+++ b/Simulation/G4Atlas/G4AtlasTools/src/FastSimulationMasterTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASSERVICES_FASTSIMULATIONMASTERTOOL_H
@@ -24,7 +24,7 @@ class FastSimulationMasterTool : public extends<AthAlgTool , IFastSimulationMast
   StatusCode EndOfAthenaEvent() override final; ///!< Base class method that calls EventOfAthenaEvent for all fast simulation models.
 
  private:
-  ToolHandleArray<IFastSimulation> m_FastSimList; ///!< Private array of tool handles pointing to all fast simulations
+  ToolHandleArray<IFastSimulation> m_FastSimList{this, "FastSimulations", {}, "Tool handle array of fast simulation tools"}; ///!< Private array of tool handles pointing to all fast simulations
 
 };
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
index 55a8fdd60993..57d0e2281df9 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/G4FieldManagerToolBase.cxx
@@ -55,31 +55,8 @@ static constexpr double perMillion  = CLHEP::perMillion;
 G4FieldManagerToolBase::G4FieldManagerToolBase(const std::string& type,
                                                const std::string& name,
                                                const IInterface* parent)
-  : base_class(type, name, parent),
-    m_fieldSvc("G4FieldSvc", name),
-    m_fieldOn(true),
-    m_integratorStepper("AtlasRK4"),
-    m_equationOfMotion("", this), //private toolhandle
-    m_minEps(-1.0),
-    m_maxEps(-1.0),
-    m_deltaChord(-1.0),
-    m_deltaOneStep(-1.0),
-    m_deltaIntersection(-1.0),
-    m_maxStep(-1.0), // (1.*CLHEP::m)
-    m_minStep(1e-2) // (1.*CLHEP::mm)
+  : base_class(type, name, parent)
 {
-  // Declare common configurable properties
-  declareProperty( "FieldSvc", m_fieldSvc, "Service providing a G4MagneticField");
-  declareProperty( "FieldOn", m_fieldOn, "Toggles field on/off");
-  declareProperty( "IntegratorStepper", m_integratorStepper, "Integrator stepper name" );
-  declareProperty( "EquationOfMotion", m_equationOfMotion, "");
-  declareProperty( "DeltaChord", m_deltaChord, "Missing distance for the chord finder" );
-  declareProperty( "DeltaOneStep", m_deltaOneStep, "Delta(one-step)" );
-  declareProperty( "DeltaIntersection", m_deltaIntersection, "Accuracy for boundary intersection" );
-  declareProperty( "MinimumEpsilonStep", m_minEps, "Minimum epsilon (see G4 documentation)" );
-  declareProperty( "MaximumEpsilonStep", m_maxEps, "Maximum epsilon (see G4 documentation)" );
-  declareProperty( "MaximumStep", m_maxStep, "Maximum step length in field (see G4 documentation)" );
-  declareProperty( "MinimumStep", m_minStep, "Minimum step length in field (see G4 documentation)" );
 }
 
 //=============================================================================
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/GlobalFieldManagerTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/GlobalFieldManagerTool.cxx
index b9dc00fe95bc..d9140ad90bdf 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/GlobalFieldManagerTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/GlobalFieldManagerTool.cxx
@@ -26,8 +26,6 @@ GlobalFieldManagerTool::GlobalFieldManagerTool(const std::string& type,
                                                const IInterface* parent)
   : G4FieldManagerToolBase(type, name, parent)
 {
-  declareProperty("UseTightMuonStepping", m_useTightMuonStepping=false,
-                  "Use tight muon stepping parameters by default");
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/PolyconicalEnvelope.cxx b/Simulation/G4Atlas/G4AtlasTools/src/PolyconicalEnvelope.cxx
index 21549fe6607a..ec8cb2557917 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/PolyconicalEnvelope.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/PolyconicalEnvelope.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -16,19 +16,8 @@
 
 PolyconicalEnvelope::PolyconicalEnvelope(const std::string& type, const std::string& name, const IInterface* parent)
   : DetectorGeometryBase(type,name,parent)
-  , m_materialName("Air")
-  , m_surfaceNr(0)
-  , m_startphi(0.)
-  , m_deltaphi(360.*CLHEP::deg)
 {
   ATH_MSG_VERBOSE( "PolyconicalEnvelope constructor for " << name );
-  declareProperty("Material",m_materialName,"Envelope Material");
-  declareProperty("NSurfaces",m_surfaceNr,"Nr. of surfaces in Z");
-  declareProperty("InnerRadii",m_innerRadii,"Envelope inner radii");
-  declareProperty("OuterRadii",m_outerRadii,"Envelope outer radii");
-  declareProperty("ZSurfaces",m_ZSurfaces,"Envelope surface Zs");
-  declareProperty("StartPhi", m_startphi, "");
-  declareProperty("DeltaPhi", m_deltaphi, "");
 }
 
 void PolyconicalEnvelope::BuildGeometry()
@@ -38,7 +27,7 @@ void PolyconicalEnvelope::BuildGeometry()
   // Get nist material manager
   G4NistManager* nist = G4NistManager::Instance();
 
-  G4Material* mat = nist->FindOrBuildMaterial(m_materialName);
+  G4Material* mat = nist->FindOrBuildMaterial(m_materialName.value());
 
   if (!m_surfaceNr) m_surfaceNr=m_ZSurfaces.size();
 
@@ -63,9 +52,9 @@ void PolyconicalEnvelope::BuildGeometry()
       ov[i]=m_outerRadii[i];
     }
 
-  G4VSolid* envSolid=new G4Polycone(m_detectorName,m_startphi,m_deltaphi,m_surfaceNr,zv,iv,ov);
+  G4VSolid* envSolid=new G4Polycone(m_detectorName.value(),m_startphi,m_deltaphi,m_surfaceNr,zv,iv,ov);
 
-  G4LogicalVolume* logicWorld = new G4LogicalVolume(envSolid,mat,m_detectorName);
+  G4LogicalVolume* logicWorld = new G4LogicalVolume(envSolid,mat,m_detectorName.value());
 
   m_envelope.theEnvelope=logicWorld;
 
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx b/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
index e7d7bb9ae1e2..535d5f8cf554 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
@@ -1,11 +1,10 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
 #include "G4AtlasTools/RegionCreator.h"
 
-#include "GaudiKernel/SystemOfUnits.h"
 // Geant4 includes used in functions
 
 #include "G4LogicalVolume.hh"
@@ -14,33 +13,28 @@
 #include "G4ProductionCuts.hh"
 
 RegionCreator::RegionCreator(const std::string& type, const std::string& name, const IInterface* parent)
-  : base_class(type,name,parent),m_regionName(name),m_gammaCut(1.*Gaudi::Units::mm),m_electronCut(1.*Gaudi::Units::mm),m_positronCut(1.*Gaudi::Units::mm),
-    m_protonCut(1.*Gaudi::Units::mm)
+  : base_class(type,name,parent)
 {
-  // re-initialize m_regionName in order to take the real tool name rather than the path to it
-  size_t ipos=m_regionName.find_last_of(".");
-  size_t length=m_regionName.size();
-  if (ipos<length) m_regionName=m_regionName.substr(ipos+1,length-ipos-1);
-  ATH_MSG_INFO( "m_regionName default value reset to "<<m_regionName);
-
-  declareProperty( "VolumeList" , m_logicalVolumes , "List of volumes to be included in this region" );
-  declareProperty( "ElectronCut" , m_electronCut, "Cut to be applied for electrons");
-  declareProperty( "PositronCut" , m_positronCut, "Cut to be applied for positrons");
-  declareProperty( "GammaCut" , m_gammaCut, "Cut to be applied for gammas");
-  declareProperty( "ProtonCut" , m_protonCut, "Cut to be applied for gammas");
-
-  declareProperty( "RegionName" , m_regionName , "Region name (same as the Tool name if not set");
-
-
 }
 
 // Athena method, called at initialization time
 StatusCode RegionCreator::initialize()
 {
   ATH_MSG_INFO(" initializing RegionCreator "<<name() );
+  if (m_regionName.empty()) {
+    m_regionName = this->name();
+    // re-initialize m_regionName in order to take the real tool name rather than the path to it
+    size_t ipos=m_regionName.value().find_last_of(".");
+    size_t length=m_regionName.value().size();
+    if (ipos<length) {
+      ATH_MSG_VERBOSE( "m_regionName: " << m_regionName.value() << " needs to be reset.");
+      m_regionName=m_regionName.value().substr(ipos+1,length-ipos-1);
+    }
+    ATH_MSG_INFO( "m_regionName default value reset to "<<m_regionName.value());
+  }
 
   //create a new G4Region
-  G4Region* theRegion=new G4Region(m_regionName);
+  G4Region* theRegion=new G4Region(m_regionName.value());
 
   // loop over volumes and fish for those in the list
   int nVolumes = 0;
@@ -57,7 +51,7 @@ StatusCode RegionCreator::initialize()
           }
       }
 
-  ATH_MSG_INFO(" a total of "<<nVolumes<<" volumes was assigned to region "<<m_regionName );
+  ATH_MSG_INFO(" a total of "<<nVolumes<<" volumes was assigned to region "<<m_regionName.value() );
 
   // create a G4ProductionCuts object and set appropriate values
   G4ProductionCuts* cuts=new G4ProductionCuts();
@@ -78,7 +72,7 @@ void RegionCreator::Dump()
 {
   ATH_MSG_INFO("+----------------------------------------------------+");
   ATH_MSG_INFO(" ");
-  ATH_MSG_INFO("    Dump of region  "<<m_regionName);
+  ATH_MSG_INFO("    Dump of region  "<<m_regionName.value());
   ATH_MSG_INFO("    Volumes being assigned to this region:");
   for (const auto& vol: m_logicalVolumes)
     {
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorBase.cxx b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorBase.cxx
index eee3deb0def9..6ddcf67fbfd5 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorBase.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorBase.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // STL includes
@@ -23,13 +23,7 @@ SensitiveDetectorBase::SensitiveDetectorBase(const std::string& type,
                                              const std::string& name,
                                              const IInterface* parent)
   : base_class(type,name,parent)
-#ifndef G4MULTITHREADED
-  , m_SD(nullptr)
-#endif
 {
-  declareProperty("LogicalVolumeNames", m_volumeNames);
-  declareProperty("NoVolumes", m_noVolumes=false);
-  declareProperty("OutputCollectionNames", m_outputCollectionNames);
 }
 
 // Athena method used to set up the SDs for the current worker thread.
@@ -42,7 +36,7 @@ StatusCode SensitiveDetectorBase::initializeSD()
   if(m_volumeNames.empty() != m_noVolumes) {
     ATH_MSG_ERROR("Initializing SD from " << name() << ", NoVolumes = "
                   << (m_noVolumes? "true" : "false") << ", but LogicalVolumeNames = "
-                  << m_volumeNames);
+                  << m_volumeNames.value());
     return StatusCode::FAILURE;
   }
 
@@ -63,7 +57,7 @@ StatusCode SensitiveDetectorBase::initializeSD()
   setSD(sd);
 
   // Assign the SD to our list of volumes
-  ATH_CHECK( assignSD( getSD(), m_volumeNames ) );
+  ATH_CHECK( assignSD( getSD(), m_volumeNames.value() ) );
 
   ATH_MSG_DEBUG( "Initialized and added SD " << name() );
   return StatusCode::SUCCESS;
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.cxx b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.cxx
index 68031cd2dbf8..ca63a539c2e6 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <mutex>
@@ -9,10 +9,7 @@ SensitiveDetectorMasterTool::SensitiveDetectorMasterTool(const std::string& type
                                                          const std::string& name,
                                                          const IInterface* parent)
   : base_class(type, name, parent)
-  , m_senDetTools(this)
 {
-  declareProperty( "SensitiveDetectors", m_senDetTools,
-                   "Tool handle array of all sensitive detector tools" );
 }
 
 StatusCode SensitiveDetectorMasterTool::initialize()
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.h b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.h
index 41901b52cdca..0de40df02ae6 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.h
+++ b/Simulation/G4Atlas/G4AtlasTools/src/SensitiveDetectorMasterTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef G4ATLASSERVICES_SENSITIVEDETECTORMASTERTOOL_H
@@ -43,7 +43,7 @@ class SensitiveDetectorMasterTool : public extends<AthAlgTool, ISensitiveDetecto
 
  private:
   /// Private array of tool handles pointing to all SD tools.
-  ToolHandleArray<ISensitiveDetector> m_senDetTools;
+  ToolHandleArray<ISensitiveDetector> m_senDetTools{this, "SensitiveDetectors", {}, "Tool handle array of all sensitive detector tools"};
 };
 
 #endif
diff --git a/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKillerTool.cxx b/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKillerTool.cxx
index 37799cc92ee3..30b9e53dda4f 100644
--- a/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKillerTool.cxx
+++ b/Simulation/G4Utilities/G4FastSimulation/src/SimpleFastKillerTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // class header include
@@ -11,7 +11,7 @@
 SimpleFastKillerTool::SimpleFastKillerTool(const std::string& type, const std::string& name, const IInterface *parent)
   : FastSimulationBase(type,name,parent)
 {
-  m_regionNames = { "BeampipeFwdCut" };
+  m_regionNames.setValue({ "BeampipeFwdCut" });
 }
 
 G4VFastSimulationModel* SimpleFastKillerTool::makeFastSimModel()
diff --git a/Simulation/G4Utilities/Geo2G4/src/GDMLDetectorTool.cxx b/Simulation/G4Utilities/Geo2G4/src/GDMLDetectorTool.cxx
index f484943ebec1..082867c814be 100644
--- a/Simulation/G4Utilities/Geo2G4/src/GDMLDetectorTool.cxx
+++ b/Simulation/G4Utilities/Geo2G4/src/GDMLDetectorTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -31,23 +31,23 @@ StatusCode GDMLDetectorTool::initialize()
     {
       m_detectorName = this->name();
       // re-initialize m_detectorName in order to take the real detector name rather than the path to it
-      size_t ipos=m_detectorName.find_last_of(".");
-      size_t length=m_detectorName.size();
+      size_t ipos=m_detectorName.value().find_last_of(".");
+      size_t length=m_detectorName.value().size();
       if (ipos<length)
         {
-          ATH_MSG_DEBUG( "m_detectorName: " << m_detectorName << " needs to be reset.");
-          m_detectorName=m_detectorName.substr(ipos+1,length-ipos-1);
-          ATH_MSG_DEBUG( "m_detectorName default value reset to " << m_detectorName);
+          ATH_MSG_DEBUG( "m_detectorName: " << m_detectorName.value() << " needs to be reset.");
+          m_detectorName=m_detectorName.value().substr(ipos+1,length-ipos-1);
+          ATH_MSG_DEBUG( "m_detectorName default value reset to " << m_detectorName.value());
         }
     }
-  ATH_MSG_DEBUG( name() << "GDMLDetectorTool::initialize() : Detector name = " << m_detectorName<<" File name: "<<m_GDMLFileName );
+  ATH_MSG_DEBUG( name() << "GDMLDetectorTool::initialize() : Detector name = " << m_detectorName.value()<<" File name: "<<m_GDMLFileName );
   if(m_geoDetectorName.empty())
     {
-      m_geoDetectorName = m_detectorName;
+      m_geoDetectorName = m_detectorName.value();
     }
   if(m_GDMLFileName.empty())
     {
-          m_GDMLFileName = m_detectorName+".gdml";
+          m_GDMLFileName = m_detectorName.value()+".gdml";
     }
   ATH_MSG_DEBUG( name() << "GDMLDetectorTool::initialize() : Geo Detector name = " << m_geoDetectorName<<" File name: "<<m_GDMLFileName );
 
diff --git a/Simulation/G4Utilities/Geo2G4/src/GeoDetectorTool.cxx b/Simulation/G4Utilities/Geo2G4/src/GeoDetectorTool.cxx
index 5c05828aa0c4..60510e4026b8 100644
--- a/Simulation/G4Utilities/Geo2G4/src/GeoDetectorTool.cxx
+++ b/Simulation/G4Utilities/Geo2G4/src/GeoDetectorTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Base class
@@ -32,19 +32,19 @@ StatusCode GeoDetectorTool::initialize()
     {
       m_detectorName = this->name();
       // re-initialize m_detectorName in order to take the real detector name rather than the path to it
-      size_t ipos=m_detectorName.find_last_of(".");
-      size_t length=m_detectorName.size();
+      size_t ipos=m_detectorName.value().find_last_of(".");
+      size_t length=m_detectorName.value().size();
       if (ipos<length)
         {
-          ATH_MSG_VERBOSE( "m_detectorName: " << m_detectorName << " needs to be reset.");
-          m_detectorName=m_detectorName.substr(ipos+1,length-ipos-1);
-          ATH_MSG_VERBOSE( "m_detectorName default value reset to " << m_detectorName);
+          ATH_MSG_VERBOSE( "m_detectorName: " << m_detectorName.value() << " needs to be reset.");
+          m_detectorName = m_detectorName.value().substr(ipos+1,length-ipos-1);
+          ATH_MSG_VERBOSE( "m_detectorName default value reset to " << m_detectorName.value());
         }
     }
-  ATH_MSG_DEBUG( name() << "GeoDetectorTool::initialize() : Detector name = " << m_detectorName );
+  ATH_MSG_DEBUG( name() << "GeoDetectorTool::initialize() : Detector name = " << m_detectorName.value() );
   if(m_geoDetectorName.empty())
     {
-      m_geoDetectorName = m_detectorName;
+      m_geoDetectorName = m_detectorName.value();
     }
   ATH_MSG_DEBUG( name() << "GeoDetectorTool::initialize() : Geo Detector name = " << m_geoDetectorName );
 
diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackFastSimSDTool.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackFastSimSDTool.cxx
index 63b467f69c5e..7f0ec5ffc22c 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/TrackFastSimSDTool.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/TrackFastSimSDTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -12,8 +12,8 @@
 TrackFastSimSDTool::TrackFastSimSDTool(const std::string& type, const std::string& name, const IInterface* parent)
   : SensitiveDetectorBase( type , name , parent )
 {
-  m_outputCollectionNames = {"NeutronBG"};
-  m_noVolumes=true;
+  m_outputCollectionNames.setValue({"NeutronBG"});
+  m_noVolumes.setValue(true);
 }
 
 G4VSensitiveDetector* TrackFastSimSDTool::makeSD() const
@@ -21,5 +21,5 @@ G4VSensitiveDetector* TrackFastSimSDTool::makeSD() const
   ATH_MSG_DEBUG( "Initializing SD" );
 
   // Create a fresh SD
-  return new TrackFastSimSD(name(), m_outputCollectionNames[0]);
+  return new TrackFastSimSD(name(), m_outputCollectionNames.value()[0]);
 }
-- 
GitLab


From 3400bcca243aa3884b3f57ad68bd8014cf646c34 Mon Sep 17 00:00:00 2001
From: amete <serhanmete@gmail.com>
Date: Tue, 7 Jul 2020 20:00:43 +0200
Subject: [PATCH 092/217] Fixing a memory leak in AGDDControl/XMLHandler

---
 DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx b/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
index 813eda019983..ac932770fbdd 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
@@ -1,10 +1,11 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDDControl/XMLHandler.h"
 #include "AGDDControl/XMLHandlerStore.h"
 
+#include <memory>
 #include <vector>
 
 using namespace xercesc;
@@ -44,7 +45,9 @@ std::string XMLHandler::getAttribute(const std::string name, bool& isPresent) co
 	isPresent=false;
 	if (s_currentElement->hasAttributes()) {
 		DOMNamedNodeMap *pAttributes = s_currentElement->getAttributes();
-		DOMAttr *pAttributeNode = (DOMAttr*) pAttributes->getNamedItem(XMLString::transcode(name.c_str()));
+		auto deleter = [&](XMLCh buf[]) { XMLString::release(&buf); };
+		std::unique_ptr<XMLCh[], decltype(deleter)> ptr(XMLString::transcode(name.c_str()), deleter);
+		DOMAttr *pAttributeNode = (DOMAttr*) pAttributes->getNamedItem(ptr.get());
 		if (pAttributeNode) {
 
   		  char* val=XMLString::transcode(pAttributeNode->getValue());
-- 
GitLab


From 07268ba451797bb45b726f968847e2262f369f2c Mon Sep 17 00:00:00 2001
From: Paul Gessinger-Befurt <paul.gessinger@cern.ch>
Date: Tue, 7 Jul 2020 18:57:12 +0000
Subject: [PATCH 093/217] Adapt to Acts v0.27.0: Change renamed include

---
 Projects/AnalysisBase/externals.txt                 |  2 +-
 Projects/AthDataQuality/externals.txt               |  2 +-
 Projects/AthGeneration/externals.txt                |  2 +-
 Projects/AthSimulation/externals.txt                |  2 +-
 Projects/Athena/externals.txt                       |  2 +-
 Projects/VP1Light/externals.txt                     |  2 +-
 .../Acts/ActsGeometry/src/ActsMaterialMapping.cxx   |  2 +-
 .../ActsAdaptiveMultiPriVtxFinderTool.h             |  2 +-
 .../src/ActsAdaptiveMultiPriVtxFinderTool.cxx       | 13 ++++---------
 9 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index dbecc1c4cf52..06ede204c083 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.69
+AnalysisBaseExternalsVersion = 2.0.70
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index c5635ff6b2f3..b7f3b614e536 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.69
+AtlasExternalsVersion = 2.0.70
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index a7149c426e5a..89f6d7054b37 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.69
+AthGenerationExternalsVersion = 2.0.70
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 81840116e1a5..3cf9a994d107 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.69
+AthSimulationExternalsVersion = 2.0.70
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index e3e3a41a5fa5..d2894d549dad 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.69
+AthenaExternalsVersion = 2.0.70
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index 254dc48e8f9e..71b7e6156520 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.68
+VP1LightExternalsVersion = 2.0.70
diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx
index 3efd705c4e61..7ecd32bcf826 100755
--- a/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx
@@ -31,7 +31,7 @@
 #include <string>
 
 //TEST
-#include "Acts/EventData/NeutralParameters.hpp"
+#include "Acts/EventData/NeutralTrackParameters.hpp"
 #include "Acts/Propagator/ActionList.hpp"
 #include "Acts/Propagator/DebugOutputActor.hpp"
 #include "Acts/Propagator/Navigator.hpp"
diff --git a/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h b/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h
index b1755eb83474..d7838e872097 100644
--- a/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h
+++ b/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h
@@ -109,7 +109,7 @@ private:
   using Propagator = Acts::Propagator<Acts::EigenStepper<ATLASMagneticFieldWrapper>, Acts::Navigator>;
   using TrackLinearizer = Acts::HelicalTrackLinearizer<Propagator>;
   using VertexFitter = Acts::AdaptiveMultiVertexFitter<TrackWrapper, TrackLinearizer>;
-  using VertexSeedFinder = Acts::TrackDensityVertexFinder<VertexFitter, Acts::GaussianTrackDensity>;
+  using VertexSeedFinder = Acts::TrackDensityVertexFinder<VertexFitter, Acts::GaussianTrackDensity<TrackWrapper>>;
   using VertexFinder = Acts::AdaptiveMultiVertexFinder<VertexFitter, VertexSeedFinder>;
 
   std::shared_ptr<VertexFinder> m_vertexFinder = nullptr;
diff --git a/Tracking/Acts/ActsPriVtxFinder/src/ActsAdaptiveMultiPriVtxFinderTool.cxx b/Tracking/Acts/ActsPriVtxFinder/src/ActsAdaptiveMultiPriVtxFinderTool.cxx
index 2ca64719ffa7..bb9e41530807 100755
--- a/Tracking/Acts/ActsPriVtxFinder/src/ActsAdaptiveMultiPriVtxFinderTool.cxx
+++ b/Tracking/Acts/ActsPriVtxFinder/src/ActsAdaptiveMultiPriVtxFinderTool.cxx
@@ -100,14 +100,14 @@ ActsAdaptiveMultiPriVtxFinderTool::initialize()
     TrackLinearizer linearizer(ltConfig);
 
     // Set up Gaussian track density
-    Acts::GaussianTrackDensity::Config trackDensityConfig;
+    Acts::GaussianTrackDensity<TrackWrapper>::Config trackDensityConfig;
     trackDensityConfig.d0MaxSignificance = m_gaussianMaxD0Significance;
     trackDensityConfig.z0MaxSignificance = m_gaussianMaxZ0Significance;
-    Acts::GaussianTrackDensity trackDensity(trackDensityConfig);
+    Acts::GaussianTrackDensity<TrackWrapper> trackDensity(trackDensityConfig);
 
     // Vertex seed finder
     VertexSeedFinder::Config seedFinderConfig;
-    seedFinderConfig.trackDensityEstimator = trackDensity;
+    //seedFinderConfig.trackDensityEstimator = trackDensity;
     VertexSeedFinder seedFinder(seedFinderConfig, extractParameters);
     VertexFinder::Config finderConfig(std::move(fitter), seedFinder,
       ipEst, linearizer);
@@ -301,12 +301,7 @@ ActsAdaptiveMultiPriVtxFinderTool::findVertex(const EventContext& ctx, std::vect
       xAODVtx->makePrivateStore();
       xAODVtx->setPosition(vtx.position());
       xAODVtx->setCovariancePosition(vtx.covariance());
-      // TODO: remove this 1.e9 subtraction once acts bug fix is in.
-      double tempChi2 = vtx.fitQuality().first;
-      if(tempChi2 >= 1.e9){
-        tempChi2 -= 1.e9;
-      }
-      xAODVtx->setFitQuality(tempChi2, vtx.fitQuality().second);
+      xAODVtx->setFitQuality(vtx.fitQuality().first, vtx.fitQuality().second);
 
       const auto& tracks = vtx.tracks();
       std::vector<Trk::VxTrackAtVertex>* trkAtVtxVec = &(xAODVtx->vxTrackAtVertex());
-- 
GitLab


From 85c8dea34acb2408634bc87a7e7a9eeb36a7db0f Mon Sep 17 00:00:00 2001
From: Anthony Morley <anthony.morley@cern.ch>
Date: Tue, 7 Jul 2020 19:00:13 +0000
Subject: [PATCH 094/217] Make  a new  GsfMaterialMixtureConvolutionLM  which
 hopefully reduces malloc

---
 .../InDetRecExample/python/TrackingCommon.py  |   4 +-
 .../share/InDetRec_jobOptions.py              |  13 +-
 .../src/PRD_TruthTrajectorySelectorID.cxx     |  18 +-
 .../egammaRec/python/EMCommonRefitter.py      |   4 +-
 .../TrkGaussianSumFilter/AlignedDynArray.h    |   6 +
 .../TrkGaussianSumFilter/ForwardGsfFitter.h   |   5 +-
 .../TrkGaussianSumFilter/GaussianSumFitter.h  |  16 +-
 .../TrkGaussianSumFilter/GsfExtrapolator.h    |  60 +--
 .../GsfMaterialMixtureConvolution.h           |   9 +-
 .../GsfMaterialMixtureConvolutionLM.h         | 138 +++++
 .../TrkGaussianSumFilter/GsfSmoother.h        |   1 +
 .../TrkGaussianSumFilter/IForwardGsfFitter.h  |   4 +-
 .../TrkGaussianSumFilter/IGsfSmoother.h       |   3 +-
 .../IMaterialMixtureConvolution.h             |   4 +
 .../IMultiStateExtrapolator.h                 |  75 ++-
 .../IMultiStateMaterialEffects.h              |  16 +
 .../MultiComponentStateCombiner.h             |  20 +
 .../src/ForwardGsfFitter.cxx                  |  10 +
 .../src/GaussianSumFitter.cxx                 |  60 ++-
 .../src/GsfCombinedMaterialEffects.cxx        |   3 +-
 .../src/GsfExtrapolator.cxx                   |  34 +-
 .../src/GsfMaterialEffectsUpdator.cxx         |   8 +-
 .../src/GsfMaterialMixtureConvolution.cxx     |  10 +-
 .../src/GsfMaterialMixtureConvolutionLM.cxx   | 503 ++++++++++++++++++
 .../src/GsfMeasurementUpdator.cxx             |  13 +-
 .../TrkGaussianSumFilter/src/GsfSmoother.cxx  |   2 +
 .../src/MultiComponentStateCombiner.cxx       | 124 +++--
 .../src/MultiComponentStateModeCalculator.cxx |  31 +-
 .../TrkGaussianSumFilter_entries.cxx          |   2 +
 .../src/TruthTrackBuilder.cxx                 |   6 +-
 30 files changed, 1015 insertions(+), 187 deletions(-)
 create mode 100644 Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h
 create mode 100644 Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolutionLM.cxx

diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 433a8c7a9ed6..99383e9fc469 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -654,8 +654,8 @@ def getInDetGsfMaterialUpdator(name='InDetGsfMaterialUpdator', **kwargs) :
     if 'MaximumNumberOfComponents' not in kwargs :
         kwargs=setDefaults(kwargs, MaximumNumberOfComponents = 12)
 
-    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMaterialMixtureConvolution
-    return Trk__GsfMaterialMixtureConvolution (name = the_name, **kwargs)
+    from TrkGaussianSumFilter.TrkGaussianSumFilterConf import Trk__GsfMaterialMixtureConvolutionLM
+    return Trk__GsfMaterialMixtureConvolutionLM (name = the_name, **kwargs)
 
 
 @makePublicTool
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
index 7987f21044b4..38558de3029b 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
@@ -928,19 +928,20 @@ else:
 #        InDetTruthTrackCreation.OutputLevel = VERBOSE
         topSequence += InDetTruthTrackCreation
 
-        # --- add the truth to the truth tracks ;-)
-        include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
-        InDetTracksTruth = ConfiguredInDetTrackTruth(InDetKeys.PseudoTracks(),
+        if  InDetFlags.doSplitReco() :
+          # --- add the truth to the truth tracks ;-)
+          include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
+          InDetTracksTruth = ConfiguredInDetTrackTruth(InDetKeys.PseudoTracks(),
                                                      InDetKeys.PseudoDetailedTracksTruth(),
                                                      InDetKeys.PseudoTracksTruth(),
                                                      PixelClusterTruth,
                                                      SCT_ClusterTruth,
                                                      TRT_DriftCircleTruth)
 
-        from TrkTruthToTrack.TrkTruthToTrackConf import Trk__TruthToTrack
-        InDetTruthToTrack  = Trk__TruthToTrack(name         = "InDetTruthToTrack",
+          from TrkTruthToTrack.TrkTruthToTrackConf import Trk__TruthToTrack
+          InDetTruthToTrack  = Trk__TruthToTrack(name         = "InDetTruthToTrack",
                                                Extrapolator = TrackingCommon.getInDetExtrapolator())
-        ToolSvc += InDetTruthToTrack
+          ToolSvc += InDetTruthToTrack
     
         # Register the track collections for further processing - only if new tracking has not been running
         if not InDetFlags.doNewTracking():
diff --git a/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_TruthTrajectorySelectorID.cxx b/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_TruthTrajectorySelectorID.cxx
index 80e7bb29a1c0..b3ab20ab83ed 100644
--- a/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_TruthTrajectorySelectorID.cxx
+++ b/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_TruthTrajectorySelectorID.cxx
@@ -140,16 +140,24 @@ bool InDet::PRD_TruthTrajectorySelectorID::pass( const Trk::PRD_TruthTrajectory
   for ( int i = 0; i  < 3 &&  prdIter != prdIterE; ++ prdIter ){
     if( m_atlasId->is_pixel((*prdIter)->identify()) ){
       const InDet::PixelCluster* pixclus=dynamic_cast<const InDet::PixelCluster*>(*prdIter);
-      if (pixclus) pos.push_back (pixclus->globalPosition());
+      if (pixclus) {
+        if(!pos.empty() && (pos.back()-pixclus->globalPosition()).squaredNorm() < 9)
+          continue;
+        pos.push_back (pixclus->globalPosition());
+      }
     }
     else if( m_atlasId->is_sct((*prdIter)->identify()) ){
-            const InDet::SCT_Cluster* sctclus=dynamic_cast<const InDet::SCT_Cluster*>(*prdIter);
-            if (sctclus) pos.push_back (sctclus->globalPosition());
+      const InDet::SCT_Cluster* sctclus=dynamic_cast<const InDet::SCT_Cluster*>(*prdIter);
+      if (sctclus) { 
+        if(!pos.empty() && (pos.back()-sctclus->globalPosition()).squaredNorm() < 9)
+          continue;
+        pos.push_back (sctclus->globalPosition());
+      }
     }
     else if( m_atlasId->is_trt((*prdIter)->identify()) ){
-            continue;
+      continue;
     }
-  i++;
+    i++;
   }
 
   // only take trajectory if enough hits
diff --git a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
index da9368ef829a..e4188ae5d879 100644
--- a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
+++ b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
@@ -32,9 +32,9 @@ def getGSFTrackFitter():
 
     # Set up the GSF
     from TrkGaussianSumFilter.TrkGaussianSumFilterConf import (
-        Trk__GsfMaterialMixtureConvolution)
+        Trk__GsfMaterialMixtureConvolutionLM)
 
-    GsfMaterialUpdator = Trk__GsfMaterialMixtureConvolution(name='GsfMaterialUpdator',MaximumNumberOfComponents=12)
+    GsfMaterialUpdator = Trk__GsfMaterialMixtureConvolutionLM(name='GsfMaterialUpdator',MaximumNumberOfComponents=12)
 
     from TrkGaussianSumFilter.TrkGaussianSumFilterConf import (
         Trk__GsfExtrapolator)
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h
index 5809bbd07bca..a833fe39d9a1 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h
@@ -61,6 +61,12 @@ public:
   /// size of allocated buffer
   std::size_t size() const noexcept;
 
+
+  typedef T* iterator;
+  typedef const T* const_iterator;
+  iterator begin() { return &m_buffer[0]; }
+  iterator end() { return &m_buffer[m_size]; }
+
 private:
   void cleanup() noexcept;
   T* m_buffer = nullptr;
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h
index 38c10489cb58..c7c912a05008 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h
@@ -15,6 +15,7 @@
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 #include "TrkFitterUtils/FitterTypes.h"
 #include "TrkGaussianSumFilter/IForwardGsfFitter.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
 #include "TrkParameters/TrackParameters.h"
 
@@ -24,7 +25,6 @@
 namespace Trk {
 
 class IMultiStateMeasurementUpdator;
-class IMultiStateExtrapolator;
 class IRIO_OnTrackCreator;
 class Surface;
 
@@ -58,6 +58,7 @@ public:
   /** Forward GSF fit using PrepRawData */
   virtual std::unique_ptr<ForwardTrajectory> fitPRD(
     const EventContext& ctx,
+    IMultiStateExtrapolator::Cache&, 
     const PrepRawDataSet&,
     const TrackParameters&,
     const ParticleHypothesis particleHypothesis =
@@ -66,6 +67,7 @@ public:
   /** Forward GSF fit using MeasurementSet */
   virtual std::unique_ptr<ForwardTrajectory> fitMeasurements(
     const EventContext& ctx,
+    IMultiStateExtrapolator::Cache&, 
     const MeasurementSet&,
     const TrackParameters&,
     const ParticleHypothesis particleHypothesis =
@@ -78,6 +80,7 @@ private:
   /** Progress one step along the fit */
   bool stepForwardFit(
     const EventContext& ctx,
+    IMultiStateExtrapolator::Cache&, 
     ForwardTrajectory*,
     const PrepRawData*,
     const MeasurementBase*,
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
index 160dcea5aa5e..6fc9d21ce6e9 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h
@@ -12,6 +12,7 @@
 #include "TrkEventPrimitives/PropDirection.h"
 #include "TrkEventUtils/TrkParametersComparisonFunction.h"
 #include "TrkFitterInterfaces/ITrackFitter.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h" 
 #include "TrkFitterUtils/FitterTypes.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkFitterUtils/TrackFitInputPreparator.h"
@@ -28,7 +29,6 @@
 namespace Trk {
 class IMultiStateMeasurementUpdator;
 class MultiComponentStateOnSurface;
-class IMultiStateExtrapolator;
 class IForwardGsfFitter;
 class IGsfSmoother;
 class FitQuality;
@@ -115,6 +115,7 @@ private:
   /** Produces a perigee from a smoothed trajectory */
   const MultiComponentStateOnSurface* makePerigee(
     const EventContext& ctx,
+    Trk::IMultiStateExtrapolator::Cache&,
     const SmoothedTrajectory*,
     const ParticleHypothesis particleHypothesis = nonInteracting) const;
 
@@ -150,7 +151,14 @@ private:
                                           "GsfSmoother",
                                           "Trk::GsfSmoother/GsfSmoother",
                                           "" };
-
+  
+  Gaudi::Property<bool> m_StoreMCSOS{
+    this,
+    "StoreMCSOS",
+    false,
+    "Store multicomponent state or single state in final trajectory"
+  };
+ 
   bool m_reintegrateOutliers;
   bool m_makePerigee;
   bool m_refitOnMeasurementBase;
@@ -173,6 +181,10 @@ private:
   mutable std::atomic<int> m_PerigeeFailure;
   // Number of Tracks that fail fit Quailty test
   mutable std::atomic<int> m_fitQualityFailure;
+  // Number of Tracks that are successfull
+  mutable std::atomic<int> m_fitSuccess;
+
+
 };
 
 } // end Trk namespace
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h
index 350e84992f3e..8db31e2430a3 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfExtrapolator.h
@@ -19,6 +19,7 @@
 #include "TrkExInterfaces/INavigator.h"
 #include "TrkExInterfaces/IPropagator.h"
 #include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
+#include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h"
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/IChronoStatSvc.h"
@@ -45,37 +46,6 @@ class MaterialProperties;
 class IMultiComponentStateMerger;
 class IMaterialMixtureConvolution;
 class IMultipleScatteringUpdator;
-/** @struct StateAtBoundarySurface
-  - Structure to contain information about a state at the interface between
-  tracking volumes
-  */
-
-struct StateAtBoundarySurface
-{
-
-  /** Data members */
-  const MultiComponentState* stateAtBoundary;
-  const TrackParameters* navigationParameters;
-  const TrackingVolume* trackingVolume;
-
-  /** Default constructor  */
-  StateAtBoundarySurface()
-    : stateAtBoundary(nullptr)
-    , navigationParameters(nullptr)
-    , trackingVolume(nullptr)
-  {}
-
-  /** Update State at Boundary Surface Information */
-  void updateBoundaryInformation(const MultiComponentState* boundaryState,
-                                 const TrackParameters* navParameters,
-                                 const TrackingVolume* nextVolume)
-  {
-    stateAtBoundary = boundaryState;
-    navigationParameters = navParameters;
-    trackingVolume = nextVolume;
-  }
-};
-
 /** @class GsfExtrapolator */
 
 class GsfExtrapolator
@@ -99,6 +69,7 @@ public:
   /** Configured AlgTool extrapolation method (1) */
   virtual MultiComponentState extrapolate(
     const EventContext& ctx,
+    Cache&,
     const MultiComponentState&,
     const Surface&,
     PropDirection direction = anyDirection,
@@ -125,33 +96,6 @@ public:
                ParticleHypothesis particle) const override final;
 
 private:
-  struct Cache
-  {
-    bool m_recall;                  //!< Flag the recall solution
-    const Surface* m_recallSurface; //!< Surface for recall
-    const Layer* m_recallLayer;     //!< Layer for recall
-    const TrackingVolume*
-      m_recallTrackingVolume; //!< Tracking volume for recall
-    StateAtBoundarySurface
-      m_stateAtBoundarySurface; //!< Instance of structure describing the state
-                                //!< at a boundary of tracking volumes
-    std::unique_ptr<std::vector<const Trk::TrackStateOnSurface*>> m_matstates;
-    std::vector<std::unique_ptr<const MultiComponentState>>
-      m_mcsGarbageBin; //!< Garbage bin for MultiComponentState objects
-    std::vector<std::unique_ptr<const TrackParameters>>
-      m_tpGarbageBin; //!< Garbage bin for TrackParameter objects
-
-    Cache()
-      : m_recall(false)
-      , m_recallSurface(nullptr)
-      , m_recallLayer(nullptr)
-      , m_recallTrackingVolume(nullptr)
-      , m_stateAtBoundarySurface()
-      , m_matstates(nullptr)
-      , m_mcsGarbageBin()
-      , m_tpGarbageBin()
-    {}
-  };
 
   /** These are the methods that do the actual heavy lifting when extrapolating
    * with a cache */
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
index 0c32a8a0c662..65d4e5296cd1 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h
@@ -44,21 +44,24 @@ public:
   virtual StatusCode finalize() override;
 
   //!< Convolution with full material properties
-  virtual MultiComponentState update(const MultiComponentState&,
+  virtual MultiComponentState update(std::vector<Trk::IMultiStateMaterialEffects::Cache>&, 
+                                     const MultiComponentState&,
                                      const Layer&,
                                      PropDirection direction = anyDirection,
                                      ParticleHypothesis particleHypothesis =
                                        nonInteracting) const override final;
 
   //!< Convolution with pre-measurement-update material properties
-  virtual MultiComponentState preUpdate(const MultiComponentState&,
+  virtual MultiComponentState preUpdate(std::vector<Trk::IMultiStateMaterialEffects::Cache>&, 
+                                        const MultiComponentState&,
                                         const Layer&,
                                         PropDirection direction = anyDirection,
                                         ParticleHypothesis particleHypothesis =
                                           nonInteracting) const override final;
 
   //!< Convolution with post-measurement-update material properties
-  virtual MultiComponentState postUpdate(const MultiComponentState&,
+  virtual MultiComponentState postUpdate(std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
+                                         const MultiComponentState&,
                                          const Layer&,
                                          PropDirection direction = anyDirection,
                                          ParticleHypothesis particleHypothesis =
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h
new file mode 100644
index 000000000000..4611856669cd
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h
@@ -0,0 +1,138 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @file   GsfMaterialMixtureConvolutionLM.h
+ * @date   Thursday 7th September 2006
+ * @author Tom Athkinson, Anthony Morley, Christos Anastopoulos
+ * @brief Class description for convolution of GSF material mixture 
+ */
+
+#ifndef TrkGsfMaterialMixtureConvolutionLM_H
+#define TrkGsfMaterialMixtureConvolutionLM_H
+
+#include "TrkGaussianSumFilter/IMaterialMixtureConvolution.h"
+#include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+
+namespace Trk {
+
+class IMultiStateMaterialEffectsUpdator;
+class IMultiStateMaterialEffects;
+class Layer;
+class MaterialProperties;
+
+class GsfMaterialMixtureConvolutionLM
+  : public AthAlgTool
+  , virtual public IMaterialMixtureConvolution
+{
+
+public:
+  
+  enum MaterialUpdateType{ Normal = 0, Preupdate=1, Postupdate=2 }; 
+
+  //!< Constructor with AlgTool parameters
+  GsfMaterialMixtureConvolutionLM(const std::string&,
+                                const std::string&,
+                                const IInterface*);
+
+  //!< Destructor
+  virtual ~GsfMaterialMixtureConvolutionLM();
+
+  //!< AlgTool initialise method
+  virtual StatusCode initialize() override;
+
+  //!< AlgTool finalize method
+  virtual StatusCode finalize() override;
+
+  //!< Convolution with full material properties
+  virtual MultiComponentState update(std::vector<Trk::IMultiStateMaterialEffects::Cache>&,  
+                                     const MultiComponentState&,
+                                     const Layer&,
+                                     PropDirection direction = anyDirection,
+                                     ParticleHypothesis particleHypothesis =
+                                       nonInteracting) const override final;
+
+  //!< Convolution with pre-measurement-update material properties
+  virtual MultiComponentState preUpdate(std::vector<Trk::IMultiStateMaterialEffects::Cache>&, 
+                                        const MultiComponentState&,
+                                        const Layer&,
+                                        PropDirection direction = anyDirection,
+                                        ParticleHypothesis particleHypothesis =
+                                          nonInteracting) const override final;
+
+  //!< Convolution with post-measurement-update material properties
+  virtual MultiComponentState postUpdate(std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
+                                         const MultiComponentState&,
+                                         const Layer&,
+                                         PropDirection direction = anyDirection,
+                                         ParticleHypothesis particleHypothesis =
+                                           nonInteracting) const override final;
+
+  //!< Retain for now redundant simplified material effects
+  virtual MultiComponentState simplifiedMaterialUpdate(
+    const MultiComponentState& ,
+    PropDirection,
+    ParticleHypothesis) const override final { return {}; };
+
+
+ private:
+  Gaudi::Property<unsigned int> m_maximumNumberOfComponents{
+    this,
+    "MaximumNumberOfComponents",
+    12,
+    "Maximum number of components"
+  };
+
+  ToolHandle<IMultiStateMaterialEffectsUpdator> m_updator{
+    this,
+    "MaterialEffectsUpdator",
+    "Trk::GsfMaterialEffectsUpdator/GsfMaterialEffectsUpdator",
+    ""
+  };
+
+  ToolHandle<IMultiStateMaterialEffects> m_materialEffects{
+    this,
+    "MaterialEffects",
+    "Trk::GsfCombinedMaterialEffects/GsfCombinedMaterialEffects",
+    ""
+  };
+  
+  Gaudi::Property<bool> m_useReferenceMaterial{
+    this,
+    "UseReferenceMaterial",
+    false,
+    ""
+  };
+  
+  Gaudi::Property<double> m_momentumCut{
+    this,
+    "MinimalMomentum",
+    250. * Gaudi::Units::MeV,
+    ""
+  };
+
+
+  Trk::MultiComponentState update(
+    std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
+    const Trk::MultiComponentState& inputState,
+    const Trk::Layer& layer,
+    Trk::PropDirection direction,
+    Trk::ParticleHypothesis particleHypothesis,
+    MaterialUpdateType  updateType) const;
+ 
+  bool updateP(double& qOverP,  double deltaP) const;
+  
+  std::pair< const Trk::MaterialProperties*, double >  getMaterialProperties( 
+    const Trk::TrackParameters* trackParameters,
+    const Trk::Layer& layer ) const;
+ 
+
+};
+
+} // end Trk namespace
+
+#endif
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfSmoother.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfSmoother.h
index f7a363901c46..615054c82b7f 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfSmoother.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfSmoother.h
@@ -54,6 +54,7 @@ public:
   /** Gsf smoother method */
   virtual SmoothedTrajectory* fit(
     const EventContext& ctx,
+    Trk::IMultiStateExtrapolator::Cache&,
     const ForwardTrajectory&,
     const ParticleHypothesis particleHypothesis = nonInteracting,
     const CaloCluster_OnTrack* ccot = nullptr) const;
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h
index ebc4bbd4c791..f514deb5402b 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h
@@ -18,6 +18,7 @@
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 #include "TrkFitterUtils/FitterTypes.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h"
 #include "TrkParameters/TrackParameters.h"
 #include "GaudiKernel/EventContext.h"
 
@@ -25,7 +26,6 @@
 namespace Trk {
 
 class IMultiStateMeasurementUpdator;
-class IMultiStateExtrapolator;
 class IRIO_OnTrackCreator;
 class Surface;
 
@@ -56,6 +56,7 @@ public:
   /** Forward GSF fit using PrepRawData */
   virtual std::unique_ptr<ForwardTrajectory> fitPRD(
     const EventContext& ctx,
+    Trk::IMultiStateExtrapolator::Cache&,
     const PrepRawDataSet&,
     const TrackParameters&,
     const ParticleHypothesis particleHypothesis = nonInteracting) const = 0;
@@ -63,6 +64,7 @@ public:
   /** Forward GSF fit using MeasurementSet */
   virtual std::unique_ptr<ForwardTrajectory> fitMeasurements(
     const EventContext& ctx,
+    Trk::IMultiStateExtrapolator::Cache&,
     const MeasurementSet&,
     const TrackParameters&,
     const ParticleHypothesis particleHypothesis = nonInteracting) const = 0;
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IGsfSmoother.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IGsfSmoother.h
index 2dbf97f0af0f..11ae1e16db27 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IGsfSmoother.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IGsfSmoother.h
@@ -15,6 +15,7 @@
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 #include "TrkFitterUtils/FitterTypes.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+#include "TrkGaussianSumFilter/IMultiStateExtrapolator.h" 
 
 #include "GaudiKernel/EventContext.h"
 #include "GaudiKernel/IAlgTool.h"
@@ -23,7 +24,6 @@
 namespace Trk {
 
 class IMultiStateMeasurementUpdator;
-class IMultiStateExtrapolator;
 class CaloCluster_OnTrack;
 
 static const InterfaceID InterfaceID_GsfSmoother("GsfSmoother", 1, 0);
@@ -48,6 +48,7 @@ public:
   /** Gsf smoother method */
   virtual SmoothedTrajectory* fit(
     const EventContext& ctx,
+    Trk::IMultiStateExtrapolator::Cache&,
     const ForwardTrajectory&,
     const ParticleHypothesis particleHypothesis = nonInteracting,
     const CaloCluster_OnTrack* ccot = nullptr) const = 0;
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMaterialMixtureConvolution.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMaterialMixtureConvolution.h
index 10aa90246091..469b19c66019 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMaterialMixtureConvolution.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMaterialMixtureConvolution.h
@@ -16,6 +16,7 @@
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 #include "TrkEventPrimitives/PropDirection.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+#include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h"
 
 namespace Trk {
 class Layer;
@@ -37,6 +38,7 @@ public:
 
   //!< Convolution with full material properties
   virtual MultiComponentState update(
+    std::vector<Trk::IMultiStateMaterialEffects::Cache>&, 
     const MultiComponentState&,
     const Layer&,
     PropDirection direction = anyDirection,
@@ -44,6 +46,7 @@ public:
 
   //!< Convolution with pre-measurement-update material properties
   virtual MultiComponentState preUpdate(
+    std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
     const MultiComponentState&,
     const Layer&,
     PropDirection direction = anyDirection,
@@ -51,6 +54,7 @@ public:
 
   //!< Convolution with post-measurement-update material properties
   virtual MultiComponentState postUpdate(
+    std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
     const MultiComponentState&,
     const Layer&,
     PropDirection direction = anyDirection,
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateExtrapolator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateExtrapolator.h
index 42d6af11468a..d7e0a75b1461 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateExtrapolator.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateExtrapolator.h
@@ -14,6 +14,7 @@
 #define TrkIMultiStateExtrapolator_H
 
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+#include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h"
 
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 #include "TrkEventPrimitives/PropDirection.h"
@@ -35,6 +36,32 @@ class Track;
 class TrackingVolume;
 class TrackStateOnSurface;
 
+/** @struct StateAtBoundarySurface
+  - Structure to contain information about a state at the interface between
+  tracking volumes
+  */
+
+struct StateAtBoundarySurface
+{
+
+  /** Data members */
+  const MultiComponentState* stateAtBoundary = nullptr;
+  const TrackParameters* navigationParameters = nullptr;
+  const TrackingVolume* trackingVolume = nullptr;
+
+
+  /** Update State at Boundary Surface Information */
+  void updateBoundaryInformation(const MultiComponentState* boundaryState,
+                                 const TrackParameters* navParameters,
+                                 const TrackingVolume* nextVolume)
+  {
+    stateAtBoundary = boundaryState;
+    navigationParameters = navParameters;
+    trackingVolume = nextVolume;
+  }
+};
+
+
 static const InterfaceID IID_IMultiStateExtrapolator("IMultiStateExtrapolator",
                                                      1,
                                                      0);
@@ -42,7 +69,52 @@ static const InterfaceID IID_IMultiStateExtrapolator("IMultiStateExtrapolator",
 class IMultiStateExtrapolator : virtual public IAlgTool
 {
 public:
-  /** Virtual destructor */
+  /** @brief MultiStateExtrapolator cache class.
+   *  This object holds information regarding the state of the extrpolation process 
+   *  as well as a large store for  material effects properties.
+   *  
+   *  The is owned by the tools that call the extrapolatator (Currently the GSFSmoother or Forward fitter)
+   *  and it not exposed to the caller of the track fitter.
+   *                 */
+  struct Cache
+  {
+    bool  m_recall = false;                   //!< Flag the recall solution
+    const Surface* m_recallSurface = nullptr; //!< Surface for recall
+    const Layer* m_recallLayer = nullptr;     //!< Layer for recall
+    const TrackingVolume*
+      m_recallTrackingVolume = nullptr; //!< Tracking volume for recall
+    StateAtBoundarySurface
+      m_stateAtBoundarySurface; //!< Instance of structure describing the state
+                                //!< at a boundary of tracking volumes
+    std::unique_ptr<std::vector<const Trk::TrackStateOnSurface*>> m_matstates;
+    std::vector<std::unique_ptr<const MultiComponentState>>
+      m_mcsGarbageBin; //!< Garbage bin for MultiComponentState objects
+    std::vector<std::unique_ptr<const TrackParameters>>
+      m_tpGarbageBin; //!< Garbage bin for TrackParameter objects
+
+    std::vector<Trk::IMultiStateMaterialEffects::Cache> 
+      m_materialEffectsCaches; //!<  Large cache for material effects
+
+
+    Cache()
+    {
+      m_materialEffectsCaches.reserve(72);
+    }
+
+    void reset(){
+      m_recall = false;
+      m_recallSurface = nullptr;
+      m_recallLayer = nullptr;
+      m_recallTrackingVolume = nullptr;
+      m_matstates.reset(nullptr);
+      m_stateAtBoundarySurface.updateBoundaryInformation(nullptr,nullptr,nullptr);
+      m_mcsGarbageBin.clear();
+      m_tpGarbageBin.clear();
+      m_materialEffectsCaches.clear();
+    };
+  };
+ 
+ /** Virtual destructor */
   virtual ~IMultiStateExtrapolator() = default;
 
   /** AlgTool interface method */
@@ -54,6 +126,7 @@ public:
   /** Configured AlgTool extrapolation method (1) */
   virtual MultiComponentState extrapolate(
     const EventContext& ctx,
+    Cache&,
     const MultiComponentState&,
     const Surface&,
     PropDirection direction = anyDirection,
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMaterialEffects.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMaterialEffects.h
index 1d235b978b8d..870ee67246dd 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMaterialEffects.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMaterialEffects.h
@@ -44,6 +44,7 @@ public:
     {
       weights.reserve(6);
       deltaPs.reserve(6);
+      deltaParameters.reserve(6);
       deltaCovariances.reserve(6);
     }
     Cache(Cache&&) = default;
@@ -60,14 +61,29 @@ public:
      * "you must use the Eigen::aligned_allocator (not another aligned
      * allocator), and #include <Eigen/StdVector>."
      */
+    std::vector<AmgVector(5),Eigen::aligned_allocator<AmgVector(5)>>
+      deltaParameters;
     std::vector<AmgSymMatrix(5), Eigen::aligned_allocator<AmgSymMatrix(5)>>
       deltaCovariances;
     void reset()
     {
       weights.clear();
       deltaPs.clear();
+      deltaParameters.clear();
       deltaCovariances.clear();
     }
+    void resetAndAddDummyValues()
+    {
+      reset();
+      weights.push_back(1);
+      deltaPs.push_back(0);
+      AmgVector(5) newParameters;
+      newParameters.setZero();
+      deltaParameters.push_back( std::move(newParameters) );
+      AmgSymMatrix(5) newCovarianceMatrix;
+      newCovarianceMatrix.setZero();
+      deltaCovariances.push_back( std::move(newCovarianceMatrix) );
+    }
   };
 
   /** Alg tool and IAlgTool interface method */
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateCombiner.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateCombiner.h
index d18a5aee90fa..95cd0d23d8a8 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateCombiner.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/MultiComponentStateCombiner.h
@@ -31,6 +31,26 @@ void
 combineWithWeight(Trk::ComponentParameters& mergeTo,
                   const Trk::ComponentParameters& addThis);
 
+/** @brief Combined/merge a component to the parts of another */  
+void 
+combineWithWeight( Trk::ComponentParameters& mergeTo,
+                   const AmgVector(5)& secondParameters, 
+                   const AmgSymMatrix(5)* secondMeasuredCov,
+                   const double secondWeight );
+
+
+/** @brief Update first parameters */
+void combineParametersWithWeight(
+  AmgVector(5)& firstParameters, double& firstWeight,
+  const AmgVector(5)& secondParameters, const double secondWeight );
+
+/** @brief Update cov matrix */
+void combineCovWithWeight(
+  const AmgVector(5)& firstParameters, AmgSymMatrix(5)& firstMeasuredCov, const double firstWeight,
+  const AmgVector(5)& secondParameters, const AmgSymMatrix(5)& secondMeasuredCov, const double secondWeight );
+
+
+
 /** @brief Calculate combined state and weight of many components */
 std::unique_ptr<Trk::ComponentParameters>
 combineWithWeight(const MultiComponentState&,
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx
index 12ab02457be4..f317764a29d4 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx
@@ -91,6 +91,7 @@ Trk::ForwardGsfFitter::configureTools(
 std::unique_ptr<Trk::ForwardTrajectory>
 Trk::ForwardGsfFitter::fitPRD(
   const EventContext& ctx,
+  Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
   const Trk::PrepRawDataSet& inputPrepRawDataSet,
   const Trk::TrackParameters& estimatedTrackParametersNearOrigin,
   const Trk::ParticleHypothesis particleHypothesis) const
@@ -149,6 +150,7 @@ Trk::ForwardGsfFitter::fitPRD(
     // stepForwardFit method is updated
     bool stepIsValid = stepForwardFit(
       ctx,
+      extrapolatorCache,
       forwardTrajectory.get(),
       *prepRawData,
       nullptr,
@@ -172,6 +174,7 @@ Trk::ForwardGsfFitter::fitPRD(
 std::unique_ptr<Trk::ForwardTrajectory>
 Trk::ForwardGsfFitter::fitMeasurements(
   const EventContext& ctx,
+  Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
   const Trk::MeasurementSet& inputMeasurementSet,
   const Trk::TrackParameters& estimatedTrackParametersNearOrigin,
   const Trk::ParticleHypothesis particleHypothesis) const
@@ -230,6 +233,7 @@ Trk::ForwardGsfFitter::fitMeasurements(
   for (; measurement != inputMeasurementSet.end(); ++measurement) {
 
     bool stepIsValid = stepForwardFit(ctx,
+                                      extrapolatorCache,
                                       forwardTrajectory.get(),
                                       nullptr,
                                       *measurement,
@@ -252,6 +256,7 @@ Trk::ForwardGsfFitter::fitMeasurements(
 bool
 Trk::ForwardGsfFitter::stepForwardFit(
   const EventContext& ctx,
+  Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
   ForwardTrajectory* forwardTrajectory,
   const Trk::PrepRawData* originalPrepRawData,
   const Trk::MeasurementBase* originalMeasurement,
@@ -276,6 +281,7 @@ Trk::ForwardGsfFitter::stepForwardFit(
   // =================================================================
   Trk::MultiComponentState extrapolatedState =
     m_extrapolator->extrapolate(ctx,
+                                extrapolatorCache,
                                 updatedState,
                                 surface,
                                 Trk::alongMomentum,
@@ -284,6 +290,8 @@ Trk::ForwardGsfFitter::stepForwardFit(
   if (extrapolatedState.empty()) {
     ATH_MSG_DEBUG("Extrapolation failed... returning false");
     return false;
+  } else {
+    ATH_MSG_DEBUG("Extrapolation worked... state size: "<< extrapolatedState.size() );
   }
   // =======================
   // Measurement Preparation
@@ -321,6 +329,8 @@ Trk::ForwardGsfFitter::stepForwardFit(
   if (updatedState.empty()) {
     ATH_MSG_DEBUG("Measurement update of the state failed... Exiting!");
     return false;
+  } else {
+    ATH_MSG_DEBUG("Measurement update of the state worked : " << updatedState.size() );
   }
   // Bail if the fit quality is not defined:
   if (!fitQuality) {
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
index 618c26e733a1..b2654163bd48 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx
@@ -55,6 +55,7 @@ Trk::GaussianSumFitter::GaussianSumFitter(const std::string& type,
   , m_SmootherFailure{ 0 }
   , m_PerigeeFailure{ 0 }
   , m_fitQualityFailure{ 0 }
+  , m_fitSuccess{ 0 }
 {
 
   declareInterface<ITrackFitter>(this);
@@ -162,6 +163,8 @@ Trk::GaussianSumFitter::finalize()
     << "Number of MakePerigee Failures:           " << m_PerigeeFailure << '\n'
     << "Number of Trks that fail fitquality test: " << m_fitQualityFailure
     << '\n'
+    << "Number of successful fits:                " << m_fitSuccess << '\n'
+    << '\n'
     << "-----------------------------------------------" << '\n'
     << "Finalisation of " << name() << " was successful");
   return StatusCode::SUCCESS;
@@ -323,11 +326,15 @@ Trk::GaussianSumFitter::fit(
               sortedPrepRawDataSet.end(),
               prdComparisonFunction);
   }
+  // Create Extrapolator cache that holds material effects cache;
+  Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
+
 
   // Perform GSF forwards fit
   ForwardTrajectory* forwardTrajectory =
     m_forwardGsfFitter
       ->fitPRD(ctx,
+               extrapolatorCache,
                sortedPrepRawDataSet,
                estimatedParametersNearOrigin,
                particleHypothesis)
@@ -348,7 +355,7 @@ Trk::GaussianSumFitter::fit(
 
   // Perform GSF smoother operation
   SmoothedTrajectory* smoothedTrajectory =
-    m_gsfSmoother->fit(ctx,*forwardTrajectory, particleHypothesis);
+    m_gsfSmoother->fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
@@ -370,7 +377,7 @@ Trk::GaussianSumFitter::fit(
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
-      this->makePerigee(ctx,smoothedTrajectory, particleHypothesis);
+      makePerigee(ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
     if (perigeeMultiStateOnSurface) {
@@ -389,11 +396,28 @@ Trk::GaussianSumFitter::fit(
   delete forwardTrajectory;
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
+  
+  // Store only TSOS in tracks instead of MCSOS
+  if( !m_StoreMCSOS ){
+    auto slimmedSmoothedTrajectory = std::make_unique<Trk::SmoothedTrajectory>();
+    for( const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory ){
+      slimmedSmoothedTrajectory->push_back( new Trk::TrackStateOnSurface( *tsos ) );
+    }
+    delete smoothedTrajectory;
+    // Create new track
+    Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
+    info.setTrackProperties(TrackInfo::BremFit);
+    info.setTrackProperties(TrackInfo::BremFitSuccessful);
+    ++m_fitSuccess;
+    return std::make_unique<Track>(info, slimmedSmoothedTrajectory.release(), fitQuality);
+  }
+
 
   // Create new track
   Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
+  ++m_fitSuccess;
   return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
 }
 
@@ -465,10 +489,17 @@ Trk::GaussianSumFitter::fit(
          measurementBaseComparisonFunction);
   }
 
+   
+  // Create Extrapolator cache that holds material effects cache;
+  Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
+
+
+
   // Perform GSF forwards fit - new memory allocated in forwards fitter
   ForwardTrajectory* forwardTrajectory =
     m_forwardGsfFitter
       ->fitMeasurements(ctx,
+                        extrapolatorCache,
                         sortedMeasurementSet,
                         estimatedParametersNearOrigin,
                         particleHypothesis)
@@ -490,7 +521,7 @@ Trk::GaussianSumFitter::fit(
   // Perform GSF smoother operation
 
   SmoothedTrajectory* smoothedTrajectory =
-    m_gsfSmoother->fit(ctx, *forwardTrajectory, particleHypothesis, ccot);
+    m_gsfSmoother->fit(ctx, extrapolatorCache, *forwardTrajectory, particleHypothesis, ccot);
 
   // Protect against failed smoother fit
   if (!smoothedTrajectory) {
@@ -513,7 +544,7 @@ Trk::GaussianSumFitter::fit(
 
   if (m_makePerigee) {
     const Trk::MultiComponentStateOnSurface* perigeeMultiStateOnSurface =
-      this->makePerigee(ctx,smoothedTrajectory, particleHypothesis);
+      makePerigee(ctx, extrapolatorCache, smoothedTrajectory, particleHypothesis);
     ATH_MSG_DEBUG(
       "perigeeMultiStateOnSurface  :" << perigeeMultiStateOnSurface);
 
@@ -535,10 +566,27 @@ Trk::GaussianSumFitter::fit(
   // Reverse the order of the TSOS's to make be order flow from inside to out
   std::reverse(smoothedTrajectory->begin(), smoothedTrajectory->end());
 
+
+  // Store only TSOS in tracks instead of MCSOS
+  if( !m_StoreMCSOS ){
+    auto slimmedSmoothedTrajectory = std::make_unique<Trk::SmoothedTrajectory>();
+    for( const Trk::TrackStateOnSurface* tsos : *smoothedTrajectory ){
+      slimmedSmoothedTrajectory->push_back( new Trk::TrackStateOnSurface(*tsos) );
+    }
+    delete smoothedTrajectory;
+    // Create new track
+    Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
+    info.setTrackProperties(TrackInfo::BremFit);
+    info.setTrackProperties(TrackInfo::BremFitSuccessful);
+    ++m_fitSuccess;
+    return std::make_unique<Track>(info, slimmedSmoothedTrajectory.release(), fitQuality);
+  }
+
   // Create new track
   Trk::TrackInfo info(Trk::TrackInfo::GaussianSumFilter, particleHypothesis);
   info.setTrackProperties(TrackInfo::BremFit);
   info.setTrackProperties(TrackInfo::BremFitSuccessful);
+  ++m_fitSuccess;
   return std::make_unique<Track>(info, smoothedTrajectory, fitQuality);
 }
 
@@ -698,6 +746,7 @@ Trk::GaussianSumFitter::fit(const EventContext& ctx,
 const Trk::MultiComponentStateOnSurface*
 Trk::GaussianSumFitter::makePerigee(
   const EventContext& ctx,
+  Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
   const Trk::SmoothedTrajectory* smoothedTrajectory,
   const Trk::ParticleHypothesis particleHypothesis) const
 {
@@ -733,6 +782,7 @@ Trk::GaussianSumFitter::makePerigee(
   // Extrapolate to perigee, taking material effects considerations into account
   Trk::MultiComponentState stateExtrapolatedToPerigee =
     m_extrapolator->extrapolate(ctx,
+                                extrapolatorCache,
                                 *multiComponentState,
                                 perigeeSurface,
                                 m_directionToPerigee,
@@ -763,7 +813,7 @@ Trk::GaussianSumFitter::makePerigee(
     pattern(0);
   pattern.set(Trk::TrackStateOnSurface::Perigee);
 
-  if (fabs(combinedPerigee->parameters()[Trk::qOverP]) > 1e8) {
+  if (std::abs(combinedPerigee->parameters()[Trk::qOverP]) > 1e8) {
     // Protection against 0-momentum track .. this check should NEVER be needed.
     //actual cutoff is 0.01eV track
     ATH_MSG_ERROR(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx
index c5b2735ab753..b53ae153a282 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx
@@ -72,7 +72,7 @@ Trk::GsfCombinedMaterialEffects::compute(
   Trk::ParticleHypothesis particleHypothesis) const
 {
 
-  ATH_MSG_DEBUG("Computing combined material effects");
+  ATH_MSG_DEBUG("Computing combined material effects, P : " << componentParameters.first->momentum().norm() << " W " << componentParameters.second );
 
   // Reset everything before computation
   cache.reset();
@@ -163,7 +163,6 @@ Trk::GsfCombinedMaterialEffects::compute(
         (*multipleScatter_weightsIterator) * (*energyLoss_weightsIterator);
       double combinedDeltaP =
         (*multipleScatter_deltaPsIterator) + (*energyLoss_deltaPsIterator);
-
       cache.weights.push_back(combinedWeight);
       cache.deltaPs.push_back(combinedDeltaP);
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfExtrapolator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfExtrapolator.cxx
index 0dfb08aefafa..251154f86a89 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfExtrapolator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfExtrapolator.cxx
@@ -145,6 +145,7 @@ Trk::GsfExtrapolator::extrapolateImpl(
   const Trk::BoundaryCheck& boundaryCheck,
   Trk::ParticleHypothesis particleHypothesis) const
 {
+  ATH_MSG_DEBUG("Calling extrpolate: " << multiComponentState.size() );
   auto buff_extrapolateCalls = m_extrapolateCalls.buffer();
 
   // If the extrapolation is to be without material effects simply revert to the
@@ -312,7 +313,7 @@ Trk::GsfExtrapolator::extrapolateImpl(
     double revisedDistance =
       (referenceParameters->position() - newDestination).mag();
 
-    double distanceChange = fabs(revisedDistance - initialDistance);
+    double distanceChange = std::abs(revisedDistance - initialDistance);
 
     if (revisedDistance > initialDistance && distanceChange > 0.01) {
       ATH_MSG_DEBUG("Navigation break. Initial separation: "
@@ -432,6 +433,7 @@ Trk::GsfExtrapolator::extrapolateImpl(
     return {};
   }
   // After successful extrapolation return the state
+  ATH_MSG_DEBUG("extrapolateInsideVolume() successful:  " << destinationState.size() );
   return destinationState;
 }
 /*
@@ -469,17 +471,19 @@ Trk::GsfExtrapolator::extrapolateDirectlyImpl(
 Trk::MultiComponentState
 Trk::GsfExtrapolator::extrapolate(
   const EventContext& ctx,
+  Cache& cache,
   const Trk::MultiComponentState& multiComponentState,
   const Trk::Surface& surface,
   Trk::PropDirection direction,
   const Trk::BoundaryCheck& boundaryCheck,
   Trk::ParticleHypothesis particleHypothesis) const
 {
-  Cache cache{};
   if (multiComponentState.empty()) {
     ATH_MSG_DEBUG("MultiComponentState is empty...");
     return {};
   }
+  
+  cache.reset();
 
   // Set the propagator to that one corresponding to the configuration level
   const Trk::IPropagator* currentPropagator =
@@ -629,7 +633,7 @@ Trk::GsfExtrapolator::extrapolateToVolumeBoundary(
   else if (trackingVolume.confinedLayers() &&
            associatedLayer->layerMaterialProperties()) {
     Trk::MultiComponentState updatedState = m_materialUpdator->postUpdate(
-      *currentState, *layer, direction, particleHypothesis);
+      cache.m_materialEffectsCaches, *currentState, *layer, direction, particleHypothesis);
 
     if (!updatedState.empty()) {
       addMaterialtoVector(cache, layer, currentState->begin()->first.get());
@@ -752,7 +756,7 @@ Trk::GsfExtrapolator::extrapolateToVolumeBoundary(
         ATH_MSG_DEBUG("Boundary surface has material - updating properties");
         assert(currentState);
         matUpdatedState = m_materialUpdator->postUpdate(
-          *currentState, *layerAtBoundary, direction, particleHypothesis);
+          cache.m_materialEffectsCaches, *currentState, *layerAtBoundary, direction, particleHypothesis);
       }
     }
 
@@ -809,7 +813,7 @@ Trk::GsfExtrapolator::extrapolateInsideVolume(
 {
 
   ATH_MSG_DEBUG("GSF extrapolateInsideVolume() in tracking volume: "
-                << trackingVolume.volumeName());
+                << trackingVolume.volumeName()  << " with " << multiComponentState.size() << " components" );
 
   /*
    * We use current State to track where we are
@@ -856,7 +860,7 @@ Trk::GsfExtrapolator::extrapolateInsideVolume(
            associatedLayer->layerMaterialProperties()) {
 
     updatedState = m_materialUpdator->postUpdate(
-      *currentState, *associatedLayer, direction, particleHypothesis);
+      cache.m_materialEffectsCaches, *currentState, *associatedLayer, direction, particleHypothesis);
 
     if (!updatedState.empty()) {
       addMaterialtoVector(
@@ -1090,7 +1094,7 @@ Trk::GsfExtrapolator::extrapolateToIntermediateLayer(
      ------------------------------------- */
 
   Trk::MultiComponentState updatedState = m_materialUpdator->update(
-    destinationState, layer, direction, particleHypothesis);
+    cache.m_materialEffectsCaches, destinationState, layer, direction, particleHypothesis);
 
   if (updatedState.empty()) {
     return destinationState;
@@ -1166,9 +1170,11 @@ Trk::GsfExtrapolator::extrapolateToDestinationLayer(
   Trk::MultiComponentState updatedState{};
   if (startLayer != &layer) {
     updatedState = m_materialUpdator->preUpdate(
-      destinationState, layer, direction, particleHypothesis);
+      cache.m_materialEffectsCaches, destinationState, layer, direction, particleHypothesis);
   }
 
+  ATH_MSG_DEBUG( "State size after preUpdate: " << updatedState.size() );
+
   if (updatedState.empty()) {
     return destinationState;
   }
@@ -1201,7 +1207,7 @@ Trk::GsfExtrapolator::extrapolateSurfaceBasedMaterialEffects(
 
   // Check the multi-component state is populated
   if (multiComponentState.empty()) {
-    ATH_MSG_WARNING("Multi component state passed to extrapolateInsideVolume "
+    ATH_MSG_WARNING("Multi component state passed to extrapolateSurfaceBasedMaterialEffects "
                     "is not populated... returning 0");
     return {};
   }
@@ -1288,7 +1294,7 @@ Trk::GsfExtrapolator::multiStatePropagate(
   }
 
   ATH_MSG_DEBUG("GSF multiStatePropagate() propagated  "
-                << propagatedState.size() << "components");
+                << propagatedState.size() << " components");
   // Protect against empty propagation
   if (propagatedState.empty() || sumw < 0.1) {
     ATH_MSG_DEBUG("multiStatePropagate failed... ");
@@ -1320,7 +1326,7 @@ Trk::GsfExtrapolator::propagatorType(
   // field and material properties ST : the following check may fail as the dEdX
   // is often dummy for dense volumes - switch to rho or zOverAtimesRho ?
   unsigned int propagatorMode =
-    (magneticFieldMode > 1 && fabs(trackingVolume.dEdX) < 10e-2) ? 2 : 3;
+    (magneticFieldMode > 1 && std::abs(trackingVolume.dEdX) < 10e-2) ? 2 : 3;
 
   unsigned int returnType = (propagatorMode > m_propagatorConfigurationLevel)
                               ? m_propagatorConfigurationLevel
@@ -1352,7 +1358,7 @@ Trk::GsfExtrapolator::initialiseNavigation(
   Trk::PropDirection direction) const
 {
 
-  ATH_MSG_DEBUG("initialiseNavigation !!!");
+  ATH_MSG_DEBUG("initialiseNavigation !!! : " << multiComponentState.size() );
   // Empty the garbage bin
   ATH_MSG_DEBUG("Destination to surface [r,z] ["
                 << surface.center().perp() << ",\t" << surface.center().z()
@@ -1505,7 +1511,7 @@ Trk::GsfExtrapolator::addMaterialtoVector(Cache& cache,
 
     // Determine the pathCorrection if the material properties exist
     pathcorr = materialProperties
-                 ? 1. / fabs(surface->normal().dot(nextPar->momentum().unit()))
+                 ? 1. / std::abs(surface->normal().dot(nextPar->momentum().unit()))
                  : 0.;
   }
 
@@ -1527,7 +1533,7 @@ Trk::GsfExtrapolator::addMaterialtoVector(Cache& cache,
                      nextPar->position(), nextPar->momentum());
     double thick = pathcorr * materialProperties->thickness();
     double dInX0 = thick / materialProperties->x0();
-    double absP = 1 / fabs(nextPar->parameters()[Trk::qOverP]);
+    double absP = 1 / std::abs(nextPar->parameters()[Trk::qOverP]);
     double scatsigma = sqrt(
       m_msupdators->sigmaSquare(*materialProperties, absP, pathcorr, particle));
     Trk::ScatteringAngles* newsa = new Trk::ScatteringAngles(
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx
index 9657a682b851..16c18501e86b 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialEffectsUpdator.cxx
@@ -98,7 +98,7 @@ Trk::GsfMaterialEffectsUpdator::updateState(
       // Determine the pathCorrection if the material properties exist
       pathCorrection =
         materialProperties
-          ? 1. / fabs(surface->normal().dot(trackParameters->momentum().unit()))
+          ? 1. / std::abs(surface->normal().dot(trackParameters->momentum().unit()))
           : 0.;
     }
   }
@@ -216,7 +216,7 @@ Trk::GsfMaterialEffectsUpdator::preUpdateState(
       // Determine the pathCorrection if the material properties exist
       pathCorrection =
         materialProperties
-          ? 1. / fabs(surface->normal().dot(trackParameters->momentum().unit()))
+          ? 1. / std::abs(surface->normal().dot(trackParameters->momentum().unit()))
           : 0.;
     }
   }
@@ -316,7 +316,7 @@ Trk::GsfMaterialEffectsUpdator::postUpdateState(
       // Determine the pathCorrection if the material properties exist
       pathCorrection =
         materialProperties
-          ? 1. / fabs(surface->normal().dot(trackParameters->momentum().unit()))
+          ? 1. / std::abs(surface->normal().dot(trackParameters->momentum().unit()))
           : 0.;
     }
   }
@@ -446,7 +446,7 @@ bool
 Trk::GsfMaterialEffectsUpdator::updateP(AmgVector(5) & stateVector,
                                         double deltaP) const
 {
-  double p = 1. / fabs(stateVector[Trk::qOverP]);
+  double p = 1. / std::abs(stateVector[Trk::qOverP]);
   p += deltaP;
   if (p <= 0.) {
     return false;
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
index 438bb317b845..eabd4ae974bf 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolution.cxx
@@ -58,6 +58,7 @@ Trk::GsfMaterialMixtureConvolution::finalize()
 
 Trk::MultiComponentState
 Trk::GsfMaterialMixtureConvolution::update(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
   const Trk::MultiComponentState& multiComponentState,
   const Trk::Layer& layer,
   Trk::PropDirection direction,
@@ -113,6 +114,7 @@ Trk::GsfMaterialMixtureConvolution::update(
     QuickCloseComponentsMultiStateMerger::merge(
       std::move(cache.multiComponentState), m_maximumNumberOfComponents);
 
+  ATH_MSG_DEBUG("UPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< mergedState.size() );
   if (mergedState.empty()) {
     return {};
   }
@@ -128,6 +130,7 @@ Trk::GsfMaterialMixtureConvolution::update(
 
 Trk::MultiComponentState
 Trk::GsfMaterialMixtureConvolution::preUpdate(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
   const Trk::MultiComponentState& multiComponentState,
   const Trk::Layer& layer,
   Trk::PropDirection direction,
@@ -159,7 +162,7 @@ Trk::GsfMaterialMixtureConvolution::preUpdate(
 
     Trk::MultiComponentState updatedState = m_updator->preUpdateState(
       *component, layer, direction, particleHypothesis);
-
+     ATH_MSG_DEBUG("PREUPDATE update component result size:  " <<  updatedState.size() );
     if (updatedState.empty()) {
       continue;
     }
@@ -172,11 +175,12 @@ Trk::GsfMaterialMixtureConvolution::preUpdate(
         "Component could not be added to the state in the assembler");
     }
   }
-
+  ATH_MSG_DEBUG("PREUPDATE before merge N: " <<  cache.multiComponentState.size()  );
   Trk::MultiComponentState mergedState =
     QuickCloseComponentsMultiStateMerger::merge(
       std::move(cache.multiComponentState), m_maximumNumberOfComponents);
 
+  ATH_MSG_DEBUG("PREUPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< mergedState.size() );
   if (mergedState.empty()) {
     return {};
   }
@@ -192,6 +196,7 @@ Trk::GsfMaterialMixtureConvolution::preUpdate(
 
 Trk::MultiComponentState
 Trk::GsfMaterialMixtureConvolution::postUpdate(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>&,
   const Trk::MultiComponentState& multiComponentState,
   const Trk::Layer& layer,
   Trk::PropDirection direction,
@@ -243,6 +248,7 @@ Trk::GsfMaterialMixtureConvolution::postUpdate(
     QuickCloseComponentsMultiStateMerger::merge(
       std::move(cache.multiComponentState), m_maximumNumberOfComponents);
 
+  ATH_MSG_DEBUG("POSTUPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< mergedState.size() );
   if (mergedState.empty()) {
     return {};
   }
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolutionLM.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolutionLM.cxx
new file mode 100644
index 000000000000..3f8405742c58
--- /dev/null
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMaterialMixtureConvolutionLM.cxx
@@ -0,0 +1,503 @@
+/*
+  Copyright (C) 2020-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/*************************************************************************************
+      GsfMaterialMixtureConvolutionLM.cxx  -  description
+      -------------------------------------------------
+author               : amorley
+email                : amorley@cern.ch
+decription           : Implementation code for GSF material mixture convolution that uses less mem
+************************************************************************************/
+
+#include "TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h"
+#include "TrkGaussianSumFilter/IMultiStateMaterialEffectsUpdator.h"
+#include "TrkGaussianSumFilter/IMultiStateMaterialEffects.h"
+#include "TrkGaussianSumFilter/MultiComponentStateAssembler.h"
+#include "TrkGaussianSumFilter/MultiComponentStateCombiner.h"
+#include "TrkGaussianSumFilter/QuickCloseComponentsMultiStateMerger.h"
+#include "TrkGeometry/Layer.h"
+#include "TrkGeometry/MaterialProperties.h"
+#include "TrkGaussianSumFilter/AlignedDynArray.h"
+#include "TrkGaussianSumFilter/KLGaussianMixtureReduction.h"
+
+#include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
+#include "TrkSurfaces/PerigeeSurface.h"
+
+Trk::GsfMaterialMixtureConvolutionLM::GsfMaterialMixtureConvolutionLM(
+  const std::string& type,
+  const std::string& name,
+  const IInterface* parent)
+  : AthAlgTool(type, name, parent)
+{
+  declareInterface<IMaterialMixtureConvolution>(this);
+}
+
+Trk::GsfMaterialMixtureConvolutionLM::~GsfMaterialMixtureConvolutionLM() = default;
+
+StatusCode
+Trk::GsfMaterialMixtureConvolutionLM::initialize()
+{
+ 
+  ATH_CHECK( m_updator.retrieve() ); 
+  
+  ATH_CHECK( m_materialEffects.retrieve() );
+  
+  return StatusCode::SUCCESS;
+}
+
+StatusCode
+Trk::GsfMaterialMixtureConvolutionLM::finalize()
+{
+  return StatusCode::SUCCESS;
+}
+
+/* ==========================================
+   Update with full material effects
+   ========================================== */
+
+Trk::MultiComponentState
+Trk::GsfMaterialMixtureConvolutionLM::update(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>& caches,
+  const Trk::MultiComponentState& multiComponentState,
+  const Trk::Layer& layer,
+  Trk::PropDirection direction,
+  Trk::ParticleHypothesis particleHypothesis) const
+{
+
+  const Trk::MaterialProperties* materialProperties =
+    layer.fullUpdateMaterialProperties(*(multiComponentState.begin()->first));
+
+  if (!materialProperties) {
+    ATH_MSG_DEBUG("UPDATE but no material properties!!!");
+  }
+  
+  Trk::MultiComponentState updatedMergedState = update( caches, 
+                                                 multiComponentState,
+                                                 layer,
+                                                 direction,
+                                                 particleHypothesis,
+                                                 Normal );
+  ATH_MSG_DEBUG("UPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< updatedMergedState.size() );
+  if (updatedMergedState.empty()) {
+    return {};
+  }
+  // Renormalise state
+  MultiComponentStateHelpers::renormaliseState(updatedMergedState);
+
+  return updatedMergedState;
+}
+
+/* ==========================================
+   Update with pre-update material effects
+========================================== */
+
+Trk::MultiComponentState
+Trk::GsfMaterialMixtureConvolutionLM::preUpdate(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>& caches,
+  const Trk::MultiComponentState& multiComponentState,
+  const Trk::Layer& layer,
+  Trk::PropDirection direction,
+  Trk::ParticleHypothesis particleHypothesis) const
+{
+  const Trk::MaterialProperties* materialProperties =
+    layer.fullUpdateMaterialProperties(*(multiComponentState.begin()->first));
+  if (!materialProperties) {
+    ATH_MSG_DEBUG("PREUPDATE but no material properties!!!");
+  }
+  /* -------------------------------------
+     Preliminary checks
+     ------------------------------------- */
+  Trk::MultiComponentState updatedMergedState = update( caches,
+                                                 multiComponentState,
+                                                 layer,
+                                                 direction,
+                                                 particleHypothesis,
+                                                 Preupdate );
+  ATH_MSG_DEBUG("PREUPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< updatedMergedState.size() );
+  if (updatedMergedState.empty()) {
+    return {};
+  }
+  // Renormalise state
+  MultiComponentStateHelpers::renormaliseState(updatedMergedState);
+
+  return updatedMergedState;
+}
+
+/* ==========================================
+   Update with post-update material effects
+   ========================================== */
+
+Trk::MultiComponentState
+Trk::GsfMaterialMixtureConvolutionLM::postUpdate(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>& caches,
+  const Trk::MultiComponentState& multiComponentState,
+  const Trk::Layer& layer,
+  Trk::PropDirection direction,
+  Trk::ParticleHypothesis particleHypothesis) const
+{
+
+  const Trk::MaterialProperties* materialProperties =
+    layer.fullUpdateMaterialProperties(*(multiComponentState.begin()->first));
+  if (!materialProperties) {
+    ATH_MSG_DEBUG("POSTUPDATE but no material properties!!!");
+  }
+  /* -------------------------------------
+     Preliminary checks
+     ------------------------------------- */
+
+  Trk::MultiComponentState updatedMergedState = update( caches, 
+                                                 multiComponentState,
+                                                 layer,
+                                                 direction,
+                                                 particleHypothesis,
+                                                 Postupdate );
+                                                  
+  
+  ATH_MSG_DEBUG("POSTUPDATE update N in: " <<  multiComponentState.size() <<" N out: "<< updatedMergedState.size() );
+  if (updatedMergedState.empty()) {
+    return {};
+  }
+  // Renormalise state
+  MultiComponentStateHelpers::renormaliseState(updatedMergedState);
+
+
+  return updatedMergedState;
+}
+
+
+
+Trk::MultiComponentState  Trk::GsfMaterialMixtureConvolutionLM::update(
+  std::vector<Trk::IMultiStateMaterialEffects::Cache>& caches,
+  const Trk::MultiComponentState& inputState,
+  const Trk::Layer& layer,
+  Trk::PropDirection direction,
+  Trk::ParticleHypothesis particleHypothesis,
+  MaterialUpdateType  updateType) const
+{
+
+
+  // Check the multi-component state is populated
+  if (inputState.empty()) {
+    ATH_MSG_DEBUG("Multi component state passed to update is "
+                  "not populated... returning 0");
+    return {};
+  }
+
+ 
+  double updateFactor(1.);  
+  // Full method does this for each component which i don't think this is needed
+  if( updateType == Preupdate ){
+    updateFactor = layer.preUpdateMaterialFactor(*inputState.front().first, direction);  
+    ATH_MSG_DEBUG("Material effects update prior to propagation using layer "
+                  "information and particle hypothesis: "
+                  << particleHypothesis);
+  } else if ( updateType == Postupdate) {
+    updateFactor = layer.postUpdateMaterialFactor( *inputState.front().first, direction);
+    ATH_MSG_DEBUG("Material effects update after propagation using layer "
+                  "information and particle hypothesis: "
+                  << particleHypothesis);
+  } 
+
+  if( updateFactor < 0.01 ){ 
+    //Bail out as factor is too small to bother about
+    return {};
+  } 
+
+
+  caches.resize( inputState.size() );
+  
+  // Fill cache and work out how many final components there should be
+  size_t n(0);
+  for( size_t i(0) ; i < inputState.size(); ++i){
+    const AmgSymMatrix(5)* measuredCov = inputState[i].first->covariance();
+    //If the momentum is too dont apply material effects
+    if( inputState[i].first->momentum().mag() <=  m_momentumCut ){
+      ATH_MSG_DEBUG("Ignoring material effects... Momentum too low");
+      caches[i].resetAndAddDummyValues();
+      caches[i].deltaParameters[0] = inputState[i].first->parameters();
+      caches[i].weights[0] = inputState[i].second;
+      if (measuredCov) {
+        caches[i].deltaCovariances[0] += *measuredCov;
+      }
+      n += caches[i].weights.size();
+      continue;
+    }
+    
+    // Get the material effects and store them in the cache
+    std::pair< const Trk::MaterialProperties*, double > matPropPair =   
+      getMaterialProperties( inputState[i].first.get(), layer );
+   
+    if( !matPropPair.first ) {
+      ATH_MSG_DEBUG("No material properties .. dont apply material effects");
+      caches[i].resetAndAddDummyValues();
+      caches[i].deltaParameters[0] = inputState[i].first->parameters();
+      caches[i].weights[0] = inputState[i].second;
+      if (measuredCov) {
+        caches[i].deltaCovariances[0] += *measuredCov;
+      }
+      n += caches[i].weights.size();
+      continue;
+    }
+    
+    // Apply the update factor
+    matPropPair.second *= updateFactor;    
+ 
+    m_materialEffects->compute(caches[i],
+                           inputState[i],
+                           *matPropPair.first,
+                           matPropPair.second,
+                           direction,
+                           particleHypothesis);
+
+    // check all vectors have the same size
+    if (caches[i].weights.size() != caches[i].deltaPs.size()) {
+      ATH_MSG_ERROR("Inconsistent number of components in the updator!!! no material effect will be applied");
+      caches[i].resetAndAddDummyValues();
+    }
+
+    for( size_t j(0); j < caches[i].weights.size(); ++j){
+      if (measuredCov) {
+        caches[i].deltaCovariances[j] += *measuredCov;
+      } else {
+        caches[i].deltaCovariances[j].setZero();
+      }
+      caches[i].deltaParameters[j] = inputState[i].first->parameters();
+      // Adjust the momentum of the component's parameters vector here. Check to
+      // make sure update is good.
+      if (!updateP(caches[i].deltaParameters[j][Trk::qOverP], caches[i].deltaPs[j])) {
+        ATH_MSG_ERROR("Cannot update state vector momentum!!! return nullptr"); 
+        return {};
+      }
+      // Store component weight
+      caches[i].weights[j] *= inputState[i].second; 
+    }
+
+    n += caches[i].weights.size();   
+  } 
+
+
+  // Fill information for to calculate which components to merge
+  // Inaddition scan all components for covariance matrices. If one or more component
+  // is missing an error matrix, component reduction is impossible.
+  bool componentWithoutMeasurement = false;
+ 
+  GSFUtils::AlignedDynArray<GSFUtils::Component1D, GSFUtils::alignment> components(n);
+  size_t k(0);
+  std::vector< std::pair<size_t,size_t> > indices(n);
+  for( size_t i(0) ; i < inputState.size(); ++i){  
+    for( size_t j(0); j < caches[i].weights.size(); ++j ){ 
+      const AmgSymMatrix(5)* measuredCov = inputState[i].first->covariance();
+      // Fill in infomation
+      const double cov =
+        measuredCov ? caches[i].deltaCovariances[j](Trk::qOverP, Trk::qOverP) : -1.;
+      if( !measuredCov ){
+        componentWithoutMeasurement = true; 
+      }
+      components[k].mean = caches[i].deltaParameters[j][Trk::qOverP];
+      components[k].cov = cov;
+      components[k].invCov = cov > 0 ? 1. / cov : 1e10;
+      components[k].weight = caches[i].weights[j] ;
+      indices[k] = {i,j};
+      ++k;
+    }
+  }
+ 
+
+  if(componentWithoutMeasurement){
+    auto result = std::max_element(components.begin(), 
+                                   components.end(),
+                                   [](const auto& a, const auto& b){ 
+                                     return a.weight < b.weight;
+                                   });
+    auto index = std::distance(components.begin(), result);
+
+    // Build the first TP
+    size_t stateIndex = indices[index].first;
+    size_t materialIndex = indices[index].second;
+
+    AmgVector(5)& updatedStateVector = caches[stateIndex].deltaParameters[materialIndex];
+    const AmgSymMatrix(5)* measuredCov = inputState[stateIndex].first->covariance();
+    AmgSymMatrix(5)* updatedCovariance = nullptr;
+    if (measuredCov && caches[stateIndex].deltaCovariances.size() > materialIndex) {
+      updatedCovariance = new AmgSymMatrix(5)(
+        caches[stateIndex].deltaCovariances[materialIndex] );
+    }
+    Trk::TrackParameters* updatedTrackParameters =
+      inputState[stateIndex].first->associatedSurface().createTrackParameters(
+        updatedStateVector[Trk::loc1],
+        updatedStateVector[Trk::loc2],
+        updatedStateVector[Trk::phi],
+        updatedStateVector[Trk::theta],
+        updatedStateVector[Trk::qOverP],
+        updatedCovariance);
+ 
+    Trk::ComponentParameters dummyCompParams( updatedTrackParameters, 1.);
+    Trk::MultiComponentState returnMultiState;
+    returnMultiState.push_back(std::move(dummyCompParams));
+    return returnMultiState;
+  }
+  
+
+  // Gather the merges -- order is important -- RHS is smaller than LHS 
+  std::vector<std::pair<int32_t, int32_t>> merges; 
+  if (n > m_maximumNumberOfComponents)
+    merges = findMerges(components.buffer(), n, m_maximumNumberOfComponents);
+
+  //Merge components
+  MultiComponentStateAssembler::Cache assemblerCache;
+  int nMerges(0);
+  std::vector<bool> isMerged( n, false); 
+  for (const auto& mergePair : merges) {
+    const int32_t mini = mergePair.first;
+    const int32_t minj = mergePair.second;
+
+  
+    
+    // Build the first TP
+    size_t stateIndex = indices[mini].first;
+    size_t materialIndex = indices[mini].second;
+    AmgVector(5)&  stateVector   = caches[stateIndex].deltaParameters[materialIndex];
+    AmgSymMatrix(5)& measuredCov = caches[stateIndex].deltaCovariances[materialIndex];
+    
+    // Build the second TP
+    size_t stateIndex2    = indices[minj].first;
+    size_t materialIndex2 = indices[minj].second;
+    
+    ++nMerges;
+ 
+    const AmgVector(5) firstParameters = stateVector;
+    const double firstWeight     = caches[stateIndex].weights[materialIndex]; 
+
+    Trk::MultiComponentStateCombiner::combineParametersWithWeight( caches[stateIndex].deltaParameters[materialIndex], 
+                                   caches[stateIndex].weights[materialIndex],
+                                   caches[stateIndex2].deltaParameters[materialIndex2], 
+                                   caches[stateIndex2].weights[materialIndex2] );
+
+    Trk::MultiComponentStateCombiner::combineCovWithWeight( firstParameters,  
+                            measuredCov,  
+                            firstWeight, 
+                            caches[stateIndex2].deltaParameters[materialIndex2], 
+                            caches[stateIndex2].deltaCovariances[materialIndex2], 
+                            caches[stateIndex2].weights[materialIndex2] );
+     
+    isMerged[minj] = true;
+    caches[stateIndex2].deltaParameters[materialIndex2].setZero();
+    caches[stateIndex2].deltaCovariances[materialIndex2].setZero();
+     
+  }
+  
+  for( size_t i(0); i < n; ++i ){
+    if( isMerged[i] )
+      continue;
+
+    // Build the TP
+    size_t stateIndex = indices[i].first;
+    size_t materialIndex = indices[i].second;
+    AmgVector(5)&  stateVector   = caches[stateIndex].deltaParameters[materialIndex];
+    AmgSymMatrix(5)& measuredCov = caches[stateIndex].deltaCovariances[materialIndex];
+    
+    Trk::TrackParameters* updatedTrackParameters =
+      inputState[stateIndex].first->associatedSurface().createTrackParameters(
+        stateVector[Trk::loc1],
+        stateVector[Trk::loc2],
+        stateVector[Trk::phi],
+        stateVector[Trk::theta],
+        stateVector[Trk::qOverP],
+        new AmgSymMatrix(5)( measuredCov ) );
+    
+    double updatedWeight = caches[stateIndex].weights[materialIndex];
+ 
+    assemblerCache.multiComponentState.emplace_back( updatedTrackParameters, updatedWeight);
+    assemblerCache.validWeightSum += updatedWeight;
+  } 
+ 
+  if( nMerges + assemblerCache.multiComponentState.size() != n ){
+    ATH_MSG_ERROR("Combining complete but merger size is incompatible: " << n << "  " << nMerges << " " <<  assemblerCache.multiComponentState.size() );  
+  }
+  
+  // Check all weights 
+  Trk::MultiComponentState mergedState =
+    MultiComponentStateAssembler::assembledState(assemblerCache);
+ 
+  if(mergedState.size() > m_maximumNumberOfComponents)
+    ATH_MSG_ERROR("Merging failed, target size: " << m_maximumNumberOfComponents << " final size: " << mergedState.size());
+  return mergedState;
+}
+
+
+bool Trk::GsfMaterialMixtureConvolutionLM::updateP(double& qOverP,  double deltaP) const
+{
+  double p = 1. / std::abs(qOverP);
+  p += deltaP;
+  if (p <= 0.) {
+    return false;
+  }
+  qOverP = qOverP > 0. ? 1. / p : -1. / p;
+  return true;
+}
+
+
+
+std::pair< const Trk::MaterialProperties*, double >  
+  Trk::GsfMaterialMixtureConvolutionLM::getMaterialProperties( 
+    const Trk::TrackParameters* trackParameters,
+    const Trk::Layer& layer) const
+{
+
+  const Trk::MaterialProperties* materialProperties(nullptr);
+  double pathCorrection(0.);
+
+  // Incorporate the reference material
+
+  if (m_useReferenceMaterial) {
+
+    // Get the surface associated with the parameters
+    const Trk::Surface* surface = &(trackParameters->associatedSurface());
+
+    // Only utilise the reference material if an associated detector element
+    // exists
+    if (surface && surface->associatedDetectorElement()) {
+
+      // Get the layer material properties
+      const Trk::LayerMaterialProperties* layerMaterial =
+        layer.layerMaterialProperties();
+
+      // Assign the material properties
+      materialProperties =
+        layerMaterial ? layerMaterial->fullMaterial(trackParameters->position())
+                      : nullptr;
+
+      // Determine the pathCorrection if the material properties exist
+      pathCorrection =
+        materialProperties
+          ? 1. / std::abs(surface->normal().dot(trackParameters->momentum().unit()))
+          : 0.;
+    }
+  }
+
+  // Check that the material properties have been defined - if not define them
+  // from the layer information
+  materialProperties = materialProperties
+                         ? materialProperties
+                         : layer.fullUpdateMaterialProperties(*trackParameters);
+
+  // Bail out if still no material properties can be found
+  if (!materialProperties) {
+    return {nullptr,0};
+  }
+
+  // Define the path correction
+  pathCorrection =
+    pathCorrection > 0.
+      ? pathCorrection
+      : layer.surfaceRepresentation().pathCorrection(
+          trackParameters->position(), trackParameters->momentum());
+
+
+  // The pathlength ( in mm ) is the path correction * the thickness of the
+  // material
+  double pathLength = pathCorrection * materialProperties->thickness();
+
+  return {materialProperties,pathLength};
+}
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx
index 5300da13fe45..5ffb33af9b5b 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx
@@ -291,6 +291,8 @@ Trk::GsfMeasurementUpdator::calculateFilterStep(
   if (stateBeforeUpdate.empty()) {
     ATH_MSG_WARNING("Cannot update multi-state with no components!");
     return {};
+  } else {
+    ATH_MSG_DEBUG("calculateFilterStep() starting with  : " <<  stateBeforeUpdate.size() );
   }
 
   // Calculate the weight of each component after the measurement
@@ -301,6 +303,8 @@ Trk::GsfMeasurementUpdator::calculateFilterStep(
   if (stateWithNewWeights.empty()) {
     ATH_MSG_DEBUG("Cacluation of state posterior weights failed... Exiting!");
     return {};
+  } else {
+    ATH_MSG_DEBUG("calculateFilterStep() after new weights : " <<  stateWithNewWeights.size() );
   }
 
   // Update each component using the specified updator
@@ -312,9 +316,10 @@ Trk::GsfMeasurementUpdator::calculateFilterStep(
 
   for (; component != stateWithNewWeights.end(); ++component) {
 
-    if (fabs((*component).first->parameters()[Trk::qOverP]) > 0.033333) {
+    if ( stateWithNewWeights.size() > 1 && 
+         std::abs((*component).first->parameters()[Trk::qOverP]) > 0.033333) {
       ATH_MSG_DEBUG(
-        "About to update component with p<30MeV...skipping component! (2)");
+        "About to update component with p<30 MeV...skipping component! (2)");
       continue;
     }
     Trk::FitQualityOnSurface* componentFitQuality = nullptr;
@@ -381,11 +386,15 @@ Trk::GsfMeasurementUpdator::calculateFilterStep(
     }
   }
 
+  ATH_MSG_DEBUG("Assembeler cache size : " << cache.multiComponentState.size() );
+
   Trk::MultiComponentState assembledUpdatedState =
     MultiComponentStateAssembler::assembledState(cache);
 
   if (assembledUpdatedState.empty()) {
     return {};
+  } else {
+    ATH_MSG_DEBUG("Assembeled size : " << assembledUpdatedState.size() );
   }
 
   fitQoS = std::make_unique<FitQualityOnSurface>(chiSquared, degreesOfFreedom);
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
index 5ca92fd33503..4dba395e6017 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfSmoother.cxx
@@ -65,6 +65,7 @@ Trk::GsfSmoother::configureTools(
 
 Trk::SmoothedTrajectory*
 Trk::GsfSmoother::fit(const EventContext& ctx,
+                      Trk::IMultiStateExtrapolator::Cache& extrapolatorCache,
                       const ForwardTrajectory& forwardTrajectory,
                       const ParticleHypothesis particleHypothesis,
                       const Trk::CaloCluster_OnTrack* ccot) const
@@ -249,6 +250,7 @@ Trk::GsfSmoother::fit(const EventContext& ctx,
 
     Trk::MultiComponentState extrapolatedState =
       m_extrapolator->extrapolate(ctx,
+                                  extrapolatorCache,   
                                   updatedState,
                                   measurement->associatedSurface(),
                                   Trk::oppositeMomentum,
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateCombiner.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateCombiner.cxx
index cd299aa50059..801690c53a60 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateCombiner.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateCombiner.cxx
@@ -14,6 +14,7 @@
 #include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkSurfaces/Surface.h"
+#include "CxxUtils/phihelper.h"
 
 std::unique_ptr<Trk::TrackParameters>
 Trk::MultiComponentStateCombiner::combine(
@@ -41,76 +42,91 @@ Trk::MultiComponentStateCombiner::combineWithWeight(
   Trk::ComponentParameters& mergeTo,
   const Trk::ComponentParameters& addThis)
 {
+  const Trk::TrackParameters* secondParameters = addThis.first.get(); 
+  combineWithWeight( mergeTo, secondParameters->parameters(), secondParameters->covariance(), addThis.second );
+}
 
-  const Trk::TrackParameters* firstParameters = mergeTo.first.get();
-  // Check to see if first track parameters are measured or not
-  const AmgSymMatrix(5)* firstMeasuredCov = firstParameters->covariance();
+void
+Trk::MultiComponentStateCombiner::combineWithWeight(
+  Trk::ComponentParameters& mergeTo,
+  const AmgVector(5)& secondParameters, const AmgSymMatrix(5)* secondMeasuredCov, const double secondWeight )
+{
   double firstWeight = mergeTo.second;
-
-  const Trk::TrackParameters* secondParameters = addThis.first.get();
+  auto trackParameters = mergeTo.first.get();
+  const AmgVector(5)& firstParameters =  trackParameters->parameters();
+  AmgVector(5)  finalParameters( firstParameters );
   // Check to see if first track parameters are measured or not
-  const AmgSymMatrix(5)* secondMeasuredCov = secondParameters->covariance();
-  double secondWeight = addThis.second;
-  double totalWeight = firstWeight + secondWeight;
+  double finalWeight = firstWeight; 
+  combineParametersWithWeight( finalParameters, finalWeight,
+                               secondParameters, secondWeight );
+
+
+  if( trackParameters->covariance() && secondMeasuredCov ) 
+  { 
+    AmgSymMatrix(5) finalMeasuredCov( *trackParameters->covariance() );
+    combineCovWithWeight( firstParameters,  finalMeasuredCov,  firstWeight,
+                          secondParameters, *secondMeasuredCov, secondWeight );
+
+    mergeTo.first->updateParameters(finalParameters, finalMeasuredCov);
+    mergeTo.second = finalWeight;
+  } else {
+    mergeTo.first->updateParameters(finalParameters, nullptr);
+    mergeTo.second = finalWeight;
+  }
+
+}
+
 
-  AmgVector(5) mean;
-  mean.setZero();
 
-  AmgVector(5) parameters = secondParameters->parameters();
+
+void Trk::MultiComponentStateCombiner::combineParametersWithWeight(
+  AmgVector(5)& firstParameters, double& firstWeight,
+  const AmgVector(5)& secondParameters, const double secondWeight )
+{
+
+  double totalWeight = firstWeight + secondWeight;
 
   // Ensure that we don't have any problems with the cyclical nature of phi
   // Use first state as reference poin
-  double deltaPhi = firstParameters->parameters()[2] - parameters[2];
-
+  double deltaPhi = firstParameters[2] - secondParameters[2];
   if (deltaPhi > M_PI) {
-    parameters[2] += 2 * M_PI;
+    firstParameters[2] -= 2 * M_PI;
   } else if (deltaPhi < -M_PI) {
-    parameters[2] -= 2 * M_PI;
+    firstParameters[2] += 2 * M_PI;
   }
 
-  mean =
-    firstWeight * firstParameters->parameters() + secondWeight * parameters;
-  mean /= totalWeight;
+
+  firstParameters =
+    firstWeight * firstParameters  + secondWeight * secondParameters;
+  firstParameters /= totalWeight;
 
   // Ensure that phi is between -pi and pi
   //
-  if (mean[2] > M_PI) {
-    mean[2] -= 2 * M_PI;
-  } else if (mean[2] < -M_PI) {
-    mean[2] += 2 * M_PI;
-  }
+  firstParameters[2] =  CxxUtils::wrapToPi( firstParameters[2] );
+  firstWeight = totalWeight;
+}
+ 
+
+
+void Trk::MultiComponentStateCombiner::combineCovWithWeight(
+  const AmgVector(5)& firstParameters, AmgSymMatrix(5)& firstMeasuredCov, const double firstWeight,
+  const AmgVector(5)& secondParameters, const AmgSymMatrix(5)& secondMeasuredCov, const double secondWeight )
+{
+
+  double totalWeight = firstWeight + secondWeight;
 
   // Extract local error matrix: Must make sure track parameters are measured,
   // ie have an associated error matrix.
-  if (firstMeasuredCov && secondMeasuredCov) {
-    AmgSymMatrix(5) covariance;
-    AmgSymMatrix(5) covariancePart1;
-    covariancePart1.setZero();
-    AmgSymMatrix(5) covariancePart2;
-    covariancePart2.setZero();
-
-    covariancePart1 =
-      firstWeight * (*firstMeasuredCov) + secondWeight * (*secondMeasuredCov);
-    AmgVector(5) parameterDifference =
-      firstParameters->parameters() - parameters;
-
-    if (parameterDifference[2] > M_PI) {
-      parameterDifference[2] -= 2 * M_PI;
-    } else if (parameterDifference[2] < -M_PI) {
-      parameterDifference[2] += 2 * M_PI;
-    }
 
-    covariancePart2 = firstWeight * secondWeight * parameterDifference *
-                      parameterDifference.transpose();
-    covariance = covariancePart1 / totalWeight +
-                 covariancePart2 / (totalWeight * totalWeight);
-
-    mergeTo.first->updateParameters(mean, covariance);
-    mergeTo.second = totalWeight;
-  } else {
-    mergeTo.first->updateParameters(mean, nullptr);
-    mergeTo.second = totalWeight;
-  }
+  AmgVector(5) parameterDifference = firstParameters - secondParameters;
+  parameterDifference[2] =  CxxUtils::wrapToPi( parameterDifference[2] );
+  parameterDifference /= totalWeight; 
+  
+  firstMeasuredCov *= firstWeight;
+  firstMeasuredCov += secondWeight * secondMeasuredCov;
+  firstMeasuredCov /= totalWeight;
+  firstMeasuredCov += firstWeight * secondWeight * parameterDifference * parameterDifference.transpose();
+  
 }
 
 std::unique_ptr<Trk::ComponentParameters>
@@ -227,11 +243,7 @@ Trk::MultiComponentStateCombiner::compute(
 
   // Ensure that phi is between -pi and pi
   //
-  if (mean[2] > M_PI) {
-    mean[2] -= 2 * M_PI;
-  } else if (mean[2] < -M_PI) {
-    mean[2] += 2 * M_PI;
-  }
+  mean[2] =  CxxUtils::wrapToPi( mean[2] ); 
 
   (*covariance) = covariancePart1 / sumW + covariancePart2 / (sumW * sumW);
 
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
index 6a7df3538a31..ef97513d3e1b 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
@@ -13,9 +13,10 @@
 #include "TrkGaussianSumFilter/MultiComponentStateModeCalculator.h"
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
 #include "TrkParameters/TrackParameters.h"
+#include "CxxUtils/phihelper.h"
 
 namespace {
-const double invsqrt2PI = 1. / sqrt(2. * M_PI);
+constexpr double invsqrt2PI = 1. / sqrt(2. * M_PI);
 
 /** bried method to determine the value of the a gaussian distribution at a
  * given value */
@@ -165,11 +166,7 @@ Trk::MultiComponentStateModeCalculator::calculateMode(
       }
       // Ensure that phi is between -pi and pi
       if (i == 2) {
-        if (modes[i] > M_PI) {
-          modes[i] -= 2 * M_PI;
-        } else if (modes[i] < -M_PI) {
-          modes[i] += 2 * M_PI;
-        }
+        modes[i] = CxxUtils::wrapToPi( modes[i] ) ;
       }
     }
   }
@@ -205,9 +202,9 @@ Trk::MultiComponentStateModeCalculator::fillMixture(
       //                           d0=0, z0=1, phi0=2, theta=3, qOverP=4,
       double weight = component->second;
       double mean = componentParameters->parameters()[parameter[i]];
-      // FIXME ATLASRECTS-598 this fabs() should not be necessary... for some
+      // FIXME ATLASRECTS-598 this std::abs() should not be necessary... for some
       // reason cov(qOverP,qOverP) can be negative
-      double sigma = sqrt(fabs((*measuredCov)(parameter[i], parameter[i])));
+      double sigma = sqrt(std::abs((*measuredCov)(parameter[i], parameter[i])));
 
       // Ensure that we don't have any problems with the cyclical nature of phi
       // Use first state as reference point
@@ -254,7 +251,7 @@ Trk::MultiComponentStateModeCalculator::findMode(
     double pdfPreviousMode = pdf(previousMode, i, mixture);
 
     if ((pdfMode + pdfPreviousMode) != 0.0) {
-      tolerance = fabs(pdfMode - pdfPreviousMode) / (pdfMode + pdfPreviousMode);
+      tolerance = std::abs(pdfMode - pdfPreviousMode) / (pdfMode + pdfPreviousMode);
     } else {
       return xStart;
     }
@@ -288,7 +285,7 @@ Trk::MultiComponentStateModeCalculator::findModeGlobal(
 
   double mode(0);
   double maximum(-1);
-  double iterate(fabs(mean / 1000));
+  double iterate(std::abs(mean / 1000));
 
   for (double counter(start); counter < end; counter += iterate) {
     double value(pdf(counter, i, mixture));
@@ -342,7 +339,7 @@ Trk::MultiComponentStateModeCalculator::findRoot(
       e = b - a;
     }
 
-    if (fabs(fc) < fabs(fb)) {
+    if (std::abs(fc) < std::abs(fb)) {
       ac_equal = true;
       a = b;
       b = c;
@@ -352,15 +349,15 @@ Trk::MultiComponentStateModeCalculator::findRoot(
       fc = fa;
     }
 
-    double tol = 0.5 * tolerance * fabs(b);
+    double tol = 0.5 * tolerance * std::abs(b);
     double m = 0.5 * (c - b);
 
-    if (fb == 0 || fabs(m) <= tol) {
+    if (fb == 0 || std::abs(m) <= tol) {
       result = b;
       return true;
     }
 
-    if (fabs(e) < tol || fabs(fa) <= fabs(fb)) {
+    if (std::abs(e) < tol || std::abs(fa) <= std::abs(fb)) {
       // Bounds decreasing too slowly: use bisection
       d = m;
       e = m;
@@ -387,8 +384,8 @@ Trk::MultiComponentStateModeCalculator::findRoot(
         p = -p;
       }
 
-      double min1 = 3 * m * q - fabs(tol * q);
-      double min2 = fabs(e * q);
+      double min1 = 3 * m * q - std::abs(tol * q);
+      double min2 = std::abs(e * q);
       if (2 * p < (min1 < min2 ? min1 : min2)) {
         // Accept the interpolation
         e = d;
@@ -403,7 +400,7 @@ Trk::MultiComponentStateModeCalculator::findRoot(
     a = b;
     fa = fb;
     // Evaluate new trial root
-    if (fabs(d) > tol) {
+    if (std::abs(d) > tol) {
       b += d;
     } else {
       b += (m > 0 ? +tol : -tol);
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx
index 86bd37996bb9..f53ef90ca49b 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/components/TrkGaussianSumFilter_entries.cxx
@@ -1,3 +1,4 @@
+#include "TrkGaussianSumFilter/GsfMaterialMixtureConvolutionLM.h"
 #include "TrkGaussianSumFilter/GsfMaterialMixtureConvolution.h"
 #include "TrkGaussianSumFilter/GsfCombinedMaterialEffects.h"
 #include "TrkGaussianSumFilter/GsfMaterialEffectsUpdator.h"
@@ -8,6 +9,7 @@
 #include "TrkGaussianSumFilter/GsfExtrapolator.h"
 #include "TrkGaussianSumFilter/GsfSmoother.h"
 
+DECLARE_COMPONENT( Trk::GsfMaterialMixtureConvolutionLM )
 DECLARE_COMPONENT( Trk::GsfMaterialMixtureConvolution )
 DECLARE_COMPONENT( Trk::GsfCombinedMaterialEffects )
 DECLARE_COMPONENT( Trk::GsfMaterialEffectsUpdator )
diff --git a/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx b/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx
index d3635339af1c..b17fa2e045bb 100644
--- a/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx
+++ b/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx
@@ -237,7 +237,7 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr
 
    Trk::Track *refittedtrack=m_trackFitter->fit(track,false,materialInteractions);
   
-   //!<  @todo : add documentation & find out why we need the fit twice ?
+   //!<  Refit a second time to add TRT hits
    Trk::Track *refittedtrack2=nullptr;
    if (refittedtrack && (int)clusters.size()-i>=9){
      Trk::MeasurementSet measset;
@@ -263,7 +263,7 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr
        refittedtrack2=new Trk::Track(refittedtrack->info(),traj2,refittedtrack->fitQuality()->clone());
      }
      else for (int j=0;j<(int)measset.size();j++) delete measset[j];
-   } else {
+   } else if(!refittedtrack){
     ATH_MSG_VERBOSE("Track fit of truth trajectory NOT successful, NO track created. ");
     return nullptr;
    }
@@ -272,7 +272,7 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr
    if (!refittedtrack2 && refittedtrack) refittedtrack2=refittedtrack;
 
    //         
-   ATH_MSG_WARNING("Track fit of truth trajectory successful, track created. ");
+   ATH_MSG_DEBUG("Track fit of truth trajectory successful, track created. ");
    // return what you have
    // Before returning, fix the creator
    refittedtrack2->info().setPatternRecognitionInfo( Trk::TrackInfo::Pseudotracking);
-- 
GitLab


From c63a09a33b29fc4a5d895d167333e62b082db024 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 7 Jul 2020 18:36:14 +0200
Subject: [PATCH 095/217] LArAthenaPool: Fix clang warnings.

Missing override keywords.

Mismatched include guard.
---
 .../LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
index 224d735a14b2..a4bcd3d227b3 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/src/LArLATOMEHeaderContainerCnv.h
@@ -4,7 +4,7 @@
 
 //Dear emacs, this is -*-c++-*- 
 #ifndef LARATHENAPOOL_LARLATOMEHEADERCONTAINERCNV_H
-#define LARATHENAPOOL_LARLATOMECONTAINERCNV_H
+#define LARATHENAPOOL_LARLATOMEHEADERCONTAINERCNV_H
 
 #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
 #include "LArRawEvent/LArLATOMEHeaderContainer.h"
@@ -18,10 +18,10 @@ class LArLATOMEHeaderContainerCnv : public LArLATOMEHeaderContainerCnvBase
 {
 public:
   LArLATOMEHeaderContainerCnv(ISvcLocator*);
-  StatusCode initialize();
+  virtual StatusCode initialize() override;
 protected:
   virtual LArLATOMEHeaderContainer* createTransient() override final;
-  virtual LArLATOMEHeaderContainerPERS* createPersistent(LArLATOMEHeaderContainer*);
+  virtual LArLATOMEHeaderContainerPERS* createPersistent(LArLATOMEHeaderContainer*) override;
 private:
   pool::Guid   m_p1_guid;
   
-- 
GitLab


From 74c3dfd4ceaf4d62660dcf99172347670ad33a6b Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Tue, 7 Jul 2020 19:08:37 +0000
Subject: [PATCH 096/217] TrkEventPrimitives: Move inline to separate icc,
 default operations, tidy code

---
 .../TrkEventPrimitives/CurvilinearUVT.h       | 122 +++++------
 .../TrkEventPrimitives/CurvilinearUVT.icc     |  40 ++++
 .../TrkEventPrimitives/DefinedParameter.h     |  56 +++---
 .../TrkEventPrimitives/FitQuality.h           |  92 ++++-----
 .../TrkEventPrimitives/FitQuality.icc         |  39 ++++
 .../JacobianCotThetaPtToThetaP.h              |   1 -
 .../JacobianCurvilinearToLocal.h              |  21 +-
 .../JacobianLocalToCurvilinear.h              |  18 +-
 .../JacobianThetaPToCotThetaPt.h              |   1 -
 .../TrkEventPrimitives/LocalDirection.h       | 119 ++++++-----
 .../TrkEventPrimitives/LocalParameters.h      |  56 ++----
 .../TrkEventPrimitives/LocalParameters.icc    |  59 ++++++
 .../PdgToParticleHypothesis.h                 | 179 ++---------------
 .../PdgToParticleHypothesis.icc               | 190 ++++++++++++++++++
 .../TrkEventPrimitives/ResidualPull.h         | 154 ++++++--------
 .../TrkEventPrimitives/ResidualPull.icc       |  72 +++++++
 .../TrkEventPrimitives/VertexType.h           |  27 +--
 .../TrkEventPrimitives/src/CurvilinearUVT.cxx |   3 -
 .../TrkEventPrimitives/src/FitQuality.cxx     |  32 ---
 .../src/JacobianCotThetaPtToThetaP.cxx        |   2 -
 .../src/JacobianCurvilinearToLocal.cxx        |  20 +-
 .../src/JacobianLocalToCurvilinear.cxx        |   2 -
 .../src/JacobianThetaPToCotThetaPt.cxx        |   5 -
 .../src/LocalParameters.cxx                   |  18 --
 .../TrkEventPrimitives/src/ResidualPull.cxx   |  62 ------
 25 files changed, 713 insertions(+), 677 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.icc
 create mode 100644 Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.icc
 create mode 100644 Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.icc
 create mode 100644 Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.icc
 create mode 100644 Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
 delete mode 100755 Tracking/TrkEvent/TrkEventPrimitives/src/ResidualPull.cxx

diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.h
index 027df7b6e9cb..ac7e6b1c61e8 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,88 +13,60 @@
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "EventPrimitives/EventPrimitives.h"
 
-class MsgStream;
-
-//STD
+#include <cmath>
 #include <iostream>
 
+class MsgStream;
 namespace Trk {
+
+/** @class CurvilinearUVT
+
+   simple class that constructs the curvilinear vectors curvU and curvV
+   from a given momentum direction (must be unit vector).
+
+  The curvilinear frame @f$ (\vec u, \vec v, \vec t) @f$ at each point @f$ m @f$
+  is constructed by:
+
+  - @f$ \vec t = \vec{curvT} @f$ ... momentum direction at @f$ m @f$
+  - @f$ \vec u = \vec{curvU} = \frac{\vec t \times \vec z}{||\vec t \times \vec
+  z||} @f$ ... with @f$ \vec z @f$ the global z-axis
+  - @f$ \vec v = \vec{curvV} = \vec t \times \fec u @f$ ... constructed so that
+  frame is right-handed
+
+   The picture shows the curvilinear frame for a straight line measurement
+
+   @internal
+   @image html CurvilinearFrameStraw.png
+   @endinternal
+
+   @author Andreas.Salzburger@cern.ch
+  */
+class CurvilinearUVT
+{
+
+public:
+
+  /** Create from Amg::Vector3D */
+  CurvilinearUVT(const Amg::Vector3D& dir);
+  CurvilinearUVT() = default;
+
+  /** Access methods */
+  const Amg::Vector3D& curvU() const;
+  const Amg::Vector3D& curvV() const;
+  const Amg::Vector3D& curvT() const;
+
+private:
+  Amg::Vector3D m_curvU; //!< curvilinear U axis
+  Amg::Vector3D m_curvV; //!< curvilinear V axis
+  Amg::Vector3D m_curvT; //!< curvilinear T axis
+};
+
   
-   /** @class CurvilinearUVT
-
-      simple class that constructs the curvilinear vectors curvU and curvV
-      from a given momentum direction (must be unit vector).
-     
-     The curvilinear frame @f$ (\vec u, \vec v, \vec t) @f$ at each point @f$ m @f$ is constructed by:
-     
-     - @f$ \vec t = \vec{curvT} @f$ ... momentum direction at @f$ m @f$ 
-     - @f$ \vec u = \vec{curvU} = \frac{\vec t \times \vec z}{||\vec t \times \vec z||} @f$ ... with @f$ \vec z @f$ the global z-axis  
-     - @f$ \vec v = \vec{curvV} = \vec t \times \fec u @f$ ... constructed so that frame is right-handed  
-     
-      The picture shows the curvilinear frame for a straight line measurement
-
-      @internal
-      @image html CurvilinearFrameStraw.png
-      @endinternal
-
-      @author Andreas.Salzburger@cern.ch
-     */
-   class CurvilinearUVT {
-	
-     public:
-     /** POOL method needed  */
-       CurvilinearUVT(){}
-       
-     /** Create from Amg::Vector3D */
-       CurvilinearUVT(const Amg::Vector3D& dir);
-       
-     /** Destructor */  
-       ~CurvilinearUVT();
-       
-     /** Access methods */
-       const Amg::Vector3D& curvU() const;
-       const Amg::Vector3D& curvV() const;
-       const Amg::Vector3D& curvT() const;      
-     
-     private:      
-      Amg::Vector3D         m_curvU;  //!< curvilinear U axis 
-      Amg::Vector3D         m_curvV;  //!< curvilinear V axis
-      Amg::Vector3D         m_curvT;  //!< curvilinear T axis
-	
-    };
-
-   inline  CurvilinearUVT::CurvilinearUVT(const Amg::Vector3D& dir) :
-     m_curvT(dir)
-    {         
-      // make it safe for tracks progressing along the z axis
-      if ( fabs( dir.normalized().dot(Amg::Vector3D::UnitZ()) ) < 0.99 ){
-          Amg::Vector3D curvZcrossT = -(m_curvT.cross(Amg::Vector3D::UnitZ()));
-          m_curvU = curvZcrossT.normalized();
-          m_curvV = m_curvT.cross(m_curvU);
-      } else {
-          Amg::Vector3D curvZcrossT = -(m_curvT.cross(Amg::Vector3D::UnitX()));
-          m_curvU = curvZcrossT.normalized();
-          m_curvV = m_curvT.cross(m_curvU);
-        }
-    }
-
-   inline const Amg::Vector3D& CurvilinearUVT::curvU() const {
-     return(m_curvU);
-   }
-
-   inline const Amg::Vector3D& CurvilinearUVT::curvV() const {
-     return(m_curvV);
-   }
-
-   inline const Amg::Vector3D& CurvilinearUVT::curvT() const {
-     return(m_curvT);
-   }  
-   
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& operator << ( MsgStream& sl, const CurvilinearUVT& uvt);
 std::ostream& operator << ( std::ostream& sl, const CurvilinearUVT& uvt); 
-
 }
 
+#include "TrkEventPrimitives/CurvilinearUVT.icc"
 #endif // TRKEVENTPRIMITIVES_CURVILINEARUV_H
 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.icc
new file mode 100644
index 000000000000..865c4fc7e5b2
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/CurvilinearUVT.icc
@@ -0,0 +1,40 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+namespace Trk {
+
+inline CurvilinearUVT::CurvilinearUVT(const Amg::Vector3D& dir)
+  : m_curvT(dir)
+{
+  // make it safe for tracks progressing along the z axis
+  if (std::abs(dir.normalized().dot(Amg::Vector3D::UnitZ())) < 0.99) {
+    Amg::Vector3D curvZcrossT = -(m_curvT.cross(Amg::Vector3D::UnitZ()));
+    m_curvU = curvZcrossT.normalized();
+    m_curvV = m_curvT.cross(m_curvU);
+  } else {
+    Amg::Vector3D curvZcrossT = -(m_curvT.cross(Amg::Vector3D::UnitX()));
+    m_curvU = curvZcrossT.normalized();
+    m_curvV = m_curvT.cross(m_curvU);
+  }
+}
+
+inline const Amg::Vector3D&
+CurvilinearUVT::curvU() const
+{
+  return (m_curvU);
+}
+
+inline const Amg::Vector3D&
+CurvilinearUVT::curvV() const
+{
+  return (m_curvV);
+}
+
+inline const Amg::Vector3D&
+CurvilinearUVT::curvT() const
+{
+  return (m_curvT);
+}
+
+}
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/DefinedParameter.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/DefinedParameter.h
index 183f7b817c35..f32a56426995 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/DefinedParameter.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/DefinedParameter.h
@@ -1,31 +1,31 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// DefinedParameter.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-#ifndef TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
-#define TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
-
-//Trk
-#include "TrkEventPrimitives/ParamDefs.h"
-// STL
-#include <utility>
-
-/** standard namespace for Tracking*/
-namespace Trk {
-
-  /** @typedef  DefinedParameter
-    
-    Typedef to of a std::pair<double, ParamDefs>
-    to identify a passed-through double as a specific type of parameter
-    
-    @author Andreas.Salzburger@cern.ch 
-  */
-  typedef std::pair<double, ParamDefs> DefinedParameter;
-
-}
-
-#endif // TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
+///////////////////////////////////////////////////////////////////
+// DefinedParameter.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+#ifndef TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
+#define TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
+
+//Trk
+#include "TrkEventPrimitives/ParamDefs.h"
+// STL
+#include <utility>
+
+/** standard namespace for Tracking*/
+namespace Trk {
+
+  /** @typedef  DefinedParameter
+    
+    Typedef to of a std::pair<double, ParamDefs>
+    to identify a passed-through double as a specific type of parameter
+    
+    @author Andreas.Salzburger@cern.ch 
+  */
+  typedef std::pair<double, ParamDefs> DefinedParameter;
+
+}
+
+#endif // TRKEVENTPRIMITIVES_DEFINEDPARAMETER_H
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.h
index 41d2c1a799c3..4f777e1c0c88 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.h
@@ -9,9 +9,8 @@
 #ifndef TRKEVENTPRIMITIVES_TRKFITQUALITY_H
 #define TRKEVENTPRIMITIVES_TRKFITQUALITY_H
 
-
-#include <iostream>
 #include <cmath>
+#include <iostream>
 
 class MsgStream;
 
@@ -26,73 +25,54 @@ namespace Trk {
         a measurement and of the overall track. However, it can
         be extended as necessary.
 
-        @author Edward.Moyse@cern.ch, Andreas.Salzburger@cern.ch  
+        @author Edward.Moyse@cern.ch, Andreas.Salzburger@cern.ch
 */
 
-        class FitQuality
-    {
-    public:
+class FitQuality
+{
+public:
+  /** default ctor for POOL*/
+  FitQuality() = default;
 
-        /** default ctor for POOL*/
-        FitQuality();
-        /** Constructor with @f$ \chi^2 @f$ and @f$ n_{dof} @f$ */ 
-        FitQuality (double chiSquared, int numberDoF); 
+  FitQuality(const FitQuality&) = default;
+  FitQuality(FitQuality&&) = default;
+  FitQuality& operator=(const FitQuality&) = default;
+  FitQuality& operator=(FitQuality&&) = default;
+  virtual ~FitQuality() = default;
 
-        /**Constructor hadling double type of NDF*/
-        FitQuality (double chiSquared, double numberDoF); 
+  /** Constructor with @f$ \chi^2 @f$ and @f$ n_{dof} @f$ */
+  FitQuality(double chiSquared, int numberDoF);
 
-        /** Copy constructor */
-        FitQuality( const FitQuality& rhs);
-        
-        ///Assignment
-        FitQuality & operator=(const FitQuality& /*rhs*/) = default;
+  /**Constructor hadling double type of NDF*/
+  FitQuality(double chiSquared, double numberDoF);
 
-        /** Destructor */
-        virtual ~FitQuality();
+  /**Virtual constructor */
+  virtual FitQuality* clone() const;
 
-        /**Virtual constructor */
-        virtual FitQuality* clone() const;
+  /** returns the @f$ \chi^2 @f$ of the overall track fit*/
+  double chiSquared() const;
 
-        /** returns the @f$ \chi^2 @f$ of the overall track fit*/
-        double chiSquared() const;
+  /** returns the number of degrees of freedom of the overall track or
+  vertex fit as integer */
+  int numberDoF() const;
 
-        /** returns the number of degrees of freedom of the overall track or
-        vertex fit as integer */
-        int  numberDoF() const;
+  /** returns the number of degrees of freedom of the overall track or
+  vertex fit as double */
+  double doubleNumberDoF() const;
 
-        /** returns the number of degrees of freedom of the overall track or
-        vertex fit as double */
-        double  doubleNumberDoF() const;
+private:
+  double m_chiSquared;
+  double m_numberDoF;
 
-    private:
-        double m_chiSquared;
-        double m_numberDoF;
-
-    };//end of class definitions 
+}; // end of class definitions
 
 /**Overload of << operator for MsgStream for debug output*/
-    MsgStream& operator << ( MsgStream& sl, const FitQuality& fq);
+MsgStream&
+operator<<(MsgStream& sl, const FitQuality& fq);
 /**Overload of << operator for std::ostream for debug output*/
-    std::ostream& operator << ( std::ostream& sl, const FitQuality& fq);
-
-    inline FitQuality* FitQuality::clone() const
-        { return new FitQuality(*this); }
-
-    inline double FitQuality::chiSquared() const
-    {
-        return m_chiSquared;
-    }
-
-    inline int FitQuality::numberDoF() const
-    {
-        return static_cast<int>(floor(m_numberDoF+0.5));
-    }
-
-    inline double  FitQuality::doubleNumberDoF() const
-    {
-        return m_numberDoF;
-    }
-
-} //end ns
+std::ostream&
+operator<<(std::ostream& sl, const FitQuality& fq);
 
+} // end ns
+#include "TrkEventPrimitives/FitQuality.icc"
 #endif // TRKEVENTPRIMITIVES_FITQUALITY_H
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.icc
new file mode 100644
index 000000000000..384f87f60295
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/FitQuality.icc
@@ -0,0 +1,39 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+namespace Trk {
+inline FitQuality*
+FitQuality::clone() const
+{
+  return new FitQuality(*this);
+}
+
+inline double
+FitQuality::chiSquared() const
+{
+  return m_chiSquared;
+}
+
+inline int
+FitQuality::numberDoF() const
+{
+  return static_cast<int>(floor(m_numberDoF + 0.5));
+}
+
+inline double
+FitQuality::doubleNumberDoF() const
+{
+  return m_numberDoF;
+}
+inline Trk::FitQuality::FitQuality(double chiSquared, int numberDoF)
+  : m_chiSquared(double(chiSquared))
+  , m_numberDoF(numberDoF)
+{}
+
+inline Trk::FitQuality::FitQuality(double chiSquared, double numberDoF)
+  : m_chiSquared(chiSquared)
+  , m_numberDoF(numberDoF)
+{}
+
+}
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCotThetaPtToThetaP.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCotThetaPtToThetaP.h
index 1b7357317b9c..a886d63a42c2 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCotThetaPtToThetaP.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCotThetaPtToThetaP.h
@@ -43,7 +43,6 @@ namespace Trk {
 
     public:
       JacobianCotThetaPtToThetaP(const double cotTheta, const double qpT);
-      ~JacobianCotThetaPtToThetaP();   
   };
 
 } // end of namespace
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCurvilinearToLocal.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCurvilinearToLocal.h
index 7924024f4d88..6b516e323995 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCurvilinearToLocal.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianCurvilinearToLocal.h
@@ -81,19 +81,14 @@ namespace Trk {
                                   );
      /**Constructor for helix track model
        */
-     JacobianCurvilinearToLocal(  const Amg::Vector3D& bfield,
-								  double qOp,
-								  double sinTheta,               // only necessary if magnetic field is not along z
-                                  const CurvilinearUVT& curvUVT,
-                                  const Amg::Vector3D& locX,
-                                  const Amg::Vector3D& locY,
-                                  const Amg::Vector3D& locZ
-                                  );     
-     /** destructor */
-     ~JacobianCurvilinearToLocal();
-
-    private:
-
+     JacobianCurvilinearToLocal(
+       const Amg::Vector3D& bfield,
+       double qOp,
+       double sinTheta, // only necessary if magnetic field is not along z
+       const CurvilinearUVT& curvUVT,
+       const Amg::Vector3D& locX,
+       const Amg::Vector3D& locY,
+       const Amg::Vector3D& locZ);
  };
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianLocalToCurvilinear.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianLocalToCurvilinear.h
index 266c23ed9f06..2c4b838841d6 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianLocalToCurvilinear.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianLocalToCurvilinear.h
@@ -71,18 +71,12 @@ namespace Trk {
                                   const Amg::Vector3D& locY);
 
      /**Constructor for helical track model */
-     JacobianLocalToCurvilinear(  const Amg::Vector3D& bfield,
-								  double qOp,
-								  double sinTheta,
-                                  const CurvilinearUVT& curvUVT,
-                                  const Amg::Vector3D& locX,
-                                  const Amg::Vector3D& locY);
-
-     /** destructor */
-     ~JacobianLocalToCurvilinear();
-
-    private:
-
+     JacobianLocalToCurvilinear(const Amg::Vector3D& bfield,
+                                double qOp,
+                                double sinTheta,
+                                const CurvilinearUVT& curvUVT,
+                                const Amg::Vector3D& locX,
+                                const Amg::Vector3D& locY);
  };
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianThetaPToCotThetaPt.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianThetaPToCotThetaPt.h
index 2e88d804fb65..fab18987af63 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianThetaPToCotThetaPt.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/JacobianThetaPToCotThetaPt.h
@@ -41,7 +41,6 @@ namespace Trk {
   class JacobianThetaPToCotThetaPt : public AmgMatrix(5,5) {
     public:
       JacobianThetaPToCotThetaPt(const double theta, const double qp);
-      ~JacobianThetaPToCotThetaPt();
   };
 
 } // end of namespace
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h
index 3a850b9062b9..83427c95d017 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalDirection.h
@@ -16,85 +16,94 @@ class MsgStream;
 /** standard namespace for Tracking*/
 namespace Trk {
 
-  /** @class LocalDirection
-      @brief represents the three-dimensional global direction with respect
-             to a planar surface frame.
-    
-     <b>LocalDirection Class</b><br>
-     Class to represent the three-dimensional global direction with respect to a
-     planar surface frame.
+/** @class LocalDirection
+    @brief represents the three-dimensional global direction with respect
+           to a planar surface frame.
 
-     The two angles @f$ \alpha_{xz} @f$ and @f$ \alpha_{yz} @f$ describe the angles of the momentum within the two projections onto the xz plane respectively the yz plane of the surface-intrinsic (x,y,z) cartesian frame.
+   <b>LocalDirection Class</b><br>
+   Class to represent the three-dimensional global direction with respect to a
+   planar surface frame.
 
-     The transformation between local and global direction coordinates is done as follows:
-     May @f$ T @f$ denote the transformation of the local frame to the global frame, such that a point
-     @f$ \lambda @f$ expressed in the local frame coordinates transforms to a global point @f$ \gamma @f$ 
-     by the use of @f$ T @f$ like:
+   The two angles @f$ \alpha_{xz} @f$ and @f$ \alpha_{yz} @f$ describe the
+  angles of the momentum within the two projections onto the xz plane
+  respectively the yz plane of the surface-intrinsic (x,y,z) cartesian frame.
 
-     @f$ \gamma = T(\lambda) @f$ and similarily
-     @f$ \lambda = T^{-1} (\gamma) @f$.
-     
-     1) Local direction to global direction:
-     Given @f$ \alpha_{xz} @f$ and @f$ \alpha_{yz} @f$ in the local frame, the 3-dim direciton in the local frame
-     can be expressed as:
+   The transformation between local and global direction coordinates is done as
+  follows: May @f$ T @f$ denote the transformation of the local frame to the
+  global frame, such that a point
+   @f$ \lambda @f$ expressed in the local frame coordinates transforms to a
+  global point @f$ \gamma @f$ by the use of @f$ T @f$ like:
 
-     @f$ \vec d = (d_{z}/tan(\alpha_{xz}), d_{z}/tan(\alpha_{yz}), d_{z}) @f$
+   @f$ \gamma = T(\lambda) @f$ and similarily
+   @f$ \lambda = T^{-1} (\gamma) @f$.
 
-     using the constraint that the direciton is normalized:
+   1) Local direction to global direction:
+   Given @f$ \alpha_{xz} @f$ and @f$ \alpha_{yz} @f$ in the local frame, the
+  3-dim direciton in the local frame can be expressed as:
 
-     @f$ d^{2} = 1 = \frac{d_{z}^{2}}{tan^{2}(\alpha_{xz}} + \frac{d_{z}^{2}}{tan^{2}(\alpha_{yz}} + d_{z}^{2} @f$,
-     @f$ d_{z} @f$ can be evaluated as:
+   @f$ \vec d = (d_{z}/tan(\alpha_{xz}), d_{z}/tan(\alpha_{yz}), d_{z}) @f$
 
-     @f$ d_{z} = \frac{tan(\alpha_{xz})tan(\alpha_{yz})}{\sqrt{tan^{2}(\alpha_{xz})+
-                                                              tan^{2}(\alpha_{yz})+
-                                                             tan^{2}(\alpha_{xz})tan^{2}(\alpha_{yz})}} @f$
+   using the constraint that the direciton is normalized:
 
-    The global direcion @f$ D @f$ is then, using @f$ T @f$:
-         @f$ D = T(d) @f$        
+   @f$ d^{2} = 1 = \frac{d_{z}^{2}}{tan^{2}(\alpha_{xz}} +
+  \frac{d_{z}^{2}}{tan^{2}(\alpha_{yz}} + d_{z}^{2} @f$,
+   @f$ d_{z} @f$ can be evaluated as:
 
-    2) Global direction to local direcion:
-    Constructing the global direction from the local one is straight forwardly done, such that @f$ D @f$ is transformed into the local frame by using @f$ T^{-1} @f$:
+   @f$ d_{z} =
+  \frac{tan(\alpha_{xz})tan(\alpha_{yz})}{\sqrt{tan^{2}(\alpha_{xz})+
+                                                            tan^{2}(\alpha_{yz})+
+                                                           tan^{2}(\alpha_{xz})tan^{2}(\alpha_{yz})}}
+  @f$
 
-      @f$ d = T^{-1}(D) @f$
+  The global direcion @f$ D @f$ is then, using @f$ T @f$:
+       @f$ D = T(d) @f$
 
-    and @f$ \alpha_{xz} @f$ respectively @f$ \alpha_{yz} @f$ are then determined as:
+  2) Global direction to local direcion:
+  Constructing the global direction from the local one is straight forwardly
+  done, such that @f$ D @f$ is transformed into the local frame by using @f$
+  T^{-1} @f$:
 
-    @f$ \alpha_{xz} = atan(d_{z}, d_{x}) @f$, respectively @f$ \alpha_{xz} = atan(d_{z}, d_{y}) @f$.
-    
+    @f$ d = T^{-1}(D) @f$
 
-     \todo  add image of Jean-Francois
+  and @f$ \alpha_{xz} @f$ respectively @f$ \alpha_{yz} @f$ are then determined
+  as:
 
-     @author Andreas.Salzburger@cern.ch    
-    */
-  
-  class LocalDirection {
+  @f$ \alpha_{xz} = atan(d_{z}, d_{x}) @f$, respectively @f$ \alpha_{xz} =
+  atan(d_{z}, d_{y}) @f$.
 
-  public: 
-    
-    LocalDirection() {};
-    
-    LocalDirection(double axz, double ayz) : 
-	m_angleXZ(axz),
-        m_angleYZ(ayz) 
-    {}	
 
-    /** access method for angle of local XZ projection */ 
-    const double& angleXZ() const;
+   \todo  add image of Jean-Francois
+
+   @author Andreas.Salzburger@cern.ch
+  */
+
+class LocalDirection
+{
+
+public:
+  LocalDirection()=default;
+  LocalDirection(double axz, double ayz)
+    : m_angleXZ(axz)
+    , m_angleYZ(ayz)
+  {}
+
+  /** access method for angle of local XZ projection */
+  double angleXZ() const;
 
-    /** access method for angle of local YZ projection */ 
-    const double& angleYZ() const;
+  /** access method for angle of local YZ projection */
+  double angleYZ() const;
 
-  protected:
-    double m_angleXZ = 0.;
-    double m_angleYZ = 0.;
+protected:
+  double m_angleXZ = 0.;
+  double m_angleYZ = 0.;
 
   };
 
 /** inline access method */
-inline const double& LocalDirection::angleXZ() const { return m_angleXZ; }
+inline double LocalDirection::angleXZ() const { return m_angleXZ; }
 
 /** inline access method */
-inline const double& LocalDirection::angleYZ() const { return m_angleYZ; }
+inline double LocalDirection::angleYZ() const { return m_angleYZ; }
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& operator << ( MsgStream& sl, const LocalDirection& lomo);
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.h
index 9e613e4ad4e5..45ebf165d942 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.h
@@ -99,7 +99,14 @@ namespace Trk {
     public:
       /**Default constructor used for POOL */
       LocalParameters();
-      
+
+      //default other operations 
+      LocalParameters(const LocalParameters&) = default;
+      LocalParameters(LocalParameters&&) = default;
+      LocalParameters& operator=(const LocalParameters&) = default;
+      LocalParameters& operator=(LocalParameters&&) = default;
+      ~LocalParameters() = default;
+
       /**Default constructor with dimension */
       LocalParameters(int dim);
       
@@ -119,18 +126,9 @@ namespace Trk {
       /**Dynamical constructor */                
       LocalParameters(const std::vector<DefinedParameter>& );
 
-      /** Copy constructor */
-      LocalParameters(const LocalParameters& );
-    
-      /** Virtual destructor */
-      virtual ~LocalParameters();
-
       /**Pseudo-constructor */
       LocalParameters* clone() const;
       
-      /** Assignment */
-      LocalParameters& operator=(const LocalParameters& );
-
       /** Reduction matrix from 5x5 to the [dimension()]x[dimension()] */
       const Amg::MatrixX& reductionMatrix() const;
       
@@ -144,25 +142,25 @@ namespace Trk {
       int parameterKey() const;
       
       /** The simple check for the clients wheter the parameter is contained */
-      inline bool contains(ParamDefs par) const;
+      bool contains(ParamDefs par) const;
 
       /**Read from data members */
-      inline const double & operator[](ParamDefs par) const;
+      const double & operator[](ParamDefs par) const;
       
       /**Write data members */      
-      inline double & operator[](ParamDefs par);
+      double & operator[](ParamDefs par);
       
         /**Retrieve specified parameter (const version). There is NO check to see if a parameter is contained, 
         so consider using contains(ParamDefs par) to make sure it is actually defined for this object.
         @param par Parameters requested to be return
         @return Value of stored parameter (or undefined, if the parameter is not used in this object i.e. be SURE it is!) */
-      inline double get(ParamDefs par) const;
+      double get(ParamDefs par) const;
 
         /**Retrieve specified parameter. There is NO check to see if a parameter is contained, 
         so consider using contains(ParamDefs par) to make sure it is actually defined for this object.
         @param par Parameters requested to be return
         @return Value of stored parameter (or undefined, if the parameter is not used in this object i.e. be SURE it is!) */
-      inline double get(ParamDefs par);
+      double get(ParamDefs par);
       
       /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
       friend MsgStream& operator << ( MsgStream& sl, const LocalParameters& lp);
@@ -175,33 +173,9 @@ namespace Trk {
      
     private: 
      static const ProjectionMatricesSet s_projectionMatrices;
-     
   };    
-
-inline LocalParameters* LocalParameters::clone() const { return new LocalParameters(*this); }  
-  
-inline int LocalParameters::dimension() const { return Amg::VectorX::rows(); }    
-
-inline int LocalParameters::parameterKey() const { return m_parameterkey; }
-
-inline bool LocalParameters::contains(ParamDefs par) const
-{ return (m_parameterkey & (1<< int(par))); }
-
-inline const double& LocalParameters::operator[](ParamDefs par) const
-{ 
-  if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) { return Amg::VectorX::operator[](par);}
-  return Amg::VectorX::operator[](s_projectionMatrices.accessor(m_parameterkey, par)); }
-
-inline double& LocalParameters::operator[](ParamDefs par)
-{ 
-   if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) { return Amg::VectorX::operator[](par);}
-   return Amg::VectorX::operator[](s_projectionMatrices.accessor(m_parameterkey, par)); }
-        
-inline double LocalParameters::get(ParamDefs par) const { return (*this)[par]; }
-
-inline double LocalParameters::get(ParamDefs par)       { return (*this)[par]; }
-        
+       
 } // end of namespace
 
-
+#include "TrkEventPrimitives/LocalParameters.icc"
 #endif // TRKEVENTPRIMITIVES_LOCALPARAMETERS_H
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.icc
new file mode 100644
index 000000000000..a9a12d34a074
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/LocalParameters.icc
@@ -0,0 +1,59 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+namespace Trk {
+inline LocalParameters*
+LocalParameters::clone() const
+{
+  return new LocalParameters(*this);
+}
+
+inline int
+LocalParameters::dimension() const
+{
+  return Amg::VectorX::rows();
+}
+
+inline int
+LocalParameters::parameterKey() const
+{
+  return m_parameterkey;
+}
+
+inline bool
+LocalParameters::contains(ParamDefs par) const
+{
+  return (m_parameterkey & (1 << int(par)));
+}
+
+inline const double& LocalParameters::operator[](ParamDefs par) const
+{
+  if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) {
+    return Amg::VectorX::operator[](par);
+  }
+  return Amg::VectorX::operator[](
+    s_projectionMatrices.accessor(m_parameterkey, par));
+}
+
+inline double& LocalParameters::operator[](ParamDefs par)
+{
+  if (m_parameterkey == 31 || m_parameterkey == 1 || m_parameterkey == 3) {
+    return Amg::VectorX::operator[](par);
+  }
+  return Amg::VectorX::operator[](
+    s_projectionMatrices.accessor(m_parameterkey, par));
+}
+
+inline double
+LocalParameters::get(ParamDefs par) const
+{
+  return (*this)[par];
+}
+
+inline double
+LocalParameters::get(ParamDefs par)
+{
+  return (*this)[par];
+}
+}
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.h
index 9ae5bc4c851d..b6b46112f7e4 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -12,178 +12,41 @@
 // Fatras
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 // STD
-#include <cmath>  
+#include <cmath>
 
 namespace Trk {
 
-    /** @class PdgToParticleHypothesis 
+/** @class PdgToParticleHypothesis
 
-small converter from the (abs) PDG code 
+small converter from the (abs) PDG code
 to the particle hypothsis used in Tracking
 
 @author Andreas.Salzburger@cern.ch
 
 **/
 
-class PdgToParticleHypothesis {
-
-  public:
-    /** Constructor */
-    PdgToParticleHypothesis(){}
-
-    /** ~Destructor */
-    ~PdgToParticleHypothesis(){}
-
-    /** Converter method : PDG -> Particle Hyptothesis */
-    Trk::ParticleHypothesis  convert(int pdg, bool& stable, bool& exiting, double charge=1.) const;
-
-    /** Converter method : PDG -> Particle Hyptothesis , w/o stable exiting*/
-    Trk::ParticleHypothesis  convert(int pdg, double charge=1.) const;
+class PdgToParticleHypothesis
+{
 
+public:
+  /** Constructor */
+  PdgToParticleHypothesis() = default;
 
-    /** Converter method : Particle Hyptothesis -> PDG*/
-    int convert(Trk::ParticleHypothesis particleHypo, double charge, bool dist=true) const;
+  /** Converter method : PDG -> Particle Hyptothesis */
+  Trk::ParticleHypothesis convert(int pdg,
+                                  bool& stable,
+                                  bool& exiting,
+                                  double charge = 1.) const;
 
+  /** Converter method : PDG -> Particle Hyptothesis , w/o stable exiting*/
+  Trk::ParticleHypothesis convert(int pdg, double charge = 1.) const;
 
+  /** Converter method : Particle Hyptothesis -> PDG*/
+  int convert(Trk::ParticleHypothesis particleHypo,
+              double charge,
+              bool dist = true) const;
 };
-
-inline Trk::ParticleHypothesis PdgToParticleHypothesis::convert(int pdg, double charge) const {
-    bool stable, exiting; 
-    return convert(pdg,stable,exiting,charge); 
 }
 
-
-inline Trk::ParticleHypothesis PdgToParticleHypothesis::convert(int pdg, bool& stable, bool& exiting, double charge) const {
-
-    int pdgCode = abs(pdg);
-
-    stable       = false;
-    exiting      = false;
-
-    Trk::ParticleHypothesis particleType;
-
-  // try to follow number of appearance 
-    switch (pdgCode )
-    {
-    // leptons
-        case 11: // e+/e-
-        particleType = Trk::electron;
-        stable       = true;
-        exiting      = false;
-        break;
-        case 13: // mu+/mu-
-        particleType = Trk::muon;
-        stable       = false;
-        exiting      = false;
-        break;
-        case 12: // e neutrino
-        case 14: // mu neutrino
-        case 16: // tau neutrino
-        particleType = Trk::nonInteracting;
-        stable       = true;
-        exiting      = true;
-        break;
-        case 22: // gamma
-        particleType = Trk::photon;
-        stable       = true;
-        exiting      = false;
-        break; 
-        case 211: // pi+/pi-
-        particleType = Trk::pion;
-        stable       = false;
-        exiting      = false;
-        break;
-        case 111: // pi0
-        particleType = Trk::pi0;              
-        stable       = false;
-        exiting      = false;
-        break;
-        case 2212: // proton
-        particleType = Trk::proton;
-        stable       = true;
-        exiting      = false;
-        break;
-        case 2112: // neutron               
-        particleType = Trk::neutron;
-        stable       = true;
-        exiting      = true;
-        break;
-        case 321: // K
-        particleType = Trk::kaon;
-        stable       = false;
-        exiting      = false;
-        break;
-        case 130: // K_long
-        particleType = Trk::k0;
-        stable       = false;
-        exiting      = false;
-        break;
-        case 310: // K_short
-        particleType = Trk::k0;
-        stable       = false;
-        exiting      = false;
-        break;
-        default: // treat mesons as pions
-        particleType = charge != 0. ? Trk::pion : Trk::pi0 ;                               
-        stable       = false;
-        exiting      = false;
-    }
-
-  // and all baryons as proton hypo
-    if (pdgCode > 999 && pdgCode!=2112 )
-    {
-        particleType = charge != 0. ? Trk::proton : Trk::neutron ;
-        stable       = false;
-        exiting      = false;
-    }
-
-  // ignore SUSY particles for now
-    if (pdgCode > 1000000)
-    {
-        particleType = Trk::nonInteracting;
-        stable       = true;
-        exiting      = true;
-    }
-
-    return particleType;
-}
-
-
-inline int PdgToParticleHypothesis::convert(Trk::ParticleHypothesis particleHypo, double charge, bool dist) const 
-{
-
-    int pdg = 0;
-
-    switch (particleHypo) {
-     // the electron case
-        case Trk::electron   :  {  pdg = 11; pdg *= charge > 0. ? -1 : 1;   } return pdg;  
-     // the muon case
-        case Trk::muon       :  {  pdg = 13; pdg *= charge > 0. ? -1 : 1;   } return pdg;  
-     // the kaon case
-        case Trk::kaon       :  {  pdg = 321; pdg *= charge > 0. ? 1 : -1; 
-            if (charge*charge < 0.0001)
-                pdg = dist ? 130 : 310;                } return pdg;
-     // the proton case
-            case Trk::proton     :  {  pdg = 2212; pdg *= charge > 0. ? 1 : -1; 
-                if (charge*charge < 0.0001)
-                    pdg = dist ? 2112 : -2112;             } return pdg;
-     // the photon case
-                case Trk::photon     :  { pdg = 22;                                   } return pdg;
-     // the neutron case
-                case Trk::neutron     :  { pdg = 2112;                                } return pdg;
-     // the neutral pion case
-                case Trk::pi0         :  { pdg = 111;                      } return pdg;
-     // the neutral kaon case
-                case Trk::k0          :  { pdg = dist ? 130 : 310;                      } return pdg;
-     // the pion case - is the default
-                default              :  {  pdg = 211; pdg *= charge > 0. ? 1 : -1; 
-                    if (charge*charge < 0.0001)
-                        pdg = 111;                             };  
-                }
-
-                return pdg;
-            }
-
-
-        }
+#include "TrkEventPrimitives/PdgToParticleHypothesis.icc"
 #endif
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.icc
new file mode 100644
index 000000000000..24c4dd2abf0a
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/PdgToParticleHypothesis.icc
@@ -0,0 +1,190 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+namespace Trk {
+inline Trk::ParticleHypothesis
+PdgToParticleHypothesis::convert(int pdg, double charge) const
+{
+  bool stable, exiting;
+  return convert(pdg, stable, exiting, charge);
+}
+
+inline Trk::ParticleHypothesis
+PdgToParticleHypothesis::convert(int pdg,
+                                 bool& stable,
+                                 bool& exiting,
+                                 double charge) const
+{
+
+  int pdgCode = abs(pdg);
+
+  stable = false;
+  exiting = false;
+
+  Trk::ParticleHypothesis particleType;
+
+  // try to follow number of appearance
+  switch (pdgCode) {
+      // leptons
+    case 11: { // e+/e-
+      particleType = Trk::electron;
+      stable = true;
+      exiting = false;
+      break;
+    }
+    case 13: { // mu+/mu-
+      particleType = Trk::muon;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    case 12:   // e neutrino
+    case 14:   // mu neutrino
+    case 16: { // tau neutrino
+      particleType = Trk::nonInteracting;
+      stable = true;
+      exiting = true;
+      break;
+    }
+    case 22: { // gamma
+      particleType = Trk::photon;
+      stable = true;
+      exiting = false;
+      break;
+    }
+    case 211: { // pi+/pi-
+      particleType = Trk::pion;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    case 111: { // pi0
+      particleType = Trk::pi0;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    case 2212: { // proton
+      particleType = Trk::proton;
+      stable = true;
+      exiting = false;
+      break;
+    }
+    case 2112: { // neutron
+      particleType = Trk::neutron;
+      stable = true;
+      exiting = true;
+      break;
+    }
+    case 321: { // K
+      particleType = Trk::kaon;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    case 130: { // K_long
+      particleType = Trk::k0;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    case 310: { // K_short
+      particleType = Trk::k0;
+      stable = false;
+      exiting = false;
+      break;
+    }
+    default: { // treat mesons as pions
+      particleType = charge != 0. ? Trk::pion : Trk::pi0;
+      stable = false;
+      exiting = false;
+    }
+  }
+
+  // and all baryons as proton hypo
+  if (pdgCode > 999 && pdgCode != 2112) {
+    particleType = charge != 0. ? Trk::proton : Trk::neutron;
+    stable = false;
+    exiting = false;
+  }
+
+  // ignore SUSY particles for now
+  if (pdgCode > 1000000) {
+    particleType = Trk::nonInteracting;
+    stable = true;
+    exiting = true;
+  }
+
+  return particleType;
+}
+
+inline int
+PdgToParticleHypothesis::convert(Trk::ParticleHypothesis particleHypo,
+                                 double charge,
+                                 bool dist) const
+{
+
+  int pdg = 0;
+
+  switch (particleHypo) {
+      // the electron case
+    case Trk::electron: {
+      pdg = 11;
+      pdg *= charge > 0. ? -1 : 1;
+      return pdg;
+    }
+      // the muon case
+    case Trk::muon: {
+      pdg = 13;
+      pdg *= charge > 0. ? -1 : 1;
+      return pdg;
+    }
+      // the kaon case
+    case Trk::kaon: {
+      pdg = 321;
+      pdg *= charge > 0. ? 1 : -1;
+      if (charge * charge < 0.0001)
+        pdg = dist ? 130 : 310;
+      return pdg;
+    }
+      // the proton case
+    case Trk::proton: {
+      pdg = 2212;
+      pdg *= charge > 0. ? 1 : -1;
+      if (charge * charge < 0.0001)
+        pdg = dist ? 2112 : -2112;
+      return pdg;
+    }
+      // the photon case
+    case Trk::photon: {
+      pdg = 22;
+      return pdg;
+    }
+      // the neutron case
+    case Trk::neutron: {
+      pdg = 2112;
+      return pdg;
+    }
+      // the neutral pion case
+    case Trk::pi0: {
+      pdg = 111;
+      return pdg;
+    }
+      // the neutral kaon case
+    case Trk::k0: {
+      pdg = dist ? 130 : 310;
+      return pdg;
+    }
+      // the pion case - is the default
+    default: {
+      pdg = 211;
+      pdg *= charge > 0. ? 1 : -1;
+      if (charge * charge < 0.0001)
+        pdg = 111;
+    }
+  }
+
+  return pdg;
+}
+}
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.h
index 774f393078b3..5db42aca35cb 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -19,124 +19,100 @@
 
 namespace Trk {
 /** @brief This class containes residual and pull information.
-    
+
     Beside the values of the residual and pull the parameterKey belonging
     to the measurement and information about the residual type are stored
     in this class. One should distinguish (at least) four types of residuals:
-    - the residual between reconstructed track state and MC truth: @f$ r_i = x_i - {x_{truth}}_i @f$
-      with the pull: @f$ p_i = \frac{x_i - {x_{truth}}_i}{\sigma(x_i)} @f$
-    - biased residual belonging to a track state, which includes the considered measurement: @f$ r_i = m_i - x_i @f$
-      with the related pull: @f$ p_i = \frac{m_i - x_i}{\sqrt{\sigma(m_i)^2 - \sigma(x_i)^2}} @f$
+    - the residual between reconstructed track state and MC truth: @f$ r_i = x_i
+   - {x_{truth}}_i @f$ with the pull: @f$ p_i = \frac{x_i -
+   {x_{truth}}_i}{\sigma(x_i)} @f$
+    - biased residual belonging to a track state, which includes the considered
+   measurement: @f$ r_i = m_i - x_i @f$ with the related pull: @f$ p_i =
+   \frac{m_i - x_i}{\sqrt{\sigma(m_i)^2 - \sigma(x_i)^2}} @f$
     - alignment residuals belonging to a track state, which includes
       the considered measurement: @f$ r_i = m_i - x_i @f$
-      with the related pull: @f$ p_i = \frac{m_i - x_i}{\sqrt{\sigma(m_i)^2}} @f$
-    - unbiased residual belonging to a track state, which does not include the measurement: @f$ r_i = m_i - x_i^* @f$
-      with its pull: @f$ p_i = \frac{m_i - x_i^*}{\sqrt{\sigma(m_i)^2 + \sigma(x_i^*)^2}} @f$
+      with the related pull: @f$ p_i = \frac{m_i - x_i}{\sqrt{\sigma(m_i)^2}}
+   @f$
+    - unbiased residual belonging to a track state, which does not include the
+   measurement: @f$ r_i = m_i - x_i^* @f$ with its pull: @f$ p_i = \frac{m_i -
+   x_i^*}{\sqrt{\sigma(m_i)^2 + \sigma(x_i^*)^2}} @f$
 
     The ResidualType enum reflects the above distinction.
-    
+
     @author Sebastian.Fleischmann@cern.ch
 */
 
-class ResidualPull {
-    ///////////////////////////////////////////////////////////////////
-    // Public methods:
-    ///////////////////////////////////////////////////////////////////
+class ResidualPull
+{
+  ///////////////////////////////////////////////////////////////////
+  // Public methods:
+  ///////////////////////////////////////////////////////////////////
 
 public:
-
-  enum ResidualType {
-    McTruth = 0,   //!< RP between rec and true track intersection
-    Biased = 1,    //!< RP with track state including the hit
-    HitOnly = 2,   //!< RP with biased track state, but pull from hit only
-    Unbiased = 3,  //!< RP with track state that has measurement not included
+  enum ResidualType
+  {
+    McTruth = 0,  //!< RP between rec and true track intersection
+    Biased = 1,   //!< RP with track state including the hit
+    HitOnly = 2,  //!< RP with biased track state, but pull from hit only
+    Unbiased = 3, //!< RP with track state that has measurement not included
     NumberOfResidualTypes = 4
   };
 
   /**  default constructor */
-  ResidualPull();
+  ResidualPull() = default;
   /**  explicit constructor */
-  ResidualPull(const std::vector<double> &residual,
-               const std::vector<double> &pull,
-               const bool pullValid,
-               const ResidualType residualType,
-               const int parameterKey,
-               const double sineStripAngle=0.0);
-
-  /**  copy constructor */
-  ResidualPull(const ResidualPull&);
-  /**  destructor */
-  ~ResidualPull(){};
-  
+  ResidualPull(const std::vector<double>& residual,
+               const std::vector<double>& pull,
+               bool pullValid,
+               ResidualType residualType,
+               int parameterKey,
+               double sineStripAngle = 0.0);
 
   ///////////////////////////////////////////////////////////////////
   // Main methods
   ///////////////////////////////////////////////////////////////////
-    
-    //!  return residual vector
-    const std::vector<double>&  residual()  const;
-    
-    //!  return pull vector
-    const std::vector<double>&  pull()  const;
-    
-    /**  @brief returns false if the pull was calculated without a
-         valid covariance matrix
-         for the track parameters, this means the pull is not valid! */
-    bool isPullValid()  const;
-    
-    /** @brief  return the parameter key of the Trk::LocalParameters 
-        (of the measurement) used for the calculation */
-    int parameterKey()  const;
-    
-    //!  return the dimension of the residual and pull
-    int dimension() const;
-    
-    //!  returns residual type (truth/biased/unbiased etc)
-    ResidualType residualType()  const;
-
-    /** @brief returns strip angle wrt. local frame for fan-shaped
-        strip sensors, 0.0 for others */
-    double       sineStripAngle() const;
 
-protected:
+  //!  return residual vector
+  const std::vector<double>& residual() const;
 
-    ///////////////////////////////////////////////////////////////////
-    // Protected Data
-    ///////////////////////////////////////////////////////////////////
-    const std::vector<double> m_residual;
-    const std::vector<double> m_pull;
-    const bool m_pullValid;
-    const ResidualType m_residualType;
-    const int m_parameterKey;
-    const double m_sineStripAngle;
+  //!  return pull vector
+  const std::vector<double>& pull() const;
 
-};
+  /**  @brief returns false if the pull was calculated without a
+       valid covariance matrix
+       for the track parameters, this means the pull is not valid! */
+  bool isPullValid() const;
 
-/////////////////////////////////////////////////////////////////////////////////
-// Inline methods
-/////////////////////////////////////////////////////////////////////////////////
+  /** @brief  return the parameter key of the Trk::LocalParameters
+      (of the measurement) used for the calculation */
+  int parameterKey() const;
 
-inline const std::vector<double>&  ResidualPull::residual()  const {
-    return m_residual;
-}
+  //!  return the dimension of the residual and pull
+  int dimension() const;
 
-inline const std::vector<double>&  ResidualPull::pull()  const {
-    return m_pull;
-}
+  //!  returns residual type (truth/biased/unbiased etc)
+  ResidualType residualType() const;
 
-inline bool ResidualPull::isPullValid()  const {
-    return m_pullValid;
-}
+  /** @brief returns strip angle wrt. local frame for fan-shaped
+      strip sensors, 0.0 for others */
+  double sineStripAngle() const;
 
-inline ResidualPull::ResidualType
-   ResidualPull::residualType()  const {
-    return m_residualType;
-}
+protected:
+  ///////////////////////////////////////////////////////////////////
+  // Protected Data
+  ///////////////////////////////////////////////////////////////////
+  std::vector<double> m_residual;
+  std::vector<double> m_pull;
+  bool m_pullValid = false;
+  ResidualType m_residualType = Trk::ResidualPull::Biased;
+  int m_parameterKey = 0;
+  double m_sineStripAngle = 0.0;
+};
 
-inline double ResidualPull::sineStripAngle()  const {
-    return m_sineStripAngle;
-}
+/////////////////////////////////////////////////////////////////////////////////
+// Inline methods
+/////////////////////////////////////////////////////////////////////////////////
 
 } // end of name space
-
+#include "TrkEventPrimitives/ResidualPull.icc"
 #endif // TRK_RESIDUALPULL_H
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
new file mode 100644
index 000000000000..c47bd50e8749
--- /dev/null
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/ResidualPull.icc
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+namespace Trk {
+// constructor with parameters
+inline Trk::ResidualPull::ResidualPull(
+  const std::vector<double>& residual,
+  const std::vector<double>& pull,
+  bool pullValid,
+  Trk::ResidualPull::ResidualType type,
+  int parameterKey,
+  double sineStripAngle)
+  : m_residual(residual)
+  , m_pull(pull)
+  , m_pullValid(pullValid)
+  , m_residualType(type)
+  , m_parameterKey(parameterKey)
+  , m_sineStripAngle(sineStripAngle)
+{
+  if (m_residual.size() != m_pull.size()) {
+    throw std::runtime_error(
+      "Trk::ResidualPull: residual and pull sizes differ");
+  }
+}
+
+// return the parameter key of the Trk::LocalParameters (of the measurement)
+// used for the calculation
+inline int
+Trk::ResidualPull::parameterKey() const
+{
+  return m_parameterKey;
+}
+
+// return the dimension of the residual and pull
+inline int
+Trk::ResidualPull::dimension() const
+{
+  return m_residual.size();
+}
+inline const std::vector<double>&
+ResidualPull::residual() const
+{
+  return m_residual;
+}
+
+inline const std::vector<double>&
+ResidualPull::pull() const
+{
+  return m_pull;
+}
+
+inline bool
+ResidualPull::isPullValid() const
+{
+  return m_pullValid;
+}
+
+inline ResidualPull::ResidualType
+ResidualPull::residualType() const
+{
+  return m_residualType;
+}
+
+inline double
+ResidualPull::sineStripAngle() const
+{
+  return m_sineStripAngle;
+}
+
+}
+
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/VertexType.h b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/VertexType.h
index c1b584f849fc..f165446c5cdd 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/VertexType.h
+++ b/Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/VertexType.h
@@ -21,19 +21,20 @@ namespace Trk {
     @author Andreas.Wildauer@cern.ch
    */
 
-   enum VertexType         {
-                            NoVtx   = 0,      //!< Dummy vertex, TrackParticle was not used in vertex fit
-                            PriVtx  = 1,      //!< Primary Vertex
-                            SecVtx  = 2,      //!< Secondary Vertex
-                            PileUp  = 3,      //!< Pile Up Vertex
-                            ConvVtx = 4,      //!< Converstion Vertex
-                            V0Vtx   = 5,      //!< Vertex from V0 Decay
-                            KinkVtx = 6,      //!< Kink Vertex
-			    V0Lambda = 7,     //!< Temporary addition for V0 Lambda
-			    V0LambdaBar = 8,  //!< Temporary addition for V0 LambdaBar
-			    V0KShort = 9,     //!< Temporary addition for KShort
-                            NotSpecified = -99 //!< this is the default
-                           };                            
+enum VertexType
+{
+  NoVtx = 0,         //!< Dummy vertex, TrackParticle was not used in vertex fit
+  PriVtx = 1,        //!< Primary Vertex
+  SecVtx = 2,        //!< Secondary Vertex
+  PileUp = 3,        //!< Pile Up Vertex
+  ConvVtx = 4,       //!< Converstion Vertex
+  V0Vtx = 5,         //!< Vertex from V0 Decay
+  KinkVtx = 6,       //!< Kink Vertex
+  V0Lambda = 7,      //!< Temporary addition for V0 Lambda
+  V0LambdaBar = 8,   //!< Temporary addition for V0 LambdaBar
+  V0KShort = 9,      //!< Temporary addition for KShort
+  NotSpecified = -99 //!< this is the default
+};
 } // end of namespace
 
 #endif // TRKEVENTPRIMITIVES_VERTEXTYPE_H
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/CurvilinearUVT.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/CurvilinearUVT.cxx
index f96f97e1e120..3624e6f654f8 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/CurvilinearUVT.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/CurvilinearUVT.cxx
@@ -11,9 +11,6 @@
 //Gaudi
 #include "GaudiKernel/MsgStream.h"
 
-Trk::CurvilinearUVT::~CurvilinearUVT()
-{}
-
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& Trk::operator << ( MsgStream& sl, const Trk::CurvilinearUVT& uvt)
 { 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/FitQuality.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/FitQuality.cxx
index a5024111b41d..87f076401c63 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/FitQuality.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/FitQuality.cxx
@@ -10,38 +10,6 @@
 #include "GaudiKernel/MsgStream.h"
 #include <string>
 
-Trk::FitQuality::FitQuality()
-	:
-	m_chiSquared(0.0),
-	m_numberDoF(0)
-{
-}
-
-Trk::FitQuality::FitQuality(double chiSquared, int numberDoF)
-	:
-	m_chiSquared(double(chiSquared)),
-	m_numberDoF(numberDoF)
-{
- 
-}
-
-Trk::FitQuality::FitQuality(double chiSquared, double numberDoF):
-	                                m_chiSquared(chiSquared),
-	                                  m_numberDoF(numberDoF)
-{
-}
-
-
-Trk::FitQuality::FitQuality(const FitQuality& rhs)
-{
-	m_chiSquared=rhs.m_chiSquared;
-	m_numberDoF= rhs.m_numberDoF;
-}
-
-Trk::FitQuality::~FitQuality()
-{
-}
-
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& Trk::operator << ( MsgStream& sl, const Trk::FitQuality& fq)
 { 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCotThetaPtToThetaP.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCotThetaPtToThetaP.cxx
index 0418c34581ab..ae6c0628abd9 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCotThetaPtToThetaP.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCotThetaPtToThetaP.cxx
@@ -23,8 +23,6 @@ Trk::JacobianCotThetaPtToThetaP::JacobianCotThetaPtToThetaP(const double cotThet
 }
 
 
-Trk::JacobianCotThetaPtToThetaP::~JacobianCotThetaPtToThetaP()
-{}
 
 
 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCurvilinearToLocal.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCurvilinearToLocal.cxx
index d038d315eab6..004d511a5f85 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCurvilinearToLocal.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianCurvilinearToLocal.cxx
@@ -42,15 +42,15 @@ Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(const CurvilinearUVT
 /** Calculates the Jacobian
   * for helical track model
   */
-Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(const Amg::Vector3D& bfield,
-															double qOp,
-                                                            double sinTheta,
-                                                            const CurvilinearUVT& curvUVT,
-                                                            const Amg::Vector3D& locX,
-                                                            const Amg::Vector3D& locY,
-                                                            const Amg::Vector3D& locZ
-                                                            ) :
-  AmgMatrix(5,5)()
+Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(
+  const Amg::Vector3D& bfield,
+  double qOp,
+  double sinTheta,
+  const CurvilinearUVT& curvUVT,
+  const Amg::Vector3D& locX,
+  const Amg::Vector3D& locY,
+  const Amg::Vector3D& locZ)
+  : AmgMatrix(5, 5)()
 {
     this->setIdentity();
     
@@ -88,8 +88,6 @@ Trk::JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(const Amg::Vector3D&
 }
 
 
-Trk::JacobianCurvilinearToLocal::~JacobianCurvilinearToLocal()
-{}
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& Trk::operator << ( MsgStream& sl, const Trk::JacobianCurvilinearToLocal& jac)
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianLocalToCurvilinear.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianLocalToCurvilinear.cxx
index d9fe7f421cf1..c5dd5ae94d88 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianLocalToCurvilinear.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianLocalToCurvilinear.cxx
@@ -77,8 +77,6 @@ Trk::JacobianLocalToCurvilinear::JacobianLocalToCurvilinear( const Amg::Vector3D
 
 }
 
-Trk::JacobianLocalToCurvilinear::~JacobianLocalToCurvilinear()
-{}
 
 /**Overload of << operator for both, MsgStream and std::ostream for debug output*/ 
 MsgStream& Trk::operator << ( MsgStream& sl, const Trk::JacobianLocalToCurvilinear& jac)
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianThetaPToCotThetaPt.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianThetaPToCotThetaPt.cxx
index 002b45789f47..9ecbd8dc9bbc 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianThetaPToCotThetaPt.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/JacobianThetaPToCotThetaPt.cxx
@@ -20,8 +20,3 @@ Trk::JacobianThetaPToCotThetaPt::JacobianThetaPToCotThetaPt(const double theta,
    (*this)(4,3) = - qp * std::cos(theta)/(sintheta*sintheta);
    (*this)(4,4) = 1.0 / sintheta;
 }
-
-
-Trk::JacobianThetaPToCotThetaPt::~JacobianThetaPToCotThetaPt()
-{}
-
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/LocalParameters.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/LocalParameters.cxx
index a4b8d2d207b9..3aa62ad78833 100755
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/LocalParameters.cxx
+++ b/Tracking/TrkEvent/TrkEventPrimitives/src/LocalParameters.cxx
@@ -87,24 +87,6 @@ Trk::LocalParameters::LocalParameters(const std::vector<Trk::DefinedParameter >&
   
 }
 
-Trk::LocalParameters::LocalParameters(const Trk::LocalParameters& lpars) :
-  Amg::VectorX(lpars),
-  m_parameterkey(lpars.m_parameterkey)
-{}
-
-Trk::LocalParameters::~LocalParameters()
-{}
-
-Trk::LocalParameters& Trk::LocalParameters::operator=(const Trk::LocalParameters& lpars)
-{
-  
-  if (this!=&lpars){
-     Amg::VectorX::operator=(lpars);
-     m_parameterkey = lpars.m_parameterkey;
-  }
-  return (*this);
-}
-
 const Amg::MatrixX& Trk::LocalParameters::reductionMatrix() const 
  { return s_projectionMatrices.reductionMatrix(m_parameterkey); }
 
diff --git a/Tracking/TrkEvent/TrkEventPrimitives/src/ResidualPull.cxx b/Tracking/TrkEvent/TrkEventPrimitives/src/ResidualPull.cxx
deleted file mode 100755
index 8e168755c8a6..000000000000
--- a/Tracking/TrkEvent/TrkEventPrimitives/src/ResidualPull.cxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//////////////////////////////////////////////////////////////////
-// ResidualPull.cxx
-//   Source file for class ResidualPull
-///////////////////////////////////////////////////////////////////
-// (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-// Sebastian.Fleischmann@cern.ch
-///////////////////////////////////////////////////////////////////
-
-#include "TrkEventPrimitives/ResidualPull.h"
-
-// default constructor
-Trk::ResidualPull::ResidualPull():
-        m_residual(0),
-        m_pull(0),
-        m_pullValid(false),
-        m_residualType(Trk::ResidualPull::Biased),
-        m_parameterKey(0),
-        m_sineStripAngle(0.0) {}
-
-// copy constructor
-Trk::ResidualPull::ResidualPull(const Trk::ResidualPull& resPull):
-  m_residual(resPull.m_residual),
-  m_pull(resPull.m_pull),
-  m_pullValid(resPull.m_pullValid),
-  m_residualType(resPull.m_residualType),
-  m_parameterKey(resPull.m_parameterKey),
-  m_sineStripAngle(resPull.m_sineStripAngle)  {}
-
-// constructor with parameters
-Trk::ResidualPull::ResidualPull(const std::vector<double> &residual,
-                                const std::vector<double> &pull,
-                                const bool pullValid,
-                                const Trk::ResidualPull::ResidualType type,
-                                const int parameterKey,
-                                const double sineStripAngle):
-        m_residual(residual),
-        m_pull(pull),
-        m_pullValid(pullValid),
-        m_residualType(type),
-        m_parameterKey(parameterKey),
-        m_sineStripAngle(sineStripAngle) {
-    if (m_residual.size() != m_pull.size()) {
-        //return 0;
-        // throw something....
-    }
-
-}
-
-//return the parameter key of the Trk::LocalParameters (of the measurement) used for the calculation
-int Trk::ResidualPull::parameterKey()  const {
-    return m_parameterKey;
-}
-
-// return the dimension of the residual and pull
-int Trk::ResidualPull::dimension() const {
-    return m_residual.size();
-}
-- 
GitLab


From d79a241e015f2a5c90186b2e864190ad8ba65e00 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 7 Jul 2020 19:09:29 +0000
Subject: [PATCH 097/217] Implement InDet::InDetPRD_AssociationToolGangedPixels
 in SCTLorentzMonAlg/Tool. Turn it off by default.

---
 .../InDetRecExample/share/InDetMonitoringSCT.py |  2 ++
 .../share/SCTLorentzMonAlg_jobOptions.py        |  5 ++++-
 .../SCT_Monitoring/src/SCTLorentzMonAlg.cxx     | 17 +++++++++++++++++
 .../SCT_Monitoring/src/SCTLorentzMonAlg.h       |  8 ++++++--
 .../SCT_Monitoring/src/SCTLorentzMonTool.cxx    | 17 +++++++++++++++++
 .../SCT_Monitoring/src/SCTLorentzMonTool.h      | 14 ++++++++++++++
 6 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py
index 7c7bc4d8a413..ebbeda9763d1 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py
@@ -71,6 +71,8 @@ else:
   InDetSCTLorentzMonTool = SCTLorentzMonTool ( name             = "InDetSCTLorentzMonTool",
                                                OutputLevel      = 4,
                                                tracksName       = tracksName )
+  InDetSCTLorentzMonTool.AssociationTool = InDetPrdAssociationTool
+  InDetSCTLorentzMonTool.RejectSharedHits = False
 
   if jobproperties.Beam.beamType()=='collisions':
     from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTLorentzMonAlg_jobOptions.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTLorentzMonAlg_jobOptions.py
index 0e2b89add5e3..6e6c0f3b8378 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTLorentzMonAlg_jobOptions.py
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTLorentzMonAlg_jobOptions.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 
 '''@file SCTLorentzMonAlg_jobOptions.py
@@ -19,6 +19,9 @@ myMonAlg.TriggerChain = ''
 # Set InDetTrackSummaryTool to TrackSummaryTool of SCTLorentzMonAlg
 myMonAlg.TrackSummaryTool = InDetTrackSummaryTool
 
+myMonAlg.AssociationTool = InDetPrdAssociationTool
+myMonAlg.RejectSharedHits = False
+
 # Add a generic monitoring tool (a "group" in old language). The returned 
 # object here is the standard GenericMonitoringTool.
 myMonGroup = helper.addGroup(
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx
index 1ce79bdf52f7..38af2d0617f8 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx
@@ -25,6 +25,12 @@ StatusCode SCTLorentzMonAlg::initialize() {
   ATH_CHECK(m_tracksName.initialize());
   ATH_CHECK(m_SCTDetEleCollKey.initialize());
 
+  if (m_rejectSharedHits) {
+    ATH_CHECK(m_assoTool.retrieve());
+  } else {
+    m_assoTool.disable();
+  }
+
   return AthMonitorAlgorithm::initialize();
 }
 
@@ -65,6 +71,12 @@ StatusCode SCTLorentzMonAlg::fillHistograms(const EventContext& ctx) const {
     return StatusCode::SUCCESS;
   }
 
+  // Prepare AssociationTool
+  Trk::IPRD_AssociationTool::Maps maps;
+  for (const Trk::Track* track : *tracks) {
+    ATH_CHECK(m_assoTool->addPRDs(maps, *track));
+  }
+
   for (const Trk::Track* track: *tracks) {
     if (track==nullptr) {
       ATH_MSG_ERROR("no pointer to track!!!");
@@ -93,6 +105,11 @@ StatusCode SCTLorentzMonAlg::fillHistograms(const EventContext& ctx) const {
       if (tsos->type(Trk::TrackStateOnSurface::Measurement)) {
         const InDet::SiClusterOnTrack* clus{dynamic_cast<const InDet::SiClusterOnTrack*>(tsos->measurementOnTrack())};
         if (clus) { // Is it a SiCluster? If yes...
+          // Reject shared hits if you want
+          if (m_rejectSharedHits and m_assoTool->isShared(maps, *(clus->prepRawData()))) {
+            continue;
+          }
+
           const InDet::SiCluster* RawDataClus{dynamic_cast<const InDet::SiCluster*>(clus->prepRawData())};
           if (RawDataClus==nullptr) {
             continue; // Continue if dynamic_cast returns null
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h
index 36ad0f46538e..3957f57b0985 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SCTLORENTZMONALG_H
@@ -12,8 +12,9 @@
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandleKey.h"
-#include "TrkToolInterfaces/ITrackSummaryTool.h"
 #include "TrkTrack/TrackCollection.h"
+#include "TrkToolInterfaces/ITrackSummaryTool.h"
+#include "TrkToolInterfaces/IPRD_AssociationTool.h"
 
 class SCT_ID;
 
@@ -31,11 +32,14 @@ class SCTLorentzMonAlg : public AthMonitorAlgorithm {
   const SCT_ID* m_pSCTHelper{nullptr};
 
   ToolHandle<Trk::ITrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryTool"};
+  ToolHandle<Trk::IPRD_AssociationTool> m_assoTool{this, "AssociationTool", "InDet::InDetPRD_AssociationToolGangedPixels"};
 
   /// Name of the Track collection to use
   SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"};
   SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
 
+  BooleanProperty m_rejectSharedHits{this, "RejectSharedHits", false};
+
   int findAnglesToWaferSurface(const float (&vec)[3],
                                const float& sinAlpha,
                                const Identifier& id, 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
index c7a5a06007a4..092dd5f7e257 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
@@ -50,6 +50,12 @@ StatusCode SCTLorentzMonTool::initialize() {
   ATH_CHECK(m_tracksName.initialize());
   ATH_CHECK(m_SCTDetEleCollKey.initialize());
 
+  if (m_rejectSharedHits) {
+    ATH_CHECK(m_assoTool.retrieve());
+  } else {
+    m_assoTool.disable();
+  }
+
   return ManagedMonitorToolBase::initialize();
 }
 
@@ -126,6 +132,12 @@ SCTLorentzMonTool::fillHistograms() {
     return StatusCode::SUCCESS;
   }
 
+  // Prepare AssociationTool
+  Trk::IPRD_AssociationTool::Maps maps;
+  for (const Trk::Track* track : *tracks) {
+    ATH_CHECK(m_assoTool->addPRDs(maps, *track));
+  }
+
   for (const Trk::Track* track: *tracks) {
     if (track==nullptr) {
       ATH_MSG_ERROR("no pointer to track!!!");
@@ -149,6 +161,11 @@ SCTLorentzMonTool::fillHistograms() {
       if (tsos->type(Trk::TrackStateOnSurface::Measurement)) {
         const InDet::SiClusterOnTrack* clus{dynamic_cast<const InDet::SiClusterOnTrack*>(tsos->measurementOnTrack())};
         if (clus) { // Is it a SiCluster? If yes...
+          // Reject shared hits if you want
+          if (m_rejectSharedHits and m_assoTool->isShared(maps, *(clus->prepRawData()))) {
+            continue;
+          }
+
           const InDet::SiCluster* RawDataClus{dynamic_cast<const InDet::SiCluster*>(clus->prepRawData())};
           if (RawDataClus==nullptr) {
             continue; // Continue if dynamic_cast returns null
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.h
index 14fa03b30083..88fa2e89254f 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.h
@@ -27,6 +27,7 @@
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "TrkToolInterfaces/IPRD_AssociationTool.h"
 #include "TrkTrack/TrackCollection.h"
 
 #include "GaudiKernel/ToolHandle.h"
@@ -74,11 +75,24 @@ class SCTLorentzMonTool : public ManagedMonitorToolBase {
   SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"};
   SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
 
+  //@name Tool members
+  //@{
+  ///Association tool
+  ToolHandle<Trk::IPRD_AssociationTool> m_assoTool{this, "AssociationTool", "InDet::InDetPRD_AssociationToolGangedPixels"};
+  //@}
+
   //@name Service members
   //@{
   ///SCT Helper class
   const SCT_ID* m_pSCTHelper{nullptr};
   //@}
+
+  //@name Flags
+  //@{
+  // Reject shared hits
+  BooleanProperty m_rejectSharedHits{this, "RejectSharedHits", false};
+  //@}
+
   //@name  Histograms related methods
   //@{
   // Book Histograms
-- 
GitLab


From 48837dfe18c65b206faa4cd176b8f42573a1532c Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Tue, 7 Jul 2020 19:12:05 +0000
Subject: [PATCH 098/217] Make sure that distances wrt to a merged component
 are always float max

---
 .../KLGaussianMixtureReduction.h              |  1 +
 .../src/KLGaussianMixtureReduction.cxx        | 21 ++++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h
index 2d40c26d26c7..b44311b4fc9d 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h
@@ -86,6 +86,7 @@ constexpr size_t alignment = 32;
 
 /**
  * @brief struct representing 1D component
+ * Negative weight means invalidated component
  */
 struct Component1D
 {
diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx
index a95dc5998ea2..294223d8bf10 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx
@@ -87,7 +87,7 @@ combine(GSFUtils::Component1D& updated, GSFUtils::Component1D& removed)
   removed.mean = 1e10;
   removed.cov = 1e10;
   removed.invCov = 1e10;
-  removed.weight = 1;
+  removed.weight = -1;
 }
 
 /**
@@ -108,17 +108,32 @@ recalculateDistances(const Component1D* componentsIn,
 
   const int32_t j = mini;
   const int32_t indexConst = (j - 1) * j / 2;
-  // Rows
+  //This is the component that has been updated
+  //so we calculate distances wrt.
   const Component1D componentJ = components[j];
+  
+  // Rows
   for (int32_t i = 0; i < j; ++i) {
     const Component1D componentI = components[i];
     const int32_t index = indexConst + i;
+    //This component has been merged to/removed
+    //so keep the distance wrt to it max always
+    if (componentI.weight < 0) {
+      distances[index] = std::numeric_limits<float>::max();
+      continue;
+    }
     distances[index] = symmetricKL(componentI, componentJ);
   }
   // Columns
   for (int32_t i = j + 1; i < n; ++i) {
-    const int32_t index = (i - 1) * i / 2 + j;
     const Component1D componentI = components[i];
+    const int32_t index = (i - 1) * i / 2 + j;
+    //This component has been merged to/removed
+    //so keep the distance wrt to it max always
+    if (componentI.weight < 0) {
+      distances[index] = std::numeric_limits<float>::max();
+      continue;
+    }
     distances[index] = symmetricKL(componentI, componentJ);
   }
 }
-- 
GitLab


From 5c449639cfb66ee2a855aef5db38595553385ea8 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Tue, 7 Jul 2020 21:21:58 +0200
Subject: [PATCH 099/217] Explicitly making use of the boost_regex library.

The Json2Cool.cxx file needs it, so the package's configuration needs
to explicitly link against it.
---
 Database/IOVDbSvc/CMakeLists.txt | 38 ++++++++++++++++----------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 222de0472579..36381d045340 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -7,7 +7,7 @@ atlas_subdir( IOVDbSvc )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
 find_package( CORAL COMPONENTS CoralBase RelationalAccess )
 find_package( ROOT COMPONENTS Core )
-find_package( Boost COMPONENTS unit_test_framework )
+find_package( Boost COMPONENTS unit_test_framework regex )
 find_package( nlohmann_json )
 find_package( CURL )
 
@@ -24,9 +24,9 @@ atlas_add_component( IOVDbSvc
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES}
-   ${CURL_LIBRARIES} nlohmann_json::nlohmann_json GaudiKernel AthenaBaseComps
-   AthenaKernel StoreGateLib FileCatalog AthenaPoolUtilities CoraCool
-   IOVDbDataModel EventInfo EventInfoUtils GeoModelInterfaces
+   ${Boost_LIBRARIES} ${CURL_LIBRARIES} nlohmann_json::nlohmann_json GaudiKernel
+   AthenaBaseComps AthenaKernel StoreGateLib FileCatalog AthenaPoolUtilities
+   CoraCool IOVDbDataModel EventInfo EventInfoUtils GeoModelInterfaces
    IOVDbMetaDataToolsLib EventInfoMgtLib PoolSvcLib IOVDbSvcLib )
 
 # Install files from the package:
@@ -43,27 +43,27 @@ atlas_add_test( IOVDbSvc_test
    PROPERTIES TIMEOUT 300
    LOG_IGNORE_PATTERN "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG |Warning in <TFile::Init>: no |Initializing"  )
 
-atlas_add_test( IOVDbSvc_Boost_test                
+atlas_add_test( IOVDbSvc_Boost_test
    SOURCES test/IOVDbSvc_Boost_test.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES}
    GaudiKernel AthenaKernel CxxUtils TestTools StoreGateLib
    LOG_IGNORE_PATTERN "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" )
 
-atlas_add_test( IOVDbConn_test                
+atlas_add_test( IOVDbConn_test
    SOURCES test/IOVDbConn_test.cxx src/IOVDbConn.cxx
    INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${COOL_LIBRARIES} ${Boost_LIBRARIES} ${ROOT_LIBRARIES}
    GaudiKernel CxxUtils TestTools CoraCool
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( IOVDbStringFunctions_test                
+atlas_add_test( IOVDbStringFunctions_test
    SOURCES test/IOVDbStringFunctions_test.cxx src/IOVDbStringFunctions.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES}
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( IOVDbParser_test                
+atlas_add_test( IOVDbParser_test
    SOURCES test/IOVDbParser_test.cxx src/IOVDbParser.cxx
    src/IOVDbStringFunctions.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
@@ -71,7 +71,7 @@ atlas_add_test( IOVDbParser_test
    TestTools
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( FolderTypes_test                
+atlas_add_test( FolderTypes_test
    SOURCES test/FolderTypes_test.cxx src/FolderTypes.cxx
    src/IOVDbStringFunctions.cxx
    INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
@@ -81,7 +81,7 @@ atlas_add_test( FolderTypes_test
    AthenaPoolUtilities
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( IOVDbCoolFunctions_test                
+atlas_add_test( IOVDbCoolFunctions_test
    SOURCES test/IOVDbCoolFunctions_test.cxx src/IOVDbCoolFunctions.cxx
    src/IOVDbConn.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
@@ -89,7 +89,7 @@ atlas_add_test( IOVDbCoolFunctions_test
    GaudiKernel AthenaKernel CoraCool
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( ReadFromFileMetaData_test                
+atlas_add_test( ReadFromFileMetaData_test
    SOURCES test/ReadFromFileMetaData_test.cxx src/ReadFromFileMetaData.cxx
    src/FolderTypes.cxx src/IOVDbCoolFunctions.cxx src/IOVDbStringFunctions.cxx
    src/IOVDbConn.cxx
@@ -98,7 +98,7 @@ atlas_add_test( ReadFromFileMetaData_test
    AthenaKernel IOVDbDataModel AthenaPoolUtilities CoraCool CxxUtils TestTools
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( IOVDbFolder_test                
+atlas_add_test( IOVDbFolder_test
    SOURCES test/IOVDbFolder_test.cxx src/FolderTypes.cxx
    src/IOVDbStringFunctions.cxx src/IOVDbParser.cxx src/IOVDbConn.cxx
    src/IOVDbFolder.cxx src/IOVDbParser.cxx src/IovStore.cxx
@@ -115,13 +115,13 @@ atlas_add_test( IOVDbFolder_test
    LOG_IGNORE_PATTERN "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG"
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( IovStore_test                
+atlas_add_test( IovStore_test
    SOURCES test/IovStore_test.cxx src/IovStore.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${CORAL_LIBRARIES}
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( TagFunctions_test                
+atlas_add_test( TagFunctions_test
    SOURCES test/TagFunctions_test.cxx src/TagFunctions.cxx
    src/IOVDbStringFunctions.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
@@ -131,7 +131,7 @@ atlas_add_test( TagFunctions_test
    POST_EXEC_SCRIPT "nopost.sh" )
 
 atlas_add_test( IOVDbSvcCurl_test
-   SOURCES test/IOVDbSvcCurl_test.cxx src/IOVDbSvcCurl.cxx 
+   SOURCES test/IOVDbSvcCurl_test.cxx src/IOVDbSvcCurl.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${CURL_LIBRARIES}
    POST_EXEC_SCRIPT "nopost.sh" )
@@ -149,7 +149,7 @@ atlas_add_test( Json2Cool_test
    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${CORAL_LIBRARIES}
    nlohmann_json::nlohmann_json
    POST_EXEC_SCRIPT "nopost.sh" )
-                
+
 atlas_add_test( Cool2Json_test
    SOURCES test/Cool2Json_test.cxx src/Cool2Json.cxx src/IOVDbConn.cxx
    src/IOVDbParser.cxx src/IOVDbStringFunctions.cxx src/FolderTypes.cxx
@@ -162,7 +162,7 @@ atlas_add_test( Cool2Json_test
    LOG_IGNORE_PATTERN "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG"
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( CrestFunctions_test                
+atlas_add_test( CrestFunctions_test
    SOURCES test/CrestFunctions_test.cxx src/CrestFunctions.cxx
    src/IOVDbSvcCurl.cxx src/IOVDbStringFunctions.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
@@ -171,8 +171,8 @@ atlas_add_test( CrestFunctions_test
    ${CURL_LIBRARIES}
    POST_EXEC_SCRIPT "nopost.sh" )
 
-atlas_add_test( Base64Codec_test                
-   SOURCES test/Base64Codec_test.cxx src/Base64Codec.cxx 
+atlas_add_test( Base64Codec_test
+   SOURCES test/Base64Codec_test.cxx src/Base64Codec.cxx
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES}
    POST_EXEC_SCRIPT "nopost.sh" )
-- 
GitLab


From 3920251de8d26c69a2d1aeb6706e49d7ef0e0eba Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 3 Jul 2020 23:56:19 +0200
Subject: [PATCH 100/217] InDetTruthTools: cmake fixes

Library dependency fixes.
---
 InnerDetector/InDetTruth/InDetTruthTools/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetTruth/InDetTruthTools/CMakeLists.txt b/InnerDetector/InDetTruth/InDetTruthTools/CMakeLists.txt
index dfe02508759b..052a313b09b4 100644
--- a/InnerDetector/InDetTruth/InDetTruthTools/CMakeLists.txt
+++ b/InnerDetector/InDetTruth/InDetTruthTools/CMakeLists.txt
@@ -29,7 +29,7 @@ atlas_add_component( InDetTruthTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS 
-                     LINK_LIBRARIES AtlasHepMCLib AthenaBaseComps TrkEventPrimitives AtlasDetDescr GaudiKernel InDetIdentifier InDetReadoutGeometry InDetSimData InDetPrepRawData TrkPrepRawData TrkTruthData )
+                     LINK_LIBRARIES AtlasHepMCLib AthenaBaseComps TrkEventPrimitives AtlasDetDescr GaudiKernel InDetIdentifier InDetReadoutGeometry InDetSimData InDetPrepRawData TrkPrepRawData TrkTruthData InDetTruthInterfaces TrkTruthTrackInterfaces )
 
 # Install files from the package:
 atlas_install_headers( InDetTruthTools )
-- 
GitLab


From ac8eea501ec05ca0aae9ddc206105b359888f77f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:40:18 +0200
Subject: [PATCH 101/217] InDetIncSecVxFinderTool: cmake fixes

Library dependency fixes.
---
 .../InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
index 3a21ba60b97d..d5642f3784b7 100644
--- a/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetIncSecVxFinderTool/CMakeLists.txt
@@ -40,7 +40,7 @@ atlas_add_component( InDetIncSecVxFinderTool
                      src/*.cxx
                      src/components/*.cxx
 		     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkSurfaces TrkVertexFitterInterfaces TrkVxEdmCnvLib EventPrimitives InDetTrackSelectionToolLib)
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthContainers CxxUtils xAODTracking GaudiKernel InDetRecToolInterfaces GeoPrimitives TrkTrack TrkParticleBase TrkParameters TrkEventPrimitives VxVertex TrkLinks TrkTrack TrkSurfaces TrkVertexFitterInterfaces TrkVxEdmCnvLib EventPrimitives InDetTrackSelectionToolLib TrkVertexSeedFinderUtilsLib InDetBeamSpotServiceLib )
 
 # Install files from the package:
 atlas_install_headers( InDetIncSecVxFinderTool )
-- 
GitLab


From af8ae1a440af923f52856c8fc538db2f0b55d0fd Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:42:54 +0200
Subject: [PATCH 102/217] TRT_RecoConditionsServices: cmake fixes

Library dependency fixes.
---
 .../InDetConditions/TRT_RecoConditionsServices/CMakeLists.txt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetConditions/TRT_RecoConditionsServices/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_RecoConditionsServices/CMakeLists.txt
index 279400cdd75a..e63b40e015be 100644
--- a/InnerDetector/InDetConditions/TRT_RecoConditionsServices/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/TRT_RecoConditionsServices/CMakeLists.txt
@@ -25,4 +25,4 @@ find_package( Eigen )
 atlas_add_component( TRT_RecoConditionsServices
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} GaudiKernel TrkParameters AthenaBaseComps StoreGateLib SGtests InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry TRT_ConditionsServicesLib )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} GaudiKernel TrkParameters AthenaBaseComps StoreGateLib SGtests InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry TRT_ConditionsServicesLib InDetRecToolInterfaces )
-- 
GitLab


From 07b7531c0e67ab5bc9c7fc3038b7c5a0afec58bd Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:43:08 +0200
Subject: [PATCH 103/217] TrkVertexSeedFinderUtils: cmake fixes

Library dependency fixes.
---
 .../TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
index 9fb2689a44ee..f16fc669b538 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/CMakeLists.txt
@@ -41,7 +41,7 @@ atlas_add_library( TrkVertexSeedFinderUtilsLib
    INTERFACE
    PUBLIC_HEADERS TrkVertexSeedFinderUtils
    LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkParameters GeoPrimitives
-   VxVertex TrkParticleBase xAODTracking )
+   VxVertex TrkParticleBase xAODTracking BeamSpotConditionsData )
 
 atlas_add_component( TrkVertexSeedFinderUtils
    src/*.cxx src/components/*.cxx
-- 
GitLab


From c57efd4f3a89c5a251688f1aea6e7a31325c259b Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <stewart.martin-haugh@cern.ch>
Date: Tue, 7 Jul 2020 19:27:59 +0000
Subject: [PATCH 104/217] Protect DEBUG statements: Athena core

---
 Control/AthViews/AthViews/ViewHelper.h        | 11 +++-
 .../src/AthenaHiveEventLoopMgr.cxx            | 65 +++++++++++++------
 Control/GaudiSequencer/src/AthSequencer.cxx   | 29 +++++----
 3 files changed, 69 insertions(+), 36 deletions(-)

diff --git a/Control/AthViews/AthViews/ViewHelper.h b/Control/AthViews/AthViews/ViewHelper.h
index bc2db834137d..7a65e32a2ec2 100644
--- a/Control/AthViews/AthViews/ViewHelper.h
+++ b/Control/AthViews/AthViews/ViewHelper.h
@@ -202,8 +202,10 @@ namespace ViewHelper
         //Nothing to do for empty collections
         if ( queryHandle->size() == 0 )
         {
-          m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg;
-          continue;
+          if (m_msg.level() <= MSG::DEBUG) {
+            m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg;
+            continue;
+          }
         }
 
         //Merge the data
@@ -217,7 +219,10 @@ namespace ViewHelper
           //Add aux data for bookkeeping
           viewBookkeeper( *outputObject ) = inputView->getROI();
         }
-        m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view  " << inputView->name() << endmsg;
+
+        if (m_msg.level() <= MSG::DEBUG) {
+          m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view  " << inputView->name() << endmsg;
+        }
 
         //Declare remapping
         m_sg->remap( ClassID_traits< DataVector< T > >::ID(), inputView->name() + "_" + queryHandle.name(), queryHandle.name(), offset );
diff --git a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
index 7bd376ddab9d..0b5dc9dbd286 100644
--- a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
@@ -673,9 +673,11 @@ StatusCode AthenaHiveEventLoopMgr::executeEvent( EventContext &&ctx )
     m_lastEventContext = ctx;
     
     // Now add event to the scheduler 
-    debug() << "Adding event " << ctx.evt() 
-            << ", slot " << ctx.slot()
-            << " to the scheduler" << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "Adding event " << ctx.evt() 
+              << ", slot " << ctx.slot()
+              << " to the scheduler" << endmsg;
+    }
     
     m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing, 
 					 ctx));
@@ -790,13 +792,18 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
   };
 
   while ( !loop_ended and ( (maxevt < 0) or (finishedEvts < maxevt) ) ){
-    debug() << " -> createdEvts: " << createdEvts << endmsg;
+
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << " -> createdEvts: " << createdEvts << endmsg;
+    }
     
     if ( ( !m_terminateLoop ) && // The events are not finished with an unlimited number of events
 	 ( (createdEvts < maxevt) or (maxevt<0) ) &&  // The events are not finished with a limited number of events
 	 (m_schedulerSvc->freeSlots()>0) ){ // There are still free slots in the scheduler
       
-      debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
+      if (msgLevel(MSG::DEBUG)) {
+        debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
+      }
       
       auto ctx = createEventContext();
       
@@ -819,7 +826,9 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
       // all the events were created but not all finished or the slots were 
       // all busy: the scheduler should finish its job
 
-      debug() << "Draining the scheduler" << endmsg;
+      if (msgLevel(MSG::DEBUG)) {
+        debug() << "Draining the scheduler" << endmsg;
+      }
 
       // Pull out of the scheduler the finished events
       int ir = drainScheduler(finishedEvts);
@@ -1172,12 +1181,16 @@ int AthenaHiveEventLoopMgr::declareEventRootAddress(EventContext& ctx){
 
     ctx.setEventID( *((EventIDBase*) pEvent->event_ID()) );
 
-    debug() << "selecting store: " << ctx.slot() << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "selecting store: " << ctx.slot() << endmsg;
+    }
 
     m_whiteboard->selectStore( ctx.slot() ).ignore();
 
-    debug() << "recording EventInfo " << *pEvent->event_ID() << " in "
-            << eventStore()->name() << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "recording EventInfo " << *pEvent->event_ID() << " in "
+             << eventStore()->name() << endmsg;
+    }
     sc = eventStore()->record(pEvent,"McEventInfo");
     if( !sc.isSuccess() )  {
       error() << "Error declaring event data object" << endmsg;
@@ -1202,8 +1215,10 @@ EventContext AthenaHiveEventLoopMgr::createEventContext() {
     Atlas::setExtendedEventContext(ctx,
                                    Atlas::ExtendedEventContext( eventStore()->hiveProxyDict() ) );
 
-    debug() << "created EventContext, num: " << ctx.evt()  << "  in slot: " 
-	    << ctx.slot() << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "created EventContext, num: " << ctx.evt()  << "  in slot: " 
+	      << ctx.slot() << endmsg;
+    }
   }
 
   return ctx;
@@ -1222,17 +1237,23 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
   EventContext* finishedEvtContext(nullptr);
 
   // Here we wait not to loose cpu resources
-  debug() << "drainScheduler: [" << finishedEvts << "] Waiting for a context" << endmsg;
+  if (msgLevel(MSG::DEBUG)) {
+    debug() << "drainScheduler: [" << finishedEvts << "] Waiting for a context" << endmsg;
+  }
   sc = m_schedulerSvc->popFinishedEvent(finishedEvtContext);
 
   // We got past it: cache the pointer
   if (sc.isSuccess()){
-    debug() << "drainScheduler: scheduler not empty: Context " 
-	    << finishedEvtContext << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "drainScheduler: scheduler not empty: Context " 
+	      << finishedEvtContext << endmsg;
+    }
     finishedEvtContexts.push_back(finishedEvtContext);
   } else{
     // no more events left in scheduler to be drained
-    debug() << "drainScheduler: scheduler empty" << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "drainScheduler: scheduler empty" << endmsg;
+    }
     return 0;
   }
 
@@ -1280,9 +1301,11 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
     Gaudi::Hive::setCurrentContext( *thisFinishedEvtContext );
     m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext ));
 
-    debug() << "Clearing slot " << thisFinishedEvtContext->slot() 
-            << " (event " << thisFinishedEvtContext->evt()
-            << ") of the whiteboard" << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "Clearing slot " << thisFinishedEvtContext->slot() 
+              << " (event " << thisFinishedEvtContext->evt()
+              << ") of the whiteboard" << endmsg;
+    }
     
     StatusCode sc = clearWBSlot(thisFinishedEvtContext->slot());
     if (!sc.isSuccess()) {
@@ -1321,8 +1344,10 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
       }  
     }
 
-    debug() << "drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext
-	    << endmsg;
+    if (msgLevel(MSG::DEBUG)) {
+      debug() << "drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext
+	      << endmsg;
+    }
 
     delete thisFinishedEvtContext;
   }
diff --git a/Control/GaudiSequencer/src/AthSequencer.cxx b/Control/GaudiSequencer/src/AthSequencer.cxx
index 25f90884d842..555f25d11591 100644
--- a/Control/GaudiSequencer/src/AthSequencer.cxx
+++ b/Control/GaudiSequencer/src/AthSequencer.cxx
@@ -508,20 +508,23 @@ AthSequencer::decodeNames( Gaudi::Property<std::vector<std::string>>& theNames,
     
   }
   // Print membership list
-  if ( result.isSuccess() && !theAlgs->empty() ) {
-    msg(MSG::DEBUG) << "Member list: ";
-    bool first = true;
-    for (Gaudi::Algorithm* alg : *theAlgs) {
-      if (first)
-        first = false;
-      else
-        msg() << ", ";
-      if ( alg->name() == System::typeinfoName(typeid(*alg)))
-        msg() << alg->name();
-      else
-        msg() << System::typeinfoName(typeid(*alg)) << "/" << alg->name();
+  if (msgLvl(MSG::DEBUG)) {
+    if ( result.isSuccess() && !theAlgs->empty() ) {
+
+      msg(MSG::DEBUG) << "Member list: ";
+      bool first = true;
+      for (Gaudi::Algorithm* alg : *theAlgs) {
+        if (first)
+          first = false;
+        else
+          msg() << ", ";
+        if ( alg->name() == System::typeinfoName(typeid(*alg)))
+          msg() << alg->name();
+        else
+          msg() << System::typeinfoName(typeid(*alg)) << "/" << alg->name();
+      }
+      msg(MSG::DEBUG) << endmsg;
     }
-    msg(MSG::DEBUG) << endmsg;
   }
   theAlgMgr->release();
   return result;
-- 
GitLab


From b9dd6b33cb463749aa0d77aa3e2ec84024f338c2 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:43:23 +0200
Subject: [PATCH 105/217] TrkVertexSeedFinderTools: cmake fixes

Declare an interface library for exported heades.

Library dependency fixes.
---
 .../TrkVertexSeedFinderTools/CMakeLists.txt               | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
index a04de66bae29..ded2a274e694 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/CMakeLists.txt
@@ -29,12 +29,18 @@ find_package( Eigen )
 find_package( HepPDT )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
+atlas_add_library( TrkVertexSeedFinderToolsLib
+                   TrkVertexSeedFinderTools/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS TrkVertexSeedFinderTools
+                   LINK_LIBRARIES GaudiKernel AthenaBaseComps TrkVertexFitterInterfaces TrkVertexSeedFinderUtilsLib xAODEventInfo GeneratorObjects AtlasHepMCLib CxxUtils )
+
 # Component(s) in the package:
 atlas_add_component( TrkVertexSeedFinderTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel TrkVertexFitterInterfaces GeoPrimitives EventPrimitives xAODEventInfo TruthHelper GeneratorObjects TrkEventPrimitives TrkParameters TrkTrack VxVertex )
+                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} TrkVertexSeedFinderToolsLib GeoPrimitives EventPrimitives  TruthHelper  TrkEventPrimitives TrkParameters TrkTrack VxVertex  )
 
 # Install files from the package:
 atlas_install_headers( TrkVertexSeedFinderTools )
-- 
GitLab


From 5b5913612b47929056269aa4e91514d8541284ab Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:43:57 +0200
Subject: [PATCH 106/217] GeoModelExamples: Fix clang 10 warnings.

If a dtor is declared final, the class itself should also be declared final.
---
 .../GeoModel/GeoModelExamples/src/CentralScrutinizer.h        | 4 ++--
 .../GeoModel/GeoModelExamples/src/ForwardScrutinizer.h        | 4 ++--
 .../GeoModel/GeoModelExamples/src/ToyDetectorTool.h           | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoModelExamples/src/CentralScrutinizer.h b/DetectorDescription/GeoModel/GeoModelExamples/src/CentralScrutinizer.h
index 4b08feb084e0..965152d5020c 100755
--- a/DetectorDescription/GeoModel/GeoModelExamples/src/CentralScrutinizer.h
+++ b/DetectorDescription/GeoModel/GeoModelExamples/src/CentralScrutinizer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef CentralScrutinizer_h
@@ -10,7 +10,7 @@
     #include "Identifier/Identifier.h"
 #endif
 
-class CentralScrutinizer : public GeoVDetectorElement
+class CentralScrutinizer final : public GeoVDetectorElement
 {
  public:
   CentralScrutinizer(const GeoVFullPhysVol *fullPhysVol);
diff --git a/DetectorDescription/GeoModel/GeoModelExamples/src/ForwardScrutinizer.h b/DetectorDescription/GeoModel/GeoModelExamples/src/ForwardScrutinizer.h
index e9ad0b340a87..ab22e33ec5f4 100755
--- a/DetectorDescription/GeoModel/GeoModelExamples/src/ForwardScrutinizer.h
+++ b/DetectorDescription/GeoModel/GeoModelExamples/src/ForwardScrutinizer.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef ForwardScrutinizer_h
@@ -10,7 +10,7 @@
     #include "Identifier/Identifier.h"
 #endif
 
-class ForwardScrutinizer : public GeoVDetectorElement
+class ForwardScrutinizer final : public GeoVDetectorElement
 {
  public:
   ForwardScrutinizer(const GeoVFullPhysVol *fullPhysVol);
diff --git a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.h b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.h
index 029f63c49fc9..bcc2c2a19922 100755
--- a/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.h
+++ b/DetectorDescription/GeoModel/GeoModelExamples/src/ToyDetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef GEOMODELEXAMPLES_TOYDETECTORTOOL_H
@@ -10,7 +10,7 @@
 #include "GeoModelUtilities/GeoModelTool.h"
 #include "GeoModelKernel/GeoPVConstLink.h"
 
-class ToyDetectorTool : public GeoModelTool 
+class ToyDetectorTool final : public GeoModelTool 
 {
  public:
   ToyDetectorTool( const std::string& type, const std::string& name, const IInterface* parent );
-- 
GitLab


From d5c121a3a2b640ae38f25de6a2a55a7c732fa0d6 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:44:25 +0200
Subject: [PATCH 107/217] TileGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 TileCalorimeter/TileGeoModel/TileGeoModel/TileDetectorTool.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/TileCalorimeter/TileGeoModel/TileGeoModel/TileDetectorTool.h b/TileCalorimeter/TileGeoModel/TileGeoModel/TileDetectorTool.h
index fca9c655952d..6227788770d4 100755
--- a/TileCalorimeter/TileGeoModel/TileGeoModel/TileDetectorTool.h
+++ b/TileCalorimeter/TileGeoModel/TileGeoModel/TileDetectorTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TileDetectorTool_H
@@ -13,7 +13,7 @@ class MsgStream;
 class StoreGateSvc;
 class TileDetDescrManager;
 
-class TileDetectorTool : public GeoModelTool 
+class TileDetectorTool final : public GeoModelTool 
 {
  public:
 
-- 
GitLab


From 3aac68e7d4211019e03337798ef30d1d9825bfa5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:44:12 +0200
Subject: [PATCH 108/217] AthenaPoolCnvSvc: Fix clang 10 warning.

Fix warning about deprecated implicit declarations.
---
 .../AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx
index 18e62fbe3f34..069f05faf17d 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file AthenaPoolCnvSvc/test/T_AuxContainerCopyTPCnv_test.cxx
@@ -47,6 +47,7 @@ class OldData
 {
 public:
   OldData();
+  OldData (const OldData&) = default;
   OldData& operator= (const OldData&) { return *this; }
 
 
-- 
GitLab


From 91d279f7b015068f61cf1b37d88179a58110face Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:44:39 +0200
Subject: [PATCH 109/217] TileTPCnv: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h
index f7270c1efe9b..311e75ade9e5 100644
--- a/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h
+++ b/TileCalorimeter/TileSvc/TileTPCnv/TileTPCnv/T_TilePoolContainerCnv.h
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // T_TilePoolContainerCnv.h 
@@ -84,7 +84,7 @@ public:
     }
 
     std::vector<IdentifierHash> hashes = mutableContainer->GetAllCurrentHashes();
-    for (const IdentifierHash hash : hashes) {
+    for (const IdentifierHash& hash : hashes) {
       Collection* coll = mutableContainer->indexFindPtr(hash);
       auto newColl = std::make_unique<Collection>(std::move(*coll));
       if (trans->addOrDelete(std::move(newColl), hash).isFailure()) {
-- 
GitLab


From 6444a081892687b0644f819a69f0530c10b6a6ac Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Jul 2020 18:44:51 +0200
Subject: [PATCH 110/217] EventContainers: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 Event/EventContainers/test/IDC_Realistic_Test.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Event/EventContainers/test/IDC_Realistic_Test.cxx b/Event/EventContainers/test/IDC_Realistic_Test.cxx
index 37497319ac0e..c4ca7f963af1 100644
--- a/Event/EventContainers/test/IDC_Realistic_Test.cxx
+++ b/Event/EventContainers/test/IDC_Realistic_Test.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 #include "EventContainers/IdentifiableContainerMT.h"
 #include <vector>
@@ -190,7 +190,7 @@ public:
             std::abort();
         }
         //Check random access method
-        for(const auto x : hashes) {
+        for(const auto& x : hashes) {
             auto p = container.indexFindPtr(x);
             int j =0;
             for(auto q : *p) {
-- 
GitLab


From 97f944c8461d824b28267e847f5036f63ebfa471 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 1 Jul 2020 16:54:31 +0200
Subject: [PATCH 111/217] InDetEtaDependentCuts: Re-enable thread-safety
 checker.

Test now passes the thread-safety checker.
---
 .../InDetEtaDependentCuts/test/IDEDCSvc_GaudiFixtureBase.h      | 2 --
 1 file changed, 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/IDEDCSvc_GaudiFixtureBase.h b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/IDEDCSvc_GaudiFixtureBase.h
index 4d3b610d6261..3761799bc526 100644
--- a/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/IDEDCSvc_GaudiFixtureBase.h
+++ b/InnerDetector/InDetRecTools/InDetEtaDependentCuts/test/IDEDCSvc_GaudiFixtureBase.h
@@ -16,11 +16,9 @@
 
 #include "TestTools/initGaudi.h"
 #include "TInterpreter.h"
-#include "CxxUtils/checker_macros.h"
 #include "CxxUtils/ubsan_suppress.h"
 #include <string>
 
-ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This is for unit tests and a static variable IDEDC_GaudiFixtureBase::gaudiIsInitialised is used.
 
 struct IDEDC_GaudiFixtureBase{
   ISvcLocator* svcLoc{};
-- 
GitLab


From 2e74876fd2f3c14cadc5f70237b110753802d7f0 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 19 Jun 2020 15:11:55 +0200
Subject: [PATCH 112/217] MuonTGRecToolsb: cmake fixes

Define an interface library for exported headers.

Library dependency fixes.
---
 .../MuonRecTools/MuonTGRecTools/CMakeLists.txt           | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
index dc8755a3afcd..7c94c35c614f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/CMakeLists.txt
@@ -50,14 +50,19 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( HepPDT )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
+atlas_add_library( MuonTGRecToolsLib
+                   MuonTGRecTools/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS MuonTGRecTools
+                   LINK_LIBRARIES GaudiKernel TrkGeometry EventPrimitives AthenaBaseComps TrkTrack TrkExInterfaces TrkToolInterfaces TrkFitterUtils TrackRecordLib TrkEventPrimitives TrkGeometry TrkPrepRawData MuonTrackMakerUtils MuonIdHelpersLib MuonPrepRawData AthContainers AthenaKernel TrkExInterfaces TrkSurfaces TrkSegment )
+
 # Component(s) in the package:
 atlas_add_component( MuonTGRecTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthLinks AthContainers AthenaKernel StoreGateLib SGtests EventPrimitives GaudiKernel GeneratorObjects MuonReadoutGeometry MuonIdHelpersLib MuonStationIndexLib MuonPrepRawData TrkGeometry TrkSurfaces TrkEventPrimitives TrkPrepRawData TrkSegment TrkTrack TrkExInterfaces TrkFitterUtils TrkToolInterfaces xAODTracking MuonDetDescrUtils MuonDigitContainer MuonCompetingRIOsOnTrack MuonLayerEvent MuonRIO_OnTrack MuonRecToolInterfaces MuonSimData MuonSimEvent RecoToolInterfaces TrkMaterialOnTrack TrkMeasurementBase TrkParameters TrkRIO_OnTrack )
+                     LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} MuonTGRecToolsLib AthLinks StoreGateLib SGtests GeneratorObjects MuonReadoutGeometry MuonStationIndexLib xAODTracking MuonDetDescrUtils MuonDigitContainer MuonCompetingRIOsOnTrack MuonLayerEvent MuonRIO_OnTrack MuonRecToolInterfaces MuonSimData MuonSimEvent RecoToolInterfaces TrkMaterialOnTrack TrkMeasurementBase TrkParameters TrkRIO_OnTrack )
 
 # Install files from the package:
-atlas_install_headers( MuonTGRecTools )
 atlas_install_joboptions( share/*.py )
 
-- 
GitLab


From f5c0f848ec92042931a3897d3d8016dd259bca43 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Tue, 7 Jul 2020 23:55:32 +0200
Subject: [PATCH 113/217] Trk::Track Use the new type functionality from
 surfaces to avoid dynamic_casts

---
 Tracking/TrkEvent/TrkTrack/src/Track.cxx | 81 +++++++++++++++---------
 1 file changed, 50 insertions(+), 31 deletions(-)

diff --git a/Tracking/TrkEvent/TrkTrack/src/Track.cxx b/Tracking/TrkEvent/TrkTrack/src/Track.cxx
index c2c56740e09e..0baeafd9303d 100755
--- a/Tracking/TrkEvent/TrkTrack/src/Track.cxx
+++ b/Tracking/TrkEvent/TrkTrack/src/Track.cxx
@@ -124,26 +124,35 @@ Trk::Track& Trk::Track::operator= (const Track& rhs)
     }
     //perigee parameters set to invalid
     m_perigeeParameters.reset();
-    
-    //Create the TrackStateVector and the perigeeParamters
-    if( rhs.m_trackStateVector!=nullptr )
-    {
+
+    // Create the TrackStateVector and the perigeeParameters
+    if (rhs.m_trackStateVector != nullptr) {
       m_trackStateVector = new DataVector<const TrackStateOnSurface>;
       m_trackStateVector->reserve(rhs.m_trackStateVector->size());
+     
       TSoS_iterator itTSoSEnd = rhs.m_trackStateVector->end();
-      for( TSoS_iterator itTSoS = rhs.m_trackStateVector->begin();itTSoS!=itTSoSEnd; ++itTSoS){
-        assert(*itTSoS!=0); // check that is defined.
+      for (TSoS_iterator itTSoS = rhs.m_trackStateVector->begin();
+           itTSoS != itTSoSEnd;
+           ++itTSoS) {
+        assert(*itTSoS != nullptr); // check that is defined.
+        //clone and store
         TrackStateOnSurface* tsos = (**itTSoS).clone();
-        m_trackStateVector->push_back( tsos );
-        if(tsos!=nullptr && tsos->type(TrackStateOnSurface::Perigee)){ 
-          const Trk::Perigee*  perigee = dynamic_cast<const Trk::Perigee*>(tsos->trackParameters() ) ;
-          if(perigee!=nullptr){  
-            m_perigeeParameters.store(perigee);//Now they will be valid
+        m_trackStateVector->push_back(tsos);
+        //Check if this a perigee so we can already cache it
+        if (tsos != nullptr && tsos->type(TrackStateOnSurface::Perigee)) {
+          const Trk::Perigee* perigee = nullptr;
+          const Trk::TrackParameters* tp = tsos->trackParameters();
+          if (tp && tp->type() == Trk::AtaSurface &&
+              tp->surfaceType() == Trk::Surface::Perigee) {
+            perigee = static_cast<const Trk::Perigee*> (tp);
+          }
+          if (perigee != nullptr) {
+            m_perigeeParameters.store(perigee); // Now they will be valid
           }
         }
       }
     }
-  }
+  }//!=this
   return *this;
 }
 
@@ -189,25 +198,28 @@ void Trk::Track::findPerigee() const {
 
 void Trk::Track::findPerigeeImpl() const
 {
-  // loop through all passed parameters and, if there is a Perigee in there,
-  // assign it to Perigee parameters. Obviously there should never be more
-  // than one perigee type. I could check for it, but it will make the
-  // code slower which (in my opinion) makes it not worth doing. EJWM
-  // there can be other objects, like VertexOnTrack measurements, with
-  // params at a Perigee surface, thus an additional TSoS type check. AS/WL
-
- const Trk::Perigee* tmpPerigeeParameters=nullptr; 
+  // loop through all passed parameters and, if there is a at Perigee in there,
+  // assign it to Perigee parameters. There should never be more
+  // than one perigee type.
+  // Note that there can be other objects, like VertexOnTrack measurements, with
+  // params at a Perigee surface, thus the  TSoS check.
+
+  const Trk::Perigee* tmpPerigeeParameters = nullptr; 
   if (m_trackStateVector!=nullptr){
     DataVector<const TrackStateOnSurface>::const_iterator it = 
       m_trackStateVector->begin();
     DataVector<const TrackStateOnSurface>::const_iterator itEnd = 
       m_trackStateVector->end();
-    for( ; it!=itEnd; ++it )
-    {
-      if ((*it)->type(TrackStateOnSurface::Perigee)){
-        tmpPerigeeParameters = dynamic_cast<const Trk::Perigee*>( (*it)->trackParameters() ) ;
-        if(tmpPerigeeParameters!=nullptr){
-        break; // found perigee so stop loop.
+    for (; it != itEnd; ++it) {
+      if ((*it)->type(TrackStateOnSurface::Perigee)) {
+        const Trk::TrackParameters* tp = (*it)->trackParameters();
+        if (tp && tp->type() == Trk::AtaSurface &&
+            tp->surfaceType() == Trk::Surface::Perigee) {
+          tmpPerigeeParameters = static_cast<const Trk::Perigee*>(tp);
+        }
+
+        if (tmpPerigeeParameters != nullptr) {
+          break; // found perigee so stop loop.
         }
       }
     }
@@ -221,13 +233,19 @@ void Trk::Track::findPerigeeImpl() const
 const Trk::Perigee*
 Trk::Track::perigeeParameters() const
 {
+
   if (!m_perigeeParameters.isValid()) {
     // findPerigee performs the setting of the parameters
     // i.e does the CachedValue set
     findPerigeeImpl();
   }
-  // Here the cached value type is a pointer
-  return *(m_perigeeParameters.ptr());
+  
+  //Return payload if valid
+  if(m_perigeeParameters.isValid()){
+    return  *(m_perigeeParameters.ptr());
+  }
+
+  return nullptr;
 }
 
 const DataVector<const Trk::MeasurementBase>* Trk::Track::measurementsOnTrack() const
@@ -249,11 +267,12 @@ const DataVector<const Trk::MeasurementBase>* Trk::Track::measurementsOnTrack()
         const Trk::MeasurementBase* rot = (*itTSoS)->measurementOnTrack();
         // does it have a measurement ?
         if (rot!=nullptr) { tmpMeasurementVector.push_back( rot );
-}
+        }
       }
     }
     m_cachedMeasurementVector.set(std::move(tmpMeasurementVector));
   }
+
   return m_cachedMeasurementVector.ptr();
 }
 
@@ -354,10 +373,10 @@ std::ostream& Trk::operator << ( std::ostream& sl, const Trk::Track& track)
   std::string name("Track ");
   sl <<name<<"Author = "<<track.info().dumpInfo()<<std::endl;
   if (track.fitQuality()!=nullptr) { sl << *(track.fitQuality() )<<std::endl;
-}
+  }
   if (track.trackSummary()!=nullptr) { sl << *(track.trackSummary())<<std::endl;
   } else { sl << "No TrackSummary available in this track."<<std::endl;
-}
+  }
 
   if (track.trackStateOnSurfaces() !=nullptr)
   { 
-- 
GitLab


From 978c2a901a787769c96ab0327550e8200a87c619 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 10:06:15 +0200
Subject: [PATCH 114/217] TrigInDetTrackFitter: Delete
 TrigInDetBremDetectionTool

Delete obsolete `[I]TrigInDetBremDetectionTool` and enable
thread-checker.
---
 .../ITrigInDetBremDetectionTool.h             |  44 -
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../src/TrigInDetBremDetectionTool.cxx        | 900 ------------------
 .../src/TrigInDetBremDetectionTool.h          |  98 --
 .../TrigInDetTrackFitter_entries.cxx          |   2 -
 5 files changed, 1 insertion(+), 1044 deletions(-)
 delete mode 100644 Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigInDetBremDetectionTool.h
 create mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/ATLAS_CHECK_THREAD_SAFETY
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
 delete mode 100644 Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h

diff --git a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigInDetBremDetectionTool.h b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigInDetBremDetectionTool.h
deleted file mode 100644
index f7cc53367c2e..000000000000
--- a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigInDetBremDetectionTool.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __ITRIGINDETBREMDETECTIONTOOL_H__
-#define __ITRIGINDETBREMDETECTIONTOOL_H__
-
-#include "GaudiKernel/IAlgTool.h"
-
-namespace Trk {
-
-    class TrkBaseNode;
-    class TrkTrackState; 
-    class TrkPlanarSurface;  
-}
-
-static const InterfaceID IID_ITrigInDetBremDetectionTool("ITrigInDetBremDetectionTool",1,0);
-
-
-  /** @class ITrigInDetBremDetectionTool
-
-      provides the abstract interface for the input estimation algorithm used to apply 
-      bremsstrahlung corrections. 
-
-      @author D.Emeliyanov <http://consult.cern.ch/xwho>
-  */
-
-  class ITrigInDetBremDetectionTool : virtual public IAlgTool { 
-
-  public:
-    /** other standard AlgTool methods */
-    //    virtual ~ITrigInDetBremDetectionTool() {};                //!< virtual destructor
-
-    static const InterfaceID& interfaceID ()   //!< the Tool's interface
-      {  return IID_ITrigInDetBremDetectionTool; }  	
-
-    virtual void reset() = 0;
-    virtual bool addNewPoint(Trk::TrkTrackState*,Trk::TrkBaseNode*, Trk::TrkPlanarSurface*, double a[5][5], double) = 0;
-    virtual bool solve(int) = 0;
-    virtual void modifySurfaces(int) = 0;
-    virtual void report(int) = 0;
-  };
-
-#endif
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigInDetTrackFitter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..c4f097ecde7b
--- /dev/null
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigTools/TrigInDetTrackFitter
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
deleted file mode 100644
index 52ec78b7d221..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.cxx
+++ /dev/null
@@ -1,900 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//////////////////////////////////////////////////////////////////
-// TrigInDetBremDetectionTool.cxx
-//   Source file for TrigInDetBremDetectionTool
-///////////////////////////////////////////////////////////////////
-// (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-// Dmitry.Emeliyanov@cern.ch
-///////////////////////////////////////////////////////////////////
-
-#include "TrkDistributedKalmanFilter/TrkBaseNode.h"
-#include "TrkDistributedKalmanFilter/TrkFilteringNodes.h"
-#include "TrkDistributedKalmanFilter/TrkTrackState.h"
-#include "TrkDistributedKalmanFilter/TrkPlanarSurface.h"
-#include "TrigInDetBremDetectionTool.h"
-#include "AthenaBaseComps/AthMsgStreamMacros.h"
-#include <cmath>
-#include <cstring>
-using std::memset;
-
-//#define IDE_DEBUG 1
-
-TrigInDetBremDetectionTool::TrigInDetBremDetectionTool(const std::string& t,const std::string& n,const IInterface* p) :
-  AthAlgTool (t,n,p),
-  m_log(msgSvc(), n),
-  m_outputLevel(1),
-  m_minDistance(10.0),
-  m_P0(0.6),
-  m_SignificanceCut(4.5)
-{
-  declareProperty("minDistance",m_minDistance);
-  declareProperty("noBremProbability",m_P0);
-  declareProperty("MinSignificance",m_SignificanceCut);
-  declareInterface<ITrigInDetBremDetectionTool>( this );
-  m_pLS=NULL;
-}
-
-// destructor
-TrigInDetBremDetectionTool::~TrigInDetBremDetectionTool()
-{
-
-}
-// initialize
-StatusCode TrigInDetBremDetectionTool::initialize()
-{
-  StatusCode sc = AthAlgTool::initialize();
-
-  m_log.setLevel(msgLevel());            // individual outputlevel not known before initialise
-  m_outputLevel=msgSvc()->outputLevel( name() );
-  m_Threshold=2.0*log(m_P0/(1.0-m_P0));
-
-  m_log << MSG::INFO << "initialize() successful in " << name() << endmsg;
-  m_log << MSG::INFO << "Input detection threshold is set to " << m_Threshold << endmsg;
-
-  return sc;
-}
-
-// finalize
-StatusCode TrigInDetBremDetectionTool::finalize()
-{
-  if(m_pLS!=NULL) delete m_pLS;
-
-  m_log << MSG::INFO << "finalize() successful in " << name() << endmsg;
-  return StatusCode::SUCCESS;
-}
-
-void TrigInDetBremDetectionTool::reset()
-{
-  m_totalPath=0.0;
-  m_lsmSize=0;m_resSizes.clear();m_resSize=0;
-  memset(&m_A[0][0],0,sizeof(m_A));
-  memset(&m_MG[0][0],0,sizeof(m_MG));
-  memset(&m_S[0][0],0,sizeof(m_S));
-  if(m_pLS!=NULL) delete m_pLS;
-  m_pLS=NULL;
-}
-
-bool TrigInDetBremDetectionTool::addNewPoint(Trk::TrkTrackState* pTS,
-					     Trk::TrkBaseNode* pN, Trk::TrkPlanarSurface* pS, double F[5][5],
-					     double delta)
-{
-  int i,j,dim,k;
-  double res[5];
-  double K[5][2];
-  double H[2][5];
-  double S[2][2];
-  double mu[5][5];
-  double HF[2][5];
-  double M[5];
-  double lP[3],gP[3];
-
-
-  m_totalPath+=fabs(delta);
-
-  dim=pN->getKalmanGain(K);
-  dim=pN->getMeasurementMatrix(H);
-  dim=pN->getInverseResidualVariance(S);
-  dim=pN->getResiduals(res);
-
-#ifdef IDE_DEBUG
-
-  m_log<<MSG::INFO<<"new measurement, size="<<dim<< endmsg;
-  m_log<< MSG::INFO << " Accumulated path = "<< m_totalPath  << endmsg;
-
-  printf("Jacobian:\n");
-  for(i=0;i<5;i++)
-    {
-      for(j=0;j<5;j++)
-	printf("%E ",F[i][j]);
-      printf("\n");
-    }
-
-#endif
-
-  if(dim!=0)
-    {
-#ifdef IDE_DEBUG
-      printf("Measurement matrix:\n");
-      for(i=0;i<dim;i++)
-	{
-	  for(j=0;j<5;j++)
-	    printf("%E ",H[i][j]);
-	  printf("\n");
-	}  
-#endif
-      if(m_lsmSize!=0)
-	{
-	  m_resSizes.push_back(dim);
-	  for(i=0;i<dim;i++) 
-	    {
-	      m_R[m_resSize]=res[i];
-	      for(j=0;j<dim;j++) m_S[m_resSize][j]=S[i][j];
-	      m_resSize++;
-	    }
-	}
-      for(i=0;i<dim;i++)
-	for(j=0;j<5;j++)
-	  {
-	    HF[i][j]=0.0;
-	    for(k=0;k<5;k++) HF[i][j]+=H[i][k]*F[k][j];
-	  }
-      for(i=0;i<5;i++)
-	for(j=0;j<5;j++) 
-	  {
-	    mu[i][j]=F[i][j];
-	    for(k=0;k<dim;k++) mu[i][j]-=K[i][k]*HF[k][j];
-	  }
-    }
-  else
-    {
-      for(i=0;i<5;i++)
-	for(j=0;j<5;j++) 
-	  {
-	    mu[i][j]=F[i][j];
-	  }
-    }  
-  for(i=1;i<=m_lsmSize;i++)
-    {
-      for(k=0;k<5;k++)
-	{
-	  M[k]=0.0;
-	  for(j=0;j<5;j++) M[k]+=mu[k][j]*m_MG[j][i];
-	}
-      for(k=0;k<5;k++) m_MG[k][i]=M[k];
-    }
-  for(i=0;i<dim;i++)
-    {
-      for(k=1;k<=m_lsmSize;k++)
-	{
-	  m_A[i+m_resSize-dim][k-1]=0.0;
-	  for(j=0;j<5;j++) m_A[i+m_resSize-dim][k-1]+=HF[i][j]*m_MG[j][k];
-	}
-    }
-#ifdef IDE_DEBUG
-  printf("Matrix A:\n");
-  for(i=0;i<m_resSize;i++)
-    {
-      for(j=0;j<m_lsmSize;j++) printf("%E ",m_A[i][j]);
-      printf("\n");
-    }
-#endif
-  if(m_totalPath<m_minDistance) return false;
-
-  m_totalPath=0.0;
-  
-  m_lsmSize++;  
-
-  for(i=0;i<4;i++)
-  {
-    m_MG[i][m_lsmSize]=0.0;
-  }
-  m_MG[4][m_lsmSize]=1.0;
-
-  m_surfArray[m_lsmSize-1]=pS;
-
-  lP[0]=pTS->getTrackState(0);lP[1]=pTS->getTrackState(1);
-  lP[2]=0.0;
-  pS->transformPointToGlobal(lP,gP);
-  m_jX[m_lsmSize-1]=gP[0];m_jY[m_lsmSize-1]=gP[1];m_jZ[m_lsmSize-1]=gP[2]; 
-#ifdef IDE_DEBUG 
-  m_log << MSG::INFO << " Added new jump at "<<gP[0]<<" "<<gP[1]<<" "<<gP[2]<<endmsg;
-#endif
-  return true;
-}
-
-bool TrigInDetBremDetectionTool::solve(int Sign)
-{
-  int i;
-  bool isSolved=false;
-  bool isFeasible=false;
-  int size=m_lsmSize-1;
-  int nIter;
-  double Chi2Opt;
-  double g[MAX_INP_SIZE];
-
-  m_sign=Sign;
-  m_size=m_lsmSize-1;
-  precomputeGain();
-  if(m_pLS!=NULL) delete m_pLS;
-  m_pLS=NULL;
-
-  m_pLS=new LSMSolution(size);
-  for(i=0;i<m_size;i++)
-    {
-      m_pLS->fixVariable(i);
-    }
-  for(i=0;i<MAX_INP_SIZE;i++)
-    {
-      m_Zarray[i]=1;m_Parray[i]=0;
-    }
-  nIter=0;
-  while(!isSolved)
-    {
-      getGradient(m_pLS,g);
-#ifdef IDE_DEBUG
-      printf("++++ Gradient: ++++ Sign %d\n",Sign);
-      for(i=0;i<size;i++)
-	{
-	  printf("%E ",g[i]);
-	}
-      printf("\n");
-#endif
-      Chi2Opt=getCriterionValue(m_pLS);
-#ifdef IDE_DEBUG
-      printf("***** Criterion = %f ******\n",Chi2Opt);
-#endif
-      if(nIter>100) break;
-      if(isZempty()) 
-	{
-	  isSolved=true;break;
-	}
-      if(goodGradient(g))
-	{
-#ifdef IDE_DEBUG
-	  printf("Good gradient - solved\n");
-#endif
-	  isSolved=true;break;
-	}
-#ifdef IDE_DEBUG
-      else printf("Not good gradient - searching ...\n");
-#endif
-      int bestI=findBestDirection(g);
-#ifdef IDE_DEBUG
-      printf("Selected %d grad = %f\n",bestI,g[bestI]);
-#endif
-      m_Zarray[bestI]=0;m_Parray[bestI]=1;
-#ifdef IDE_DEBUG
-      for(i=0;i<m_size;i++) printf("%d ",m_Zarray[i]);
-      printf("\n");
-      for(i=0;i<m_size;i++) printf("%d ",m_Parray[i]);
-      printf("\n");
-#endif
-      isFeasible=false;
-     
-      while(!isFeasible)
-	{
-	  LSMSolution* pST=solveLSM();
-#ifdef IDE_DEBUG
-	  pST->report();
-#endif
-	  isFeasible=checkFeasibility(pST);
-	  if(!isFeasible)
-	    {
-#ifdef IDE_DEBUG
-	      printf("Non-feasible solution");
-#endif
-	      mixSolutions(pST,m_pLS);
-	      delete pST;
-	    }
-	  else
-	    {
-#ifdef IDE_DEBUG
-	      printf("Feasible solution\n");
-#endif
-	      delete m_pLS;
-	      m_pLS=pST;
-	    }
-	}
-      nIter++;
-    }
-  int nChanges=0;
-  bool nonZero=false;
-  
-  for(i=0;i<m_size;i++)
-    {
-      m_Zarray[i]=1;
-      if(!m_pLS->isOnConstraint(i))
-	{
-	  m_Zarray[i]=0;
-	  double utmp=(*m_pLS)[i];
-	  (*m_pLS)[i]=0.0;
-	  double Chi2Zero=getCriterionValue(m_pLS);
-	  if(m_outputLevel<=MSG::DEBUG)
-	    {
-	      m_log<<MSG::DEBUG<<i+1<<" Chi2* = "<<Chi2Opt<<" Chi20 = "<<Chi2Zero<<" Th="<<m_Threshold<<endmsg;
-	    }
-	  (*m_pLS)[i]=utmp;
-	  double deltaChi2=Chi2Zero-Chi2Opt;
-	  if(deltaChi2<m_Threshold)
-	    {
-	      m_Zarray[i]=1;
-	      nChanges++;
-	    }
-	  else nonZero=true;
-
-	}
-    }
-  if((nChanges!=0)&&nonZero)
-    {
-      LSMSolution* pUS=solveLSM();
-      if(m_outputLevel<=MSG::DEBUG)
-	{
-	  m_log<<MSG::DEBUG<<"LSM Solution"<<endmsg;
-	  pUS->report();
-	  Chi2Opt=getCriterionValue(pUS);
-	  m_log<<MSG::DEBUG<<"Criterion = "<<Chi2Opt<<endmsg;
-	}
-      delete m_pLS;
-      m_pLS=pUS;
-    }
-  if(!nonZero)
-    {
-      delete m_pLS;
-      m_pLS=new LSMSolution(size);
-      for(i=0;i<m_size;i++)
-	{
-	  m_pLS->fixVariable(i);
-	}
-      if(m_outputLevel<=MSG::DEBUG)
-	{
-	  m_log<<MSG::DEBUG<<"LSM Solution"<<endmsg;
-	  m_pLS->report();
-	  Chi2Opt=getCriterionValue(m_pLS);
-	  m_log<<MSG::DEBUG<<"Criterion = "<<Chi2Opt<<endmsg;
-	}
-    }
-  return isSolved;
-}
-
-void TrigInDetBremDetectionTool::precomputeGain()
-{
-  int i,j,k;
-  memset(&m_K[0][0],0,sizeof(m_K));
-
-  int sJ,J0;
-
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      J0=0;
-      for(std::vector<int>::iterator iIt=m_resSizes.begin();iIt!=m_resSizes.end();++iIt)
-	{
-	  for(sJ=0;sJ<(*iIt);sJ++)
-	    {
-	      j=J0+sJ;
-	      m_K[i][j]=0.0;
-	      for(k=J0;k<J0+(*iIt);k++)
-		{
-		  m_K[i][j]+=m_A[k][i]*m_S[k][sJ];
-		}
-	      j++;
-	    }
-	  J0+=(*iIt);
-	}
-    }
-
-  for(i=0;i<m_lsmSize-1;i++)
-    for(j=i;j<m_lsmSize-1;j++)
-      {
-	m_W[i][j]=0.0;
-	for(k=0;k<m_resSize;k++) m_W[i][j]+=m_K[i][k]*m_A[k][j];
-	m_W[j][i]=m_W[i][j];
-      }
-}
-
-
-void TrigInDetBremDetectionTool::getGradient(LSMSolution* pLS, double g[])
-{
-  int i,j;
-
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      g[i]=0.0;
-      for(j=i;j<m_resSize;j++) g[i]+=m_K[i][j]*m_R[j];
-    }
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      for(j=0;j<m_lsmSize-1;j++) g[i]-=m_W[i][j]*(*pLS)[j];
-    }
-}
-
-bool TrigInDetBremDetectionTool::goodGradient(double* g)
-{
-  int i,np=0;
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      if(m_Zarray[i]==0) continue;
-      if(g[i]*m_sign>0.0) np++;
-    }
-  return (np==0);
-}
-
-int TrigInDetBremDetectionTool::findBestDirection(double* g)
-{
-  int i,bestI=0;
-  double maxGrad=-1.0;
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      if(g[i]*m_sign>maxGrad) 
-	{
-	  maxGrad=g[i]*m_sign;
-	  bestI=i;
-	}
-    }
-  return bestI;
-}
-
-bool TrigInDetBremDetectionTool::isZempty()
-{
-  int i;
-  
-  for(i=0;i<m_lsmSize-1;i++)
-    {
-      if(m_Zarray[i]==1) return false;
-    }
-  return true;
-}
-
-bool TrigInDetBremDetectionTool::CholeskyDecompositionNxN(double* a,int Size)
-{
-  int i,j,k;
-  double sum;
-  double* p=new double[Size];
-
-  for(i=0;i<Size;i++)
-    {
-      for(j=i;j<Size;j++)
-	{
-	  sum=a[i+j*Size];
-	  for(k=i-1;k>=0;k--)
-	    sum-=a[i+k*Size]*a[j+k*Size];
-	  if(i==j)
-	    {
-	      if(sum<=0.0)
-		{
-		  printf("Cholesky decomp. failed\n");delete[] p;
-		  return false;
-		}
-	      p[i]=sqrt(sum);
-	    }
-	  else a[j+i*Size]=sum/p[i];
-	}
-    }
-  for(i=0;i<Size;i++)
-    {
-      a[i+Size*i]=1.0/p[i];
-      for(j=i+1;j<Size;j++)
-	{
-	  sum=0.0;for(k=i;k<j;k++) sum-=a[j+Size*k]*a[k+Size*i];
-	  a[j+Size*i]=sum/p[j];
-	}
-    }
-  delete[] p;
-  return true;
-}
-
-
-bool TrigInDetBremDetectionTool::invertMatrixNxN(double* a, int size)
-{
-  double detr;
-  int i,j;
-  bool rc=false;
-
-  if(size==1)
-    {
-      a[0]=1.0/a[0];
-      rc=true;
-    }
-  else if(size==2)
-    {
-      detr=a[0]*a[3]-a[1]*a[2];
-      detr=1.0/detr;
-      double b[2][2];
-      b[0][0]=a[3]*detr;
-      b[1][0]=b[0][1]=-a[1]*detr;
-      b[1][1]=a[0]*detr;
-      for(i=0;i<2;i++) for(j=0;j<2;j++) a[i+j*size]=b[i][j];
-      rc=true;
-    }
-  else if(size==3)
-    {
-      double A[3][3],b[3][3],M[3];
-      for(i=0;i<3;i++) for(j=0;j<3;j++) A[i][j]=a[i+j*size];
-
-      M[0]=A[1][1]*A[2][2]-A[1][2]*A[1][2];
-      M[1]=A[0][1]*A[2][2]-A[1][2]*A[0][2];
-      M[2]=A[0][1]*A[1][2]-A[1][1]*A[0][2];
-      detr=A[0][0]*M[0]-A[0][1]*M[1]+A[0][2]*M[2];
-      detr=1.0/detr;
-      b[0][0]=M[0]*detr;
-      b[0][1]=b[1][0]=-M[1]*detr;
-      b[0][2]=b[2][0]=M[2]*detr;
-      b[1][1]=(A[0][0]*A[2][2]-A[0][2]*A[0][2])*detr;
-      b[1][2]=b[2][1]=-(A[0][0]*A[1][2]-A[0][1]*A[0][2])*detr;
-      b[2][2]=(A[0][0]*A[1][1]-A[0][1]*A[0][1])*detr;
-      for(i=0;i<3;i++) for(j=0;j<3;j++) a[i+j*size]=b[i][j];
-      rc=true;
-    }
-  else if(size>3)
-    {      
-      if(!CholeskyDecompositionNxN(a,size)) return false;
-
-      double* L=new double[size*size];
-      double* LT=new double[size*size];
-
-      memset(L,0,sizeof(double)*size*size);
-      memset(LT,0,sizeof(double)*size*size);
-
-      for(i=0;i<size;i++)
-		  for(j=0;j<=i;j++)
-		  {
-			  L[i+j*size]=a[i+j*size];
-			  LT[j+i*size]=L[i+size*j];
-		  }
-      for(i=0;i<size;i++)
-	  {
-		  for(j=i;j<size;j++)
-		  {
-			  double sum=0.0;
-			  for(int k=0;k<size;k++) sum+=LT[i+k*size]*L[k+j*size];
-			  a[j+i*size]=a[i+j*size]=sum;
-		  }
-	  }
-      delete[] L;
-      delete[] LT;
-      rc=true;
-    }
-  return rc;
-}
-
-
-LSMSolution* TrigInDetBremDetectionTool::solveLSM()
-{
-  LSMSolution* pLS=NULL;
-
-  int i,j,idxI,idxJ,newSize=m_size;
-  double W[MAX_INP_SIZE][MAX_INP_SIZE];
-  double P[MAX_INP_SIZE][MAX_INP_SIZE];
-  double E[MAX_INP_SIZE];
-  double chi2;
-  
-  memset(&W[0][0],0,sizeof(W));
-
-  for(i=0;i<m_size;i++) if(m_Zarray[i]==1) newSize--;
-
-  //  printf("newSize = %d\n",newSize);
-
-  idxI=-1;idxJ=-1;
-  for(i=0;i<m_size;i++)
-    {
-      if(m_Zarray[i]==1) continue;
-      idxI++;idxJ=idxI-1;
-      for(j=i;j<m_size;j++)
-	{
-	  if(m_Zarray[j]==1) continue;
-	  idxJ++;
-	  W[idxI][idxJ]=0.0;
-	  //  printf("Computing W: I=%d J=%d\n",idxI,idxJ);
-	  W[idxJ][idxI]=W[idxI][idxJ]=m_W[i][j];
-	}
-    }
-  /*
-  printf("Reduced W:\n");
-  for(i=0;i<newSize;i++)
-    {
-      for(j=0;j<newSize;j++) printf("%E ",W[i][j]);
-      printf("\n");
-    }
-  */
-  double* a=new double[newSize*newSize];
-  for(i=0;i<newSize;i++) for(j=0;j<newSize;j++) a[i+j*newSize]=W[i][j];
-  bool rc=this->invertMatrixNxN(a,newSize);
-  if(!rc)
-    {
-      delete[] a;
-      return NULL;
-    }
-  for(i=0;i<newSize;i++) for(j=0;j<newSize;j++) P[i][j]=a[i+j*newSize];
-  /*
-  printf("Inverted W:\n");
-  for(i=0;i<newSize;i++)
-    {
-      for(j=0;j<newSize;j++)
-	printf("%E ",P[i][j]);
-      printf("\n");
-    }
-  */
-  idxI=-1;
-
-  double Q[MAX_INP_SIZE];
-  memset(&Q[0],0,sizeof(Q));
-  for(i=0;i<m_size;i++)
-    {
-      if(m_Zarray[i]==1) continue;
-      idxI++;
-      Q[idxI]=0.0;
-      for(j=0;j<m_resSize;j++) Q[idxI]+=m_K[i][j]*m_R[j];
-    }
-  //printf("Solution:\n");
-  for(i=0;i<newSize;i++)
-    {
-      E[i]=0.0;
-      for(j=0;j<newSize;j++) E[i]+=P[i][j]*Q[j];
-      //  printf("%E \n",E[i]);
-    }
-  chi2=0.0;
-  for(i=0;i<newSize;i++)
-    for(j=0;j<newSize;j++) chi2+=E[i]*W[i][j]*E[j];
-  // printf("Significance: %f\n",chi2);
-  pLS = new LSMSolution(m_size);
-  pLS->Significance()=chi2;
-
-  idxI=-1;
-  for(i=0;i<m_size;i++)
-    {
-      if(m_Zarray[i]==1)
-	{
-	  (*pLS)[i]=0.0;pLS->fixVariable(i);
-	  continue;
-	}
-      idxI++;
-      (*pLS)[i]=E[idxI];idxJ=-1;
-      for(j=0;j<m_size;j++)
-	{
-	  if(m_Zarray[j]==1) continue;
-	  idxJ++;
-	  pLS->Cov(i,j)=P[idxI][idxJ];
-	}
-    }
-  delete[] a;
-  return pLS;
-}
-
-
-double TrigInDetBremDetectionTool::getCriterionValue(LSMSolution* pLS)
-{
-  double R[MAX_RES_SIZE];
-  int i,j,k;
-  double crit=0.0;
-
-  for(i=0;i<m_resSize;i++)
-    {
-      R[i]=m_R[i];
-      for(j=0;j<m_size;j++) R[i]-=m_A[i][j]*(*pLS)[j];
-    }
-  i=0;
-  for(std::vector<int>::iterator iIt=m_resSizes.begin();iIt!=m_resSizes.end();++iIt)
-      {
-	for(j=0;j<(*iIt);j++)
-	  {
-	    for(k=0;k<(*iIt);k++) crit+=R[i+j]*m_S[i+j][k]*R[i+k];
-	  }
-	i+=(*iIt);
-      }
-  return crit;
-}
-
-bool TrigInDetBremDetectionTool::checkFeasibility(LSMSolution * pS)
-{
-  int i;
-  bool rc=true;
-  for(i=0;i<m_size;i++)
-    {
-      if(m_Parray[i]!=1) continue;
-      if((*pS)[i]*m_sign<0.0) 
-	{
-	  rc=false;break;
-	}
-    }
-  return rc;
-}
-
-void TrigInDetBremDetectionTool::mixSolutions(LSMSolution* pST, LSMSolution* pLS)
-{
-  int i,iMin=-1;
-  double aMin=1000000.0,a;
-
-  for(i=0;i<m_size;i++)
-    {
-      if(m_Parray[i]!=1) continue;
-      if(m_sign*(*pST)[i]>0.0) continue;
-      a=(*pLS)[i]/((*pLS)[i]-(*pST)[i]);
-      //      printf("i=%d alpha=%f\n",i,a);
-      if(a<aMin)
-	{
-	  aMin=a;iMin=i;
-	}
-  }
-  if(iMin<0) return;
-  // printf("Closest component %d with alpha=%f\n",iMin,aMin);
-  for(i=0;i<m_size;i++)
-    {
-      (*pLS)[i]=(1.0-aMin)*(*pLS)[i]+aMin*(*pST)[i];
-    }
-  m_Zarray[iMin]=1;m_Parray[iMin]=0;
-}
-
-void TrigInDetBremDetectionTool::modifySurfaces(int flag)
-{
-  int i;
-
-  if(flag!=0)
-    {
-      if(m_pLS!=NULL)
-	{
-	  if(m_pLS->Significance()>m_SignificanceCut)
-	    {
-	      for(i=0;i<m_size;i++)
-		{
-		  if(!m_pLS->isOnConstraint(i))
-		    {
-		      m_surfArray[i]->setBreakPoint((*m_pLS)[i]);
-		      if(m_outputLevel<=MSG::DEBUG)
-			{
-			  m_log<<MSG::DEBUG<<i<<"  Breakpoint is set, u="<<(*m_pLS)[i]<<
-			    " X="<<m_jX[i]<<" Y="<<m_jY[i]<<" Z="<<m_jZ[i]<<endmsg;
-			}
-		    }
-		  else 
-		    if(m_outputLevel<=MSG::DEBUG)
-			{
-			  m_log<<MSG::DEBUG<<i<<"  Not a Breakpoint X="<<m_jX[i]<<" Y="<<m_jY[i]<<
-			    " Z="<<m_jZ[i]<<endmsg;
-			}
-		}
-	    }
-	}
-    }
-  else
-    {
-      for(i=0;i<m_size;i++) 
-	{
-	  m_surfArray[i]->unsetBreakPoint();                                                                               
-	}
-    }
-  delete m_pLS;m_pLS=NULL;
-}
-
-
-void TrigInDetBremDetectionTool::report(int flag)
-{
-  int i,j,k;
-
-  if(flag==1) //Residuals
-    {
-      m_log << MSG::DEBUG << "IDE Residuals : "<< endmsg;
-      i=0;
-      for(std::vector<int>::iterator iIt=m_resSizes.begin();iIt!=m_resSizes.end();++iIt)
-	{
-	  for(j=0;j<(*iIt);j++)
-	    {
-	      m_log << MSG::DEBUG << "   "<<m_R[i]<< endmsg;
-	      i++;
-	    }
-	}
-    }
-  if(flag==2) //LSM
-  {
-    i=0;
-    m_log << MSG::DEBUG << "LSM Problem : nU="<<m_lsmSize-1<<" nR="<<m_resSize<< endmsg;
-    for(std::vector<int>::iterator iIt=m_resSizes.begin();iIt!=m_resSizes.end();++iIt)
-      {
-	for(j=0;j<(*iIt);j++)
-	  {
-	    m_log << MSG::DEBUG <<m_R[i]<<"    [";
-	    for(k=0;k<(*iIt);k++) m_log << MSG::DEBUG <<m_S[i][k]<<"  ";
-	    m_log << MSG::DEBUG <<"]  ";
-	    for(k=0;k<m_lsmSize-1;k++)
-	      m_log << MSG::DEBUG <<m_A[i][k]<<" ";
-	    m_log << MSG::DEBUG << endmsg;
-	    i++;
-	  } 
-      }
-    m_log << MSG::DEBUG << "LSM Gain Matrix "<< endmsg;
-    for(i=0;i<m_lsmSize-1;i++)
-      {
-	for(j=0;j<m_resSize;j++)
-	  m_log << MSG::DEBUG <<m_K[i][j]<<"  ";
-	m_log << MSG::DEBUG << endmsg;
-      }
-    m_log << MSG::DEBUG << "LSM Weight Matrix "<< endmsg;
-    for(i=0;i<m_lsmSize-1;i++)
-      {
-	for(j=0;j<m_lsmSize-1;j++)
-	  m_log << MSG::DEBUG <<m_W[i][j]<<"  ";
-	m_log << MSG::DEBUG << endmsg;
-      }
-
-    m_log << MSG::DEBUG << "-----------------------"<< endmsg;
-  }
-}
-
-
-LSMSolution::LSMSolution()
-{
-  m_size=0;
-  int i,j; 
-  m_Chi2=0.0;
-  for(i=0;i<=m_size;i++) 
-    {
-      m_u[i]=0.0;
-      m_fixedVariables[i]=0;
-      for(j=0;j<=m_size;j++) m_C[i][j]=0.0;
-    }
-}
-
-LSMSolution::~LSMSolution()
-{
-
-}
-
-LSMSolution::LSMSolution(int size) : m_size(size)
-{
-  int i,j; 
-  m_Chi2=0.0;
-  for(i=0;i<=m_size;i++) 
-    {
-      m_u[i]=0.0;
-      m_fixedVariables[i]=0;
-      for(j=0;j<=m_size;j++) m_C[i][j]=0.0;
-    }
-}
-
-double& LSMSolution::operator[] (int i)
-{
-  if((i<0)||(i>=m_size))
-    return m_u[0];
-  else return m_u[i];
-}
-
-double& LSMSolution::Cov(int i, int j)
-{
-  if((i<0)||(i>=m_size)) return m_C[0][0];
-  if((j<0)||(j>=m_size)) return m_C[0][0];
-  return m_C[i][j];
-}
-
-double& LSMSolution::Significance()
-{
-  return m_Chi2;
-}
-
-bool LSMSolution::isOnConstraint(int i)
-{
-  return (m_fixedVariables[i]==1);
-}
-
-void LSMSolution::fixVariable(int i)
-{
-  m_fixedVariables[i]=1;
-}
-
-void LSMSolution::report()
-{
-  int i,j;
-
-  printf("LSM Solution size %d\n",m_size);
-  for(i=0;i<m_size;i++)
-    {
-      printf("%E  ",m_u[i]);
-      if(isOnConstraint(i)) printf("constr.  ");
-      else printf("free    ");
-      for(j=0;j<m_size;j++) printf("%E ",m_C[i][j]);
-      printf("\n");
-    }
-  printf("Significance  %f\n",m_Chi2);
-  
-}
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h
deleted file mode 100644
index 3589928a49ea..000000000000
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetBremDetectionTool.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef __TRIGINDETBREMDETECTIONTOOL_H__
-#define __TRIGINDETBREMDETECTIONTOOL_H__
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/MsgStream.h"
-
-#include "TrigInDetToolInterfaces/ITrigInDetBremDetectionTool.h"
-#include <vector>
-
-#define MAX_RES_SIZE 100
-#define MAX_INP_SIZE 20
-
-
-class LSMSolution  
-{
-public:
-  void report();
-  void fixVariable(int);
-  bool isOnConstraint(int);
-  double& Significance();
-  double& Cov(int,int);
-  LSMSolution(int);
-  LSMSolution();
-  virtual ~LSMSolution();
-  double& operator[] (int);
-
-private:
-  int m_fixedVariables[MAX_INP_SIZE];
-  double m_Chi2;
-  double m_C[MAX_INP_SIZE][MAX_INP_SIZE];
-  int m_size;
-  double m_u[MAX_INP_SIZE];
-};
-
-class TrigInDetBremDetectionTool : virtual public ITrigInDetBremDetectionTool, public AthAlgTool {
- public:
-      
-  // standard AlgTool methods
-  TrigInDetBremDetectionTool(const std::string&,const std::string&,const IInterface*);
-  virtual ~TrigInDetBremDetectionTool();
-		
-  // standard Athena methods
-  StatusCode initialize();
-  StatusCode finalize();
-  virtual void reset(); 
-  virtual bool addNewPoint(Trk::TrkTrackState*,Trk::TrkBaseNode*, Trk::TrkPlanarSurface*, double a[5][5],double);
-  virtual bool solve(int);
-  virtual void modifySurfaces(int);
-  virtual void report(int);
-    
-  private:
-
-    void mixSolutions(LSMSolution*, LSMSolution*);
-    bool checkFeasibility(LSMSolution*);
-    int findBestDirection(double*);
-    bool goodGradient(double*);
-    bool isZempty();
-    double getCriterionValue(LSMSolution*);
-    LSMSolution* solveLSM();
-    void fixVariables(const int *);
-    void precomputeGain();
-    void report();
-    void getGradient(LSMSolution*,double[]);
-    bool CholeskyDecompositionNxN(double*,int);
-    bool invertMatrixNxN(double*, int);
-    double m_K[MAX_INP_SIZE][MAX_RES_SIZE];
-    double m_W[MAX_INP_SIZE][MAX_INP_SIZE];
-    int m_size;
-    
-    double m_A[MAX_RES_SIZE][MAX_INP_SIZE];
-    double m_MG[5][MAX_INP_SIZE];
-    double m_jX[MAX_INP_SIZE];
-    double m_jY[MAX_INP_SIZE];
-    double m_jZ[MAX_INP_SIZE];
-    double m_S[MAX_RES_SIZE][2];
-    mutable MsgStream  m_log;         //!< msgstream as private member (-> speed)
-    int m_outputLevel; //!< private member to control debug messages
-    double m_totalPath;
-    double m_minDistance;
-    double m_P0;
-    double m_SignificanceCut;
-    int m_lsmSize,m_resSize;
-    std::vector<int> m_resSizes;
-    double m_R[MAX_INP_SIZE];
-    
-    int m_Parray[MAX_INP_SIZE];
-    int m_Zarray[MAX_INP_SIZE];
-    int m_sign;
-    double m_Threshold;
-    LSMSolution* m_pLS;
-    Trk::TrkPlanarSurface* m_surfArray[MAX_INP_SIZE];
-  };
-
-#endif 
diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
index d3cd7735a22a..eb424e52f935 100644
--- a/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
+++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/components/TrigInDetTrackFitter_entries.cxx
@@ -1,9 +1,7 @@
 #include "../TrigInDetTrackFitter.h"
-#include "../TrigInDetBremDetectionTool.h"
 #include "../TrigDkfTrackMakerTool.h"
 #include "../TrigL2ResidualCalculator.h"
 
 DECLARE_COMPONENT( TrigInDetTrackFitter )
-DECLARE_COMPONENT( TrigInDetBremDetectionTool )
 DECLARE_COMPONENT( TrigDkfTrackMakerTool )
 DECLARE_COMPONENT( TrigL2ResidualCalculator )
-- 
GitLab


From be0b59a8d24deeec74e9fff26f1bcdf61cd70009 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 11:26:02 +0200
Subject: [PATCH 115/217] Move TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h
 to TrigInDetToolInterfaces

---
 .../InDetTrigRecAlgs/InDetTrigVxSecondary/CMakeLists.txt     | 2 +-
 .../InDetTrigVxSecondary/TrigVxSecondary.h                   | 2 +-
 .../InDetTrigVxSecondary/TrigVxSecondaryCombo.h              | 2 +-
 Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt       | 2 +-
 .../TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h     | 2 +-
 Trigger/TrigHypothesis/TrigBjetHypo/CMakeLists.txt           | 2 +-
 .../TrigHypothesis/TrigBjetHypo/Root/TrigBjetFexStandalone.h | 2 +-
 .../TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetFex.h   | 2 +-
 .../TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h   | 2 +-
 .../TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h    | 2 +-
 Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.h      | 2 +-
 Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt     | 2 +-
 .../TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx | 2 +-
 .../TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h   | 2 +-
 .../TrigInDetToolInterfaces}/ITrigTrackJetFinderTool.h       | 5 ++---
 Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt      | 2 +-
 .../TrigTrackJetFinderTool/TrigTrackJetFinderTool.h          | 2 +-
 17 files changed, 18 insertions(+), 19 deletions(-)
 rename Trigger/TrigTools/{TrigTrackJetFinderTool/TrigTrackJetFinderTool => TrigInDetToolInterfaces/TrigInDetToolInterfaces}/ITrigTrackJetFinderTool.h (90%)

diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/CMakeLists.txt b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/CMakeLists.txt
index e186c337ad0e..98aa09161fbf 100644
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/CMakeLists.txt
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/CMakeLists.txt
@@ -11,7 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           Tracking/TrkEvent/VxSecVertex
                           Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTrackJetFinderTool
+                          Trigger/TrigTools/TrigInDetToolInterfaces
                           PRIVATE
                           Control/AthContainers
                           Control/CxxUtils
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondary.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondary.h
index 966cc85d7834..a3cb8dd998a6 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondary.h
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondary.h
@@ -16,7 +16,7 @@
 
 // Trigger specific stuff
 #include "TrigInterfaces/FexAlgo.h"
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 
 #include "VxSecVertex/VxSecVertexInfo.h"
 #include "VxSecVertex/VxSecVKalVertexInfo.h"
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondaryCombo.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondaryCombo.h
index 3e79d18809eb..a82ecd00bc7a 100755
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondaryCombo.h
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/InDetTrigVxSecondary/TrigVxSecondaryCombo.h
@@ -17,7 +17,7 @@
 
 // Trigger specific stuff
 #include "TrigInterfaces/ComboAlgo.h"
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 
 #include "VxSecVertex/VxSecVertexInfo.h"
 #include "VxSecVertex/VxSecVKalVertexInfo.h"
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
index 86d57d14bcfb..5867a46d9553 100644
--- a/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
@@ -11,7 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigTools/TrigInDetVxInJetTool
                           Trigger/TrigTools/TrigTimeAlgs
-                          Trigger/TrigTools/TrigTrackJetFinderTool
+                          Trigger/TrigTools/TrigInDetToolInterfaces
                           InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
                           Control/CxxUtils
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h
index ddcbc45947fd..f44a76b60d2a 100755
--- a/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h
@@ -19,7 +19,7 @@
 #include "TrigTimeAlgs/TrigTimer.h"
 #include "TrigInterfaces/FexAlgo.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 #include "TrigInDetVxInJetTool/ITrigInDetVxInJetTool.h"
 #include "BeamSpotConditionsData/BeamSpotData.h"
 
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigBjetHypo/CMakeLists.txt
index b9172aec1028..857b0e5630ef 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/CMakeLists.txt
@@ -17,7 +17,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigInDetEvent
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigSteer/TrigCompositeUtils
-                          Trigger/TrigTools/TrigTrackJetFinderTool
+                          Trigger/TrigTools/TrigInDetToolInterfaces
 			  Control/AthViews
                           InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/Root/TrigBjetFexStandalone.h b/Trigger/TrigHypothesis/TrigBjetHypo/Root/TrigBjetFexStandalone.h
index b5b649dae84c..f0892fe84427 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/Root/TrigBjetFexStandalone.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/Root/TrigBjetFexStandalone.h
@@ -23,7 +23,7 @@
 #include "TrigBjetHypo/TuningLikelihood.h"
 #include "TrigBjetHypo/TrigBjetDataHelper.h"
 
-//#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+//#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 //#include "VxSecVertex/VxSecVertexInfo.h"
 
 class TaggerHelper;
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetFex.h
index ac6b64d8741e..3d1759805e8c 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetFex.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBjetFex.h
@@ -23,7 +23,7 @@
 #include "TrigBjetHypo/TuningLikelihood.h"
 #include "TrigBjetHypo/TrigBjetDataHelper.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 #include "VxSecVertex/VxSecVertexInfo.h"
 #include "BeamSpotConditionsData/BeamSpotData.h"
 
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
index 8f08e171edde..00a53b411f54 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigBtagFex.h
@@ -26,7 +26,7 @@
 #include "TrigBjetHypo/TuningLikelihood.h"
 #include "TrigBjetHypo/TrigBjetDataHelper.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 #include "VxSecVertex/VxSecVertexInfo.h"
 
 #include "BTagging/IBTagTool.h"
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
index 32cefa5c48cd..69f50c71b163 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/TrigGSCFex.h
@@ -27,7 +27,7 @@
 //#include "TrigBjetHypo/TuningLikelihood.h"
 //#include "TrigBjetHypo/TrigBjetDataHelper.h"
 
-//#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+//#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 //#include "VxSecVertex/VxSecVertexInfo.h"
 
 class MsgStream;
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.h
index 0a2158188b8d..9e97b71f6c69 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.h
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.h
@@ -27,7 +27,7 @@
 #include "TrigBjetHypo/TuningLikelihood.h"
 #include "TrigBjetHypo/TrigBjetDataHelper.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 #include "VxSecVertex/VxSecVertexInfo.h"
 
 
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
index 584d844c288e..c1ad515099d5 100644
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/CMakeLists.txt
@@ -10,7 +10,7 @@ find_package( ROOT COMPONENTS Core Hist MathCore )
 atlas_add_component( TrigBjetMonitoring
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringKernelLib AthenaMonitoringLib EventPrimitives FourMomUtils GaudiKernel GeoPrimitives JetEvent JetUtils Particle StoreGateLib TrigDecisionToolLib TrigHLTMonitoringLib TrigParticle TrigTrackJetFinderToolLib muonEvent xAODBTagging xAODEventInfo xAODMuon xAODTracking )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringKernelLib AthenaMonitoringLib EventPrimitives FourMomUtils GaudiKernel GeoPrimitives JetEvent JetUtils Particle StoreGateLib TrigDecisionToolLib TrigHLTMonitoringLib TrigParticle TrigInDetToolInterfacesLib muonEvent xAODBTagging xAODEventInfo xAODMuon xAODTracking )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
index f6176ab7981b..bcef5e4e6041 100755
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx
@@ -68,7 +68,7 @@
 
 #include "HLTBjetMonTool.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 
 #include "GaudiKernel/ListItem.h"
 
diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h
index 323c2031ea7a..790c5cb9f2cc 100755
--- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h
+++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h
@@ -22,7 +22,7 @@
 
 
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 
 
 #include "TrigDecisionTool/TrigDecisionTool.h"
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h
similarity index 90%
rename from Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h
rename to Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h
index e282b8783462..d0065b1068b5 100755
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h
+++ b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h
@@ -5,15 +5,14 @@
 // **************************************************
 //
 // NAME:     ITrigTrackJetFinderTool.h
-// PACKAGE:  Trigger/TrigTools/TrigTrackJetFinderTool
 //
 // AUTHOR:   Andrea Coccaro
 // MAIL:     Andrea.Coccaro@ge.infn.it
 // 
 // **************************************************
 
-#ifndef ITRIGTRACKJETFINDERTOOL_H
-#define ITRIGTRACKJETFINDERTOOL_H
+#ifndef TRIGINDETTOOLINTERFACES_ITRIGTRACKJETFINDERTOOL_H
+#define TRIGINDETTOOLINTERFACES_ITRIGTRACKJETFINDERTOOL_H
 
 #include "GaudiKernel/IAlgTool.h"
 
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt b/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
index 7a38c64000ac..037af6ec19e8 100644
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
@@ -21,7 +21,7 @@ atlas_add_library( TrigTrackJetFinderToolLib
                    TrigTrackJetFinderTool/*.h
                    INTERFACE
                    PUBLIC_HEADERS TrigTrackJetFinderTool
-                   LINK_LIBRARIES AthenaBaseComps GaudiKernel Particle TrigInDetEvent TrkTrack )
+                   LINK_LIBRARIES AthenaBaseComps GaudiKernel Particle TrigInDetEvent TrigInDetToolInterfacesLib TrkTrack )
 
 atlas_add_component( TrigTrackJetFinderTool
                      src/*.cxx
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h b/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h
index 6bb7b70b910f..35551878a40d 100755
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h
+++ b/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h
@@ -24,7 +24,7 @@
 
 #include "AthenaBaseComps/AthAlgTool.h"
 
-#include "TrigTrackJetFinderTool/ITrigTrackJetFinderTool.h"
+#include "TrigInDetToolInterfaces/ITrigTrackJetFinderTool.h"
 
 #include "TrigInDetEvent/TrigInDetTrack.h"
 #include "Particle/TrackParticle.h"
-- 
GitLab


From 33cebf9edacbbf550da604eb421f701ad5bf22b7 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 11:29:30 +0200
Subject: [PATCH 116/217] TrigTrackJetFinderTool: CMake cleanup

- tidy link dependencies
- move private header to src/
- remove interface library
---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  0
 .../TrigTrackJetFinderTool/CMakeLists.txt     | 20 ++-----------------
 .../src/TrigTrackJetFinderTool.cxx            |  2 +-
 .../TrigTrackJetFinderTool.h                  |  0
 .../TrigTrackJetFinderTool_entries.cxx        |  2 +-
 5 files changed, 4 insertions(+), 20 deletions(-)
 rename Trigger/TrigTools/TrigTrackJetFinderTool/{TrigTrackJetFinderTool => }/ATLAS_CHECK_THREAD_SAFETY (100%)
 rename Trigger/TrigTools/TrigTrackJetFinderTool/{TrigTrackJetFinderTool => src}/TrigTrackJetFinderTool.h (100%)
 mode change 100755 => 100644

diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigTools/TrigTrackJetFinderTool/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/ATLAS_CHECK_THREAD_SAFETY
rename to Trigger/TrigTools/TrigTrackJetFinderTool/ATLAS_CHECK_THREAD_SAFETY
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt b/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
index 037af6ec19e8..0bed70f07e8d 100644
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigTrackJetFinderTool/CMakeLists.txt
@@ -1,30 +1,14 @@
-################################################################################
-# Package: TrigTrackJetFinderTool
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTrackJetFinderTool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/TrkTrack
-                          Trigger/TrigEvent/TrigInDetEvent )
-
 # External dependencies:
 find_package( ROOT COMPONENTS MathCore )
 
 # Component(s) in the package:
-atlas_add_library( TrigTrackJetFinderToolLib
-                   TrigTrackJetFinderTool/*.h
-                   INTERFACE
-                   PUBLIC_HEADERS TrigTrackJetFinderTool
-                   LINK_LIBRARIES AthenaBaseComps GaudiKernel Particle TrigInDetEvent TrigInDetToolInterfacesLib TrkTrack )
-
 atlas_add_component( TrigTrackJetFinderTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} TrigTrackJetFinderToolLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps Particle TrigInDetEvent TrigInDetToolInterfacesLib TrkTrack )
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.cxx b/Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.cxx
index 9d5567b9758c..3639037e995b 100755
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.cxx
+++ b/Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.cxx
@@ -13,7 +13,7 @@
 // 
 // *********************************************************
 
-#include "TrigTrackJetFinderTool/TrigTrackJetFinderTool.h"
+#include "TrigTrackJetFinderTool.h"
 #include "TMath.h"
 
 using namespace std;
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h b/Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.h
old mode 100755
new mode 100644
similarity index 100%
rename from Trigger/TrigTools/TrigTrackJetFinderTool/TrigTrackJetFinderTool/TrigTrackJetFinderTool.h
rename to Trigger/TrigTools/TrigTrackJetFinderTool/src/TrigTrackJetFinderTool.h
diff --git a/Trigger/TrigTools/TrigTrackJetFinderTool/src/components/TrigTrackJetFinderTool_entries.cxx b/Trigger/TrigTools/TrigTrackJetFinderTool/src/components/TrigTrackJetFinderTool_entries.cxx
index 4354c96a9287..cdf492ab54c6 100644
--- a/Trigger/TrigTools/TrigTrackJetFinderTool/src/components/TrigTrackJetFinderTool_entries.cxx
+++ b/Trigger/TrigTools/TrigTrackJetFinderTool/src/components/TrigTrackJetFinderTool_entries.cxx
@@ -1,4 +1,4 @@
-#include "TrigTrackJetFinderTool/TrigTrackJetFinderTool.h"
+#include "../TrigTrackJetFinderTool.h"
 
 DECLARE_COMPONENT( TrigTrackJetFinderTool )
 
-- 
GitLab


From 238406be48fbf20c06d897f83ce93ab6f75011a4 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 11:43:44 +0200
Subject: [PATCH 117/217] TrigTimeAlgs: CMake cleanup

---
 Trigger/TrigTools/TrigTimeAlgs/CMakeLists.txt | 33 +++++--------------
 .../share/jobOfragment_TrigTimerSvc.py        | 20 -----------
 2 files changed, 8 insertions(+), 45 deletions(-)
 delete mode 100755 Trigger/TrigTools/TrigTimeAlgs/share/jobOfragment_TrigTimerSvc.py

diff --git a/Trigger/TrigTools/TrigTimeAlgs/CMakeLists.txt b/Trigger/TrigTools/TrigTimeAlgs/CMakeLists.txt
index a8a67928222e..4210d42abaae 100644
--- a/Trigger/TrigTools/TrigTimeAlgs/CMakeLists.txt
+++ b/Trigger/TrigTools/TrigTimeAlgs/CMakeLists.txt
@@ -1,45 +1,28 @@
-################################################################################
-# Package: TrigTimeAlgs
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTimeAlgs )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/AthenaKernel
-                          Control/AthContainers
-                          GaudiKernel
-                          PRIVATE
-                          Control/CxxUtils
-                          AtlasTest/TestTools )
-
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( Boost COMPONENTS regex )
+find_package( ROOT COMPONENTS Core Hist )
 
 # Component(s) in the package:
 atlas_add_library( TrigTimeAlgsLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigTimeAlgs
                    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers GaudiKernel
-                   PRIVATE_LINK_LIBRARIES TestTools )
+                   LINK_LIBRARIES ${Boost_LIBRARIES} AthContainers AthenaBaseComps AthenaKernel GaudiKernel
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CxxUtils )
 
 atlas_add_component( TrigTimeAlgs
                      src/components/*.cxx
-                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers GaudiKernel TestTools TrigTimeAlgsLib )
+                     LINK_LIBRARIES TrigTimeAlgsLib )
 
+# Tests:
 atlas_add_test( TimerSvc_test
                 SOURCES
                 test/TimerSvc_test.cxx
-                INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers GaudiKernel TestTools TrigTimeAlgsLib
+                LINK_LIBRARIES LINK_LIBRARIES TestTools TrigTimeAlgsLib
                 POST_EXEC_SCRIPT nopost.sh
                 ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
-
-# Install files from the package:
-atlas_install_joboptions( share/jobOfragment_TrigTimerSvc.py )
-
diff --git a/Trigger/TrigTools/TrigTimeAlgs/share/jobOfragment_TrigTimerSvc.py b/Trigger/TrigTools/TrigTimeAlgs/share/jobOfragment_TrigTimerSvc.py
deleted file mode 100755
index cedb75f879eb..000000000000
--- a/Trigger/TrigTools/TrigTimeAlgs/share/jobOfragment_TrigTimerSvc.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#**************************************************************
-#
-# jopOptions file for Benchmarking using TrigTimerSvc
-#
-#==============================================================
-theApp.Dlls +=["TrigTimeAlgs" ]
-theApp.ExtSvc += [ "TrigTimerSvc" ]
-# Need Info OutputLevel in order to get end of run statistics
-# (0=NIL 1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
-TrigTimerSvc = Service( "TrigTimerSvc" )
-TrigTimerSvc.OutputLevel  = 3
-#
-# To control which timers will be active/present use this flag
-#
-#TrigTimerSvc.IncludeName = "Sequence.+"
-#
-# To quicly disable one or group
-#
-#TrigTimerSvc.ExcludeName = ".+T2Calo.+"
-
-- 
GitLab


From 8ef6c384897704b035bcb10fed55bb11b5ecabf3 Mon Sep 17 00:00:00 2001
From: Julie Kirk <Julie.Kirk@cern.ch>
Date: Wed, 8 Jul 2020 12:29:31 +0200
Subject: [PATCH 118/217] Changes for TrigInDetValidation ART tests - fix for
 python 3 in TrigInDetValidation_AODtoTrkNtuple.py - add extra post-processing
 in test_trigID_all_ttbar_pu80_grid.py

	modified:   Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
	modified:   Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_grid.py
---
 .../share/TrigInDetValidation_AODtoTrkNtuple.py   |  2 +-
 .../test/test_trigID_all_ttbar_pu80_grid.py       | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index 9b1c11a99605..6296778a638e 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -172,7 +172,7 @@ if ( True ) :
   TestMonTool.releaseMetaData = d['nightly name'] + " " + d['nightly release'] + " " + d['date'] + " " + d['platform'] + " " + d['release']
   TestMonTool.outputFileName="TrkNtuple.root"
   HLTMonManager.AthenaMonTools += [ TestMonTool ]
-  print TestMonTool
+  print (TestMonTool)
 
 
 print ("configured everything")
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_grid.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_grid.py
index d9fca62fc8b2..26428b0dda93 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_grid.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_grid.py
@@ -103,6 +103,7 @@ rdo2aod.max_events = 1000 # TODO: 2000 events
 rdo2aod.threads = 1 # TODO: change to 4
 rdo2aod.concurrent_events = 1 # TODO: change to 4
 rdo2aod.perfmon = False
+rdo2aod.timeout = 18*3600
 rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" '
 if local:
     rdo2aod.input = 'ttbar_pu80'   ## This isn't the same sample as the grid test but for not lets use it.
@@ -130,15 +131,25 @@ if ((not exclude) or postproc ):
 # Now the comparitor steps
 comp=TrigInDetCompStep('CompareStep1')
 comp.chains = 'HLT_mu24_idperf_InDetTrigTrackingxAODCnv_Muon_FTF'
-comp.output_dir = 'HLT-plots-FTF'
+comp.output_dir = 'HLT-plots-muon-FTF'
 test.check_steps.append(comp)
  
  
 comp2=TrigInDetCompStep('CompareStep2')
 comp2.chains='HLT_mu24_idperf_InDetTrigTrackingxAODCnv_Muon_FTF HLT_mu24_idperf_InDetTrigTrackingxAODCnv_Muon_IDTrig'
-comp2.output_dir = 'HLT-plots-IDTrig'
+comp2.output_dir = 'HLT-plots-muon-IDTrig'
 test.check_steps.append(comp2)
 
+comp3=TrigInDetCompStep('CompareStep3')
+comp3.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig'
+comp3.output_dir = 'HLT-plots-bjet-IDTrig'
+test.check_steps.append(comp3)
+
+comp4=TrigInDetCompStep('CompareStep4')
+comp4.chains='HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_FTF HLT_e5_etcut_L1EM3:HLT_IDTrack_Electron_IDTrig'
+comp4.output_dir = 'HLT-plots-el-IDTrig'
+test.check_steps.append(comp4)
+
 
 import sys
 sys.exit(test.run())
-- 
GitLab


From 39a3a865b4e08c3158652fb503a1d86c3459920a Mon Sep 17 00:00:00 2001
From: Benjamin Michael Wynne <b.m.wynne@ed.ac.uk>
Date: Wed, 8 Jul 2020 11:15:15 +0000
Subject: [PATCH 119/217] Fixed optional handles in
 SCT_DCSConditionsStatCondAlg

---
 .../src/SCT_DCSConditionsStatCondAlg.cxx      | 22 ++++++++-----------
 .../Egamma/ElectronSequenceSetup.py           |  7 ------
 .../MinBias/MinBiasChainConfiguration.py      |  6 +----
 .../HLTMenuConfig/Muon/MuonSequenceSetup.py   |  5 -----
 4 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx
index 1b0da809c475..aa6515fac152 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx
@@ -21,20 +21,16 @@ StatusCode SCT_DCSConditionsStatCondAlg::initialize() {
   // CondSvc
   ATH_CHECK(m_condSvc.retrieve());
 
-  if (m_returnHVTemp.value()) {
-    // Read Cond Handle (HV)
-    ATH_CHECK(m_readKeyHV.initialize());
-  }
+  // Read Cond Handle (HV)
+  ATH_CHECK(m_readKeyHV.initialize(m_returnHVTemp.value()));
 
-  if (m_doState) {
-    // Read Cond Handle (state)
-    ATH_CHECK(m_readKeyState.initialize());
-    // Write Cond Handle
-    ATH_CHECK(m_writeKeyState.initialize());
-    if (m_condSvc->regHandle(this, m_writeKeyState).isFailure()) {
-      ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyState.fullKey() << " with CondSvc");
-      return StatusCode::FAILURE;
-    }
+  // Read Cond Handle (state)
+  ATH_CHECK(m_readKeyState.initialize(m_doState));
+  // Write Cond Handle
+  ATH_CHECK(m_writeKeyState.initialize(m_doState));
+  if (m_doState && m_condSvc->regHandle(this, m_writeKeyState).isFailure()) {
+    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyState.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
   }
 
   if (m_useDefaultHV.value()) {
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
index cc4c9ef5619f..89fc2377eeb0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronSequenceSetup.py
@@ -28,13 +28,6 @@ def fastElectronSequence(ConfigFlags):
     viewVerify.DataObjects += [( 'xAOD::TrigEMClusterContainer' , 'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters ),
                                ( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+'+RoIs )]
 
-    from AthenaCommon.AlgSequence import AlgSequence, AthSequencer
-    topSequence = AlgSequence()
-    condSeq = AthSequencer( "AthCondSeq" )
-    if not hasattr( condSeq, 'SCT_DCSConditionsStatCondAlg' ):
-      viewVerify.DataObjects += [( 'SCT_DCSStatCondData' , 'ConditionStore+SCT_DCSStatCondData' )]
-      topSequence.SGInputLoader.Load += [( 'SCT_DCSStatCondData' , 'ConditionStore+SCT_DCSStatCondData' )]
-
     from IOVDbSvc.CondDB import conddb
     if not conddb.folderRequested( "/PIXEL/DCS/FSMSTATUS"):
       viewVerify.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
index 820eba59d6f2..d75ae3ddd79a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/MinBias/MinBiasChainConfiguration.py
@@ -59,7 +59,7 @@ class MinBiasChainConfig(ChainConfigurationBase):
                                  ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]
 
         # Make sure required objects are still available at whole-event level
-        from AthenaCommon.AlgSequence import AlgSequence, AthSequencer
+        from AthenaCommon.AlgSequence import AlgSequence
         topSequence = AlgSequence()
         topSequence.SGInputLoader.Load += [( 'SCT_ID' , 'DetectorStore+SCT_ID' ),
                                            ( 'PixelID' , 'DetectorStore+PixelID' ),
@@ -75,10 +75,6 @@ class MinBiasChainConfig(ChainConfigurationBase):
         if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATUS' ):
           verifier.DataObjects += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
           topSequence.SGInputLoader.Load += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATUS' )]
-        condSeq = AthSequencer( "AthCondSeq" )
-        if not hasattr( condSeq, 'SCT_DCSConditionsStatCondAlg' ):
-          verifier.DataObjects += [( 'SCT_DCSStatCondData' , 'ConditionStore+SCT_DCSStatCondData' )]
-          topSequence.SGInputLoader.Load += [( 'SCT_DCSStatCondData' , 'ConditionStore+SCT_DCSStatCondData' )]
 
         SpList = idAlgs[:-2]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
index eb47934a46e7..c589c013d672 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
@@ -143,11 +143,6 @@ def muCombAlgSequence(ConfigFlags):
     if not conddb.folderRequested( '/PIXEL/DCS/FSMSTATE' ):
       extraLoads += [( 'CondAttrListCollection' , 'ConditionStore+/PIXEL/DCS/FSMSTATE' )]
 
-    from AthenaCommon.AlgSequence import AthSequencer
-    condSeq = AthSequencer( "AthCondSeq" )
-    if not hasattr( condSeq, 'SCT_DCSConditionsStatCondAlg' ):
-      extraLoads += [( 'SCT_DCSStatCondData' , 'ConditionStore+SCT_DCSStatCondData' )]
-
     for decision in muonChainFilter.InputDecisions:
       extraLoads += [( 'xAOD::TrigCompositeContainer' , 'StoreGateSvc+'+decision )]
 
-- 
GitLab


From 052ff130cce2b3ded0433268e69783d4b8b85f15 Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Wed, 8 Jul 2020 11:23:24 +0000
Subject: [PATCH 120/217] add ATLAS_CHECK_THREAD_SAFETY to
 TrkVertexWeightCalculators

---
 .../IVertexWeightCalculator.h                 |  60 +--
 .../TrkVertexWeightCalculators/CMakeLists.txt |   3 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../NNVertexWeightCalculator.h                | 123 ++---
 .../SumPtVertexWeightCalculator.h             | 130 +++--
 .../TrueVertexDistanceWeightCalculator.h      | 138 +++---
 .../VxProbVertexWeightCalculator.h            | 108 ++---
 .../src/NNVertexWeightCalculator.cxx          | 454 +++++++++---------
 .../src/SumPtVertexWeightCalculator.cxx       | 124 +++--
 .../TrueVertexDistanceWeightCalculator.cxx    | 148 +++---
 .../src/VxProbVertexWeightCalculator.cxx      | 156 +++---
 11 files changed, 720 insertions(+), 725 deletions(-)
 create mode 100644 Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexWeightCalculator.h b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexWeightCalculator.h
index 53dca2f118c0..d259a567a485 100755
--- a/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexWeightCalculator.h
+++ b/Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexWeightCalculator.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -11,44 +11,48 @@
 
 #include "GaudiKernel/IAlgTool.h"
 
-//xAOD include
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/VertexAuxContainer.h"
+// xAOD include
 #include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "xAODTracking/VertexFwd.h"
 
-namespace Trk
-{
-  static const InterfaceID IID_IVertexWeightCalculator("IVertexWeightCalculator", 1, 0);
-
-  /**
-   @class IVertexWeightCalculaculator
-   @brief Interface class for signal vertex selection.
-
-   For more detailed information, take a look at the header file of the actual
-   implementation files.
-
-   ---------------------------------------------------
-   Changes:
+namespace Trk {
+static const InterfaceID IID_IVertexWeightCalculator("IVertexWeightCalculator",
+                                                     1,
+                                                     0);
 
-   David Shope <david.richard.shope@cern.ch> (2016-06-01)
+/**
+ @class IVertexWeightCalculaculator
+ @brief Interface class for signal vertex selection.
 
-     EDM Migration to xAOD - remove method using VxCandidate
+ For more detailed information, take a look at the header file of the actual
+ implementation files.
 
-  */
+ ---------------------------------------------------
+ Changes:
 
-  class IVertexWeightCalculator : virtual public IAlgTool {
+ David Shope <david.richard.shope@cern.ch> (2016-06-01)
+   EDM Migration to xAOD - remove method using VxCandidate
 
-     public:
-       /** Virtual destructor */
-       virtual ~IVertexWeightCalculator(){};
+*/
 
-       /** AlgTool interface methods */
-       static const InterfaceID& interfaceID() { return IID_IVertexWeightCalculator; };
+class IVertexWeightCalculator : virtual public IAlgTool
+{
 
-       /** Interface for @c xAOD::Vertex */
-       virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex) = 0;
+public:
+  /** Virtual destructor */
+  virtual ~IVertexWeightCalculator() = default;
 
+  /** AlgTool interface methods */
+  static const InterfaceID& interfaceID()
+  {
+    return IID_IVertexWeightCalculator;
   };
+
+  /** Interface for @c xAOD::Vertex */
+  virtual double estimateSignalCompatibility(
+    const xAOD::Vertex& vertex) const = 0;
+};
 }
 
 #endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/CMakeLists.txt b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/CMakeLists.txt
index 884aa25c0943..5d0cf006c098 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/CMakeLists.txt
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/CMakeLists.txt
@@ -27,7 +27,8 @@ atlas_add_component( TrkVertexWeightCalculators
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives xAODTracking GaudiKernel TrkVertexFitterInterfaces GeneratorObjects TrkParameters VxVertex TrkNeuralNetworkUtilsLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives xAODTracking GaudiKernel TrkVertexFitterInterfaces 
+                     GeneratorObjects TrkParameters VxVertex TrkNeuralNetworkUtilsLib)
 
 # Install files from the package:
 atlas_install_headers( TrkVertexWeightCalculators )
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..702d27a445a9
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkVertexFitter/TrkVertexWeightCalculators
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/NNVertexWeightCalculator.h b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/NNVertexWeightCalculator.h
index 61e68a51981d..405f28870517 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/NNVertexWeightCalculator.h
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/NNVertexWeightCalculator.h
@@ -1,78 +1,81 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrkVertexWeightCalculator_NNVertexWeightCalculator_H
 #define TrkVertexWeightCalculator_NNVertexWeightCalculator_H
- 
+
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
-#include <vector>
 #include <TString.h>
-
-//xAOD include
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/VertexAuxContainer.h"
+#include <vector>
+#include <memory>
+// xAOD include
 #include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "xAODTracking/VertexFwd.h"
 
- /**
-  * @class Trk::NNVertexWeightCalculator 
-  *
-  * @author Johanna Bronner, April 2009
-  *
-  * ---------------------------------------------------
-  * Changes:
-  *
-  * David Shope <david.richard.shope@cern.ch> (2016-06-01)
-  *
-  *   EDM Migration to xAOD - remove method using VxCandidate
-  *
-  */
+#include "TrkNeuralNetworkUtils/NeuralNetworkToHistoTool.h"
+#include "TrkNeuralNetworkUtils/TTrainedNetwork.h"
+/**
+ * @class Trk::NNVertexWeightCalculator
+ *
+ * @author Johanna Bronner, April 2009
+ *
+ * ---------------------------------------------------
+ * Changes:
+ *
+ * David Shope <david.richard.shope@cern.ch> (2016-06-01)
+ *
+ *   EDM Migration to xAOD - remove method using VxCandidate
+ *
+ */
 
-class TTrainedNetwork;
 class TH1;
 class ITHistSvc;
 
- namespace Trk
- {
-   class NeuralNetworkToHistoTool;
-   
-   class NNVertexWeightCalculator : public AthAlgTool, virtual public IVertexWeightCalculator
-   {
-   public:
-     StatusCode initialize();
-     StatusCode finalize();
-     
-     /**
-      * constructor
-      */
-     NNVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p);
-     
-     /**
-      * destructor
-      */
-     virtual ~NNVertexWeightCalculator();
-     
-    /**
-     * WeightCalculator
-     */
-    virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex);
-         
-   private:
+namespace Trk {
+
+class NNVertexWeightCalculator
+  : public AthAlgTool
+  , virtual public IVertexWeightCalculator
+{
+public:
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  /**
+   * constructor
+   */
+  NNVertexWeightCalculator(const std::string& t,
+                           const std::string& n,
+                           const IInterface* p);
+
+  /**
+   * destructor
+   */
+  virtual ~NNVertexWeightCalculator() = default;
+
+  /**
+   * WeightCalculator
+   */
+  virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex) const override final;
+
+private:
+  double mEstimateSignalCompatibility(
+    const std::vector<const Trk::TrackParameters*>& tpList) const;
 
-    double mEstimateSignalCompatibility(const std::vector<const Trk::TrackParameters*>& tpList);
-     
-     ToolHandle<Trk::NeuralNetworkToHistoTool> m_networkToHistoTool;
-     TTrainedNetwork *m_NN;
-     int m_NLayers;
-     ITHistSvc* m_iTHistSvc;
-     std::string m_directoryName;
-     std::vector <TH1*> m_NNhistos;
-     double sphericityFunc(std::vector <std::vector<double> > v_P);
-     double LogFunc(double value); 
+  double sphericityFunc(std::vector<std::vector<double>> v_P) const;
+  double LogFunc(double value) const;
 
-   }; //end of class description
- }//end of namespace definition
+  ToolHandle<Trk::NeuralNetworkToHistoTool> m_networkToHistoTool;
+  std::unique_ptr<TTrainedNetwork> m_NN;
+  int m_NLayers;
+  ITHistSvc* m_iTHistSvc;
+  std::string m_directoryName;
+  std::vector<TH1*> m_NNhistos;
+}; // end of class description
+} // end of namespace definition
 
- #endif
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h
index 11307c520f65..4439cd65c97a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h
@@ -1,72 +1,70 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #ifndef TrkVertexWeightCalculator_SumPtVertexWeightCalculator_H
- #define TrkVertexWeightCalculator_SumPtVertexWeightCalculator_H
- 
- #include "AthenaBaseComps/AthAlgTool.h"
- #include "GaudiKernel/ToolHandle.h"
- #include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
- 
-//xAOD include
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/VertexAuxContainer.h"
+#ifndef TrkVertexWeightCalculator_SumPtVertexWeightCalculator_H
+#define TrkVertexWeightCalculator_SumPtVertexWeightCalculator_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
+
+// xAOD include
 #include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "xAODTracking/VertexFwd.h"
+
+/**
+ * @class Trk::SumPtVertexWeightCalculator
+ *
+ * @author Johanna Bronner, November 2009
+ *
+ * ---------------------------------------------------
+ * Changes:
+ *
+ * David Shope <david.richard.shope@cern.ch> (2016-06-01)
+ *
+ *   EDM Migration to xAOD - remove method using VxCandidate
+ *
+ */
+
+namespace Trk {
+
+class SumPtVertexWeightCalculator
+  : public AthAlgTool
+  , virtual public IVertexWeightCalculator
+{
+public:
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  /**
+   * constructor
+   */
+
+  SumPtVertexWeightCalculator(const std::string& t,
+                              const std::string& n,
+                              const IInterface* p);
+
+  /**
+   * destructor
+   */
+
+  virtual ~SumPtVertexWeightCalculator() = default;
+
+  /**
+   * WeightCalculator
+   */
+
+  virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex) const override final;
+
+private:
+  /**
+   * Flag to Set SumPt^2 not SumPt as selection criteria
+   */
+  bool m_doSumPt2Selection;
 
- /**
-  * @class Trk::SumPtVertexWeightCalculator 
-  *
-  * @author Johanna Bronner, November 2009
-  *
-  * ---------------------------------------------------
-  * Changes:
-  *
-  * David Shope <david.richard.shope@cern.ch> (2016-06-01)
-  *
-  *   EDM Migration to xAOD - remove method using VxCandidate
-  *
-  */
- 
- 
- namespace Trk
- {
-  
-  class SumPtVertexWeightCalculator : public AthAlgTool, virtual public IVertexWeightCalculator
-  {
-   public:
-     StatusCode initialize();
-     StatusCode finalize();
- 
-     /**
-      * constructor
-      */
-     
-     SumPtVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p);
- 
-     /**
-      * destructor
-      */
-     
-     virtual ~SumPtVertexWeightCalculator();
-     
-    /**
-     * WeightCalculator
-     */
-    
-    virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex);
-    
-         
-  private:
-     
-    /**
-     * Flag to Set SumPt^2 not SumPt as selection criteria
-     */
-    bool m_doSumPt2Selection;
-    
+}; // end of class description
+} // end of namespace definition
 
- 
-  }; //end of class description
- }//end of namespace definition
- 
- #endif
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h
index 4d5bd1832332..6284a5d148e5 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h
@@ -1,72 +1,78 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #ifndef TrkVertexWeightCalculator_TrueVertexDistanceWeightCalculator_H
- #define TrkVertexWeightCalculator_TrueVertexDistanceWeightCalculator_H
- 
- #include "AthenaBaseComps/AthAlgTool.h"
- #include "GaudiKernel/ToolHandle.h"
- #include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
- #include "GeoPrimitives/GeoPrimitives.h"
- 
-//xAOD include
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/VertexAuxContainer.h"
-#include "xAODTracking/TrackParticleFwd.h"
+#ifndef TrkVertexWeightCalculator_TrueVertexDistanceWeightCalculator_H
+#define TrkVertexWeightCalculator_TrueVertexDistanceWeightCalculator_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "GeoPrimitives/GeoPrimitives.h"
+#include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
+
+// xAOD include
 #include "GeneratorObjects/McEventCollection.h"
+#include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "xAODTracking/VertexFwd.h"
+
+/**
+ * @class Trk::TrueVertexDistanceWeightCalculator
+ *
+ * @author Giacinto Piacquadio, August 2010
+ *
+ * ---------------------------------------------------
+ * Changes:
+ *
+ * David Shope <david.richard.shope@cern.ch> (2016-06-01)
+ *
+ *   EDM Migration to xAOD - remove method using VxCandidate
+ *
+ */
 
- /**
-  * @class Trk::TrueVertexDistanceWeightCalculator 
-  *
-  * @author Giacinto Piacquadio, August 2010
-  *
-  * ---------------------------------------------------
-  * Changes:
-  *
-  * David Shope <david.richard.shope@cern.ch> (2016-06-01)
-  *
-  *   EDM Migration to xAOD - remove method using VxCandidate
-  *
-  */
- 
 class McEventCollection;
- 
- namespace Trk
- {
-  
-  class TrueVertexDistanceWeightCalculator : public AthAlgTool, virtual public IVertexWeightCalculator
-  {
-   public:
-     StatusCode initialize();
-     StatusCode finalize();
- 
-     /**
-      * constructor
-      */
-     
-     TrueVertexDistanceWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p);
- 
-     /**
-      * destructor
-      */
-     
-     virtual ~TrueVertexDistanceWeightCalculator();
-     
-    /**
-     * WeightCalculator
-     */
-    
-    virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex);
-    
-         
-  private:
-    SG::ReadHandleKey<McEventCollection> m_mcEventCollectionKey { this, "McTruthCollection", "TruthEvent", 
-                                                                  "key to retrieve MC truth" };
-
-    double mEstimateSignalCompatibility(const Amg::Vector3D& vtxPosition);
- 
-  }; //end of class description
- }//end of namespace definition
- 
- #endif
+
+namespace Trk {
+
+class TrueVertexDistanceWeightCalculator
+  : public AthAlgTool
+  , virtual public IVertexWeightCalculator
+{
+public:
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  /**
+   * constructor
+   */
+
+  TrueVertexDistanceWeightCalculator(const std::string& t,
+                                     const std::string& n,
+                                     const IInterface* p);
+
+  /**
+   * destructor
+   */
+
+  virtual ~TrueVertexDistanceWeightCalculator() = default;
+
+  /**
+   * WeightCalculator
+   */
+
+  virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex) const override final;
+
+private:
+  SG::ReadHandleKey<McEventCollection> m_mcEventCollectionKey{
+    this,
+    "McTruthCollection",
+    "TruthEvent",
+    "key to retrieve MC truth"
+  };
+
+  double mEstimateSignalCompatibility(const Amg::Vector3D& vtxPosition) const;
+
+}; // end of class description
+} // end of namespace definition
+
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/VxProbVertexWeightCalculator.h b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/VxProbVertexWeightCalculator.h
index a2e346a6b97c..e28c89548c05 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/VxProbVertexWeightCalculator.h
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/TrkVertexWeightCalculators/VxProbVertexWeightCalculator.h
@@ -1,71 +1,69 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrkVertexWeightCalculator_VxProbVertexWeightCalculator_H
 #define TrkVertexWeightCalculator_VxProbVertexWeightCalculator_H
- 
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "TrkVertexFitterInterfaces/IVertexWeightCalculator.h"
- 
-//xAOD include
-#include "xAODTracking/VertexFwd.h"
-#include "xAODTracking/VertexAuxContainer.h"
+
+// xAOD include
 #include "xAODTracking/TrackParticleFwd.h"
+#include "xAODTracking/VertexAuxContainer.h"
+#include "xAODTracking/VertexFwd.h"
+
+/**
+ * @class Trk::VxProbVertexWeightCalculator
+ *
+ * @author Johanna Bronner, April 2009
+ *
+ * ---------------------------------------------------
+ * Changes:
+ *
+ * David Shope <david.richard.shope@cern.ch> (2016-06-01)
+ *
+ *   EDM Migration to xAOD - remove method using VxCandidate
+ *
+ */
 
- /**
-  * @class Trk::VxProbVertexWeightCalculator 
-  *
-  * @author Johanna Bronner, April 2009
-  *
-  * ---------------------------------------------------
-  * Changes:
-  *
-  * David Shope <david.richard.shope@cern.ch> (2016-06-01)
-  *
-  *   EDM Migration to xAOD - remove method using VxCandidate
-  *
-  */
- 
 class TH1;
 class ITHistSvc;
 
+namespace Trk {
+
+class VxProbVertexWeightCalculator
+  : public AthAlgTool
+  , virtual public IVertexWeightCalculator
+{
+public:
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+  /**
+   * constructor
+   */
+  VxProbVertexWeightCalculator(const std::string& t,
+                               const std::string& n,
+                               const IInterface* p);
+
+  /**
+   * destructor
+   */
+  virtual ~VxProbVertexWeightCalculator() = default;
+
+  /**
+   * WeightCalculator
+   */
+
+  virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex) const override final;
+
+private:
+  TH1* m_hMinBiasPt;
+  std::string m_HistoFileLocation;
+  ITHistSvc* m_iTHistSvc;
 
- namespace Trk
- {
-  
-   class VxProbVertexWeightCalculator : public AthAlgTool, virtual public IVertexWeightCalculator
-   {
-   public:
-     StatusCode initialize();
-     StatusCode finalize();
- 
-     /**
-      * constructor
-      */
-     VxProbVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p);
- 
-     /**
-      * destructor
-      */
-     virtual ~VxProbVertexWeightCalculator();
-     
-    /**
-     * WeightCalculator
-     */
-    
-    virtual double estimateSignalCompatibility(const xAOD::Vertex& vertex);
+}; // end of class description
+} // end of namespace definition
 
-     
-   private:
-     
-     TH1 *m_hMinBiasPt;
-     std::string m_HistoFileLocation;
-     ITHistSvc* m_iTHistSvc;
- 
-   }; //end of class description
- }//end of namespace definition
- 
- #endif
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/NNVertexWeightCalculator.cxx b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/NNVertexWeightCalculator.cxx
index 972b1b05e223..4fafdd5d0a60 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/NNVertexWeightCalculator.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/NNVertexWeightCalculator.cxx
@@ -1,288 +1,272 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrkVertexWeightCalculators/NNVertexWeightCalculator.h"
-#include "VxVertex/VxTrackAtVertex.h"
 #include "TrkParameters/TrackParameters.h"
+#include "VxVertex/VxTrackAtVertex.h"
 
-#include "xAODTracking/Vertex.h"
 #include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/Vertex.h"
 
+#include "FuncMeanRMS.h"
 #include "GaudiKernel/ITHistSvc.h"
-#include "FuncMeanRMS.h" 
+#include "GaudiKernel/SystemOfUnits.h"
 #include <TH1.h>
 #include <TMath.h>
 #include <TMatrixD.h>
 #include <TMatrixDEigen.h>
-#include <TVectorT.h>
-#include <vector>
 #include <TString.h>
+#include <TVectorT.h>
 #include <string>
+#include <vector>
 
 #include "TrkNeuralNetworkUtils/TTrainedNetwork.h"
-#include "TrkNeuralNetworkUtils/NeuralNetworkToHistoTool.h"
- 
-namespace Trk{
-  
-  //usual tool related methods
-  StatusCode NNVertexWeightCalculator::initialize()
-  {
-    StatusCode sc = AthAlgTool::initialize();
-    
-    //initializing the AlgTool itself
-    if(sc.isFailure())
-    {
-      msg(MSG::ERROR)<<" Unable to initialize the AlgTool"<<endmsg;
-      return StatusCode::FAILURE;
-    }
-    (TString)m_directoryName;
-    
-    sc = m_networkToHistoTool.retrieve();
-    if (sc.isFailure())
-    {
-      msg(MSG::FATAL) << " Could not retrieve " << m_networkToHistoTool  << ". Aborting..." << endmsg;
-      return sc;
-    } 
-    else msg(MSG::INFO) << " Retrieved: " << m_networkToHistoTool << ". " << endmsg;
-
-
-    if (!service("THistSvc",m_iTHistSvc , true).isSuccess()) 
-    {
-      msg(MSG::ERROR) << "Unable to locate THistSvc" << endmsg;
-      return StatusCode::FAILURE;
-    }
-    
-    TString LayerInfo = "LayersInfo";
-    sc = m_iTHistSvc->regHist(std::string((const char*)(m_directoryName+LayerInfo)));
-    if (sc.isFailure())
-    {
-      msg(MSG::ERROR) << "Unable to locate THistSvc" << endmsg;
-      return StatusCode::FAILURE;
-    }
-    
-    m_NNhistos.push_back(0);
-    
-    sc = m_iTHistSvc->getHist(std::string((const char*)(m_directoryName+LayerInfo)),m_NNhistos[0]);
-    
-    if (sc.isFailure())
-    {
-      msg(MSG::ERROR) << "Unable to locate THistSvc" << endmsg;
-      return StatusCode::FAILURE;
-    }
 
+namespace Trk {
 
-    for (int i = 0; i < m_NLayers - 1; i++)
-    {
-      TString weightName("Layer");
-      weightName +=i;
-      weightName +="_weights";
-      
-      TString thresholdName("Layer");
-      thresholdName +=i;
-      thresholdName +="_thresholds";
-      
-      sc = m_iTHistSvc->regHist(std::string((const char*)(m_directoryName+weightName)));
-      if (sc.isFailure())
-      {
-        msg(MSG::ERROR) << "Unable to locate THistSvc" << endmsg;
-        return StatusCode::FAILURE;
-      }
-      m_NNhistos.push_back(0);
-      sc = m_iTHistSvc->getHist(std::string((const char*)(m_directoryName+weightName)),m_NNhistos[2*i + 1]);
-      
-      sc = m_iTHistSvc->regHist(std::string((const char*)(m_directoryName+thresholdName)));
-      if (sc.isFailure())
-      {
-        msg(MSG::ERROR)<< "Unable to locate THistSvc" << endmsg;
-        return StatusCode::FAILURE;
-      }
-      m_NNhistos.push_back(0);
-      sc = m_iTHistSvc->getHist(std::string((const char*)(m_directoryName+thresholdName)),m_NNhistos[2*i + 2]);
-    }
-    
-    msg(MSG::INFO)<<"Initialization successfull"<<endmsg;
-    return StatusCode::SUCCESS;
-  }//end of initialize method
- 
- 
-  StatusCode NNVertexWeightCalculator::finalize()
-  {
-    msg(MSG::INFO)<< "Finalize successful" << endmsg;
-    return StatusCode::SUCCESS;
+// usual tool related methods
+StatusCode
+NNVertexWeightCalculator::initialize()
+{
+
+  (TString) m_directoryName;
+  StatusCode sc = m_networkToHistoTool.retrieve();
+  if (sc.isFailure()) {
+    ATH_MSG_FATAL(" Could not retrieve " << m_networkToHistoTool
+                                         << ". Aborting...");
+    return sc;
+  }
+
+  if (!service("THistSvc", m_iTHistSvc, true).isSuccess()) {
+    ATH_MSG_ERROR("Unable to locate THistSvc");
+    return StatusCode::FAILURE;
   }
- 
- //class constructor implementation
-  NNVertexWeightCalculator::NNVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p):
-          AthAlgTool(t,n,p),
-          m_networkToHistoTool("Trk::NeuralNetworkToHistoTool"),
-          m_NN(0),
-          m_NLayers(3),
-          m_iTHistSvc(0),
-          m_directoryName("/NNHisto/")
-  {
-    declareProperty("HistoFilePath",m_directoryName );
-    declareProperty("NeuralNetworkToHistoTool",m_networkToHistoTool);
-  
-    declareInterface<IVertexWeightCalculator>(this);
+
+  TString LayerInfo = "LayersInfo";
+  ATH_CHECK(m_iTHistSvc->regHist(
+    std::string((const char*)(m_directoryName + LayerInfo))));
+  m_NNhistos.push_back(nullptr);
+
+  ATH_CHECK(m_iTHistSvc->getHist(
+    std::string((const char*)(m_directoryName + LayerInfo)), m_NNhistos[0]));
+
+
+  for (int i = 0; i < m_NLayers - 1; i++) {
+    TString weightName("Layer");
+    weightName += i;
+    weightName += "_weights";
+
+    TString thresholdName("Layer");
+    thresholdName += i;
+    thresholdName += "_thresholds";
+
+    ATH_CHECK(m_iTHistSvc->regHist(
+      std::string((const char*)(m_directoryName + weightName))));
+    m_NNhistos.push_back(nullptr);
+    
+    ATH_CHECK(m_iTHistSvc->getHist(
+      std::string((const char*)(m_directoryName + weightName)),
+      m_NNhistos[2 * i + 1]));
+
+    ATH_CHECK(m_iTHistSvc->regHist(
+      std::string((const char*)(m_directoryName + thresholdName))));
+    
+    m_NNhistos.push_back(nullptr);
+    ATH_CHECK(m_iTHistSvc->getHist(
+      std::string((const char*)(m_directoryName + thresholdName)),
+      m_NNhistos[2 * i + 2]));
   }
- 
-  //destructor
-  NNVertexWeightCalculator::~NNVertexWeightCalculator(){}
-  
-double  NNVertexWeightCalculator::estimateSignalCompatibility(const xAOD::Vertex& vertex)
+  m_NN.reset(m_networkToHistoTool->fromHistoToTrainedNetwork(m_NNhistos));
+  return StatusCode::SUCCESS;
+} // end of initialize method
+
+StatusCode
+NNVertexWeightCalculator::finalize()
+{
+  return StatusCode::SUCCESS;
+}
+
+// class constructor implementation
+NNVertexWeightCalculator::NNVertexWeightCalculator(const std::string& t,
+                                                   const std::string& n,
+                                                   const IInterface* p)
+  : AthAlgTool(t, n, p)
+  , m_networkToHistoTool("Trk::NeuralNetworkToHistoTool")
+  , m_NN(nullptr)
+  , m_NLayers(3)
+  , m_iTHistSvc(nullptr)
+  , m_directoryName("/NNHisto/")
+{
+  declareProperty("HistoFilePath", m_directoryName);
+  declareProperty("NeuralNetworkToHistoTool", m_networkToHistoTool);
+  declareInterface<IVertexWeightCalculator>(this);
+}
+
+
+double
+NNVertexWeightCalculator::estimateSignalCompatibility(
+  const xAOD::Vertex& vertex) const
 {
   std::vector<const Trk::TrackParameters*> tpList;
-  
-  for(const auto& elTrackParticle : vertex.trackParticleLinks()) {
-    
+
+  for (const auto& elTrackParticle : vertex.trackParticleLinks()) {
+
     if (not elTrackParticle.isValid()) {
-      ATH_MSG_WARNING("No valid link to tracks in xAOD::Vertex object. Skipping track for signal compatibility (may be serious).");
+      ATH_MSG_WARNING(
+        "No valid link to tracks in xAOD::Vertex object. Skipping track for "
+        "signal compatibility (may be serious).");
       continue;
     }
-    const Trk::Perigee& perigee = (*elTrackParticle.cptr())->perigeeParameters();
+    const Trk::Perigee& perigee =
+      (*elTrackParticle.cptr())->perigeeParameters();
     tpList.push_back(static_cast<const Trk::TrackParameters*>(&perigee));
-  }   
+  }
 
   return mEstimateSignalCompatibility(tpList);
-  
 }
 
-double NNVertexWeightCalculator::mEstimateSignalCompatibility(const std::vector<const Trk::TrackParameters*>& tpList)
+double
+NNVertexWeightCalculator::mEstimateSignalCompatibility(
+  const std::vector<const Trk::TrackParameters*>& tpList) const
 {
-  double    NTrks = (double)tpList.size();
-     
-  double    st1Moment = 0;
-  double    st2Moment = 0;
-  double    st3Moment = 0;
-  double    st4Moment = 0;
-  double    st5Moment = 0;
-  double    st6Moment = 0;
-  double    st7Moment = 0;
-  double    st8Moment = 0;
-  double    st9Moment = 0;
-  double    st10Moment = 0;
-  
-  double    Sphericity = 0;
-  
-  if (tpList.size()>0)
-    {
-      for(const Trk::TrackParameters* perigee : tpList) {
-        double p_T = std::fabs(1./perigee->parameters()[Trk::qOverP])*sin(perigee->parameters()[Trk::theta])/1000.;
-        st1Moment += p_T;
-      }
-      st1Moment = st1Moment/NTrks;
-      std::vector <std::vector<double> > v_allPs;
-             
-      for(const Trk::TrackParameters* perigee : tpList) {
-        double p_T = std::fabs(1./perigee->parameters()[Trk::qOverP])*sin(perigee->parameters()[Trk::theta])/1000.;
-         
-        st2Moment = st2Moment + TMath::Power(p_T - st1Moment,2);
-        st3Moment = st3Moment + TMath::Power(p_T - st1Moment,3);
-        st4Moment = st4Moment + TMath::Power(p_T - st1Moment,4);
-        st5Moment = st5Moment + TMath::Power(p_T - st1Moment,5);
-        st6Moment = st6Moment + TMath::Power(p_T - st1Moment,6);
-        st7Moment = st7Moment + TMath::Power(p_T - st1Moment,7);
-        st8Moment = st8Moment + TMath::Power(p_T - st1Moment,8);
-        st9Moment = st9Moment + TMath::Power(p_T - st1Moment,9);
-        st10Moment = st10Moment + TMath::Power(p_T - st1Moment,10); 
-         
-        double thisPx = perigee->parameters()[Trk::qOverP]*sin(perigee->parameters()[Trk::theta])*cos(perigee->parameters()[Trk::phi])/1000.;
-        double thisPy= perigee->parameters()[Trk::qOverP]*sin(perigee->parameters()[Trk::theta])*sin(perigee->parameters()[Trk::phi])/1000.;
-        double thisPz= perigee->parameters()[Trk::qOverP]*cos(perigee->parameters()[Trk::theta])/1000.;
-         
-        std::vector <double> V_PxPyPz;
-        V_PxPyPz.push_back(thisPx);
-        V_PxPyPz.push_back(thisPy);
-        V_PxPyPz.push_back(thisPz);
-         
-        v_allPs.push_back(V_PxPyPz);
-        
-      }
-      Sphericity = sphericityFunc(v_allPs);
-             
-      st2Moment = st2Moment/NTrks;
-      st3Moment = st3Moment/NTrks;
-      st4Moment = st4Moment/NTrks;
-      st5Moment = st5Moment/NTrks;
-      st6Moment = st6Moment/NTrks;
-      st7Moment = st7Moment/NTrks;
-      st8Moment = st8Moment/NTrks;
-      st9Moment = st9Moment/NTrks;
-      st10Moment =st10Moment/NTrks;
-       
-      std::vector <double> NNinput;
-      NNinput.push_back(Norm_NTrks(((int)NTrks)));
-      NNinput.push_back(Norm_st1Mom(LogFunc(st1Moment)));
-      NNinput.push_back(Norm_st2Mom(LogFunc(st2Moment)));
-      NNinput.push_back(Norm_st3Mom(LogFunc(st3Moment)));
-      NNinput.push_back(Norm_st4Mom(LogFunc(st4Moment)));   
-      NNinput.push_back(Norm_st5Mom(LogFunc(st5Moment)));
-      NNinput.push_back(Norm_st6Mom(LogFunc(st6Moment)));
-      NNinput.push_back(Norm_st7Mom(LogFunc(st7Moment)));
-      NNinput.push_back(Norm_st8Mom(LogFunc(st8Moment)));
-      NNinput.push_back(Norm_st9Mom(LogFunc(st9Moment)));
-      NNinput.push_back(Norm_st10Mom(LogFunc(st10Moment)));
-      NNinput.push_back(Norm_Sphere((Sphericity)));
-      
-      m_NN = m_networkToHistoTool->fromHistoToTrainedNetwork(m_NNhistos);
-       
-      return m_NN->calculateOutputValues(NNinput).at(0);
-    } //at least one track
-  
+  double NTrks = (double)tpList.size();
+
+  double st1Moment = 0;
+  double st2Moment = 0;
+  double st3Moment = 0;
+  double st4Moment = 0;
+  double st5Moment = 0;
+  double st6Moment = 0;
+  double st7Moment = 0;
+  double st8Moment = 0;
+  double st9Moment = 0;
+  double st10Moment = 0;
+
+  double Sphericity = 0;
+
+  if (!tpList.empty()) {
+    for (const Trk::TrackParameters* perigee : tpList) {
+      double p_T = std::fabs(1. / perigee->parameters()[Trk::qOverP]) *
+                   sin(perigee->parameters()[Trk::theta]) / Gaudi::Units::GeV;
+      st1Moment += p_T;
+    }
+    st1Moment = st1Moment / NTrks;
+    std::vector<std::vector<double>> v_allPs;
+
+    for (const Trk::TrackParameters* perigee : tpList) {
+      double p_T = std::fabs(1. / perigee->parameters()[Trk::qOverP]) *
+                   sin(perigee->parameters()[Trk::theta]) / Gaudi::Units::GeV;
+
+      st2Moment = st2Moment + TMath::Power(p_T - st1Moment, 2);
+      st3Moment = st3Moment + TMath::Power(p_T - st1Moment, 3);
+      st4Moment = st4Moment + TMath::Power(p_T - st1Moment, 4);
+      st5Moment = st5Moment + TMath::Power(p_T - st1Moment, 5);
+      st6Moment = st6Moment + TMath::Power(p_T - st1Moment, 6);
+      st7Moment = st7Moment + TMath::Power(p_T - st1Moment, 7);
+      st8Moment = st8Moment + TMath::Power(p_T - st1Moment, 8);
+      st9Moment = st9Moment + TMath::Power(p_T - st1Moment, 9);
+      st10Moment = st10Moment + TMath::Power(p_T - st1Moment, 10);
+
+      double thisPx = perigee->parameters()[Trk::qOverP] *
+                      sin(perigee->parameters()[Trk::theta]) *
+                      cos(perigee->parameters()[Trk::phi]) / Gaudi::Units::GeV;
+      double thisPy = perigee->parameters()[Trk::qOverP] *
+                      sin(perigee->parameters()[Trk::theta]) *
+                      sin(perigee->parameters()[Trk::phi]) / Gaudi::Units::GeV;
+      double thisPz = perigee->parameters()[Trk::qOverP] *
+                      cos(perigee->parameters()[Trk::theta]) / Gaudi::Units::GeV;
+
+      std::vector<double> V_PxPyPz;
+      V_PxPyPz.push_back(thisPx);
+      V_PxPyPz.push_back(thisPy);
+      V_PxPyPz.push_back(thisPz);
+
+      v_allPs.push_back(V_PxPyPz);
+    }
+    Sphericity = sphericityFunc(v_allPs);
+
+    st2Moment = st2Moment / NTrks;
+    st3Moment = st3Moment / NTrks;
+    st4Moment = st4Moment / NTrks;
+    st5Moment = st5Moment / NTrks;
+    st6Moment = st6Moment / NTrks;
+    st7Moment = st7Moment / NTrks;
+    st8Moment = st8Moment / NTrks;
+    st9Moment = st9Moment / NTrks;
+    st10Moment = st10Moment / NTrks;
+
+    std::vector<double> NNinput;
+    NNinput.push_back(Norm_NTrks(((int)NTrks)));
+    NNinput.push_back(Norm_st1Mom(LogFunc(st1Moment)));
+    NNinput.push_back(Norm_st2Mom(LogFunc(st2Moment)));
+    NNinput.push_back(Norm_st3Mom(LogFunc(st3Moment)));
+    NNinput.push_back(Norm_st4Mom(LogFunc(st4Moment)));
+    NNinput.push_back(Norm_st5Mom(LogFunc(st5Moment)));
+    NNinput.push_back(Norm_st6Mom(LogFunc(st6Moment)));
+    NNinput.push_back(Norm_st7Mom(LogFunc(st7Moment)));
+    NNinput.push_back(Norm_st8Mom(LogFunc(st8Moment)));
+    NNinput.push_back(Norm_st9Mom(LogFunc(st9Moment)));
+    NNinput.push_back(Norm_st10Mom(LogFunc(st10Moment)));
+    NNinput.push_back(Norm_Sphere((Sphericity)));
+
+    return m_NN->calculateOutputValues(NNinput).at(0);
+  } // at least one track
+
   return 0;
 }
 
-double NNVertexWeightCalculator::sphericityFunc(std::vector <std::vector<double> > v_allPs)
+double
+NNVertexWeightCalculator::sphericityFunc(
+  std::vector<std::vector<double>> v_allPs) const
 {
-  TMatrixD a_P(2,2);
-  
-  for (int a=0; a<2; a++)
-  {
-    for (int b=0; b<2; b++)
-    {
+  TMatrixD a_P(2, 2);
+
+  for (int a = 0; a < 2; a++) {
+    for (int b = 0; b < 2; b++) {
       double SumAbsP = 0;
       double SumPaPb = 0;
-      
-      for (unsigned int i=0; i < v_allPs.size(); i++)
-      {
-        double AbsP = TMath::Abs(v_allPs.at(i).at(0)*v_allPs.at(i).at(0) + v_allPs.at(i).at(1)*v_allPs.at(i).at(1));
+
+      for (unsigned int i = 0; i < v_allPs.size(); i++) {
+        double AbsP = TMath::Abs(v_allPs.at(i).at(0) * v_allPs.at(i).at(0) +
+                                 v_allPs.at(i).at(1) * v_allPs.at(i).at(1));
         SumAbsP = SumAbsP + AbsP;
-        double PaPb  = v_allPs.at(i).at(a)*v_allPs.at(i).at(b);
+        double PaPb = v_allPs.at(i).at(a) * v_allPs.at(i).at(b);
         SumPaPb = SumPaPb + PaPb;
       }
-      a_P[a][b]=SumPaPb/SumAbsP;
-    }      
+      a_P[a][b] = SumPaPb / SumAbsP;
+    }
   }
 
   TVectorT<double> EigVal;
-  
+
   a_P.EigenVectors(EigVal);
-  double smallL =0;
-  
-  if ( EigVal[0]< EigVal[1])
-      smallL = EigVal[0];
+  double smallL = 0;
+
+  if (EigVal[0] < EigVal[1])
+    smallL = EigVal[0];
   else
-      smallL = EigVal[1];
-  
-  return smallL*2;
+    smallL = EigVal[1];
+
+  return smallL * 2;
 }
 
-double NNVertexWeightCalculator::LogFunc(double value)
+double
+NNVertexWeightCalculator::LogFunc(double value) const
 {
   double x0 = 0.05e-3;
-  double a = 20000.;//f1_strich->Eval(x0);
-  double y =  -9.90349;// f1->Eval(x0);
-  double y0 = y - a*x0;
-  
+  double a = 20000.;   // f1_strich->Eval(x0);
+  double y = -9.90349; // f1->Eval(x0);
+  double y0 = y - a * x0;
+
   if (value <= -x0)
-      return -TMath::Log(-value) + 2*y0;
-  else if ((value > -x0)  && (value < x0))
-      return y0 + a*value;
-  else if (value >= x0)
-      return TMath::Log(value);
-  
+    return -TMath::Log(-value) + 2 * y0;
+  if ((value > -x0) && (value < x0))
+    return y0 + a * value;
+  if (value >= x0)
+    return TMath::Log(value);
+
   return 0;
- }
+}
 
-} //end namespace Trk
+} // end namespace Trk
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/SumPtVertexWeightCalculator.cxx b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/SumPtVertexWeightCalculator.cxx
index 68cc4beeff32..c746640a46a2 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/SumPtVertexWeightCalculator.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/SumPtVertexWeightCalculator.cxx
@@ -1,74 +1,68 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #include "TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h"
- #include "VxVertex/VxTrackAtVertex.h"
- #include "TrkParameters/TrackParameters.h"
+#include "TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h"
+#include "TrkParameters/TrackParameters.h"
+#include "VxVertex/VxTrackAtVertex.h"
 
- #include "xAODTracking/Vertex.h"
- #include "xAODTracking/TrackParticle.h"
- 
-namespace Trk{
- 
-  StatusCode SumPtVertexWeightCalculator::initialize()
-  {
-    StatusCode sc = AthAlgTool::initialize();
-    
-    //initializing the AlgTool itself
-    if(sc.isFailure())
-    {
-      msg(MSG::ERROR)<<" Unable to initialize the AlgTool"<<endmsg;
-      return StatusCode::FAILURE;
-    }
-    
-    msg(MSG::INFO)<<"Initialization successfull"<<endmsg;
-    return StatusCode::SUCCESS;
-  }//end of initialize method
-  
-  StatusCode SumPtVertexWeightCalculator::finalize()
-  {
-    MsgStream log(msgSvc(), name());
-    msg(MSG::INFO)  << "Finalize successful" << endmsg;
-    return StatusCode::SUCCESS;
-  }
- 
-  //class constructor implementation
-  SumPtVertexWeightCalculator::SumPtVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p):
-          AthAlgTool(t,n,p),
-          m_doSumPt2Selection(true)
-  {
-    declareProperty("DoSumPt2Selection",m_doSumPt2Selection);
-    declareInterface<IVertexWeightCalculator>(this);
-  }
- 
-  //destructor
-  SumPtVertexWeightCalculator::~SumPtVertexWeightCalculator(){}
-   
-  double  SumPtVertexWeightCalculator::estimateSignalCompatibility(const xAOD::Vertex& vertex)
-  { 
-    double total_pt=0;
-    ATH_MSG_DEBUG("Estimating vertex sorting score from " << vertex.nTrackParticles() << " tracks at vertex.");
-    for(const auto& elTrackParticle : vertex.trackParticleLinks()) {
+#include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/Vertex.h"
+
+namespace Trk {
+
+StatusCode
+SumPtVertexWeightCalculator::initialize()
+{
+  return StatusCode::SUCCESS;
+} // end of initialize method
 
-      if (not elTrackParticle.isValid()) {
-	ATH_MSG_WARNING("No valid link to tracks in xAOD::Vertex object. Skipping track for signal compatibility (may be serious).");
-	continue;
-      }
+StatusCode
+SumPtVertexWeightCalculator::finalize()
+{
+  return StatusCode::SUCCESS;
+}
 
-      const Trk::Perigee& perigee = (*elTrackParticle.cptr())->perigeeParameters();
-      if (m_doSumPt2Selection)
-      {
-        total_pt+=std::pow(1./perigee.parameters()[Trk::qOverP]*sin(perigee.parameters()[Trk::theta])/1000.,2);
-      }
-      else
-      {
-        total_pt+= std::fabs(1./perigee.parameters()[Trk::qOverP])*sin(perigee.parameters()[Trk::theta])/1000.;
-      }
+// class constructor implementation
+SumPtVertexWeightCalculator::SumPtVertexWeightCalculator(const std::string& t,
+                                                         const std::string& n,
+                                                         const IInterface* p)
+  : AthAlgTool(t, n, p)
+  , m_doSumPt2Selection(true)
+{
+  declareProperty("DoSumPt2Selection", m_doSumPt2Selection);
+  declareInterface<IVertexWeightCalculator>(this);
+}
+
+double
+SumPtVertexWeightCalculator::estimateSignalCompatibility(
+  const xAOD::Vertex& vertex) const
+{
+  double total_pt = 0;
+  ATH_MSG_DEBUG("Estimating vertex sorting score from "
+                << vertex.nTrackParticles() << " tracks at vertex.");
+  for (const auto& elTrackParticle : vertex.trackParticleLinks()) {
+
+    if (not elTrackParticle.isValid()) {
+      ATH_MSG_WARNING(
+        "No valid link to tracks in xAOD::Vertex object. Skipping track for "
+        "signal compatibility (may be serious).");
+      continue;
+    }
+
+    const Trk::Perigee& perigee =
+      (*elTrackParticle.cptr())->perigeeParameters();
+    if (m_doSumPt2Selection) {
+      total_pt += std::pow(1. / perigee.parameters()[Trk::qOverP] *
+                             sin(perigee.parameters()[Trk::theta]) / 1000.,
+                           2);
+    } else {
+      total_pt += std::fabs(1. / perigee.parameters()[Trk::qOverP]) *
+                  sin(perigee.parameters()[Trk::theta]) / 1000.;
     }
-    return  total_pt;     
   }
-  
-   
- }///End!!!
+  return total_pt;
+}
+
+} /// End!!!
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/TrueVertexDistanceWeightCalculator.cxx b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/TrueVertexDistanceWeightCalculator.cxx
index 4b47d9b84a35..82f33e61661c 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/TrueVertexDistanceWeightCalculator.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/TrueVertexDistanceWeightCalculator.cxx
@@ -1,89 +1,83 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
- #include "TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h"
- #include "VxVertex/VxTrackAtVertex.h"
+#include "TrkVertexWeightCalculators/TrueVertexDistanceWeightCalculator.h"
+#include "VxVertex/VxTrackAtVertex.h"
 
-#include "xAODTracking/Vertex.h"
 #include "xAODTracking/TrackParticle.h"
+#include "xAODTracking/Vertex.h"
 
-namespace Trk{
- 
-  StatusCode TrueVertexDistanceWeightCalculator::initialize()
-  {
-    ATH_CHECK( m_mcEventCollectionKey.initialize() );
-    //initializing the AlgTool itself
-    ATH_CHECK( AthAlgTool::initialize() );
-    msg(MSG::INFO)<<"Initialization successfull"<<endmsg;
-
-    return StatusCode::SUCCESS;
-  }//end of initialize method
-  
-  StatusCode TrueVertexDistanceWeightCalculator::finalize()
-  {
-    MsgStream log(msgSvc(), name());
-    msg(MSG::INFO)  << "Finalize successful" << endmsg;
-    return StatusCode::SUCCESS;
-  }
- 
-  //class constructor implementation
-  TrueVertexDistanceWeightCalculator::TrueVertexDistanceWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p):
-          AthAlgTool(t,n,p)
-  {
-    declareInterface<IVertexWeightCalculator>(this);
+namespace Trk {
+
+StatusCode
+TrueVertexDistanceWeightCalculator::initialize()
+{
+  ATH_CHECK(m_mcEventCollectionKey.initialize());
+  return StatusCode::SUCCESS;
+} 
+
+StatusCode
+TrueVertexDistanceWeightCalculator::finalize()
+{
+  return StatusCode::SUCCESS;
+}
+
+// class constructor implementation
+TrueVertexDistanceWeightCalculator::TrueVertexDistanceWeightCalculator(
+  const std::string& t,
+  const std::string& n,
+  const IInterface* p)
+  : AthAlgTool(t, n, p)
+{
+  declareInterface<IVertexWeightCalculator>(this);
+}
+
+double
+TrueVertexDistanceWeightCalculator::estimateSignalCompatibility(
+  const xAOD::Vertex& vertex) const
+{
+  return mEstimateSignalCompatibility(vertex.position());
+}
+
+double
+TrueVertexDistanceWeightCalculator::mEstimateSignalCompatibility(
+  const Amg::Vector3D& vtxPosition) const
+{
+  SG::ReadHandle<McEventCollection> mcColl(m_mcEventCollectionKey);
+
+  if (!mcColl.isValid()) {
+    ATH_MSG_WARNING("Could not retrieve McEventCollection "
+                    << m_mcEventCollectionKey.key()
+                    << " from StoreGate. Returning 0 distance.");
+    return 0;
   }
- 
-  //destructor
-  TrueVertexDistanceWeightCalculator::~TrueVertexDistanceWeightCalculator(){}
-   
-  double  TrueVertexDistanceWeightCalculator::estimateSignalCompatibility(const xAOD::Vertex& vertex)
-  { 
-    return mEstimateSignalCompatibility(vertex.position());
+
+  McEventCollection::const_iterator itr = mcColl->begin();
+  const HepMC::GenEvent* myEvent = (*itr);
+  if (!myEvent) {
+    ATH_MSG_ERROR(" Cannot find truth event...  Returning 0 distance... ");
+    return 0;
   }
 
-  double TrueVertexDistanceWeightCalculator::mEstimateSignalCompatibility(const Amg::Vector3D& vtxPosition)
-  {
-    SG::ReadHandle<McEventCollection> mcColl( m_mcEventCollectionKey );
-
-    if ( !mcColl.isValid() )
-    {
-      ATH_MSG_WARNING("Could not retrieve McEventCollection " << m_mcEventCollectionKey.key() 
-		      << " from StoreGate. Returning 0 distance.");
-      return 0;
-    } 
-
-    McEventCollection::const_iterator itr = mcColl->begin();
-    const HepMC::GenEvent* myEvent=(*itr);
-    if (!myEvent)
-    {
-      msg(MSG::ERROR) << " Cannot find truth event...  Returning 0 distance... " << endmsg;
-      return 0;
-    }
-    
-    HepMC::GenEvent::vertex_const_iterator Vert = myEvent->vertices_begin();
-    ATH_MSG_DEBUG("Resulting MC seed:  x: " << (*Vert)->position().x()  << 
-		  " y: " << (*Vert)->position().y() << 
-		  " z: " << (*Vert)->position().z());
-    double ztrue=(*Vert)->position().z();
-  
-    double z_vtx_pos=vtxPosition.z();
-
-    double distance = fabs(z_vtx_pos - ztrue);
-    
-    ATH_MSG_DEBUG("Distance of pV from truth:" << distance);
-
-    if (distance==0.)
-    {
-      ATH_MSG_WARNING(" Suspicious 0 distance.");
-      return 1./0.000001;
-    }
-    
-    ATH_MSG_DEBUG(" Returning distance: " << 1./distance);
-
-    return 1./distance;
+  HepMC::GenEvent::vertex_const_iterator Vert = myEvent->vertices_begin();
+  ATH_MSG_DEBUG("Resulting MC seed:  x: " << (*Vert)->position().x()
+                                          << " y: " << (*Vert)->position().y()
+                                          << " z: " << (*Vert)->position().z());
+  double ztrue = (*Vert)->position().z();
+
+  double z_vtx_pos = vtxPosition.z();
+
+  double distance = fabs(z_vtx_pos - ztrue);
+
+  ATH_MSG_DEBUG("Distance of pV from truth:" << distance);
 
+  if (distance == 0.) {
+    ATH_MSG_WARNING(" Suspicious 0 distance.");
+    return 1. / 0.000001;
   }
-   
-}///End!!!
+  ATH_MSG_DEBUG(" Returning distance: " << 1. / distance);
+  return 1. / distance;
+}
+} 
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/VxProbVertexWeightCalculator.cxx b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/VxProbVertexWeightCalculator.cxx
index d4d7456ad3b5..769620c2a13a 100644
--- a/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/VxProbVertexWeightCalculator.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexWeightCalculators/src/VxProbVertexWeightCalculator.cxx
@@ -1,85 +1,97 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrkVertexWeightCalculators/VxProbVertexWeightCalculator.h"
-#include "VxVertex/VxTrackAtVertex.h"
-#include "TrkParameters/TrackParameters.h"
 #include "GaudiKernel/ITHistSvc.h"
+#include "TrkParameters/TrackParameters.h"
+#include "VxVertex/VxTrackAtVertex.h"
 #include <TH1.h>
 #include <TMath.h>
 
-#include "xAODTracking/Vertex.h"
 #include "xAODTracking/TrackParticle.h"
- 
- namespace Trk{
- 
-   StatusCode VxProbVertexWeightCalculator::initialize()
-   {
-     ATH_CHECK( AthAlgTool::initialize());
-     ATH_CHECK(service("THistSvc",m_iTHistSvc , true));
-     ATH_CHECK( m_iTHistSvc->regHist(m_HistoFileLocation)); 
-     ATH_CHECK( m_iTHistSvc->getHist(m_HistoFileLocation,m_hMinBiasPt ));
-     ATH_MSG_DEBUG("Initialization successful");
-     return StatusCode::SUCCESS;
-  }//end of initialize method
- 
- 
-  StatusCode VxProbVertexWeightCalculator::finalize()
-  {
-    ATH_MSG_VERBOSE( "Finalize successful");
-    return StatusCode::SUCCESS;
-  }
- 
-   //class constructor implementation
-   VxProbVertexWeightCalculator::VxProbVertexWeightCalculator(const std::string& t, const std::string& n, const IInterface*  p):
-           AthAlgTool(t,n,p),
-           m_hMinBiasPt(0),
-           m_HistoFileLocation("/VxProbHisto/h_sTrkPdfminBias"),
-           m_iTHistSvc()
-   {
-     declareProperty("HistogramPath",m_HistoFileLocation );
-     declareInterface<IVertexWeightCalculator>(this);
-   }
-   
-   //destructor
-   VxProbVertexWeightCalculator::~VxProbVertexWeightCalculator(){}
-   
-   double  VxProbVertexWeightCalculator::estimateSignalCompatibility(const xAOD::Vertex& vertex) 
-   {
-     double P0 = 1.;
-     //bool pTtooBig = false;
-     for(const auto& elTrackParticle : vertex.trackParticleLinks()) {
-      if (not elTrackParticle.isValid()) {
-	      ATH_MSG_WARNING("No valid link to tracks in xAOD::Vertex object. Skipping track for signal compatibility (may be serious).");
-	      continue;
-      }
-      const Trk::Perigee& perigee = (*elTrackParticle.cptr())->perigeeParameters();
-      double p_T = std::fabs(1./perigee.parameters()[Trk::qOverP])*sin(perigee.parameters()[Trk::theta])/1000.;
-      TH1F* myHisto = dynamic_cast<TH1F*>(m_hMinBiasPt);
-      if (myHisto == 0)	{
-	      ATH_MSG_WARNING("VxProbHisto is an empty pointer. Signal compatibility failed and returning 0.0");
-        return 0;         
-      }
-      double IntPt = (myHisto->Integral(myHisto->FindBin(p_T),myHisto->GetNbinsX() + 1)
-		      + myHisto->Integral(myHisto->FindBin(p_T)+1,myHisto->GetNbinsX() + 1))/2.;
-      // --- Markus Elsing: fake high pt tracks, limit the integral
-      if (IntPt < 0.0001) IntPt = 0.0001;
-      P0 = P0 *IntPt;
+#include "xAODTracking/Vertex.h"
+
+namespace Trk {
+
+StatusCode
+VxProbVertexWeightCalculator::initialize()
+{
+  ATH_CHECK(service("THistSvc", m_iTHistSvc, true));
+  ATH_CHECK(m_iTHistSvc->regHist(m_HistoFileLocation));
+  ATH_CHECK(m_iTHistSvc->getHist(m_HistoFileLocation, m_hMinBiasPt));
+  ATH_MSG_DEBUG("Initialization successful");
+  return StatusCode::SUCCESS;
+} // end of initialize method
+
+StatusCode
+VxProbVertexWeightCalculator::finalize()
+{
+  ATH_MSG_VERBOSE("Finalize successful");
+  return StatusCode::SUCCESS;
+}
+
+// class constructor implementation
+VxProbVertexWeightCalculator::VxProbVertexWeightCalculator(const std::string& t,
+                                                           const std::string& n,
+                                                           const IInterface* p)
+  : AthAlgTool(t, n, p)
+  , m_hMinBiasPt(nullptr)
+  , m_HistoFileLocation("/VxProbHisto/h_sTrkPdfminBias")
+  , m_iTHistSvc()
+{
+  declareProperty("HistogramPath", m_HistoFileLocation);
+  declareInterface<IVertexWeightCalculator>(this);
+}
+
+
+double
+VxProbVertexWeightCalculator::estimateSignalCompatibility(
+  const xAOD::Vertex& vertex) const
+{
+  double P0 = 1.;
+  // bool pTtooBig = false;
+  for (const auto& elTrackParticle : vertex.trackParticleLinks()) {
+    if (not elTrackParticle.isValid()) {
+      ATH_MSG_WARNING(
+        "No valid link to tracks in xAOD::Vertex object. Skipping track for "
+        "signal compatibility (may be serious).");
+      continue;
+    }
+    const Trk::Perigee& perigee =
+      (*elTrackParticle.cptr())->perigeeParameters();
+    double p_T = std::fabs(1. / perigee.parameters()[Trk::qOverP]) *
+                 sin(perigee.parameters()[Trk::theta]) / 1000.;
+    TH1F* myHisto = dynamic_cast<TH1F*>(m_hMinBiasPt);
+    if (myHisto == nullptr) {
+      ATH_MSG_WARNING("VxProbHisto is an empty pointer. Signal compatibility "
+                      "failed and returning 0.0");
+      return 0;
     }
-    double VxProb = 0.;
-    const int sizeOfTPColl = vertex.trackParticleLinks().size();
-    if (sizeOfTPColl > 0) {        
-	    for (int j = 0; j < sizeOfTPColl; ++j) {
-	      /** @todo Given that you are looping from zero, the 'Power' and 'Factorial'
-          * could be speeded up by using a simple multiplication on each loop (sroe)
-          **/
-	      VxProb = VxProb + (TMath::Power(-TMath::Log(P0),j)/TMath::Factorial(j));
-	    }
-	    VxProb = -TMath::Log(VxProb*P0);        
+    double IntPt =
+      (myHisto->Integral(myHisto->FindBin(p_T), myHisto->GetNbinsX() + 1) +
+       myHisto->Integral(myHisto->FindBin(p_T) + 1, myHisto->GetNbinsX() + 1)) /
+      2.;
+    // --- Markus Elsing: fake high pt tracks, limit the integral
+    if (IntPt < 0.0001)
+      IntPt = 0.0001;
+    P0 = P0 * IntPt;
+  }
+  double VxProb = 0.;
+  const int sizeOfTPColl = vertex.trackParticleLinks().size();
+  if (sizeOfTPColl > 0) {
+    for (int j = 0; j < sizeOfTPColl; ++j) {
+      /** @todo Given that you are looping from zero, the 'Power' and
+       *'Factorial' could be speeded up by using a simple multiplication on each
+       *loop (sroe)
+       **/
+      VxProb =
+        VxProb + (TMath::Power(-TMath::Log(P0), j) / TMath::Factorial(j));
     }
-    return  VxProb;
-   }
+    VxProb = -TMath::Log(VxProb * P0);
+  }
+  return VxProb;
+}
 
- }//Namespace
+} // Namespace
 
-- 
GitLab


From 7588e159360c4ede3d35c02437953922bdb78e98 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 14:37:52 +0200
Subject: [PATCH 121/217] TrigEgammaHypo: Package cleanup

- tidy CMake configuration
- move flake8 checking to build stage
- remove unused CLHEP dependency
---
 .../TrigEgammaHypo/CMakeLists.txt             |  73 +-----
 .../TrigEgammaHypo/doc/Doxyfile               | 231 ------------------
 .../python/TrigEFElectronHypoMonitoring.py    |  19 +-
 .../python/TrigEFPhotonHypoMonitoring.py      |  30 +--
 .../python/TrigL2CaloHypoConfig.py            |   4 +-
 .../python/TrigL2PhotonHypoMonitoring.py      |  28 +--
 .../src/TrigEFDielectronMassFex.cxx           |   3 +-
 7 files changed, 41 insertions(+), 347 deletions(-)
 delete mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt
index 578cef4aa119..32ff89c5af04 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt
@@ -5,79 +5,28 @@
 # Declare the package name:
 atlas_subdir( TrigEgammaHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Calorimeter/CaloUtils
-                          Control/AthLinks
-                          Control/StoreGate
-                          Control/AthenaMonitoringKernel
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODEgamma
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTrigCalo
-                          Event/xAOD/xAODTrigEgamma
-                          Event/xAOD/xAODTrigger
-                          Event/xAOD/xAODTrigRinger
-                          GaudiKernel
-                          LumiBlock/LumiBlockComps
-                          Tools/PathResolver
-                          PhysicsAnalysis/AnalysisCommon/PATCore
-                          PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces
-                          Reconstruction/egamma/egammaInterfaces
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/VxVertex
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigT1/TrigT1Interfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Trigger/TrigHypothesis/TrigMultiVarHypo
-                          PRIVATE
-                          Calorimeter/CaloEvent
-                          Control/CxxUtils
-                          Event/xAOD/xAODEgammaCnv
-                          Reconstruction/RecoTools/ITrackToVertex
-                          Reconstruction/RecoTools/RecoToolInterfaces
-                          Reconstruction/egamma/egammaEvent
-                          Reconstruction/egamma/egammaMVACalib
-                          Tracking/TrkEvent/TrkCaloExtension
-                          Trigger/TrigAlgorithms/TrigCaloRec
-                          Trigger/TrigEvent/TrigMissingEtEvent
-                          Trigger/TrigEvent/TrigNavigation 
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils
-                          Control/AthViews
-                          Control/AthContainers )
-
 # External dependencies:
-find_package( CLHEP )
 find_package( ROOT COMPONENTS Core MathCore Hist )
 
 # Component(s) in the package:
 atlas_add_component( TrigEgammaHypo
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloUtilsLib AthLinks AthenaBaseComps StoreGateLib SGtests AthenaMonitoringKernelLib TrigMultiVarHypoLib xAODTrigRinger xAODCaloEvent xAODEgamma xAODTracking xAODTrigCalo xAODTrigEgamma GaudiKernel LumiBlockCompsLib PathResolver PATCoreLib EgammaAnalysisInterfacesLib TrkSurfaces VxVertex TrigCaloEvent TrigInDetEvent TrigParticle TrigSteeringEvent TrigInterfacesLib TrigT1Interfaces TrigTimeAlgsLib CaloEvent CxxUtils ITrackToVertex RecoToolInterfaces egammaEvent egammaMVACalibLib TrkCaloExtension TrigCaloRecLib TrigMissingEtEvent TrigNavigationLib DecisionHandlingLib AthViews TrigCompositeUtilsLib )
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks AthViews AthenaBaseComps AthenaMonitoringKernelLib CaloDetDescrLib CaloEvent CaloUtilsLib DecisionHandlingLib EgammaAnalysisInterfacesLib GaudiKernel LumiBlockCompsLib LumiBlockData PATCoreLib RecoToolInterfaces StoreGateLib TrigCaloRecLib TrigCompositeUtilsLib TrigInterfacesLib TrigMissingEtEvent TrigMultiVarHypoLib TrigNavigationLib TrigSteeringEvent TrigT1Interfaces TrigTimeAlgsLib TrkCaloExtension TrkSurfaces VxVertex egammaEvent egammaInterfacesLib xAODBase xAODCaloEvent xAODEgamma xAODEgammaCnvLib xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigRinger xAODTrigger TrigParticle )
 
 # Install files from the package:
-atlas_install_headers( TrigEgammaHypo )
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
 
 # Unit tests:
-atlas_add_test( TrigL2CaloHypoToolConfig SCRIPT python -m TrigEgammaHypo.TrigL2CaloHypoTool
-		POST_EXEC_SCRIPT nopost.sh )
-
-atlas_add_test( TrigL2ElectronHypoToolConfig SCRIPT python -m TrigEgammaHypo.TrigL2ElectronHypoTool
-		POST_EXEC_SCRIPT nopost.sh )
+atlas_add_test( TrigL2CaloHypoToolConfig
+   SCRIPT python -m TrigEgammaHypo.TrigL2CaloHypoTool
+   POST_EXEC_SCRIPT nopost.sh )
 
-atlas_add_test( TrigL2PhotonHypoToolConfig SCRIPT python -m TrigEgammaHypo.TrigL2PhotonHypoTool
-		POST_EXEC_SCRIPT nopost.sh )
+atlas_add_test( TrigL2ElectronHypoToolConfig
+   SCRIPT python -m TrigEgammaHypo.TrigL2ElectronHypoTool
+   POST_EXEC_SCRIPT nopost.sh )
 
-# Check Python syntax:
-atlas_add_test( flake8
-   SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python
+atlas_add_test( TrigL2PhotonHypoToolConfig
+   SCRIPT python -m TrigEgammaHypo.TrigL2PhotonHypoTool
    POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile
deleted file mode 100755
index 56007db0a585..000000000000
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile
+++ /dev/null
@@ -1,231 +0,0 @@
-# Doxyfile 1.5.3
-
-#---------------------------------------------------------------------------
-#Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING      = UTF-8
-PROJECT_NAME           = TrigEgammaHypo
-PROJECT_NUMBER         = TrigEgammaHypo-00-07-66
-OUTPUT_DIRECTORY = /afs/cern.ch/user/a/ahamil/trigger/test/InstallArea/doc/TrigEgammaHypo
-CREATE_SUBDIRS         = NO
-OUTPUT_LANGUAGE        = English
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = YES
-ABBREVIATE_BRIEF       = 
-ALWAYS_DETAILED_SEC    = NO
-INLINE_INHERITED_MEMB  = YES
-FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = 
-STRIP_FROM_INC_PATH    = 
-SHORT_NAMES            = NO
-JAVADOC_AUTOBRIEF      = YES
-QT_AUTOBRIEF           = YES
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP         = NO
-INHERIT_DOCS           = YES
-SEPARATE_MEMBER_PAGES  = NO
-TAB_SIZE               = 8
-ALIASES                = 
-OPTIMIZE_OUTPUT_FOR_C  = NO
-OPTIMIZE_OUTPUT_JAVA   = NO
-BUILTIN_STL_SUPPORT    = NO
-CPP_CLI_SUPPORT        = NO
-DISTRIBUTE_GROUP_DOC   = NO
-SUBGROUPING            = YES
-#---------------------------------------------------------------------------
-#Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL            = YES
-EXTRACT_PRIVATE        = YES
-EXTRACT_STATIC         = YES
-EXTRACT_LOCAL_CLASSES  = YES
-EXTRACT_LOCAL_METHODS  = NO
-EXTRACT_ANON_NSPACES   = NO
-HIDE_UNDOC_MEMBERS     = NO
-HIDE_UNDOC_CLASSES     = NO
-HIDE_FRIEND_COMPOUNDS  = NO
-HIDE_IN_BODY_DOCS      = NO
-INTERNAL_DOCS          = NO
-CASE_SENSE_NAMES       = YES
-HIDE_SCOPE_NAMES       = NO
-SHOW_INCLUDE_FILES     = YES
-INLINE_INFO            = YES
-SORT_MEMBER_DOCS       = NO
-SORT_BRIEF_DOCS        = NO
-SORT_BY_SCOPE_NAME     = NO
-GENERATE_TODOLIST      = YES
-GENERATE_TESTLIST      = YES
-GENERATE_BUGLIST       = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS       = 
-MAX_INITIALIZER_LINES  = 30
-SHOW_USED_FILES        = YES
-SHOW_DIRECTORIES       = YES
-FILE_VERSION_FILTER    = 
-#---------------------------------------------------------------------------
-#configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET                  = NO
-WARNINGS               = YES
-WARN_IF_UNDOCUMENTED   = YES
-WARN_IF_DOC_ERROR      = YES
-WARN_NO_PARAMDOC       = NO
-WARN_FORMAT            = "$file:$line: $text "
-WARN_LOGFILE           = 
-#---------------------------------------------------------------------------
-#configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT =  ../src ../TrigEgammaHypo ../doc ../share ../python
-INPUT_ENCODING         = UTF-8
-FILE_PATTERNS          = *.cxx *.h *.py *.mk *.icc
-RECURSIVE              = YES
-EXCLUDE                = 
-EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXCLUDE_SYMBOLS        = 
-EXAMPLE_PATH           = ../doc ../cmt ../share
-EXAMPLE_PATTERNS       = *.cxx *.html requirements *.py
-EXAMPLE_RECURSIVE      = YES
-IMAGE_PATH             = 
-INPUT_FILTER           = 
-FILTER_PATTERNS        = 
-FILTER_SOURCE_FILES    = NO
-#---------------------------------------------------------------------------
-#configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER         = YES
-INLINE_SOURCES         = YES
-STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION    = NO
-REFERENCES_LINK_SOURCE = YES
-USE_HTAGS              = NO
-VERBATIM_HEADERS       = NO
-#---------------------------------------------------------------------------
-#configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX     = NO
-COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
-#---------------------------------------------------------------------------
-#configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML          = YES
-HTML_OUTPUT            = html
-HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = 
-HTML_ALIGN_MEMBERS     = YES
-GENERATE_HTMLHELP      = NO
-HTML_DYNAMIC_SECTIONS  = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
-GENERATE_CHI           = NO
-BINARY_TOC             = NO
-TOC_EXPAND             = NO
-DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
-GENERATE_TREEVIEW      = NO
-TREEVIEW_WIDTH         = 250
-#---------------------------------------------------------------------------
-#configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX         = NO
-LATEX_OUTPUT           = latex
-LATEX_CMD_NAME         = latex
-MAKEINDEX_CMD_NAME     = makeindex
-COMPACT_LATEX          = NO
-PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
-PDF_HYPERLINKS         = NO
-USE_PDFLATEX           = NO
-LATEX_BATCHMODE        = YES
-LATEX_HIDE_INDICES     = NO
-#---------------------------------------------------------------------------
-#configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF           = NO
-RTF_OUTPUT             = rtf
-COMPACT_RTF            = NO
-RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
-#---------------------------------------------------------------------------
-#configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN           = NO
-MAN_OUTPUT             = man
-MAN_EXTENSION          = .3
-MAN_LINKS              = NO
-#---------------------------------------------------------------------------
-#configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML           = NO
-XML_OUTPUT             = xml
-XML_SCHEMA             = 
-XML_DTD                = 
-XML_PROGRAMLISTING     = YES
-#---------------------------------------------------------------------------
-#configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF   = NO
-#---------------------------------------------------------------------------
-#configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD       = NO
-PERLMOD_LATEX          = NO
-PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
-#---------------------------------------------------------------------------
-#Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING   = YES
-MACRO_EXPANSION        = NO
-EXPAND_ONLY_PREDEF     = NO
-SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
-SKIP_FUNCTION_MACROS   = YES
-#---------------------------------------------------------------------------
-#Configuration::additions related to external references   
-#---------------------------------------------------------------------------
-TAGFILES = 
-GENERATE_TAGFILE = /afs/cern.ch/user/a/ahamil/trigger/test/InstallArea/doc/TrigEgammaHypo.tag
-ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = /usr/bin/perl
-#---------------------------------------------------------------------------
-#Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = YES
-MSCGEN_PATH            = 
-HIDE_UNDOC_RELATIONS   = YES
-HAVE_DOT               = YES
-CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-GROUP_GRAPHS           = YES
-UML_LOOK               = YES
-TEMPLATE_RELATIONS     = YES
-INCLUDE_GRAPH          = YES
-INCLUDED_BY_GRAPH      = YES
-CALL_GRAPH             = NO
-CALLER_GRAPH           = NO
-GRAPHICAL_HIERARCHY    = YES
-DIRECTORY_GRAPH        = YES
-DOT_IMAGE_FORMAT       = gif
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-DOT_GRAPH_MAX_NODES    = 50
-MAX_DOT_GRAPH_DEPTH    = 0
-DOT_TRANSPARENT        = NO
-DOT_MULTI_TARGETS      = NO
-GENERATE_LEGEND        = YES
-DOT_CLEANUP            = YES
-#---------------------------------------------------------------------------
-#Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = YES
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py
index 538a9a41fc05..5fc7ed851ee2 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 
@@ -55,10 +55,6 @@ class TrigEFElectronHypoValidationMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFElectronHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-    
         self.Histograms += [ defineHistogram('El_ClusterEt', 	type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
                                             xbins=50, xmin=-2000, xmax=100000) ]
      
@@ -248,10 +244,7 @@ class TrigEFElectronHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFElectronHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-        
+
         self.Histograms += [ defineHistogram('El_ClusterEt', 	type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
                                             xbins=50, xmin=-2000, xmax=100000) ]
                                              
@@ -275,8 +268,7 @@ class TrigEFElectronHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('El_PtCone20', 	type='TH1F', title="EFElectron Hypo Pt in a ring of DR<0.20 above noise (excluding electron PT); PT [MeV]",
                                              xbins=60, xmin=-10000, xmax=50000 ) ] 
 
-                                									
-        
+
 class TrigEFElectronHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
     def __init__ (self, name="TrigEFElectronHypoCosmicMonitoring"):
         """ defines histograms for cosmic """
@@ -336,10 +328,7 @@ class TrigEFElectronHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFElectronHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-        
+
         self.Histograms += [ defineHistogram('El_ClusterEt', 	type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
                                             xbins=50, xmin=-2000, xmax=100000) ]
      
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py
index e33599460d57..f11b6bf07753 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 
@@ -64,12 +64,8 @@ class TrigEFPhotonHypoValidationMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFEgammaHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-       
         self.Histograms += [ defineHistogram('Ph_ClusterEt', 	type='TH1F', title="EFPhoton Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
      
         self.Histograms += [ defineHistogram('Ph_F1', 	type='TH1F', title="EFPhoton Hypo fraction of energy found in 1st em sampling;Fraction",
                                              xbins=50, xmin=-0.1, xmax=1.1 ) ]
@@ -208,10 +204,6 @@ class TrigEFPhotonHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFEgammaHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-
         self.Histograms += [ defineHistogram('Ph_ClusterEt', 	type='TH1F', title="EFPhoton Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
                                             xbins=50, xmin=-2000, xmax=100000) ]
         
@@ -285,10 +277,6 @@ class TrigEFPhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
         for c in cuts:
             labelsDescription +=  c+':'
 
-	#AT Aug2011: deactivate histogram egIsEM - outdated
-        #self.Histograms += [ defineHistogram('egIsEM', 	type='TH1I', title="EFEgammaHypo isEM; Cut",
-        #                                     xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)]
-       
         self.Histograms += [ defineHistogram('Ph_ClusterEt', 	type='TH1F', title="EFPhoton Hypo Cluster E_{T}; E_{T}^{em} [MeV]",
                                             xbins=50, xmin=-2000, xmax=100000) ]
      
@@ -318,25 +306,25 @@ class TrigEFPhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
         self.Histograms += [ defineHistogram('Ph_Phi',	 type='TH1F', title="EFPhoton Hypo Phi; #eta ",xbins=160, xmin=-3.2, xmax=3.2) ]       
         
         self.Histograms += [ defineHistogram('Ph_ClusterEt37', 	type='TH1F', title="EFPhoton Hypo Cluster(3x7) E_{T}; E_{T}^{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_EnergyBE0', 	type='TH1F', title="EFPhoton Hypo Cluster E0; E_{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_EnergyBE1', 	type='TH1F', title="EFPhoton Hypo Cluster E1; E_{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_EnergyBE2', 	type='TH1F', title="EFPhoton Hypo Cluster E2; E_{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_EnergyBE3', 	type='TH1F', title="EFPhoton Hypo Cluster E3; E_{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_Eaccordion', 	type='TH1F', title="EFPhoton Hypo Cluster (E1+E2+E3); E_{T}^{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         
         self.Histograms += [ defineHistogram('Ph_E0Eaccordion', 	type='TH1F', title="EFPhton Hypo Cluster E0/(E1+E2+E3); E_{T}^{em} [MeV]",
-                                            xbins=50, xmin=-2000, xmax=100000) ]
+                                             xbins=50, xmin=-2000, xmax=100000) ]
         self.Histograms += [ defineHistogram('Ph_Eratio', 	type='TH1F', title="EFPhoton Hypo Eratio = (emax1 - emax2) / (emax1 + emax2) ; Eratio ",
                                              xbins=32, xmin=-0.1, xmax=1.5 ) ]
 
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py
index 5030ceae3510..db384f04f5d6 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ##############################
 # L2 Electron and Photon Calorimeter Hypothesis Algorithm Configuration:
@@ -86,7 +86,7 @@ class L2CaloHypo_EtCut (TrigL2CaloHypoBase):
         # AcceptAll flag: if true take events regardless of cuts
         self.AcceptAll = False
 
-	#L2 Threshold moved to 3 GeV within HLT threshold 
+        #L2 Threshold moved to 3 GeV within HLT threshold
         self.ETthr          = [(float(threshold) -  3)*GeV]*9
         # No other cuts applied
         self.dETACLUSTERthr = 9999.
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
index 585b0353d20d..582f326d7b3c 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 
@@ -9,15 +9,15 @@ class TrigL2PhotonHypoValidationMonitoring(TrigGenericMonitoringToolConfig):
 
 
         self.Histograms = [ defineHistogram('PhEt', 	type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]",
-                                                                                                                xbins=50, xmin=-2000, xmax=100000) ]
+                                            xbins=50, xmin=-2000, xmax=100000) ]
         self.Histograms += [ defineHistogram('PhEta', 	type='TH1F', title="L2Photon Hypo #eta;#eta",
-                                            									xbins=100, xmin=-2.5, xmax=2.5) ]
+                                             xbins=100, xmin=-2.5, xmax=2.5) ]
         self.Histograms += [ defineHistogram('PhPhi', 	type='TH1F', title="L2Photon Hypo #phi;#phi",
-                                            									xbins=128, xmin=-3.2, xmax=3.2) ]
+                                             xbins=128, xmin=-3.2, xmax=3.2) ]
         self.Histograms += [ defineHistogram('PhEratio', 	type='TH1F', title="L2Photon Hypo Eratio;Eratio",
-                                    										xbins=64, xmin=-0.1, xmax=1.5) ]
+                                             xbins=64, xmin=-0.1, xmax=1.5) ]
         self.Histograms += [ defineHistogram('PhRcore', 	type='TH1F', title="L2Photon Hypo Rcore; Rcore",
-                                             									xbins=48, xmin=-0.1, xmax=1.1 ) ]
+                                             xbins=48, xmin=-0.1, xmax=1.1 ) ]
 
         self.Histograms += [ defineHistogram('dEta', 	type='TH1F', title="L2Photon Hypo #Delta #eta; #Delta #eta",
                                              xbins=80, xmin=-0.2, xmax=0.2 ) ]
@@ -51,11 +51,11 @@ class TrigL2PhotonHypoOnlineMonitoring(TrigGenericMonitoringToolConfig):
 
 
         self.Histograms = [ defineHistogram('PhEt', 	type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]",
-                                                                                                                xbins=50, xmin=-2000, xmax=100000) ]
+                                            xbins=50, xmin=-2000, xmax=100000) ]
         self.Histograms += [ defineHistogram('PhEta', 	type='TH1F', title="L2Photon Hypo #eta;#eta",
-                                            									xbins=100, xmin=-2.5, xmax=2.5) ]
+                                             xbins=100, xmin=-2.5, xmax=2.5) ]
         self.Histograms += [ defineHistogram('PhPhi', 	type='TH1F', title="L2Photon Hypo #phi;#phi",
-                                            									xbins=128, xmin=-3.2, xmax=3.2) ]
+                                             xbins=128, xmin=-3.2, xmax=3.2) ]
         cuts=['Input','has TrigPhotonContainer', '#Delta #eta', '#Delta #phi', '#eta','Reta','eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}']
         
         labelsDescription = ''
@@ -74,15 +74,15 @@ class TrigL2PhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig):
         self.defineTarget("Cosmic")
 
         self.Histograms = [ defineHistogram('PhEt', 	type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]",
-                                                                                                                xbins=50, xmin=-2000, xmax=100000) ]
+                                            xbins=50, xmin=-2000, xmax=100000) ]
         self.Histograms += [ defineHistogram('PhEta', 	type='TH1F', title="L2Photon Hypo #eta;#eta",
-                                            									xbins=100, xmin=-2.5, xmax=2.5) ]
+                                             xbins=100, xmin=-2.5, xmax=2.5) ]
         self.Histograms += [ defineHistogram('PhPhi', 	type='TH1F', title="L2Photon Hypo #phi;#phi",
-                                            									xbins=128, xmin=-3.2, xmax=3.2) ]
+                                             xbins=128, xmin=-3.2, xmax=3.2) ]
         self.Histograms += [ defineHistogram('PhEratio', 	type='TH1F', title="L2Photon Hypo Eratio;Eratio",
-                                    										xbins=64, xmin=-0.1, xmax=1.5) ]
+                                             xbins=64, xmin=-0.1, xmax=1.5) ]
         self.Histograms += [ defineHistogram('PhRcore', 	type='TH1F', title="L2Photon Hypo Rcore; Rcore",
-                                             									xbins=48, xmin=-0.1, xmax=1.1 ) ]
+                                             xbins=48, xmin=-0.1, xmax=1.1 ) ]
 
         self.Histograms += [ defineHistogram('dEta', 	type='TH1F', title="L2Photon Hypo #Delta #eta; #Delta #eta",
                                              xbins=80, xmin=-0.2, xmax=0.2 ) ]
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx
index 96433bc83174..6e2c4c27d612 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**************************************************************************
@@ -38,7 +38,6 @@
 #include "xAODTrigger/TrigComposite.h"
 #include "xAODTrigger/TrigCompositeContainer.h"
 #include "TLorentzVector.h"
-#include "CLHEP/Vector/LorentzVector.h"
 //#include "TrigConfHLTData/HLTTriggerElement.h"
 #include <math.h>
 
-- 
GitLab


From ebd30bb5b3a98b24568a515fb1c688c264a44187 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 14:43:46 +0200
Subject: [PATCH 122/217] TrigCaloHypo: Package cleanup

- tidy cmake configuration
- remove CLHEP dependency
- enable flake8
---
 .../TrigCaloHypo/CMakeLists.txt               | 30 +++----------------
 .../TrigCaloHypo/python/TrigCaloHypoConfig.py |  4 +--
 .../TrigCaloHypo/src/TrigEFCaloHypoNoise.cxx  |  7 +++--
 .../TrigCaloHypo/src/TrigL2JetHypo.cxx        | 10 +++----
 4 files changed, 14 insertions(+), 37 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigCaloHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigCaloHypo/CMakeLists.txt
index 1e8016e2e7cb..b5c0d223a066 100644
--- a/Trigger/TrigHypothesis/TrigCaloHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigCaloHypo/CMakeLists.txt
@@ -1,38 +1,16 @@
-
-################################################################################
-# Package: TrigCaloHypo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigCaloHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Calorimeter/CaloInterface
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Calorimeter/CaloGeoHelpers
-                          Event/EventKernel
-                          Event/FourMomUtils
-                          Event/xAOD/xAODCaloEvent
-                          Event/xAOD/xAODEventInfo
-                          LArCalorimeter/LArRecEvent
-                          LArCalorimeter/LArRecConditions
-                          Reconstruction/Jet/JetUtils )
-
 # External dependencies:
-find_package( CLHEP )
 find_package( tdaq-common COMPONENTS hltinterface )
 
 # Component(s) in the package:
 atlas_add_component( TrigCaloHypo
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} xAODJet GaudiKernel JetEvent TrigCaloEvent TrigParticle TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib CaloGeoHelpers EventKernel FourMomUtils xAODCaloEvent xAODEventInfo LArRecEvent LArRecConditions JetUtils )
+                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloInterfaceLib GaudiKernel LArRecConditions LArRecEvent StoreGateLib TrigCaloEvent TrigInterfacesLib TrigSteeringEvent TrigTimeAlgsLib xAODCaloEvent xAODEventInfo )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigHypothesis/TrigCaloHypo/python/TrigCaloHypoConfig.py b/Trigger/TrigHypothesis/TrigCaloHypo/python/TrigCaloHypoConfig.py
index 89a470ae43e1..3c37b071bf7c 100644
--- a/Trigger/TrigHypothesis/TrigCaloHypo/python/TrigCaloHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigCaloHypo/python/TrigCaloHypoConfig.py
@@ -1,12 +1,10 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 
 from AthenaCommon.SystemOfUnits import GeV
 from TrigCaloHypo.TrigCaloHypoConf import TrigEFCaloHypoNoise
 from LArCellRec.LArCellRecConf import LArNoisyROTool
-from LArBadChannelTool.LArBadChannelToolConf import LArBadChanLegacyTool
 from IOVDbSvc.CondDB import conddb
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 
 from LArCabling.LArCablingAccess import LArOnOffIdMapping
 LArOnOffIdMapping()
diff --git a/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigEFCaloHypoNoise.cxx b/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigEFCaloHypoNoise.cxx
index f80bd2d5b6b9..ebfa1bb19abe 100755
--- a/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigEFCaloHypoNoise.cxx
+++ b/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigEFCaloHypoNoise.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -20,6 +20,8 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/StatusCode.h"
 #include "GaudiKernel/ListItem.h"
+#include "GaudiKernel/SystemOfUnits.h"
+
 #include "xAODEventInfo/EventInfo.h"
 #include "LArRecEvent/LArNoisyROSummary.h"
 
@@ -32,7 +34,6 @@
 #include "hltinterface/IInfoRegister.h"
 #include "hltinterface/ContainerFactory.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 class ISvcLocator;
 
@@ -43,7 +44,7 @@ class ISvcLocator;
 TrigEFCaloHypoNoise::TrigEFCaloHypoNoise(const std::string& name, ISvcLocator* pSvcLocator):
   HLT::HypoAlgo(name, pSvcLocator), m_isInterface(false), m_noisyROTool("",this),m_hasFebs(false) {
 
-  declareProperty("Etcut",   m_EtCut = 40*CLHEP::GeV); // Default: 40 GeV
+  declareProperty("Etcut",   m_EtCut = 40*Gaudi::Units::GeV); // Default: 40 GeV
   declareProperty("doMonitoring", m_doMonitoring = false );
   declareProperty("AcceptAll",      m_acceptAll=false);
   declareProperty("NoiseTool",   m_noisyROTool);
diff --git a/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigL2JetHypo.cxx b/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigL2JetHypo.cxx
index a5e8d2f81649..4f482d2dc17c 100644
--- a/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigL2JetHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigCaloHypo/src/TrigL2JetHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -14,6 +14,7 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 //#include "TrigSteeringEvent/TriggerElement.h"
 
@@ -24,7 +25,6 @@
 
 #include "TrigL2JetHypo.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 class ISvcLocator;
 
@@ -35,7 +35,7 @@ class ISvcLocator;
 TrigL2JetHypo::TrigL2JetHypo(const std::string& name, ISvcLocator* pSvcLocator):
   HLT::HypoAlgo(name, pSvcLocator) {
 
-  declareProperty("Etcut_L2",   m_EtCut_L2 = 20*CLHEP::GeV, "cut value for L2 jet et"); // Default: 20 GeV
+  declareProperty("Etcut_L2",   m_EtCut_L2 = 20*Gaudi::Units::GeV, "cut value for L2 jet et"); // Default: 20 GeV
   declareProperty("doMonitoring_L2", m_doMonitoring = false, "switch on/off monitoring" );
   declareProperty("AcceptAll",      m_acceptAll=false);
   //declareProperty("histoPath", m_path = "/stat/Monitoring/EventFilter" );
@@ -52,9 +52,9 @@ TrigL2JetHypo::TrigL2JetHypo(const std::string& name, ISvcLocator* pSvcLocator):
   declareProperty("applyCleaningToHighEtJets",   m_applyCleaningToHighEtJets = true);
   declareProperty("applyCleaningToLowEtJets",    m_applyCleaningToLowEtJets = true);
   // Et-threshold: if(applyCleaningToHighEtJets==false) then don't apply cleaning cuts to jets with Et > highEtThreshold:
-  declareProperty("cleaningHighEtThreshold",     m_cleaningHighEtThreshold = 1000.*CLHEP::GeV);
+  declareProperty("cleaningHighEtThreshold",     m_cleaningHighEtThreshold = 1000.*Gaudi::Units::GeV);
   // Et-threshold: if(applyCleaningToLowEtJets==false) then don't apply cleaning cuts to jets with Et < lowEtThreshold:
-  declareProperty("cleaningLowEtThreshold",      m_cleaningLowEtThreshold = 20.*CLHEP::GeV);
+  declareProperty("cleaningLowEtThreshold",      m_cleaningLowEtThreshold = 20.*Gaudi::Units::GeV);
   // threshold for number of leading cells in hecf > m_leadingCellsThr &&  nLeadingCells <= m_leadingCellsThr cut:
   declareProperty("leadingCellsThr", m_leadingCellsThr = 1);
   // hecf threshold for cut in combination with nLeadingCells (i.e. hecf > m_hecfThrN &&  nLeadingCells <= m_leadingCellsThr):
-- 
GitLab


From 5bc5e0fb87ad4741b6163bf10b1618634f522956 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 14:50:56 +0200
Subject: [PATCH 123/217] TrigMissingETHypo: Package cleanup

- enable flake8
- delete obsolete job options
- cleanup cmake configuration
- remove CLHEP dependency
---
 .../TrigMissingETHypo/CMakeLists.txt          |  33 +-----
 .../python/TrigMissingETHypoConfig.py         |   0
 .../python/TrigMissingETHypoMonitoring.py     |   0
 .../share/TriggerConfig_MET.py                |  60 ----------
 .../share/TriggerConfig_MET_HLT.py            |  91 ---------------
 .../share/TriggerConfig_MET_Level1.py         | 107 ------------------
 .../share/TriggerConfig_MET_flags.py          |  17 ---
 .../share/testMETSlice_jobOptions.py          |  95 ----------------
 .../src/TrigEFMissingETHypo.cxx               |  23 ++--
 .../src/TrigEFMissingETHypo.h                 |   0
 10 files changed, 16 insertions(+), 410 deletions(-)
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoring.py
 delete mode 100755 Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET.py
 delete mode 100755 Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_HLT.py
 delete mode 100755 Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_Level1.py
 delete mode 100755 Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_flags.py
 delete mode 100755 Trigger/TrigHypothesis/TrigMissingETHypo/share/testMETSlice_jobOptions.py
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.h

diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt
index 65c147e2e8eb..fc7944182c6e 100644
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt
@@ -1,41 +1,18 @@
-################################################################################
-# Package: TrigMissingETHypo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMissingETHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          PRIVATE
-                          Event/xAOD/xAODTrigMissingET
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigMissingEtEvent 
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils
-                          Trigger/TrigAlgorithms/TrigEFMissingET)
-
-# External dependencies:
-find_package( CLHEP )
-
 # Component(s) in the package:
 atlas_add_component( TrigMissingETHypo
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} TrigInterfacesLib TrigTimeAlgsLib xAODTrigMissingET GaudiKernel TrigMissingEtEvent DecisionHandlingLib TrigCompositeUtilsLib )
+                     LINK_LIBRARIES AsgTools AthenaBaseComps AthenaMonitoringKernelLib DecisionHandlingLib GaudiKernel TrigCompositeUtilsLib TrigInterfacesLib TrigMissingEtEvent TrigTimeAlgsLib xAODTrigMissingET )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/TriggerConfig_*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
 
 # Unit tests:
-atlas_add_test( TrigMissingETHypoConfigMT SCRIPT python -m TrigMissingETHypo.TrigMissingETHypoConfigMT
+atlas_add_test( TrigMissingETHypoConfigMT
+                SCRIPT python -m TrigMissingETHypo.TrigMissingETHypoConfigMT
                 PROPERTIES TIMEOUT 300
 		        POST_EXEC_SCRIPT nopost.sh )
-
-# Check Python syntax:
-atlas_add_test( flake8
-   SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python
-   POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoring.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoring.py
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET.py b/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET.py
deleted file mode 100755
index 37b151812663..000000000000
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET.py
+++ /dev/null
@@ -1,60 +0,0 @@
-include.block("TrigMissingETHypo/TriggerConfig_MET.py")
-
-#print "METSlice Flags:"
-TriggerFlags.METSlice.printFlags("MET Slice Flags")
-
-from TrigMissingETHypo.MissingET import MissingET
-te150 = MissingET("te150")
-te250 = MissingET("te250")
-te360 = MissingET("te360")
-te650 = MissingET("te650")
-xe15 = MissingET("xe15")
-xe20 = MissingET("xe20")
-xe25 = MissingET("xe25")
-xe30 = MissingET("xe30")
-xe40 = MissingET("xe40")
-xe50 = MissingET("xe50")
-xe70 = MissingET("xe70")
-xe80 = MissingET("xe80")
-
-#print deprecated?
-#print "MissingETSlice Flags:" 
-#TriggerFlags.METSlice.printFlags(" Missing ET Slice Flags ")
-
-include("TrigMissingETHypo/TriggerConfig_MET_Level1.py")
-if triggerMenu.signatureIsEnabled("te150"):
-    te150.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("te250"):
-    te250.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("te360"):
-    te360.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("te650"):
-    te650.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe15"):
-    xe15.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe20"):
-    xe20.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe25"):
-    xe25.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe30"):
-    xe30.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe40"):
-    xe40.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe50"):
-    xe50.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe70"):
-    xe70.generateMenu(triggerPythonConfig)
-
-if triggerMenu.signatureIsEnabled("xe80"):
-    xe80.generateMenu(triggerPythonConfig)
-
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_HLT.py b/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_HLT.py
deleted file mode 100755
index c7fb4d95bfff..000000000000
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_HLT.py
+++ /dev/null
@@ -1,91 +0,0 @@
-include.block("TrigMissingETHypo/TriggerConfig_MET_HLT.py")
-
-from TrigL2MissingET.TrigL2MissingETConfig import T2MissingET
-from TrigEFMissingET.TrigEFMissingETConfig import EFMissingET_Met
-from TrigMissingETHypo.TrigMissingETHypoConfig import EFMetHypo_met_xx
-
-def TriggerConfig_MET_HLT( L1TE , L1ITEM, sliceId, chain_number, METcut, SETcut, CutType, sigval ):
-
-	l2chain_name = "L2_"
-	l2chain_name += sliceId
-	l2chain_name += CutType
-	l2chain = HLTChain( chain_name=l2chain_name, chain_counter=chain_number, lower_chain_name=L1ITEM, level="L2", prescale="1", pass_through="0")
-	l2chain.addTriggerTypeBit(1)
-	l2chain.addStreamTag("met")
-
-	efchain_name = "EF_"
-	efchain_name += sliceId
-	efchain_name += CutType
-	efchain = HLTChain( chain_name=efchain_name, chain_counter=chain_number, lower_chain_name=l2chain_name, level="EF", prescale="1", pass_through="0")
-	efchain.addTriggerTypeBit(1)
-	efchain.addStreamTag("met")
-
-	sequence=[]
-
-	if CutType=="OR" :
-		AlgCut = -2.0
-	else:
-		if CutType=="AND" :
-			AlgCut = -1.0
-		else :
-			AlgCut = sigval
-
-	if TriggerFlags.METSlice.doL2Calo():
-
-		# get configurables of L2 algorithms (FEX, HYPO):
-		l2FEXinstance = "L2METfex_"
-		l2FEXinstance += "ALLchain"
-		#l2FEXinstance += sliceId
-		l2Topo = T2MissingET(l2FEXinstance)
-		l2HYPOinstance = "L2METhypo_"
-		l2HYPOinstance += sliceId
-		l2Hypo = EFMetHypo_met_xx(l2HYPOinstance)
-
-		# Set cut values [MeV] and OR of MET and SumET cuts
-		l2Hypo.MissingETCut=METcut
-		l2Hypo.SumETCut=SETcut
-		l2Hypo.CutType=AlgCut
-
-		# set hypo to use L2 feature:
-		l2Hypo.METLabel = "T2MissingET"
-
-
-		if TriggerFlags.MuonSlice.doL2Muon() :
-			TE=triggerPythonConfig.addSequence([L1TE,"T2muFastMuon_mu6"], [ l2Topo, l2Hypo], sliceId+"_L2")
-		else:
-			print "WARNING : cannot setup LVL2 MissingET trigger to use muons, since the muons are not configured (yet) !!!"
-			TE=triggerPythonConfig.addSequence([L1TE], [ l2Topo, l2Hypo], sliceId+"_L2")
-
-		print "L2 output TE= %s = %s"%(TE,sliceId+"_L2")
-		l2chain.addHLTSignature(TE)
-
-	if TriggerFlags.METSlice.doEFCalo():
-		# get configurables of L2 algorithms (FEX, HYPO):
-		efFEXinstance = "EFMETfex_"
-		#efFEXinstance += "ALLchain"
-		efFEXinstance += sliceId
-		efcaloMET     = EFMissingET_Met(efFEXinstance)
-		print efcaloMET
-		efHYPOinstance = "EFMEThypo_"
-		efHYPOinstance += sliceId
-		efcaloMEThypo = EFMetHypo_met_xx(efHYPOinstance)
-
-		# Set cut values [MeV] and OR of MET and SumET cuts.
-		efcaloMEThypo.MissingETCut=METcut
-		efcaloMEThypo.SumETCut=SETcut
-		efcaloMEThypo.CutType=AlgCut
-		print efcaloMEThypo
-
-		if TriggerFlags.MuonSlice.doEFMuon() :
-			TE=triggerPythonConfig.addSequence( [TE, "EFID_mu6"], [ efcaloMET, efcaloMEThypo ], sliceId+"_EF")
-		else:
-			print "WARNING : cannot setup EF MissingET trigger to use muons, since the muons are not configured (yet) !!!"
-			TE=triggerPythonConfig.addSequence( [TE], [ efcaloMET, efcaloMEThypo ], sliceId+"_EF")
-
-		efchain.addHLTSignature(TE)
-
-	# --------------------------------------------------------------------
-	# Add single electron signature
-
-	triggerPythonConfig.addHLTChain(l2chain)
-	triggerPythonConfig.addHLTChain(efchain)
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_Level1.py b/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_Level1.py
deleted file mode 100755
index 0214fc1001e3..000000000000
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_Level1.py
+++ /dev/null
@@ -1,107 +0,0 @@
-include.block("TrigMissingETHypo/TriggerConfig_MET_Level1.py")
-
-# 8 thresholds on MET + 4 thresholds on SumEt
-
-# MET a)
-th = triggerPythonConfig.addLvl1Threshold( name='XE15', type='XE', mapping=0, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="15", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE15', ctpid='128', group='1', prescale=30000)
-item.addAndedCondition(name='XE15', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET b)
-th = triggerPythonConfig.addLvl1Threshold( name='XE20', type='XE', mapping=1, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="20", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE20', ctpid='129', group='1', prescale=7000)
-item.addAndedCondition(name='XE20', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET c)
-th = triggerPythonConfig.addLvl1Threshold( name='XE25', type='XE', mapping=2, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="25", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE25', ctpid='130', group='1', prescale=1500)
-item.addAndedCondition(name='XE25', multi='1') 
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET d)
-th = triggerPythonConfig.addLvl1Threshold( name='XE30', type='XE', mapping=3, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="30", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE30', ctpid='131', group='1', prescale=200)
-item.addAndedCondition(name='XE30', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET e)
-th = triggerPythonConfig.addLvl1Threshold( name='XE40', type='XE', mapping=4, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="40", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE40', ctpid='132', group='1', prescale=20)
-item.addAndedCondition(name='XE40', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET f)
-th = triggerPythonConfig.addLvl1Threshold( name='XE50', type='XE', mapping=5, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="50", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE50', ctpid='133', group='1', prescale=2)
-item.addAndedCondition(name='XE50', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET g)
-th = triggerPythonConfig.addLvl1Threshold( name='XE70', type='XE', mapping=6, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="70", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE70', ctpid='134', group='1', prescale=1)
-item.addAndedCondition(name='XE70', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# MET h)
-th = triggerPythonConfig.addLvl1Threshold( name='XE80', type='XE', mapping=7, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="80", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_XE80', ctpid='135', group='1', prescale=1)
-item.addAndedCondition(name='XE80', multi='1')
-
-triggerPythonConfig.addLVL1Item(item)
-
-# SumET a)
-th = triggerPythonConfig.addLvl1Threshold( name='TE100', type='TE', mapping=0, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="100", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_TE100', ctpid='136', group='1', prescale=86000)
-item.addAndedCondition(name='TE100', multi='1')
-triggerPythonConfig.addLVL1Item(item)
-
-# SumET b)
-th = triggerPythonConfig.addLvl1Threshold( name='TE200', type='TE', mapping=1, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="200", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_TE200', ctpid='137', group='1', prescale=1800)
-item.addAndedCondition(name='TE200', multi='1')
-triggerPythonConfig.addLVL1Item(item)
-
-# SumET c)
-th = triggerPythonConfig.addLvl1Threshold( name='TE304', type='TE', mapping=2, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="304", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_TE304', ctpid='138', group='1', prescale=19)
-item.addAndedCondition(name='TE304', multi='1')
-triggerPythonConfig.addLVL1Item(item)
-
-# SumET d)
-th = triggerPythonConfig.addLvl1Threshold( name='TE380', type='TE', mapping=3, slot='SLOT8', connector='CON2' )
-th.addEnergyThresholdValue(value="380", etamin="-49" , etamax="49" , phimin="0" , phimax="64", priority="0")
-
-item = LVL1MenuItem('L1_TE380', ctpid='139', group='1', prescale=1)
-item.addAndedCondition(name='TE380', multi='1')
-triggerPythonConfig.addLVL1Item(item)
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_flags.py b/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_flags.py
deleted file mode 100755
index 1c7a92761456..000000000000
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/share/TriggerConfig_MET_flags.py
+++ /dev/null
@@ -1,17 +0,0 @@
-include.block("TrigMissingETHypo/TriggerConfig_MET_flags.py")
-
-triggerMenu.addSignatures(["te150","te250", "te360", "te650", "xe15", "xe20", "xe25", "xe30", "xe40", "xe50", "xe70", "xe80"])
-
-triggerMenu.enableSignature("te150")
-triggerMenu.enableSignature("te250")
-triggerMenu.enableSignature("te360")
-triggerMenu.enableSignature("te650")
-
-triggerMenu.enableSignature("xe15")
-triggerMenu.enableSignature("xe20")
-triggerMenu.enableSignature("xe25")
-triggerMenu.enableSignature("xe30")
-triggerMenu.enableSignature("xe40")
-triggerMenu.enableSignature("xe50")
-triggerMenu.enableSignature("xe70")
-triggerMenu.enableSignature("xe80")
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/share/testMETSlice_jobOptions.py b/Trigger/TrigHypothesis/TrigMissingETHypo/share/testMETSlice_jobOptions.py
deleted file mode 100755
index 91ad35eeb918..000000000000
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/share/testMETSlice_jobOptions.py
+++ /dev/null
@@ -1,95 +0,0 @@
-######################################################################################
-#
-# This file is intended for running the MET slice in the offline software.
-# By default a ttbar RDO file is used.
-#
-# HOWTO run:
-# 1. create a run directory          : cd $TestArea; mkdir run; cd run
-# 2. source & get some trigger stuff : source source TriggerRelease_links.sh
-# 3. copy our test jobOption file    : cp ../Trigger/TrigHypothesis/TrigMissingETHypo/share/testMETSlice_jobOptions.py .
-# 4. run the job                     : athena testMETSlice_jobOptions.py &>! log &
-#
-######################################################################################
-
-
-### usually ATN tests runs with following RDO input:
-#PoolRDOInput=["/afs/cern.ch/atlas/offline/data/testfile/calib1_csc11.005200.T1_McAtNlo_Jimmy.digit.RDO.v12000301_tid003138._00016_extract_10evt.pool.root"]
-
-
-if not ('EvtMax' in dir()):
-    EvtMax=10
-if not ('OutputLevel' in dir()):
-    OutputLevel=INFO
-
-### need to check if default is ok
-doCBNT=False
-
-
-
-doTrigger=True
-doESD=False
-
-doWriteAOD=False
-doWriteESD=False
-doWriteTAG=False
-doAOD=False
-doESD=False
-doTAG=False
-
-doTruth=True
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_flags.py")
-#-----------------------------------------------------------
-
-TriggerFlags.readHLTconfigFromXML=False
-TriggerFlags.readLVL1configFromXML=False
-
-TriggerFlags.enableMonitoring = [ 'Validation', 'Time', 'Log' ]
-
-#------------ This is a temporary fix ---------------
-TriggerFlags.abortOnConfigurationError=True
-#-------------end of temporary fix-------------------
-
-####  First switch all slices OFF
-TriggerFlags.Slices_all_setOff()
-
-
-# add muons for MET ... !
-if readMuonHits:
-    DetFlags.digitize.Muon_setOn()
-    DetFlags.readRIOBS.Muon_setOff()
-    DetFlags.readRIOPool.LVL1_setOff()
-    TriggerFlags.doLVL1=True
-    ###### This is a temporary fix ################
-    DetFlags.simulateLVL1.Muon_setOn()
-else:
-    DetFlags.digitize.Muon_setOff()
-
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable MET slice
-TriggerFlags.METSlice.unsetAll()
-TriggerFlags.METSlice.setL2Calo()
-TriggerFlags.METSlice.setEFCalo()
-#TriggerFlags.doEF=False
-
-TriggerFlags.MuonSlice.setL2Muon()
-
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_topOptions.py")
-#-----------------------------------------------------------
-
-MessageSvc.debugLimit = 10000000
-MessageSvc.Format = "% F%48W%S%7W%R%T %0W%M"
-
-#get rid of messages and increase speed
-Service ("StoreGateSvc" ).ActivateHistory=False
-
-from AthenaCommon.AlgSequence import AlgSequence
-print AlgSequence()
-print ServiceMgr
-
-
-AlgSequence().TrigSteer_L2.OutputLevel=VERBOSE
-AlgSequence().TrigSteer_L2.T2MissingET.OutputLevel=VERBOSE
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.cxx b/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.cxx
old mode 100755
new mode 100644
index e948c83389e2..eca3fd8f84d3
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -9,7 +9,6 @@
 //
 // AUTHOR:  Kyle Cranmer, Florian Bernlochner
 //
-//  $Id: TrigEFMissingETHypo.cxx,v 1.26 2009-03-25 17:04:03 casadei Exp $
 // ********************************************************************
 //
 #include <list>
@@ -20,6 +19,7 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/StatusCode.h"
 #include "GaudiKernel/ListItem.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 #include "TrigEFMissingETHypo.h"
 
@@ -27,7 +27,6 @@
 #include "TrigMissingEtEvent/TrigMissingET.h"
 #include "xAODTrigMissingET/TrigMissingET.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 class ISvcLocator;
 
@@ -40,8 +39,8 @@ TrigEFMissingETHypo::TrigEFMissingETHypo(const std::string& name, ISvcLocator* p
 
   declareProperty("METLabel", m_featureLabel = "TrigEFMissingET", "label for the MET feature in the HLT Navigation");
 
-  declareProperty("MissingETCut", m_MEtCut   =  200*CLHEP::GeV, "cut value for the MissingEt [MeV]");
-  declareProperty("SumETCut",     m_SumEtCut = 1000*CLHEP::GeV, "cut value for the SumEt [MeV]");
+  declareProperty("MissingETCut", m_MEtCut   =  200*Gaudi::Units::GeV, "cut value for the MissingEt [MeV]");
+  declareProperty("SumETCut",     m_SumEtCut = 1000*Gaudi::Units::GeV, "cut value for the SumEt [MeV]");
   declareProperty("SigCut",       m_SigCut   = 30, "cut value for the SumEt");
   declareProperty("CutType",      m_CutType  = -3.0,     "val<-1.5 => MissingEt OR SumEt; -1.5<val<-0.5 => MissingEt AND SumEt; -0.5<val<0.5 => reject all events .5<val => Significance" );
 
@@ -50,7 +49,7 @@ TrigEFMissingETHypo::TrigEFMissingETHypo(const std::string& name, ISvcLocator* p
   declareProperty("doOnlyCalcCentralMET", m_doOnlyCalcCentralMET = false, "only use central MET" );
 
   declareProperty("doL1L2FEBTest", m_doL1L2FEBTest = false, "Use L2=L1 values to Trigger FEB if MET values disagree by more than L1L2FEBTolerance GeV (for FEB only!)" );
-  declareProperty("L1L2FEBTolerance", m_L1L2FEBTolerance = 100*CLHEP::GeV, "L2=L1 vs FEB tolerance in GeV" );
+  declareProperty("L1L2FEBTolerance", m_L1L2FEBTolerance = 100*Gaudi::Units::GeV, "L2=L1 vs FEB tolerance in GeV" );
 
   declareProperty("doLArH11off", m_doLArH11off = false, "LAr H11 crate is off" );
   declareProperty("doLArH12off", m_doLArH12off = false, "LAr H12 crate is off" );
@@ -65,11 +64,11 @@ TrigEFMissingETHypo::TrigEFMissingETHypo(const std::string& name, ISvcLocator* p
   declareProperty("significanceSlope",  m_significanceSlope  = 1, "slope of xs");
   declareProperty("significanceQuadr",  m_significanceQuadr  = 0, "quadratic term of xs");
 
-  declareProperty("xsMETmin",  m_xsMETmin = 10*CLHEP::GeV, "Minimum Value for MET in xs chains");  
-  declareProperty("xsSETmin",  m_xsSETmin = 16*CLHEP::GeV, "Minimum Value for MET in xs chains");  
+  declareProperty("xsMETmin",  m_xsMETmin = 10*Gaudi::Units::GeV, "Minimum Value for MET in xs chains");
+  declareProperty("xsSETmin",  m_xsSETmin = 16*Gaudi::Units::GeV, "Minimum Value for MET in xs chains");
 
-  declareProperty("xsMETok",   m_xsMETok = 64*CLHEP::GeV,   "MET value for acceptance in xs chains" );
-  declareProperty("xsSETok",   m_xsSETok = 6500*CLHEP::GeV, "SET value for acceptance in xs chains" );
+  declareProperty("xsMETok",   m_xsMETok = 64*Gaudi::Units::GeV,   "MET value for acceptance in xs chains" );
+  declareProperty("xsSETok",   m_xsSETok = 6500*Gaudi::Units::GeV, "SET value for acceptance in xs chains" );
 
   m_bitMask = 0;
   declareProperty("bitMaskComp", m_bitMaskComp = 0, "bit mask to enable rejection based on the component level status flag" );
@@ -574,8 +573,8 @@ HLT::ErrorCode TrigEFMissingETHypo::hltExecute(const HLT::TriggerElement* output
   float SIG = 0;
   if( SET > 0 )
     {
-      float SIG_numerator   = MET/CLHEP::GeV;
-      float SIG_denominator = m_significanceOffset + m_significanceSlope*sqrt(SET/CLHEP::GeV) + m_significanceQuadr*(SET/CLHEP::GeV);
+      float SIG_numerator   = MET/Gaudi::Units::GeV;
+      float SIG_denominator = m_significanceOffset + m_significanceSlope*sqrt(SET/Gaudi::Units::GeV) + m_significanceQuadr*(SET/Gaudi::Units::GeV);
       SIG = SIG_numerator/SIG_denominator;
     }
   else SIG=0;
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.h b/Trigger/TrigHypothesis/TrigMissingETHypo/src/TrigEFMissingETHypo.h
old mode 100755
new mode 100644
-- 
GitLab


From 3bafad02abc1e2461588e81c44baba7e2fb3f041 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 15:01:51 +0200
Subject: [PATCH 124/217] TrigEgammaMuonCombHypo: Package cleanup

Cleanup cmake configuration and enable flake8.
---
 .../TrigEgammaMuonCombHypo/CMakeLists.txt     | 36 ++-----------------
 .../TrigEFElectronMuonAngleHypoConfig.py      | 18 +++++-----
 .../TrigEFElectronMuonAngleHypoMonitoring.py  |  4 +--
 .../python/TrigEFPhotonMuonAngleHypoConfig.py |  8 ++---
 .../TrigL2ElectronMuonAngleHypoConfig.py      | 17 +++++----
 .../TrigL2ElectronMuonAngleHypoMonitoring.py  |  5 ++-
 .../python/TrigL2PhotonMuonAngleHypoConfig.py |  8 ++---
 7 files changed, 32 insertions(+), 64 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/CMakeLists.txt
index 8750c01f1f85..cf94b2815d90 100644
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/CMakeLists.txt
@@ -1,43 +1,13 @@
-################################################################################
-# Package: TrigEgammaMuonCombHypo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigEgammaMuonCombHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/StoreGate
-                          DetectorDescription/GeoPrimitives
-                          GaudiKernel
-                          Reconstruction/egamma/egammaEvent
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigEvent/TrigTopoEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          PRIVATE
-                          Control/CxxUtils
-                          Event/xAOD/xAODEgamma
-                          Event/xAOD/xAODMuon
-                          Reconstruction/MuonIdentification/MuidEvent
-                          Reconstruction/RecoTools/ITrackToVertex
-                          Tracking/TrkEvent/VxVertex )
-
-# External dependencies:
-find_package( Eigen )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_component( TrigEgammaMuonCombHypo
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} StoreGateLib SGtests GeoPrimitives GaudiKernel egammaEvent TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigParticle TrigSteeringEvent TrigTopoEvent TrigInterfacesLib CxxUtils xAODEgamma xAODMuon MuidEvent ITrackToVertex VxVertex )
+                     LINK_LIBRARIES CxxUtils GaudiKernel GeoPrimitives ITrackToVertex MuidEvent StoreGateLib TrigInDetEvent TrigInterfacesLib TrigMuonEvent TrigParticle TrigSteeringEvent TrigTopoEvent VxVertex egammaEvent xAODEgamma xAODMuon )
 
 # Install files from the package:
-atlas_install_headers( TrigEgammaMuonCombHypo )
-atlas_install_python_modules( python/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoConfig.py
index 0b9b9fb56b1f..084428f892bf 100755
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoConfig.py
@@ -1,8 +1,8 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigEgammaMuonCombHypo.TrigEgammaMuonCombHypoConf import TrigEFElectronMuonAngleFexAlgo, TrigEFElectronMuonAngleHypo
 from AthenaCommon.SystemOfUnits import GeV
-from TrigEgammaMuonCombHypo.TrigEFElectronMuonAngleHypoMonitoring import *
+import TrigEgammaMuonCombHypo.TrigEFElectronMuonAngleHypoMonitoring as mon
 
 class TrigEFElectronMuonAngleFex ( TrigEFElectronMuonAngleFexAlgo ):
     __slots__ = []
@@ -19,7 +19,7 @@ class TrigEFElectronMuonAngleFex ( TrigEFElectronMuonAngleFexAlgo ):
         self.MaxDRCut=99.0
         self.MaxDPhiCut=99.0
 
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineFexMonitoring(), TrigEFElectronMuonAngleValidationFexMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineFexMonitoring(), mon.TrigEFElectronMuonAngleValidationFexMonitoring_emutopo() ]
   
 # new cuts as presented at TGM on April 20
 class TrigEFElectronMuonAngleHypo_tight ( TrigEFElectronMuonAngleHypo ):
@@ -40,7 +40,7 @@ class TrigEFElectronMuonAngleHypo_tight ( TrigEFElectronMuonAngleHypo ):
         self.MaxDPhiCut=1.5
 
         
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
   
 class TrigEFElectronMuonAngleHypo_medium ( TrigEFElectronMuonAngleHypo ):
     __slots__ = []
@@ -60,7 +60,7 @@ class TrigEFElectronMuonAngleHypo_medium ( TrigEFElectronMuonAngleHypo ):
         self.MaxDPhiCut=1.5
 
         
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
 
 class TrigEFElectronMuonAngleHypo_loose ( TrigEFElectronMuonAngleHypo ):
     __slots__ = []
@@ -80,7 +80,7 @@ class TrigEFElectronMuonAngleHypo_loose ( TrigEFElectronMuonAngleHypo ):
         self.MaxDPhiCut=1.5
 
         
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
 
 #algorithms configured in TriggerMenuPython - to prevent athena crash in the transition period  
    
@@ -102,7 +102,7 @@ class TrigEFElectronMuonAngleHypo_e5mu4 ( TrigEFElectronMuonAngleHypo ):
         self.MaxDPhiCut=1.5
 
         
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
 
 class TrigEFElectronMuonAngleHypo_e5mu4_medium ( TrigEFElectronMuonAngleHypo ):
     __slots__ = []
@@ -122,7 +122,7 @@ class TrigEFElectronMuonAngleHypo_e5mu4_medium ( TrigEFElectronMuonAngleHypo ):
         self.MaxDPhiCut=1.5
 
         
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
 
 class TrigEFElectronMuonAngleHypo_bXemu ( TrigEFElectronMuonAngleHypo ):
     __slots__ = []
@@ -142,4 +142,4 @@ class TrigEFElectronMuonAngleHypo_bXemu ( TrigEFElectronMuonAngleHypo ):
         self.MinDRCut=0.
         self.MaxDPhiCut=1.5
 
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoMonitoring.py
index 14e691f357f0..0b706060d76e 100644
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFElectronMuonAngleHypoMonitoring.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 from AthenaCommon.SystemOfUnits import GeV
@@ -7,7 +7,7 @@ cuts=['Input','Has EmuTopoInfo','Opposite Charge','Common Vertex','dPhi','dR','m
 
 labelsDescription = ''
 for c in cuts:
-	labelsDescription += c+':'
+    labelsDescription += c+':'
 
 
 class TrigEFElectronMuonAngleOnlineFexMonitoring(TrigGenericMonitoringToolConfig):
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFPhotonMuonAngleHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFPhotonMuonAngleHypoConfig.py
index 5dc1f99eb662..19fcd8759618 100755
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFPhotonMuonAngleHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigEFPhotonMuonAngleHypoConfig.py
@@ -1,15 +1,15 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigEgammaMuonCombHypo.TrigEgammaMuonCombHypoConf import TrigEFPhotonMuonAngleFexAlgo, TrigEFElectronMuonAngleHypo
 from AthenaCommon.SystemOfUnits import GeV
-from TrigEgammaMuonCombHypo.TrigEFElectronMuonAngleHypoMonitoring import *
+import TrigEgammaMuonCombHypo.TrigEFElectronMuonAngleHypoMonitoring as mon
 
 class TrigEFPhotonMuonAngleFex ( TrigEFPhotonMuonAngleFexAlgo ):
     __slots__ = []
     def __init__(self, name="TrigEFPhotonMuonAngleFex"):
         super(TrigEFPhotonMuonAngleFex, self).__init__(name)
 
-        self.AthenaMonTools = [ TrigEFPhotonMuonAngleOnlineMonitoring() ] 
+        self.AthenaMonTools = [ mon.TrigEFPhotonMuonAngleOnlineMonitoring() ]
   
   
 class TrigEFPhotonMuonAngleHypo_tau ( TrigEFElectronMuonAngleHypo ):
@@ -30,4 +30,4 @@ class TrigEFPhotonMuonAngleHypo_tau ( TrigEFElectronMuonAngleHypo ):
         self.MinDRCut=0.
         self.MaxDPhiCut=1.5
 
-        self.AthenaMonTools = [ TrigEFElectronMuonAngleOnlineHypoMonitoring(), TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigEFElectronMuonAngleOnlineHypoMonitoring(), mon.TrigEFElectronMuonAngleValidationHypoMonitoring_emutopo() ]
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoConfig.py
index 95c662ad7fe2..3eab34f8069e 100755
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoConfig.py
@@ -1,8 +1,8 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigEgammaMuonCombHypo.TrigEgammaMuonCombHypoConf import TrigL2ElectronMuonAngleFexAlgo, TrigL2ElectronMuonAngleHypo
 from AthenaCommon.SystemOfUnits import GeV
-from TrigEgammaMuonCombHypo.TrigL2ElectronMuonAngleHypoMonitoring import *
+import TrigEgammaMuonCombHypo.TrigL2ElectronMuonAngleHypoMonitoring as mon
 
 class TrigL2ElectronMuonAngleFex ( TrigL2ElectronMuonAngleFexAlgo ):
     __slots__ = []
@@ -20,7 +20,7 @@ class TrigL2ElectronMuonAngleFex ( TrigL2ElectronMuonAngleFexAlgo ):
         self.LowerMassCut=0.0*GeV
         self.UpperMassCut=999.0*GeV
 
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
 
 # new cuts as presented at TGM on April 20
 class TrigL2ElectronMuonAngleHypo_tight (TrigL2ElectronMuonAngleHypo ):  # tight selection
@@ -46,7 +46,7 @@ class TrigL2ElectronMuonAngleHypo_tight (TrigL2ElectronMuonAngleHypo ):  # tight
         self.LowerMassCut=1.5*GeV
         self.UpperMassCut=10.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
         
 class TrigL2ElectronMuonAngleHypo_medium (TrigL2ElectronMuonAngleHypo ):  # medium selection
     __slots__ = []
@@ -71,7 +71,7 @@ class TrigL2ElectronMuonAngleHypo_medium (TrigL2ElectronMuonAngleHypo ):  # medi
         self.LowerMassCut=1.5*GeV
         self.UpperMassCut=10.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
 
 class TrigL2ElectronMuonAngleHypo_loose (TrigL2ElectronMuonAngleHypo ):  # loose selection
     __slots__ = []
@@ -96,7 +96,7 @@ class TrigL2ElectronMuonAngleHypo_loose (TrigL2ElectronMuonAngleHypo ):  # loose
         self.LowerMassCut=1.0*GeV
         self.UpperMassCut=20.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
 
 #algorithms configured in TriggerMenuPython - to prevent athena crash in the transition period  
 
@@ -124,7 +124,7 @@ class TrigL2ElectronMuonAngleHypo_e5mu4 (TrigL2ElectronMuonAngleHypo ):  # tight
         self.LowerMassCut=1.5*GeV
         self.UpperMassCut=10.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
         
 class TrigL2ElectronMuonAngleHypo_e5mu4_medium (TrigL2ElectronMuonAngleHypo ):  # medium selection
     __slots__ = []
@@ -149,5 +149,4 @@ class TrigL2ElectronMuonAngleHypo_e5mu4_medium (TrigL2ElectronMuonAngleHypo ):
         self.LowerMassCut=1.5*GeV
         self.UpperMassCut=10.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(), TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ] 
-        
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoMonitoring.py
index 8a41e7377841..9f94694cc3e2 100644
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2ElectronMuonAngleHypoMonitoring.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
 from AthenaCommon.SystemOfUnits import GeV
@@ -7,8 +7,7 @@ cuts=['Input','Has EmuTopoInfo','Opposite Charge','Common Vertex','dPhi','dR','m
 
 labelsDescription = ''
 for c in cuts:
-	labelsDescription += c+':'
-	
+    labelsDescription += c+':'
 
 
 class TrigL2ElectronMuonAngleOnlineMonitoring(TrigGenericMonitoringToolConfig):
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2PhotonMuonAngleHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2PhotonMuonAngleHypoConfig.py
index 286877dbd0fc..3a2117c08129 100755
--- a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2PhotonMuonAngleHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/python/TrigL2PhotonMuonAngleHypoConfig.py
@@ -1,15 +1,15 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigEgammaMuonCombHypo.TrigEgammaMuonCombHypoConf import TrigL2PhotonMuonAngleFexAlgo, TrigL2ElectronMuonAngleHypo
 from AthenaCommon.SystemOfUnits import GeV
-from TrigEgammaMuonCombHypo.TrigL2ElectronMuonAngleHypoMonitoring import *
+import TrigEgammaMuonCombHypo.TrigL2ElectronMuonAngleHypoMonitoring as mon
 
 class TrigL2PhotonMuonAngleFex ( TrigL2PhotonMuonAngleFexAlgo ):
     __slots__ = []
     def __init__(self, name="TrigL2PhotonMuonAngleFex"):
         super(TrigL2PhotonMuonAngleFex, self).__init__(name)
         
-        self.AthenaMonTools = [ TrigL2PhotonMuonAngleOnlineMonitoring(), TrigL2PhotonMuonAngleValidationMonitoring() ] 
+        self.AthenaMonTools = [ mon.TrigL2PhotonMuonAngleOnlineMonitoring(), mon.TrigL2PhotonMuonAngleValidationMonitoring() ]
 
 # new cuts as presented at TGM on April 20
 class TrigL2PhotonMuonAngleHypo_tau (TrigL2ElectronMuonAngleHypo ):  # tight selection
@@ -34,4 +34,4 @@ class TrigL2PhotonMuonAngleHypo_tau (TrigL2ElectronMuonAngleHypo ):  # tight sel
         self.LowerMassCut=0.*GeV
         self.UpperMassCut=6.0*GeV
         
-        self.AthenaMonTools = [ TrigL2ElectronMuonAngleOnlineMonitoring(),TrigL2ElectronMuonAngleValidationMonitoring_emutopo()  ] 
+        self.AthenaMonTools = [ mon.TrigL2ElectronMuonAngleOnlineMonitoring(), mon.TrigL2ElectronMuonAngleValidationMonitoring_emutopo() ]
-- 
GitLab


From 863b207df7912ba2b48d472f8d139f3f53b2c01f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 15:04:17 +0200
Subject: [PATCH 125/217] TrigStreamerHypo: Cleanup cmake configuration

---
 .../TrigStreamerHypo/CMakeLists.txt           | 26 +++----------------
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigStreamerHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigStreamerHypo/CMakeLists.txt
index 17934a6237b4..5725d3f4a13e 100644
--- a/Trigger/TrigHypothesis/TrigStreamerHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigStreamerHypo/CMakeLists.txt
@@ -1,37 +1,17 @@
-################################################################################
-# Package: TrigStreamerHypo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigStreamerHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          PRIVATE
-                          GaudiKernel
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils)
-
-# External dependencies:
-find_package( CLHEP )
-
 # Component(s) in the package:
 atlas_add_component( TrigStreamerHypo
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} TrigInterfacesLib TrigTimeAlgsLib GaudiKernel DecisionHandlingLib TrigCompositeUtilsLib )
+                     LINK_LIBRARIES AsgTools AthenaBaseComps DecisionHandlingLib GaudiKernel TrigCompositeUtilsLib )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
 
 # Unit tests:
 atlas_add_test( TrigStreamerHypoConfigMT SCRIPT python -m TrigStreamerHypo.TrigStreamerHypoConfigMT
                 PROPERTIES TIMEOUT 300
 		        POST_EXEC_SCRIPT nopost.sh )
-
-# Check Python syntax:
-atlas_add_test( flake8
-   SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python
-   POST_EXEC_SCRIPT nopost.sh )
-- 
GitLab


From 5e962f2af9bc9c3153f49af08bdb30572c012a86 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 16:05:32 +0200
Subject: [PATCH 126/217] TrigHypoCommonTools: Delete package

Delete package that only contains `L1InfoHypo` which was used in the
Run-2 cosmics menu. It's still referenced in TriggerMenu but the code is
not being executed as there are no cosmic signatures in the only
supported Physics_pp_v7_primaries menu.
---
 .../TrigHypoCommonTools/CMakeLists.txt        |  35 ----
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 -
 .../TrigHypoCommonTools/L1InfoHypo.hxx        |  69 -------
 .../TrigHypoCommonTools/src/L1InfoHypo.cxx    | 170 ------------------
 .../TrigHypoCommonTools_entries.cxx           |   5 -
 5 files changed, 280 deletions(-)
 delete mode 100644 Trigger/TrigHypothesis/TrigHypoCommonTools/CMakeLists.txt
 delete mode 100644 Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
 delete mode 100755 Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
 delete mode 100755 Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHypoCommonTools/src/components/TrigHypoCommonTools_entries.cxx

diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/CMakeLists.txt b/Trigger/TrigHypothesis/TrigHypoCommonTools/CMakeLists.txt
deleted file mode 100644
index 129fc53689ea..000000000000
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-# Package: TrigHypoCommonTools
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigHypoCommonTools )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Event/ByteStreamCnvSvcBase
-                          Trigger/TrigConfiguration/TrigConfInterfaces
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigSteer/TrigSteering
-                          PRIVATE
-                          DetectorDescription/RegionSelector
-                          Event/EventInfo
-                          GaudiKernel
-                          Tools/PathResolver
-                          Trigger/TrigT1/TrigT1Result )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
-# Component(s) in the package:
-atlas_add_component( TrigHypoCommonTools
-                     src/*.cxx
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ByteStreamCnvSvcBaseLib TrigInDetEvent TrigSteeringEvent TrigInterfacesLib TrigSteeringLib RegionSelectorLib EventInfo GaudiKernel PathResolver TrigT1Result )
-
-# Install files from the package:
-atlas_install_headers( TrigHypoCommonTools )
-
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
deleted file mode 100644
index 91498c164bb1..000000000000
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
+++ /dev/null
@@ -1 +0,0 @@
-Trigger/TrigHypothesis/TrigHypoCommonTools
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
deleted file mode 100755
index 9936bbd30c89..000000000000
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef TRIGHYPOCOMMONTOOLS_L1INFOHYPO_HXX
-#define TRIGHYPOCOMMONTOOLS_L1INFOHYPO_HXX
-/*
-  L1InfoHypo
-*/
-#include <string>
-#include <vector>
-#include <set>
-#include "GaudiKernel/Algorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-
-#include "TrigInterfaces/HypoAlgo.h"
-#include "TrigInterfaces/IMonitoredAlgo.h"
-
-#include "ByteStreamCnvSvcBase/ROBDataProviderSvc.h"
-
-#include "TrigSteeringEvent/Enums.h"
-#include "TrigSteering/LvlConverter.h"
-#include "TrigConfInterfaces/ILVL1ConfigSvc.h"
-
-namespace HLT 
-{
-  class ILvl1ResultAccessTool;
-  class Chain;
-}
-
-class L1InfoHypo : public HLT::HypoAlgo {
-public:
-  L1InfoHypo(const std::string& name, ISvcLocator* svc);
-  ~L1InfoHypo();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE,bool &Pass);
-  HLT::ErrorCode hltFinalize();
-
-
-protected:
-  // Flow of the algorithm
-
-protected:
-
-  // JobOption properties
-
-  bool m_alwaysPass;
-  bool m_invertSelection;
-  bool m_invertBitMaskSelection;
-  bool m_invertL1ItemNameSelection;
-  bool m_useBeforePrescaleBit;
-  std::vector<std::string> m_L1ItemNames;
-
-  unsigned int m_triggerTypeBitMask;
-  unsigned int m_L1TriggerBitMask;
-
-  unsigned int m_triggerTypeBit;
-  unsigned int m_L1TriggerBit;
-
-  // Output object
-
-  // Internal data structures used by this algorithm
-
-  // Monitored Quantities
-
-
-private:
-  ToolHandle<HLT::ILvl1ResultAccessTool> m_lvl1Tool;
-};
-
-#endif // TRIGHYPOCOMMONTOOLS_L1INFOHYPO_HXX
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
deleted file mode 100755
index b6f8e0fca95f..000000000000
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
-  L1InfoHypo.cxx
-*/
-#include <cmath>
-#include "TrigHypoCommonTools/L1InfoHypo.hxx"
-
-#include <EventInfo/EventID.h>
-#include "EventInfo/TriggerInfo.h"
-#include "EventInfo/EventInfo.h"
-
-#include "PathResolver/PathResolver.h"
-#include "GaudiKernel/ITHistSvc.h"
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-#include "TrigSteering/Lvl1ItemsAndRoIs.h"
-#include "TrigT1Result/RoIBResult.h"
-#include "TrigSteeringEvent/Lvl1Result.h"
-#include "TrigSteering/Lvl1ResultAccessTool.h"
-
-using namespace std;
-
-L1InfoHypo::L1InfoHypo(const std::string& name, ISvcLocator* svc) 
-  : HLT::HypoAlgo(name, svc),
-    m_lvl1Tool("HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool",this)
-{
-  declareProperty("AlwaysPass",m_alwaysPass=false);
-  declareProperty("InvertSelection",m_invertSelection=false);
-
-  declareProperty("L1ItemNames",m_L1ItemNames);
-  declareProperty("InvertL1ItemNameSelection",m_invertL1ItemNameSelection=false);
-  declareProperty("UseBeforePrescaleBit",     m_useBeforePrescaleBit=false);
-
-  declareProperty("TriggerTypeBitMask"                       ,m_triggerTypeBitMask=0x80);
-  declareProperty("L1TriggerBitMask"                         ,m_L1TriggerBitMask=0);
-
-  declareProperty("TriggerTypeBit"                       ,m_triggerTypeBit=0x80);
-  declareProperty("L1TriggerBit"                         ,m_L1TriggerBit=0);
-  declareProperty("InvertBitMaskSelection",m_invertBitMaskSelection=false);
-
-  declareProperty("Lvl1ResultAccessToool",m_lvl1Tool,"tool to access lvl1 result");
-}
-
-L1InfoHypo::~L1InfoHypo() {
-}
-
-HLT::ErrorCode L1InfoHypo::hltInitialize() 
-{
-  msg() << MSG::DEBUG << "initialize()" << endmsg;
-  
-  msg() << MSG::INFO << "Parameters for L1InfoHypo:" << name() << endmsg;
-  msg() << MSG::INFO << "AlwaysPass                  : " << m_alwaysPass                    << endmsg;
-  msg() << MSG::INFO << "InvertSelection             : " << m_invertSelection               << endmsg;
-  msg() << MSG::INFO << "L1ItemNames                 : " << m_L1ItemNames                   << endmsg;
-  msg() << MSG::INFO << "InvertL1ItemNameSelection   : " << m_invertL1ItemNameSelection     << endmsg;
-  msg() << MSG::INFO << "TriggerTypeBitMask          : " << m_triggerTypeBitMask            << endmsg;
-  msg() << MSG::INFO << "L1TriggerBitMask            : " << m_L1TriggerBitMask              << endmsg;
-  msg() << MSG::INFO << "TriggerTypeBit              : " << m_triggerTypeBit                << endmsg;
-  msg() << MSG::INFO << "L1TriggerBit                : " << m_L1TriggerBit                  << endmsg;
-  msg() << MSG::INFO << "InvertBitMasksSelection     : " << m_invertBitMaskSelection        << endmsg;
-
-
-  if ( m_lvl1Tool.retrieve().isFailure()) 
-    {
-      msg() << MSG::FATAL << "Unable to retrieve lvl1 result access tool: " << m_lvl1Tool << endmsg;
-      return HLT::FATAL;
-    }
-
-  StatusCode sc = m_lvl1Tool->updateConfig(true,true,true);
-  if ( sc.isFailure() ) 
-    {
-      (msg()) << MSG::FATAL << "Unable to configure tool!" << endmsg;
-      return HLT::FATAL;
-    }
-
-  msg() << MSG::DEBUG << "initialize success" << endmsg;
-
-  return HLT::OK;
-}
-
-HLT::ErrorCode L1InfoHypo::hltFinalize() 
-{
-  msg() << MSG::DEBUG << "finalize()" << endmsg;
-
-  return HLT::OK;
-}
-
-HLT::ErrorCode L1InfoHypo::hltExecute(const HLT::TriggerElement* /*unused*/,bool &Pass) 
-{
-
-  Pass=true;
-  bool ItemPass=false;
-
-  int output_level = msgSvc()->outputLevel(name());
-  if (output_level <= MSG::VERBOSE) msg() << MSG::VERBOSE << "execL1InfoHypo"  << endmsg;
-  const EventInfo* constEventInfo(0);
-
-  if (m_alwaysPass) {Pass=true; return HLT::OK; };
-
-  StatusCode sc =  evtStore()->retrieve(constEventInfo);
-
-  if(sc.isFailure())
-    {
-      if(output_level <= MSG::FATAL)
-	msg() << MSG::FATAL << "Can't get EventInfo object"  << endmsg;
-      return HLT::BAD_JOB_SETUP;
-    }
-  else
-    {
-      if (m_L1ItemNames.size())
-	{
-	  const ROIB::RoIBResult* result;
-	  sc = evtStore()->retrieve(result);
-	  
-	  if(sc.isFailure())
-	    {
-	      msg() << MSG::WARNING
-		  << "Unable to retrieve RoIBResult from storeGate!"
-		  << endmsg;
-	      return HLT::NO_LVL1_RESULT;
-	    }
-	  std::vector<const LVL1CTP::Lvl1Item*> items = m_lvl1Tool->createL1Items(*result);
-	  for (std::vector<const LVL1CTP::Lvl1Item*>::const_iterator item = items.begin(); item != items.end(); ++item) 
-	    {
-	      if(m_useBeforePrescaleBit) {
-		if(!(*item)->isPassedBeforePrescale())
-		  continue;
-	      }
-	      else {
-		if(!(*item)->isPassedAfterVeto())
-		  continue;
-	      }
-
-	      msg() << MSG::DEBUG << "Found active LVL1 item " << (*item)->name() << " ("
-		  << (*item)->hashId() << ")" << endmsg;
-	      for (int unsigned i=0;i<m_L1ItemNames.size();i++)
-		{
-		  msg() << MSG::DEBUG << "Comparing " << 
-		    (*item)->name() << " to [L1_]" <<
-		    m_L1ItemNames[i] << " result: " << 
-		    ( ((*item)->name()==m_L1ItemNames[i]) or ((*item)->name()=="L1_"+m_L1ItemNames[i]) ) << endmsg;
-		  ItemPass=ItemPass or ((*item)->name()==m_L1ItemNames[i]) or ((*item)->name()=="L1_"+m_L1ItemNames[i]);
-		};
-	    }
-
-	  if (m_invertL1ItemNameSelection) ItemPass=(ItemPass)?0:1;
-	}
-      else
-	ItemPass=true;
-
-      const TriggerInfo* tinfo = constEventInfo->trigger_info();
-      TriggerInfo::number_type L1TriggerType=tinfo->level1TriggerType();
-      TriggerInfo::number_type L1ID=tinfo->extendedLevel1ID();
-      
-      //printf("L1 Info: %x %x\n",L1TriggerType,L1ID);
-      msg() << MSG::DEBUG << "L1 Info: " << hex << L1TriggerType << " " << L1ID << endmsg;
-      bool PassBM=
-	((L1TriggerType & m_triggerTypeBitMask)==m_triggerTypeBit||(m_triggerTypeBitMask==0))&&
-	((L1ID          & m_L1TriggerBitMask  )==m_L1TriggerBit    ||(m_L1TriggerBitMask  ==0));
-      if (m_invertBitMaskSelection) PassBM=(PassBM)?0:1;
-      Pass = Pass and PassBM and ItemPass;
-    }
-
-  if (m_invertSelection) Pass=(Pass)?0:1;
-  
-  return HLT::OK;
-}
-
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/components/TrigHypoCommonTools_entries.cxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/components/TrigHypoCommonTools_entries.cxx
deleted file mode 100644
index 5f34d06c56a2..000000000000
--- a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/components/TrigHypoCommonTools_entries.cxx
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "TrigHypoCommonTools/L1InfoHypo.hxx"
-
-
-DECLARE_COMPONENT( L1InfoHypo )
-
-- 
GitLab


From fb93b7657a84d9477f9c0fb3a41c44d9878ea159 Mon Sep 17 00:00:00 2001
From: Semen Turchikhin <semen.turchikhin@cern.ch>
Date: Wed, 8 Jul 2020 16:24:50 +0200
Subject: [PATCH 127/217] Update legacy monitoring for B-physics trigger

* Replace the monitored container name (according to fixes in !31872)
* Replace 2mu10 monitored chains with 2mu4 ones to get some stats in ART
---
 .../TrigBphysMonitoring/python/TrigBphysMonitCategory.py   | 7 ++++---
 .../python/TrigBphysMonitoringConfig.py                    | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
index 6daa1e35b068..7c879286c968 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitCategory.py
@@ -41,11 +41,12 @@ primary_bphys = [
 
 if TriggerFlags.EDMDecodingVersion == 3 :
   monitoring_bphys = [
-                      'HLT_2mu10_bJpsimumu_L12MU10',
-                      'HLT_2mu10_bUpsimumu_L12MU10',
+                      'HLT_2mu4_bJpsimumu_L12MU4',
+                      'HLT_2mu4_bUpsimumu_L12MU4',
+                      'HLT_2mu4_bDimu_L12MU4',
                      ]
   primary_bphys = [
-                    'HLT_2mu10_bJpsimumu_L12MU10',
+                    'HLT_2mu4_bDimu_L12MU4',
                   ]
 
 primary_bphys_pp = primary_bphys
diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
index eba557b39551..ce32dfcc1df4 100644
--- a/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/python/TrigBphysMonitoringConfig.py
@@ -19,7 +19,7 @@ containers = [
               ]
 if TriggerFlags.EDMDecodingVersion == 3 :
   # will add the MT version of TrigBphys containers once they are available in EDM
-  containers = [ "TrigBphysDimu", "TrigBphysEFDimu" ]
+  containers = [ "HLT_DimuEF" ]
   
 DetailedChains = {
                   "BMuMu"  : 'HLT_(2mu[0-9]+|mu[0-9]+_?mu[0-9]+)_(bDimu|bJpsimumu)(_L1[0-9]?MU[0-9]+)?',
-- 
GitLab


From 0c2c3411390d1284a486ceb0a9d52177971d635b Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 8 Jul 2020 16:32:53 +0200
Subject: [PATCH 128/217] Rationalised the build setup of
 TrigInDetAnalysisUtils a bit.

Reduced the list of used ROOT libraries a bit, and removed the library's
dependency on StoreGate.
---
 .../TrigInDetAnalysisUtils/CMakeLists.txt     | 45 +++-------
 .../TrigInDetAnalysisUtils/T_AnalysisConfig.h | 90 +++++++++----------
 2 files changed, 52 insertions(+), 83 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/CMakeLists.txt b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/CMakeLists.txt
index 8137f81113fc..e5e58b3127f2 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/CMakeLists.txt
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/CMakeLists.txt
@@ -1,43 +1,18 @@
-################################################################################
-# Package: TrigInDetAnalysisUtils
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetAnalysisUtils )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/StoreGate
-                          GaudiKernel
-                          PhysicsAnalysis/TruthParticleID/McParticleEvent
-                          Reconstruction/Particle
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/egamma/egammaEvent
-                          Reconstruction/tauEvent
-			  Event/xAOD/xAODMuon
-			  Event/xAOD/xAODEgamma
-			  Event/xAOD/xAODTau
-			  Event/xAOD/xAODTruth
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          Tracking/TrkExtrapolation/TrkExUtils
-                          Tracking/TrkTools/TrkParticleCreator
-                          Tracking/TrkTools/TrkToolInterfaces
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigAnalysis/TrigInDetAnalysis
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTruthEvent/TrigInDetTruthEvent 
-                          Generators/AtlasHepMC )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( ROOT COMPONENTS Core MathCore )
 
 # Component(s) in the package:
 atlas_add_library( TrigInDetAnalysisUtils
-                   src/*.cxx
-                   PUBLIC_HEADERS TrigInDetAnalysisUtils
-                   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} 
-                   LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib GaudiKernel McParticleEvent muonEvent Particle egammaEvent tauEvent TrkParameters TrkTrack TrkTrackSummary TrkExUtils TrkToolInterfaces TrigInDetAnalysis TrigInDetEvent TrigSteeringEvent TrigInDetTruthEvent StoreGateLib SGtests TrigDecisionToolLib )
-
+   TrigInDetAnalysisUtils/*.h src/*.cxx
+   PUBLIC_HEADERS TrigInDetAnalysisUtils
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel McParticleEvent Particle
+   muonEvent egammaEvent tauEvent xAODMuon xAODEgamma xAODTau xAODTruth
+   TrkParameters TrkTrack TrkToolInterfaces TrigDecisionToolLib
+   TrigInDetAnalysis TrigInDetEvent TrigSteeringEvent TrigInDetTruthEvent
+   AtlasHepMCLib )
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h
index 6b20b7cd5da9..69ec81e65114 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h
@@ -3,9 +3,9 @@
  **     @file    T_AnalysisConfig.h
  **
  **     @author  mark sutton
- **     @date    Fri 11 Jan 2019 07:06:39 CET 
+ **     @date    Fri 11 Jan 2019 07:06:39 CET
  **
- **     Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ **     Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  **/
 
 
@@ -18,10 +18,8 @@
 #include <map>
 
 #include "GaudiKernel/IToolSvc.h"
-#include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/ITHistSvc.h"
 // #include "GaudiKernel/AlgFactory.h"
-#include "StoreGate/StoreGateSvc.h"
 
 #include "TrigDecisionTool/TrigDecisionTool.h"
 
@@ -50,7 +48,6 @@
 #endif
 
 class MsgSvc;
-class StoreGateSvc;
 
 // class TrackAssociator;
 // class Converter;
@@ -220,7 +217,7 @@ public:
   void addSelectionFilter(TrackFilter* filter) { m_filters[2].push_back(filter); }
 
   // Initialize, execute and finalize generic methods
-  virtual void initialize(Provider* p, ToolHandle<Trig::TrigDecisionTool>* tdt ) { 
+  virtual void initialize(Provider* p, ToolHandle<Trig::TrigDecisionTool>* tdt ) {
       m_provider = p;
       m_tdt      = tdt;
       if ( m_tdt==0 ) m_analysis->initialise();
@@ -282,18 +279,18 @@ public:
 
   void keepAllEvents( bool b ) { m_keepAllEvents = b; }
 
-  void setUseHighestPT( bool b )    { m_useHighestPT=b; } 
-  bool getUseHighestPT()      const { return m_useHighestPT; } 
+  void setUseHighestPT( bool b )    { m_useHighestPT=b; }
+  bool getUseHighestPT()      const { return m_useHighestPT; }
 
-  void setVtxIndex( int i )    { m_vtxIndex=i; } 
-  int  getVtxIndex()     const { return m_vtxIndex; } 
+  void setVtxIndex( int i )    { m_vtxIndex=i; }
+  int  getVtxIndex()     const { return m_vtxIndex; }
 
   bool filterOnRoi()          const { return m_filterOnRoi; }
   bool setFilterOnRoi(bool b)       { return m_filterOnRoi=b; }
 
-  void setRequireDecision(bool b) { m_requireDecision=b; } 
-  bool requireDecision() const    { return m_requireDecision; } 
-  
+  void setRequireDecision(bool b) { m_requireDecision=b; }
+  bool requireDecision() const    { return m_requireDecision; }
+
 protected:
 
   virtual void loop() = 0;
@@ -310,8 +307,8 @@ protected:
     /// until it has been properly debugged, then it can be removed
     //    std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
 
-    /// will not use the te name here, but keep it on just the                                                                                       
-    /// same for the time being, for subsequent development                                                                                          
+    /// will not use the te name here, but keep it on just the
+    /// same for the time being, for subsequent development
     std::string key_collection = key;
     std::string key_tename     = "";
     size_t pos = key_collection.find("/");
@@ -333,18 +330,18 @@ protected:
 
 
   template<class Collection>
-  bool selectTracks( TrigTrackSelector* selector, 
-		     //		     const TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> roi_link,  
+  bool selectTracks( TrigTrackSelector* selector,
+		     //		     const TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> roi_link,
 		     const ElementLink<TrigRoiDescriptorCollection>& roi_link,
 		     const std::string& key="" )  {
 
 
-    /// will need this printout for debugging the feature access, so leave this commented 
+    /// will need this printout for debugging the feature access, so leave this commented
     /// until it has been properly debugged, then it can be removed
     //    std::cout << "try " << key << "\t" << m_provider->evtStore()->template transientContains<Collection>(key) << std::endl;
 
-    /// will not use the te name here, but keep it on just the 
-    /// same for the time being, for subsequent development 
+    /// will not use the te name here, but keep it on just the
+    /// same for the time being, for subsequent development
     std::string key_collection = key;
     std::string key_tename     = "";
     size_t pos = key_collection.find("/");
@@ -353,13 +350,13 @@ protected:
       key_tename     = key.substr( 0, pos );
     }
 
-    std::pair< typename Collection::const_iterator, 
+    std::pair< typename Collection::const_iterator,
 	       typename Collection::const_iterator > itrpair;
 
     SG::ReadHandle<Collection> handle(key);
 
     itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
-                      
+
     if ( itrpair.first != itrpair.second ) {
       selector->selectTracks( itrpair.first, itrpair.second );
       return true;
@@ -522,14 +519,14 @@ protected:
     std::vector< Trig::Feature<Collection> >  trackcollections = citr->get<Collection>( key, TrigDefs::alsoDeactivateTEs );
     std::vector<double> v;
     if ( !trackcollections.empty() ) {
-      // NB!! a combination should never have more than one entry for a track collection from a single algorithm,                                                                                                     
-      //   if ( trackcollections.size()>1 ) std::cerr << "SUTT OH NO!!!!!!!!" << endmsg;                                                                                                                              
+      // NB!! a combination should never have more than one entry for a track collection from a single algorithm,
+      //   if ( trackcollections.size()>1 ) std::cerr << "SUTT OH NO!!!!!!!!" << endmsg;
       for ( unsigned ifeat=0 ; ifeat<trackcollections.size() ; ifeat++ ) {
-        //      std::cout << "selectTracks() ifeat=" << ifeat << "\tkey " << key << std::endl;                                                                                                                        
+        //      std::cout << "selectTracks() ifeat=" << ifeat << "\tkey " << key << std::endl;
 	Trig::Feature<Collection> trackfeature = trackcollections.at(ifeat);
         if ( !trackfeature.empty() ) {
-          //      m_provider->msg(MSG::DEBUG) << "TDT TrackFeature->size() " << trackfeature.cptr()->size() << " (" << key << ")" << endmsg;                                                                          
-          // actually select the tracks from this roi at last!!                                                                                                                                                       
+          //      m_provider->msg(MSG::DEBUG) << "TDT TrackFeature->size() " << trackfeature.cptr()->size() << " (" << key << ")" << endmsg;
+          // actually select the tracks from this roi at last!!
           const Collection* trigtracks = trackfeature.cptr();
 
 	  typename Collection::const_iterator  trackitr = trigtracks->begin();
@@ -560,8 +557,8 @@ protected:
   ////////////////////////////////////////////////////////////////////////////////////////////
   unsigned processElectrons( TrigTrackSelector& selectorRef,
 			     std::vector<TrackTrigObject>* elevec=0,
-			     const unsigned int selection=0, 
-			     bool   raw_track=false,  
+			     const unsigned int selection=0,
+			     bool   raw_track=false,
 			     double ETOffline=0,
 #                            ifdef XAODTRACKING_TRACKPARTICLE_H
 			     const std::string& containerName = "Electrons"
@@ -582,12 +579,12 @@ protected:
 
 
     const Container* container = 0;
-    
+
     if( ! m_provider->evtStore()->template contains<Container>(containerName) ) {
       m_provider->msg(MSG::WARNING) << "Error No Electron Container " << containerName << " !" << endmsg;
       return 0;
     }
-    
+
     StatusCode sc=m_provider->evtStore()->retrieve( container, containerName);
     if( sc.isFailure() || !container ) {
       m_provider->msg(MSG::WARNING) << "Error retrieving container: " << containerName << " !" << endmsg;
@@ -617,7 +614,7 @@ protected:
       good_electron = TIDA::isGoodOffline( *(*elec));
 #     endif
 
-      if (good_electron) { 
+      if (good_electron) {
 	const xAOD::Electron_v1& eleduff = *(*elec);
 	long unsigned   eleid  = (unsigned long)(&eleduff) ;
 	TrackTrigObject eleobj = TrackTrigObject( (*elec)->eta(),
@@ -626,13 +623,13 @@ protected:
 						  0,
 						  (*elec)->type(),
 						  eleid );
-	
+
 	bool trk_added ;
 	if ( raw_track ) trk_added = selectorRef.selectTrack( xAOD::EgammaHelpers::getOriginalTrackParticle( *elec ) );
 	else             trk_added = selectorRef.selectTrack( (*elec)->trackParticle() );
-	
+
 	if (trk_added) eleobj.addChild( selectorRef.tracks().back()->id() );
-	if (elevec)    elevec->push_back( eleobj ); 
+	if (elevec)    elevec->push_back( eleobj );
       }
     }
 
@@ -644,7 +641,7 @@ protected:
   ////////////////////////////////////////////////////////////////////////////////////////////
   /// select offlinqe muons
   ////////////////////////////////////////////////////////////////////////////////////////////
-  unsigned processMuons(     TrigTrackSelector& selectorRef,  const unsigned int selection=0, 
+  unsigned processMuons(     TrigTrackSelector& selectorRef,  const unsigned int selection=0,
 			     double ETOffline=0,
 #                            ifdef XAODTRACKING_TRACKPARTICLE_H
                              const std::string& containerName = "Muons"
@@ -712,9 +709,9 @@ unsigned processTaus( TrigTrackSelector& selectorRef,
 		      const std::string& containerName = "TauRecContainer"
 #                     endif
 			   ) {
-  
+
 # ifdef XAODTRACKING_TRACKPARTICLE_H
-  typedef xAOD::TauJetContainer     Container; 
+  typedef xAOD::TauJetContainer     Container;
 # else
   typedef Analysis::TauJetContainer Container;
 # endif
@@ -731,7 +728,7 @@ unsigned processTaus( TrigTrackSelector& selectorRef,
     m_provider->msg(MSG::WARNING) << " Offline taus not found" << endmsg;
     return 0;
   }
-  
+
 
   StatusCode sc = m_provider->evtStore()->retrieve( container, containerName);
   if (sc != StatusCode::SUCCESS) {
@@ -759,7 +756,7 @@ unsigned processTaus( TrigTrackSelector& selectorRef,
 #   endif
 
 #   else
-    unsigned N = (*tau)->numTrack(); 
+    unsigned N = (*tau)->numTrack();
 #   endif
 
 
@@ -770,8 +767,8 @@ unsigned processTaus( TrigTrackSelector& selectorRef,
     good_tau = TIDA::isGoodOffline( *(*tau), requireNtracks, EtCutOffline );
 #   endif
 
-    //   std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;  
-      
+    //   std::cout << "SUTT tau ntracks: " << N << "\tgoodtau: " << good_tau << "\tpt: " << (*tau)->p4().Et() << "\t3prong: " << doThreeProng << std::endl;
+
     if (good_tau){
       const xAOD::TauJet_v3& duff = *(*tau);
       long unsigned tauid = (unsigned long)(&duff) ;
@@ -781,10 +778,10 @@ unsigned processTaus( TrigTrackSelector& selectorRef,
 						0,
 						(*tau)->type(),
 						tauid );
-      
+
       bool trk_added;
       for ( unsigned i=N ; i-- ; )  {
-#       ifdef XAODTAU_TAUTRACK_H  
+#       ifdef XAODTAU_TAUTRACK_H
         trk_added = selectorRef.selectTrack((*tau)->track(i)->track());
 #       else
         trk_added = selectorRef.selectTrack((*tau)->track(i));
@@ -806,8 +803,6 @@ protected:
 
   Provider* m_provider;
 
-  //    MsgStream* m_msg;
-  //    StoreGateSvc* m_sg;
   ToolHandle<Trig::TrigDecisionTool>* m_tdt;
 
   // TrigInDetAnalysis tools
@@ -853,7 +848,7 @@ protected:
   bool                   m_keepAllEvents;
 
   bool                   m_useHighestPT;
-  
+
   int                    m_vtxIndex;
 
   bool                   m_filterOnRoi;
@@ -866,4 +861,3 @@ protected:
 
 
 #endif  // TrigInDetAnalysisUtils_T_AnalysisConfig_H
-
-- 
GitLab


From be5fc06bc485193f4d8e4d1b5b25e615ae317737 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 8 Jul 2020 16:34:19 +0200
Subject: [PATCH 129/217] Cleaned the build configuration of
 TrigInDetAnalysisUser.

Removed all the unnecessary dependencies from all the targets, to
make the build quite a bit more parallel. Also declared explicit
include directories for the shared libraries built by the package,
to avoid having to use the "global" include_directories(...) in the
package's configuration.
---
 .../TrigInDetAnalysisUser/CMakeLists.txt      | 161 ++++++++----------
 1 file changed, 75 insertions(+), 86 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/CMakeLists.txt b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/CMakeLists.txt
index 9784c8852928..9fd5e63a89fe 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/CMakeLists.txt
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/CMakeLists.txt
@@ -1,127 +1,116 @@
-################################################################################
-# Package: TrigInDetAnalysisUser
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetAnalysisUser )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Trigger/TrigAnalysis/TrigInDetAnalysis
-                          Trigger/TrigAnalysis/TrigInDetAnalysisExample
-                          Trigger/TrigAnalysis/TrigInDetAnalysisUtils )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Graf Gpad Cint Core Tree MathCore Hist RIO pthread )
-
-include_directories(Resplot/src Readcards/src)
+find_package( ROOT COMPONENTS Core Hist MathCore Graf Gpad RIO Tree )
 
-# Component(s) in the package:
+# Libraries in the package:
 atlas_add_root_dictionary( Resplot
-                           ResplotDictSource
-                           ROOT_HEADERS Resplot/src/Resplot.h
-                           EXTERNAL_PACKAGES ROOT )
+   ResplotDictSource
+   ROOT_HEADERS Resplot/src/Resplot.h
+   EXTERNAL_PACKAGES ROOT )
 
 atlas_add_library( Resplot
-                   Resplot/src/Resplot.cxx
-                   Resplot/src/generate.cxx
-                   Resplot/src/rmsFrac.cxx
-                   ${ResplotDictSource}
-                   NO_PUBLIC_HEADERS
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES TrigInDetAnalysisExampleLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisUtils )
+   Resplot/src/*.h Resplot/src/Resplot.cxx Resplot/src/generate.cxx
+   Resplot/src/rmsFrac.cxx ${ResplotDictSource}
+   NO_PUBLIC_HEADERS
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} )
+target_include_directories( Resplot PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Resplot/src> )
 
 atlas_add_library( Readcards
-                   Readcards/src/IReadCards.cxx
-                   Readcards/src/ReadCards.cxx
-                   Readcards/src/Value.cxx
-                   Readcards/src/utils.cxx
-                   NO_PUBLIC_HEADERS
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES TrigInDetAnalysisExampleLib Resplot
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisUtils )
+   Readcards/src/*.h Readcards/src/IReadCards.cxx Readcards/src/ReadCards.cxx
+   Readcards/src/Value.cxx Readcards/src/utils.cxx
+   NO_PUBLIC_HEADERS )
+target_include_directories( Readcards PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Readcards/src> )
 
 atlas_add_library( TIDA
-                   Analysis/src/ConfAnalysis.cxx
-                   Analysis/src/ConfVtxAnalysis.cxx
-                   Analysis/src/PurityAnalysis.cxx
-                   Analysis/src/globals.cxx
-                   NO_PUBLIC_HEADERS
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES TrigInDetAnalysisExampleLib Resplot Readcards
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisUtils )
+   Analysis/src/ConfAnalysis.h Analysis/src/ConfAnalysis.cxx
+   Analysis/src/ConfVtxAnalysis.h Analysis/src/ConfVtxAnalysis.cxx
+   Analysis/src/PurityAnalysis.h Analysis/src/PurityAnalysis.cxx
+   Analysis/src/globals.h Analysis/src/globals.cxx
+   NO_PUBLIC_HEADERS
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis
+   TrigInDetAnalysisExampleLib Resplot Readcards )
+target_include_directories( TIDA PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src> )
 
 atlas_add_library( TIDAcomputils
-                   Analysis/src/computils.cxx
-                   NO_PUBLIC_HEADERS
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES TrigInDetAnalysisExampleLib Resplot Readcards TIDA
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisUtils )
-
+   Analysis/src/computils.h Analysis/src/computils.cxx
+   NO_PUBLIC_HEADERS
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Readcards )
+target_include_directories( TIDAcomputils PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Analysis/src> )
+
+# Executables in the package:
 atlas_add_executable( TIDAreader
-                      Analysis/src/reader.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/reader.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Readcards )
 
 atlas_add_executable( TIDArdict
-                      Analysis/src/rmain.cxx
-                      Analysis/src/TagNProbe.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/rmain.cxx Analysis/src/TagNProbe.h Analysis/src/TagNProbe.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisUtils
+   TrigInDetAnalysisExampleLib Resplot Readcards TIDA TIDAcomputils )
 
 atlas_add_executable( TIDAcomparitor
-                      Analysis/src/comparitor.cxx
-                      Analysis/src/AtlasStyle.cxx
-                      Analysis/src/AtlasLabels.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/comparitor.cxx
+   Analysis/src/AtlasStyle.h Analysis/src/AtlasStyle.cxx
+   Analysis/src/AtlasLabels.h Analysis/src/AtlasLabels.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Resplot Readcards
+   TIDAcomputils )
 
 atlas_add_executable( TIDAcpucost
-                      Analysis/src/cpucost.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/cpucost.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} Readcards TIDAcomputils )
 
 atlas_add_executable( TIDAchains
-                      Analysis/src/chains.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/chains.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_executable( TIDAskim
-                      Analysis/src/skim.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/skim.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Readcards )
 
 atlas_add_executable( TIDAfastadd
-                      Analysis/src/fastadd.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/fastadd.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_executable( TIDArefit
-                      Analysis/src/refit.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/refit.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Resplot )
 
 atlas_add_executable( TIDAlistroot
-                      Analysis/src/listroot.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/listroot.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis Readcards )
 
 atlas_add_executable( TIDAmakeSmallRefFile
-                      Analysis/src/makeSmallRefFile.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} TrigInDetAnalysis TrigInDetAnalysisExampleLib TrigInDetAnalysisUtils Resplot Readcards TIDA TIDAcomputils )
+   Analysis/src/makeSmallRefFile.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_executable( TIDAruntool
-                      Analysis/src/runtool.cxx 
-                      Analysis/src/computils.cxx
-                      INCLUDE_DIRS  ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES  ${ROOT_LIBRARIES}   )
+   Analysis/src/runtool.cxx
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} TIDAcomputils )
 
 atlas_add_executable( TIDAsb
-                      Analysis/src/chainparser.cxx
-                      INCLUDE_DIRS 
-                      LINK_LIBRARIES  Readcards  )
+   Analysis/src/chainparser.cxx
+   LINK_LIBRARIES Readcards )
 
 
 # Disable naming convention checker.
-- 
GitLab


From 18bdedc49a06ad7542928f755c833af1a8b6cfc8 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 8 Jul 2020 14:49:41 +0000
Subject: [PATCH 130/217] Update MultiComponentStateModeCalculator.cxx; sqrt is
 not constexpr

---
 .../src/MultiComponentStateModeCalculator.cxx                | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
index ef97513d3e1b..021b080857ad 100644
--- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
+++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/MultiComponentStateModeCalculator.cxx
@@ -14,9 +14,12 @@
 #include "TrkMultiComponentStateOnSurface/MultiComponentState.h"
 #include "TrkParameters/TrackParameters.h"
 #include "CxxUtils/phihelper.h"
+#include <cmath>
 
 namespace {
-constexpr double invsqrt2PI = 1. / sqrt(2. * M_PI);
+//note: sqrt is not constexpr; although gcc might accept it, clang doesn't.
+//but cmath constants can still be used..
+constexpr double invsqrt2PI = M_2_SQRTPI/(2.*M_SQRT2);//1. / sqrt(2. * M_PI);
 
 /** bried method to determine the value of the a gaussian distribution at a
  * given value */
-- 
GitLab


From df24f019763626d89ec78b83f9ce76c53257dabe Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 8 Jul 2020 17:06:40 +0200
Subject: [PATCH 131/217] Updated all projects to atlasexternals-2.0.71.

---
 Projects/AnalysisBase/externals.txt   | 2 +-
 Projects/AthDataQuality/externals.txt | 2 +-
 Projects/AthGeneration/externals.txt  | 2 +-
 Projects/AthSimulation/externals.txt  | 2 +-
 Projects/Athena/externals.txt         | 2 +-
 Projects/VP1Light/externals.txt       | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index 06ede204c083..9d67d068bafe 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.70
+AnalysisBaseExternalsVersion = 2.0.71
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index b7f3b614e536..17c59acee126 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.70
+AtlasExternalsVersion = 2.0.71
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index 89f6d7054b37..a02976e05e5c 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.70
+AthGenerationExternalsVersion = 2.0.71
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 3cf9a994d107..8ffb68a00141 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.70
+AthSimulationExternalsVersion = 2.0.71
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index d2894d549dad..dc8b3c68f869 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.70
+AthenaExternalsVersion = 2.0.71
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v33r1.004
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index 71b7e6156520..46aef434d6ac 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.70
+VP1LightExternalsVersion = 2.0.71
-- 
GitLab


From a8887bc60e46488d7dfbb9e77a061a8ccc68e2aa Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Wed, 8 Jul 2020 15:17:22 +0000
Subject: [PATCH 132/217] Surface : Add by value  local to global methods

---
 .../TrkSurfaces/TrkSurfaces/Surface.h         | 121 ++++++++++++------
 .../TrkSurfaces/TrkSurfaces/Surface.icc       |  63 +++++++--
 .../TrkDetDescr/TrkSurfaces/src/Surface.cxx   |  14 +-
 3 files changed, 145 insertions(+), 53 deletions(-)

diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
index bfc9df0f867a..9d0bfc4c8f50 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h
@@ -152,7 +152,8 @@ public:
    * rotation) */
   virtual const Amg::Vector3D& normal() const;
 
-  /** Returns a normal vector at a specific local position */
+  /** Returns a normal vector at a specific local position
+   */
   virtual const Amg::Vector3D* normal(const Amg::Vector2D& lp) const;
 
   /** Returns a global reference point on the surface,
@@ -177,7 +178,8 @@ public:
   virtual const Trk::Surface* baseSurface() const;
 
   /** Use the Surface as a ParametersBase constructor, from local parameters -
-   * charged */
+   * charged. The caller assumes ownership of the returned ptr.
+   */
   virtual ParametersBase<5, Trk::Charged>* createTrackParameters(
     double,
     double,
@@ -187,7 +189,8 @@ public:
     AmgSymMatrix(5) * cov = nullptr) const = 0;
 
   /** Use the Surface as a ParametersBase constructor, from global parameters -
-   * charged*/
+   * charged  The caller assumes ownership of the returned ptr
+   */
   virtual ParametersBase<5, Trk::Charged>* createTrackParameters(
     const Amg::Vector3D&,
     const Amg::Vector3D&,
@@ -195,7 +198,8 @@ public:
     AmgSymMatrix(5) * cov = nullptr) const = 0;
 
   /** Use the Surface as a ParametersBase constructor, from local parameters -
-   * neutral */
+   * neutral.  The caller assumes ownership of the returned ptr
+   */
   virtual ParametersBase<5, Trk::Neutral>* createNeutralParameters(
     double,
     double,
@@ -205,7 +209,8 @@ public:
     AmgSymMatrix(5) * cov = nullptr) const = 0;
 
   /** Use the Surface as a ParametersBase constructor, from global parameters -
-   * neutral */
+   * neutral. The caller assumes ownership of the returned ptr
+   */
   virtual ParametersBase<5, Trk::Neutral>* createNeutralParameters(
     const Amg::Vector3D&,
     const Amg::Vector3D&,
@@ -213,14 +218,18 @@ public:
     AmgSymMatrix(5) * cov = nullptr) const = 0;
 
   /** positionOnSurface() returns a pointer to a LocalPosition on the
-    Surface,<br> If BoundaryCheck==false it just returns the value of
-    globalToLocal (including NULL pointer possibility), if BoundaryCheck==true
-    it checks whether the point is inside bounds or not (returns NULL pointer in
-    this case). */
-  const Amg::Vector2D* positionOnSurface(const Amg::Vector3D& glopo,
-                                         const BoundaryCheck& bchk = true,
-                                         double tol1 = 0.,
-                                         double tol2 = 0.) const;
+    Surface,<br>
+    If BoundaryCheck==false it just returns the value of
+    globalToLocal (including nullptr possibility),
+    if BoundaryCheck==true
+    it checks whether the point is inside bounds or not (returns nullptr
+    pointer in this case).
+    The caller assumes ownership of the returned ptr.
+    */
+  Amg::Vector2D* positionOnSurface(const Amg::Vector3D& glopo,
+                                   const BoundaryCheck& bchk = true,
+                                   double tol1 = 0.,
+                                   double tol2 = 0.) const;
 
   /** The templated Parameters OnSurface method - checks on surface pointer
    * first */
@@ -244,33 +253,73 @@ public:
   virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
                                  const BoundaryCheck& bchk) const = 0;
 
+  /** Specified by each surface type: LocalToGlobal method without dynamic
+   * memory allocation */
+  virtual void localToGlobal(const Amg::Vector2D& locp,
+                             const Amg::Vector3D& mom,
+                             Amg::Vector3D& glob) const = 0;
+
+  /** This method returns the GlobalPosition from a LocalPosition
+   * uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * The caller is responsible for deleting the ptr.
+   */
+  Amg::Vector3D* localToGlobal(const Amg::Vector2D& locpos) const;
+
   /** This method returns the GlobalPosition from a LocalPosition
-    The LocalPosition can be outside Surface bounds - only for planar, cylinder
-    surfaces fully defined */
-  const Amg::Vector3D* localToGlobal(const Amg::Vector2D& locpos) const;
+   * uses the per surface localToGlobal. Return by value
+   */
+  Amg::Vector3D localToGlobalPos(const Amg::Vector2D& locpos) const;
 
   /** This method returns the GlobalPosition from a LocalPosition
-    The LocalPosition can be outside Surface bounds - for generality with
-    momentum*/
-  const Amg::Vector3D* localToGlobal(const Amg::Vector2D& locpos,
-                                     const Amg::Vector3D& glomom) const;
+   * The LocalPosition can be outside Surface bounds - for generality with
+   * momentum
+   *
+   * Uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * The caller is responsible for deleting the ptr.
+   */
+
+  Amg::Vector3D* localToGlobal(const Amg::Vector2D& locpos,
+                               const Amg::Vector3D& glomom) const;
+
+  /** This method returns the GlobalPosition from a LocalPosition
+   * The LocalPosition can be outside Surface bounds - for generality with
+   * momentum
+   * Return by value No memeory allocation
+   */
+  Amg::Vector3D localToGlobalPos(const Amg::Vector2D& locpos,
+                                 const Amg::Vector3D& glomom) const;
 
   /** This method returns the GlobalPosition from LocalParameters
-    The LocalParameters can be outside Surface bounds - only for planar,
-    cylinder surfaces fully defined */
-  const Amg::Vector3D* localToGlobal(const LocalParameters& locpars) const;
+   * The LocalParameters can be outside Surface bounds.
+   * Uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * The caller is responsible for deleting the ptr.
+   */
+  Amg::Vector3D* localToGlobal(const LocalParameters& locpars) const;
 
   /** This method returns the GlobalPosition from LocalParameters
-    The LocalParameters can be outside Surface bounds - for generality with
-    momentum */
-  const Amg::Vector3D* localToGlobal(const LocalParameters& locpars,
-                                     const Amg::Vector3D& glomom) const;
+   * The LocalParameters can be outside Surface bounds.
+   * Uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * Return by value no memory allocation
+   */
+  Amg::Vector3D localToGlobalPos(const LocalParameters& locpars) const;
 
-  /** Specified by each surface type: LocalToGlobal method without dynamic
-   * memory allocation */
-  virtual void localToGlobal(const Amg::Vector2D& locp,
-                             const Amg::Vector3D& mom,
-                             Amg::Vector3D& glob) const = 0;
+  /** This method returns the GlobalPosition from LocalParameters
+   * The LocalParameters can be outside Surface bounds - for generality with
+   * momentum
+   * Uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * The caller is responsible for deleting the ptr.
+   */
+  Amg::Vector3D* localToGlobal(const LocalParameters& locpars,
+                               const Amg::Vector3D& glomom) const;
+
+  /** This method returns the GlobalPosition from LocalParameters
+   * The LocalParameters can be outside Surface bounds - for generality with
+   * momentum
+   * Uses the per surface localToGlobal and pefrorms dynamic allocations.
+   * Return by value no memory allocation
+   */
+  Amg::Vector3D localToGlobalPos(const LocalParameters& locpars,
+                                 const Amg::Vector3D& glomom) const;
 
   /** Specified by each surface type: GlobalToLocal method without dynamic
    * memory allocation - boolean checks if on surface */
@@ -283,16 +332,16 @@ public:
     This method does not check if the calculated LocalPosition is inside surface
     bounds. If this check is needed, use positionOnSurface - only for planar,
     cylinder surface fully defined*/
-  const Amg::Vector2D* globalToLocal(const Amg::Vector3D& glopos,
-                                     double tol = 0.) const;
+  Amg::Vector2D* globalToLocal(const Amg::Vector3D& glopos,
+                               double tol = 0.) const;
 
   /** This method returns the LocalPosition from a provided GlobalPosition.
       If the GlobalPosition is not on the Surface, it returns a NULL pointer.
       This method does not check if the calculated LocalPosition is inside
      surface bounds. If this check is needed, use positionOnSurface - for
      generality with momentum */
-  const Amg::Vector2D* globalToLocal(const Amg::Vector3D& glopos,
-                                     const Amg::Vector3D& glomom) const;
+  Amg::Vector2D* globalToLocal(const Amg::Vector3D& glopos,
+                               const Amg::Vector3D& glomom) const;
 
   /** Optionally specified by each surface type : LocalParameters to Vector2D */
   virtual Amg::Vector2D localParametersToPosition(
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
index 4c34696f7e3b..63984ec0b28e 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 namespace Trk {
@@ -96,34 +96,62 @@ Surface::onSurface(const T& pars, const Trk::BoundaryCheck& bcheck) const
   return isOnSurface(pars.position(), bcheck);
 }
 
-// common to all surface, uses memory optized method
-inline const Amg::Vector3D*
+/// Local to Global implementations
+
+// From Local position
+inline Amg::Vector3D*
 Surface::localToGlobal(const Amg::Vector2D& locpos) const
 {
   Amg::Vector3D* gPosition = new Amg::Vector3D;
   localToGlobal(locpos, Amg::Vector3D(1., 1., 1.), *gPosition);
   return gPosition;
 }
-// common to all surfaces uses memory optimized method
-inline const Amg::Vector3D*
+inline Amg::Vector3D
+Surface::localToGlobalPos(const Amg::Vector2D& locpos) const
+{
+  Amg::Vector3D gPosition;
+  localToGlobal(locpos, Amg::Vector3D(1., 1., 1.), gPosition);
+  return gPosition;
+}
+
+// From local position and momentum
+inline Amg::Vector3D*
 Surface::localToGlobal(const Amg::Vector2D& locpos,
                        const Amg::Vector3D& glomom) const
 {
-  Amg::Vector3D* gPosition = new Amg::Vector3D;
+  Amg::Vector3D* gPosition = new Amg::Vector3D(0., 0., 0.);
   localToGlobal(locpos, glomom, *gPosition);
   return gPosition;
 }
-// common to all surface, uses memory optized method
-inline const Amg::Vector3D*
+inline Amg::Vector3D
+Surface::localToGlobalPos(const Amg::Vector2D& locpos,
+                          const Amg::Vector3D& glomom) const
+{
+  Amg::Vector3D gPosition(0., 0., 0.);
+  localToGlobal(locpos, glomom, gPosition);
+  return gPosition;
+}
+
+// From Local parameters
+inline Amg::Vector3D*
 Surface::localToGlobal(const LocalParameters& locpars) const
 {
-  Amg::Vector3D* gPosition = new Amg::Vector3D;
+  Amg::Vector3D* gPosition = new Amg::Vector3D(0., 0., 0.);
   localToGlobal(
     localParametersToPosition(locpars), Amg::Vector3D(1., 1., 1.), *gPosition);
   return gPosition;
 }
-// common to all surfaces uses memory optimized method
-inline const Amg::Vector3D*
+inline Amg::Vector3D
+Surface::localToGlobalPos(const LocalParameters& locpars) const
+{
+  Amg::Vector3D gPosition(0., 0., 0.);
+  localToGlobal(
+    localParametersToPosition(locpars), Amg::Vector3D(1., 1., 1.), gPosition);
+  return gPosition;
+}
+
+// From Local parameters and momementum
+inline Amg::Vector3D*
 Surface::localToGlobal(const LocalParameters& locpars,
                        const Amg::Vector3D& glomom) const
 {
@@ -131,8 +159,17 @@ Surface::localToGlobal(const LocalParameters& locpars,
   localToGlobal(localParametersToPosition(locpars), glomom, *gPosition);
   return gPosition;
 }
+inline Amg::Vector3D
+Surface::localToGlobalPos(const LocalParameters& locpars,
+                          const Amg::Vector3D& glomom) const
+{
+  Amg::Vector3D gPosition(0., 0., 0.);
+  localToGlobal(localParametersToPosition(locpars), glomom, gPosition);
+  return gPosition;
+}
+
 // common to all surfaces, uses memory optized method
-inline const Amg::Vector2D*
+inline Amg::Vector2D*
 Surface::globalToLocal(const Amg::Vector3D& glopos, double) const
 {
   Amg::Vector2D* lPosition = new Amg::Vector2D(0., 0.);
@@ -142,7 +179,7 @@ Surface::globalToLocal(const Amg::Vector3D& glopos, double) const
   return nullptr;
 }
 // common to all surfaces, uses memory optized method
-inline const Amg::Vector2D*
+inline Amg::Vector2D*
 Surface::globalToLocal(const Amg::Vector3D& glopos,
                        const Amg::Vector3D& glomom) const
 {
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/Surface.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/Surface.cxx
index 370fe35a387b..a0a403d4c0b6 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/src/Surface.cxx
+++ b/Tracking/TrkDetDescr/TrkSurfaces/src/Surface.cxx
@@ -164,10 +164,13 @@ Trk::Surface::operator=(const Trk::Surface& sf)
 }
 
 // returns the LocalPosition on a surface of a GlobalPosition
-const Amg::Vector2D*
-Trk::Surface::positionOnSurface(const Amg::Vector3D& glopo, const BoundaryCheck& bchk, double tol1, double tol2) const
+Amg::Vector2D*
+Trk::Surface::positionOnSurface(const Amg::Vector3D& glopo,
+                                const BoundaryCheck& bchk,
+                                double tol1,
+                                double tol2) const
 {
-  const Amg::Vector2D* posOnSurface = globalToLocal(glopo, tol1);
+  Amg::Vector2D* posOnSurface = globalToLocal(glopo, tol1);
   if (!bchk){
     return posOnSurface;
   }
@@ -180,7 +183,10 @@ Trk::Surface::positionOnSurface(const Amg::Vector3D& glopo, const BoundaryCheck&
 
 // checks if GlobalPosition is on Surface and inside bounds
 bool
-Trk::Surface::isOnSurface(const Amg::Vector3D& glopo, BoundaryCheck bchk, double tol1, double tol2) const
+Trk::Surface::isOnSurface(const Amg::Vector3D& glopo,
+                          BoundaryCheck bchk,
+                          double tol1,
+                          double tol2) const
 {
   const Amg::Vector2D* posOnSurface = positionOnSurface(glopo, bchk, tol1, tol2);
   if (posOnSurface) {
-- 
GitLab


From a36990aab89a983b183821e4acc146a80ec185b3 Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Wed, 8 Jul 2020 15:21:10 +0000
Subject: [PATCH 133/217] Fix test trigUpgr_XX_cf_buld

---
 .../TrigUpgradeTest/share/full_menu_cf.py     | 575 ++++++++----------
 .../share/full_menu_cf_build.ref              | 164 ++---
 2 files changed, 355 insertions(+), 384 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py
index 1096b4ac8db8..6cd3ef7e08e3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py
@@ -2,349 +2,296 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 
-from AthenaCommon.Logging import logging
-__log = logging.getLogger('full_menu')
 
-createHLTMenuExternally=True # menu will be build up explicitly here 
-doWriteRDOTrigger = False
-doWriteBS = False
-include("TriggerJobOpts/runHLT_standalone.py")
+
 
 ##########################################
-# menu
+# This is the menu:
 ###########################################
 # note : L1 Seeds must be declared in CTP file: for example
 # nightly/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/XML/TriggerMenuXML/LVL1config_Physics_pp_v7.xml
 ##########################################
 
-
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
-
-testChains = []
-from TrigUpgradeTest.TestUtils import makeChain
-
-##################################################################
-# egamma chains
-##################################################################
-if opt.doEgammaSlice == True:
-    from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg, fastElectronSequenceCfg, precisionCaloSequenceCfg
-    fastCaloSeq = RecoFragmentsPool.retrieve( electronFastCaloCfg, None )
-    electronSeq = RecoFragmentsPool.retrieve( fastElectronSequenceCfg, None )
-    precisionCaloSeq = RecoFragmentsPool.retrieve( precisionCaloSequenceCfg, None )
-
-    FastCaloStep = ChainStep("ElectronFastCaloStep", [fastCaloSeq])
-    FastElectronStep = ChainStep("ElectronFastTrackStep", [electronSeq])
-    PrecisionCaloStep = ChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq])
-
-    electronChains  = [
-        makeChain(name='HLT_e3_etcut1step_L1EM3',  L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep]  ),
-        makeChain(name='HLT_e3_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  ),
-        makeChain(name='HLT_e5_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  ),
-        makeChain(name='HLT_e7_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  )
-        ]
-
-#    DiEleStep1=ChainStep("DiEleStep1",[fastCaloSeq, fastCaloSeq], multiplicity=2) #same step
-#    DiEleStep2=ChainStep("DiEleStep2",[electronSeq, electronSeq], multiplicity=2) #need to be: one leg with only one step, one with 3 steps!
+def generateChains():
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
+    from TrigUpgradeTest.TestUtils import makeChain
     
-#    electronChains += [Chain(name='HLT_e5_etcut1step_e8_etcut',  ChainSteps=[DiEleStep1, DiEleStep2 ]  )]
-    testChains += electronChains
-
-    from TriggerMenuMT.HLTMenuConfig.Egamma.PhotonDef import fastPhotonCaloSequenceCfg, fastPhotonSequenceCfg, precisionPhotonCaloSequenceCfg
-
-    fastCaloSeq = RecoFragmentsPool.retrieve( fastPhotonCaloSequenceCfg, None )
-    fastPhotonSeq = RecoFragmentsPool.retrieve( fastPhotonSequenceCfg, None )
-    precisionCaloPhotonSeq = RecoFragmentsPool.retrieve( precisionPhotonCaloSequenceCfg, None)
-
-    FastCaloStep = ChainStep("PhotonFastCaloStep", [fastCaloSeq])
-    fastPhotonStep = ChainStep("PhotonStep2", [fastPhotonSeq])
-    precisionCaloPhotonStep = ChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq])
-
-    photonChains = [
-        makeChain(name='HLT_g5_etcut_L1EM3',    L1Thresholds=["EM3"],  ChainSteps=[ FastCaloStep,  fastPhotonStep, precisionCaloPhotonStep]  )
-        ]
-
-    testChains += photonChains
-
-##################################################################
-# muon chains
-##################################################################
-if opt.doMuonSlice == True:
-    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muIsoSequence, muEFCBSequence, muEFSAFSSequence, muEFCBFSSequence
-
-    MuonChains  = []
-
-    # step1
-    mufastS= muFastSequence()
-    step1mufast=ChainStep("Step1_muFast", [ mufastS ])
-    # step2
-    mucombS = muCombSequence()
-    step2muComb=ChainStep("Step2_muComb", [ mucombS ])
-
-    # step3
-    muEFSAS = muEFSASequence()
-    step3muEFSA=ChainStep("Step3_muEFSA", [ muEFSAS ])
-    step3muIso =ChainStep("Step3_muIso",  [ muIsoSequence() ])
-    # step4
-    muEFCBS = muEFCBSequence()
-    step4muEFCB=ChainStep("Step4_muEFCB", [ muEFCBS ])
-
-    emptyStep=ChainStep("Step2_empty")
-
-    ## single muon trigger  
-    MuonChains += [ makeChain(name='HLT_mu6fast_L1MU6',     L1Thresholds=["MU6"], ChainSteps=[ step1mufast ])]
-    MuonChains += [ makeChain(name='HLT_mu6Comb_L1MU6',     L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb ])]
-    MuonChains += [ makeChain(name='HLT_mu6_L1MU6',         L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb, step3muEFSA, step4muEFCB ])]
-    MuonChains += [ makeChain(name='HLT_mu6msonly_L1MU6',   L1Thresholds=["MU6"], ChainSteps=[ step1mufast, emptyStep,   step3muEFSA ])] # removed due to muEFSA isuue(?)
-    MuonChains += [ makeChain(name='HLT_mu20_ivar_L1MU6',   L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb, step3muIso ])]
-
-    # multi muon trigger
-    # 2muons symmetric
-    step1_2mufast_sym= ChainStep("Step1_2muFast_sym", [ mufastS], multiplicity=[2])
-    step2_2muComb_sym= ChainStep("Step2_2muComb_sym", [ mucombS], multiplicity=[2])
+    testChains = []
+    ##################################################################
+    # egamma chains
+    ##################################################################
+    if opt.doEgammaSlice == True:
+        from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg, fastElectronSequenceCfg, precisionCaloSequenceCfg
+        fastCaloSeq = RecoFragmentsPool.retrieve( electronFastCaloCfg, None )
+        electronSeq = RecoFragmentsPool.retrieve( fastElectronSequenceCfg, None )
+        precisionCaloSeq = RecoFragmentsPool.retrieve( precisionCaloSequenceCfg, None )
+        
+        FastCaloStep = ChainStep("ElectronFastCaloStep", [fastCaloSeq])
+        FastElectronStep = ChainStep("ElectronFastTrackStep", [electronSeq])
+        PrecisionCaloStep = ChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq])
+        
+        electronChains  = [
+            makeChain(name='HLT_e3_etcut1step_L1EM3',  L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep]  ),
+            makeChain(name='HLT_e3_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  ),
+            makeChain(name='HLT_e5_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  ),
+            makeChain(name='HLT_e7_etcut_L1EM3',       L1Thresholds=["EM3"],  ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep]  )
+            ]
+        testChains += electronChains
+
+        from TriggerMenuMT.HLTMenuConfig.Egamma.PhotonDef import fastPhotonCaloSequenceCfg, fastPhotonSequenceCfg, precisionPhotonCaloSequenceCfg
+        fastCaloSeq = RecoFragmentsPool.retrieve( fastPhotonCaloSequenceCfg, None )
+        fastPhotonSeq = RecoFragmentsPool.retrieve( fastPhotonSequenceCfg, None )
+        precisionCaloPhotonSeq = RecoFragmentsPool.retrieve( precisionPhotonCaloSequenceCfg, None)
+        
+        FastCaloStep = ChainStep("PhotonFastCaloStep", [fastCaloSeq])
+        fastPhotonStep = ChainStep("PhotonStep2", [fastPhotonSeq])
+        precisionCaloPhotonStep = ChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq])
+        
+        photonChains = [
+            makeChain(name='HLT_g5_etcut_L1EM3',    L1Thresholds=["EM3"],  ChainSteps=[ FastCaloStep,  fastPhotonStep, precisionCaloPhotonStep]  )
+            ]
+            
+        testChains += photonChains
+        
+    ##################################################################
+    # muon chains
+    ##################################################################
+    if opt.doMuonSlice == True:
+        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muIsoSequence, muEFCBSequence, muEFSAFSSequence, muEFCBFSSequence
+
+        MuonChains  = []
+        # step1
+        mufastS= muFastSequence()
+        step1mufast=ChainStep("Step1_muFast", [ mufastS ])
+        # step2
+        mucombS = muCombSequence()
+        step2muComb=ChainStep("Step2_muComb", [ mucombS ])
+        # step3
+        muEFSAS = muEFSASequence()
+        step3muEFSA=ChainStep("Step3_muEFSA", [ muEFSAS ])
+        step3muIso =ChainStep("Step3_muIso",  [ muIsoSequence() ])
+        # step4
+        muEFCBS = muEFCBSequence()
+        step4muEFCB=ChainStep("Step4_muEFCB", [ muEFCBS ])
+
+        emptyStep=ChainStep("Step2_empty", multiplicity=[])
+
+        ## single muon trigger  
+        MuonChains += [ makeChain(name='HLT_mu6fast_L1MU6',     L1Thresholds=["MU6"], ChainSteps=[ step1mufast ])]
+        MuonChains += [ makeChain(name='HLT_mu6Comb_L1MU6',     L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb ])]
+        MuonChains += [ makeChain(name='HLT_mu6_L1MU6',         L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb, step3muEFSA, step4muEFCB ])]
+        MuonChains += [ makeChain(name='HLT_mu6msonly_L1MU6',   L1Thresholds=["MU6"], ChainSteps=[ step1mufast, emptyStep,   step3muEFSA ])] # removed due to muEFSA isuue(?)
+        MuonChains += [ makeChain(name='HLT_mu20_ivar_L1MU6',   L1Thresholds=["MU6"], ChainSteps=[ step1mufast, step2muComb, step3muIso ])]
+
+        # multi muon trigger
+        # 2muons symmetric
+        step1_2mufast_sym= ChainStep("Step1_2muFast_sym", [ mufastS], multiplicity=[2])
+        step2_2muComb_sym= ChainStep("Step2_2muComb_sym", [ mucombS], multiplicity=[2])
     
-    step3_2muEFSA_sym= ChainStep("Step3_2muEFSA_sym", [ muEFSAS], multiplicity=[2])
-    step4_2muEFCB_sym= ChainStep("Step4_2muEFCB_sym", [ muEFCBS], multiplicity=[2])
+        step3_2muEFSA_sym= ChainStep("Step3_2muEFSA_sym", [ muEFSAS], multiplicity=[2])
+        step4_2muEFCB_sym= ChainStep("Step4_2muEFCB_sym", [ muEFCBS], multiplicity=[2])
  
-    MuonChains += [ makeChain(name='HLT_2mu6Comb_L12MU6',  L1Thresholds=["MU6"], ChainSteps=[ step1_2mufast_sym, step2_2muComb_sym ])]
+        MuonChains += [ makeChain(name='HLT_2mu6Comb_L12MU6',  L1Thresholds=["MU6"], ChainSteps=[ step1_2mufast_sym, step2_2muComb_sym ])]
 
-    # 2muons asymmetric (this will change): 2 sequences, 2 seeds
-    step1_2mufast_asym= ChainStep("Step1_2muFast_asym", [ mufastS, mufastS], multiplicity=[1,1])
-    step2_2muComb_asym= ChainStep("Step1_2muComb_asym", [ mucombS, mucombS], multiplicity=[1,1])
+        # 2muons asymmetric (this will change): 2 sequences, 2 seeds
+        step1_2mufast_asym= ChainStep("Step1_2muFast_asym", [ mufastS, mufastS], multiplicity=[1,1])
+        step2_2muComb_asym= ChainStep("Step1_2muComb_asym", [ mucombS, mucombS], multiplicity=[1,1])
     
-    step3_2muEFSA_asym= ChainStep("Step3_2muEFSA_asym", [ muEFSAS, muEFSAS], multiplicity=[1,1])
-    step4_2muEFCB_asym= ChainStep("Step4_2muEFCB_asym", [ muEFCBS, muEFCBS], multiplicity=[1,1])
+        step3_2muEFSA_asym= ChainStep("Step3_2muEFSA_asym", [ muEFSAS, muEFSAS], multiplicity=[1,1])
+        step4_2muEFCB_asym= ChainStep("Step4_2muEFCB_asym", [ muEFCBS, muEFCBS], multiplicity=[1,1])
+        
     
+        MuonChains += [ makeChain(name='HLT_mu6_mu4_L12MU4',
+                                L1Thresholds=["MU4", "MU6"],
+                                ChainSteps=[ step1_2mufast_asym, step2_2muComb_asym ])]        
+        
+        
+        #FS Muon trigger
+        # Full scan MS tracking step
+        stepFSmuEFSA=ChainStep("Step_FSmuEFSA", [muEFSAFSSequence()])
+        stepFSmuEFCB=ChainStep("Step_FSmuEFCB", [muEFCBFSSequence()])
+        MuonChains += [ makeChain(name='HLT_mu6noL1_L1MU6', L1Thresholds=["FSNOSEED"],  ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])] 
+        
+        testChains += MuonChains
+        
+        
+    ##################################################################
+    # jet chains
+    ##################################################################
+    if opt.doJetSlice == True:
+        from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
+
+        # small-R jets, different calibrations HLT_AntiKt4EMTopoJets_subjesIS
+        jetSeq_a4_tc_em = jetMenuSequenceFromString("a4_tc_em_subjesIS")
+        step_a4_tc_em =ChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em])
+        
+        jetSeq_a4_tc_em_subjes = jetMenuSequenceFromString("a4_tc_em_subjes")
+        step_a4_tc_em_subjes = ChainStep("Step_jet_a4_subjes_tc_em", [jetSeq_a4_tc_em_subjes])
+        
+        jetSeq_a4_tc_em_nocalib = jetMenuSequenceFromString("a4_tc_em_nojcalib")
+        step_a4_tc_em_nocalib=ChainStep("Step_jet_a4_nojcalib_tc_em", [jetSeq_a4_tc_em_nocalib])
+        
+        #    jetSeq_a4_tc_lcw = jetMenuSequenceFromString("a10_tc_lcw_subjesIS")
+        #    step_a4_tc_lcw=ChainStep("Step_jet_a10_tc_lcw", [jetSeq_a4_tc_lcw])
     
-    MuonChains += [ makeChain(name='HLT_mu6_mu4_L12MU4',
-                              L1Thresholds=["MU4", "MU6"],
-                              ChainSteps=[ step1_2mufast_asym, step2_2muComb_asym ])]        
+        # large-R jets
+        jetSeq_a10_tc_lcw_subjes = jetMenuSequenceFromString("a10_tc_lcw_subjes")
+        step_a10_tc_lcw_subjes=ChainStep("Step_jet_a10_subjes_tc_lcw", [jetSeq_a10_tc_lcw_subjes])
+        
+        jetSeq_a10r = jetMenuSequenceFromString("a10r_tc_em_subjesIS")
+        step_a10r=ChainStep("Step_jet_a10r", [jetSeq_a10r])
+        
+        jetChains  = [
+            makeChain(name='HLT_j45_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_j85_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_j420_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_j260_320eta490_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+        # makeChain(name='HLT_j225_gsc420_boffperf_split',   ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_j460_a10_lcw_subjes_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a10_tc_lcw_subjes]  ),
+            makeChain(name='HLT_j460_a10r_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a10r]  ),
+            makeChain(name='HLT_3j200_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
+            makeChain(name='HLT_5j70_0eta240_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ), # 5j70_0eta240_L14J15 (J20 until multi-object L1 seeds supported)
+            ]
+
+        testChains += jetChains
+
+
+    ##################################################################
+    # bjet chains
+    ##################################################################
+    if opt.doBjetSlice == True:
+        from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
+        from TriggerMenuMT.HLTMenuConfig.Bjet.BjetSequenceSetup import getBJetSequence
+
+        jetSequence = jetMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf")
+        
+        step1 = ChainStep("Step1_bjet", [jetSequence] )
+        step2 = ChainStep("Step2_bjet", [getBJetSequence()])
+        
+        bjetChains  = [
+            makeChain(name='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' , L1Thresholds=["J20"], ChainSteps=[step1,step2] ),
+            makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20', L1Thresholds=["J20"], ChainSteps=[step1,step2] ),
+            makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_L1J20'      , L1Thresholds=["J20"], ChainSteps=[step1,step2] )
+            ]
+        testChains += bjetChains
     
-    
-    #FS Muon trigger
-    # Full scan MS tracking step
-    stepFSmuEFSA=ChainStep("Step_FSmuEFSA", [muEFSAFSSequence()])
-    stepFSmuEFCB=ChainStep("Step_FSmuEFCB", [muEFCBFSSequence()])
-    MuonChains += [ makeChain(name='HLT_mu6noL1_L1MU6', L1Thresholds=["FSNOSEED"],  ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])] 
-
-    testChains += MuonChains
-
-
-##################################################################
-# jet chains
-##################################################################
-if opt.doJetSlice == True:
-    from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
-
-    # small-R jets, different calibrations HLT_AntiKt4EMTopoJets_subjesIS
-    jetSeq_a4_tc_em = jetMenuSequenceFromString("a4_tc_em_subjesIS")
-    step_a4_tc_em =ChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em])
-
-    jetSeq_a4_tc_em_subjes = jetMenuSequenceFromString("a4_tc_em_subjes")
-    step_a4_tc_em_subjes = ChainStep("Step_jet_a4_subjes_tc_em", [jetSeq_a4_tc_em_subjes])
-
-    jetSeq_a4_tc_em_nocalib = jetMenuSequenceFromString("a4_tc_em_nojcalib")
-    step_a4_tc_em_nocalib=ChainStep("Step_jet_a4_nojcalib_tc_em", [jetSeq_a4_tc_em_nocalib])
-
-#    jetSeq_a4_tc_lcw = jetMenuSequenceFromString("a10_tc_lcw_subjesIS")
-#    step_a4_tc_lcw=ChainStep("Step_jet_a10_tc_lcw", [jetSeq_a4_tc_lcw])
-
-    # large-R jets
-    jetSeq_a10_tc_lcw_subjes = jetMenuSequenceFromString("a10_tc_lcw_subjes")
-    step_a10_tc_lcw_subjes=ChainStep("Step_jet_a10_subjes_tc_lcw", [jetSeq_a10_tc_lcw_subjes])
-
-    jetSeq_a10r = jetMenuSequenceFromString("a10r_tc_em_subjesIS")
-    step_a10r=ChainStep("Step_jet_a10r", [jetSeq_a10r])
-    
-    jetChains  = [
-        makeChain(name='HLT_j45_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_j85_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_j420_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_j260_320eta490_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-      # makeChain(name='HLT_j225_gsc420_boffperf_split',   ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20',  L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_j460_a10_lcw_subjes_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a10_tc_lcw_subjes]  ),
-        makeChain(name='HLT_j460_a10r_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a10r]  ),
-        makeChain(name='HLT_3j200_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ),
-        makeChain(name='HLT_5j70_0eta240_L1J20', L1Thresholds=["J20"], ChainSteps=[step_a4_tc_em]  ), # 5j70_0eta240_L14J15 (J20 until multi-object L1 seeds supported)
-        ]
-
-    testChains += jetChains
-
-
-##################################################################
-# bjet chains
-##################################################################
-if opt.doBjetSlice == True:
-    from TrigUpgradeTest.jetMenuHelper import jetMenuSequenceFromString
-    from TriggerMenuMT.HLTMenuConfig.Bjet.BjetSequenceSetup import getBJetSequence
-
-    jetSequence = jetMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf")
-
-    step1 = ChainStep("Step1_bjet", [jetSequence] )
-    step2 = ChainStep("Step2_bjet", [getBJetSequence()])
-
-    bjetChains  = [
-          makeChain(name='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' , L1Thresholds=["J20"], ChainSteps=[step1,step2] ),
-          makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20', L1Thresholds=["J20"], ChainSteps=[step1,step2] ),
-          makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_L1J20'      , L1Thresholds=["J20"], ChainSteps=[step1,step2] )
-        ]
-    testChains += bjetChains
-
-"""
-Commenting out tau chains for now    
-##################################################################
-# tau chains
-##################################################################
-if opt.doTauSlice == True:
-    from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import getTauSequence
+   
+        ##################################################################
+    # tau chains
+    ##################################################################
+    if opt.doTauSlice == True and False:
+        from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import getTauSequence
 
-    step1=ChainStep("Step1_tau", [getTauSequence('calo')])
-    step1MVA=ChainStep("Step1MVA_tau", [getTauSequence('calo_mva')])
+        step1=ChainStep("Step1_tau", [getTauSequence('calo')])
+        step1MVA=ChainStep("Step1MVA_tau", [getTauSequence('calo_mva')])
 
-    #This runs the tau-preselection(TP) step
-    step2TP=ChainStep("Step2TP_tau", [getTauSequence('track_core')])
+        #This runs the tau-preselection(TP) step
+        step2TP=ChainStep("Step2TP_tau", [getTauSequence('track_core')])
 
-    #This runs the EFTauMV hypo on top of fast tracks 
-    step2PT=ChainStep("Step2PT_tau", [getTauSequence('precision')])    
+        #This runs the EFTauMV hypo on top of fast tracks 
+        step2PT=ChainStep("Step2PT_tau", [getTauSequence('precision')])    
   
-    tauChains  = [
-          makeChain(name='HLT_tau0_perf_ptonly_L1TAU12',              L1Thresholds=["TAU12"], ChainSteps=[step1, step2] ),
-          makeChain(name='HLT_tau25_medium1_tracktwo_L1TAU12IM',      L1Thresholds=["TAU12IM"],  ChainSteps=[step1, step2TP] ),
-          makeChain(name='HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM', L1Thresholds=["TAU20IM"], ChainSteps=[step1MVA, step2PT])
-      ]
-    testChains += tauChains
-"""
-
-##################################################################
-# MET chains
-##################################################################
-if opt.doMETSlice == True:
-    from TriggerMenuMT.HLTMenuConfig.MET.METMenuSequences import metMenuSequence
-    from TriggerMenuMT.HLTMenuConfig.MET.ConfigHelpers import extractMETRecoDict
-
-    cellRecoDict = extractMETRecoDict({'EFrecoAlg': "cell"})
-    metCellSeq = metMenuSequence(None, **cellRecoDict)
-
-    pufitRecoDict = extractMETRecoDict({'EFrecoAlg': "tcpufit"})
-    metClusterPufitSeq = metMenuSequence(None, **pufitRecoDict)
-
-    metCellStep = ChainStep("Step1_met_cell", [metCellSeq])
-    metClusterPufitStep          = ChainStep("Step1_met_clusterpufit", [metClusterPufitSeq])
-    comboStep_cell_clusterpufit  = ChainStep("Step1_combo_cell_clusterpufit", [metCellSeq, metClusterPufitSeq], multiplicity=[1,1])
-
-    metChains = [
-        makeChain(name="HLT_xe65_L1XE50",         L1Thresholds=["XE50"], ChainSteps=[metCellStep]),
-        makeChain(name="HLT_xe30_L1XE10",         L1Thresholds=["XE10"], ChainSteps=[metCellStep]),
-        makeChain(name="HLT_xe30_tcpufit_L1XE10", L1Thresholds=["XE10"], ChainSteps=[metClusterPufitStep]),
-        makeChain(name='HLT_xe30_cell_xe30_tcpufit_L1XE10',  L1Thresholds=["XE10","XE10"], ChainSteps=[comboStep_cell_clusterpufit ]) 
+        tauChains  = [
+            makeChain(name='HLT_tau0_perf_ptonly_L1TAU12',              L1Thresholds=["TAU12"], ChainSteps=[step1, step2] ),
+            makeChain(name='HLT_tau25_medium1_tracktwo_L1TAU12IM',      L1Thresholds=["TAU12IM"],  ChainSteps=[step1, step2TP] ),
+            makeChain(name='HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM', L1Thresholds=["TAU20IM"], ChainSteps=[step1MVA, step2PT])
         ]
+        testChains += tauChains
+
+
+    ##################################################################
+    # MET chains
+    ##################################################################
+    if opt.doMETSlice == True:
+        from TriggerMenuMT.HLTMenuConfig.MET.METMenuSequences import metMenuSequence
+        from TriggerMenuMT.HLTMenuConfig.MET.ConfigHelpers import extractMETRecoDict
+
+        cellRecoDict = extractMETRecoDict({'EFrecoAlg': "cell"})
+        metCellSeq = metMenuSequence(None, **cellRecoDict)
+
+        pufitRecoDict = extractMETRecoDict({'EFrecoAlg': "tcpufit"})
+        metClusterPufitSeq = metMenuSequence(None, **pufitRecoDict)
+        
+        metCellStep = ChainStep("Step1_met_cell", [metCellSeq])
+        metClusterPufitStep          = ChainStep("Step1_met_clusterpufit", [metClusterPufitSeq])
+        comboStep_cell_clusterpufit  = ChainStep("Step1_combo_cell_clusterpufit", [metCellSeq, metClusterPufitSeq], multiplicity=[1,1])
+
+        metChains = [
+            makeChain(name="HLT_xe65_L1XE50",         L1Thresholds=["XE50"], ChainSteps=[metCellStep]),
+            makeChain(name="HLT_xe30_L1XE10",         L1Thresholds=["XE10"], ChainSteps=[metCellStep]),
+            makeChain(name="HLT_xe30_tcpufit_L1XE10", L1Thresholds=["XE10"], ChainSteps=[metClusterPufitStep]),
+            makeChain(name='HLT_xe30_cell_xe30_tcpufit_L1XE10',  L1Thresholds=["XE10","XE10"], ChainSteps=[comboStep_cell_clusterpufit ]) 
+            ]
+
+        testChains += metChains
+
+    ##################################################################
+    # B-physics and light states chains
+    ##################################################################
+    if opt.doBphysicsSlice == True:
+        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muEFCBSequence
+        from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DimuL2ComboHypoCfg, DimuEFComboHypoCfg
+        
+        step1_dimufast=ChainStep("Step1_dimuFast", [muFastSequence()], multiplicity=[2])
+        step2_dimuComb=ChainStep("Step2_dimuComb", [muCombSequence()], multiplicity=[2], comboHypoCfg=DimuL2ComboHypoCfg)
+        step3_dimuEFSA=ChainStep("Step3_dimuEFSA", [muEFSASequence()], multiplicity=[2])
+        step4_dimuEFCB=ChainStep("Step4_dimuEFCB", [muEFCBSequence()], multiplicity=[2], comboHypoCfg=DimuEFComboHypoCfg)
+        steps = [step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB]
+        
+        BphysChains = [
+            makeChain(name='HLT_2mu4_bBmumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
+            makeChain(name='HLT_2mu4_bDimu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
+            makeChain(name='HLT_2mu4_bJpsimumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
+            makeChain(name='HLT_2mu6_bJpsimumu_L12MU6', L1Thresholds=["MU6"], ChainSteps=steps),
+            makeChain(name='HLT_2mu4_bUpsimumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps)
+            ]
+
+        testChains += BphysChains
+
+    ##################################################################
+    # combined chains
+    ##################################################################
+    if opt.doCombinedSlice == True:
+        from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg
+        fastCaloSeq = RecoFragmentsPool.retrieve( electronFastCaloCfg, None )
+        
+        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence
+        
+        comboStep_et_mufast           = ChainStep("Step1_et_mufast", [fastCaloSeq, muFastSequence()], multiplicity=[1,1])
+        comboStep_mufast_etcut1_step1 = ChainStep("Step1_mufast_etcut1", [muFastSequence(), fastCaloSeq], multiplicity=[1,1])
+        
+        comboChains =  [ makeChain(name='HLT_e3_etcut_mu6_L1EM8I_MU10', L1Thresholds=["EM8I", "MU10"],  ChainSteps=[comboStep_et_mufast ])]
+    #   comboChains += [Chain(name='HLT_mu8fast_e8_etcut1step',   ChainSteps=[ comboStep_mufast_etcut1_step1 ])]
+        testChains += comboChains
+        
+
+### commands here:
 
+from AthenaCommon.Logging import logging
+__log = logging.getLogger('full_menu')
 
-    testChains += metChains
-
-##################################################################
-# B-physics and light states chains
-##################################################################
-if opt.doBphysicsSlice == True:
-    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muEFCBSequence
-    from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DimuL2ComboHypoCfg, DimuEFComboHypoCfg
-
-    step1_dimufast=ChainStep("Step1_dimuFast", [muFastSequence()], multiplicity=[2])
-    step2_dimuComb=ChainStep("Step2_dimuComb", [muCombSequence()], multiplicity=[2], comboHypoCfg=DimuL2ComboHypoCfg)
-    step3_dimuEFSA=ChainStep("Step3_dimuEFSA", [muEFSASequence()], multiplicity=[2])
-    step4_dimuEFCB=ChainStep("Step4_dimuEFCB", [muEFCBSequence()], multiplicity=[2], comboHypoCfg=DimuEFComboHypoCfg)
-    steps = [step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB]
-
-    BphysChains = [
-        makeChain(name='HLT_2mu4_bBmumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
-        makeChain(name='HLT_2mu4_bDimu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
-        makeChain(name='HLT_2mu4_bJpsimumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps),
-        makeChain(name='HLT_2mu6_bJpsimumu_L12MU6', L1Thresholds=["MU6"], ChainSteps=steps),
-        makeChain(name='HLT_2mu4_bUpsimumu_L12MU4', L1Thresholds=["MU4"], ChainSteps=steps)
-        ]
-
-    testChains += BphysChains
-
-##################################################################
-# combined chains
-##################################################################
-if opt.doCombinedSlice == True:
-    # combo chains
-
-    from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg
-    fastCaloSeq = RecoFragmentsPool.retrieve( electronFastCaloCfg, None )
-
-    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence
-
-    comboStep_et_mufast           = ChainStep("Step1_et_mufast", [fastCaloSeq, muFastSequence()], multiplicity=[1,1])
-    comboStep_mufast_etcut1_step1 = ChainStep("Step1_mufast_etcut1", [muFastSequence(), fastCaloSeq], multiplicity=[1,1])
-
-
-    comboChains =  [ makeChain(name='HLT_e3_etcut_mu6_L1EM8I_MU10', L1Thresholds=["EM8I", "MU10"],  ChainSteps=[comboStep_et_mufast ])]
- #   comboChains += [Chain(name='HLT_mu8fast_e8_etcut1step',   ChainSteps=[ comboStep_mufast_etcut1_step1 ])]
-    testChains += comboChains
-
-
+createHLTMenuExternally=True # menu will be build up explicitly here 
+doWriteRDOTrigger = False
+doWriteBS = False
+forceEnableAllChains=True
 
-##########################################
-# CF construction
-##########################################
+include("TriggerJobOpts/runHLT_standalone.py")
 
-##### Make all HLT #######
+# make menu manually here:
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
 from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
-makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
 
-##########################################
-# Configure trigger output using parts of the NewJO configuration
-# in a somewhat hacky way - copy-pasted from full_menu.py
-##########################################
-from TriggerJobOpts.TriggerConfig import collectHypos, collectFilters, collectDecisionObjects, collectHypoDecisionObjects, triggerOutputCfg
-from AthenaCommon.CFElements import findAlgorithm,findSubSequence
-hypos = collectHypos(findSubSequence(topSequence, "HLTAllSteps"))
-filters = collectFilters(findSubSequence(topSequence, "HLTAllSteps"))
-
-# find DecisionSummaryMakerAlg
-summaryMakerAlg = findAlgorithm(topSequence, "DecisionSummaryMakerAlg")
-if not summaryMakerAlg:
-    __log.warning("Failed to find DecisionSummaryMakerAlg")
-
-# try to find L1Decoder
-l1decoder = findAlgorithm(topSequence,'L1Decoder')
-if not l1decoder:
-    l1decoder = findAlgorithm(topSequence,'L1EmulationTest')
-if l1decoder and summaryMakerAlg:
-    decObj = collectDecisionObjects( hypos, filters, l1decoder, summaryMakerAlg )
-    decObjHypoOut = collectHypoDecisionObjects(hypos, inputs=False, outputs=True)
-    __log.debug("Decision Objects to write to output [hack method - should be replaced with triggerRunCfg()]")
-    __log.debug(decObj)
-else:
-    __log.warning("Failed to find L1Decoder or summaryMakerAlg, cannot determine Decision names for output configuration")
-    decObj = []
-    decObjHypoOut = []
-
-
-from AthenaConfiguration.AllConfigFlags import ConfigFlags
-from AthenaCommon.Configurable import Configurable
-Configurable.configurableRun3Behavior=1
-acc, edmSet = triggerOutputCfg(ConfigFlags, decObj, decObjHypoOut, summaryMakerAlg)
-Configurable.configurableRun3Behavior=0
-from AthenaConfiguration.ComponentAccumulator import appendCAtoAthena
-appendCAtoAthena(acc)
+generateChains()
+makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
 
-##########################################
-# Print top sequence for debugging
-##########################################
-from AthenaCommon.AlgSequence import dumpSequence, AthSequencer
-dumpSequence(topSequence)
+from TrigConfigSvc.TrigConfigSvcCfg import createHLTPrescalesFileFromMenu
+createHLTPrescalesFileFromMenu()
 
-##########################################
-# Write menu JSON
-##########################################
-HLTTop = findSubSequence(topSequence, "HLTTop")
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
 generateJSON()
-
-# the generation of the prescale set file from the menu is temporary
-from TrigConfigSvc.TrigConfigSvcCfg import createHLTPrescalesFileFromMenu
-createHLTPrescalesFileFromMenu( ConfigFlags )
+    
+from AthenaCommon.AlgSequence import dumpSequence, AthSequencer
+dumpSequence(topSequence)
+    
+    
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref
index 35ee4104663d..16c0e9822e25 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf_build.ref
@@ -1,105 +1,129 @@
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e3_etcut1step_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e3_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e3_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e3_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e5_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e5_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e5_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastCaloStep (step ) used at step 1 in chain HLT_e7_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronFastTrackStep (step ) used at step 2 in chain HLT_e7_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence ElectronPrecisionCaloStep (step ) used at step 3 in chain HLT_e7_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence PhotonFastCaloStep (step ) used at step 1 in chain HLT_g5_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence precisionCaloPhotonStep (step ) used at step 3 in chain HLT_g5_etcut_L1EM3
+TrigSignatureMoniMT                                 INFO Sequence Step1_2muComb_asym (step Step1) used at step 2 in chain HLT_mu6_mu4_L12MU4
+TrigSignatureMoniMT                                 INFO Sequence Step_FSmuEFSA (step ) used at step 1 in chain HLT_mu6noL1_L1MU6
+TrigSignatureMoniMT                                 INFO Sequence Step_FSmuEFCB (step ) used at step 2 in chain HLT_mu6noL1_L1MU6
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j45_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j85_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j420_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j260_320eta490_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a10_subjes_tc_lcw (step ) used at step 1 in chain HLT_j460_a10_lcw_subjes_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a10r (step ) used at step 1 in chain HLT_j460_a10r_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_3j200_L1J20
+TrigSignatureMoniMT                                 INFO Sequence Step_jet_a4_tc_em (step ) used at step 1 in chain HLT_5j70_0eta240_L1J20
 TrigSignatureMoniMT                                 INFO HLT_2mu4_bBmumu_L12MU4 #3163510355
-TrigSignatureMoniMT                                 INFO -- #3163510355 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3163510355 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3163510355 Events         20         20         1          1          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #3163510355 Features                             4          2          0          0          
 TrigSignatureMoniMT                                 INFO HLT_2mu4_bDimu_L12MU4 #1730084172
-TrigSignatureMoniMT                                 INFO -- #1730084172 Events         0          0          0          0          0          0          0          0          
-TrigSignatureMoniMT                                 INFO -- #1730084172 Features                             0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1730084172 Events         20         20         1          1          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1730084172 Features                             4          2          0          0          
 TrigSignatureMoniMT                                 INFO HLT_2mu4_bJpsimumu_L12MU4 #4276347155
-TrigSignatureMoniMT                                 INFO -- #4276347155 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4276347155 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #4276347155 Events         20         20         1          1          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #4276347155 Features                             4          2          0          0          
 TrigSignatureMoniMT                                 INFO HLT_2mu4_bUpsimumu_L12MU4 #4008168535
-TrigSignatureMoniMT                                 INFO -- #4008168535 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4008168535 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #4008168535 Events         20         20         1          1          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #4008168535 Features                             4          2          0          0          
 TrigSignatureMoniMT                                 INFO HLT_2mu6Comb_L12MU6 #2046267508
-TrigSignatureMoniMT                                 INFO -- #2046267508 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2046267508 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #2046267508 Events         20         20         0          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2046267508 Features                             0          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_2mu6_bJpsimumu_L12MU6 #1924924067
-TrigSignatureMoniMT                                 INFO -- #1924924067 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1924924067 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1924924067 Events         20         20         0          0          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #1924924067 Features                             0          0          0          0          
 TrigSignatureMoniMT                                 INFO HLT_3j200_L1J20 #493765146
-TrigSignatureMoniMT                                 INFO -- #493765146 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #493765146 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #493765146 Events          20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #493765146 Features                              0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_5j70_0eta240_L1J20 #4050408395
-TrigSignatureMoniMT                                 INFO -- #4050408395 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4050408395 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #4050408395 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #4050408395 Features                             0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut1step_L1EM3 #999988353
-TrigSignatureMoniMT                                 INFO -- #999988353 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #999988353 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #999988353 Events          20         20         13         -          -          -          13         
+TrigSignatureMoniMT                                 INFO -- #999988353 Features                              27         -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut_L1EM3 #683953566
-TrigSignatureMoniMT                                 INFO -- #683953566 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #683953566 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #683953566 Events          20         20         15         14         14         -          14         
+TrigSignatureMoniMT                                 INFO -- #683953566 Features                              48         156        87         -          
 TrigSignatureMoniMT                                 INFO HLT_e3_etcut_mu6_L1EM8I_MU10 #3997258299
-TrigSignatureMoniMT                                 INFO -- #3997258299 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3997258299 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3997258299 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3997258299 Features                             0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_e5_etcut_L1EM3 #324908483
-TrigSignatureMoniMT                                 INFO -- #324908483 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #324908483 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #324908483 Events          20         20         13         13         13         -          13         
+TrigSignatureMoniMT                                 INFO -- #324908483 Features                              41         141        47         -          
 TrigSignatureMoniMT                                 INFO HLT_e7_etcut_L1EM3 #1959043579
-TrigSignatureMoniMT                                 INFO -- #1959043579 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1959043579 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1959043579 Events         20         20         13         13         11         -          11         
+TrigSignatureMoniMT                                 INFO -- #1959043579 Features                             26         90         20         -          
 TrigSignatureMoniMT                                 INFO HLT_g5_etcut_L1EM3 #471243435
-TrigSignatureMoniMT                                 INFO -- #471243435 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #471243435 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #471243435 Events          20         20         13         13         13         -          13         
+TrigSignatureMoniMT                                 INFO -- #471243435 Features                              41         41         50         -          
 TrigSignatureMoniMT                                 INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151
-TrigSignatureMoniMT                                 INFO -- #4034799151 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Events         20         20         2          -          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #4034799151 Features                             34         -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j260_320eta490_L1J20 #3084792704
-TrigSignatureMoniMT                                 INFO -- #3084792704 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3084792704 Features                             0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j420_L1J20 #2205518067
-TrigSignatureMoniMT                                 INFO -- #2205518067 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #2205518067 Features                             0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_L1J20 #1247336154
-TrigSignatureMoniMT                                 INFO -- #1247336154 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1247336154 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1247336154 Events         20         20         5          -          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #1247336154 Features                             5          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_L1J20 #4088855158
-TrigSignatureMoniMT                                 INFO -- #4088855158 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #4088855158 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #4088855158 Events         20         20         5          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #4088855158 Features                             5          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339
-TrigSignatureMoniMT                                 INFO -- #991419339 Events          0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #991419339 Features                              0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #991419339 Events          20         20         5          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #991419339 Features                              5          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049
-TrigSignatureMoniMT                                 INFO -- #1961149049 Events         0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1961149049 Events         20         20         5          5          -          -          5          
+TrigSignatureMoniMT                                 INFO -- #1961149049 Features                             5          5          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10_lcw_subjes_L1J20 #215408633
-TrigSignatureMoniMT                                 INFO -- #215408633 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #215408633 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #215408633 Events          20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #215408633 Features                              0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j460_a10r_L1J20 #3875082669
-TrigSignatureMoniMT                                 INFO -- #3875082669 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #3875082669 Features                             0          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_j85_L1J20 #510475538
-TrigSignatureMoniMT                                 INFO -- #510475538 Events          0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #510475538 Features                              -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #510475538 Events          20         20         3          -          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #510475538 Features                              3          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 #2083734526
-TrigSignatureMoniMT                                 INFO -- #2083734526 Events         0          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2083734526 Events         20         20         1          1          1          -          1          
+TrigSignatureMoniMT                                 INFO -- #2083734526 Features                             1          1          1          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6Comb_L1MU6 #996392590
-TrigSignatureMoniMT                                 INFO -- #996392590 Events          0          0          0          0          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #996392590 Features                              0          0          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #996392590 Events          20         20         1          1          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #996392590 Features                              1          1          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6_L1MU6 #2560542253
-TrigSignatureMoniMT                                 INFO -- #2560542253 Events         0          0          0          0          0          0          -          0          
-TrigSignatureMoniMT                                 INFO -- #2560542253 Features                             0          0          0          0          -          
+TrigSignatureMoniMT                                 INFO -- #2560542253 Events         20         20         1          1          0          0          0          
+TrigSignatureMoniMT                                 INFO -- #2560542253 Features                             1          1          0          0          
 TrigSignatureMoniMT                                 INFO HLT_mu6_mu4_L12MU4 #1713982776
-TrigSignatureMoniMT                                 INFO -- #1713982776 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1713982776 Events         20         20         1          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1713982776 Features                             2          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6fast_L1MU6 #3518031697
-TrigSignatureMoniMT                                 INFO -- #3518031697 Events         0          0          0          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             0          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3518031697 Events         20         20         1          -          -          -          1          
+TrigSignatureMoniMT                                 INFO -- #3518031697 Features                             1          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6msonly_L1MU6 #2316111217
-TrigSignatureMoniMT                                 INFO -- #2316111217 Events         0          0          0          0          0          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #2316111217 Features                             0          0          0          -          -          
+TrigSignatureMoniMT                                 INFO -- #2316111217 Events         20         20         1          0          0          -          0          
+TrigSignatureMoniMT                                 INFO -- #2316111217 Features                             1          0          0          -          
 TrigSignatureMoniMT                                 INFO HLT_mu6noL1_L1MU6 #1631468602
-TrigSignatureMoniMT                                 INFO -- #1631468602 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1631468602 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1631468602 Events         20         20         1          0          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1631468602 Features                             1          0          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_L1XE10 #347649004
-TrigSignatureMoniMT                                 INFO -- #347649004 Events          0          0          0          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #347649004 Features                              0          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #347649004 Events          20         20         3          -          -          -          3          
+TrigSignatureMoniMT                                 INFO -- #347649004 Features                              3          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_cell_xe30_tcpufit_L1XE10 #3768353779
-TrigSignatureMoniMT                                 INFO -- #3768353779 Events         0          0          -          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             -          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Events         20         20         2          -          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #3768353779 Features                             2          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe30_tcpufit_L1XE10 #1583719916
-TrigSignatureMoniMT                                 INFO -- #1583719916 Events         0          0          0          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             0          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Events         20         20         2          -          -          -          2          
+TrigSignatureMoniMT                                 INFO -- #1583719916 Features                             2          -          -          -          
 TrigSignatureMoniMT                                 INFO HLT_xe65_L1XE50 #1283272884
-TrigSignatureMoniMT                                 INFO -- #1283272884 Events         1          1          0          -          -          -          -          0          
-TrigSignatureMoniMT                                 INFO -- #1283272884 Features                             0          -          -          -          -          
+TrigSignatureMoniMT                                 INFO -- #1283272884 Events         20         20         0          -          -          -          0          
+TrigSignatureMoniMT                                 INFO -- #1283272884 Features                             0          -          -          -          
-- 
GitLab


From f9238e4e2ddde19f982bd95f5c2d3529281523ff Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 8 Jul 2020 17:21:13 +0200
Subject: [PATCH 134/217] Fix ATLASRECTS-5578. Add protections against index
 out of bounds. abortBottomLoop and abortTopLoop were used in only outer for
 loops and should be used in inner for loops too to avoid index out of bounds.

---
 .../src/SiSpacePointsSeedMaker_ATLxk.cxx                      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
index 277e979f429e..b0dd7293bab0 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx
@@ -1641,7 +1641,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
     bool abortBottomLoop=false;
     for (int cell=0; !abortBottomLoop && cell<numberBottomCells; ++cell) {
       /// in each cell, loop over the space points
-      for (iter_otherSP=iter_bottomCands[cell]; iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
+      for (iter_otherSP=iter_bottomCands[cell]; !abortBottomLoop && iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
         
         /// evaluate the radial distance between the central and bottom SP
         const float& Rb =(*iter_otherSP)->radius();
@@ -1688,7 +1688,7 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::production3Sp
     /// again, loop over cells of interest, this time for the top SP candidate
     for (int cell=0; !abortTopLoop && cell<numberTopCells; ++cell) {
       /// loop over each SP in each cell 
-      for (iter_otherSP=iter_topCands[cell]; iter_otherSP!=iter_endTopCands[cell]; ++iter_otherSP) {
+      for (iter_otherSP=iter_topCands[cell]; !abortTopLoop && iter_otherSP!=iter_endTopCands[cell]; ++iter_otherSP) {
   
         /// evaluate the radial distance, 
         float Rt =(*iter_otherSP)->radius();
-- 
GitLab


From 45a5300cab2079bb56544da0d81e757e489dc9ce Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:47:46 +0200
Subject: [PATCH 135/217] Tweak ConstGenParticlePtr and ConstGenVertexPtr
 definitions for HepMC2

---
 Generators/AtlasHepMC/AtlasHepMC/GenParticle_fwd.h | 1 +
 Generators/AtlasHepMC/AtlasHepMC/GenVertex.h       | 3 ++-
 Generators/AtlasHepMC/AtlasHepMC/GenVertex_fwd.h   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Generators/AtlasHepMC/AtlasHepMC/GenParticle_fwd.h b/Generators/AtlasHepMC/AtlasHepMC/GenParticle_fwd.h
index 06e26fead4d6..6a6057016f83 100644
--- a/Generators/AtlasHepMC/AtlasHepMC/GenParticle_fwd.h
+++ b/Generators/AtlasHepMC/AtlasHepMC/GenParticle_fwd.h
@@ -13,6 +13,7 @@ typedef HepMC3::ConstGenParticlePtr ConstGenParticlePtr;
 namespace HepMC {
 class GenParticle;
 typedef GenParticle* GenParticlePtr;
+typedef const GenParticle* ConstGenParticlePtr;
 }
 #endif
 #endif
diff --git a/Generators/AtlasHepMC/AtlasHepMC/GenVertex.h b/Generators/AtlasHepMC/AtlasHepMC/GenVertex.h
index 501c2b58832f..25987601a67f 100644
--- a/Generators/AtlasHepMC/AtlasHepMC/GenVertex.h
+++ b/Generators/AtlasHepMC/AtlasHepMC/GenVertex.h
@@ -41,12 +41,13 @@ inline void* raw_pointer(GenVertexPtr p){ return p.get();}
 #include "HepMC/GenVertex.h"
 namespace HepMC {
 typedef HepMC::GenVertex* GenVertexPtr;
-typedef HepMC::GenVertex* const  ConstGenVertexPtr;
+typedef const HepMC::GenVertex* ConstGenVertexPtr;
 inline GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos = HepMC::FourVector(0.0,0.0,0.0,0.0), const int i=0) {
     return new HepMC::GenVertex(pos,i);
 }
 inline int barcode(ConstGenVertexPtr p){ return p->barcode();}
 inline void* raw_pointer(GenVertexPtr p){ return p;}
+inline const void* raw_pointer(ConstGenVertexPtr p){ return p;}
 inline std::ostream& operator<<( std::ostream& os, const GenVertex* v ) { if (v) return os<<(*v); else return os;} 
 }
 #endif
diff --git a/Generators/AtlasHepMC/AtlasHepMC/GenVertex_fwd.h b/Generators/AtlasHepMC/AtlasHepMC/GenVertex_fwd.h
index 680b4f2d6303..e6396810d2bc 100644
--- a/Generators/AtlasHepMC/AtlasHepMC/GenVertex_fwd.h
+++ b/Generators/AtlasHepMC/AtlasHepMC/GenVertex_fwd.h
@@ -13,6 +13,7 @@ typedef HepMC3::ConstGenVertexPtr ConstGenVertexPtr;
 namespace HepMC {
 class GenVertex;
 typedef HepMC::GenVertex* GenVertexPtr;
+typedef const HepMC::GenVertex* ConstGenVertexPtr;
 }
 #endif
 #endif
-- 
GitLab


From 5e545bdb2fde7d336793814a5e6322edb85c9b64 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 14:10:34 +0200
Subject: [PATCH 136/217] Migrate MCTruth package to use (Const)GenParticlePtr

---
 .../G4Sim/MCTruth/MCTruth/EventInformation.h  | 14 ++++----
 .../MCTruth/PrimaryParticleInformation.h      | 34 +++++++++----------
 .../G4Sim/MCTruth/MCTruth/TrackInformation.h  | 10 +++---
 .../G4Sim/MCTruth/MCTruth/VTrackInformation.h | 32 ++++++++---------
 .../src/PrimaryParticleInformation.cxx        | 21 ++++++------
 .../G4Sim/MCTruth/src/TrackInformation.cxx    |  8 ++---
 .../G4Sim/MCTruth/src/VTrackInformation.cxx   | 12 +++----
 7 files changed, 65 insertions(+), 66 deletions(-)

diff --git a/Simulation/G4Sim/MCTruth/MCTruth/EventInformation.h b/Simulation/G4Sim/MCTruth/MCTruth/EventInformation.h
index 9ea3748848af..9b3e6a2a5cc0 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/EventInformation.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/EventInformation.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef EventInformation_H
@@ -27,13 +27,13 @@ public:
         const G4ThreeVector GetVertexPosition() const;
         void Print() const {}
 
-        void SetCurrentPrimary(HepMC::GenParticle *p) {m_currentPrimary=p;}
+        void SetCurrentPrimary(HepMC::GenParticlePtr p) {m_currentPrimary=p;}
 
-        void SetCurrentlyTraced(HepMC::GenParticle *p) {m_currentlyTraced=p;}
+        void SetCurrentlyTraced(HepMC::GenParticlePtr p) {m_currentlyTraced=p;}
 
-        HepMC::GenParticle *GetCurrentPrimary() const {return m_currentPrimary;}
+        HepMC::GenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
 
-        HepMC::GenParticle *GetCurrentlyTraced() const {return m_currentlyTraced;}
+        HepMC::GenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
         int SecondaryParticleBarCode() {m_secondaryParticleBarCode++;
                                         return m_secondaryParticleBarCode;}
         int SecondaryVertexBarCode() {m_secondaryVertexBarCode--;
@@ -50,8 +50,8 @@ private:
         int m_secondaryParticleBarCode;
         int m_secondaryVertexBarCode;
         HepMC::GenEvent *m_theEvent;
-        HepMC::GenParticle *m_currentPrimary;
-        HepMC::GenParticle *m_currentlyTraced;
+        HepMC::GenParticlePtr m_currentPrimary;
+        HepMC::GenParticlePtr m_currentlyTraced;
         // These two are used by calibration hits as event-level flags
         // They correspond to the last barcode and step processed by an SD
         // Both are needed, because a particle might have only one step
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/PrimaryParticleInformation.h b/Simulation/G4Sim/MCTruth/MCTruth/PrimaryParticleInformation.h
index 13eb66a066fe..009e9e79883c 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/PrimaryParticleInformation.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/PrimaryParticleInformation.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef PrimaryParticleInformation_H
@@ -15,25 +15,25 @@ namespace ISF {
 
 class PrimaryParticleInformation: public G4VUserPrimaryParticleInformation {
 public:
-	PrimaryParticleInformation();
-	PrimaryParticleInformation(const HepMC::GenParticle*, const ISF::ISFParticle* isp=0);
-	const HepMC::GenParticle *GetHepMCParticle() const;
-	int GetParticleBarcode() const;
-	void SuggestBarcode(int bc);
-	void SetParticle(const HepMC::GenParticle*);
-	void Print() const {}
-	int GetRegenerationNr() {return  m_regenerationNr;}
-	void SetRegenerationNr(int i) {m_regenerationNr=i;}
-
-	void SetISFParticle(const ISF::ISFParticle* isp);
-	const ISF::ISFParticle* GetISFParticle() const;
+  PrimaryParticleInformation();
+  PrimaryParticleInformation(HepMC::ConstGenParticlePtr, const ISF::ISFParticle* isp=0);
+  HepMC::ConstGenParticlePtr GetHepMCParticle() const;
+  int GetParticleBarcode() const;
+  void SuggestBarcode(int bc);
+  void SetParticle(HepMC::ConstGenParticlePtr);
+  void Print() const {}
+  int GetRegenerationNr() {return  m_regenerationNr;}
+  void SetRegenerationNr(int i) {m_regenerationNr=i;}
+
+  void SetISFParticle(const ISF::ISFParticle* isp);
+  const ISF::ISFParticle* GetISFParticle() const;
 
 private:
-	const HepMC::GenParticle *m_theParticle;
-	const ISF::ISFParticle* m_theISFParticle;
+  HepMC::ConstGenParticlePtr m_theParticle{};
+  const ISF::ISFParticle* m_theISFParticle{};
 
-	int m_regenerationNr;
-	int m_barcode;
+  int m_regenerationNr{0};
+  int m_barcode{-1};
 };
 
 #endif
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/TrackInformation.h b/Simulation/G4Sim/MCTruth/MCTruth/TrackInformation.h
index 5d2e2f88203b..6726589ae766 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/TrackInformation.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/TrackInformation.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrackInformation_H
@@ -14,11 +14,11 @@ namespace ISF {
 class TrackInformation: public VTrackInformation {
 public:
 	TrackInformation();
-	TrackInformation(const HepMC::GenParticle*,const ISF::ISFParticle* baseIsp=0);
-	const HepMC::GenParticle *GetHepMCParticle() const;
+	TrackInformation(HepMC::ConstGenParticlePtr,const ISF::ISFParticle* baseIsp=0);
+	HepMC::ConstGenParticlePtr GetHepMCParticle() const;
 	const ISF::ISFParticle *GetBaseISFParticle() const;
 	int GetParticleBarcode() const;
-	void SetParticle(const HepMC::GenParticle*);
+	void SetParticle(HepMC::ConstGenParticlePtr);
 	void SetBaseISFParticle(const ISF::ISFParticle*);
 	void SetReturnedToISF(bool returned) {m_returnedToISF=returned;};
 	bool GetReturnedToISF() const {return m_returnedToISF;};
@@ -26,7 +26,7 @@ public:
 	int GetRegenerationNr() const {return m_regenerationNr;};
 private:
 	int m_regenerationNr;
-	const HepMC::GenParticle *m_theParticle;
+	HepMC::ConstGenParticlePtr m_theParticle;
 	const ISF::ISFParticle *m_theBaseISFParticle;
 	bool m_returnedToISF;
 };
diff --git a/Simulation/G4Sim/MCTruth/MCTruth/VTrackInformation.h b/Simulation/G4Sim/MCTruth/MCTruth/VTrackInformation.h
index 335ccf9f45d3..57d2a9f0d088 100644
--- a/Simulation/G4Sim/MCTruth/MCTruth/VTrackInformation.h
+++ b/Simulation/G4Sim/MCTruth/MCTruth/VTrackInformation.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef VTrackInformation_H
@@ -17,22 +17,22 @@ namespace ISF {
 
 class VTrackInformation: public G4VUserTrackInformation {
 public:
-	VTrackInformation(TrackClassification tc=Primary);
-	const HepMC::GenParticle *GetPrimaryHepMCParticle() const;
-	void  SetPrimaryHepMCParticle(const HepMC::GenParticle*);
-	virtual const HepMC::GenParticle *GetHepMCParticle() const;
-	virtual const ISF::ISFParticle *GetBaseISFParticle() const;
-	virtual bool GetReturnedToISF() const;
-	virtual int  GetParticleBarcode() const =0;
-	virtual void SetParticle(const HepMC::GenParticle*);
-	virtual void SetBaseISFParticle(const ISF::ISFParticle*);
-	virtual void SetReturnedToISF(bool) ;
-	virtual void Print() const {}
-	void SetClassification(TrackClassification tc) {m_classify=tc;}
-	TrackClassification GetClassification() {return m_classify;}
+  VTrackInformation(TrackClassification tc=Primary);
+  HepMC::ConstGenParticlePtr GetPrimaryHepMCParticle() const;
+  void  SetPrimaryHepMCParticle(HepMC::ConstGenParticlePtr);
+  virtual HepMC::ConstGenParticlePtr GetHepMCParticle() const;
+  virtual const ISF::ISFParticle *GetBaseISFParticle() const;
+  virtual bool GetReturnedToISF() const;
+  virtual int  GetParticleBarcode() const =0;
+  virtual void SetParticle(HepMC::ConstGenParticlePtr);
+  virtual void SetBaseISFParticle(const ISF::ISFParticle*);
+  virtual void SetReturnedToISF(bool) ;
+  virtual void Print() const {}
+  void SetClassification(TrackClassification tc) {m_classify=tc;}
+  TrackClassification GetClassification() {return m_classify;}
 private:
-	TrackClassification m_classify;
-	const HepMC::GenParticle *m_thePrimaryParticle;
+  TrackClassification m_classify;
+  HepMC::ConstGenParticlePtr m_thePrimaryParticle{};
 };
 
 #endif
diff --git a/Simulation/G4Sim/MCTruth/src/PrimaryParticleInformation.cxx b/Simulation/G4Sim/MCTruth/src/PrimaryParticleInformation.cxx
index 6f0a1f952c3a..c4a1e311f2a6 100644
--- a/Simulation/G4Sim/MCTruth/src/PrimaryParticleInformation.cxx
+++ b/Simulation/G4Sim/MCTruth/src/PrimaryParticleInformation.cxx
@@ -1,26 +1,25 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MCTruth/PrimaryParticleInformation.h"
 
-PrimaryParticleInformation::PrimaryParticleInformation() 
-  : m_theParticle(0),m_theISFParticle(0),m_regenerationNr(0),m_barcode(-1)
+PrimaryParticleInformation::PrimaryParticleInformation()
 {
 }
 
-PrimaryParticleInformation::PrimaryParticleInformation(const HepMC::GenParticle *p, const ISF::ISFParticle* isp):m_theParticle(p),m_theISFParticle(isp),m_regenerationNr(0),m_barcode(-1)
+PrimaryParticleInformation::PrimaryParticleInformation(HepMC::ConstGenParticlePtr p, const ISF::ISFParticle* isp):m_theParticle(p),m_theISFParticle(isp)
 {
 }
 
-const HepMC::GenParticle* PrimaryParticleInformation::GetHepMCParticle() const
+HepMC::ConstGenParticlePtr PrimaryParticleInformation::GetHepMCParticle() const
 {
-	return m_theParticle;
+  return m_theParticle;
 }
 
 const ISF::ISFParticle* PrimaryParticleInformation::GetISFParticle() const
 {
-	return m_theISFParticle;
+  return m_theISFParticle;
 }
 
 void PrimaryParticleInformation::SuggestBarcode(int bc)
@@ -33,15 +32,15 @@ void PrimaryParticleInformation::SuggestBarcode(int bc)
 
 int PrimaryParticleInformation::GetParticleBarcode() const
 {
-	return m_theParticle?m_theParticle->barcode():m_barcode;
+  return m_theParticle?HepMC::barcode(m_theParticle):m_barcode;
 }
 
-void PrimaryParticleInformation::SetParticle(const HepMC::GenParticle* p)
+void PrimaryParticleInformation::SetParticle(HepMC::ConstGenParticlePtr p)
 {
-	m_theParticle=p;
+  m_theParticle=p;
 }
 
 void PrimaryParticleInformation::SetISFParticle(const ISF::ISFParticle* p)
 {
-	m_theISFParticle=p;
+  m_theISFParticle=p;
 }
diff --git a/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx b/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx
index ca8d9694a832..fcaa59ba6541 100644
--- a/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx
+++ b/Simulation/G4Sim/MCTruth/src/TrackInformation.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MCTruth/TrackInformation.h"
@@ -9,7 +9,7 @@ TrackInformation::TrackInformation():m_regenerationNr(0),m_theParticle(0),m_theB
 {
 }
 
-TrackInformation::TrackInformation(const HepMC::GenParticle *p,const ISF::ISFParticle* baseIsp):
+TrackInformation::TrackInformation(HepMC::ConstGenParticlePtr p,const ISF::ISFParticle* baseIsp):
     m_regenerationNr(0),
     m_theParticle(p),
     m_theBaseISFParticle(baseIsp),
@@ -17,7 +17,7 @@ TrackInformation::TrackInformation(const HepMC::GenParticle *p,const ISF::ISFPar
 {
 }
 
-const HepMC::GenParticle* TrackInformation::GetHepMCParticle() const
+HepMC::ConstGenParticlePtr TrackInformation::GetHepMCParticle() const
 {
   return m_theParticle;
 }
@@ -31,7 +31,7 @@ int TrackInformation::GetParticleBarcode() const
   return ( m_theParticle ? m_theParticle->barcode() : 0 );
 }
 
-void TrackInformation::SetParticle(const HepMC::GenParticle* p)
+void TrackInformation::SetParticle(HepMC::ConstGenParticlePtr p)
 {
   m_theParticle=p;
 }
diff --git a/Simulation/G4Sim/MCTruth/src/VTrackInformation.cxx b/Simulation/G4Sim/MCTruth/src/VTrackInformation.cxx
index 4f22d902bd4b..022afaf4f887 100644
--- a/Simulation/G4Sim/MCTruth/src/VTrackInformation.cxx
+++ b/Simulation/G4Sim/MCTruth/src/VTrackInformation.cxx
@@ -1,25 +1,25 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MCTruth/VTrackInformation.h"
 
-VTrackInformation::VTrackInformation(TrackClassification tc):m_classify(tc),m_thePrimaryParticle(0)
+VTrackInformation::VTrackInformation(TrackClassification tc):m_classify(tc)
 {
 }
 
-const HepMC::GenParticle* VTrackInformation::GetPrimaryHepMCParticle() const
+HepMC::ConstGenParticlePtr VTrackInformation::GetPrimaryHepMCParticle() const
 {
   return m_thePrimaryParticle;
 }
 
-void VTrackInformation::SetPrimaryHepMCParticle(const HepMC::GenParticle* p)
+void VTrackInformation::SetPrimaryHepMCParticle(HepMC::ConstGenParticlePtr p)
 {
   m_thePrimaryParticle=p;
 }
 
 
-const HepMC::GenParticle* VTrackInformation::GetHepMCParticle() const
+HepMC::ConstGenParticlePtr VTrackInformation::GetHepMCParticle() const
 {
   return 0;
 }
@@ -34,7 +34,7 @@ bool VTrackInformation::GetReturnedToISF() const
   return false;
 }
 
-void VTrackInformation::SetParticle(const HepMC::GenParticle* /*p*/)
+void VTrackInformation::SetParticle(HepMC::ConstGenParticlePtr /*p*/)
 {
   // you should not call this, perhaps throw an exception?
   std::cerr<<"ERROR  VTrackInformation::SetParticle() not supported  "<<std::endl;
-- 
GitLab


From 5b453dd87788a54186dbdb355b8abe5f9b0ccb1e Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 8 Jul 2020 17:02:13 +0100
Subject: [PATCH 137/217] fix thread safety warning

---
 .../TRT_Monitoring/src/TRT_Monitoring_Tool.cxx              | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
index 72f743fe56e2..6f733650688d 100644
--- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
+++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
@@ -2452,7 +2452,7 @@ StatusCode TRT_Monitoring_Tool::fillTRTTracks(const TrackCollection& trackCollec
 	}
 
 	for (; p_trk != trackCollection.end(); ++p_trk) {
-		const std::unique_ptr<const Trk::TrackSummary> summary(m_TrackSummaryTool->createSummary(*(*p_trk)));
+		std::unique_ptr<const Trk::TrackSummary> summary = m_TrackSummaryTool->summary(*(*p_trk));
 		int nTRTHits = summary->get(Trk::numberOfTRTHits);
 
 		if (nTRTHits < m_minTRThits) continue;
@@ -3580,7 +3580,7 @@ StatusCode TRT_Monitoring_Tool::fillTRTEfficiency(const TrackCollection& combTra
 			continue;
 		}
 
-		const std::unique_ptr<const Trk::TrackSummary> summary(m_TrackSummaryTool->createSummary(*(*track)));
+		std::unique_ptr<const Trk::TrackSummary> summary = m_TrackSummaryTool->summary(*(*track));
 		int n_trt_hits = summary->get(Trk::numberOfTRTHits);
 		int n_sct_hits = summary->get(Trk::numberOfSCTHits);
 		int n_pixel_hits = summary->get(Trk::numberOfPixelHits);
@@ -3857,7 +3857,7 @@ StatusCode TRT_Monitoring_Tool::fillTRTHighThreshold(const TrackCollection& trac
 
 		DataVector<const Trk::TrackStateOnSurface>::const_iterator TSOSItBegin     = trackStates->begin();
 		DataVector<const Trk::TrackStateOnSurface>::const_iterator TSOSItEnd       = trackStates->end();
-		const std::unique_ptr<const Trk::TrackSummary> summary(m_TrackSummaryTool->createSummary(*(*p_trk)));
+		std::unique_ptr<const Trk::TrackSummary> summary = m_TrackSummaryTool->summary(*(*p_trk));
 		int trt_hits = summary->get(Trk::numberOfTRTHits);
 		int sct_hits = summary->get(Trk::numberOfSCTHits);
 		int pixel_hits = summary->get(Trk::numberOfPixelHits);
-- 
GitLab


From 873d13704ee959a9a2bdc3c597a39a04545d44c9 Mon Sep 17 00:00:00 2001
From: Werner Wiedenmann <Werner.Wiedenmann@cern.ch>
Date: Wed, 8 Jul 2020 18:03:03 +0200
Subject: [PATCH 138/217] Add protection for duplicate ROB requests to
 HltROBDataProviderSvc (see also issue in ATR-21615)

---
 .../TrigServices/src/HltROBDataProviderSvc.cxx       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
index 20c566df027c..cd56cc19a0e9 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
@@ -16,6 +16,9 @@
 
 // Athena
 
+// STL includes
+#include <algorithm>    // std::find
+
 HltROBDataProviderSvc::HltROBDataProviderSvc(const std::string& name, ISvcLocator* pSvcLocator) :
   base_class(name, pSvcLocator)
 {
@@ -338,7 +341,7 @@ void HltROBDataProviderSvc::getROBData(const EventContext& context,
   // check input ROB list against cache
   eventCache_checkRobListToCache(cache, robIds, robFragments, robIds_missing) ;
 
-  //  missing ROB fragments from the DCM and add them to the cache
+  // no missing ROB fragments, return the found ROB fragments 
   if (robIds_missing.size() == 0) {
     ATH_MSG_DEBUG( __FUNCTION__ << ": All requested ROB Ids were found in the cache. "); 
     return;
@@ -552,6 +555,13 @@ void HltROBDataProviderSvc::eventCache_checkRobListToCache(EventCache* cache, co
 
   for (uint32_t id : robIds_toCheck) {
 
+    // check for duplicate IDs on the list of missing ROBs
+    std::vector<uint32_t>::iterator missing_it = std::find(robIds_missing.begin(), robIds_missing.end(), id);
+    if (missing_it != robIds_missing.end()) {
+      ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id : 0x" << MSG::hex << id << MSG::dec <<" is already on the list of missing IDs.");
+      continue;
+    }
+
     // check if ROB is already in cache
     ROBMAP::const_iterator map_it = cache->robmap.find(id);
     if (map_it != cache->robmap.end()) {
-- 
GitLab


From 5d9bded9ab8ed6677cf2431a2f79ef7621bfee68 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 8 Jul 2020 17:19:45 +0100
Subject: [PATCH 139/217] TRT_CalibTools fix thread safety warnings

---
 .../InDetCalibTools/TRT_CalibTools/src/FillAlignTrkInfo.cxx | 6 ++----
 .../TRT_CalibTools/src/TRTCalibTrackSelectionTool.cxx       | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/FillAlignTrkInfo.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/FillAlignTrkInfo.cxx
index 1375c3e2de64..bf70599abd18 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/FillAlignTrkInfo.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/FillAlignTrkInfo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -70,13 +70,11 @@ bool FillAlignTrkInfo::fill(const Trk::Track* aTrack, TRT::TrackInfo* output,
   (*output)[TRT::Track::degreesOfFreedom]=aTrack->fitQuality()->numberDoF();
 
   // implicit memory allocation in createSummary, need to clean up later 
-  const Trk::TrackSummary* summary = m_TrackSummaryTool->createSummary(*aTrack);
+  std::unique_ptr<Trk::TrackSummary> summary = m_TrackSummaryTool->summary(*aTrack);
   (*output)[TRT::Track::numberOfPixelHits]=summary->get(Trk::numberOfPixelHits) ;
   (*output)[TRT::Track::numberOfSCTHits]=summary->get(Trk::numberOfSCTHits) ;
   (*output)[TRT::Track::numberOfTRTHits]=summary->get(Trk::numberOfTRTHits) ;
 
-  // fix to coverity 118333
-  delete summary;
 
   // All ok
   if (msgLvl(MSG::DEBUG)) msg() << "Track info filled .... " << endmsg;
diff --git a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibTrackSelectionTool.cxx b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibTrackSelectionTool.cxx
index 588fe02932a3..1160ac288421 100755
--- a/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibTrackSelectionTool.cxx
+++ b/InnerDetector/InDetCalibTools/TRT_CalibTools/src/TRTCalibTrackSelectionTool.cxx
@@ -72,7 +72,7 @@ bool TRTCalibTrackSelectionTool::isAccepted(const Trk::Track* pTrack) const
   float eta=-log(tan(theta/2));
   if (m_EtaMin< m_EtaMax && (eta < m_EtaMin || eta > m_EtaMax) ) return false;
 
-  std::unique_ptr<const Trk::TrackSummary> summary(m_TrackSummaryTool->createSummary(*pTrack));
+  std::unique_ptr<const Trk::TrackSummary> summary = m_TrackSummaryTool->summary(*pTrack);
   if(summary->get(Trk::numberOfTRTHits)<m_MinTRTHits) return false;
   if(summary->get(Trk::numberOfPixelHits)<m_MinPixelHits) return false;
   if(summary->get(Trk::numberOfSCTHits)<m_MinSCTHits) return false;
-- 
GitLab


From 58b4745c8837090119fa48f4b0965770007aa5a4 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 15:16:55 +0200
Subject: [PATCH 140/217] TrigHLTJetHypoUnitTests: Cleanup CMake config

---
 .../TrigHLTJetHypoUnitTests/CMakeLists.txt    | 28 +++++--------------
 .../python/plot_av_times.py                   |  2 +-
 .../python/plot_times.py                      |  1 +
 .../python/plot_tot_times.py                  |  2 +-
 4 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/CMakeLists.txt b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/CMakeLists.txt
index 2b5aa6891ebb..b04652d5be4f 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/CMakeLists.txt
@@ -1,16 +1,8 @@
-# $Id: CMakeLists.txt 727053 2016-03-01 14:24:32Z krasznaa $
-################################################################################
-# Package: TrigHLTJetHypoUnitTests
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigHLTJetHypoUnitTests )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs(
-   PRIVATE
-   Trigger/TrigHypothesis/TrigHLTJetHypo )
-
 # External dependencies:
 find_package( ROOT COMPONENTS Core Physics )
 find_package( GMock )
@@ -18,18 +10,14 @@ find_package( GMock )
 atlas_add_library( TrigHLTJetHypoUnitTestsLib
                    src/*.cxx
                    exerciser/*.cxx
-                   PUBLIC_HEADERS TrigHLTJetHypoUnitTests
-                   # PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES xAODJet GaudiKernel TrigParticle TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib DecisionHandlingLib TrigHLTJetHypoLib 
-                   # PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
-		   )
+                   NO_PUBLIC_HEADERS
+                   LINK_LIBRARIES TrigHLTJetHypoLib
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel xAODJet )
 
 atlas_add_component( TrigHLTJetHypoUnitTests
                      exerciser/components/*.cxx
-                     LINK_LIBRARIES  TrigHLTJetHypoUnitTestsLib)
+                     LINK_LIBRARIES TrigHLTJetHypoUnitTestsLib)
 		     
-atlas_install_headers( TrigHLTJetHypoUnitTests )
-
 # Test(s) in the package:
 atlas_add_test( TrigHLTJetHypoTimerTest
    SOURCES src/Timer.cxx
@@ -55,9 +43,7 @@ atlas_add_test( TrigHLTJetHypoUnitTests
    tests/xAODJetCollectorTest.cxx
    tests/PartitionsGrouperTest.cxx
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} GoogleTestTools ${GMOCK_LIBRARIES}
-   TrigHLTJetHypoLib
-   TrigHLTJetHypoUnitTestsLib)
+   LINK_LIBRARIES ${ROOT_LIBRARIES} GoogleTestTools ${GMOCK_LIBRARIES} TrigHLTJetHypoLib TrigHLTJetHypoUnitTestsLib )
    
 # Install files from the package:
-atlas_install_python_modules( python/*.py ) 
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_av_times.py b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_av_times.py
index 4c68e7deb34f..510cba5afd72 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_av_times.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_av_times.py
@@ -1,8 +1,8 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from __future__ import print_function
 from plot_times import times
 import pylab as pl
 import sys
-import os
 import glob
 
 if len(sys.argv) < 3:
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_times.py b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_times.py
index 7acac9d6a44b..40b30a3f3d68 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_times.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_times.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from __future__ import print_function
 import pylab as pl
 import sys
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_tot_times.py b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_tot_times.py
index ef4c961c3023..76e06c76943f 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_tot_times.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/python/plot_tot_times.py
@@ -1,8 +1,8 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from __future__ import print_function
 from plot_times import times
 import pylab as pl
 import sys
-import os
 import glob
 from collections import defaultdict
 import itertools
-- 
GitLab


From 9a747cda965719e66040af6ef8fca81af10d855f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 15:33:23 +0200
Subject: [PATCH 141/217] TrigLongLivedParticlesHypo: Package cleanup

- cleanup cmake configuration and link dependencies
- remove CLHEP dependency
- enable flake8
- delete obsolete job options
---
 .../TrigLongLivedParticlesHypo/CMakeLists.txt | 32 +++----------------
 .../MuonClusterHypo.h                         |  0
 .../MuonClusterIsolationHypo.h                |  0
 .../TrigCaloRatioHypo.h                       |  0
 .../TrigL2HVJetHypo.h                         |  0
 .../TrigL2HVJetHypoAllCuts.h                  |  0
 .../TrigL2HVJetHypoTrk.h                      |  0
 .../TrigLoFRemovalHypo.h                      |  0
 .../TrigNewLoFHypo.h                          |  0
 .../TrigLongLivedParticlesHypoConfig.py       | 26 +++++++--------
 .../share/TriggerConfig_MuClusterHypo.py      | 22 -------------
 .../share/jobOfragment_MuonClusterHypo.py     |  5 ---
 .../src/MuonClusterHypo.cxx                   |  3 +-
 .../src/MuonClusterIsolationHypo.cxx          |  3 +-
 .../src/TrigCaloRatioHypo.cxx                 | 10 +++---
 .../src/TrigL2HVJetHypo.cxx                   |  6 ++--
 .../src/TrigL2HVJetHypoAllCuts.cxx            |  6 ++--
 .../src/TrigL2HVJetHypoTrk.cxx                |  3 +-
 .../src/TrigLoFRemovalHypo.cxx                |  3 +-
 .../src/TrigNewLoFHypo.cxx                    |  3 +-
 20 files changed, 31 insertions(+), 91 deletions(-)
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigCaloRatioHypo.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypo.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoAllCuts.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoTrk.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigLoFRemovalHypo.h
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigNewLoFHypo.h
 delete mode 100755 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/TriggerConfig_MuClusterHypo.py
 delete mode 100755 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/jobOfragment_MuonClusterHypo.py
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigCaloRatioHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoAllCuts.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoTrk.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigLoFRemovalHypo.cxx
 mode change 100755 => 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigNewLoFHypo.cxx

diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/CMakeLists.txt
index 19b891eaa29b..7b1dcb881865 100644
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/CMakeLists.txt
@@ -1,41 +1,17 @@
-################################################################################
-# Package: TrigLongLivedParticlesHypo
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigLongLivedParticlesHypo )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          PRIVATE
-                          Calorimeter/CaloEvent
-                          Control/CxxUtils
-                          Event/xAOD/xAODJet
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTrigger
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigParticle )
-
 # External dependencies:
-find_package( CLHEP )
 find_package( tdaq-common COMPONENTS eformat )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
 
 # Component(s) in the package:
 atlas_add_component( TrigLongLivedParticlesHypo
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib CaloEvent CxxUtils xAODJet xAODTracking xAODTrigger GaudiKernel TrigParticle InDetIdentifier InDetPrepRawData IRegionSelector TrkSpacePoint xAODEventInfo)
+                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloEvent CxxUtils GaudiKernel IRegionSelector InDetIdentifier InDetPrepRawData TrigCaloEvent TrigInDetEvent TrigInterfacesLib TrigParticle TrigSteeringEvent TrigTimeAlgsLib TrkSpacePoint xAODEventInfo xAODJet xAODTracking xAODTrigger )
 
 # Install files from the package:
-atlas_install_headers( TrigLongLivedParticlesHypo )
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigCaloRatioHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigCaloRatioHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoAllCuts.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoAllCuts.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoTrk.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigL2HVJetHypoTrk.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigLoFRemovalHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigLoFRemovalHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigNewLoFHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/TrigNewLoFHypo.h
old mode 100755
new mode 100644
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py
index 6f45055af6db..cd608cc9c1f8 100755
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py
@@ -1,11 +1,7 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf import *
-from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoMonitoring import *
-from AthenaCommon.SystemOfUnits import MeV, GeV
-from AthenaCommon.AppMgr import ToolSvc
-from AthenaCommon.Logging import logging
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+import TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf as Conf
+from AthenaCommon.SystemOfUnits import GeV
 
 
 def getCaloRatioHypoInstance( instance, threshold, logratio, dotrackiso):
@@ -25,7 +21,7 @@ def getCaloRatioHypoInstance( instance, threshold, logratio, dotrackiso):
                           name=name )
 
 
-class MuonClusterHypoConfig (MuonClusterHypo):
+class MuonClusterHypoConfig (Conf.MuonClusterHypo):
     __slots__ = []
     def __init__(self, name, maxEta, midEta):
 
@@ -38,7 +34,7 @@ class MuonClusterHypoConfig (MuonClusterHypo):
         self.maxEta              = maxEta
         self.midEta              = midEta
 
-class MuonClusterIsolationHypoConfig (MuonClusterIsolationHypo):
+class MuonClusterIsolationHypoConfig (Conf.MuonClusterIsolationHypo):
     __slots__ = []
     def __init__(self, name, maxEta, midEta, numJet, numTrk, doIsolation):
         super( MuonClusterIsolationHypoConfig, self ).__init__( name )
@@ -63,7 +59,7 @@ class MuonClusterIsolationHypoConfig (MuonClusterIsolationHypo):
         self.nTrk                = numTrk
         self.doIsolation         = doIsolation
 
-class L2HVJetHypoAllCutsBase (TrigL2HVJetHypoAllCuts):
+class L2HVJetHypoAllCutsBase (Conf.TrigL2HVJetHypoAllCuts):
     __slots__ = []
     def __init__(self, name):
         super( L2HVJetHypoAllCutsBase, self ).__init__( name )
@@ -114,7 +110,7 @@ class L2HVJetHypoAllCuts_doCleaning (L2HVJetHypoAllCuts):
         self.jetTimeCellsThr = 25
 
 
-class L2HVJetHypoBase (TrigL2HVJetHypo):
+class L2HVJetHypoBase (Conf.TrigL2HVJetHypo):
     __slots__ = []
     def __init__(self, name):
         super( L2HVJetHypoBase, self ).__init__( name )
@@ -165,7 +161,7 @@ class L2HVJetHypo_doCleaning (L2HVJetHypo):
         self.jetTimeCellsThr = 25
 
 
-class L2HVJetHypoTrkBase (TrigL2HVJetHypoTrk):
+class L2HVJetHypoTrkBase (Conf.TrigL2HVJetHypoTrk):
     __slots__ = []
     def __init__(self, name):
         super( L2HVJetHypoTrkBase, self ).__init__( name )
@@ -187,7 +183,7 @@ class L2HVJetHypoTrk (L2HVJetHypoTrkBase):
         super( L2HVJetHypoTrk, self ).__init__( name )
 
 
-class TrigNewLoFHypoConfig (TrigNewLoFHypo):
+class TrigNewLoFHypoConfig (Conf.TrigNewLoFHypo):
     __slots__ = []
     def __init__(self, name = "TrigNewLoFHypoConfig"):
         super( TrigNewLoFHypoConfig, self ).__init__( name )
@@ -197,7 +193,7 @@ class TrigNewLoFHypoConfig (TrigNewLoFHypo):
         self.LoFCellContSize     = 4
 
 
-class TrigLoFRemovalHypoConfig (TrigLoFRemovalHypo):
+class TrigLoFRemovalHypoConfig (Conf.TrigLoFRemovalHypo):
     __slots__ = []
     def __init__(self, name = "TrigLoFRemovalHypoConfig"):
         super( TrigLoFRemovalHypoConfig, self ).__init__( name )
@@ -217,7 +213,7 @@ class TrigLoFRemovalHypoConfig (TrigLoFRemovalHypo):
         self.LoFCellContSize     = 4
 
 
-class CaloRatioHypo (TrigCaloRatioHypo):
+class CaloRatioHypo (Conf.TrigCaloRatioHypo):
     __slots__ = []
     def __init__(self, threshold, logratio, dotrackiso, name):
         super( CaloRatioHypo, self ).__init__( name )
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/TriggerConfig_MuClusterHypo.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/TriggerConfig_MuClusterHypo.py
deleted file mode 100755
index 4330c5fe324d..000000000000
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/TriggerConfig_MuClusterHypo.py
+++ /dev/null
@@ -1,22 +0,0 @@
-include.block("TrigLongLivedParticlesHypo/TriggerConfig_MuClusterHypo.py")
-
-class TriggerConfig_MuClusterHypo:
-    
-    def __init__(self, level, type = None, threshold = None, isIsolated = None):
-
-        if type == "muon":
-            self.__instname__ = "muCluster_Muon_" + level
-            self.__sequence__ = "MuClusterHypo/MuClusterHypo/Muon_"
-        if type == "900GeV":
-            self.__instname__ = "muCluster_900GeV_" + level
-            self.__sequence__ = "MuClusterHypo/MuClusterHypo/900GeV_"
-        
-        #self.__sequence__ += threshold
-
-    def instanceName(self):
-        return self.__instname__
-
-    def classAndInstanceName(self):
-        return [ self.__sequence__ ]
-
-include ("TrigLongLivedParticlesHypo/jobOfragment_MuClusterHypo.py")
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/jobOfragment_MuonClusterHypo.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/jobOfragment_MuonClusterHypo.py
deleted file mode 100755
index 8045aa074b07..000000000000
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/share/jobOfragment_MuonClusterHypo.py
+++ /dev/null
@@ -1,5 +0,0 @@
-theApp.Dlls += [ "TrigLongLivedParticlesHypo" ]
-#
-# so far only one instance of the muon cluster hypothesis 
-# algo is needed
-MuonClusterHypo = Algorithm( "MuonClusterHypo" )
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
old mode 100755
new mode 100644
index 99f147e320ff..5323c57ac4b5
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //
@@ -13,7 +13,6 @@
 #include "xAODTrigger/TrigComposite.h"
 #include "xAODTrigger/TrigCompositeContainer.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 class ISvcLocator;
 
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
old mode 100755
new mode 100644
index cff42da580fd..297dbc65ee20
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //
@@ -13,7 +13,6 @@
 #include "xAODTrigger/TrigComposite.h"
 #include "xAODTrigger/TrigCompositeContainer.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 class ISvcLocator;
 
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigCaloRatioHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigCaloRatioHypo.cxx
old mode 100755
new mode 100644
index 77d70149342f..0213c140b2d7
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigCaloRatioHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigCaloRatioHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ************************************************************
@@ -23,7 +23,7 @@
 
 #include "CxxUtils/fpcompare.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 //** ----------------------------------------------------------------------------------------------------------------- **//
 
@@ -31,7 +31,7 @@
 TrigCaloRatioHypo::TrigCaloRatioHypo(const std::string& name, ISvcLocator* pSvcLocator):
   HLT::HypoAlgo(name, pSvcLocator) {
 
-  declareProperty("EtCut",       m_etCut = 30*CLHEP::GeV, "cut value forthe jet et"); 
+  declareProperty("EtCut",       m_etCut = 30*Gaudi::Units::GeV, "cut value forthe jet et");
   declareProperty("LogRatioCut", m_logRatioCut = 1.2, "cut value for the jet energy ratio"); 
   declareProperty("PtMinID",     m_ptCut = 2000.0, "minimum track Pt in MeV for the isolation requirement");
   declareProperty("TrackCut",    m_trackCut = 0, "minimum number of tracks for the isolation requirement");
@@ -165,7 +165,7 @@ HLT::ErrorCode TrigCaloRatioHypo::hltExecute(const HLT::TriggerElement* outputTE
     
     if (jetEt > m_etCut && std::fabs(jetEta) <= m_etaCut) {
       
-      m_jetEt.push_back(jetEt/CLHEP::GeV);
+      m_jetEt.push_back(jetEt/Gaudi::Units::GeV);
       m_jetEta.push_back(jetEta); 
       m_jetPhi.push_back(jetPhi);
       m_logRatio = jetRatio;
@@ -177,7 +177,7 @@ HLT::ErrorCode TrigCaloRatioHypo::hltExecute(const HLT::TriggerElement* outputTE
       
     if (jetEt > m_etCut && std::fabs(jetEta) <= m_etaCut && jetRatio <= m_logRatioCut) {
 	
-      m_jetEt.push_back(jetEt/CLHEP::GeV);
+      m_jetEt.push_back(jetEt/Gaudi::Units::GeV);
       m_jetEta.push_back(jetEta); 
       m_jetPhi.push_back(jetPhi);
       m_logRatio = jetRatio;
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypo.cxx
old mode 100755
new mode 100644
index f8459986f730..9847c7505e15
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -16,6 +16,7 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
@@ -28,7 +29,6 @@
 
 #include "CxxUtils/fpcompare.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 
 class ISvcLocator;
@@ -40,7 +40,7 @@ class ISvcLocator;
 TrigL2HVJetHypo::TrigL2HVJetHypo(const std::string& name, ISvcLocator* pSvcLocator):
   HLT::HypoAlgo(name, pSvcLocator) {
 
-  declareProperty("Etcut_L2",            m_EtCut_L2 = 35*CLHEP::GeV, "cut value for L2 jet et"); 
+  declareProperty("Etcut_L2",            m_EtCut_L2 = 35*Gaudi::Units::GeV, "cut value for L2 jet et");
   declareProperty("LRaticout_L2",        m_LRatioCut_L2 = 1., "cut value for L2 jet log10 of had over em energy ratio"); 
   declareProperty("doMonitoring_L2",     m_doMonitoring = true, "switch on/off monitoring" );
   declareProperty("AcceptAll",           m_acceptAll=false);
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoAllCuts.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoAllCuts.cxx
old mode 100755
new mode 100644
index 024b2e25107e..5ca6ec829732
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoAllCuts.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoAllCuts.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -16,6 +16,7 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/SystemOfUnits.h"
 
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
@@ -29,7 +30,6 @@
 #include "CxxUtils/fpcompare.h"
 #include "CxxUtils/phihelper.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 
 class ISvcLocator;
@@ -41,7 +41,7 @@ class ISvcLocator;
 TrigL2HVJetHypoAllCuts::TrigL2HVJetHypoAllCuts(const std::string& name, ISvcLocator* pSvcLocator):
   HLT::HypoAlgo(name, pSvcLocator) {
 
-  declareProperty("Etcut_L2",            m_EtCut_L2 = 35*CLHEP::GeV, "cut value for L2 jet et"); 
+  declareProperty("Etcut_L2",            m_EtCut_L2 = 35*Gaudi::Units::GeV, "cut value for L2 jet et");
   declareProperty("LRaticout_L2",        m_LRatioCut_L2 = 1., "cut value for L2 jet log10 of had over em energy ratio"); 
   declareProperty("doMonitoring_L2",     m_doMonitoring = true, "switch on/off monitoring" );
   declareProperty("AcceptAll",           m_acceptAll=false);
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoTrk.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoTrk.cxx
old mode 100755
new mode 100644
index e95162aac408..845de575dc8d
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoTrk.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigL2HVJetHypoTrk.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -27,7 +27,6 @@
 #include "TrigInDetEvent/TrigInDetTrackHelper.h"
 
 #include "CxxUtils/phihelper.h"
-#include "CLHEP/Units/SystemOfUnits.h"
 
 
 class ISvcLocator;
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigLoFRemovalHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigLoFRemovalHypo.cxx
old mode 100755
new mode 100644
index b94870f887c5..59f602bd74eb
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigLoFRemovalHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigLoFRemovalHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -28,7 +28,6 @@
 #include "CaloEvent/CaloCellContainer.h"
 #include "CaloEvent/CaloCell.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 
 
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigNewLoFHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigNewLoFHypo.cxx
old mode 100755
new mode 100644
index c21f825216da..0c0dd63143ba
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigNewLoFHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/TrigNewLoFHypo.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <algorithm>
@@ -19,7 +19,6 @@
 #include "CaloEvent/CaloCellContainer.h"
 #include "CaloEvent/CaloCell.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
 
 
 class ISvcLocator;
-- 
GitLab


From 62d4d2547111cc8480053a081dbc918190866902 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Wed, 8 Jul 2020 19:18:24 +0200
Subject: [PATCH 142/217] TrigValidation: Clean up obsolete files

---
 .../TrigAnalysisTest/bin/compareTrigSizes.py  |  246 ---
 .../share/testAthenaTrigRDOtoTAG.py           |   61 -
 .../TrigP1Test/Testing/splitlog.py            |   83 -
 .../share/checklogTrigUpgradeTest.conf        |    4 -
 .../TrigUpgradeTest/share/photon.withViews.py |  159 --
 .../TrigUpgradeTest/share/testL1MC.py         |   72 -
 .../test/exec_TrigUpgradeTest_art_post.sh     |    4 +-
 .../TrigValTools/bin/filterREGTEST.py         |   35 -
 .../TrigValTools/bin/htmldiff.py              |   86 -
 .../TrigValTools/python/HTML.py               |  215 ---
 .../python/TrigValSteering/CheckSteps.py      |    4 +-
 .../TriggerTest/share/TriggerTestSilence.py   |  103 --
 .../TriggerTest/share/plotDecision.cxx        |   50 -
 .../TriggerTest/share/rob-ros-map.py          | 1623 -----------------
 .../share/testAthenaTrigRDO_standalone.py     |   27 -
 .../TriggerTest/share/testIDAthenaTrigRDO.py  |  107 --
 .../share/testIDAthenaTrigRDO_preRTTtest.py   |   26 -
 .../share/testLVL1CTPAthenaTrigRDO.py         |   80 -
 18 files changed, 3 insertions(+), 2982 deletions(-)
 delete mode 100755 Trigger/TrigValidation/TrigAnalysisTest/bin/compareTrigSizes.py
 delete mode 100644 Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigRDOtoTAG.py
 delete mode 100755 Trigger/TrigValidation/TrigP1Test/Testing/splitlog.py
 delete mode 100644 Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
 delete mode 100644 Trigger/TrigValidation/TrigUpgradeTest/share/photon.withViews.py
 delete mode 100644 Trigger/TrigValidation/TrigUpgradeTest/share/testL1MC.py
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/htmldiff.py
 delete mode 100644 Trigger/TrigValidation/TrigValTools/python/HTML.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/TriggerTestSilence.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/plotDecision.cxx
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/rob-ros-map.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/testAthenaTrigRDO_standalone.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO_preRTTtest.py
 delete mode 100644 Trigger/TrigValidation/TriggerTest/share/testLVL1CTPAthenaTrigRDO.py

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/bin/compareTrigSizes.py b/Trigger/TrigValidation/TrigAnalysisTest/bin/compareTrigSizes.py
deleted file mode 100755
index e188b7e2cd49..000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/bin/compareTrigSizes.py
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#import sys
-
-from checkFileTrigSize_RTT import *
-
-
-params = [
-
-#     Add/replace new files to compare sizes of trigger xAOD containers in this list.
-#     the format for adding new file /path/myAOD.pool.root for comparison:
-#
-#     ({'checkFile':'/path/myAOD.pool.root.checkFile'},'AODEDMSET', 'RELEASE_VERSION')
-#
-#     add ".checkFile" in the end of the file name!!!
-#     AODEDMSET and RELEASE_VERISON can take any string value, but the set of variables 
-#     AODEDMSET and RELEASE_VERSION must be unique for each entry in this params list!
-#     Otherwise the results will be not correct (you will see this in the output,
-#     some entries will be missing for some containers).
-#     To launch, navigate to TrigAnalysisTest/bin and do
-#
-#     ./compareTrigSizes.py
-#
-#     the output will be printed to a screen.
-
-
-   # ({'checkFile':'../../../../../../AtlasProduction210Xrel6_161023_checkTriggerSizeNODYN/run/AODFULL/myAOD.pool.root.checkFile'}, 'AODFULL'),
-   # ({'checkFile':'../../../../../../AtlasProduction210Xrel6_161023_checkTriggerSizeNODYN/run/AODFULLNODYN/myAOD.pool.root.checkFile'}, 'AODFULLNODYN'),
-   # ({'checkFile':'../../../../../../AtlasProduction210Xrel6_161023_checkTriggerSizeNODYN/run/AODSLIM/myAOD.pool.root.checkFile'}, 'AODSLIM'),
-   # ({'checkFile':'../../../../../../AtlasProduction210Xrel6_161023_checkTriggerSizeNODYN/run/AODSLIMNODYN/myAOD.pool.root.checkFile'}, 'AODSLIMNODYN'),
-   # ({'checkFile':'../../../../../../AtlasProduction207XYVAL_rel3_161005_checkTriggerSize/myAOD.pool.root.checkFile'},'20.7AODSLIM')
-
-    ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210Xrel6_161106_checkTrigSizeRyan/run/AODFULL/myAOD.pool.root.checkFile'},'AODFULL','21.0.X'),
-    ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210Xrel6_161106_checkTrigSizeRyan/run/AODFULLNODYN/myAOD.pool.root.checkFile'},'AODFULLNODYN','21.0.X'),
-    ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210Xrel6_161106_checkTrigSizeRyan/run/myAOD.pool.root.checkFile'},'AODSLIM','21.0.X'),
-    ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210Xrel6_161106_checkTrigSizeRyan/run/AODSLIMNODYN/myAOD.pool.root.checkFile'},'AODSLIMNODYN','21.0.X'),
-
-#   ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210XVALrel6_161106_checkTrigSizeRyan/run/AODFULL/myAOD.pool.root.checkFile'},'AODFULL'),
-#   ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210XVALrel6_161106_checkTrigSizeRyan/run/AODFULLNODYN/myAOD.pool.root.checkFile'},'AODFULLNODYN'),
-#   ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210XVALrel6_161106_checkTrigSizeRyan/run/myAOD.pool.root.checkFile'},'AODSLIM'),
-   ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction210XVALrel6_161106_checkTrigSizeRyan/run/AODSLIMNODYN/myAOD.pool.root.checkFile'},'AODSLIMNODYN','21.0.X-VAL'),
-   ({'checkFile':'/afs/cern.ch/work/o/okuprash/public/AtlasProduction207Xrel6_161106_checkTrigSizeRyan/myAOD.pool.root.checkFile'},'AODSLIM','20.7.X')
-
-]
-#params = {}
-
-# a delimiter to be used in office spreadsheet to separate data to columns
-spreadsheetDelimiter = ";"
-numberFormat = "%12s"
-
-versions = [] #'AODFULL', 'AODFULLNODYN', 'AODSLIM', 'AODSLIMNODYN', '20.7AODSLIM'
-releases = [] #'21.0.X', '21.0.X-VAL' etc
-
-# the order of elements in these lists will be kept the same throughout the code (the same as in input "params" list)
-for param in params:
-    versions.append( param[1] )
-    releases.append( param[2] )
-
-trigContainerLists = []
-trigSizesPerCategory = []
-trigTotalFileSizes = []
-trigTotalFileSizesLists = []
-trigTotalFileSizesCheckFile = []
-
-# launch checkFileTrigSize_RTT for each input file and store the output in variables
-for param in params:
-    r =  checkFileTrigSize_RTT(param[0])
-#    print "trigger container list:"
-#    print r.triggerAlgList
-    print "processing ",param
-    status = r.run()
-    print "done processing ",param
-#    print "trigger container list:"
-#    print r.triggerAlgList
-    trigContainerLists.append( (r.triggerAlgList, param[1], param[2]) )
-    trigSizesPerCategory.append( (r.triggerAlgSize, param[1], param[2]) )
-    trigTotalFileSizes.append( (r.totalAlgSize, param[1], param[2]) )
-    trigTotalFileSizesLists.append( (r.totalAlgSizeInLists, param[1], param[2]) )
-    trigTotalFileSizesCheckFile.append( (r.total, param[1], param[2]) )
-
-
-# let's setup the full list of container names and the full list of categories:
-fullListContainers = []
-fullListCategories = []
-for containerList in trigContainerLists:
-    for item in reversed(containerList[0]):
-        if item[0] not in [it[0] for it in fullListContainers]:
-            fullListContainers.append( [item[0], item[1]] )
-        if item[1] not in fullListCategories:
-            fullListCategories.append( item[1] )
-
-# the comparison part
-
-print ""
-print "copypaste the part below to a spredsheet and use ",spreadsheetDelimiter," as a delimiter"
-print ""
-
-# first print the summary (total size) for different categories
-# table header
-print "release               ",
-print spreadsheetDelimiter,
-for release in releases:
-    print numberFormat % release,
-    print spreadsheetDelimiter,
-print ""
-
-print "AOD EDM set           ",
-print spreadsheetDelimiter,
-for version in versions:
-    print numberFormat % version,
-    print spreadsheetDelimiter,
-print ""
-print "                      ",
-print spreadsheetDelimiter,
-for version in versions:
-    print numberFormat % "kB/event",
-    print spreadsheetDelimiter,
-print ""
-# categories sizes
-for category in fullListCategories:
-    print "trigger%-15s" % category,
-    print spreadsheetDelimiter,
-    for version, release in zip(versions, releases):
-        for catSize in trigSizesPerCategory:
-            if catSize[1] == version and catSize[2] == release:
-                if category in catSize[0]:
-                    # the category size is printed here:
-                    print numberFormat % catSize[0][ category ],
-                    print spreadsheetDelimiter,
-                else:
-                    # if the category does not exist for the given AODEDMSET and RELEASE_VERSION, then just print "x" instead of size
-                    print numberFormat % "x",
-                    print spreadsheetDelimiter,
-    print ""
-
-# total trigger and file sizes
-print "triggerTotal          ",
-print spreadsheetDelimiter,
-for version,release in zip(versions,releases):
-    for catSize in trigSizesPerCategory:
-        if catSize[1] == version and catSize[2] == release:
-            print numberFormat % catSize[0][ 'Total' ],
-            print spreadsheetDelimiter,
-print ""
-
-print "File size:                  ",
-print spreadsheetDelimiter,
-for version,release in zip(versions,releases):
-    for t in trigTotalFileSizes:
-        if t[1] == version and t[2] == release:
-            print "%12.3f" % t[0],
-            print spreadsheetDelimiter,
-print ""
-print "File size (from lists):     ",
-print spreadsheetDelimiter,
-for version,release in zip(versions,releases):
-    for t in trigTotalFileSizesLists:
-        if t[1] == version and t[2] == release:
-            print "%12.3f" % t[0],
-            print spreadsheetDelimiter,
-print ""
-print "File size (from checkFile): ",
-print spreadsheetDelimiter,
-for version,release in zip(versions,releases):
-    for t in trigTotalFileSizesCheckFile:
-        if t[1] == version and t[2] == release:
-            print "%12.3f" % t[0],
-            print spreadsheetDelimiter,
-print ""
-print ""
-            
-
-# now let's print for each category all containers within it
-for category in fullListCategories:
-
-    print "\nSummary for ", category
-    # table header
-    print "%-80s" % "release",
-    print spreadsheetDelimiter,
-    for release in releases:
-        print numberFormat % release,
-        print spreadsheetDelimiter,
-    print ""
-
-    print "%-80s" % "AOD EDM set",
-    print spreadsheetDelimiter,
-    for version in versions:
-        print numberFormat % version,
-        print spreadsheetDelimiter,
-    print ""
-    print "%-80s" % "",
-    print spreadsheetDelimiter,
-    for version in versions:
-        print numberFormat % "kB/event",
-        print spreadsheetDelimiter,
-    print ""
-    # the actual numbers
-    for container in fullListContainers:
-        if container[1] == category:
-            containerSizePerVersion = []
-            for containerList in trigContainerLists:
-                contList = containerList[0]
-                description = containerList[1]
-                release = containerList[2]
-
-                for currentContainer in contList:
-                    if currentContainer[0] == container[0]:
-#                        print "size of ",currentContainer[0]," from category ",category," of type ",description," is ",currentContainer[2]
-                        containerSizePerVersion.append( (currentContainer[0], category, description, currentContainer[2], release) )
-            if len(container[0]) < 80:
-                print "%-80s" % container[0],
-                print spreadsheetDelimiter,
-            elif len(container[0]) < 100:
-                print "%-100s" % container[0],
-                print spreadsheetDelimiter,
-            else:
-                print container[0],
-                print spreadsheetDelimiter,
-            for version,release in zip(versions,releases):
-                if (version not in [it[2] for it in containerSizePerVersion]) or (release not in [it[4] for it in containerSizePerVersion]):
-                    # if the container does not exist for the given AODEDMSET and RELEASE_VERSION, then just print "x" instead of its size
-                    print numberFormat % "x",
-                    print spreadsheetDelimiter,
-                else:
-                    for contSize in containerSizePerVersion:
-                        if contSize[2] == version and contSize[4] == release:
-                            # the container size is printed here
-                            print numberFormat % contSize[3],
-                            print spreadsheetDelimiter,
-            print ""
-    # print summary for this category again, in the bottom of the list of containers
-    print "Total for %-69s:" % category,
-    print spreadsheetDelimiter,
-    for version,release in zip(versions,releases):
-        for catSize in trigSizesPerCategory:
-            if catSize[1] == version and catSize[2] == release:
-                if category in catSize[0]:
-                    print numberFormat % catSize[0][ category ],
-                    print spreadsheetDelimiter,
-                else:
-                    print numberFormat % "x",
-                    print spreadsheetDelimiter,
-    print ""
-                        
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigRDOtoTAG.py b/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigRDOtoTAG.py
deleted file mode 100644
index 3822ed2c6df0..000000000000
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/testAthenaTrigRDOtoTAG.py
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-### usually ATN tests runs with following RDO input:
-#PoolRDOInput=["/afs/cern.ch/atlas/offline/data/testfile/calib1_csc11.005200.T1_McAtNlo_Jimmy.digit.RDO.v12000301_tid003138._00016_extract_10evt.pool.root"]
-
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-if not acf.EvtMax.is_locked():
-    acf.EvtMax=10
-if not ('OutputLevel' in dir()):
-    rec.OutputLevel=INFO
-###############################
-rec.doCBNT=False
-
-
-doTrigger=True
-
-
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=True
-rec.doAOD=False
-rec.doDPD=False
-rec.doESD=False 
-doTAG=True
-
-#rec.doTruth=True
-
-#-----------------------------------------------------------
-include("RecExCond/RecExCommon_flags.py")
-#-----------------------------------------------------------
-
-TriggerFlags.readHLTconfigFromXML=False
-TriggerFlags.readLVL1configFromXML=False
-
-TriggerFlags.enableMonitoring = [ 'Validation', 'Time', 'Log' ]
-
-#------------ This is for ATN/RTT tests only ---------
-#TriggerFlags.triggerMenuSetup = 'undefined_no_prescale'
-TriggerFlags.triggerMenuSetup = 'Physics_pp_v5'
-if  ('menu' in dir()):
-    TriggerFlags.triggerMenuSetup=menu 
-TriggerFlags.L1PrescaleSet = ''
-TriggerFlags.HLTPrescaleSet = ''
-TriggerFlags.doHLT=True
-#-------------end of flag for tests-------------------
-
-#------------ This is a temporary fix ---------------
-#from RecExConfig.RecConfFlags import recConfFlags
-#recConfFlags.AllowIgnoreConfigError=False
-#athenaCommonFlags.AllowIgnoreConfigError=False
-#-------------end of temporary fix-------------------
-
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_topOptions.py")
-#-----------------------------------------------------------
-
-include("TriggerTest/TriggerTestCommon.py")
-
diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/splitlog.py b/Trigger/TrigValidation/TrigP1Test/Testing/splitlog.py
deleted file mode 100755
index 0d4a871cb9cd..000000000000
--- a/Trigger/TrigValidation/TrigP1Test/Testing/splitlog.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-#
-# @file:    splitlog.py
-# @purpose: Slice file into several pieces using regular expressions
-# @author:  Frank Winklmeier
-
-__version__ = "$Revision: 1.1 $"
-
-import sys
-import re
-
-def sliceLog(beginRE, endRE, filename):
-      
-   file = open(filename)
-   fSlice = None
-
-   class Slice:
-      n = 0
-      def new(self):
-         Slice.n += 1
-         f = open("%s.%d" % (filename,Slice.n), "w")
-         print f.name
-         return f
-   
-   for line in file:
-      if fSlice:
-         if beginRE.match(line):
-            fSlice.close()
-            fSlice = Slice().new()
-         elif endRE and endRE.match(line):
-            fSlice.write(line)
-            fSlice.close()
-            fSlice = None
-      else:
-         if beginRE.match(line):
-            fSlice = Slice().new()
-
-      if fSlice: fSlice.write(line)
-   return
-
-     
-def main():
-
-   import logging
-   logging.basicConfig()
-   
-   import optparse
-   parser = optparse.OptionParser(description="Slice log file into several pieces",
-                                  version="%prog: "+ __version__,
-                                  usage="%prog -b PATTERN [...] FILE")
-
-   parser.add_option("-b", "--begin", action="store", type="string",
-                     help="Regular expression for start of slice")
-
-   parser.add_option("-e", "--end", action="store", type="string",
-                     help="Regular expression for end of slice")
-
-   (opts, args) = parser.parse_args()
-   if len(args)!=1:
-      parser.error("Need to specify one FILE name")
-
-   if not opts.begin:
-      parser.error("Need to specify PATTERN where the slice starts")
-      
-   beginRE = re.compile(opts.begin)
-   if opts.end: endRE = re.compile(opts.end)
-   else: endRE = None
-   
-   sliceLog(beginRE,endRE,args[0])
-
-
-if __name__ == "__main__":
-   try:
-      sys.exit(main())
-   except IOError, e:
-      (code, msg) = e
-      if (code==32): pass   # ignore broken pipe exception
-      else: raise e
-   except KeyboardInterrupt:
-      sys.exit(1)
-      
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf b/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
deleted file mode 100644
index 1338960f8e9b..000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-ignore 'xxx Flagged ABCD ERROR*'
-ignore 'DEBUG     Trailer: xxx Trailer*'
-ignore 'attempt to add a duplicate.*dupe ignored'
-ignore 'AttributeError for .*HitsFile'
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/photon.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/photon.withViews.py
deleted file mode 100644
index 110add925c6c..000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/photon.withViews.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#
-#  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-#
-
-doWriteRDOTrigger = False
-doWriteBS = False
-include("TriggerJobOpts/runHLT_standalone.py")
-
-testChains = ["HLT_g5_etcut"]
-
-from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo
-theFastCaloAlgo=T2CaloEgamma_ReFastAlgo("FastCaloAlgo" )
-theFastCaloAlgo.ClustersName="L2CaloClusters"
-
- 
-from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer
-trigL2CaloRingerFexMT = init_ringer()
-
-from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq, findAlgorithm
-from DecisionHandling.DecisionHandlingConf import RoRSeqFilter, DumpDecisions
-from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
-from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool
-
-def createFastCaloSequence(rerun=False):
-   __prefix = "Rerurn_" if rerun else ""
-   __l1RoIDecisions = "RerunEMRoIDecisions" if rerun else "EMRoIDecisions"
-   __forViewDecsions = "RerunEMRoIDecisions"  if rerun else "Filtered"+__l1RoIDecisions 
-
-   from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo
-   clusterMaker=T2CaloEgamma_ReFastAlgo( "FastClusterMaker" )
-   clusterMaker.ClustersName="L2CaloClusters"
-
-   fastCaloInViewAlgs = seqAND( __prefix+"fastCaloInViewAlgs", [ clusterMaker ])
-
-   filterL1RoIsAlg = RoRSeqFilter( __prefix+"filterL1RoIsAlg")
-   filterL1RoIsAlg.Input = [__l1RoIDecisions]
-   filterL1RoIsAlg.Output = ["Filtered"+__l1RoIDecisions]
-   filterL1RoIsAlg.Chains = testChains
-
-   fastCaloViewsMaker = EventViewCreatorAlgorithm( __prefix+"fastCaloViewsMaker" )
-   fastCaloViewsMaker.ViewFallThrough = True
-   fastCaloViewsMaker.InputMakerInputDecisions =  [ __forViewDecsions ]
-   fastCaloViewsMaker.RoIsLink = "initialRoI"
-   fastCaloViewsMaker.RoITool = ViewCreatorInitialROITool()
-   fastCaloViewsMaker.InViewRoIs = "EMCaloRoIs" 
-   fastCaloViewsMaker.Views = __prefix+"EMCaloViews"
-   fastCaloViewsMaker.ViewNodeName = __prefix+"fastCaloInViewAlgs"
-   fastCaloViewsMaker.InputMakerOutputDecisions = "L2CaloLinks"
-   clusterMaker.RoIs = fastCaloViewsMaker.InViewRoIs
-
-   from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT
-   from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName
-   fastCaloHypo = TrigL2CaloHypoAlgMT( __prefix+"L2CaloHypo" )
-   fastCaloHypo.HypoInputDecisions =  fastCaloViewsMaker.InputMakerOutputDecisions #   __l1RoIDecisions
-#   fastCaloHypo.Views = fastCaloViewsMaker.Views
-   fastCaloHypo.CaloClusters = clusterMaker.ClustersName
-#   fastCaloHypo.RoIs = fastCaloViewsMaker.InViewRoIs
-   fastCaloHypo.HypoOutputDecisions = __prefix+"EgammaCaloDecisions"
-   fastCaloHypo.HypoTools =  [ TrigL2CaloHypoToolFromName( c, c ) for c in testChains ]
-
-   fastCaloSequence = seqAND( __prefix+"fastCaloSequence", [fastCaloViewsMaker, fastCaloInViewAlgs, fastCaloHypo ])
-   #if rerun: 
-   #   return parOR(__prefix+"egammaCaloStep", [ fastCaloSequence ] )
-   return stepSeq(__prefix+"egammaCaloStep", filterL1RoIsAlg, [ fastCaloSequence ])
-
-egammaCaloStep = createFastCaloSequence( rerun=False )
-
-
-
-from TrigEgammaHypo.TrigL2PhotonFexMTConfig import L2PhotonFex_1
-thePhotonFex= L2PhotonFex_1()
-thePhotonFex.TrigEMClusterName = theFastCaloAlgo.ClustersName
-thePhotonFex.PhotonsName="Photons"
-
-filterCaloRoIsAlg = RoRSeqFilter("filterCaloRoIsAlg")
-caloHypoDecisions = findAlgorithm(egammaCaloStep, "L2CaloHypo").HypoOutputDecisions
-print "kkkk ", caloHypoDecisions
-filterCaloRoIsAlg.Input = [caloHypoDecisions]
-filterCaloRoIsAlg.Output = ["Filtered" + caloHypoDecisions]
-filterCaloRoIsAlg.Chains = testChains
-
-from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2PhotonHypoAlgMT
-from TrigEgammaHypo.TrigL2PhotonHypoTool import TrigL2PhotonHypoToolFromName
-thePhotonHypo = TrigL2PhotonHypoAlgMT()
-thePhotonHypo.RunInView=True
-thePhotonHypo.Photons = thePhotonFex.PhotonsName
-thePhotonHypo.HypoTools = [ TrigL2PhotonHypoToolFromName( c, c ) for c in testChains ]
-
-
-photonSequence = seqAND("photonSequence", [ thePhotonHypo ] )
-
-egammaIDStep = stepSeq("egammaIDStep", filterCaloRoIsAlg, [ photonSequence ] )
-
-# CF construction
-
-from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
-summaryStep0 = TriggerSummaryAlg( "TriggerSummaryStep1" )
-summaryStep0.InputDecision = "L1DecoderSummary"
-summaryStep0.FinalDecisions = [ caloHypoDecisions ]
-
-step0 = parOR("step0", [ egammaCaloStep, summaryStep0 ] )
-step1 = parOR("step1", [ egammaIDStep ] )
-
-
-egammaCaloStepRR = createFastCaloSequence( rerun=True )
-
-step0r = parOR("step0r", [ egammaCaloStepRR ])
-
-summary = TriggerSummaryAlg( "TriggerSummaryAlg" )
-summary.InputDecision = "L1DecoderSummary"
-summary.FinalDecisions = [ "PhotonL2Decisions" ]
-from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator
-edmCreator = HLTEDMCreator()
-edmCreator.TrigCompositeContainer = [ "EgammaCaloDecisions", "PhotonL2Decisions", "EMRoIDecisions", "L1DecoderSummary" ]
-
-
-egammaViewsMerger = HLTEDMCreator("egammaViewsMerger")
-
-summary.OutputTools = [ edmCreator, egammaViewsMerger ]
-
-
-step0filter = parOR("step0filter", [ findAlgorithm( egammaCaloStep, "filterL1RoIsAlg") ] )
-step1filter = parOR("step1filter", [ findAlgorithm(egammaIDStep, "filterCaloRoIsAlg") ] )
-step0rfilter = parOR("step0rfilter", [ findAlgorithm(egammaCaloStepRR, "Rerurn_filterL1RoIsAlg") ] )
-
-#steps = seqAND("HLTSteps", [ step0, step1, step0r, summary ]  )
-steps = seqAND("HLTSteps", [ step0filter, step0, step1filter, step1, step0rfilter, step0r, summary ]  )
-
-
-
-from TrigSteerMonitor.TrigSteerMonitorConf import TrigSignatureMoniMT
-mon = TrigSignatureMoniMT()
-mon.FinalDecisions = [ "PhotonL2Decisions", "MuonL2Decisions", "WhateverElse" ]
-from TrigUpgradeTest.TestUtils import MenuTest
-mon.HLTTriggerMenu = [ x.split(":")[1] for x in  MenuTest.CTPToChainMapping ]
-
-import AthenaPoolCnvSvc.WriteAthenaPool
-from OutputStreamAthenaPool.CreateOutputStreams import  createOutputStream
-StreamESD=createOutputStream("StreamESD","myESD.pool.root",True)
-topSequence.remove( StreamESD )
-
-def addTC(name):
-   StreamESD.ItemList += [ "xAOD::TrigCompositeContainer#"+name, "xAOD::TrigCompositeAuxContainer#"+name+"Aux." ]
-
-for tc in edmCreator.TrigCompositeContainer:
-   addTC( tc )
-
-addTC("HLTNav_Summary")
-
-StreamESD.ItemList += [ "xAOD::TrigPhotonContainer#HLT_photons"]
-
-print "ESD file content "
-print StreamESD.ItemList
-
-
-hltTop = seqOR( "hltTop", [ steps, mon, summary, StreamESD ] )
-topSequence += hltTop
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testL1MC.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testL1MC.py
deleted file mode 100644
index cec9f6b685db..000000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/testL1MC.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#Adapted from L1 test in TriggerTest
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-if not acf.EvtMax.is_locked():
-    acf.EvtMax=10
-if not ('OutputLevel' in dir()):
-    rec.OutputLevel=INFO
-#scan for RTT files (only if dsName and fileRange set)
-include("TriggerTest/TrigScanFiles.py")
-###############################
-
-doTrigger=True
-
-from AthenaCommon.AlgScheduler import AlgScheduler
-AlgScheduler.OutputLevel( INFO )
-AlgScheduler.CheckDependencies( True )
-AlgScheduler.ShowControlFlow( True )
-AlgScheduler.ShowDataDependencies( True )
-
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD.set_Value_and_Lock(False) 
-doTAG=False
-rec.doCBNT=False
-
-#rec.doTruth=False
-rec.doTruth.set_Value_and_Lock(False)
-
-#-----------------------------------------------------------
-include("RecExCond/RecExCommon_flags.py")
-#-----------------------------------------------------------
-
-#------------ This is for ATN/RTT tests only ---------
-#TriggerFlags.triggerMenuSetup = 'default' 
-TriggerFlags.triggerMenuSetup = 'Physics_pp_v7' 
-
-#------------ run only LVL1 -------------------------- 
-TriggerFlags.doHLT=False
-#TriggerFlags.doL1Topo=True 
-
-
-def L1Only():
-    TriggerFlags.Slices_all_setOff()
-
-try:
-    from TriggerMenu import useNewTriggerMenu
-    useNewTM = useNewTriggerMenu()
-    log.info("Using new TriggerMenu: %r" % useNewTM)
-except:
-    useNewTM = False
-    log.info("Using old TriggerMenuPython since TriggerMenu.useNewTriggerMenu can't be imported")
-
-if useNewTM:
-    from TriggerMenu.menu.GenerateMenu import GenerateMenu
-else:
-    from TriggerMenuPython.GenerateMenu import GenerateMenu
-GenerateMenu.overwriteSignaturesWith(L1Only)
-
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_topOptions.py")
-#-----------------------------------------------------------
-
-#------------------------------------------------------------
-include("TriggerTest/TriggerTestCommon.py")
-#------------------------------------------------------------
-
-DetFlags.makeRIO.Calo_setOff()
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
index 36722f34c233..0709e9ff2bd8 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
@@ -80,11 +80,11 @@ if [ "${ATH_RETURN}" -ne "0" ] && [ -n "${gitlabTargetBranch}" ]; then
 fi
 
 echo $(date "+%FT%H:%M %Z")"     Running checklog for errors"
-timeout 5m check_log.py --config checklogTrigUpgradeTest.conf --errors --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log
+timeout 5m check_log.py --config checklogTriggerTest.conf --errors --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log
 echo "art-result: ${PIPESTATUS[0]} CheckLog"
 
 echo $(date "+%FT%H:%M %Z")"     Running checklog for warnings"
-timeout 5m check_log.py --config checklogTrigUpgradeTest.conf --warnings --showexcludestats ${JOB_LOG} >warnings.log 2>&1
+timeout 5m check_log.py --config checklogTriggerTest.conf --warnings --showexcludestats ${JOB_LOG} >warnings.log 2>&1
 
 ### PERFMON
 
diff --git a/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py b/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py
deleted file mode 100755
index a21553eb4b5d..000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-"""
-filterREGTEST.py
-Filter to remove DEBUG messages but keep REGTEST messages.
-"""
-
-import sys
-import re
-
-def main():
-   if len(sys.argv)>1:
-      print(__doc__)
-      return 1
-
-   re_debug = re.compile('\S+\s+DEBUG.*')
-   for line in sys.stdin:
-      # Ignore DEBUG lines but keep REGTEST
-      if re_debug.match(line)!=None and line.find("REGTEST")==-1:
-         pass
-      else:
-         print(line, end=' ')
-         
-   return 0
-
-if __name__ == "__main__":
-   try:
-      sys.exit(main())
-   except IOError as e:
-      (code, msg) = e
-      if (code==32): pass   # ignore broken pipe exception
-      else: raise e
-   except KeyboardInterrupt:
-      sys.exit(1)
diff --git a/Trigger/TrigValidation/TrigValTools/bin/htmldiff.py b/Trigger/TrigValidation/TrigValTools/bin/htmldiff.py
deleted file mode 100755
index 8b5462dbafd3..000000000000
--- a/Trigger/TrigValidation/TrigValTools/bin/htmldiff.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-# @file:    htmldiff.py
-# @purpose: Produce HTML side-by-side diff (based on python's Tools/scripts/diff.py)
-# @author:  Frank Winklmeier
-#
-# $Id: $
-
-import sys, os, time, difflib, optparse
-
-def main():
-
-    usage = "usage: %prog [options] fromfile tofile"
-    parser = optparse.OptionParser(usage)
-    parser.add_option("-f", "--full", action="store_true", default=False,
-                      help='Full diff instead of context diff')
-    parser.add_option("-l", "--lines", type="int", default=3,
-                      help='Number of context lines (default 3)')
-    parser.add_option("-w", "--wrap", type="int", default=None,
-                      help='Column number where lines are wrapped')
-    
-    (options, args) = parser.parse_args()
-
-    if len(args) == 0:
-        parser.print_help()
-        sys.exit(1)
-    if len(args) != 2:
-        parser.error("need to specify both a fromfile and tofile")
-
-    fromfile, tofile = args
-
-    fromlines = open(fromfile, 'U').readlines()
-    tolines = open(tofile, 'U').readlines()
-
-    diff = difflib.HtmlDiff(wrapcolumn=options.wrap).make_table(fromlines,tolines,fromfile,tofile,
-                                                                context=(not options.full),
-                                                                numlines=options.lines)
-
-    # The header and footer are slightly modified version of what
-    # is created by HtmlDiff.make_file()
-    print """
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-    <meta http-equiv="Content-Type"
-          content="text/html; charset=ISO-8859-1" />
-    <title></title>
-    <style type="text/css">
-        table.diff {font-family:monospace; border:medium;}
-        .diff_header {background-color:#e0e0e0}
-        td.diff_header {text-align:right}
-        .diff_next {background-color:#c0c0c0}
-        .diff_add {background-color:#aaffaa}
-        .diff_chg {background-color:#ffff77}
-        .diff_sub {background-color:#ffaaaa}
-    </style>
-</head>
-<body>
-"""
-    # Main diff table
-    sys.stdout.writelines(diff)
-    print """
-<hr>
-<table class="diff" summary="Legends">
-<tr> <th colspan="2"> Legends </th> </tr>
-<tr> <td> <table border="" summary="Colors">
-<tr><th> Colors </th> </tr>
-<tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
-<tr><td class="diff_chg">Changed</td> </tr>
-<tr><td class="diff_sub">Deleted</td> </tr>
-</table></td>
-<td> <table border="" summary="Links">
-<tr><th colspan="2"> Links </th> </tr>
-<tr><td>(f)irst change</td> </tr>
-<tr><td>(n)ext change</td> </tr>
-<tr><td>(t)op</td> </tr>
-</table></td> </tr>
-
-</body>
-</html>
-"""
-
-if __name__ == '__main__':
-    main()
diff --git a/Trigger/TrigValidation/TrigValTools/python/HTML.py b/Trigger/TrigValidation/TrigValTools/python/HTML.py
deleted file mode 100644
index dc7553b58f73..000000000000
--- a/Trigger/TrigValidation/TrigValTools/python/HTML.py
+++ /dev/null
@@ -1,215 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-"""Classes to generate HTML in Python
-
-This class was adapted from http://code.activestate.com/recipes/366000/
-The changes was mostly related to generate valid XHTML
-
-The HTMLTags module defines a class for all the valid HTML tags, written in
- uppercase letters. To create a piece of HTML, the general syntax is :
-
-    t = TAG(innerHTML, key1=val1,key2=val2,...)
-
-so that "print t" results in :
-
-    <TAG key1="val1" key2="val2" ...>innerHTML</TAG>
-
-For instance :
-
-    print A('bar', href="foo") ==> <A href="foo">bar</A>
-
-To generate HTML attributes without value, give them the value True :
-
-    print OPTION('foo',SELECTED=True,value=5) ==> 
-            <OPTION value="5" SELECTED>
-
-For non-closing tags such as <IMG> or <BR>, the print statement does not 
-generate the closing tag
-
-The innerHTML argument can be an instance of an HTML class, so that you can nest 
-tags, like this :
-
-    print B(I('foo')) ==> <B><I>foo</I></B>
-
-Instances of the HTML classes support the addition :
-
-    print B('bar')+INPUT(name="bar") ==> <B>bar</B><INPUT name="bar">
-
-and also repetition :
-
-    print TH('&nbsp')*3 ==> <TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD>
-
-If you have a list (or any iterable) of instances, you can't concatenate the items with 
-sum(instanceList) because sum takes only numbers as arguments. So there is a 
-function called Sum which will do the job :
-
-    Sum( TR(TD(i)+TD(i*i)) for i in range(100) )
-
-generates the rows of a table showing the squares of integers from 0 to 99
-
-A simple document can be produced by :
-
-    print HTML( HEAD(TITLE('Test document')) +
-        BODY(H1('This is a test document')+
-             TEXT('First line')+BR()+
-             TEXT('Second line')))
-
-This will produce :
-
-    <HTML>
-    <HEAD>
-    <TITLE>Test document</TITLE>
-    </HEAD>
-    <BODY>
-    <H1>This is a test document</H1>
-    First line
-    <BR>
-    Second line
-    </BODY>
-    </HTML>
-
-If the document is more complex it is more readable to create the elements 
-first, then to print the whole result in one instruction. For example :
-
-stylesheet = LINK(rel="Stylesheet",href="doc.css")
-
-head= HEAD(TITLE('Record collection')+stylesheet)
-title = H1('My record collection')
-rows = Sum ([TR(TD(rec.title,Class="title")+TD(rec.artist,Class="Artist")) 
-    for rec in records])
-table = TABLE(TR(TH('Title')+TH('Artist')) + rows)
-
-print HTML(head + BODY(title + table))
-"""
-
-import cStringIO
-
-def XHTML(document):
-    head="""<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html
-        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-"""
-    return head+HTML(document,
-                     xmlns="http://www.w3.org/1999/xhtml",
-                     lang="en-US",
-                     xml__lang="en-US")
-
-
-
-class TAG:
-    """Generic class for tags"""
-    def __init__(self, innerHTML="", **attrs):
-        self.tag = [self.__class__.__name__]
-        self.innerHTML = [innerHTML]
-        self.attrs = [attrs]
-    
-    def __str__(self):
-        res=cStringIO.StringIO()
-        w=res.write
-        for tag, innerHTML, attrs in zip(self.tag, 
-            self.innerHTML, self.attrs):
-            if not tag=='TEXT':
-                if tag in _WS_INSENSITIVE:
-                    w('\n')
-                w("<%s" %tag.lower())
-                # attributes which will produce arg = "val"
-                attr1 = [ k for k in attrs if not isinstance(attrs[k],bool) ]
-                w("".join([' %s="%s"' 
-                    %(k.replace('__',':').replace('_','-').replace('Class','class'),attrs[k]) for k in attr1]))
-                # attributes with no argument
-                # if value is False, don't generate anything
-                attr2 = [ k for k in attrs if attrs[k] is True ]
-                w("".join([' %s="%s"' %(k,k) for k in attr2]))
-                if not tag in ClosingTags:
-                    w(" /")
-                w(">")
-            if type(innerHTML)==unicode:
-                w(innerHTML.encode('ascii','ignore'))
-            else:
-                w(str(innerHTML))
-            if tag in ClosingTags:
-                w("</%s>" %tag.lower())
-        return res.getvalue()
-
-    def __add__(self,other):
-        """Concatenate another tag to self"""
-        self.tag += other.tag
-        self.innerHTML += other.innerHTML
-        self.attrs += other.attrs
-        return self
-
-    def __radd__(self,other):
-        """Used to add a tag to a string"""
-        if isinstance(other,str):
-            return TEXT(other)+self
-        else:
-            raise ValueError("Can't concatenate %s and instance" %other)
-
-    def __mul__(self,n):
-        """Replicate self n times"""
-        res = TAG()
-        res.tag = self.tag*n
-        res.innerHTML = self.innerHTML*n
-        res.attrs = self.attrs*n
-        return res
-
-# list of tags, from the HTML 4.01 specification
-
-ClosingTags =  ['A', 'ABBR', 'ACRONYM', 'ADDRESS', 'APPLET',
-            'B', 'BDO', 'BIG', 'BLOCKQUOTE', 'BUTTON',
-            'CAPTION', 'CENTER', 'CITE', 'CODE',
-            'DEL', 'DFN', 'DIR', 'DIV', 'DL',
-            'EM', 'FIELDSET', 'FONT', 'FORM', 'FRAMESET',
-            'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
-            'I', 'IFRAME', 'INS', 'KBD', 'LABEL', 'LEGEND',
-            'MAP', 'MENU', 'NOFRAMES', 'NOSCRIPT', 'OBJECT',
-            'OL', 'OPTGROUP', 'PRE', 'Q', 'S', 'SAMP',
-            'SCRIPT', 'SELECT', 'SMALL', 'SPAN', 'STRIKE',
-            'STRONG', 'STYLE', 'SUB', 'SUP', 'TABLE',
-            'TEXTAREA', 'TITLE', 'TT', 'U', 'UL',
-            'VAR', 'BODY', 'COLGROUP', 'DD', 'DT', 'HEAD',
-            'HTML', 'LI', 'P', 'TBODY','OPTION', 
-            'TD', 'TFOOT', 'TH', 'THEAD', 'TR']
-
-NonClosingTags = ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME',
-            'HR', 'IMG', 'INPUT', 'ISINDEX', 'LINK',
-            'META', 'PARAM']
-
-# create the classes
-for tag in ClosingTags + NonClosingTags + ['TEXT']:
-    exec("class %s(TAG): pass" %tag)
-    
-def Sum(iterable):
-    """Return the concatenation of the instances in the iterable
-    Can't use the built-in sum() on non-integers"""
-    it = [ item for item in iterable ]
-    if it:
-        return reduce(lambda x,y:x+y, it)
-    else:
-        return ''
-
-def SP():
-    return TEXT('&nbsp;')
-
-
-def htmlify(text):
-    """
-    convert special characters to html symbols
-    """
-    html=text.replace("&",'&#38;')
-    html=html.replace('"','&#34;')
-    html=html.replace("'",'&#39;')
-    html=html.replace("<",'&#60;')
-    html=html.replace(">",'&#62;')
-    return html
-
-
-# whitespace-insensitive tags, determines pretty-print rendering
-_WS_INSENSITIVE = NonClosingTags + ['HTML','HEAD','BODY',
-    'FRAMESET','FRAME',
-    'TITLE','SCRIPT',
-    'TABLE','TR','TD','TH','SELECT','OPTION',
-    'FORM']
-
-_WS_INSENSITIVE.remove('INPUT')
diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
index cd37aa4b2a2e..56e9eda2d1e4 100644
--- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
+++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py
@@ -242,9 +242,7 @@ class CheckLogStep(Step):
 
     def configure(self, test):
         if self.config_file is None:
-            if test.package_name == 'TrigUpgradeTest':
-                self.config_file = 'checklogTrigUpgradeTest.conf'
-            elif test.package_name == 'TrigP1Test':
+            if test.package_name == 'TrigP1Test':
                 self.config_file = 'checklogTrigP1Test.conf'
             elif test.package_name == 'TrigValTools':
                 self.config_file = 'checklogTrigValTools.conf'
diff --git a/Trigger/TrigValidation/TriggerTest/share/TriggerTestSilence.py b/Trigger/TrigValidation/TriggerTest/share/TriggerTestSilence.py
deleted file mode 100644
index 3a24e8c05d40..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/TriggerTestSilence.py
+++ /dev/null
@@ -1,103 +0,0 @@
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-if hasattr(topSequence, "T2CaloEgamma_Ringer"):
-    alg = getattr(topSequence, "T2CaloEgamma_Ringer")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigL2CaloHypo"):
-    alg = getattr(topSequence, "TrigL2CaloHypo")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "T2CaloEgamma_eGamma"):
-    alg = getattr(topSequence, "T2CaloEgamma_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigCaloCellMaker_eGamma"):
-    alg = getattr(topSequence, "TrigCaloCellMaker_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigCaloTowerMaker_eGamma"):
-    alg = getattr(topSequence, "TrigCaloTowerMaker_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigCaloClusterMaker_slw"):
-    alg = getattr(topSequence, "TrigCaloClusterMaker_slw")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigL2SiTrackFinder_eGammaC"):
-    alg = getattr(topSequence, "TrigL2SiTrackFinder_eGammaC")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "InDetTrigTrackingxAODCnv_Electron_L2ID"):
-    alg = getattr(topSequence, "InDetTrigTrackingxAODCnv_Electron_L2ID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigL2SiTrackFinder_eGammaB"):
-    alg = getattr(topSequence, "TrigL2SiTrackFinder_eGammaB")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigL2SiTrackFinder_eGammaA"):
-    alg = getattr(topSequence, "TrigL2SiTrackFinder_eGammaA")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "PixelClustering_Electron_IDTrig"):
-    alg = getattr(topSequence, "PixelClustering_Electron_IDTrig")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "SCTClustering_Electron_IDTrig"):
-    alg = getattr(topSequence, "SCTClustering_Electron_IDTrig")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigFastTrackFinder_eGamma"):
-    alg = getattr(topSequence, "TrigFastTrackFinder_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2PhotonFex_1"):
-    alg = getattr(topSequence, "L2PhotonFex_1")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2PhotonHypo"):
-    alg = getattr(topSequence, "L2PhotonHypo")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigEFCaloCalibFex_Electron"):
-    alg = getattr(topSequence, "TrigEFCaloCalibFex_Electron")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigEFCaloHypo"):
-    alg = getattr(topSequence, "TrigEFCaloHypo")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2ElectronFex_L2StarC"):
-    alg = getattr(topSequence, "L2ElectronFex_L2StarC")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2ElectronFex_L2StarB"):
-    alg = getattr(topSequence, "L2ElectronFex_L2StarB")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2ElectronFex_L2StarA"):
-    alg = getattr(topSequence, "L2ElectronFex_L2StarA")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2ElectronFex_1"):
-    alg = getattr(topSequence, "L2ElectronFex_1")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "L2ElectronHypo"):
-    alg = getattr(topSequence, "L2ElectronHypo")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigExtProcessor_Electron_EFID"):
-    alg = getattr(topSequence, "TrigExtProcessor_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "InDetTrigTrackSlimmer_Electron_EFID"):
-    alg = getattr(topSequence, "InDetTrigTrackSlimmer_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigVxPrimary_Electron_EFID"):
-    alg = getattr(topSequence, "TrigVxPrimary_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "InDetTrigParticleCreation_Electron_EFID"):
-    alg = getattr(topSequence, "InDetTrigParticleCreation_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "SiTrigSpacePointFinder_Electron_EFID"):
-    alg = getattr(topSequence, "SiTrigSpacePointFinder_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigEgammaRec_eGamma"):
-    alg = getattr(topSequence, "TrigEgammaRec_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigEgammaRec_NoIDEF_eGamma"):
-    alg = getattr(topSequence, "TrigEgammaRec_NoIDEF_eGamma")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TRTTrackExtAlg_Electron_EFID"):
-    alg = getattr(topSequence, "TRTTrackExtAlg_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TrigAmbiguitySolver_Electron_EFID"):
-    alg = getattr(topSequence, "TrigAmbiguitySolver_Electron_EFID")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "EFTrackHypo"):
-    alg = getattr(topSequence, "EFTrackHypo")
-    alg.OutputLevel = WARNING
-if hasattr(topSequence, "TRTDriftCircleMaker_Electron_EFID"):
-    alg = getattr(topSequence, "TRTDriftCircleMaker_Electron_EFID")
-    alg.OutputLevel = WARNING
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.enableMonitoring = [ ]
\ No newline at end of file
diff --git a/Trigger/TrigValidation/TriggerTest/share/plotDecision.cxx b/Trigger/TrigValidation/TriggerTest/share/plotDecision.cxx
deleted file mode 100644
index d00f42acafaf..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/plotDecision.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-int plotDecision(const char * fileName = "")
-{
-  if( fileName == "" ) 
-    {
-      cout << " Usage : .x plotDecision.cxx (\"..\") \n";
-      return 1;
-    }
-
-  TString hname1 = "TrigSteer_HLT/ChainAcceptance";
-//  TString hname1 = "TrigSteer_L2/ChainAcceptance_runsummary";
-//  TString hname2 = "TrigSteer_EF/ChainAcceptance_runsummary";
-
-  TFile file(fileName);
-  gROOT->cd();
-  TH1F * h1 = ((TH1F*)file.Get(hname1))->Clone();
-//  TH1F * h2 = ((TH1F*)file.Get(hname2))->Clone();
-
-  gStyle->SetPadBottomMargin(0.4);
-  gStyle->SetOptLogy();
-  TCanvas * c1 = (TCanvas*)gROOT->Get("c1");
-  if( c1 == 0 ) c1 = new TCanvas("c1","",10,10,800,500);
-//  c1->Divide(1,2);
-
- // c1->cd(1);
-  if(h1 ) 
-    {
-      h1->LabelsOption("v");
-      h1->SetLabelSize(0.08);
-      h1->Draw();
-    }else{
-    cout << " Cannot find histogram " << hname1 << endl;
-  }
-
-//  c1->cd(2);
-//  if(h2 ) 
-//    {
-//      h2->LabelsOption("v");
-//      h2->SetLabelSize(0.08);
-//      h2->Draw();
-//    }else{
-//    cout << " Cannot find histogram " << hname2 << endl;
-//  }
-
-
-  // write out to graphics file
-  c1->SaveAs("trigDecision.gif");
-
-}
diff --git a/Trigger/TrigValidation/TriggerTest/share/rob-ros-map.py b/Trigger/TrigValidation/TriggerTest/share/rob-ros-map.py
deleted file mode 100644
index 35edb4077f16..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/rob-ros-map.py
+++ /dev/null
@@ -1,1623 +0,0 @@
-# This ROB-ROS map was generated by generate-rob-ros-map-from-data.py
-# Current date and time is 2013-09-24 14:14:37.154312
-#
-# These unique identifiers were extracted from:
-# root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_EnhancedBias.merge_eb_zee_zmumu_cc.RAW._lb0291._SFO-5._0001.data
-#
-svcMgr.ROBDataProviderSvc.RobRosMapping = {
-#
-# ROB id   : ROS id = SubDetector Id 
-#
-# 01 : Sub Detector = PIXEL_BARREL
-  0x111705 : 0x11 ,
-  0x111706 : 0x11 ,
-  0x111707 : 0x11 ,
-  0x111708 : 0x11 ,
-  0x111709 : 0x11 ,
-  0x111710 : 0x11 ,
-  0x111711 : 0x11 ,
-  0x111712 : 0x11 ,
-  0x111714 : 0x11 ,
-  0x111715 : 0x11 ,
-  0x111716 : 0x11 ,
-  0x111717 : 0x11 ,
-  0x111718 : 0x11 ,
-  0x111719 : 0x11 ,
-  0x111720 : 0x11 ,
-  0x111721 : 0x11 ,
-  0x111805 : 0x11 ,
-  0x111806 : 0x11 ,
-  0x111807 : 0x11 ,
-  0x111808 : 0x11 ,
-  0x111809 : 0x11 ,
-  0x111810 : 0x11 ,
-  0x111811 : 0x11 ,
-  0x111812 : 0x11 ,
-  0x111814 : 0x11 ,
-  0x111815 : 0x11 ,
-  0x111816 : 0x11 ,
-  0x111817 : 0x11 ,
-  0x111818 : 0x11 ,
-  0x111819 : 0x11 ,
-  0x111820 : 0x11 ,
-  0x111821 : 0x11 ,
-  0x112405 : 0x11 ,
-  0x112406 : 0x11 ,
-  0x112407 : 0x11 ,
-  0x112408 : 0x11 ,
-  0x112409 : 0x11 ,
-  0x112410 : 0x11 ,
-  0x112411 : 0x11 ,
-  0x112412 : 0x11 ,
-  0x112414 : 0x11 ,
-  0x112415 : 0x11 ,
-  0x112416 : 0x11 ,
-  0x112417 : 0x11 ,
-  0x112418 : 0x11 ,
-  0x112419 : 0x11 ,
-  0x112420 : 0x11 ,
-  0x112421 : 0x11 ,
-  0x112505 : 0x11 ,
-  0x112506 : 0x11 ,
-  0x112507 : 0x11 ,
-  0x112508 : 0x11 ,
-  0x112509 : 0x11 ,
-  0x112510 : 0x11 ,
-  0x112511 : 0x11 ,
-  0x112512 : 0x11 ,
-  0x112514 : 0x11 ,
-  0x112515 : 0x11 ,
-  0x112516 : 0x11 ,
-  0x112517 : 0x11 ,
-  0x112518 : 0x11 ,
-  0x112519 : 0x11 ,
-  0x112520 : 0x11 ,
-  0x112521 : 0x11 ,
-# 02 : Sub Detector = PIXEL_DISK_SIDE
-  0x120205 : 0x12 ,
-  0x120206 : 0x12 ,
-  0x120207 : 0x12 ,
-  0x120208 : 0x12 ,
-  0x120209 : 0x12 ,
-  0x120210 : 0x12 ,
-  0x120211 : 0x12 ,
-  0x120212 : 0x12 ,
-  0x120214 : 0x12 ,
-  0x120215 : 0x12 ,
-  0x120216 : 0x12 ,
-  0x120217 : 0x12 ,
-  0x120218 : 0x12 ,
-  0x120219 : 0x12 ,
-  0x120220 : 0x12 ,
-  0x120221 : 0x12 ,
-  0x121609 : 0x12 ,
-  0x121610 : 0x12 ,
-  0x121611 : 0x12 ,
-  0x121612 : 0x12 ,
-  0x121614 : 0x12 ,
-  0x121615 : 0x12 ,
-  0x121616 : 0x12 ,
-  0x121617 : 0x12 ,
-# 03 : Sub Detector = PIXEL_B_LAYER
-  0x130005 : 0x13 ,
-  0x130006 : 0x13 ,
-  0x130007 : 0x13 ,
-  0x130008 : 0x13 ,
-  0x130009 : 0x13 ,
-  0x130010 : 0x13 ,
-  0x130011 : 0x13 ,
-  0x130012 : 0x13 ,
-  0x130014 : 0x13 ,
-  0x130015 : 0x13 ,
-  0x130016 : 0x13 ,
-  0x130017 : 0x13 ,
-  0x130018 : 0x13 ,
-  0x130019 : 0x13 ,
-  0x130020 : 0x13 ,
-  0x130021 : 0x13 ,
-  0x130105 : 0x13 ,
-  0x130106 : 0x13 ,
-  0x130107 : 0x13 ,
-  0x130108 : 0x13 ,
-  0x130109 : 0x13 ,
-  0x130110 : 0x13 ,
-  0x130111 : 0x13 ,
-  0x130112 : 0x13 ,
-  0x130114 : 0x13 ,
-  0x130115 : 0x13 ,
-  0x130116 : 0x13 ,
-  0x130117 : 0x13 ,
-  0x130118 : 0x13 ,
-  0x130119 : 0x13 ,
-  0x130120 : 0x13 ,
-  0x130121 : 0x13 ,
-  0x130307 : 0x13 ,
-  0x130308 : 0x13 ,
-  0x130309 : 0x13 ,
-  0x130310 : 0x13 ,
-  0x130311 : 0x13 ,
-  0x130312 : 0x13 ,
-  0x130314 : 0x13 ,
-  0x130315 : 0x13 ,
-  0x130316 : 0x13 ,
-  0x130317 : 0x13 ,
-  0x130318 : 0x13 ,
-  0x130319 : 0x13 ,
-# 04 : Sub Detector = SCT_BARREL_A_SIDE
-  0x210000 : 0x21 ,
-  0x210001 : 0x21 ,
-  0x210002 : 0x21 ,
-  0x210003 : 0x21 ,
-  0x210004 : 0x21 ,
-  0x210005 : 0x21 ,
-  0x210006 : 0x21 ,
-  0x210007 : 0x21 ,
-  0x210008 : 0x21 ,
-  0x210009 : 0x21 ,
-  0x21000a : 0x21 ,
-  0x210100 : 0x21 ,
-  0x210101 : 0x21 ,
-  0x210102 : 0x21 ,
-  0x210103 : 0x21 ,
-  0x210104 : 0x21 ,
-  0x210105 : 0x21 ,
-  0x210106 : 0x21 ,
-  0x210107 : 0x21 ,
-  0x210108 : 0x21 ,
-  0x210109 : 0x21 ,
-  0x21010a : 0x21 ,
-# 05 : Sub Detector = SCT_BARREL_C_SIDE
-  0x220000 : 0x22 ,
-  0x220001 : 0x22 ,
-  0x220002 : 0x22 ,
-  0x220003 : 0x22 ,
-  0x220004 : 0x22 ,
-  0x220005 : 0x22 ,
-  0x220006 : 0x22 ,
-  0x220007 : 0x22 ,
-  0x220008 : 0x22 ,
-  0x220009 : 0x22 ,
-  0x22000a : 0x22 ,
-  0x220100 : 0x22 ,
-  0x220101 : 0x22 ,
-  0x220102 : 0x22 ,
-  0x220103 : 0x22 ,
-  0x220104 : 0x22 ,
-  0x220105 : 0x22 ,
-  0x220106 : 0x22 ,
-  0x220107 : 0x22 ,
-  0x220108 : 0x22 ,
-  0x220109 : 0x22 ,
-  0x22010a : 0x22 ,
-# 06 : Sub Detector = SCT_ENDCAP_A_SIDE
-  0x230000 : 0x23 ,
-  0x230001 : 0x23 ,
-  0x230002 : 0x23 ,
-  0x230003 : 0x23 ,
-  0x230004 : 0x23 ,
-  0x230005 : 0x23 ,
-  0x230006 : 0x23 ,
-  0x230007 : 0x23 ,
-  0x230008 : 0x23 ,
-  0x230009 : 0x23 ,
-  0x23000a : 0x23 ,
-  0x230100 : 0x23 ,
-  0x230101 : 0x23 ,
-  0x230102 : 0x23 ,
-  0x230103 : 0x23 ,
-  0x230104 : 0x23 ,
-  0x230105 : 0x23 ,
-  0x230106 : 0x23 ,
-  0x230107 : 0x23 ,
-  0x230108 : 0x23 ,
-  0x230109 : 0x23 ,
-  0x23010a : 0x23 ,
-  0x23010b : 0x23 ,
-# 07 : Sub Detector = SCT_ENDCAP_C_SIDE
-  0x240000 : 0x24 ,
-  0x240001 : 0x24 ,
-  0x240002 : 0x24 ,
-  0x240003 : 0x24 ,
-  0x240004 : 0x24 ,
-  0x240005 : 0x24 ,
-  0x240006 : 0x24 ,
-  0x240007 : 0x24 ,
-  0x240008 : 0x24 ,
-  0x240009 : 0x24 ,
-  0x24000a : 0x24 ,
-  0x24000b : 0x24 ,
-  0x240100 : 0x24 ,
-  0x240101 : 0x24 ,
-  0x240102 : 0x24 ,
-  0x240103 : 0x24 ,
-  0x240104 : 0x24 ,
-  0x240105 : 0x24 ,
-  0x240106 : 0x24 ,
-  0x240107 : 0x24 ,
-  0x240108 : 0x24 ,
-  0x240109 : 0x24 ,
-  0x24010a : 0x24 ,
-# 08 : Sub Detector = TRT_BARREL_A_SIDE
-  0x310100 : 0x31 ,
-  0x310200 : 0x31 ,
-  0x310300 : 0x31 ,
-  0x310400 : 0x31 ,
-  0x310500 : 0x31 ,
-  0x310600 : 0x31 ,
-  0x310700 : 0x31 ,
-  0x310800 : 0x31 ,
-  0x310900 : 0x31 ,
-  0x310a00 : 0x31 ,
-  0x310b00 : 0x31 ,
-  0x310c00 : 0x31 ,
-  0x310d00 : 0x31 ,
-  0x310e00 : 0x31 ,
-  0x310f00 : 0x31 ,
-  0x311000 : 0x31 ,
-  0x311100 : 0x31 ,
-  0x311200 : 0x31 ,
-  0x311300 : 0x31 ,
-  0x311400 : 0x31 ,
-  0x311500 : 0x31 ,
-  0x311600 : 0x31 ,
-  0x311700 : 0x31 ,
-  0x311800 : 0x31 ,
-  0x311900 : 0x31 ,
-  0x311a00 : 0x31 ,
-  0x311b00 : 0x31 ,
-  0x311c00 : 0x31 ,
-  0x311d00 : 0x31 ,
-  0x311e00 : 0x31 ,
-  0x311f00 : 0x31 ,
-  0x312000 : 0x31 ,
-# 09 : Sub Detector = TRT_BARREL_C_SIDE
-  0x320100 : 0x32 ,
-  0x320200 : 0x32 ,
-  0x320300 : 0x32 ,
-  0x320400 : 0x32 ,
-  0x320500 : 0x32 ,
-  0x320600 : 0x32 ,
-  0x320700 : 0x32 ,
-  0x320800 : 0x32 ,
-  0x320900 : 0x32 ,
-  0x320a00 : 0x32 ,
-  0x320b00 : 0x32 ,
-  0x320c00 : 0x32 ,
-  0x320d00 : 0x32 ,
-  0x320e00 : 0x32 ,
-  0x320f00 : 0x32 ,
-  0x321000 : 0x32 ,
-  0x321100 : 0x32 ,
-  0x321200 : 0x32 ,
-  0x321300 : 0x32 ,
-  0x321400 : 0x32 ,
-  0x321500 : 0x32 ,
-  0x321600 : 0x32 ,
-  0x321700 : 0x32 ,
-  0x321800 : 0x32 ,
-  0x321900 : 0x32 ,
-  0x321a00 : 0x32 ,
-  0x321b00 : 0x32 ,
-  0x321c00 : 0x32 ,
-  0x321d00 : 0x32 ,
-  0x321e00 : 0x32 ,
-  0x321f00 : 0x32 ,
-  0x322000 : 0x32 ,
-# 10 : Sub Detector = TRT_ENDCAP_A_SIDE
-  0x330101 : 0x33 ,
-  0x330102 : 0x33 ,
-  0x330201 : 0x33 ,
-  0x330202 : 0x33 ,
-  0x330301 : 0x33 ,
-  0x330302 : 0x33 ,
-  0x330401 : 0x33 ,
-  0x330402 : 0x33 ,
-  0x330501 : 0x33 ,
-  0x330502 : 0x33 ,
-  0x330601 : 0x33 ,
-  0x330602 : 0x33 ,
-  0x330701 : 0x33 ,
-  0x330702 : 0x33 ,
-  0x330801 : 0x33 ,
-  0x330802 : 0x33 ,
-  0x330901 : 0x33 ,
-  0x330902 : 0x33 ,
-  0x330a01 : 0x33 ,
-  0x330a02 : 0x33 ,
-  0x330b01 : 0x33 ,
-  0x330b02 : 0x33 ,
-  0x330c01 : 0x33 ,
-  0x330c02 : 0x33 ,
-  0x330d01 : 0x33 ,
-  0x330d02 : 0x33 ,
-  0x330e01 : 0x33 ,
-  0x330e02 : 0x33 ,
-  0x330f01 : 0x33 ,
-  0x330f02 : 0x33 ,
-  0x331001 : 0x33 ,
-  0x331002 : 0x33 ,
-  0x331101 : 0x33 ,
-  0x331102 : 0x33 ,
-  0x331201 : 0x33 ,
-  0x331202 : 0x33 ,
-  0x331301 : 0x33 ,
-  0x331302 : 0x33 ,
-  0x331401 : 0x33 ,
-  0x331402 : 0x33 ,
-  0x331501 : 0x33 ,
-  0x331502 : 0x33 ,
-  0x331601 : 0x33 ,
-  0x331602 : 0x33 ,
-  0x331701 : 0x33 ,
-  0x331702 : 0x33 ,
-  0x331801 : 0x33 ,
-  0x331802 : 0x33 ,
-  0x331901 : 0x33 ,
-  0x331902 : 0x33 ,
-  0x331a01 : 0x33 ,
-  0x331a02 : 0x33 ,
-  0x331b01 : 0x33 ,
-  0x331b02 : 0x33 ,
-  0x331c01 : 0x33 ,
-  0x331c02 : 0x33 ,
-  0x331d01 : 0x33 ,
-  0x331d02 : 0x33 ,
-  0x331e01 : 0x33 ,
-  0x331e02 : 0x33 ,
-  0x331f01 : 0x33 ,
-  0x331f02 : 0x33 ,
-  0x332001 : 0x33 ,
-  0x332002 : 0x33 ,
-# 11 : Sub Detector = TRT_ENDCAP_C_SIDE
-  0x340101 : 0x34 ,
-  0x340102 : 0x34 ,
-  0x340201 : 0x34 ,
-  0x340202 : 0x34 ,
-  0x340301 : 0x34 ,
-  0x340302 : 0x34 ,
-  0x340401 : 0x34 ,
-  0x340402 : 0x34 ,
-  0x340501 : 0x34 ,
-  0x340502 : 0x34 ,
-  0x340601 : 0x34 ,
-  0x340602 : 0x34 ,
-  0x340701 : 0x34 ,
-  0x340702 : 0x34 ,
-  0x340801 : 0x34 ,
-  0x340802 : 0x34 ,
-  0x340901 : 0x34 ,
-  0x340902 : 0x34 ,
-  0x340a01 : 0x34 ,
-  0x340a02 : 0x34 ,
-  0x340b01 : 0x34 ,
-  0x340b02 : 0x34 ,
-  0x340c01 : 0x34 ,
-  0x340c02 : 0x34 ,
-  0x340d01 : 0x34 ,
-  0x340d02 : 0x34 ,
-  0x340e01 : 0x34 ,
-  0x340e02 : 0x34 ,
-  0x340f01 : 0x34 ,
-  0x340f02 : 0x34 ,
-  0x341001 : 0x34 ,
-  0x341002 : 0x34 ,
-  0x341101 : 0x34 ,
-  0x341102 : 0x34 ,
-  0x341201 : 0x34 ,
-  0x341202 : 0x34 ,
-  0x341301 : 0x34 ,
-  0x341302 : 0x34 ,
-  0x341401 : 0x34 ,
-  0x341402 : 0x34 ,
-  0x341501 : 0x34 ,
-  0x341502 : 0x34 ,
-  0x341601 : 0x34 ,
-  0x341602 : 0x34 ,
-  0x341701 : 0x34 ,
-  0x341702 : 0x34 ,
-  0x341801 : 0x34 ,
-  0x341802 : 0x34 ,
-  0x341901 : 0x34 ,
-  0x341902 : 0x34 ,
-  0x341a01 : 0x34 ,
-  0x341a02 : 0x34 ,
-  0x341b01 : 0x34 ,
-  0x341b02 : 0x34 ,
-  0x341c01 : 0x34 ,
-  0x341c02 : 0x34 ,
-  0x341d01 : 0x34 ,
-  0x341d02 : 0x34 ,
-  0x341e01 : 0x34 ,
-  0x341e02 : 0x34 ,
-  0x341f01 : 0x34 ,
-  0x341f02 : 0x34 ,
-  0x342001 : 0x34 ,
-  0x342002 : 0x34 ,
-# 12 : Sub Detector = LAR_EM_BARREL_A_SIDE
-  0x410000 : 0x41 ,
-  0x410001 : 0x41 ,
-  0x410002 : 0x41 ,
-  0x410003 : 0x41 ,
-  0x410004 : 0x41 ,
-  0x410005 : 0x41 ,
-  0x410006 : 0x41 ,
-  0x410007 : 0x41 ,
-  0x410008 : 0x41 ,
-  0x410009 : 0x41 ,
-  0x41000a : 0x41 ,
-  0x41000b : 0x41 ,
-  0x41000c : 0x41 ,
-  0x41000d : 0x41 ,
-  0x41000e : 0x41 ,
-  0x41000f : 0x41 ,
-  0x410010 : 0x41 ,
-  0x410011 : 0x41 ,
-  0x410012 : 0x41 ,
-  0x410013 : 0x41 ,
-  0x410014 : 0x41 ,
-  0x410015 : 0x41 ,
-  0x410016 : 0x41 ,
-  0x410017 : 0x41 ,
-  0x410018 : 0x41 ,
-  0x410019 : 0x41 ,
-  0x41001a : 0x41 ,
-  0x41001b : 0x41 ,
-  0x41001c : 0x41 ,
-  0x41001d : 0x41 ,
-  0x41001e : 0x41 ,
-  0x41001f : 0x41 ,
-  0x410020 : 0x41 ,
-  0x410021 : 0x41 ,
-  0x410022 : 0x41 ,
-  0x410023 : 0x41 ,
-  0x410024 : 0x41 ,
-  0x410025 : 0x41 ,
-  0x410026 : 0x41 ,
-  0x410027 : 0x41 ,
-  0x410028 : 0x41 ,
-  0x410029 : 0x41 ,
-  0x41002a : 0x41 ,
-  0x41002b : 0x41 ,
-  0x41002c : 0x41 ,
-  0x41002d : 0x41 ,
-  0x41002e : 0x41 ,
-  0x41002f : 0x41 ,
-  0x410030 : 0x41 ,
-  0x410031 : 0x41 ,
-  0x410032 : 0x41 ,
-  0x410033 : 0x41 ,
-  0x410034 : 0x41 ,
-  0x410035 : 0x41 ,
-  0x410036 : 0x41 ,
-  0x410037 : 0x41 ,
-  0x410038 : 0x41 ,
-  0x410039 : 0x41 ,
-  0x41003a : 0x41 ,
-  0x41003b : 0x41 ,
-  0x41003c : 0x41 ,
-  0x41003d : 0x41 ,
-  0x41003e : 0x41 ,
-  0x41003f : 0x41 ,
-  0x410040 : 0x41 ,
-  0x410041 : 0x41 ,
-  0x410042 : 0x41 ,
-  0x410043 : 0x41 ,
-  0x410044 : 0x41 ,
-  0x410045 : 0x41 ,
-  0x410046 : 0x41 ,
-  0x410047 : 0x41 ,
-  0x410048 : 0x41 ,
-  0x410049 : 0x41 ,
-  0x41004a : 0x41 ,
-  0x41004b : 0x41 ,
-  0x41004c : 0x41 ,
-  0x41004d : 0x41 ,
-  0x41004e : 0x41 ,
-  0x41004f : 0x41 ,
-  0x410050 : 0x41 ,
-  0x410051 : 0x41 ,
-  0x410052 : 0x41 ,
-  0x410053 : 0x41 ,
-  0x410054 : 0x41 ,
-  0x410055 : 0x41 ,
-  0x410056 : 0x41 ,
-  0x410057 : 0x41 ,
-  0x410058 : 0x41 ,
-  0x410059 : 0x41 ,
-  0x41005a : 0x41 ,
-  0x41005b : 0x41 ,
-  0x41005c : 0x41 ,
-  0x41005d : 0x41 ,
-  0x41005e : 0x41 ,
-  0x41005f : 0x41 ,
-  0x410060 : 0x41 ,
-  0x410061 : 0x41 ,
-  0x410062 : 0x41 ,
-  0x410063 : 0x41 ,
-  0x410064 : 0x41 ,
-  0x410065 : 0x41 ,
-  0x410066 : 0x41 ,
-  0x410067 : 0x41 ,
-  0x410068 : 0x41 ,
-  0x410069 : 0x41 ,
-  0x41006a : 0x41 ,
-  0x41006b : 0x41 ,
-  0x41006c : 0x41 ,
-  0x41006d : 0x41 ,
-  0x41006e : 0x41 ,
-  0x41006f : 0x41 ,
-  0x410070 : 0x41 ,
-  0x410071 : 0x41 ,
-  0x410072 : 0x41 ,
-  0x410073 : 0x41 ,
-  0x410074 : 0x41 ,
-  0x410075 : 0x41 ,
-  0x410076 : 0x41 ,
-  0x410077 : 0x41 ,
-  0x410078 : 0x41 ,
-  0x410079 : 0x41 ,
-  0x41007a : 0x41 ,
-  0x41007b : 0x41 ,
-  0x41007c : 0x41 ,
-  0x41007d : 0x41 ,
-  0x41007e : 0x41 ,
-  0x41007f : 0x41 ,
-  0x410080 : 0x41 ,
-  0x410081 : 0x41 ,
-  0x410082 : 0x41 ,
-  0x410083 : 0x41 ,
-  0x410084 : 0x41 ,
-  0x410085 : 0x41 ,
-  0x410086 : 0x41 ,
-  0x410087 : 0x41 ,
-  0x410088 : 0x41 ,
-  0x410089 : 0x41 ,
-  0x41008a : 0x41 ,
-  0x41008b : 0x41 ,
-  0x41008c : 0x41 ,
-  0x41008d : 0x41 ,
-  0x41008e : 0x41 ,
-  0x41008f : 0x41 ,
-  0x410090 : 0x41 ,
-  0x410091 : 0x41 ,
-  0x410092 : 0x41 ,
-  0x410093 : 0x41 ,
-  0x410094 : 0x41 ,
-  0x410095 : 0x41 ,
-  0x410096 : 0x41 ,
-  0x410097 : 0x41 ,
-  0x410098 : 0x41 ,
-  0x410099 : 0x41 ,
-  0x41009a : 0x41 ,
-  0x41009b : 0x41 ,
-  0x41009c : 0x41 ,
-  0x41009d : 0x41 ,
-  0x41009e : 0x41 ,
-  0x41009f : 0x41 ,
-  0x4100a0 : 0x41 ,
-  0x4100a1 : 0x41 ,
-  0x4100a2 : 0x41 ,
-  0x4100a3 : 0x41 ,
-  0x4100a4 : 0x41 ,
-  0x4100a5 : 0x41 ,
-  0x4100a6 : 0x41 ,
-  0x4100a7 : 0x41 ,
-  0x4100a8 : 0x41 ,
-  0x4100a9 : 0x41 ,
-  0x4100aa : 0x41 ,
-  0x4100ab : 0x41 ,
-  0x4100ac : 0x41 ,
-  0x4100ad : 0x41 ,
-  0x4100ae : 0x41 ,
-  0x4100af : 0x41 ,
-  0x4100b0 : 0x41 ,
-  0x4100b1 : 0x41 ,
-  0x4100b2 : 0x41 ,
-  0x4100b3 : 0x41 ,
-  0x4100b4 : 0x41 ,
-  0x4100b5 : 0x41 ,
-  0x4100b6 : 0x41 ,
-  0x4100b7 : 0x41 ,
-  0x4100b8 : 0x41 ,
-  0x4100b9 : 0x41 ,
-  0x4100ba : 0x41 ,
-  0x4100bb : 0x41 ,
-  0x4100bc : 0x41 ,
-  0x4100bd : 0x41 ,
-  0x4100be : 0x41 ,
-  0x4100bf : 0x41 ,
-  0x4100c0 : 0x41 ,
-  0x4100c1 : 0x41 ,
-  0x4100c2 : 0x41 ,
-  0x4100c3 : 0x41 ,
-  0x4100c4 : 0x41 ,
-  0x4100c5 : 0x41 ,
-  0x4100c6 : 0x41 ,
-  0x4100c7 : 0x41 ,
-  0x4100c8 : 0x41 ,
-  0x4100c9 : 0x41 ,
-  0x4100ca : 0x41 ,
-  0x4100cb : 0x41 ,
-  0x4100cc : 0x41 ,
-  0x4100cd : 0x41 ,
-  0x4100ce : 0x41 ,
-  0x4100cf : 0x41 ,
-  0x4100d0 : 0x41 ,
-  0x4100d1 : 0x41 ,
-  0x4100d2 : 0x41 ,
-  0x4100d3 : 0x41 ,
-  0x4100d4 : 0x41 ,
-  0x4100d5 : 0x41 ,
-  0x4100d6 : 0x41 ,
-  0x4100d7 : 0x41 ,
-  0x4100d8 : 0x41 ,
-  0x4100d9 : 0x41 ,
-  0x4100da : 0x41 ,
-  0x4100db : 0x41 ,
-  0x4100dc : 0x41 ,
-  0x4100dd : 0x41 ,
-  0x4100de : 0x41 ,
-  0x4100df : 0x41 ,
-# 13 : Sub Detector = LAR_EM_BARREL_C_SIDE
-  0x420000 : 0x42 ,
-  0x420001 : 0x42 ,
-  0x420002 : 0x42 ,
-  0x420003 : 0x42 ,
-  0x420004 : 0x42 ,
-  0x420005 : 0x42 ,
-  0x420006 : 0x42 ,
-  0x420007 : 0x42 ,
-  0x420008 : 0x42 ,
-  0x420009 : 0x42 ,
-  0x42000a : 0x42 ,
-  0x42000b : 0x42 ,
-  0x42000c : 0x42 ,
-  0x42000d : 0x42 ,
-  0x42000e : 0x42 ,
-  0x42000f : 0x42 ,
-  0x420010 : 0x42 ,
-  0x420011 : 0x42 ,
-  0x420012 : 0x42 ,
-  0x420013 : 0x42 ,
-  0x420014 : 0x42 ,
-  0x420015 : 0x42 ,
-  0x420016 : 0x42 ,
-  0x420017 : 0x42 ,
-  0x420018 : 0x42 ,
-  0x420019 : 0x42 ,
-  0x42001a : 0x42 ,
-  0x42001b : 0x42 ,
-  0x42001c : 0x42 ,
-  0x42001d : 0x42 ,
-  0x42001e : 0x42 ,
-  0x42001f : 0x42 ,
-  0x420020 : 0x42 ,
-  0x420021 : 0x42 ,
-  0x420022 : 0x42 ,
-  0x420023 : 0x42 ,
-  0x420024 : 0x42 ,
-  0x420025 : 0x42 ,
-  0x420026 : 0x42 ,
-  0x420027 : 0x42 ,
-  0x420028 : 0x42 ,
-  0x420029 : 0x42 ,
-  0x42002a : 0x42 ,
-  0x42002b : 0x42 ,
-  0x42002c : 0x42 ,
-  0x42002d : 0x42 ,
-  0x42002e : 0x42 ,
-  0x42002f : 0x42 ,
-  0x420030 : 0x42 ,
-  0x420031 : 0x42 ,
-  0x420032 : 0x42 ,
-  0x420033 : 0x42 ,
-  0x420034 : 0x42 ,
-  0x420035 : 0x42 ,
-  0x420036 : 0x42 ,
-  0x420037 : 0x42 ,
-  0x420038 : 0x42 ,
-  0x420039 : 0x42 ,
-  0x42003a : 0x42 ,
-  0x42003b : 0x42 ,
-  0x42003c : 0x42 ,
-  0x42003d : 0x42 ,
-  0x42003e : 0x42 ,
-  0x42003f : 0x42 ,
-  0x420040 : 0x42 ,
-  0x420041 : 0x42 ,
-  0x420042 : 0x42 ,
-  0x420043 : 0x42 ,
-  0x420044 : 0x42 ,
-  0x420045 : 0x42 ,
-  0x420046 : 0x42 ,
-  0x420047 : 0x42 ,
-  0x420048 : 0x42 ,
-  0x420049 : 0x42 ,
-  0x42004a : 0x42 ,
-  0x42004b : 0x42 ,
-  0x42004c : 0x42 ,
-  0x42004d : 0x42 ,
-  0x42004e : 0x42 ,
-  0x42004f : 0x42 ,
-  0x420050 : 0x42 ,
-  0x420051 : 0x42 ,
-  0x420052 : 0x42 ,
-  0x420053 : 0x42 ,
-  0x420054 : 0x42 ,
-  0x420055 : 0x42 ,
-  0x420056 : 0x42 ,
-  0x420057 : 0x42 ,
-  0x420058 : 0x42 ,
-  0x420059 : 0x42 ,
-  0x42005a : 0x42 ,
-  0x42005b : 0x42 ,
-  0x42005c : 0x42 ,
-  0x42005d : 0x42 ,
-  0x42005e : 0x42 ,
-  0x42005f : 0x42 ,
-  0x420060 : 0x42 ,
-  0x420061 : 0x42 ,
-  0x420062 : 0x42 ,
-  0x420063 : 0x42 ,
-  0x420064 : 0x42 ,
-  0x420065 : 0x42 ,
-  0x420066 : 0x42 ,
-  0x420067 : 0x42 ,
-  0x420068 : 0x42 ,
-  0x420069 : 0x42 ,
-  0x42006a : 0x42 ,
-  0x42006b : 0x42 ,
-  0x42006c : 0x42 ,
-  0x42006d : 0x42 ,
-  0x42006e : 0x42 ,
-  0x42006f : 0x42 ,
-  0x420070 : 0x42 ,
-  0x420071 : 0x42 ,
-  0x420072 : 0x42 ,
-  0x420073 : 0x42 ,
-  0x420074 : 0x42 ,
-  0x420075 : 0x42 ,
-  0x420076 : 0x42 ,
-  0x420077 : 0x42 ,
-  0x420078 : 0x42 ,
-  0x420079 : 0x42 ,
-  0x42007a : 0x42 ,
-  0x42007b : 0x42 ,
-  0x42007c : 0x42 ,
-  0x42007d : 0x42 ,
-  0x42007e : 0x42 ,
-  0x42007f : 0x42 ,
-  0x420080 : 0x42 ,
-  0x420081 : 0x42 ,
-  0x420082 : 0x42 ,
-  0x420083 : 0x42 ,
-  0x420084 : 0x42 ,
-  0x420085 : 0x42 ,
-  0x420086 : 0x42 ,
-  0x420087 : 0x42 ,
-  0x420088 : 0x42 ,
-  0x420089 : 0x42 ,
-  0x42008a : 0x42 ,
-  0x42008b : 0x42 ,
-  0x42008c : 0x42 ,
-  0x42008d : 0x42 ,
-  0x42008e : 0x42 ,
-  0x42008f : 0x42 ,
-  0x420090 : 0x42 ,
-  0x420091 : 0x42 ,
-  0x420092 : 0x42 ,
-  0x420093 : 0x42 ,
-  0x420094 : 0x42 ,
-  0x420095 : 0x42 ,
-  0x420096 : 0x42 ,
-  0x420097 : 0x42 ,
-  0x420098 : 0x42 ,
-  0x420099 : 0x42 ,
-  0x42009a : 0x42 ,
-  0x42009b : 0x42 ,
-  0x42009c : 0x42 ,
-  0x42009d : 0x42 ,
-  0x42009e : 0x42 ,
-  0x42009f : 0x42 ,
-  0x4200a0 : 0x42 ,
-  0x4200a1 : 0x42 ,
-  0x4200a2 : 0x42 ,
-  0x4200a3 : 0x42 ,
-  0x4200a4 : 0x42 ,
-  0x4200a5 : 0x42 ,
-  0x4200a6 : 0x42 ,
-  0x4200a7 : 0x42 ,
-  0x4200a8 : 0x42 ,
-  0x4200a9 : 0x42 ,
-  0x4200aa : 0x42 ,
-  0x4200ab : 0x42 ,
-  0x4200ac : 0x42 ,
-  0x4200ad : 0x42 ,
-  0x4200ae : 0x42 ,
-  0x4200af : 0x42 ,
-  0x4200b0 : 0x42 ,
-  0x4200b1 : 0x42 ,
-  0x4200b2 : 0x42 ,
-  0x4200b3 : 0x42 ,
-  0x4200b4 : 0x42 ,
-  0x4200b5 : 0x42 ,
-  0x4200b6 : 0x42 ,
-  0x4200b7 : 0x42 ,
-  0x4200b8 : 0x42 ,
-  0x4200b9 : 0x42 ,
-  0x4200ba : 0x42 ,
-  0x4200bb : 0x42 ,
-  0x4200bc : 0x42 ,
-  0x4200bd : 0x42 ,
-  0x4200be : 0x42 ,
-  0x4200bf : 0x42 ,
-  0x4200c0 : 0x42 ,
-  0x4200c1 : 0x42 ,
-  0x4200c2 : 0x42 ,
-  0x4200c3 : 0x42 ,
-  0x4200c4 : 0x42 ,
-  0x4200c5 : 0x42 ,
-  0x4200c6 : 0x42 ,
-  0x4200c7 : 0x42 ,
-  0x4200c8 : 0x42 ,
-  0x4200c9 : 0x42 ,
-  0x4200ca : 0x42 ,
-  0x4200cb : 0x42 ,
-  0x4200cc : 0x42 ,
-  0x4200cd : 0x42 ,
-  0x4200ce : 0x42 ,
-  0x4200cf : 0x42 ,
-  0x4200d0 : 0x42 ,
-  0x4200d1 : 0x42 ,
-  0x4200d2 : 0x42 ,
-  0x4200d3 : 0x42 ,
-  0x4200d4 : 0x42 ,
-  0x4200d5 : 0x42 ,
-  0x4200d6 : 0x42 ,
-  0x4200d7 : 0x42 ,
-  0x4200d8 : 0x42 ,
-  0x4200d9 : 0x42 ,
-  0x4200da : 0x42 ,
-  0x4200db : 0x42 ,
-  0x4200dc : 0x42 ,
-  0x4200dd : 0x42 ,
-  0x4200de : 0x42 ,
-  0x4200df : 0x42 ,
-# 14 : Sub Detector = LAR_EM_ENDCAP_A_SIDE
-  0x430000 : 0x43 ,
-  0x430001 : 0x43 ,
-  0x430002 : 0x43 ,
-  0x430003 : 0x43 ,
-  0x430004 : 0x43 ,
-  0x430005 : 0x43 ,
-  0x430006 : 0x43 ,
-  0x430007 : 0x43 ,
-  0x430008 : 0x43 ,
-  0x430009 : 0x43 ,
-  0x43000a : 0x43 ,
-  0x43000b : 0x43 ,
-  0x43000c : 0x43 ,
-  0x43000d : 0x43 ,
-  0x43000e : 0x43 ,
-  0x43000f : 0x43 ,
-  0x430010 : 0x43 ,
-  0x430011 : 0x43 ,
-  0x430012 : 0x43 ,
-  0x430013 : 0x43 ,
-  0x430014 : 0x43 ,
-  0x430015 : 0x43 ,
-  0x430016 : 0x43 ,
-  0x430017 : 0x43 ,
-  0x430018 : 0x43 ,
-  0x430019 : 0x43 ,
-  0x43001a : 0x43 ,
-  0x43001b : 0x43 ,
-  0x43001c : 0x43 ,
-  0x43001d : 0x43 ,
-  0x43001e : 0x43 ,
-  0x43001f : 0x43 ,
-  0x430020 : 0x43 ,
-  0x430021 : 0x43 ,
-  0x430022 : 0x43 ,
-  0x430023 : 0x43 ,
-  0x430024 : 0x43 ,
-  0x430025 : 0x43 ,
-  0x430026 : 0x43 ,
-  0x430027 : 0x43 ,
-  0x430028 : 0x43 ,
-  0x430029 : 0x43 ,
-  0x43002a : 0x43 ,
-  0x43002b : 0x43 ,
-  0x43002c : 0x43 ,
-  0x43002d : 0x43 ,
-  0x43002e : 0x43 ,
-  0x43002f : 0x43 ,
-  0x430030 : 0x43 ,
-  0x430031 : 0x43 ,
-  0x430032 : 0x43 ,
-  0x430033 : 0x43 ,
-  0x430034 : 0x43 ,
-  0x430035 : 0x43 ,
-  0x430036 : 0x43 ,
-  0x430037 : 0x43 ,
-  0x430038 : 0x43 ,
-  0x430039 : 0x43 ,
-  0x43003a : 0x43 ,
-  0x43003b : 0x43 ,
-  0x43003c : 0x43 ,
-  0x43003d : 0x43 ,
-  0x43003e : 0x43 ,
-  0x43003f : 0x43 ,
-  0x430040 : 0x43 ,
-  0x430041 : 0x43 ,
-  0x430042 : 0x43 ,
-  0x430043 : 0x43 ,
-  0x430044 : 0x43 ,
-  0x430045 : 0x43 ,
-  0x430046 : 0x43 ,
-  0x430047 : 0x43 ,
-  0x430048 : 0x43 ,
-  0x430049 : 0x43 ,
-  0x43004a : 0x43 ,
-  0x43004b : 0x43 ,
-  0x43004c : 0x43 ,
-  0x43004d : 0x43 ,
-  0x43004e : 0x43 ,
-  0x43004f : 0x43 ,
-  0x430050 : 0x43 ,
-  0x430051 : 0x43 ,
-  0x430052 : 0x43 ,
-  0x430053 : 0x43 ,
-  0x430054 : 0x43 ,
-  0x430055 : 0x43 ,
-  0x430056 : 0x43 ,
-  0x430057 : 0x43 ,
-  0x430058 : 0x43 ,
-  0x430059 : 0x43 ,
-  0x43005a : 0x43 ,
-  0x43005b : 0x43 ,
-  0x43005c : 0x43 ,
-  0x43005d : 0x43 ,
-  0x43005e : 0x43 ,
-  0x43005f : 0x43 ,
-  0x430060 : 0x43 ,
-  0x430061 : 0x43 ,
-  0x430062 : 0x43 ,
-  0x430063 : 0x43 ,
-  0x430064 : 0x43 ,
-  0x430065 : 0x43 ,
-  0x430066 : 0x43 ,
-  0x430067 : 0x43 ,
-  0x430068 : 0x43 ,
-  0x430069 : 0x43 ,
-  0x43006a : 0x43 ,
-  0x43006b : 0x43 ,
-  0x43006c : 0x43 ,
-  0x43006d : 0x43 ,
-  0x43006e : 0x43 ,
-  0x43006f : 0x43 ,
-  0x430070 : 0x43 ,
-  0x430071 : 0x43 ,
-  0x430072 : 0x43 ,
-  0x430073 : 0x43 ,
-  0x430074 : 0x43 ,
-  0x430075 : 0x43 ,
-  0x430076 : 0x43 ,
-  0x430077 : 0x43 ,
-  0x430078 : 0x43 ,
-  0x430079 : 0x43 ,
-  0x43007a : 0x43 ,
-  0x43007b : 0x43 ,
-  0x43007c : 0x43 ,
-  0x43007d : 0x43 ,
-  0x43007e : 0x43 ,
-  0x43007f : 0x43 ,
-  0x430080 : 0x43 ,
-  0x430081 : 0x43 ,
-  0x430082 : 0x43 ,
-  0x430083 : 0x43 ,
-  0x430084 : 0x43 ,
-  0x430085 : 0x43 ,
-  0x430086 : 0x43 ,
-  0x430087 : 0x43 ,
-  0x430088 : 0x43 ,
-  0x430089 : 0x43 ,
-# 15 : Sub Detector = LAR_EM_ENDCAP_C_SIDE
-  0x440000 : 0x44 ,
-  0x440001 : 0x44 ,
-  0x440002 : 0x44 ,
-  0x440003 : 0x44 ,
-  0x440004 : 0x44 ,
-  0x440005 : 0x44 ,
-  0x440006 : 0x44 ,
-  0x440007 : 0x44 ,
-  0x440008 : 0x44 ,
-  0x440009 : 0x44 ,
-  0x44000a : 0x44 ,
-  0x44000b : 0x44 ,
-  0x44000c : 0x44 ,
-  0x44000d : 0x44 ,
-  0x44000e : 0x44 ,
-  0x44000f : 0x44 ,
-  0x440010 : 0x44 ,
-  0x440011 : 0x44 ,
-  0x440012 : 0x44 ,
-  0x440013 : 0x44 ,
-  0x440014 : 0x44 ,
-  0x440015 : 0x44 ,
-  0x440016 : 0x44 ,
-  0x440017 : 0x44 ,
-  0x440018 : 0x44 ,
-  0x440019 : 0x44 ,
-  0x44001a : 0x44 ,
-  0x44001b : 0x44 ,
-  0x44001c : 0x44 ,
-  0x44001d : 0x44 ,
-  0x44001e : 0x44 ,
-  0x44001f : 0x44 ,
-  0x440020 : 0x44 ,
-  0x440021 : 0x44 ,
-  0x440022 : 0x44 ,
-  0x440023 : 0x44 ,
-  0x440024 : 0x44 ,
-  0x440025 : 0x44 ,
-  0x440026 : 0x44 ,
-  0x440027 : 0x44 ,
-  0x440028 : 0x44 ,
-  0x440029 : 0x44 ,
-  0x44002a : 0x44 ,
-  0x44002b : 0x44 ,
-  0x44002c : 0x44 ,
-  0x44002d : 0x44 ,
-  0x44002e : 0x44 ,
-  0x44002f : 0x44 ,
-  0x440030 : 0x44 ,
-  0x440031 : 0x44 ,
-  0x440032 : 0x44 ,
-  0x440033 : 0x44 ,
-  0x440034 : 0x44 ,
-  0x440035 : 0x44 ,
-  0x440036 : 0x44 ,
-  0x440037 : 0x44 ,
-  0x440038 : 0x44 ,
-  0x440039 : 0x44 ,
-  0x44003a : 0x44 ,
-  0x44003b : 0x44 ,
-  0x44003c : 0x44 ,
-  0x44003d : 0x44 ,
-  0x44003e : 0x44 ,
-  0x44003f : 0x44 ,
-  0x440040 : 0x44 ,
-  0x440041 : 0x44 ,
-  0x440042 : 0x44 ,
-  0x440043 : 0x44 ,
-  0x440044 : 0x44 ,
-  0x440045 : 0x44 ,
-  0x440046 : 0x44 ,
-  0x440047 : 0x44 ,
-  0x440048 : 0x44 ,
-  0x440049 : 0x44 ,
-  0x44004a : 0x44 ,
-  0x44004b : 0x44 ,
-  0x44004c : 0x44 ,
-  0x44004d : 0x44 ,
-  0x44004e : 0x44 ,
-  0x44004f : 0x44 ,
-  0x440050 : 0x44 ,
-  0x440051 : 0x44 ,
-  0x440052 : 0x44 ,
-  0x440053 : 0x44 ,
-  0x440054 : 0x44 ,
-  0x440055 : 0x44 ,
-  0x440056 : 0x44 ,
-  0x440057 : 0x44 ,
-  0x440058 : 0x44 ,
-  0x440059 : 0x44 ,
-  0x44005a : 0x44 ,
-  0x44005b : 0x44 ,
-  0x44005c : 0x44 ,
-  0x44005d : 0x44 ,
-  0x44005e : 0x44 ,
-  0x44005f : 0x44 ,
-  0x440060 : 0x44 ,
-  0x440061 : 0x44 ,
-  0x440062 : 0x44 ,
-  0x440063 : 0x44 ,
-  0x440064 : 0x44 ,
-  0x440065 : 0x44 ,
-  0x440066 : 0x44 ,
-  0x440067 : 0x44 ,
-  0x440068 : 0x44 ,
-  0x440069 : 0x44 ,
-  0x44006a : 0x44 ,
-  0x44006b : 0x44 ,
-  0x44006c : 0x44 ,
-  0x44006d : 0x44 ,
-  0x44006e : 0x44 ,
-  0x44006f : 0x44 ,
-  0x440070 : 0x44 ,
-  0x440071 : 0x44 ,
-  0x440072 : 0x44 ,
-  0x440073 : 0x44 ,
-  0x440074 : 0x44 ,
-  0x440075 : 0x44 ,
-  0x440076 : 0x44 ,
-  0x440077 : 0x44 ,
-  0x440078 : 0x44 ,
-  0x440079 : 0x44 ,
-  0x44007a : 0x44 ,
-  0x44007b : 0x44 ,
-  0x44007c : 0x44 ,
-  0x44007d : 0x44 ,
-  0x44007e : 0x44 ,
-  0x44007f : 0x44 ,
-  0x440080 : 0x44 ,
-  0x440081 : 0x44 ,
-  0x440082 : 0x44 ,
-  0x440083 : 0x44 ,
-  0x440084 : 0x44 ,
-  0x440085 : 0x44 ,
-  0x440086 : 0x44 ,
-  0x440087 : 0x44 ,
-  0x440088 : 0x44 ,
-  0x440089 : 0x44 ,
-# 16 : Sub Detector = LAR_HAD_ENDCAP_A_SIDE
-  0x450000 : 0x45 ,
-  0x450001 : 0x45 ,
-  0x450002 : 0x45 ,
-  0x450003 : 0x45 ,
-  0x450004 : 0x45 ,
-  0x450005 : 0x45 ,
-  0x450006 : 0x45 ,
-  0x450007 : 0x45 ,
-  0x450008 : 0x45 ,
-  0x450009 : 0x45 ,
-  0x45000a : 0x45 ,
-  0x45000b : 0x45 ,
-# 17 : Sub Detector = LAR_HAD_ENDCAP_C_SIDE
-  0x460000 : 0x46 ,
-  0x460001 : 0x46 ,
-  0x460002 : 0x46 ,
-  0x460003 : 0x46 ,
-  0x460004 : 0x46 ,
-  0x460005 : 0x46 ,
-  0x460006 : 0x46 ,
-  0x460007 : 0x46 ,
-  0x460008 : 0x46 ,
-  0x460009 : 0x46 ,
-  0x46000a : 0x46 ,
-  0x46000b : 0x46 ,
-# 18 : Sub Detector = LAR_FCAL_A_SIDE
-  0x470000 : 0x47 ,
-  0x470001 : 0x47 ,
-  0x470002 : 0x47 ,
-  0x470003 : 0x47 ,
-  0x470004 : 0x47 ,
-  0x470005 : 0x47 ,
-  0x470006 : 0x47 ,
-# 19 : Sub Detector = LAR_FCAL_C_SIDE
-  0x480000 : 0x48 ,
-  0x480001 : 0x48 ,
-  0x480002 : 0x48 ,
-  0x480003 : 0x48 ,
-  0x480004 : 0x48 ,
-  0x480005 : 0x48 ,
-  0x480006 : 0x48 ,
-# 20 : Sub Detector = TILECAL_BARREL_A_SIDE
-  0x510000 : 0x51 ,
-  0x510001 : 0x51 ,
-  0x510002 : 0x51 ,
-  0x510003 : 0x51 ,
-  0x510004 : 0x51 ,
-  0x510005 : 0x51 ,
-  0x510006 : 0x51 ,
-  0x510007 : 0x51 ,
-  0x510008 : 0x51 ,
-  0x510009 : 0x51 ,
-  0x51000a : 0x51 ,
-  0x51000b : 0x51 ,
-  0x51000c : 0x51 ,
-  0x51000d : 0x51 ,
-  0x51000e : 0x51 ,
-  0x51000f : 0x51 ,
-# 21 : Sub Detector = TILECAL_BARREL_C_SIDE
-  0x520000 : 0x52 ,
-  0x520001 : 0x52 ,
-  0x520002 : 0x52 ,
-  0x520003 : 0x52 ,
-  0x520004 : 0x52 ,
-  0x520005 : 0x52 ,
-  0x520006 : 0x52 ,
-  0x520007 : 0x52 ,
-  0x520008 : 0x52 ,
-  0x520009 : 0x52 ,
-  0x52000a : 0x52 ,
-  0x52000b : 0x52 ,
-  0x52000c : 0x52 ,
-  0x52000d : 0x52 ,
-  0x52000e : 0x52 ,
-  0x52000f : 0x52 ,
-  0x520010 : 0x52 ,
-# 22 : Sub Detector = TILECAL_EXT_A_SIDE
-  0x530000 : 0x53 ,
-  0x530001 : 0x53 ,
-  0x530002 : 0x53 ,
-  0x530003 : 0x53 ,
-  0x530004 : 0x53 ,
-  0x530005 : 0x53 ,
-  0x530006 : 0x53 ,
-  0x530007 : 0x53 ,
-  0x530008 : 0x53 ,
-  0x530009 : 0x53 ,
-  0x53000a : 0x53 ,
-  0x53000b : 0x53 ,
-  0x53000c : 0x53 ,
-  0x53000d : 0x53 ,
-  0x53000e : 0x53 ,
-  0x53000f : 0x53 ,
-# 23 : Sub Detector = TILECAL_EXT_C_SIDE
-  0x540000 : 0x54 ,
-  0x540001 : 0x54 ,
-  0x540002 : 0x54 ,
-  0x540003 : 0x54 ,
-  0x540004 : 0x54 ,
-  0x540005 : 0x54 ,
-  0x540006 : 0x54 ,
-  0x540007 : 0x54 ,
-  0x540008 : 0x54 ,
-  0x540009 : 0x54 ,
-  0x54000a : 0x54 ,
-  0x54000b : 0x54 ,
-  0x54000c : 0x54 ,
-  0x54000d : 0x54 ,
-  0x54000e : 0x54 ,
-  0x54000f : 0x54 ,
-# 24 : Sub Detector = MUON_MDT_BARREL_A_SIDE
-  0x610000 : 0x61 ,
-  0x610001 : 0x61 ,
-  0x610002 : 0x61 ,
-  0x610003 : 0x61 ,
-  0x610004 : 0x61 ,
-  0x610005 : 0x61 ,
-  0x610006 : 0x61 ,
-  0x610007 : 0x61 ,
-  0x610008 : 0x61 ,
-  0x610009 : 0x61 ,
-  0x61000a : 0x61 ,
-  0x61000b : 0x61 ,
-  0x61000c : 0x61 ,
-  0x61000d : 0x61 ,
-  0x61000e : 0x61 ,
-  0x61000f : 0x61 ,
-  0x610010 : 0x61 ,
-  0x610011 : 0x61 ,
-  0x610012 : 0x61 ,
-  0x610013 : 0x61 ,
-  0x610014 : 0x61 ,
-  0x610015 : 0x61 ,
-  0x610016 : 0x61 ,
-  0x610017 : 0x61 ,
-  0x610018 : 0x61 ,
-  0x610019 : 0x61 ,
-  0x61001a : 0x61 ,
-  0x61001b : 0x61 ,
-  0x61001c : 0x61 ,
-  0x61001d : 0x61 ,
-  0x61001e : 0x61 ,
-  0x61001f : 0x61 ,
-  0x610020 : 0x61 ,
-  0x610021 : 0x61 ,
-  0x610022 : 0x61 ,
-  0x610023 : 0x61 ,
-  0x610024 : 0x61 ,
-  0x610025 : 0x61 ,
-  0x610026 : 0x61 ,
-  0x610027 : 0x61 ,
-  0x610028 : 0x61 ,
-  0x610029 : 0x61 ,
-  0x61002a : 0x61 ,
-  0x61002b : 0x61 ,
-  0x61002c : 0x61 ,
-  0x61002d : 0x61 ,
-  0x61002e : 0x61 ,
-  0x61002f : 0x61 ,
-  0x610030 : 0x61 ,
-  0x610031 : 0x61 ,
-# 25 : Sub Detector = MUON_MDT_BARREL_C_SIDE
-  0x620000 : 0x62 ,
-  0x620001 : 0x62 ,
-  0x620002 : 0x62 ,
-  0x620003 : 0x62 ,
-  0x620004 : 0x62 ,
-  0x620005 : 0x62 ,
-  0x620006 : 0x62 ,
-  0x620007 : 0x62 ,
-  0x620008 : 0x62 ,
-  0x620009 : 0x62 ,
-  0x62000a : 0x62 ,
-  0x62000b : 0x62 ,
-  0x62000c : 0x62 ,
-  0x62000d : 0x62 ,
-  0x62000e : 0x62 ,
-  0x62000f : 0x62 ,
-  0x620010 : 0x62 ,
-  0x620011 : 0x62 ,
-  0x620012 : 0x62 ,
-  0x620013 : 0x62 ,
-  0x620014 : 0x62 ,
-  0x620015 : 0x62 ,
-  0x620016 : 0x62 ,
-  0x620017 : 0x62 ,
-  0x620018 : 0x62 ,
-  0x620019 : 0x62 ,
-  0x62001a : 0x62 ,
-  0x62001b : 0x62 ,
-  0x62001c : 0x62 ,
-  0x62001d : 0x62 ,
-  0x62001e : 0x62 ,
-  0x62001f : 0x62 ,
-  0x620020 : 0x62 ,
-  0x620021 : 0x62 ,
-  0x620022 : 0x62 ,
-  0x620023 : 0x62 ,
-  0x620024 : 0x62 ,
-  0x620025 : 0x62 ,
-  0x620026 : 0x62 ,
-  0x620027 : 0x62 ,
-  0x620028 : 0x62 ,
-  0x620029 : 0x62 ,
-  0x62002a : 0x62 ,
-  0x62002b : 0x62 ,
-  0x62002c : 0x62 ,
-  0x62002d : 0x62 ,
-  0x62002e : 0x62 ,
-  0x62002f : 0x62 ,
-  0x620030 : 0x62 ,
-  0x620031 : 0x62 ,
-# 26 : Sub Detector = MUON_MDT_ENDCAP_A_SIDE
-  0x630000 : 0x63 ,
-  0x630001 : 0x63 ,
-  0x630002 : 0x63 ,
-  0x630003 : 0x63 ,
-  0x630004 : 0x63 ,
-  0x630005 : 0x63 ,
-  0x630006 : 0x63 ,
-  0x630007 : 0x63 ,
-  0x630008 : 0x63 ,
-  0x630009 : 0x63 ,
-  0x63000a : 0x63 ,
-  0x63000b : 0x63 ,
-  0x63000c : 0x63 ,
-  0x63000d : 0x63 ,
-  0x63000e : 0x63 ,
-  0x63000f : 0x63 ,
-  0x630010 : 0x63 ,
-  0x630011 : 0x63 ,
-  0x630012 : 0x63 ,
-  0x630013 : 0x63 ,
-  0x630014 : 0x63 ,
-  0x630015 : 0x63 ,
-  0x630016 : 0x63 ,
-  0x630017 : 0x63 ,
-  0x630018 : 0x63 ,
-  0x630019 : 0x63 ,
-  0x63001a : 0x63 ,
-  0x63001b : 0x63 ,
-  0x63001c : 0x63 ,
-  0x63001d : 0x63 ,
-  0x63001e : 0x63 ,
-  0x63001f : 0x63 ,
-  0x630020 : 0x63 ,
-  0x630021 : 0x63 ,
-  0x630022 : 0x63 ,
-  0x630023 : 0x63 ,
-  0x630024 : 0x63 ,
-  0x630025 : 0x63 ,
-  0x630026 : 0x63 ,
-  0x630027 : 0x63 ,
-  0x630028 : 0x63 ,
-  0x630029 : 0x63 ,
-  0x63002a : 0x63 ,
-  0x63002b : 0x63 ,
-  0x63002c : 0x63 ,
-  0x63002d : 0x63 ,
-  0x63002e : 0x63 ,
-  0x63002f : 0x63 ,
-  0x630030 : 0x63 ,
-  0x630031 : 0x63 ,
-  0x630032 : 0x63 ,
-  0x630033 : 0x63 ,
-# 27 : Sub Detector = MUON_MDT_ENDCAP_C_SIDE
-  0x640000 : 0x64 ,
-  0x640001 : 0x64 ,
-  0x640002 : 0x64 ,
-  0x640003 : 0x64 ,
-  0x640004 : 0x64 ,
-  0x640005 : 0x64 ,
-  0x640006 : 0x64 ,
-  0x640007 : 0x64 ,
-  0x640008 : 0x64 ,
-  0x640009 : 0x64 ,
-  0x64000a : 0x64 ,
-  0x64000b : 0x64 ,
-  0x64000c : 0x64 ,
-  0x64000d : 0x64 ,
-  0x64000e : 0x64 ,
-  0x64000f : 0x64 ,
-  0x640010 : 0x64 ,
-  0x640011 : 0x64 ,
-  0x640012 : 0x64 ,
-  0x640013 : 0x64 ,
-  0x640014 : 0x64 ,
-  0x640015 : 0x64 ,
-  0x640016 : 0x64 ,
-  0x640017 : 0x64 ,
-  0x640018 : 0x64 ,
-  0x640019 : 0x64 ,
-  0x64001a : 0x64 ,
-  0x64001b : 0x64 ,
-  0x64001c : 0x64 ,
-  0x64001d : 0x64 ,
-  0x64001e : 0x64 ,
-  0x64001f : 0x64 ,
-  0x640020 : 0x64 ,
-  0x640021 : 0x64 ,
-  0x640022 : 0x64 ,
-  0x640023 : 0x64 ,
-  0x640024 : 0x64 ,
-  0x640025 : 0x64 ,
-  0x640026 : 0x64 ,
-  0x640027 : 0x64 ,
-  0x640028 : 0x64 ,
-  0x640029 : 0x64 ,
-  0x64002a : 0x64 ,
-  0x64002b : 0x64 ,
-  0x64002c : 0x64 ,
-  0x64002d : 0x64 ,
-  0x64002e : 0x64 ,
-  0x64002f : 0x64 ,
-  0x640030 : 0x64 ,
-  0x640031 : 0x64 ,
-  0x640032 : 0x64 ,
-  0x640033 : 0x64 ,
-# 28 : Sub Detector = MUON_RPC_BARREL_A_SIDE
-  0x650000 : 0x65 ,
-  0x650001 : 0x65 ,
-  0x650002 : 0x65 ,
-  0x650003 : 0x65 ,
-  0x650004 : 0x65 ,
-  0x650005 : 0x65 ,
-  0x650006 : 0x65 ,
-  0x650007 : 0x65 ,
-  0x650008 : 0x65 ,
-  0x650009 : 0x65 ,
-  0x65000a : 0x65 ,
-  0x65000b : 0x65 ,
-  0x65000c : 0x65 ,
-  0x65000d : 0x65 ,
-  0x65000e : 0x65 ,
-  0x65000f : 0x65 ,
-# 29 : Sub Detector = MUON_RPC_BARREL_C_SIDE
-  0x660000 : 0x66 ,
-  0x660001 : 0x66 ,
-  0x660002 : 0x66 ,
-  0x660003 : 0x66 ,
-  0x660004 : 0x66 ,
-  0x660005 : 0x66 ,
-  0x660006 : 0x66 ,
-  0x660007 : 0x66 ,
-  0x660008 : 0x66 ,
-  0x660009 : 0x66 ,
-  0x66000a : 0x66 ,
-  0x66000b : 0x66 ,
-  0x66000c : 0x66 ,
-  0x66000d : 0x66 ,
-  0x66000e : 0x66 ,
-  0x66000f : 0x66 ,
-# 30 : Sub Detector = MUON_TGC_ENDCAP_A_SIDE
-  0x670001 : 0x67 ,
-  0x670002 : 0x67 ,
-  0x670003 : 0x67 ,
-  0x670004 : 0x67 ,
-  0x670005 : 0x67 ,
-  0x670006 : 0x67 ,
-  0x670007 : 0x67 ,
-  0x670008 : 0x67 ,
-  0x670009 : 0x67 ,
-  0x67000a : 0x67 ,
-  0x67000b : 0x67 ,
-  0x67000c : 0x67 ,
-# 31 : Sub Detector = MUON_TGC_ENDCAP_C_SIDE
-  0x680001 : 0x68 ,
-  0x680002 : 0x68 ,
-  0x680003 : 0x68 ,
-  0x680004 : 0x68 ,
-  0x680005 : 0x68 ,
-  0x680006 : 0x68 ,
-  0x680007 : 0x68 ,
-  0x680008 : 0x68 ,
-  0x680009 : 0x68 ,
-  0x68000a : 0x68 ,
-  0x68000b : 0x68 ,
-  0x68000c : 0x68 ,
-# 32 : Sub Detector = MUON_CSC_ENDCAP_A_SIDE
-  0x690005 : 0x69 ,
-  0x690007 : 0x69 ,
-  0x690009 : 0x69 ,
-  0x690011 : 0x69 ,
-  0x690015 : 0x69 ,
-  0x690017 : 0x69 ,
-  0x690019 : 0x69 ,
-  0x690021 : 0x69 ,
-# 33 : Sub Detector = MUON_CSC_ENDCAP_C_SIDE
-  0x6a0005 : 0x6a ,
-  0x6a0007 : 0x6a ,
-  0x6a0009 : 0x6a ,
-  0x6a0011 : 0x6a ,
-  0x6a0015 : 0x6a ,
-  0x6a0017 : 0x6a ,
-  0x6a0019 : 0x6a ,
-  0x6a0021 : 0x6a ,
-# 34 : Sub Detector = TDAQ_CALO_PREPROC
-  0x710000 : 0x71 ,
-  0x710001 : 0x71 ,
-  0x710002 : 0x71 ,
-  0x710003 : 0x71 ,
-  0x710004 : 0x71 ,
-  0x710005 : 0x71 ,
-  0x710006 : 0x71 ,
-  0x710007 : 0x71 ,
-  0x710010 : 0x71 ,
-  0x710011 : 0x71 ,
-  0x710012 : 0x71 ,
-  0x710013 : 0x71 ,
-  0x710014 : 0x71 ,
-  0x710015 : 0x71 ,
-  0x710016 : 0x71 ,
-  0x710017 : 0x71 ,
-  0x710020 : 0x71 ,
-  0x710021 : 0x71 ,
-  0x710022 : 0x71 ,
-  0x710023 : 0x71 ,
-  0x710024 : 0x71 ,
-  0x710025 : 0x71 ,
-  0x710026 : 0x71 ,
-  0x710027 : 0x71 ,
-  0x710030 : 0x71 ,
-  0x710031 : 0x71 ,
-  0x710032 : 0x71 ,
-  0x710033 : 0x71 ,
-  0x710034 : 0x71 ,
-  0x710035 : 0x71 ,
-  0x710036 : 0x71 ,
-  0x710037 : 0x71 ,
-# 35 : Sub Detector = TDAQ_CALO_CLUSTER_PROC_DAQ
-  0x720008 : 0x72 ,
-  0x720009 : 0x72 ,
-  0x72000a : 0x72 ,
-  0x72000b : 0x72 ,
-  0x720028 : 0x72 ,
-  0x720029 : 0x72 ,
-  0x72002a : 0x72 ,
-  0x72002b : 0x72 ,
-# 36 : Sub Detector = TDAQ_CALO_JET_PROC_DAQ
-  0x74000c : 0x74 ,
-  0x74000d : 0x74 ,
-  0x74001c : 0x74 ,
-  0x74001d : 0x74 ,
-  0x74002c : 0x74 ,
-  0x74002d : 0x74 ,
-  0x74003c : 0x74 ,
-  0x74003d : 0x74 ,
-# 37 : Sub Detector = TDAQ_MUON_CTP_INTERFACE
-  0x760000 : 0x76 ,
-# 38 : Sub Detector = TDAQ_CTP
-  0x770000 : 0x77 ,
-# 39 : Sub Detector = FORWARD_BCM
-  0x81000a : 0x81 ,
-  0x81000c : 0x81 ,
-  0x81004a : 0x81 ,
-  0x81004c : 0x81 ,
-# 40 : Sub Detector = FORWARD_LUCID
-  0x820000 : 0x82 ,
-}
diff --git a/Trigger/TrigValidation/TriggerTest/share/testAthenaTrigRDO_standalone.py b/Trigger/TrigValidation/TriggerTest/share/testAthenaTrigRDO_standalone.py
deleted file mode 100644
index 1364d908c7b1..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/testAthenaTrigRDO_standalone.py
+++ /dev/null
@@ -1,27 +0,0 @@
-######################################################################################
-#
-# Run runHLT_standalone.py from TriggerJobOpts offline to compare with results
-# from AthenaMT/PT: run on RDO
-#
-######################################################################################
-
-
-# does not use RecExCommon_flags!
-
-if not ('EvtMax' in dir()):
-   EvtMax = 10
-
-
-
-ReadBS=False
-
-include("TriggerJobOpts/runHLT_standalone_run2.py")
-
-MessageSvc.Format = "% F%48W%S%7W%R%T %0W%M"
-
-printfunc (AlgSequence)
-printfunc (ServiceMgr)
-
-del EvtMax
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO.py b/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO.py
deleted file mode 100644
index a21903e73617..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO.py
+++ /dev/null
@@ -1,107 +0,0 @@
-######################################################################################
-#
-# This file is automatically generated with TriggerTest/python/TrigvalJobOptionBuilder.py
-# To generate TriggerTest/testIDAthenaModernRDO.py use  TriggerTest/python/trigValMakeJobOptions.py 
-#
-######################################################################################
-
-
-### usually ATN tests runs with following RDO input:
-#PoolRDOInput=["/afs/cern.ch/atlas/offline/data/testfile/calib1_csc11.005200.T1_McAtNlo_Jimmy.digit.RDO.v12000301_tid003138._00016_extract_10evt.pool.root"]
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-if not acf.EvtMax.is_locked():
-  acf.EvtMax=10
-if not ('OutputLevel' in dir()):
-  rec.OutputLevel=INFO
-
-###############################
-doTrigger=True
-rec.doESD.set_Value_and_Lock(False)
-
-
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD.set_Value_and_Lock(False) 
-doTAG=False
-
-#rec.doTruth=True
-rec.doTruth.set_Value_and_Lock(False)
-
-
-#-----------------------------------------------------------
-include("RecExCond/RecExCommon_flags.py")
-#-----------------------------------------------------------
-
-rec.AutoConfiguration = ['everything']
-import RecExConfig.AutoConfiguration as auto
-auto.ConfigureFromListOfKeys(rec.AutoConfiguration())
-
-TriggerFlags.readHLTconfigFromXML=False
-TriggerFlags.readLVL1configFromXML=False
-
-TriggerFlags.enableMonitoring = [ 'Validation', 'Time', 'Log' ]
-TriggerFlags.doHLT=True
-#TriggerFlags.doL1Topo=True 
-
-#Enable tau slice
-# PJB I can't configure this such that it runs EF ID only, and not
-# calo and/or tauRec, so I switch it off
-#TriggerFlags.TauSlice.setAll()
-#TriggerFlags.TauSlice.unsetCalo()
-#TriggerFlags.TauSlice.unsetEF()
-#TriggerFlags.TauSlice.unsetAll()
-#TriggerFlags.TauSlice.setID()
-#TriggerFlags.TauSlice.unsetCalo()
-#TriggerFlags.TauSlice.signatures = ["tau10"]
-#TriggerFlags.TauSlice.unsetEF()
-
-#### switch OFF other detectors
-#TriggerFlags.doMuon=False
-
-#------------ This is for ATN/RTT tests only ---------
-TriggerFlags.triggerMenuSetup = 'Physics_pp_v7'
-#-------------end of flag for tests-------------------
-
-#------------ This is a temporary fix ---------------
-#from RecExConfig.RecConfFlags import recConfFlags
-#recConfFlags.AllowIgnoreConfigError=False
-#athenaCommonFlags.AllowIgnoreConfigError=False
-#-------------end of temporary fix-------------------
-
-
-#override menu
-def ElectronOnly():
-  TriggerFlags.Slices_all_setOff()
-  
-    # Enable electron slice TriggerFlags.EgammaSlice.setAll()
-  TriggerFlags.EgammaSlice.unsetCalo()
-  TriggerFlags.Lvl1.items = TriggerFlags.Lvl1.items() + [  ]
-  
-  TriggerFlags.EgammaSlice.signatures = [
-    ['e28_lhtight_idperf',        'L1_EM24VHI',    [], ['express'], ['RATE:IDMonitoring', 'BW:Egamma', 'BW:ID'],-1],
-    ]
-    
-  
-from TriggerMenu.menu.GenerateMenu import GenerateMenu
-
-GenerateMenu.overwriteSignaturesWith(ElectronOnly)
-
-
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_topOptions.py")
-#-----------------------------------------------------------
-from AthenaCommon.AlgSequence import AthSequencer
-condSeq = AthSequencer("AthCondSeq")
-if not hasattr( condSeq, "LumiBlockMuWriter" ):
-    include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py")
-
-#-----------------------------------------------------------
-include("TriggerTest/TriggerTestCommon.py")
-#-----------------------------------------------------------
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO_preRTTtest.py b/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO_preRTTtest.py
deleted file mode 100644
index 5a84736832c6..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/testIDAthenaTrigRDO_preRTTtest.py
+++ /dev/null
@@ -1,26 +0,0 @@
-######################################################################################
-#
-# Skeleton job options to run
-# TrigInDetValidation/TrigInDetValidation_RTT_topOptions.py 
-# in ATN to catch errors early
-#
-######################################################################################
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-acf.EvtMax=2
-if not acf.EvtMax.is_locked():
-    acf.EvtMax.set_Value_and_Lock(2)
-if not ('OutputLevel' in dir()):
-    rec.OutputLevel=INFO
-
-#-------------------------------------------------------------------
-include("TrigInDetValidation/TrigInDetValidation_RTT_topOptions_ElectronSlice.py")
-#-----------------------------------------------------------
-
-#-------------------------------------------------------------------
-include("TriggerTest/TriggerTestCommon.py")
-#-----------------------------------------------------------
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/share/testLVL1CTPAthenaTrigRDO.py b/Trigger/TrigValidation/TriggerTest/share/testLVL1CTPAthenaTrigRDO.py
deleted file mode 100644
index 75190797d1a6..000000000000
--- a/Trigger/TrigValidation/TriggerTest/share/testLVL1CTPAthenaTrigRDO.py
+++ /dev/null
@@ -1,80 +0,0 @@
-### usually ATN tests runs with following RDO input:
-#PoolRDOInput=["/afs/cern.ch/atlas/offline/ReleaseData/v3/testfile/valid1.005200.T1_McAtNlo_Jimmy.digit.RDO.e322_s488_d151_tid039414_RDO.039414._00001_extract_10evt.pool.root"]
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-if not acf.EvtMax.is_locked():
-    acf.EvtMax=10
-if not ('OutputLevel' in dir()):
-    rec.OutputLevel=INFO
-#scan for RTT files (only if dsName and fileRange set)
-include("TriggerTest/TrigScanFiles.py")
-###############################
-
-doTrigger=True
-
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD.set_Value_and_Lock(False) 
-doTAG=False
-rec.doCBNT=False
-
-#rec.doTruth=False
-rec.doTruth.set_Value_and_Lock(False)
-
-#-----------------------------------------------------------
-include("RecExCond/RecExCommon_flags.py")
-#-----------------------------------------------------------
-
-# set up trigger monitoring                                                                                                                                                        
-if not ('RunningRTT' in dir()):
-    TriggerFlags.enableMonitoring = [ 'Validation', 'Time' , 'Log' ]
-else:
-    TriggerFlags.enableMonitoring = [ 'Validation', 'Time'  ]
-
-#------------ This is for ATN/RTT tests only ---------
-#TriggerFlags.triggerMenuSetup = 'default' 
-TriggerFlags.triggerMenuSetup = 'Physics_pp_v7' 
-
-#------------ run only LVL1 -------------------------- 
-TriggerFlags.doHLT=False
-#TriggerFlags.doL1Topo=True 
-
-
-def L1Only():
-    TriggerFlags.Slices_all_setOff()
-
-try:
-    from TriggerMenu import useNewTriggerMenu
-    useNewTM = useNewTriggerMenu()
-    log.info("Using new TriggerMenu: %r" % useNewTM)
-except:
-    useNewTM = False
-    log.info("Using old TriggerMenuPython since TriggerMenu.useNewTriggerMenu can't be imported")
-
-if useNewTM:
-    from TriggerMenu.menu.GenerateMenu import GenerateMenu
-else:
-    from TriggerMenuPython.GenerateMenu import GenerateMenu
-GenerateMenu.overwriteSignaturesWith(L1Only)
-
-#-----------------------------------------------------------
-include("RecExCommon/RecExCommon_topOptions.py")
-#-----------------------------------------------------------
-
-from LumiBlockComps.LumiBlockMuWriterDefault import LumiBlockMuWriterDefault
-LumiBlockMuWriterDefault()
-
-#------------------------------------------------------------
-include("TriggerTest/TriggerTestCommon.py")
-#------------------------------------------------------------
-
-
-#printfunc (AlgSequence())
-#printfunc (ServiceMgr)
-printfunc (DetFlags)
-printfunc (TriggerFlags)
-
-- 
GitLab


From 3ab73357a93a0d2881871050d08c285dd763c6f0 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 16:24:56 +0200
Subject: [PATCH 143/217] StoreGate: Fix potential deadlock between SGImplSvc
 and DataProxy

The SGImplSvc::proxy methods take out a lock on the store, fetch
the proxy, then call isValid() on the proxy.  DataProxy::isValid()
will acquire a lock on the proxy and than can call back to the store
via TransientAddress::contextFromStore().  Thus, we can get a deadlock
if SGImplSvc::proxy() is called in one thread and DataProxy::isValid()
in another.

Resolve by releasing the SGImplSvc lock in proxy() before calling
DataProxy::isValid().
---
 Control/StoreGate/src/SGImplSvc.cxx | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx
index 502702c18f91..d950f8257e0f 100644
--- a/Control/StoreGate/src/SGImplSvc.cxx
+++ b/Control/StoreGate/src/SGImplSvc.cxx
@@ -796,12 +796,17 @@ SGImplSvc::proxy(const CLID& id) const
 DataProxy* 
 SGImplSvc::proxy(const CLID& id, bool checkValid) const
 { 
-  lock_t lock (m_mutex);
-  DataProxy* dp = m_pStore->proxy(id);
-  if (0 == dp && 0 != m_pPPS) {
-    dp = m_pPPS->retrieveProxy(id, string("DEFAULT"), *m_pStore);
+  DataProxy* dp = nullptr;
+  {
+    lock_t lock (m_mutex);
+    dp = m_pStore->proxy(id);
+    if (0 == dp && 0 != m_pPPS) {
+      dp = m_pPPS->retrieveProxy(id, string("DEFAULT"), *m_pStore);
+    }
   }
   /// Check if it is valid
+  // Be sure to release the lock before this.
+  // isValid() may call back to the store, so we could otherwise deadlock..
   if (checkValid && 0 != dp) {
     // FIXME: For keyless retrieve, this checks only the first instance
     // of the CLID in store. If that happens to be invalid, but the second
@@ -820,11 +825,16 @@ SGImplSvc::proxy(const CLID& id, const string& key) const
 DataProxy*
 SGImplSvc::proxy(const CLID& id, const string& key, bool checkValid) const
 { 
-  lock_t lock (m_mutex);
-  DataProxy* dp = m_pStore->proxy(id, key);
-  if (0 == dp && 0 != m_pPPS) {
-    dp = m_pPPS->retrieveProxy(id, key, *m_pStore);
+  DataProxy* dp = nullptr;
+  {
+    lock_t lock (m_mutex);
+    dp = m_pStore->proxy(id, key);
+    if (0 == dp && 0 != m_pPPS) {
+      dp = m_pPPS->retrieveProxy(id, key, *m_pStore);
+    }
   }
+  // Be sure to release the lock before this.
+  // isValid() may call back to the store, so we could otherwise deadlock..
   if (checkValid && 0 != dp && !(dp->isValid())) dp = 0;
   return dp;
 }
-- 
GitLab


From 37302829db1f84055d7f8eb060326ae365e4663d Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 16:25:50 +0200
Subject: [PATCH 144/217] TrigT1CaloByteStream: Thread-safety hacks for
 L1CaloErrorByteStreamTool.

L1CaloErrorByteStreamTool is a public tool that is accumulating
information about unpacking errors.  Hack it so that the information
is made slot-specific and locked.  This should get things going,
but the design on this should be reconsidered.
---
 .../src/L1CaloErrorByteStreamTool.cxx         | 34 +++++++++++--------
 .../src/L1CaloErrorByteStreamTool.h           | 21 +++++++-----
 2 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx
index 7c48d50ee4f5..caac9a69428f 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx
@@ -60,10 +60,12 @@ StatusCode L1CaloErrorByteStreamTool::finalize()
 // Set ROB status error
 
 void L1CaloErrorByteStreamTool::robError(const uint32_t robid,
-                                         const unsigned int err)
+                                         const unsigned int err) const
 {
-  if (err && m_robMap.find(robid) == m_robMap.end()) {
-    m_robMap.insert(std::make_pair(robid, err));
+  ErrorMaps& maps = *m_maps;
+  std::scoped_lock lock (maps.m_mutex);
+  if (err && maps.m_robMap.find(robid) == maps.m_robMap.end()) {
+    maps.m_robMap.insert(std::make_pair(robid, err));
   }
   return;
 }
@@ -71,10 +73,12 @@ void L1CaloErrorByteStreamTool::robError(const uint32_t robid,
 // Set ROD unpacking error
 
 void L1CaloErrorByteStreamTool::rodError(const uint32_t robid,
-                                         const unsigned int err)
+                                         const unsigned int err) const
 {
-  if (err && m_rodMap.find(robid) == m_rodMap.end()) {
-    m_rodMap.insert(std::make_pair(robid, err));
+  ErrorMaps& maps = *m_maps;
+  std::scoped_lock lock (maps.m_mutex);
+  if (err && maps.m_rodMap.find(robid) == maps.m_rodMap.end()) {
+    maps.m_rodMap.insert(std::make_pair(robid, err));
   }
   return;
 }
@@ -84,22 +88,24 @@ void L1CaloErrorByteStreamTool::rodError(const uint32_t robid,
 StatusCode L1CaloErrorByteStreamTool::errors(std::vector<unsigned int>*
                                                                  const errColl)
 {
-  if (!m_robMap.empty() || !m_rodMap.empty()) {
-    errColl->push_back(m_robMap.size());
-    ErrorMap::const_iterator iter  = m_robMap.begin();
-    ErrorMap::const_iterator iterE = m_robMap.end();
+  ErrorMaps& maps = *m_maps;
+  std::scoped_lock lock (maps.m_mutex);
+  if (!maps.m_robMap.empty() || !maps.m_rodMap.empty()) {
+    errColl->push_back(maps.m_robMap.size());
+    ErrorMap::const_iterator iter  = maps.m_robMap.begin();
+    ErrorMap::const_iterator iterE = maps.m_robMap.end();
     for (; iter != iterE; ++iter) {
       errColl->push_back(iter->first);
       errColl->push_back(iter->second);
     }
-    m_robMap.clear();
-    iter  = m_rodMap.begin();
-    iterE = m_rodMap.end();
+    maps.m_robMap.clear();
+    iter  = maps.m_rodMap.begin();
+    iterE = maps.m_rodMap.end();
     for (; iter != iterE; ++iter) {
       errColl->push_back(iter->first);
       errColl->push_back(iter->second);
     }
-    m_rodMap.clear();
+    maps.m_rodMap.clear();
   }
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h
index 6bbf24809402..27fadc8e2d70 100644
--- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h
+++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h
@@ -12,6 +12,7 @@
 #include <vector>
 
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "AthenaKernel/SlotSpecificObj.h"
 
 class IInterface;
 class InterfaceID;
@@ -34,23 +35,27 @@ class L1CaloErrorByteStreamTool : public AthAlgTool {
    /// AlgTool InterfaceID
    static const InterfaceID& interfaceID();
 
-   virtual StatusCode initialize();
-   virtual StatusCode finalize();
+   virtual StatusCode initialize() override;
+   virtual StatusCode finalize() override;
 
    /// Set ROB status error
-   void robError(uint32_t robid, unsigned int err);
+   void robError(uint32_t robid, unsigned int err) const;
    /// Set ROD unpacking error
-   void rodError(uint32_t robid, unsigned int err);
+   void rodError(uint32_t robid, unsigned int err) const;
    /// Fill vector with accumulated errors and reset
    StatusCode errors(std::vector<unsigned int>* errColl);
 
  private:
 
-   // Maps of accumulated errors
+   // FIXME: do this in a sane way...
    typedef std::map<uint32_t, unsigned int> ErrorMap;
-   ErrorMap m_robMap;
-   ErrorMap m_rodMap;
-
+   struct ErrorMaps {
+     // Maps of accumulated errors
+     ErrorMap m_robMap;
+     ErrorMap m_rodMap;
+     std::mutex m_mutex;
+   };
+   mutable SG::SlotSpecificObj<ErrorMaps> m_maps;
 };
 
 } // end namespace
-- 
GitLab


From 68e3adec61843a7b6a3f0c0f1331d2aa9cfaae02 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 16:30:27 +0200
Subject: [PATCH 145/217] xAODMuonCnv: cmake fixes

Declare an interface library for exported headers.
---
 Event/xAOD/xAODMuonCnv/CMakeLists.txt | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Event/xAOD/xAODMuonCnv/CMakeLists.txt b/Event/xAOD/xAODMuonCnv/CMakeLists.txt
index ef886b53813a..05c304bfa6da 100644
--- a/Event/xAOD/xAODMuonCnv/CMakeLists.txt
+++ b/Event/xAOD/xAODMuonCnv/CMakeLists.txt
@@ -20,12 +20,16 @@ atlas_depends_on_subdirs( PUBLIC
                           Reconstruction/Particle
 			  Event/xAOD/xAODTruth )
 
+atlas_add_library( xAODMuonCnvLib
+                   xAODMuonCnv/*.h
+                   INTERFACE
+                   PUBLIC_HEADERS xAODMuonCnv
+                   LINK_LIBRARIES GaudiKernel xAODMuon MuonSegment TrkSegment AthLinks )
+
 # Component(s) in the package:
 atlas_add_component( xAODMuonCnv
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthLinks xAODMuon MuonSegment TrkSegment AthenaBaseComps AthenaKernel xAODPrimitives GaudiKernel muonEvent Particle xAODTruth)
+                     LINK_LIBRARIES xAODMuonCnvLib AthenaBaseComps AthenaKernel xAODPrimitives muonEvent Particle xAODTruth)
 
-# Install files from the package:
-atlas_install_headers( xAODMuonCnv )
 
-- 
GitLab


From 87c49234223951f9bf85d4f1ca25621772f06fc7 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 16:30:43 +0200
Subject: [PATCH 146/217] EgammaAnalysisInterfaces: cmake fixes

Library dependency fixes.
---
 .../Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
index a3eaaf9e43eb..433fbbee59ce 100644
--- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
+++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt
@@ -20,7 +20,7 @@ atlas_add_library( EgammaAnalysisInterfacesLib
    INTERFACE
    PUBLIC_HEADERS EgammaAnalysisInterfaces
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces PATCoreLib)
+   LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma PATInterfaces PATCoreLib AsgAnalysisInterfaces )
 
 atlas_add_dictionary( EgammaAnalysisInterfacesDict
    EgammaAnalysisInterfaces/EgammaAnalysisInterfacesDict.h
-- 
GitLab


From 07b4e421083e125112865f1212f14907a1c0ee22 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 16:31:03 +0200
Subject: [PATCH 147/217] MuonAnalysisInterfaces: cmake fixes

Library dependency fixes.
---
 .../Interfaces/MuonAnalysisInterfaces/CMakeLists.txt            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/Interfaces/MuonAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/MuonAnalysisInterfaces/CMakeLists.txt
index 88456b102453..bc7a9ff86be8 100644
--- a/PhysicsAnalysis/Interfaces/MuonAnalysisInterfaces/CMakeLists.txt
+++ b/PhysicsAnalysis/Interfaces/MuonAnalysisInterfaces/CMakeLists.txt
@@ -15,7 +15,7 @@ atlas_add_library( MuonAnalysisInterfacesLib
    MuonAnalysisInterfaces/*.h
    INTERFACE
    PUBLIC_HEADERS MuonAnalysisInterfaces
-   LINK_LIBRARIES AsgTools xAODEventInfo xAODMuon PATCoreLib )
+   LINK_LIBRARIES AsgTools xAODEventInfo xAODMuon PATCoreLib PATInterfaces )
 
 atlas_add_dictionary( MuonAnalysisInterfacesDict
    MuonAnalysisInterfaces/MuonAnalysisInterfacesDict.h
-- 
GitLab


From 3921738f7ee1d81b581362d1c896b6ec004a4a06 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 16:37:30 +0200
Subject: [PATCH 148/217] JetMomentTools: cmake fixes

Library dependency fixes.
---
 Reconstruction/Jet/JetMomentTools/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/Jet/JetMomentTools/CMakeLists.txt b/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
index 79333ec13f2a..96433ecda5ca 100644
--- a/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
+++ b/Reconstruction/Jet/JetMomentTools/CMakeLists.txt
@@ -73,7 +73,7 @@ atlas_add_library( JetMomentToolsLib
    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES}
    AsgTools xAODCaloEvent xAODJet xAODMissingET xAODTracking xAODTruth JetEDM JetInterface TrackVertexAssociationToolLib
-   JetRecLib JetUtils
+   JetRecLib JetUtils  PFlowUtilsLib
    PRIVATE_LINK_LIBRARIES CaloGeoHelpers xAODEventInfo xAODPFlow PathResolver )
 
 if( NOT XAOD_STANDALONE )
-- 
GitLab


From fa63467d93c8793b2769359ca44c1c319b7b7369 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 17:08:29 +0200
Subject: [PATCH 149/217] MuonGeoModel: Fix clang 10 warning.

If a dtor is declared final, the class itself should also be declared final.
---
 MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h
index 9e7b4eec6bde..8fec733c6d15 100755
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorTool.h
@@ -14,7 +14,7 @@ namespace MuonGM
 }
 
 
-class MuonDetectorTool : public GeoModelTool {
+class MuonDetectorTool final : public GeoModelTool {
 
 public:
 
-- 
GitLab


From 6eab986d31462b6ccd40ebd5940126082541b2a8 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 17:06:41 +0200
Subject: [PATCH 150/217] EventInfo: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 Event/EventInfo/src/EventStreamInfo.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Event/EventInfo/src/EventStreamInfo.cxx b/Event/EventInfo/src/EventStreamInfo.cxx
index 3bab00431379..99842d84c92e 100644
--- a/Event/EventInfo/src/EventStreamInfo.cxx
+++ b/Event/EventInfo/src/EventStreamInfo.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 /** @file EventStreamInfo.cxx
@@ -99,7 +99,7 @@ EventStreamInfo::print(MsgStream& log) const {
   }
   log << MSG::DEBUG << endmsg;
   log << MSG::DEBUG << "EventStreamInfo Processing Tags: ";
-  for (const std::string tag : m_processingTags) {
+  for (const std::string& tag : m_processingTags) {
     log << MSG::DEBUG << tag << ", ";
   }
   log << MSG::DEBUG << endmsg;
-- 
GitLab


From c07242e2641b1f7d4e7121ba9afcfb9f55fa571e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 17:07:43 +0200
Subject: [PATCH 151/217] xAODTau: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 Event/xAOD/xAODTau/Root/TauJet_v3.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/xAOD/xAODTau/Root/TauJet_v3.cxx b/Event/xAOD/xAODTau/Root/TauJet_v3.cxx
index a465a61feee2..2f62bb0434de 100644
--- a/Event/xAOD/xAODTau/Root/TauJet_v3.cxx
+++ b/Event/xAOD/xAODTau/Root/TauJet_v3.cxx
@@ -537,7 +537,7 @@ namespace xAOD {
   /// Get the v<const pointer> to a given tauTrack collection associated with this tau
   std::vector<const TauTrack*> TauJet_v3::tracksWithMask(unsigned int mask )const {
   std::vector<const TauTrack*> trks;
-    for(const ElementLink< xAOD::TauTrackContainer > link : tauTrackAcc(*this) ){
+    for(const ElementLink< xAOD::TauTrackContainer >& link : tauTrackAcc(*this) ){
       const TauTrack* trk = *link;
       if(trk->flagWithMask(mask)){
 	trks.push_back(trk);
-- 
GitLab


From 9ef5219207f2824390e0f656d87873f0a22c990f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 17:08:01 +0200
Subject: [PATCH 152/217] TrigConfIO: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../TrigConfIO/utils/TriggerMenuRW.cxx                 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
index c430147f5fee..a7a80c4e96de 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
+++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <cstdlib>
@@ -245,9 +245,9 @@ int main(int argc, char** argv) {
             fileLoader.loadFile( fn, jo);
             cout << "Loaded job options with " << jo.getObject("properties").getKeys().size() << " entries " << endl;
             if( cfg.detail ) {
-               for( const auto alg : jo.getObject("properties").data()) {
+               for( const auto& alg : jo.getObject("properties").data()) {
                   std::cout << alg.first << std::endl;
-                  for( const auto prop : alg.second ) {
+                  for( const auto& prop : alg.second ) {
                      std::cout << "      " << prop.first << " -> " << prop.second.data() << std::endl;
                   }
                }
@@ -292,9 +292,9 @@ int main(int argc, char** argv) {
       if (jo) {
          cout << "Loaded job options with " << jo.getObject("properties").getKeys().size() << " entries " << endl;
          if( cfg.detail ) {
-            for( const auto alg : jo.getObject("properties").data()) {
+            for( const auto& alg : jo.getObject("properties").data()) {
                std::cout << alg.first << std::endl;
-               for( const auto prop : alg.second ) {
+               for( const auto& prop : alg.second ) {
                   std::cout << "      " << prop.first << " -> " << prop.second.data() << std::endl;
                }
             }
-- 
GitLab


From d96348791d06ee33e8fd7068fa2d783b6b88a8f4 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Jul 2020 17:08:15 +0200
Subject: [PATCH 153/217] MuonEventTPCnv: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx  | 4 ++--
 .../src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx               | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx
index d9bab01dc75b..dfc96281ecd0 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/MM_RawDataContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonEventTPCnv/MuonRDO/MM_RawDataContainerCnv_p1.h"
@@ -40,7 +40,7 @@ void  Muon::MM_RawDataContainerCnv_p1::persToTrans(const Muon::MM_RawDataContain
   if (DEBUG) log<<MSG::VERBOSE<<"MM_RawDataContainerCnv_p1::persToTrans with MM_RawDataContainer_p1 with this many collections "<<numColl<<std::endl;
     
   MM_RawDataCollection* coll = nullptr;
-  for ( const MM_RawDataCollection_p1 collection : *persCont){
+  for ( const MM_RawDataCollection_p1& collection : *persCont){
 
     coll = new MM_RawDataCollection(collection.m_idHash);
     if ( transCont->addCollection(coll,collection.m_idHash).isFailure() ) {
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx
index ece37a850d4f..6c0e4080ed6a 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/STGC_RawDataContainerCnv_p1.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonEventTPCnv/MuonRDO/STGC_RawDataContainerCnv_p1.h"
@@ -39,7 +39,7 @@ void  Muon::STGC_RawDataContainerCnv_p1::persToTrans(const Muon::STGC_RawDataCon
   if (DEBUG) log<<MSG::VERBOSE<<"STGC_RawDataContainerCnv_p1::persToTrans with STGC_RawDataContainer_p1 with this many collections "<<numColl<<std::endl;
     
   STGC_RawDataCollection* coll = nullptr;
-  for ( const STGC_RawDataCollection_p1 collection : *persCont){
+  for ( const STGC_RawDataCollection_p1& collection : *persCont){
     coll = new STGC_RawDataCollection(collection.m_idHash);
     if ( transCont->addCollection(coll,collection.m_idHash).isFailure() ) {
       log << MSG::WARNING << "Could not add the sTGC collection during persistent->transient conversion" << std::endl;
-- 
GitLab


From 14623f4ea2663c2e16713d72e582d8cdc730797a Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 17:54:01 +0200
Subject: [PATCH 154/217] InDetGlobalMonitoring: createSummary -> summary

Use ITrackSummaryTool::summary instead of createSummary to resolve
thread-safety issues.
---
 .../InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx   | 9 ++-------
 .../src/InDetGlobalTrackMonTool.cxx                      | 6 +++---
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
index 007c89934147..0c3dcdaa2b13 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /** @file InDetGlobalPixelTool.cxx
@@ -147,17 +147,12 @@ StatusCode InDetGlobalPixelTool::fillHistograms()
 	  if (msgLvl(MSG::ERROR) ) msg(MSG::ERROR) << "no pointer to track!!!" << endmsg;
 	  break;
 	}
-      const Trk::TrackSummary* summary = m_trkSummaryTool->createSummary(*track);
+      std::unique_ptr<Trk::TrackSummary> summary = m_trkSummaryTool->summary(*track);
       if ( summary->get(Trk::numberOfPixelHits) == 0 )
       {
-	  delete summary;
 	  continue;
       }
                
-      else
-      {
-	  delete summary;
-      }
       const Trk::TrackParameters *trkParameters = 0;
 
       //get the track state on surfaces (a vector, on element per surface) and loop over it
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx
index fdc18f4f459e..0094d935302e 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /** @file InDetGlobalTrackMonTool.cxx
@@ -655,7 +655,7 @@ StatusCode InDetGlobalTrackMonTool::fillHistograms()
 	    continue;
 	
 	// Create a new summary or get copy of the cached one
-	std::unique_ptr<const Trk::TrackSummary> summary(m_trkSummaryTool->createSummary( * track ) );
+	std::unique_ptr<const Trk::TrackSummary> summary(m_trkSummaryTool->summary( * track ) );
 	
 	if ( !summary )
 	{
@@ -752,7 +752,7 @@ StatusCode InDetGlobalTrackMonTool::fillHistograms()
 		}
 		
 		// Create a new summary or get copy of the cached one
-		std::unique_ptr<const Trk::TrackSummary> summary( m_trkSummaryTool->createSummary( * track ) );
+		std::unique_ptr<const Trk::TrackSummary> summary( m_trkSummaryTool->summary( * track ) );
 		
 		if ( !summary )
 		{
-- 
GitLab


From aba9a0a3559b45d69af367e3194eb01fcc17d2bb Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 17:54:23 +0200
Subject: [PATCH 155/217] InDetAlignmentMonitoring: createSummary -> summary

Use ITrackSummaryTool::summary instead of createSummary to resolve
thread-safety issues.
---
 .../src/IDAlignMonEfficiencies.cxx                        | 6 ++----
 .../InDetAlignmentMonitoring/src/IDAlignMonSivsTRT.cxx    | 8 +++-----
 .../src/IDAlignMonTrackSegments.cxx                       | 8 ++------
 .../InDetAlignmentMonitoring/src/TrackSelectionAlg.cxx    | 8 ++------
 4 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx
index 190c97da5a76..a3651a9ff7bd 100755
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // **********************************************************************
@@ -1237,13 +1237,11 @@ StatusCode IDAlignMonEfficiencies::fillHistograms()
       } // end of outliers 
     } // TSOS on track 
     
-    const Trk::TrackSummary* summary = m_trackSumTool->createSummary(**trksItr);
+    std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(**trksItr);
     if( !summary->get(Trk::numberOfPixelHits) && !summary->get(Trk::numberOfSCTHits) && (summary->get(Trk::numberOfPixelHoles)==0) && (summary->get(Trk::numberOfSCTHoles)==0) && (m_doHoleSearch)){
       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No Pixel or SCT hits skip hole search" << endmsg;
-      delete summary;
       continue;
     }
-    delete summary;
 
     const DataVector<const Trk::TrackStateOnSurface>* HTSOS;
     HTSOS = m_holeSearchTool->getHolesOnTrack(**trksItr); 
diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonSivsTRT.cxx b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonSivsTRT.cxx
index 23b83e689896..35c72f34082e 100644
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonSivsTRT.cxx
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonSivsTRT.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // **********************************************************************
@@ -276,15 +276,13 @@ StatusCode IDAlignMonSivsTRT::fillHistograms()
       continue;
     }
 
-    const Trk::TrackSummary* summary = NULL;       
-    summary = m_trackSumTool->createSummary(*trackTRT);
+    std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(*trackTRT);
     int nhpix=0, nhsct=0, nhtrt=0;
 
-    if ( summary != NULL ){
+    if ( summary  ){
       nhpix = summary->get(Trk::numberOfPixelHits);
       nhsct = summary->get(Trk::numberOfSCTHits);
       nhtrt = summary->get(Trk::numberOfTRTHits);
-      delete summary;
     }
     
 
diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonTrackSegments.cxx b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonTrackSegments.cxx
index 25a6de7bcc24..7c4f54fc87e9 100644
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonTrackSegments.cxx
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonTrackSegments.cxx
@@ -681,8 +681,7 @@ StatusCode IDAlignMonTrackSegments::fillHistograms()
     }else
       if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Got the "<< nTracksUpper << " Upper Track" << endmsg;
 
-    const Trk::TrackSummary* summary = NULL;       
-    summary = m_trackSumTool->createSummary(*trackUpper);
+    std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(*trackUpper);
     unsigned int nHitsPixUp = 0;
     unsigned int nHitsSCTUp=0;
     unsigned int nHitsTRTUp=0;
@@ -690,7 +689,6 @@ StatusCode IDAlignMonTrackSegments::fillHistograms()
     nHitsSCTUp = summary->get(Trk::numberOfSCTHits);
     nHitsTRTUp = summary->get(Trk::numberOfTRTHits);
     unsigned int nHitsUp = nHitsPixUp + nHitsSCTUp + nHitsTRTUp;
-    delete summary;
 
     
     const Trk::Perigee* measUpperPer = trackUpper->perigeeParameters();
@@ -797,8 +795,7 @@ StatusCode IDAlignMonTrackSegments::fillHistograms()
 	continue;
       }
 
-      const Trk::TrackSummary* summary = NULL;       
-      summary = m_trackSumTool->createSummary(*trackLower);
+      std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(*trackLower);
       unsigned int nHitsPixLow = 0;
       unsigned int nHitsSCTLow = 0;
       unsigned int nHitsTRTLow = 0;
@@ -806,7 +803,6 @@ StatusCode IDAlignMonTrackSegments::fillHistograms()
       nHitsSCTLow = summary->get(Trk::numberOfSCTHits);
       nHitsTRTLow = summary->get(Trk::numberOfTRTHits);
       nHitsLow = nHitsPixLow + nHitsSCTLow + nHitsTRTLow;
-      delete summary;
 
       
       const Trk::Perigee* measLowerPer = trackLower->perigeeParameters();
diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/TrackSelectionAlg.cxx b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/TrackSelectionAlg.cxx
index 1f03f22ba693..8c30ca9ee67e 100644
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/TrackSelectionAlg.cxx
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/TrackSelectionAlg.cxx
@@ -164,8 +164,7 @@ bool TrackSelectionAlg::makeTrackCuts(const Trk::Track* track, float zVtx)
   if(z0zVtx > m_trackMaxVtxZ0) trackPassed = false;
   if(fabs(d0) > m_trackMaxD0) trackPassed = false;
 
-  const Trk::TrackSummary* summary = NULL;       
-  summary = m_trackSumTool->createSummary(*track);
+  std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(*track);
   
   int nhtrt = 0;
   int nhtrtHT = 0;
@@ -173,7 +172,7 @@ bool TrackSelectionAlg::makeTrackCuts(const Trk::Track* track, float zVtx)
   int nhsct = 0;
   int nhblay = 0;
 
-  if(summary==0){
+  if(!summary){
     if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not create TrackSummary  - Track will likely fail hits requirements" << endmsg;}  
   else{
 
@@ -191,8 +190,5 @@ bool TrackSelectionAlg::makeTrackCuts(const Trk::Track* track, float zVtx)
   if(nhtrt < m_minTRTHits) trackPassed = false;
   if(nhtrtHT < m_minTRTHitsHT) trackPassed = false;
 
-    
-  delete summary;
-  
   return trackPassed;
 }
-- 
GitLab


From d00ad5e994861af55a2cb4348d1fa23689502508 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 17:54:42 +0200
Subject: [PATCH 156/217] InDetGlobalMonitoringRun3Test: createSummary ->
 summary

Use ITrackSummaryTool::summary instead of createSummary to resolve
thread-safety issues.
---
 .../src/InDetGlobalTrackMonAlg.cxx                              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalTrackMonAlg.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalTrackMonAlg.cxx
index ba8303f256a8..31b21a47d960 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalTrackMonAlg.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/src/InDetGlobalTrackMonAlg.cxx
@@ -162,7 +162,7 @@ StatusCode InDetGlobalTrackMonAlg::fillHistograms( const EventContext& ctx ) con
       continue;
     
     // Create a new summary or get copy of the cached one
-    std::unique_ptr<const Trk::TrackSummary> summary(m_trkSummaryTool->createSummary( * track ) );
+    std::unique_ptr<const Trk::TrackSummary> summary(m_trkSummaryTool->summary( * track ) );
     
     if ( !summary )
       {
-- 
GitLab


From 84b92f87c6eab7fe860a87ef5e10e5d24362c80b Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 17:55:21 +0200
Subject: [PATCH 157/217] InDetAlignGenTools: createSummary -> summary

Use ITrackSummaryTool::summary instead of createSummary to resolve
thread-safety issues.
---
 .../InDetAlignGenTools/src/InDetAlignFillTrack.cxx     |  8 +++-----
 .../InDetAlignGenTools/src/InDetAlignTrackSelTool.cxx  | 10 ++++------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx
index 9148ea93b01f..f2946b9a5bff 100644
--- a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx
+++ b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
  */
 
 //////////////////////////////////////////////////////////////////////////
@@ -877,8 +877,8 @@ void InDetAlignFillTrack::dumpTrack(int itrk, const Trk::Track* trk,
     int nshared = 0, nshpix = 0, nshsct = 0;
     int nholes = 0, nhpix = 0, nhsct = 0;
 
-    const Trk::TrackSummary* summary = m_trackSumTool->createSummary((*trk));
-    if (summary == 0) ATH_MSG_ERROR("Could not create TrackSummary");
+    std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary((*trk));
+    if (!summary) ATH_MSG_ERROR("Could not create TrackSummary");
 
     else {
       // hits
@@ -939,8 +939,6 @@ void InDetAlignFillTrack::dumpTrack(int itrk, const Trk::Track* trk,
       }
     }
 
-    delete summary;
-
     // get fit quality and chi2 probability of track
     // chi2Prob = TMath::Prob(chi2,DoF) ROOT function
     double chi2Prob = 0.;
diff --git a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignTrackSelTool.cxx b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignTrackSelTool.cxx
index aa62250dbbb2..4ab3502d887f 100755
--- a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignTrackSelTool.cxx
+++ b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignTrackSelTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // InDetAlignTrackSelTool.h
@@ -126,8 +126,8 @@ int InDetAlignTrackSelTool::nShared(const Trk::Track& track) const {
   ATH_MSG_DEBUG( "in nShared()" ) ;
   int nshared=0, nshpix, nshsct;
 
-  const Trk::TrackSummary* summary = m_trackSumTool->createSummary(track);
-  if(summary==0){
+  std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(track);
+  if(!summary){
     ATH_MSG_ERROR( "Could not create TrackSummary" ) ;
     nshared = 1000;
   }
@@ -143,7 +143,6 @@ int InDetAlignTrackSelTool::nShared(const Trk::Track& track) const {
 
     nshared = nshpix + nshsct;
   }
-  delete summary;
   return nshared;
 }
 
@@ -153,7 +152,7 @@ int InDetAlignTrackSelTool::nHoles(const Trk::Track& track) const {
   ATH_MSG_DEBUG( "in nHoles() " ) ;
   int nholes=0, nhpix, nhsct;
 
-  const Trk::TrackSummary* summary = m_trackSumTool->createSummary(track);
+  std::unique_ptr<Trk::TrackSummary> summary = m_trackSumTool->summary(track);
   if(summary==0){
     ATH_MSG_ERROR( "Could not create TrackSummary" ) ;
     nholes = 1000;
@@ -173,7 +172,6 @@ int InDetAlignTrackSelTool::nHoles(const Trk::Track& track) const {
 
     nholes =  nhpix + nhsct;
   }
-  delete summary;
   return nholes;
 }
 
-- 
GitLab


From d52e59343c7de9c258ffbb3ca0644e5573e47723 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 8 Jul 2020 20:02:33 +0200
Subject: [PATCH 158/217] PixelCoralClientUtils: Thread-safety fixes.

The static member m_markSpecialRegions is nowhere used.
Remove it.

Add some missing const qualifiers.

Remove some now unneeded NOT_THREAD_SAFE qualifiers.
---
 .../PixelCoralClientUtils/SpecialPixelMap.hh      | 13 +++++--------
 .../PixelCoralClientUtils/src/SpecialPixelMap.cc  | 15 +--------------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
index 31ef77c10a00..4f3dfc396ebf 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/PixelCoralClientUtils/SpecialPixelMap.hh
@@ -33,9 +33,9 @@ namespace PixelCoralClientUtils {
   //static unsigned int columnsPerFEI4 = 80;   // number of columns per FEI4
   //static unsigned int rowsPerFEI4    = 336;   // number of rows per FEI4
   const unsigned int nmtype(5);
-  static unsigned int columnsPerFEIX[5]={18,80,132,80,132}; // number of columns per FEI3, 4, 50, 51, 52 
-  static unsigned int rowsPerFEIX[5]={164, 336, 672, 339, 678}; // number of rows per FEI3, 4, 50, 51, 52
-  static unsigned int rowsRdoPerFEIX[5]={160, 336, 672, 336, 672}; // number of rows readout per FEI3, 4, 50, 51, 52
+  static const unsigned int columnsPerFEIX[5]={18,80,132,80,132}; // number of columns per FEI3, 4, 50, 51, 52 
+  static const unsigned int rowsPerFEIX[5]={164, 336, 672, 339, 678}; // number of rows per FEI3, 4, 50, 51, 52
+  static const unsigned int rowsRdoPerFEIX[5]={160, 336, 672, 336, 672}; // number of rows readout per FEI3, 4, 50, 51, 52
 
 class ModuleSpecialPixelMap;
 
@@ -46,7 +46,7 @@ class ModuleSpecialPixelMap;
     its IdentifierHash.
 */
 
-class ATLAS_NOT_THREAD_SAFE DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{ // Thread unsafe ModuleSpecialPixelMap class is used.
+class DetectorSpecialPixelMap : public std::vector<ModuleSpecialPixelMap*>{
    
  public: 
    DetectorSpecialPixelMap();
@@ -100,7 +100,7 @@ class ATLAS_NOT_THREAD_SAFE DetectorSpecialPixelMap : public std::vector<ModuleS
 
 **/
 
-class ATLAS_NOT_THREAD_SAFE ModuleSpecialPixelMap : private std::map<unsigned int, unsigned int>{ // static member variable is used.
+class ModuleSpecialPixelMap : private std::map<unsigned int, unsigned int>{
 
  public:
    friend class ::ModuleSpecialPixelMap;
@@ -196,9 +196,6 @@ class ATLAS_NOT_THREAD_SAFE ModuleSpecialPixelMap : private std::map<unsigned in
    void setNeighbourFlags();
    //!< fill the information about special neighbouring pixels, bits 25 - 28
 
-   static bool m_markSpecialRegions;
-   //!< switch for automatic identification of special regions
-
    typedef std::map<unsigned int, unsigned int>::iterator iterator;
    //!< std::map iterators are forwarded for access to all special pixels on a module
    //!< These iterate *only* over the special pixels that are *not* in a special region, one has to check special regions independently
diff --git a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc
index 5803c26902ac..212c6ecdcca3 100644
--- a/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc
+++ b/InnerDetector/InDetConditions/PixelCoralClientUtils/src/SpecialPixelMap.cc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //****************************************************************************
@@ -177,9 +177,6 @@ ModuleSpecialPixelMap::ModuleSpecialPixelMap(const char* filename, unsigned int
     }
   }
 
-  if(m_markSpecialRegions){
-    markSpecialRegions();
-  }
   setNeighbourFlags();
 }
 
@@ -192,9 +189,6 @@ ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::string& clob, unsigned i
     std::cout << "In ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::string&) :" 
 	<< " Construction from clob failed" << std::endl;
   }
-  if(m_markSpecialRegions){
-    markSpecialRegions();
-  }
 }
 
 
@@ -207,9 +201,6 @@ ModuleSpecialPixelMap::ModuleSpecialPixelMap(const coral::Blob& blob, unsigned i
     std::cout << "In ModuleSpecialPixelMap::ModuleSpecialPixelMap(const coral::Blob&) :" 
 	<< " Construction from blob failed" << std::endl;
   }
-  if(m_markSpecialRegions){
-    markSpecialRegions();
-  }
 }
 
 ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::map<unsigned int, unsigned int>& pixels, 
@@ -223,9 +214,6 @@ ModuleSpecialPixelMap::ModuleSpecialPixelMap(const std::map<unsigned int, unsign
   m_chip_status(chip_status),
   m_column_pair_status(column_pair_status)
 {
-  if(m_markSpecialRegions){
-    markSpecialRegions();
-  }
 }
 
 ModuleSpecialPixelMap::~ModuleSpecialPixelMap(){}
@@ -1678,7 +1666,6 @@ void ModuleSpecialPixelMap::setNeighbourFlags(){
   }
 }
 
-bool ModuleSpecialPixelMap::m_markSpecialRegions = false;
 
 ModuleSpecialPixelMap::size_type ModuleSpecialPixelMap::size() const{
   return std::map<unsigned int, unsigned int>::size();
-- 
GitLab


From 2831508a96aef403b288e8ed582dece0ebb7a1a6 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 18:58:26 +0200
Subject: [PATCH 159/217] TrigFastTrackFinder: Cleanup CMake, enable flake8

---
 .../TrigFastTrackFinder/CMakeLists.txt        | 45 ++-----------------
 .../python/TrigFastTrackFinder_Config.py      |  2 +-
 2 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigFastTrackFinder/CMakeLists.txt
index 092618f1f8ec..eb8283551736 100644
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/CMakeLists.txt
@@ -1,52 +1,13 @@
-################################################################################
-# Package: TrigFastTrackFinder
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigFastTrackFinder )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkEventPrimitives
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigInDetPattRecoTools
-
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Control/CxxUtils
-                          Control/StoreGate
-			  Control/AthenaMonitoringKernel
-                          DetectorDescription/IRegionSelector
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
-                          InnerDetector/InDetRecEvent/SiSpacePointsSeed
-                          InnerDetector/InDetRecEvent/SiSPSeededTrackFinderData
-                          InnerDetector/InDetRecTools/InDetRecToolInterfaces
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkRIO_OnTrack
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          Tracking/TrkTools/TrkToolInterfaces
-                          Tracking/TrkEvent/TrkEventUtils
-                          Trigger/TrigEvent/TrigInDetPattRecoEvent
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs )
-
-# External dependencies:
-find_package( TBB )
-
 # Component(s) in the package:
 atlas_add_component( TrigFastTrackFinder
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${TBB_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TBB_LIBRARIES} GaudiKernel TrkEventPrimitives TrigInDetEvent TrigSteeringEvent TrigInterfacesLib TrigInDetPattRecoTools AthenaBaseComps IRegionSelector InDetIdentifier InDetPrepRawData InDetRIO_OnTrack SiSpacePointsSeed SiSPSeededTrackFinderData InDetRecToolInterfaces TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkToolInterfaces TrigInDetPattRecoEvent TrigTimeAlgsLib TrkEventUtils AthenaMonitoringKernelLib)
+                     LINK_LIBRARIES AthenaBaseComps AthenaMonitoringKernelLib BeamSpotConditionsData CxxUtils GaudiKernel InDetIdentifier InDetPrepRawData InDetRIO_OnTrack InDetRecToolInterfaces SiSPSeededTrackFinderData SiSpacePointsSeed TrigInDetEvent TrigInDetPattRecoEvent TrigInDetPattRecoTools TrigInDetToolInterfacesLib TrigInterfacesLib TrigNavigationLib TrigSteeringEvent TrigTimeAlgsLib TrkEventPrimitives TrkEventUtils TrkParameters TrkRIO_OnTrack TrkToolInterfaces TrkTrack TrkTrackSummary )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index 347af0cea78a..d58a6beba186 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
@@ -171,7 +171,7 @@ class TrigFastTrackFinderBase(TrigFastTrackFinder):
         assert(remapped_type is not None)
 
         #Global keys/names for collections 
-        from TrigInDetConfig.InDetTrigCollectionKeys import TrigTRTKeys, TrigPixelKeys, TrigSCTKeys
+        from TrigInDetConfig.InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys
 
 
         self.useNewLayerNumberScheme = True
-- 
GitLab


From 648b466ae8042fa402232762be4cb5665f7f1523 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 19:03:44 +0200
Subject: [PATCH 160/217] TrigT2BeamSpot: CMake cleanup

---
 .../TrigT2BeamSpot/CMakeLists.txt             | 29 +++----------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2BeamSpot/CMakeLists.txt
index 4fd6a08a0b93..082eba673cd8 100644
--- a/Trigger/TrigAlgorithms/TrigT2BeamSpot/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/CMakeLists.txt
@@ -1,40 +1,19 @@
-################################################################################
-# Package: TrigT2BeamSpot
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigT2BeamSpot )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          PRIVATE
-                          Control/AthContainers
-                          Event/EventInfo
-                          Event/EventPrimitives
-                          GaudiKernel
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkEvent/TrkTrackSummary
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigNavigation
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( ROOT COMPONENTS MathCore )
 
 # Component(s) in the package:
 atlas_add_component( TrigT2BeamSpot
                      src/*.cxx
                      src/components/TrigT2*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringKernelLib TrigSteeringEvent TrigInterfacesLib AthContainers EventInfo EventPrimitives GaudiKernel TrkParameters TrkTrack TrkTrackSummary TrigInDetEvent TrigNavigationLib TrigTimeAlgsLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaBaseComps AthenaMonitoringKernelLib BeamSpotConditionsData EventPrimitives GaudiKernel StoreGateLib TrigInDetEvent TrigInDetToolInterfacesLib TrigInterfacesLib TrigNavigationLib TrigSteeringEvent TrigTimeAlgsLib TrkParameters TrkTrack TrkTrackSummary xAODEventInfo )
 
 # Install files from the package:
-atlas_install_headers( TrigT2BeamSpot )
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 
-- 
GitLab


From 5ec6b4cf08d09d5a39f68c4ecb4493fea68810b5 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 8 Jul 2020 19:08:12 +0200
Subject: [PATCH 161/217] TrigTauRec: CMake and package cleanup

- update link dependencies
- move flake8 to build stage
- delete obsolete job options
---
 .../TrigAlgorithms/TrigTauRec/CMakeLists.txt  | 35 +-------
 .../TrigTauRec/python/TrigTauRecConfig.py     |  7 +-
 .../share/TriggerConfig_TrigTauRec.py         | 35 --------
 .../share/jobOfragment_TrigTauRec.py          | 85 -------------------
 .../share/jobOfragment_TrigTauRec_noID.py     | 60 -------------
 5 files changed, 6 insertions(+), 216 deletions(-)
 delete mode 100755 Trigger/TrigAlgorithms/TrigTauRec/share/TriggerConfig_TrigTauRec.py
 delete mode 100755 Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec.py
 delete mode 100755 Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec_noID.py

diff --git a/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
index 342c04c011f9..7e7c4c1cf145 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigTauRec/CMakeLists.txt
@@ -1,41 +1,12 @@
-################################################################################
-# Package: TrigTauRec
-################################################################################
+#Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTauRec )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          GaudiKernel
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          LumiBlock/LumiBlockComps
-                          Reconstruction/tauRecTools
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Calorimeter/CaloEvent
-                          Event/EventKernel
-                          Event/NavFourMom
-                          Event/xAOD/xAODJet
-                          Event/xAOD/xAODTau
-                          Event/xAOD/xAODTracking
-                          Reconstruction/Particle
-                          Tracking/TrkEvent/VxVertex
-                          Trigger/TrigT1/TrigT1Interfaces 
-                          Control/AthAnalysisBaseComps)
-
 # Component(s) in the package:
 atlas_add_component( TrigTauRec
                      src/*.cxx src/components/*.cxx
-                     LINK_LIBRARIES GaudiKernel LumiBlockCompsLib tauRecToolsLib TrigParticle TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib CaloEvent EventKernel NavFourMom xAODJet xAODTau xAODTracking Particle VxVertex TrigT1Interfaces AthAnalysisBaseCompsLib)
+                     LINK_LIBRARIES AthAnalysisBaseCompsLib AthenaBaseComps AthenaMonitoringKernelLib BeamSpotConditionsData CaloEvent EventKernel GaudiKernel LumiBlockCompsLib NavFourMom Particle StoreGateLib TrigInterfacesLib TrigParticle TrigSteeringEvent TrigT1Interfaces TrigTimeAlgsLib VxVertex tauRecToolsLib xAODJet xAODTau xAODTracking )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
-# Check python syntax:
-atlas_add_test( flake8
-                SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python
-                POST_EXEC_SCRIPT nopost.sh )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
index 5e167771c31c..8585bf1ba90a 100644
--- a/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigTauRec/python/TrigTauRecConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 
 """ TrigTauRec """
@@ -47,17 +47,16 @@ class TrigTauRecMerged_Tau (TrigTauRecMerged) :
             tools.append(taualgs.getTauCommonCalcVars())
             tools.append(taualgs.getTauSubstructure())
             #tools.append(taualgs.getEnergyCalibrationLC(correctEnergy=False, correctAxis=True, postfix='_onlyAxis'))
-	    
             for tool in tools:
                 tool.inTrigger = True
                 tool.calibFolder = 'TrigTauRec/00-11-02/'
-	    
+
             self.Tools = tools
 
             ## add beam type flag
             from AthenaCommon.BeamFlags import jobproperties
             self.BeamType = jobproperties.Beam.beamType()
-		    
+
 
 class TrigTauRecMerged_Tau2012 (TrigTauRecMerged) :
         __slots__ = [ '_mytools']
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/share/TriggerConfig_TrigTauRec.py b/Trigger/TrigAlgorithms/TrigTauRec/share/TriggerConfig_TrigTauRec.py
deleted file mode 100755
index 07f42c1b38a1..000000000000
--- a/Trigger/TrigAlgorithms/TrigTauRec/share/TriggerConfig_TrigTauRec.py
+++ /dev/null
@@ -1,35 +0,0 @@
-include.block("TrigTauRec/TriggerConfig_TrigTauRec.py")
-#
-# Configure a suitable TrigTauRec Algorithm instance
-#
-# Constructor arguments:
-# level, type, threshold, isIsolated
-#
-# e.g. level=L2, type=muon, threshold=30, isIsolated=None
-#      level=EF, type=egamma, threshold=20, isIsolated=isolated
-#
-# Methods:
-# instanceName() : returns name of algorithm instance
-# classAndInstanceName() : returns a string to be entered in the sequence file. This string
-#              defines the class and instance name
-#
-
-
-class TriggerConfig_TrigTauRec:
-    def __init__(self, type = None, threshold = None, isIsolated = None):
-
-        # currently only one option defined
-        
-        self.__instname__ = "TrigTauRec_h5_EF"
-        self.__sequence__ = "TrigTauRec/TrigTauRec/h5"
-        
-    def instanceName(self):
-        return self.__instname__
-        
-    def classAndInstanceName(self):
-        return [ self.__sequence__ ]
-        
-if TriggerFlags.TauSlice.doEFID() and TriggerFlags.TauSlice.doEFCalo():
-    include("TrigTauRec/jobOfragment_TrigTauRec.py")
-elif TriggerFlags.TauSlice.doEFCalo():
-    include("TrigTauRec/jobOfragment_TrigTauRec_noID.py")
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec.py b/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec.py
deleted file mode 100755
index c07fadcd88b5..000000000000
--- a/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# jobOptions file for tau Reconstruction
-
-theApp.Dlls += [ "tauRec", "TrigTauRec" ]
-theApp.Dlls += [ "CaloUtils"]
-
-
-#--------------------------------------------------------------
-# Algorithms Private Options
-#--------------------------------------------------------------
-#tower Maker sub-algorithms:
-TrigTauRec_h5_EF = Algorithm( "TrigTauRec_h5_EF" )
-
-TrigTauRec_h5_EF.toolNames = [
-    "tauSeedBuilder/TrigTauSeeds",
-    "tauTrack/TrigTauTracks",
-    "tauCellBuilder/TrigTauCells",		
-    "tauCalibrateWeightTool/TrigTauCalibrate",
-    ]
-
-
-				
-# For data with noise, threshold on cells
-TrigTauRec_h5_EF.TrigTauSeeds.seedContainerName      = "RoIEMCalo"
-TrigTauRec_h5_EF.TrigTauSeeds.UseCaloNoiseTool       = FALSE
-TrigTauRec_h5_EF.TrigTauSeeds.UsePileUpNoise         = FALSE
-TrigTauRec_h5_EF.TrigTauSeeds.useCaloCellList        = 1
-
-# which tracks to use
-TrigTauRec_h5_EF.TrigTauTracks.TrackContainer        = "TrigTauTrackCandidate"
-TrigTauRec_h5_EF.TrigTauTracks.VxPrimaryCandidate    = "TrigTauVtxPrimaryCandidate"
-TrigTauRec_h5_EF.TrigTauTracks.TrackPTmin            = 2000.0
-TrigTauRec_h5_EF.TrigTauTracks.TrackDist             = 0.3
-
-# parameters required by tauCellBuilder tool:
-TrigTauRec_h5_EF.TrigTauCells.CellEthreshold         = 200.0
-TrigTauRec_h5_EF.TrigTauCells.StripEthreshold        = 200.0
-TrigTauRec_h5_EF.TrigTauCells.EMSumThreshold         = 500.0
-TrigTauRec_h5_EF.TrigTauCells.EMSumRadius            = 0.2
-
-#
-# select G4-jet weights
-TrigTauRec_h5_EF.TrigTauCalibrate.CellWeightTool="H1WeightToolCSC12"
-TrigTauRec_h5_EF.TrigTauCalibrate.pTNumberOfBins = 3
-TrigTauRec_h5_EF.TrigTauCalibrate.etaNumberOfBins = 3
-TrigTauRec_h5_EF.TrigTauCalibrate.pTPoints = [ 15000, 35000, 150000 ]
-TrigTauRec_h5_EF.TrigTauCalibrate.etaPoints = [  0.25, 1.0, 2.0 ]
-TrigTauRec_h5_EF.TrigTauCalibrate.pTetaCorrectionsNtr1= [
-    ## made with histo pT(tauMC)/pT(tauRec) vs pT vs eta, llh>2, ntr==1
-    ##eta=0.0..0.5  0.5..1.5  1.5..2.5
-    0.8339,   0.8125,   0.8254,   ## pt=-5 .. 30
-    0.8747,   0.8583,   0.8594,   ## pt=30 .. 40
-    0.9088,   0.9013,   0.8922    ## pt=40 .. 1000
-    ]
-TrigTauRec_h5_EF.TrigTauCalibrate.pTetaCorrectionsNtr23= [
-    ## made with histo pT(tauMC)/pT(tauRec) vs pT vs eta, llh>2, ntr==2||3
-    ##eta=0.0..0.5  0.5..1.5  1.5..2.5
-    0.9000,   0.8593,   0.9034,   ## pt=-5 .. 30
-    0.9208,   0.8791,   0.9132,   ## pt=30 .. 40
-    0.9359,   0.9231,   0.9033    ## pt=40 .. 1000
-    ]
-TrigTauRec_h5_EF.TrigTauCalibrate.FudgeFactor        = 1.011
-
-# Cut values in TrigTauCuts to select tau's
-#TrigTauRec_h5_EF.TrigTauCuts.NumTrackMin             = 1        # Min. number tracks
-#TrigTauRec_h5_EF.TrigTauCuts.NumTrackMax             = 3        # Max. number tracks
-#TrigTauRec_h5_EF.TrigTauCuts.EMRadiusMax             = 0.15     # Max. EM radius
-#TrigTauRec_h5_EF.TrigTauCuts.IsolationFracMax        = 0.3      # Max. isolation fraction
-#TrigTauRec_h5_EF.TrigTauCuts.EMFractionMin           = 0.6      # Min. fraction of Et in the EM layers
-#TrigTauRec_h5_EF.TrigTauCuts.PtMaxTrackMin           = 10000.0  # Min. Pt of the hardest track
-
-
-TrigTauRec_h5_EF.TrigTauTracks.tauRecTTCExtrapolator.Extrapolator='Trk::Extrapolator/InDetExtrapolator'
-TrigTauRec_h5_EF.TrigTauTracks.tauRecTTCExtrapolator.CaloDepthTool.DepthChoice = "entrance"
-
-from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter
-TauRecFitterTool = Trk__FastVertexFitter(
-    Extrapolator = "Trk::Extrapolator/InDetExtrapolator"
-    )
-
-ToolSvc += TauRecFitterTool
-print TauRecFitterTool
-
-
-
-
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec_noID.py b/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec_noID.py
deleted file mode 100755
index 8faa9bf41163..000000000000
--- a/Trigger/TrigAlgorithms/TrigTauRec/share/jobOfragment_TrigTauRec_noID.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# jobOptions file for tau Reconstruction
-
-theApp.Dlls += [ "tauRec", "TrigTauRec" ]
-theApp.Dlls += [ "CaloUtils"]
-
-
-#--------------------------------------------------------------
-# Algorithms Private Options
-#--------------------------------------------------------------
-#tower Maker sub-algorithms:
-TrigTauRec_h5_EF = Algorithm( "TrigTauRec_h5_EF" )
-
-TrigTauRec_h5_EF.toolNames = [
-    "tauSeedBuilder/TrigTauSeeds",
-    "tauCellBuilder/TrigTauCells",
-    "tauCalibrateWeightTool/TrigTauCalibrate",
-    ]
-TrigTauRec_h5_EF.toolContainers = [
-    "TrigTauRec_h5_EF.TrigTauSeeds seedContainerName",
-    ]
-
-				
-# For data with noise, threshold on cells
-TrigTauRec_h5_EF.TrigTauSeeds.seedContainerName      = "RoIEMCalo"
-TrigTauRec_h5_EF.TrigTauSeeds.UseCaloNoiseTool       = FALSE
-TrigTauRec_h5_EF.TrigTauSeeds.UsePileUpNoise         = FALSE
-TrigTauRec_h5_EF.TrigTauSeeds.useCaloCellList        = 1
-
-# parameters required by tauCellBuilder tool:
-TrigTauRec_h5_EF.TrigTauCells.CellEthreshold         = 200.0
-TrigTauRec_h5_EF.TrigTauCells.StripEthreshold        = 200.0
-TrigTauRec_h5_EF.TrigTauCells.EMSumThreshold         = 500.0
-TrigTauRec_h5_EF.TrigTauCells.EMSumRadius            = 0.2
-
-# select G4-jet weights
-TrigTauRec_h5_EF.TrigTauCalibrate.CellWeightTool="H1WeightToolCSC12"
-TrigTauRec_h5_EF.TrigTauCalibrate.pTNumberOfBins = 3
-TrigTauRec_h5_EF.TrigTauCalibrate.etaNumberOfBins = 3
-TrigTauRec_h5_EF.TrigTauCalibrate.pTPoints = [ 15000, 35000, 150000 ]
-TrigTauRec_h5_EF.TrigTauCalibrate.etaPoints = [  0.25, 1.0, 2.0 ]
-TrigTauRec_h5_EF.TrigTauCalibrate.pTetaCorrectionsNtr1= [
-    ## made with histo pT(tauMC)/pT(tauRec) vs pT vs eta, llh>2, ntr==1
-    ##eta=0.0..0.5  0.5..1.5  1.5..2.5
-    0.8339,   0.8125,   0.8254,   ## pt=-5 .. 30
-    0.8747,   0.8583,   0.8594,   ## pt=30 .. 40
-    0.9088,   0.9013,   0.8922    ## pt=40 .. 1000
-    ]
-TrigTauRec_h5_EF.TrigTauCalibrate.pTetaCorrectionsNtr23= [
-    ## made with histo pT(tauMC)/pT(tauRec) vs pT vs eta, llh>2, ntr==2||3
-    ##eta=0.0..0.5  0.5..1.5  1.5..2.5
-    0.9000,   0.8593,   0.9034,   ## pt=-5 .. 30
-    0.9208,   0.8791,   0.9132,   ## pt=30 .. 40
-    0.9359,   0.9231,   0.9033    ## pt=40 .. 1000
-    ]
-TrigTauRec_h5_EF.TrigTauCalibrate.FudgeFactor        = 1.011
-
-
-
-
-
-- 
GitLab


From 6e6e2769fdd1b7713b4f514b15c9466edca6739a Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 09:56:37 +0200
Subject: [PATCH 162/217] TrigL2MissingET: Package cleanup

- remove unused CLHEP dependency
- enable flake8
- cleanup cmake configuration
---
 .../TrigL2MissingET/CMakeLists.txt            | 31 +++----------------
 .../python/TrigL2MissingETMonitoring.py       |  7 +++--
 .../TrigL2MissingET/src/T2MissingET.cxx       |  3 +-
 3 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigL2MissingET/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigL2MissingET/CMakeLists.txt
index 91ba6d7c2e05..e274321db3c3 100644
--- a/Trigger/TrigAlgorithms/TrigL2MissingET/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigL2MissingET/CMakeLists.txt
@@ -1,39 +1,16 @@
-################################################################################
-# Package: TrigL2MissingET
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigL2MissingET )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Calorimeter/CaloIdentifier
-                          DetectorDescription/IRegionSelector
-                          Event/xAOD/xAODTrigMissingET
-                          GaudiKernel
-                          LArCalorimeter/LArIdentifier
-                          LArCalorimeter/LArRecEvent
-                          LArCalorimeter/LArCabling
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Control/CxxUtils
-                          Event/xAOD/xAODEventInfo
-                          Trigger/TrigAlgorithms/TrigT2CaloCommon
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigMissingEtEvent
-                          Trigger/TrigEvent/TrigNavigation
-                          Trigger/TrigT1/TrigT1Interfaces )
-
 # External dependencies:
-find_package( CLHEP )
 find_package( tdaq-common )
 
 # Component(s) in the package:
 atlas_add_component( TrigL2MissingET
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier IRegionSelector xAODTrigMissingET GaudiKernel LArIdentifier LArRecEvent LArCablingLib TrigSteeringEvent TrigInterfacesLib CxxUtils xAODEventInfo TrigT2CaloCommonLib TrigCaloEvent TrigMissingEtEvent TrigNavigationLib TrigT1Interfaces )
+                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloIdentifier CxxUtils GaudiKernel IRegionSelector LArCablingLib LArIdentifier LArRecConditions LArRecEvent StoreGateLib TrigInterfacesLib TrigMissingEtEvent TrigNavigationLib TrigSteeringEvent TrigT1Interfaces TrigT2CaloCommonLib TrigTimeAlgsLib xAODEventInfo xAODTrigMissingET )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigL2MissingET/python/TrigL2MissingETMonitoring.py b/Trigger/TrigAlgorithms/TrigL2MissingET/python/TrigL2MissingETMonitoring.py
index f68a012d5183..c29f0f65a56e 100755
--- a/Trigger/TrigAlgorithms/TrigL2MissingET/python/TrigL2MissingETMonitoring.py
+++ b/Trigger/TrigAlgorithms/TrigL2MissingET/python/TrigL2MissingETMonitoring.py
@@ -1,7 +1,8 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ################# Validation, DQ checks
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
+from builtins import range
 
 bitNames = [ "ErrParityL1",          # bit  0
              "ErrL1mult",            # bit  1
@@ -88,7 +89,7 @@ class T2CaloMissingETOnlineMonitoring(TrigGenericMonitoringToolConfig):
         label_lbc=''
         label_eba=''
         label_ebc=''
-        for i in xrange(64):
+        for i in range(64):
            if i==63 :
               label_la = '%(b)s%(n)02d' % {'b':'LBA', 'n':(i+1)}  
               label_lc = '%(b)s%(n)02d' % {'b':'LBC', 'n':(i+1)}  
@@ -121,7 +122,7 @@ class T2CaloMissingETValidationMonitoring(TrigGenericMonitoringToolConfig):
         label_lbc=''
         label_eba=''
         label_ebc=''
-        for i in xrange(64):
+        for i in range(64):
            if i==63 :
               label_la = '%(b)s%(n)02d' % {'b':'LBA', 'n':(i+1)}
               label_lc = '%(b)s%(n)02d' % {'b':'LBC', 'n':(i+1)}
diff --git a/Trigger/TrigAlgorithms/TrigL2MissingET/src/T2MissingET.cxx b/Trigger/TrigAlgorithms/TrigL2MissingET/src/T2MissingET.cxx
index a530a7cf1f47..9257d0daf122 100755
--- a/Trigger/TrigAlgorithms/TrigL2MissingET/src/T2MissingET.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MissingET/src/T2MissingET.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -15,7 +15,6 @@
 // ********************************************************************
 
 #include "T2MissingET.h"
-#include "CLHEP/Units/SystemOfUnits.h"
 #include "TrigT1Interfaces/RecEnergyRoI.h"
 #include "TrigSteeringEvent/Enums.h"
 #include "TrigMissingEtEvent/TrigMissingET.h"
-- 
GitLab


From 45fe08c6d457e412be281d5fa2119e1bc4e16c1f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:12:16 +0200
Subject: [PATCH 163/217] TrigMissingETMuon: Package cleanup

- enable flake8
- cmake cleanup
---
 .../TrigMissingETMuon/CMakeLists.txt          | 26 ++----------
 .../python/TrigMissingETMuonConfig.py         | 42 +------------------
 .../src/TrigMissingETMuon.cxx                 |  6 +--
 3 files changed, 8 insertions(+), 66 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigMissingETMuon/CMakeLists.txt
index 46abb9ca2a08..948fbc3cc95c 100644
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/CMakeLists.txt
@@ -1,34 +1,16 @@
-################################################################################
-# Package: TrigMissingETMuon
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMissingETMuon )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Event/xAOD/xAODTrigMissingET
-                          Trigger/TrigSteer/TrigInterfaces
-                          Control/CxxUtils
-                          Event/EventInfo
-                          Event/xAOD/xAODMuon
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigMissingEtEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigNavigation
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigT1/TrigT1Interfaces )
-
 # External dependencies:
-find_package( CLHEP )
 find_package( tdaq-common )
 
 # Component(s) in the package:
 atlas_add_component( TrigMissingETMuon
                      src/*.cxx src/components/*.cxx
-                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} xAODTrigMissingET TrigInterfacesLib CxxUtils EventInfo xAODMuon GaudiKernel TrigMissingEtEvent TrigMuonEvent TrigNavigationLib TrigSteeringEvent TrigT1Interfaces )
+                     INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CxxUtils EventInfo GaudiKernel TrigInterfacesLib TrigMissingEtEvent TrigNavigationLib TrigSteeringEvent TrigT1Interfaces xAODMuon xAODTrigMissingET )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/python/TrigMissingETMuonConfig.py b/Trigger/TrigAlgorithms/TrigMissingETMuon/python/TrigMissingETMuonConfig.py
index b88f30a9afbb..4eb55c3e653c 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/python/TrigMissingETMuonConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/python/TrigMissingETMuonConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigMissingETMuon.TrigMissingETMuonConf import TrigMissingETMuon
 
@@ -11,11 +11,6 @@ class L2TrigMissingETMuon_Fex ( TrigMissingETMuon ) :
 
         self.METLabel = "T2MissingET"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring() 
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -28,11 +23,6 @@ class L2CaloTrigMissingETMuon_Fex ( TrigMissingETMuon ) :
 
         self.METLabel = "L2MissingET_FEB"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring() 
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -46,11 +36,6 @@ class EFTrigMissingETMuon_Fex ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring() 
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -63,11 +48,6 @@ class EFTrigMissingETMuon_Fex_FEB ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET_FEB"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring() 
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -80,11 +60,6 @@ class EFTrigMissingETMuon_Fex_topocl ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET_topocl"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring() 
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -97,11 +72,6 @@ class EFTrigMissingETMuon_Fex_topoclPS ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET_topocl_PS"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring()
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -115,11 +85,6 @@ class EFTrigMissingETMuon_Fex_Jets ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET_Jets"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring()
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
@@ -132,11 +97,6 @@ class EFTrigMissingETMuon_Fex_topoclPUC ( TrigMissingETMuon ) :
 
         self.METLabel = "TrigEFMissingET_topocl_PUC"
         #self.MuonPtCut = 5.0
-        # monitoring part. To switch off do in topOption TriggerFlags.enableMonitoring = []
-        from TrigMissingETMuon.TrigMissingETMuonMonitoring import TrigMissingETMuonOnlineMonitoring, TrigMissingETMuonCosmicMonitoring, TrigMissingETMuonValidationMonitoring
-        validation = TrigMissingETMuonValidationMonitoring()
-        online     = TrigMissingETMuonOnlineMonitoring()
-        cosmic     = TrigMissingETMuonCosmicMonitoring()
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 944ac677b921..145b103191a5 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // ********************************************************************
@@ -22,7 +22,7 @@
 
 #include "xAODMuon/MuonContainer.h"
 
-#include "CLHEP/Units/SystemOfUnits.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "TrigT1Interfaces/RecEnergyRoI.h"
 #include "TrigSteeringEvent/Enums.h"
 #include "TrigMissingEtEvent/TrigMissingET.h"
@@ -215,7 +215,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
 
         // Minimum pt cut
         float Et = fabs(muon->pt());
-        if (Et/CLHEP::GeV < m_muonptcut) continue;
+        if (Et/Gaudi::Units::GeV < m_muonptcut) continue;
 
         // Reject muons without IDtracks
         const xAOD::TrackParticle* idtrk = muon->trackParticle( xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle );
-- 
GitLab


From 851ae44f7cfbabe86f2631d166d5a1a41b4adc3b Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:23:33 +0200
Subject: [PATCH 164/217] TrigTRTHighTHitCounter: Package cleanup

- use CxxUtils::deltaPhi
- remove ROOT dependency
- cleanup cmake configuration
---
 .../TrigTRTHighTHitCounter/CMakeLists.txt     | 28 ++-----------------
 .../src/TrigTRTHTHCounter.cxx                 | 23 +++++----------
 .../TrigTRTHighTHitCounter_entries.cxx        |  5 ++--
 3 files changed, 11 insertions(+), 45 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/CMakeLists.txt
index 986646457914..d6d65c95ff1c 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/CMakeLists.txt
@@ -1,34 +1,10 @@
-################################################################################
-# Package: TrigTRTHighTHitCounter
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTRTHighTHitCounter )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          GaudiKernel
-                          PRIVATE
-                          DetectorDescription/GeoPrimitives
-                          DetectorDescription/Identifier
-                          Event/xAOD/xAODTrigRinger
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigInDetToolInterfaces )
-
-# External dependencies:
-find_package( Eigen )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
-include_directories(src)
-
 # Component(s) in the package:
 atlas_add_component( TrigTRTHighTHitCounter
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GaudiKernel GeoPrimitives Identifier xAODTrigRinger InDetIdentifier InDetPrepRawData TrigCaloEvent TrigSteeringEvent TrigInterfacesLib EventContainers)
-
+                     LINK_LIBRARIES CxxUtils GaudiKernel GeoPrimitives Identifier InDetIdentifier InDetPrepRawData TrigCaloEvent TrigInterfacesLib TrigSteeringEvent xAODTrigRinger )
diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx
index 319e4a8aebd5..59ab633ca426 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx
@@ -1,31 +1,22 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigTRTHTHCounter.h"
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 
+#include "CxxUtils/phihelper.h"
 #include "InDetIdentifier/TRT_ID.h"
 #include "Identifier/IdentifierHash.h"
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h" 
 
 #include "TrigCaloEvent/TrigEMCluster.h"
 #include "xAODTrigRinger/TrigRNNOutput.h"
-#include "TMath.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 
 #include<cmath>
 #include<fstream>
 
-const double PI = TMath::Pi();
-const double TWOPI = 2.0*PI;
-
-//Function to return deltaPhi between -PI and PI
-double hth_delta_phi(const float& phi1, const float& phi2){
-  float PHI=fabs(phi1-phi2);
-  return (PHI<=PI)? PHI : TWOPI-PHI;
-}
-
 //Function to calculate distance for road algorithm
 float dist2COR(float R, float phi1, float phi2){
   float PHI=fabs(phi1-phi2);
@@ -138,7 +129,7 @@ HLT::ErrorCode TrigTRTHTHCounter::hltExecute(const HLT::TriggerElement* inputTE,
  
   //Sanity check of the ROI size
   double deltaEta=fabs(roi->etaPlus()-roi->etaMinus());
-  double deltaPhi=hth_delta_phi(roi->phiPlus(),roi->phiMinus());
+  double deltaPhi=CxxUtils::deltaPhi(roi->phiPlus(),roi->phiMinus());
   float phiTolerance = 0.001;
   float etaTolerance = 0.001;
 
@@ -200,12 +191,12 @@ HLT::ErrorCode TrigTRTHTHCounter::hltExecute(const HLT::TriggerElement* inputTE,
 
 	//First, define coarse wedges in phi, and count the TRT hits in these wedges
         int countbin=0;	
-        if(hth_delta_phi(hphi, roi->phi()) < 0.1){
+        if(CxxUtils::deltaPhi(hphi, static_cast<float>(roi->phi())) < 0.1){
 	  float startValue = roi->phi() - m_phiHalfWidth + coarseWedgeHalfWidth;
 	  float endValue = roi->phi() + m_phiHalfWidth;
 	  float increment = 2*coarseWedgeHalfWidth;
           for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){
-            if (hth_delta_phi(hphi,roibincenter)<=coarseWedgeHalfWidth) {
+            if (CxxUtils::deltaPhi(hphi,roibincenter)<=coarseWedgeHalfWidth) {
 	      if(hth) count_httrt_c.at(countbin) += 1.;
 	      count_tottrt_c.at(countbin) += 1.;
 	      break; //the hit has been assigned to one of the coarse wedges, so no need to continue the for loop							
@@ -245,12 +236,12 @@ HLT::ErrorCode TrigTRTHTHCounter::hltExecute(const HLT::TriggerElement* inputTE,
   //Now, define fine wedges in phi, centered around the best coarse wedge, and count the TRT hits in these fine wedges
   for(size_t v=0;v<hit.size();v++){
     int countbin=0;	
-    if(hth_delta_phi(hit[v].phi, center_pos_phi) < 0.01){
+    if(CxxUtils::deltaPhi(hit[v].phi, center_pos_phi) < 0.01){
       float startValue = center_pos_phi - 3*coarseWedgeHalfWidth + fineWedgeHalfWidth;
       float endValue = center_pos_phi + 3*coarseWedgeHalfWidth;
       float increment = 2*fineWedgeHalfWidth;
       for(float roibincenter = startValue; roibincenter < endValue; roibincenter += increment){	
-        if (hth_delta_phi(hit[v].phi,roibincenter)<=fineWedgeHalfWidth) {
+        if (CxxUtils::deltaPhi(hit[v].phi,roibincenter)<=fineWedgeHalfWidth) {
           if(hit[v].isHT) count_httrt.at(countbin) += 1.;
           count_tottrt.at(countbin) += 1.;
           break; //the hit has been assigned to one of the fine wedges, so no need to continue the for loop							
diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/components/TrigTRTHighTHitCounter_entries.cxx b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/components/TrigTRTHighTHitCounter_entries.cxx
index 78295f132f6b..4a169e81de37 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/components/TrigTRTHighTHitCounter_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/components/TrigTRTHighTHitCounter_entries.cxx
@@ -1,6 +1,5 @@
-#include "TrigTRTHTHCounter.h"
-#include "TrigTRTHTHhypo.h"
-
+#include "../TrigTRTHTHCounter.h"
+#include "../TrigTRTHTHhypo.h"
 
 DECLARE_COMPONENT( TrigTRTHTHCounter )
 DECLARE_COMPONENT( TrigTRTHTHhypo )
-- 
GitLab


From e04a50d6f0ae4e3a770a5bf5aea28c824976a4ec Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:27:20 +0200
Subject: [PATCH 165/217] TrigPartialEventBuilding: CMake cleanup, enable
 flake8

---
 .../TrigPartialEventBuilding/CMakeLists.txt   | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/CMakeLists.txt
index 5928d8088d20..ebdfbd90da31 100644
--- a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/CMakeLists.txt
@@ -1,30 +1,18 @@
-################################################################################
-# Package: TrigPartialEventBuilding
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name
 atlas_subdir( TrigPartialEventBuilding )
 
-# Declare the package's dependencies
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          PRIVATE
-                          Control/CxxUtils )
-
 # Component(s) in the package
 atlas_add_library( TrigPartialEventBuildingLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigPartialEventBuilding
-                   LINK_LIBRARIES DecisionHandlingLib TrigSteeringEvent TrigCompositeUtilsLib )
+                   PRIVATE_LINK_LIBRARIES CxxUtils IRegionSelector
+                   LINK_LIBRARIES AthenaBaseComps DecisionHandlingLib TrigCompositeUtilsLib TrigSteeringEvent )
 
 atlas_add_component( TrigPartialEventBuilding
                      src/components/*.cxx
                      LINK_LIBRARIES TrigPartialEventBuildingLib )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
-
-# Tests
-#atlas_add_test( )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
-- 
GitLab


From e4c7bef6ff8ff2ea6768fc54aa8dadb0e81f4c6f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:34:29 +0200
Subject: [PATCH 166/217] TrigTileMuId: CMake cleanup, enable flake8

---
 .../TrigTileMuId/CMakeLists.txt               | 32 ++-----------------
 .../python/TrigTileLookForMuAlgConfig.py      | 11 +++----
 .../python/TrigTileMuFexConfig.py             | 19 +++++------
 .../python/TrigTileRODMuAlgConfig.py          |  9 +++---
 4 files changed, 21 insertions(+), 50 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigTileMuId/CMakeLists.txt
index 3ee6fd14a239..b890b0e4eed2 100644
--- a/Trigger/TrigAlgorithms/TrigTileMuId/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigTileMuId/CMakeLists.txt
@@ -1,38 +1,12 @@
-################################################################################
-# Package: TrigTileMuId
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTileMuId )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          MagneticField/MagFieldInterfaces
-                          TileCalorimeter/TileEvent
-                          TileCalorimeter/TileSvc/TileByteStream
-                          Trigger/TrigAlgorithms/TrigT2CaloCommon
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Calorimeter/CaloIdentifier
-                          Control/AthenaKernel
-                          Control/AthenaMonitoring
-                          Control/CxxUtils
-                          DetectorDescription/RegionSelector
-                          Event/ByteStreamCnvSvcBase
-                          Event/ByteStreamData
-                          Generators/GeneratorObjects
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigT1/TrigT1Interfaces
-                          Trigger/TrigTools/TrigInDetToolInterfaces )
-
 # Component(s) in the package:
 atlas_add_component( TrigTileMuId
                      src/*.cxx src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel MagFieldInterfaces TileEvent TileByteStreamLib TrigT2CaloCommonLib TrigInDetEvent TrigMuonEvent TrigInterfacesLib TrigTimeAlgsLib CaloIdentifier AthenaKernel AthenaMonitoringLib RegionSelectorLib ByteStreamCnvSvcBaseLib ByteStreamData GeneratorObjects TrigSteeringEvent TrigT1Interfaces )
+                     LINK_LIBRARIES AthenaBaseComps AthenaKernel ByteStreamCnvSvcBaseLib ByteStreamData CaloIdentifier CxxUtils GaudiKernel GeneratorObjects MagFieldInterfaces RegionSelectorLib TileByteStreamLib TileEvent TrigInDetEvent TrigInDetToolInterfacesLib TrigInterfacesLib TrigMuonEvent TrigSteeringEvent TrigT1Interfaces TrigT2CaloCommonLib TrigTimeAlgsLib )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileLookForMuAlgConfig.py b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileLookForMuAlgConfig.py
index ace6a5264b60..db7f38cba623 100755
--- a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileLookForMuAlgConfig.py
+++ b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileLookForMuAlgConfig.py
@@ -1,13 +1,12 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-
+from TrigTileMuId import TrigTileMuIdConf
 from AthenaCommon.SystemOfUnits import MeV
 
-
-class TrigTileLookForMuAlg_L2(TrigTileLookForMuAlg):
+class TrigTileLookForMuAlg_L2(TrigTileMuIdConf.TrigTileLookForMuAlg):
     __slot__ = []
     def __init__(self, name='TrigTileLookForMuAlg_L2'):
-        TrigTileLookForMuAlg.__init__(self, name)
+        TrigTileMuIdConf.TrigTileLookForMuAlg.__init__(self, name)
 
         #self.ReadRoIsFromL1 = False
         self.ReadRoIsFromL1 = True
@@ -123,10 +122,10 @@ class TrigTileLookForMuAlg_L2(TrigTileLookForMuAlg):
         self.AthenaMonTools = [ time, cosmic, validation, online ] 
 
 
-class TrigTileLookForMuAlg_All(TrigTileLookForMuAlg):
+class TrigTileLookForMuAlg_All(TrigTileMuIdConf.TrigTileLookForMuAlg):
     __slot__ = []
     def __init__(self, name='TrigTileLookForMuAlg_All'):
-        TrigTileLookForMuAlg.__init__(self, name)
+        TrigTileMuIdConf.TrigTileLookForMuAlg.__init__(self, name)
 
         #self.ReadRoIsFromL1 = False
         self.ReadRoIsFromL1 = True
diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileMuFexConfig.py b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileMuFexConfig.py
index b6865f2149fd..a4bf841f2a42 100755
--- a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileMuFexConfig.py
+++ b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileMuFexConfig.py
@@ -1,12 +1,9 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
-#from TrigTileMuId.TrigTileMuIdConf import TrigTileMuFex
-from AthenaCommon.GlobalFlags import globalflags
-from AthenaCommon.AppMgr import ServiceMgr
-from TrigTileMuId.TrigTileMuIdMonitoring import *
+from TrigTileMuId import TrigTileMuIdMonitoring
+from TrigTileMuId import TrigTileMuIdConf
 
-
-class TrigTileMuFexConfig (TrigTileMuFex):
+class TrigTileMuFexConfig (TrigTileMuIdConf.TrigTileMuFex):
     __slot__ = []
 
     def __new__( cls, *args, **kwargs ):
@@ -21,7 +18,7 @@ class TrigTileMuFexConfig (TrigTileMuFex):
     def __init__(self, name, *args, **kwargs ):
         super( TrigTileMuFexConfig, self ).__init__( name )
 
-        TrigTileMuFex.__init__(self, name)
+        TrigTileMuIdConf.TrigTileMuFex.__init__(self, name)
 
         self.UseAthenaFieldService = True
 
@@ -41,14 +38,14 @@ class TrigTileMuFexConfig (TrigTileMuFex):
         self.DelPhi_Cut = 0.2
         self.DelEta_Cut = 0.1
         self.Pt_Cut = 2000.0
-                        # Unit(Pt) : MeV
+        # Unit(Pt) : MeV
 
         self.GetTruthMuon = False
         #self.GetTruthMuon = True 
 
-        validation = TrigTileMuFexValidationMonitoring()
-        online     = TrigTileMuFexOnlineMonitoring()
-        cosmic     = TrigTileMuFexCosmicMonitoring()
+        validation = TrigTileMuIdMonitoring.TrigTileMuFexValidationMonitoring()
+        online     = TrigTileMuIdMonitoring.TrigTileMuFexOnlineMonitoring()
+        cosmic     = TrigTileMuIdMonitoring.TrigTileMuFexCosmicMonitoring()
 
         from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
         time = TrigTimeHistToolConfig("Time")
diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileRODMuAlgConfig.py b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileRODMuAlgConfig.py
index 2dacb30c122d..6e0088523f75 100755
--- a/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileRODMuAlgConfig.py
+++ b/Trigger/TrigAlgorithms/TrigTileMuId/python/TrigTileRODMuAlgConfig.py
@@ -1,10 +1,11 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+from TrigTileMuId import TrigTileMuIdConf
 
-class TrigTileRODMuAlg_L2(TrigTileRODMuAlg):
+class TrigTileRODMuAlg_L2(TrigTileMuIdConf.TrigTileRODMuAlg):
     __slot__ = []
     def __init__(self, name='TrigTileRODMuAlg_L2'):
-        TrigTileRODMuAlg.__init__(self, name)
+        TrigTileMuIdConf.TrigTileRODMuAlg.__init__(self, name)
 
         self.ReadRoIsFromL1 = True
         #self.ReadRoIsFromL1 = False
@@ -44,10 +45,10 @@ class TrigTileRODMuAlg_L2(TrigTileRODMuAlg):
 
         self.AthenaMonTools = [ time, cosmic, validation, online ]
 
-class TrigTileRODMuAlg_All(TrigTileRODMuAlg):
+class TrigTileRODMuAlg_All(TrigTileMuIdConf.TrigTileRODMuAlg):
     __slot__ = []
     def __init__(self, name='TrigTileRODMuAlg_All'):
-        TrigTileRODMuAlg.__init__(self, name)
+        TrigTileMuIdConf.TrigTileRODMuAlg.__init__(self, name)
 
         self.ReadRoIsFromL1 = True
         #self.ReadRoIsFromL1 = False
-- 
GitLab


From a87c89311d2b171696254181eaff21ee9f9c69eb Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:44:16 +0200
Subject: [PATCH 167/217] TrigL2LongLivedParticles: Package cleanup

- remove ROOT and CLHEP dependency
- delete obsolete job options
- cleanup cmake configuration
- enable flake8
---
 .../TrigL2LongLivedParticles/CMakeLists.txt   | 38 ++-----------------
 .../python/TrigL2LongLivedParticlesConfig.py  |  5 +--
 .../share/MuClusterJobOption.py               | 14 -------
 .../share/jobOfragment_TrigMuCluster.py       | 13 -------
 .../src/MuonCluster.cxx                       |  4 +-
 .../src/MuonClusterIsolation.cxx              |  6 +--
 6 files changed, 7 insertions(+), 73 deletions(-)
 delete mode 100644 Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/MuClusterJobOption.py
 delete mode 100644 Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/jobOfragment_TrigMuCluster.py

diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/CMakeLists.txt
index cfb045f36ab7..467995895baa 100644
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/CMakeLists.txt
@@ -1,45 +1,13 @@
-################################################################################
-# Package: TrigL2LongLivedParticles
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigL2LongLivedParticles )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Event/xAOD/xAODTrigger
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigT1/TrigT1Interfaces
-                          Trigger/TrigTools/TrigTimeAlgs
-                          PRIVATE
-                          Calorimeter/CaloEvent
-                          Control/AthContainers
-                          Control/CxxUtils
-                          Event/FourMomUtils
-                          Event/xAOD/xAODJet
-                          Event/xAOD/xAODTracking
-                          GaudiKernel
-                          Reconstruction/Jet/JetEvent
-                          Tools/PathResolver
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigNavigation
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent )
-
-# External dependencies:
-find_package( CLHEP )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
-
 # Component(s) in the package:
 atlas_add_component( TrigL2LongLivedParticles
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} xAODTrigger TrigMuonEvent TrigInterfacesLib TrigT1Interfaces TrigTimeAlgsLib CaloEvent AthContainers CxxUtils FourMomUtils xAODJet xAODTracking GaudiKernel JetEvent PathResolver TrigCaloEvent TrigNavigationLib TrigParticle TrigSteeringEvent )
+                     LINK_LIBRARIES AthContainers CaloEvent CxxUtils FourMomUtils GaudiKernel JetEvent PathResolver TrigInterfacesLib TrigNavigationLib TrigParticle TrigSteeringEvent TrigT1Interfaces TrigTimeAlgsLib xAODJet xAODTracking xAODTrigger )
 
 # Install files from the package:
-atlas_install_headers( TrigL2LongLivedParticles )
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py
index 46f59b7efee1..af66f7f55363 100755
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py
+++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import MuonCluster
 from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import MuonClusterIsolation
@@ -6,9 +6,6 @@ from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigMuonJetFex
 from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigJetSplitter
 from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigBHremoval
 
-from AthenaCommon.GlobalFlags import globalflags
-from AthenaCommon.AppMgr import ServiceMgr
-
 
 def getJetSplitterInstance( instance, logratio, pufixlogratio ):
 
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/MuClusterJobOption.py b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/MuClusterJobOption.py
deleted file mode 100644
index e7eb759de9bb..000000000000
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/MuClusterJobOption.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#----------------------------------------------------
-#  MuCluster options
-#----------------------------------------------------
-# Timing service libs.
-theApp.Dlls += [ "TrigTimeAlgs" ]
-theApp.ExtSvc += [ "TrigTimeSvc" ]
-
-# Algorithm
-theApp.Dlls += [ "TrigMuCluster" ]
-
-
-# Timer service conf.
-TrigTimerSvc = Service ( "TrigTimerSvc" )
-TrigTimerSvc.OutputLevel = 3
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/jobOfragment_TrigMuCluster.py b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/jobOfragment_TrigMuCluster.py
deleted file mode 100644
index 54aee5fa6386..000000000000
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/share/jobOfragment_TrigMuCluster.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#----------------------------------------------------
-# MuCluster options
-#----------------------------------------------------
-# Timing service libs.
-theApp.Dlls += [ "TrigTimeAlgs" ]
-theApp.ExtSvc += [ "TrigTimeSvc" ]
-
-# Algorithm
-theApp.Dlls += [ "TrigiMuCluster" ]
-
-# Timer service conf.
-TrigTimerSvc = Service ( "TrigTimerSvc" )
-TrigTimerSvc.OutputLevel = 3
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx
index 1c7a2cf2ab78..3e6056566817 100644
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx
@@ -1,16 +1,14 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /*
   MuonCluster.cxx
   Muon cluster finding, creates an RoI cluster for track finding
 */
-#include "TMath.h"
 #include <cmath>
 #include <algorithm>
 #include <sstream>
-#include "CLHEP/Units/SystemOfUnits.h"
 #include "GaudiKernel/ITHistSvc.h"
 #include "PathResolver/PathResolver.h"
 #include "TrigInterfaces/FexAlgo.h"
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx
index d8d08fc90254..f8c9b7455403 100644
--- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx
@@ -1,15 +1,13 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /*
   MuonClusterIsolation.cxx
 */
-#include "TMath.h"
 #include <cmath>
 #include <algorithm>
 #include <sstream>
-#include "CLHEP/Units/SystemOfUnits.h"
 #include "GaudiKernel/ITHistSvc.h"
 #include "PathResolver/PathResolver.h"
 #include "TrigInterfaces/FexAlgo.h"
@@ -308,7 +306,7 @@ HLT::ErrorCode MuonClusterIsolation::hltExecute(std::vector<std::vector<HLT::Tri
        
 	for(; track !=lasttrack; track++ ) {
   
-	  float pT = fabs(TMath::Sin((*track)->theta())/(*track)->qOverP());
+	  float pT = fabs(std::sin((*track)->theta())/(*track)->qOverP());
 
 	  if ( pT <= m_PtMinID) continue;
 	  double eta  = (*track)->eta();
-- 
GitLab


From fee32111c31c7d3c372b2fb2e2e71b61db1e9866 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:47:55 +0200
Subject: [PATCH 168/217] TrigMinBias: CMake cleanup, enable flake8

---
 .../TrigAlgorithms/TrigMinBias/CMakeLists.txt | 26 +++----------------
 .../python/TrigMinBiasProperties.py           |  7 +++--
 2 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMinBias/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigMinBias/CMakeLists.txt
index 9d084ae94d29..67c066a1c687 100644
--- a/Trigger/TrigAlgorithms/TrigMinBias/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigMinBias/CMakeLists.txt
@@ -1,32 +1,12 @@
-################################################################################
-# Package: TrigMinBias
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigMinBias )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Event/xAOD/xAODTracking
-                          Event/xAOD/xAODTrigMinBias
-                          Tracking/TrkEvent/TrkTrack
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils
-                          Control/StoreGate
-                          GaudiKernel
-                          Tracking/TrkEvent/TrkParameters
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Event/xAOD/xAODTrigger
-                          Control/AthenaMonitoringKernel
-                          Control/AthViews)
-
 # Component(s) in the package:
 atlas_add_component( TrigMinBias
                      src/*.cxx src/components/*.cxx
-
-                     LINK_LIBRARIES DecisionHandlingLib AthenaMonitoringKernelLib xAODTracking xAODTrigMinBias TrkTrack TrigInDetEvent TrigInterfacesLib StoreGateLib GaudiKernel TrkParameters TrigTimeAlgsLib AthViews TrigCompositeUtilsLib)
+                     LINK_LIBRARIES AthViews AthenaBaseComps AthenaMonitoringKernelLib DecisionHandlingLib GaudiKernel TrigCompositeUtilsLib TrigInterfacesLib TrigTimeAlgsLib TrkParameters TrkTrack xAODTracking xAODTrigMinBias xAODTrigger )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasProperties.py b/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasProperties.py
index 01a00dff4244..eb9c37eb12c5 100644
--- a/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasProperties.py
+++ b/Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasProperties.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ##
 ## @file Trigger/TrigAlgorithms/TrigMinBias/python/TrigMinBiasProperties.py
@@ -19,7 +19,6 @@ __all__    = [ "trigMinBiasProperties" ]
 ## Import
  
 from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties
 
 ##-----------------------------------------------------------------------------
 ## 1st step: define JobProperty classes
@@ -102,8 +101,8 @@ log = logging.getLogger( 'TrigMinBiasProperties.py' )
 try:
     from TriggerMenu import useNewTriggerMenu
     useNewTM = useNewTriggerMenu()
-    log.info("Using new TriggerMenu: %r" % useNewTM)
-except:
+    log.info("Using new TriggerMenu: %r", useNewTM)
+except Exception:
     useNewTM = False
     log.info("Using old TriggerMenuPython since TriggerMenu.useNewTriggerMenu can't be imported")
 
-- 
GitLab


From b7fe041dc61c3b6ba240babc30ea9b7860ea2a4b Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 10:57:06 +0200
Subject: [PATCH 169/217] TrigT2MinBias: CMake cleanup, enable flake8

---
 .../TrigT2MinBias/CMakeLists.txt              |  38 +---
 .../TrigT2MinBias/python/MbtsConfig.py        |   1 +
 .../python/TrigT2MinBiasConfig.py             | 171 +++++++++---------
 .../python/TrigT2MinBiasMonitoringMT.py       |   1 +
 .../python/TrigT2MinBiasProperties.py         |   7 +-
 5 files changed, 91 insertions(+), 127 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2MinBias/CMakeLists.txt
index 340bff10e200..b5617482676d 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/CMakeLists.txt
@@ -1,38 +1,8 @@
-################################################################################
-# Package: TrigT2MinBias
-###############################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigT2MinBias )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Event/xAOD/xAODTrigMinBias
-                          ForwardDetectors/ZDC/ZdcEvent
-                          GaudiKernel
-                          TileCalorimeter/TileEvent
-                          Trigger/TrigAlgorithms/TrigT2CaloCommon
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigSteer/DecisionHandling
-                          Trigger/TrigSteer/TrigCompositeUtils
-                          Trigger/TrigSteer/TrigInterfaces
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          DetectorDescription/IRegionSelector
-                          Event/xAOD/xAODEventInfo
-                          ForwardDetectors/ZDC/ZdcConditions
-                          ForwardDetectors/ZDC/ZdcIdentifier
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRawEvent/InDetRawData
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          TileCalorimeter/TileIdentifier
-                          Tracking/TrkEvent/TrkSpacePoint
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTools/TrigTimeAlgs
-                          Event/xAOD/xAODTrigger
-                          Control/AthenaMonitoringKernel
-                          Control/AthViews )
-
 # External dependencies:
 find_package( tdaq-common )
 
@@ -40,9 +10,7 @@ find_package( tdaq-common )
 atlas_add_component( TrigT2MinBias
                      src/*.cxx src/components/*.cxx
                      INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} DecisionHandlingLib xAODTrigger xAODTrigMinBias ZdcEvent GaudiKernel TileEvent TrigT2CaloCommonLib TrigCaloEvent TrigInDetEvent TrigInterfacesLib IRegionSelector xAODEventInfo ZdcConditions ZdcIdentifier InDetIdentifier InDetRawData InDetPrepRawData TileIdentifier TrkSpacePoint TrigSteeringEvent TrigTimeAlgsLib AthViews TrigCompositeUtilsLib)
-
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthViews AthenaBaseComps AthenaMonitoringKernelLib CaloEvent CaloIdentifier DecisionHandlingLib GaudiKernel IRegionSelector InDetIdentifier InDetPrepRawData InDetRawData StoreGateLib TileByteStreamLib TileConditionsLib TileEvent TileIdentifier TrigCaloEvent TrigCompositeUtilsLib TrigInDetEvent TrigInDetToolInterfacesLib TrigInterfacesLib TrigSteeringEvent TrigT2CaloCommonLib TrigTimeAlgsLib TrkSpacePoint ZdcConditions ZdcEvent ZdcIdentifier xAODEventInfo xAODTrigMinBias xAODTrigger )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/python/MbtsConfig.py b/Trigger/TrigAlgorithms/TrigT2MinBias/python/MbtsConfig.py
index a6c2270a7c48..efd8baa3af5e 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/python/MbtsConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/python/MbtsConfig.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 from TrigT2MinBias.TrigT2MinBiasConf import MbtsFexMT
 from TrigT2MinBias.TrigT2MinBiasMonitoringMT import MbtsFexMTMonitoring
 
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
index 922b5d7cae53..f72969c45a86 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasConfig.py
@@ -1,10 +1,9 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # -*- coding: utf-8 -*-
 from TrigT2MinBias.TrigT2MinBiasConf import T2ZdcFex, T2ZdcHypo
 from TrigT2MinBias.TrigT2MinBiasConf import T2MbtsFex, T2MbtsHypo
 from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePoints, TrigCountSpacePointsHypo
-from TrigT2MinBias.TrigT2MinBiasConf import TrigCountTrtHits, TrigCountTrtHitsHypo
 
 # Monitoring
 from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
@@ -13,10 +12,6 @@ from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
 # Properties for histogram dimensions
 from TrigT2MinBias.TrigT2MinBiasProperties import trigT2MinBiasProperties
 
-from AthenaCommon.AppMgr import ToolSvc
-
-#ToolSvc += ospTool
-
 
 fexes = {}
 hypos = {}
@@ -1318,82 +1313,82 @@ fexes["L2MbZdcFex_LG"] = L2MbZdcFex_LG
 
 
 class ZdcHypoMonitoring(TrigGenericMonitoringToolConfig):
-	def __init__ (self, name="ZdcHypoMonitoring"):
-		super(ZdcHypoMonitoring, self).__init__(name)
-		self.defineTarget( ["Online", "Validation", "Cosmic"])
-
-
-		self.Histograms += [ defineHistogram('MultiplicityZDC_A',
-					type  = 'TH1I',
-					title = "Num ZDC Modules Side A",
-					xbins = 5, xmin=-0.5, xmax=5.5)]
-
-		self.Histograms += [ defineHistogram('MultiplicityZDC_C',
-					type  = 'TH1I',
-					title = "Num ZDC Modules Side C",
-					xbins = 5, xmin=-0.5, xmax=5.5)]
-
-		self.Histograms += [ defineHistogram('TimeZDC_A',
-					type  = 'TH1F',
-					title = "ZDC Mean Time Side A",
-					xbins = 100, xmin=-10, xmax=10)]
-
-		self.Histograms += [ defineHistogram('TimeZDC_C',
-					type  = 'TH1F',
-					title = "ZDC Mean Time Side C",
-					xbins = 100, xmin=-10, xmax=10)]
-
-		self.Histograms += [ defineHistogram('SumEnergyZDC_A',
-					type  = 'TH1F',
-                                        title = "ZDC Sum Energy Side A",
-					xbins = 500, xmin=0, xmax=5000)]
-
-		self.Histograms += [ defineHistogram('SumEnergyZDC_C',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Sum Energy Side C",
-                                             	xbins = 500, xmin=0, xmax=5000)]
-
-		self.Histograms += [ defineHistogram('TimeDiff_A_C',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Time Diff (A-C)",
-                                             	xbins = 100, xmin=-10, xmax=10)]
+        def __init__ (self, name="ZdcHypoMonitoring"):
+                super(ZdcHypoMonitoring, self).__init__(name)
+                self.defineTarget( ["Online", "Validation", "Cosmic"])
+
+
+                self.Histograms += [ defineHistogram('MultiplicityZDC_A',
+                                                     type  = 'TH1I',
+                                                     title = "Num ZDC Modules Side A",
+                                                     xbins = 5, xmin=-0.5, xmax=5.5)]
+
+                self.Histograms += [ defineHistogram('MultiplicityZDC_C',
+                                                     type  = 'TH1I',
+                                                     title = "Num ZDC Modules Side C",
+                                                     xbins = 5, xmin=-0.5, xmax=5.5)]
+
+                self.Histograms += [ defineHistogram('TimeZDC_A',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Mean Time Side A",
+                                                     xbins = 100, xmin=-10, xmax=10)]
+
+                self.Histograms += [ defineHistogram('TimeZDC_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Mean Time Side C",
+                                                     xbins = 100, xmin=-10, xmax=10)]
+
+                self.Histograms += [ defineHistogram('SumEnergyZDC_A',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Sum Energy Side A",
+                                                     xbins = 500, xmin=0, xmax=5000)]
+
+                self.Histograms += [ defineHistogram('SumEnergyZDC_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Sum Energy Side C",
+                                                     xbins = 500, xmin=0, xmax=5000)]
+
+                self.Histograms += [ defineHistogram('TimeDiff_A_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Time Diff (A-C)",
+                                                     xbins = 100, xmin=-10, xmax=10)]
 
 # after selection
 
-		self.Histograms += [ defineHistogram('SelMultiplicityZDC_A',
-                                             	type  = 'TH1I',
-                                             	title = "Num ZDC Modules Side A (After)",
-                                             	xbins = 5, xmin=-0.5, xmax=5.5)]
+                self.Histograms += [ defineHistogram('SelMultiplicityZDC_A',
+                                                     type  = 'TH1I',
+                                                     title = "Num ZDC Modules Side A (After)",
+                                                     xbins = 5, xmin=-0.5, xmax=5.5)]
 
-		self.Histograms += [ defineHistogram('SelMultiplicityZDC_C',
-                                             	type  = 'TH1I',
-                                             	title = "Num ZDC Modules Side C (After)",
-                                             	xbins = 5, xmin=-0.5, xmax=5.5)]
+                self.Histograms += [ defineHistogram('SelMultiplicityZDC_C',
+                                                     type  = 'TH1I',
+                                                     title = "Num ZDC Modules Side C (After)",
+                                                     xbins = 5, xmin=-0.5, xmax=5.5)]
 
-		self.Histograms += [ defineHistogram('SelTimeZDC_A',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Mean Time Side A (After)",
-                                             	xbins = 100, xmin=-10, xmax=10)]
+                self.Histograms += [ defineHistogram('SelTimeZDC_A',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Mean Time Side A (After)",
+                                                     xbins = 100, xmin=-10, xmax=10)]
 
-		self.Histograms += [ defineHistogram('SelTimeZDC_C',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Mean Time Side C (After)",
-                                             	xbins = 100, xmin=-10, xmax=10)]
+                self.Histograms += [ defineHistogram('SelTimeZDC_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Mean Time Side C (After)",
+                                                     xbins = 100, xmin=-10, xmax=10)]
 
-		self.Histograms += [ defineHistogram('SelSumEnergyZDC_A',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Sum Energy Side A (After)",
-                                             	xbins = 500, xmin=0, xmax=5000)]
+                self.Histograms += [ defineHistogram('SelSumEnergyZDC_A',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Sum Energy Side A (After)",
+                                                     xbins = 500, xmin=0, xmax=5000)]
 
-		self.Histograms += [ defineHistogram('SelSumEnergyZDC_C',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Sum Energy Side C (After)",
-                                             	xbins = 500, xmin=0, xmax=5000)]
+                self.Histograms += [ defineHistogram('SelSumEnergyZDC_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Sum Energy Side C (After)",
+                                                     xbins = 500, xmin=0, xmax=5000)]
 
-		self.Histograms += [ defineHistogram('SelTimeDiff_A_C',
-                                             	type  = 'TH1F',
-                                             	title = "ZDC Time Diff (A-C) (After)",
-                                             	xbins = 100, xmin=-10, xmax=10)]
+                self.Histograms += [ defineHistogram('SelTimeDiff_A_C',
+                                                     type  = 'TH1F',
+                                                     title = "ZDC Time Diff (A-C) (After)",
+                                                     xbins = 100, xmin=-10, xmax=10)]
 
 
 
@@ -1413,11 +1408,11 @@ L2MbZdcHypo_PT.TimeLogic = 0
 L2MbZdcHypo_PT.EnergyLogic = 1
 L2MbZdcHypo_PT.MultiplicityLogic = 0
 L2MbZdcHypo_PT.TimeOffset = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                             0., 0., 0., 0.]
 L2MbZdcHypo_PT.Pedestal = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                           0., 0., 0., 0.]
 L2MbZdcHypo_PT.EnergyCalibration = [1., 1., 1., 1.,
-	1., 1., 1., 1.]
+                                    1., 1., 1., 1.]
 L2MbZdcHypo_PT.TimeModuleCut = 99999.
 L2MbZdcHypo_PT.SumEnergyCut = [-1., 99999., -1., 99999.]
 L2MbZdcHypo_PT.MultCut = [ -1 , -1 ]
@@ -1431,11 +1426,11 @@ L2MbZdcHypo_hip_low_sideA.TimeLogic = 0
 L2MbZdcHypo_hip_low_sideA.EnergyLogic = 2 ## OR
 L2MbZdcHypo_hip_low_sideA.MultiplicityLogic = 0
 L2MbZdcHypo_hip_low_sideA.TimeOffset = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                        0., 0., 0., 0.]
 L2MbZdcHypo_hip_low_sideA.Pedestal = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                      0., 0., 0., 0.]
 L2MbZdcHypo_hip_low_sideA.EnergyCalibration = [1., 1., 1., 1.,
-	1., 1., 1., 1.]
+                                               1., 1., 1., 1.]
 L2MbZdcHypo_hip_low_sideA.TimeModuleCut = 99999.
 L2MbZdcHypo_hip_low_sideA.SumEnergyCut = [180., 99999., 99999., -1] # 1<A<2 || 3<C<4
 L2MbZdcHypo_hip_low_sideA.MultCut = [ -1 , -1 ]
@@ -1450,11 +1445,11 @@ L2MbZdcHypo_hip_low_sideC.TimeLogic = 0
 L2MbZdcHypo_hip_low_sideC.EnergyLogic = 2 ## OR
 L2MbZdcHypo_hip_low_sideC.MultiplicityLogic = 0
 L2MbZdcHypo_hip_low_sideC.TimeOffset = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                        0., 0., 0., 0.]
 L2MbZdcHypo_hip_low_sideC.Pedestal = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                      0., 0., 0., 0.]
 L2MbZdcHypo_hip_low_sideC.EnergyCalibration = [1., 1., 1., 1.,
-	1., 1., 1., 1.]
+                                               1., 1., 1., 1.]
 L2MbZdcHypo_hip_low_sideC.TimeModuleCut = 99999.
 L2MbZdcHypo_hip_low_sideC.SumEnergyCut = [99999.,-1., 180., 99999.] # 1<A<2 || 3<C<4
 L2MbZdcHypo_hip_low_sideC.MultCut = [ -1 , -1 ]
@@ -1469,11 +1464,11 @@ L2MbZdcHypo_hip_hi_sideA.TimeLogic = 0
 L2MbZdcHypo_hip_hi_sideA.EnergyLogic = 2 ## OR
 L2MbZdcHypo_hip_hi_sideA.MultiplicityLogic = 0
 L2MbZdcHypo_hip_hi_sideA.TimeOffset = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                       0., 0., 0., 0.]
 L2MbZdcHypo_hip_hi_sideA.Pedestal = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                     0., 0., 0., 0.]
 L2MbZdcHypo_hip_hi_sideA.EnergyCalibration = [1., 1., 1., 1.,
-	1., 1., 1., 1.]
+                                              1., 1., 1., 1.]
 L2MbZdcHypo_hip_hi_sideA.TimeModuleCut = 99999.
 L2MbZdcHypo_hip_hi_sideA.SumEnergyCut = [300., 99999., 99999., -1.] # 1<A<2 || 3<C<4
 L2MbZdcHypo_hip_hi_sideA.MultCut = [ -1 , -1 ]
@@ -1488,11 +1483,11 @@ L2MbZdcHypo_hip_hi_sideC.TimeLogic = 0
 L2MbZdcHypo_hip_hi_sideC.EnergyLogic = 2 ## OR
 L2MbZdcHypo_hip_hi_sideC.MultiplicityLogic = 0
 L2MbZdcHypo_hip_hi_sideC.TimeOffset = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                       0., 0., 0., 0.]
 L2MbZdcHypo_hip_hi_sideC.Pedestal = [0., 0., 0., 0.,
-	0., 0., 0., 0.]
+                                     0., 0., 0., 0.]
 L2MbZdcHypo_hip_hi_sideC.EnergyCalibration = [1., 1., 1., 1.,
-	1., 1., 1., 1.]
+                                              1., 1., 1., 1.]
 L2MbZdcHypo_hip_hi_sideC.TimeModuleCut = 99999.
 L2MbZdcHypo_hip_hi_sideC.SumEnergyCut = [99999.,-1., 300., 99999.] # 1<A<2 || 3<C<4
 L2MbZdcHypo_hip_hi_sideC.MultCut = [ -1 , -1 ]
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasMonitoringMT.py b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasMonitoringMT.py
index 3da6332aeada..e91b8a45cf10 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasMonitoringMT.py
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasMonitoringMT.py
@@ -1,3 +1,4 @@
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 def SpCountMonitoring():
 
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasProperties.py b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasProperties.py
index 706bb1496181..35d055629aa7 100644
--- a/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasProperties.py
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasProperties.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ##
 ## @file Trigger/TrigAlgorithms/TrigT2MinBias/python/TrigT2MinBiasProperties.py
@@ -19,7 +19,6 @@ __all__    = [ "trigT2MinBiasProperties" ]
 ## Import
  
 from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties
 
 ##-----------------------------------------------------------------------------
 ## 1st step: define JobProperty classes
@@ -114,8 +113,8 @@ log = logging.getLogger( 'TrigT2MinBiasProperties.py' )
 try:
     from TriggerMenu import useNewTriggerMenu
     useNewTM = useNewTriggerMenu()
-    log.info("Using new TriggerMenu: %r" % useNewTM)
-except:
+    log.info("Using new TriggerMenu: %r", useNewTM)
+except Exception:
     useNewTM = False
     log.info("Using old TriggerMenuPython since TriggerMenu.useNewTriggerMenu can't be imported")
 
-- 
GitLab


From dd55c014f914f89d8dc3ae3b2a991f329d0ff0bf Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 11:00:41 +0200
Subject: [PATCH 170/217] TrigT2HistoPrmVtx: Package cleanup

- cleanup cmake configuration
- enable flake8
- delete obsolete job options
---
 .../TrigT2HistoPrmVtx/CMakeLists.txt          | 29 +++------------
 .../python/TrigT2HistoPrmVtxComboConfig.py    |  6 +---
 .../share/TriggerConfig_TrigT2HistoPrmVtx.py  | 35 -------------------
 .../share/jobOfragment_TrigT2HistoPrmVtx.py   | 30 ----------------
 4 files changed, 5 insertions(+), 95 deletions(-)
 delete mode 100755 Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/TriggerConfig_TrigT2HistoPrmVtx.py
 delete mode 100755 Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/jobOfragment_TrigT2HistoPrmVtx.py

diff --git a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/CMakeLists.txt
index 32953b122f62..2d367bdae7cb 100644
--- a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/CMakeLists.txt
@@ -1,38 +1,17 @@
-################################################################################
-# Package: TrigT2HistoPrmVtx
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigT2HistoPrmVtx )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Event/xAOD/xAODTracking
-                          Trigger/TrigSteer/TrigInterfaces
-                          PRIVATE
-                          Event/EventInfo
-                          Event/EventPrimitives
-                          Event/xAOD/xAODBase
-                          GaudiKernel
-                          InnerDetector/InDetConditions/BeamSpotConditionsData
-                          Reconstruction/Particle
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigNavigation
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigTools/TrigTimeAlgs )
-
 # External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+find_package( ROOT COMPONENTS MathCore )
 
 # Component(s) in the package:
 atlas_add_component( TrigT2HistoPrmVtx
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} xAODTracking TrigInterfacesLib EventInfo EventPrimitives xAODBase GaudiKernel Particle TrigInDetEvent TrigNavigationLib TrigSteeringEvent TrigTimeAlgsLib )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps BeamSpotConditionsData CxxUtils EventInfo EventPrimitives GaudiKernel Particle StoreGateLib TrigInDetEvent TrigInterfacesLib TrigNavigationLib TrigSteeringEvent TrigTimeAlgsLib xAODBase xAODTracking )
 
 # Install files from the package:
-atlas_install_headers( TrigT2HistoPrmVtx )
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
diff --git a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/python/TrigT2HistoPrmVtxComboConfig.py b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/python/TrigT2HistoPrmVtxComboConfig.py
index 9619ac1698fd..3b7c71dddb7b 100755
--- a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/python/TrigT2HistoPrmVtxComboConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/python/TrigT2HistoPrmVtxComboConfig.py
@@ -1,11 +1,7 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxConf import TrigT2HistoPrmVtxCombo
 
-
-from AthenaCommon.SystemOfUnits import mm, GeV
-
-
 class TrigT2HistoPrmVtxComboBase (TrigT2HistoPrmVtxCombo):
     __slots__ = []
     def __init__(self, name):
diff --git a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/TriggerConfig_TrigT2HistoPrmVtx.py b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/TriggerConfig_TrigT2HistoPrmVtx.py
deleted file mode 100755
index 2c306d45f5d2..000000000000
--- a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/TriggerConfig_TrigT2HistoPrmVtx.py
+++ /dev/null
@@ -1,35 +0,0 @@
-include.block("TrigT2HistoPrmVtx/TriggerConfig_TrigT2HistoPrmVtx.py")
-#
-# Configure a suitable TrigT2HistoPrmVtx Algorithm instance
-#
-# Constructor arguments:
-# level, type, threshold, isIsolated
-# 
-# e.g. level=L2, type=muon, threshold=30, isIsolated=None
-#      level=EF, type=egamma, threshold=20, isIsolated=isolated
-#
-# Methods:
-# instanceName() : returns name of algorithm instance
-# classAndInstanceName() : returns a list of strings to be entered in the sequence file. This string
-#              defines the class and instance name
-#
-
-class TriggerConfig_TrigT2HistoPrmVtx:
-    def __init__(self, level, type = None, threshold = None, isIsolated = None):
-
-        if type == "jet":    
-            self.__instname__ = "TrigT2HistoPrmVtx_jet_"
-            self.__sequence__ = "TrigT2HistoPrmVtx/TrigT2HistoPrmVtx/jet"
-
-        self.__instname__ += level
-
-
-    def instanceName(self):
-        return self.__instname__
-
-    def classAndInstanceName(self):
-        return [ self.__sequence__ ]
-
-include( "TrigT2HistoPrmVtx/jobOfragment_TrigT2HistoPrmVtx.py")
-include.block( "TrigT2HistoPrmVtx/jobOfragment_TrigT2HistoPrmVtx.py")
-
diff --git a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/jobOfragment_TrigT2HistoPrmVtx.py b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/jobOfragment_TrigT2HistoPrmVtx.py
deleted file mode 100755
index c19cf8a5af4b..000000000000
--- a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/share/jobOfragment_TrigT2HistoPrmVtx.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#=============================================================
-#
-# TrigT2HistoPrmVtx job options
-#
-#==============================================================
-
-
-#--------------------------------------------------
-# TrigT2HistoPrmVtx algorithm
-#--------------------------------------------------
-theApp.Dlls += [ "TrigT2HistoPrmVtx" ]
-TrigT2HistoPrmVtx_jet_L2 = Algorithm( "TrigT2HistoPrmVtx_jet_L2" )
-
-
-#--------------------------------------------------------------
-# Algorithm Private Options
-#--------------------------------------------------------------
-
-
-# SET GENERAL PROPERTIES
-# track reconstruction algorithm: SiTrack(1) IdScan(2)
-TrigT2HistoPrmVtx_jet_L2.AlgoId = 1
-
-
-#==============================================================
-#
-# end of file
-#
-#==============================================================
-
-- 
GitLab


From 84a0f7cbf5da171a93072ff5653d9d44491ba55d Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <stewart.martin-haugh@cern.ch>
Date: Thu, 9 Jul 2020 09:18:38 +0000
Subject: [PATCH 171/217] Delete ATLAS_CHECK_THREAD_SAFETY - package not thread
 safe

---
 .../MuonIdHelpersAlgs/ATLAS_CHECK_FILE_THREAD_SAFETY              | 0
 .../MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY}                  | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_FILE_THREAD_SAFETY
 rename MuonSpectrometer/{Amdcsimrec/AmdcMGM/AmdcMGM/ATLAS_CHECK_FILE_THREAD_SAFETY => MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY} (100%)

diff --git a/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_FILE_THREAD_SAFETY b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_FILE_THREAD_SAFETY
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcMGM/AmdcMGM/ATLAS_CHECK_FILE_THREAD_SAFETY b/MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY
similarity index 100%
rename from MuonSpectrometer/Amdcsimrec/AmdcMGM/AmdcMGM/ATLAS_CHECK_FILE_THREAD_SAFETY
rename to MuonSpectrometer/MuonIdHelpersAlgs/MuonIdHelpersAlgs/ATLAS_CHECK_THREAD_SAFETY
-- 
GitLab


From 089d2aeedc96e47722450d159cd7a3feff8725f9 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:02:34 +0200
Subject: [PATCH 172/217] TrigTruthEventTPCnv: Cleanup cmake configuration

---
 .../TrigTruthEventTPCnv/CMakeLists.txt        | 46 ++++---------------
 .../test/TrigTruthEventTPCnv.xml              | 16 -------
 2 files changed, 9 insertions(+), 53 deletions(-)
 delete mode 100755 Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigTruthEventTPCnv.xml

diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/CMakeLists.txt b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/CMakeLists.txt
index 2924cd00527c..e75f4fa39dfb 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/CMakeLists.txt
+++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/CMakeLists.txt
@@ -1,65 +1,37 @@
-################################################################################
-# Package: TrigTruthEventTPCnv
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigTruthEventTPCnv )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthLinks
-                          Control/DataModelAthenaPool
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          Database/AthenaPOOL/RootConversions
-                          Generators/GeneratorObjectsTPCnv
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigInDetEventTPCnv
-                          Trigger/TrigTruthEvent/TrigInDetTruthEvent
-                          PRIVATE
-                          AtlasTest/TestTools
-                          Control/AthenaKernel
-                          Control/CxxUtils
-                          Control/SGTools
-                          GaudiKernel )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_tpcnv_library( TrigTruthEventTPCnv
                          src/*.cxx
                          PUBLIC_HEADERS TrigTruthEventTPCnv
-                         PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                         LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel )
+                         PRIVATE_LINK_LIBRARIES AthenaKernel
+                         LINK_LIBRARIES AthLinks AthenaPoolCnvSvcLib AthenaPoolUtilities DataModelAthenaPoolLib GeneratorObjectsTPCnv RootConversions TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent )
 
 atlas_add_dictionary( TrigTruthEventTPCnvDict
                       TrigTruthEventTPCnv/TrigTruthEventTPCnvDict.h
                       TrigTruthEventTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel TrigTruthEventTPCnv )
+                      LINK_LIBRARIES TrigTruthEventTPCnv )
 
 atlas_add_dictionary( OLD_TrigTruthEventTPCnvDict
                       TrigTruthEventTPCnv/TrigTruthEventTPCnvDict.h
                       TrigTruthEventTPCnv/OLD_selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel TrigTruthEventTPCnv )
+                      LINK_LIBRARIES TrigTruthEventTPCnv )
 
+# Tests in the package:
 atlas_add_test( TrigIDHitStatsCnv_p1_test
                 SOURCES
                 test/TrigIDHitStatsCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel TrigTruthEventTPCnv )
+                LINK_LIBRARIES TrigTruthEventTPCnv )
 
 atlas_add_test( TrigInDetTrackTruthCnv_p1_test
                 SOURCES
                 test/TrigInDetTrackTruthCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel TrigTruthEventTPCnv )
+                LINK_LIBRARIES AtlasHepMCLib TrigTruthEventTPCnv )
 
 atlas_add_test( TrigInDetTrackTruthMapCnv_p1_test
                 SOURCES
                 test/TrigInDetTrackTruthMapCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib AthenaPoolUtilities RootConversions GeneratorObjectsTPCnv TrigInDetEvent TrigInDetEventTPCnv TrigInDetTruthEvent TestTools AthenaKernel CxxUtils SGTools GaudiKernel TrigTruthEventTPCnv )
-
+                LINK_LIBRARIES AtlasHepMCLib StoreGateLib TrigTruthEventTPCnv )
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigTruthEventTPCnv.xml b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigTruthEventTPCnv.xml
deleted file mode 100755
index c794bb5f123f..000000000000
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigTruthEventTPCnv.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<atn>
-   <TEST name="TrigTruthEventTPCnvTests" type="makecheck">
-      <package>Trigger/TrigTruthEvent/TrigTruthEventTPCnv</package>
-      <timelimit>20</timelimit>
-      <author> scott snyder </author>
-      <mailto> snyder@bnl.gov </mailto>
-      <expectations>
-         <errorMessage>Athena exited abnormally</errorMessage>
-         <errorMessage>differ</errorMessage>
-         <warningMessage> # WARNING_MESSAGE : post.sh> ERROR</warningMessage>
-         <successMessage>check ok</successMessage>
-         <returnValue>0</returnValue>
-      </expectations>
-   </TEST>
-</atn>
-- 
GitLab


From 612151a7e07a67ff9b11f8eb8b915433ba0ac60b Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:04:19 +0200
Subject: [PATCH 173/217] TrigTruthEventAthenaPool: Delete obsolete XML test
 definition

---
 .../test/TrigTruthEventAthenaPool.xml            | 16 ----------------
 1 file changed, 16 deletions(-)
 delete mode 100755 Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/test/TrigTruthEventAthenaPool.xml

diff --git a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/test/TrigTruthEventAthenaPool.xml b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/test/TrigTruthEventAthenaPool.xml
deleted file mode 100755
index 3c98c7720584..000000000000
--- a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/test/TrigTruthEventAthenaPool.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<atn>
-   <TEST name="TrigTruthEventAthenaPoolTests" type="makecheck">
-      <package>Trigger/TrigTruthEvent/TrigTruthEventAthenaPool</package>
-      <timelimit>20</timelimit>
-      <author> scott snyder </author>
-      <mailto> snyder@bnl.gov </mailto>
-      <expectations>
-         <errorMessage>Athena exited abnormally</errorMessage>
-         <errorMessage>differ</errorMessage>
-         <warningMessage> # WARNING_MESSAGE : post.sh> ERROR</warningMessage>
-         <successMessage>check ok</successMessage>
-         <returnValue>0</returnValue>
-      </expectations>
-   </TEST>
-</atn>
-- 
GitLab


From dd59fc2ed953433bc7b5fdc43da00911347c10ed Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:08:55 +0200
Subject: [PATCH 174/217] TrigInDetTruthEvent: CMake cleanup

---
 .../TrigInDetTruthEvent/CMakeLists.txt        | 28 ++-----------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/Trigger/TrigTruthEvent/TrigInDetTruthEvent/CMakeLists.txt b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/CMakeLists.txt
index 24127ce1872d..d967fa73d292 100644
--- a/Trigger/TrigTruthEvent/TrigInDetTruthEvent/CMakeLists.txt
+++ b/Trigger/TrigTruthEvent/TrigInDetTruthEvent/CMakeLists.txt
@@ -1,37 +1,15 @@
-################################################################################
-# Package: TrigInDetTruthEvent
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetTruthEvent )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthContainers
-                          Control/AthLinks
-                          Control/AthenaKernel
-                          Generators/GeneratorObjects
-                          Generators/AtlasHepMC
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          PRIVATE
-                          GaudiKernel )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_library( TrigInDetTruthEvent
                    src/*.cxx
                    PUBLIC_HEADERS TrigInDetTruthEvent
-                   INCLUDE_DIRS 
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AtlasHepMCLib AthContainers AthLinks AthenaKernel GeneratorObjects TrigInDetEvent TrigSteeringEvent
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel )
+                   LINK_LIBRARIES AthContainers AthLinks AthenaKernel AtlasHepMCLib GeneratorObjects TrigInDetEvent )
 
 atlas_add_dictionary( TrigInDetTruthEventDict
                       TrigInDetTruthEvent/TrigInDetTruthEventDict.h
                       TrigInDetTruthEvent/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} 
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthContainers AthLinks GeneratorObjects TrigInDetEvent TrigSteeringEvent AthenaKernel GaudiKernel TrigInDetTruthEvent )
-
+                      LINK_LIBRARIES TrigInDetTruthEvent )
-- 
GitLab


From d763c340e6dc7a5bd68f4422b64fcb23a006b1ac Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:14:30 +0200
Subject: [PATCH 175/217] TrigInDetTruthAlgs: Package cleanup

- delete obsolete job options
- cleanup cmake configuration
- enable flake8
---
 .../TrigInDetTruthAlgs/CMakeLists.txt         | 28 +------
 .../python/TrigInDetTruthAlgsConfig.py        | 79 +++++++++----------
 .../jobOfragment_makeTrigInDetTrackTruth.py   | 28 -------
 3 files changed, 42 insertions(+), 93 deletions(-)
 delete mode 100644 Trigger/TrigAnalysis/TrigInDetTruthAlgs/share/jobOfragment_makeTrigInDetTrackTruth.py

diff --git a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/CMakeLists.txt b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/CMakeLists.txt
index 3bc9d078736f..d4b91a79cc3c 100644
--- a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/CMakeLists.txt
+++ b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/CMakeLists.txt
@@ -1,35 +1,13 @@
-################################################################################
-# Package: TrigInDetTruthAlgs
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigInDetTruthAlgs )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Trigger/TrigEvent/TrigInDetEvent
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          GaudiKernel
-                          Generators/GenzModuleEvent
-                          Generators/AtlasHepMC
-                          InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRawEvent/InDetSimData
-                          InnerDetector/InDetRecEvent/InDetPrepRawData
-                          Tracking/TrkEvent/TrkTruthData
-                          Trigger/TrigTools/TrigInDetToolInterfaces
-                          Trigger/TrigTruthEvent/TrigInDetTruthEvent )
-
-# External dependencies:
-
 # Component(s) in the package:
 atlas_add_component( TrigInDetTruthAlgs
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS 
-                     LINK_LIBRARIES AtlasHepMCLib TrigInDetEvent AthenaBaseComps GaudiKernel GenzModuleEvent InDetIdentifier InDetSimData InDetPrepRawData TrkTruthData TrigInDetTruthEvent )
+                     LINK_LIBRARIES AthenaBaseComps AtlasHepMCLib GenzModuleEvent InDetIdentifier InDetPrepRawData InDetSimData TrigInDetEvent TrigInDetToolInterfacesLib TrigInDetTruthEvent TrkTruthData )
 
 # Install files from the package:
-atlas_install_python_modules( python/__init__.py python/TrigInDetTruthAlgsConfig.py )
-atlas_install_joboptions( share/jobOfragment*.py )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/python/TrigInDetTruthAlgsConfig.py b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/python/TrigInDetTruthAlgsConfig.py
index c21107fba712..e7a6eee4c224 100644
--- a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/python/TrigInDetTruthAlgsConfig.py
+++ b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/python/TrigInDetTruthAlgsConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 from TrigInDetTruthAlgs.TrigInDetTruthAlgsConf import TrigInDetTrackTruthMaker
 
@@ -9,42 +9,41 @@ class TrigIDTruthMaker ( TrigInDetTrackTruthMaker ):
         super( TrigInDetTrackTruthMaker, self ).__init__( name )
 
     def setDefaults(self, handle):
-        TrigIDTrackTruthMapName = "TrigInDetTrackTruthMap"
-        PixelSDO_MapName = "PixelSDO_Map"
-        SCT_SDO_MapName = "SCT_SDO_Map"
-        TRT_SDO_MapName = "TRT_SDO_Map"
-        MinNrMatchingHits = 2
-        TrigInDetTrackCollectionKeys= ["HLT",
-                                       "HLT_TrigIDSCAN_Jet",
-                                       "HLT_TrigIDSCAN_Tau", 
-                                       "HLT_TrigIDSCAN_eGamma",
-                                       "HLT_TrigIDSCAN_Muon", 
-                                       "HLT_TrigIDSCAN_muonIso",
-                                       "HLT_TrigIDSCAN_Bphysics", 
-                                       "HLT_TrigIDSCAN_FullScan",
-                                       #"HLT_TrigIDSCAN_BeamSpot",
-                                       "HLT_TrigIDSCAN_Cosmics", 
-                                       "HLT_TrigIDSCAN_eGamma_Brem",
-                                       "HLT_TrigIDSCAN_Tile", 
-                                       "HLT_TrigSiTrack_eGamma",
-                                       "HLT_TrigSiTrack_Muon", 
-                                       "HLT_TrigSiTrack_muonIso",
-                                       "HLT_TrigSiTrack_Tau", 
-                                       "HLT_TrigSiTrack_Jet",
-                                       "HLT_TrigSiTrack_Bphysics", 
-                                       "HLT_TrigSiTrack_FullScan",
-                                       #"HLT_TrigSiTrack_BeamSpot",
-                                       "HLT_TrigSiTrack_Tile",
-                                       "HLT_TrigSiTrack_Cosmics",
-                                       "HLT_TrigSiTrack_eGamma_robust",
-                                       "HLT_TrigSiTrack_Muon_robust", 
-                                       "HLT_TrigSiTrack_muonIso_robust",
-                                       "HLT_TrigSiTrack_Tau_robust", 
-                                       "HLT_TrigSiTrack_Jet_robust",
-                                       "HLT_TrigSiTrack_Bphysics_robust", 
-                                       "HLT_TrigSiTrack_FullScan_robust",
-                                       "HLT_TrigSiTrack_Tile_robust",
-                                       "HLT_TrigL2SiTrackFinder_MuonA",
-                                       "HLT_TRTSegmentFinder", 
-                                       "HLT_TRTxK"]
-        
+        handle.TrigIDTrackTruthMapName = "TrigInDetTrackTruthMap"
+        handle.PixelSDO_MapName = "PixelSDO_Map"
+        handle.SCT_SDO_MapName = "SCT_SDO_Map"
+        handle.TRT_SDO_MapName = "TRT_SDO_Map"
+        handle.MinNrMatchingHits = 2
+        handle.TrigInDetTrackCollectionKeys= ["HLT",
+                                              "HLT_TrigIDSCAN_Jet",
+                                              "HLT_TrigIDSCAN_Tau",
+                                              "HLT_TrigIDSCAN_eGamma",
+                                              "HLT_TrigIDSCAN_Muon",
+                                              "HLT_TrigIDSCAN_muonIso",
+                                              "HLT_TrigIDSCAN_Bphysics",
+                                              "HLT_TrigIDSCAN_FullScan",
+                                              #"HLT_TrigIDSCAN_BeamSpot",
+                                              "HLT_TrigIDSCAN_Cosmics",
+                                              "HLT_TrigIDSCAN_eGamma_Brem",
+                                              "HLT_TrigIDSCAN_Tile",
+                                              "HLT_TrigSiTrack_eGamma",
+                                              "HLT_TrigSiTrack_Muon",
+                                              "HLT_TrigSiTrack_muonIso",
+                                              "HLT_TrigSiTrack_Tau",
+                                              "HLT_TrigSiTrack_Jet",
+                                              "HLT_TrigSiTrack_Bphysics",
+                                              "HLT_TrigSiTrack_FullScan",
+                                              #"HLT_TrigSiTrack_BeamSpot",
+                                              "HLT_TrigSiTrack_Tile",
+                                              "HLT_TrigSiTrack_Cosmics",
+                                              "HLT_TrigSiTrack_eGamma_robust",
+                                              "HLT_TrigSiTrack_Muon_robust",
+                                              "HLT_TrigSiTrack_muonIso_robust",
+                                              "HLT_TrigSiTrack_Tau_robust",
+                                              "HLT_TrigSiTrack_Jet_robust",
+                                              "HLT_TrigSiTrack_Bphysics_robust",
+                                              "HLT_TrigSiTrack_FullScan_robust",
+                                              "HLT_TrigSiTrack_Tile_robust",
+                                              "HLT_TrigL2SiTrackFinder_MuonA",
+                                              "HLT_TRTSegmentFinder",
+                                              "HLT_TRTxK"]
diff --git a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/share/jobOfragment_makeTrigInDetTrackTruth.py b/Trigger/TrigAnalysis/TrigInDetTruthAlgs/share/jobOfragment_makeTrigInDetTrackTruth.py
deleted file mode 100644
index d94656b29a6a..000000000000
--- a/Trigger/TrigAnalysis/TrigInDetTruthAlgs/share/jobOfragment_makeTrigInDetTrackTruth.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Job Options file for TrigInDetTrackTruthMaker
-# /Trigger/TrigAnalysis/TrigInDetTruthAlgs/share
-# RG 28/3/2006
-#
-# the DLL:
-#theApp.Dlls += [ "TrigInDetTruthAlgs" ]
-#theApp.TopAlg += [ "TrigInDetTrackTruthMaker" ]
-
-# the algorithm derived class
-#TrigInDetTrackTruthMaker = Algorithm( "TrigInDetTrackTruthMaker" )
-
-# set properties
-#TrigInDetTrackTruthMaker.TrigIDTrackTruthMapName = "MyTrigInDetTrackTruthMap"
-#TrigInDetTrackTruthMaker.MinNrMatchingHits = 2
-#TrigInDetTrackTruthMaker.OutputLevel = DEBUG
-
-from TrigInDetTruthAlgs.TrigInDetTruthAlgsConfig import TrigIDTruthMaker
-
-myTrigIDTruthMaker = TrigIDTruthMaker()
-#myTrigIDTruthMaker.OutputLevel=DEBUG
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-topSequence += myTrigIDTruthMaker
-
-
-
-- 
GitLab


From 0ce725cfd0da96a02b2a6d07d6774cbe1b555824 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Thu, 9 Jul 2020 12:17:56 +0200
Subject: [PATCH 176/217] CaloMonitoring: Fix Tile cell monitoring histogram
 name for Run3

Name of one TileCal cell monitoring histogram has been corrected
to be compatible with Run2.
---
 Calorimeter/CaloMonitoring/python/TileCalCellMonAlg.py | 4 ++--
 Calorimeter/CaloMonitoring/src/TileCalCellMonAlg.cxx   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Calorimeter/CaloMonitoring/python/TileCalCellMonAlg.py b/Calorimeter/CaloMonitoring/python/TileCalCellMonAlg.py
index a32e03d88dc5..e133be10b666 100644
--- a/Calorimeter/CaloMonitoring/python/TileCalCellMonAlg.py
+++ b/Calorimeter/CaloMonitoring/python/TileCalCellMonAlg.py
@@ -82,11 +82,11 @@ def TileCalCellMonAlgConfig(inputFlags, **kwargs):
 
     # 2) Configure histograms with occupancy maps over threshold (4 noise sigma) per Tile sample
     samplesWithoutE = ['A', 'BC', 'D', '']
-    noiseEtaPhiArray = helper.addArray([len(samplesWithoutE)], tileCalCellMonAlg, 'CellNoiseXEtaVSPhi', topPath = topPath)
+    noiseEtaPhiArray = helper.addArray([len(samplesWithoutE)], tileCalCellMonAlg, 'CellsNoiseXEtaVSPhi', topPath = topPath)
     for postfix, tool in noiseEtaPhiArray.Tools.items():
         sample = samplesWithoutE[int( postfix.split('_')[1] )]
         title = ('Number of Tile Cells %s' % sample) + ' with E > 4 sigma (DB);#eta;#phi'
-        name = 'eta,phi;CellNoiseXEtaVSPhi' + (sample + 'cells' if sample else '')
+        name = 'eta,phi;CellsNoiseXEtaVSPhi' + (sample + 'cells' if sample else '')
         tool.defineHistogram(name, title = title, type = 'TH2F',
                              xbins = 17, xmin = -1.7, xmax = 1.7,
                              ybins = 64, ymin = -3.14, ymax = 3.14)
diff --git a/Calorimeter/CaloMonitoring/src/TileCalCellMonAlg.cxx b/Calorimeter/CaloMonitoring/src/TileCalCellMonAlg.cxx
index d5c6835d8703..aac3e71af178 100644
--- a/Calorimeter/CaloMonitoring/src/TileCalCellMonAlg.cxx
+++ b/Calorimeter/CaloMonitoring/src/TileCalCellMonAlg.cxx
@@ -19,7 +19,7 @@ StatusCode TileCalCellMonAlg::initialize() {
   ATH_CHECK( m_caloNoiseKey.initialize() );
 
   // Excluding histogram for Tile E sample, but including histogram for all samples instead
-  m_noiseEtaPhiGroups = Monitored::buildToolMap<int>(m_tools, "CellNoiseXEtaVSPhi", N_TILE_SAMPLES);
+  m_noiseEtaPhiGroups = Monitored::buildToolMap<int>(m_tools, "CellsNoiseXEtaVSPhi", N_TILE_SAMPLES);
   // Histogams per Tile sample
   m_energyModuleGroups = Monitored::buildToolMap<int>(m_tools, "CellsXModule", N_TILE_SAMPLES);
 
-- 
GitLab


From d9b545dd2e2c7575bc5c0359a000ec8093e56830 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:30:28 +0200
Subject: [PATCH 177/217] TrigSimTransforms: CMake cleanup, enable flake8

---
 .../TrigSimTransforms/CMakeLists.txt          | 29 ++++---------------
 .../scripts/TrigAndReco_tf.py                 | 14 +++------
 .../scripts/printRODVersions.py               | 17 +++++------
 ...ergingEventLoopMgr_TriggerBSandRDOtoRDO.py |  6 ++--
 4 files changed, 20 insertions(+), 46 deletions(-)

diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt b/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
index 4c7d4b412d0b..00a3b98091fa 100644
--- a/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
+++ b/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
@@ -1,35 +1,16 @@
-################################################################################
-# Package: TrigSimTransforms
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( TrigSimTransforms )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
-                          Control/AthenaKernel
-                          Control/SGTools
-                          Control/StoreGate
-                          Event/EventInfo
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_component( TrigSimTransforms
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel SGTools StoreGateLib SGtests EventInfo GaudiKernel TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigParticle TrigSteeringEvent )
+                     LINK_LIBRARIES AthenaKernel EventInfo GaudiKernel SGTools StoreGateLib TrigSteeringEvent )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
-atlas_install_scripts( scripts/*.sh scripts/*.py )
-
+atlas_install_scripts( scripts/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
+atlas_install_scripts( scripts/*.sh )
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
index d3d1ea6e08fd..79364fe38dfa 100755
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
+++ b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
@@ -1,27 +1,21 @@
 #! /usr/bin/env python
 
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ## TrigAndReco_tf.py - Temporary transform to develop the .
-# @version $Id: TrigAndReco_tf.py$ 
 
 import sys
 import time
 
-import logging
-
 # Setup core logging here
 from PyJobTransforms.trfLogger import msg
-msg.info('logging set in %s' % sys.argv[0])
+msg.info('logging set in %s', sys.argv[0])
 
 from PyJobTransforms.transform import transform
-from PyJobTransforms.trfExe import athenaExecutor
 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments, addTriggerArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
 from RecJobTransforms.recTransformUtils import addAllRecoArgs, addRecoSubsteps
 
-import PyJobTransforms.trfArgClasses as trfArgClasses
-
 from TrigSimTransforms.trfTrigSimUtils import addTrigSimSubsteps, addTrigSimArguments
 
 
@@ -29,14 +23,14 @@ from TrigSimTransforms.trfTrigSimUtils import addTrigSimSubsteps, addTrigSimArgu
 @sigUsrStackTrace
 def main():
     
-    msg.info('This is %s' % sys.argv[0])
+    msg.info('This is %s', sys.argv[0])
 
     trf = getTransform()
     trf.parseCmdLineArgs(sys.argv[1:])
     trf.execute()
     trf.generateReport()
 
-    msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
+    msg.info("%s stopped at %s, trf exit code %d", sys.argv[0], time.asctime(), trf.exitCode)
     sys.exit(trf.exitCode)
 
 def getTransform():
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
index 1d3aa6915ade..09798e85de56 100755
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
+++ b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
@@ -1,15 +1,14 @@
 #!/usr/bin/env python
 
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+from __future__ import print_function
 import sys
 import eformat
-from eformat import helper
 from collections import defaultdict
 
 filename = sys.argv[1]
 bsfile = eformat.istream(filename)
-print "Read file %s with %i events" % (filename,bsfile.total_events)
+print("Read file %s with %i events" % (filename,bsfile.total_events))
 
 event = bsfile[0]
 
@@ -67,8 +66,8 @@ for rob in event:
 
 width = max([len(s) for s in rob_by_subdet.keys()]+[15]) + 5
 
-print "Detector%sROD version%s#ROBs" % (' ' * (width-8), ' ' * (14) )
-print "--------%s-----------%s-----" % ('-' * (width-8), '-' * (14) )
+print("Detector%sROD version%s#ROBs" % (' ' * (width-8), ' ' * (14) ))
+print("--------%s-----------%s-----" % ('-' * (width-8), '-' * (14) ))
 
 for subdet in sorted(rob_by_subdet.keys()):
 
@@ -76,10 +75,10 @@ for subdet in sorted(rob_by_subdet.keys()):
 
     robset = set(["%s" % rob.rod_version() for rob in roblist])
 
-    print "%-*s%-*s%i" % (width, subdet, 25, ", ".join(robset), len(roblist) )
+    print("%-*s%-*s%i" % (width, subdet, 25, ", ".join(robset), len(roblist) ))
 
 subdet_missing = set(subdetsData) - subdets
 if subdet_missing:
-    print "Missing the following sub detectors in the file:"
+    print("Missing the following sub detectors in the file:")
     for sd in sorted(subdet_missing):
-        print "    ",sd
+        print("    ",sd)
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
index 70c78fccfc69..78f0df31fb19 100644
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
+++ b/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
@@ -198,11 +198,11 @@ ostream.ItemList += [n.replace("/", "#") for n in svcMgr.ByteStreamAddressProvid
 #-------------------------------------------------------------------------------
 # Print some post output post config
 #-------------------------------------------------------------------------------
-print svcMgr
+print(svcMgr)
 
-print topSequence
+print(topSequence)
 
-print DetFlags.Print()
+print(DetFlags.Print())
 
 svcMgr.MessageSvc.debugLimit = 500000000
 
-- 
GitLab


From 19ef1a53c65e73e2480471d6d6a674ad96c8d829 Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Thu, 9 Jul 2020 10:44:28 +0000
Subject: [PATCH 178/217] DiscLayer,CylinderLayer use unique_ptr for
 IApproachDescriptor, IApproachDescriptor actually delete the ptr i.e use
 unique_ptr

---
 .../src/TRT_LayerBuilder.cxx                  |   8 +-
 .../src/TRT_LayerBuilderCond.cxx              |  16 +-
 .../TrkGeometry/ApproachDescriptor.h          |  17 +-
 .../TrkGeometry/TrkGeometry/CylinderLayer.h   |   6 +-
 .../TrkGeometry/TrkGeometry/DiscLayer.h       |  43 +-
 .../TrkGeometry/IApproachDescriptor.h         |  51 +-
 .../src/AlignableTrackingVolume.cxx           |   2 +-
 .../TrkGeometry/src/ApproachDescriptor.cxx    |   4 +-
 .../TrkDetDescr/TrkGeometry/src/ConeLayer.cxx |   9 +-
 .../TrkGeometry/src/CylinderLayer.cxx         | 566 +++++++++---------
 .../TrkDetDescr/TrkGeometry/src/DiscLayer.cxx | 462 +++++++-------
 .../src/HomogeneousLayerMaterial.cxx          |   2 +-
 .../TrkGeometry/src/MaterialLayer.cxx         |   4 +-
 .../TrkGeometry/src/MaterialProperties.cxx    |  11 +-
 .../TrkGeometry/src/MaterialStep.cxx          |  14 +-
 .../TrkGeometry/src/PlaneLayer.cxx            |   9 +-
 .../src/SubtractedCylinderLayer.cxx           |   9 +-
 .../TrkGeometry/src/SubtractedPlaneLayer.cxx  | 137 +++--
 .../TrkGeometry/src/TrackingVolume.cxx        |  31 +-
 19 files changed, 705 insertions(+), 696 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx
index cfb6e0996e14..d61f5bf3e482 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilder.cxx
@@ -426,10 +426,10 @@ const std::vector< const Trk::CylinderLayer* >* InDet::TRT_LayerBuilder::cylindr
               // build a BinUtility for the ApproachDescritptor
               Trk::BinUtility* aDescriptorBinUtility = new Trk::BinUtility(nBarrelPhiSectors,layerPhiMinCorrected,layerPhiMaxCorrected,Trk::closed,Trk::binPhi);
                            (*aDescriptorBinUtility) += Trk::BinUtility(2,-layerHalflength,layerHalflength,Trk::open, Trk::binZ);
-              Trk::BinnedArray2D<Trk::ApproachSurfaces>* aDescriptorBinnedArray = new Trk::BinnedArray2D<Trk::ApproachSurfaces> (layerApproachSurfaces, aDescriptorBinUtility);             
+              auto aDescriptorBinnedArray = std::make_unique<Trk::BinnedArray2D<Trk::ApproachSurfaces>> (layerApproachSurfaces, aDescriptorBinUtility);             
               // build an approach surface
               Trk::CylinderSurface* approachSurface  = new Trk::CylinderSurface(barrelLayerBounds->clone()); 
-              Trk::ApproachDescriptor* aDescritpor   = new Trk::ApproachDescriptor(aDescriptorBinnedArray, approachSurface);
+              Trk::ApproachDescriptor* aDescritpor   = new Trk::ApproachDescriptor(std::move(aDescriptorBinnedArray), approachSurface);
               
               // do not give every layer material properties
               if (assignMaterial) {
@@ -669,7 +669,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers(
            ATH_MSG_VERBOSE("TRT Disc being build at z Position " << discZ << " ( from " << zMin << " / " << zMax << " )");
 
            // create the approach offset
-           Trk::ApproachSurfaces* aSurfaces = new Trk::ApproachSurfaces;
+           auto aSurfaces = std::make_unique<Trk::ApproachSurfaces>();
            // get the position of the approach surfaces
            const Amg::Vector3D aspPosition(0.,0.,zMin-m_layerStrawRadius);
            const Amg::Vector3D asnPosition(0.,0.,zMax+m_layerStrawRadius);
@@ -686,7 +686,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::TRT_LayerBuilder::discLayers(
                aSurfaces->push_back( new Trk::DiscSurface(asnTransform, fullDiscBounds->clone()) );
            }               
            // approach descriptor
-           Trk::ApproachDescriptor* aDescriptor = new Trk::ApproachDescriptor(aSurfaces,false);
+           Trk::ApproachDescriptor* aDescriptor = new Trk::ApproachDescriptor(std::move(aSurfaces),false);
            
            // do not give every layer material properties
            if (assignMaterial)
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx
index 90ac1dc3137d..ee73ca31db73 100755
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/TRT_LayerBuilderCond.cxx
@@ -433,11 +433,15 @@ std::pair<EventIDRange, const std::vector< const Trk::CylinderLayer* >* > InDet:
               // build a BinUtility for the ApproachDescritptor
               Trk::BinUtility* aDescriptorBinUtility = new Trk::BinUtility(nBarrelPhiSectors,layerPhiMinCorrected,layerPhiMaxCorrected,Trk::closed,Trk::binPhi);
                            (*aDescriptorBinUtility) += Trk::BinUtility(2,-layerHalflength,layerHalflength,Trk::open, Trk::binZ);
-              Trk::BinnedArray2D<Trk::ApproachSurfaces>* aDescriptorBinnedArray = new Trk::BinnedArray2D<Trk::ApproachSurfaces> (layerApproachSurfaces, aDescriptorBinUtility);             
+
+              auto aDescriptorBinnedArray = std::make_unique<Trk::BinnedArray2D<Trk::ApproachSurfaces>> (layerApproachSurfaces, aDescriptorBinUtility);             
+            
               // build an approach surface
-              Trk::CylinderSurface* approachSurface  = new Trk::CylinderSurface(barrelLayerBounds->clone()); 
-              Trk::ApproachDescriptor* aDescritpor   = new Trk::ApproachDescriptor(aDescriptorBinnedArray, approachSurface);
-              
+              Trk::CylinderSurface* approachSurface  = new Trk::CylinderSurface(barrelLayerBounds->clone());
+              Trk::ApproachDescriptor* aDescritpor =
+                new Trk::ApproachDescriptor(std::move(aDescriptorBinnedArray),
+                                            approachSurface);
+
               // do not give every layer material properties
               if (assignMaterial) {
                  // ----- prepare the BinnedLayerMaterial -----------------------------------------------------
@@ -678,7 +682,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT
            ATH_MSG_VERBOSE("TRT Disc being build at z Position " << discZ << " ( from " << zMin << " / " << zMax << " )");
 
            // create the approach offset
-           Trk::ApproachSurfaces* aSurfaces = new Trk::ApproachSurfaces;
+           auto aSurfaces = std::make_unique<Trk::ApproachSurfaces>();
            // get the position of the approach surfaces
            const Amg::Vector3D aspPosition(0.,0.,zMin-m_layerStrawRadius);
            const Amg::Vector3D asnPosition(0.,0.,zMax+m_layerStrawRadius);
@@ -695,7 +699,7 @@ std::pair<EventIDRange, const std::vector< const Trk::DiscLayer* >* > InDet::TRT
                aSurfaces->push_back( new Trk::DiscSurface(asnTransform, fullDiscBounds->clone()) );
            }               
            // approach descriptor
-           Trk::ApproachDescriptor* aDescriptor = new Trk::ApproachDescriptor(aSurfaces,false);
+           Trk::ApproachDescriptor* aDescriptor = new Trk::ApproachDescriptor(std::move(aSurfaces),false);
            
            // do not give every layer material properties
            if (assignMaterial)
diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ApproachDescriptor.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ApproachDescriptor.h
index 9e2b4aed5771..788a9c1c41ca 100644
--- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ApproachDescriptor.h
+++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/ApproachDescriptor.h
@@ -25,13 +25,18 @@ namespace Trk {
   class ApproachDescriptor : public IApproachDescriptor {
       public: 
         // Default constructor
-        ApproachDescriptor(ApproachSurfaces* aSurfaces, bool rebuild=true) : 
-           IApproachDescriptor(aSurfaces,rebuild) {}
-        
+        ApproachDescriptor(std::unique_ptr<ApproachSurfaces> aSurfaces,
+                           bool rebuild = true)
+          : IApproachDescriptor(std::move(aSurfaces), rebuild)
+        {}
+
         // Default constructor
-        ApproachDescriptor(BinnedArray<ApproachSurfaces>* aSurfaceArray, Surface* aSurfaceArraySurface = nullptr) : 
-           IApproachDescriptor(aSurfaceArray,aSurfaceArraySurface) {}
-        
+        ApproachDescriptor(
+          std::unique_ptr<BinnedArray<ApproachSurfaces>> aSurfaceArray,
+          Surface* aSurfaceArraySurface = nullptr)
+          : IApproachDescriptor(std::move(aSurfaceArray), aSurfaceArraySurface)
+        {}
+
         /** get the compatible surfaces 
             - return : a boolean indicating if an actual intersection had been tried
             - fill vector of intersections
diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h
index e235f53daa9b..e755a68cd7d8 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h
+++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/CylinderLayer.h
@@ -18,6 +18,7 @@ class MsgStream;
 #include "TrkSurfaces/CylinderSurface.h"
 #include "TrkDetDescrUtils/BinnedArray.h"
 #include "TrkEventPrimitives/PropDirection.h"
+#include "TrkGeometry/ApproachDescriptor.h"
 // STL sorting
 #include <algorithm>
 
@@ -26,7 +27,6 @@ namespace Trk {
 class CylinderBounds;
 class LayerMaterialProperties;
 class OverlapDescriptor;
-class IApproachDescriptor;
 
   /**
    @class CylinderLayer
@@ -115,7 +115,7 @@ class IApproachDescriptor;
         CylinderLayer& operator=(const CylinderLayer&);
                       
         /**Destructor*/
-        virtual ~CylinderLayer() override;
+        virtual ~CylinderLayer() = default;
                 
         /** Transforms the layer into a Surface representation for extrapolation */
         virtual const CylinderSurface& surfaceRepresentation() const override;
@@ -179,7 +179,7 @@ class IApproachDescriptor;
 
      protected:
        /** surfaces on approach to the layer */
-       IApproachDescriptor*  m_approachDescriptor;
+       std::unique_ptr<IApproachDescriptor>  m_approachDescriptor;
        
        
   };
diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h
index b9863d0a85cb..8bb2b812e1db 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h
+++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/DiscLayer.h
@@ -17,16 +17,16 @@ class MsgStream;
 #include "TrkGeometry/Layer.h"
 #include "TrkSurfaces/DiscSurface.h"
 #include "TrkEventPrimitives/PropDirection.h"
+#include "TrkGeometry/ApproachDescriptor.h"
 // STL sorting
 #include <algorithm>
-
+#include <memory>
 namespace Trk {
 
   class DiscBounds;
   class VolumeBounds;
   class LayerMaterialProperties;
   class OverlapDescriptor;
-  class IApproachDescriptor;
   
   /**
    @class DiscLayer
@@ -44,8 +44,8 @@ namespace Trk {
       
       public:
         /**Default Constructor*/
-        DiscLayer(){}
-        
+        DiscLayer() = default;
+
         /**Constructor with DiscSurface components and MaterialProperties */
         DiscLayer(Amg::Transform3D* transform,
                   DiscBounds* dbounds,
@@ -91,8 +91,8 @@ namespace Trk {
         DiscLayer& operator=(const DiscLayer&);
               
         /**Destructor*/
-        virtual ~DiscLayer() override;
-                
+        virtual ~DiscLayer() = default;
+
         /** Transforms the layer into a Surface representation for extrapolation */
         virtual const DiscSurface& surfaceRepresentation() const override;
 
@@ -112,30 +112,31 @@ namespace Trk {
         virtual double  postUpdateMaterialFactor(const Trk::TrackParameters& par,
                                                  Trk::PropDirection dir) const override;
 
-       /** move the Layer */
+       /** move the Layer non-const*/
        virtual void moveLayer( Amg::Transform3D& shift ) override;
      
-       /** move the Layer */
+       /** move the Layer const , performas const_cast */
        virtual void moveLayer ATLAS_NOT_THREAD_SAFE ( Amg::Transform3D& shift ) const override{
          const_cast<DiscLayer*> (this)->moveLayer(shift);
        }
  
      private:   
        /** Resize the layer to the tracking volume - only works for CylinderVolumeBouns */ 
-       virtual void resizeLayer(const VolumeBounds& vBounds, double envelope) override;        
-              /** Resize the layer to the tracking volume - only works for CylinderVolumeBouns */
+       virtual void resizeLayer(const VolumeBounds& vBounds, double envelope) override;
+       /** Resize the layer to the tracking volume - only works for
+        * CylinderVolumeBouns . performs const cast */
        virtual void resizeLayer ATLAS_NOT_THREAD_SAFE(const VolumeBounds& vBounds,
                                                       double envelope) const override
        {
          const_cast<DiscLayer*> (this)->resizeLayer(vBounds,envelope);
        }
 
-       /** Resize the layer to the tracking volume - not implemented */
+       /** Resize the layer to the tracking volume - not implemented.*/
        virtual void resizeAndRepositionLayer(const VolumeBounds& vBounds,
                                              const Amg::Vector3D& cCenter,
                                              double envelop) override;
 
-       /** Resize the layer to the tracking volume - not implemented */ 
+       /** Resize the layer to the tracking volume - not implemented . Performs const cast*/ 
        virtual void resizeAndRepositionLayer ATLAS_NOT_THREAD_SAFE (const VolumeBounds& vBounds, 
                                                                     const Amg::Vector3D& cCenter, 
                                                                     double envelop) const override{
@@ -151,22 +152,20 @@ namespace Trk {
                                       const Amg::Vector3D& dir,
                                       const BoundaryCheck& bcheck) const;    
      protected:
-       IApproachDescriptor*  m_approachDescriptor;      //!< surface for approaching
-    
+       //!< surface for approaching
+       std::unique_ptr<IApproachDescriptor> m_approachDescriptor;
   };
 
   /** @class DiscLayerSorterZ 
 	simple helper function to allow sorting of DiscLayers in z
   */
   class DiscLayerSorterZ {
-	public:       
-	 /** Default Constructor */
-	 DiscLayerSorterZ()
-	    {}
-	       
-	    bool operator() (const DiscLayer* one, const DiscLayer* two) const 
-	    {return ( one->center().z() <  two->center().z() ); }          
-    };
+	public:
+          bool operator()(const DiscLayer* one, const DiscLayer* two) const
+          {
+            return (one->center().z() < two->center().z());
+          }
+  };
 
 } // end of namespace
 
diff --git a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/IApproachDescriptor.h b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/IApproachDescriptor.h
index 9f6046201eec..0ed49a870336 100644
--- a/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/IApproachDescriptor.h
+++ b/Tracking/TrkDetDescr/TrkGeometry/TrkGeometry/IApproachDescriptor.h
@@ -13,7 +13,7 @@
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "TrkSurfaces/Surface.h"
 #include "TrkDetDescrUtils/BinnedArray.h"
-
+#include <memory>
 namespace Trk {
     
     /**
@@ -31,10 +31,14 @@ namespace Trk {
         // Desctructur with cleanup
         ~ApproachSurfaces() 
          { 
-             for (auto& sf : (*this))
+             for (auto& sf : (*this)){
+               //delete when not owned by
+               //Tracking Geometry
+               if (sf && sf->isFree()) {
                  delete sf;
+               }
+             }
          }
-        
     };
     
      /**
@@ -49,23 +53,31 @@ namespace Trk {
     class IApproachDescriptor {
       public: 
         // Default constructor
-        IApproachDescriptor(ApproachSurfaces* aSurfaces, bool rebuild=true) :
-            m_approachSurfaces(aSurfaces),
-            m_approachSurfaceArraySurface(nullptr),
-            m_approachSurfaceArray(nullptr),
-            m_rebuild(rebuild)
+        IApproachDescriptor(std::unique_ptr<ApproachSurfaces> aSurfaces,
+                            bool rebuild = true)
+          : m_approachSurfaces(std::move(aSurfaces))
+          , m_approachSurfaceArraySurface(nullptr)
+          , m_approachSurfaceArray(nullptr)
+          , m_rebuild(rebuild)
         {}
         
         // Default constructor
-        IApproachDescriptor(BinnedArray<ApproachSurfaces>* aSurfaceArray, Surface* aSurfaceArraySurface = nullptr):
-            m_approachSurfaces(nullptr),
-            m_approachSurfaceArraySurface(aSurfaceArraySurface),
-            m_approachSurfaceArray(aSurfaceArray),
-            m_rebuild(false)
+        IApproachDescriptor(
+          std::unique_ptr<BinnedArray<ApproachSurfaces>> aSurfaceArray,
+          Surface* aSurfaceArraySurface = nullptr)
+          : m_approachSurfaces(nullptr)
+          , m_approachSurfaceArraySurface(aSurfaceArraySurface)
+          , m_approachSurfaceArray(std::move(aSurfaceArray))
+          , m_rebuild(false)
         {}
         
-       // Virtual destructor
-        virtual ~IApproachDescriptor() {}
+        virtual ~IApproachDescriptor() {
+          //Delet if not free 
+          if (m_approachSurfaceArraySurface &&
+              m_approachSurfaceArraySurface->isFree()) {
+            delete m_approachSurfaceArraySurface;
+          }
+        }
 
         // register Layer
         void registerLayer(const Layer& lay);
@@ -93,13 +105,12 @@ namespace Trk {
         {}
         
       protected:
-        ApproachSurfaces*                m_approachSurfaces;
-        Surface*                         m_approachSurfaceArraySurface;
-        BinnedArray<ApproachSurfaces>*   m_approachSurfaceArray;
-        bool                             m_rebuild;
+        std::unique_ptr<ApproachSurfaces> m_approachSurfaces;
+        Surface* m_approachSurfaceArraySurface;
+        std::unique_ptr<BinnedArray<ApproachSurfaces>> m_approachSurfaceArray;
+        bool m_rebuild;
     };
 
-
     inline bool IApproachDescriptor::rebuild() const { return m_rebuild; }    
     
     inline void IApproachDescriptor::registerLayer(const Layer& lay) {
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/AlignableTrackingVolume.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/AlignableTrackingVolume.cxx
index 566daba63bc0..17f495f21391 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/AlignableTrackingVolume.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/AlignableTrackingVolume.cxx
@@ -45,5 +45,5 @@ Trk::AlignableTrackingVolume::~AlignableTrackingVolume()
 const Trk::TrackingVolume* Trk::AlignableTrackingVolume::alignedTrackingVolume() const
 {
   if ( m_alignedTV ) return m_alignedTV; 
-  else return this;  
+  return this;  
 }
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/ApproachDescriptor.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/ApproachDescriptor.cxx
index aa7fe711e011..ff3ee7d498a1 100644
--- a/Tracking/TrkDetDescr/TrkGeometry/src/ApproachDescriptor.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/ApproachDescriptor.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -13,7 +13,7 @@ const Trk::ApproachSurfaces* Trk::ApproachDescriptor::approachSurfaces(const Amg
 {
   // return the single approach surfaces
   if (m_approachSurfaces)
-    return (m_approachSurfaces);
+    return (m_approachSurfaces.get());
   // there's new surface given
   if (m_approachSurfaceArraySurface){
     Trk::Intersection asInter = m_approachSurfaceArraySurface->straightLineIntersection(pos,dir);
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/ConeLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/ConeLayer.cxx
index 6d3786aad2c9..40857a44af5d 100644
--- a/Tracking/TrkDetDescr/TrkGeometry/src/ConeLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/ConeLayer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -56,10 +56,9 @@ Trk::ConeLayer::ConeLayer(Amg::Transform3D* transform,
   Layer(surfaceArray, laymatprop, thickness, olap, laytyp)
 {}
 
-Trk::ConeLayer::ConeLayer(const Trk::ConeLayer& clay):
-  ConeSurface(clay),
-  Layer(clay)
-{}
+Trk::ConeLayer::ConeLayer(const Trk::ConeLayer& clay)
+  
+= default;
 
 Trk::ConeLayer::ConeLayer(const Trk::ConeLayer& clay, const Amg::Transform3D& transf):
   ConeSurface(clay,transf),
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/CylinderLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/CylinderLayer.cxx
index 49f3c982c8bb..8a46f927731b 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/CylinderLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/CylinderLayer.cxx
@@ -2,294 +2,288 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// CylinderLayer.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-// Trk
-#include "TrkGeometry/CylinderLayer.h"
-#include "TrkGeometry/LayerMaterialProperties.h"
-#include "TrkGeometry/MaterialProperties.h"
-#include "TrkGeometry/ApproachDescriptor.h"
-#include "TrkVolumes/CylinderVolumeBounds.h"
-#include "TrkSurfaces/CylinderBounds.h"
-#include "TrkParameters/TrackParameters.h"
-#include "TrkDetDescrUtils/BinUtility.h"
-// Amg
-#include "GeoPrimitives/GeoPrimitives.h"
-
-Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
-                                  Trk::CylinderBounds* cbounds,
-                                  const Trk::LayerMaterialProperties& laymatprop,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  int laytyp) :
-  CylinderSurface(transform, cbounds),
-  Layer(laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(nullptr)
-{
-  CylinderSurface::associateLayer(*this);
-}
-
-Trk::CylinderLayer::CylinderLayer(Trk::CylinderSurface* cyl,
-                                  const Trk::LayerMaterialProperties& laymatprop,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  int laytyp) :
-  CylinderSurface(*cyl),
-  Layer(laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(nullptr)
-{
-    CylinderSurface::associateLayer(*this);
-}
-        
-Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
-                                  Trk::CylinderBounds* cbounds,
-                                  Trk::SurfaceArray* surfaceArray,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  Trk::IApproachDescriptor* ades,
-                                  int laytyp) :
-  CylinderSurface(transform, cbounds),
-  Layer(surfaceArray, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    CylinderSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);
-    
-}
-                
-Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
-                                  Trk::CylinderBounds* cbounds,
-                                  Trk::SurfaceArray* surfaceArray,
-                                  const Trk::LayerMaterialProperties& laymatprop,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  Trk::IApproachDescriptor* ades,
-                                  int laytyp) :
-  CylinderSurface(transform, cbounds),
-  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    CylinderSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);
-    
-}
-
-Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
-                                  const Trk::LayerMaterialProperties& laymatprop,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  int laytyp) :
-  CylinderSurface(cbounds),
-  Layer(laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(nullptr)
-{
-    CylinderSurface::associateLayer(*this);
-}
-        
-Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
-                                  Trk::SurfaceArray* surfaceArray,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  Trk::IApproachDescriptor* ades,
-                                  int laytyp) :
-  CylinderSurface(cbounds),
-  Layer(surfaceArray, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    CylinderSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);  
-}
-                
-Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
-                                  Trk::SurfaceArray* surfaceArray,
-                                  const Trk::LayerMaterialProperties& laymatprop,
-                                  double thickness,
-                                  Trk::OverlapDescriptor* olap,
-                                  Trk::IApproachDescriptor* ades,
-                                  int laytyp) :
-  CylinderSurface(cbounds),
-  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    CylinderSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);    
-}
-
-Trk::CylinderLayer::CylinderLayer(const Trk::CylinderLayer& clay):
-  CylinderSurface(clay),
-  Layer(clay),
-  m_approachDescriptor(nullptr)
-{
-    CylinderSurface::associateLayer(*this);
-    delete m_approachDescriptor;
-    if (m_surfaceArray) buildApproachDescriptor(); //!< TODO use clone when exists
-}
-
-Trk::CylinderLayer::CylinderLayer(const Trk::CylinderLayer& clay, const Amg::Transform3D& transf):
-  CylinderSurface(clay,transf),
-  Layer(clay),
-  m_approachDescriptor(nullptr)
-{
-    if (m_surfaceArray) buildApproachDescriptor();
-}
-
-Trk::CylinderLayer& Trk::CylinderLayer::operator=(const CylinderLayer& clay)
-{
-  if (this!=&clay){
-    // call the assignments of the base classes
-    Trk::CylinderSurface::operator=(clay);
-    Trk::Layer::operator=(clay);
-    if (m_surfaceArray) buildApproachDescriptor(); 
-    CylinderSurface::associateLayer(*this); 
-  }
-  return(*this);
-}
-
-Trk::CylinderLayer::~CylinderLayer()
-{
-    delete m_approachDescriptor;
-}
- 
-    
-const Trk::CylinderSurface& Trk::CylinderLayer::surfaceRepresentation() const
-{
-  return (*this);
-}
-
-double Trk::CylinderLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                                   Trk::PropDirection dir) const
-{    
-    if (!Trk::Layer::m_layerMaterialProperties.get())
-      return 0.;
-    // calculate the direction to the normal 
-    const Amg::Vector3D& parmPos = parm.position();
-    Amg::Vector3D pastStep(parmPos + dir*parm.momentum().normalized());
-    if (pastStep.perp() > parm.position().perp())
-      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
-    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();
-}
-
-double Trk::CylinderLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                                    Trk::PropDirection dir) const 
-{
-   if (!Trk::Layer::m_layerMaterialProperties.get())
-      return 0;
-    const Amg::Vector3D& parmPos = parm.position();
-    Amg::Vector3D pastStep(parmPos + dir*parm.momentum().normalized());
-    if (pastStep.perp() > parm.position().perp())
-      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
-    return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
-}
-
-
-void Trk::CylinderLayer::moveLayer(Amg::Transform3D& shift) {
+///////////////////////////////////////////////////////////////////
+// CylinderLayer.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+// Trk
+#include "TrkGeometry/CylinderLayer.h"
+#include "TrkGeometry/LayerMaterialProperties.h"
+#include "TrkGeometry/MaterialProperties.h"
+#include "TrkGeometry/ApproachDescriptor.h"
+#include "TrkVolumes/CylinderVolumeBounds.h"
+#include "TrkSurfaces/CylinderBounds.h"
+#include "TrkParameters/TrackParameters.h"
+#include "TrkDetDescrUtils/BinUtility.h"
+// Amg
+#include "GeoPrimitives/GeoPrimitives.h"
+
+Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
+                                  Trk::CylinderBounds* cbounds,
+                                  const Trk::LayerMaterialProperties& laymatprop,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  int laytyp) :
+  CylinderSurface(transform, cbounds),
+  Layer(laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(nullptr)
+{
+  CylinderSurface::associateLayer(*this);
+}
+
+Trk::CylinderLayer::CylinderLayer(Trk::CylinderSurface* cyl,
+                                  const Trk::LayerMaterialProperties& laymatprop,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  int laytyp) :
+  CylinderSurface(*cyl),
+  Layer(laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(nullptr)
+{
+    CylinderSurface::associateLayer(*this);
+}
+        
+Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
+                                  Trk::CylinderBounds* cbounds,
+                                  Trk::SurfaceArray* surfaceArray,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  Trk::IApproachDescriptor* ades,
+                                  int laytyp) :
+  CylinderSurface(transform, cbounds),
+  Layer(surfaceArray, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    CylinderSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);
+    
+}
+                
+Trk::CylinderLayer::CylinderLayer(Amg::Transform3D* transform,
+                                  Trk::CylinderBounds* cbounds,
+                                  Trk::SurfaceArray* surfaceArray,
+                                  const Trk::LayerMaterialProperties& laymatprop,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  Trk::IApproachDescriptor* ades,
+                                  int laytyp) :
+  CylinderSurface(transform, cbounds),
+  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    CylinderSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);
+    
+}
+
+Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
+                                  const Trk::LayerMaterialProperties& laymatprop,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  int laytyp) :
+  CylinderSurface(cbounds),
+  Layer(laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(nullptr)
+{
+    CylinderSurface::associateLayer(*this);
+}
+        
+Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
+                                  Trk::SurfaceArray* surfaceArray,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  Trk::IApproachDescriptor* ades,
+                                  int laytyp) :
+  CylinderSurface(cbounds),
+  Layer(surfaceArray, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    CylinderSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);  
+}
+                
+Trk::CylinderLayer::CylinderLayer(Trk::CylinderBounds* cbounds,
+                                  Trk::SurfaceArray* surfaceArray,
+                                  const Trk::LayerMaterialProperties& laymatprop,
+                                  double thickness,
+                                  Trk::OverlapDescriptor* olap,
+                                  Trk::IApproachDescriptor* ades,
+                                  int laytyp) :
+  CylinderSurface(cbounds),
+  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    CylinderSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);    
+}
+
+Trk::CylinderLayer::CylinderLayer(const Trk::CylinderLayer& clay):
+  CylinderSurface(clay),
+  Layer(clay),
+  m_approachDescriptor(nullptr)
+{
+    CylinderSurface::associateLayer(*this);
+    m_approachDescriptor.reset();
+    if (m_surfaceArray) buildApproachDescriptor(); //!< TODO use clone when exists
+}
+
+Trk::CylinderLayer::CylinderLayer(const Trk::CylinderLayer& clay, const Amg::Transform3D& transf):
+  CylinderSurface(clay,transf),
+  Layer(clay),
+  m_approachDescriptor(nullptr)
+{
+    if (m_surfaceArray) buildApproachDescriptor();
+}
+
+Trk::CylinderLayer& Trk::CylinderLayer::operator=(const CylinderLayer& clay)
+{
+  if (this!=&clay){
+    // call the assignments of the base classes
+    Trk::CylinderSurface::operator=(clay);
+    Trk::Layer::operator=(clay);
+    if (m_surfaceArray) buildApproachDescriptor(); 
+    CylinderSurface::associateLayer(*this); 
+  }
+  return(*this);
+}
+
+    
+const Trk::CylinderSurface& Trk::CylinderLayer::surfaceRepresentation() const
+{
+  return (*this);
+}
+
+double Trk::CylinderLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                                   Trk::PropDirection dir) const
+{    
+    if (!Trk::Layer::m_layerMaterialProperties.get())
+      return 0.;
+    // calculate the direction to the normal 
+    const Amg::Vector3D& parmPos = parm.position();
+    Amg::Vector3D pastStep(parmPos + dir*parm.momentum().normalized());
+    if (pastStep.perp() > parm.position().perp())
+      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
+    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();
+}
+
+double Trk::CylinderLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                                    Trk::PropDirection dir) const 
+{
+   if (!Trk::Layer::m_layerMaterialProperties.get())
+      return 0;
+    const Amg::Vector3D& parmPos = parm.position();
+    Amg::Vector3D pastStep(parmPos + dir*parm.momentum().normalized());
+    if (pastStep.perp() > parm.position().perp())
+      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
+    return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
+}
+
+
+void Trk::CylinderLayer::moveLayer(Amg::Transform3D& shift) {
        Amg::Transform3D transf = shift * (*m_transform);
-       Trk::CylinderSurface::m_transform= std::make_unique<Amg::Transform3D>(transf);
-       m_center.store(std::make_unique<Amg::Vector3D>(m_transform->translation()));
-       m_normal.store(std::make_unique<Amg::Vector3D>(m_transform->rotation().col(2)));
-
-       if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
-           // build the new approach descriptor - deletes the current one
-           buildApproachDescriptor();
-       }
-}
-
-void Trk::CylinderLayer::resizeLayer(const VolumeBounds& bounds, double envelope) {
-    // only do this if the volume bounds a CylinderVolumeBounds
-    const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&bounds);
-    if (cvb){
-        // get the dimensions
-        double hLengthZ = cvb->halflengthZ();
-        double r        = surfaceRepresentation().bounds().r();
-        // (0) first, resize the layer itself
-        Trk::CylinderBounds* rCylinderBounds = new Trk::CylinderBounds(r,hLengthZ-envelope);
-        Trk::CylinderSurface::m_bounds = Trk::SharedObject<const Trk::CylinderBounds>(rCylinderBounds);
-        // (1) resize the material properties by updating the BinUtility, assuming rphi/z binning
-        if (Trk::Layer::m_layerMaterialProperties.get() ){
-            const BinUtility* layerMaterialBU = Trk::Layer::m_layerMaterialProperties->binUtility();
-            if (layerMaterialBU && layerMaterialBU->dimensions() > 1 ){
-                size_t binsRPhi = layerMaterialBU->max(0)+1;
-                size_t binsZ    = layerMaterialBU->max(1)+1;
-                // create a new binning with the new dimensions
-                Trk::BinUtility* rBinUtility = 
-                    new Trk::BinUtility(binsRPhi,-r*M_PI,r*M_PI, Trk::closed, Trk::binRPhi);
-                    (*rBinUtility) += Trk::BinUtility(binsZ, -hLengthZ+envelope, hLengthZ-envelope, Trk::open, Trk::binZ);
-                Trk::Layer::m_layerMaterialProperties->updateBinning(rBinUtility);
-            }
-        }
-    }
-    
-    if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
-        // build the approach descriptor - delete the current approach descriptor
-        buildApproachDescriptor();
-    }
-
-    
-}
-
-/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
-const Trk::Surface& Trk::CylinderLayer::approachSurface(const Amg::Vector3D& pos,
-                                                        const Amg::Vector3D& dir,
-                                                        const Trk::BoundaryCheck& bcheck) const
-{
-    if (m_approachDescriptor){
-        // get the test surfaces from the approach Descriptor
-        const Trk::ApproachSurfaces* surfacesOnApproach = m_approachDescriptor->approachSurfaces(pos,dir);
-        if (surfacesOnApproach){
-            // test the intersections and go 
-            std::vector<Trk::Intersection> sfIntersections;
-            const Trk::Surface* aSurface = nullptr;
-            double aPathLength           = 10e10;
-            // get the surfaces
-            for (auto& sfIter : (*surfacesOnApproach)){
-                // get the intersection with the surface
-                Trk::Intersection sIntersection = sfIter->straightLineIntersection(pos, dir, true, bcheck); 
-                // validation
-                if (sIntersection.valid && sIntersection.pathLength < aPathLength){
-                    aPathLength = sIntersection.pathLength;
-                    aSurface    = sfIter;
-                } 
-            } 
-            if (aSurface) return (*aSurface);
-        } 
-    }
-    return surfaceRepresentation();
-}
-
-/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
-const Trk::Surface& Trk::CylinderLayer::surfaceOnApproach(const Amg::Vector3D& pos,
-                                                          const Amg::Vector3D& mom,
-                                                          Trk::PropDirection pDir,
-                                                          const Trk::BoundaryCheck& bcheck,
-                                                          bool resolveSubSurfaces,
-                                                          const Trk::ICompatibilityEstimator*) const
-{ 
-    // resolve the surfaces
-    if (m_approachDescriptor && resolveSubSurfaces){
-        // resolve based on straight line intersection
-        return approachSurface(pos,double(pDir)*mom.unit(),bcheck);
-    }
-    return surfaceRepresentation();
-}
-
-
-
+       Trk::CylinderSurface::m_transform= std::make_unique<Amg::Transform3D>(transf);
+       m_center.store(std::make_unique<Amg::Vector3D>(m_transform->translation()));
+       m_normal.store(std::make_unique<Amg::Vector3D>(m_transform->rotation().col(2)));
+
+       if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
+           // build the new approach descriptor - deletes the current one
+           buildApproachDescriptor();
+       }
+}
+
+void Trk::CylinderLayer::resizeLayer(const VolumeBounds& bounds, double envelope) {
+    // only do this if the volume bounds a CylinderVolumeBounds
+    const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&bounds);
+    if (cvb){
+        // get the dimensions
+        double hLengthZ = cvb->halflengthZ();
+        double r        = surfaceRepresentation().bounds().r();
+        // (0) first, resize the layer itself
+        Trk::CylinderBounds* rCylinderBounds = new Trk::CylinderBounds(r,hLengthZ-envelope);
+        Trk::CylinderSurface::m_bounds = Trk::SharedObject<const Trk::CylinderBounds>(rCylinderBounds);
+        // (1) resize the material properties by updating the BinUtility, assuming rphi/z binning
+        if (Trk::Layer::m_layerMaterialProperties.get() ){
+            const BinUtility* layerMaterialBU = Trk::Layer::m_layerMaterialProperties->binUtility();
+            if (layerMaterialBU && layerMaterialBU->dimensions() > 1 ){
+                size_t binsRPhi = layerMaterialBU->max(0)+1;
+                size_t binsZ    = layerMaterialBU->max(1)+1;
+                // create a new binning with the new dimensions
+                Trk::BinUtility* rBinUtility = 
+                    new Trk::BinUtility(binsRPhi,-r*M_PI,r*M_PI, Trk::closed, Trk::binRPhi);
+                    (*rBinUtility) += Trk::BinUtility(binsZ, -hLengthZ+envelope, hLengthZ-envelope, Trk::open, Trk::binZ);
+                Trk::Layer::m_layerMaterialProperties->updateBinning(rBinUtility);
+            }
+        }
+    }
+    
+    if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
+        // build the approach descriptor - delete the current approach descriptor
+        buildApproachDescriptor();
+    }
+
+    
+}
+
+/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
+const Trk::Surface& Trk::CylinderLayer::approachSurface(const Amg::Vector3D& pos,
+                                                        const Amg::Vector3D& dir,
+                                                        const Trk::BoundaryCheck& bcheck) const
+{
+    if (m_approachDescriptor){
+        // get the test surfaces from the approach Descriptor
+        const Trk::ApproachSurfaces* surfacesOnApproach = m_approachDescriptor->approachSurfaces(pos,dir);
+        if (surfacesOnApproach){
+            // test the intersections and go 
+            std::vector<Trk::Intersection> sfIntersections;
+            const Trk::Surface* aSurface = nullptr;
+            double aPathLength           = 10e10;
+            // get the surfaces
+            for (auto& sfIter : (*surfacesOnApproach)){
+                // get the intersection with the surface
+                Trk::Intersection sIntersection = sfIter->straightLineIntersection(pos, dir, true, bcheck); 
+                // validation
+                if (sIntersection.valid && sIntersection.pathLength < aPathLength){
+                    aPathLength = sIntersection.pathLength;
+                    aSurface    = sfIter;
+                } 
+            } 
+            if (aSurface) return (*aSurface);
+        } 
+    }
+    return surfaceRepresentation();
+}
+
+/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
+const Trk::Surface& Trk::CylinderLayer::surfaceOnApproach(const Amg::Vector3D& pos,
+                                                          const Amg::Vector3D& mom,
+                                                          Trk::PropDirection pDir,
+                                                          const Trk::BoundaryCheck& bcheck,
+                                                          bool resolveSubSurfaces,
+                                                          const Trk::ICompatibilityEstimator*) const
+{ 
+    // resolve the surfaces
+    if (m_approachDescriptor && resolveSubSurfaces){
+        // resolve based on straight line intersection
+        return approachSurface(pos,double(pDir)*mom.unit(),bcheck);
+    }
+    return surfaceRepresentation();
+}
+
+
+
 /** build approach surfaces */
-void Trk::CylinderLayer::buildApproachDescriptor(){
-    // delete it
-    delete m_approachDescriptor;
+void Trk::CylinderLayer::buildApproachDescriptor(){
+    // delete it
     // delete the surfaces    
-    Trk::ApproachSurfaces* aSurfaces = new Trk::ApproachSurfaces;
+    auto  aSurfaces = std::make_unique<Trk::ApproachSurfaces>();
     // create new surfaces
     Amg::Transform3D* asTransform = m_transform ? new Amg::Transform3D(*m_transform) : nullptr;
     // create the new surfaces
@@ -300,7 +294,7 @@ void Trk::CylinderLayer::buildApproachDescriptor(){
         sIter->associateLayer(*this);
         sIter->setOwner(Trk::TGOwn);
     }
-    m_approachDescriptor = new Trk::ApproachDescriptor(aSurfaces);
+    m_approachDescriptor = std::make_unique<Trk::ApproachDescriptor>(std::move(aSurfaces));
     
 }
 
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/DiscLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/DiscLayer.cxx
index 3ee5bd861923..5350136ed628 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/DiscLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/DiscLayer.cxx
@@ -2,241 +2,238 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// DiscLayer.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-// Trk
-#include "TrkGeometry/DiscLayer.h"
-#include "TrkGeometry/LayerMaterialProperties.h"
-#include "TrkGeometry/MaterialProperties.h"
-#include "TrkGeometry/ApproachDescriptor.h"
-#include "TrkVolumes/CylinderVolumeBounds.h"
-#include "TrkSurfaces/DiscBounds.h"
-#include "TrkParameters/TrackParameters.h"
-#include "TrkDetDescrUtils/BinUtility.h"
-// CLHEP
-#include "GeoPrimitives/GeoPrimitives.h"
-
-Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
-                          Trk::DiscBounds* dbounds,
-                          const Trk::LayerMaterialProperties& laymatprop,
-                          double thickness,
-                          Trk::OverlapDescriptor* olap,
-                          int laytyp) :
-  DiscSurface(transform, dbounds),
-  Layer(laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(nullptr)
-{
-    DiscSurface::associateLayer(*this);
-}
-
-Trk::DiscLayer::DiscLayer(Trk::DiscSurface* disc,
-                          const Trk::LayerMaterialProperties& laymatprop,
-                          double thickness,
-                          Trk::OverlapDescriptor* olap,
-                          int laytyp) :
-  DiscSurface(*disc),
-  Layer(laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(nullptr)
-{
-    DiscSurface::associateLayer(*this);    
-}
-
-Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
-                          Trk::DiscBounds* dbounds,
-                          Trk::SurfaceArray* surfaceArray,
-                          double thickness,
-                          Trk::OverlapDescriptor* olap,
-                          Trk::IApproachDescriptor* ades,
-                          int laytyp) :
-  DiscSurface(transform, dbounds),
-  Layer(surfaceArray, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    DiscSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);
-    
-}
-                
-Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
-                          Trk::DiscBounds* dbounds,
-                          Trk::SurfaceArray* surfaceArray,
-                          const Trk::LayerMaterialProperties& laymatprop,
-                          double thickness,
-                          Trk::OverlapDescriptor* olap,
-                          Trk::IApproachDescriptor* ades,
-                          int laytyp) :
-  DiscSurface(transform, dbounds),
-  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
-  m_approachDescriptor(ades)
-{
-    DiscSurface::associateLayer(*this);
-    if (!ades && surfaceArray) buildApproachDescriptor();
-    // register the layer
-    if (ades) m_approachDescriptor->registerLayer(*this);
-}
-
-Trk::DiscLayer::DiscLayer(const Trk::DiscLayer& dlay):
-  DiscSurface(dlay),
-  Layer(dlay),
-  m_approachDescriptor(nullptr)
-{
-    DiscSurface::associateLayer(*this);
-    if (m_surfaceArray) buildApproachDescriptor();
-}
-
-Trk::DiscLayer::DiscLayer(const Trk::DiscLayer& dlay, const Amg::Transform3D& transf):
-  DiscSurface(dlay,transf),
-  Layer(dlay),
-  m_approachDescriptor(nullptr)
-{
-    DiscSurface::associateLayer(*this);
-    if (m_surfaceArray) buildApproachDescriptor();    
-}
-
-Trk::DiscLayer::~DiscLayer() {
-  delete m_approachDescriptor;
-}
-
-Trk::DiscLayer& Trk::DiscLayer::operator=(const DiscLayer& dlay)
-{
-  if (this!=&dlay){
-        // call the assignments of the base classes
-        Trk::DiscSurface::operator=(dlay);
-        Trk::Layer::operator=(dlay);
-        delete m_approachDescriptor;
-        if (m_surfaceArray) buildApproachDescriptor();
-        DiscSurface::associateLayer(*this);
-   }
-  return(*this);
-}
-    
-const Trk::DiscSurface& Trk::DiscLayer::surfaceRepresentation() const
-{
-  return (*this);
-}
-
-double Trk::DiscLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                               Trk::PropDirection dir) const
-{
-    if (!Trk::Layer::m_layerMaterialProperties.get())
-      return 0.;
-    //const Amg::Vector3D& parmPos = parm.position(); 
-    if (Trk::DiscSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
-      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
-    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();  
-}
-
-double Trk::DiscLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                                Trk::PropDirection dir) const 
-{
-   if (!Trk::Layer::m_layerMaterialProperties.get())
-     return 0.;
-   //const Amg::Vector3D& parmPos = parm.position(); 
-   if (Trk::DiscSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
-      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
-   return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
-}
-
-void Trk::DiscLayer::moveLayer(Amg::Transform3D& shift)  {
+///////////////////////////////////////////////////////////////////
+// DiscLayer.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+// Trk
+#include "TrkGeometry/DiscLayer.h"
+#include "TrkGeometry/LayerMaterialProperties.h"
+#include "TrkGeometry/MaterialProperties.h"
+#include "TrkVolumes/CylinderVolumeBounds.h"
+#include "TrkSurfaces/DiscBounds.h"
+#include "TrkParameters/TrackParameters.h"
+#include "TrkDetDescrUtils/BinUtility.h"
+// CLHEP
+#include "GeoPrimitives/GeoPrimitives.h"
+
+Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
+                          Trk::DiscBounds* dbounds,
+                          const Trk::LayerMaterialProperties& laymatprop,
+                          double thickness,
+                          Trk::OverlapDescriptor* olap,
+                          int laytyp) :
+  DiscSurface(transform, dbounds),
+  Layer(laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(nullptr)
+{
+    DiscSurface::associateLayer(*this);
+}
+
+Trk::DiscLayer::DiscLayer(Trk::DiscSurface* disc,
+                          const Trk::LayerMaterialProperties& laymatprop,
+                          double thickness,
+                          Trk::OverlapDescriptor* olap,
+                          int laytyp) :
+  DiscSurface(*disc),
+  Layer(laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(nullptr)
+{
+    DiscSurface::associateLayer(*this);    
+}
+
+Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
+                          Trk::DiscBounds* dbounds,
+                          Trk::SurfaceArray* surfaceArray,
+                          double thickness,
+                          Trk::OverlapDescriptor* olap,
+                          Trk::IApproachDescriptor* ades,
+                          int laytyp) :
+  DiscSurface(transform, dbounds),
+  Layer(surfaceArray, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    DiscSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);
+    
+}
+                
+Trk::DiscLayer::DiscLayer(Amg::Transform3D* transform,
+                          Trk::DiscBounds* dbounds,
+                          Trk::SurfaceArray* surfaceArray,
+                          const Trk::LayerMaterialProperties& laymatprop,
+                          double thickness,
+                          Trk::OverlapDescriptor* olap,
+                          Trk::IApproachDescriptor* ades,
+                          int laytyp) :
+  DiscSurface(transform, dbounds),
+  Layer(surfaceArray, laymatprop, thickness, olap, laytyp),
+  m_approachDescriptor(ades)
+{
+    DiscSurface::associateLayer(*this);
+    if (!ades && surfaceArray) buildApproachDescriptor();
+    // register the layer
+    if (ades) m_approachDescriptor->registerLayer(*this);
+}
+
+Trk::DiscLayer::DiscLayer(const Trk::DiscLayer& dlay):
+  DiscSurface(dlay),
+  Layer(dlay),
+  m_approachDescriptor(nullptr)
+{
+    DiscSurface::associateLayer(*this);
+    if (m_surfaceArray) buildApproachDescriptor();
+}
+
+Trk::DiscLayer::DiscLayer(const Trk::DiscLayer& dlay, const Amg::Transform3D& transf):
+  DiscSurface(dlay,transf),
+  Layer(dlay),
+  m_approachDescriptor(nullptr)
+{
+    DiscSurface::associateLayer(*this);
+    if (m_surfaceArray) buildApproachDescriptor();    
+}
+
+Trk::DiscLayer& Trk::DiscLayer::operator=(const DiscLayer& dlay)
+{
+  if (this!=&dlay){
+        // call the assignments of the base classes
+        Trk::DiscSurface::operator=(dlay);
+        Trk::Layer::operator=(dlay);
+        m_approachDescriptor.reset();
+        if (m_surfaceArray) {
+          buildApproachDescriptor();
+        }
+        DiscSurface::associateLayer(*this);
+   }
+  return(*this);
+}
+    
+const Trk::DiscSurface& Trk::DiscLayer::surfaceRepresentation() const
+{
+  return (*this);
+}
+
+double Trk::DiscLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                               Trk::PropDirection dir) const
+{
+    if (!Trk::Layer::m_layerMaterialProperties.get())
+      return 0.;
+    //const Amg::Vector3D& parmPos = parm.position(); 
+    if (Trk::DiscSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
+      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
+    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();  
+}
+
+double Trk::DiscLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                                Trk::PropDirection dir) const 
+{
+   if (!Trk::Layer::m_layerMaterialProperties.get())
+     return 0.;
+   //const Amg::Vector3D& parmPos = parm.position(); 
+   if (Trk::DiscSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
+      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
+   return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
+}
+
+void Trk::DiscLayer::moveLayer(Amg::Transform3D& shift)  {
        
-       Amg::Transform3D transf = shift * (*m_transform);
-       m_transform=std::make_unique<Amg::Transform3D>(transf);
-       m_center.store(std::make_unique<Amg::Vector3D>(m_transform->translation()));
-       m_normal.store(std::make_unique<Amg::Vector3D>(m_transform->rotation().col(2)));
-       // rebuild that - deletes the current one
-       if (m_approachDescriptor &&  m_approachDescriptor->rebuild()) 
-           buildApproachDescriptor();       
-}
-
-void Trk::DiscLayer::resizeLayer(const VolumeBounds& bounds, double envelope)  {
-   // only do this if the volume bounds a CylinderVolumeBounds
-    const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&bounds);
-    if (cvb){
-        // get the dimensions
-        double rInner = cvb->innerRadius();
-        double rOuter = cvb->outerRadius();
-        // (0) first, resize the layer itself
-        Trk::DiscBounds* rDiscBounds = new Trk::DiscBounds(rInner+envelope,rOuter-envelope);
-        Trk::DiscSurface::m_bounds = Trk::SharedObject<const Trk::SurfaceBounds>(rDiscBounds);
-        // (1) resize the material properties by updating the BinUtility, assuming r/phi binning
-        if (Trk::Layer::m_layerMaterialProperties.get() ){
-            const BinUtility* layerMaterialBU = Trk::Layer::m_layerMaterialProperties->binUtility();
-            if (layerMaterialBU && layerMaterialBU->binningValue(0) == Trk::binR ){
-                size_t binsR = layerMaterialBU->max(0)+1;
-                // create a new binning with the new dimensions
-                Trk::BinUtility* rBinUtility = 
-                    new Trk::BinUtility(binsR,rInner+envelope,rOuter-envelope, Trk::open, Trk::binR);
-                // copy the second dimension over if exist
-                if (layerMaterialBU->dimensions()>1){
-                    (*rBinUtility) += Trk::BinUtility(layerMaterialBU->max(1)+1, -M_PI, M_PI, Trk::closed, Trk::binPhi);
-                }
-                Trk::Layer::m_layerMaterialProperties->updateBinning(rBinUtility);
-            }
-        }
-    }
-
-    if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
-        // rebuild the approach descriptor - delete the current approach descriptor
-        buildApproachDescriptor();
-    }
-    
-}
-
-/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
-const Trk::Surface& Trk::DiscLayer::approachSurface(const Amg::Vector3D& pos,
-                                                    const Amg::Vector3D& dir,
-                                                    const Trk::BoundaryCheck& bcheck) const
-{
-    if (m_approachDescriptor){
-        // get the test surfaces from the approach Descriptor
-        const Trk::ApproachSurfaces* surfacesOnApproach = m_approachDescriptor->approachSurfaces(pos,dir);
-        if (surfacesOnApproach){
-            // test the intersections and go
-            std::vector<Trk::Intersection> sfIntersections;
-            const Trk::Surface* aSurface = nullptr;
-            double aPathLength           = 10e10;
-            //!< @TODO -> optimise by breaking the loop if possible
-            for (auto& sfIter : (*surfacesOnApproach)){
-                // get the intersection with the surface
-                Trk::Intersection sIntersection = sfIter->straightLineIntersection(pos, dir, true, bcheck); 
-                // validation
-                if (sIntersection.valid && sIntersection.pathLength < aPathLength){
-                    aPathLength = sIntersection.pathLength;
-                    aSurface    = sfIter;
-                }   
-            } 
-            if (aSurface) return (*aSurface);
-        } 
-    }
-    return surfaceRepresentation();
-}
-
-/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
-const Trk::Surface& Trk::DiscLayer::surfaceOnApproach(const Amg::Vector3D& pos,
-                                                      const Amg::Vector3D& mom,
-                                                      Trk::PropDirection pDir,
-                                                      const Trk::BoundaryCheck& bcheck,
-                                                      bool resolveSubSurfaces,
-                                                      const Trk::ICompatibilityEstimator*) const
-{ 
-    // resolve the surfaces
-    if (m_approachDescriptor && resolveSubSurfaces){
-        // resolve based on straight line intersection
-        return approachSurface(pos,double(pDir)*mom.unit(),bcheck);
-    }
-    return surfaceRepresentation();
-}
-
+       Amg::Transform3D transf = shift * (*m_transform);
+       m_transform=std::make_unique<Amg::Transform3D>(transf);
+       m_center.store(std::make_unique<Amg::Vector3D>(m_transform->translation()));
+       m_normal.store(std::make_unique<Amg::Vector3D>(m_transform->rotation().col(2)));
+       // rebuild that - deletes the current one
+       if (m_approachDescriptor &&  m_approachDescriptor->rebuild()) {
+         buildApproachDescriptor();
+       }
+}
+
+void Trk::DiscLayer::resizeLayer(const VolumeBounds& bounds, double envelope)  {
+   // only do this if the volume bounds a CylinderVolumeBounds
+    const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&bounds);
+    if (cvb){
+        // get the dimensions
+        double rInner = cvb->innerRadius();
+        double rOuter = cvb->outerRadius();
+        // (0) first, resize the layer itself
+        Trk::DiscBounds* rDiscBounds = new Trk::DiscBounds(rInner+envelope,rOuter-envelope);
+        Trk::DiscSurface::m_bounds = Trk::SharedObject<const Trk::SurfaceBounds>(rDiscBounds);
+        // (1) resize the material properties by updating the BinUtility, assuming r/phi binning
+        if (Trk::Layer::m_layerMaterialProperties.get() ){
+            const BinUtility* layerMaterialBU = Trk::Layer::m_layerMaterialProperties->binUtility();
+            if (layerMaterialBU && layerMaterialBU->binningValue(0) == Trk::binR ){
+                size_t binsR = layerMaterialBU->max(0)+1;
+                // create a new binning with the new dimensions
+                Trk::BinUtility* rBinUtility = 
+                    new Trk::BinUtility(binsR,rInner+envelope,rOuter-envelope, Trk::open, Trk::binR);
+                // copy the second dimension over if exist
+                if (layerMaterialBU->dimensions()>1){
+                    (*rBinUtility) += Trk::BinUtility(layerMaterialBU->max(1)+1, -M_PI, M_PI, Trk::closed, Trk::binPhi);
+                }
+                Trk::Layer::m_layerMaterialProperties->updateBinning(rBinUtility);
+            }
+        }
+    }
+
+    if (m_approachDescriptor &&  m_approachDescriptor->rebuild()){
+        // rebuild the approach descriptor - delete the current approach descriptor
+        buildApproachDescriptor();
+    }
+    
+}
+
+/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
+const Trk::Surface& Trk::DiscLayer::approachSurface(const Amg::Vector3D& pos,
+                                                    const Amg::Vector3D& dir,
+                                                    const Trk::BoundaryCheck& bcheck) const
+{
+    if (m_approachDescriptor){
+        // get the test surfaces from the approach Descriptor
+        const Trk::ApproachSurfaces* surfacesOnApproach = m_approachDescriptor->approachSurfaces(pos,dir);
+        if (surfacesOnApproach){
+            // test the intersections and go
+            std::vector<Trk::Intersection> sfIntersections;
+            const Trk::Surface* aSurface = nullptr;
+            double aPathLength           = 10e10;
+            //!< @TODO -> optimise by breaking the loop if possible
+            for (auto& sfIter : (*surfacesOnApproach)){
+                // get the intersection with the surface
+                Trk::Intersection sIntersection = sfIter->straightLineIntersection(pos, dir, true, bcheck); 
+                // validation
+                if (sIntersection.valid && sIntersection.pathLength < aPathLength){
+                    aPathLength = sIntersection.pathLength;
+                    aSurface    = sfIter;
+                }   
+            } 
+            if (aSurface) return (*aSurface);
+        } 
+    }
+    return surfaceRepresentation();
+}
+
+/** Surface seen on approach - if not defined differently, it is the surfaceRepresentation() */
+const Trk::Surface& Trk::DiscLayer::surfaceOnApproach(const Amg::Vector3D& pos,
+                                                      const Amg::Vector3D& mom,
+                                                      Trk::PropDirection pDir,
+                                                      const Trk::BoundaryCheck& bcheck,
+                                                      bool resolveSubSurfaces,
+                                                      const Trk::ICompatibilityEstimator*) const
+{ 
+    // resolve the surfaces
+    if (m_approachDescriptor && resolveSubSurfaces){
+        // resolve based on straight line intersection
+        return approachSurface(pos,double(pDir)*mom.unit(),bcheck);
+    }
+    return surfaceRepresentation();
+}
+
 /** build approach surfaces */
 void Trk::DiscLayer::buildApproachDescriptor(){
-    // delete the current approach descriptor
-    delete m_approachDescriptor;
+
     // create the surface container   
-    Trk::ApproachSurfaces* aSurfaces = new Trk::ApproachSurfaces;
+    auto aSurfaces = std::make_unique<Trk::ApproachSurfaces>();
     // get the center
     const auto halfThickness=0.5*thickness()*normal();
     const Amg::Vector3D aspPosition(center()+halfThickness);
@@ -255,7 +252,8 @@ void Trk::DiscLayer::buildApproachDescriptor(){
             sIter->setOwner(Trk::TGOwn);
         }
     }
-    m_approachDescriptor = new Trk::ApproachDescriptor(aSurfaces);
+    //The approach descriptor takes owneship
+    m_approachDescriptor = std::make_unique<Trk::ApproachDescriptor>(std::move(aSurfaces));
 }
 
 void Trk::DiscLayer::resizeAndRepositionLayer(const VolumeBounds& vBounds, const Amg::Vector3D& vCenter, double envelope)  {
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/HomogeneousLayerMaterial.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/HomogeneousLayerMaterial.cxx
index d778cf91d314..a7103fc54919 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/HomogeneousLayerMaterial.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/HomogeneousLayerMaterial.cxx
@@ -26,7 +26,7 @@ Trk::HomogeneousLayerMaterial::HomogeneousLayerMaterial(const Trk::HomogeneousLa
 {}
 
 Trk::HomogeneousLayerMaterial::~HomogeneousLayerMaterial()
-{}
+= default;
 
 
 Trk::HomogeneousLayerMaterial& Trk::HomogeneousLayerMaterial::operator=(const Trk::HomogeneousLayerMaterial& lmp)
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialLayer.cxx
index f36c9f516e83..537fe8e5f2a1 100644
--- a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialLayer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ Trk::MaterialLayer::MaterialLayer(const Trk::MaterialLayer& lay):
 
 // destructor 
 Trk::MaterialLayer::~MaterialLayer()
-{} 
+= default; 
 
 Trk::MaterialLayer& Trk::MaterialLayer::operator =(const Trk::MaterialLayer& lay)
 {
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialProperties.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialProperties.cxx
index 15d62b956253..5b4ddede34eb 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialProperties.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialProperties.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -39,12 +39,9 @@ Trk::MaterialProperties::MaterialProperties(const Trk::Material& material, float
   m_zOaTrTd( material.A*material.A > 10e-10  ? path*material.Z/material.A*material.rho : 0.)
 {}
 
-Trk::MaterialProperties::MaterialProperties(const Trk::MaterialProperties& mprop) :
-  m_material(mprop.m_material),
-  m_dInX0(mprop.m_dInX0),
-  m_dInL0(mprop.m_dInL0),  
-  m_zOaTrTd(mprop.m_zOaTrTd)  
-{}
+Trk::MaterialProperties::MaterialProperties(const Trk::MaterialProperties& mprop)   
+   
+= default;
 
 
 Trk::MaterialProperties* Trk::MaterialProperties::clone() const 
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialStep.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialStep.cxx
index 16f489f73fc2..39e3a36e97dc 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/MaterialStep.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/MaterialStep.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -59,16 +59,12 @@ Trk::MaterialStep::MaterialStep(
     {}
 
 Trk::MaterialStep::MaterialStep(const MaterialStep& mstep)
-    : m_steplength(mstep.m_steplength),
-    m_hitX(mstep.m_hitX),
-    m_hitY(mstep.m_hitY),
-    m_hitZ(mstep.m_hitZ),
-    m_hitR(mstep.m_hitR),
-    m_material(mstep.m_material)
+    
+    
 
-    {}
+    = default;
 
-Trk::MaterialStep::~MaterialStep() {}
+Trk::MaterialStep::~MaterialStep() = default;
 
 Trk::MaterialStep& Trk::MaterialStep::operator =( const Trk::MaterialStep& mstep ) 
 {
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/PlaneLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/PlaneLayer.cxx
index 3e1fef12cb9d..3dfeb027b27e 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/PlaneLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/PlaneLayer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -136,10 +136,9 @@ Trk::PlaneLayer::PlaneLayer(Amg::Transform3D* transform,
   Layer(surfaceArray, laymatprop, thickness, olap, laytyp)
 {}
 
-Trk::PlaneLayer::PlaneLayer(const Trk::PlaneLayer& play):
-  PlaneSurface(play),
-  Layer(play)
-{}
+Trk::PlaneLayer::PlaneLayer(const Trk::PlaneLayer& play)
+  
+= default;
 
 Trk::PlaneLayer::PlaneLayer(const Trk::PlaneLayer& play, const Amg::Transform3D& transf):
   PlaneSurface(play, transf),
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedCylinderLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedCylinderLayer.cxx
index 1baa90d8d372..06a000589c5e 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedCylinderLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedCylinderLayer.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -24,10 +24,9 @@ Trk::SubtractedCylinderLayer::SubtractedCylinderLayer(const Trk::SubtractedCylin
   Layer(laymatprop, thickness, olap, laytyp)
 {}
 
-Trk::SubtractedCylinderLayer::SubtractedCylinderLayer(const Trk::SubtractedCylinderLayer& clay):
-  SubtractedCylinderSurface(clay),
-  Layer(clay)
-{}
+Trk::SubtractedCylinderLayer::SubtractedCylinderLayer(const Trk::SubtractedCylinderLayer& clay)
+  
+= default;
 
 Trk::SubtractedCylinderLayer::SubtractedCylinderLayer(const Trk::SubtractedCylinderLayer& clay, const Amg::Transform3D& transf):
   SubtractedCylinderSurface(clay, transf),
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedPlaneLayer.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedPlaneLayer.cxx
index 635afffcea5a..81bccc44a77d 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedPlaneLayer.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/SubtractedPlaneLayer.cxx
@@ -1,76 +1,75 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// SubtractedPlaneLayer.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-// Trk
-#include "TrkGeometry/SubtractedPlaneLayer.h"
-#include "TrkGeometry/LayerMaterialProperties.h"
-#include "TrkGeometry/MaterialProperties.h"
-#include "TrkParameters/TrackParameters.h"
-// CLHEP
-#include "GeoPrimitives/GeoPrimitives.h"
-
-Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const SubtractedPlaneSurface* subtrPlaneSurf,
-                            const Trk::LayerMaterialProperties& laymatprop,
-                            double thickness,
-                            Trk::OverlapDescriptor* olap,
-                            int laytyp) :
-  SubtractedPlaneSurface(*subtrPlaneSurf),
-  Layer(laymatprop, thickness, olap, laytyp) 
-{}
-  
-Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const Trk::SubtractedPlaneLayer& play):
-  SubtractedPlaneSurface(play),
-  Layer(play)
-{}
-
-Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const Trk::SubtractedPlaneLayer& play, const Amg::Transform3D& transf):
-  SubtractedPlaneSurface(play,transf),
-  Layer(play)
-{}
-
-Trk::SubtractedPlaneLayer& Trk::SubtractedPlaneLayer::operator=(const SubtractedPlaneLayer& play)
-{
-  if (this!=&play){
-   // call the assignments of the base classes
-   Trk::SubtractedPlaneSurface::operator=(play);
-   Trk::Layer::operator=(play);
-  }
-  return(*this);
-}
-        
-const Trk::SubtractedPlaneSurface& Trk::SubtractedPlaneLayer::surfaceRepresentation() const
-{
-  return (*this);
-}
-
-double Trk::SubtractedPlaneLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                                          Trk::PropDirection dir) const
-{
-    if (!Trk::Layer::m_layerMaterialProperties.get())
-      return 0.;
-    if (Trk::SubtractedPlaneSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
-      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
-    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();  
-}
-
-double Trk::SubtractedPlaneLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
-                                                 Trk::PropDirection dir) const 
-{
-    if (!Trk::Layer::m_layerMaterialProperties.get())
-      return 0.;
-    if (Trk::SubtractedPlaneSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
-      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
-    return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
-}
-
-void Trk::SubtractedPlaneLayer::moveLayer(Amg::Transform3D& shift)  {
+///////////////////////////////////////////////////////////////////
+// SubtractedPlaneLayer.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+// Trk
+#include "TrkGeometry/SubtractedPlaneLayer.h"
+#include "TrkGeometry/LayerMaterialProperties.h"
+#include "TrkGeometry/MaterialProperties.h"
+#include "TrkParameters/TrackParameters.h"
+// CLHEP
+#include "GeoPrimitives/GeoPrimitives.h"
+
+Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const SubtractedPlaneSurface* subtrPlaneSurf,
+                            const Trk::LayerMaterialProperties& laymatprop,
+                            double thickness,
+                            Trk::OverlapDescriptor* olap,
+                            int laytyp) :
+  SubtractedPlaneSurface(*subtrPlaneSurf),
+  Layer(laymatprop, thickness, olap, laytyp) 
+{}
+  
+Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const Trk::SubtractedPlaneLayer& play)
+  
+= default;
+
+Trk::SubtractedPlaneLayer::SubtractedPlaneLayer(const Trk::SubtractedPlaneLayer& play, const Amg::Transform3D& transf):
+  SubtractedPlaneSurface(play,transf),
+  Layer(play)
+{}
+
+Trk::SubtractedPlaneLayer& Trk::SubtractedPlaneLayer::operator=(const SubtractedPlaneLayer& play)
+{
+  if (this!=&play){
+   // call the assignments of the base classes
+   Trk::SubtractedPlaneSurface::operator=(play);
+   Trk::Layer::operator=(play);
+  }
+  return(*this);
+}
+        
+const Trk::SubtractedPlaneSurface& Trk::SubtractedPlaneLayer::surfaceRepresentation() const
+{
+  return (*this);
+}
+
+double Trk::SubtractedPlaneLayer::preUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                                          Trk::PropDirection dir) const
+{
+    if (!Trk::Layer::m_layerMaterialProperties.get())
+      return 0.;
+    if (Trk::SubtractedPlaneSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
+      return Trk::Layer::m_layerMaterialProperties->alongPreFactor();
+    return   Trk::Layer::m_layerMaterialProperties->oppositePreFactor();  
+}
+
+double Trk::SubtractedPlaneLayer::postUpdateMaterialFactor(const Trk::TrackParameters& parm,
+                                                 Trk::PropDirection dir) const 
+{
+    if (!Trk::Layer::m_layerMaterialProperties.get())
+      return 0.;
+    if (Trk::SubtractedPlaneSurface::normal().dot(dir*parm.momentum().normalized()) > 0. )
+      return Trk::Layer::m_layerMaterialProperties->alongPostFactor();
+    return   Trk::Layer::m_layerMaterialProperties->oppositePostFactor();
+}
+
+void Trk::SubtractedPlaneLayer::moveLayer(Amg::Transform3D& shift)  {
       Amg::Transform3D transf = shift * (*m_transform);
       m_transform=std::make_unique<Amg::Transform3D>(transf);
       m_center.store(std::make_unique<Amg::Vector3D>(m_transform->translation()));
       m_normal.store(std::make_unique<Amg::Vector3D>(m_transform->rotation().col(2)));
-}
+}
diff --git a/Tracking/TrkDetDescr/TrkGeometry/src/TrackingVolume.cxx b/Tracking/TrkDetDescr/TrkGeometry/src/TrackingVolume.cxx
index 5be02d921779..673b66f310f0 100755
--- a/Tracking/TrkDetDescr/TrkGeometry/src/TrackingVolume.cxx
+++ b/Tracking/TrkDetDescr/TrkGeometry/src/TrackingVolume.cxx
@@ -895,10 +895,14 @@ void Trk::TrackingVolume::createBoundarySurfaces ATLAS_NOT_THREAD_SAFE ()
 	            m_boundarySurfaces->push_back(Trk::SharedObject<const Trk::BoundarySurface<Trk::TrackingVolume> >
 				      (new Trk::BoundarySubtractedPlaneSurface<Trk::TrackingVolume>(in, out, *spsf)));    
 	    delete spsf; continue;
-      } else if (psf){ m_boundarySurfaces->push_back(Trk::SharedObject<const Trk::BoundarySurface<Trk::TrackingVolume> >
-                                      (new Trk::BoundaryPlaneSurface<Trk::TrackingVolume>(in, out, *psf)));    
-                     delete psf; continue;
-      }        
+      }
+      if (psf) {
+        m_boundarySurfaces->push_back(
+          Trk::SharedObject<const Trk::BoundarySurface<Trk::TrackingVolume>>(
+            new Trk::BoundaryPlaneSurface<Trk::TrackingVolume>(in, out, *psf)));
+        delete psf;
+        continue;
+      }
 
       const Trk::DiscSurface*       dsf = dynamic_cast<const Trk::DiscSurface*>(*surfIter);
       if (dsf) {
@@ -915,13 +919,18 @@ void Trk::TrackingVolume::createBoundarySurfaces ATLAS_NOT_THREAD_SAFE ()
           m_boundarySurfaces->push_back(Trk::SharedObject<const Trk::BoundarySurface< Trk::TrackingVolume> >
             (new Trk::BoundarySubtractedCylinderSurface<Trk::TrackingVolume>(inner, outer, *scsf)));
           delete scsf; continue;
-      } else if (csf) {
-          Trk::TrackingVolume* inner = (sfCounter == 4 && sfNumber > 3) ? nullptr : this;
-          Trk::TrackingVolume* outer = (inner) ? nullptr : this;
-          m_boundarySurfaces->push_back(Trk::SharedObject<const Trk::BoundarySurface< Trk::TrackingVolume> >
-            (new Trk::BoundaryCylinderSurface<Trk::TrackingVolume>(inner, outer, *csf)));
-          delete csf; continue;
-      } 
+      }
+      if (csf) {
+        Trk::TrackingVolume* inner =
+          (sfCounter == 4 && sfNumber > 3) ? nullptr : this;
+        Trk::TrackingVolume* outer = (inner) ? nullptr : this;
+        m_boundarySurfaces->push_back(
+          Trk::SharedObject<const Trk::BoundarySurface<Trk::TrackingVolume>>(
+            new Trk::BoundaryCylinderSurface<Trk::TrackingVolume>(
+              inner, outer, *csf)));
+        delete csf;
+        continue;
+      }
     }
 
   } else {
-- 
GitLab


From 072bb9d3ffdffd5ec9da00130c19c55b8822ab70 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Thu, 9 Jul 2020 12:55:42 +0200
Subject: [PATCH 179/217] LArHV: cmake fixes and rename files

Update link dependencies, i.e. remove IOVSvcLib that was not needed and
this packages was the only client of that library.

Also rename `.cpp` files to `.cxx` to follow our naming convention.
---
 .../LArGeoModel/LArHV/CMakeLists.txt          | 28 ++++---------------
 ...MBHVDescriptor.cpp => EMBHVDescriptor.cxx} |  0
 ...{EMBHVElectrode.cpp => EMBHVElectrode.cxx} |  0
 .../{EMBHVManager.cpp => EMBHVManager.cxx}    |  0
 .../src/{EMBHVModule.cpp => EMBHVModule.cxx}  |  0
 ...ptor.cpp => EMBPresamplerHVDescriptor.cxx} |  0
 ...Manager.cpp => EMBPresamplerHVManager.cxx} |  0
 ...HVModule.cpp => EMBPresamplerHVModule.cxx} |  0
 ...CHVDescriptor.cpp => EMECHVDescriptor.cxx} |  0
 ...MECHVElectrode.cpp => EMECHVElectrode.cxx} |  0
 .../{EMECHVManager.cpp => EMECHVManager.cxx}  |  0
 .../{EMECHVModule.cpp => EMECHVModule.cxx}    |  0
 ...anager.cpp => EMECPresamplerHVManager.cxx} |  0
 ...VModule.cpp => EMECPresamplerHVModule.cxx} |  0
 .../src/{FCALHVLine.cpp => FCALHVLine.cxx}    |  0
 .../{FCALHVManager.cpp => FCALHVManager.cxx}  |  0
 .../{FCALHVModule.cpp => FCALHVModule.cxx}    |  0
 ...ECHVDescriptor.cpp => HECHVDescriptor.cxx} |  0
 .../{HECHVManager.cpp => HECHVManager.cxx}    |  0
 .../src/{HECHVModule.cpp => HECHVModule.cxx}  |  0
 .../src/{HECHVSubgap.cpp => HECHVSubgap.cxx}  |  0
 .../{LArHVManager.cpp => LArHVManager.cxx}    |  0
 22 files changed, 5 insertions(+), 23 deletions(-)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBHVDescriptor.cpp => EMBHVDescriptor.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBHVElectrode.cpp => EMBHVElectrode.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBHVManager.cpp => EMBHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBHVModule.cpp => EMBHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBPresamplerHVDescriptor.cpp => EMBPresamplerHVDescriptor.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBPresamplerHVManager.cpp => EMBPresamplerHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMBPresamplerHVModule.cpp => EMBPresamplerHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECHVDescriptor.cpp => EMECHVDescriptor.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECHVElectrode.cpp => EMECHVElectrode.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECHVManager.cpp => EMECHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECHVModule.cpp => EMECHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECPresamplerHVManager.cpp => EMECPresamplerHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{EMECPresamplerHVModule.cpp => EMECPresamplerHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{FCALHVLine.cpp => FCALHVLine.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{FCALHVManager.cpp => FCALHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{FCALHVModule.cpp => FCALHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{HECHVDescriptor.cpp => HECHVDescriptor.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{HECHVManager.cpp => HECHVManager.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{HECHVModule.cpp => HECHVModule.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{HECHVSubgap.cpp => HECHVSubgap.cxx} (100%)
 rename LArCalorimeter/LArGeoModel/LArHV/src/{LArHVManager.cpp => LArHVManager.cxx} (100%)

diff --git a/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt b/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt
index b0ca66d7d24c..f01262e5faad 100644
--- a/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt
+++ b/LArCalorimeter/LArGeoModel/LArHV/CMakeLists.txt
@@ -1,39 +1,21 @@
-################################################################################
-# Package: LArHV
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LArHV )
 
 # Possible extra dependencies:
-set( extra_dep )
 set( extra_lib )
 if( NOT SIMULATIONBASE AND NOT GENERATIONBASE )
-   set( extra_dep LArCalorimeter/LArRecConditions )
    set( extra_lib LArRecConditions )
 endif()
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaKernel
-                          Control/IOVSvc
-                          Control/StoreGate
-                          PRIVATE
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          DetectorDescription/Identifier
-                          GaudiKernel
-                          LArCalorimeter/LArCabling
-                          LArCalorimeter/LArIdentifier
-                          ${extra_dep} )
-
 # External dependencies:
 find_package( GeoModelCore )
 
 # Component(s) in the package:
 atlas_add_library( LArHV
-                   src/*.cpp
+                   src/*.cxx
                    PUBLIC_HEADERS LArHV
-		   INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel IOVSvcLib StoreGateLib SGtests LArCablingLib ${extra_lib}
-                   PRIVATE_LINK_LIBRARIES AthenaPoolUtilities Identifier GaudiKernel LArIdentifier )
-
+                   INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS}
+                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel
+                   PRIVATE_LINK_LIBRARIES AthenaPoolUtilities GaudiKernel Identifier LArCablingLib LArIdentifier StoreGateLib ${extra_lib} )
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVDescriptor.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVDescriptor.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBHVDescriptor.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBHVDescriptor.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVElectrode.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVElectrode.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBHVElectrode.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBHVElectrode.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVDescriptor.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVDescriptor.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVDescriptor.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVDescriptor.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVDescriptor.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVDescriptor.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECHVDescriptor.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECHVDescriptor.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVElectrode.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVElectrode.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECHVElectrode.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECHVElectrode.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVLine.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVLine.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/FCALHVLine.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/FCALHVLine.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/FCALHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/FCALHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVDescriptor.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVDescriptor.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/HECHVDescriptor.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/HECHVDescriptor.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVModule.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVModule.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/HECHVModule.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/HECHVModule.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVSubgap.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVSubgap.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/HECHVSubgap.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/HECHVSubgap.cxx
diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/LArHVManager.cpp b/LArCalorimeter/LArGeoModel/LArHV/src/LArHVManager.cxx
similarity index 100%
rename from LArCalorimeter/LArGeoModel/LArHV/src/LArHVManager.cpp
rename to LArCalorimeter/LArGeoModel/LArHV/src/LArHVManager.cxx
-- 
GitLab


From 1fba859ff17136eed744f9a7c228321458c6a399 Mon Sep 17 00:00:00 2001
From: James Richard Catmore <james.catmore@cern.ch>
Date: Thu, 9 Jul 2020 13:38:56 +0200
Subject: [PATCH 180/217] Sweeping 21.2 version of SGxAODProxyLoader into
 master

The version of SGxAODProxyLoader in master, which defines the type for each container in the ExpressionEvaluation, has not been touched for four years. In consequence it misses several containers that were added later (particularly the DiTauJets) This MR sweeps the version from 21.2 into master. DAOD_PHYS is adjusted to uncomment some lines that were broken by this issue and are now able to work.
---
 .../ExpressionEvaluation/src/SGxAODProxyLoader.cxx           | 5 +++--
 .../DerivationFrameworkPhys/share/PHYS.py                    | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx b/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
index ae1ea28ce021..788bd8ce51ff 100644
--- a/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
+++ b/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
@@ -57,6 +57,7 @@
 #include "xAODTruth/TruthEventContainer.h"
 #include "xAODTruth/TruthVertexContainer.h"
 #include "xAODTau/TauJetContainer.h"
+#include "xAODTau/DiTauJetContainer.h"
 #include "xAODMissingET/MissingETContainer.h"
 #include "xAODBTagging/BTaggingContainer.h"
 #include "xAODPFlow/PFOContainer.h"
@@ -106,7 +107,6 @@ namespace ExpressionParsing {
     m_elementProxyLoader->setData(metElement);
   }
 
-
   // End helper classes
 
 
@@ -157,6 +157,7 @@ namespace ExpressionParsing {
 
     // End specific workarounds
 
+    TRY_VECTOR(xAOD::TruthParticleContainer);
     TRY_VECTOR(xAOD::ElectronContainer);
     TRY_VECTOR(xAOD::PhotonContainer);
     TRY_VECTOR(xAOD::MuonContainer);
@@ -164,10 +165,10 @@ namespace ExpressionParsing {
     TRY_VECTOR(xAOD::TrackParticleContainer);
     TRY_VECTOR(xAOD::VertexContainer);
     TRY_VECTOR(xAOD::CaloClusterContainer);
-    TRY_VECTOR(xAOD::TruthParticleContainer);
     TRY_VECTOR(xAOD::TruthEventContainer);
     TRY_VECTOR(xAOD::TruthVertexContainer);
     TRY_VECTOR(xAOD::TauJetContainer);
+    TRY_VECTOR(xAOD::DiTauJetContainer);
     TRY_VECTOR(xAOD::BTaggingContainer);
     TRY_VECTOR(xAOD::PFOContainer);
     TRY_VECTOR(xAOD::ParticleContainer);
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
index dd6f9e1d0c97..0e9be5fdc5e1 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
@@ -198,7 +198,7 @@ DerivationFrameworkJob += SeqPHYS
 # Add low-pt di-tau reconstruction
 from DerivationFrameworkTau.TauCommon import addDiTauLowPt
 addDiTauLowPt(Seq=SeqPHYS)
-'''
+
 # Low-pt di-tau thinning
 from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning
 PHYSDiTauLowPtThinningTool = DerivationFramework__GenericObjectThinning(name            = "PHYSDiTauLowPtThinningTool",
@@ -216,7 +216,7 @@ PHYSDiTauLowPtTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(n
                                                                                SelectionString         = "DiTauJetsLowPt.nSubjets > 1")
 ToolSvc += PHYSDiTauLowPtTPThinningTool
 thinningTools.append(PHYSDiTauLowPtTPThinningTool)
-'''
+
 #====================================================================
 # CREATE THE DERIVATION KERNEL ALGORITHM   
 #====================================================================
-- 
GitLab


From 8e60df67328ce1248d30579bf5e284ab0851febd Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Thu, 2 Jul 2020 15:38:07 +0000
Subject: [PATCH 181/217] Merge branch 'NSWCALIB' into '21.3'

NSWCalib

See merge request atlas/athena!33892
---
 .../NSWCalibTools/INSWCalibTool.h             |  9 ++-
 .../NSWCalibTools/src/NSWCalibTool.cxx        | 74 +++++++++++++------
 .../NSWCalib/NSWCalibTools/src/NSWCalibTool.h |  7 +-
 .../src/MmRdoToPrepDataToolCore.cxx           |  2 +-
 4 files changed, 64 insertions(+), 28 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h
index b570ce5a58a2..e4bec41e8632 100644
--- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h
+++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/NSWCalibTools/INSWCalibTool.h
@@ -30,11 +30,11 @@ namespace NSWCalib {
   };
 
 }
-
-
+ 
 namespace Muon {
 
   class MM_RawData;
+  class MMPrepData;
 
   class INSWCalibTool : virtual public IAlgTool {
     
@@ -44,8 +44,9 @@ namespace Muon {
 
   public:  // interface methods
     
-    virtual StatusCode calibrate(const Muon::MM_RawData* mmRawData, const Amg::Vector3D& globalPos, NSWCalib::CalibratedStrip& calibStrip) const = 0;
-
+    virtual StatusCode calibrateClus(const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const = 0;
+    virtual StatusCode calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const = 0;
+    virtual StatusCode calibrateStrip(const double time,  const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip&calibStrip) const = 0;
     virtual StatusCode mmGasProperties(float &vDrift, float &longDiff, float &transDiff, float &interactionDensityMean, float &interactionDensitySigma, TF1* &lorentzAngleFunction) const = 0;
   };
   
diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx
index 69b1eb1176af..e062ad50ba94 100644
--- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx
+++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx
@@ -5,7 +5,7 @@
 #include "NSWCalibTool.h"
 #include "GaudiKernel/SystemOfUnits.h"
 #include "GaudiKernel/PhysicalConstants.h"
-
+#include "MuonReadoutGeometry/MMReadoutElement.h"
 
 namespace {
   static constexpr double const& toRad = M_PI/180;
@@ -35,9 +35,7 @@ namespace {
 
 }
 
-Muon::NSWCalibTool::NSWCalibTool(const std::string& t,
-				  const std::string& n, 
-				  const IInterface* p ) :
+Muon::NSWCalibTool::NSWCalibTool(const std::string& t, const std::string& n, const IInterface* p) :
   AthAlgTool(t,n,p)
 {
   declareInterface<INSWCalibTool>(this);
@@ -54,7 +52,6 @@ Muon::NSWCalibTool::NSWCalibTool(const std::string& t,
 
 StatusCode Muon::NSWCalibTool::initialize()
 {
-
   ATH_MSG_DEBUG("In initialize()");
   ATH_CHECK(m_idHelperSvc.retrieve());
   if ( !(m_idHelperSvc->hasMM() && m_idHelperSvc->hasSTgc() ) ) {
@@ -62,6 +59,7 @@ StatusCode Muon::NSWCalibTool::initialize()
     return StatusCode::FAILURE;
   }
   ATH_CHECK(m_fieldCondObjInputKey.initialize());
+  ATH_CHECK(m_muDetMgrKey.initialize());
   ATH_CHECK(initializeGasProperties());
   return StatusCode::SUCCESS;
 }
@@ -86,14 +84,7 @@ StatusCode Muon::NSWCalibTool::initializeGasProperties() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode Muon::NSWCalibTool::calibrate( const Muon::MM_RawData* mmRawData, const Amg::Vector3D& globalPos, NSWCalib::CalibratedStrip& calibStrip) const
-{
-
-  double  vDriftCorrected;
-  calibStrip.charge = mmRawData->charge();
-  calibStrip.time = mmRawData->time() - globalPos.norm() * reciprocalSpeedOfLight + m_timeOffset;
-
-  calibStrip.identifier = mmRawData->identify();
+StatusCode Muon::NSWCalibTool::calibrateClus(const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const {
 
   /// magnetic field
   MagField::AtlasFieldCache fieldCache;
@@ -104,7 +95,6 @@ StatusCode Muon::NSWCalibTool::calibrate( const Muon::MM_RawData* mmRawData, con
     return StatusCode::FAILURE;
   }
   fieldCondObj->getInitializedCache(fieldCache);
-
   Amg::Vector3D magneticField;
   fieldCache.getField(globalPos.data(), magneticField.data());
 
@@ -113,26 +103,66 @@ StatusCode Muon::NSWCalibTool::calibrate( const Muon::MM_RawData* mmRawData, con
   double bfield = (magneticField.x()*std::sin(phi)-magneticField.y()*std::cos(phi))*1000.;
 
   /// swap sign depending on the readout side
-  int gasGap = m_idHelperSvc->mmIdHelper().gasGap(mmRawData->identify());
+  int gasGap = m_idHelperSvc->mmIdHelper().gasGap(prepData->identify());
   bool changeSign = ( globalPos.z() > 0. ? (gasGap==1 || gasGap==3) : (gasGap==2 || gasGap==4) );
   if (changeSign) bfield = -bfield;
 
-  /// sign of the lorentz angle matches digitization - angle is in radians
+  //// sign of the lorentz angle matches digitization - angle is in radians
   double lorentzAngle = (bfield>0. ? 1. : -1.)*m_lorentzAngleFunction->Eval(std::abs(bfield)) * toRad;
 
-  vDriftCorrected = m_vDrift * std::cos(lorentzAngle);
+  /// loop over prepData strips
+  for (unsigned int i = 0; i < prepData->stripNumbers().size(); i++){
+    double time = prepData->stripTimes().at(i);
+    double charge = prepData->stripCharges().at(i);
+    NSWCalib::CalibratedStrip calibStrip;
+    ATH_CHECK(calibrateStrip(time, charge, lorentzAngle, calibStrip));
+    calibClus.push_back(calibStrip);
+  }
+  return StatusCode::SUCCESS;
+}
+
+StatusCode Muon::NSWCalibTool::calibrateStrip(const double time, const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip& calibStrip) const {
+  calibStrip.charge = charge;
+  calibStrip.time = time;
+
+  double vDriftCorrected = m_vDrift * std::cos(lorentzAngle);
   calibStrip.distDrift = vDriftCorrected * calibStrip.time;
 
   /// transversal and longitudinal components of the resolution
-  calibStrip.resTransDistDrift = pitchErr + std::pow(m_transDiff * calibStrip.distDrift, 2); 
-  calibStrip.resLongDistDrift = std::pow(m_ionUncertainty * vDriftCorrected, 2) 
+  calibStrip.resTransDistDrift = pitchErr + std::pow(m_transDiff * calibStrip.distDrift, 2);
+  calibStrip.resLongDistDrift = std::pow(m_ionUncertainty * vDriftCorrected, 2)
     + std::pow(m_longDiff * calibStrip.distDrift, 2);
-  
   calibStrip.dx = std::sin(lorentzAngle) * calibStrip.time * m_vDrift;
-
   return StatusCode::SUCCESS;
 }
 
+StatusCode Muon::NSWCalibTool::calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const
+{
+  Identifier rdoId = mmRawData->identify();
+
+  // @TODO: for the shifter: this code will be used as soon as the NSW is built in the MuonDetectorCondAlg
+  // for now, we will need to use the nominal manager from the detectorStore to run
+  // SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey};
+  // const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
+  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
+  ATH_CHECK(detStore()->retrieve(muDetMgr));
+
+  //get globalPos
+  Amg::Vector3D globalPos;
+  const MuonGM::MMReadoutElement* detEl = muDetMgr->getMMReadoutElement(rdoId);
+  detEl->stripGlobalPosition(rdoId,globalPos);
+
+  calibStrip.charge = mmRawData->charge();
+  calibStrip.time = mmRawData->time() - globalPos.norm() * reciprocalSpeedOfLight + m_timeOffset;
+  calibStrip.identifier = mmRawData->identify();
+
+  calibStrip.distDrift = m_vDrift * calibStrip.time;
+  calibStrip.resTransDistDrift = pitchErr + std::pow(m_transDiff * calibStrip.distDrift, 2);
+  calibStrip.resLongDistDrift = std::pow(m_ionUncertainty * m_vDrift, 2)
+    + std::pow(m_longDiff * calibStrip.distDrift, 2);
+
+  return StatusCode::SUCCESS;
+}
 
 StatusCode Muon::NSWCalibTool::finalize()
 {
@@ -150,4 +180,4 @@ StatusCode Muon::NSWCalibTool::mmGasProperties(float &vDrift, float &longDiff, f
   interactionDensitySigma = m_interactionDensitySigma;
   lorentzAngleFunction = m_lorentzAngleFunction;
   return StatusCode::SUCCESS;
-}
\ No newline at end of file
+}
diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h
index 6abecefb29e8..8dfae4201172 100644
--- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h
+++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.h
@@ -16,6 +16,7 @@
 #include "MuonPrepRawData/MMPrepData.h"
 #include "MuonRDO/MM_RawData.h"
 #include "StoreGate/ReadCondHandleKey.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MagFieldConditions/AtlasFieldCacheCondObj.h"
 
 #include "TRandom3.h"
@@ -31,7 +32,9 @@ namespace Muon {
 
     virtual ~NSWCalibTool() = default;
     
-    virtual StatusCode calibrate( const Muon::MM_RawData* mmRawData, const Amg::Vector3D& globalPos, NSWCalib::CalibratedStrip& calibStrip) const override;
+    StatusCode calibrateClus(const Muon::MMPrepData* prepData, const Amg::Vector3D& globalPos, std::vector<NSWCalib::CalibratedStrip>& calibClus) const;
+    StatusCode calibrateStrip(const double time,  const double charge, const double lorentzAngle, NSWCalib::CalibratedStrip& calibStrip) const;
+    StatusCode calibrateStrip(const Muon::MM_RawData* mmRawData, NSWCalib::CalibratedStrip& calibStrip) const;
 
     virtual StatusCode initialize() override;
     virtual StatusCode finalize() override;
@@ -41,6 +44,8 @@ namespace Muon {
 
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
     SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj"};
+    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; 
+
     StatusCode initializeGasProperties();
 
     TF1* m_lorentzAngleFunction;
diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
index 9c714838d2aa..b385a199b2b5 100644
--- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
@@ -143,7 +143,7 @@ StatusCode Muon::MmRdoToPrepDataToolCore::processCollection(const MM_RawDataColl
       continue;
     }
     NSWCalib::CalibratedStrip calibStrip;
-    ATH_CHECK (m_calibTool->calibrate(rdo, globalPos, calibStrip));
+    ATH_CHECK (m_calibTool->calibrateStrip(rdo, calibStrip));
 
     const Amg::Vector3D globalDir(globalPos.x(), globalPos.y(), globalPos.z());
     Trk::LocalDirection localDir;
-- 
GitLab


From 996c1537002226048fbbf13220af40701b212048 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:42:38 +0200
Subject: [PATCH 182/217] Migrate ISF_Core and ISF_Geant4 packages to use
 (Const)GenParticlePtr

---
 .../ISF_Event/ISF_Event/HepMCHelper.h         |  2 +-
 .../ISF_Event/ISF_Event/HepMCHelper.icc       |  4 +--
 .../ISF_Event/ISF_Event/ISFTruthIncident.h    | 14 +++++-----
 .../ISF_Event/ISF_Event/ITruthIncident.h      | 10 +++----
 .../ISF_Event/ISF_Event/ParticleHelper.h      |  2 +-
 .../ISF_Event/ISF_Event/TruthBinding.h        | 20 +++++++-------
 .../ISF_Event/ISF_Event/TruthBinding.icc      | 16 ++++++------
 .../ISF_Event/src/ISFTruthIncident.cxx        | 20 +++++++-------
 .../ISF_Core/ISF_Event/src/ParticleHelper.cxx |  8 +++---
 .../ISF_Services/src/InputConverter.cxx       | 16 ++++++------
 .../ISF_Services/src/InputConverter.h         |  2 +-
 .../ISF_Core/ISF_Services/src/TruthSvc.cxx    | 14 +++++-----
 .../ISF_Geant4Event/Geant4TruthIncident.h     | 20 +++++++-------
 .../ISF_Geant4Event/ISFG4Helper.h             |  2 +-
 .../src/Geant4TruthIncident.cxx               | 26 +++++++++----------
 .../ISF_Geant4Event/src/ISFG4Helper.cxx       |  4 ++-
 .../src/PhysicsValidationUserAction.cxx       |  4 +--
 .../src/TrackProcessorUserActionBase.cxx      | 16 ++++++------
 .../src/TrackProcessorUserActionBase.h        | 10 +++----
 .../src/TrackProcessorUserActionPassBack.cxx  | 16 ++++++------
 .../src/TrackProcessorUserActionPassBack.h    |  6 ++---
 .../src/GenParticleGenericFilter.cxx          |  2 +-
 .../src/GenParticlePositionFilter.cxx         |  2 +-
 .../src/ConeSimSelector.cxx                   |  6 ++---
 .../src/TruthAssocSimSelector.cxx             |  8 +++---
 25 files changed, 126 insertions(+), 124 deletions(-)

diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h
index ca3491cdbf5b..69ed5994ff62 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h
@@ -51,7 +51,7 @@ namespace ISF {
           at least one particle with one of the given PDG codes appears.
           returns pointer to first found particle that matches any of the
           given PDG codes in relativesPDG */
-      static inline const HepMC::GenParticle * findRealtiveWithPDG( const HepMC::GenParticle &genParticle,
+      static inline HepMC::ConstGenParticlePtr findRealtiveWithPDG( const HepMC::GenParticle &genParticle,
                                                                     const HepMC::IteratorRange &relation,
                                                                     const std::set<int> &relativesPDG     );
   };
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc
index 9dc21beddaf2..ba477d1d70ce 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.icc
@@ -29,7 +29,7 @@ HepMC::IteratorRange ISF::HepMCHelper::convertIteratorRange( int intItRange ) {
   else                    return ( HepMC::parents   );
 }
 
-const HepMC::GenParticle * ISF::HepMCHelper::findRealtiveWithPDG( const HepMC::GenParticle &genParticle,
+HepMC::ConstGenParticlePtr ISF::HepMCHelper::findRealtiveWithPDG( const HepMC::GenParticle &genParticle,
                                                                   const HepMC::IteratorRange &relation,
                                                                   const std::set<int> &relativesPDG     ) {
 
@@ -39,7 +39,7 @@ const HepMC::GenParticle * ISF::HepMCHelper::findRealtiveWithPDG( const HepMC::G
   // loop over relatives
   HepMC::GenVertex::particle_iterator       partIt  = relativesRng.begin();
   const HepMC::GenVertex::particle_iterator partEnd = relativesRng.end();
-  const HepMC::GenParticle *curRelative = 0;
+  HepMC::ConstGenParticlePtr curRelative{};
   bool  found = false;
   for ( ; (!found) && (partIt!=partEnd) ; ++partIt) {
     curRelative = (*partIt) ;
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h
index c45ff5d3285f..47b240cf900f 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h
@@ -67,7 +67,7 @@ namespace ISF {
     int                       parentPdgCode() const override final;
     /** Return the parent particle as a HepMC particle type
         (usually only called for particles that will enter the HepMC truth event) */
-    HepMC::GenParticle*       parentParticle() const override final;
+    HepMC::GenParticlePtr     parentParticle() const override final;
     /** Return the barcode of the parent particle */
     Barcode::ParticleBarcode  parentBarcode() const override final;
     /** Return the bunch-crossing identifier of the parent particle */
@@ -76,7 +76,7 @@ namespace ISF {
     bool                      parentSurvivesIncident() const override final;
     /** Return the parent particle after the TruthIncident vertex (and give
         it a new barcode) */
-    HepMC::GenParticle*       parentParticleAfterIncident(Barcode::ParticleBarcode newBC) override final;
+    HepMC::GenParticlePtr     parentParticleAfterIncident(Barcode::ParticleBarcode newBC) override final;
 
     /** Return p^2 of the i-th child particle */
     double                    childP2(unsigned short index) const override final;
@@ -89,24 +89,24 @@ namespace ISF {
     /** Return the i-th child as a HepMC particle type and assign the given
         Barcode to the simulator particle (usually only called for particles that
         will enter the HepMC truth event) */
-    HepMC::GenParticle*       childParticle(unsigned short index,
+    HepMC::GenParticlePtr     childParticle(unsigned short index,
                                             Barcode::ParticleBarcode bc) const override final;
     /** Update the properties of a child particle from a pre-defined
         interaction based on the properties of the ith child of the
         current TruthIncident (only used in quasi-stable particle
         simulation) - TODO only a dummy implementation currently */
-    virtual HepMC::GenParticle*       updateChildParticle(unsigned short index,
-                                                          HepMC::GenParticle *existingChild) const override final;
+    virtual HepMC::GenParticlePtr     updateChildParticle(unsigned short index,
+                                                          HepMC::GenParticlePtr existingChild) const override final;
     /** Set the the barcode of all child particles to the given bc */
     void                      setAllChildrenBarcodes(Barcode::ParticleBarcode bc) override final;
   private:
     ISFTruthIncident();
 
     /** return attached truth particle */
-    inline HepMC::GenParticle* getHepMCTruthParticle( const ISF::ISFParticle& particle ) const;
+    inline HepMC::GenParticlePtr getHepMCTruthParticle( const ISF::ISFParticle& particle ) const;
 
     /** convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding */
-    inline HepMC::GenParticle* updateHepMCTruthParticle( ISF::ISFParticle& particle, const ISF::ISFParticle* parent=nullptr ) const;
+    inline HepMC::GenParticlePtr updateHepMCTruthParticle( ISF::ISFParticle& particle, const ISF::ISFParticle* parent=nullptr ) const;
 
     ISF::ISFParticle&                  m_parent;
     const ISFParticleVector&           m_children;
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
index 3882f1d43ccb..843d0645c6f6 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
@@ -74,7 +74,7 @@ namespace ISF {
     virtual int                       parentPdgCode() const = 0;
     /** Return the parent particle as a HepMC particle type
         (only called for particles that will enter the HepMC truth event) */
-    virtual HepMC::GenParticle*       parentParticle() const = 0;
+    virtual HepMC::GenParticlePtr     parentParticle() const = 0;
     /** Return the barcode of the parent particle */
     virtual Barcode::ParticleBarcode  parentBarcode() const = 0;
     /** Return the bunch-crossing identifier of the parent particle */
@@ -83,7 +83,7 @@ namespace ISF {
     virtual bool                      parentSurvivesIncident() const = 0;
     /** Return the parent particle after the TruthIncident vertex (and assign
         a new barcode to it) */
-    virtual HepMC::GenParticle*       parentParticleAfterIncident(Barcode::ParticleBarcode newBC) = 0;
+    virtual HepMC::GenParticlePtr     parentParticleAfterIncident(Barcode::ParticleBarcode newBC) = 0;
 
     /** Return total number of child particles */
     inline unsigned short             numberOfChildren() const;
@@ -107,14 +107,14 @@ namespace ISF {
     /** Return the i-th child as a HepMC particle type and assign the given
         Barcode to the simulator particle (only called for particles that will
         enter the HepMC truth event) */
-    virtual HepMC::GenParticle*       childParticle(unsigned short index,
+    virtual HepMC::GenParticlePtr     childParticle(unsigned short index,
                                                     Barcode::ParticleBarcode bc = Barcode::fUndefinedBarcode) const = 0;
     /** Update the properties of a child particle from a pre-defined
         interaction based on the properties of the ith child of the
         current TruthIncident (only used in quasi-stable particle
         simulation). */
-    virtual HepMC::GenParticle*       updateChildParticle(unsigned short index,
-                                                          HepMC::GenParticle *existingChild) const = 0;
+    virtual HepMC::GenParticlePtr     updateChildParticle(unsigned short index,
+                                                          HepMC::GenParticlePtr existingChild) const = 0;
     /** Set the the barcode of all child particles to the given bc */
     virtual void                      setAllChildrenBarcodes(Barcode::ParticleBarcode bc) = 0;
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ParticleHelper.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ParticleHelper.h
index 48072b67b79d..65e471791f27 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ParticleHelper.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ParticleHelper.h
@@ -35,7 +35,7 @@ namespace ISF {
         ~ParticleHelper() {} ;
 
         /** convert the given particle to HepMC format */
-        static HepMC::GenParticle *convert( const ISF::ISFParticle &p);
+        static HepMC::GenParticlePtr convert( const ISF::ISFParticle &p);
         
     private :
   };
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
index 599779d35715..e5352b5c7fa8 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
@@ -25,9 +25,9 @@ namespace ISF {
     TruthBinding() = delete;
 
     /** constructor setting all truth particle pointers to the given particle */
-    inline TruthBinding(HepMC::GenParticle* allTruthP);
+    inline TruthBinding(HepMC::GenParticlePtr allTruthP);
     /** constructor setting all truth particle pointers individually */
-    inline TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP);
+    inline TruthBinding(HepMC::GenParticlePtr truthP, HepMC::GenParticlePtr primaryTruthP, HepMC::GenParticlePtr genZeroTruthP);
 
     /** copy constructors */
     inline TruthBinding(const TruthBinding &rhs);
@@ -46,20 +46,20 @@ namespace ISF {
     inline ~TruthBinding();
 
     /** pointer to the particle in the simulation truth */
-    inline HepMC::GenParticle* getTruthParticle() const;
-    inline void                setTruthParticle(HepMC::GenParticle* p);
+    inline HepMC::GenParticlePtr getTruthParticle() const;
+    inline void                setTruthParticle(HepMC::GenParticlePtr p);
 
     /** pointer to the primary particle in the simulation truth */
-    inline HepMC::GenParticle* getPrimaryTruthParticle() const;
+    inline HepMC::GenParticlePtr getPrimaryTruthParticle() const;
 
     /** pointer to the simulation truth particle before any regeneration happened (eg. brem) */
-    inline HepMC::GenParticle* getGenerationZeroTruthParticle() const;
-    inline void                setGenerationZeroTruthParticle(HepMC::GenParticle* p);
+    inline HepMC::GenParticlePtr getGenerationZeroTruthParticle() const;
+    inline void                setGenerationZeroTruthParticle(HepMC::GenParticlePtr p);
 
   private:
-    HepMC::GenParticle*   m_truthParticle;               //!< pointer to particle in MC truth
-    HepMC::GenParticle*   m_primaryTruthParticle;        //!< pointer to corresponding primary (generator) particle
-    HepMC::GenParticle*   m_generationZeroTruthParticle; //!< pointer to corresponding truth particle before any regenration
+    HepMC::GenParticlePtr   m_truthParticle{};               //!< pointer to particle in MC truth
+    HepMC::GenParticlePtr   m_primaryTruthParticle{};        //!< pointer to corresponding primary (generator) particle
+    HepMC::GenParticlePtr   m_generationZeroTruthParticle{}; //!< pointer to corresponding truth particle before any regenration
   };
 
 } // end of namespace
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
index b97272c450be..91c73a6f98b9 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
@@ -1,18 +1,18 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // this file contains all ITruthBinding inline methods
 
 namespace ISF {
   /** constructor setting all truth particle pointers to the given particle */
-  TruthBinding::TruthBinding(HepMC::GenParticle* allTruthP) :
+  TruthBinding::TruthBinding(HepMC::GenParticlePtr allTruthP) :
     m_truthParticle(allTruthP),
     m_primaryTruthParticle(allTruthP),
     m_generationZeroTruthParticle(allTruthP) { }
 
   /** constructor setting all truth particle pointers individually */
-  TruthBinding::TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP) :
+  TruthBinding::TruthBinding(HepMC::GenParticlePtr truthP, HepMC::GenParticlePtr primaryTruthP, HepMC::GenParticlePtr genZeroTruthP) :
     m_truthParticle(truthP),
     m_primaryTruthParticle(primaryTruthP),
     m_generationZeroTruthParticle(genZeroTruthP) { }
@@ -91,14 +91,14 @@ namespace ISF {
   }
 
   /** pointer to the particle in the simulation truth */
-  HepMC::GenParticle* TruthBinding::getTruthParticle() const { return m_truthParticle; }
-  void                TruthBinding::setTruthParticle(HepMC::GenParticle* p) { m_truthParticle = p; }
+  HepMC::GenParticlePtr TruthBinding::getTruthParticle() const { return m_truthParticle; }
+  void                TruthBinding::setTruthParticle(HepMC::GenParticlePtr p) { m_truthParticle = p; }
 
   /** pointer to the primary particle in the simulation truth */
-  HepMC::GenParticle* TruthBinding::getPrimaryTruthParticle() const { return m_primaryTruthParticle; }
+  HepMC::GenParticlePtr TruthBinding::getPrimaryTruthParticle() const { return m_primaryTruthParticle; }
 
   /** pointer to the simulation truth particle before any regeneration (eg. brem) */
-  HepMC::GenParticle* TruthBinding::getGenerationZeroTruthParticle() const { return m_generationZeroTruthParticle; }
-  void                TruthBinding::setGenerationZeroTruthParticle(HepMC::GenParticle* p) { m_generationZeroTruthParticle = p; }
+  HepMC::GenParticlePtr TruthBinding::getGenerationZeroTruthParticle() const { return m_generationZeroTruthParticle; }
+  void                TruthBinding::setGenerationZeroTruthParticle(HepMC::GenParticlePtr p) { m_generationZeroTruthParticle = p; }
 
 } // end ISF namespace
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
index e91de330fe40..4c8aa3f2b174 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -77,7 +77,7 @@ int ISF::ISFTruthIncident::parentPdgCode() const {
   return m_parent.pdgCode();
 }
 
-HepMC::GenParticle* ISF::ISFTruthIncident::parentParticle() const {
+HepMC::GenParticlePtr ISF::ISFTruthIncident::parentParticle() const {
   if ( m_parent.getTruthBinding() || m_parent.getParticleLink()) {
     return getHepMCTruthParticle(m_parent);
   } else {
@@ -97,7 +97,7 @@ bool ISF::ISFTruthIncident::parentSurvivesIncident() const {
   return !(m_killsPrimary == ISF::fKillsPrimary);
 }
 
-HepMC::GenParticle* ISF::ISFTruthIncident::parentParticleAfterIncident(Barcode::ParticleBarcode newBC) {
+HepMC::GenParticlePtr ISF::ISFTruthIncident::parentParticleAfterIncident(Barcode::ParticleBarcode newBC) {
   // if parent is killed in the interaction -> return nullptr
   if (m_killsPrimary==ISF::fKillsPrimary) return nullptr;
 
@@ -127,7 +127,7 @@ int ISF::ISFTruthIncident::childPdgCode(unsigned short index) const {
   return m_children[index]->pdgCode();
 }
 
-HepMC::GenParticle* ISF::ISFTruthIncident::childParticle(unsigned short index,
+HepMC::GenParticlePtr ISF::ISFTruthIncident::childParticle(unsigned short index,
                                                          Barcode::ParticleBarcode bc) const {
   // the child particle
   ISF::ISFParticle *sec = m_children[index];
@@ -141,8 +141,8 @@ HepMC::GenParticle* ISF::ISFTruthIncident::childParticle(unsigned short index,
   return updateHepMCTruthParticle( *sec, &m_parent );
 }
 
-HepMC::GenParticle* ISF::ISFTruthIncident::updateChildParticle(unsigned short /*index*/,
-                                                               HepMC::GenParticle *existingChild) const {
+HepMC::GenParticlePtr ISF::ISFTruthIncident::updateChildParticle(unsigned short /*index*/,
+                                                               HepMC::GenParticlePtr existingChild) const {
   // Dummy implementation
   return existingChild;
 }
@@ -162,7 +162,7 @@ void ISF::ISFTruthIncident::setAllChildrenBarcodes(Barcode::ParticleBarcode bc)
 
 
 /** return attached truth particle */
-HepMC::GenParticle* ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISFParticle& particle ) const {
+HepMC::GenParticlePtr ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISFParticle& particle ) const {
   auto* truthBinding     = particle.getTruthBinding();
   auto* hepTruthParticle = truthBinding ? truthBinding->getTruthParticle() : nullptr;
 
@@ -170,7 +170,7 @@ HepMC::GenParticle* ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISF
   if (!hepTruthParticle) {
     const HepMcParticleLink* oldHMPL = particle.getParticleLink();
     if (oldHMPL && oldHMPL->cptr())
-      hepTruthParticle = const_cast<HepMC::GenParticle*>(oldHMPL->cptr());
+      hepTruthParticle = const_cast<HepMC::GenParticlePtr>(oldHMPL->cptr());
   }
 
   return hepTruthParticle;
@@ -178,8 +178,8 @@ HepMC::GenParticle* ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISF
 
 
 /** convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding */
-HepMC::GenParticle* ISF::ISFTruthIncident::updateHepMCTruthParticle( ISF::ISFParticle& particle,
-                                                                     const ISF::ISFParticle* parent ) const {
+HepMC::GenParticlePtr ISF::ISFTruthIncident::updateHepMCTruthParticle( ISF::ISFParticle& particle,
+                                                                       const ISF::ISFParticle* parent ) const {
   auto* truthBinding     = particle.getTruthBinding();
   auto* hepTruthParticle = ParticleHelper::convert( particle );
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ParticleHelper.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ParticleHelper.cxx
index c8de9a6e0bdb..e9326b860d86 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/src/ParticleHelper.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ParticleHelper.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -17,7 +17,7 @@
 // ISF includes
 #include "ISF_Event/ISFParticle.h"
 
-HepMC::GenParticle* ISF::ParticleHelper::convert( const ISF::ISFParticle &particle) {
+HepMC::GenParticlePtr ISF::ParticleHelper::convert( const ISF::ISFParticle &particle) {
 
   const Amg::Vector3D &mom = particle.momentum();
   double mass = particle.mass();
@@ -25,8 +25,8 @@ HepMC::GenParticle* ISF::ParticleHelper::convert( const ISF::ISFParticle &partic
   HepMC::FourVector fourMomentum( mom.x(), mom.y(), mom.z(), energy);
   int status = 1; // stable particle not decayed by EventGenerator
 
-  auto* hepParticle = new HepMC::GenParticle( fourMomentum, particle.pdgCode(), status );
-  hepParticle->suggest_barcode( particle.barcode() );
+  auto hepParticle = HepMC::newGenParticlePtr( fourMomentum, particle.pdgCode(), status );
+  HepMC::suggest_barcode(hepParticle, particle.barcode() );
 
   // return a newly created GenParticle
   return hepParticle;
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
index a012c1c5c77a..73e323149231 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
@@ -187,13 +187,13 @@ StatusCode ISF::InputConverter::convertHepMCToG4Event(McEventCollection& inputGe
 
 
 /** get all generator particles which pass filters */
-std::vector<HepMC::GenParticle*>
+std::vector<HepMC::GenParticlePtr>
 ISF::InputConverter::getSelectedParticles(const HepMC::GenEvent& evnt, bool legacyOrdering) const {
   auto allGenPartBegin = evnt.particles_begin();
   auto allGenPartEnd = evnt.particles_end();
 
   // reserve destination container with maximum size, i.e. number of particles in input event
-  std::vector<HepMC::GenParticle*> passedGenParticles{};
+  std::vector<HepMC::GenParticlePtr> passedGenParticles{};
   size_t maxParticles = std::distance(allGenPartBegin, allGenPartEnd);
   passedGenParticles.reserve(maxParticles);
 
@@ -207,14 +207,14 @@ ISF::InputConverter::getSelectedParticles(const HepMC::GenEvent& evnt, bool lega
       std::copy_if(vtxPtr->particles_begin(HepMC::children),
                    vtxPtr->particles_end(HepMC::children),
                    std::back_inserter(passedGenParticles),
-                   [this](HepMC::GenParticle* p){return this->passesFilters(*p);});
+                   [this](HepMC::GenParticlePtr p){return this->passesFilters(*p);});
     }
   }
   else {
     std::copy_if(allGenPartBegin,
                  allGenPartEnd,
                  std::back_inserter(passedGenParticles),
-                 [this](HepMC::GenParticle* p){return this->passesFilters(*p);});
+                 [this](HepMC::GenParticlePtr p){return this->passesFilters(*p);});
   }
 
   passedGenParticles.shrink_to_fit();
@@ -225,7 +225,7 @@ ISF::InputConverter::getSelectedParticles(const HepMC::GenEvent& evnt, bool lega
 
 /** get all generator particles which pass filters */
 ISF::ISFParticle*
-ISF::InputConverter::convertParticle(HepMC::GenParticle* genPartPtr, EBC_EVCOLL kindOfCollection) const {
+ISF::InputConverter::convertParticle(HepMC::GenParticlePtr genPartPtr, EBC_EVCOLL kindOfCollection) const {
   if (!genPartPtr) { return nullptr; }
   auto& genPart = *genPartPtr;
 
@@ -483,8 +483,8 @@ G4PrimaryParticle* ISF::InputConverter::getG4PrimaryParticle(const ISF::ISFParti
       G4Exception("iGeant4::TransportTool", "NoISFTruthBinding", FatalException, description);
       return nullptr; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up.
   }
-  HepMC::GenParticle*        genpart = truthBinding->getTruthParticle();
-  HepMC::GenParticle* primaryGenpart = truthBinding->getPrimaryTruthParticle();
+  HepMC::GenParticlePtr        genpart = truthBinding->getTruthParticle();
+  HepMC::GenParticlePtr primaryGenpart = truthBinding->getPrimaryTruthParticle();
 
   const G4ParticleDefinition *particleDefinition = this->getG4ParticleDefinition(isp.pdgCode());
 
@@ -595,7 +595,7 @@ G4PrimaryParticle* ISF::InputConverter::getG4PrimaryParticle(const ISF::ISFParti
       //For backward compatibility, if all 3-momentum components agree to the g4particle momentum within 1 keV, we keep
       //this old method. This comparison is needed, since in ISF this code could be rerun after the ID or CALO simulation, where
       //real energy was lost in previous detectors and hence genpart should NOT be changed to some g4particle values!
-      //TODO: find a way to implement this in a backward compatible way in ISF::InputConverter::convertParticle(HepMC::GenParticle* genPartPtr, int bcid)
+      //TODO: find a way to implement this in a backward compatible way in ISF::InputConverter::convertParticle(HepMC::GenParticlePtr genPartPtr, int bcid)
       if(std::abs(px-g4px)<CLHEP::keV && std::abs(py-g4py)<CLHEP::keV && std::abs(pz-g4pz)<CLHEP::keV) {
         px=g4px;
         py=g4py;
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
index 6e15cc8ee06d..59b42820c371 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
@@ -102,7 +102,7 @@ namespace ISF {
     bool passesFilters(const HepMC::GenParticle& p) const;
 
     /** convert GenParticle to ISFParticle */
-    ISF::ISFParticle* convertParticle(HepMC::GenParticle* genPartPtr, EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const;
+    ISF::ISFParticle* convertParticle(HepMC::GenParticlePtr genPartPtr, EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const;
 
     /** ParticlePropertyService and ParticleDataTable */
     ServiceHandle<IPartPropSvc>           m_particlePropSvc;          //!< particle properties svc to retrieve PDT
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx
index 4814b4633525..f793776e574b 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx
@@ -132,12 +132,12 @@ StatusCode ISF::TruthSvc::initializeTruthCollection()
 }
 
 /** Delete child vertex */
-void ISF::TruthSvc::deleteChildVertex(HepMC::GenVertex* vertex) const {
-  std::vector<HepMC::GenVertex*> verticesToDelete;
+void ISF::TruthSvc::deleteChildVertex(HepMC::GenVertexPtr vertex) const {
+  std::vector<HepMC::GenVertexPtr> verticesToDelete;
   verticesToDelete.resize(0);
   verticesToDelete.push_back(vertex);
   for ( unsigned short i = 0; i<verticesToDelete.size(); ++i ) {
-    HepMC::GenVertex* vtx = verticesToDelete.at(i);
+    HepMC::GenVertexPtr vtx = verticesToDelete.at(i);
     for (HepMC::GenVertex::particles_out_const_iterator iter = vtx->particles_out_const_begin();
          iter != vtx->particles_out_const_end(); ++iter) {
       if( (*iter) && (*iter)->end_vertex() ) {
@@ -292,7 +292,7 @@ void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const {
       ATH_MSG_INFO("New QS GenVertex 1: " << *(newVtx.get()) );
 #endif
       HepMC::GenEvent *mcEvent = parentBeforeIncident->parent_event();
-      newVtx->suggest_barcode( this->maxGeneratedVertexBarcode(mcEvent)-1 );
+      HepMC::suggest_barcode(newVtx.get(), this->maxGeneratedVertexBarcode(mcEvent)-1 );
 #ifdef DEBUG_TRUTHSVC
       ATH_MSG_INFO("New QSGenVertex 2: " << *(newVtx.get()) );
 #endif
@@ -332,8 +332,8 @@ void ISF::TruthSvc::recordIncidentToMCTruth( ISF::ITruthIncident& ti) const {
     ATH_MSG_VERBOSE("Existing vertex has " << nVertexChildren << " children. " <<
                  "Number of secondaries in current truth incident = " << numSec);
   }
-  const std::vector<HepMC::GenParticle*> childParticleVector = (isQuasiStableVertex) ? MC::findChildren(ti.parentParticle()) : std::vector<HepMC::GenParticle*>();
-  std::vector<HepMC::GenParticle*> matchedChildParticles;
+  const std::vector<HepMC::GenParticlePtr> childParticleVector = (isQuasiStableVertex) ? MC::findChildren(ti.parentParticle()) : std::vector<HepMC::GenParticlePtr>();
+  std::vector<HepMC::GenParticlePtr> matchedChildParticles;
   for ( unsigned short i=0; i<numSec; ++i) {
 
     bool writeOutChild = isQuasiStableVertex || m_passWholeVertex || ti.childPassedFilters(i);
@@ -430,7 +430,7 @@ HepMC::GenVertex *ISF::TruthSvc::createGenVertexFromTruthIncident( ISF::ITruthIn
   }
   int vtxID = 1000 + static_cast<int>(processCode);
   std::unique_ptr<HepMC::GenVertex> vtx = std::make_unique<HepMC::GenVertex>( ti.position(), vtxID, weights );
-  vtx->suggest_barcode( vtxbcode );
+  HepMC::suggest_barcode( vtx.get(), vtxbcode );
 
   if (parent->end_vertex()){
     if(!m_quasiStableParticlesIncluded) {
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h
index 27693a6dfd2d..d47709813203 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h
@@ -68,7 +68,7 @@ namespace iGeant4 {
       bool                      parentSurvivesIncident() const override final;
       /** Return the parent particle after the TruthIncident vertex (and give
           it a new barcode) */
-      HepMC::GenParticle*       parentParticleAfterIncident(Barcode::ParticleBarcode newBC) override final;
+      HepMC::GenParticlePtr     parentParticleAfterIncident(Barcode::ParticleBarcode newBC) override final;
 
       /** Return p of the i-th child particle */
       const G4ThreeVector       childP(unsigned short index) const;
@@ -95,17 +95,17 @@ namespace iGeant4 {
       // only called once accepted
 
       /** Return the parent particle as a HepMC particle type */
-      HepMC::GenParticle*       parentParticle() const override final;
+      HepMC::GenParticlePtr   parentParticle() const override final;
       /** Return the i-th child as a HepMC particle type and assign the given
           Barcode to the simulator particle */
-      HepMC::GenParticle*       childParticle(unsigned short index,
-                                              Barcode::ParticleBarcode bc) const override final;
+      HepMC::GenParticlePtr   childParticle(unsigned short index,
+                                            Barcode::ParticleBarcode bc) const override final;
       /** Update the properties of a child particle from a pre-defined
           interaction based on the properties of the ith child of the
           current TruthIncident (only used in quasi-stable particle
           simulation). */
-      HepMC::GenParticle* updateChildParticle(unsigned short index,
-                                              HepMC::GenParticle *existingChild) const override final;
+      HepMC::GenParticlePtr   updateChildParticle(unsigned short index,
+                                                  HepMC::GenParticlePtr existingChild) const override final;
     private:
       Geant4TruthIncident();
       /** prepare the child particles */
@@ -114,18 +114,18 @@ namespace iGeant4 {
       /** check if the given G4Track represents a particle that is alive in ISF or ISF-G4 */
       inline bool particleAlive(const G4Track *track) const;
 
-      HepMC::GenParticle* convert(const G4Track *particle, const int barcode, const bool secondary) const; //*AS* might be put static
+      HepMC::GenParticlePtr convert(const G4Track *particle, const int barcode, const bool secondary) const; //*AS* might be put static
 
       mutable bool                  m_positionSet;
       mutable HepMC::FourVector     m_position;
-      const G4Step*                 m_step;
+      const G4Step*                 m_step{};
       const ISF::ISFParticle&       m_baseISP;
 
-      EventInformation*             m_eventInfo;
+      EventInformation*             m_eventInfo{};
       mutable bool                  m_childrenPrepared;
       mutable std::vector<const G4Track*> m_children;
 
-      HepMC::GenParticle*           m_parentParticleAfterIncident;
+      HepMC::GenParticlePtr         m_parentParticleAfterIncident{};
    };
 
 }
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/ISFG4Helper.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/ISFG4Helper.h
index 443734dee6a7..2cae499ed000 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/ISFG4Helper.h
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/ISFG4Helper.h
@@ -49,7 +49,7 @@ class ISFG4Helper {
   static TrackInformation* attachTrackInfoToNewG4Track( G4Track& aTrack,
                                    const ISF::ISFParticle& baseIsp,
                                    TrackClassification classification,
-                                   HepMC::GenParticle *nonRegeneratedTruthParticle = nullptr);
+                                   HepMC::GenParticlePtr nonRegeneratedTruthParticle = nullptr);
   
   /** return pointer to current EventInformation */
   static EventInformation* getEventInformation();
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx
index 4e47e2f8ed46..e6593e152ed5 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx
@@ -121,11 +121,11 @@ int iGeant4::Geant4TruthIncident::parentPdgCode() const {
 Barcode::ParticleBarcode iGeant4::Geant4TruthIncident::parentBarcode() const {
   auto parent = parentParticle();
 
-  return (parent) ? parent->barcode() : Barcode::fUndefinedBarcode;
+  return (parent) ? HepMC::barcode(parent) : Barcode::fUndefinedBarcode;
 }
 
-HepMC::GenParticle* iGeant4::Geant4TruthIncident::parentParticle() const {
-  HepMC::GenParticle* hepParticle = m_eventInfo->GetCurrentlyTraced();
+HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::parentParticle() const {
+  HepMC::GenParticlePtr hepParticle = m_eventInfo->GetCurrentlyTraced();
 
   return hepParticle;
 }
@@ -146,7 +146,7 @@ bool iGeant4::Geant4TruthIncident::parentSurvivesIncident() const {
   }
 }
 
-HepMC::GenParticle* iGeant4::Geant4TruthIncident::parentParticleAfterIncident(Barcode::ParticleBarcode newBarcode) {
+HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::parentParticleAfterIncident(Barcode::ParticleBarcode newBarcode) {
   const G4Track *track = m_step->GetTrack();
 
   // check if particle is a alive in G4 or in ISF
@@ -219,8 +219,8 @@ void iGeant4::Geant4TruthIncident::setAllChildrenBarcodes(Barcode::ParticleBarco
   G4Exception("iGeant4::Geant4TruthIncident", "NotImplemented", FatalException, description);
 }
 
-HepMC::GenParticle* iGeant4::Geant4TruthIncident::childParticle(unsigned short i,
-                                                            Barcode::ParticleBarcode newBarcode) const {
+HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::childParticle(unsigned short i,
+                                                                  Barcode::ParticleBarcode newBarcode) const {
   prepareChildren();
 
   // the G4Track instance for the current child particle
@@ -230,7 +230,7 @@ HepMC::GenParticle* iGeant4::Geant4TruthIncident::childParticle(unsigned short i
   //     secondary could decay right away and create further particles which pass the
   //     truth strategies.
 
-  HepMC::GenParticle* hepParticle = convert( thisChildTrack , newBarcode , true );
+  HepMC::GenParticlePtr hepParticle = convert( thisChildTrack , newBarcode , true );
 
   TrackHelper tHelper(thisChildTrack);
   TrackInformation *trackInfo = tHelper.GetTrackInformation();
@@ -249,8 +249,8 @@ HepMC::GenParticle* iGeant4::Geant4TruthIncident::childParticle(unsigned short i
 }
 
 
-HepMC::GenParticle* iGeant4::Geant4TruthIncident::updateChildParticle(unsigned short index,
-                                                                      HepMC::GenParticle *existingChild) const {
+HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::updateChildParticle(unsigned short index,
+                                                                        HepMC::GenParticlePtr existingChild) const {
   prepareChildren();
 
   // the G4Track instance for the current child particle
@@ -310,7 +310,7 @@ bool iGeant4::Geant4TruthIncident::particleAlive(const G4Track *track) const {
 }
 
 
-HepMC::GenParticle* iGeant4::Geant4TruthIncident::convert(const G4Track *track, const int barcode, const bool secondary) const {
+HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::convert(const G4Track *track, const int barcode, const bool secondary) const {
 
   const G4ThreeVector & mom =  track->GetMomentum();
   const double energy =  track->GetTotalEnergy();
@@ -318,7 +318,7 @@ HepMC::GenParticle* iGeant4::Geant4TruthIncident::convert(const G4Track *track,
   const HepMC::FourVector fourMomentum( mom.x(), mom.y(), mom.z(), energy);
 
   const int status = 1; // stable particle not decayed by EventGenerator
-  HepMC::GenParticle* newParticle = new HepMC::GenParticle(fourMomentum, pdgCode, status);
+  HepMC::GenParticlePtr newParticle = HepMC::newGenParticlePtr(fourMomentum, pdgCode, status);
 
   // This should be a *secondary* track.  If it has a primary, it was a decay and 
   //  we are running with quasi-stable particle simulation.  Note that if the primary
@@ -330,9 +330,9 @@ HepMC::GenParticle* iGeant4::Geant4TruthIncident::convert(const G4Track *track,
       track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation()){
     // Then the new particle should use the same barcode as the old one!!
     PrimaryParticleInformation* ppi = dynamic_cast<PrimaryParticleInformation*>( track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation() );
-    newParticle->suggest_barcode( ppi->GetParticleBarcode() );
+    HepMC::suggest_barcode( newParticle, ppi->GetParticleBarcode() );
   } else {
-    newParticle->suggest_barcode( barcode );
+    HepMC::suggest_barcode( newParticle, barcode );
   }
 
   return newParticle;
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx
index 004621c581ab..3858d74020fc 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4Helper.cxx
@@ -11,6 +11,8 @@
 #include "G4EventManager.hh"
 #include "G4Event.hh"
 
+#include "AtlasHepMC/GenParticle.h"
+
 // G4Atlas includes
 #include "MCTruth/EventInformation.h"
 #include "MCTruth/TrackBarcodeInfo.h"
@@ -73,7 +75,7 @@ TrackInformation*
 iGeant4::ISFG4Helper::attachTrackInfoToNewG4Track( G4Track& aTrack,
                                                     const ISF::ISFParticle& baseIsp,
                                                     TrackClassification classification,
-                                                    HepMC::GenParticle *nonRegeneratedTruthParticle)
+                                                    HepMC::GenParticlePtr nonRegeneratedTruthParticle)
 {
   if ( aTrack.GetUserInformation() ) {
     G4ExceptionDescription description;
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx
index 76e11714b46f..b845ede14de0 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx
@@ -239,14 +239,14 @@ namespace G4UA{
 	m_scIn = creation? creation->GetProcessSubType() : -1;
 	
 	VTrackInformation * trackInfo= static_cast<VTrackInformation*>(track->GetUserInformation());
-	HepMC::GenParticle* genpart= trackInfo ? const_cast<HepMC::GenParticle*>(trackInfo->GetHepMCParticle()):0;
+	HepMC::GenParticlePtr genpart= trackInfo ? const_cast<HepMC::GenParticlePtr>(trackInfo->GetHepMCParticle()):0;
 	HepMC::GenVertex* vtx = genpart ? genpart->production_vertex() : 0;
 	m_gen = genpart? 0 : -1;
 	
 	if (genpart)  { // mc truth known
 	  while (genpart && vtx ) {
 	    int pdgID=genpart->pdg_id();
-	    HepMC::GenParticle* genmom = vtx->particles_in_size()>0 ? *(vtx->particles_in_const_begin()) : 0;
+	    HepMC::GenParticlePtr genmom = vtx->particles_in_size()>0 ? *(vtx->particles_in_const_begin()) : 0;
 	    if ( genmom && pdgID!=genmom->pdg_id() ) m_gen++;
 	    else if (vtx->particles_out_size()>0 && genpart!=*(vtx->particles_out_const_begin())) m_gen++;
 	    vtx = genmom ? genmom->production_vertex() : 0;
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx
index 3bdb378bcb9c..b69bec16eb8b 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx
@@ -93,7 +93,7 @@ void TrackProcessorUserActionBase::UserSteppingAction(const G4Step* aStep)
     // G4Tracks aready returned to ISF will have a TrackInformation attached to them
     bool particleReturnedToISF = trackInfo && trackInfo->GetReturnedToISF();
     if (!particleReturnedToISF) {
-      HepMC::GenParticle* generationZeroTruthParticle = nullptr;
+      HepMC::GenParticlePtr generationZeroTruthParticle{};
       ::iGeant4::ISFG4Helper::attachTrackInfoToNewG4Track( *aSecondaryTrack,
                                                 *m_curBaseISP,
                                                 Secondary,
@@ -191,8 +191,8 @@ void TrackProcessorUserActionBase::setupSecondary(const G4Track& aTrack)
   auto* trackInfo = ::iGeant4::ISFG4Helper::getISFTrackInfo(aTrack);
 
   // why does TrackInformation return *const* GenParticle and ISFParticle objects!?
-  auto* currentlyTracedTruthParticle = const_cast<HepMC::GenParticle*>( trackInfo->GetHepMCParticle() );
-  auto* primaryTruthParticle = const_cast<HepMC::GenParticle*>( trackInfo->GetPrimaryHepMCParticle() );
+  HepMC::GenParticlePtr currentlyTracedTruthParticle = const_cast<HepMC::GenParticlePtr>( trackInfo->GetHepMCParticle() );
+  HepMC::GenParticlePtr primaryTruthParticle = const_cast<HepMC::GenParticlePtr>( trackInfo->GetPrimaryHepMCParticle() );
   auto* baseISFParticle = const_cast<ISF::ISFParticle*>( trackInfo->GetBaseISFParticle() );
 
   setCurrentParticle(baseISFParticle, primaryTruthParticle, currentlyTracedTruthParticle);
@@ -200,8 +200,8 @@ void TrackProcessorUserActionBase::setupSecondary(const G4Track& aTrack)
 }
 
 void TrackProcessorUserActionBase::setCurrentParticle(ISF::ISFParticle* baseISFParticle,
-                                                      HepMC::GenParticle* truthPrimary,
-                                                      HepMC::GenParticle* truthCurrentlyTraced)
+                                                      HepMC::GenParticlePtr truthPrimary,
+                                                      HepMC::GenParticlePtr truthCurrentlyTraced)
 {
   m_curBaseISP = baseISFParticle;
   m_eventInfo->SetCurrentPrimary( truthPrimary );
@@ -210,9 +210,9 @@ void TrackProcessorUserActionBase::setCurrentParticle(ISF::ISFParticle* baseISFP
 }
 
 /// Classify the particle represented by the given set of truth links
-TrackClassification TrackProcessorUserActionBase::classify(const HepMC::GenParticle* primaryTruthParticle,
-                                                           const HepMC::GenParticle* generationZeroTruthParticle,
-                                                           const HepMC::GenParticle* currentlyTracedHepPart,
+TrackClassification TrackProcessorUserActionBase::classify(HepMC::ConstGenParticlePtr primaryTruthParticle,
+                                                           HepMC::ConstGenParticlePtr generationZeroTruthParticle,
+                                                           HepMC::ConstGenParticlePtr currentlyTracedHepPart,
                                                            int regenerationNumber) const
 {
   // if particle points to a non-zero truth particle it can not just be a 'simple' Secondary
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h
index c863ecf52383..e5b215a38262 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h
@@ -64,13 +64,13 @@ private:
 
   /// Set the following information as the currently traced particle
   void setCurrentParticle(ISF::ISFParticle* baseISFParticle,
-                          HepMC::GenParticle* truthPrimary,
-                          HepMC::GenParticle* truthCurrentlyTraced);
+                          HepMC::GenParticlePtr truthPrimary,
+                          HepMC::GenParticlePtr truthCurrentlyTraced);
 
   /// Classify the particle represented by the given set of truth links
-  TrackClassification classify(const HepMC::GenParticle* primaryTruthParticle,
-                               const HepMC::GenParticle* generationZeroTruthParticle,
-                               const HepMC::GenParticle* currentlyTracedHepPart,
+  TrackClassification classify(HepMC::ConstGenParticlePtr primaryTruthParticle,
+                               HepMC::ConstGenParticlePtr generationZeroTruthParticle,
+                               HepMC::ConstGenParticlePtr currentlyTracedHepPart,
                                int regenerationNumber) const;
 
   /// The most recent ISFParticle ancestor that triggers the currently processed G4Track
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx
index 4495398c580a..cb2774d20048 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.cxx
@@ -175,7 +175,7 @@ namespace G4UA {
         //               " and is returned to ISF.");
 
         const ISF::ISFParticle*    parent = curISP;
-        HepMC::GenParticle* truthParticle = m_eventInfo->GetCurrentlyTraced();
+        HepMC::GenParticlePtr truthParticle = m_eventInfo->GetCurrentlyTraced();
         this->returnParticleToISF(aTrack, parent, truthParticle, nextGeoID);
       }
 
@@ -214,13 +214,13 @@ namespace G4UA {
 
             // attach TrackInformation instance to the new secondary G4Track
             const ISF::ISFParticle *parent                  = curISP;
-            HepMC::GenParticle* generationZeroTruthParticle = nullptr;
+            HepMC::GenParticlePtr generationZeroTruthParticle = nullptr;
             ::iGeant4::ISFG4Helper::attachTrackInfoToNewG4Track( *aTrack_2nd,
                                                        *parent,
                                                        Secondary,
                                                        generationZeroTruthParticle );
 
-            HepMC::GenParticle* truthParticle = nullptr;
+            HepMC::GenParticlePtr truthParticle{};
             returnParticleToISF(aTrack_2nd, parent, truthParticle, nextGeoID_2nd);
           }
         }
@@ -230,7 +230,7 @@ namespace G4UA {
       return;
     }
 
-    ISF::TruthBinding* TrackProcessorUserActionPassBack::newTruthBinding(const G4Track* aTrack, HepMC::GenParticle* truthParticle) const
+    ISF::TruthBinding* TrackProcessorUserActionPassBack::newTruthBinding(const G4Track* aTrack, HepMC::GenParticlePtr truthParticle) const
     {
       auto* trackInfo = ::iGeant4::ISFG4Helper::getISFTrackInfo(*aTrack);
       if (!trackInfo) {
@@ -242,8 +242,8 @@ namespace G4UA {
         return nullptr; //The G4Exception call above should abort the job, but Coverity does not seem to pick this up.
       }
 
-      HepMC::GenParticle*         primaryHepParticle = const_cast<HepMC::GenParticle*>(trackInfo->GetPrimaryHepMCParticle());
-      HepMC::GenParticle*  generationZeroHepParticle = const_cast<HepMC::GenParticle*>(trackInfo->GetHepMCParticle());
+      HepMC::GenParticlePtr         primaryHepParticle = const_cast<HepMC::GenParticlePtr>(trackInfo->GetPrimaryHepMCParticle());
+      HepMC::GenParticlePtr  generationZeroHepParticle = const_cast<HepMC::GenParticlePtr>(trackInfo->GetHepMCParticle());
 
       ISF::TruthBinding* tBinding = new ISF::TruthBinding(truthParticle, primaryHepParticle, generationZeroHepParticle);
 
@@ -252,7 +252,7 @@ namespace G4UA {
 
     ISF::ISFParticle* TrackProcessorUserActionPassBack::newISFParticle(G4Track* aTrack,
                                                                        const ISF::ISFParticle* parentISP,
-                                                                       HepMC::GenParticle* truthParticle,
+                                                                       HepMC::GenParticlePtr truthParticle,
                                                                        AtlasDetDescr::AtlasRegion  nextGeoID)
     {
       ISF::TruthBinding* tBinding = newTruthBinding(aTrack, truthParticle);
@@ -271,7 +271,7 @@ namespace G4UA {
 
     void TrackProcessorUserActionPassBack::returnParticleToISF( G4Track *aTrack,
                                                                 const ISF::ISFParticle* parentISP,
-                                                                HepMC::GenParticle* truthParticle,
+                                                                HepMC::GenParticlePtr truthParticle,
                                                                 AtlasDetDescr::AtlasRegion nextGeoID )
     {
       // kill track inside G4
diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.h
index b54d7df05f46..f96fd65309ee 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.h
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBack.h
@@ -55,17 +55,17 @@ namespace G4UA{
       Config m_config;
 
       /** create a new TruthBinding object for the given G4Track (may return 0 if unable) */
-      ISF::TruthBinding* newTruthBinding(const G4Track* aTrack, HepMC::GenParticle* truthParticle) const;
+      ISF::TruthBinding* newTruthBinding(const G4Track* aTrack, HepMC::GenParticlePtr truthParticle) const;
 
       ISF::ISFParticle* newISFParticle(G4Track* aTrack,
                                        const ISF::ISFParticle* parent,
-                                       HepMC::GenParticle* truthParticle,
+                                       HepMC::GenParticlePtr truthParticle,
                                        AtlasDetDescr::AtlasRegion nextGeoID);
 
       /** kills the given G4Track, converts it into an ISFParticle and returns it to the ISF particle broker */
       void returnParticleToISF( G4Track *aTrack,
                                 const ISF::ISFParticle *parentISP,
-                                HepMC::GenParticle* truthParticle,
+                                HepMC::GenParticlePtr truthParticle,
                                 AtlasDetDescr::AtlasRegion nextGeoID );
 
       ISF::IParticleBroker                *m_particleBrokerQuick; //!< quickaccess avoiding gaudi ovehead
diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx
index 51531a82191c..f4a54d5845c4 100644
--- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx
+++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleGenericFilter.cxx
@@ -85,7 +85,7 @@ bool ISF::GenParticleGenericFilter::pass(const HepMC::GenParticle& particle) con
 {
   bool pass = true;
 
-  const auto* productionVertex = particle.production_vertex();
+  HepMC::ConstGenVertexPtr productionVertex = particle.production_vertex();
   const auto* position = productionVertex ? &productionVertex->position() : nullptr;
   if (!position || position->perp()<=m_maxApplicableRadius) {
     pass = check_cuts_passed(particle);
diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx
index 2dbbb15df18a..597933ec224e 100644
--- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx
+++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticlePositionFilter.cxx
@@ -51,7 +51,7 @@ StatusCode  ISF::GenParticlePositionFilter::initialize()
 bool ISF::GenParticlePositionFilter::pass(const HepMC::GenParticle& particle) const
 {
   // the GenParticle production vertex
-  HepMC::GenVertex* vtx = particle.production_vertex();
+  HepMC::GenVertexPtr vtx = particle.production_vertex();
 
   // no production vertex?
   if (!vtx) {
diff --git a/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx b/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx
index eb164b1b07d5..d298c9de756c 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx
+++ b/Simulation/ISF/ISF_SimulationSelectors/src/ConeSimSelector.cxx
@@ -134,7 +134,7 @@ void ISF::ConeSimSelector::update(const ISFParticle& particle)
       if (truth)
         {
           // get GenParticle from truth binding
-          const HepMC::GenParticle* genParticle = truth->getTruthParticle();
+          HepMC::ConstGenParticlePtr genParticle = truth->getTruthParticle();
           if (!genParticle)
             {
               // cone conditions not fulfilled
@@ -142,13 +142,13 @@ void ISF::ConeSimSelector::update(const ISFParticle& particle)
             }
 
           // test whether any of the pdg codes is found in the genParticle history
-          const HepMC::GenParticle *relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives);
+          HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives);
 
           if (relative)
             {
               ATH_MSG_VERBOSE("Current particle has valid relative particle:"
                               << " (pdg=" << relative->pdg_id() << ","
-                              << " barcode=" << relative->barcode() << ")."
+                              << " barcode=" << HepMC::barcode(relative) << ")."
                               << " Will now check whether cone cuts apply" );
             }
           else
diff --git a/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx b/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx
index ac71596f1143..4bf6af110ea8 100644
--- a/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx
+++ b/Simulation/ISF/ISF_SimulationSelectors/src/TruthAssocSimSelector.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -69,11 +69,11 @@ bool  ISF::TruthAssocSimSelector::passSelectorCuts(const ISFParticle& particle)
   if (truth)
     {
       // get GenParticle from truth binding
-      const HepMC::GenParticle* genParticle = truth->getTruthParticle();
+      HepMC::ConstGenParticlePtr genParticle = truth->getTruthParticle();
       if (genParticle)
         {
           // test whether any of the pdg codes is found in the genParticle history
-          const HepMC::GenParticle* relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives);
+          HepMC::ConstGenParticlePtr relative = HepMCHelper::findRealtiveWithPDG( *genParticle, m_relation, m_relatives);
           // in case a relative was found
           if (relative)
             {
@@ -84,7 +84,7 @@ bool  ISF::TruthAssocSimSelector::passSelectorCuts(const ISFParticle& particle)
                               << " barcode=" << particle.barcode() << ")"
                               << " passes due relative particle"
                               << " (pdg=" << relative->pdg_id() << ","
-                              << " barcode=" << relative->barcode() << ")" );
+                              << " barcode=" << HepMC::barcode(*relative) << ")" );
               // selector cuts passed
               return true;
             } // found relative
-- 
GitLab


From 509eabd3e1890b53468e8b5a062313db1a975562 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:44:05 +0200
Subject: [PATCH 183/217] Migrate Frozen Showers packages to use
 (Const)GenParticlePtr

---
 .../LArG4/LArG4FastSimulation/src/LArFastShower.cxx       | 8 +++++---
 .../LArG4ShowerLib/LArG4ShowerLib/EtaEnergyShowerLib.h    | 2 +-
 .../LArG4ShowerLib/FCALDistEnergyShowerLib.h              | 2 +-
 .../LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h           | 2 +-
 .../LArG4/LArG4ShowerLib/LArG4ShowerLib/IShowerLib.h      | 2 +-
 .../LArG4/LArG4ShowerLib/LArG4ShowerLib/TestShowerLib.h   | 2 +-
 .../LArG4/LArG4ShowerLib/src/EtaEnergyShowerLib.cxx       | 8 ++++----
 .../LArG4/LArG4ShowerLib/src/FCALDistEnergyShowerLib.cxx  | 6 +++---
 .../LArG4ShowerLib/src/FCALDistEtaEnergyShowerLib.cxx     | 8 ++++----
 LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx    | 2 +-
 LArCalorimeter/LArG4/LArG4ShowerLib/src/TestShowerLib.cxx | 8 ++++----
 11 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
index 442c6d12bd16..467d4254b10c 100644
--- a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
+++ b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "LArFastShower.h"
@@ -9,6 +9,8 @@
 #include "LArG4Code/EnergySpot.h"
 
 #include "AtlasHepMC/GenEvent.h"
+#include "AtlasHepMC/GenParticle.h"
+#include "AtlasHepMC/GenVertex.h"
 #include "AtlasHepMC/IO_GenEvent.h"
 
 #include <stdexcept>
@@ -339,11 +341,11 @@ HepMC::GenEvent * LArFastShower::GetGenEvent(const G4FastTrack &fastTrack)
   // new event. Signal processing = 0, event number "next"
   HepMC::GenEvent* ge = new HepMC::GenEvent( 0, ++m_eventNum);
   // vertex. Position of the shower, time = 0
-  HepMC::GenVertex* gv = new HepMC::GenVertex(
+  HepMC::GenVertexPtr gv = HepMC::newGenVertexPtr(
       HepMC::FourVector(showerPos.x(), showerPos.y(), showerPos.z(), 0) );
   ge->add_vertex(gv);
   // particle. FourVector of the shower, pdgcode, status = 1
-  HepMC::GenParticle* gp = new HepMC::GenParticle(
+  HepMC::GenParticlePtr gp = HepMC::newGenParticlePtr(
       HepMC::FourVector(showerMom.x(), showerMom.y(), showerMom.z(), energy),
       pdgcode, 1 );
   gv->add_particle_out(gp);
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/EtaEnergyShowerLib.h b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/EtaEnergyShowerLib.h
index 435be4b500d5..a8f0f138f438 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/EtaEnergyShowerLib.h
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/EtaEnergyShowerLib.h
@@ -64,7 +64,7 @@ namespace ShowerLib {
     //! get average lateral spread of the showers for the given energy
     virtual double getContainmentR(const G4Track* track) const;
     //! store shower in the library
-    virtual bool storeShower(const HepMC::GenParticle* genParticle,const Shower* shower);
+    virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
     //! write library to ROOT file
     virtual bool writeToROOT(TFile* dest);
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEnergyShowerLib.h b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEnergyShowerLib.h
index ac9e383f3891..694886088cbb 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEnergyShowerLib.h
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEnergyShowerLib.h
@@ -65,7 +65,7 @@ namespace ShowerLib {
     //! get average lateral spread of the showers for the given energy
     virtual double getContainmentR(const G4Track* track) const;
     //! store shower in the library
-    virtual bool storeShower(const HepMC::GenParticle* genParticle,const Shower* shower);
+    virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
     //! write library to ROOT file
     virtual bool writeToROOT(TFile* dest);
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h
index c758abbb1a46..9b387c10e8b8 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h
@@ -67,7 +67,7 @@ namespace ShowerLib {
     //! get average lateral spread of the showers for the given energy
     virtual double getContainmentR(const G4Track* track) const;
     //! store shower in the library
-    virtual bool storeShower(const HepMC::GenParticle* genParticle,const Shower* shower);
+    virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
     //! write library to ROOT file
     virtual bool writeToROOT(TFile* dest);
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/IShowerLib.h b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/IShowerLib.h
index 81534967b0ae..c0a9948eeeab 100755
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/IShowerLib.h
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/IShowerLib.h
@@ -51,7 +51,7 @@ namespace ShowerLib {
     //! get average lateral spread of the showers for the given energy
     virtual double getContainmentR(const G4Track* track) const = 0;
     //! store shower in the library
-    virtual bool storeShower(const HepMC::GenParticle* genParticle,const Shower* shower) = 0;
+    virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower) = 0;
     //! write library to ROOT file
     virtual bool writeToROOT(TFile* dest) = 0;
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/TestShowerLib.h b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/TestShowerLib.h
index 6c6d50ba7176..55fafb1875b5 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/TestShowerLib.h
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/LArG4ShowerLib/TestShowerLib.h
@@ -52,7 +52,7 @@ namespace ShowerLib {
     //! get average lateral spread of the showers for the given energy
     virtual double getContainmentR(const G4Track* track) const;
     //! store shower in the library
-    virtual bool storeShower(const HepMC::GenParticle* genParticle,const Shower* shower);
+    virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
     //! write library to ROOT file
     virtual bool writeToROOT(TFile* dest);
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/EtaEnergyShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/EtaEnergyShowerLib.cxx
index b8b78ab2092e..e9966a343936 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/EtaEnergyShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/EtaEnergyShowerLib.cxx
@@ -1,13 +1,13 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
 // this header file
 #include "LArG4ShowerLib/EtaEnergyShowerLib.h"
 
-#include <HepMC/GenParticle.h>
-#include <HepMC/GenVertex.h>
+#include "AtlasHepMC/GenParticle.h"
+#include "AtlasHepMC/GenVertex.h"
 
 #include <sstream>
 #include <fstream>
@@ -356,7 +356,7 @@ namespace ShowerLib {
 	  return rezR/actualNumFS; //average Z size
   }
 
-  bool EtaEnergyShowerLib::storeShower(const HepMC::GenParticle* genParticle, const Shower* shower)
+  bool EtaEnergyShowerLib::storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower* shower)
   {
 	  if (m_filled) {
 		  std::cout << "ERROR: filled" << std::endl;
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEnergyShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEnergyShowerLib.cxx
index d8d14e2933ea..b4b87ac9521e 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEnergyShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEnergyShowerLib.cxx
@@ -6,8 +6,8 @@
 // this header file
 #include "LArG4ShowerLib/FCALDistEnergyShowerLib.h"
 
-#include <HepMC/GenParticle.h>
-#include <HepMC/GenVertex.h>
+#include "AtlasHepMC/GenParticle.h"
+#include "AtlasHepMC/GenVertex.h"
 
 #include <sstream>
 #include <fstream>
@@ -439,7 +439,7 @@ namespace ShowerLib {
 	  return rezR/actualNumFS; //average Z size
   }
 
-  bool FCALDistEnergyShowerLib::storeShower(const HepMC::GenParticle* genParticle, const Shower* shower)
+  bool FCALDistEnergyShowerLib::storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower* shower)
   {
 	  if (m_filled) {
 		  std::cout << "ERROR: filled" << std::endl;
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEtaEnergyShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEtaEnergyShowerLib.cxx
index ec7f55ecf86e..5fc382b61f46 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEtaEnergyShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/FCALDistEtaEnergyShowerLib.cxx
@@ -1,13 +1,13 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
 // this header file
 #include "LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h"
 
-#include <HepMC/GenParticle.h>
-#include <HepMC/GenVertex.h>
+#include "AtlasHepMC/GenParticle.h"
+#include "AtlasHepMC/GenVertex.h"
 
 #include <sstream>
 #include <fstream>
@@ -548,7 +548,7 @@ namespace ShowerLib {
 	  return rezR/actualNumFS; //average Z size
   }
 
-  bool FCALDistEtaEnergyShowerLib::storeShower(const HepMC::GenParticle* genParticle, const Shower* shower)
+  bool FCALDistEtaEnergyShowerLib::storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower* shower)
   {
 	  if (m_filled) {
 		  std::cout << "ERROR: filled" << std::endl;
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx
index 302778d85945..70db67bc4086 100755
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx
@@ -7,7 +7,7 @@
 #include "LArG4ShowerLib/IShowerLib.h"
 #include "TTree.h"
 #include "G4Track.hh"
-#include <HepMC/GenParticle.h>
+#include "AtlasHepMC/GenParticle.h"
 
 #include <sstream>
 
diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/TestShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/TestShowerLib.cxx
index e1cde46f1ec5..8d7489299806 100644
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/TestShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/TestShowerLib.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -7,8 +7,8 @@
 #include "LArG4ShowerLib/TestShowerLib.h"
 
 // CLHEP incldues
-#include <HepMC/GenParticle.h>
-#include <HepMC/GenVertex.h>
+#include "AtlasHepMC/GenParticle.h"
+#include "AtlasHepMC/GenVertex.h"
 
 //#include <algorithm>
 //#include <functional>
@@ -153,7 +153,7 @@ namespace ShowerLib {
 	  return 0.0;
   }
 
-bool TestShowerLib::storeShower(const HepMC::GenParticle* genParticle, const Shower* shower)
+bool TestShowerLib::storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower* shower)
   {
 	  if (m_filled) {
 		  std::cout << "ERROR: filled" << std::endl;
-- 
GitLab


From ba77fb24f4fc331260258f3771c2ec823dc895a1 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:45:29 +0200
Subject: [PATCH 184/217] Migrate BeamEffects package to use
 (Const)GenParticlePtr

---
 Simulation/BeamEffects/src/GenEventBeamEffectBooster.h | 2 +-
 Simulation/BeamEffects/src/GenEventRotator.h           | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
index c42f15a6e19f..2d0bb7469e20 100644
--- a/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
+++ b/Simulation/BeamEffects/src/GenEventBeamEffectBooster.h
@@ -57,7 +57,7 @@ namespace Simulation {
     /** calculate the transformations that we want to apply to the particles in the current GenEvent */
     StatusCode initializeGenEvent(CLHEP::HepLorentzRotation& transform) const;
     /** apply boost to individual GenParticles */
-    void boostParticle(HepMC::GenParticlePtr  p, const CLHEP::HepLorentzRotation& transform) const;
+    void boostParticle(HepMC::GenParticlePtr p, const CLHEP::HepLorentzRotation& transform) const;
 
     ServiceHandle<IAthRNGSvc>       m_rndGenSvc;
     ATHRNG::RNGWrapper*             m_randomEngine;             //!< Slot-local RNG
diff --git a/Simulation/BeamEffects/src/GenEventRotator.h b/Simulation/BeamEffects/src/GenEventRotator.h
index 0039316aaef5..682a9ff41053 100644
--- a/Simulation/BeamEffects/src/GenEventRotator.h
+++ b/Simulation/BeamEffects/src/GenEventRotator.h
@@ -4,10 +4,6 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// GenEventRotator.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
 #ifndef ISF_HEPMC_GENEVENTROTATOR_H
 #define ISF_HEPMC_GENEVENTROTATOR_H 1
 
-- 
GitLab


From 642d35730e304319ada7c99b4b18e5885ad5cb88 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:46:27 +0200
Subject: [PATCH 185/217] Migrate G4UserActions and TrackWriteFastSim packages
 to use (Const)GenParticlePtr

---
 .../G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx    | 4 ++--
 .../G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
index d5180ab1f8ba..cd95ed929b74 100644
--- a/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/AthenaTrackingAction.cxx
@@ -46,8 +46,8 @@ namespace G4UA
     {
       // Why a const_cast???
       // This is an ugly way to communicate the GenParticle...
-      HepMC::GenParticle* part =
-        const_cast<HepMC::GenParticle*>( trackHelper.GetTrackInformation()->
+      HepMC::GenParticlePtr part =
+        const_cast<HepMC::GenParticlePtr>( trackHelper.GetTrackInformation()->
                                          GetHepMCParticle() );
 
       // Assign the GenParticle to the EventInformation.
diff --git a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
index 67c21f18f55a..297f99d5f8e1 100644
--- a/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
+++ b/Simulation/G4Utilities/TrackWriteFastSim/src/NeutronFastSim.cxx
@@ -51,7 +51,7 @@ G4bool NeutronFastSim::ModelTrigger(const G4FastTrack& fastTrack)
 
   // Not a neutron... Pick it up if the primary had eta>6.0
   EventInformation *eventInfo=static_cast<EventInformation*>(G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
-  HepMC::GenParticle *gp = eventInfo->GetCurrentPrimary();
+  HepMC::GenParticlePtr gp = eventInfo->GetCurrentPrimary();
   if (fabs(gp->momentum().eta())>m_etaCut && gp->barcode()<200000){
     return true;
   } else {
-- 
GitLab


From ba0b83454e1f5bc2706ead2a16b78e86fb201ab4 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:48:15 +0200
Subject: [PATCH 186/217] Migrate TruthUtils package to use
 (Const)GenParticlePtr

---
 Generators/TruthUtils/TruthUtils/HepMCHelpers.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Generators/TruthUtils/TruthUtils/HepMCHelpers.h b/Generators/TruthUtils/TruthUtils/HepMCHelpers.h
index bca1fb0c476a..bc5035976049 100644
--- a/Generators/TruthUtils/TruthUtils/HepMCHelpers.h
+++ b/Generators/TruthUtils/TruthUtils/HepMCHelpers.h
@@ -30,7 +30,7 @@ namespace MC {
   /// The receipe for this is barcode < 200k and status = 1. Gen-stable particles decayed by
   /// G4 are not set to have status = 2 in ATLAS, but simply have more status = 1 children,
   /// with barcodes > 200k.
-  inline bool isGenStable(const HepMC::GenParticle* p) {
+  inline bool isGenStable(HepMC::ConstGenParticlePtr p) {
     return isGenStable(p->status(), p->barcode());
   }
 
@@ -39,7 +39,7 @@ namespace MC {
 
 
   /// @brief Identify if the particle is considered stable at the post-detector-sim stage
-  inline bool isSimStable(const HepMC::GenParticle* p) {
+  inline bool isSimStable(HepMC::ConstGenParticlePtr p) {
     if (p->status() != 1) return false;
     if (isGenStable(p)) return p->end_vertex() == NULL;
     return true;
@@ -48,25 +48,25 @@ namespace MC {
   /// @brief Identify if the particle is considered stable at the post-detector-sim stage
   /// @todo I'm sure this shouldn't be exactly the same as isGenStable, but it is...
   /// @deprecated Use isSimulStable: this function _will_ be removed!
-  inline bool isGenSimulStable(const HepMC::GenParticle* p) {
+  inline bool isGenSimulStable(HepMC::ConstGenParticlePtr p) {
     return isSimStable(p);
   }
 
 
   /// @brief Identify if the particle would not interact with the detector, i.e. not a neutrino or WIMP
-  inline bool isNonInteracting(const HepMC::GenParticle* p) {
+  inline bool isNonInteracting(HepMC::ConstGenParticlePtr p) {
     return MC::isNonInteracting(p->pdg_id()); //< From TruthUtils/PIDHelpers.h
   }
 
   /// @brief Identify if the particle could interact with the detector during the simulation, e.g. not a neutrino or WIMP
-  inline bool isSimInteracting(const HepMC::GenParticle* p) {
+  inline bool isSimInteracting(HepMC::ConstGenParticlePtr p) {
     if (! MC::isGenStable(p)) return false; //skip particles which the simulation would not see
     return !MC::isNonInteracting(p);
   }
 
   /// @brief Oddly-named alias for isSimInteracting
   /// @deprecated Use isSimInteracting: this function _will_ be removed!
-  inline bool isGenInteracting(const HepMC::GenParticle* p) {
+  inline bool isGenInteracting(HepMC::ConstGenParticlePtr p) {
     return isSimInteracting(p);
   }
 
-- 
GitLab


From 8cc87eda6790804b16c7178a7b34d253c13ef002 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:48:55 +0200
Subject: [PATCH 187/217] Migrate McEventCollectionFilter package to use
 (Const)GenParticlePtr

---
 .../src/McEventCollectionFilter.cxx           | 34 ++++++++-----------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx
index 0f100552ce32..0a6c9a1f7121 100644
--- a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx
+++ b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 //////////////////////////////////////////////////////////////////////////
@@ -176,12 +176,12 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){
   if (!m_outputTruthCollection.isValid()) m_outputTruthCollection = std::make_unique<McEventCollection>();
 
   //.......Create new particle (geantino) to link  hits from pileup
-  HepMC::GenParticle* genPart=new HepMC::GenParticle();
+  HepMC::GenParticlePtr genPart=HepMC::newGenParticlePtr();
   genPart->set_pdg_id(m_PileupPartPDGID); //Geantino
   genPart->set_status(1); //!< set decay status
-  genPart->suggest_barcode( std::numeric_limits<int32_t>::max() );
+  HepMC::suggest_barcode(genPart, std::numeric_limits<int32_t>::max() );
 
-  HepMC::GenVertex* genVertex=new HepMC::GenVertex();
+  HepMC::GenVertexPtr genVertex = HepMC::newGenVertexPtr();
   genVertex->add_particle_out(genPart);
 
   const HepMC::GenEvent* genEvt = *(m_inputTruthCollection->begin());
@@ -191,7 +191,7 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){
 
 
   //to set geantino vertex as a truth primary vertex
-  HepMC::GenVertex* hScatVx = genEvt->barcode_to_vertex(-3);
+  HepMC::GenVertexPtr hScatVx = genEvt->barcode_to_vertex(-3);
   if(hScatVx!=nullptr) {
     HepMC::FourVector pmvxpos=hScatVx->position();
     genVertex->set_position(pmvxpos);
@@ -211,33 +211,29 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){
   }
 
   if(!evt->vertices_empty()){
-    std::vector<HepMC::GenVertex *> vtxvec;
     HepMC::GenEvent::vertex_iterator itvtx = evt->vertices_begin();
     for (;itvtx != evt ->vertices_end(); ++itvtx ) {
-      evt->remove_vertex(*itvtx);
-      vtxvec.push_back((*itvtx));
-      //fix me: delete vertex pointer causes crash
-      //delete (*itvtx);
+      HepMC::GenVertexPtr vtx = *itvtx++;
+      evt->remove_vertex(vtx);
+      delete vtx;
     }
-    for(unsigned int i=0;i<vtxvec.size();i++)  delete vtxvec[i];
   }
 
   //--------------------------------------
   if(m_IsKeepTRTElect){
     for(int i=0;i<(int) m_elecBarcode.size();i++){
-      HepMC::GenParticle* thePart=genEvt->barcode_to_particle(m_elecBarcode[i]);
+      HepMC::GenParticlePtr thePart=genEvt->barcode_to_particle(m_elecBarcode[i]);
       if (!thePart){
         ATH_MSG_DEBUG( "Could not find particle for barcode " << m_elecBarcode[i] );
         continue;
       }
-      const HepMC::GenVertex* vx = thePart->production_vertex();
-      HepMC::GenParticle* thePart_new=new HepMC::GenParticle( thePart->momentum(),thePart->pdg_id(),
-                                                              thePart->status(),thePart->flow(),
-                                                              thePart->polarization() );
-      thePart_new->suggest_barcode(m_elecBarcode[i]);
+      HepMC::ConstGenVertexPtr vx = thePart->production_vertex();
+      HepMC::GenParticlePtr thePart_new = HepMC::newGenParticlePtr( thePart->momentum(),thePart->pdg_id(),
+                                                                    thePart->status());
+      HepMC::suggest_barcode(thePart_new, m_elecBarcode[i]);
 
       HepMC::FourVector pos= vx->position();
-      HepMC::GenVertex* vx_new=new HepMC::GenVertex(pos);
+      HepMC::GenVertexPtr vx_new = HepMC::newGenVertexPtr(pos);
       vx_new->add_particle_out(thePart_new);
       evt->add_vertex(vx_new);
     }
@@ -245,7 +241,7 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){
 
   //.....add new vertex with geantino
   evt->add_vertex(genVertex);
-  m_RefBarcode=genPart->barcode();
+  m_RefBarcode=HepMC::barcode(*genPart);
 
   m_outputTruthCollection->push_back(evt);
 
-- 
GitLab


From e7222ecd5a03d10e081265781b0a131a707e93e0 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 17:49:42 +0200
Subject: [PATCH 188/217] Migrate xAODTruthCnv package to use
 (Const)GenParticlePtr

---
 Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.cxx | 4 ++--
 Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.h   | 6 +++---
 Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx  | 4 ++--
 Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h    | 6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.cxx b/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.cxx
index f0ddf24c69f1..da157b9d0f6e 100644
--- a/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.cxx
+++ b/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.cxx
@@ -95,7 +95,7 @@ void HepMCTruthReader::printEvent(const HepMC::GenEvent* event) {
 
 // Print method for vertex - mimics the HepMC dump.
 // Particle print method called within here
-void HepMCTruthReader::printVertex(const HepMC::GenVertexPtr vertex) {
+void HepMCTruthReader::printVertex(HepMC::ConstGenVertexPtr vertex) {
   std::ios::fmtflags f( cout.flags() ); 
   cout << "GenVertex (" << vertex << "):";
   if (HepMC::barcode(vertex) != 0) {
@@ -221,7 +221,7 @@ void HepMCTruthReader::printVertex(const HepMC::GenVertexPtr vertex) {
 
 
 // Print method for particle - mimics the HepMC dump.
-void HepMCTruthReader::printParticle(const HepMC::GenParticlePtr particle) {
+void HepMCTruthReader::printParticle(HepMC::ConstGenParticlePtr particle) {
   std::ios::fmtflags f( cout.flags() ); 
   cout << " ";
   cout.width(9);
diff --git a/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.h b/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.h
index 9d835d2015d3..b47419c07d52 100644
--- a/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.h
+++ b/Event/xAOD/xAODTruthCnv/src/HepMCTruthReader.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef HEPMCTRUTHREADER_H
@@ -33,8 +33,8 @@ private:
   std::string m_hepMCContainerName;
 
   void printEvent(const HepMC::GenEvent*);
-  void printVertex(const HepMC::GenVertexPtr);
-  void printParticle(const HepMC::GenParticlePtr);
+  void printVertex(HepMC::ConstGenVertexPtr);
+  void printParticle(HepMC::ConstGenParticlePtr);
 
 }; // class HepMCTruthReader
 
diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx
index a651259d1591..8cf4b77177b4 100644
--- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx
+++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx
@@ -402,7 +402,7 @@ namespace xAODMaker {
     
     
     // A helper to set up a TruthVertex (without filling the ELs)
-    void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, const HepMC::GenVertexPtr gv) {
+    void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, HepMC::ConstGenVertexPtr gv) {
         tv->setId(gv->id());
         tv->setBarcode(HepMC::barcode(gv));
         
@@ -419,7 +419,7 @@ namespace xAODMaker {
     
     
     // A helper to set up a TruthParticle (without filling the ELs)
-    void xAODTruthCnvAlg::fillParticle(xAOD::TruthParticle* tp, const HepMC::GenParticlePtr gp) {
+    void xAODTruthCnvAlg::fillParticle(xAOD::TruthParticle* tp, HepMC::ConstGenParticlePtr gp) {
         tp->setPdgId(gp->pdg_id());
         tp->setBarcode(HepMC::barcode(gp));
         tp->setStatus(gp->status());
diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h
index 7dbd7ab41667..eff80d6621f0 100644
--- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h
+++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h
@@ -103,11 +103,11 @@ namespace xAODMaker {
       std::vector<ElementLink<xAOD::TruthParticleContainer> > outgoingEL;
     };
     /// Convenience handle for a map of vtx ptrs -> connected particles
-    typedef std::map<const HepMC::GenVertexPtr, VertexParticles> VertexMap;
+    typedef std::map<HepMC::ConstGenVertexPtr, VertexParticles> VertexMap;
 
     /// These functions do not set up ELs, just the other variables
-    static void fillVertex(xAOD::TruthVertex *tv, const HepMC::GenVertexPtr gv);
-    static void fillParticle(xAOD::TruthParticle *tp, const HepMC::GenParticlePtr gp);
+    static void fillVertex(xAOD::TruthVertex *tv, HepMC::ConstGenVertexPtr gv);
+    static void fillParticle(xAOD::TruthParticle *tp, HepMC::ConstGenParticlePtr gp);
 
     /// The key of the input AOD truth container
     SG::ReadHandleKey<McEventCollection> m_aodContainerKey{ 
-- 
GitLab


From 8dd7078086895f48e0611bb146a99cdaa863c629 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 8 Jul 2020 13:21:08 +0200
Subject: [PATCH 189/217] Migrate TruthJiveXML package to use the
 HepMC::barcode helper method

---
 Simulation/TruthJiveXML/src/TruthTrackRetriever.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/TruthJiveXML/src/TruthTrackRetriever.cxx b/Simulation/TruthJiveXML/src/TruthTrackRetriever.cxx
index c73ae7f145a7..e924de32f091 100755
--- a/Simulation/TruthJiveXML/src/TruthTrackRetriever.cxx
+++ b/Simulation/TruthJiveXML/src/TruthTrackRetriever.cxx
@@ -108,7 +108,7 @@ namespace JiveXML {
         phi.push_back(DataType( (thePhi<0) ? thePhi+=2*M_PI : thePhi ));
         eta.push_back(DataType( particle->momentum().pseudoRapidity() ));
         code.push_back(DataType( particle->pdg_id() ));
-        id.push_back(DataType( particle->barcode() ));
+        id.push_back(DataType( HepMC::barcode(*particle) ));
 
         // Get the vertex information
         auto vertex =  particle->production_vertex();
-- 
GitLab


From 94788d353c7eb4b333c1565f8083d8ac8c917c50 Mon Sep 17 00:00:00 2001
From: James Richard Catmore <james.catmore@cern.ch>
Date: Thu, 9 Jul 2020 14:03:27 +0200
Subject: [PATCH 190/217] Updating copyright statement

---
 .../CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx b/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
index 788bd8ce51ff..5c0f3a0bbdad 100644
--- a/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
+++ b/PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/SGxAODProxyLoader.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /////////////////////////////////////////////////////////////////
-- 
GitLab


From 375e3ef3f14f3819fd28aa3f0fc613f19afcb8f4 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Tue, 7 Jul 2020 13:26:41 +0000
Subject: [PATCH 191/217] Merge branch 'perfSummary' into '21.3'

Create summary txt also for MuonPerformanceAlg and MuonSegmentPerformanceAlg

See merge request atlas/athena!34397
---
 .../test/test_muonrec_Run3_symmetric.sh       |   3 +-
 .../src/MuonPerformanceAlg.cxx                | 133 ++++++++----------
 .../src/MuonSegmentPerformanceAlg.cxx         |  75 +++++-----
 .../src/MuonSegmentPerformanceAlg.h           |   7 +-
 4 files changed, 104 insertions(+), 114 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrec_Run3_symmetric.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrec_Run3_symmetric.sh
index bbe74fd472c6..d21dc8b7d23c 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrec_Run3_symmetric.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrec_Run3_symmetric.sh
@@ -10,7 +10,8 @@
 # art-output: trkPerformance_ExtrapolatedMuonTracks.txt
 # art-output: trkPerformance_MSOnlyExtrapolatedMuonTracks.txt
 # art-output: trkPerformance_CombinedMuonTracks.txt
-# art-output: log.RAWtoESD
+# art-output: muonPerformance_segments.txt
+# art-output: muonPerformance_xAOD.txt
 # art-output: warningCount.txt
 # art-output: NSWRecoCheck.txt
 # art-output: NSWPRDValAlg.reco.ntuple.root
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonPerformanceAlg.cxx b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonPerformanceAlg.cxx
index ab5f240433e1..b348b0e8a151 100644
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonPerformanceAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonPerformanceAlg.cxx
@@ -2,16 +2,8 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-/***************************************************************************
-MuonPerformanceAlg
-***************************************************************************/
-
 #include "MuonPerformanceAlg.h"
 
-// STL includes
-#include <vector>
-
-// FrameWork includes
 #include "GaudiKernel/IToolSvc.h"
 
 #include "xAODMuon/Muon.h"
@@ -19,16 +11,12 @@ MuonPerformanceAlg
 #include "xAODTruth/TruthParticleContainer.h"
 #include "xAODTruth/TruthParticleAuxContainer.h"
 #include "AthenaBaseComps/AthCheckMacros.h"
-
 #include "xAODMuon/MuonSegmentContainer.h"
 #include "xAODMuon/MuonSegment.h"
 
+#include <vector>
 
-//#include "MuonID/MuonSelectionTool.h"
-
-//  CONSTRUCTOR:
-MuonPerformanceAlg::MuonPerformanceAlg(const std::string& name, ISvcLocator* pSvcLocator)
-  :
+MuonPerformanceAlg::MuonPerformanceAlg(const std::string& name, ISvcLocator* pSvcLocator) :
   AthAlgorithm(name, pSvcLocator),
   m_writeToFile (false),
   m_nevents(0),
@@ -38,12 +26,8 @@ MuonPerformanceAlg::MuonPerformanceAlg(const std::string& name, ISvcLocator* pSv
   declareProperty("writeToFile",        m_writeToFile = false);
   declareProperty("FileName",           m_fileName = "MuonPerformanceAlg.txt" );
   declareProperty("ConsideredPDGs",             m_pdgsToBeConsidered );
-
-
 }
 
-// INITIALIZE METHOD:
- 
 StatusCode MuonPerformanceAlg::initialize()
 {
 
@@ -600,81 +584,80 @@ void MuonPerformanceAlg::print(std::string txt, const xAOD::Muon* muon)
   ATH_MSG_DEBUG(txt << " run " << m_runNumber << " event " << m_eventNumber << std::endl  << " eta " << muon->eta() << " phi " << muon->phi() << " q*p (GeV) " << muon->charge()*p / 1000. << " pt (GeV) " << muon->pt() / 1000. << " precisionLayers " << nprec << " nr segments " << muon->nMuonSegments() );
 }
 
-/////////////////////////////////////////////////////////////////
-// ATHENA FINALIZE:
-
-
-StatusCode MuonPerformanceAlg::finalize()
-{
+StatusCode MuonPerformanceAlg::finalize() {
+  std::ofstream fileOutput;
+  std::string outfile = "muonPerformance_xAOD.txt";
+  fileOutput.open(outfile.c_str(), std::ios::trunc);
+  std::ostringstream sout;
+  sout.precision(4);
 
   unsigned int width = 9;
   unsigned int precision = 3;
 
-  msg(MSG::INFO) << std::endl;
-  msg(MSG::INFO) <<  " Summary of the xAOD Muon performance "  << std::endl;
-  msg(MSG::INFO) << "  Muon type  #Truth muons   Efficiency #Truth muons   Efficiency #Truth muons   Efficiency" << std::endl;
-  msg(MSG::INFO) << "                        (pt>2)                   (pt>5)                 (pt>10 GeV/c)    " << std::endl;
+  sout << std::endl;
+  sout <<  " Summary of the xAOD Muon performance "  << std::endl;
+  sout << "  Muon type  #Truth muons   Efficiency #Truth muons   Efficiency #Truth muons   Efficiency" << std::endl;
+  sout << "                        (pt>2)                   (pt>5)                 (pt>10 GeV/c)    " << std::endl;
   for ( unsigned int i = 0; i < 12; ++i ) {
     if (  m_ntruth[i] == 0  ) {
-      msg(MSG::INFO) << " " << std::endl;
+      sout << " " << std::endl;
     } else {
-      msg(MSG::INFO) << "    " << m_hitCutString[i];
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_ntruth[i]);
-      msg(MSG::INFO) << "       ";
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nfound[i]) / static_cast<double>(m_ntruth[i]);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_ntruth5[i]);
-      msg(MSG::INFO) << "       ";
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
+      sout << "    " << m_hitCutString[i];
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_ntruth[i]);
+      sout << "       ";
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nfound[i]) / static_cast<double>(m_ntruth[i]);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_ntruth5[i]);
+      sout << "       ";
+      sout << std::setw(width) << std::setprecision(precision);
       if (m_ntruth5[i] != 0) {
-        msg(MSG::INFO) << static_cast<double>(m_nfound5[i]) / static_cast<double>(m_ntruth5[i]);
-      } else msg(MSG::INFO) << 0.;
+        sout << static_cast<double>(m_nfound5[i]) / static_cast<double>(m_ntruth5[i]);
+      } else sout << 0.;
 
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_ntruth10[i]);
-      msg(MSG::INFO) << "       ";
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_ntruth10[i]);
+      sout << "       ";
+      sout << std::setw(width) << std::setprecision(precision);
       if (m_ntruth10[i] != 0) {
-        msg(MSG::INFO) << static_cast<double>(m_nfound10[i]) / static_cast<double>(m_ntruth10[i]) << std::endl;
-      } else msg(MSG::INFO) << 0. << std::endl;
+        sout << static_cast<double>(m_nfound10[i]) / static_cast<double>(m_ntruth10[i]) << std::endl;
+      } else sout << 0. << std::endl;
     }
   }
-  msg(MSG::INFO) << " The efficiency of the ID is calculated inside |eta| < 2 for the MCP ID hit selection cuts (it uses identified - Combined, Tagged or CaloTagged - muons with an ID track)" << std::endl;
-  msg(MSG::INFO) << " The efficiencies for CB all, MuidCB, MuGirl, Tag and Calo include the MCP ID cuts" << std::endl;
-  msg(MSG::INFO) << " The Tight, Medium and Loose efficiencies include MCP ID cuts for muons |eta| < 2" << std::endl;
-  msg(MSG::INFO) << " The SA 2.0 for |eta| >2 and SA (no ID) for |eta| < 2  doesnot include MCP ID cuts" << std::endl;
-  msg(MSG::INFO) << " The Combined efficiency is defined ID tracks after MCP cuts and requiring at least 1 muon station at truth level" << std::endl;
-  msg(MSG::INFO) << " Fakes are calculated with the selections listed above" << std::endl;
-  msg(MSG::INFO) << std::endl;
-
-  msg(MSG::INFO) << "  Muon type #Fake muons rate #Fake muons rate  #Fake muons rate   " << std::endl;
-  msg(MSG::INFO) << "             (all pt>0,2)           (pt>5)        (pt>10 GeV/c)    " << std::endl;
+  sout << " The efficiency of the ID is calculated inside |eta| < 2 for the MCP ID hit selection cuts (it uses identified - Combined, Tagged or CaloTagged - muons with an ID track)" << std::endl;
+  sout << " The efficiencies for CB all, MuidCB, MuGirl, Tag and Calo include the MCP ID cuts" << std::endl;
+  sout << " The Tight, Medium and Loose efficiencies include MCP ID cuts for muons |eta| < 2" << std::endl;
+  sout << " The SA 2.0 for |eta| >2 and SA (no ID) for |eta| < 2  doesnot include MCP ID cuts" << std::endl;
+  sout << " The Combined efficiency is defined ID tracks after MCP cuts and requiring at least 1 muon station at truth level" << std::endl;
+  sout << " Fakes are calculated with the selections listed above" << std::endl;
+  sout << std::endl;
+
+  sout << "  Muon type #Fake muons rate #Fake muons rate  #Fake muons rate   " << std::endl;
+  sout << "             (all pt>0,2)           (pt>5)        (pt>10 GeV/c)    " << std::endl;
   for ( unsigned int i = 0; i < 11; ++i ) {
     if (i == 6) continue;
     if (  m_nevents == 0 ) {
-      msg(MSG::INFO) << " " << std::endl;
+      sout << " " << std::endl;
     } else {
-      msg(MSG::INFO) << "  " << m_hitCutString[i];
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nreco[i] - m_nfoundr[i]);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nreco[i] - m_nfoundr[i]) / static_cast<double>(m_nevents);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nreco5[i] - m_nfoundr5[i]);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nreco5[i] - m_nfoundr5[i]) / static_cast<double>(m_nevents);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) << static_cast<double>(m_nreco10[i] - m_nfoundr10[i]);
-      msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-      msg(MSG::INFO) <<  static_cast<double>(m_nreco10[i] - m_nfoundr10[i]) / static_cast<double>(m_nevents) << std::endl;
+      sout << "  " << m_hitCutString[i];
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco[i] - m_nfoundr[i]);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco[i] - m_nfoundr[i]) / static_cast<double>(m_nevents);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco5[i] - m_nfoundr5[i]);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco5[i] - m_nfoundr5[i]) / static_cast<double>(m_nevents);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco10[i] - m_nfoundr10[i]);
+      sout << std::setw(width) << std::setprecision(precision);
+      sout << static_cast<double>(m_nreco10[i] - m_nfoundr10[i]) / static_cast<double>(m_nevents) << std::endl;
     }
   }
-
-  msg(MSG::INFO) << std::endl;
-  msg(MSG::INFO) << endmsg;
-
+  sout << std::endl;
+  fileOutput << sout.str() << std::endl;
+  fileOutput.close();
   return StatusCode::SUCCESS;
 }
 
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.cxx b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.cxx
index 0ae21a4924f2..ea05793b3312 100644
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "MuonSegmentPerformanceAlg.h"
+
 #include "xAODMuon/MuonSegmentContainer.h"
 #include "xAODMuon/MuonSegment.h"
 #include "MuonStationIndex/MuonStationIndex.h"
@@ -19,7 +20,6 @@ MuonSegmentPerformanceAlg::MuonSegmentPerformanceAlg(const std::string& name, IS
   declareProperty("TruthSegmentLocation", m_truthSegmentKey);
   declareProperty("writeToFile",          m_writeToFile = false);
   declareProperty("FileName",             m_fileName = "MuonSegmentPerformanceAlg.txt" );
-
 }
  
 StatusCode MuonSegmentPerformanceAlg::initialize()
@@ -108,68 +108,75 @@ StatusCode MuonSegmentPerformanceAlg::execute()
   
 }
 
-void MuonSegmentPerformanceAlg::printRatio( std::string prefix, unsigned int begin, unsigned int end, 
+std::string MuonSegmentPerformanceAlg::printRatio( std::string prefix, unsigned int begin, unsigned int end, 
                                             const std::vector<int> reco, const std::vector<int> truth ) const {
-
+  std::ostringstream sout;
   unsigned int width = 9;
   unsigned int precision = 3;
-  msg(MSG::INFO) << std::endl << prefix;
+  sout << std::endl << prefix;
   for( unsigned int i=begin;i<end;++i ){
-    msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-    if(  truth[i] == 0 ) msg(MSG::INFO) << " ";
-    else                 msg(MSG::INFO) <<  static_cast<double>(reco[i])/static_cast<double>(truth[i]);
+    sout << std::setw(width) << std::setprecision(precision);
+    if(  truth[i] == 0 ) sout << " ";
+    else                 sout << static_cast<double>(reco[i])/static_cast<double>(truth[i]);
   }
-  msg(MSG::INFO) << std::endl << " #Events        " << " ";
+  sout << std::endl << " #Events        " << " ";
   for( unsigned int i=begin;i<end;++i ){
-    msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-    if(  truth[i] == 0 ) msg(MSG::INFO) << " ";
-    else                
-     msg(MSG::INFO) << static_cast<double>(truth[i]);
+    sout << std::setw(width) << std::setprecision(precision);
+    if(  truth[i] == 0 ) sout << " ";
+    else sout << static_cast<double>(truth[i]);
   }
+  return sout.str();
 }
-void MuonSegmentPerformanceAlg::printRatio( std::string prefix, unsigned int begin, unsigned int end, 
+std::string MuonSegmentPerformanceAlg::printRatio( std::string prefix, unsigned int begin, unsigned int end, 
                                             const std::vector<int> reco ) const {
-
+  std::ostringstream sout;
   unsigned int width = 9;
   unsigned int precision = 3;
-  msg(MSG::INFO) << std::endl << prefix;
+  sout << std::endl << prefix;
   for( unsigned int i=begin;i<end;++i ){
-    msg(MSG::INFO) << std::setw(width) << std::setprecision(precision);
-    if(  m_nevents == 0 ) msg(MSG::INFO) << " ";
-    else                  msg(MSG::INFO) <<  static_cast<double>(reco[i])/static_cast<double>(m_nevents);
+    sout << std::setw(width) << std::setprecision(precision);
+    if(  m_nevents == 0 ) sout << " ";
+    else                  sout << static_cast<double>(reco[i])/static_cast<double>(m_nevents);
   }
+  return sout.str();
 }
 
-StatusCode MuonSegmentPerformanceAlg::finalize() 
+StatusCode MuonSegmentPerformanceAlg::finalize() {
+  std::ofstream fileOutput;
+  std::string outfile = "muonPerformance_segments.txt";
+  fileOutput.open(outfile.c_str(), std::ios::trunc);
+  std::ostringstream sout;
+  sout.precision(4);
 
-{
   unsigned int width = 9;
-  msg(MSG::INFO) << " Segment finding efficiencies barrel " << std::endl;
-  msg(MSG::INFO)         << " Chambers        ";
+  sout << "Segment finding efficiencies barrel" << std::endl;
+  sout << " Chambers        ";
   std::string prefix_eff  = " Efficiency ";
   std::string prefix_fake = " Fake rate  ";
-  for( unsigned int i=0;i<Muon::MuonStationIndex::BEE;++i ) msg(MSG::INFO) << std::setw(width) << Muon::MuonStationIndex::chName((Muon::MuonStationIndex::ChIndex)i);
+  for( unsigned int i=0;i<Muon::MuonStationIndex::BEE;++i ) sout << std::setw(width) << Muon::MuonStationIndex::chName((Muon::MuonStationIndex::ChIndex)i);
   for( unsigned int j=0;j<m_nfound.size();++j ){
-    printRatio(prefix_eff+m_hitCutString[j],0,Muon::MuonStationIndex::BEE,m_nfound[j],m_ntruth[j]); 
+    sout << printRatio(prefix_eff+m_hitCutString[j],0,Muon::MuonStationIndex::BEE,m_nfound[j],m_ntruth[j]); 
   }
-  msg(MSG::INFO) << std::endl;
+  sout << std::endl;
   for( unsigned int j=0;j<m_nfound.size();++j ){
-    printRatio(prefix_fake+m_hitCutString[j],0,Muon::MuonStationIndex::BEE,m_nfake[j]); 
+    sout << printRatio(prefix_fake+m_hitCutString[j],0,Muon::MuonStationIndex::BEE,m_nfake[j]); 
   }
-  msg(MSG::INFO) << std::endl << endmsg;
+  sout << std::endl;
 
-  msg(MSG::INFO) << " Segment finding efficiencies endcaps " << std::endl;
-  msg(MSG::INFO) << " Chambers        ";
+  sout << "Segment finding efficiencies endcaps" << std::endl;
+  sout << " Chambers        ";
   for( unsigned int i=Muon::MuonStationIndex::BEE;i<Muon::MuonStationIndex::ChIndexMax;++i ) 
-    msg(MSG::INFO) << std::setw(width) << Muon::MuonStationIndex::chName((Muon::MuonStationIndex::ChIndex)i);
+    sout << std::setw(width) << Muon::MuonStationIndex::chName((Muon::MuonStationIndex::ChIndex)i);
   for( unsigned int j=0;j<m_nfound.size();++j ){
-    printRatio(prefix_eff+m_hitCutString[j],Muon::MuonStationIndex::BEE,Muon::MuonStationIndex::ChIndexMax,m_nfound[j],m_ntruth[j]); 
+    sout << printRatio(prefix_eff+m_hitCutString[j],Muon::MuonStationIndex::BEE,Muon::MuonStationIndex::ChIndexMax,m_nfound[j],m_ntruth[j]); 
   }
-  msg(MSG::INFO) << std::endl;
+  sout << std::endl;
   for( unsigned int j=0;j<m_nfound.size();++j ){
-    printRatio(prefix_fake+m_hitCutString[j],Muon::MuonStationIndex::BEE,Muon::MuonStationIndex::ChIndexMax,m_nfake[j]); 
+    sout << printRatio(prefix_fake+m_hitCutString[j],Muon::MuonStationIndex::BEE,Muon::MuonStationIndex::ChIndexMax,m_nfake[j]); 
   }
-  msg(MSG::INFO) << endmsg;
+  sout << std::endl;
+  fileOutput << sout.str() << std::endl;
+  fileOutput.close();
   return StatusCode::SUCCESS;
 }
 
diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.h b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.h
index 4be9ca01a799..8e803c66015b 100644
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonSegmentPerformanceAlg.h
@@ -17,18 +17,17 @@ class MuonSegmentPerformanceAlg : public AthAlgorithm {
   
   // Algorithm Constructor
   MuonSegmentPerformanceAlg (const std::string &name, ISvcLocator *pSvcLocator);
-  ~MuonSegmentPerformanceAlg(){};
+  ~MuonSegmentPerformanceAlg()=default;
   
   // Gaudi algorithm hooks
   StatusCode initialize();
   StatusCode execute();
   StatusCode finalize();
 
-  
  private:
   bool retrieve(const SG::ReadHandleKey<xAOD::MuonSegmentContainer>&, const xAOD::MuonSegmentContainer*& ptr) const;
-  void printRatio( std::string prefix, unsigned int begin, unsigned int end, const std::vector<int> reco, const std::vector<int> truth ) const;
-  void printRatio( std::string prefix, unsigned int begin, unsigned int end, const std::vector<int> reco ) const;
+  std::string printRatio( std::string prefix, unsigned int begin, unsigned int end, const std::vector<int> reco, const std::vector<int> truth ) const;
+  std::string printRatio( std::string prefix, unsigned int begin, unsigned int end, const std::vector<int> reco ) const;
 
 
   /** name of external file to write statistics */
-- 
GitLab


From a1f2446df019221fe877c63d20baf7d5345253bd Mon Sep 17 00:00:00 2001
From: Marcin Nowak <Marcin.Nowak@cern.ch>
Date: Thu, 9 Jul 2020 19:27:35 +0200
Subject: [PATCH 192/217] Add locking to the source AuxContainer when making a
 copy of it

ATEAM-624 and ATEAM-626 show job failures that we suspect were caused by
modifying AuxSelection at the same time other thread tried to make a
copy of the same AuxContainer.
---
 Event/xAOD/xAODCore/Root/AuxContainerBase.cxx   | 17 ++++++++++-------
 Event/xAOD/xAODCore/Root/AuxInfoBase.cxx        | 17 +++++++++++------
 .../xAOD/xAODCore/Root/ShallowAuxContainer.cxx  | 16 ++++++++++------
 3 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
index 361aca988a3c..c1da5654a1b8 100644
--- a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
+++ b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
@@ -48,21 +48,22 @@ namespace xAOD {
    ///
    AuxContainerBase::AuxContainerBase( const AuxContainerBase& parent )
       : SG::IAuxStore(),
-        m_selection( parent.m_selection ),
-        m_compression( parent.m_compression ),
         m_auxids(), m_vecs(), m_store( 0 ), m_storeIO( 0 ),
         m_ownsStore( true ),
-        m_locked( false ),
-        m_name( parent.m_name ) {
+        m_locked( false )
+   {
+      // Keep the source unmutable during copy
+      guard_t guard( parent.m_mutex );
+      m_selection = parent.m_selection;
+      m_compression = parent.m_compression;
+      m_name = parent.m_name;
 
       // Unfortunately the dynamic variables can not be copied this easily...
       if( parent.m_store ) {
          // cppcheck-suppress copyCtorPointerCopying
-         m_store = parent.m_store;
          m_ownsStore = false;
+         m_store = parent.m_store;
          m_storeIO = dynamic_cast< SG::IAuxStoreIO* >( m_store );
-         m_selection = parent.m_selection;
-         m_compression = parent.m_compression;
          m_auxids = m_store->getAuxIDs();
       }
    }
@@ -111,6 +112,8 @@ namespace xAOD {
       // Protect against self-assignment:
       if( this == &rhs ) return *this;
 
+      // Keep the source unmutable during copy
+      guard_t guard( rhs.m_mutex );
       m_selection = rhs.m_selection;
       m_compression = rhs.m_compression;
 
diff --git a/Event/xAOD/xAODCore/Root/AuxInfoBase.cxx b/Event/xAOD/xAODCore/Root/AuxInfoBase.cxx
index 7b436ed8022d..65a86d6a007e 100644
--- a/Event/xAOD/xAODCore/Root/AuxInfoBase.cxx
+++ b/Event/xAOD/xAODCore/Root/AuxInfoBase.cxx
@@ -47,19 +47,21 @@ namespace xAOD {
    ///
    AuxInfoBase::AuxInfoBase( const AuxInfoBase& parent )
       : SG::IAuxStore(),
-        m_selection( parent.m_selection ),
         m_auxids(), m_vecs(), m_store( 0 ), m_storeIO( 0 ),
         m_ownsStore( true ),
-        m_locked( false ),
-        m_name( parent.m_name ) {
+        m_locked( false )
+   {
+      // Keep the source unmutable during copy
+      guard_t guard( parent.m_mutex );
+      m_selection = parent.m_selection;
+      m_name = parent.m_name;
 
       // Unfortunately the dynamic variables can not be copied this easily...
       if( parent.m_store ) {
          // cppcheck-suppress copyCtorPointerCopying
-         m_store = parent.m_store;
          m_ownsStore = false;
+         m_store = parent.m_store;
          m_storeIO = dynamic_cast< SG::IAuxStoreIO* >( m_store );
-         m_selection = parent.m_selection;
          m_auxids.insert( m_store->getAuxIDs().begin(),
                           m_store->getAuxIDs().end() );
       }
@@ -109,6 +111,9 @@ namespace xAOD {
       // Protect against self-assignment:
       if( this == &rhs ) return *this;
 
+      // Keep the source unmutable during copy
+      std::scoped_lock  lck{m_mutex, rhs.m_mutex};
+
       m_selection = rhs.m_selection;
 
       // Clean up after the old dynamic store:
@@ -122,8 +127,8 @@ namespace xAOD {
 
       // Take posession of the new dynamic store:
       if( rhs.m_store ) {
-         m_store = rhs.m_store;
          m_ownsStore = false;
+         m_store = rhs.m_store;
          m_storeIO = dynamic_cast< SG::IAuxStoreIO* >( m_store );
          m_auxids.insert (m_store->getAuxIDs());
       }
diff --git a/Event/xAOD/xAODCore/Root/ShallowAuxContainer.cxx b/Event/xAOD/xAODCore/Root/ShallowAuxContainer.cxx
index 40102f76d8f1..5db106afb16f 100644
--- a/Event/xAOD/xAODCore/Root/ShallowAuxContainer.cxx
+++ b/Event/xAOD/xAODCore/Root/ShallowAuxContainer.cxx
@@ -35,15 +35,17 @@ namespace xAOD {
 
    ShallowAuxContainer::ShallowAuxContainer( const ShallowAuxContainer& parent )
       : SG::IAuxStore(), SG::IAuxStoreIO(), SG::IAuxStoreHolder(),
-        m_selection( parent.m_selection ), 
         m_store( parent.m_store ), m_storeIO( parent.m_storeIO ),
         m_ownsStore( false ), m_locked( parent.m_locked ),
         m_parentLink( parent.m_parentLink ),
         m_parentIO( parent.m_parentIO ), m_shallowIO( parent.m_shallowIO ),
         m_auxids (),
-        m_auxidsValid (false),
-        m_name( parent.m_name ) {
-
+        m_auxidsValid (false)
+   {
+      // Keep the source unmutable during copy
+      guard_t guard( parent.m_mutex );
+      m_selection = parent.m_selection;
+      m_name = parent.m_name;
    }
 
    /// @param parent The parent object to make a shallow copy of
@@ -75,12 +77,14 @@ namespace xAOD {
    ShallowAuxContainer&
    ShallowAuxContainer::operator= ( const ShallowAuxContainer& rhs ) {
 
-      guard_t guard (m_mutex);
       // Check if anything needs to be done:
       if( this == &rhs ) {
          return *this;
       }
 
+      // Keep the source unmutable during copy
+      std::scoped_lock  lck{m_mutex, rhs.m_mutex};
+
       // Clean up if necessary:
       if( m_ownsStore && m_store ) {
          delete m_store;
@@ -88,9 +92,9 @@ namespace xAOD {
       }
 
       m_selection  = rhs.m_selection;
+      m_ownsStore  = false;
       m_store      = rhs.m_store;
       m_storeIO    = rhs.m_storeIO;
-      m_ownsStore  = false;
       m_locked     = rhs.m_locked;
       m_parentLink = rhs.m_parentLink;
       m_parentIO   = rhs.m_parentIO;
-- 
GitLab


From 017cd1558c5ed87b76e94839a3235fd2047f4e5b Mon Sep 17 00:00:00 2001
From: Marcin Nowak <Marcin.Nowak@cern.ch>
Date: Thu, 9 Jul 2020 20:02:14 +0200
Subject: [PATCH 193/217] Add double lock to copy operator like in the other
 containers

---
 Event/xAOD/xAODCore/Root/AuxContainerBase.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
index c1da5654a1b8..a99cbed3f892 100644
--- a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
+++ b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx
@@ -112,8 +112,8 @@ namespace xAOD {
       // Protect against self-assignment:
       if( this == &rhs ) return *this;
 
-      // Keep the source unmutable during copy
-      guard_t guard( rhs.m_mutex );
+      // Keep the objects locked during copy
+      std::scoped_lock  lck{m_mutex, rhs.m_mutex};
       m_selection = rhs.m_selection;
       m_compression = rhs.m_compression;
 
-- 
GitLab


From d8030ada1f386e91d19376c200a78d646b5486f6 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Thu, 9 Jul 2020 18:49:33 +0000
Subject: [PATCH 194/217] Add (some) missing configuration now
 MuonInsideOutTool has private sub-tools. Was causing ctest to fail.

---
 .../MuonConfig/python/MuonReconstructionConfig.py  |  5 ++++-
 .../MuonConfig/python/MuonSegmentFindingConfig.py  |  5 ++++-
 .../MuonConfig/python/MuonTrackBuildingConfig.py   |  5 ++++-
 .../python/MuonCombinedRecToolsConfig.py           | 14 +++++++++++++-
 .../python/MuonCombinedReconstructionConfig.py     |  5 ++++-
 5 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py b/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py
index aba689e3c1f0..25fb367cb01d 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonReconstructionConfig.py
@@ -66,4 +66,7 @@ if __name__=="__main__":
     f.close()
     
     if args.run:
-        cfg.run(20)
+        sc = cfg.run(20)
+        if not sc.isSuccess():
+            import sys
+            sys.exit("Execution failed")
diff --git a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
index 1b928fc2a789..b19192958cfa 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
@@ -747,5 +747,8 @@ if __name__=="__main__":
     f.close()
 
     if args.run:
-        cfg.run(20)
+        sc = cfg.run(20)
+        if not sc.isSuccess():
+            import sys
+            sys.exit("Execution failed")
     
diff --git a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
index 4dc77171ca12..04fdddd8b1a2 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py
@@ -560,5 +560,8 @@ if __name__=="__main__":
     f.close()
     
     if args.run:
-        cfg.run(20)
+        sc = cfg.run(20)
+        if not sc.isSuccess():
+            import sys
+            sys.exit("Execution failed")
         
diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
index 4789539dc431..5212352b1eb1 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py
@@ -866,6 +866,15 @@ def MuonInsideOutRecoToolCfg(flags, name="MuonInsideOutRecoTool", **kwargs ):
     kwargs.setdefault("TrackSummaryTool", acc.getPrimary())
     result.merge(acc)
 
+    acc = CombinedMuonTrackBuilderCfg(flags)
+    kwargs.setdefault("MuonTrackBuilder", acc.getPrimary())
+    result.merge(acc)
+
+    from MuonConfig.MuonRecToolsConfig import MuonAmbiProcessorCfg
+    acc = MuonAmbiProcessorCfg(flags)
+    kwargs.setdefault("TrackAmbiguityProcessor", acc.getPrimary())
+    result.merge(acc)
+
     tool = CompFactory.MuonCombined.MuonInsideOutRecoTool(name, **kwargs)
     result.setPrivateTools(tool)
     return result
@@ -893,11 +902,12 @@ def MuonSegmentSelectionToolCfg(flags, name="MuonSegmentSelectionTool", **kwargs
       kwargs.setdefault("GoodADCFractionCut",  0.5 )
       kwargs.setdefault("MinADCPerSegmentCut", 100 )
     result = ComponentAccumulator()
+    # kwargs.setdefault("Printer", MuonEDMPrinterTool(flags) ) # FIXME - needs property added.
+
     result.setPrivateTools(CompFactory.Muon.MuonSegmentSelectionTool(name, **kwargs))
     return result
 
 def MuonLayerAmbiguitySolverToolCfg(flags, name="MuonLayerAmbiguitySolverTool", **kwargs):
-    # Won't explicitly configure MuonEDMPrinterTool
     result = MuonSegmentSelectionToolCfg(flags)
     segment_selection_tool = result.popPrivateTools()
     kwargs.setdefault("MuonSegmentSelectionTool",segment_selection_tool)
@@ -917,6 +927,8 @@ def MuonLayerAmbiguitySolverToolCfg(flags, name="MuonLayerAmbiguitySolverTool",
     acc.addPublicTool(muon_segment_track_builder)
     result.merge(acc)
 
+    kwargs.setdefault("MuonEDMPrinterTool", MuonEDMPrinterTool(flags) ) 
+
     result.setPrivateTools(CompFactory.Muon.MuonLayerAmbiguitySolverTool(name, **kwargs))
     
     return result
diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedReconstructionConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedReconstructionConfig.py
index 023282907446..4533997e0466 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedReconstructionConfig.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedReconstructionConfig.py
@@ -398,5 +398,8 @@ if __name__=="__main__":
     # f.close()
     
     if args.run:
-        cfg.run(20)
+        sc = cfg.run(20)
+        if not sc.isSuccess():
+            import sys
+            sys.exit("Execution failed")
         
-- 
GitLab


From 22948df1453245a38b7351fdddb4be99bdb070e0 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:43:38 +0200
Subject: [PATCH 195/217] AthenaCommon: python3 fix

Need to pass a raw string to prctl, not a unicode string.
Otherwise, the process name get set to just `a'.
---
 Control/AthenaCommon/share/athena.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py
index 4efe84d8b747..f114cbed608e 100755
--- a/Control/AthenaCommon/share/athena.py
+++ b/Control/AthenaCommon/share/athena.py
@@ -147,7 +147,7 @@ try:
    import ctypes
    from ctypes.util import find_library as ctypes_find_library
    libc = ctypes.cdll.LoadLibrary( ctypes_find_library('c') )
-   libc.prctl( 15, 'athena.py', 0, 0, 0 )
+   libc.prctl( 15, b'athena.py', 0, 0, 0 )
 except Exception:
    pass            # don't worry about it failing ...
 
-- 
GitLab


From f66ec80444be4f03f6a750a89f0f107825773f5e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:48:45 +0200
Subject: [PATCH 196/217] MagFieldElements: Fix compilation with clang 10.

Need <cstdlib> for size_t.
---
 MagneticField/MagFieldElements/MagFieldElements/BFieldVectorZR.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MagneticField/MagFieldElements/MagFieldElements/BFieldVectorZR.h b/MagneticField/MagFieldElements/MagFieldElements/BFieldVectorZR.h
index 291e1a93f187..78c2b04de72e 100644
--- a/MagneticField/MagFieldElements/MagFieldElements/BFieldVectorZR.h
+++ b/MagneticField/MagFieldElements/MagFieldElements/BFieldVectorZR.h
@@ -14,6 +14,7 @@
 #ifndef BFIELDVECTORZR_H
 #define BFIELDVECTORZR_H
 #include <array>
+#include <cstdlib>
 class BFieldVectorZR
 {
 public:
-- 
GitLab


From a5ad52ae835326767b989298029ddf2481fdaa70 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 19 Jun 2020 15:11:38 +0200
Subject: [PATCH 197/217] ISF_FatrasToolsMS: cmake fixes

Library dependency fixes.
---
 Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt
index 2828ae54024c..350a0e1084a7 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt
@@ -31,5 +31,5 @@ atlas_add_component( ISF_FatrasToolsMS
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Identifier GaudiKernel MuonSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces MuonReadoutGeometry MuonIdHelpersLib ISF_Event ISF_InterfacesLib TrkTrack )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Identifier GaudiKernel MuonSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces MuonReadoutGeometry MuonIdHelpersLib ISF_Event ISF_InterfacesLib TrkTrack MuonTGRecToolsLib )
 
-- 
GitLab


From 5b48ce583e26492f1a701ce013fd2efdb491989d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:51:40 +0200
Subject: [PATCH 198/217] TRT_TrackExtensionTool_DAF: cmake fixes

Library dependency fixes.
---
 .../InDetRecTools/TRT_TrackExtensionTool_DAF/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/CMakeLists.txt b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/CMakeLists.txt
index d0219a51dd68..6c28c7b41d97 100644
--- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/CMakeLists.txt
@@ -33,7 +33,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_component( TRT_TrackExtensionTool_DAF
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetPrepRawData InDetRecToolInterfaces TrkGeometry TrkParameters StoreGateLib SGtests InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry MagFieldInterfaces TrkMeasurementBase TrkTrack TrkExInterfaces TrkToolInterfaces MagFieldElements MagFieldConditions )
+                     LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetPrepRawData InDetRecToolInterfaces TrkGeometry TrkParameters StoreGateLib SGtests InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry MagFieldInterfaces TrkMeasurementBase TrkTrack TrkExInterfaces TrkToolInterfaces MagFieldElements MagFieldConditions InDetCompetingRIOsOnTrackToolLib )
 
 # Install files from the package:
 atlas_install_headers( TRT_TrackExtensionTool_DAF )
-- 
GitLab


From 65f3ae1a3914d25524663460b3034bc7fba4a231 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:50:56 +0200
Subject: [PATCH 199/217] TRT_RawDataByteStreamCnv: cmake fix

Library dependency fix.
---
 .../InDetEventCnv/TRT_RawDataByteStreamCnv/CMakeLists.txt       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/CMakeLists.txt b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/CMakeLists.txt
index 5c04aa542f3c..fb69aad88341 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/CMakeLists.txt
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/CMakeLists.txt
@@ -39,7 +39,7 @@ atlas_add_component( TRT_RawDataByteStreamCnv
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${COOL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps Identifier ByteStreamData ByteStreamData_test InDetRawData AthenaKernel CxxUtils StoreGateLib SGtests AthenaPoolUtilities ByteStreamCnvSvcBaseLib GaudiKernel TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver IRegionSelector TrigSteeringEvent TRT_CablingLib )
+                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${COOL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps Identifier ByteStreamData ByteStreamData_test InDetRawData AthenaKernel CxxUtils StoreGateLib SGtests AthenaPoolUtilities ByteStreamCnvSvcBaseLib GaudiKernel TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver IRegionSelector TrigSteeringEvent TRT_CablingLib InDetByteStreamErrors )
 
 # Install files from the package:
 atlas_install_headers( TRT_RawDataByteStreamCnv )
-- 
GitLab


From 1cb25660a3bd5c42a12aac39668d418f2115be54 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:52:06 +0200
Subject: [PATCH 200/217] TrkTruthTrackAlgs: cmake fixes

Library dependency fixes.
---
 Tracking/TrkTruthTracks/TrkTruthTrackAlgs/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tracking/TrkTruthTracks/TrkTruthTrackAlgs/CMakeLists.txt b/Tracking/TrkTruthTracks/TrkTruthTrackAlgs/CMakeLists.txt
index 9288b5a2c159..756d66c76af8 100644
--- a/Tracking/TrkTruthTracks/TrkTruthTrackAlgs/CMakeLists.txt
+++ b/Tracking/TrkTruthTracks/TrkTruthTrackAlgs/CMakeLists.txt
@@ -21,5 +21,5 @@ atlas_add_component( TrkTruthTrackAlgs
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS 
-                     LINK_LIBRARIES AtlasHepMCLib AthenaBaseComps GaudiKernel TrkSegment TrkTrack TrkToolInterfaces )
+                     LINK_LIBRARIES AtlasHepMCLib AthenaBaseComps GaudiKernel TrkSegment TrkTrack TrkToolInterfaces TrkTruthTrackInterfaces )
 
-- 
GitLab


From 26f47eb4c11ddfdf40f888c50e14e76ec9bd341d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:48:54 +0200
Subject: [PATCH 201/217] MuonTGMeasAssocAlg: cmake fixes

Library dependency fixes.
---
 .../MuonDataPrep/MuonTGMeasAssocAlg/CMakeLists.txt              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/CMakeLists.txt
index 4948ce729107..867cbe907387 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/CMakeLists.txt
@@ -36,7 +36,7 @@ atlas_add_component( MuonTGMeasAssocAlg
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GeoPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData TrkGeometry TrkSurfaces TrkPrepRawData TrkSegment TrkTrack TrkExInterfaces EventPrimitives MuonSegment TrkEventPrimitives TrkMeasurementBase TrkParameters )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GeoPrimitives GaudiKernel MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData TrkGeometry TrkSurfaces TrkPrepRawData TrkSegment TrkTrack TrkExInterfaces EventPrimitives MuonSegment TrkEventPrimitives TrkMeasurementBase TrkParameters MuonTGRecToolsLib )
 
 # Install files from the package:
 atlas_install_headers( MuonTGMeasAssocAlg )
-- 
GitLab


From 7d7b09753b5c9ba0c3b201a7c0b2ec0cb99ac1a6 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Jul 2020 16:49:45 +0200
Subject: [PATCH 202/217] MuonRecToolInterfaces: cmake fixes

Library dependency fixes.
---
 .../MuonRecTools/MuonRecToolInterfaces/CMakeLists.txt           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/CMakeLists.txt
index d04101120140..a2819a865c1e 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/CMakeLists.txt
@@ -43,5 +43,5 @@ find_package( Eigen )
 atlas_add_library( MuonRecToolInterfaces
                    PUBLIC_HEADERS MuonRecToolInterfaces
                    INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives Identifier EventPrimitives xAODTracking GeneratorObjects GaudiKernel MuonClusterizationLib MuonLayerEvent MuonPattern MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonEDM_AssociationObjects MuonLayerHough MuonSimData MuonCombinedEvent TrkEventPrimitives TrkMeasurementBase TrkParameters TrkPrepRawData TrkTrack TrkTruthData TrkToolInterfaces TrkDriftCircleMath MuonStationIndexLib )
+                   LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives Identifier EventPrimitives xAODTracking GeneratorObjects GaudiKernel MuonClusterizationLib MuonLayerEvent MuonPattern MuonPrepRawData MuonRIO_OnTrack MuonSegment MuonEDM_AssociationObjects MuonLayerHough MuonSimData MuonCombinedEvent TrkEventPrimitives TrkMeasurementBase TrkParameters TrkPrepRawData TrkTrack TrkTruthData TrkToolInterfaces TrkDriftCircleMath MuonStationIndexLib TrkCompetingRIOsOnTrackToolLib )
 
-- 
GitLab


From 2b34566865f695c3bc4d85491f808616c39c486b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:51:20 +0200
Subject: [PATCH 203/217] AmdcDb: cmake fix

Library dependency fixes.
---
 MuonSpectrometer/Amdcsimrec/AmdcDb/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/CMakeLists.txt b/MuonSpectrometer/Amdcsimrec/AmdcDb/CMakeLists.txt
index 41cf14e3df45..752534760838 100644
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/CMakeLists.txt
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/CMakeLists.txt
@@ -25,7 +25,7 @@ atlas_add_library( AmdcDbLib
                    src/*.cxx
                    PUBLIC_HEADERS AmdcDb
                    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel StoreGateLib SGtests AmdcAthLib
+                   LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel StoreGateLib SGtests AmdcAthLib RDBAccessSvcLib
                    PRIVATE_LINK_LIBRARIES AmdcCore )
 
 atlas_add_component( AmdcDb
-- 
GitLab


From fea415cc05d0c0374dcf338f045c482662adba3e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:52:32 +0200
Subject: [PATCH 204/217] MMClusterization: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../src/ClusterTimeProjectionMMClusterBuilderTool.cxx           | 2 +-
 .../src/ConstraintAngleMMClusterBuilderTool.cxx                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ClusterTimeProjectionMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ClusterTimeProjectionMMClusterBuilderTool.cxx
index ed7991c1dec2..66260382ebf4 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ClusterTimeProjectionMMClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ClusterTimeProjectionMMClusterBuilderTool.cxx
@@ -105,7 +105,7 @@ StatusCode Muon::ClusterTimeProjectionMMClusterBuilderTool::clusterLayer(
         }
     }
     ATH_MSG_DEBUG("Found "<< idxClusters.size() <<" clusters");
-    for (const auto idxCluster : idxClusters) {
+    for (const auto& idxCluster : idxClusters) {
         ATH_MSG_DEBUG("cluster: "<< idxCluster);
     }
     return StatusCode::SUCCESS;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ConstraintAngleMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ConstraintAngleMMClusterBuilderTool.cxx
index 638f935ddc01..96936160fff4 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ConstraintAngleMMClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ConstraintAngleMMClusterBuilderTool.cxx
@@ -160,7 +160,7 @@ const{
         }
     }
     ATH_MSG_DEBUG("Found "<< idxClusters.size() <<" clusters");
-    for(const auto idxCluster:idxClusters){
+    for(const auto& idxCluster:idxClusters){
         ATH_MSG_DEBUG("cluster: "<< idxCluster);
     }
 
-- 
GitLab


From 5b41f784b84d12eabbbd0e54d8aadeccd48261b3 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:53:00 +0200
Subject: [PATCH 205/217] MuonStationIntersectSvc: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 .../MuonStationIntersectSvc/src/MuonStationIntersectSvc.cxx     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MuonStationIntersectSvc.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MuonStationIntersectSvc.cxx
index 3cf57ea24205..897379807caf 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MuonStationIntersectSvc.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonStationIntersectSvc/src/MuonStationIntersectSvc.cxx
@@ -41,7 +41,7 @@ const std::vector<std::unique_ptr<Muon::MdtIntersectGeometry> > MuonStationInter
   std::vector<std::unique_ptr<Muon::MdtIntersectGeometry> > stations;
 
   // loop over bins, retrieve geometry
-  for( const auto chId : chambers){
+  for( const auto& chId : chambers){
     if(dbData){
       if(!dbData->isGoodStation(chId)){
 	ATH_MSG_VERBOSE ("chamber "<<m_idHelperSvc->toString(chId)<<" is dead");
-- 
GitLab


From 7a7e4c0104d2ceba9fabbae9ed4ed73a46ebc9c9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:53:15 +0200
Subject: [PATCH 206/217] Valkyrie: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 Control/Valkyrie/src/ValgrindAuditor.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/Valkyrie/src/ValgrindAuditor.cxx b/Control/Valkyrie/src/ValgrindAuditor.cxx
index 176c106df3a6..22fb289dae03 100644
--- a/Control/Valkyrie/src/ValgrindAuditor.cxx
+++ b/Control/Valkyrie/src/ValgrindAuditor.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: ValgrindAuditor.cxx,v 1.4 2008-10-14 12:31:40 fwinkl Exp $
@@ -87,7 +87,7 @@ StatusCode ValgrindAuditor::initialize()
   m_eventCounter = 0;
 
   // Create regular expressions from algorithm names
-  for( const std::string re : m_algs ) {
+  for( const std::string& re : m_algs ) {
     try {
       m_algsRegEx.push_back( boost::regex(re) );
     }
-- 
GitLab


From 226e8a74e6f815f3e83c6cb11dbea579b80aeccb Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:54:02 +0200
Subject: [PATCH 207/217] AthenaMonitoring: Fix clang 10 warning.

Avoid spurious object copy in range for.
---
 Control/AthenaMonitoring/src/TriggerTranslatorSimple.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Control/AthenaMonitoring/src/TriggerTranslatorSimple.cxx b/Control/AthenaMonitoring/src/TriggerTranslatorSimple.cxx
index f666235f2bc1..547bc2c877c7 100644
--- a/Control/AthenaMonitoring/src/TriggerTranslatorSimple.cxx
+++ b/Control/AthenaMonitoring/src/TriggerTranslatorSimple.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AthenaMonitoring/TriggerTranslatorSimple.h"
@@ -20,7 +20,7 @@ TriggerTranslatorToolSimple::~TriggerTranslatorToolSimple() {}
 StatusCode TriggerTranslatorToolSimple::initialize() {
   std::vector<std::string> junk;
   //m_trigmap[""] = junk;
-  for(const auto item : m_trigmap_property) {
+  for(const auto& item : m_trigmap_property) {
     ATH_MSG_DEBUG( "Key " << item.first << " Value " << item.second );
     std::vector<std::string> triggers;
     boost::split(triggers, item.second, boost::is_any_of(","));
-- 
GitLab


From e5fb9780079178492a23eb9e4fbedf416eee9fd5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Jul 2020 18:54:17 +0200
Subject: [PATCH 208/217] AthContainers: Fix clang 10 warning.

Fix warning about deprecated implicit declarations.
---
 Control/AthContainers/AthContainers/tools/ElementProxy.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Control/AthContainers/AthContainers/tools/ElementProxy.h b/Control/AthContainers/AthContainers/tools/ElementProxy.h
index aacbf8675fa7..f1c5bd3ffd03 100644
--- a/Control/AthContainers/AthContainers/tools/ElementProxy.h
+++ b/Control/AthContainers/AthContainers/tools/ElementProxy.h
@@ -1,10 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file AthContainers/tools/ElementProxy.h
  * @author scott snyder <snyder@bnl.gov>
@@ -65,6 +62,10 @@ public:
                 DVL* container);
 
 
+  /// Default copy.
+  ElementProxy (const ElementProxy&) = default;
+
+
   /**
    * @brief Assignment operator, from an @c Element proxy.
    * @param rhs The proxy from which we're assigning.
-- 
GitLab


From fd5c90dd6ab33f50bdfe2c986aca4bcdc1de5cbf Mon Sep 17 00:00:00 2001
From: leggett <leggett@cern.ch>
Date: Thu, 9 Jul 2020 16:52:55 -0700
Subject: [PATCH 209/217] HiveEventLoopMgr: fully process first event before
 scheduling any others

---
 Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx | 7 +++++++
 Control/AthenaServices/src/AthenaHiveEventLoopMgr.h   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
index 0b5dc9dbd286..bb123abf9ed7 100644
--- a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
@@ -118,6 +118,9 @@ AthenaHiveEventLoopMgr::AthenaHiveEventLoopMgr(const std::string& nam,
   declareProperty("UseSecondaryEventNumber", m_useSecondaryEventNumber = false,
                   "In case of DoubleEventSelector use event number from secondary input");
 
+  declareProperty("FirstEventAlone", m_firstEventAlone = true,
+                  "process all of first event before scheduling any more");
+
   m_scheduledStop = false;
 
 }
@@ -785,6 +788,8 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
   bool loop_ended=false;
   StatusCode sc(StatusCode::SUCCESS,true);
 
+  bool newEvtAllowed = ! m_firstEventAlone;
+  
   // Calculate runtime
   auto start_time = tbb::tick_count::now();
   auto secsFromStart = [&start_time]()->double{
@@ -798,6 +803,7 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
     }
     
     if ( ( !m_terminateLoop ) && // The events are not finished with an unlimited number of events
+         (newEvtAllowed || createdEvts == 0) &&       // Launch first event alone
 	 ( (createdEvts < maxevt) or (maxevt<0) ) &&  // The events are not finished with a limited number of events
 	 (m_schedulerSvc->freeSlots()>0) ){ // There are still free slots in the scheduler
       
@@ -843,6 +849,7 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
       } else {
 	// keep going!
       }
+      newEvtAllowed = true;
       
     }
   } // end main loop on finished events  
diff --git a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.h b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.h
index e67cda50bd1b..bcf09819ce82 100644
--- a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.h
+++ b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.h
@@ -263,6 +263,7 @@ private:
   unsigned int m_proc;
   bool m_useTools;
   bool m_doEvtHeartbeat;
+  bool m_firstEventAlone;
 
   unsigned int m_flmbi, m_timeStampInt;
 
-- 
GitLab


From 3e34cc217df77239ac77758236b01f694b82004a Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 10 Jul 2020 07:46:59 +0200
Subject: [PATCH 210/217] Fix thread saferty warnings of PixelRTT package. Add
 ATLAS_NOT_THREAD_SAFE to ResPullValidation::Write and
 CosmicTrackValidation::Write because thread unsafe MultiHisto<ht>::Write
 method is used.

---
 .../InDetValidation/PixelRTT/src/ResPullValidation.cxx          | 2 +-
 InnerDetector/InDetValidation/PixelRTT/src/TrackValidation.cxx  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetValidation/PixelRTT/src/ResPullValidation.cxx b/InnerDetector/InDetValidation/PixelRTT/src/ResPullValidation.cxx
index e77b1b47899e..f3336ebb6b3f 100644
--- a/InnerDetector/InDetValidation/PixelRTT/src/ResPullValidation.cxx
+++ b/InnerDetector/InDetValidation/PixelRTT/src/ResPullValidation.cxx
@@ -146,7 +146,7 @@ int ResPullValidation::Read(){
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
-int ResPullValidation::Write(){
+int ResPullValidation::Write ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe MultiHisto<ht>::Write method is used.
 
 	TDirectory *current = gDirectory;
 	TDirectory *globaldir = current->mkdir(m_globaldirname.c_str());
diff --git a/InnerDetector/InDetValidation/PixelRTT/src/TrackValidation.cxx b/InnerDetector/InDetValidation/PixelRTT/src/TrackValidation.cxx
index 589120816c6f..e44c89561b1b 100644
--- a/InnerDetector/InDetValidation/PixelRTT/src/TrackValidation.cxx
+++ b/InnerDetector/InDetValidation/PixelRTT/src/TrackValidation.cxx
@@ -112,7 +112,7 @@ int CosmicTrackValidation::Read(){
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
-int CosmicTrackValidation::Write(){
+int CosmicTrackValidation::Write ATLAS_NOT_THREAD_SAFE (){ // Thread unsafe MultiHisto<ht>::Write method is used.
 
 	TDirectory *current = gDirectory;
 	TDirectory *globaldir = current->mkdir(m_globaldirname.c_str());
-- 
GitLab


From b5206a8036b8b6cbc88ebc873f05e0c1b8aad63b Mon Sep 17 00:00:00 2001
From: Georgios Stavropoulos <George.Stavropoulos@cern.ch>
Date: Fri, 10 Jul 2020 07:46:45 +0200
Subject: [PATCH 211/217] Builts the NSW chambers in the MuonDetectorCondAlg.

---
 .../src/MmRdoToPrepDataToolCore.cxx           | 17 ++--
 .../MuonDetDescr/MuonAGDD/CMakeLists.txt      |  3 +-
 .../MuonAGDD/src/MuonAGDDToolHelper.cxx       | 80 ++++---------------
 .../MuonAGDD/src/MuonAGDDToolHelper.h         |  1 -
 .../MuonDetDescrUtils/CMakeLists.txt          |  7 +-
 .../BuildNSWReadoutGeometry.h                 | 27 +++++++
 .../src/BuildNSWReadoutGeometry.cxx           | 72 +++++++++++++++++
 .../MuonGeoModel/src/MuonDetectorCondAlg.cxx  | 12 ++-
 8 files changed, 142 insertions(+), 77 deletions(-)
 create mode 100644 MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/MuonDetDescrUtils/BuildNSWReadoutGeometry.h
 create mode 100644 MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/src/BuildNSWReadoutGeometry.cxx

diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
index 9c714838d2aa..ae3cd588d9ec 100644
--- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataToolCore.cxx
@@ -97,6 +97,14 @@ StatusCode Muon::MmRdoToPrepDataToolCore::processCollection(const MM_RawDataColl
 
   }
 
+  // MuonDetectorManager from the conditions store
+  SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{m_muDetMgrKey};
+  const MuonGM::MuonDetectorManager* MuonDetMgr = DetectorManagerHandle.cptr(); 
+  if(MuonDetMgr==nullptr){
+    ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object");
+    return StatusCode::FAILURE;
+  }
+ 
   std::vector<MMPrepData> MMprds;
   // convert the RDO collection to a PRD collection
   MM_RawDataCollection::const_iterator it = rdoColl->begin();
@@ -119,14 +127,9 @@ StatusCode Muon::MmRdoToPrepDataToolCore::processCollection(const MM_RawDataColl
     Identifier prdId = m_idHelperSvc->mmIdHelper().channelID(parentID, m_idHelperSvc->mmIdHelper().multilayer(rdoId), m_idHelperSvc->mmIdHelper().gasGap(rdoId),channel);
     ATH_MSG_DEBUG(" channel RDO " << channel << " channel from rdoID " << m_idHelperSvc->mmIdHelper().channel(rdoId));
     rdoList.push_back(prdId);
-
-    // TODO: this needs to be replaced by SG::ReadCondHandle<MuonGM::MuonDetectorManager>
-    // will do it in a follow-up MR, since for now, we need to get the Run2 detectors running, so skip MicroMegas for now
-    const MuonGM::MuonDetectorManager* muDetMgrNominal=nullptr;
-    ATH_CHECK(detStore()->retrieve(muDetMgrNominal));
-
+ 
     // get the local and global positions
-    const MuonGM::MMReadoutElement* detEl = muDetMgrNominal->getMMReadoutElement(layid);
+    const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(layid);
     Amg::Vector2D localPos;
 
     bool getLocalPos = detEl->stripPosition(prdId,localPos);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/CMakeLists.txt b/MuonSpectrometer/MuonDetDescr/MuonAGDD/CMakeLists.txt
index 97a752a13617..9a138202eabb 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/CMakeLists.txt
@@ -30,6 +30,7 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/GeoModel/GeoModelInterfaces
                           MuonSpectrometer/MuonDetDescr/MuonAGDDBase
                           MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry
+			  MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils
                           ${extra_dep} )
 
 # External dependencies:
@@ -41,7 +42,7 @@ atlas_add_component( MuonAGDD
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AGDDControl GaudiKernel StoreGateLib SGtests AGDDKernel AGDDModel MuonAGDDBase MuonReadoutGeometry ${extra_lib}
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AGDDControl GaudiKernel StoreGateLib SGtests AGDDKernel AGDDModel MuonAGDDBase MuonReadoutGeometry MuonDetDescrUtils ${extra_lib}
                      PRIVATE_LINK_LIBRARIES AGDD2GeoSvcLib )
 
 # Install files from the package:
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
index 4312348750ca..0606e2b108e8 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
@@ -38,6 +38,8 @@
 #include "MuonAGDDBase/mmSpacer_TechHandler.h"
 #include "MuonAGDDBase/mm_readoutHandler.h"
 
+#include "MuonDetDescrUtils/BuildNSWReadoutGeometry.h"
+
 #include <TString.h> // for Form
 #include <fstream>
 
@@ -140,81 +142,29 @@ bool MuonAGDDToolHelper::BuildMScomponents() const
   if (svcLocator->service("DetectorStore",pDetStore).isFailure()) return false;
   MuonGM::MuonDetectorManager* muonMgr=nullptr;
   if (pDetStore->retrieve(muonMgr).isFailure()) return false;
-  bool readoutGeoDone =  BuildReadoutGeometry(muonMgr/*, GetMSdetectors*/);
+  BuildNSWReadoutGeometry theBuilder = BuildNSWReadoutGeometry();
+  bool readoutGeoDone =  theBuilder.BuildReadoutGeometry(muonMgr/*, GetMSdetectors*/);
   if (!readoutGeoDone) return false;
   return true;
 }
 
-bool MuonAGDDToolHelper::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*, std::map<GeoFullPhysVol*, std::string>* vec*/) const
-{
-  bool geoBuilt = true;  
-
-  detectorList& dList=AGDDDetectorStore::GetDetectorStore()->GetDetectorList();
-  detectorList::const_iterator it;
-  for (it=dList.begin(); it!=dList.end(); ++it)
-  {
-  	  std::vector<AGDDDetectorPositioner*>& dPos=((*it).second)->GetDetectorPositioners();
-	  for (unsigned int i=0;i<dPos.size();i++)
-      {
-      std::string chTag = dPos[i]->ID.detectorAddress;
-      GeoFullPhysVol* vol = dPos[i]->theVolume;
-      
-      std::string stName = chTag.substr(0,4);
-      
-      int etaIndex = 999;
-      int phiIndex = 999;
-      int mLayer   = 999;
-      int iSide    = 0;
-      int iLS      = atoi((chTag.substr(3,1)).c_str()); //sTG3 and sMD3 are small chambers for small sectors 
-      if (iLS==3) iLS = 1; // small 
-      else iLS = 0; // large 
-      if (chTag.substr(13,1)=="A") iSide=1;
-      else if (chTag.substr(13,1)=="C") iSide=-1;
-      etaIndex = iSide*atoi((chTag.substr(5,1)).c_str());
-      phiIndex = atoi((chTag.substr(12,1)).c_str());
-      mLayer = atoi((chTag.substr(7,1)).c_str());
-      
-      if (chTag.substr(0,3)=="sMD")
-	  {
-	  MMReadoutElement* re = new MMReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);
-	  std::string myVolName = (chTag.substr(0,8)).c_str();
-	  re->initDesign(-999., -999., -999., -999., -999.);
-	  re->fillCache();
-	  mgr->addMMReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
-    re->setDelta(mgr);
-	  }
-      else if (chTag.substr(0,3)=="sTG")
-	  {
-	  sTgcReadoutElement* re = new sTgcReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);	  
-	  std::string myVolName = (chTag.substr(0,8)).c_str();
-	  re->initDesign(-999., -999., -999., 3.2, -999., 2.7, -999., 2.6);
-	  re->fillCache();
-	  mgr->addsTgcReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
-    re->setDelta(mgr);
-	  }
-	  }
-  }
-  return geoBuilt;
-
-}
-
 void MuonAGDDToolHelper::SetNSWComponents()
 {
-	IAGDDtoGeoSvc* agddsvc = nullptr;
-	if (Gaudi::svcLocator()->service(m_svcName,agddsvc).isFailure()) {
+  IAGDDtoGeoSvc* agddsvc = nullptr;
+  if (Gaudi::svcLocator()->service(m_svcName,agddsvc).isFailure()) {
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonAGDDToolHelper::SetNSWComponents() - Could not retrieve %s from ServiceLocator", __FILE__, __LINE__, m_svcName.c_str()));
   }
 	
-	agddsvc->addHandler(new micromegasHandler("micromegas"));
-	agddsvc->addHandler(new mm_TechHandler("mm_Tech"));
-	agddsvc->addHandler(new sTGCHandler("sTGC"));
-	agddsvc->addHandler(new sTGC_readoutHandler("sTGC_readout"));
-	agddsvc->addHandler(new sTGC_TechHandler("sTGC_Tech"));
-	agddsvc->addHandler(new mmSpacerHandler("mmSpacer"));
-	agddsvc->addHandler(new mmSpacer_TechHandler("mmSpacer_Tech"));
-	agddsvc->addHandler(new mm_readoutHandler("mm_readout"));
+  agddsvc->addHandler(new micromegasHandler("micromegas"));
+  agddsvc->addHandler(new mm_TechHandler("mm_Tech"));
+  agddsvc->addHandler(new sTGCHandler("sTGC"));
+  agddsvc->addHandler(new sTGC_readoutHandler("sTGC_readout"));
+  agddsvc->addHandler(new sTGC_TechHandler("sTGC_Tech"));
+  agddsvc->addHandler(new mmSpacerHandler("mmSpacer"));
+  agddsvc->addHandler(new mmSpacer_TechHandler("mmSpacer_Tech"));
+  agddsvc->addHandler(new mm_readoutHandler("mm_readout"));
 }	
 
 void MuonAGDDToolHelper::setAGDDtoGeoSvcName(const std::string& name) {
   m_svcName = name;
-}
\ No newline at end of file
+}
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
index 7b65dbaea972..6eb8c90d3287 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
@@ -28,7 +28,6 @@ public:
 	std::string GetAGDD(const bool dumpIt, const std::string& tableName, const std::string& outFileName);
 	
 	bool BuildMScomponents() const;
-	bool BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr) const;
 
 	void setAGDDtoGeoSvcName(const std::string& name);
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/CMakeLists.txt b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/CMakeLists.txt
index 8ba3f4dd3d5e..95f1d167bdbb 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/CMakeLists.txt
@@ -7,7 +7,10 @@ atlas_subdir( MuonDetDescrUtils )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
-                          MuonSpectrometer/MuonStationIndex )
+                          MuonSpectrometer/MuonStationIndex
+			  PRIVATE
+			  DetectorDescription/AGDD/AGDDKernel
+			  MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry )
 
 # External dependencies:
 find_package( ROOT COMPONENTS RIO Tree Core MathCore Hist pthread )
@@ -18,7 +21,7 @@ atlas_add_library( MuonDetDescrUtils
                    PUBLIC_HEADERS MuonDetDescrUtils
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                    LINK_LIBRARIES MuonStationIndexLib
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AGDDKernel MuonReadoutGeometry )
 
 atlas_add_executable( MuonSectorMappingTest
                       exe/MuonSectorMappingTest.cxx
diff --git a/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/MuonDetDescrUtils/BuildNSWReadoutGeometry.h b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/MuonDetDescrUtils/BuildNSWReadoutGeometry.h
new file mode 100644
index 000000000000..37353f3e83fd
--- /dev/null
+++ b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/MuonDetDescrUtils/BuildNSWReadoutGeometry.h
@@ -0,0 +1,27 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef MUON_BUILDNSWREADOUTGEOMETRY_H
+#define MUON_BUILDNSWREADOUTGEOMETRY_H
+
+#include <vector>
+
+namespace MuonGM 
+{
+	class MuonDetectorManager;
+}
+
+class BuildNSWReadoutGeometry
+{
+public:
+  BuildNSWReadoutGeometry();
+	
+  bool BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr) const;
+
+private:
+
+	
+};
+
+#endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/src/BuildNSWReadoutGeometry.cxx b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/src/BuildNSWReadoutGeometry.cxx
new file mode 100644
index 000000000000..dc1648520d8a
--- /dev/null
+++ b/MuonSpectrometer/MuonDetDescr/MuonDetDescrUtils/src/BuildNSWReadoutGeometry.cxx
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonDetDescrUtils/BuildNSWReadoutGeometry.h"
+
+#include "MuonReadoutGeometry/MMReadoutElement.h"
+#include "MuonReadoutGeometry/sTgcReadoutElement.h"
+
+#include "AGDDKernel/AGDDDetector.h"
+#include "AGDDKernel/AGDDDetectorStore.h"
+
+#include <TString.h> // for Form
+#include <fstream>
+
+using namespace MuonGM;
+
+BuildNSWReadoutGeometry::BuildNSWReadoutGeometry()
+{}
+
+bool BuildNSWReadoutGeometry::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*, std::map<GeoFullPhysVol*, std::string>* vec*/) const
+{
+  bool geoBuilt = true;  
+
+  detectorList& dList=AGDDDetectorStore::GetDetectorStore()->GetDetectorList();
+  detectorList::const_iterator it;
+  for (it=dList.begin(); it!=dList.end(); ++it) {
+
+    std::vector<AGDDDetectorPositioner*>& dPos=((*it).second)->GetDetectorPositioners();
+    for (unsigned int i=0;i<dPos.size();i++) {
+
+      std::string chTag = dPos[i]->ID.detectorAddress;
+      GeoFullPhysVol* vol = dPos[i]->theVolume;
+      
+      std::string stName = chTag.substr(0,4);
+      
+      int etaIndex = 999;
+      int phiIndex = 999;
+      int mLayer   = 999;
+      int iSide    = 0;
+      int iLS      = atoi((chTag.substr(3,1)).c_str()); //sTG3 and sMD3 are small chambers for small sectors 
+      if (iLS==3) iLS = 1; // small 
+      else iLS = 0; // large 
+      if (chTag.substr(13,1)=="A") iSide=1;
+      else if (chTag.substr(13,1)=="C") iSide=-1;
+      etaIndex = iSide*atoi((chTag.substr(5,1)).c_str());
+      phiIndex = atoi((chTag.substr(12,1)).c_str());
+      mLayer = atoi((chTag.substr(7,1)).c_str());
+      
+      if (chTag.substr(0,3)=="sMD") {
+
+	MMReadoutElement* re = new MMReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);
+	std::string myVolName = (chTag.substr(0,8)).c_str();
+	re->initDesign(-999., -999., -999., -999., -999.);
+	re->fillCache();
+	mgr->addMMReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
+	re->setDelta(mgr);
+      }
+      else if (chTag.substr(0,3)=="sTG") {
+	
+	sTgcReadoutElement* re = new sTgcReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);	  
+	std::string myVolName = (chTag.substr(0,8)).c_str();
+	re->initDesign(-999., -999., -999., 3.2, -999., 2.7, -999., 2.6);
+	re->fillCache();
+	mgr->addsTgcReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
+	re->setDelta(mgr);
+      }
+    }
+  }
+  return geoBuilt;
+
+}
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorCondAlg.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorCondAlg.cxx
index 2ba1565873d0..e250f0ccb689 100755
--- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorCondAlg.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorCondAlg.cxx
@@ -5,6 +5,7 @@
 #include "MuonGeoModel/MuonDetectorCondAlg.h"
 #include "MuonGeoModel/MuonDetectorFactory001.h"
 #include "MuonGeoModel/MuonDetectorTool.h"
+#include "MuonDetDescrUtils/BuildNSWReadoutGeometry.h"
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 
@@ -83,6 +84,16 @@ StatusCode MuonDetectorCondAlg::execute()
   std::unique_ptr<MuonGM::MuonDetectorManager> MuonMgrData
     (theFactory.getDetectorManager());
 
+  // =======================
+  // Add NSW to the MuonDetectorManager by calling BuildReadoutGeometry from MuonAGDDToolHelper
+  // =======================
+  if (MuonMgrData->mmIdHelper() && MuonMgrData->stgcIdHelper()) {
+    BuildNSWReadoutGeometry theBuilder = BuildNSWReadoutGeometry();
+    if (!theBuilder.BuildReadoutGeometry(MuonMgrData.get())) {
+      ATH_MSG_FATAL("unable to add NSW ReadoutGeometry in the MuonDetectorManager in conditions store");
+    }
+  }
+
   // =======================
   // Update CSC Internal Alignment if requested
   // =======================
@@ -148,4 +159,3 @@ StatusCode MuonDetectorCondAlg::finalize()
   ATH_MSG_DEBUG( "finalize " << name() );
   return StatusCode::SUCCESS;
  }
-
-- 
GitLab


From f0f08121ffe86bc1bff437ce16d3e5bce0242cd7 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 10 Jul 2020 15:24:41 +0000
Subject: [PATCH 212/217] PixelConditionsAlgorithms: Fix initialization hack.

PixelCablingCondAlg::initialize() is recording a conditions object
to be read by SiRegionSeletorTable::initialize().  However, it was
doing this with an unbounded IOV range, which then collides with
any other IOV ranges that may be added later.

Change so that the range for this hack covers only run number 0,
so it won't collide with any real IOV ranges.
---
 .../src/PixelCablingCondAlg.cxx                    |  4 ++--
 .../InDetRegionSelector/CMakeLists.txt             |  3 ++-
 .../InDetRegionSelector/SiRegionSelectorTable.h    |  2 +-
 .../src/SiRegionSelectorTable.cxx                  | 14 +++++++++++---
 .../share/jobOfragment_TransBS_standalone.py       |  1 +
 5 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx
index f15cbe07c497..7212c3805b53 100644
--- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelCablingCondAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "PixelCablingCondAlg.h"
@@ -51,7 +51,7 @@ StatusCode PixelCablingCondAlg::initialize() {
   const EventIDBase::number_type UNDEFNUM = EventIDBase::UNDEFNUM;
   const EventIDBase::event_number_t UNDEFEVT = EventIDBase::UNDEFEVT;
   EventIDRange rangeW (EventIDBase (0, UNDEFEVT, UNDEFNUM, 0, 0),
-                       EventIDBase (UNDEFNUM-1, UNDEFEVT, UNDEFNUM, 0, 0));
+                       EventIDBase (1, UNDEFEVT, UNDEFNUM, 0, 0));
 
   // Signed values
   int barrel_ec, eta_module;
diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetRegionSelector/CMakeLists.txt
index 6865b61269d3..fec15c73bdf6 100644
--- a/InnerDetector/InDetDetDescr/InDetRegionSelector/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/CMakeLists.txt
@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetConditions/PixelConditionsData
                           InnerDetector/InDetDetDescr/SCT_Cabling
                           PRIVATE
+                          Control/AthenaKernel
                           DetectorDescription/Identifier                          
 			  DetectorDescription/IRegionSelector
                           InnerDetector/InDetDetDescr/InDetIdentifier
@@ -29,7 +30,7 @@ atlas_add_component( InDetRegionSelector
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps RegSelLUT GaudiKernel PixelConditionsData SCT_CablingLib Identifier InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry TRT_CablingLib )
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps RegSelLUT GaudiKernel PixelConditionsData SCT_CablingLib Identifier InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry TRT_CablingLib AthenaKernel )
 
 # Install files from the package:
 atlas_install_headers( InDetRegionSelector )
diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/InDetRegionSelector/SiRegionSelectorTable.h b/InnerDetector/InDetDetDescr/InDetRegionSelector/InDetRegionSelector/SiRegionSelectorTable.h
index 428cf404c8fd..f8efee971ae5 100755
--- a/InnerDetector/InDetDetDescr/InDetRegionSelector/InDetRegionSelector/SiRegionSelectorTable.h
+++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/InDetRegionSelector/SiRegionSelectorTable.h
@@ -36,7 +36,7 @@ public:
 
 private:
   
-  StatusCode createTable();
+  StatusCode createTable (const EventContext& ctx);
   
   RegSelSiLUT*   m_regionLUT;
 
diff --git a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegionSelectorTable.cxx b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegionSelectorTable.cxx
index 29528fe28c89..a67fd227535c 100755
--- a/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegionSelectorTable.cxx
+++ b/InnerDetector/InDetDetDescr/InDetRegionSelector/src/SiRegionSelectorTable.cxx
@@ -15,6 +15,9 @@
 #include "RegSelLUT/RegSelModule.h" 
 #include "RegSelLUT/RegSelSiLUT.h" 
 
+#include "AthenaKernel/ExtendedEventContext.h"
+#include "GaudiKernel/ThreadLocalContext.h"
+
 #include "CLHEP/Units/SystemOfUnits.h"
 
 #include <iostream>
@@ -76,7 +79,12 @@ SiRegionSelectorTable::initialize(){
   ATH_CHECK(m_condCablingKey.initialize());
 
   ATH_MSG_WARNING("So far, this prevents the conditions migration!! The createTable() should NOT be used in the initilization step...");
-  ATH_CHECK(createTable());
+  const EventIDBase::number_type UNDEFNUM = EventIDBase::UNDEFNUM;
+  const EventIDBase::event_number_t UNDEFEVT = EventIDBase::UNDEFEVT;
+  EventContext ctx = Gaudi::Hive::currentContext();
+  ctx.setEventID (EventIDBase (0, UNDEFEVT, UNDEFNUM, 0, 0));
+  Atlas::getExtendedEventContext(ctx).setConditionsRun (0);
+  ATH_CHECK(createTable (ctx));
 
   return StatusCode::SUCCESS;
 }
@@ -101,7 +109,7 @@ RegSelSiLUT* SiRegionSelectorTable::getLUT()
 
 
 StatusCode 
-SiRegionSelectorTable::createTable()
+SiRegionSelectorTable::createTable (const EventContext& ctx)
 {
 
   if ( msgLvl(MSG::DEBUG) )  msg(MSG::DEBUG) << "Creating region selector table"  << endmsg;
@@ -131,7 +139,7 @@ SiRegionSelectorTable::createTable()
   else                        rd = new RegSelSiLUT(RegSelSiLUT::SCT);
 
 
-  SG::ReadCondHandle<PixelCablingCondData> pixCabling(m_condCablingKey);
+  SG::ReadCondHandle<PixelCablingCondData> pixCabling(m_condCablingKey, ctx);
 
   SiDetectorElementCollection::const_iterator iter;
   for (iter = manager->getDetectorElementBegin(); iter != manager->getDetectorElementEnd(); ++iter){
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
index ba3154fe4be9..0b8c1305deac 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/jobOfragment_TransBS_standalone.py
@@ -35,6 +35,7 @@ if TriggerFlags.doID():
    # Pixel
    StreamBS.ItemList += ["PixelRDO_Container#*"]
    StreamBS.ExtraInputs += [('PixelHitDiscCnfgData','ConditionStore+PixelHitDiscCnfgData')]
+   StreamBS.ExtraInputs += [('PixelCablingCondData','ConditionStore+PixelCablingCondData')]
 
 if TriggerFlags.doCalo():
    # LAr
-- 
GitLab


From 4baf5eb6dfd88c8557b149c94426d78727608be2 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 10 Jul 2020 15:25:22 +0000
Subject: [PATCH 213/217] Replace CxxUtils::CachedUniquePtr<const
 Amg::Vector3D> m_globalPosition by Amg::Vector3D m_globalPosition in
 Si/Pixel/SCT_ClusterOnTrack

---
 .../InDetRIO_OnTrack/SCT_ClusterOnTrack.h     | 11 ++--
 .../InDetRIO_OnTrack/SiClusterOnTrack.h       |  3 +-
 .../src/PixelClusterOnTrack.cxx               |  9 +++-
 .../src/SCT_ClusterOnTrack.cxx                | 32 +++++-------
 .../InDetRIO_OnTrack/src/SiClusterOnTrack.cxx | 52 +++++--------------
 5 files changed, 38 insertions(+), 69 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCT_ClusterOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCT_ClusterOnTrack.h
index edd10789db39..4952e71948ff 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCT_ClusterOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCT_ClusterOnTrack.h
@@ -109,17 +109,12 @@ namespace InDet{
       /** Destructor */
       virtual ~SCT_ClusterOnTrack() = default;
      
-      /** returns global position (gathered through Surface constraint)
-      - fullfills Trk::MeasurementBase interface
-        Overload of the method in parent class */
-      virtual const Amg::Vector3D& globalPosition() const override final;
-     
       /** Pseudo-constructor */
       virtual SCT_ClusterOnTrack* clone() const override;
 
-    /** returns the surface for the local to global transformation
-      - fullfills the Trk::MeasurementBase interface
-     */
+      /** returns the surface for the local to global transformation
+          - fullfills the Trk::MeasurementBase interface
+      */
       virtual const Trk::Surface& associatedSurface() const override;
 
       virtual bool rioType(Trk::RIO_OnTrackType::Type type) const override final
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
index f6aa3bc12b31..eefb8627ebaf 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
@@ -10,7 +10,6 @@
 #define TRKRIO_ONTRACK_SICLUSTERONTRACK_H
 
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
-#include "CxxUtils/CachedUniquePtr.h"
 #include "Identifier/IdentifierHash.h"
 
 class SiClusterOnTrackCnv_p1;
@@ -105,7 +104,7 @@ namespace InDet {
       /** The IdentifierHash - probably not used*/
       IdentifierHash                      m_idDE;
       /** The global position */
-      CxxUtils::CachedUniquePtr<const Amg::Vector3D> m_globalPosition;
+      Amg::Vector3D m_globalPosition;
       bool m_isbroad;
   };
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelClusterOnTrack.cxx
index 156d72877436..567c65026556 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelClusterOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -30,6 +30,9 @@ InDet::PixelClusterOnTrack::PixelClusterOnTrack(
   m_detEl( RIO->detectorElement() )
 {
   m_rio.setElement(RIO);
+
+  // Set global position
+  m_globalPosition = associatedSurface().localToGlobalPos(localParameters());
 }
 
 // Constructor with parameters
@@ -68,8 +71,10 @@ InDet::PixelClusterOnTrack::PixelClusterOnTrack
   m_hasClusterAmbiguity (hasClusterAmbiguity),
   m_isFake (isFake),
   m_energyLoss (energyLoss),
-  m_detEl (nullptr)
+  m_detEl ((*RIO)->detectorElement())
 {
+  // Set global position
+  m_globalPosition = associatedSurface().localToGlobalPos(localParameters());
 }
     
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
index 02f8b5a93b7a..d534d01251a2 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCT_ClusterOnTrack.cxx
@@ -23,9 +23,13 @@ InDet::SCT_ClusterOnTrack::SCT_ClusterOnTrack(const InDet::SCT_Cluster* RIO,
            bool isbroad) : 
   SiClusterOnTrack(locpars, locerr, idDE, RIO->identify(),isbroad) //call base class constructor
 {
-  m_detEl=nullptr;
+  m_detEl=RIO->detectorElement();
   m_positionAlongStrip=std::numeric_limits<double>::quiet_NaN();
   m_rio.setElement(RIO);
+
+  // Set global position
+  Amg::Vector2D lpos(localParameters().get(Trk::locX), m_positionAlongStrip);
+  m_globalPosition = detectorElement()->surface(identify()).localToGlobalPos(lpos);
 }
 
 // Constructor with parameters
@@ -60,17 +64,21 @@ InDet::SCT_ClusterOnTrack::SCT_ClusterOnTrack( const ElementLinkToIDCSCT_Cluster
                      idDE,
                      id,
                      isbroad),
-    m_rio (RIO),
-    m_detEl (nullptr),
+    m_rio(RIO),
+    m_detEl((*RIO)->detectorElement()),
     m_positionAlongStrip (positionAlongStrip)
-{}
+{
+  // Set global position
+  Amg::Vector2D lpos(localParameters().get(Trk::locX), m_positionAlongStrip);
+  m_globalPosition = detectorElement()->surface(identify()).localToGlobalPos(lpos);
+}
 
 
 // Default constructor:
 InDet::SCT_ClusterOnTrack::SCT_ClusterOnTrack():
   SiClusterOnTrack(),
   m_rio(),
-  m_detEl(0),
+  m_detEl(nullptr),
   m_positionAlongStrip(std::numeric_limits<double>::quiet_NaN())
 {}
 
@@ -85,20 +93,6 @@ void InDet::SCT_ClusterOnTrack::setValues(const Trk::TrkDetElementBase* detEl, c
     m_detEl = dynamic_cast< const InDetDD::SiDetectorElement* >(detEl);
 }
   
-const  Amg::Vector3D& InDet::SCT_ClusterOnTrack::globalPosition() const
-  {
-   //checking whether the globalposition is available
-   if (not m_globalPosition)
-   {
-    
-    // calculate global position from the position of the strip and the position along the strip
-     Amg::Vector2D lpos( localParameters().get(Trk::locX), m_positionAlongStrip );
-     m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(detectorElement()->surface( identify() ).localToGlobal( lpos )));            
-   }
-    
-   return (*m_globalPosition);
-} 
-
 MsgStream& InDet::SCT_ClusterOnTrack::dump( MsgStream& sl ) const
 {
   SiClusterOnTrack::dump(sl);// use dump(...) from SiClusterOnTrack
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
index 4ede0a611f7f..9c87958e5fa6 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const Trk::LocalParameters& locpars,
                                            bool isbroad) : 
   RIO_OnTrack(locpars, locerr, id), //call base class constructor
   m_idDE(idDE),
-  m_globalPosition{},
+  m_globalPosition(), // should be set in constructor of derived class
   m_isbroad(isbroad)
 {}
 
@@ -40,7 +40,7 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const Trk::LocalParameters& locpars,
     : 
     RIO_OnTrack(locpars, locerr, id), //call base class constructor
     m_idDE(idDE),
-    m_globalPosition(std::make_unique<Amg::Vector3D>(globalPosition)),
+    m_globalPosition(globalPosition),
     m_isbroad(isbroad)
 {}
 
@@ -54,7 +54,7 @@ InDet::SiClusterOnTrack::~SiClusterOnTrack()
 InDet::SiClusterOnTrack::SiClusterOnTrack():
     Trk::RIO_OnTrack(),
     m_idDE(),
-    m_globalPosition{},
+    m_globalPosition(), // should be set in constructor of derived class
     m_isbroad(false)
 {}
 
@@ -63,24 +63,16 @@ InDet::SiClusterOnTrack::SiClusterOnTrack( const SiClusterOnTrack& rot)
     :
     RIO_OnTrack(rot),
     m_idDE(rot.m_idDE),
-    m_globalPosition{},
+    m_globalPosition(rot.m_globalPosition),
     m_isbroad(rot.m_isbroad)
-{
-  if (rot.m_globalPosition) {
-    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
-  }
-}
+{}
 
 // assignment operator:
 InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTrack& rot){
     if ( &rot != this) {
        Trk::RIO_OnTrack::operator=(rot);
        m_idDE           = rot.m_idDE;
-       if (rot.m_globalPosition) {
-         m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
-       } else if (m_globalPosition) {
-         m_globalPosition.release().reset();
-       }
+       m_globalPosition = rot.m_globalPosition;
        m_isbroad        = rot.m_isbroad;
     }
     return *this;
@@ -91,10 +83,7 @@ InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTr
 
 const Amg::Vector3D& InDet::SiClusterOnTrack::globalPosition() const
 { 
-  if (not m_globalPosition) {
-    m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(associatedSurface().localToGlobal(localParameters())));
-  }
-  return (*m_globalPosition);
+  return m_globalPosition;
 }
 
 MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const
@@ -104,15 +93,9 @@ MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const
     Trk::RIO_OnTrack::dump(sl);
 
     sl << "Global position (x,y,z) = (";
-    this->globalPosition();
-    if (m_globalPosition)
-    {
-       sl  <<this->globalPosition().x()<<", "
-               <<this->globalPosition().y()<<", "
-               <<this->globalPosition().z()<<")"<<endmsg;
-    } else {
-        sl<<"NULL!), "<<endmsg;
-    }
+    sl  <<this->globalPosition().x()<<", "
+        <<this->globalPosition().y()<<", "
+        <<this->globalPosition().z()<<")"<<endmsg;
     sl<<"}"<<endmsg;
     return sl;
 }
@@ -124,16 +107,9 @@ std::ostream& InDet::SiClusterOnTrack::dump( std::ostream& sl ) const
     Trk::RIO_OnTrack::dump(sl);
 
     sl << "Global position (x,y,z) = (";
-    this->globalPosition();
-    if (m_globalPosition)
-    {
-        sl  <<this->globalPosition().x()<<", "
-            <<this->globalPosition().y()<<", "
-            <<this->globalPosition().z()<<")"<<std::endl;
-    } else {
-        sl<<"NULL!), "<<std::endl;
-    }
-
+    sl  <<this->globalPosition().x()<<", "
+        <<this->globalPosition().y()<<", "
+        <<this->globalPosition().z()<<")"<<std::endl;
     sl<<"}"<<std::endl;
     return sl;
 }
-- 
GitLab


From 2a162fec471cba91d21f74ff489859ececdb2beb Mon Sep 17 00:00:00 2001
From: Patrick Scholer <patrick.scholer@cern.ch>
Date: Fri, 10 Jul 2020 15:39:39 +0000
Subject: [PATCH 214/217] Manual Sweep: Introduce MMClusterOnTrackCreator

---
 .../share/SiSmearing_noPU_CompletedjO.py      |   6 +-
 .../src/MMClusterOnTrackCreator.cxx           | 102 ++++++++++++++
 .../src/MMClusterOnTrackCreator.h             |  78 +++++++++++
 .../src/MuonClusterOnTrackCreator.cxx         |  28 ++--
 .../MuonClusterOnTrackCreator_entries.cxx     |   2 +
 .../MuonRecExample/python/MuonRecTools.py     |   3 +
 .../share/MuonHolesSearch_jobOptions.py       |   1 +
 .../src/MuonSegmentFinderAlg.cxx              |  12 +-
 .../src/MuonSegmentFinderAlg.h                |   3 +-
 .../RIO_OnTrackCreator.h                      |   2 +
 .../src/RIO_OnTrackCreator.cxx                | 127 ++++++++----------
 .../python/TrigMuonEFCosmicConfig.py          |   1 +
 12 files changed, 269 insertions(+), 96 deletions(-)
 create mode 100644 MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx
 create mode 100644 MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.h

diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU_CompletedjO.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU_CompletedjO.py
index 34f3e1e38702..ee3d95e8ff6a 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU_CompletedjO.py
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU_CompletedjO.py
@@ -236,7 +236,8 @@ InDetRotCreator = Trk__RIO_OnTrackCreator(name                = 'InDetRotCreator
                                           ToolPixelCluster    = PixelPlanarClusterOnTrackTool,
                                           ToolSCT_Cluster     = SCT_PlanarClusterOnTrackTool,
                                           ToolMuonCluster     = None,
-                                          ToolMuonDriftCircle = None,       
+                                          ToolMuonDriftCircle = None,
+                                          ToolMuonMMCluster   = None,       
                                           ToolTRT_DriftCircle = None,    
                                           Mode                = 'indet')
 InDetRotCreator.OutputLevel = OutputLevel
@@ -247,7 +248,8 @@ BroadInDetRotCreator = Trk__RIO_OnTrackCreator(name                = 'BroadInDet
                                                ToolPixelCluster    = PixelPlanarClusterOnTrackTool,
                                                ToolSCT_Cluster     = SCT_PlanarClusterOnTrackTool,
                                                ToolMuonCluster     = None,
-                                               ToolMuonDriftCircle = None,       
+                                               ToolMuonDriftCircle = None,
+                                               ToolMuonMMCluster   = None,       
                                                ToolTRT_DriftCircle = None,    
                                                Mode                = 'indet')
 BroadInDetRotCreator.OutputLevel = OutputLevel
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx
new file mode 100644
index 000000000000..d812bd04ffa4
--- /dev/null
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx
@@ -0,0 +1,102 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#include "MMClusterOnTrackCreator.h"
+
+
+#include "MuonRIO_OnTrack/MMClusterOnTrack.h"
+
+Muon::MMClusterOnTrackCreator::MMClusterOnTrackCreator
+  (const std::string& ty, const std::string& na, const IInterface* pa)
+    : AthAlgTool(ty, na, pa) {
+
+    // algtool interface - necessary!
+    declareInterface<IMuonClusterOnTrackCreator>(this);
+    declareInterface<IRIO_OnTrackCreator>(this);
+}
+
+
+StatusCode Muon::MMClusterOnTrackCreator::initialize() {
+    ATH_CHECK(m_idHelperSvc.retrieve());
+    return StatusCode::SUCCESS;
+}
+
+
+
+
+const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::createRIO_OnTrack(const Trk::PrepRawData& RIO,
+                                                    const Amg::Vector3D& GP) const {
+    MuonClusterOnTrack* MClT = nullptr;
+
+    // check whether PrepRawData has detector element, if not there print warning
+    const Trk::TrkDetElementBase* EL = RIO.detectorElement();
+    if ( !EL ) {
+      ATH_MSG_WARNING("RIO does not have associated detectorElement!, cannot produce ROT");
+      return nullptr;
+    }
+
+    // MuClusterOnTrack production
+    //
+    // in RIO_OnTrack the local param and cov should have the same dimension
+    Trk::LocalParameters locpar(RIO.localPosition());
+
+    if (RIO.localCovariance().cols() != RIO.localCovariance().rows()) {
+      ATH_MSG_FATAL("Rows and colums not equal!");
+    }
+
+    if (RIO.localCovariance().cols() > 1) {
+      ATH_MSG_VERBOSE("Making 2-dim local parameters: " << m_idHelperSvc->toString(RIO.identify()));
+    } else {
+      Trk::DefinedParameter  radiusPar(RIO.localPosition().x(), Trk::locX);
+      locpar = Trk::LocalParameters(radiusPar);
+      ATH_MSG_VERBOSE("Making 1-dim local parameters: "  << m_idHelperSvc->toString(RIO.identify()));
+    }
+
+    Amg::Vector2D lp;
+    double positionAlongStrip = 0;
+
+    if ( !EL->surface(RIO.identify()).globalToLocal(GP, GP, lp) ) {
+      Amg::Vector3D lpos = RIO.detectorElement()->surface(RIO.identify()).transform().inverse()*GP;
+      ATH_MSG_WARNING("Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
+      lp[Trk::locX]  = lpos.x();
+      lp[Trk::locY]  = lpos.y();
+    }
+    positionAlongStrip = lp[Trk::locY];
+
+    Amg::MatrixX loce = RIO.localCovariance();
+    ATH_MSG_DEBUG("All: new err matrix is " << loce);
+
+
+
+
+    if ( m_idHelperSvc->isMM(RIO.identify()) ) {
+      // cast to MMPrepData
+      const MMPrepData* MClus   = dynamic_cast<const MMPrepData*> (&RIO);
+      if (!MClus) {
+        ATH_MSG_WARNING("RIO not of type MMPrepData, cannot create ROT");
+        return nullptr;
+      }
+      ATH_MSG_VERBOSE("generating MMClusterOnTrack in MMClusterBuilder");
+      MClT = new MMClusterOnTrack(MClus, locpar, loce, positionAlongStrip);
+     } else {
+      ATH_MSG_WARNING("MMClusterOnTrackCreator called with an non MM identifier");
+    }
+
+    return MClT;
+}
+
+
+
+const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::createRIO_OnTrack(const Trk::PrepRawData& RIO,
+                                                    const Amg::Vector3D& GP,
+                                                    const Amg::Vector3D&) const {
+    return createRIO_OnTrack(RIO, GP);
+}
+
+
+
+const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::correct(const Trk::PrepRawData& RIO, const Trk::TrackParameters& TP) const {
+    return createRIO_OnTrack(RIO, TP.position());
+}
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.h b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.h
new file mode 100644
index 000000000000..66f6a9ce464f
--- /dev/null
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.h
@@ -0,0 +1,78 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef MMClusterOnTrackCreator_H
+#define MMClusterOnTrackCreator_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "MuonRecToolInterfaces/IMuonClusterOnTrackCreator.h"
+#include "MuonRIO_OnTrack/MuonClusterOnTrack.h"
+#include "MuonIdHelpers/IMuonIdHelperSvc.h"
+
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "TrkPrepRawData/PrepRawDataCLASS_DEF.h"
+#include "TrkParameters/TrackParameters.h"
+
+namespace Muon {
+
+
+  /** @class MMClusterOnTrackCreator
+      @brief Interface for the reconstruction to calibration and alignment corrections. It should be used by 
+             reconstruction and pattern recognition to create Muon::MuonClusterOnTrack objects (s).
+
+       It offers several interfaces:
+       - Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a predicted Trk::TrackParameter.       
+         @code const MuonClusterOnTrack* correct ( const Trk::PrepRawData& RIO, const Trk::TrackParameters& tp) const @endcode
+       - Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a prediction of the global position and direction.
+         @code createRIO_OnTrack(const Trk::PrepRawData& ROP, const Trk::GlobalPosition& GP, const Trk::GlobalDirection GD) const @endcode
+       - Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a prediction intersect position of the muon with the 
+         measurement surface.
+         Kept for legacy with interface
+         @code createRIO_OnTrack(const Trk::PrepRawData& RIO, const Trk::GlobalPosition& GP) const @endcode
+       
+       JobOptions Flags:
+       - MuonIdHelperTool : choose muon id helper tool
+   */
+ class MMClusterOnTrackCreator : public AthAlgTool, virtual public IMuonClusterOnTrackCreator {
+  public:
+    
+    MMClusterOnTrackCreator(const std::string&,const std::string&,const IInterface*);
+    virtual ~MMClusterOnTrackCreator()=default;
+    virtual StatusCode initialize() override;
+ 
+    /** @brief Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a predicted Trk::TrackParameter. 
+	@param RIO Trk::PrepRawData object to be calibrated
+	@param GP  Predicted intersect position of the muon with the measurement plane 
+	@return a pointer to a new Muon::MuonClusterOnTrack object, zero if calibration failed.
+	The ownership of the new Muon::MuonClusterOnTrack is passed to the client calling the tool
+    */       
+    virtual const MuonClusterOnTrack* createRIO_OnTrack(const Trk::PrepRawData& RIO,
+                                                        const Amg::Vector3D& GP) const override;
+
+    /** @brief Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and a prediction of the global position and direction.
+	It is only implemented for the CSCs, for RPC and TGC Trk::PrepRawData the result is the same as for the routine without the direction. 
+	@param RIO Trk::PrepRawData object to be calibrated
+	@param GP  Predicted intersect position of the muon with the measurement plane 
+	@param GD  Predicted direction at the intersect position of the muon with the measurement plane 
+	@return a pointer to a new Muon::MuonClusterOnTrack object, zero if calibration failed.
+	The ownership of the new Muon::MuonClusterOnTrack is passed to the client calling the tool
+    */
+    virtual const MuonClusterOnTrack* createRIO_OnTrack(const Trk::PrepRawData& RIO,
+                                                        const Amg::Vector3D& GP,
+                                                        const Amg::Vector3D& GD) const override;
+ 
+    /** @brief Create new Muon::MuonClusterOnTrack from a Trk::PrepRawData and the predicted Trk::TrackParameter at the measurement surface. 
+	@param RIO Trk::PrepRawData object to be calibrated
+	@param TP  Predicted Trk::TrackParameter at the measurement surface
+	@return a pointer to a new Muon::MuonClusterOnTrack object, zero if calibration failed.
+	The ownership of the new Muon::MuonClusterOnTrack is passed to the client calling the tool
+    */
+    virtual const MuonClusterOnTrack* correct(const Trk::PrepRawData& RIO,const Trk::TrackParameters& TP) const override; 
+  
+  private:
+    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+ }; // end of class def
+}  //  namespace Muon
+#endif // MMClusterOnTrackCreator_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MuonClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MuonClusterOnTrackCreator.cxx
index 063d84d75c21..56c7a6437446 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MuonClusterOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MuonClusterOnTrackCreator.cxx
@@ -14,13 +14,11 @@
 #include "MuonPrepRawData/TgcPrepData.h"
 #include "MuonPrepRawData/CscPrepData.h"
 #include "MuonPrepRawData/sTgcPrepData.h"
-#include "MuonPrepRawData/MMPrepData.h"
 
 #include "MuonRIO_OnTrack/CscClusterOnTrack.h"
 #include "MuonRIO_OnTrack/TgcClusterOnTrack.h"
 #include "MuonRIO_OnTrack/RpcClusterOnTrack.h"
 #include "MuonRIO_OnTrack/sTgcClusterOnTrack.h"
-#include "MuonRIO_OnTrack/MMClusterOnTrack.h"
 #include <sstream>
 
 #define SIG_VEL 4.80000  // ns/m
@@ -77,13 +75,13 @@ namespace Muon {
 									 const Amg::Vector3D& GP) const
 
   {
-    MuonClusterOnTrack* MClT = 0;
+    MuonClusterOnTrack* MClT = nullptr;
  
     // check whether PrepRawData has detector element, if not there print warning 
     const Trk::TrkDetElementBase* EL = RIO.detectorElement();
     if( !EL ){
       ATH_MSG_WARNING ( "RIO does not have associated detectorElement!, cannot produce ROT" );
-      return 0;
+      return nullptr;
     }
 
     // MuClusterOnTrack production
@@ -133,7 +131,7 @@ namespace Muon {
       const RpcPrepData* MClus   = dynamic_cast<const RpcPrepData*> (&RIO);
       if (!MClus) {
 	ATH_MSG_WARNING ( "RIO not of type RpcPrepData, cannot create ROT" );
-	return 0;
+	return nullptr;
       }
         
       bool measphi = m_idHelperSvc->measuresPhi(RIO.identify());
@@ -187,7 +185,7 @@ namespace Muon {
       const TgcPrepData* MClus   = dynamic_cast<const TgcPrepData*> (&RIO);
       if (!MClus) {
 	ATH_MSG_WARNING ( "RIO not of type TgcPrepData, cannot create ROT" );
-	return 0;
+	return nullptr;
       }
 
       // calculation of 2D error matrix for TGC phi strips
@@ -237,7 +235,7 @@ namespace Muon {
       const CscPrepData* MClus   = dynamic_cast<const CscPrepData*> (&RIO);
       if (!MClus) {
 	ATH_MSG_WARNING ( "RIO not of type CscPrepData, cannot create ROT" );
-	return 0;
+	return nullptr;
       }
 
       bool measphi = m_idHelperSvc->measuresPhi(RIO.identify());
@@ -259,22 +257,12 @@ namespace Muon {
       // current not changing CscClusterStatus but passing status of RIO
       MClT = new CscClusterOnTrack(MClus,locpar,loce,positionAlongStrip,MClus->status(),MClus->timeStatus());
 
-    }else if( m_idHelperSvc->isMM(RIO.identify()) ){
-      // cast to MMPrepData
-      const MMPrepData* MClus   = dynamic_cast<const MMPrepData*> (&RIO);
-      if (!MClus) {
-	        ATH_MSG_WARNING ( "RIO not of type MMPrepData, cannot create ROT" );
-	        return 0;
-      }
-      MClT = new MMClusterOnTrack(MClus,locpar,loce,positionAlongStrip);
-
     }else if( m_idHelperSvc->issTgc(RIO.identify()) ){
-
       // cast to sTgcPrepData
       const sTgcPrepData* MClus   = dynamic_cast<const sTgcPrepData*> (&RIO);
       if (!MClus) {
       	ATH_MSG_WARNING ( "RIO not of type sTgcPrepData, cannot create ROT" );
-      	return 0;
+      	return nullptr;
       }
 
       
@@ -285,11 +273,11 @@ namespace Muon {
 
   const MuonClusterOnTrack* MuonClusterOnTrackCreator::
   createRIO_OnTrack(const Trk::PrepRawData& RIO, const Amg::Vector3D& GP, const Amg::Vector3D&) const {
-    return createRIO_OnTrack(RIO,GP);
+    return createRIO_OnTrack(RIO, GP);
   }
 
   const MuonClusterOnTrack* MuonClusterOnTrackCreator::correct(const Trk::PrepRawData& RIO,const Trk::TrackParameters& TP) const 
-  {
+  {  
     return createRIO_OnTrack(RIO,TP.position(),TP.momentum());
   }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/components/MuonClusterOnTrackCreator_entries.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/components/MuonClusterOnTrackCreator_entries.cxx
index 920fedc942a2..a746963dc0d0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/components/MuonClusterOnTrackCreator_entries.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/components/MuonClusterOnTrackCreator_entries.cxx
@@ -1,8 +1,10 @@
 #include "../MuonClusterOnTrackCreator.h"
 #include "../CscClusterOnTrackCreator.h"
+#include "../MMClusterOnTrackCreator.h"
 
 using namespace Muon;
 
 DECLARE_COMPONENT( MuonClusterOnTrackCreator )
 DECLARE_COMPONENT( CscClusterOnTrackCreator )
+DECLARE_COMPONENT( MMClusterOnTrackCreator )
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
index b1f4ca7f6a60..7f950dfa1d08 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
@@ -48,6 +48,9 @@ def MuonClusterOnTrackCreator(name="MuonClusterOnTrackCreator",**kwargs):
 
     return CfgMgr.Muon__MuonClusterOnTrackCreator(name,**kwargs)
 
+def MMClusterOnTrackCreator(name="MMClusterOnTrackCreator",**kwargs):
+    return CfgMgr.Muon__MMClusterOnTrackCreator(name,**kwargs)
+
 def getMuonRIO_OnTrackErrorScalingCondAlg() :
     error_scaling_def=["CSCRIO_OnTrackErrorScaling:/MUON/TrkErrorScalingCSC"]
     return getRIO_OnTrackErrorScalingCondAlg( name                = "MuonRIO_OnTrackErrorScalingCondAlg",
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/share/MuonHolesSearch_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/share/MuonHolesSearch_jobOptions.py
index 89ce40f8c76f..561b2a56376a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/share/MuonHolesSearch_jobOptions.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTGRecTools/share/MuonHolesSearch_jobOptions.py
@@ -85,6 +85,7 @@ if ( doMuonOutliers ) :
     ToolSvc += RotCreator
     ToolSvc.RotCreator.Mode = "muon"
     ToolSvc.RotCreator.ToolMuonCluster = 'MuonClusterOnTrackTool'
+    ToolSvc.RotCreator.ToolMuonMMCluster = 'MMClusterOnTrackTool'
     print RotCreator
 
     ToolSvc.MuonHolesOnTrackTool.RIO_OnTrackCreator = RotCreator
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.cxx
index 4a1d9848772f..88fa757e2b10 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.cxx
@@ -31,6 +31,7 @@ MuonSegmentFinderAlg::MuonSegmentFinderAlg(const std::string& name, ISvcLocator*
   m_clusterSegMaker("Muon::MuonClusterSegmentFinder/MuonClusterSegmentFinder", this),
   m_segmentOverlapRemovalTool("Muon::MuonSegmentOverlapRemovalTool/MuonSegmentOverlapRemovalTool", this),
   m_clusterCreator("Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator", this),
+  m_mmClusterCreator("Muon::MMClusterOnTrackCreator/MMClusterOnTrackCreator", this),
   m_clusterSegMakerNSW("Muon::MuonClusterSegmentFinderTool/MuonClusterSegmentFinderTool", this),
   m_truthSummaryTool("Muon::MuonTruthSummaryTool/MuonTruthSummaryTool", this),
   m_csc2dSegmentFinder("Csc2dSegmentMaker/Csc2dSegmentMaker", this),
@@ -42,6 +43,7 @@ MuonSegmentFinderAlg::MuonSegmentFinderAlg(const std::string& name, ISvcLocator*
   declareProperty("MuonPatternSegmentMaker", m_patternSegmentMaker);
   declareProperty("SegmentMaker",m_segmentMaker);
   declareProperty("ClusterCreator",m_clusterCreator);
+  declareProperty("MMClusterCreator",m_mmClusterCreator);
   declareProperty("MuonClusterSegmentFinderTool",m_clusterSegMakerNSW);
   declareProperty("MuonTruthSummaryTool",m_truthSummaryTool);
   declareProperty("Csc2dSegmentMaker", m_csc2dSegmentFinder);
@@ -249,9 +251,15 @@ void MuonSegmentFinderAlg::createSegmentsFromClusters(const Muon::MuonPatternCom
       if( !cl ) continue;
       int sector = m_idHelperSvc->sector(id);
       std::vector<const Muon::MuonClusterOnTrack*>& clusters = clustersPerSector[sector];
-      const Muon::MuonClusterOnTrack* clust = m_clusterCreator->createRIO_OnTrack( *cl, cl->globalPosition() );
       
-      clusters.push_back(clust);
+      if(m_idHelperSvc->isMM((*pit)->identify())){
+        const Muon::MuonClusterOnTrack* clust = m_mmClusterCreator->createRIO_OnTrack( *cl, cl->globalPosition() );
+        clusters.push_back(clust);
+      } else {  //  must be an sTGC prd
+        const Muon::MuonClusterOnTrack* clust = m_clusterCreator->createRIO_OnTrack( *cl, cl->globalPosition() );
+        clusters.push_back(clust);
+      }
+
     }
   }
   
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.h
index 6162da4e94ce..ba9e6ffa3cdb 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MuonSegmentFinderAlg.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MOOSEGMENTFINDERS_MUOSEGMENTFINDERALGS_H
@@ -58,6 +58,7 @@ class MuonSegmentFinderAlg : public AthAlgorithm
   ToolHandle<Muon::IMuonClusterSegmentFinder>     m_clusterSegMaker;
   ToolHandle<Muon::IMuonSegmentOverlapRemovalTool> m_segmentOverlapRemovalTool;
   ToolHandle<Muon::IMuonClusterOnTrackCreator>    m_clusterCreator;  //<! pointer to muon cluster rio ontrack creator
+  ToolHandle<Muon::IMuonClusterOnTrackCreator>    m_mmClusterCreator;  //<! pointer to mm cluster rio ontrack creator
   ToolHandle<Muon::IMuonClusterSegmentFinderTool> m_clusterSegMakerNSW;
   ToolHandle<Muon::IMuonTruthSummaryTool>         m_truthSummaryTool;
   ToolHandle<ICscSegmentFinder>                  m_csc2dSegmentFinder;
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/TrkRIO_OnTrackCreator/RIO_OnTrackCreator.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/TrkRIO_OnTrackCreator/RIO_OnTrackCreator.h
index 73d3fba7db5e..648113830244 100755
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/TrkRIO_OnTrackCreator/RIO_OnTrackCreator.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/TrkRIO_OnTrackCreator/RIO_OnTrackCreator.h
@@ -89,6 +89,8 @@ namespace Trk {
     ToolHandle<IRIO_OnTrackCreator>  m_muonDriftCircleCor;
     //! Detector-specific helper tool, performing the actual calibration corrections for the remaining muon detector technologies: RPC, TGC and CSC.
     ToolHandle<IRIO_OnTrackCreator>  m_muonClusterCor;
+    //! Detector-specific helper tool, performing the actual calibration corrections for every Muon::MMPrepData 
+    ToolHandle<IRIO_OnTrackCreator>  m_mmClusterCor;
     std::string                      m_mode;   //!< flag: can be 'all', 'indet' or 'muon'
     int*                  m_nwarning;          //!< counter to locally control # of warnings
     bool                             m_doPixel; //!< Load Pixel IRIO_OnTrackCreator
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
index 00e8c8bcd0cd..c77d174f2a09 100755
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackCreator.cxx
@@ -28,11 +28,12 @@ Trk::RIO_OnTrackCreator::RIO_OnTrackCreator(const std::string& t,
 			      const IInterface* p)
   :  AthAlgTool(t,n,p),
      m_idHelper(nullptr),
-     m_pixClusCor        ("InDet::PixelClusterOnTrackTool/PixelClusterOnTrackTool"),
+     m_pixClusCor        ("InDet::PixelClusterOnTrackTool/PixelClusterOnTrackTool", this),
      m_sctClusCor        ("InDet::SCT_ClusterOnTrackTool/SCT_ClusterOnTrackTool", this),
-     m_trt_Cor           ("InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool"),
-     m_muonDriftCircleCor("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackTool"),
-     m_muonClusterCor    ("Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackTool"),
+     m_trt_Cor           ("InDet::TRT_DriftCircleOnTrackTool/TRT_DriftCircleOnTrackTool", this),
+     m_muonDriftCircleCor("Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackTool", this),
+     m_muonClusterCor    ("Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackTool", this),
+     m_mmClusterCor      ("Muon::MMClusterOnTrackCreator/MMClusterOnTrackTool", this),
      m_doPixel(true),
      m_doSCT(true),
      m_doTRT(true)
@@ -45,6 +46,7 @@ Trk::RIO_OnTrackCreator::RIO_OnTrackCreator(const std::string& t,
    declareProperty("ToolTRT_DriftCircle",m_trt_Cor);
    declareProperty("ToolMuonDriftCircle",m_muonDriftCircleCor);
    declareProperty("ToolMuonCluster"    ,m_muonClusterCor);
+   declareProperty("ToolMuonMMCluster"  ,m_mmClusterCor);
    declareProperty("Mode"               ,m_mode);
  }
 
@@ -60,53 +62,41 @@ StatusCode Trk::RIO_OnTrackCreator::initialize()
   if (AlgTool::initialize().isFailure()) return StatusCode::FAILURE; 
 
   if (m_mode != "all" && m_mode != "indet" &&m_mode != "muon") {
-    msg(MSG::FATAL) << "Mode is set to unknown value " << m_mode << endmsg;
+    ATH_MSG_FATAL("Mode is set to unknown value " << m_mode);
     return StatusCode::FAILURE;
   }
 
-  ATH_MSG_INFO( " RIO_OnTrackCreator job configuration:" << std::endl
-		 << std::endl << " (i) The following RIO correction "
-		 << "tools configured (depends on mode = "<< m_mode <<"):" << std::endl
-		 << "     Pixel      : " << m_pixClusCor << std::endl
-		 << "     SCT        : " << m_sctClusCor << std::endl
-		 << "     TRT        : " << m_trt_Cor       << std::endl
-		 << "     MDT        : " << m_muonDriftCircleCor << std::endl
-		 << "     CSC/RPC/TGC: " << m_muonClusterCor << std::endl
-       );
+  ATH_MSG_INFO("RIO_OnTrackCreator job configuration:" << std::endl
+     << std::endl << " (i) The following RIO correction "
+     << "tools configured (depends on mode = "<< m_mode <<"):" << std::endl
+     << "     Pixel      : " << m_pixClusCor << std::endl
+     << "     SCT        : " << m_sctClusCor << std::endl
+     << "     TRT        : " << m_trt_Cor       << std::endl
+     << "     MDT        : " << m_muonDriftCircleCor << std::endl
+     << "     CSC/RPC/TGC/sTGC: " << m_muonClusterCor << std::endl
+     << "     MM: " << m_mmClusterCor);
 
   // Get the correction tool to create Pixel/SCT/TRT RIO_onTrack
 
   if (m_mode == "all" || m_mode == "indet") {
-
     if (!m_pixClusCor.empty()) {
-      if ( m_pixClusCor.retrieve().isFailure() ) {
-	      ATH_MSG_FATAL( "Failed to retrieve tool " << m_pixClusCor);
-	      return StatusCode::FAILURE;
-      } 
-	      ATH_MSG_INFO( "Retrieved tool " << m_pixClusCor);
-      
+      ATH_CHECK(m_pixClusCor.retrieve());
+      ATH_MSG_INFO("Retrieved tool " << m_pixClusCor);
     } else {
       m_doPixel = false;
     }
 
     if (!m_sctClusCor.empty()) {
-      if ( m_sctClusCor.retrieve().isFailure() ) {
-        ATH_MSG_FATAL( "Failed to retrieve tool " << m_sctClusCor);
-	      return StatusCode::FAILURE;
-      } 
-	      ATH_MSG_INFO( "Retrieved tool " << m_sctClusCor);
-      
+      ATH_CHECK(m_sctClusCor.retrieve());
+      ATH_MSG_INFO("Retrieved tool " << m_sctClusCor);
     } else {
       m_doSCT = false;
     }
 
-    if (!m_trt_Cor.empty()) {
-      if ( m_trt_Cor.retrieve().isFailure() ) {
-        ATH_MSG_FATAL( "Failed to retrieve tool " << m_trt_Cor);
-	      return StatusCode::FAILURE;
-      } 
-	      ATH_MSG_INFO( "Retrieved tool " << m_trt_Cor);
       
+    if (!m_trt_Cor.empty()) {
+      ATH_CHECK(m_trt_Cor.retrieve());
+      ATH_MSG_INFO("Retrieved tool " << m_trt_Cor);
     } else {
       m_doTRT = false;
     }
@@ -117,30 +107,22 @@ StatusCode Trk::RIO_OnTrackCreator::initialize()
   }
 
   if (m_mode == "all" || m_mode == "muon") {
-    if ( m_muonDriftCircleCor.retrieve().isFailure() ) {
-      ATH_MSG_FATAL( "Failed to retrieve tool " << m_muonDriftCircleCor);      
-      return StatusCode::FAILURE;
-    } 
-      ATH_MSG_INFO( "Retrieved tool " << m_muonDriftCircleCor);
-    
+    ATH_CHECK(m_muonDriftCircleCor.retrieve());
+    ATH_MSG_INFO("Retrieved tool " << m_muonDriftCircleCor);
 
-    if ( m_muonClusterCor.retrieve().isFailure() ) {
-      ATH_MSG_FATAL( "Failed to retrieve tool " << m_muonClusterCor);            
-      return StatusCode::FAILURE;
-    } 
-      ATH_MSG_INFO( "Retrieved tool " << m_muonClusterCor);
-    
-  }
-  else{
+    ATH_CHECK(m_muonClusterCor.retrieve());
+    ATH_MSG_INFO("Retrieved tool " << m_muonClusterCor);
+
+    ATH_CHECK(m_mmClusterCor.retrieve());
+    ATH_MSG_INFO("Retrieved tool " << m_mmClusterCor);
+  } else{
     m_muonClusterCor.disable();
     m_muonDriftCircleCor.disable();
+    m_mmClusterCor.disable();
   }
-  
+
   // Set up ATLAS ID helper to be able to identify the RIO's det-subsystem.
-  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
-    ATH_MSG_ERROR ("Could not get AtlasDetectorID helper" );
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
 
   ATH_MSG_INFO("initialize() successful in " << name());
   return StatusCode::SUCCESS;
@@ -170,7 +152,7 @@ Trk::RIO_OnTrackCreator::correct(const Trk::PrepRawData& rio,
     if (m_mode == "muon") {
       ATH_MSG_WARNING("I have no tool to correct the current Pixel hit! - Giving back nil.");
       return nullptr;
-    } 
+    }
       ATH_MSG_DEBUG ("RIO identified as PixelCluster.");
       return m_pixClusCor->correct(rio, trk);
     
@@ -180,41 +162,44 @@ Trk::RIO_OnTrackCreator::correct(const Trk::PrepRawData& rio,
     if (m_mode == "muon") {
       ATH_MSG_WARNING("I have no tool to correct the current SCT hit! - Giving back nil.");
       return nullptr;
-    } 
-      ATH_MSG_DEBUG ("RIO identified as SCT_Cluster.");
-      return m_sctClusCor->correct(rio, trk);
-    
+    }
+    ATH_MSG_DEBUG("RIO identified as SCT_Cluster.");
+    return m_sctClusCor->correct(rio, trk);
   }
 
   if (m_doTRT && m_idHelper->is_trt(id)) {
     if (m_mode == "muon") {
       ATH_MSG_WARNING("I have no tool to correct a TRT DriftCircle! - Giving back nil.");
       return nullptr;
-    } 
-      ATH_MSG_DEBUG ("RIO identified as TRT_DriftCircle.");
-      return m_trt_Cor->correct(rio, trk);
-    
+    }
+    ATH_MSG_DEBUG ("RIO identified as TRT_DriftCircle.");
+    return m_trt_Cor->correct(rio, trk);
   }
 
   if (m_idHelper->is_mdt(id)){
     if (m_mode == "indet") {
       ATH_MSG_WARNING("I have no tool to correct a MDT DriftCircle! - Giving back nil.");
       return nullptr;
-    } 
-      ATH_MSG_DEBUG ("RIO identified as MuonDriftCircle.");
-      return m_muonDriftCircleCor->correct(rio, trk);
-    
+    }
+    ATH_MSG_DEBUG("RIO identified as MuonDriftCircle.");
+    return m_muonDriftCircleCor->correct(rio, trk);
   }
-  
   if ( (m_idHelper->is_csc(id)) || (m_idHelper->is_rpc(id))
-       || (m_idHelper->is_tgc(id)) || (m_idHelper->is_mm(id)) || (m_idHelper->is_stgc(id)) ) {
+       || (m_idHelper->is_tgc(id)) || (m_idHelper->is_stgc(id)) ) {
     if (m_mode == "indet") {
-      ATH_MSG_WARNING("I have no tool to correct a CSC/RPC/TGC hit! - Giving back nil.");
+      ATH_MSG_WARNING("I have no tool to correct a CSC/RPC/TGC/sTGC hit! - Giving back nil.");
       return nullptr;
-    } 
-      ATH_MSG_DEBUG ("RIO identified as MuonCluster.");
+    }
+      ATH_MSG_DEBUG("RIO identified as MuonCluster.");
       return m_muonClusterCor->correct(rio, trk);
-    
+  }
+  if (m_idHelper->is_mm(id)) {
+    if (m_mode == "indet") {
+      ATH_MSG_WARNING("I have no tool to correct a MM hit! - Giving back nil.");
+      return nullptr;
+    }
+      ATH_MSG_DEBUG("RIO identified as MMCluster.");
+      return m_mmClusterCor->correct(rio, trk);
   }
 
   ATH_MSG_WARNING( "idHelper could not identify sub-detector for: "<<m_idHelper->print_to_string(id)<<". Return nil RIO_OnTrack");
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
index 299fc851bf81..0eba5a3718b1 100755
--- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
@@ -79,6 +79,7 @@ from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCrea
 TMEF_MuonRotCreatorCosmic =  Trk__RIO_OnTrackCreator("TMEF_MuonRotCreatorCosmic",
                                                      ToolMuonDriftCircle = TMEF_MdtDriftCircleOnTrackCreatorCosmic,
                                                      ToolMuonCluster     = "MuonClusterOnTrackCreator"    ,
+                                                     ToolMuonMMCluster   = "MMClusterOnTrackCreator"    ,
                                                      Mode                = 'muon'
                                                      )
 
-- 
GitLab


From b65368a09ce7f3b3a3aa4beb6bf8ac74e5cecd92 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Fri, 10 Jul 2020 16:29:49 +0000
Subject: [PATCH 215/217] Update PhysVal_jobOptions.py to remove usage of
 deleted property

---
 .../InDetPhysValMonitoring/run/PhysVal_jobOptions.py          | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
index fc264f87b9f1..e1a1e3c2e9a4 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py
@@ -1,5 +1,4 @@
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # $Id: PhysVal_jobOptions.py 795792 2017-02-06 14:45:08Z sroe $
 
@@ -99,7 +98,6 @@ tool1 = InDetPhysValMonitoringTool()
 tool1.TruthSelectionTool = AthTruthSelectionTool
 tool1.useTrackSelection = usingTrackSelection
 tool1.TrackSelectionTool=InDetTrackSelectorTool
-tool1.useTrkSelectPV= False
 tool1.FillTrackInJetPlots = True
 print tool1
 #ToolSvc += tool1
-- 
GitLab


From c29edba3e872899632da07c4bbd93943ffc81409 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 10 Jul 2020 16:46:35 +0000
Subject: [PATCH 216/217] Use CachedUniquePtr<T>::store instead of
 CachedUniquePtr<T>::set in assignment operators and constructors.

---
 .../src/CompetingPixelClustersOnTrack.cxx              |  6 +++---
 .../src/CompetingSCT_ClustersOnTrack.cxx               |  4 ++--
 .../src/CompetingTRT_DriftCirclesOnTrack.cxx           |  6 +++---
 .../InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx   |  6 +++---
 .../InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx    |  6 +++---
 .../src/CompetingMuonClustersOnTrack.cxx               |  6 +++---
 .../MuonPrepRawData/MuonPrepRawData/MdtTwinPrepData.h  |  4 ++--
 .../MuonRecEvent/MuonPrepRawData/src/MuonCluster.cxx   |  6 +++---
 .../MuonRIO_OnTrack/src/MdtDriftCircleOnTrack.cxx      |  6 +++---
 .../MuonRIO_OnTrack/src/MuonClusterOnTrack.cxx         |  6 +++---
 .../MuonRecEvent/MuonTrigCoinData/src/TgcCoinData.cxx  | 10 +++++-----
 .../ISF_Fatras/ISF_FatrasEvent/src/PlanarCluster.cxx   |  6 +++---
 .../ISF_FatrasEvent/src/PlanarClusterOnTrack.cxx       |  8 ++++----
 13 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
index fe07070c6ba9..077f53db8e56 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -30,7 +30,7 @@ InDet::CompetingPixelClustersOnTrack::CompetingPixelClustersOnTrack(const InDet:
         m_containedChildRots->push_back((*rotIter)->clone());
     }
     if (compROT.m_globalPosition) {
-        m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+        m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
     }
 }
 
@@ -57,7 +57,7 @@ InDet::CompetingPixelClustersOnTrack& InDet::CompetingPixelClustersOnTrack::oper
         delete m_containedChildRots;
         m_containedChildRots = new std::vector<const InDet::PixelClusterOnTrack*>;
         if (compROT.m_globalPosition) {
-            m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+            m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
         } else if (m_globalPosition) {
             m_globalPosition.release().reset();
         }
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
index 8edd270876dd..ab51eeed1723 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingSCT_ClustersOnTrack.cxx
@@ -30,7 +30,7 @@ InDet::CompetingSCT_ClustersOnTrack::CompetingSCT_ClustersOnTrack(const InDet::C
         m_containedChildRots.push_back(rot->clone());
     }
     if (compROT.m_globalPosition) {
-        m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+        m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
     }
 }
 
@@ -61,7 +61,7 @@ InDet::CompetingSCT_ClustersOnTrack& InDet::CompetingSCT_ClustersOnTrack::operat
             m_containedChildRots.push_back(rot->clone());
         }
         if (compROT.m_globalPosition) {
-            m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+            m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
         } else if (m_globalPosition) {
             m_globalPosition.release().reset();
         }
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
index 23103e5e629b..6040c10354a1 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -42,7 +42,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack(const
     m_containedChildRots->push_back((*rotIter)->clone());
   }
   if (compROT.m_globalPosition) {
-    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(compROT.m_globalPosition)));
+    m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*(compROT.m_globalPosition)));
   }
 }
 
@@ -88,7 +88,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
     } else {
       m_associatedSurface = 0;
     }
-    if (compROT.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+    if (compROT.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
     else if (m_globalPosition) m_globalPosition.release().reset();
     m_ROTsHaveCommonSurface     = compROT.m_ROTsHaveCommonSurface.load();
     std::vector<const InDet::TRT_DriftCircleOnTrack*>::const_iterator rotIter = compROT.m_containedChildRots->begin();
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
index 4c862fbd1d28..03f781da266e 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -73,7 +73,7 @@ SiCluster::SiCluster(const SiCluster& RIO):
 {
         // copy only if it exists
         if (RIO.m_globalPosition) {
-                m_globalPosition.set(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
+                m_globalPosition.store(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
         }
 }
 
@@ -94,7 +94,7 @@ SiCluster& SiCluster::operator=(const SiCluster& RIO){
                 Trk::PrepRawData::operator= (RIO);
 		m_width = RIO.m_width;
 		if (RIO.m_globalPosition) {
-                        m_globalPosition.set(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
+                        m_globalPosition.store(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
                 } else if (m_globalPosition) {
                         m_globalPosition.release().reset();
                 }
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
index d6c1e601469d..1c1cb9b16892 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -112,7 +112,7 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack( const InDet::TRT_DriftCir
   m_detEl(rot.m_detEl)
 {
   if (rot.m_globalPosition) {
-    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+    m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
   }
 }
 
@@ -122,7 +122,7 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( const I
   if ( &rot != this) {
     Trk::RIO_OnTrack::operator= (rot);
     if (rot.m_globalPosition) {
-      m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
+      m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*(rot.m_globalPosition)));
     } else if (m_globalPosition) {
       m_globalPosition.release().reset();
     }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonCompetingRIOsOnTrack/src/CompetingMuonClustersOnTrack.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonCompetingRIOsOnTrack/src/CompetingMuonClustersOnTrack.cxx
index 3f7a08e6055a..7d06d3aeb7da 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonCompetingRIOsOnTrack/src/CompetingMuonClustersOnTrack.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonCompetingRIOsOnTrack/src/CompetingMuonClustersOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -31,7 +31,7 @@ namespace Muon {
     m_containedChildRots(0),
     m_associatedSurface(0)
   {
-    if (compROT.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+    if (compROT.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
     
     m_containedChildRots = new std::vector< const MuonClusterOnTrack* >;
     std::vector< const MuonClusterOnTrack* >::const_iterator rotIter = compROT.m_containedChildRots->begin();
@@ -106,7 +106,7 @@ namespace Muon {
               MuonClusterOnTrack* mrot = dynamic_cast<MuonClusterOnTrack*>(rot);
               if( mrot ) m_containedChildRots->push_back( mrot );
           }
-          if (compROT.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
+          if (compROT.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*compROT.m_globalPosition));
           else if (m_globalPosition) m_globalPosition.release().reset();
 
           delete m_associatedSurface;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtTwinPrepData.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtTwinPrepData.h
index 3e7a6db32462..e7a13831a6cd 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtTwinPrepData.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtTwinPrepData.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -129,7 +129,7 @@ namespace Muon
       m_tdcTwin = RIO.tdcTwin();
       m_adcTwin = RIO.adcTwin();
       if (RIO.m_globalPosition){
-	m_globalPosition.set(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
+	m_globalPosition.store(std::make_unique<Amg::Vector3D>(*RIO.m_globalPosition));
       }
  
     }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MuonCluster.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MuonCluster.cxx
index e3516929c6d7..31f74e8bc5ad 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MuonCluster.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/src/MuonCluster.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ namespace Muon
   { 
     // copy only if it exists
 
-    if (RIO.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
+    if (RIO.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
   }
 
   MuonCluster::MuonCluster(MuonCluster&& RIO):
@@ -63,7 +63,7 @@ namespace Muon
     if (&RIO !=this)
     {
       Trk::PrepRawData::operator=(RIO);
-      if (RIO.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
+      if (RIO.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
       else if (m_globalPosition) m_globalPosition.release().reset();
     }
     return *this;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MdtDriftCircleOnTrack.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MdtDriftCircleOnTrack.cxx
index be9edcc5eb4f..9beabb537764 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MdtDriftCircleOnTrack.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MdtDriftCircleOnTrack.cxx
@@ -49,7 +49,7 @@ Muon::MdtDriftCircleOnTrack::MdtDriftCircleOnTrack(
 
   const Trk::StraightLineSurface* slsf = dynamic_cast<const Trk::StraightLineSurface*>(&(m_detEl->surface(RIO->identify())));
  
-  if(slsf) m_globalPosition.set(std::unique_ptr<const Amg::Vector3D>(slsf->localToGlobal(locPos, predictedTrackDirection, positionAlongWire)));
+  if(slsf) m_globalPosition.store(std::unique_ptr<const Amg::Vector3D>(slsf->localToGlobal(locPos, predictedTrackDirection, positionAlongWire)));
   Amg::Vector3D loc_gDirection = predictedTrackDirection; 
    
   //scaling the direction with drift radius   
@@ -153,7 +153,7 @@ Muon::MdtDriftCircleOnTrack::MdtDriftCircleOnTrack( const Muon::MdtDriftCircleOn
     m_driftTime(rot.m_driftTime),
     m_errorStrategy(rot.m_errorStrategy)
 {
-    if ( rot.m_globalPosition ) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
+    if ( rot.m_globalPosition ) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
     if ( rot.m_saggedSurface!=0 ) m_saggedSurface= new Trk::StraightLineSurface( *(rot.m_saggedSurface) );
 }
 
@@ -163,7 +163,7 @@ Muon::MdtDriftCircleOnTrack& Muon::MdtDriftCircleOnTrack::operator=( const Muon:
     if ( &rot != this)
     {
         Trk::RIO_OnTrack::operator=(rot);//base class ass. op.
-        if (rot.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
+        if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
         else if (m_globalPosition) m_globalPosition.release().reset();
         delete m_saggedSurface;
         if( rot.m_saggedSurface!=0 )
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonClusterOnTrack.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonClusterOnTrack.cxx
index 18a75cc435e0..b0bc09188d86 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonClusterOnTrack.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonClusterOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -31,7 +31,7 @@ MuonClusterOnTrack::MuonClusterOnTrack():
     m_globalPosition()
 { 
   m_positionAlongStrip = rot.m_positionAlongStrip;
-  if (rot.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
+  if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
 }
 
 
@@ -60,7 +60,7 @@ MuonClusterOnTrack& MuonClusterOnTrack::operator=( const MuonClusterOnTrack& rot
   if ( &rot != this) {
     Trk::RIO_OnTrack::operator=(rot);//base class ass. op.
     m_positionAlongStrip = rot.m_positionAlongStrip;
-    if (rot.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
+    if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
     else if (m_globalPosition) m_globalPosition.release().reset();
   }
   return *this;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonTrigCoinData/src/TgcCoinData.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonTrigCoinData/src/TgcCoinData.cxx
index b9b16033d79e..7a9b1461a412 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonTrigCoinData/src/TgcCoinData.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonTrigCoinData/src/TgcCoinData.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -230,8 +230,8 @@ TgcCoinData::TgcCoinData(const TgcCoinData& RIO):
   m_posIn = ((RIO.m_posIn) ? new Amg::Vector2D(*RIO.m_posIn) : 0 );
   m_posOut = ((RIO.m_posOut) ? new Amg::Vector2D(*RIO.m_posOut) : 0 );
   m_errMat = ((RIO.m_errMat) ? new Amg::MatrixX(*RIO.m_errMat) : 0 );
-  if (RIO.m_globalposIn) m_globalposIn.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
-  if (RIO.m_globalposOut) m_globalposOut.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
+  if (RIO.m_globalposIn) m_globalposIn.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
+  if (RIO.m_globalposOut) m_globalposOut.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
 }
 
 //assignment operator
@@ -270,9 +270,9 @@ TgcCoinData& TgcCoinData::operator=(const TgcCoinData& RIO)
       m_inner = RIO.m_inner;
       m_sub = RIO.m_sub;
       m_isPositiveDeltaR = RIO.m_isPositiveDeltaR;
-      if (RIO.m_globalposIn) m_globalposIn.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
+      if (RIO.m_globalposIn) m_globalposIn.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposIn));
       else if (m_globalposIn) m_globalposIn.release().reset();
-      if (RIO.m_globalposOut) m_globalposOut.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
+      if (RIO.m_globalposOut) m_globalposOut.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalposOut));
       else if (m_globalposOut) m_globalposOut.release().reset();
     }
   return *this;
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarCluster.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarCluster.cxx
index c750301c52e5..e484a61ea2a3 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarCluster.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarCluster.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -60,7 +60,7 @@ namespace iFatras {
     m_detEl( RIO.m_detEl )
   {
     // copy only if it exists
-    if (RIO.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
+    if (RIO.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
   }
 
   //assignment operator
@@ -68,7 +68,7 @@ namespace iFatras {
     if (&RIO !=this) {
       static_cast<Trk::PrepRawData&>(*this) = RIO;
       m_width = RIO.m_width;
-      if (RIO.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
+      if (RIO.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*RIO.m_globalPosition));
       else if (m_globalPosition) m_globalPosition.release().reset();
       m_detEl =  RIO.m_detEl ;
       }
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarClusterOnTrack.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarClusterOnTrack.cxx
index 7936d6dde3b6..e61aba9922b3 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarClusterOnTrack.cxx
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasEvent/src/PlanarClusterOnTrack.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -40,7 +40,7 @@ namespace iFatras {
     m_idDE(idDE),
     m_detEl( RIO->detectorElement() )
   {
-    m_globalPosition.set(std::make_unique<const Amg::Vector3D>(globalPosition));
+    m_globalPosition.store(std::make_unique<const Amg::Vector3D>(globalPosition));
     m_rio.setElement(RIO);
   }
   
@@ -64,7 +64,7 @@ namespace iFatras {
     m_detEl(rot.m_detEl),
     m_globalPosition()
   {
-    if (rot.m_globalPosition) m_globalPosition.set(std::make_unique<Amg::Vector3D>(*rot.m_globalPosition));
+    if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<Amg::Vector3D>(*rot.m_globalPosition));
   }
 
   // assignment operator:
@@ -74,7 +74,7 @@ namespace iFatras {
       m_rio            = rot.m_rio;
       m_idDE           = rot.m_idDE;
       m_detEl          = rot.m_detEl;
-      if (rot.m_globalPosition) m_globalPosition.set(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
+      if (rot.m_globalPosition) m_globalPosition.store(std::make_unique<const Amg::Vector3D>(*rot.m_globalPosition));
       else if (m_globalPosition) m_globalPosition.release().reset();
     }
     return *this;
-- 
GitLab


From 95930e9d75310430fe46df2172484a3f28d4aa8f Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 10 Jul 2020 17:34:05 +0000
Subject: [PATCH 217/217] AthenaServices: Make stack dumps more robust.

Tweak CoreDumpSvc to be more robust against multiple signals from different
threads.

The CoreDumpSvc signal handler had protection against recursion.
But that could be confused if we get signals in multiple threads,
leading to one thread terminating the program while another is trying
to make a stack dump.

Rework to separate out the cases of recursion from that of multiple threads,
and only allow one thread at a time to be dumping.
---
 Control/AthenaServices/src/CoreDumpSvc.cxx | 41 +++++++++++++++++++---
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/Control/AthenaServices/src/CoreDumpSvc.cxx b/Control/AthenaServices/src/CoreDumpSvc.cxx
index 1c34b6744337..a82b0bd65c57 100644
--- a/Control/AthenaServices/src/CoreDumpSvc.cxx
+++ b/Control/AthenaServices/src/CoreDumpSvc.cxx
@@ -15,6 +15,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
+#include <time.h>
 #include <sys/types.h>
 #ifndef __APPLE__
 #include <sys/sysinfo.h>
@@ -72,15 +73,37 @@ namespace CoreDumpSvcHandler
    */
   void action( int sig, siginfo_t *info, void* extra )
   {
-    // Protect against additional signals while we are handling this one
-    static std::atomic<int> inHandler {0};
+    // Protect against additional signals while we are handling this one.
+    // Note: thread-local.
+    static thread_local int inHandler = 0;
     if (inHandler++ > 0) {
       if (inHandler > 100) _exit (98);
       return;
     }
-    
-    // setup timeout
+
+    // Count the number of threads trying to dump.
+    static std::atomic<int> inThreads = 0;
+    ++inThreads;
+
     unsigned int timeoutSeconds = static_cast<unsigned int>(round(coreDumpSvc->m_timeout * 1e-9));
+
+    // Only allow one thread past at a time.
+    // Try to assume as little as possible about the state of the library.
+    // We don't want to hang forever here, but we also don't want
+    // to call any library functions that might use signals under the hood.
+    // So use nanosleep() to do the delay --- that's defined to be
+    // independent of signals.
+    static std::mutex threadMutex;
+    const timespec one_second { 1, 0 };
+    {
+      unsigned int waits = 0;
+      while (!threadMutex.try_lock()) {
+        nanosleep (&one_second, nullptr);
+        if (++waits > timeoutSeconds) _exit (97);
+      }
+    }
+
+    // setup timeout
     if ( timeoutSeconds > 0 && (sig == SIGSEGV || sig == SIGBUS || sig == SIGABRT) ) {
       struct sigaction sa;
       memset(&sa, 0, sizeof(sa));
@@ -121,7 +144,17 @@ namespace CoreDumpSvcHandler
       }
     }
 
+    // This thread is done dumping.
+    threadMutex.unlock();
+    --inThreads;
+
     if (coreDumpSvc && (sig == SIGSEGV || sig == SIGBUS || sig == SIGABRT) ) {
+      // Don't terminate the program while there are other threads
+      // trying to dump (but don't wait forever either).
+      unsigned int waits = 0;
+      while (inThreads > 0 && waits < timeoutSeconds) {
+        nanosleep (&one_second, nullptr);
+      }
       // Exit now on a fatal signal; otherwise, we can hang.
       _exit (99);
     }
-- 
GitLab