Skip to content
Snippets Groups Projects
Commit 2bbe8118 authored by scott snyder's avatar scott snyder
Browse files

LArConditionsCommon: Fixes for LAr conditions setup.

LAr conditions setup was failing for run 1, where we didn't have
flat conditions.  Try to make work now for all cases.

There are still some components that access conditions directly,
not using a conditions handle.  For those cases, we still need
to keep LArFlatConditionsSvc alive.  Once those are gone,
we can remove it.
parent 4dc2c331
No related branches found
No related tags found
No related merge requests found
include.block ( "LArConditionsCommon/LArConditionsCommon_MT_jobOptions.py" )
from LArConditionsCommon.LArCondFlags import larCondFlags
from IOVDbSvc.CondDB import conddb
if not larCondFlags.LoadElecCalib.is_locked():
larCondFlags.LoadElecCalib.set_Value(rec.readRDO())
#Import conditions algos
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LAruA2MeVFlat_ as LAruA2MeVCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArDAC2uAFlat_ as LArDAC2uACondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArRampFlat_ as LArRampCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArPedestalFlat_ as LArPedestalCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArHVScaleCorrFlat_ as LArHVScaleCorrCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArMphysOverMcalFlat_ as LArMphysOverMcalCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArOFCFlat_ as LArOFCCondAlg
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArShapeFlat_ as LArShapeCondAlg
from AthenaCommon.AlgSequence import AthSequencer
condSequence = AthSequencer("AthCondSeq")
for obj,calg in (("Pedestal",LArPedestalCondAlg),("uA2MeV",LAruA2MeVCondAlg),("DAC2uA",LArDAC2uACondAlg),("Ramp",LArRampCondAlg),("MphysOverMcal", LArMphysOverMcalCondAlg),("HVScaleCorr",LArHVScaleCorrCondAlg),("OFC",LArOFCCondAlg),("Shape",LArShapeCondAlg)):
conddb.addFolder("LAR_ONL","/LAR/ElecCalibFlat/"+obj,className="CondAttrListCollection")
condSequence+=calg(ReadKey="/LAR/ElecCalibFlat/"+obj,WriteKey="LAr"+obj)
......@@ -58,6 +58,7 @@ haveElecCalibInline=(conddb.dbdata=="CONDBR2")
if (haveElecCalibInline):
# TEMPORARY --- until everything's been changed to use conditions handles.
# Run 2 case:
#This service creates a objects in the DetectorStore that wrap the AttributeListCollections
#with the inline representation of the electronic calibration and makes them accessible through the
......@@ -68,9 +69,32 @@ if (haveElecCalibInline):
svcMgr.ProxyProviderSvc.ProviderNames += [ "LArFlatConditionSvc" ]
def addLArFlatFolder (db, obj, calg, qual=''):
from AthenaCommon.AlgSequence import AthSequencer
condSequence = AthSequencer("AthCondSeq")
folder = '/LAR/ElecCalibFlat/' + obj
conddb.addFolder(db, folder + forceRN + qual,
className = 'CondAttrListCollection')
condSequence += calg (ReadKey=folder, WriteKey='LAr'+obj)
return
def addLArFolder (db, obj, cls, qual=''):
if db.endswith ('OFL'):
folder = 'ElecCalibOfl'
else:
folder = 'ElecCalibOnl'
conddb.addFolder (db, '/LAR/' + folder + '/' + obj + forceRN+qual,
className = cls)
return
#Load HVScaleCorr. For run 2,these constants are also used by the CaloNoiseToolDB
if (haveElecCalibInline):
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/HVScaleCorr"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArHVScaleCorrFlat_ as LArHVScaleCorrCondAlg
addLArFlatFolder (ONLDB, 'HVScaleCorr', LArHVScaleCorrCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.HVScaleCorrInput="/LAR/ElecCalibFlat/HVScaleCorr"
......@@ -93,56 +117,75 @@ if larCondFlags.LoadElecCalib():
# Run 2 case:
#1. uA2MeV
if larCondFlags.ua2MeVFolder()=="":
conddb.addFolder("LAR_ONL","/LAR/ElecCalibFlat/uA2MeV"+forceRN)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LAruA2MeVFlat_ as LAruA2MeVCondAlg
addLArFlatFolder ('LAR_ONL', 'uA2MeV', LAruA2MeVCondAlg)
# TEMPORARY
theLArCondSvc.uA2MeVInput="/LAR/ElecCalibFlat/uA2MeV"
else:
#Load from offline database
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/"+larCondFlags.ua2MeVFolder()+forceRN)
pass
addLArFolder ('LAR_OFL', larCondFlags.ua2MeVFolder(),
'LAruA2MeVComplete')
#2. DAC2uA
conddb.addFolder("LAR_ONL","/LAR/ElecCalibFlat/DAC2uA"+forceRN)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArDAC2uAFlat_ as LArDAC2uACondAlg
addLArFlatFolder ('LAR_ONL', 'DAC2uA', LArDAC2uACondAlg)
# TEMPORARY
theLArCondSvc.DAC2uAInput="/LAR/ElecCalibFlat/DAC2uA"
#3. Pedestal
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/Pedestal"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArPedestalFlat_ as LArPedestalCondAlg
addLArFlatFolder (ONLDB, 'Pedestal', LArPedestalCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.PedestalInput="/LAR/ElecCalibFlat/Pedestal"
#4. Ramp
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/Ramp"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArRampFlat_ as LArRampCondAlg
addLArFlatFolder (ONLDB, 'Ramp', LArRampCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.RampInput="/LAR/ElecCalibFlat/Ramp"
#5. MphysOverMcal
if larCondFlags.MphysOverMcalFolder()=="":
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/MphysOverMcal"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArMphysOverMcalFlat_ as LArMphysOverMcalCondAlg
addLArFlatFolder (ONLDB, 'MphysOverMcal',
LArMphysOverMcalCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.MphysOverMcalInput="/LAR/ElecCalibFlat/MphysOverMcal"
else:
else:
#Load from offline database:
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/"+larCondFlags.MphysOverMcalFolder()+forceRN+sqlDB)
pass
addLArFolder ('LAR_OFL', larCondFlags.MphysOverMcalFolder(),
'LArMphysOverMcalComplete', sqlDB)
#6. HVScaleCorr -> moved outside of the if loadElecCalib clause b/c it's now used by the CaloNoiseTool
#conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/HVScaleCorr"+forceRN+sqlDB)
#theLArCondSvc.HVScaleCorrInput="/LAR/ElecCalibFlat/HVScaleCorr"
#7. OFCs
if larCondFlags.OFCShapeFolder()=="":
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/OFC"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArOFCFlat_ as LArOFCCondAlg
addLArFlatFolder (ONLDB, 'OFC', LArOFCCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.OFCInput="/LAR/ElecCalibFlat/OFC"
else:
#Load from offline DB
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+larCondFlags.OFCShapeFolder()+selection+forceRN)
pass
addLArFolder ('LAR_OFL',
'OFC/PhysWave/RTM/'+larCondFlags.OFCShapeFolder(),
'LArOFCComplete', selection)
#8.Shape
if larCondFlags.useShape():
if larCondFlags.OFCShapeFolder()=="":
conddb.addFolder(ONLDB,"/LAR/ElecCalibFlat/Shape"+forceRN+sqlDB)
from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArShapeFlat_ as LArShapeCondAlg
addLArFlatFolder (ONLDB, 'Shape', LArShapeCondAlg, sqlDB)
# TEMPORARY
theLArCondSvc.ShapeInput="/LAR/ElecCalibFlat/Shape"
else:
#Load from offline database
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/Shape/RTM/"+larCondFlags.OFCShapeFolder()+selection+forceRN)
pass
addLArFolder ('LAR_OFL',
'Shape/RTM/'+larCondFlags.OFCShapeFolder(),
'LArShapeComplete', selection)
pass
pass
......@@ -163,47 +206,50 @@ if larCondFlags.LoadElecCalib():
#1. uA2MeV
if larCondFlags.ua2MeVFolder()=="":
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/uA2MeV"+forceRN)
addLArFolder ('LAR_ONL', 'uA2MeV', 'LAruA2MeVMC')
else:
#Load from offline database
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/"+larCondFlags.ua2MeVFolder()+forceRN)
pass
addLArFolder ('LAR_OFL', larCondFlags.ua2MeVFolder(), 'LAruA2MeVMC')
#2. DAC2uA
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/DAC2uA"+forceRN)
addLArFolder ('LAR_ONL', 'DAC2uA', 'LArDAC2uAMC')
#3. Pedestal
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Pedestal"+forceRN)
addLArFolder ('LAR_ONL', 'Pedestal', 'LArPedestalComplete')
#4. Ramp
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Ramp"+forceRN)
addLArFolder ('LAR_ONL', 'Ramp', 'LArRampComplete')
#5. MphysOverMcal
if larCondFlags.MphysOverMcalFolder()=="":
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/MphysOverMcal"+forceRN)
addLArFolder ('LAR_ONL', MphysOverMcal,
'LArMphysOverMcalComplete')
else:
#Load from offline database:
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/"+larCondFlags.MphysOverMcalFolder()+forceRN)
pass
addLArFolder ('LAR_OFL', larCondFlags.MphysOverMcalFolder(),
'LArMphysOverMcalComplete')
#6. HVScaleCorr
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/HVScaleCorr"+forceRN)
#6. HVScaleCorr
addLArFolder ('LAR_ONL', 'HVScaleCorr', 'LArHVScaleCorrComplete')
#7. OFCs
if larCondFlags.OFCShapeFolder()=="":
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/OFC"+forceRN)
addLArFolder ('LAR_ONL', 'OFC', 'LArOFCComplete')
else:
#Load from offline DB
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+larCondFlags.OFCShapeFolder()+selection+forceRN)
pass
addLArFolder ('LAR_OFL', 'OFC/PhysWave/RTM/'+larCondFlags.OFCShapeFolder(),
'LArOFCComplete', selection)
#8.Shape
if larCondFlags.useShape():
if larCondFlags.OFCShapeFolder()=="":
conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Shape"+forceRN)
addLArFolder ('LAR_ONL', 'Shape', 'LArShapeComplete')
else:
#Load from offline database
conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/Shape/RTM/"+larCondFlags.OFCShapeFolder()+selection+forceRN)
pass
addLArFolder ('LAR_OFL', 'Shape/RTM/'+larCondFlags.OFCShapeFolder(),
'LArShapeComplete', selection)
pass
pass
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment