Skip to content
Snippets Groups Projects
Commit 28860ff0 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (TrigT1CaloCalibUtils-00-06-24)

parent 1a979637
No related merge requests found
Showing
with 991 additions and 482 deletions
################################################################################
# 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 )
......@@ -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
// -*- 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
......@@ -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
......@@ -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"):
......
################################################################################
# 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
################################################################################
# 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
/*
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;
}
// -*- 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
......@@ -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;
}
This diff is collapsed.
......@@ -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 )
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment