Skip to content
Snippets Groups Projects
Commit 4094a491 authored by Thomas Strebler's avatar Thomas Strebler Committed by Ahmed Tarek
Browse files

Clean up legacy LArOnlDbPrep configs

Clean up legacy LArOnlDbPrep configs
parent 4cad087d
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( LArOnlDbPrep )
......@@ -14,7 +14,3 @@ atlas_add_component( LArOnlDbPrep
INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} CaloIdentifier CaloTriggerToolLib AthenaBaseComps GaudiKernel LArRecConditions LArCablingLib CaloDetDescrLib StoreGateLib AthenaPoolUtilities LArCOOLConditions LArIdentifier CaloInterfaceLib )
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_scripts( share/*.sh )
fill=True
import AthenaCommon.AtlasUnixGeneratorJob
## get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.GlobalFlags import globalflags
globalflags.DataSource.set_Value_and_Lock('data')
globalflags.InputFormat.set_Value_and_Lock('bytestream')
#globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-GEO-18-01-01')
globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-GEO-20-00-01')
globalflags.DetGeo.set_Value_and_Lock('commis')
globalflags.Luminosity.set_Value_and_Lock('zero')
from AthenaCommon.DetFlags import DetFlags
DetFlags.Calo_setOn()
DetFlags.ID_setOff()
DetFlags.Muon_setOff()
DetFlags.Truth_setOff()
DetFlags.LVL1_setOff()
DetFlags.digitize.all_setOff()
#Set up GeoModel (not really needed but crashes without)
from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
svcMgr.IOVDbSvc.GlobalTag = "COMCOND-ES1PA-006-02"
#Get identifier mapping (needed by LArConditionsContainer)
include("LArConditionsCommon/LArIdMap_comm_jobOptions.py")
include( "CaloConditions/CaloConditions_jobOptions.py" )
# for LArBadChannelTool, instead of conddb.AddFolder below
#include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")
theApp.EvtMax = 1
#conddb.setGlobalTag("COMCOND-006-01") #For id mapping
folder="/LAR/Configuration/DSPGeoWeightsFlat"
fileName="DSPGeoWeigths"
from CaloTools.CaloNoiseFlags import jobproperties
jobproperties.CaloNoiseFlags.FixedLuminosity.set_Value_and_Lock(1.45*30/8)
from LArOnlDbPrep.LArOnlDbPrepConf import LArGeoWeightsFill
theLArGeoWeightsFill=LArGeoWeightsFill()
theLArGeoWeightsFill.OutFile="dumpFile.txt"
theLArGeoWeightsFill.Key=folder
theLArGeoWeightsFill.Fill=True
theLArGeoWeightsFill.Dump=True
topSequence+=theLArGeoWeightsFill
OutputList=[ "AthenaAttributeList#"+folder ]
OutputTagList=[]
from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","LArGeoWeightsTemplates.pool.root",
OutputList,OutputTagList,True)
from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc
svcMgr += IOVRegistrationSvc()
svcMgr.IOVRegistrationSvc.RecreateFolders = False
svcMgr.IOVRegistrationSvc.SVFolder=True
svcMgr.IOVRegistrationSvc.OverrideNames += ["costheta","sinthetacosphi","sinthetasinphi","offlineTTid"]
svcMgr.IOVRegistrationSvc.OverrideTypes += ["Blob16M","Blob16M","Blob16M","Blob16M"]
svcMgr.IOVRegistrationSvc.OutputLevel=VERBOSE
svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=DSPGeoWeights.db;dbname=CONDBR2"
svcMgr.DetectorStore.Dump=True
svcMgr.EventSelector.RunNumber=0xFFFFFF
fill=True
if 'IWscale' not in dir():
IWscale=0.
import AthenaCommon.AtlasUnixGeneratorJob
## get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.GlobalFlags import globalflags
globalflags.DataSource.set_Value_and_Lock('data')
globalflags.InputFormat.set_Value_and_Lock('bytestream')
globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-R2-2015-04-00-00')
globalflags.DetGeo.set_Value_and_Lock('commis')
globalflags.Luminosity.set_Value_and_Lock('zero')
globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2')
from AthenaCommon.DetFlags import DetFlags
DetFlags.Calo_setOn()
DetFlags.ID_setOff()
DetFlags.Muon_setOff()
DetFlags.Truth_setOff()
DetFlags.LVL1_setOff()
DetFlags.digitize.all_setOff()
#Set up GeoModel (not really needed but crashes without)
from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
svcMgr.IOVDbSvc.GlobalTag = "CONDBR2-BLKPA-2023-02"
#Get identifier mapping (needed by LArConditionsContainer)
include("LArConditionsCommon/LArIdMap_comm_jobOptions.py")
# for LArBadChannelTool, instead of conddb.AddFolder below
include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")
theApp.EvtMax = 1
folder="/LAR/Configuration/DSPThresholdFlat/Templates"
fileName=ModeType+tag
setName="-".join(tag.split("-")[1:])
from CaloTools.CaloNoiseFlags import jobproperties
# in case of fixed lumi:
#jobproperties.CaloNoiseFlags.FixedLuminosity.set_Value_and_Lock(1.45*30/8)
# otherwise reading from folder:
jobproperties.CaloNoiseFlags.FixedLuminosity.set_Value_and_Lock(-1.)
# Turn this off before configuring CaloNoiseCondAlg.
from CaloRec.CaloCellFlags import jobproperties
jobproperties.CaloCellFlags.doLArHVCorr = False
from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
CaloNoiseCondAlg ('totalNoise')
CaloNoiseCondAlg ('electronicNoise')
conddb.addOverride("/CALO/Ofl/Noise/PileUpNoiseLumi","CALOOflNoisePileUpNoiseLumi-RUN2-UPD1-00")
if 'pileupsqlite' in dir():
conddb.addMarkup("/CALO/Ofl/Noise/PileUpNoiseLumi","<db>sqlite://;schema="+pileupsqlite+";dbname=CONDBR2</db>")
if 'noisesqlite' in dir():
if 'noisetag' in dir():
conddb.addMarkup("/LAR/NoiseOfl/CellNoise","<db>sqlite://;schema="+noisesqlite+";dbname=CONDBR2</db><tag>"+noisetag+"</tag>")
else:
conddb.addMarkup("/LAR/NoiseOfl/CellNoise","<db>sqlite://;schema="+noisesqlite+";dbname=CONDBR2</db>")
else:
if 'noisetag' in dir():
conddb.addOverride("/LAR/NoiseOfl/CellNoise",""+noisetag+"")
if 'RunSince' not in dir():
RunSince=0
from LArOnlDbPrep.LArOnlDbPrepConf import LArDSPThresholdFillInline
theLArDSPThresholdFillAlg=LArDSPThresholdFillInline()
theLArDSPThresholdFillAlg.OutputLevel=INFO
theLArDSPThresholdFillAlg.ScaleIW=IWscale
theLArDSPThresholdFillAlg.Key=folder
theLArDSPThresholdFillAlg.OutFile=fileName+".txt"
theLArDSPThresholdFillAlg.mode=ModeType
theLArDSPThresholdFillAlg.MaskBadChannels=True
theLArDSPThresholdFillAlg.ProblemsToMask=[
"highNoiseHG","highNoiseMG","highNoiseLG"
]
theLArDSPThresholdFillAlg.NameOfSet=setName
# Set masked channel thresholds lower for diagnostics
#theLArDSPThresholdFillAlg.MaskedtQThreshold=0.
#theLArDSPThresholdFillAlg.MaskedsamplesThreshold=0.
##if ModeType=="fixed":
## theLArDSPThresholdFillAlg.tQThreshold=10000
## theLArDSPThresholdFillAlg.samplesThreshold=10000
if ModeType=="fixed":
theLArDSPThresholdFillAlg.tQThreshold=Qtval
theLArDSPThresholdFillAlg.samplesThreshold=Sampval
if ModeType=="group":
theLArDSPThresholdFillAlg.ThresholdsPerCellGroup=["250,1000",
"[HEC,FCAL/*/*/*/*/*] 500, 1000"]
if ModeType=="noise":
theLArDSPThresholdFillAlg.sigmaNoiseSamples=Sampval
theLArDSPThresholdFillAlg.sigmaNoiseQt=Qtval
theLArDSPThresholdFillAlg.usePileupNoiseSamples=Samppileup
theLArDSPThresholdFillAlg.usePileupNoiseQt=Qtpileup
if fill:
theLArDSPThresholdFillAlg.Fill=True
theLArDSPThresholdFillAlg.Dump=True
else:
theLArDSPThresholdFillAlg.Fill=False
theLArDSPThresholdFillAlg.Dump=True
topSequence+=theLArDSPThresholdFillAlg
MessageSvc = svcMgr.MessageSvc
MessageSvc.OutputLevel = WARNING
if fill:
OutputList=[ "AthenaAttributeList#"+folder ]
OutputTagList=[tag]
WriteIOV=True
from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
## theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","LArDSPthresholds_"+fileName+".pool.root",
theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","LArDSPthresholdTemplates.pool.root",
OutputList,OutputTagList,WriteIOV)
theOutputConditionsAlg.Run1=RunSince
from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc
svcMgr += IOVRegistrationSvc()
svcMgr.IOVRegistrationSvc.OutputLevel = WARNING
##svcMgr.IOVRegistrationSvc.RecreateFolders = True
svcMgr.IOVRegistrationSvc.RecreateFolders = False
svcMgr.IOVRegistrationSvc.OverrideNames += ["tQThr","samplesThr","trigSumThr",]
svcMgr.IOVRegistrationSvc.OverrideTypes += ["Blob16M","Blob16M","Blob16M",]
else:
conddb.addFolder("",folder+"<tag>"+tag+"</tag>")
# For LArBadChannelTool
conddb.addFolder(LArDB,"/LAR/BadChannels/BadChannels")
conddb.addFolder(LArDB,"/LAR/BadChannels/MissingFEBs")
svcMgr.PoolSvc.FileOpen = "update"
svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:PoolFileCatalog_LARConfigurationDSPThresholdTemplates.xml"
##svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:PoolFileCatalog_"+fileName+".xml"
print(svcMgr.PoolSvc)
#svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=test.db;dbname=COMP200"
#svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema="+fileName+".db;dbname=COMP200"
svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=DSPThresholdTemplates.db;dbname=CONDBR2"
svcMgr.DetectorStore.Dump=True
if 'RunNumber' in dir():
svcMgr.EventSelector.RunNumber=RunNumber
else:
svcMgr.EventSelector.RunNumber=0xFFFFFF
tagList = ['LARConfigurationDSPThresholdFlatTemplates-Qt0-samp0',
'LARConfigurationDSPThresholdFlatTemplates-Qt250-samp0',
'LARConfigurationDSPThresholdFlatTemplates-Qt250-samp1000',
'LARConfigurationDSPThresholdFlatTemplates-Qt250HECFCAL500-samp1000',
'LARConfigurationDSPThresholdFlatTemplates-Qt10000-samp10000',
'LARConfigurationDSPThresholdFlatTemplates-Qt0sigma-samp50sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt50sigma-samp0sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt0.5sigma-samp0.5sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt1sigma-samp1sigma',
## 'LARConfigurationDSPThresholdFlatTemplates-Qt1sigma-samp10sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt1.5sigma-samp1.5sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigma-samp2sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp1sigma',
## 'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp1.5sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp2sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp3sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigma-samp5sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt5sigma-samp5sigma',
'LARConfigurationDSPThresholdFlatTemplates-Qt1sigmaPileup-samp1sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaPileup-samp2sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaPileup-samp3sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaPileup-samp4sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaPileup-samp3sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt4sigmaPileup-samp4sigmaPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt5sigmaPileup-samp5sigmaPileup'
]
tag=tagList[tagNum]
print(tag)
Qtstr=tag.split("Qt")[1]
Sampstr=tag.split("samp")[1]
#print(Qtstr,Sampstr)
if "sigma" in tag:
ModeType = "noise"
Qtpileup = False
Samppileup = False
if len(Qtstr.split("sigma")) > 1:
print(Qtstr.split("sigma")[1])
if Qtstr.split("sigma")[1].find("Pileup") > -1:
Qtpileup = True
if len(Sampstr.split("sigma")) > 1:
print(Sampstr.split("sigma")[1])
if Sampstr.split("sigma")[1].find("Pileup") > -1:
Samppileup = True
print("Setting pileup noise to (Qt,Samp) = ",Qtpileup,Samppileup)
Qtstr=Qtstr.split("sigma")[0]
Sampstr=Sampstr.split("sigma")[0]
elif "HECFCAL" in tag:
ModeType = "group"
Qtstr="0" ## done manually
Sampstr="0" ## done manually
else:
ModeType = "fixed"
Qtstr=Qtstr.split("-")[0]
Qtval=float(Qtstr)
Sampval=float(Sampstr)
print(Qtval,Sampval)
include("LArOnlDbPrep/LArDSPThresholdFillAlg.py")
tagList = [
'LARConfigurationDSPThresholdFlatTemplates-Qt1sigmaSmallPileup-samp1sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaSmallPileup-samp2sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaSmallPileup-samp3sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaSmallPileup-samp4sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaSmallPileup-samp3sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt4sigmaSmallPileup-samp4sigmaSmallPileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt5sigmaSmallPileup-samp5sigmaSmallPileup'
]
tag=tagList[tagNum]
print tag
Qtstr=tag.split("Qt")[1]
Sampstr=tag.split("samp")[1]
#print Qtstr,Sampstr
if "sigma" in tag:
ModeType = "noise"
Qtpileup = False
Samppileup = False
if len(Qtstr.split("sigma")) > 1:
print Qtstr.split("sigma")[1]
if Qtstr.split("sigma")[1].find("Pileup") > -1:
Qtpileup = True
if len(Sampstr.split("sigma")) > 1:
print Sampstr.split("sigma")[1]
if Sampstr.split("sigma")[1].find("Pileup") > -1:
Samppileup = True
print "Setting pileup noise to (Qt,Samp) = ",Qtpileup,Samppileup
Qtstr=Qtstr.split("sigma")[0]
Sampstr=Sampstr.split("sigma")[0]
elif "HECFCAL" in tag:
ModeType = "group"
Qtstr="0" ## done manually
Sampstr="0" ## done manually
else:
ModeType = "fixed"
Qtstr=Qtstr.split("-")[0]
Qtval=float(Qtstr)
Sampval=float(Sampstr)
print Qtval,Sampval
include("LArOnlDbPrep/LArDSPThresholdFillAlg.py")
tagList = [
'LARConfigurationDSPThresholdFlatTemplates-Qt1sigmaMu50Pileup-samp1sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaMu50Pileup-samp2sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt2sigmaMu50Pileup-samp3sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaMu50Pileup-samp4sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt3sigmaMu50Pileup-samp3sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt4sigmaMu50Pileup-samp4sigmaMu50Pileup',
'LARConfigurationDSPThresholdFlatTemplates-Qt5sigmaMu50Pileup-samp5sigmaMu50Pileup'
]
tag=tagList[tagNum]
print tag
Qtstr=tag.split("Qt")[1]
Sampstr=tag.split("samp")[1]
#print Qtstr,Sampstr
if "sigma" in tag:
ModeType = "noise"
Qtpileup = False
Samppileup = False
if len(Qtstr.split("sigma")) > 1:
print Qtstr.split("sigma")[1]
if Qtstr.split("sigma")[1].find("Pileup") > -1:
Qtpileup = True
if len(Sampstr.split("sigma")) > 1:
print Sampstr.split("sigma")[1]
if Sampstr.split("sigma")[1].find("Pileup") > -1:
Samppileup = True
print "Setting pileup noise to (Qt,Samp) = ",Qtpileup,Samppileup
Qtstr=Qtstr.split("sigma")[0]
Sampstr=Sampstr.split("sigma")[0]
elif "HECFCAL" in tag:
ModeType = "group"
Qtstr="0" ## done manually
Sampstr="0" ## done manually
else:
ModeType = "fixed"
Qtstr=Qtstr.split("-")[0]
Qtval=float(Qtstr)
Sampval=float(Sampstr)
print Qtval,Sampval
include("LArOnlDbPrep/LArDSPThresholdFillAlg.py")
#!/bin/zsh
if [[ $# > 0 ]]
then
Run=$1
else
Run=266280
fi
if [[ $# > 1 ]]
then
Noise=$2
else
Noise=""
fi
if [[ $# > 2 ]]
then
Pileup=$3
else
Pileup=""
fi
fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/NoiseOfl/CellNoise | tail -1`
#foreach i in `seq 0 11`
#foreach i in `seq 0 22`
foreach i in `seq 5 22`
#foreach i in `seq 16 22`
cmdline="RunNumber=$Run;RunSince=$Run;tagNum=$i;noisetag=\"$fulltag\";"
if [[ $Noise != "" ]]
then
cmdline+="noisesqlite=\"$Noise\";"
fi
if [[ $Pileup != "" ]]
then
cmdline+="pileupsqlite=\"$Pileup\";"
fi
athena.py -c "$cmdline" LArOnlDbPrep/LArDSPThresholdTopOptions.py
end
#foreach i in `seq 0 16`
# tagNum=$i; python LArDSPThresholdTopOptions.py
#end
##mv *.db *.txt *.xml *.root /afs/cern.ch/user/s/smajewsk/public/LAr/.
##rm *.xml.BAK
#!/bin/zsh
if [[ $# > 0 ]]
then
Run=$1
else
Run=266280
fi
if [[ $# > 1 ]]
then
Pileup=$2
else
Pileup=""
fi
if [[ $# > 2 ]]
then
Noise=$3
else
Noise=""
fi
fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/NoiseOfl/CellNoise | tail -1`
#foreach i in `seq 0 11`
#foreach i in `seq 0 22`
foreach i in `seq 0 6`
#foreach i in `seq 16 22`
if [[ $Noise == "" ]]
then
athena.py -s -c "RunNumber=$Run;tagNum=$i;pileupsqlite=\"$Pileup\";noisetag=\"$fulltag\";RunSince=$Run" LArOnlDbPrep/LArDSPThresholdTopOptions_mu1.py
else
athena.py -s -c "RunNumber=$Run;tagNum=$i;pileupsqlite=\"$Pileup\";noisesqlite=\"$Noise\";noisetag=\"$fulltag\";RunSince=$Run" LArOnlDbPrep/LArDSPThresholdTopOptions_mu1.py
fi
end
#!/bin/zsh
if [[ $# > 0 ]]
then
Run=$1
else
Run=266280
fi
if [[ $# > 1 ]]
then
Pileup=$2
else
Pileup=""
fi
if [[ $# > 2 ]]
then
Noise=$3
else
Noise=""
fi
fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/NoiseOfl/CellNoise | tail -1`
#foreach i in `seq 0 11`
#foreach i in `seq 0 22`
foreach i in `seq 0 6`
#foreach i in `seq 16 22`
if [[ $Noise == "" ]]
then
athena.py -s -c "RunNumber=$Run;tagNum=$i;pileupsqlite=\"$Pileup\";noisetag=\"$fulltag\";RunSince=$Run" LArOnlDbPrep/LArDSPThresholdTopOptions_mu50.py
else
athena.py -s -c "RunNumber=$Run;tagNum=$i;pileupsqlite=\"$Pileup\";noisesqlite=\"$Noise\";noisetag=\"$fulltag\";RunSince=$Run" LArOnlDbPrep/LArDSPThresholdTopOptions_mu50.py
fi
end
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