Skip to content
Snippets Groups Projects
Commit 6f2200f3 authored by Thomas Strebler's avatar Thomas Strebler Committed by Tadej Novak
Browse files

Clean up legacy CaloNoise configs

Clean up legacy CaloNoise configs
parent 9fe5bbfa
No related branches found
No related tags found
29 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71484Clean up legacy CaloNoise configs
......@@ -16,9 +16,6 @@ from CaloClusterCorrection.constants import \
from CaloClusterCorrection.common import makecorr
from AthenaCommon.SystemOfUnits import deg
from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg
CaloNoiseCondAlg()
#
# This table lists all available versions of this correction.
# See common.py for a description of the contents.
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.AlgSequence import AthSequencer
from IOVDbSvc.CondDB import conddb
from AthenaCommon.Logging import logging
def CaloNoiseCondAlg(noisetype="totalNoise"):
if noisetype not in ("electronicNoise","pileupNoise","totalNoise"):
raise RuntimeError("Requested noise of unknown type %s" % noisetype)
noiseAlgName="Calo_"+noisetype+"Alg"
condSeq = AthSequencer("AthCondSeq")
if hasattr (condSeq,noiseAlgName):
return getattr(condSeq,noiseAlgName)
if (conddb.isMC):
alg = _CaloNoiseCondAlgMC(noiseAlgName,noisetype)
else:
alg = _CaloNoiseCondAlgData(noiseAlgName,noisetype)
condSeq += alg
return alg
def _CaloNoiseCondAlgMC(noiseAlgName,noisetype):
mlog = logging.getLogger('CaloNoiseCondMC')
from CaloTools.CaloToolsConf import CaloNoiseCondAlg
theCaloNoiseAlg=CaloNoiseCondAlg(noiseAlgName,OutputKey=noisetype)
from CaloTools.CaloNoiseFlags import jobproperties
if jobproperties.CaloNoiseFlags.FixedLuminosity() >= 0 :
theCaloNoiseAlg.Luminosity=jobproperties.CaloNoiseFlags.FixedLuminosity()
mlog.info(" Luminosity (in 10**33) units used for pileup noise from CaloNoiseFlags : %f", theCaloNoiseAlg.Luminosity)
else:
if jobproperties.CaloNoiseFlags.UseCaloLuminosity():
lumiFolder='/CALO/Ofl/Noise/PileUpNoiseLumi'
conddb.addFolder('CALO_OFL',lumiFolder,className="CondAttrListCollection")
mlog.info("offline mode: use luminosity from /CALO/Ofl/Noise/PileUpNoiseLumi to scale pileup noise")
theCaloNoiseAlg.LumiFolder = lumiFolder
theCaloNoiseAlg.Luminosity=-1.
else:
from AthenaCommon.BeamFlags import jobproperties
theCaloNoiseAlg.Luminosity=jobproperties.Beam.estimatedLuminosity()/1e+33
mlog.info(" Luminosity (in 10**33) units used for pileup noise from BeamFlags : %f", theCaloNoiseAlg.Luminosity)
pass
pass
theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
conddb.addFolder("LAR_OFL","/LAR/NoiseOfl/CellNoise",className="CondAttrListCollection")
theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
conddb.addFolder("TILE_OFL","/TILE/OFL02/NOISE/CELL",className="CondAttrListCollection")
theCaloNoiseAlg.CaloNoiseFolder="/CALO/Ofl/Noise/CellNoise"
conddb.addFolder("CALO_OFL","/CALO/Ofl/Noise/CellNoise",className="CondAttrListCollection")
return theCaloNoiseAlg
def _CaloNoiseCondAlgData(noiseAlgName,noisetype):
mlog = logging.getLogger('CaloNoiseCondData')
from CaloTools.CaloNoiseFlags import jobproperties
fixedLumi = jobproperties.CaloNoiseFlags.FixedLuminosity()
caloLumi = jobproperties.CaloNoiseFlags.UseCaloLuminosity()
from CaloTools.CaloToolsConf import CaloNoiseCondAlg
theCaloNoiseAlg=CaloNoiseCondAlg(noiseAlgName,OutputKey=noisetype)
if conddb.isOnline:
folder = "/CALO/Noise/CellNoise"
theCaloNoiseAlg.CaloNoiseFolder=folder
theCaloNoiseAlg.LArNoiseFolder=""
theCaloNoiseAlg.TileNoiseFolder=""
conddb.addFolder('CALO_ONL',folder,className="CondAttrListCollection")
if fixedLumi >= 0 :
theCaloNoiseAlg.Luminosity = fixedLumi
mlog.info("online mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
else:
if caloLumi:
lumiFolder='/CALO/Noise/PileUpNoiseLumi'
conddb.addFolder('CALO',lumiFolder,className="CondAttrListCollection")
theCaloNoiseAlg.LumiFolder = lumiFolder
theCaloNoiseAlg.Luminosity = -1.
mlog.info("online mode: use luminosity from /CALO/Noise/PileUpNoiseLumi to scale pileup noise")
else:
theCaloNoiseAlg.Luminosity = 0.
mlog.info("online mode: ignore pileup noise")
pass
else: #regular offline mode
if conddb.dbdata=="CONDBR2": # Run2 case:
theCaloNoiseAlg.CaloNoiseFolder=""
theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
conddb.addFolder("LAR_OFL","/LAR/NoiseOfl/CellNoise",className="CondAttrListCollection")
conddb.addFolder("TILE_OFL","/TILE/OFL02/NOISE/CELL",className="CondAttrListCollection")
from CaloRec.CaloCellFlags import jobproperties
if jobproperties.CaloCellFlags.doLArHVCorr():
mlog.info("Run2 & doLArHVCorr=True: Will rescale noise automatically for HV trips")
theCaloNoiseAlg.useHVCorr=True
from LArConditionsCommon import LArHVDB # noqa: F401
pass
pass
else: #COMP200 case:
#The noise for runs before 2012 is in different folders:
theCaloNoiseAlg.CaloNoiseFolder="/CALO/Ofl/Noise/CellNoise"
theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
conddb.addFolder("CALO_OFL","/CALO/Ofl/Noise/CellNoise",className="CondAttrListCollection")
conddb.addFolder("LAR_OFL","/LAR/NoiseOfl/CellNoise",className="CondAttrListCollection")
conddb.addFolder("TILE_OFL","/TILE/OFL02/NOISE/CELL",className="CondAttrListCollection")
# for luminosity
if fixedLumi >= 0 :
theCaloNoiseAlg.Luminosity = fixedLumi
mlog.info("offline mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
else:
theCaloNoiseAlg.Luminosity = -1
if caloLumi:
lumiFolder='/CALO/Ofl/Noise/PileUpNoiseLumi'
conddb.addFolder('CALO_OFL',lumiFolder,className="CondAttrListCollection")
mlog.info("offline mode: use luminosity from /CALO/Ofl/Noise/PileUpNoiseLumi to scale pileup noise")
else:
lumiFolder = '/TRIGGER/LUMI/LBLESTONL'
conddb.addFolder('TRIGGER_ONL',lumiFolder,className="CondAttrListCollection")
mlog.info("offline mode: use luminosity = f(Lumiblock) to scale pileup noise")
theCaloNoiseAlg.LumiFolder = lumiFolder
return theCaloNoiseAlg
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
""" Flags for define calo noise tool configuration
"""
#
#
__author__ = 'G.Unal'
#=======================================================================
# imports
#=======================================================================
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
from AthenaCommon.JobProperties import jobproperties
class FixedLuminosity(JobProperty):
""" Flag to force luminosity (10**33 units) to a given value corresponding to a given mu
Lumi is related to mu by Lumi = (mu/2.3) * 25ns/BunchSpacing(ns)
BunchSpacing should be consistent with what is used from DB, as noise/sqrt(Lumi) depends on BunchSpacing
if -1 uses lumi from database (Data) or Beam properties (MC) to perform the sqrt(Lumi) pileup noise scaling
"""
statusOn = True
allowedType=['float']
StoredValue = -1.
class UseCaloLuminosity(JobProperty):
""" Flag to tell to use the luminosity normalization for pileup noise from dedicated calo folder
instead of online per LumiBlock
Only active if FixedLuminosity is not >0
"""
statusOn = True
allowedType=['bool']
StoredValue = True
class CaloNoiseFlags(JobPropertyContainer):
""" The CaloNoiseFlag container
"""
pass
# add container to jobProperties
jobproperties.add_Container(CaloNoiseFlags)
list_jobproperties = [
FixedLuminosity,UseCaloLuminosity
]
for i in list_jobproperties:
jobproperties.CaloNoiseFlags.add_JobProperty(i)
del list_jobproperties
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