diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/CMakeLists.txt b/Trigger/TrigT1/TrigT1CaloCalibUtils/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f1a3dd79cd0174561eedf13cba12daa6f946d84d
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/CMakeLists.txt
@@ -0,0 +1,65 @@
+################################################################################
+# Package: TrigT1CaloCalibUtils
+################################################################################
+
+# Declare the package name:
+atlas_subdir( TrigT1CaloCalibUtils )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Calorimeter/CaloIdentifier
+                          Calorimeter/CaloTriggerTool
+                          Control/AthenaBaseComps
+                          Control/AthenaKernel
+                          Database/AthenaPOOL/AthenaPoolUtilities
+                          Database/RegistrationServices
+                          DetectorDescription/Identifier
+                          Event/EventInfo
+                          Event/xAOD/xAODTrigL1Calo
+                          GaudiKernel
+                          Trigger/TrigConfiguration/TrigConfHLTData
+                          Trigger/TrigConfiguration/TrigConfL1Data
+                          Trigger/TrigEvent/TrigSteeringEvent
+                          Trigger/TrigT1/TrigT1CaloCalibConditions
+                          Trigger/TrigT1/TrigT1CaloCalibToolInterfaces
+                          Trigger/TrigT1/TrigT1CaloCalibTools
+                          Trigger/TrigT1/TrigT1CaloCondSvc
+                          Trigger/TrigT1/TrigT1CaloEvent
+                          Trigger/TrigT1/TrigT1CaloMonitoringTools
+                          Trigger/TrigT1/TrigT1CaloUtils
+                          PRIVATE
+                          Calorimeter/CaloDetDescr
+                          Calorimeter/CaloEvent
+                          Control/CxxUtils
+                          Control/StoreGate
+                          Event/xAOD/xAODEventInfo
+                          LArCalorimeter/LArRecUtils
+                          Simulation/Tools/AtlasCLHEP_RandomGenerators
+                          Trigger/TrigT1/TrigT1CaloToolInterfaces
+                          Trigger/TrigT1/TrigT1Interfaces )
+
+# External dependencies:
+find_package( Boost COMPONENTS filesystem thread system )
+find_package( CLHEP )
+find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+
+# Component(s) in the package:
+atlas_add_library( TrigT1CaloCalibUtilsLib
+                   src/*.cxx
+                   PUBLIC_HEADERS TrigT1CaloCalibUtils
+                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                   DEFINITIONS ${CLHEP_DEFINITIONS}
+                   LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier AthenaBaseComps AthenaKernel AthenaPoolUtilities Identifier EventInfo xAODTrigL1Calo GaudiKernel TrigConfHLTData TrigConfL1Data TrigSteeringEvent TrigT1CaloCalibConditions TrigT1CaloCalibToolInterfaces CaloTriggerToolLib TrigT1CaloCalibToolsLib TrigT1CaloEventLib TrigT1CaloMonitoringToolsLib TrigT1CaloUtilsLib CaloDetDescrLib StoreGateLib SGtests LArRecUtilsLib
+                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent CxxUtils xAODEventInfo AtlasCLHEP_RandomGenerators TrigT1CaloToolInterfaces TrigT1Interfaces )
+
+atlas_add_component( TrigT1CaloCalibUtils
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} CaloIdentifier CaloTriggerToolLib AthenaBaseComps AthenaKernel AthenaPoolUtilities Identifier EventInfo xAODTrigL1Calo GaudiKernel TrigConfHLTData TrigConfL1Data TrigSteeringEvent TrigT1CaloCalibConditions TrigT1CaloCalibToolInterfaces TrigT1CaloCalibToolsLib TrigT1CaloEventLib TrigT1CaloMonitoringToolsLib TrigT1CaloUtilsLib CaloDetDescrLib CaloEvent CxxUtils StoreGateLib SGtests xAODEventInfo LArRecUtilsLib AtlasCLHEP_RandomGenerators TrigT1CaloToolInterfaces TrigT1Interfaces TrigT1CaloCalibUtilsLib )
+
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+atlas_install_joboptions( share/*.txt share/*.py )
+
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloPprMonitoring.h b/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloPprMonitoring.h
index f7fc685b3f3a6d22e21a04decf60e22eed555740..915f428e7b5eca59482c65ce96e1183c19dc0f23 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloPprMonitoring.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloPprMonitoring.h
@@ -21,32 +21,20 @@
 #include <string>
 
 #include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/MsgStream.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ITHistSvc.h" 
 #include "CLHEP/Units/SystemOfUnits.h"    
-
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "TrigT1CaloCalibTools/L1CaloPprFineTimePlotManager.h"
-#include "TrigT1CaloCalibTools/L1CaloPprPedestalPlotManager.h"
-#include "TrigT1CaloCalibTools/L1CaloPprPedestalCorrectionPlotManager.h"
-#include "TrigT1CaloCalibTools/L1CaloPprEtCorrelationPlotManager.h"
-#include "TrigT1CaloToolInterfaces/IL1RoITools.h"
-
-#include "TrigT1CaloCalibToolInterfaces/IL1CaloCells2TriggerTowers.h"
-
-#include "TrigT1CaloEvent/TriggerTowerCollection.h"
-#include "TrigT1CaloCalibConditions/L1CaloCoolChannelId.h"
-#include "TrigT1CaloCalibToolInterfaces/IL1CaloOfflineTriggerTowerTools.h"
-#include "TrigT1Interfaces/TrigT1CaloDefs.h"
-
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
+#include "xAODTrigL1Calo/TriggerTowerContainer.h"
+
+class CondAttrListCollection;
+class EventInfo;
+class ITHistSvc;
+class L1CaloPprFineTimePlotManager;
+class L1CaloPprPedestalPlotManager;
+class L1CaloPprPedestalCorrectionPlotManager;
+class L1CaloPprEtCorrelationPlotManager;
 namespace LVL1 {
+  class IL1CaloOfflineTriggerTowerTools;
   class IL1TriggerTowerTool;
 }
 
@@ -73,7 +61,7 @@ class L1CaloPprMonitoring : public AthAlgorithm
         const CondAttrListCollection* m_dbPpmDisabledTowers;
 	const CondAttrListCollection* m_dbFineTimeRefsTowers;
         const xAOD::TriggerTowerContainer* m_triggerTowers;
-        ITHistSvc* m_histoSvc;
+        ServiceHandle<ITHistSvc> m_histoSvc;
 	
 	// monitoring plotters
 	L1CaloPprFineTimePlotManager* m_fineTimePlotManager;
@@ -81,7 +69,6 @@ class L1CaloPprMonitoring : public AthAlgorithm
 	L1CaloPprPedestalCorrectionPlotManager* m_pedestalCorrectionPlotManager;
 	L1CaloPprEtCorrelationPlotManager* m_etCorrelationPlotManager;
  
-        ServiceHandle<StoreGateSvc> m_storeGate;
         ToolHandle<LVL1::IL1CaloOfflineTriggerTowerTools> m_offlineTowerTools;
 	ToolHandle<LVL1::IL1TriggerTowerTool> m_towerTools;
 
@@ -112,7 +99,6 @@ class L1CaloPprMonitoring : public AthAlgorithm
 	                                     // Et correlation monitoring
 	double m_EtMinForEtCorrelation;      // threshold of L1Calo and calo cell energies
 	                                     // in Et correlation monitoring
-	
 };
 
 #endif
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloRampMaker.h b/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloRampMaker.h
index fcfe342a400e134ec75c083e8e6d601519a887e7..c2a9d51ea82ae979208b66c7d6d3efbf211585a4 100755
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloRampMaker.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/TrigT1CaloCalibUtils/L1CaloRampMaker.h
@@ -1,3 +1,5 @@
+// -*- C++ -*-
+
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
@@ -6,34 +8,31 @@
 #define L1CALORAMPMAKER_H
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "Identifier/Identifier.h"
-#include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h"
-#include "TileRecUtils/TileBeamInfoProvider.h"
+
 #include "TrigT1CaloEvent/TriggerTowerCollection.h"
-#include "TrigT1CaloCalibConditions/L1CaloPprLutContainer.h"
+#include "TrigT1CaloCalibConditions/L1CaloPprConditionsContainerRun2.h"
 #include "TrigT1CaloCalibConditions/L1CaloPprDisabledChannelContainer.h"
+
+#include "xAODTrigL1Calo/TriggerTowerContainer.h"
+
 #include <string>
 #include <map>
-
+#include <memory>
 
 // forward declarations
-class StoreGateSvc;
+class Identifier;
 class L1CaloCondSvc;
 class CaloLVL1_ID;
-// class L1CaloCells2TriggerTowers;
 class L1CaloRampDataContainer;
 class L1CaloRampMaker;
-// class L1CaloLArTowerEnergy;
-// class TriggerTowerTools;
-
 namespace LVL1{
-  class IL1CaloCells2TriggerTowers;
-  class IL1CaloLArTowerEnergy;
   class IL1CaloOfflineTriggerTowerTools;
+  class IL1TriggerTowerTool;
+  class IL1CaloxAODOfflineTriggerTowerTools;
 }
 
-
 /**
  * The L1CaloRampMaker creates a set of L1CaloRampData objects.
  *
@@ -51,9 +50,7 @@ class L1CaloRampMaker : public AthAlgorithm
 
  private:
     // properties
-    std::string m_triggerTowerCollectionName; // name of transient TriggerTower container
-    std::string m_caloCellContainerName; // name of transient CaloCell container.
-    std::string m_l1CaloCells2TriggerTowersToolName;
+    std::string m_triggerTowerContainerName; // name of transient TriggerTower container
     std::string m_outputFolderName;
     std::string m_gainStrategyFolder;
     std::map<int, int> m_specialChannelRange; // upper limit for coolIds (sick TBB)
@@ -70,40 +67,36 @@ class L1CaloRampMaker : public AthAlgorithm
     int m_fadcSaturationCut; // cut on FADC counts
     double m_tileSaturationCut; // cut on Tile TT Et in GeV
     ToolHandle<LVL1::IL1TriggerTowerTool> m_ttTool; // Handle to L1TriggerTowerTool.
-    ToolHandle<TileBeamInfoProvider> m_beamInfo; // Handle to TileBeamInfoProvider for CISPAR info.
+    ToolHandle<LVL1::IL1CaloxAODOfflineTriggerTowerTools> m_xAODTTTools;
+    ToolHandle<LVL1::IL1CaloOfflineTriggerTowerTools> m_jmTools;
+    ServiceHandle<L1CaloCondSvc> m_condSvc;
 
     unsigned int m_nEvent;
     bool m_firstEvent;
 
-    StoreGateSvc *m_storeGate;
-    StoreGateSvc *m_detStore;
-    L1CaloCondSvc *m_condSvc;
-
     const CaloLVL1_ID *m_lvl1Helper;
-//     L1CaloCells2TriggerTowers *m_cells2tt;
-//     TriggerTowerTools* m_jmTools;
-
-    ToolHandle<LVL1::IL1CaloCells2TriggerTowers> m_cells2tt;
-    ToolHandle<LVL1::IL1CaloOfflineTriggerTowerTools> m_jmTools;
 
-    L1CaloRampDataContainer *m_rampDataContainer;
-    L1CaloPprLutContainer *m_pprLutContainer;
+    std::unique_ptr<L1CaloRampDataContainer> m_rampDataContainer;
+    L1CaloPprConditionsContainerRun2 *m_pprLutContainer;
     L1CaloPprDisabledChannelContainer *m_pprDisabledChannelContainer;
-//     L1CaloLArTowerEnergy *m_larEnergy;
-    ToolHandle<LVL1::IL1CaloLArTowerEnergy> m_larEnergy;
 
     // private functions
-    void setupRampDataContainer(const TriggerTowerCollection* triggerTowerCollection);
-    double getTriggerTowerEnergy(const std::vector<int>& adc, const Identifier& id, unsigned int coolId, double eta);
-    double getCaloEnergy(const Identifier& id, const TriggerTower* tt);
-    
+    void setupRampDataContainer(const xAOD::TriggerTowerContainer* triggerTowerContainer);
+    double getTriggerTowerEnergy(const xAOD::TriggerTower* tt);
+    double getCaloEnergy(const xAOD::TriggerTower* tt);
+    void checkProvenance(const xAOD::TriggerTower* tt);
 
     // stores coolid vs. number of failed ofc iterations
     std::map<unsigned int, std::pair<unsigned int, double> > m_mapBadOFCIteration;
-    void checkProvenance(const Identifier& ttId, unsigned int coolid);
 
-    std::map<L1CaloPprLutContainer::eCoolFolders, std::string> m_pprLutContainerFolderMap;
+    std::map<L1CaloPprConditionsContainerRun2::eCoolFolders, std::string> m_pprLutContainerFolderMap;
     std::map<L1CaloPprDisabledChannelContainer::eCoolFolders, std::string> m_pprDisabledChannelContainerFolderMap;
+
+    struct DBInfo {
+      unsigned int pedValue;
+      bool disabledChannel;
+    };
+    std::map<uint32_t, DBInfo> m_tempDBInfo;
 };
 
 #endif //L1CALORAMPMAKER_H
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/cmt/requirements b/Trigger/TrigT1/TrigT1CaloCalibUtils/cmt/requirements
index 5f0bd8731259c551591e8ecea6f6f93726713aaf..71c54f704aef6381bce2f5870d68245d0c5c75a2 100755
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/cmt/requirements
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/cmt/requirements
@@ -4,16 +4,12 @@ author Damien Prieur <damien.prieur@cern.ch>
 
 use AtlasPolicy     AtlasPolicy-*
 use GaudiInterface  GaudiInterface-*  External
-use StoreGate       StoreGate-*       Control
 use AthenaKernel    AthenaKernel-*    Control
 use EventInfo       EventInfo-*       Event
 
 use AtlasBoost      AtlasBoost-*      External
 use AtlasCLHEP      AtlasCLHEP-*      External
 use AtlasCORAL      AtlasCORAL-*      External
-private
-use AtlasROOT       AtlasROOT-*       External
-end_private
 
 use AthenaBaseComps AthenaBaseComps-* Control
 use AthenaPoolUtilities  AthenaPoolUtilities-*  Database/AthenaPOOL
@@ -24,25 +20,12 @@ use Identifier            Identifier-*            DetectorDescription
 use CaloTriggerTool       CaloTriggerTool-*       Calorimeter
 use CaloIdentifier        CaloIdentifier-*        Calorimeter
 
-private
-use CaloEvent             CaloEvent-*             Calorimeter
-use CaloDetDescr          CaloDetDescr*           Calorimeter
-use LArRecUtils           LArRecUtils-*           LArCalorimeter
-use AtlasCLHEP_RandomGenerators AtlasCLHEP_RandomGenerators-* Simulation/Tools
-end_private
-
-#use LArRawEvent           LArRawEvent-*           LArCalorimeter
-#use TileEvent             TileEvent-*             TileCalorimeter
-use TileRecUtils          TileRecUtils-*          TileCalorimeter
-
 use TrigConfHLTData       TrigConfHLTData-*       Trigger/TrigConfiguration
 use TrigConfL1Data        TrigConfL1Data-*        Trigger/TrigConfiguration
 use TrigSteeringEvent     TrigSteeringEvent-*     Trigger/TrigEvent
-use TrigT1Interfaces    	TrigT1Interfaces-*    	Trigger/TrigT1
 
 use TrigT1CaloEvent           TrigT1CaloEvent-*           Trigger/TrigT1
 use TrigT1CaloUtils           TrigT1CaloUtils-*           Trigger/TrigT1
-use TrigT1CaloToolInterfaces  TrigT1CaloToolInterfaces-*  Trigger/TrigT1
 use TrigT1CaloMonitoringTools TrigT1CaloMonitoringTools-* Trigger/TrigT1
 use TrigT1CaloCalibConditions TrigT1CaloCalibConditions-* Trigger/TrigT1
 use TrigT1CaloCondSvc         TrigT1CaloCondSvc-*         Trigger/TrigT1
@@ -50,6 +33,19 @@ use TrigT1CaloCalibTools      TrigT1CaloCalibTools-*      Trigger/TrigT1
 use TrigT1CaloCalibToolInterfaces      TrigT1CaloCalibToolInterfaces-*      Trigger/TrigT1
 use xAODTrigL1Calo		xAODTrigL1Calo-*		Event/xAOD
 
+private
+use AtlasCLHEP_RandomGenerators AtlasCLHEP_RandomGenerators-* Simulation/Tools
+use AtlasROOT       AtlasROOT-*       External
+use CaloEvent             CaloEvent-*             Calorimeter
+use CaloDetDescr          CaloDetDescr*           Calorimeter
+use CxxUtils		  CxxUtils-*		  Control
+use LArRecUtils           LArRecUtils-*           LArCalorimeter
+use StoreGate       StoreGate-*       Control
+use TrigT1CaloToolInterfaces  TrigT1CaloToolInterfaces-*  Trigger/TrigT1
+use TrigT1Interfaces    	TrigT1Interfaces-*    	Trigger/TrigT1
+use xAODEventInfo	  xAODEventInfo-*	  Event/xAOD
+end_private
+
 apply_pattern dual_use_library files=*.cxx
 apply_pattern declare_joboptions files="*.txt *.py"
 apply_pattern declare_python_modules files=*.py
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/python/L1CaloDumpRampDataAlgorithm.py b/Trigger/TrigT1/TrigT1CaloCalibUtils/python/L1CaloDumpRampDataAlgorithm.py
index a078f6cef37201755b8bbac080dd0c849a716c2d..e2e16bea75600a2e79d1f9c87ff9012e990c900c 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/python/L1CaloDumpRampDataAlgorithm.py
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/python/L1CaloDumpRampDataAlgorithm.py
@@ -7,6 +7,9 @@ from PyKernel import PyKernel
 import scipy
 import sys,traceback
 
+# vscharf 20150519: This algorithm doesn't work with release 20.1.X-VAL due to
+# memory management issues between ROOT and python. Replaced by
+# TrigT1CaloCalibUtils/L1CaloDumpRampData
 class L1CaloDumpRampDataAlgorithm(PyAthena.Alg):
     """ Test reading back in conditions data. """
     def __init__(self, name="L1CaloDumpRampDataAlgorithm"):
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/share/LArL1CaloRampMaker.py b/Trigger/TrigT1/TrigT1CaloCalibUtils/share/LArL1CaloRampMaker.py
new file mode 100755
index 0000000000000000000000000000000000000000..8e1eca5007937043576e3e5dc2396638fce052fd
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/share/LArL1CaloRampMaker.py
@@ -0,0 +1,251 @@
+################################################################################
+# config
+################################################################################
+
+EvtMax = 2500
+SkipEvents = 0
+doLAr = True
+doTile = False
+
+from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
+athenaCommonFlags.BSRDOInput = ['/afs/cern.ch/work/j/juraj/public/2015/LAr/264948/data15_calib.00264948.calibration_L1CaloEnergyScan.daq.RAW._lb0000._SFO-1._0003.data']
+FilesInput = athenaCommonFlags.BSRDOInput()
+
+
+################################################################################
+# actual job options
+################################################################################
+
+# initial setup
+from AthenaCommon.AlgSequence import AlgSequence
+from AthenaCommon.AppMgr import ToolSvc,theApp,ServiceMgr
+topSequence = AlgSequence()
+
+# add EventInfo to xAOD::EventInfo conversion
+topSequence += CfgMgr.xAODMaker__EventInfoCnvAlg()
+
+# setup athenaCommonFlags
+from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
+athenaCommonFlags.EvtMax = EvtMax
+athenaCommonFlags.SkipEvents = SkipEvents
+athenaCommonFlags.FilesInput = FilesInput
+del SkipEvents
+del EvtMax
+del FilesInput
+
+# setup globalflags
+from AthenaCommon.GlobalFlags  import globalflags
+
+import sys
+sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/') # CERN
+from AtlCoolBKLib import resolveAlias
+conditionsTag = resolveAlias.getCurrent()
+print conditionsTag
+globalflags.ConditionsTag.set_Value_and_Lock(conditionsTag)
+
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock('cosmics')
+
+from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
+ConfigureFromListOfKeys(['everything'])
+
+# database tag
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag(globalflags.ConditionsTag())
+
+# setup detflags
+import DetDescrCnvSvc.DetStoreConfig
+from AthenaCommon.DetFlags import DetFlags
+if doLAr: DetFlags.detdescr.LAr_setOn()
+if doTile: DetFlags.detdescr.Tile_setOn()
+
+# needed ....
+#from RecExConfig.RecFlags import rec
+rec.doLArg.set_Value_and_Lock(doLAr)
+rec.doTile.set_Value_and_Lock(doTile)
+rec.doCalo.set_Value_and_Lock(doLAr or doTile)
+rec.Commissioning.set_Value_and_Lock(True)
+
+# setup geometry
+from AtlasGeoModel import SetGeometryVersion
+from AtlasGeoModel import GeoModelInit
+from AtlasGeoModel import SetupRecoGeometry
+
+# setup bytestream reading
+from ByteStreamCnvSvc import ReadByteStream
+svcMgr.ByteStreamInputSvc.FullFileName = athenaCommonFlags.FilesInput()
+theApp.EvtMax = athenaCommonFlags.EvtMax()
+svcMgr.EventSelector.SkipEvents = athenaCommonFlags.SkipEvents()
+# Level-1 bs data
+include ("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py")
+
+# detector description
+include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py")
+include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")
+include("TileIdCnv/TileIdCnv_jobOptions.py")
+include("TileConditions/TileConditions_jobOptions.py")
+        
+# extra LAr setup
+if doLAr:
+    include("LArConditionsCommon/LArIdMap_comm_jobOptions.py")
+    include("LArIdCnv/LArIdCnv_joboptions.py")
+    svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"]
+    include("LArROD/LArFebErrorSummaryMaker_jobOptions.py")
+    
+    from LArConditionsCommon.LArCondFlags import larCondFlags
+    larCondFlags.useLArFEBGainThresholds.set_Value_and_Lock(False)
+
+    from LArROD.LArRODFlags import larRODFlags
+    larRODFlags.keepDSPRaw = False
+
+    print larRODFlags
+    print larCondFlags
+
+    # cell reconstruction properties
+    from CaloRec.CaloCellFlags import jobproperties
+    # reconstruct cells
+    from CaloRec.CaloCellGetter import CaloCellGetter
+    CaloCellGetter()
+
+else:
+    from TileRecUtils.TileRecFlags import jobproperties
+    jobproperties.TileRecFlags.doTileOpt2=True
+    jobproperties.TileRecFlags.readDigits=True
+    jobproperties.TileRecFlags.noiseFilter=0
+    jobproperties.TileRecFlags.TileRunType=8
+    jobproperties.TileRecFlags.calibrateEnergy=False
+    jobproperties.TileRecFlags.OfcFromCOOL=False
+    jobproperties.TileRecFlags.BestPhaseFromCOOL=False
+    jobproperties.TileRecFlags.correctTime=False
+    jobproperties.TileRecFlags.correctAmplitude=False
+
+    from TileConditions.TileCondToolConf import *
+    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','CIS')
+
+    tileCondToolOfcCool = getTileCondToolOfcCool('COOL', 'CISPULSE100')
+    from AthenaCommon.AppMgr import ToolSvc
+    ToolSvc += tileCondToolOfcCool
+
+    tileCondToolOfc = CfgMgr.TileCondToolOfc()
+    tileCondToolOfc.TileCondToolPulseShape = getTileCondToolPulseShape('COOL','CISPULSE100')
+
+    include( "TileRec/TileRec_jobOptions.py" )
+    include( "TileRec/TileCellMaker_jobOptions.py" )
+    ToolSvc.TileBeamInfoProvider.TileRawChannelContainer = 'TileRawChannelOpt2'
+    # turn off masking of bad channels
+    ToolSvc.TileCellBuilder.maskBadChannels = False
+
+# setup l1calo database
+include('TrigT1CaloCalibConditions/L1CaloCalibConditions_jobOptions.py')
+
+# set up tools
+ToolSvc += CfgMgr.LVL1__L1TriggerTowerTool()
+ToolSvc += CfgMgr.LVL1__L1CaloLArTowerEnergy()
+
+# add cell decoration
+include('TrigT1CaloCalibTools/DecorateL1CaloTriggerTowers_prodJobOFragment.py')
+
+# configure actual ramp maker algorithm
+topSequence += CfgMgr.L1CaloRampMaker()
+topSequence.L1CaloRampMaker.L1TriggerTowerTool = CfgMgr.LVL1__L1TriggerTowerTool()
+topSequence.L1CaloRampMaker.DoTile = doTile
+topSequence.L1CaloRampMaker.DoLAr = doLAr
+topSequence.L1CaloRampMaker.EventsPerEnergyStep = 200
+#topSequence.L1CaloRampMaker.NumberOfEnergySteps = 9
+topSequence.L1CaloRampMaker.NumberOfEnergySteps = 11
+topSequence.L1CaloRampMaker.IsGain1 = True
+topSequence.L1CaloRampMaker.CheckProvenance = False
+topSequence.L1CaloRampMaker.TileSaturationCut = 255.
+# special region 1.3 < |eta| < 1.5, saturation on tile side.
+topSequence.L1CaloRampMaker.SpecialChannelRange = { 0x6130f02 : 150, 0x7100003 : 150, 0x7180f03 : 150, 0x7180303 : 150, 0x7100200 : 150,
+	0x6130601 : 150, 0x6130302 : 150, 0x61f0303 : 150, 0x71c0e00 : 150, 0x71c0a00 : 150, 0x7180501 : 150, 0x6130003 : 150, 0x7140d01 : 150,
+	0x7140600 : 150, 0x7100d00 : 150, 0x6170900 : 150, 0x61b0901 : 150, 0x7180002 : 150, 0x7140c03 : 150, 0x6170901 : 150, 0x6130702 : 150,
+	0x7180a00 : 150, 0x61b0403 : 150, 0x6130e00 : 150, 0x7180601 : 150, 0x61f0200 : 150, 0x6130002 : 150, 0x61b0601 : 150, 0x71c0e01 : 150,
+	0x7100900 : 150, 0x7100901 : 150, 0x7100501 : 150, 0x6170100 : 150, 0x7140802 : 150, 0x7140003 : 150, 0x7140803 : 150, 0x7180c02 : 150,
+	0x7100f02 : 150, 0x61b0b03 : 150, 0x6170302 : 150, 0x6170303 : 150, 0x7180703 : 150, 0x6170b02 : 150, 0x71c0402 : 150, 0x61f0803 : 150,
+	0x6170b03 : 150, 0x6130101 : 150, 0x71c0601 : 150, 0x7140702 : 150, 0x61f0500 : 150, 0x71c0403 : 150, 0x71c0501 : 150, 0x7140e00 : 150,
+	0x7140703 : 150, 0x7140402 : 150, 0x61f0501 : 150, 0x7140403 : 150, 0x61b0402 : 150, 0x7140e01 : 150, 0x6130703 : 150, 0x7180302 : 150,
+	0x61b0a00 : 150, 0x61b0f02 : 150, 0x61b0f03 : 150, 0x7180100 : 150, 0x61b0303 : 150, 0x61f0e01 : 150, 0x71c0b03 : 150, 0x6130d00 : 150,
+	0x7180101 : 150, 0x7100c03 : 150, 0x61b0a01 : 150, 0x6170802 : 150, 0x7100d01 : 150, 0x6130500 : 150, 0x7100403 : 150, 0x6130d01 : 150,
+	0x7180702 : 150, 0x6170601 : 150, 0x61f0302 : 150, 0x71c0302 : 150, 0x61f0a01 : 150, 0x7180d00 : 150, 0x6130901 : 150, 0x7180d01 : 150,
+	0x71c0303 : 150, 0x61f0901 : 150, 0x7140d00 : 150, 0x71c0a01 : 150, 0x7180c03 : 150, 0x6170c03 : 150, 0x6130201 : 150, 0x61b0702 : 150,
+	0x71c0b02 : 150, 0x7100b02 : 150, 0x71c0600 : 150, 0x61f0600 : 150, 0x7140901 : 150, 0x61f0f02 : 150, 0x6170702 : 150, 0x6130803 : 150,
+	0x6170403 : 150, 0x6170e00 : 150, 0x7180803 : 150, 0x6170703 : 150, 0x71c0c02 : 150, 0x7140f02 : 150, 0x71c0c03 : 150, 0x7100500 : 150,
+	0x7140f03 : 150, 0x6130e01 : 150, 0x61b0b02 : 150, 0x6130c02 : 150, 0x6170101 : 150, 0x7100302 : 150, 0x61b0100 : 150, 0x7180003 : 150,
+	0x7140501 : 150, 0x7100a00 : 150, 0x6130c03 : 150, 0x71c0900 : 150, 0x7100303 : 150, 0x6170002 : 150, 0x61b0101 : 150, 0x7180802 : 150,
+	0x7100b03 : 150, 0x61f0402 : 150, 0x61f0403 : 150, 0x61f0f03 : 150, 0x7180e00 : 150, 0x7100a01 : 150, 0x7100201 : 150, 0x6130402 : 150,
+	0x71c0101 : 150, 0x6170d01 : 150, 0x7140c02 : 150, 0x61f0a00 : 150, 0x6130403 : 150, 0x61b0c03 : 150, 0x6170d00 : 150, 0x71c0702 : 150,
+	0x6130a01 : 150, 0x71c0d01 : 150, 0x6170c02 : 150, 0x61b0803 : 150, 0x7100600 : 150, 0x6170500 : 150, 0x61f0201 : 150, 0x6130600 : 150,
+	0x61b0002 : 150, 0x7180900 : 150, 0x6170501 : 150, 0x7180901 : 150, 0x61b0003 : 150, 0x6130a00 : 150, 0x61f0900 : 150, 0x6170803 : 150,
+	0x7140303 : 150, 0x7140100 : 150, 0x71c0200 : 150, 0x7180f02 : 150, 0x7140500 : 150, 0x71c0201 : 150, 0x6170003 : 150, 0x6130200 : 150,
+	0x7140601 : 150, 0x6170e01 : 150, 0x61f0b02 : 150, 0x61f0b03 : 150, 0x71c0f02 : 150, 0x61b0e00 : 150, 0x61b0703 : 150, 0x71c0002 : 150,
+	0x61b0e01 : 150, 0x7140a01 : 150, 0x6130b02 : 150, 0x71c0802 : 150, 0x7140b02 : 150, 0x71c0803 : 150, 0x7100100 : 150, 0x61f0100 : 150,
+	0x61b0900 : 150, 0x7140b03 : 150, 0x71c0003 : 150, 0x6130f03 : 150, 0x7100101 : 150, 0x7140a00 : 150, 0x7140200 : 150, 0x7140201 : 150,
+	0x61f0702 : 150, 0x7100802 : 150, 0x61b0d00 : 150, 0x61b0600 : 150, 0x61b0d01 : 150, 0x7180402 : 150, 0x61f0c02 : 150, 0x61f0c03 : 150,
+	0x7100703 : 150, 0x61f0002 : 150, 0x6130900 : 150, 0x71c0703 : 150, 0x7180a01 : 150, 0x7180e01 : 150, 0x61f0601 : 150, 0x7140002 : 150,
+	0x61f0802 : 150, 0x7100002 : 150, 0x7100c02 : 150, 0x7100f03 : 150, 0x61b0200 : 150, 0x6130100 : 150, 0x6170f02 : 150, 0x6170200 : 150,
+	0x61b0201 : 150, 0x6170f03 : 150, 0x6170600 : 150, 0x6130501 : 150, 0x7140900 : 150, 0x61b0501 : 150, 0x71c0901 : 150, 0x7100702 : 150,
+	0x61b0500 : 150, 0x7100803 : 150, 0x7180403 : 150, 0x61b0802 : 150, 0x71c0d00 : 150, 0x6130b03 : 150, 0x6130303 : 150, 0x6170201 : 150,
+	0x7180600 : 150, 0x61f0003 : 150, 0x7100e01 : 150, 0x7180500 : 150, 0x71c0f03 : 150, 0x6170a00 : 150, 0x61b0c02 : 150, 0x61f0101 : 150,
+	0x6170402 : 150, 0x7100402 : 150, 0x6130802 : 150, 0x7100e00 : 150, 0x7140302 : 150, 0x61f0e00 : 150, 0x7180b02 : 150, 0x7180b03 : 150,
+	0x71c0500 : 150, 0x7140101 : 150, 0x6170a01 : 150, 0x7180200 : 150, 0x7180201 : 150, 0x61b0302 : 150, 0x61f0703 : 150, 0x71c0100 : 150,
+	0x7100601 : 150, 0x61f0d00 : 150, 0x61f0d01 : 150,
+	# saturating channels
+	0x7120203 : 100
+	#0x7120203 : 100, 0x6170c03 : 50, 0x6150b02 : 100, 0x6180d03 : 150, 0x61b0f02 : 100, 0x71d0d02 : 150, 
+	#0x61c0a00 : 100, 0x6160f03 : 150, 0x6110901 : 150, 0x6140c02 : 150, 0x61a0e03 : 150, 0x61a0103 : 150,
+	#0x61b0f00 : 150, 0x61b0f01 : 150 
+}
+
+# configure fitting algorithm
+topSequence += CfgMgr.L1CaloLinearCalibration()
+
+# configure writing of L1CaloRampData.pool.root
+from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
+outputConditionsAlg = OutputConditionsAlg("outputConditionsAlg", "L1CaloRampData.pool.root")
+outputConditionsAlg.ObjectList = ["L1CaloRampDataContainer"]
+outputConditionsAlg.WriteIOV = False
+
+# configure writing of calib database
+EnergyScanResultOutput = OutputConditionsAlg("EnergyScanResultOutput", "dummy.root")
+EnergyScanResultOutput.ObjectList = ["CondAttrListCollection#/TRIGGER/L1Calo/V1/Results/EnergyScanResults",
+                                     "AthenaAttributeList#/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo"]
+EnergyScanResultOutput.WriteIOV = True
+EnergyScanResultOutput.Run1 = GetRunNumber()
+svcMgr.IOVDbSvc.dbConnection="sqlite://;schema=energyscanresults.sqlite;dbname=L1CALO"
+
+# configure writing of additional files for the calibration gui
+topSequence += CfgMgr.L1CaloDumpRampData(RootStreamName="RAMPDATA")
+#from TrigT1CaloCalibUtils.L1CaloDumpRampDataAlgorithm import L1CaloDumpRampDataAlgorithm
+#topSequence += L1CaloDumpRampDataAlgorithm()
+
+# run finetime
+topSequence += CfgMgr.L1CaloPprMonitoring("L1CaloPprMonitoring",
+                                          lumiBlockMax = 2,
+                                          ppmADCMinValue = 80,
+                                          ppmADCMaxValue = 963,
+                                          doFineTimePlots = True,
+                                          doPedestalPlots = False,
+                                          doEtCorrelationPlots = False,
+                                          doCaloQualCut = False
+                                      )
+ToolSvc += CfgMgr.LVL1__TrigT1CaloLWHistogramTool("TrigT1CaloLWHistogramTool", LVL1ConfigSvc = "")
+
+ServiceMgr += CfgMgr.THistSvc()
+ServiceMgr.THistSvc.Output = ["AANT DATAFILE='output.root' OPT='RECREATE'"]
+ServiceMgr.THistSvc.Output += ["RAMPDATA DATAFILE='graphs.root' OPT='RECREATE'"]
+svcMgr.IOVDbSvc.Folders += ["<dbConnection>sqlite://;schema=/afs/cern.ch/user/l/l1ccalib/w0/DaemonData/reference/calibReferences.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/References/FineTimeReferences"]
+
+conddb.addFolderWithTag("TRIGGER", "/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib", "HEAD")
+
+# override timestamp with SOR time of run
+# this overcomes strange timestamps stored in the EventInfo
+# code taken from CoolConvUtilities/MagFieldUtils.py
+from CoolConvUtilities.AtlCoolLib import indirectOpen
+foldername_ = '/TDAQ/RunCtrl/SOR' if svcMgr.IOVDbSvc.DBInstance == 'CONDBR2' else '/TDAQ/RunCtrl/SOR_Params'
+db_ = indirectOpen('COOLONL_TDAQ/%s' % svcMgr.IOVDbSvc.DBInstance, oracle=True)
+if not db_: raise RuntimeError("Couldn't open connection to TDAQ DB")
+folder_ = db_.getFolder(foldername_)
+obj_ = folder_.findObject(GetRunNumber() << 32, 0)
+payload_ = obj_.payload() 
+svcMgr.IOVDbSvc.forceTimestamp = payload_['SORTime'] / 1000000000L
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/share/TileL1CaloRampMaker.py b/Trigger/TrigT1/TrigT1CaloCalibUtils/share/TileL1CaloRampMaker.py
new file mode 100755
index 0000000000000000000000000000000000000000..5dc04274e2be0e8309f55aaedb6548cacfae016a
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/share/TileL1CaloRampMaker.py
@@ -0,0 +1,245 @@
+################################################################################
+# config
+################################################################################
+
+EvtMax = 2500
+SkipEvents = 0
+
+from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
+athenaCommonFlags.BSRDOInput = ['/afs/cern.ch/work/j/juraj/public/2015/TileCIS/264498/data15_calib.00264498.calibration_L1CaloEnergyScan.daq.RAW._lb0000._SFO-1._0001.data']
+FilesInput = athenaCommonFlags.BSRDOInput()
+
+doLAr = False
+doTile = True
+
+################################################################################
+# actual job options
+################################################################################
+
+# initial setup
+from AthenaCommon.AlgSequence import AlgSequence
+from AthenaCommon.AppMgr import ToolSvc,theApp,ServiceMgr
+topSequence = AlgSequence()
+
+# add EventInfo to xAOD::EventInfo conversion
+topSequence += CfgMgr.xAODMaker__EventInfoCnvAlg()
+
+# setup athenaCommonFlags
+from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
+athenaCommonFlags.EvtMax = EvtMax
+athenaCommonFlags.SkipEvents = SkipEvents
+athenaCommonFlags.FilesInput = FilesInput
+del SkipEvents
+del EvtMax
+del FilesInput
+
+# setup globalflags
+from AthenaCommon.GlobalFlags  import globalflags
+
+#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-BLKPA-2015-04")
+import sys
+sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/') # CERN
+#sys.path.append('/home/atdata5/pjwf/atlcond/utils/python') # Brum
+from AtlCoolBKLib import resolveAlias
+conditionsTag = resolveAlias.getCurrent()
+print conditionsTag
+globalflags.ConditionsTag.set_Value_and_Lock(conditionsTag)
+
+from AthenaCommon.BeamFlags import jobproperties
+jobproperties.Beam.beamType.set_Value_and_Lock('cosmics')
+
+from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
+ConfigureFromListOfKeys(['everything'])
+
+# database tag
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag(globalflags.ConditionsTag())
+
+# setup detflags
+import DetDescrCnvSvc.DetStoreConfig
+from AthenaCommon.DetFlags import DetFlags
+if doLAr: DetFlags.detdescr.LAr_setOn()
+if doTile: DetFlags.detdescr.Tile_setOn()
+
+# needed ....
+#from RecExConfig.RecFlags import rec
+rec.doLArg.set_Value_and_Lock(doLAr)
+rec.doTile.set_Value_and_Lock(doTile)
+rec.doCalo.set_Value_and_Lock(doLAr or doTile)
+rec.Commissioning.set_Value_and_Lock(True)
+
+# setup geometry
+from AtlasGeoModel import SetGeometryVersion
+from AtlasGeoModel import GeoModelInit
+from AtlasGeoModel import SetupRecoGeometry
+
+# setup bytestream reading
+from ByteStreamCnvSvc import ReadByteStream
+svcMgr.ByteStreamInputSvc.FullFileName = athenaCommonFlags.FilesInput()
+theApp.EvtMax = athenaCommonFlags.EvtMax()
+svcMgr.EventSelector.SkipEvents = athenaCommonFlags.SkipEvents()
+# Level-1 bs data
+include ("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py")
+
+# detector description
+include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py")
+include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")
+include("TileIdCnv/TileIdCnv_jobOptions.py")
+include("TileConditions/TileConditions_jobOptions.py")
+        
+# extra LAr setup
+if doLAr:
+    include("LArConditionsCommon/LArIdMap_comm_jobOptions.py")
+    include("LArIdCnv/LArIdCnv_joboptions.py")
+    svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"]
+    include("LArROD/LArFebErrorSummaryMaker_jobOptions.py")
+    # cell reconstruction properties
+    from CaloRec.CaloCellFlags import jobproperties
+    # reconstruct cells
+    from CaloRec.CaloCellGetter import CaloCellGetter
+    CaloCellGetter()
+
+else:
+    from TileRecUtils.TileRecFlags import jobproperties
+    jobproperties.TileRecFlags.doTileOpt2=True
+    jobproperties.TileRecFlags.readDigits=True
+    jobproperties.TileRecFlags.noiseFilter=0
+    jobproperties.TileRecFlags.TileRunType=8
+    jobproperties.TileRecFlags.calibrateEnergy=False
+    jobproperties.TileRecFlags.OfcFromCOOL=False
+    jobproperties.TileRecFlags.BestPhaseFromCOOL=False
+    jobproperties.TileRecFlags.correctTime=False
+    jobproperties.TileRecFlags.correctAmplitude=False
+
+    from TileConditions.TileCondToolConf import *
+    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','CIS')
+
+    tileCondToolOfcCool = getTileCondToolOfcCool('COOL', 'CISPULSE100')
+    from AthenaCommon.AppMgr import ToolSvc
+    ToolSvc += tileCondToolOfcCool
+
+    tileCondToolOfc = CfgMgr.TileCondToolOfc()
+    tileCondToolOfc.TileCondToolPulseShape = getTileCondToolPulseShape('COOL','CISPULSE100')
+
+    include( "TileRec/TileRec_jobOptions.py" )
+    include( "TileRec/TileCellMaker_jobOptions.py" )
+    ToolSvc.TileBeamInfoProvider.TileRawChannelContainer = 'TileRawChannelOpt2'
+    # turn off masking of bad channels
+    ToolSvc.TileCellBuilder.maskBadChannels = False
+
+# setup l1calo database
+include('TrigT1CaloCalibConditions/L1CaloCalibConditions_jobOptions.py')
+
+# set up tools
+ToolSvc += CfgMgr.LVL1__L1TriggerTowerTool()
+ToolSvc += CfgMgr.LVL1__L1CaloLArTowerEnergy()
+
+# add cell decoration
+include('TrigT1CaloCalibTools/DecorateL1CaloTriggerTowers_prodJobOFragment.py')
+
+# configure actual ramp maker algorithm
+topSequence += CfgMgr.L1CaloRampMaker()
+topSequence.L1CaloRampMaker.L1TriggerTowerTool = CfgMgr.LVL1__L1TriggerTowerTool()
+topSequence.L1CaloRampMaker.DoTile = doTile
+topSequence.L1CaloRampMaker.DoLAr = doLAr
+topSequence.L1CaloRampMaker.EventsPerEnergyStep = 200
+#topSequence.L1CaloRampMaker.NumberOfEnergySteps = 9
+topSequence.L1CaloRampMaker.NumberOfEnergySteps = 11
+topSequence.L1CaloRampMaker.IsGain1 = True
+topSequence.L1CaloRampMaker.CheckProvenance = False
+topSequence.L1CaloRampMaker.TileSaturationCut = 255.
+# special region 1.3 < |eta| < 1.5, saturation on tile side.
+topSequence.L1CaloRampMaker.SpecialChannelRange = { 0x6130f02 : 150, 0x7100003 : 150, 0x7180f03 : 150, 0x7180303 : 150, 0x7100200 : 150,
+	0x6130601 : 150, 0x6130302 : 150, 0x61f0303 : 150, 0x71c0e00 : 150, 0x71c0a00 : 150, 0x7180501 : 150, 0x6130003 : 150, 0x7140d01 : 150,
+	0x7140600 : 150, 0x7100d00 : 150, 0x6170900 : 150, 0x61b0901 : 150, 0x7180002 : 150, 0x7140c03 : 150, 0x6170901 : 150, 0x6130702 : 150,
+	0x7180a00 : 150, 0x61b0403 : 150, 0x6130e00 : 150, 0x7180601 : 150, 0x61f0200 : 150, 0x6130002 : 150, 0x61b0601 : 150, 0x71c0e01 : 150,
+	0x7100900 : 150, 0x7100901 : 150, 0x7100501 : 150, 0x6170100 : 150, 0x7140802 : 150, 0x7140003 : 150, 0x7140803 : 150, 0x7180c02 : 150,
+	0x7100f02 : 150, 0x61b0b03 : 150, 0x6170302 : 150, 0x6170303 : 150, 0x7180703 : 150, 0x6170b02 : 150, 0x71c0402 : 150, 0x61f0803 : 150,
+	0x6170b03 : 150, 0x6130101 : 150, 0x71c0601 : 150, 0x7140702 : 150, 0x61f0500 : 150, 0x71c0403 : 150, 0x71c0501 : 150, 0x7140e00 : 150,
+	0x7140703 : 150, 0x7140402 : 150, 0x61f0501 : 150, 0x7140403 : 150, 0x61b0402 : 150, 0x7140e01 : 150, 0x6130703 : 150, 0x7180302 : 150,
+	0x61b0a00 : 150, 0x61b0f02 : 150, 0x61b0f03 : 150, 0x7180100 : 150, 0x61b0303 : 150, 0x61f0e01 : 150, 0x71c0b03 : 150, 0x6130d00 : 150,
+	0x7180101 : 150, 0x7100c03 : 150, 0x61b0a01 : 150, 0x6170802 : 150, 0x7100d01 : 150, 0x6130500 : 150, 0x7100403 : 150, 0x6130d01 : 150,
+	0x7180702 : 150, 0x6170601 : 150, 0x61f0302 : 150, 0x71c0302 : 150, 0x61f0a01 : 150, 0x7180d00 : 150, 0x6130901 : 150, 0x7180d01 : 150,
+	0x71c0303 : 150, 0x61f0901 : 150, 0x7140d00 : 150, 0x71c0a01 : 150, 0x7180c03 : 150, 0x6170c03 : 150, 0x6130201 : 150, 0x61b0702 : 150,
+	0x71c0b02 : 150, 0x7100b02 : 150, 0x71c0600 : 150, 0x61f0600 : 150, 0x7140901 : 150, 0x61f0f02 : 150, 0x6170702 : 150, 0x6130803 : 150,
+	0x6170403 : 150, 0x6170e00 : 150, 0x7180803 : 150, 0x6170703 : 150, 0x71c0c02 : 150, 0x7140f02 : 150, 0x71c0c03 : 150, 0x7100500 : 150,
+	0x7140f03 : 150, 0x6130e01 : 150, 0x61b0b02 : 150, 0x6130c02 : 150, 0x6170101 : 150, 0x7100302 : 150, 0x61b0100 : 150, 0x7180003 : 150,
+	0x7140501 : 150, 0x7100a00 : 150, 0x6130c03 : 150, 0x71c0900 : 150, 0x7100303 : 150, 0x6170002 : 150, 0x61b0101 : 150, 0x7180802 : 150,
+	0x7100b03 : 150, 0x61f0402 : 150, 0x61f0403 : 150, 0x61f0f03 : 150, 0x7180e00 : 150, 0x7100a01 : 150, 0x7100201 : 150, 0x6130402 : 150,
+	0x71c0101 : 150, 0x6170d01 : 150, 0x7140c02 : 150, 0x61f0a00 : 150, 0x6130403 : 150, 0x61b0c03 : 150, 0x6170d00 : 150, 0x71c0702 : 150,
+	0x6130a01 : 150, 0x71c0d01 : 150, 0x6170c02 : 150, 0x61b0803 : 150, 0x7100600 : 150, 0x6170500 : 150, 0x61f0201 : 150, 0x6130600 : 150,
+	0x61b0002 : 150, 0x7180900 : 150, 0x6170501 : 150, 0x7180901 : 150, 0x61b0003 : 150, 0x6130a00 : 150, 0x61f0900 : 150, 0x6170803 : 150,
+	0x7140303 : 150, 0x7140100 : 150, 0x71c0200 : 150, 0x7180f02 : 150, 0x7140500 : 150, 0x71c0201 : 150, 0x6170003 : 150, 0x6130200 : 150,
+	0x7140601 : 150, 0x6170e01 : 150, 0x61f0b02 : 150, 0x61f0b03 : 150, 0x71c0f02 : 150, 0x61b0e00 : 150, 0x61b0703 : 150, 0x71c0002 : 150,
+	0x61b0e01 : 150, 0x7140a01 : 150, 0x6130b02 : 150, 0x71c0802 : 150, 0x7140b02 : 150, 0x71c0803 : 150, 0x7100100 : 150, 0x61f0100 : 150,
+	0x61b0900 : 150, 0x7140b03 : 150, 0x71c0003 : 150, 0x6130f03 : 150, 0x7100101 : 150, 0x7140a00 : 150, 0x7140200 : 150, 0x7140201 : 150,
+	0x61f0702 : 150, 0x7100802 : 150, 0x61b0d00 : 150, 0x61b0600 : 150, 0x61b0d01 : 150, 0x7180402 : 150, 0x61f0c02 : 150, 0x61f0c03 : 150,
+	0x7100703 : 150, 0x61f0002 : 150, 0x6130900 : 150, 0x71c0703 : 150, 0x7180a01 : 150, 0x7180e01 : 150, 0x61f0601 : 150, 0x7140002 : 150,
+	0x61f0802 : 150, 0x7100002 : 150, 0x7100c02 : 150, 0x7100f03 : 150, 0x61b0200 : 150, 0x6130100 : 150, 0x6170f02 : 150, 0x6170200 : 150,
+	0x61b0201 : 150, 0x6170f03 : 150, 0x6170600 : 150, 0x6130501 : 150, 0x7140900 : 150, 0x61b0501 : 150, 0x71c0901 : 150, 0x7100702 : 150,
+	0x61b0500 : 150, 0x7100803 : 150, 0x7180403 : 150, 0x61b0802 : 150, 0x71c0d00 : 150, 0x6130b03 : 150, 0x6130303 : 150, 0x6170201 : 150,
+	0x7180600 : 150, 0x61f0003 : 150, 0x7100e01 : 150, 0x7180500 : 150, 0x71c0f03 : 150, 0x6170a00 : 150, 0x61b0c02 : 150, 0x61f0101 : 150,
+	0x6170402 : 150, 0x7100402 : 150, 0x6130802 : 150, 0x7100e00 : 150, 0x7140302 : 150, 0x61f0e00 : 150, 0x7180b02 : 150, 0x7180b03 : 150,
+	0x71c0500 : 150, 0x7140101 : 150, 0x6170a01 : 150, 0x7180200 : 150, 0x7180201 : 150, 0x61b0302 : 150, 0x61f0703 : 150, 0x71c0100 : 150,
+	0x7100601 : 150, 0x61f0d00 : 150, 0x61f0d01 : 150,
+	# saturating channels
+	0x7120203 : 100
+	#0x7120203 : 100, 0x6170c03 : 50, 0x6150b02 : 100, 0x6180d03 : 150, 0x61b0f02 : 100, 0x71d0d02 : 150, 
+	#0x61c0a00 : 100, 0x6160f03 : 150, 0x6110901 : 150, 0x6140c02 : 150, 0x61a0e03 : 150, 0x61a0103 : 150,
+	#0x61b0f00 : 150, 0x61b0f01 : 150 
+}
+
+# configure fitting algorithm
+topSequence += CfgMgr.L1CaloLinearCalibration()
+
+# configure writing of L1CaloRampData.pool.root
+from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
+outputConditionsAlg = OutputConditionsAlg("outputConditionsAlg", "L1CaloRampData.pool.root")
+outputConditionsAlg.ObjectList = ["L1CaloRampDataContainer"]
+outputConditionsAlg.WriteIOV = False
+
+# configure writing of calib database
+EnergyScanResultOutput = OutputConditionsAlg("EnergyScanResultOutput", "dummy.root")
+EnergyScanResultOutput.ObjectList = ["CondAttrListCollection#/TRIGGER/L1Calo/V1/Results/EnergyScanResults",
+                                     "AthenaAttributeList#/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo"]
+EnergyScanResultOutput.WriteIOV = True
+EnergyScanResultOutput.Run1 = GetRunNumber()
+svcMgr.IOVDbSvc.dbConnection="sqlite://;schema=energyscanresults.sqlite;dbname=L1CALO"
+
+# configure writing of additional files for the calibration gui
+topSequence += CfgMgr.L1CaloDumpRampData(RootStreamName="RAMPDATA")
+#from TrigT1CaloCalibUtils.L1CaloDumpRampDataAlgorithm import L1CaloDumpRampDataAlgorithm
+#topSequence += L1CaloDumpRampDataAlgorithm()
+
+# run finetime
+topSequence += CfgMgr.L1CaloPprMonitoring("L1CaloPprMonitoring",
+                                          lumiBlockMax = 2,
+                                          ppmADCMinValue = 80,
+                                          ppmADCMaxValue = 963,
+                                          doFineTimePlots = True,
+                                          doPedestalPlots = False,
+                                          doEtCorrelationPlots = False,
+                                          doCaloQualCut = False
+                                      )
+ToolSvc += CfgMgr.LVL1__TrigT1CaloLWHistogramTool("TrigT1CaloLWHistogramTool", LVL1ConfigSvc = "")
+
+ServiceMgr += CfgMgr.THistSvc()
+ServiceMgr.THistSvc.Output = ["AANT DATAFILE='output.root' OPT='RECREATE'"]
+ServiceMgr.THistSvc.Output += ["RAMPDATA DATAFILE='graphs.root' OPT='RECREATE'"]
+svcMgr.IOVDbSvc.Folders += ["<dbConnection>sqlite://;schema=/afs/cern.ch/user/l/l1ccalib/w0/DaemonData/reference/calibReferences.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/References/FineTimeReferences"]
+conddb.addFolderWithTag("TRIGGER", "/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib", "HEAD")
+
+
+# override timestamp with SOR time of run
+# this overcomes strange timestamps stored in the EventInfo
+# code taken from CoolConvUtilities/MagFieldUtils.py
+# as soon as the timestamps are fixed this should be skipped
+# if 220000 < GetRunNumber() < XXX:
+from CoolConvUtilities.AtlCoolLib import indirectOpen
+foldername_ = '/TDAQ/RunCtrl/SOR' if svcMgr.IOVDbSvc.DBInstance == 'CONDBR2' else '/TDAQ/RunCtrl/SOR_Params'
+db_ = indirectOpen('COOLONL_TDAQ/%s' % svcMgr.IOVDbSvc.DBInstance, oracle=True)
+if not db_: raise RuntimeError("Couldn't open connection to TDAQ DB")
+folder_ = db_.getFolder(foldername_)
+obj_ = folder_.findObject(GetRunNumber() << 32, 0)
+payload_ = obj_.payload() 
+svcMgr.IOVDbSvc.forceTimestamp = payload_['SORTime'] / 1000000000L
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.cxx b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..d9bb7f8dc9cdc9128ff8c40632197b4c464a5497
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.cxx
@@ -0,0 +1,133 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrigT1CaloCalibUtils includes
+#include "L1CaloDumpRampData.h"
+
+#include <fstream> // std::ofstream
+#include <ios> // std::dec, std::hex
+#include <sstream>
+
+#include <TF1.h>
+#include <TFile.h>
+#include <TGraphErrors.h>
+
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "CxxUtils/make_unique.h"
+#include "TrigT1CaloCalibConditions/L1CaloRampDataContainer.h"
+
+L1CaloDumpRampData::L1CaloDumpRampData(const std::string& name, ISvcLocator* pSvcLocator)
+  : AthHistogramAlgorithm(name, pSvcLocator)
+{
+  //declareProperty( "Property", m_nProperty ); //example property declaration
+}
+
+
+L1CaloDumpRampData::~L1CaloDumpRampData() {}
+
+
+StatusCode L1CaloDumpRampData::initialize()
+{
+  ATH_MSG_INFO("Initializing " << name() << "...");
+
+  return StatusCode::SUCCESS;
+}
+
+namespace {
+void writeChannel(std::ofstream& S, uint32_t cool, double slope, double offset, double chi)
+{
+  S << "<Channel coolid='0x" << std::hex << cool
+    << std::dec << "' slope='" << slope
+    << "' offset='" << offset
+    << "' chi2='" << chi << "/>\n";
+}
+
+std::string getName(uint32_t cool)
+{
+  std::ostringstream S;
+  S << "0x" << std::hex << cool;
+  return std::string(S.str());
+}
+
+std::string getTitle(uint32_t cool)
+{
+  return "Ramp " + getName(cool);
+}
+
+} // anonymous namespace
+
+StatusCode L1CaloDumpRampData::finalize()
+{
+  using CxxUtils::make_unique;
+  ATH_MSG_INFO("Finalizing " << name() << "...");
+
+  const L1CaloRampDataContainer* rampDataContainer = nullptr;
+  CHECK_RECOVERABLE(detStore()->retrieve(rampDataContainer, "/L1CaloRampMaker/L1CaloRampDataContainer"));
+
+  const CondAttrListCollection* energyScanResults = nullptr;
+  CHECK_RECOVERABLE(detStore()->retrieve(energyScanResults, "/TRIGGER/L1Calo/V1/Results/EnergyScanResults"));
+
+  std::ofstream xmlFile("rampdata.xml");
+  xmlFile << "<?xml version='1.0' encoding='utf-8'?>\n"
+          << "<TriggerTowerDecoratorData>\n" 
+          << "<default name='slope' />\n";
+
+  std::unique_ptr<TGraphErrors> graph_temp = make_unique<TGraphErrors>();
+  std::unique_ptr<TF1> func = make_unique<TF1>("func", "pol1", 0., 255.);
+  for(auto rampDataIt : *rampDataContainer) {
+    auto coolId = rampDataIt.first;
+    const L1CaloRampData& rampData = rampDataIt.second;
+    ATH_MSG_DEBUG("Processing RampData for 0x" << std::hex << coolId << std::dec);
+
+    // create a TGraphErrors of the energy steps
+    graph_temp->SetNameTitle(getName(coolId).c_str(), getTitle(coolId).c_str());
+    TGraphErrors* graph = static_cast<TGraphErrors*>(this->bookGetPointer(*graph_temp));
+
+    unsigned int nSteps = rampData.getNSteps();
+    graph->Set(nSteps);
+    for(unsigned int iStep = 0; iStep < nSteps; ++iStep) {
+      auto dataPoint = rampData.getStep(iStep);
+      if(!dataPoint) {
+        ATH_MSG_WARNING("Recieved nullptr for step " << iStep
+                        << " and coolId 0x" << std::hex << coolId << std::dec);
+        continue;
+      }
+
+      if(iStep) {
+        // avoid problems due to saturation effects
+        auto* prevStep = rampData.getStep(iStep - 1);
+        if(prevStep && prevStep->second.mean() > dataPoint->second.mean()) continue;
+      }
+
+      graph->SetPoint(iStep, dataPoint->second.mean(), dataPoint->first.mean());
+      graph->SetPointError(iStep, dataPoint->second.rms(), dataPoint->first.rms());
+    }
+
+    // overlay the fit function
+    auto attrListIt = energyScanResults->chanAttrListPair(coolId);
+    if(attrListIt != energyScanResults->end()) {
+      auto attrList = attrListIt->second;
+      double slope = attrList["Slope"].data<double>();
+      double offset = attrList["Offset"].data<double>();
+      double chi2 = attrList["Chi2"].data<double>();
+
+      func->SetParameters(offset, slope);
+      graph->GetListOfFunctions()->Add(func->Clone(("func" + getName(coolId)).c_str()));
+
+      writeChannel(xmlFile, coolId, slope, offset, chi2);
+    } else {
+      ATH_MSG_WARNING("No database entry for 0x" << std::hex
+                      << coolId << std::dec);
+    }
+  }
+
+  xmlFile << "</TriggerTowerDecoratorData>\n";
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode L1CaloDumpRampData::execute()
+{  
+  return StatusCode::SUCCESS;
+}
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.h b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.h
new file mode 100644
index 0000000000000000000000000000000000000000..de2f634c516bb3b81e41ac9eb4c5984139a485dd
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloDumpRampData.h
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGT1CALOCALIBUTILS_L1CALODUMPRAMPDATA_H
+#define TRIGT1CALOCALIBUTILS_L1CALODUMPRAMPDATA_H 1
+
+#include "AthenaBaseComps/AthHistogramAlgorithm.h"
+
+class L1CaloDumpRampData: public ::AthHistogramAlgorithm
+{ 
+ public: 
+  L1CaloDumpRampData(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~L1CaloDumpRampData(); 
+
+  virtual StatusCode initialize();
+  virtual StatusCode execute();
+  virtual StatusCode finalize();
+  
+ private: 
+
+}; 
+
+#endif //> !TRIGT1CALOCALIBUTILS_L1CALODUMPRAMPDATA_H
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloPprMonitoring.cxx b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloPprMonitoring.cxx
index 39df06e84127f89d6ee5edf336e87b34e655574c..921701ad98f5dfea4c6d203dd998896e354f9bdd 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloPprMonitoring.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloPprMonitoring.cxx
@@ -4,27 +4,36 @@
 
 #include "TrigT1CaloCalibUtils/L1CaloPprMonitoring.h"
 
-#include "CaloEvent/CaloCellContainer.h"
+#include "TH1.h"
 
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "GaudiKernel/ITHistSvc.h"
-#include "TH1.h"
+#include "EventInfo/EventInfo.h"
+#include "EventInfo/EventID.h"
+#include "CaloEvent/CaloCellContainer.h"
 
 #include "TrigT1CaloEvent/TriggerTowerCollection.h"
-#include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h"
 #include "TrigT1Interfaces/TrigT1CaloDefs.h"
-
-L1CaloPprMonitoring::L1CaloPprMonitoring(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator),
-    m_eventInfo(0),
-    m_dbPpmDeadChannels(0),
-    m_dbPpmDisabledTowers(0),
-    m_dbFineTimeRefsTowers(0),
-    m_triggerTowers(0),
-    m_histoSvc(0),
+#include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h"
+#include "TrigT1CaloCalibToolInterfaces/IL1CaloOfflineTriggerTowerTools.h"
+
+#include "TrigT1CaloCalibTools/L1CaloPprFineTimePlotManager.h"
+#include "TrigT1CaloCalibTools/L1CaloPprPedestalPlotManager.h"
+#include "TrigT1CaloCalibTools/L1CaloPprPedestalCorrectionPlotManager.h"
+#include "TrigT1CaloCalibTools/L1CaloPprEtCorrelationPlotManager.h"
+
+L1CaloPprMonitoring::L1CaloPprMonitoring(const std::string& name, ISvcLocator* pSvcLocator)
+  : AthAlgorithm(name,pSvcLocator),
+    m_eventInfo(nullptr),
+    m_dbPpmDeadChannels(nullptr),
+    m_dbPpmDisabledTowers(nullptr),
+    m_dbFineTimeRefsTowers(nullptr),
+    m_triggerTowers(nullptr),
+    m_histoSvc("THistSvc", name),
     m_fineTimePlotManager(0),
     m_pedestalPlotManager(0),
     m_pedestalCorrectionPlotManager(0),
     m_etCorrelationPlotManager(0),
-    m_storeGate("StoreGateSvc", name),
     m_offlineTowerTools("LVL1::L1CaloOfflineTriggerTowerTools/L1CaloOfflineTriggerTowerTools"),
     m_towerTools("LVL1::L1TriggerTowerTool/L1TriggerTowerTool"),
     m_dbPpmDeadChannelsFolder("/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"),
@@ -62,13 +71,11 @@ L1CaloPprMonitoring::~L1CaloPprMonitoring()
 
 StatusCode L1CaloPprMonitoring::initialize()
 {
-    StatusCode sc;
-    sc = this->loadInTools();
-    if(sc.isFailure()){return sc;}
+    CHECK(this->loadInTools());
 
     if (m_doFineTimePlots)
     {
-        m_fineTimePlotManager = new L1CaloPprFineTimePlotManager(m_histoSvc,
+        m_fineTimePlotManager = new L1CaloPprFineTimePlotManager(&(*m_histoSvc),
 								 m_offlineTowerTools,
 								 m_PpmAdcMinValue,
 								 m_lumiBlockMax,
@@ -79,7 +86,7 @@ StatusCode L1CaloPprMonitoring::initialize()
     }
     if (m_doPedestalPlots)
     {
-        m_pedestalPlotManager = new L1CaloPprPedestalPlotManager(m_histoSvc,
+        m_pedestalPlotManager = new L1CaloPprPedestalPlotManager(&(*m_histoSvc),
 								 m_offlineTowerTools,
 								 m_lumiBlockMax,
 								 "L1Calo/PPM");
@@ -87,50 +94,42 @@ StatusCode L1CaloPprMonitoring::initialize()
     }
     if (m_doPedestalCorrectionPlots)
     {
-        m_pedestalCorrectionPlotManager = new L1CaloPprPedestalCorrectionPlotManager(m_histoSvc,
+        m_pedestalCorrectionPlotManager = new L1CaloPprPedestalCorrectionPlotManager(&(*m_histoSvc),
 								 m_offlineTowerTools,
 								 m_lumiBlockMax,
 								 "L1Calo/PPM");
     }
     if (m_doEtCorrelationPlots){
-        m_etCorrelationPlotManager = new L1CaloPprEtCorrelationPlotManager(m_histoSvc,
+        m_etCorrelationPlotManager = new L1CaloPprEtCorrelationPlotManager(&(*m_histoSvc),
 									   m_offlineTowerTools,
 									   m_lumiBlockMax,
 									   "L1Calo/PPM");
 	m_etCorrelationPlotManager->SetCaloCellContainer(m_caloCellContainerName);
 	m_etCorrelationPlotManager->SetEtMin(m_EtMinForEtCorrelation);
     }
-    return sc;
+    return StatusCode::SUCCESS;
 }
 
 StatusCode L1CaloPprMonitoring::execute()
 {
-
-    StatusCode sc;
-
-    sc = this->loadContainers();
-    if(sc.isFailure()){return sc;}
-    
-    xAOD::TriggerTowerContainer::const_iterator TT_itr;
-
-    for(TT_itr = m_triggerTowers->begin(); TT_itr != m_triggerTowers->end(); ++TT_itr)
-    {       
+    CHECK(this->loadContainers());
+    for(const auto* tt: *m_triggerTowers) {
         //Dead Channel DB folder used for 2010 data
         //Disabled tower DB folder used for 2011/12 data
         
 // 	const coral::AttributeList* DbDead = 0;
 
 	bool ChanIsDisabled(false);
-	unsigned int CoolChannelID = (*TT_itr)->coolId();
+	unsigned int CoolChannelID = tt->coolId();
 //         if(m_eventInfo->event_ID()->run_number() < 175000)
 //         {
-// 	    DbDead      = m_xAODtowerTools->DbAttributes(*TT_itr,m_dbPpmDeadChannels);
+// 	    DbDead      = m_xAODtowerTools->DbAttributes(tt, m_dbPpmDeadChannels);
 // 
 //             if(DbDead!=0){ChanIsDisabled = true;}
 //         }
 //         else //2011/12 data 
 //         {
-// 	    DbDead      = m_xAODtowerTools->DbAttributes(*TT_itr,m_dbPpmDisabledTowers);
+// 	    DbDead      = m_xAODtowerTools->DbAttributes(tt, m_dbPpmDisabledTowers);
 //             
 // 	    if(m_towerTools->DisabledTower(DbDead)){ChanIsDisabled= true; }
 //         }
@@ -142,7 +141,7 @@ StatusCode L1CaloPprMonitoring::execute()
 	    double Reference = 0;
 	    double CalFactor = 0;
 	  
-	    unsigned int CoolId = (*TT_itr)->coolId();
+	    unsigned int CoolId = tt->coolId();
 
 	    CondAttrListCollection::const_iterator Itr = m_dbFineTimeRefsTowers->chanAttrListPair(CoolId);
 	    if (Itr != m_dbFineTimeRefsTowers->end()) {
@@ -154,28 +153,26 @@ StatusCode L1CaloPprMonitoring::execute()
 	    m_fineTimePlotManager->SetReferenceValue(Reference);
 	    m_fineTimePlotManager->SetCalibrationFactor(CalFactor);
 	        
-	    m_fineTimePlotManager->Analyze(m_eventInfo,*TT_itr, ChanIsDisabled);
+	    m_fineTimePlotManager->Analyze(m_eventInfo, tt, ChanIsDisabled);
 	}
 	if (m_doPedestalPlots)
 	{
-	    m_pedestalPlotManager->Analyze(m_eventInfo,*TT_itr, ChanIsDisabled);
+	    m_pedestalPlotManager->Analyze(m_eventInfo, tt, ChanIsDisabled);
 	}
 	if (m_doPedestalCorrectionPlots)
 	{
-	    m_pedestalCorrectionPlotManager->Analyze(m_eventInfo,*TT_itr, ChanIsDisabled);	    
+	    m_pedestalCorrectionPlotManager->Analyze(m_eventInfo, tt, ChanIsDisabled);	    
 	}
 	if (m_doEtCorrelationPlots)
 	{
-	    m_etCorrelationPlotManager->Analyze(m_eventInfo,*TT_itr, ChanIsDisabled);
+	    m_etCorrelationPlotManager->Analyze(m_eventInfo, tt, ChanIsDisabled);
 	}
     }
-    
-    return sc;
+    return StatusCode::SUCCESS;
 }
 
 StatusCode L1CaloPprMonitoring::finalize()
 {
-
     if (m_doFineTimePlots)
     {
         m_fineTimePlotManager->MakeSummary();
@@ -201,49 +198,31 @@ StatusCode L1CaloPprMonitoring::finalize()
 
 StatusCode L1CaloPprMonitoring::loadContainers()
 {
-    StatusCode sc;
-
-    sc = m_storeGate->retrieve(m_eventInfo);
-    if(sc.isFailure()){msg(MSG::INFO)<<"Failed to load Event Info"<<endreq; return sc;}
-
-    sc = m_storeGate->retrieve(m_dbPpmDeadChannels, m_dbPpmDeadChannelsFolder);
-    if(sc.isFailure()){msg(MSG::INFO)<<"Failed to load DB PPm Dead channels"<<endreq; return sc;}
-
-    sc = m_storeGate->retrieve(m_dbPpmDisabledTowers,m_dbPpmDisabledTowersFolder);
-    if(sc.isFailure()){msg(MSG::INFO)<<"Failed to load DB PPm Disabled Towers"<<endreq; return sc;}
-
-    sc = m_storeGate->retrieve(m_triggerTowers,m_triggerTowersLocation);
-    if(sc.isFailure()){msg(MSG::INFO)<<"Failed to load Trigger Towers Location"<<endreq; return sc;}
+    CHECK(evtStore()->retrieve(m_eventInfo));
+    CHECK(detStore()->retrieve(m_dbPpmDeadChannels, m_dbPpmDeadChannelsFolder));
+    CHECK(detStore()->retrieve(m_dbPpmDisabledTowers,m_dbPpmDisabledTowersFolder));
+    CHECK(evtStore()->retrieve(m_triggerTowers,m_triggerTowersLocation));
     
     if (m_doEtCorrelationPlots) {
-        StatusCode sc2 = m_etCorrelationPlotManager->getCaloCells();
+      CHECK(m_etCorrelationPlotManager->getCaloCells());
     }
     
     if (m_doFineTimePlots){
       //load the standalone sqlite db containing the fine time references and calibration values
-      sc = m_storeGate->retrieve(m_dbFineTimeRefsTowers, m_dbFineTimeRefsFolder);
-      if (sc.isFailure()) {msg(MSG::WARNING) << "Failed to load FineTimeReference Folder"<< endreq; return sc;}
+      CHECK(detStore()->retrieve(m_dbFineTimeRefsTowers, m_dbFineTimeRefsFolder));
+
       //if you want to use the calo quality cut also load the calo cell container
       if(m_doCaloQualCut){
-	StatusCode sc2 = m_fineTimePlotManager->getCaloCells();
-	if (sc2.isFailure()) {msg(MSG::WARNING) << "Failed to load Calo Cells"<< endreq; return sc2;}
+	CHECK(m_fineTimePlotManager->getCaloCells());
       }
     } 
-    return sc;
+    return StatusCode::SUCCESS;
 }
 
 StatusCode L1CaloPprMonitoring::loadInTools()
 {
-    StatusCode sc;
-    
-    sc = service("THistSvc",m_histoSvc);
-    if(sc.isFailure()){msg(MSG::INFO)<<"Failed to load the histogram service"<<endreq; return sc;}
-
-    sc = m_offlineTowerTools.retrieve();
-    if(sc.isFailure()){msg(MSG::ERROR)<<"Could not retrieve OfflineTriggerTowerTools"<<endreq;return sc;}
-    
-    sc = m_towerTools.retrieve();
-    if(sc.isFailure()){msg(MSG::ERROR)<<"Could not retrieve TriggerTowerTools"<<endreq;return sc;}
-       
-    return sc;
+    CHECK(m_histoSvc.retrieve());
+    CHECK(m_offlineTowerTools.retrieve());
+    CHECK(m_towerTools.retrieve());
+    return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloRampMaker.cxx b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloRampMaker.cxx
index f76027dbeddc359083d8982fc7498eb6ae001300..34ad24543472d630f78b45b9c9286354c61db93c 100755
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloRampMaker.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/L1CaloRampMaker.cxx
@@ -2,41 +2,48 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
+#include "TrigT1CaloCalibUtils/L1CaloRampMaker.h"
+
 #include <fstream>
+#include <utility> // make_pair
 
 #include "AthenaKernel/errorcheck.h"
 
-#include "TrigT1CaloCalibUtils/L1CaloRampMaker.h"
-// #include "TrigT1CaloCalibTools/L1CaloCells2TriggerTowers.h"
-
-#include "GaudiKernel/Bootstrap.h"
-#include "GaudiKernel/IToolSvc.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
+#include "xAODEventInfo/EventInfo.h"
 
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 
 #include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
-#include "CaloEvent/CaloCellContainer.h"
+#include "CaloEvent/CaloCell.h"
+
+#include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h"
+#include "TrigT1CaloCalibToolInterfaces/IL1CaloOfflineTriggerTowerTools.h"
+#include "TrigT1CaloCalibToolInterfaces/IL1CaloxAODOfflineTriggerTowerTools.h"
 
+#include "TrigT1CaloCalibConditions/L1CaloPprConditionsRun2.h"
 #include "TrigT1CaloCalibConditions/L1CaloRampData.h"
 #include "TrigT1CaloCalibConditions/L1CaloRampDataContainer.h"
 #include "TrigT1CaloCondSvc/L1CaloCondSvc.h"
-// #include "TrigT1CaloCalibToolInterfaces/IL1CaloOfflineTriggerTowerTools.h"
-// #include "TrigT1CaloCalibToolInterfaces/IL1CaloLArTowerEnergy.h"
 
-#include "TrigT1CaloCalibToolInterfaces/IL1CaloOfflineTriggerTowerTools.h"
-#include "TrigT1CaloCalibToolInterfaces/IL1CaloLArTowerEnergy.h"
-#include "TrigT1CaloCalibToolInterfaces/IL1CaloCells2TriggerTowers.h"
+#include "TrigT1Interfaces/TrigT1CaloDefs.h"
+
+// temporary includes to work around limitations in L1CaloxAODOfflineTriggerTowerTools
+#include "TrigT1CaloUtils/TriggerTowerKey.h"
+#include "TrigT1CaloEvent/TriggerTower.h"
+
+#include "xAODTrigL1Calo/TriggerTower.h"
+
+// define Accessors
+namespace {
+xAOD::TriggerTower::ConstAccessor<float> ttCellsEnergy("CaloCellEnergy");
+xAOD::TriggerTower::ConstAccessor<float> ttCellsET("CaloCellET");
+}
 
 L1CaloRampMaker::L1CaloRampMaker(const std::string& name, ISvcLocator* pSvcLocator)
   : AthAlgorithm(name, pSvcLocator),
-    m_triggerTowerCollectionName("TriggerTowers"),
-    m_caloCellContainerName("AllCalo"),
-    m_l1CaloCells2TriggerTowersToolName("L1CaloCells2TriggerTowers"),
+    m_triggerTowerContainerName(LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation),
     m_outputFolderName("/L1CaloRampMaker/L1CaloRampDataContainer"),
     m_gainStrategyFolder("/TRIGGER/Receivers/Conditions/Strategy"),
     m_doLAr(false),
@@ -51,24 +58,18 @@ L1CaloRampMaker::L1CaloRampMaker(const std::string& name, ISvcLocator* pSvcLocat
     m_nSteps(9),
     m_fadcSaturationCut(963),
     m_tileSaturationCut(150.),
-    m_ttTool("LVL1::L1TriggerTowerTool/LVL1::L1TriggerTowerTool"),
-    m_beamInfo("TileBeamInfoProvider/TileBeamInfoProvider"),
+    m_ttTool("LVL1::L1TriggerTowerTool/L1TriggerTowerTool"),
+    m_xAODTTTools("LVL1::L1CaloxAODOfflineTriggerTowerTools/L1CaloxAODOfflineTriggerTowerTools"),
+    m_jmTools("LVL1::L1CaloOfflineTriggerTowerTools/L1CaloOfflineTriggerTowerTools"),
+    m_condSvc("L1CaloCondSvc", name),
     m_nEvent(1),
     m_firstEvent(true),
-    m_storeGate(0),
-    m_detStore(0),
-    m_condSvc(0),
-    m_lvl1Helper(0),
-    m_cells2tt("LVL1::L1CaloCells2TriggerTowers/L1CaloCells2TriggerTowers"),
-    m_jmTools("LVL1::L1CaloOfflineTriggerTowerTools/L1CaloOfflineTriggerTowerTools"),
-    m_rampDataContainer(0),
-    m_pprLutContainer(0),
-    m_pprDisabledChannelContainer(0),
-    m_larEnergy("LVL1::L1CaloLArTowerEnergy/L1CaloLArTowerEnergy")
+    m_lvl1Helper(nullptr),
+    m_rampDataContainer(nullptr),
+    m_pprLutContainer(nullptr),
+    m_pprDisabledChannelContainer(nullptr)
 {
-    declareProperty("TriggerTowerCollectionName", m_triggerTowerCollectionName);
-    declareProperty("CaloCellContainerName", m_caloCellContainerName);
-    declareProperty("L1CaloCells2TriggerTowersToolName", m_l1CaloCells2TriggerTowersToolName);
+    declareProperty("TriggerTowerCollectionName", m_triggerTowerContainerName);
     declareProperty("OutputFolderName", m_outputFolderName);
     declareProperty("GainStrategyFolder", m_gainStrategyFolder);
     declareProperty("DoLAr", m_doLAr);
@@ -84,186 +85,88 @@ L1CaloRampMaker::L1CaloRampMaker(const std::string& name, ISvcLocator* pSvcLocat
     declareProperty("FADCSaturationCut", m_fadcSaturationCut);
     declareProperty("TileSaturationCut", m_tileSaturationCut);
     declareProperty("L1TriggerTowerTool", m_ttTool);
-    declareProperty("TileBeamInfoProvider", m_beamInfo);
     declareProperty("SpecialChannelRange", m_specialChannelRange);
 }
 
-L1CaloRampMaker::~L1CaloRampMaker() 
+L1CaloRampMaker::~L1CaloRampMaker()
 {
 }
 
 StatusCode L1CaloRampMaker::initialize()
 {
-    StatusCode sc;
-    
-    sc = service("StoreGateSvc", m_storeGate);
-    if(sc.isFailure()) {
-        ATH_MSG_FATAL( "Cannot access StoreGateSvc!" );
-        return sc;
-    }
+    CHECK(m_condSvc.retrieve());
 
-    sc = service("DetectorStore", m_detStore);
-    if(sc.isFailure()) {
-        ATH_MSG_FATAL( "Cannot access DetectorStore!" );
-        return sc;
-    }
-    
-    sc = service("L1CaloCondSvc", m_condSvc);
-    if(sc.isFailure()) {
-        ATH_MSG_FATAL( "Cannot access L1CaloCondSvc!" );
-        return sc;
-    }
-
-    const CaloIdManager *caloMgr;
-    sc = m_detStore->retrieve(caloMgr);
-    if(sc.isFailure()) {
-	ATH_MSG_FATAL( "Cannot retrieve CaloIdManager from DetectorStore." );
-	return sc;
-    }
+    const CaloIdManager *caloMgr = nullptr;
+    CHECK(detStore()->retrieve(caloMgr));
     m_lvl1Helper = caloMgr->getLVL1_ID();
     if(!m_lvl1Helper) {
-	ATH_MSG_FATAL( "Cannot access CaloLVL1_ID helper." );
-	return StatusCode::FAILURE;
-    }
-
-    sc = m_cells2tt.retrieve();
-    if(sc.isFailure()){
-      ATH_MSG_FATAL( "Cannot retrieve L1CaloCells2TriggerTowers" );
-     return sc;
-    }
-
-    sc = m_larEnergy.retrieve();
-    if(sc.isFailure()){
-      ATH_MSG_FATAL( "Cannot retrieve L1CaloLArTowerEnergy" );
-     return sc;
+        ATH_MSG_FATAL( "Cannot access CaloLVL1_ID helper." );
+        return StatusCode::FAILURE;
     }
 
-    sc = m_jmTools.retrieve();
-    if(sc.isFailure()){
-      ATH_MSG_FATAL( "Cannot retrieve L1CaloOfflineTriggerTowerTools" );
-     return sc;
-    }    
-    
-//     IToolSvc *toolSvc;
-//     IAlgTool* algTool;
-//     sc = service("ToolSvc", toolSvc);
-//     if(sc.isFailure()) {
-// 	ATH_MSG_FATAL( "Cannot retrieve ToolSvc." );
-// 	return sc;
-//     }
-
-//     sc = toolSvc->retrieveTool("L1CaloCells2TriggerTowers", algTool);
-//     m_cells2tt = dynamic_cast<L1CaloCells2TriggerTowers*>(algTool);
-//     if(sc.isFailure() || !m_cells2tt) {
-// 	ATH_MSG_FATAL( "Cannot retrieve L1CaloCells2TriggerTowers from ToolSvc." );
-// 	return sc;
-//     }
-
-//     sc = toolSvc->retrieveTool("L1CaloLArTowerEnergy", algTool);
-//     m_larEnergy = dynamic_cast<L1CaloLArTowerEnergy*>(algTool);
-//     if(sc.isFailure() || !m_larEnergy) {
-//         ATH_MSG_FATAL( "Cannot retrieve L1CaloLArTowerEnergy from ToolSvc." );
-//         return StatusCode::FAILURE;
-//     }
-
-//     sc = toolSvc->retrieveTool("TriggerTowerTools",algTool);
-//     m_jmTools = dynamic_cast<TriggerTowerTools*>(algTool);
-//     if(sc.isFailure() || !m_jmTools) {
-//         ATH_MSG_FATAL( "Could not retrieve TriggerTowerTools" );
-// 	return sc;
-//     }
+    CHECK(m_ttTool.retrieve());
+    CHECK(m_xAODTTTools.retrieve());
+    CHECK(m_jmTools.retrieve());
 
     // setup access to Calib1 folder of L1CALO database
-    m_pprLutContainerFolderMap.insert(
-	 std::pair<L1CaloPprLutContainer::eCoolFolders, std::string>(L1CaloPprLutContainer::ePprLutChanCalib,
-								     "/TRIGGER/L1Calo/V1/Calibration/Calib1/PprChanCalib"));
-    m_pprDisabledChannelContainerFolderMap.insert(std::pair<L1CaloPprDisabledChannelContainer::eCoolFolders, std::string>(L1CaloPprDisabledChannelContainer::ePpmDeadChannels, "/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"));
-    m_pprDisabledChannelContainerFolderMap.insert(std::pair<L1CaloPprDisabledChannelContainer::eCoolFolders, std::string>(L1CaloPprDisabledChannelContainer::ePprChanCalib, "/TRIGGER/L1Calo/V1/Calibration/Calib1/PprChanCalib"));
-    m_pprDisabledChannelContainerFolderMap.insert(std::pair<L1CaloPprDisabledChannelContainer::eCoolFolders, std::string>(L1CaloPprDisabledChannelContainer::eDisabledTowers, "/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"));
+    m_pprLutContainerFolderMap.insert(std::make_pair(L1CaloPprConditionsContainerRun2::ePprChanCalib, "/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib"));
+    m_pprLutContainerFolderMap.insert(std::make_pair(L1CaloPprConditionsContainerRun2::ePprChanDefaults, "/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"));
+    // m_pprDisabledChannelContainerFolderMap.insert(std::make_pair(L1CaloPprDisabledChannelContainer::ePpmDeadChannels,
+    //                                                              "/TRIGGER/L1Calo/V1/Calibration/PpmDeadChannels"));
+    // m_pprDisabledChannelContainerFolderMap.insert(std::make_pair(L1CaloPprDisabledChannelContainer::ePprChanCalib,
+    //                                                              "/TRIGGER/L1Calo/V1/Calibration/Calib1/PprChanCalib"));
+    // m_pprDisabledChannelContainerFolderMap.insert(std::make_pair(L1CaloPprDisabledChannelContainer::eDisabledTowers,
+    //                                                              "/TRIGGER/L1Calo/V1/Conditions/DisabledTowers"));
 
     return StatusCode::SUCCESS;
 }
 
 StatusCode L1CaloRampMaker::execute()
 {
-
     // Skip spurious events
-
     unsigned int wantedEvents = m_nEventsPerStep*m_nSteps;
     if (m_nEvent > wantedEvents) {
         if (m_nEvent == wantedEvents+1) {
-	    ATH_MSG_INFO( "Processed " << wantedEvents
-	          << " events, skipping the rest" );
+            ATH_MSG_INFO( "Processed " << wantedEvents
+                  << " events, skipping the rest" );
         }
-	++m_nEvent;
+        ++m_nEvent;
         return StatusCode::SUCCESS;
     }
-    unsigned int evtNumber = 0;
-    const EventInfo* evInfo = 0; 
-    const EventID* evID = 0;
-    StatusCode sc = m_storeGate->retrieve(evInfo);
-    if (sc.isFailure()) {
-        ATH_MSG_WARNING( "No EventInfo found" );
-    } else {
-        evID = evInfo->event_ID();
-        if (evID) evtNumber = evID->event_number();
-    }
-    if (evtNumber == 0 && m_nEvent > 1) { // Only allow event 0 as first event
+
+    const xAOD::EventInfo* eventInfo = nullptr;
+    CHECK(evtStore()->retrieve(eventInfo));
+    if (eventInfo->eventNumber() == 0 && m_nEvent > 1) {
+      // Only allow event 0 as first event
         ATH_MSG_WARNING( "Skipping spurious event number 0" );
 	return StatusCode::SUCCESS;
     }
 
-
-    const TriggerTowerCollection *triggerTowerCollection(0);
-    sc = m_storeGate->retrieve(triggerTowerCollection, m_triggerTowerCollectionName);
+    const xAOD::TriggerTowerContainer *tts = nullptr;
+    auto sc = evtStore()->retrieve(tts, m_triggerTowerContainerName);
     if(!sc.isSuccess()) {
         ATH_MSG_ERROR( "Cannot retrieve TriggerTowerCollection '"
-              << m_triggerTowerCollectionName << "' from StoreGate." );
+                       << m_triggerTowerContainerName << "' from StoreGate." );
         return StatusCode::RECOVERABLE;
     }
 
-    const CaloCellContainer *caloCellContainer(0);
-    sc = m_storeGate->retrieve(caloCellContainer, m_caloCellContainerName);
-    if(!sc.isSuccess()) {
-	ATH_MSG_ERROR( "Cannot retrieve CaloCellContainer '" << m_caloCellContainerName
-	    << "'." );
-	return StatusCode::RECOVERABLE;
-    }
-
-    // init trigger tower to cell mapping - needed each event?
-    // not needed - done by m_larEnergy-->init...
-    if(!m_cells2tt->initCaloCellsTriggerTowers(*caloCellContainer)) {
-        ATH_MSG_ERROR( "Can not initialize L1CaloCells2TriggerTowers with CaloCellContainer '"
-              << m_caloCellContainerName << "." );
-        return StatusCode::RECOVERABLE;
-    }
+    // init trigger tower to cell mapping
+    CHECK(m_xAODTTTools->initCaloCells());
 
+    // CHECK(m_condSvc->retrieve(m_pprLutContainer, m_pprLutContainerFolderMap));
+    // CHECK(m_condSvc->retrieve(m_pprDisabledChannelContainer, m_pprDisabledChannelContainerFolderMap));
+    
     // access L1CaloPPrLutContinaer
     // since no key is given, we will override the default lookup
     // to the folder specified in initialize (i.e. the .../Calib1/PprChanCalib version)
-    CHECK( m_condSvc->retrieve(m_pprLutContainer,
-			       m_pprLutContainerFolderMap) );
-    CHECK (m_condSvc->retrieve(m_pprDisabledChannelContainer,
-			       m_pprDisabledChannelContainerFolderMap) );
-
-    // init larTowerEnergy tool
-    /*
-    if(!m_larEnergy->initL1CaloLArTowerEnergy(*caloCellContainer, *triggerTowerCollection)) {
-        ATH_MSG_ERROR( "Can not initialize L1CaloLArTowerEnergy with CaloCellContainer '"
-              << m_caloCellContainerName
-              << " and TriggerTowerCollection "
-              << m_triggerTowerCollectionName
-              << "." );
-        return StatusCode::RECOVERABLE;
-    }
-    */
+    CHECK(m_condSvc->retrieve(m_pprLutContainer, m_pprLutContainerFolderMap));
+    CHECK(m_ttTool->retrieveConditions());
 
     if(m_firstEvent) {
-      unsigned int runNumber = 0;
-      if (evID) runNumber = evID->run_number();
+      unsigned int runNumber = eventInfo->runNumber();
       std::string gainStrategy("");
       const CondAttrListCollection* gainStrategyColl = 0;
-      sc = m_detStore->retrieve(gainStrategyColl, m_gainStrategyFolder);
+      sc = detStore()->retrieve(gainStrategyColl, m_gainStrategyFolder);
       if(sc.isSuccess()) {
         CondAttrListCollection::const_iterator itr  = gainStrategyColl->begin();
 	CondAttrListCollection::const_iterator itrE = gainStrategyColl->end();
@@ -294,18 +197,15 @@ StatusCode L1CaloRampMaker::execute()
         if (runNumber == 223074) newStrategy = "GainOne";
         if (runNumber == 223075) newStrategy = "GainOne";
         if (newStrategy != "") {
-          ATH_MSG_INFO( "Changing Gain Strategy to " << newStrategy
-                             );
+          ATH_MSG_INFO( "Changing Gain Strategy to " << newStrategy);
           gainStrategy = newStrategy;
         }
 	if (gainStrategy != "" && consistent) {
 	  m_isGain1 = (gainStrategy.find("GainOne") != std::string::npos);
 	  m_isOvEmb = (gainStrategy.find("OvEmb") != std::string::npos);
 	  m_isOvEmec = (gainStrategy.find("OvEmec") != std::string::npos);
-	  m_isFcalLowEta = (gainStrategy.find("FcalLowEta") != 
-	                                                    std::string::npos);
-	  m_isFcalHighEta = (gainStrategy.find("FcalHighEta") !=
-	                                                    std::string::npos);
+	  m_isFcalLowEta = (gainStrategy.find("FcalLowEta") != std::string::npos);
+	  m_isFcalHighEta = (gainStrategy.find("FcalHighEta") != std::string::npos);
 	} else if (gainStrategy == "") {
 	  ATH_MSG_WARNING( "Gain Strategy collection empty" );
 	} else {
@@ -315,94 +215,50 @@ StatusCode L1CaloRampMaker::execute()
         ATH_MSG_WARNING( "No Gain Strategy collection found" );
       }
       ATH_MSG_INFO( "isGain1 = "         << m_isGain1
-                         << ", isOvEmb = "       << m_isOvEmb
-                         << ", isOvEmec = "      << m_isOvEmec
-                         << ", isFcalLowEta = "  << m_isFcalLowEta
-                         << ", isFcalHighEta = " << m_isFcalHighEta );
+                    << ", isOvEmb = "       << m_isOvEmb
+                    << ", isOvEmec = "      << m_isOvEmec
+                    << ", isFcalLowEta = "  << m_isFcalLowEta
+                    << ", isFcalHighEta = " << m_isFcalHighEta );
 
-      //unsigned int runNumber = 0;
-      //if (evID) runNumber = evID->run_number();
-
-      setupRampDataContainer(triggerTowerCollection);
+      setupRampDataContainer(tts);
       m_rampDataContainer->setRunNumber(runNumber);
       m_rampDataContainer->setGainStrategy(gainStrategy);
       m_firstEvent = false;
     }
 
-    LVL1::TriggerTower *tt;
-    TriggerTowerCollection::const_iterator p_itTT = triggerTowerCollection->begin();
-    TriggerTowerCollection::const_iterator p_itTTEnd = triggerTowerCollection->end();
-    Identifier id;
-    unsigned int coolId;
-    std::vector<int>::const_iterator max;
-    std::map<int, int>::iterator m_specialChannelIt,
-      m_specialChannelRangeEnd(m_specialChannelRange.end());
-    double caloEnergy, level1Energy;
+    auto m_specialChannelRangeEnd = m_specialChannelRange.end();
     bool nextStep = (m_nEvent % m_nEventsPerStep == 0);
-    bool isSaturated(false);
-
-    for(;p_itTT != p_itTTEnd; ++p_itTT) {
-        tt = *p_itTT;
-
-        // electromagnetic sampling
-	isSaturated = tt->isEMSaturated();
-	if(!isSaturated) {
-	    // isSaturated flag is not enough to check - test FADC for saturation, too
-	    max = std::max_element(tt->emADC().begin(), tt->emADC().end());
-	    if(*max >= m_fadcSaturationCut) isSaturated = true; // take ~ 2 times pedestal safety margin
-	}
-        if(m_doLAr && !isSaturated) {
-            id = m_ttTool->identifier(tt->eta(), tt->phi(), 0);
-            coolId = m_ttTool->channelID(id).id();
-
-            if(!m_ttTool->disabledChannel(coolId)) {
-		if(m_checkProvenance) checkProvenance(id, coolId);
-                level1Energy = getTriggerTowerEnergy(tt->emADC(), id, coolId, tt->eta());
-		caloEnergy = getCaloEnergy(id, tt);
-
-		// see if we have a special channel and cut on level1 energy
-		m_specialChannelIt = m_specialChannelRange.find(coolId);
-		if(m_specialChannelIt == m_specialChannelRangeEnd || level1Energy < m_specialChannelIt->second) {
-		    m_rampDataContainer->rampData(coolId)->addData(caloEnergy, level1Energy);
-		} else {
-		    // make sure we don't accidently miss the threshold again
-		    m_specialChannelIt->second = -1000;
-		}
-		if(nextStep) m_rampDataContainer->rampData(coolId)->nextStep();
+    for(auto *tt : *tts) {
+        // skip saturated towers
+        if(tt->isJepSaturated()) continue;
+
+        // isSaturated flag is not enough to check - test FADC for saturation, too
+        auto max = std::max_element(tt->adc().begin(), tt->adc().end());
+        if(*max >= m_fadcSaturationCut) continue;
+
+        // skip disabled channels
+        if(m_ttTool->disabledChannel(tt->coolId())) continue;
+
+        bool isTile = m_xAODTTTools->isTile(*tt);
+
+        if((m_doLAr && !isTile) || (m_doTile && isTile)) {
+            if(m_checkProvenance) checkProvenance(tt);
+            double level1Energy = getTriggerTowerEnergy(tt);
+            double caloEnergy = getCaloEnergy(tt);
+
+            // cut on 150 GeV ADC for Tile, lots of saturating calibration signals
+            if(isTile && level1Energy > m_tileSaturationCut) continue;
+
+            // see if we have a special channel and cut on level1 energy
+            auto m_specialChannelIt = m_specialChannelRange.find(tt->coolId());
+            if(m_specialChannelIt == m_specialChannelRangeEnd || level1Energy < m_specialChannelIt->second) {
+              ATH_MSG_DEBUG("Adding Energy for " << tt->coolId() << ":" << caloEnergy << " vs. " << level1Energy);
+              m_rampDataContainer->rampData(tt->coolId())->addData(caloEnergy, level1Energy);
+            } else {
+                // make sure we don't accidently miss the threshold again
+                m_specialChannelIt->second = -1000;
             }
-        }
-
-        // hadronic sampling
-	if(tt->isHadSaturated()) {
-	    continue;
-	} else {
-	    // isSaturated flag is not enough to check - test FADC for saturation, too
-	    max = std::max_element(tt->hadADC().begin(), tt->hadADC().end());
-	    if(*max >= m_fadcSaturationCut) continue; // take ~ 2 times pedestal safety margin
-	}
- 
-        id = m_ttTool->identifier(tt->eta(), tt->phi(), 1);
-        coolId = m_ttTool->channelID(id).id();
-
-	if(m_ttTool->disabledChannel(coolId)) continue;
-
-	if(m_checkProvenance) checkProvenance(id, coolId);
-        if((m_doTile && m_lvl1Helper->is_tile(id)) || (m_doLAr && !m_lvl1Helper->is_tile(id))) {
-	   caloEnergy = getCaloEnergy(id, tt);
-           level1Energy = getTriggerTowerEnergy(tt->hadADC(), id, coolId, tt->eta());
-
-	   // cut on 150 GeV ADC for Tile, lots of saturating calibration signals
-	   if(m_lvl1Helper->is_tile(id) && level1Energy > m_tileSaturationCut) continue;
-	   
-	   // see if we have a special channel and cut on level1 energy
-	   m_specialChannelIt = m_specialChannelRange.find(coolId);
-	   if(m_specialChannelIt == m_specialChannelRangeEnd || level1Energy < m_specialChannelIt->second) {
-	       m_rampDataContainer->rampData(coolId)->addData(caloEnergy, level1Energy);
-	   } else {
-	       // make sure we don't accidently miss the threshold again
-	       m_specialChannelIt->second = -1000;
-	   }
-           if(nextStep) m_rampDataContainer->rampData(coolId)->nextStep();
+            if(nextStep) m_rampDataContainer->rampData(tt->coolId())->nextStep();
         }
     }
 
@@ -411,72 +267,51 @@ StatusCode L1CaloRampMaker::execute()
     return StatusCode::SUCCESS;
 }
 
-void L1CaloRampMaker::setupRampDataContainer(const TriggerTowerCollection* triggerTowerCollection)
+void L1CaloRampMaker::setupRampDataContainer(const xAOD::TriggerTowerContainer* tts)
 {
-    m_rampDataContainer = new L1CaloRampDataContainer();
-    
-    TriggerTowerCollection::const_iterator p_itTT = triggerTowerCollection->begin();
-    TriggerTowerCollection::const_iterator p_itTTEnd = triggerTowerCollection->end();
+    m_rampDataContainer.reset(new L1CaloRampDataContainer());
+
     L1CaloRampData rd;
-    unsigned int coolId;
-    for(;p_itTT != p_itTTEnd; ++p_itTT) {
-        if(m_doLAr) {
-            // layer 0 is always LAr
-            coolId = m_ttTool->channelID((*p_itTT)->eta(), (*p_itTT)->phi(), 0).id();
-            m_rampDataContainer->addRampData(coolId, rd);
-
-            if(!m_lvl1Helper->is_tile(m_ttTool->identifier((*p_itTT)->eta(), (*p_itTT)->phi(), 1))) {
-                coolId = m_ttTool->channelID((*p_itTT)->eta(), (*p_itTT)->phi(), 1).id();
-                m_rampDataContainer->addRampData(coolId, rd);
-            }
-        }
-        
-        if(m_doTile && m_lvl1Helper->is_tile(m_ttTool->identifier((*p_itTT)->eta(), (*p_itTT)->phi(), 1))) {
-            // layer 1 in barrel region is tile
-            coolId = m_ttTool->channelID((*p_itTT)->eta(), (*p_itTT)->phi(), 1).id();
-            m_rampDataContainer->addRampData(coolId, rd);
-        }
-    }            
+    for(auto* tt: *tts) {
+      bool isTile = m_xAODTTTools->isTile(*tt);
+      if((m_doLAr && !isTile) || (m_doTile && isTile)) {
+        m_rampDataContainer->addRampData(tt->coolId(), rd);
+      }
+    }
 }
 
-// return E_T of cells comprising the trigger tower with @c id
-double L1CaloRampMaker::getCaloEnergy(const Identifier& id, const LVL1::TriggerTower* tt)
+// return E_T of cells comprising the trigger tower @c tt
+double L1CaloRampMaker::getCaloEnergy(const xAOD::TriggerTower* tt)
 {
     double et(0.);
-    double eta = tt->eta();
-    if (m_lvl1Helper->is_fcal(id)) {
-	if (m_lvl1Helper->sampling(id) == 0) { // em
-            et = m_jmTools->emTTCellsEt(tt);
+    auto id = m_ttTool->identifier(tt->eta(), tt->phi(), tt->sampling());
+
+    if(m_lvl1Helper->is_fcal(id)) {
+	if(tt->sampling() == 0) { // fcal em - use decorated value
+            et = ttCellsET(*tt);
 	} else {          // had
-	    std::vector<float> etRec = m_jmTools->hadTTCellsEtByReceiver(tt);
+            LVL1::TriggerTowerKey K(tt->phi(), tt->eta());
+            LVL1::TriggerTower T(tt->phi(), tt->eta(), K.ttKey(tt->phi(), tt->eta()));
+	    std::vector<float> etRec = m_jmTools->hadTTCellsEtByReceiver(&T);
 	    if (etRec.size() == 2) {
 	        if      (m_isFcalLowEta)  et = etRec[0];
 		else if (m_isFcalHighEta) et = etRec[1];
 	        else                      et = etRec[0] + etRec[1];
             } else if (etRec.size() == 1) et = etRec[0];
-	    //double etall = m_jmTools->hadTTCellsEt(tt);
-	    //std::cout << "Fcal eta/phi: " << eta << "/" << tt->phi() << " receivers = " << etRec.size()
-	    //          << " et = " << et <<  " etall = " << etall << std::endl;
         }
     } else {
-	if (m_lvl1Helper->is_barrel_end(id) && (m_isOvEmb || m_isOvEmec)) {
-	    std::vector<float> energyRec = m_jmTools->emTTCellsEnergyByReceiver(tt);
+	if(m_lvl1Helper->is_barrel_end(id) && (m_isOvEmb || m_isOvEmec)) {
+            LVL1::TriggerTowerKey K(tt->phi(), tt->eta());
+            LVL1::TriggerTower T(tt->phi(), tt->eta(), K.ttKey(tt->phi(), tt->eta()));
+	    std::vector<float> energyRec = m_jmTools->emTTCellsEnergyByReceiver(&T);
 	    if (energyRec.size() == 2) {
 	        double energy(0.);
 		if (m_isOvEmec) energy = energyRec[0];
 		else            energy = energyRec[1];
-		et = energy / std::cosh(eta);
-		//std::cout << "Et at eta/phi: " << eta << "/" << tt->phi() << " is " << et
-		//          << " Et other: " << ((eta > 0.) ? energyRec[1] : energyRec[0])/std::cosh(eta)
-                //          << " Et all: " << m_larEnergy->EtLArg(id);
-            //} else et = m_larEnergy->EtLArg(id);
-            } else et = energyRec[0] / std::cosh(eta);
+		et = energy / std::cosh(tt->eta());
+            } else et = energyRec[0] / std::cosh(tt->eta());
 	} else {
-	    //if (m_lvl1Helper->is_tile(id)) {
-	    if (m_lvl1Helper->is_tile(id) || m_lvl1Helper->is_hec(id)) {
-	        et = m_jmTools->hadTTCellsEnergy(tt) / std::cosh(eta);
-	    //} else et = m_larEnergy->EtLArg(id); // includes missing FEB correction
-	    } else et = m_jmTools->emTTCellsEnergy(tt) / std::cosh(eta);
+            et = ttCellsEnergy(*tt) / std::cosh(tt->eta());
 	}
     }
     return et;
@@ -484,32 +319,36 @@ double L1CaloRampMaker::getCaloEnergy(const Identifier& id, const LVL1::TriggerT
 
 // calculate trigger tower E_T from adc values
 // if run is with gain 1 loaded, need special treatment of E_T for HEC and TILE
-double L1CaloRampMaker::getTriggerTowerEnergy(const std::vector<int>& adc, const Identifier& id, unsigned int coolId, double eta) {
+double L1CaloRampMaker::getTriggerTowerEnergy(const xAOD::TriggerTower* tt) {
     // calibration is against ADC energy "(adc peak value - pedestal) / 4"
+    auto max = std::max_element(tt->adc().begin(), tt->adc().end());
+
+    const L1CaloPprConditionsRun2 *pprConditions = m_pprLutContainer->pprConditions(tt->coolId());
+    if(!pprConditions) {
+        ATH_MSG_WARNING("Empty PPrConditions for 0x "
+                        << std::hex << tt->coolId() << std::dec << "!");
+        return 0.;
+    }
 
-    std::vector<int>::const_iterator max = std::max_element(adc.begin(), adc.end());
-    const L1CaloPprLut *pprLut = m_pprLutContainer->pprLut(coolId);
-    double energy = (*max - int(pprLut->pedValue())) * 0.25;
+    double energy = (*max - int(pprConditions->pedValue())) * 0.25;
     if (energy < 0.) energy = 0.;
-    //if (m_lvl1Helper->is_barrel_end(id)) {
-    //    std::cout << " TT Et: " << energy << " maxADC: " << *max << " pedVal: " << pprLut->pedValue() << std::endl;
-    //}
 
     // no corrections if gain is set correctly
     if(!m_isGain1) return energy;
-    
+
     // correct hec and tile if gain 1
+    auto id = m_ttTool->identifier(tt->eta(), tt->phi(), tt->sampling());
     if(m_lvl1Helper->is_hec(id)) {
-        energy /= std::cosh(eta);
-        if(fabs(eta) > 2.5) {
+        energy /= std::cosh(tt->eta());
+        if(fabs(tt->eta()) > 2.5) {
             energy *= 10.;
-        } else if(fabs(eta) > 1.9) {
+        } else if(fabs(tt->eta()) > 1.9) {
             energy *= 5.;
         } else {
             energy *= 3.125;
         }
     } else if(m_lvl1Helper->is_tile(id)) {
-        energy /= std::cosh(eta);
+        energy /= std::cosh(tt->eta());
     }
 
     return energy;
@@ -517,35 +356,26 @@ double L1CaloRampMaker::getTriggerTowerEnergy(const std::vector<int>& adc, const
 
 // function fills a map of cooldid -> (number of cells failing quality, avg. cell timing)
 // used for fcal debugging
-void L1CaloRampMaker::checkProvenance(const Identifier& ttId, unsigned int coolId) {
-    const std::vector<const CaloCell*>& cells(m_cells2tt->caloCells(ttId));
-    unsigned int s(cells.size());
-    std::map<unsigned int, std::pair<unsigned int, double> >::iterator it;
-    for(unsigned int i = 0; i < s; ++i) {
-	it = m_mapBadOFCIteration.find(coolId);
+void L1CaloRampMaker::checkProvenance(const xAOD::TriggerTower* tt) {
+    const std::vector<const CaloCell*>& cells(m_xAODTTTools->getCaloCells(*tt));
+    double oneOverNCells = 1./double(cells.size());
+    for(const auto *cell : cells) {
+	auto it = m_mapBadOFCIteration.find(tt->coolId());
 	if(it == m_mapBadOFCIteration.end()) {
-	    m_mapBadOFCIteration.insert(
-              std::pair<unsigned int, std::pair<unsigned int, double> >(coolId,
-			std::pair<unsigned int, double>(!((cells[i])->provenance() & 0x100),
-							(cells[i]->time()/double(s)))));
+	    m_mapBadOFCIteration.insert(std::make_pair(tt->coolId(), std::make_pair(!(cell->provenance() & 0x100),
+                                                                                    (cell->time()*oneOverNCells))));
 	    continue;
 	}
-	if(!((cells[i])->provenance() & 0x100)) {
+	if(!(cell->provenance() & 0x100)) {
 	    it->second.first += 1;
 	}
-	it->second.second += (cells[i]->time()/double(s));
+	it->second.second += (cell->time()*oneOverNCells);
     }
 }
 
 StatusCode L1CaloRampMaker::finalize()
 {
-    StatusCode sc;
-
-    sc = m_detStore->record(m_rampDataContainer, m_outputFolderName);
-    if(sc.isFailure()) {
-        ATH_MSG_FATAL( "Cannot record L1CaloRampDataContainer in DetectorStore" );
-        return sc;
-    }
+    CHECK(detStore()->record(std::move(m_rampDataContainer), m_outputFolderName));
 
     if(m_checkProvenance) {
 	std::ofstream bad_ofciter("bad-ofciter.txt");
diff --git a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/components/TrigT1CaloCalibUtils_entries.cxx b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/components/TrigT1CaloCalibUtils_entries.cxx
index 3dbe6d158285cb5ce442d3be4c1716ed9b27e885..022f4ca558ce6b72ff82d4a2e9f4720113a7100e 100755
--- a/Trigger/TrigT1/TrigT1CaloCalibUtils/src/components/TrigT1CaloCalibUtils_entries.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibUtils/src/components/TrigT1CaloCalibUtils_entries.cxx
@@ -20,9 +20,12 @@ DECLARE_ALGORITHM_FACTORY( L1CaloTriggerTowerSelector )
 DECLARE_ALGORITHM_FACTORY( L1CaloPprPhos4ShapeMaker )
 DECLARE_ALGORITHM_FACTORY( L1CaloPprMonitoring )
 
+#include "../L1CaloDumpRampData.h"
+DECLARE_ALGORITHM_FACTORY( L1CaloDumpRampData )
 
 DECLARE_FACTORY_ENTRIES( TrigT1CaloCalibUtils )
 {
+  DECLARE_ALGORITHM( L1CaloDumpRampData );
   DECLARE_ALGORITHM( L1CaloHVCorrectionsForDB )
   DECLARE_ALGORITHM( L1CaloHVDummyContainers )
   DECLARE_ALGORITHM( L1CaloLinearCalibration )
@@ -33,4 +36,3 @@ DECLARE_FACTORY_ENTRIES( TrigT1CaloCalibUtils )
   DECLARE_ALGORITHM( L1CaloPprPhos4ShapeMaker )
   DECLARE_ALGORITHM( L1CaloPprMonitoring )
 }
-