diff --git a/Calorimeter/CaloCondPhysAlgs/python/CaloScaleNoiseConfig.py b/Calorimeter/CaloCondPhysAlgs/python/CaloScaleNoiseConfig.py index 79f2b64298e9e048d0665910297f82fd707d1ba5..e0663fcdd777a198e1a5ac9bb9e9cc6d77765aad 100644 --- a/Calorimeter/CaloCondPhysAlgs/python/CaloScaleNoiseConfig.py +++ b/Calorimeter/CaloCondPhysAlgs/python/CaloScaleNoiseConfig.py @@ -105,6 +105,8 @@ if __name__=="__main__": flags.Input.TimeStamps=[TimeStamp] flags.Input.Files=[] flags.IOVDb.DatabaseInstance="CONDBR2" + from AthenaConfiguration.TestDefaults import defaultGeometryTags + flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3 if args.globaltag: flags.IOVDb.GlobalTag=args.globaltag diff --git a/Calorimeter/CaloCondPhysAlgs/share/CaloNoise2Ntuple_MC.py b/Calorimeter/CaloCondPhysAlgs/share/CaloNoise2Ntuple_MC.py index 309d2cb6a1b7904d80b7a678d2cd63f935b6fa14..77ff0402abff780e05a17613c2a3a8195d2af393 100644 --- a/Calorimeter/CaloCondPhysAlgs/share/CaloNoise2Ntuple_MC.py +++ b/Calorimeter/CaloCondPhysAlgs/share/CaloNoise2Ntuple_MC.py @@ -110,6 +110,10 @@ if not hasattr(ServiceMgr, 'THistSvc'): ServiceMgr.THistSvc.Output = ["file1 DATAFILE='"+outputNtuple+"' OPT='RECREATE'"] +from AthenaCommon.AlgSequence import AthSequencer +condSequence = AthSequencer("AthCondSeq") +if hasattr(condSequence, 'TileSamplingFractionCondAlg'): + condSequence.TileSamplingFractionCondAlg.G4Version = -1 #-------------------------------------------------------------- # Set output level threshold (1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py index e29c54fba0cc35ef72fb784784cd351091ff275f..7275480c44e84b74ad65e2eab9ea6c9753c91dba 100644 --- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py +++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py @@ -215,22 +215,7 @@ if DQMonFlags.doMonitoring(): # LAr monitoring # #------------------# if DQMonFlags.doLArMon(): - from LArMonTools.LArMonFlags import LArMonFlags - if LArMonFlags.doLArCollisionTimeMon(): - #Schedule algorithms producing collision timing - include("LArClusterRec/LArClusterCollisionTime_jobOptions.py") - include("LArCellRec/LArCollisionTime_jobOptions.py") - try: - LArMon = AthenaMonManager(name="LArMonManager", - FileKey = DQMonFlags.monManFileKey(), - Environment = DQMonFlags.monManEnvironment(), - ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), - DataType = DQMonFlags.monManDataType()) - topSequence += LArMon - include("LArMonTools/LArAllMonitoring_jobOptions.py") - include("LArMonitoring/LArMonitoring_jobOption.py") - except Exception: - treatException("DataQualitySteering_jobOptions.py: exception when setting up LAr monitoring") + local_logger.warning("Legacy LAr monitoring not existing anymore") #-------------------------------------------------------------------------# # Calo monitoring - cells and clusters independent of LAr or Tile origin # diff --git a/DataQuality/DataQualityInterfaces/python/han.py b/DataQuality/DataQualityInterfaces/python/han.py index d2847667cd993dfea21757594fd49dc728dc4673..d71c0a8864c245958e97b272766777dad893951d 100644 --- a/DataQuality/DataQualityInterfaces/python/han.py +++ b/DataQuality/DataQualityInterfaces/python/han.py @@ -9,6 +9,10 @@ from typing import List, Dict, Tuple, Optional, Iterable import logging log = logging.getLogger('DataQualityInterfaces') +def logLevel(level: str='INFO') -> None: + log.setLevel(level) + + def copyMetadata(newgroup: dqi.HanConfigAssessor, oldgroup: dqi.HanConfigAssessor, input: str=None, algrefname: str=None) -> None: """Copy the configuration of an old algorithm to a new one, but without the @@ -191,9 +195,10 @@ def iterate_objs(thisdir: ROOT.TDirectory, l: List[str], prefix: str): # inconsistent ROOT handling of top directory name of file prefix = os.path.normpath(prefix) prefixlen = len(prefix) + 1 + fixeddirname = os.path.normpath(thisdir.GetPath())[prefixlen:] for k in thisdir.GetListOfKeys(): if k.GetClassName().startswith('TDirectory'): iterate_objs(k.ReadObj(), l, prefix) else: if k.GetName() != 'metadata': - l.append(os.path.join(thisdir.GetPath()[prefixlen:], k.GetName())) + l.append(os.path.join(fixeddirname, k.GetName())) diff --git a/DataQuality/DataQualityInterfaces/src/HanConfig.cxx b/DataQuality/DataQualityInterfaces/src/HanConfig.cxx index ead44584513bc2d9e1d64107dbb3f6e10dcb2849..742938aeed3b139abf8807c10787807a77e4bd67 100644 --- a/DataQuality/DataQualityInterfaces/src/HanConfig.cxx +++ b/DataQuality/DataQualityInterfaces/src/HanConfig.cxx @@ -196,12 +196,12 @@ BuildMonitorsNewRoot( std::string configName, HanInputRootFile& input, dqm_core: TPython::Bind(m_config, "config"); TPython::Bind(m_top_level, "top_level"); TPython::Bind(topdir, "path"); - TPython::Exec("from DataQualityInterfaces.han import FixRegion"); + TPython::Exec("from DataQualityInterfaces.han import FixRegion, logLevel"); const char* debugflag = std::getenv("HANDEBUG"); if (!debugflag) { - TPython::Exec("import logging; logging.basicConfig(level='INFO')"); + TPython::Exec("logLevel('INFO')"); } else { - TPython::Exec("import logging; logging.basicConfig(level='DEBUG')"); + TPython::Exec("logLevel('DEBUG')"); } HanConfigGroup* new_top_level = TPython::Eval("FixRegion(config, top_level, path)"); diff --git a/DataQuality/DataQualityInterfaces/src/han.cxx b/DataQuality/DataQualityInterfaces/src/han.cxx index 5924144ada57a7aa01e70c33dd0fd883a2c1efd7..da131ce46d28a8de3b270e203e0e6149c0576f71 100644 --- a/DataQuality/DataQualityInterfaces/src/han.cxx +++ b/DataQuality/DataQualityInterfaces/src/han.cxx @@ -11,6 +11,7 @@ #include <string> #include <cstdlib> +#include "TPython.h" #include "CxxUtils/checker_macros.h" #include "DataQualityInterfaces/HanApp.h" #include "DataQualityInterfaces/ConditionsSingleton.h" @@ -35,6 +36,7 @@ struct CmdLineArgs { int main ATLAS_NOT_THREAD_SAFE ( int argc, char *argv[] ) { + TPython::Exec("import logging; logging.basicConfig()"); CmdLineArgs arg; int rc = arg.parse( argc, argv ); if (rc!=0) return rc; diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx index e465bc4bddc8881acf352a2890bfabe19752bffe..153832f99faf00bdeb215890d1b5e49e740343b1 100755 --- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx +++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/src/GeoExporter.cxx @@ -35,7 +35,6 @@ #include "GeoModelWrite/WriteGeoModel.h" // #include "GeoModelHelpers/defineWorld.h" //TODO: Use this as soon as we have the latest GeoModel in Athena main -#include <QCoreApplication> #include <QtCore/QStringList> #include <QtCore/QFile> #include <QtCore/QFileInfo> @@ -145,13 +144,6 @@ void GeoExporter::init() VP1Msg::message("==================================================="); VP1Msg::message(""); - int argc=1; - char *argv[2]; - - QCoreApplication app(argc, argv); - QCoreApplication::setOrganizationName("ATLAS"); - QCoreApplication::setApplicationName("GeoExporter"); - VP1Msg::message("Accessing the ATLAS geometry..."); StoreGateSvc* detstore = m_d->detstore; //Get the world volume: diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/python/InDetBeamSpotFinderConfig.py b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/python/InDetBeamSpotFinderConfig.py index 5c8b6c5e486983515467fd01d6524dbc8bf7fe5c..a8c085e9d137c3ebe513d21cfd34c1b3242f7e25 100644 --- a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/python/InDetBeamSpotFinderConfig.py +++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/python/InDetBeamSpotFinderConfig.py @@ -3,25 +3,37 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -def InDetBeamSpotRooFitCfg(flags, name="InDetBeamSpotRooFit", **kwargs): +def InDetBeamSpotRooFitCfg(flags, jobConfig={}, name="InDetBeamSpotRooFit", **kwargs): result = ComponentAccumulator() + + kwargs.setdefault("OutputLevel",min(3,jobConfig['outputlevel'])) + if 'InitialKFactor' in jobConfig: kwargs.setdefault("InitialKFactor",jobConfig['InitialKFactor']) + if 'ConstantKFactor' in jobConfig: kwargs.setdefault("ConstantKFactor",jobConfig['ConstantKFactor']) + if 'RooFitMaxTransverseErr' in jobConfig: kwargs.setdefault("vtxResCut",jobConfig['RooFitMaxTransverseErr']) result.setPrivateTools( CompFactory.InDet.InDetBeamSpotRooFit(name, **kwargs)) return result -def InDetBeamSpotVertexCfg(flags, name="InDetBeamSpotVertex", **kwargs): +def InDetBeamSpotVertexCfg(flags, jobConfig={}, name="InDetBeamSpotVertex", **kwargs): result = ComponentAccumulator() - kwargs.setdefault("MaxSigmaTr", 20.) - kwargs.setdefault("OutlierChi2Tr", 20.) - kwargs.setdefault("TruncatedRMS", True) - + kwargs.setdefault("OutputLevel",min(3,jobConfig['outputlevel'])) + if 'MaxSigmaTr' in jobConfig: kwargs.setdefault("MaxSigmaTr",jobConfig['MaxSigmaTr']) + if 'OutlierChi2Tr' in jobConfig: kwargs.setdefault("OutlierChi2Tr",jobConfig['OutlierChi2Tr']) + if 'InitialKFactor' in jobConfig: kwargs.setdefault("InitParK",jobConfig['InitialKFactor']) + if 'ConstantKFactor' in jobConfig: kwargs.setdefault("FixParK",jobConfig['ConstantKFactor']) + if 'FixWidth' in jobConfig: kwargs.setdefault("FixWidth",jobConfig['FixWidth']) + if 'TruncartedRMS' in jobConfig: kwargs.setdefault("TruncatedRMS",jobConfig['TruncatedRMS']) + if 'SetInitialRMS' in jobConfig: kwargs.setdefault("SetInitialRMS",jobConfig['SetInitialRMS']) + if 'MaxSigmaVtx' in jobConfig: kwargs.setdefault("InitParMaxSigmaX",jobConfig['MaxSigmaVtx']) + if 'MaxSigmaVtx' in jobConfig: kwargs.setdefault("InitParMaxSigmaY",jobConfig['MaxSigmaVtx']) + result.setPrivateTools( CompFactory.InDet.InDetBeamSpotVertex(name, **kwargs)) return result -def InDetBeamSpotFinderCfg(flags, name="InDetBeamSpotFinder", **kwargs): +def InDetBeamSpotFinderCfg(flags, jobConfig={}, name="InDetBeamSpotFinder", **kwargs): # Add BunchCrossingCondData from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg result = BunchCrossingCondAlgCfg(flags) @@ -29,12 +41,32 @@ def InDetBeamSpotFinderCfg(flags, name="InDetBeamSpotFinder", **kwargs): if "BeamSpotToolList" not in kwargs: kwargs.setdefault("BeamSpotToolList", [ result.addPublicTool(result.popToolsAndMerge( - InDetBeamSpotRooFitCfg(flags))), + InDetBeamSpotRooFitCfg(flags,jobConfig))), result.addPublicTool(result.popToolsAndMerge( - InDetBeamSpotVertexCfg(flags))) ]) + InDetBeamSpotVertexCfg(flags,jobConfig))) ]) - kwargs.setdefault("VertexTreeName", "Vertices") - kwargs.setdefault("VertexTypes", ["PriVtx"]) + # Job configuration + kwargs.setdefault("OutputLevel",min(3,jobConfig['outputlevel'])) + if 'VertexNtuple' in jobConfig: kwargs.setdefault("VertexNtuple",jobConfig['VertexNtuple']) + if 'WriteAllVertices' in jobConfig: kwargs.setdefault("WriteAllVertices",jobConfig['WriteAllVertices']) + if 'VertexTreeName' in jobConfig: kwargs.setdefault("VertexTreeName",jobConfig['VertexTreeName']) + #Event selection options + if 'UseBCID' in jobConfig: kwargs.setdefault("UseBCID",jobConfig['UseBCID']) + if 'UseFilledBCIDsOnly' in jobConfig: kwargs.setdefault("UseFilledBCIDsOnly",jobConfig['UseFilledBCIDsOnly']) + #Vertex Selection options + if 'VertexContainer' in jobConfig: kwargs.setdefault("VertexContainer",jobConfig['VertexContainer']) + if 'MinTracksPerVtx' in jobConfig: kwargs.setdefault("MinTracksPerVtx",jobConfig['MinTracksPerVtx']) + if 'MaxTracksPerVtx' in jobConfig: kwargs.setdefault("MaxTracksPerVtx",jobConfig['MaxTracksPerVtx']) + if 'MaxVtxNum' in jobConfig: kwargs.setdefault("MaxVtxNum",jobConfig['MaxVtxNum']) + if 'MaxVtxChi2' in jobConfig: kwargs.setdefault("MaxVtxChi2",jobConfig['MaxVtxChi2']) + if 'MaxTransverseErr' in jobConfig: kwargs.setdefault("MaxTransverseErr",jobConfig['MaxTransverseErr']) + if 'VertexTypes' in jobConfig: kwargs.setdefault("VertexTypes",jobConfig['VertexTypes']) + if 'MinVtxProb' in jobConfig: kwargs.setdefault("MinVtxProb",jobConfig['MinVtxProb']) + #Beamspot Sorting options + if 'LumiRange' in jobConfig: kwargs.setdefault("LumiRange",jobConfig['LumiRange']) + if 'RunRange' in jobConfig: kwargs.setdefault("RunRange",jobConfig['RunRange']) + if 'EventRange' in jobConfig: kwargs.setdefault("EventRange",jobConfig['EventRange']) + if 'GroupFitsBy' in jobConfig: kwargs.setdefault("GroupFitsBy",jobConfig['GroupFitsBy']) result.addEventAlgo(CompFactory.InDet.InDetBeamSpotFinder(name, **kwargs)) return result diff --git a/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/scripts/runBeamSpotCalibration.py b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/scripts/runBeamSpotCalibration.py new file mode 100755 index 0000000000000000000000000000000000000000..2cc6ba8c6b3ab9fc953a9bf03b425db0a0216301 --- /dev/null +++ b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/scripts/runBeamSpotCalibration.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from glob import glob + +from AthenaConfiguration.AllConfigFlags import initConfigFlags +flags = initConfigFlags() + +import configMy + +#Job options +if 'outputlevel' not in configMy.jobConfig: configMy.jobConfig['outputlevel'] = 3 +if 'outputfileprefix' not in configMy.jobConfig: configMy.jobConfig['outputfileprefix'] = '' +if 'outputfile' not in configMy.jobConfig: configMy.jobConfig['outputfile'] = configMy.jobConfig['outputfileprefix']+'beamspot.db' +if 'histfile' not in configMy.jobConfig: configMy.jobConfig['histfile'] = configMy.jobConfig['outputfileprefix']+'nt.root' +if 'monfile' not in configMy.jobConfig: configMy.jobConfig['monfile'] = configMy.jobConfig['outputfileprefix']+'beamspotmonitoring.root' +if 'jobpostprocsteps' not in configMy.jobConfig: configMy.jobConfig['jobpostprocsteps'] = 'MergeNt PlotBeamSpot LinkResults AveBeamSpot DQBeamSpot' +if 'doMonitoring' not in configMy.jobConfig: configMy.jobConfig['doMonitoring'] = True +if 'VertexNtuple' not in configMy.jobConfig: configMy.jobConfig['VertexNtuple'] = True +if 'WriteAllVertices' not in configMy.jobConfig: configMy.jobConfig['WriteAllVertices'] = False +if 'VertexTreeName' not in configMy.jobConfig: configMy.jobConfig['VertexTreeName'] = 'Vertices' + +#Event selection options +if 'UseBCID' not in configMy.jobConfig: configMy.jobConfig['UseBCID'] = [] +if 'UseFilledBCIDsOnly' not in configMy.jobConfig: configMy.jobConfig['UseFilledBCIDsOnly'] = True + +#Vertex Selection Options +if 'MinTracksPerVtx' not in configMy.jobConfig: configMy.jobConfig['MinTracksPerVtx'] = 5 +if 'MaxTracksPerVtx' not in configMy.jobConfig: configMy.jobConfig['MaxTracksPerVtx'] = 1000000 +if 'MinVtxNum' not in configMy.jobConfig: configMy.jobConfig['MinVtxNum'] = 100 +if 'MaxVtxChi2' not in configMy.jobConfig: configMy.jobConfig['MaxVtxChi2'] = 10 +if 'MaxTransverseErr' not in configMy.jobConfig: configMy.jobConfig['MaxTransverseErr'] = 1000000 +if 'VertexTypes' not in configMy.jobConfig: configMy.jobConfig['VertexTypes'] = ['PriVtx'] +if 'MinVtxProb' not in configMy.jobConfig: configMy.jobConfig['MinVtxProb'] = .001 +if 'VertexContainer' not in configMy.jobConfig: configMy.jobConfig['VertexContainer'] = 'PrimaryVertices' + +#Options for sorting vertices into fits +if 'LumiRange' not in configMy.jobConfig: configMy.jobConfig['LumiRange'] = 0 +if 'RunRange' not in configMy.jobConfig: configMy.jobConfig['RunRange'] = 0 + +#if 'GroupFitsByBCID' not in configMy.jobConfig: configMy.jobConfig['GroupFitsByBCID'] = False +#if 'GroupFitsByPileup' not in configMy.jobConfig: configMy.jobConfig['GroupFitsByPileup'] = False +if 'GroupFitsBy' not in configMy.jobConfig: configMy.jobConfig['GroupFitsBy'] = 'none' +if 'EventRange' not in configMy.jobConfig: configMy.jobConfig['EventRange'] = 0 + +#Fit Options +if 'InitialKFactor' not in configMy.jobConfig: configMy.jobConfig['InitialKFactor'] = 1.0 +if 'ConstantKFactor' not in configMy.jobConfig: configMy.jobConfig['ConstantKFactor'] = False + +#Fit Options for official fit only +if 'MaxSigmaTr' not in configMy.jobConfig: configMy.jobConfig['MaxSigmaTr'] = 20. +if 'MaxSigmaVtx' not in configMy.jobConfig: configMy.jobConfig['MaxSigmaVtx'] = 2.0 +if 'TruncatedRMS' not in configMy.jobConfig: configMy.jobConfig['TruncatedRMS'] = True +if 'SetInitialRMS' not in configMy.jobConfig: configMy.jobConfig['SetInitialRMS'] = False +if 'OutlierChi2Tr' not in configMy.jobConfig: configMy.jobConfig['OutlierChi2Tr'] = 20. +if 'BeamSpotToolList' not in configMy.jobConfig: configMy.jobConfig['BeamSpotToolList'] = ['InDetBeamSpotRooFit','InDetBeamSpotVertex'] +if 'FixWidth' not in configMy.jobConfig: configMy.jobConfig['FixWidth'] = False + +#Fit Options for RooFit only +if 'RooFitMaxTransverseErr' not in configMy.jobConfig: configMy.jobConfig['RooFitMaxTransverseErr'] = 0.05 + +#Job options for Monitoring algorithm +if 'MinTrackPt' not in configMy.jobConfig: configMy.jobConfig['MinTrackPt'] = 500. +if 'useBeamSpot' not in configMy.jobConfig: + # change to True as soon as I have PrimaryVertexMonitoring in as well + configMy.jobConfig['useBeamSpot'] = configMy.jobConfig.get('beamspottag','')!='' or configMy.jobConfig.get('beamspotfile','')!='' + +print("job configuration: ",configMy.jobConfig) + +flags.Exec.OutputLevel = configMy.jobConfig['outputlevel'] + +flags.Input.Files = [] +for path in configMy.jobConfig['inputfiles']: + print("path: ",path) + print("glob: ",glob(path)) + flags.Input.Files += glob(path) + +flags.Trigger.triggerConfig = "DB" +flags.DQ.enableLumiAccess = False +flags.Output.HISTFileName = configMy.jobConfig['monfile'] +flags.lock() + +from AthenaConfiguration.MainServicesConfig import MainServicesCfg +acc = MainServicesCfg(flags) +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +acc.merge(PoolReadCfg(flags)) + +from InDetBeamSpotFinder.InDetBeamSpotFinderConfig import InDetBeamSpotFinderCfg +acc.merge(InDetBeamSpotFinderCfg(flags,configMy.jobConfig)) + +from AthenaConfiguration.ComponentFactory import CompFactory +acc.addService(CompFactory.THistSvc( + Output = ["INDETBEAMSPOTFINDER DATAFILE='%s' OPT='RECREATE'" % configMy.jobConfig['histfile']])) + +if configMy.jobConfig['doMonitoring']: + from AthenaMonitoring import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(flags, "BeamSpotMonitoring") + from InDetGlobalMonitoringRun3Test.InDetGlobalBeamSpotMonAlgCfg import ( + InDetGlobalBeamSpotMonAlgCfg ) + InDetGlobalBeamSpotMonAlgCfg(helper, acc, flags,configMy.jobConfig) + acc.merge(helper.result()) + +acc.printConfig(withDetails=True) + +# Execute and finish +sc = acc.run() + +# Success should be 0 +import sys +sys.exit(not sc.isSuccess()) + + + + diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamSpotT0_Vertex_tf.py b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamSpotT0_Vertex_tf.py index 09cf80ddb6ce0805ec847cedabc259e8a3732267..b5c671d124aa3c02a58179754734defb935822bb 100755 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamSpotT0_Vertex_tf.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamSpotT0_Vertex_tf.py @@ -43,7 +43,7 @@ def main(): trf.setProdTaskDatabase(taskDb) trf.setProdDir(taskDir) - trf.getJobRunner(joboptionpath='InDetBeamSpotExample/VertexTemplate.py', + trf.getJobRunner(joboptionpath='runBeamSpotCalibration.py', autoconfparams='DetDescrVersion', taskpostprocsteps=taskPostProcSteps, comment=cmd) diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamspotman.py b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamspotman.py index fd2338575f3f519b0133eb848328ab239bbd9006..17140ea46e4953ec433eb00e50d3d48914547ba7 100755 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamspotman.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/beamspotman.py @@ -907,8 +907,11 @@ if cmd=='runMonJobs' and len(args)<3: paramValues = '' if options.params: paramValues = '--params \''+options.params+'\'' + testFlag = '' + if options.testonly: + testFlag = '--test' - cmd = 'beamspotman --eospath=%s -p %s -s %s -f \'.*\\.%s\\..*\' -t %s --queue %s %s --montaskname %s runMon %i %s' % (eospath,ptag,stream,filter,bstag,queue,paramValues,monTaskName,int(runnr),datatag) + cmd = 'beamspotman --eospath=%s -p %s -s %s -f \'.*\\.%s\\..*\' -t %s --queue %s %s %s --montaskname %s runMon %i %s' % (eospath,ptag,stream,filter,bstag,queue,paramValues,testFlag,monTaskName,int(runnr),datatag) print (cmd) sys.stdout.flush() status = os.system(cmd) >> 8 # Convert to standard Unix exit code diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/plotBeamSpotMon.py b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/plotBeamSpotMon.py index 433f1d909c4779ffcda831fbe52dbc2f7764fab2..b87ea194a63e10f10579d7b1945db12014553d0d 100755 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/bin/plotBeamSpotMon.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/bin/plotBeamSpotMon.py @@ -66,6 +66,7 @@ c.Divide(3,4) # Open monitoring file mon = ROOT.TFile(filename) mondir = 'InDetGlobal/BeamSpot/' +mondirCA = 'run_'+run+'/InDetGlobal/BeamSpot/' # Summary frame @@ -89,6 +90,8 @@ for hname in ['trkDPhi', 'trkDPhiCorr', print ('Processing histogram',hname) ROOT.gStyle.SetOptStat(hDef[hname].get('stats',0)) h = mon.Get(mondir+hname) + if h == None: + h = mon.Get(mondirCA+hname) if h != None: h.Draw(hDef[hname].get('opts','')) else: diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/python/JobRunner.py b/InnerDetector/InDetExample/InDetBeamSpotExample/python/JobRunner.py index 03d487e5103b30335382e1944052aa7ea397f44b..18f027c4f0c730062642c29dc195d45f8748ac90 100644 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/python/JobRunner.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/python/JobRunner.py @@ -46,7 +46,10 @@ echo "Creating POOL file catalog (`date`) ..." %(cmddefinepoolcatalog)s echo '' echo "Running athena (`date`) ..." -/usr/bin/time -p athena.py %(configfile)s %(joboptionpath)s +export PYTHONPATH="%(jobdir)s:$PYTHONPATH" +rm -f %(configmy)s +ln -fs %(configfile)s %(configmy)s +/usr/bin/time -p %(joboptionpath)s status=$? touch %(exitflag)s echo $status > %(exitstatus)s @@ -114,6 +117,7 @@ class JobRunner: self.setParam('jobdir',os.getcwd(),'Directory template from where the jobs are started') self.setParam('rundir','.','Directory template where the jobs execute') self.setParam('configfile','%(jobdir)s/%(jobname)s.config.py','Job configuration file name template (use %(jobnr)i for current job number)') + self.setParam('configmy','%(jobdir)s/configMy.py','Job configuration file for CA configuration') self.setParam('logfile','%(jobdir)s/%(jobname)s.log','Log file name template') self.setParam('scriptfile','%(jobdir)s/%(jobname)s.sh','Script file name template') self.setParam('outputfileprefix','%(jobdir)s/%(jobname)s-','Output file name prefix template') diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py index 0df181209e44021d188965531e421d54db456193..d1fb84e4b7cbb7f5f79c54550d19c6c702cbcaee 100644 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalBeamSpotMonAlgCfg.py @@ -11,11 +11,11 @@ from AthenaConfiguration.ComponentFactory import CompFactory -def HistoInDetGlobalBeamSpotMonAlgCfg(helper, alg): +def HistoInDetGlobalBeamSpotMonAlgCfg(helper, alg, useBeamSpot=False): '''Function to configures some algorithms in the monitoring system.''' # Values set by default here - m_useBeamspot = True + m_useBeamspot = useBeamSpot expert = True m_vxContainerWithBeamConstraint = False @@ -61,9 +61,9 @@ def HistoInDetGlobalBeamSpotMonAlgCfg(helper, alg): else: varName = 'm_pvXbeam;pvX' bsGroup.defineHistogram(varName, type="TH1F", title="Primary vertex: x;x (mm)",path=pathbs,xbins=100,xmin=-10,xmax=10) - varName = 'm_pvXbeam;pvX' + varName = 'm_pvYbeam;pvY' bsGroup.defineHistogram(varName, type="TH1F", title="Primary vertex: y;y (mm)",path=pathbs,xbins=100,xmin=-10,xmax=10) - varName = 'm_pvXbeam;pvX' + varName = 'm_pvZbeam;pvZ' bsGroup.defineHistogram(varName, type="TH1F", title="Primary vertex: z;z (mm)",path=pathbs,xbins=100,xmin=-500,xmax=500) @@ -101,17 +101,24 @@ def HistoInDetGlobalBeamSpotMonAlgCfg(helper, alg): def InDetGlobalBeamSpotMonAlgCfg(helper, acc, - flags, name="InDetGlobalBeamSpotMonAlg", **kwargs): + flags, jobConfig={}, name="InDetGlobalBeamSpotMonAlg", **kwargs): from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg acc.merge(BeamSpotCondAlgCfg(flags)) from AthenaMonitoring.FilledBunchFilterToolConfig import FilledBunchFilterToolCfg from AthenaMonitoring.AtlasReadyFilterConfig import AtlasReadyFilterCfg + if 'MinTracksPerVtx' in jobConfig: kwargs.setdefault("minTracksPerVtx",jobConfig['MinTracksPerVtx']) + if 'MinTrackPt' in jobConfig: kwargs.setdefault("minTrackPt",jobConfig['MinTrackPt']) + useBeamSpot = False + if 'useBeamSpot' in jobConfig: + kwargs.setdefault("useBeamspot",jobConfig['useBeamSpot']) + useBeamSpot = jobConfig['useBeamSpot'] + monAlg = helper.addAlgorithm( CompFactory.InDetGlobalBeamSpotMonAlg, name, addFilterTools = [FilledBunchFilterToolCfg(flags), AtlasReadyFilterCfg(flags)], **kwargs) - HistoInDetGlobalBeamSpotMonAlgCfg(helper, monAlg) + HistoInDetGlobalBeamSpotMonAlgCfg(helper, monAlg, useBeamSpot) return diff --git a/LArCalorimeter/LArBadChannelTool/share/LArBuildBadChannelDB.sh b/LArCalorimeter/LArBadChannelTool/share/LArBuildBadChannelDB.sh index 28301c80bf88205848cd45056f205a10b610eea0..2c26e97aed97b6b190e4edb39b29df3f4ffc94cc 100755 --- a/LArCalorimeter/LArBadChannelTool/share/LArBuildBadChannelDB.sh +++ b/LArCalorimeter/LArBadChannelTool/share/LArBuildBadChannelDB.sh @@ -48,7 +48,8 @@ fi if [ $issc == 0 ] then echo "Resolving current folder-level tag suffix for /LAR/BadChannelsOfl/BadChannels...." - fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/BadChannelsOfl/BadChannels` + #fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/BadChannelsOfl/BadChannels` + fulltag=`getCurrentFolderTag.py "frontier://ATLF/();schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2" /LAR/BadChannelsOfl/BadChannels` if [ $? -ne 0 ] then exit 1 @@ -60,7 +61,8 @@ then upd3TagName="RUN2-UPD3-00" else echo "Resolving current folder-level tag suffix for /LAR/BadChannelsOfl/BadChannelsSC...." - fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/BadChannelsOfl/BadChannelsSC` + #fulltag=`getCurrentFolderTag.py "COOLOFL_LAR/CONDBR2" /LAR/BadChannelsOfl/BadChannelsSC` + fulltag=`getCurrentFolderTag.py "frontier://ATLF/();schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2" /LAR/BadChannelsOfl/BadChannelsSC` if [ $? -ne 0 ] then exit 1 diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h index 5925e8805983a5c1190abf8e53b1b5a6f4e7ba05..e9ad32988c8bc9e9e5f89ecae580ea3dd38125a2 100644 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArDigits2Ntuple.h @@ -28,6 +28,9 @@ class LArDigits2Ntuple : public LArCond2NtupleBase Gaudi::Property< unsigned int > m_Nsamples{this, "NSamples", 32, "number of samples to store"}; Gaudi::Property< std::vector<unsigned int> > m_FTlist{this, "FTlist", {}, "which FT to dump"}; + Gaudi::Property< std::vector<unsigned int> > m_Slotlist{this, "Slotlist", {}, "which Slot to dump"}; + Gaudi::Property< bool > m_fillEMB{this, "FillEMB", true, "if to fill EMB"}; + Gaudi::Property< bool > m_fillEndcap{this, "FillEndcap", true, "if to fill Eendcap"}; Gaudi::Property< bool > m_fillBCID{this, "FillBCID", false, "if to fill BCID"}; Gaudi::Property< bool > m_fillLB{this, "FillLB", false, "if to fill LB in Evnt tree"}; diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArPhysWaveFromStdNtuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArPhysWaveFromStdNtuple.h index 321324dc769130d5bd0d2e02bf1aeedc6de1a878..c9c3cfbdb939a22208a151ee4550625a856f57b9 100755 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArPhysWaveFromStdNtuple.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArPhysWaveFromStdNtuple.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef LARPHYSWAVEFROMSTDNTUPLE_H @@ -26,29 +26,26 @@ class LArPhysWaveFromStdNtuple : public AthAlgorithm ~LArPhysWaveFromStdNtuple(); //standard algorithm methods - /// implements IAlgorithm::initialize() - StatusCode initialize() ; - - /// implements IAlgorithm::execute() : Does nothing + StatusCode initialize() {return StatusCode::SUCCESS;} StatusCode execute() {return StatusCode::SUCCESS;} - - /// IAlgorithm::finalize() : Where the action takes place... StatusCode finalize(){return StatusCode::SUCCESS;} StatusCode stop(); private: /// the first m_skipPoints points of the waveform in the ntuple are skipped - unsigned int m_skipPoints; + Gaudi::Property< unsigned int > m_skipPoints{this, "SkipPoints", 0}; /// make a PhysWave with the first m_prefixPoints as zeros - unsigned int m_prefixPoints; + Gaudi::Property< unsigned int > m_prefixPoints{this, "PrefixPoints", 0}; /// list of input ntuple file names - std::vector<std::string> m_root_file_names; + Gaudi::Property< std::vector<std::string> > m_root_file_names{this, "FileNames", {}, "Input root file names" }; /// ntuple name - std::string m_ntuple_name; + Gaudi::Property< std::string > m_ntuple_name{this, "NtupleName", "PhysWave"}; /// key of the PhysWave collection in Storegate - std::string m_store_key; + Gaudi::Property< std::string > m_store_key{this, "StoreKey", "FromStdNtuple", "SG key to create"}; /// Grouping type. Default is Feedthrough. - std::string m_groupingType; + Gaudi::Property< std::string > m_groupingType{this,"GroupingType", "ExtendedFeedThrough", "Which COOL channel grouping to use"}; + /// is SC ? + Gaudi::Property< bool > m_isSC{this,"isSC",false,"Running for SuperCells ?"}; }; #endif diff --git a/LArCalorimeter/LArCalibTools/python/LArCalib_HVScale2NtupleConfig.py b/LArCalorimeter/LArCalibTools/python/LArCalib_HVScale2NtupleConfig.py index 668caefddb998f0da507bc02e57d45538cde4a28..14b28ef5971d08b4f6dde7a0350dd924eca9fd1b 100644 --- a/LArCalorimeter/LArCalibTools/python/LArCalib_HVScale2NtupleConfig.py +++ b/LArCalorimeter/LArCalibTools/python/LArCalib_HVScale2NtupleConfig.py @@ -68,6 +68,8 @@ if __name__=="__main__": flags.Input.TimeStamps=[TimeStamp] flags.Input.Files=[] flags.IOVDb.DatabaseInstance="CONDBR2" + from AthenaConfiguration.TestDefaults import defaultGeometryTags + flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3 rootfile="hvcorr_read.root" if len(sys.argv)>2: diff --git a/LArCalorimeter/LArCalibTools/python/LArPhysWaveFromStdNtupleConfig.py b/LArCalorimeter/LArCalibTools/python/LArPhysWaveFromStdNtupleConfig.py new file mode 100755 index 0000000000000000000000000000000000000000..b610f159902949039112919a3a619414bb5ff2ff --- /dev/null +++ b/LArCalorimeter/LArCalibTools/python/LArPhysWaveFromStdNtupleConfig.py @@ -0,0 +1,108 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + + +def LArPhysWaveFromStdNtupleCfg(flags,InputRootFile='PhysWave_HECIdeal.root', + OutputTag='-calib-02', **kwargs): + + cfg=ComponentAccumulator() + from AthenaCommon.Logging import logging + mlog = logging.getLogger( 'LArPhysWaveFromStdNtuple' ) + if not flags.hasCategory('LArCalib'): + mlog.error("We need the LArCalib flags") + return cfg + + if flags.LArCalib.isSC: + mlog.info("Running for SC") + + from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg + cfg.merge(LArCalibBaseCfg(flags)) + + from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg + cfg.merge(LArOnOffIdMappingCfg(flags)) + + if 'NtupleName' not in kwargs: + kwargs.setdefault('NtupleName', 'PHYSWAVE') + if 'SkipPoints' not in kwargs: + kwargs.setdefault('SkipPoints', 0) + if 'PrefixPoints' not in kwargs: + kwargs.setdefault('PrefixPoints', 0) + if 'StoreKey' not in kwargs: + kwargs.setdefault('StoreKey', 'LArPhysWaveHECIdeal') + + algo = CompFactory.LArPhysWaveFromStdNtuple("LArPhysWaveFromStdNtuple", **kwargs) + algo.FileNames = [InputRootFile] + algo.GroupingType = flags.LArCalib.GroupingType + algo.isSC = flags.LArCalib.isSC + + cfg.addEventAlgo(algo) + + if flags.LArCalib.Output.ROOTFile != "": + + ntdump = CompFactory.LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) + ntdump.NtupleName = "PHYSWAVE" + ntdump.KeyList = [ kwargs['StoreKey'] ] + ntdump.SaveDerivedInfo = True + if flags.LArCalib.isSC: + ntdump.isSC = flags.LArCalib.isSC + ntdump.BadChanKey = "LArBadChannelSC" + + cfg.addEventAlgo(ntdump) + + cfg.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+flags.LArCalib.Output.ROOTFile+"' OPT='NEW'" ])) + cfg.setAppProperty("HistogramPersistency","ROOT") + + if ( flags.LArCalib.Output.POOLFile != "" ): + + OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+kwargs['StoreKey']+"#"+ flags.LArCalib.PhysWave.Folder + OutputObjectSpecTagPhysWave = ''.join(flags.LArCalib.PhysWave.Folder.split('/')) + OutputTag + + from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg + cfg.merge(OutputConditionsAlgCfg(flags, + outputFile=flags.LArCalib.Output.POOLFile, + ObjectList=[OutputObjectSpecPhysWave], + IOVTagList=[OutputObjectSpecTagPhysWave], + Run1=flags.LArCalib.IOVStart, + Run2=flags.LArCalib.IOVEnd + )) + + cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True)) + + + cfg.getService("IOVDbSvc").DBInstance="" + + return cfg + + +if __name__ == "__main__": + + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + from AthenaConfiguration.AllConfigFlags import initConfigFlags + from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags + flags=initConfigFlags() + addLArCalibFlags(flags,isSC=True) + + flags.Input.Files=[] + flags.Input.RunNumber=[440000,] + flags.Input.ConditionsRunNumber=440000 + flags.Input.OverrideRunNumber=True + + flags.LArCalib.PhysWave.Folder="/LAR/ElecCalibOflSC/PhysWaves/HECIdeal" + flags.LArCalib.Output.ROOTFile="LArPhysWave_HEC_SC.root" + flags.LArCalib.Output.POOLFile="LArPhysWave_HEC_SC.pool.root" + flags.LArCalib.GroupingType="SuperCells" + flags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDBR2" + flags.IOVDb.GlobalTag="LARCALIB-RUN2-00" + flags.IOVDb.DatabaseInstance="CONDBR2" + + flags.fillFromArgs() + flags.lock() + + + cfg=MainServicesCfg(flags) + cfg.merge(LArPhysWaveFromStdNtupleCfg(flags,InputRootFile="PhysWave_HECSCIdeal.root",NtupleName="SCSUM")) + + cfg.run(1) + diff --git a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index 906d58e92c09671cbf17e012b73abc0cece0411b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,167 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'PhysWavePOOLFileOUT' in dir(): - PhysWavePOOLFileOUT = "LArPhysWave_0_HEC.pool.root" - -if not 'PhysWaveNTFileOUT' in dir(): - PhysWaveNTFileOUT = "LArPhysWave_0_HEC_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'PhysWaveNTFileIN' in dir(): - PhysWaveNTFileIN = "LArPhysWave_0_HEC.root" - -if not 'OutputKey' in dir(): - OutputKey = "LArPhysWaveHECIdeal" - -if not 'OutputFolder' in dir(): - OutputFolder="/LAR/ElecCalibOfl/PhysWaves/HECIdeal" - -if not 'OutputTag' in dir(): - OutputTag="comm-08" - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include( "LArCalibProcessing/LArCalib_MinimalSetup.py") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=COMP200" - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArPhysWaveFromStdNtuple -LArPhysWaveFromTuple = LArPhysWaveFromStdNtuple() -LArPhysWaveFromTuple.SkipPoints = 0 -LArPhysWaveFromTuple.PrefixPoints = 0 -LArPhysWaveFromTuple.FileNames = [ PhysWaveNTFileIN ] -LArPhysWaveFromTuple.StoreKey = OutputKey -LArPhysWaveFromTuple.GroupingType = GroupingType - -topSequence += LArPhysWaveFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - # LArPhysWaves2Ntuple.ReadCaliWave = False - LArPhysWaves2Ntuple.KeyList = [ OutputKey ] - LArPhysWaves2Ntuple.SaveDerivedInfo = True - - topSequence += LArPhysWaves2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+PhysWaveNTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+OutputKey+"#"+ OutputFolder - OutputObjectSpecTagPhysWave = LArCalibFolderTag(OutputFolder,OutputTag) - - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",PhysWavePOOLFileOUT, - [OutputObjectSpecPhysWave],[OutputObjectSpecTagPhysWave],True) - - theOutputConditionsAlg.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx index 38658f913cf1e08a2965e7a80bcc35f23626f039..58b9bdab5926715be1926491972dc6436caa4081 100644 --- a/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArDigits2Ntuple.cxx @@ -186,12 +186,20 @@ StatusCode LArDigits2Ntuple::execute() fillFromIdentifier(digi->hardwareID()); + if(m_fillEMB && m_barrel_ec !=0) continue; + if(m_fillEndcap && m_barrel_ec !=1) continue; + if(m_FTlist.size() > 0) { // should do a selection if(std::find(std::begin(m_FTlist), std::end(m_FTlist), m_FT) == std::end(m_FTlist)) { // is our FT in list ? continue; } } + if(m_Slotlist.size() > 0) { // should do a selection + if(std::find(std::begin(m_Slotlist), std::end(m_Slotlist), m_slot) == std::end(m_Slotlist)) { // is our slot in list ? + continue; + } + } for(unsigned i = 0; i<trueMaxSample;++i) m_samples[i] = digi->samples().at(i); diff --git a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx index bbce2f7f72485613eadf38b1156bae7f4feebb3e..717532af8824445c6a5a158d7c2b30f39068480f 100755 --- a/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArPhysWaveFromStdNtuple.cxx @@ -1,10 +1,11 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "LArCalibTools/LArPhysWaveFromStdNtuple.h" #include "LArIdentifier/LArOnlineID.h" +#include "LArIdentifier/LArOnline_SuperCellID.h" #include "CaloIdentifier/CaloGain.h" #include "LArRawConditions/LArPhysWave.h" #include "LArRawConditions/LArPhysWaveContainer.h" @@ -19,35 +20,27 @@ #include <fstream> #include <string> +LArPhysWaveFromStdNtuple::LArPhysWaveFromStdNtuple(const std::string & name, ISvcLocator * pSvcLocator):AthAlgorithm(name, pSvcLocator) {}; -LArPhysWaveFromStdNtuple::LArPhysWaveFromStdNtuple (const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) -{ - declareProperty("SkipPoints", m_skipPoints = 0); - declareProperty("PrefixPoints", m_prefixPoints = 0); - declareProperty("FileNames", m_root_file_names); - declareProperty("NtupleName", m_ntuple_name="PhysWave"); - declareProperty("StoreKey", m_store_key="FromStdNtuple"); - declareProperty("GroupingType", m_groupingType="FeedThrough"); -} - -LArPhysWaveFromStdNtuple::~LArPhysWaveFromStdNtuple() -= default; - -StatusCode LArPhysWaveFromStdNtuple::initialize() -{ - return StatusCode::SUCCESS ; -} - +LArPhysWaveFromStdNtuple::~LArPhysWaveFromStdNtuple()= default; StatusCode LArPhysWaveFromStdNtuple::stop() { ATH_MSG_INFO ( "... in stop()" ); // get LArOnlineID helper - const LArOnlineID* onlineHelper = nullptr; - ATH_CHECK( detStore()->retrieve(onlineHelper, "LArOnlineID") ); + const LArOnlineID_Base* onlineHelper = nullptr; + if(m_isSC) { + const LArOnline_SuperCellID* onltmp; + ATH_CHECK( detStore()->retrieve(onltmp, "LArOnline_SuperCellID") ); + onlineHelper = (const LArOnlineID_Base*) onltmp; + } else { + const LArOnlineID* onltmp = nullptr; + ATH_CHECK( detStore()->retrieve(onltmp, "LArOnlineID") ); + onlineHelper = (const LArOnlineID_Base*) onltmp; + } - TChain* outfit = new TChain(m_ntuple_name.c_str()); + TChain* outfit = new TChain(m_ntuple_name.value().c_str()); for (const std::string& s : m_root_file_names) { outfit->Add(s.c_str()); } @@ -89,6 +82,7 @@ StatusCode LArPhysWaveFromStdNtuple::stop() for ( Long64_t i = 0; i < nentries; i++ ) { outfit->GetEvent(i); + if(m_isSC && gain >0) continue; ATH_MSG_INFO ( " Chan " << std::hex << channelId << std::dec ); hwid = channelId; diff --git a/LArCalorimeter/LArCalibTools/src/LArPhysWaves2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArPhysWaves2Ntuple.cxx index 094bee4721138f832b964042f095fd17e86d337a..efadbeecff6c1ae795558762afb0b6d443f00058 100644 --- a/LArCalorimeter/LArCalibTools/src/LArPhysWaves2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArPhysWaves2Ntuple.cxx @@ -20,7 +20,7 @@ LArPhysWaves2Ntuple::~LArPhysWaves2Ntuple() StatusCode LArPhysWaves2Ntuple::initialize() { - m_ntTitle="Calibration Wave"; + m_ntTitle="Physics Wave"; m_ntpath=std::string("/NTUPLES/FILE1/")+m_ntName; return LArWaves2Ntuple::initialize(); } diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py index f0a906819f2e70703528fdb4a571679ed8e33924..6cc39ca44595cd5e3418eedc31bd2e1a4643b96a 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py @@ -6,6 +6,7 @@ def addLArCalibFlags(flags, isSC=False): flags.addFlag("LArCalib.isSC",isSC) flags.addFlag("LArCalib.BadChannelDB","LAR_OFL") flags.addFlag("LArCalib.BadChannelTag","-RUN2-UPD3-00") + flags.addFlag("LArCalib.BadChannelTagSC","-RUN3-UPD3-00") #Folders: def _prefix(prevFlags): diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py index e6465dcae51c9acf10e6d9c042cca2b79bd89b8a..4ddde3c80ea8172498dce167220adac784751d95 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py @@ -21,7 +21,7 @@ def LArCalibBadChannelCfg(flags): theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=foldername) else: foldername="/LAR/BadChannelsOfl/BadChannelsSC" - foldertag="".join(foldername.split("/"))+flags.LArCalib.BadChannelTag + foldertag="".join(foldername.split("/"))+flags.LArCalib.BadChannelTagSC result.merge(addFolders(flags,foldername+"<tag>"+foldertag+"</tag>",flags.LArCalib.BadChannelDB, className="CondAttrListCollection")) theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=foldername, isSC=flags.LArCalib.isSC, diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_HVCorrConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_HVCorrConfig.py index 8f60fa40bb14a8b9126bf395b0f9063b6d34dfe3..be1935d23555b94dc468f6c28585c7c71f88c349 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_HVCorrConfig.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_HVCorrConfig.py @@ -21,7 +21,7 @@ def HVCorrConfig(flags,outputName="hvcorr",runOut=0, lbOut=0): result.addEventAlgo(CompFactory.LArHVCorrMaker(LArHVScaleCorr="NewLArHVScaleCorr")) #Ntuple writing ... - from LArCalibProcessing.LArCalib_HVScale2NtupleConfig import LArHVScaleCorr2NtupleCfg + from LArCalibTools.LArCalib_HVScale2NtupleConfig import LArHVScaleCorr2NtupleCfg result.merge(LArHVScaleCorr2NtupleCfg(flags,rootfile=outputName+'.root')) result.getEventAlgo("LArHVScaleCorr2Ntuple").ContainerKey="NewLArHVScaleCorr" diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ApplyShapeResiduals_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ApplyShapeResiduals_jobOptions.py deleted file mode 100644 index 4a8c5c0fea29f4f3547ec33f4d43f5da24248537..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ApplyShapeResiduals_jobOptions.py +++ /dev/null @@ -1,138 +0,0 @@ -########################################################################### -# -# TopOptions to copy a complete set of conditions for a given run to -# one POOL file and one sqlite file -# -# Walter.Lampl@cern.ch -# -########################################################################### - - -import os,sys -from LArCalibProcessing.extractFolderInfo import * - -if 'dbname' not in dir(): - dbname="CONDBR2" - -if 'sqliteIn' not in dir(): - sqliteIn="freshConstants.db" - -if 'sqliteOut' not in dir(): - sqliteOut=sqliteIn+".out" - -inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname -outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname - - -if os.environ.has_key("CALIBMERGE_PEEKRUN"): - peekrun=int(os.environ["CALIBMERGE_PEEKRUN"]) -else: - peekrun=2147483647 - -printfunc ("Peeking input database at run",peekrun) - -if not "ShapeFolder" in dir(): - ShapeFolder="/LAR/ElecCalibOfl/Shape/RTM/5samples1phase" - -if not 'ShapeResidualsFolder' in dir() : - ShapeResidualsFolder = "/LAR/ElecCalibOfl/Shape/Residuals/5samples" - - -if 'ShapeResidualsTag' in dir() : - shapeResidualTag="<tag>"+ShapeResidualsTag+"</tag>" -else: - shapeResidualTag="" - -folderInfo=extractFolderInfo(inputDB,checkFolders=[ShapeFolder,],runnumber=peekrun) -printfunc (folderInfo) - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -theApp.EvtMax = 1 -conddb.setGlobalTag("LARCALIB-000-02") #For id mapping and wave residuals - -svcMgr.PoolSvc.SortReplicas=False -svcMgr.PoolSvc.FileOpen="update" - -runNoForFileName=2147483647 - -if len(folderInfo)==0: - printfunc ("ERROR, No input shape found in input db",inputDB,"folder",ShapeFolder) - sys.exit(-1) - pass - -if len(folderInfo)>1: - printfunc ("WARNING, More than one input shape object found in input db",inputDB,"folder",ShapeFolder) - pass - -f=folderInfo[0] -fn=f[0] -type=f[1] -key=f[2] -tag=f[3] -since=f[4] -until=f[5] -printfunc ("Working on folder",fn,"IOV:",since,"-",until) - -tagTokens=tag.split('-') -tagTokens[0]+="corr" -outTag="-".join(tagTokens) - -if since>0 and since<runNoForFileName: - runNoForFileName=since - pass - -IOVBegin=since - -outObjects=["#".join((type,key,fn)),] -outTags=[outTag,] -conddb.addFolder("",fn+"<tag>"+tag+"</tag><db>"+inputDB+"</db><key>"+key+"In</key>") - -svcMgr.EventSelector.RunNumber = peekrun - -if "OutputFile" not in dir(): - OutputFile="LArConditionsRec_"+str(runNoForFileName)+".pool.root" - -printfunc (outObjects) -printfunc (outTags) - -from LArCalibTools.LArCalibToolsConf import LArBlockCorrections -topSequence+=LArBlockCorrections() - -from LArCalibUtils.LArCalibUtilsConf import LArShapeCorrector -theLArShapeCorrector=LArShapeCorrector(KeyShape=key+"In",KeyShape_newcorr=key,OutputLevel=DEBUG) -topSequence+=theLArShapeCorrector - -conddb.addFolder("LAR_OFL",ShapeResidualsFolder+shapeResidualTag) - - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - -theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlgCorr",OutputFile, - outObjects,outTags,True) - -theOutputConditionsAlg.Run1 = IOVBegin - -svcMgr.IOVDbSvc.dbConnection = outputDB -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.RecreateFolders = False -svcMgr.IOVRegistrationSvc.OutputLevel=DEBUG -svcMgr.DetectorStore.Dump=True - - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat - - -svcMgr.IOVDbSvc.DBInstance="" -#svcMgr.IOVDbSvc.OutputLevel=DEBUG -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_AutoCorrPhys_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_AutoCorrPhys_jobOptions.py deleted file mode 100644 index e9a47c407103b8907a69f88548e6dace0738311a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_AutoCorrPhys_jobOptions.py +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -#Job Opts to compute AutoCorrelation based on a zero-bias physics run. - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -athenaCommonFlags.FilesInput=["data11_7TeV.00190256.physics_ZeroBias.merge.RAW._lb0340._SFO-ALL._0001.1","data11_7TeV.00190256.physics_ZeroBias.merge.RAW._lb0341._SFO-ALL._0001.1",] - - -if not 'RunNumberList' in dir(): - from PyUtils.MetaReaderPeeker import metadata - RunNumberList = metadata['runNumbers'] - -#LArCalibFolderOutputTag="-UPD3-00" - -if not 'EventsRef' in dir(): - EventsRef = 10 - -if not 'NSigma' in dir(): - NSigma = 5 - -if not 'NSamples' in dir(): - NSamples = 7 - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -include("LArCalibProcessing/LArCalib_Flags.py") - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = min(RunNumberList) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = "-UPD3-00" - -if not 'LArAutoCorrPhysFolder' in dir(): - LArAutoCorrPhysFolder = "/LAR/ElecCalibOfl/AutoCorrPhys" - -if not 'LArAutoCorrPhysKey' in dir(): - LArAutoCorrPhysKey = "LArAutoCorr" - -if not 'OutputAutoCorrRootFileDir' in dir(): - OutputAutoCorrRootFileDir = "." - -if not 'OutputAutoCorrPoolFileDir' in dir(): - OutputAutoCorrPoolFileDir = "." - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutputAC' in dir(): - KeyOutputAC = "LArAutoCorr" - -if not 'BaseFileNameAutoCorr' in dir(): - BaseFileNameAutoCorr = "LArAutoCorr" - -for RunNumber in RunNumberList: - BaseFileNameAutoCorr = BaseFileNameAutoCorr + "_" + str(RunNumber) - -if not 'OutputAutoCorrPoolFileName' in dir(): - OutputAutoCorrPoolFileName = BaseFileNameAutoCorr + ".pool.root" - -if not 'OutputAutoCorrRootFileName' in dir(): - OutputAutoCorrRootFileName = BaseFileNameAutoCorr + ".root" - - -if not 'OutputSQLiteFile' in dir(): - OutputSQLiteFile = BaseFileNameAutoCorr +".db" - -OutputDB="sqlite://;schema="+OutputSQLiteFile+";dbname=CONDBR2" - -# FIXME : fix name and folder and tag -if not 'OutputObjectSpecAutoCorr' in dir(): - OutputObjectSpecAutoCorr = "LArAutoCorrComplete#"+LArAutoCorrPhysKey+"#"+LArAutoCorrPhysFolder - OutputTagSpecAutoCorr=LArCalibFolderTag(LArAutoCorrPhysFolder,LArCalibFolderOutputTag) - - -####################################################################################### -# print summary -####################################################################################### - -PedestalAutoCorrLog = logging.getLogger( "PedestalAutoCorrLog" ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " *** LAr Pedestal/AutoCorr summary *** " ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " RunNumber = "+str(RunNumberList) ) -#PedestalAutoCorrLog.info( " LArGain = "+str(GainList) ) -PedestalAutoCorrLog.info( " OutputAutoCorrPoolFullFileName = "+OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName ) -PedestalAutoCorrLog.info( " OutputObjectSpecAutoCorr = "+OutputObjectSpecAutoCorr ) -PedestalAutoCorrLog.info( " OutputTagSpecAutoCorr = "+OutputTagSpecAutoCorr ) -PedestalAutoCorrLog.info( " IOVBegin = "+str(IOVBegin) ) -PedestalAutoCorrLog.info( " IOVEnd = "+str(IOVEnd) ) -PedestalAutoCorrLog.info( " LArCalibOutputDB = "+OutputDB ) -PedestalAutoCorrLog.info( " ======================================================== " ) - -####################################################################################### -include ("LArConditionsCommon/LArMinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = "COMCOND-ES1PST-005-04" -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -svcMgr.EventSelector.Input=athenaCommonFlags.FilesInput() - -theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc -theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] -theByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/FREE"] - - -# Get Electronics noise values for Pedestal(RMS), AutoCorr and ramps - -## The reference is the Oracle DB -include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") -selection="" -conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Pedestal<key>PedestalElec</key>"+selection) -conddb.addFolder("LAR_OFL","/LAR/ElecCalibOfl/AutoCorrs/AutoCorr<key>LArAutoCorrElec</key><tag>LARElecCalibOflAutoCorrsAutoCorr-UPD3-00</tag>"+selection) - -from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter -cfg = TriggerConfigGetter() - -# BunchCrossing info -from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault -BunchCrossingCondAlgDefault() - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrMaker -LArAutoCorrMaker=LArAutoCorrMaker("LArAutoCorrMaker") -LArAutoCorrMaker.KeyList = ["FREE"] -LArAutoCorrMaker.events_ref = EventsRef -LArAutoCorrMaker.nsigma = NSigma -LArAutoCorrMaker.KeyOutput = KeyOutputAC -LArAutoCorrMaker.GroupingType = GroupingType -LArAutoCorrMaker.physics = 1 -LArAutoCorrMaker.MinBCFromFront=10 -topSequence += LArAutoCorrMaker - -# extrapolation to other gains -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrExtrapolate -LArAutoCorrExtrapolate=LArAutoCorrExtrapolate("LArAutoCorrExtrapolate") -LArAutoCorrExtrapolate.KeyOutput = LArAutoCorrPhysKey - -topSequence += LArAutoCorrExtrapolate - - - -if ( WriteNtuple ) : - - Nvector = (NSamples+1)*NSamples/2 + 1 - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" ) - LArAutoCorr2Ntuple.Nsamples = Nvector - LArAutoCorr2Ntuple.ContainerKey = KeyOutputAC - LArAutoCorr2Ntuple.AddFEBTempInfo=False - topSequence += LArAutoCorr2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName): - os.remove(OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName): - os.remove(OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName) - OutputConditionsAlgAC=OutputConditionsAlg("OutputConditionsAlgAC",OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName, - [OutputObjectSpecAutoCorr],[OutputTagSpecAutoCorr],WriteIOV) - OutputConditionsAlgAC.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgAC.Run2=IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theApp.AuditAlgorithms=True -theAuditorSvc += getConfigurable("ChronoAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("NameAuditor")(OutputLevel = WARNING) -svcMgr.ChronoStatSvc.OutputLevel = INFO - -if ( WriteNtuple ) : - LArAutoCorr2Ntuple.OutputLevel = DEBUG - -svcMgr.PoolSvc.ReadCatalog+=['xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml'] diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CaliWaveMerger_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CaliWaveMerger_jobOptions.py deleted file mode 100644 index c136069bc9aa685bc6614ecb8bb28208d47a1a78..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CaliWaveMerger_jobOptions.py +++ /dev/null @@ -1,125 +0,0 @@ -########################################################################### -# -# Example jobOptions to merge several LArCaliWaveContainers into one -# -# Last update: 30/11/2007 <Marco.Delmastro@cern.ch> -# -# Note: Works with release 13.0.x, need migration to 13.x.0 -# -########################################################################### - -if not 'PoolFileList' in dir(): - printfunc ("Please provide a PoolFileList!") - theApp.exit() - -if not 'ContainerKeyList' in dir(): - printfunc ("Please provide a ContainerKeyList!") - theApp.exit() - -if not 'PoolFileDir' in dir(): - PoolFileDir = "." - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" - -if not 'BaseName' in dir(): - BaseName = "LArCaliWaveMerger" - -if not 'WritePoolFile' in dir(): - WritePoolFile = True - -if not 'WriteRootFile' in dir(): - WriteRootFile = False - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'OutDir' in dir(): - OutDir = "." -PoolFileName = OutDir+"/"+BaseName+".pool.root" -RootFileName = OutDir+"/"+BaseName+".root" - -########################################################################### -# -# Global settings -# -########################################################################### - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -ToolSvc = Service("ToolSvc") - -############################################################################### -# -# Read POOL file(s) -# -############################################################################### - -include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) - -CondProxyProvider = Service( "CondProxyProvider" ) -ProxyProviderSvc = Service( "ProxyProviderSvc" ) -ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -CondProxyProvider.InputCollections += PoolFileList - -EventPersistencySvc = Service( "EventPersistencySvc" ) -EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ] - -############################################################################### -# -# Merge LArCaliWaveContainers -# -############################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveMerger -LArCaliWaveMerger = Algorithm("LArCaliWaveMerger") -LArCaliWaveMerger.KeyList = ContainerKeyList -LArCaliWaveMerger.KeyOutput = KeyOutput -LArCaliWaveMerger.GroupingType = GroupingType -LArCaliWaveMerger.OutputLevel = DEBUG -topSequence += LArCaliWaveMerger - -if ( WriteRootFile ) : - - from LArCalibTools.LArCalibToolsConf import LArWave2Ntuple as LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple("LArCaliWaves2Ntuple") - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - topSequence += LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - NTupleSvc = Service( "NTupleSvc" ) - NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) - - include("RegistrationServices/OutputConditionsAlg_jobOptions.py") - ToolSvc.ConditionsAlgStream.OutputFile = PoolFileName - OutputConditionsAlg.ObjectList = [ "LArCaliWaveContainer#"+KeyOutput] - -########################################################################### - -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = INFO -MessageSvc.defaultLimit = 1000; - -if not 'VerboseOutput' in dir(): - VerboseOutput = False - -if ( VerboseOutput): - StoreGateSvc = Service( "StoreGateSvc" ) - StoreGateSvc.Dump = True - DetectorStore = Service( "DetectorStore" ) - DetectorStore.Dump = True - ConditionStore = Service( "ConditionStore" ) - ConditionStore.Dump = True - -########################################################################### - -theApp.EvtMax = 1 # Leave this unchanged! - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DelayXtalk_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DelayXtalk_jobOptions.py deleted file mode 100644 index e29e28d5d70510e56dc492af44e23f3e71ebbbbe..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DelayXtalk_jobOptions.py +++ /dev/null @@ -1,505 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - - -########################################################################### -# -# Crosstalk jobOptions -# Reconstruct waveshapes for non pulsed channels (LArCaliWaveBuilderXtalk) -# and compute various types of crosstalk (LArWaveXtalk) -# -# Should be run for each subdetector : BarrelA, BarrelC, EndcapA, EndcapC -# and for each calibration patterns : -# - EM Barrel : StripSingle[1-4] / MiddleSingle[1-8] / BackSingle[1-4] -# - EM Endcap : StripSingle[1-4] / MiddleSingle[1-4] / BackSingle[1-4] -# and MiddleSingle[1-4] / BackSingle[1-4] for inner wheel -# For EM endcap special crates, set SpecialCrate to True. You can then -# choose the region with SpecialRegion = OuterWheel / InnerWheel. -# -# FeedthroughPul is used to find the relevant calibration pattern. Empty -# ntuples/histograms may be produced with badly set FeedthroughPul, or if -# there are bad channels or disconnected FEBs in FeedthroughPul. -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Crosstalk parameters -####################################################### - -if not 'Type' in dir(): - Type = "DelayXtalk" - -## Calibration pattern -## StripSingle[1-4] / MiddleSingle[1-8] / BackSingle[1-4] -if not 'CalibPattern' in dir(): - CalibPattern = "MiddleSingle1" - -## EMEC Special Crates -## if SpecialCrate=True, specify SpecialRegion -if not 'SpecialCrate' in dir(): - SpecialCrate = False - -if not 'SpecialRegion' in dir(): - SpecialRegion = "OuterWheel" # OuterWheel / InnerWheel - -## FT used to check calibration pattern -## ensure there are no bad channels / disconnected FEBs -if not 'FeedthroughPul' in dir(): - FeedthroughPul = 1 - - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" # Barrel / Endcap - -if not 'Side' in dir() : - Side = "A" # A / C - -if not 'RunNumberList' in dir(): - RunNumberList = [ '00157333' ] - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Delay" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2010/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='Endcap'): - Partition = "EB-EMEC" - else: - Partition = "EB-EMB" - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = False - -if not 'FullFileName' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Delay"+".*"+Partition+Side - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = True - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -####################################################### -# Delay properties -####################################################### - -if not "ADCSaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses otherwise 4095 - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -# CutOnSample: consider only the N=CutOnSample first samples to reduce needed memory (0 = no cut) -if not 'CutOnSample' in dir(): - CutOnSample = 0 - -####################################################### -# Delay output name -####################################################### - -if SpecialCrate: - XtalkTag = CalibPattern +"_FT"+str(FeedthroughPul) + "_SpecialCrates" + "_" + SpecialRegion -else: - XtalkTag = CalibPattern +"_FT"+str(FeedthroughPul) - -if not 'OutputTag' in dir(): - OutputTag = XtalkTag -else: - OutputTag = XtalkTag + "_" + OutputTag - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -## Pedestal - -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber)+"_"+Partition.replace("*","") + ".pool.root" - -## Output - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputCaliWaveRootFileDir' in dir(): - OutputCaliWaveRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputCaliWavePoolFileDir' in dir(): - OutputCaliWavePoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if not 'BaseFileName' in dir(): - BaseFileName = Type - -for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","")+Side - -BaseFileName = BaseFileName + "_" + OutputTag - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileName+".root" - -if not 'OutputCaliWavePoolFileName' in dir(): - OutputCaliWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -DelayLog = logging.getLogger( "DelayLog" ) - -include ("LArConditionsCommon/LArMinimalSetup.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - DelayLog.info( "No FullFileName! Please give a FullFileName list.") - theApp.exit(-1) -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc -theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] -theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] -theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] -theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -from LArByteStream.LArByteStreamConf import LArRodDecoder -svcMgr.ToolSvc += LArRodDecoder() - -#ToolSvc.LArRodDecoder.BEPreselection = [1] ## : [Barrel=0,Endcap=1] -#ToolSvc.LArRodDecoder.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) -#ToolSvc.LArRodDecoder.FTNumPreselection = [6] ## : [FCAL feedthrough number] - -########################################################################## -# # -# Delay run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadPedFromCOOL ): - PedestalFolder = LArCalib_Flags.LArPedestalFolder - if 'PedLArCalibFolderTag' in dir() : - PedestalTagSpec = LArCalibFolderTag (PedestalFolder,PedLArCalibFolderTag) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",PedestalFolder+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) -else: - if 'InputPedPoolFileName' in dir(): - PoolFileList += [ InputPedPoolFileDir+"/"+InputPedPoolFileName ] - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -#-------------------------------------------------- -# LArCaliWaveBuilderXtalk -#-------------------------------------------------- - -PartitionPulsed = SubDet + Side # Partition should be BarrelA or BarrelC or EndcapA or EndcapC -if not (PartitionPulsed=="BarrelA" or PartitionPulsed=="BarrelC" or PartitionPulsed=="EndcapA" or PartitionPulsed=="EndcapC"): - printfunc ("[Xtalk JobOptions] Error: PartitionPulsed="+PartitionPulsed+". It should be BarrelA or BarrelC or EndcapA or EndcapC") - theApp.exit(-1) - -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilderXtalk -LArCaliWaveBuilderXtalk = LArCaliWaveBuilderXtalk("LArCaliWaveBuilderXtalk") - -LArCaliWaveBuilderXtalk.KeyList = GainList -if (doCaliWaveSelector) : - LArCaliWaveBuilderXtalk.KeyOutput = KeyOutput+"multi" -else : - LArCaliWaveBuilderXtalk.KeyOutput = KeyOutput -LArCaliWaveBuilderXtalk.ADCsaturation = ADCsaturation -LArCaliWaveBuilderXtalk.CalibPattern = CalibPattern # StripSingle[1-4] / MiddleSingle[1-8] / BackSingle[1-4] -LArCaliWaveBuilderXtalk.PartitionPulsed = PartitionPulsed # Partition should be BarrelA or BarrelC or EndcapA or EndcapC -LArCaliWaveBuilderXtalk.SpecialCrate = SpecialCrate # EMEC special crates -LArCaliWaveBuilderXtalk.SpecialRegion = SpecialRegion # EMEC special region -LArCaliWaveBuilderXtalk.FeedthroughPul = FeedthroughPul # Used to check calibration pattern, ensure there are no bad channels / disconnected FEBs -LArCaliWaveBuilderXtalk.CutOnSample = CutOnSample # Cut on the number of read samples (usualy 32) to save memory - -if 'Ramp' in FullFileName: # for ramp runs : only one step (ie. no delay) - printfunc ("[Xtalk JobOptions] Ramp run detected: set LArCaliWaveBuilderXtalk.NSteps to 1") - LArCaliWaveBuilderXtalk.NSteps = 1 - -topSequence+=LArCaliWaveBuilderXtalk - -########################################################################## -# # -# Output # -# # -########################################################################## - -if ( doMonitoring ) : - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - -# include("LArMonTools/LArFEBMon_jobOptions.py") - include("LArMonTools/LArXtalk_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputCaliWaveRootFileDir + "/" +RootHistOutputFileName) - svcMgr += THistSvc() - #svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - svcMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - -if ( WriteNtuple ): - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName): - os.remove(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName, - [OutputObjectSpecCaliWave],[OutputTagSpecCaliWave],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################## -# # -# Print summary # -# # -########################################################################## - -DelayLog.info( " ======================================================== " ) -DelayLog.info( " *** LAr Delay Xtalk summary *** " ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " RunNumber = "+str(RunNumberList) ) -DelayLog.info( " SubDetector = "+SubDet ) -DelayLog.info( " PartitionPulsed = "+PartitionPulsed ) -DelayLog.info( " CalibPattern = "+CalibPattern ) -DelayLog.info( " CutOnSample = "+str(CutOnSample) ) -DelayLog.info( " FeedthroughPul = "+str(FeedthroughPul) ) -DelayLog.info( " SpecialCrate = "+str(SpecialCrate) ) -DelayLog.info( " SpecialRegion = "+SpecialRegion ) -DelayLog.info( " Type = "+Type ) -DelayLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - DelayLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - DelayLog.info( " InputDBConnectionPed = "+InputDBConnectionPed) -else : - DelayLog.info( " InputPedPoolFileName = "+InputPedPoolFileName) -if 'PedLArCalibFolderTag' in dir() : - DelayLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -DelayLog.info( " OutputCaliWaveRootFullFileName = "+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName ) -DelayLog.info( " OutputCaliWavePoolFullFileName = "+OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName ) -DelayLog.info( " OutputObjectSpecCaliWave = "+OutputObjectSpecCaliWave ) -DelayLog.info( " OutputTagSpecCaliWave = "+OutputTagSpecCaliWave ) -DelayLog.info( " IOVBegin = "+str(IOVBegin) ) -DelayLog.info( " IOVEnd = "+str(IOVEnd) ) -DelayLog.info( " LArCalibOutputDB = "+OutputDB ) -DelayLog.info( " ======================================================== " ) - -####################################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py deleted file mode 100644 index f5dfdb23666519ee51ac2006507fad1109efb5d6..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py +++ /dev/null @@ -1,988 +0,0 @@ -LArCalib_Delay_OFC_Cali_jobOptions.py -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -# Modified version: -# - doOFC=False switch off the OFC computation and storing -# - skipEvents added to EventSelector - doesn't help for Xtalk -# - maxEvents added also - doesnt help for Xtalk -# - allCells will reconstruct also not-pulsed waves -# - usePatt - if <0 all patterns, if <0,15> or <0,13> if EMEC, fill only those pattern -# - numPatt - either 16 for EMB or 14 for EMEC (with standard configuration) - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to reconstruction a DELAY runs in all 3 gains -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -if "SuperCells" not in dir(): - SuperCells=False -if 'SC_SampleShift' not in dir(): - SC_SampleShift=0 - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'SCProtectSourceId' in dir(): - SCProtectSourceId=True - -if not 'patchCalibs' in dir(): - patchCalibs = [] -else: - print("WARNING: will patch the following calibration boards:", patchCalibs) - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0029143' ] - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Delay" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = False - -if not 'FullFileName' in dir(): - if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Delay"+".*"+Partition - #Trigger = "calibration_LArElec-Delay"+".*" - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -if not 'RecAllCells' in dir(): - RecAllCells=False # do not reco non-pulsed cells - -if not 'doBadCatcher' in dir(): - doBadCatcher = True - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -if not 'skipEvents' in dir(): - skipEvents=0 - -if not 'maxEvents' in dir(): - maxEvents=-1 - -if not 'allCells' in dir(): - allCells=False - -if not 'usePatt' in dir(): - usePatt = -1 - -if 'useParams' not in dir(): - useParams = False - -if useParams and 'paramsFile' not in dir(): - paramsFile = 'LArCalibProcessing/LArCalib_CalibrationPatterns.py' - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = True - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = True - -####################################################### -# Delay properties -####################################################### - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'ShortCorrector' in dir(): - ShortCorrector = True # correctio for short - -if not "ADCsaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses otherwise 4095 - -if not 'SubtractPed' in dir(): # Set whether to substract pedestals. Pedestals come from COOL, or local Pool file if 'PedPoolFileName' is defined, or fake pedestal subraction as 'extrema ratio' - SubtractPed = True - -if not 'CheckEmptyPhases' in dir(): - CheckEmptyPhases = True - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=True - - -########################################################################### -# OFC properties -########################################################################### -if not 'doOFC' in dir(): - doOFC = True - -if doOFC: - if not 'Nsamples' in dir(): - Nsamples = 4 - - if not 'Nphases' in dir(): - Nphases = 50 - - if not 'Dphases' in dir(): - Dphases = 1 - - if not 'Ndelays' in dir(): - Ndelays = 24 - - if not 'ContainerKey' in dir(): - ContainerKey = "LArCaliWave" - - if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - - if not 'Normalize' in dir(): - Normalize = True - - if not 'TimeShift' in dir() : - TimeShift = False - - if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - - if not 'DumpOFC' in dir(): - DumpOFC = False - -if not 'ForceShift' in dir(): - ForceShift = False - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if not 'DBConnectionCOOLONL' in dir(): - DBConnectionCOOLONL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - -## Pedestal -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -## AutoCorr -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -## Output -if 'dbname' in dir(): - rs=FolderTagResover(dbname=dbname) -else: - rs=FolderTagResover() -if not 'PedLArCalibFolderTag' in dir(): - PedLArCalibFolderTag=rs.getFolderTagSuffix(LArCalib_Flags.LArPedestalFolder) - -if not 'AutoCorrLArCalibFolderTag' in dir(): - AutoCorrLArCalibFolderTag=rs.getFolderTagSuffix(LArCalib_Flags.LArAutoCorrFolder) - -if not 'LArCalibWaveFolderXtlkOutputTag' in dir(): - LArCalibWaveFolderXtlkOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArCaliWaveFolderXtlk) -if not 'LArCalibWaveFolderOutputTag' in dir(): - LArCalibWaveFolderOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArCaliWaveFolder) -if doOFC and not 'LArCalibOFCXtlkFolderOutputTag' in dir(): - LArCalibOFCXtlkFolderOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArOFCCaliFolderXtlk) -if doOFC and not 'LArCalibOFCFolderOutputTag' in dir(): - LArCalibOFCFolderOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArOFCCaliFolder) -del rs #Close database - -if not 'OutputRootFileDir' in dir(): - OutputRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if not 'BaseFileName' in dir(): - BaseFileName = "LArCaliWave_OFC_Cali" - BaseFileNameCaliWave = "LArCaliWave" - -if StripsXtalkCorr : - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") +"_StripsXtalkCorr" - BaseFileNameCaliWave = BaseFileNameCaliWave+"_"+str(RunNumber)+"_"+Partition.replace("*","") +"_StripsXtalkCorr" -else : - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - BaseFileNameCaliWave = BaseFileNameCaliWave+"_"+str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileNameCaliWave+".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - if StripsXtalkCorr: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolderXtlk - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolderXtlk,LArCalibWaveFolderXtlkOutputTag) - else: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibWaveFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOLONL - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if doOFC and not 'OutputObjectSpecOFC' in dir(): - if ( ContainerKey == "LArCaliWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = "LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolder - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder,LArCalibOFCFolderOutputTag) - else: - OutputObjectSpecOFC = "LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolderXtlk - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolderXtlk,LArCalibWaveFolderXtlkOutputTag) - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolder - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolder,LArCalibOFCFolderOutputTag) - else: - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolderXtlk - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolderXtlk,LArCalibOFCXtlkFolderOutputTag) - -if doOFC: - OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - - if (StripsXtalkCorr): - OFCFileTag += "_StripsXtalkCorr" - - OFCFileTag += "_"+str(Nsamples)+"samples" - - if (Dphases>1): - OFCFileTag += "_"+str(Dphases)+"Dphase" - - if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCCali_"+OFCFileTag + ".root" - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -####################################################################################### -# print summary -####################################################################################### -DelayOFCLog = logging.getLogger( "DelayOFCLog" ) -DelayOFCLog.info( " ======================================================== " ) -DelayOFCLog.info( " *** LAr Delay&&OFC summary *** " ) -DelayOFCLog.info( " ======================================================== " ) -DelayOFCLog.info( " RunNumber = "+str(RunNumberList) ) -DelayOFCLog.info( " SubDetector = "+SubDet ) -DelayOFCLog.info( " Partition = "+Partition ) -DelayOFCLog.info( " Type = Delay " ) -DelayOFCLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - DelayOFCLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - DelayOFCLog.info( " InputDBConnectionPed = "+InputDBConnectionPed) -else : - DelayOFCLog.info( " InputPedPoolFileName = "+InputPedPoolFileName) -if ( ReadAutoCorrFromCOOL ): - DelayOFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) -else: - DelayOFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolFileName ) -DelayOFCLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -DelayOFCLog.info( " OutputCaliWaveRootFullFileName = "+OutputRootFileDir+"/"+OutputCaliWaveRootFileName ) -DelayOFCLog.info( " OutputObjectSpecCaliWave = "+OutputObjectSpecCaliWave ) -DelayOFCLog.info( " OutputTagSpecCaliWave = "+OutputTagSpecCaliWave ) -if doOFC: - DelayOFCLog.info( " OutputOFCRootFullFileName = "+OutputRootFileDir+"/"+OutputOFCRootFileName ) - DelayOFCLog.info( " OutputPoolFullFileName = "+OutputPoolFileDir+"/"+OutputPoolFileName ) - DelayOFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) - DelayOFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) - -DelayOFCLog.info( " IOVBegin = "+str(IOVBegin) ) -DelayOFCLog.info( " IOVEnd = "+str(IOVEnd) ) -DelayOFCLog.info( " LArCalibOutputDB = "+OutputDB ) -DelayOFCLog.info( " ======================================================== " ) -####################################################################################### - - -include ("LArConditionsCommon/LArMinimalSetup.py") -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() -from LArCabling.LArCablingAccess import LArCalibIdMapping -LArCalibIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import theApp, ServiceMgr, ToolSvc - -theByteStreamInputSvc=ServiceMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - DelayOFCLog.info( "No FullFileName! Please give a FullFileName list.") - theApp.exit(-1) -else : - ServiceMgr.EventSelector.Input = FullFileName - -ServiceMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -# else # -# ServiceMgr.EventSelector.Input=OneFileName # -# for i in range(len(ServiceMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - -if ( runAccumulator ) : - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #theLArLATOMEDecoder.DumpFile = SC_DumpFile - #theLArLATOMEDecoder.RawDataFile = SC_RawDataFile - from LArByteStream.LArByteStreamConf import LArRawSCDataReadingAlg - larRawSCDataReadingAlg = LArRawSCDataReadingAlg() - larRawSCDataReadingAlg.adcCollKey = Gain - larRawSCDataReadingAlg.adcBasCollKey = "" - larRawSCDataReadingAlg.etCollKey = "" - larRawSCDataReadingAlg.etIdCollKey = "" - larRawSCDataReadingAlg.LATOMEDecoder = theLArLATOMEDecoder - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - - topSequence += larRawSCDataReadingAlg - - else: - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - topSequence+=theLArRawCalibDataReadingAlg - include("./LArCalib_CalibrationPatterns_"+str(IOVBegin)+".py") - -else: - - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - from LArByteStream.LArByteStreamConf import LArRawSCCalibDataReadingAlg - LArRawSCCalibDataReadingAlg = LArRawSCCalibDataReadingAlg() - LArRawSCCalibDataReadingAlg.LArSCAccCalibDigitKey = Gain - LArRawSCCalibDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.DumpFile = SC_DumpFile - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.RawDataFile = SC_RawDataFile - LArRawSCCalibDataReadingAlg.LATOMEDecoder.ProtectSourceId = SCProtectSourceId - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.OutputLevel = WARNING - topSequence+=LArRawSCCalibDataReadingAlg - - else: - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArAccCalibDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - - # These are examples, how to use preselection: - #theLArRawCalibDataReadingAlg.BEPreselection = [0] ## : [Barrel=0,Endcap=1] - #theLArRawCalibDataReadingAlg.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] - #theLArRawCalibDataReadingAlg.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] - #theLArRawCalibDataReadingAlg.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] - #theLArRawCalibDataReadingAlg.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] - #theLArRawCalibDataReadingAlg.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] - #theLArRawCalibDataReadingAlg.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) - #theLArRawCalibDataReadingAlg.FTNumPreselection = [6] ## : [FCAL feedthrough number] - - topSequence+=theLArRawCalibDataReadingAlg - - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -if not SuperCells: - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False -if CheckBadEvents: - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=True - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList=GainList - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher - -ServiceMgr.EventSelector.SkipEvents=skipEvents -theApp.EvtMax = maxEvents - -########################################################################## -# # -# Delay run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -if not 'InputBadChannelSQLiteFile' in dir(): - DelayOFCLog.info( "Read Bad Channels from Oracle DB") -else : - DelayOFCLog. info( "Read Bad Channels from SQLite file") - -if 'BadChannelsFolder' in dir(): - if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - -if 'MissingFEBsFolder' in dir(): - if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -if SuperCells: - theLArBadChannelCondAlg.isSC=True -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - - -## define the DB Gobal Tag : -ServiceMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - ServiceMgr.IOVDbSvc.DBInstance="" -except: - pass - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") -#ServiceMgr.EventSelector.InitialTimeStamp = 1284030331 -#import cx_Oracle -#import time -#import datetime -#try: -# connection=cx_Oracle.connect("ATLAS_SFO_T0_R/readmesfotz2008@atlr") -# cursor=connection.cursor() -# sRequest=("SELECT RUNNR,CREATION_TIME FROM SFO_TZ_RUN WHERE RUNNR='%s'")%(RunNumberList[0]) -# cursor.execute(sRequest) -# times= cursor.fetchall() -# d=times[0][1] -# iovtemp=int(time.mktime(d.timetuple())) -#except: -# iovtemp=1283145454 - -#printfunc ("Setting timestamp for run ",RunNumberList[0]," to ",iovtemp) -#ServiceMgr.IOVDbSvc.forceTimestamp = 1283145454 -#ServiceMgr.IOVDbSvc.forceTimestamp = iovtemp - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -ServiceMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - if StripsXtalkCorr: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolderXtlk+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - else: - #conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - #FIXME once the calib. constants for SC will be in the oracle - if not SuperCells: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>sqlite://;schema=/eos/atlas/atlascerngroupdisk/det-larg/SuperCells/CalibData/poolFiles/LATOMERun_EndcapWeekly_220411-182904/db_00417648_00417649_00417650.db;dbname=CONDBR2</dbConnection><tag>LARElecCalibOflSCCaliWavesCaliWave-UPD3-00</tag>"+ChannelSelection) - -if (SubtractPed): - if ( ReadPedFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - DelayOFCLog.info( "Read Pedestal from Oracle DB") - PedestalFolder = "/LAR/ElecCalibFlat/Pedestal" - PedestalTagSpec = "" - from LArRecUtils.LArRecUtilsConf import LArFlatConditionSvc - theLArCondSvc=LArFlatConditionSvc(DoSuperCells=False,DoRegularCells=True) - ServiceMgr+=theLArCondSvc - ServiceMgr.ProxyProviderSvc.ProviderNames += [ "LArFlatConditionSvc" ] - ServiceMgr.LArFlatConditionSvc.PedestalInput=PedestalFolder - PedChannelSelection="" - else : - DelayOFCLog.info( "Read Pedestal from SQLite file") - PedestalFolder = LArCalib_Flags.LArPedestalFolder - PedestalTagSpec = LArCalibFolderTag (PedestalFolder,PedLArCalibFolderTag) - PedChannelSelection=ChannelSelection - - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+PedChannelSelection,className="LArPedestalComplete") - else: - if 'InputPedPoolFileName' in dir(): - DelayOFCLog.info( "Read Pedestal from POOL file") - PoolFileList += [ InputPedPoolFileDir+"/"+InputPedPoolFileName ] - - else: - DelayOFCLog.info( "LArCaliWaveBuilder WARNING : Using fake pedestals subtraction for all channels.") - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - ServiceMgr += getConfigurable( "ProxyProviderSvc" )() - ServiceMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - ServiceMgr += getConfigurable( "CondProxyProvider" )() - ServiceMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( ShortCorrector ): - - from LArCalibUtils.LArCalibUtilsConf import LArCalibShortCorrector - theLArCalibShortCorrector = LArCalibShortCorrector() - theLArCalibShortCorrector.KeyList = GainList - theLArCalibShortCorrector.OutputLevel=INFO - topSequence +=theLArCalibShortCorrector - -if ( StripsXtalkCorr ) : - - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"] - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine", "deadReadout", "deadPhys"] - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilder -LArCaliWaveBuilder = LArCaliWaveBuilder() -LArCaliWaveBuilder.KeyList = GainList -if (doCaliWaveSelector) : - LArCaliWaveBuilder.KeyOutput = KeyOutput+"multi" -else : - LArCaliWaveBuilder.KeyOutput = KeyOutput -LArCaliWaveBuilder.GroupingType = GroupingType -LArCaliWaveBuilder.SubtractPed = SubtractPed -LArCaliWaveBuilder.CheckEmptyPhases = CheckEmptyPhases -LArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing -LArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC -LArCaliWaveBuilder.RecAllCells = RecAllCells -LArCaliWaveBuilder.isSC = SuperCells -LArCaliWaveBuilder.UsePattern = usePatt -LArCaliWaveBuilder.UseParams = useParams -if useParams: - include(paramsFile) - -if StripsXtalkCorr: - LArCaliWaveBuilder.ADCsaturation = 0 -else: - LArCaliWaveBuilder.ADCsaturation = ADCsaturation - -if SuperCells: - LArCaliWaveBuilder.CablingKey="LArOnOffIdMapSC" - -topSequence+=LArCaliWaveBuilder - -if (doCaliWaveSelector) : - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelector = LArCaliWaveSelector("LArCaliWaveSelector") - LArCaliWaveSelector.KeyList = [ KeyOutput+"multi" ] - LArCaliWaveSelector.KeyOutput = KeyOutput - LArCaliWaveSelector.GroupingType = GroupingType - if (Gain=="HIGH") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ] - - if (Gain=="MEDIUM") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - - if (Gain=="LOW") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ] - - topSequence+=LArCaliWaveSelector - -###################################################################### -# # -# Correction # -# # -###################################################################### - -if CorrectBadChannels: - - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ - theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") - theLArCaliWavePatcher.ContainerKey=KeyOutput - #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour - theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event - theLArCaliWavePatcher.OutputLevel=DEBUG - theLArCaliWavePatcher.ProblemsToPatch=[ - "deadCalib","deadReadout","deadPhys","almostDead","short", - ] - if SuperCells: - theLArCaliWavePatcher.OnOffMap="LArOnOffIdMapSC" - theLArCaliWavePatcher.CalibLineKey="LArCalibIdMapSC" - theLArCaliWavePatcher.SuperCell=True - ## block standard patching for this CB - if len(patchCalibs) > 1: - theLArCaliWavePatcher.DoNotPatchCBs=patchCalibs - - topSequence+=theLArCaliWavePatcher - - -########################################################################## -# # -# Cali OFC # -# # -########################################################################## -if doOFC: - if ( ReadAutoCorrFromCOOL ): - if not 'InputAutoCorrSQLiteFile' in dir(): - DelayOFCLog.info( "Read AutoCorr from Oracle DB" ) - else : - DelayOFCLog.info( "Read AutoCorr from SQLite file" ) - - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder - AutoCorrTagSpec = LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) - else: - if 'InputAutoCorrPoolFileName' in dir(): - DelayOFCLog.info( "Read AutoCorr from POOL file" ) - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - DelayOFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - - -########################################################################## -# # -# Output # -# # -########################################################################## - -if ( doLArCalibDataQuality ) : - from LArCalibDataQuality.LArCalibDataQualityConf import LArCaliWaveValidationAlg - - from LArCalibDataQuality.Thresholds import cwFWHMThr, cwAmpThr,cwAmpThrFEB, cwFWHMThrFEB - theCaliWaveValidationAlg=LArCaliWaveValidationAlg("CaliWaveVal") - theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theCaliWaveValidationAlg.ValidationKey=KeyOutput - theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef" - theCaliWaveValidationAlg.MsgLevelForDeviations=WARNING - theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt" - theCaliWaveValidationAlg.AmplitudeTolerance=cwAmpThr - theCaliWaveValidationAlg.CaliWaveFWHMTolerance=cwFWHMThr - theCaliWaveValidationAlg.AmplitudeToleranceFEB=cwAmpThrFEB - theCaliWaveValidationAlg.CaliWaveFWHMToleranceFEB=cwFWHMThrFEB - theCaliWaveValidationAlg.TimeShiftDetection=True - theCaliWaveValidationAlg.SuperCells=SuperCells - if not SuperCells: - theCaliWaveValidationAlg.PatchMissingFEBs=True - else: - theCaliWaveValidationAlg.PatchMissingFEBs=False - theCaliWaveValidationAlg.CablingKey="LArOnOffIdMapSC" - theCaliWaveValidationAlg.CalibLineKey="LArCalibIdMapSC" - - theCaliWaveValidationAlg.UseCorrChannels=False - theCaliWaveValidationAlg.OutputLevel=DEBUG - ##in case of CalibBoard patching, please uncomment: - ## adding new patching - if len(patchCalibs) > 1: - theCaliWaveValidationAlg.PatchCBs=patchCalibs - - topSequence+=theCaliWaveValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadCaliWave=LArCaliWaveValidationAlg("CaliWaveFail") - theBadCaliWave.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadCaliWave.ValidationKey=KeyOutput - theBadCaliWave.ReferenceKey="LArCaliWaveRef" - theBadCaliWave.MsgLevelForDeviations=WARNING - theBadCaliWave.ListOfDevFEBs="Bad_caliWaveFebs.txt" - theBadCaliWave.AmplitudeTolerance=["20,20,20"] - theBadCaliWave.CaliWaveFWHMTolerance=["50,50,50"] - theBadCaliWave.AmplitudeToleranceFEB=["10,10,10"] - theBadCaliWave.CaliWaveFWHMToleranceFEB=["80,80,80"] - theBadCaliWave.TimeShiftDetection=True - theBadCaliWave.UseCorrChannels=False - theBadCaliWave.SuperCells=SuperCells - topSequence+=theBadCaliWave - - - -if ( doMonitoring ) : - - from AthenaMonitoring.DQMonFlags import DQMonFlags - DQMonFlags.enableLumiAccess.set_Value_and_Lock(False) - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputRootFileDir + "/" +RootHistOutputFileName) - ServiceMgr += THistSvc() - - ServiceMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputRootFileDir+ "/" +RootHistOutputFileName+"', OPT='RECREATE'"] - - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.RealGeometry = True - LArCaliWaves2Ntuple.OffId = True - LArCaliWaves2Ntuple.AddCalib = True - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.AddFEBTempInfo = False - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - LArCaliWaves2Ntuple.isSC = SuperCells - if SuperCells: - LArCaliWaves2Ntuple.CalibMapKey = "LArCalibIdMapSC" - from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg - condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg") - LArCaliWaves2Ntuple.ExtraInputs.add(('CaloSuperCellDetDescrManager', 'ConditionStore+CaloSuperCellDetDescrManager')) - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputRootFileDir+"/"+OutputCaliWaveRootFileName) - ServiceMgr += NTupleSvc() - ServiceMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputPoolFileDir+"/"+OutputPoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecCaliWave],[OutputTagSpecCaliWave],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - ServiceMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - ServiceMgr += IOVRegistrationSvc() - ServiceMgr.IOVRegistrationSvc.RecreateFolders = False - - - - -########################################################################### -# OFC computation -########################################################################### -if doOFC: - from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool - theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() - theLArAutoCorrDecoderTool.isSC = SuperCells - - from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg - LArCaliOFCAlg = LArOFCAlg("LArCaliOFCAlg") - LArCaliOFCAlg.ReadCaliWave = True - LArCaliOFCAlg.KeyList = [ ContainerKey ] - LArCaliOFCAlg.Nphase = Nphases - LArCaliOFCAlg.Dphase = Dphases - LArCaliOFCAlg.Ndelay = Ndelays - LArCaliOFCAlg.Nsample = Nsamples - LArCaliOFCAlg.Normalize = Normalize - LArCaliOFCAlg.TimeShift = TimeShift - LArCaliOFCAlg.TimeShiftByIndex = TimeShiftByIndex - LArCaliOFCAlg.Verify = True - LArCaliOFCAlg.FillShape = False - - if ( DumpOFC ) : - LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat" - LArCaliOFCAlg.GroupingType = GroupingType - LArCaliOFCAlg.DecoderTool=theLArAutoCorrDecoderTool - LArCaliOFCAlg.isSC = SuperCells - topSequence+=LArCaliOFCAlg - - - - if ( WritePoolFile ) : - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - OutputConditionsAlg2=OutputConditionsAlg("OutputConditionsAlg2",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg2.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg2.Run2 = IOVEnd - - - if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.Nsamples = Nsamples # number of samples to use for OFC - LArOFC2Ntuple.RealGeometry = True - LArOFC2Ntuple.OffId = True - LArOFC2Ntuple.NtupleFile = "FILE2" - LArOFC2Ntuple.AddFEBTempInfo = False - LArOFC2Ntuple.isSC = SuperCells - - topSequence+=LArOFC2Ntuple - - if os.path.exists(OutputRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputRootFileDir+"/"+OutputOFCRootFileName) - ServiceMgr += NTupleSvc() - ServiceMgr.NTupleSvc.Output += [ "FILE2 DATAFILE='"+OutputRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - - -########################################################################### - -ServiceMgr.MessageSvc.OutputLevel = WARNING -ServiceMgr.MessageSvc.defaultLimit = 10000 -ServiceMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -ServiceMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py deleted file mode 100644 index cfdf0a6ed19eba6ce944cceefec3efcab2141182..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py +++ /dev/null @@ -1,979 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <pavol@mail.cern.ch> -# -# jO to reconstruct a DELAY per calibration line -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "EndCap" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '00121536','00121539','00121542' ] - -if not 'AllWavesPerCh' in dir(): - AllWavesPerCh = True - -if not 'MaxCalLinePerCh' in dir(): - MaxCalLinePerCh = 4 - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Delay" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = False - -#if not 'RecAll' in dir(): -# RecAll = False - -if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Delay"+".*"+Partition - -if not 'FullFileName' in dir(): - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -####################################################### -# Delay properties -####################################################### - -if not 'DACs' in dir(): - DACs = [500] # Needed if runAccumulator = True - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'ShortCorrector' in dir(): - ShortCorrector = True # correctio for short - -if not "ADCSaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses otherwise 4095 - -if not 'SubtractPed' in dir(): # Set whether to substract pedestals. Pedestals come from COOL, or local Pool file if 'PedPoolFileName' is defined, or fake pedestal subraction as 'extrema ratio' - SubtractPed = True - -if not 'CheckEmptyPhases' in dir(): - CheckEmptyPhases = True - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=True - - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - -## Pedestall - -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber)+"_"+Partition.replace("*","") + ".pool.root" - -## Output - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = '-UPD3-00' - -if not 'OutputCaliWaveRootFileDir' in dir(): - OutputCaliWaveRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputCaliWavePoolFileDir' in dir(): - OutputCaliWavePoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if AllWavesPerCh: - KeyOutputSplitted = [] - for i in range(0, MaxCalLinePerCh): - KeyOutputSplitted.append(KeyOutput+str(i)) - -if not 'BaseFileName' in dir(): - BaseFileName = "LArCaliWave" - -for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber) - -if StripsXtalkCorr : - BaseFileName = BaseFileName+"_StripsXtalkCorr" - -if AllWavesPerCh: - BaseFileName = BaseFileName+"_single" -else: - BaseFileName = BaseFileName+"_averaged" - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileName+".root" - -if not 'OutputCaliWavePoolFileName' in dir(): - OutputCaliWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - if StripsXtalkCorr: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolderXtlk] - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolderXtlk,LArCalibFolderOutputTag) - else: - if ( AllWavesPerCh ) : - OutputObjectSpecCaliWave = [] - for i in range(0, MaxCalLinePerCh): - if doCaliWaveSelector: - OutputObjectSpecCaliWave.append("LArCaliWaveContainer#"+KeyOutputSplitted[i]+"Sel"+"#"+LArCalib_Flags.LArCaliWaveFolder+str(i)) - else: - OutputObjectSpecCaliWave.append("LArCaliWaveContainer#"+KeyOutputSplitted[i]+"#"+LArCalib_Flags.LArCaliWaveFolder+str(i)) - else: - if doCaliWaveSelector: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"Sel"+"#"+LArCalib_Flags.LArCaliWaveFolder] - else: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder] - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - InputDBConnectionBadChannel = "COOLONL_LAR/CONDBR2" - -########################################################################### -# OFC properties -########################################################################### - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'Nphases' in dir(): - Nphases = 50 - -if not 'Dphases' in dir(): - Dphases = 1 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'ContainerKey' in dir(): - ContainerKey = "LArCaliWave" - -if AllWavesPerCh and (not 'ContainerKeySplitted' in dir()): - ContainerKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - if (doCaliWaveSelector): - ContainerKeySplitted.append(ContainerKey+str(i)+"Sel") - else: - ContainerKeySplitted.append(ContainerKey+str(i)) - -if (doCaliWaveSelector) and (not AllWavesPerCh): - ContainerKey += "Sel" - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if AllWavesPerCh and (not 'OFCKeySplitted' in dir()): - OFCKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - OFCKeySplitted.append(OFCKey+str(i+1)) - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if AllWavesPerCh and (not 'ShapeKeySplitted' in dir()): - ShapeKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - ShapeKeySplitted.append(ShapeKey+str(i+1)) - -if not 'Normalize' in dir(): - Normalize = True - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'FillShape' in dir(): - FillShape = False # Do not fill a LArShapeComplete object for calibration OFC! - -if not 'DumpOFC' in dir(): - DumpOFC = False - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -########################################################################### -# OFC output -########################################################################### - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputOFCPoolFileDir' in dir(): - OutputOFCPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputShapePoolFileDir' in dir(): - OutputShapePoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -if (StripsXtalkCorr): - OFCFileTag += "_StripsXtalkCorr" - -OFCFileTag += "_"+str(Nsamples)+"samples" - -if (Dphases>1): - OFCFileTag += "_"+str(Dphases)+"Dphase" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCCali_"+OFCFileTag + ".root" - -if not 'OutputOFCPoolFileName' in dir(): - OutputOFCPoolFileName = "LArOFCCali_"+OFCFileTag + ".pool.root" - -if not 'OutputShapePoolFileName' in dir(): - OutputShapePoolFileName = "LArShapeCali_"+OFCFileTag + ".pool.root" - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = "-UPD3-00" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecOFC' in dir(): - if ( AllWavesPerCh ) : - OutputObjectSpecOFC = [] - for i in range(0, MaxCalLinePerCh): - OutputObjectSpecOFC.append("LArOFCComplete#"+OFCKeySplitted[i]+"#"+ LArCalib_Flags.LArOFCCaliFolder ) - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder,LArCalibFolderOutputTag) - else: - if ( ContainerKey == "LArCaliWave" ) or (ContainerKey == "LArCaliWaveSel") or (ContainerKey == "LArCaliWaveSelPatch"): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = ["LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolder] - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecOFC = ["LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolderXtlk] - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolderXtlk,LArCalibFolderOutputTag) - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = ["LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolder] - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecOFC = ["LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolderXtlk] - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolderXtlk,LArCalibFolderOutputTag) - -if not 'OutputObjectSpecShape' in dir(): - if ( AllWavesPerCh ) : - OutputObjectSpecShape = [] - for i in range(0, MaxCalLinePerCh): - OutputObjectSpecShape.append("LArShapeComplete#"+ShapeKeySplitted[i]+"#"+ LArCalib_Flags.LArShapeCaliWaveFolder ) - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolder,LArCalibFolderOutputTag) - else: - if ( ContainerKey == "LArCaliWave" ) or (ContainerKey == "LArCaliWaveSel") or (ContainerKey == "LArCaliWaveSelPatch"): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolder] - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolderXtlk] - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolderXtlk,LArCalibFolderOutputTag) - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+LArCalib_Flags.LArShapeMasterWaveFolder] - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeMasterWaveFolderXtlk] - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolderXtlk,LArCalibFolderOutputTag) - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -####################################################################################### -# print summary -####################################################################################### - -DelayLog = logging.getLogger( "DelayLog" ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " *** LAr Delay summary *** " ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " RunNumber = "+str(RunNumberList) ) -DelayLog.info( " SubDetector = "+SubDet ) -DelayLog.info( " Partition = "+Partition ) -DelayLog.info( " Type = Delay " ) -DelayLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - DelayLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - DelayLog.info( " InputDBConnectionPed = "+InputDBConnectionPed) -else : - DelayLog.info( " InputPedPoolFileName = "+InputPedPoolFileName) -if 'PedLArCalibFolderTag' in dir() : - DelayLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -DelayLog.info( " OutputCaliWaveRootFullFileName = "+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName ) -DelayLog.info( " OutputCaliWavePoolFullFileName = "+OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName ) -#DelayLog.info( " OutputObjectSpecCaliWave = "+OutputObjectSpecCaliWave ) -DelayLog.info( " OutputTagSpecCaliWave = "+OutputTagSpecCaliWave ) -DelayLog.info( " IOVBegin = "+str(IOVBegin) ) -DelayLog.info( " IOVEnd = "+str(IOVEnd) ) -DelayLog.info( " LArCalibOutputDB = "+OutputDB ) -DelayLog.info( " ======================================================== " ) -####################################################################################### - - -include ("LArConditionsCommon/LArMinimalSetup.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - DelayLog.info( "No FullFileName! Please give a FullFileName list.") - theApp.exit(-1) -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -# else # -# svcMgr.EventSelector.Input=OneFileName # -# for i in range(len(svcMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -from LArByteStream.LArByteStreamConf import LArRodDecoder -svcMgr.ToolSvc += LArRodDecoder() - -#ToolSvc.LArRodDecoder.BEPreselection = [0] ## : [Barrel=0,Endcap=1] -#ToolSvc.LArRodDecoder.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) -#ToolSvc.LArRodDecoder.FTNumPreselection = [6] ## : [FCAL feedthrough number] - - -########################################################################### -# # -# Accumulator # -# # -########################################################################### - -if ( runAccumulator ) : - # this is a OLD jobOptions which can maybe work but only for the barrel # - # can be used as a skeleton if needed but # - # need to be updated for the barrel and the patterns for EMEC, HEC and FCAL need to be added # - include("LArCalibProcessing/LArCalib_CalibrationPatterns.py") - -else: - theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -#include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") -#from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher -#theLArBadEventCatcher=LArBadEventCatcher() -#theLArBadEventCatcher.CheckAccCalibDigitCont=True -#theLArBadEventCatcher.CheckBSErrors=True -#theLArBadEventCatcher.KeyList=GainList -#theLArBadEventCatcher.StopOnError=False -#topSequence+=theLArBadEventCatcher - -########################################################################## -# # -# Delay run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -if not 'InputBadChannelSQLiteFile' in dir(): - DelayLog.info( "Read Bad Channels from Oracle DB") -else : - DelayLog. info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond09_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - if StripsXtalkCorr: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolderXtlk+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - -if (SubtractPed): - if ( ReadPedFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - DelayLog.info( "Read Pedestal from Oracle DB") - else : - DelayLog.info( "Read Pedestal from SQLite file") - - PedestalFolder = LArCalib_Flags.LArPedestalFolder - if 'PedLArCalibFolderTag' in dir() : - PedestalTagSpec = LArCalibFolderTag (PedestalFolder,PedLArCalibFolderTag) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else : - conddb.addFolder("",PedestalFolder+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else: - if 'InputPedPoolFileName' in dir(): - DelayLog.info( "Read Pedestal from POOL file") - PoolFileList += [ InputPedPoolFileDir+"/"+InputPedPoolFileName ] - - else: - DelayLog.info( "LArCaliWaveBuilder WARNING : Using fake pedestals subtraction for all channels.") - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( ShortCorrector ): - - from LArCalibUtils.LArCalibUtilsConf import LArCalibShortCorrector - theLArCalibShortCorrector = LArCalibShortCorrector() - theLArCalibShortCorrector.KeyList = GainList - theLArCalibShortCorrector.OutputLevel=INFO - topSequence +=theLArCalibShortCorrector - -if ( StripsXtalkCorr ) : - - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"] - ) - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine"] - ) - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - -# Now the complicated part, splitter or not -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilder -if ( AllWavesPerCh ) : - ContNameSplitted = [] - for i in range(0, MaxCalLinePerCh): - ContNameSplitted.append("CalLine"+str(i)) - - from LArCalibUtils.LArCalibUtilsConf import LArAccumulatedCalibDigitContSplitter - LArAccumulatedCalibDigitContSplitter = LArAccumulatedCalibDigitContSplitter("LArAccumulatedCalibDigitContSplitter") - LArAccumulatedCalibDigitContSplitter.KeyList = GainList - LArAccumulatedCalibDigitContSplitter.KeyOutputList = ContNameSplitted - LArAccumulatedCalibDigitContSplitter.NumberSplitted = MaxCalLinePerCh - LArAccumulatedCalibDigitContSplitter.OutputLevel = ERROR - topSequence += LArAccumulatedCalibDigitContSplitter - - LArCaliWaveBuilderVec = [] - if(doCaliWaveSelector): - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelVec = [] - - for i in range(0, MaxCalLinePerCh): - topSequence += LArCaliWaveBuilder("LArCaliWaveBuilder"+str(i+1)) - exec 'LArCaliWaveBuilderVec.append( topSequence.LArCaliWaveBuilder%(fn)s )' % {'fn' :i+1} - LArCaliWaveBuilderVec[i].KeyList = [ ContNameSplitted[i] ] - LArCaliWaveBuilderVec[i].KeyOutput = KeyOutputSplitted[i] - LArCaliWaveBuilderVec[i].ADCsaturation = ADCsaturation - LArCaliWaveBuilderVec[i].GroupingType = GroupingType - LArCaliWaveBuilderVec[i].SubtractPed = SubtractPed - LArCaliWaveBuilderVec[i].CheckEmptyPhases= CheckEmptyPhases - LArCaliWaveBuilderVec[i].NBaseline = 0 -# LArCaliWaveBuilderVec[i].RecAllCells = RecAll - LArCaliWaveBuilderVec[i].UseDacAndIsPulsedIndex = True - LArCaliWaveBuilderVec[i].OutputLevel = ERROR - if(doCaliWaveSelector): - topSequence += LArCaliWaveSelector("LArCaliWaveSelector"+str(i+1)) - exec 'LArCaliWaveSelVec.append( topSequence.LArCaliWaveSelector%(fn)s )' % {'fn' :i+1} - LArCaliWaveSelVec[i].KeyList = [ KeyOutputSplitted[i] ] - LArCaliWaveSelVec[i].KeyOutput = KeyOutputSplitted[i]+"Sel" - LArCaliWaveSelVec[i].SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - LArCaliWaveSelVec[i].SelectionList += [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230"] - LArCaliWaveSelVec[i].SelectionList += [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000"] - LArCaliWaveSelVec[i].OutputLevel = ERROR - -else : - LArCaliWaveBuilder = LArCaliWaveBuilder() - LArCaliWaveBuilder.KeyList = GainList - LArCaliWaveBuilder.KeyOutput = KeyOutput - LArCaliWaveBuilder.GroupingType = GroupingType - LArCaliWaveBuilder.SubtractPed = SubtractPed - LArCaliWaveBuilder.CheckEmptyPhases = CheckEmptyPhases - LArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing - LArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC - - if StripsXtalkCorr: - LArCaliWaveBuilder.ADCsaturation = 0 - else: - LArCaliWaveBuilder.ADCsaturation = ADCsaturation - - topSequence+=LArCaliWaveBuilder - - if (doCaliWaveSelector) : - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelector = LArCaliWaveSelector("LArCaliWaveSelector") - LArCaliWaveSelector.KeyList = [ KeyOutput ] - LArCaliWaveSelector.KeyOutput = KeyOutput+"Sel" - LArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ] - LArCaliWaveSelector.SelectionList += [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - LArCaliWaveSelector.SelectionList += [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ] - - topSequence+=LArCaliWaveSelector - -###################################################################### -# # -# Correction # -# # -###################################################################### -# Not done on splitted caliwaves yet -if CorrectBadChannels: - - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ - theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") - theLArCaliWavePatcher.ContainerKey=KeyOutput - #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour - theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event - theLArCaliWavePatcher.OutputLevel=INFO - theLArCaliWavePatcher.ProblemsToPatch=[ - "deadCalib","deadReadout","deadPhys","almostDead","short", - ] - topSequence+=theLArCaliWavePatcher - -########################################################################## -# # -# Output # -# # -########################################################################## - -if ( doLArCalibDataQuality ) : - - from LArCalibDataQuality.LArCalibDataQualityConf import LArCaliWaveValidationAlg - theCaliWaveValidationAlg=LArCaliWaveValidationAlg() - theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theCaliWaveValidationAlg.ValidationKey=KeyOutput - theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef" - theCaliWaveValidationAlg.MsgLevelForDeviations=INFO - theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt" - topSequence+=theCaliWaveValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadCaliWave=LArCaliWaveValidationAlg("theBadCaliWave") - theBadCaliWave.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadCaliWave.ValidationKey=KeyOutput - theBadCaliWave.ReferenceKey="LArCaliWaveRef" - theBadCaliWave.MsgLevelForDeviations=INFO - theBadCaliWave.ListOfDevFEBs="Bad_caliWaveFebs.txt" - topSequence+=theBadCaliWave - - -if ( doMonitoring ) : - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## old style - #LArMon.FileKey = "AllMon" - #LArMon.ManualDataTypeSetup = True - #LArMon.Environment = "user" - #LArMon.ManualRunLBSetup = True - #LArMon.Run = 1 - #LArMon.LumiBlock = 1 - #LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputCaliWaveRootFileDir + "/" +RootHistOutputFileName) - svcMgr += THistSvc() - #svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - svcMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - if ( AllWavesPerCh ) : - LArCaliWaves2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - thisAlgo = "LArCaliWaves2Ntuple"+str(i+1) - topSequence += LArCaliWaves2Ntuple(thisAlgo) - exec 'LArCaliWaves2NtupleVec.append( topSequence.LArCaliWaves2Ntuple%(fn)s )' % {'fn': i+1} - LArCaliWaves2NtupleVec[i].NtupleName = "CALIWAVE"+str(i+1) - if (doCaliWaveSelector): - LArCaliWaves2NtupleVec[i].KeyList = [ KeyOutputSplitted[i]+"Sel" ] - else: - LArCaliWaves2NtupleVec[i].KeyList = [ KeyOutputSplitted[i] ] - LArCaliWaves2NtupleVec[i].SaveJitter = SaveJitter - LArCaliWaves2NtupleVec[i].SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2NtupleVec[i].AddFEBTempInfo = False - - else : - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.AddFEBTempInfo = False - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - if (doCaliWaveSelector): - LArCaliWaves2Ntuple.KeyList = [ KeyOutput+"Sel" ] - else: - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - if not hasattr(svcMgr, 'NTupleSvc'): - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - if os.path.exists(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName) - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName): - os.remove(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName, - OutputObjectSpecCaliWave,[OutputTagSpecCaliWave],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -ToolSvc += theLArAutoCorrDecoderTool - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg -if ( AllWavesPerCh ) : - LArCaliOFCAlgVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence+=LArOFCAlg("LArCaliOFCAlg"+str(i+1)) - exec 'LArCaliOFCAlgVec.append( topSequence.LArCaliOFCAlg%(fn)s )' % {'fn' :i+1} - - LArCaliOFCAlgVec[i].ReadCaliWave = True - LArCaliOFCAlgVec[i].KeyList = [ ContainerKeySplitted[i] ] - LArCaliOFCAlgVec[i].Nphase = Nphases - LArCaliOFCAlgVec[i].Dphase = Dphases - LArCaliOFCAlgVec[i].Ndelay = Ndelays - LArCaliOFCAlgVec[i].Nsample = Nsamples - LArCaliOFCAlgVec[i].Normalize = Normalize - LArCaliOFCAlgVec[i].TimeShift = TimeShift - LArCaliOFCAlgVec[i].TimeShiftByIndex = TimeShiftByIndex - LArCaliOFCAlgVec[i].Verify = True - LArCaliOFCAlgVec[i].KeyOFC = OFCKeySplitted[i] # this is also the key for the output LArOFCComplete - LArCaliOFCAlgVec[i].FillShape = FillShape - LArCaliOFCAlgVec[i].KeyShape = ShapeKeySplitted[i] # this is the key for the output LArShapeComplete - if ( DumpOFC ) : - LArCaliOFCAlgVec[i].DumpOFCfile = "LArOFCCali"+str(i+1)+".dat" - LArCaliOFCAlgVec[i].GroupingType = GroupingType - LArCaliOFCAlgVec[i].DecoderTool=theLArAutoCorrDecoderTool - -else: - LArCaliOFCAlg = LArOFCAlg("LArCaliOFCAlg") - LArCaliOFCAlg.ReadCaliWave = True - LArCaliOFCAlg.KeyList = [ ContainerKey ] - LArCaliOFCAlg.Nphase = Nphases - LArCaliOFCAlg.Dphase = Dphases - LArCaliOFCAlg.Ndelay = Ndelays - LArCaliOFCAlg.Nsample = Nsamples - LArCaliOFCAlg.Normalize = Normalize - LArCaliOFCAlg.TimeShift = TimeShift - LArCaliOFCAlg.TimeShiftByIndex = TimeShiftByIndex - LArCaliOFCAlg.Verify = True - LArCaliOFCAlg.FillShape = FillShape - if ( DumpOFC ) : - LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat" - LArCaliOFCAlg.GroupingType = GroupingType - LArCaliOFCAlg.DecoderTool=theLArAutoCorrDecoderTool - topSequence+=LArCaliOFCAlg - - -########################################################################### -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName): - os.remove(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName) - OutputConditionsAlgOFC = OutputConditionsAlg("OutputConditionsAlgOFC",OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName, - OutputObjectSpecOFC,[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlgOFC.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgOFC.Run2 = IOVEnd - - if ( FillShape ): - - if os.path.exists(OutputShapePoolFileDir+"/"+OutputShapePoolFileName): - os.remove(OutputShapePoolFileDir+"/"+OutputShapePoolFileName) - OutputConditionsAlgShape = OutputConditionsAlg("OutputConditionsAlgShape",OutputShapePoolFileDir+"/"+OutputShapePoolFileName, - OutputObjectSpecShape,[OutputObjectSpecTagShape],WriteIOV) - OutputConditionsAlgShape.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgShape.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - if ( AllWavesPerCh ) : - LArOFC2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence += LArOFC2Ntuple("LArOFC2Ntuple"+str(i+1)) - exec 'LArOFC2NtupleVec.append( topSequence.LArOFC2Ntuple%(fn)s )' % {'fn': i+1} - LArOFC2NtupleVec[i].ContainerKey = OFCKeySplitted[i] - LArOFC2NtupleVec[i].NtupleName = "OFC"+str(i+1) - else: - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.ContainerKey = OFCKey - topSequence+=LArOFC2Ntuple - - if ( FillShape ): - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - if ( AllWavesPerCh ) : - LArOFC2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence += LArShape2Ntuple("LArOFC2Ntuple"+str(i+1)) - exec 'LArShape2NtupleVec.append( topSequence.LArShape2Ntuple%(fn)s )' % {'fn': i+1} - LArShape2NtupleVec[i].ContainerKey = ShapeKeySplitted[i] - LArShape2NtupleVec[i].NtupleName = "SHAPE"+str(i+1) - else: - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = ShapeKey - topSequence+=LArShape2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -########################################################################### -conddb.blockFolder("/CALO/Identifier/CaloTTOnAttrIdMapAtlas") -conddb.blockFolder("/CALO/Identifier/CaloTTOnOffIdMapAtlas") -conddb.blockFolder("/CALO/Identifier/CaloTTPpmRxIdMapAtlas") -conddb.blockFolder("/LAR/Identifier/LArTTCellMapAtlas") -########################################################################### - -svcMgr.MessageSvc.OutputLevel = DEBUG -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py deleted file mode 100644 index fcad8c8c184e92eaf931931cdc5f9066b1f994e6..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py +++ /dev/null @@ -1,622 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to reconstruction a DELAY runs in all 3 gains -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0029143' ] - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Delay" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = False - -if not 'FullFileName' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Delay"+".*"+Partition - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -####################################################### -# Delay properties -####################################################### - -if not 'DACs' in dir(): - DACs = [500] # Needed if runAccumulator = True - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'ShortCorrector' in dir(): - ShortCorrector = True # correctio for short - -if not "ADCSaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses otherwise 4095 - -if not 'SubtractPed' in dir(): # Set whether to substract pedestals. Pedestals come from COOL, or local Pool file if 'PedPoolFileName' is defined, or fake pedestal subraction as 'extrema ratio' - SubtractPed = True - -if not 'CheckEmptyPhases' in dir(): - CheckEmptyPhases = True - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=True - - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -## Pedestall - -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber)+"_"+Partition.replace("*","") + ".pool.root" - -## Output - -if not 'LArCalibFolderOutputTag' in dir(): - rs=FolderTagResover() - LArCalibFolderOutputTag = rs.getFolderTagSuffix(LArCalib_Flags.LArShapeCaliWaveFolder) - del rs - - -if not 'OutputCaliWaveRootFileDir' in dir(): - OutputCaliWaveRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputCaliWavePoolFileDir' in dir(): - OutputCaliWavePoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if not 'BaseFileName' in dir(): - BaseFileName = "LArCaliWave" - -if StripsXtalkCorr : - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") +"_StripsXtalkCorr" -else : - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileName+".root" - -if not 'OutputCaliWavePoolFileName' in dir(): - OutputCaliWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - if StripsXtalkCorr: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolderXtlk - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolderXtlk,LArCalibFolderOutputTag) - else: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -####################################################################################### -# print summary -####################################################################################### - -DelayLog = logging.getLogger( "DelayLog" ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " *** LAr Delay summary *** " ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " RunNumber = "+str(RunNumberList) ) -DelayLog.info( " SubDetector = "+SubDet ) -DelayLog.info( " Partition = "+Partition ) -DelayLog.info( " Type = Delay " ) -DelayLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - DelayLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - DelayLog.info( " InputDBConnectionPed = "+InputDBConnectionPed) -else : - DelayLog.info( " InputPedPoolFileName = "+InputPedPoolFileName) -if 'PedLArCalibFolderTag' in dir() : - DelayLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -DelayLog.info( " OutputCaliWaveRootFullFileName = "+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName ) -DelayLog.info( " OutputCaliWavePoolFullFileName = "+OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName ) -DelayLog.info( " OutputObjectSpecCaliWave = "+OutputObjectSpecCaliWave ) -DelayLog.info( " OutputTagSpecCaliWave = "+OutputTagSpecCaliWave ) -DelayLog.info( " IOVBegin = "+str(IOVBegin) ) -DelayLog.info( " IOVEnd = "+str(IOVEnd) ) -DelayLog.info( " LArCalibOutputDB = "+OutputDB ) -DelayLog.info( " ======================================================== " ) -####################################################################################### - - -include ("LArConditionsCommon/LArMinimalSetup.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - DelayLog.info( "No FullFileName! Please give a FullFileName list.") - theApp.exit(-1) -else : - svcMgr.EventSelector.Input=FullFileName - -scvMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -# else # -# svcMgr.EventSelector.Input=OneFileName # -# for i in range(len(svcMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -from LArByteStream.LArByteStreamConf import LArRodDecoder -svcMgr.ToolSvc += LArRodDecoder() - -#ToolSvc.LArRodDecoder.BEPreselection = [0] ## : [Barrel=0,Endcap=1] -#ToolSvc.LArRodDecoder.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) -#ToolSvc.LArRodDecoder.FTNumPreselection = [6] ## : [FCAL feedthrough number] - - -########################################################################### -# # -# Accumulator # -# # -########################################################################### - -if ( runAccumulator ) : - # this is a OLD jobOptions which can maybe work but only for the barrel # - # can be used as a skeleton if needed but # - # need to be updated for the barrel and the patterns for EMEC, HEC and FCAL need to be added # - include("LArCalibProcessing/LArCalib_CalibrationPatterns.py") - -else: - theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") -topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False -from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher -theLArBadEventCatcher=LArBadEventCatcher() -theLArBadEventCatcher.CheckAccCalibDigitCont=True -theLArBadEventCatcher.CheckBSErrors=True -theLArBadEventCatcher.KeyList=GainList -theLArBadEventCatcher.StopOnError=False -topSequence+=theLArBadEventCatcher - -########################################################################## -# # -# Delay run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - DelayLog.info( "Read Bad Channels from Oracle DB") -else : - DelayLog. info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - if StripsXtalkCorr: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolderXtlk+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - -if (SubtractPed): - if ( ReadPedFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - DelayLog.info( "Read Pedestal from Oracle DB") - else : - DelayLog.info( "Read Pedestal from SQLite file") - - PedestalFolder = LArCalib_Flags.LArPedestalFolder - if 'PedLArCalibFolderTag' in dir() : - PedestalTagSpec = LArCalibFolderTag (PedestalFolder,PedLArCalibFolderTag) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else : - conddb.addFolder("",PedestalFolder+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else: - if 'InputPedPoolFileName' in dir(): - DelayLog.info( "Read Pedestal from POOL file") - PoolFileList += [ InputPedPoolFileDir+"/"+InputPedPoolFileName ] - - else: - DelayLog.info( "LArCaliWaveBuilder WARNING : Using fake pedestals subtraction for all channels.") - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( ShortCorrector ): - - from LArCalibUtils.LArCalibUtilsConf import LArCalibShortCorrector - theLArCalibShortCorrector = LArCalibShortCorrector() - theLArCalibShortCorrector.KeyList = GainList - theLArCalibShortCorrector.OutputLevel=INFO - topSequence +=theLArCalibShortCorrector - -if ( StripsXtalkCorr ) : - - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"] - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine"] - - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilder -LArCaliWaveBuilder = LArCaliWaveBuilder() -LArCaliWaveBuilder.KeyList = GainList -if (doCaliWaveSelector) : - LArCaliWaveBuilder.KeyOutput = KeyOutput+"multi" -else : - LArCaliWaveBuilder.KeyOutput = KeyOutput -LArCaliWaveBuilder.GroupingType = GroupingType -LArCaliWaveBuilder.SubtractPed = SubtractPed -LArCaliWaveBuilder.CheckEmptyPhases = CheckEmptyPhases -LArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing -LArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC - -if StripsXtalkCorr: - LArCaliWaveBuilder.ADCsaturation = 0 -else: - LArCaliWaveBuilder.ADCsaturation = ADCsaturation - -topSequence+=LArCaliWaveBuilder - -if (doCaliWaveSelector) : - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelector = LArCaliWaveSelector("LArCaliWaveSelector") - LArCaliWaveSelector.KeyList = [ KeyOutput+"multi" ] - LArCaliWaveSelector.KeyOutput = KeyOutput - if (Gain=="HIGH") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ] - - if (Gain=="MEDIUM") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - - if (Gain=="LOW") : - LArCaliWaveSelector.SelectionList = [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ] - - topSequence+=LArCaliWaveSelector - -###################################################################### -# # -# Correction # -# # -###################################################################### - -if CorrectBadChannels: - - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ - theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") - theLArCaliWavePatcher.ContainerKey=KeyOutput - #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour - theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event - theLArCaliWavePatcher.OutputLevel=INFO - theLArCaliWavePatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"] - topSequence+=theLArCaliWavePatcher - -########################################################################## -# # -# Output # -# # -########################################################################## - -if ( doLArCalibDataQuality ) : - - from LArCalibDataQuality.LArCalibDataQualityConf import LArCaliWaveValidationAlg - svcMgr.ToolSvc+=theLArDelayValBCMask - from LArCalibDataQuality.Thresholds import cwFWHMThr, cwAmpThr,cwAmpThrFEB, cwFWHMThrFEB - theCaliWaveValidationAlg=LArCaliWaveValidationAlg("CaliWaveVal") - theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theCaliWaveValidationAlg.ValidationKey=KeyOutput - theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef" - theCaliWaveValidationAlg.MsgLevelForDeviations=WARNING - theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt" - theCaliWaveValidationAlg.AmplitudeTolerance=cwAmpThr - theCaliWaveValidationAlg.CaliWaveFWHMTolerance=cwFWHMThr - theCaliWaveValidationAlg.AmplitudeToleranceFEB=cwAmpThrFEB - theCaliWaveValidationAlg.CaliWaveFWHMToleranceFEB=cwFWHMThrFEB - topSequence+=theCaliWaveValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadCaliWave=LArCaliWaveValidationAlg("theBadCaliWave") - theBadCaliWave.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadCaliWave.ValidationKey=KeyOutput - theBadCaliWave.ReferenceKey="LArCaliWaveRef" - theBadCaliWave.MsgLevelForDeviations=ERROR - theBadCaliWave.ListOfDevFEBs="Bad_caliWaveFebs.txt" - theBadCaliWave.AmplitudeTolerance=["20,20,20"] - theBadCaliWave.CaliWaveFWHMTolerance=["50,50,50"] - theBadCaliWave.AmplitudeToleranceFEB=["10,10,10"] - theBadCaliWave.CaliWaveFWHMToleranceFEB=["80,80,80"] - theBadCaliWave.OutputLevel=DEBUG - topSequence+=theBadCaliWave - - -if ( doMonitoring ) : - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## old style - #LArMon.FileKey = "AllMon" - #LArMon.ManualDataTypeSetup = True - #LArMon.Environment = "user" - #LArMon.ManualRunLBSetup = True - #LArMon.Run = 1 - #LArMon.LumiBlock = 1 - #LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputCaliWaveRootFileDir + "/" +RootHistOutputFileName) - svcMgr += THistSvc() - #svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - svcMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.AddFEBTempInfo = False - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName): - os.remove(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName, - [OutputObjectSpecCaliWave],[OutputTagSpecCaliWave],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py deleted file mode 100644 index f164e96d906457baa7edbe74f1f74f2e6b29f30b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py +++ /dev/null @@ -1,698 +0,0 @@ -\from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <pavol@mail.cern.ch> -# -# jO to reconstruct a DELAY per calibration line -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "EndCap" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '00121536','00121539','00121542' ] - -if not 'AllWavesPerCh' in dir(): - AllWavesPerCh = True - -if not 'MaxCalLinePerCh' in dir(): - MaxCalLinePerCh = 4 - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Delay" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = False - -#if not 'RecAll' in dir(): -# RecAll = False - -if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Delay"+".*"+Partition - -if not 'FullFileName' in dir(): - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -####################################################### -# Delay properties -####################################################### - -if not 'DACs' in dir(): - DACs = [500] # Needed if runAccumulator = True - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'ShortCorrector' in dir(): - ShortCorrector = True # correctio for short - -if not "ADCSaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses otherwise 4095 - -if not 'SubtractPed' in dir(): # Set whether to substract pedestals. Pedestals come from COOL, or local Pool file if 'PedPoolFileName' is defined, or fake pedestal subraction as 'extrema ratio' - SubtractPed = True - -if not 'CheckEmptyPhases' in dir(): - CheckEmptyPhases = True - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=True - - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - -## Pedestall - -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber)+"_"+Partition.replace("*","") + ".pool.root" - -## Output - -if not 'LArCalibFolderOutputTag' in dir(): - rs=FolderTagResover() - LArCalibFolderOutputTag = rs.getFolderTagSuffix(LArCalib_Flags.LArCaliWaveFolder) - -if not 'OutputCaliWaveRootFileDir' in dir(): - OutputCaliWaveRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputCaliWavePoolFileDir' in dir(): - OutputCaliWavePoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if AllWavesPerCh: - KeyOutputSplitted = [] - for i in range(0, MaxCalLinePerCh): - KeyOutputSplitted.append(KeyOutput+str(i)) - -if not 'BaseFileName' in dir(): - BaseFileName = "LArCaliWave" - -for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber) - -if StripsXtalkCorr : - BaseFileName = BaseFileName+"_StripsXtalkCorr" - -if AllWavesPerCh: - BaseFileName = BaseFileName+"_single" -else: - BaseFileName = BaseFileName+"_averaged" - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileName+".root" - -if not 'OutputCaliWavePoolFileName' in dir(): - OutputCaliWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - if StripsXtalkCorr: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolderXtlk] - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolderXtlk,LArCalibFolderOutputTag) - else: - if ( AllWavesPerCh ) : - OutputObjectSpecCaliWave = [] - OutputTagSpecCaliWave = [] - for i in range(0, MaxCalLinePerCh): - if doCaliWaveSelector: - OutputObjectSpecCaliWave.append("LArCaliWaveContainer#"+KeyOutputSplitted[i]+"Sel"+"#"+LArCalib_Flags.LArCaliWaveFolder+str(i)) - else: - OutputObjectSpecCaliWave.append("LArCaliWaveContainer#"+KeyOutputSplitted[i]+"#"+LArCalib_Flags.LArCaliWaveFolder+str(i)) - OutputTagSpecCaliWave.append(LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder+str(i),LArCalibFolderOutputTag)) - else: - if doCaliWaveSelector: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"Sel"+"#"+LArCalib_Flags.LArCaliWaveFolder] - else: - OutputObjectSpecCaliWave = ["LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder] - OutputTagSpecCaliWave = [LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibFolderOutputTag)] - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -####################################################################################### -# print summary -####################################################################################### - -DelayLog = logging.getLogger( "DelayLog" ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " *** LAr Delay summary *** " ) -DelayLog.info( " ======================================================== " ) -DelayLog.info( " RunNumber = "+str(RunNumberList) ) -DelayLog.info( " SubDetector = "+SubDet ) -DelayLog.info( " Partition = "+Partition ) -DelayLog.info( " Type = Delay " ) -DelayLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - DelayLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - DelayLog.info( " InputDBConnectionPed = "+InputDBConnectionPed) -else : - DelayLog.info( " InputPedPoolFileName = "+InputPedPoolFileName) -if 'PedLArCalibFolderTag' in dir() : - DelayLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -DelayLog.info( " OutputCaliWaveRootFullFileName = "+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName ) -DelayLog.info( " OutputCaliWavePoolFullFileName = "+OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName ) -#DelayLog.info( " OutputObjectSpecCaliWave = "+OutputObjectSpecCaliWave ) -##DelayLog.info( " OutputTagSpecCaliWave = "+OutputTagSpecCaliWave ) -DelayLog.info( " IOVBegin = "+str(IOVBegin) ) -DelayLog.info( " IOVEnd = "+str(IOVEnd) ) -DelayLog.info( " LArCalibOutputDB = "+OutputDB ) -DelayLog.info( " ======================================================== " ) -####################################################################################### - - -include ("LArConditionsCommon/LArMinimalSetup.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - DelayLog.info( "No FullFileName! Please give a FullFileName list.") - theApp.exit(-1) -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -# else # -# svcMgr.EventSelector.Input=OneFileName # -# for i in range(len(svcMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -from LArByteStream.LArByteStreamConf import LArRodDecoder -svcMgr.ToolSvc += LArRodDecoder() - -#ToolSvc.LArRodDecoder.BEPreselection = [0] ## : [Barrel=0,Endcap=1] -#ToolSvc.LArRodDecoder.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) -#ToolSvc.LArRodDecoder.FTNumPreselection = [6] ## : [FCAL feedthrough number] - - -########################################################################### -# # -# Accumulator # -# # -########################################################################### - -if ( runAccumulator ) : - # this is a OLD jobOptions which can maybe work but only for the barrel # - # can be used as a skeleton if needed but # - # need to be updated for the barrel and the patterns for EMEC, HEC and FCAL need to be added # - include("LArCalibProcessing/LArCalib_CalibrationPatterns.py") - -else: - theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") -#from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher -#theLArBadEventCatcher=LArBadEventCatcher() -#theLArBadEventCatcher.CheckAccCalibDigitCont=True -#theLArBadEventCatcher.CheckBSErrors=True -#theLArBadEventCatcher.KeyList=GainList -#theLArBadEventCatcher.StopOnError=False -#topSequence+=theLArBadEventCatcher - -########################################################################## -# # -# Delay run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -if not 'InputBadChannelSQLiteFile' in dir(): - DelayLog.info( "Read Bad Channels from Oracle DB") -else : - DelayLog. info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond09_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - if StripsXtalkCorr: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolderXtlk+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWaveRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - -if (SubtractPed): - if ( ReadPedFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - DelayLog.info( "Read Pedestal from Oracle DB") - else : - DelayLog.info( "Read Pedestal from SQLite file") - - PedestalFolder = LArCalib_Flags.LArPedestalFolder - if 'PedLArCalibFolderTag' in dir() : - PedestalTagSpec = LArCalibFolderTag (PedestalFolder,PedLArCalibFolderTag) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else : - conddb.addFolder("",PedestalFolder+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else: - if 'InputPedPoolFileName' in dir(): - DelayLog.info( "Read Pedestal from POOL file") - PoolFileList += [ InputPedPoolFileDir+"/"+InputPedPoolFileName ] - - else: - DelayLog.info( "LArCaliWaveBuilder WARNING : Using fake pedestals subtraction for all channels.") - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( ShortCorrector ): - - from LArCalibUtils.LArCalibUtilsConf import LArCalibShortCorrector - theLArCalibShortCorrector = LArCalibShortCorrector() - theLArCalibShortCorrector.KeyList = GainList - theLArCalibShortCorrector.OutputLevel=INFO - topSequence +=theLArCalibShortCorrector - -if ( StripsXtalkCorr ) : - - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=ProblemsToMask=["deadReadout","deadPhys","deadCalib","almostDead"] - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine"] - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - -# Now the complicated part, splitter or not -from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilder -if ( AllWavesPerCh ) : - ContNameSplitted = [] - for i in range(0, MaxCalLinePerCh): - ContNameSplitted.append("CalLine"+str(i)) - - from LArCalibUtils.LArCalibUtilsConf import LArAccumulatedCalibDigitContSplitter - LArAccumulatedCalibDigitContSplitter = LArAccumulatedCalibDigitContSplitter("LArAccumulatedCalibDigitContSplitter") - LArAccumulatedCalibDigitContSplitter.KeyList = GainList - LArAccumulatedCalibDigitContSplitter.KeyOutputList = ContNameSplitted - LArAccumulatedCalibDigitContSplitter.NumberSplitted = MaxCalLinePerCh - LArAccumulatedCalibDigitContSplitter.OutputLevel = ERROR - topSequence += LArAccumulatedCalibDigitContSplitter - - LArCaliWaveBuilderVec = [] - if(doCaliWaveSelector): - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelVec = [] - - for i in range(0, MaxCalLinePerCh): - topSequence += LArCaliWaveBuilder("LArCaliWaveBuilder"+str(i+1)) - exec 'LArCaliWaveBuilderVec.append( topSequence.LArCaliWaveBuilder%(fn)s )' % {'fn' :i+1} - LArCaliWaveBuilderVec[i].KeyList = [ ContNameSplitted[i] ] - LArCaliWaveBuilderVec[i].KeyOutput = KeyOutputSplitted[i] - LArCaliWaveBuilderVec[i].ADCsaturation = ADCsaturation - LArCaliWaveBuilderVec[i].GroupingType = GroupingType - LArCaliWaveBuilderVec[i].SubtractPed = SubtractPed - LArCaliWaveBuilderVec[i].CheckEmptyPhases= CheckEmptyPhases - LArCaliWaveBuilderVec[i].NBaseline = 0 -# LArCaliWaveBuilderVec[i].RecAllCells = RecAll - LArCaliWaveBuilderVec[i].UseDacAndIsPulsedIndex = True - LArCaliWaveBuilderVec[i].OutputLevel = ERROR - if(doCaliWaveSelector): - topSequence += LArCaliWaveSelector("LArCaliWaveSelector"+str(i+1)) - exec 'LArCaliWaveSelVec.append( topSequence.LArCaliWaveSelector%(fn)s )' % {'fn' :i+1} - LArCaliWaveSelVec[i].KeyList = [ KeyOutputSplitted[i] ] - LArCaliWaveSelVec[i].KeyOutput = KeyOutputSplitted[i]+"Sel" - LArCaliWaveSelVec[i].SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - LArCaliWaveSelVec[i].SelectionList += [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230"] - LArCaliWaveSelVec[i].SelectionList += [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000"] - LArCaliWaveSelVec[i].OutputLevel = ERROR - - #LArCaliWaveBuilderVec[3].OutputLevel = DEBUG - -else : - LArCaliWaveBuilder = LArCaliWaveBuilder() - LArCaliWaveBuilder.KeyList = GainList - LArCaliWaveBuilder.KeyOutput = KeyOutput - LArCaliWaveBuilder.GroupingType = GroupingType - LArCaliWaveBuilder.SubtractPed = SubtractPed - LArCaliWaveBuilder.CheckEmptyPhases = CheckEmptyPhases - LArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing - LArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC - - if StripsXtalkCorr: - LArCaliWaveBuilder.ADCsaturation = 0 - else: - LArCaliWaveBuilder.ADCsaturation = ADCsaturation - - topSequence+=LArCaliWaveBuilder - - if (doCaliWaveSelector) : - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveSelector - LArCaliWaveSelector = LArCaliWaveSelector("LArCaliWaveSelector") - LArCaliWaveSelector.KeyList = [ KeyOutput ] - LArCaliWaveSelector.KeyOutput = KeyOutput+"Sel" - LArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ] - LArCaliWaveSelector.SelectionList += [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"] - LArCaliWaveSelector.SelectionList += [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ] - - topSequence+=LArCaliWaveSelector - -###################################################################### -# # -# Correction # -# # -###################################################################### -# Not done on splitted caliwaves yet -if CorrectBadChannels: - - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ - theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") - theLArCaliWavePatcher.ContainerKey=KeyOutput - #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour - theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event - theLArCaliWavePatcher.OutputLevel=INFO - theLArCaliWavePatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"] - topSequence+=theLArCaliWavePatcher - -########################################################################## -# # -# Output # -# # -########################################################################## - -if ( doLArCalibDataQuality ) : - - from LArCalibDataQuality.LArCalibDataQualityConf import LArCaliWaveValidationAlg - theCaliWaveValidationAlg=LArCaliWaveValidationAlg() - theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theCaliWaveValidationAlg.ValidationKey=KeyOutput - theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef" - theCaliWaveValidationAlg.MsgLevelForDeviations=INFO - theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt" - topSequence+=theCaliWaveValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadCaliWave=LArCaliWaveValidationAlg("theBadCaliWave") - theBadCaliWave.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadCaliWave.ValidationKey=KeyOutput - theBadCaliWave.ReferenceKey="LArCaliWaveRef" - theBadCaliWave.MsgLevelForDeviations=INFO - theBadCaliWave.ListOfDevFEBs="Bad_caliWaveFebs.txt" - topSequence+=theBadCaliWave - - -if ( doMonitoring ) : - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## old style - #LArMon.FileKey = "AllMon" - #LArMon.ManualDataTypeSetup = True - #LArMon.Environment = "user" - #LArMon.ManualRunLBSetup = True - #LArMon.Run = 1 - #LArMon.LumiBlock = 1 - #LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputCaliWaveRootFileDir + "/" +RootHistOutputFileName) - svcMgr += THistSvc() - #svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - svcMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputCaliWaveRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - if ( AllWavesPerCh ) : - LArCaliWaves2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - thisAlgo = "LArCaliWaves2Ntuple"+str(i+1) - topSequence += LArCaliWaves2Ntuple(thisAlgo) - exec 'LArCaliWaves2NtupleVec.append( topSequence.LArCaliWaves2Ntuple%(fn)s )' % {'fn': i+1} - LArCaliWaves2NtupleVec[i].NtupleName = "CALIWAVE"+str(i+1) - if (doCaliWaveSelector): - LArCaliWaves2NtupleVec[i].KeyList = [ KeyOutputSplitted[i]+"Sel" ] - else: - LArCaliWaves2NtupleVec[i].KeyList = [ KeyOutputSplitted[i] ] - LArCaliWaves2NtupleVec[i].SaveJitter = SaveJitter - LArCaliWaves2NtupleVec[i].SaveDerivedInfo = SaveDerivedInfo - - #LArCaliWaves2NtupleVec[3].OutputLevel=DEBUG - - else : - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - if (doCaliWaveSelector): - LArCaliWaves2Ntuple.KeyList = [ KeyOutput+"Sel" ] - else: - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - if not hasattr(svcMgr, 'NTupleSvc'): - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - if os.path.exists(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName) - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName): - os.remove(OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputCaliWavePoolFileDir+"/"+OutputCaliWavePoolFileName, - OutputObjectSpecCaliWave,OutputTagSpecCaliWave,WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_CaliWaveMerger_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_CaliWaveMerger_jobOptions.py deleted file mode 100644 index fe03f4e6ed48a0dfb54c6fb1c370d4b778d0fa40..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_CaliWaveMerger_jobOptions.py +++ /dev/null @@ -1,103 +0,0 @@ -########################################################################### -# -# Example jobOptions to merge several LArCaliWaveContainers into one -# -# Last update: 28/4/2006 (Marco.Delmastro@cern.ch) -# -########################################################################### - -PoolFileList = [ "LArDelay_3144.pool.root" , - "LArDelay_3462.pool.root" ] - -ContainerKeyList = [ "3144" , "3462" ] - -Outdir = "./" - -WriteNtuple = True -RootFileName = Outdir+"LArCaliWaveMerger.root" - -WritePOOLFile = True -POOLFileName = Outdir+"LArCaliWaveMerger.pool.root" -KeyOut = "LArCaliWave" - -########################################################################### - -# -# Detector description (LAr only, H8 CTB 2004) -# -include( "LArDetDescr/LArDetDescr_H8_joboptions.py" ) -DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) -DetDescrCnvSvc.DoIdChecks -DetDescrCnvSvc.LArIDFileName = "IdDictParser/IdDictLArCalorimeter_H8_2004.xml" - -ToolSvc = Service( "ToolSvc" ) - -from AthenaCommon.DetFlags import DetFlags -DetFlags.all_setOff() -DetFlags.em_setOn() - -# -# Read POOL file(s) -# -include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) -theApp.Dlls += ["EventSelectorAthenaPool"] -theApp.Dlls += ["LArAthenaPoolPoolCnv"] -theApp.Dlls += ["LArCondAthenaPoolPoolCnv"] - -CondProxyProvider = Service( "CondProxyProvider" ) -ProxyProviderSvc = Service( "ProxyProviderSvc" ) -ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -CondProxyProvider.InputCollections = PoolFileList - -EventPersistencySvc = Service( "EventPersistencySvc" ) -EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ] - -# -# Merge LArCaliWaveContainers -# -theApp.Dlls += ["LArCalibUtils"] -theApp.TopAlg += ["LArCaliWaveMerger"] -LArCaliWaveMerger=Algorithm("LArCaliWaveMerger") -LArCaliWaveMerger.KeyList = ContainerKeyList -LArCaliWaveMerger.KeyOutput = KeyOut -LArCaliWaveMerger.OutputLevel = DEBUG - -if ( WriteNtuple ) : - theApp.Dlls += ["LArCalibTools"] - theApp.TopAlg += [ "LArWaves2Ntuple/LArCaliWaves2Ntuple"] - LArCaliWaves2Ntuple = Algorithm( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = [ KeyOut ] - - theApp.Dlls += [ "RootHistCnv" ] - theApp.HistogramPersistency = "ROOT" - NTupleSvc = Service( "NTupleSvc" ) - NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -if ( WritePOOLFile ) : - include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) - theApp.Dlls += [ "LArAthenaPoolPoolCnv" ] - theApp.Dlls += [ "LArCondAthenaPoolPoolCnv" ] - - include("RegistrationServices/OutputConditionsAlg_jobOptions.py") - ToolSvc.ConditionsAlgStream.OutputFile = POOLFileName - - OutputConditionsAlg.ObjectList = [ "LArCaliWaveContainer#"+KeyOut] - -########################################################################### - -#AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -#AthenaEventLoopMgr.OutputLevel = WARNING - -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = INFO -MessageSvc.defaultLimit = 1000; - -#StoreGateSvc = Service("StoreGateSvc"); -#StoreGateSvc.dump = False - -########################################################################### - -theApp.EvtMax = 1 # Leave unchanged! - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge.py deleted file mode 100644 index aa060d9e91556229071d274587f2242b8aef59c5..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge.py +++ /dev/null @@ -1,203 +0,0 @@ -########################################################################### -# -# TopOptions to copy a complete set of conditions for a given run to -# one POOL file and one sqlite file -# -# Walter.Lampl@cern.ch -# -########################################################################### - - -import shutil, os,sys -from LArCalibProcessing.extractFolderInfo import * - -if 'dbname' not in dir(): - dbname="CONDBR2" - -if 'sqliteIn' not in dir(): - sqliteIn="freshConstants.db" - -if 'sqliteOut' not in dir(): - sqliteOut=sqliteIn+".out" - -inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname -outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname - - -if os.environ.has_key("CALIBMERGE_PEEKRUN"): - peekrun=int(os.environ["CALIBMERGE_PEEKRUN"]) -else: - peekrun=2147483647 - -printfunc ("Peeking input database at run",peekrun) - -folderInfo=extractFolderInfo(inputDB,runnumber=peekrun) - -mergeFoldersRec=["/LAR/ElecCalibOfl/Pedestals/Pedestal", - "/LAR/ElecCalibOfl/Ramps/RampLinea", - "/LAR/ElecCalibOfl/MphysOverMcal/RTM", - "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples1phase", - "/LAR/ElecCalibOfl/Shape/RTM/5samples1phase" - ] - -mergeFoldersCalib=["/LAR/ElecCalibOfl/AutoCorrs/AutoCorr", - "/LAR/ElecCalibOfl/AutoCorrs/PhysicsAutoCorr", - "/LAR/ElecCalibOfl/CaliPulseParams/RTM", - "/LAR/ElecCalibOfl/DetCellParams/RTM", - "/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts", - #"/LAR/ElecCalibOfl/OFC/CaliWave", - #"/LAR/ElecCalibOfl/OFC/CaliWaveXtalkCorr" - ] - - -shutil.copyfile(sqliteIn,sqliteOut) - - -DuplicateKeyInputPedestal = "" -DuplicateKeyInputRamp = "" -DuplicateKeyInputMphysMcali = "" -DuplicateKeyInputOFC = [] -DuplicateKeyInputShape = "" - -if not "DuplicateConstants" in dir(): - DuplicateConstants = True - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -theApp.EvtMax = 1 -conddb.setGlobalTag("COMCOND-BLKPA-006-01") #For id mapping - -svcMgr.PoolSvc.SortReplicas=False - -runNoForFileName=2147483647 - -outObjectsRec=[] -outTagsRec=[] - -outObjectsCalib=[] -outTagsCalib=[] - -sgKeys=dict() -for f in folderInfo: - fn=f[0] - type=f[1] - key=f[2] - tag=f[3] - since=f[4] - until=f[5] - printfunc ("Working on folder",fn,"Tag",tag,"Type",type,"Key",key#,"IOV:",since,"-",until) - - if sgKeys.has_key(type): - if key in sgKeys[type]: - printfunc ("StoreGate key",key,"appeared multiple times for type",type,) - key=key+str(len(sgKeys[type])) - printfunc ("Changed to",key) - pass - sgKeys[type].append(key) - pass - else: - sgKeys[type]=[key,] - - if fn in mergeFoldersRec: - if since>0 and since<runNoForFileName: - runNoForFileName=since - outObjectsRec+=["#".join((type,key,fn))] - outTagsRec+=[tag] - conddb.addFolder("",fn+"<tag>"+tag+"</tag><key>"+key+"</key><db>"+inputDB+"</db>") - elif fn in mergeFoldersCalib: - if since>0 and since<runNoForFileName: - runNoForFileName=since - outObjectsCalib+=["#".join((type,key,fn))] - outTagsCalib+=[tag] - conddb.addFolder("",fn+"<tag>"+tag+"</tag><key>"+key+"</key><db>"+inputDB+"</db>") - - #set keys for DuplicateConstatns - if fn in mergeFoldersRec: - if fn.find("Pedestal")>0: DuplicateKeyInputPedestal = key - elif fn.find("Ramp")>0: DuplicateKeyInputRamp = key - elif fn.find("MphysOverMcal")>0: DuplicateKeyInputMphysMcali = key - elif fn.find("Shape")>0: DuplicateKeyInputShape = key - elif fn.find("OFC")>0: DuplicateKeyInputOFC.append(key) #Can have more than one OFC folder - pass - -if len(DuplicateKeyInputOFC)==0: DuplicateKeyInputOFC.append("") - -svcMgr.EventSelector.RunNumber = peekrun - -OutputFileRec="LArConditionsRec_"+str(runNoForFileName)+".pool.root" -if os.access(OutputFileRec,os.F_OK): - printfunc ("File",OutputFileRec,"exists already, removing ....") - os.remove(OutputFileRec) - -OutputFileCalib="LArConditionsCalib_"+str(runNoForFileName)+".pool.root" -if os.access(OutputFileCalib,os.F_OK): - printfunc ("File",OutputFileCalib,"exists already, removing ....") - os.remove(OutputFileCalib) - - -printfunc (svcMgr.IOVDbSvc.Folders) - -printfunc ("============ Reco =============") -printfunc (outObjectsRec) -printfunc (outTagsRec) -printfunc ("============ Calib =============") -printfunc (outObjectsCalib) -printfunc (outTagsCalib) - -if len(outObjectsRec)==0 and len(outObjectsCalib)==0: - printfunc ("Nothing to do, exiting") - sys.exit(0) - -from LArCalibTools.LArCalibToolsConf import LArBlockCorrections -topSequence+=LArBlockCorrections() - -from LArCalibTools.LArCalibToolsConf import ForceLoadCondObj -topSequence+=ForceLoadCondObj(ObjectList=outObjectsRec+outObjectsCalib) - - -if DuplicateConstants: - from LArCalibUtils.LArCalibUtilsConf import LArDuplicateConstants - lArDuplicateConstants=LArDuplicateConstants() - lArDuplicateConstants.KeyPedestal = DuplicateKeyInputPedestal - lArDuplicateConstants.KeyRamp = DuplicateKeyInputRamp - lArDuplicateConstants.KeyMphysMcali = DuplicateKeyInputMphysMcali - lArDuplicateConstants.KeyOFC = DuplicateKeyInputOFC[0] - lArDuplicateConstants.KeyShape = DuplicateKeyInputShape - topSequence+=lArDuplicateConstants - - for i in range(1,len(DuplicateKeyInputOFC)): - algname="LArDuplicateConstant%i"%i - nextDuplicateConstants=LArDuplicateConstants(algname, - KeyOFC=DuplicateKeyInputOFC[i]) - topSequence+=nextDuplicateConstants - - - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - -if len(outObjectsRec): - theOutputConditionsAlgRec=OutputConditionsAlg("OutputConditionsAlgRec",OutputFileRec, - outObjectsRec,outTagsRec,True) - theOutputConditionsAlgRec.Run1=runNoForFileName - -if len(outObjectsCalib): - theOutputConditionsAlgCalib=OutputConditionsAlg("OutputConditionsAlgCalib",OutputFileCalib, - outObjectsCalib,outTagsCalib,True) - - -svcMgr.IOVDbSvc.dbConnection = outputDB -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.RecreateFolders = False - -svcMgr.DetectorStore.Dump=True - - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge_SV.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge_SV.py deleted file mode 100644 index 7b78cf859a7ca6f7d5d34c1d469dcc29129ab310..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ConditionsMerge_SV.py +++ /dev/null @@ -1,102 +0,0 @@ -########################################################################### -# -# TopOptions to copy a complete set of conditions for a given run to -# one POOL file and one sqlite file -# -# Walter.Lampl@cern.ch -# -########################################################################### - - -import shutil, os -from LArCalibProcessing.extractFolderInfo import * - -if 'dbname' not in dir(): - dbname="CONDBR2" - -if 'sqliteIn' not in dir(): - sqliteIn="freshConstants_SV.db" - -if 'sqliteOut' not in dir(): - sqliteOut=sqliteIn+".out" - -inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname -outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname - -folderInfo=extractFolderInfo(inputDB) - - -shutil.copyfile(sqliteIn,sqliteOut) - - -mergeFoldersOFC=["/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples3bins17phases", - "/LAR/ElecCalibOfl/Shape/RTM/5samples3bins17phases" - ] - - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -theApp.EvtMax = 1 -conddb.setGlobalTag("COMCOND-ES1PST-004-01") #For id mapping - -svcMgr.PoolSvc.SortReplicas=False - - -outObjectsOFC=[] -outTagsOFC=[] - -runNoForFileName=0xFFFFFFFF - -for f in folderInfo: - fn=f[0] - type=f[1] - key=f[2] - tag=f[3] - since=f[4] - until=f[5] - if since>0 and since<runNoForFileName: - runNoForFileName=since - if fn in mergeFoldersOFC and 'mu_20' in tag: - outObjectsOFC+=["#".join((type,key,fn))] - outTagsOFC+=[tag] - conddb.addFolder("",fn+"<tag>"+tag+"</tag><db>"+inputDB+"</db>") - -svcMgr.EventSelector.RunNumber = 2147483647 - -OutputFileOFC="LArConditionsOFC_"+str(runNoForFileName)+".pool.root" -if os.access(OutputFileOFC,os.F_OK): - printfunc ("File",OutputFileOFC,"exists already, removing ....") - os.remove(OutputFileOFC) - - -printfunc (svcMgr.IOVDbSvc.Folders) - -printfunc ("============ Single bin OFC =============") -printfunc (outObjectsOFC) -printfunc (outTagsOFC) - -from LArCalibTools.LArCalibToolsConf import LArBlockCorrections -topSequence+=LArBlockCorrections() - -from LArCalibTools.LArCalibToolsConf import ForceLoadCondObj -topSequence+=ForceLoadCondObj(ObjectList=outObjectsOFC) - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlgOFC=OutputConditionsAlg("OutputConditionsAlgOFC",OutputFileOFC, - outObjectsOFC,outTagsOFC,True) - -svcMgr.IOVDbSvc.dbConnection = outputDB -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.DetectorStore.Dump=True - - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_FillOFCPhase.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_FillOFCPhase.py deleted file mode 100644 index 2e971644835b72429333021170b9eed1295f9a95..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_FillOFCPhase.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - -if 'inpFile' not in dir(): - inpFile="OFC_phase.dat" -if 'KeyOutput' not in dir(): - KeyOutput = "LArOFCPhase" -if 'isSC' not in dir(): - isSC=False -if 'hasID' not in dir(): - hasID=False -if 'DefaultPhase' not in dir(): - DefaultPhase=0 -if 'GroupType' not in dir(): - GroupType = "ExtendedSubDetector" -if 'Folder' not in dir(): - Folder = "/LAR/ElecCalibOfl/OFCBin/Dummy" -if 'Tag' not in dir(): - Tag="LArOFCPhase-01" -if 'outSqlite' not in dir(): - outSqlite="OFCPhase.db" -if 'outPool' not in dir(): - outPool="ofc_phase.pool.root" - -include ("LArConditionsCommon/LArMinimalSetup.py") - -svcMgr.EventSelector.Input = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -svcMgr.EventSelector.RunNumber=500000 -svcMgr.EventSelector.EventsPerRun=1; -svcMgr.MessageSvc.OutputLevel = WARNING -theApp.EvtMax = 1 - - -#-------------------------------------------------------------- -# 0. load conditions data -#-------------------------------------------------------------- -include( "LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py" ) -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -svcMgr.IOVDbSvc.OutputLevel = INFO -svcMgr.IOVDbSvc.GlobalTag = 'CONDBR2-BLKPA-RUN2-09' - -#IOVSvc = Service( "IOVSvc" ) -#IOVSvc.updateInterval = "JOB" -#IOVSvc.preLoadData=True -#IOVSvc.OutputLevel = DEBUG -# -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from LArCalibUtils.LArCalibUtilsConf import LArOFPhaseFill -LArOFPhaseFill = LArOFPhaseFill("LArOFPhaseFill") -LArOFPhaseFill.InputFile = inpFile -LArOFPhaseFill.keyOFCBin = KeyOutput -LArOFPhaseFill.isSC = isSC -LArOFPhaseFill.isID = hasID -LArOFPhaseFill.DefaultPhase = DefaultPhase -LArOFPhaseFill.GroupingType = GroupType -LArOFPhaseFill.OutputLevel = DEBUG -topSequence += LArOFPhaseFill -# -# Make an output -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -ObjectSpec = [ "LArOFCBinComplete#"+KeyOutput+"#"+Folder ] -TagSpec = [ Tag ] -OutputDB = "sqlite://X;schema="+outSqlite+";dbname=CONDBR2" -OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","./"+outPool, - ObjectSpec,TagSpec,True) -#OutputConditionsAlg.Run1 = 0 -#OutputConditionsAlg.Run2 = 0 - -topSequence += OutputConditionsAlg - - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = False -svcMgr.IOVDbSvc.dbConnection = OutputDB - -#-------------------------------------------------------------- -# initialize Athena, then go to first event -#-------------------------------------------------------------- -#theApp.initialize() -#theApp.nextEvent() -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 1000000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = ERROR) -svcMgr.DetectorStore.OutputLevel = DEBUG -svcMgr.DetectorStore.Dump=True - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py deleted file mode 100644 index 178b6813f62f3857c04c648412d8bcb688cbb53a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_HVCorr.py +++ /dev/null @@ -1,212 +0,0 @@ -################################################################# -# -# example jobOptions to read HV from Cool/DCS in athena -# and compute cell level correction factors to store in conditions -# database -# -################################################################## - -from time import strptime,time -from calendar import timegm - -#set date to compute the correction - -if "date" not in dir(): - date="2015-02-06:09:45:00" - - -if "TimeStamp" not in dir(): - try: - ts=strptime(date+'/UTC','%Y-%m-%d:%H:%M:%S/%Z') - TimeStamp=int(timegm(ts))*1000000000 - except ValueError: - printfunc ("ERROR in time specification, use e.g. 2007-05-25:14:01:00") - - -from LArCalibProcessing.TimeStampToRunLumi import TimeStampToRunLumi - -rlb=TimeStampToRunLumi(TimeStamp,dbInstance="CONDBR2") -if rlb is None: - printfunc ("WARNING: Failed to convert time",TimeStamp,"into a run/lumi number") - RunNumber=999999 - LumiBlock=0 -else: - RunNumber=rlb[0] - LumiBlock=rlb[1] - - -printfunc ("---> Working on run",RunNumber,"LB",LumiBlock,"Timestamp:",TimeStamp) -timediff=int(time()-(TimeStamp/1000000000)) -if timediff<0: - printfunc ("ERROR: Timestamp in the future???") -else: - (days,remainder)=divmod(timediff,24*60*60) - (hours,seconds)=divmod(remainder,60*60) - printfunc ("---> Timestamp is %i days %i hours and %i minutes ago" % (days,hours,int(seconds/60))) - pass - - -# name of output local sql file -OutputSQLiteFile = 'HVScaleCorr.db' - -# name of output Pool file -PoolFileName = "dummy.pool.root" - -# database folder -LArHVScaleCorrFolder = "/LAR/ElecCalibFlat/HVScaleCorr" - -LArSCHVScaleCorrFolder = "/LAR/ElecCalibFlatSC/HVScaleCorr" - -# output key -keyOutput = "LArHVScaleCorr" - -# tag suffix -#LArCalibFolderOutputTag = "-UPD3-00" - -# write IOV -WriteIOV = True - -# global tag to read other conditions if needed -if "GlobalTag" not in dir(): - GlobalTag = 'CONDBR2-BLKPA-2015-05' - -# begin run IOV -IOVBegin = 0 - -################################################################### - -from RecExConfig.RecFlags import rec -rec.RunNumber.set_Value_and_Lock(int(RunNumber)) - -from PerfMonComps.PerfMonFlags import jobproperties -jobproperties.PerfMonFlags.doMonitoring = True - -from AthenaCommon.DetFlags import DetFlags -DetFlags.all_setOff() -DetFlags.LAr_setOn() -DetFlags.Tile_setOn() - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.DatabaseInstance="CONDBR2" - -# Get a handle to the default top-level algorithm sequence -from AthenaCommon.AppMgr import ToolSvc -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -# Get a handle to the ServiceManager -from AthenaCommon.AppMgr import ServiceMgr as svcMgr - -# Get a handle to the ApplicationManager -from AthenaCommon.AppMgr import theApp - -# Setup Db stuff -import AthenaPoolCnvSvc.AthenaPool - -from AthenaCommon.GlobalFlags import jobproperties -jobproperties.Global.DetDescrVersion='ATLAS-R2-2015-04-00-00' - -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit -from AtlasGeoModel import SetupRecoGeometry - -svcMgr.IOVDbSvc.GlobalTag = GlobalTag -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) -include( "CaloConditions/CaloConditions_jobOptions.py") -include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -LArOnOffIdMappingSC() - -from LArConditionsCommon import LArHVDB #Sets HV Cabling and DCS Database folders - -#in rel. 22: -from AthenaCommon.AlgSequence import AthSequencer -condseq = AthSequencer("AthCondSeq") -from LArRecUtils.LArRecUtilsConf import LArHVCondAlg -hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",keyOutputCorr="LArHVScaleCorr") -hvcond.UndoOnlineHVCorr=False -condseq += hvcond -from AthenaCommon.AlgSequence import dumpSequence -dumpSequence(condseq) -for alg in condseq: - if "LArHVScaleCorrFlat" in alg.getFullName(): - alg.WriteKey="HVScaleCorrFromDB" - -from LArCalibUtils.LArCalibUtilsConf import LArHVCorrMaker -hvmaker=LArHVCorrMaker() -hvmaker.LArHVScaleCorr="LArHVScaleCorr" -hvmaker.folderName="/LAR/ElecCalibFlat/HVScaleCorr" -topSequence += hvmaker - -from LArCondUtils.LArCondUtilsConf import LArHVCorrToSCHVCorr -schvmaker = LArHVCorrToSCHVCorr() -schvmaker.OutputKey="LARSCHVScaleCorr" -topSequence += schvmaker - -from LArCalibTools.LArCalibToolsConf import LArHVScaleCorr2Ntuple -theLArHVScaleCorr2Ntuple = LArHVScaleCorr2Ntuple("LArHVScaleCorr2Ntuple") -theLArHVScaleCorr2Ntuple.AddFEBTempInfo = False -topSequence += theLArHVScaleCorr2Ntuple - -theLArSCHVScaleCorr2Ntuple = LArHVScaleCorr2Ntuple("LArHVScaleCorr2NtupleSC") -theLArSCHVScaleCorr2Ntuple.AddFEBTempInfo = False -theLArSCHVScaleCorr2Ntuple.isSC = True -theLArSCHVScaleCorr2Ntuple.ContainerKey="LARSCHVScaleCorr" -theLArSCHVScaleCorr2Ntuple.NtuplePath="/NTUPLES/FILE1/HVSCALESC" -topSequence += theLArSCHVScaleCorr2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='hvcorr_ntuple.root' OPT='NEW'" ] - -# deal with DB output -OutputObjectSpec = [ "CondAttrListCollection#"+LArHVScaleCorrFolder, "CondAttrListCollection#"+LArSCHVScaleCorrFolder ] -OutputObjectSpecTag = ['',''] -OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=CONDBR2" - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",PoolFileName, - OutputObjectSpec,OutputObjectSpecTag,WriteIOV) -theOutputConditionsAlg.Run1 = IOVBegin - -svcMgr.IOVDbSvc.dbConnection = OutputDB - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder=True -svcMgr.IOVRegistrationSvc.OverrideNames += ["HVScaleCorr","HVScaleCorr",] -svcMgr.IOVRegistrationSvc.OverrideTypes += ["Blob16M","Blob16M",] - -#-------------------------------------------------------------- -#--- Dummy event loop parameters -#-------------------------------------------------------------- -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.EventsPerLB = 1 -svcMgr.EventSelector.FirstLB = LumiBlock -svcMgr.EventSelector.InitialTimeStamp = int(TimeStamp/1e9) -svcMgr.EventSelector.TimeStampInterval = 5 -svcMgr.EventSelector.OverrideRunNumber=True -theApp.EvtMax = 1 - -#-------------------------------------------------------------- -# Set output level threshold (1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) -#-------------------------------------------------------------- -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.debugLimit = 100000 -svcMgr.MessageSvc.infoLimit = 100000 -svcMgr.MessageSvc.Format = "% F%30W%S%7W%R%T %0W%M" -svcMgr.IOVDbSvc.OutputLevel = INFO diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_PickOFCOnePhase.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_PickOFCOnePhase.py deleted file mode 100644 index f761f5266608a1d115110771c90bd383ef5d704c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_PickOFCOnePhase.py +++ /dev/null @@ -1,68 +0,0 @@ -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = 10000000 -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 -theApp.EvtMax = 1 - -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -svcMgr.IOVDbSvc.GlobalTag="COMCOND-005-02" -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -conddb.addFolder("LAR","/LAR/ElecCalibOfl/OFCBin/Dummy") -conddb.addFolder("LAR","/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples3bins17phases<key>LArOFCIn</key>") - -from LArCalibUtils.LArCalibUtilsConf import LArOFPhasePicker -LArOFPhasePicker = LArOFPhasePicker("LArOFPhasePicker") -LArOFPhasePicker.KeyPhase = "LArOFCPhase" -LArOFPhasePicker.KeyOFC_new = "LArOFC" -LArOFPhasePicker.KeyOFC = "LArOFCIn" -LArOFPhasePicker.GroupingType = "ExtendedSubDetector" -LArOFPhasePicker.OutputLevel = DEBUG -LArOFPhasePicker.DefaultPhase=1 -topSequence += LArOFPhasePicker -# -# Make an output -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -Folder = "/LAR/ElecCalibOnl/OFC" -ObjectSpec = [ "LArOFCComplete#LArOFC#"+Folder ] -TagSpec = [] -OutputDB = "sqlite://X;schema=OFCnew.db;dbname=CONDBR2" -theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","./ofc_picked.pool.root", - ObjectSpec,TagSpec,True) -theOutputConditionsAlg.Run1 = 0 -theOutputConditionsAlg.Run2 = 0 - -topSequence += theOutputConditionsAlg - -svcMgr.IOVDbSvc.OutputLevel = VERBOSE - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder=True - -svcMgr.IOVDbSvc.dbConnection = OutputDB - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ReadLocalConditionsPool.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ReadLocalConditionsPool.py deleted file mode 100644 index 88dd5efa8b09ed9e3df533111039db081f1b1089..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_ReadLocalConditionsPool.py +++ /dev/null @@ -1,31 +0,0 @@ -################################################################### -# -# jobOptions to read condition data from a local POOL file(s) -# -################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArAthenaPool/LArAthenaPool_joboptions.py" ) -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -CondProxyProvider = Service("CondProxyProvider") -ProxyProviderSvc = Service("ProxyProviderSvc") -ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - -EventPersistencySvc = Service( "EventPersistencySvc" ) -EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ] - -# -# sigle POOL file should be defined as: -# PoolFileName = "filename.pool.root" -# -if 'PoolFileName' in dir() : - CondProxyProvider.InputCollections = [ PoolFileName ] - -# -# multiple POOL files should be defined as: -# PoolFileList = [ "file1.pool.root", "file2.pool.root", ... ] -# -if 'PoolFileList' in dir() : - if ( len(PoolFileList)>0 ) : - CondProxyProvider.InputCollections += PoolFileList diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py deleted file mode 100644 index fcb319cc82f8d69d519a699f1eef8628eaba131e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py +++ /dev/null @@ -1,87 +0,0 @@ -InputDB="COOLOFL_LAR/CONDBR2" -#Folder="/LAR/ElecCalibOfl/CaliWaves/CaliWave" -FolderTag="LARElecCalibCaliWavesCaliWave-comm-08" -Folder="/LAR/ElecCalibOfl/CaliWaves/CaliWaveXtalkCorr" -FolderTag="LARElecCalibCaliWavesCaliWaveXtalkCorr-comm-08" - -RunNumber=52000 - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DetGeo.set_commis() -GlobalFlags.Luminosity.set_zero() -GlobalFlags.DataSource.set_data() -GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-Comm-00-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -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 - -#Get identifier mapping (needed by LArConditionsContainer) -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -#input-data: -#conddb.addFolder("",Folder+"<key>LArCaliWaveInput</key><tag>"+FolderTag+"</tag>"+InputDB) -conddb.addFolder("",Folder+"<tag>"+FolderTag+"</tag><db>"+InputDB+"</db>") -#conddb.addFolder("",Folder+"<tag>"+FolderTag+"</tag>"+InputDB) -conddb.addFolder("LAR","/LAR/BadChannelsOfl/BadChannels") -svcMgr.IOVDbSvc.GlobalTag="COMCOND-004-00" -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -PoolSvc.ReadCatalog+=["prfile:poolcond/PoolCat_comcond_castor.xml"] - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = RunNumber - - - - -from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ -theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") -theLArCaliWavePatcher.ContainerKey="LArCaliWave" -theLArCaliWavePatcher.NewContainerKey="LArCaliWaveOut" -theLArCaliWavePatcher.PatchMethod="PhiNeighbor" -theLArCaliWavePatcher.OutputLevel=DEBUG -theLArCaliWavePatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"] -topSequence+=theLArCaliWavePatcher - -OutputObjectSpecCaliWave = "LArCaliWaveContainere#LArCaliWaveOut#"+Folder - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","LArCaliWaveCorrections_"+str(RunNumber)+".pool.root", - [OutputObjectSpecCaliWave],[FolderTag],True) -theOutputConditionsAlg.Run1 = RunNumber -svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=LArCaliWaveCorrections_"+str(RunNumber)+".db;dbname=CONDBR2" - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True - - -svcMgr.DetectorStore.Dump=True - - -svcMgr.IOVDbSvc.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MCPileupAutoCorr_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MCPileupAutoCorr_jobOptions.py deleted file mode 100644 index 3b5989abef3f6086bbd8843268560e4ccb7350b8..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MCPileupAutoCorr_jobOptions.py +++ /dev/null @@ -1,412 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -if not "SuperCells" in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0026924' ] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - - -####################################################### -# Monitoring properties -####################################################### - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = True - -if not 'online' in dir(): - online = False - -####################################################### -# AutoCorrelation properties -####################################################### - -if 'NColl' not in dir(): - NColl=0 - -if 'bunchSpace' not in dir(): - bunchSpace = 25 - -if not 'NSamples' in dir(): - NSamples = 32 - -if not 'WhichSample' in dir(): - WhichSample = -1 - -if not 'InputDB' in dir(): - #InputDB = LArCalib_Flags.OutputDB - InputDB = DBConnectionCOOL - -if 'InputSQLiteFile' in dir(): - InputDB = DBConnectionFile(OutputSQLiteFile) - - -####################################################### -# AutoCorrelation output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputPedAutoCorrRootFileDir' in dir(): - OutputPedAutoCorrRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPedAutoCorrPoolFileDir' in dir(): - OutputPedAutoCorrPoolFileDir = subprocess.getoutput("pwd") - -if not 'ACLArCalibFolderTag' in dir(): - rs=FolderTagResover() - ACLArCalibFolderTag = rs.getFolderTagSuffix(LArCalib_Flags.LArPhysAutoCorrFolder) - del rs #Close DB connection - - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutputAC' in dir(): - KeyOutputAC = "LArPhysAutoCorr" - -if not 'BaseFileNamePedAutoCorr' in dir(): - BaseFileNameAutoCorr = "LArPhysAutoCorr" - -for RunNumber in RunNumberList : - BaseFileNameAutoCorr = BaseFileNameAutoCorr + "_" - BaseFileNameAutoCorr = BaseFileNameAutoCorr + str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputAutoCorrRootFileName' in dir(): - OutputAutoCorrRootFileName = BaseFileNameAutoCorr+ ".root" - -if not 'OutputAutoCorrPoolFileName' in dir(): - OutputAutoCorrPoolFileName = BaseFileNameAutoCorr + ".pool.root" - -if not 'OutputObjectSpecAutoCorr' in dir(): - OutputObjectSpecAutoCorr = "LArAutoCorrComplete#"+KeyOutputAC+"#"+LArCalib_Flags.LArPhysAutoCorrFolder - OutputTagSpecAutoCorr=LArCalibFolderTag(LArCalib_Flags.LArPhysAutoCorrFolder,"_mu_"+str(NColl)+ACLArCalibFolderTag) - -####################################################################################### -# print summary -####################################################################################### - -PedestalAutoCorrLog = logging.getLogger( "PedestalAutoCorrLog" ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " *** LAr PhysAutoCorr summary *** " ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " RunNumber = "+str(RunNumberList) ) -PedestalAutoCorrLog.info( " SubDetector = "+SubDet ) -PedestalAutoCorrLog.info( " Partition = "+Partition ) -PedestalAutoCorrLog.info( " Type = Pedestal " ) -PedestalAutoCorrLog.info( " LArGain = "+str(GainList) ) -PedestalAutoCorrLog.info( " LArCalibFolderTag = "+"_mu_"+str(NColl)+ACLArCalibFolderTag ) -if WriteNtuple: - PedestalAutoCorrLog.info( " OutputAutoCorrRootFullFileName = "+OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName ) -PedestalAutoCorrLog.info( " OutputAutoCorrPoolFullFileName = "+OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName ) -PedestalAutoCorrLog.info( " OutputObjectSpecAutoCorr = "+OutputObjectSpecAutoCorr ) -PedestalAutoCorrLog.info( " OutputTagSpecAutoCorr = "+OutputTagSpecAutoCorr ) -PedestalAutoCorrLog.info( " IOVBegin = "+str(IOVBegin) ) -PedestalAutoCorrLog.info( " IOVEnd = "+str(IOVEnd) ) -PedestalAutoCorrLog.info( " LArCalibOutputDB = "+OutputDB ) -PedestalAutoCorrLog.info( " ======================================================== " ) - -####################################################################################### -#include ("LArConditionsCommon/LArMinimalSetup.py") -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -GlobalTag = 'CONDBR2-BLKPA-2017-01' - -from AthenaCommon.BeamFlags import jobproperties -jobproperties.Beam.bunchSpacing = bunchSpace -jobproperties.Beam.numberOfCollisions = float(NColl) - -# dont load Shape from CONDBR2 -from LArConditionsCommon.LArCondFlags import larCondFlags -larCondFlags.useShape.set_Value_and_Lock(False) - -if SuperCells: - larCondFlags.hasHVCorr.set_Value_and_Lock(False) # here needed since we don't have HVCorr info - larCondFlags.hasMphys.set_Value_and_Lock(False) # here needed since we don't have MPhys info - -import AthenaCommon.AtlasUnixGeneratorJob - -# Setup Db stuff -import AthenaPoolCnvSvc.AthenaPool - - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += [ "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_oflcond.xml" ] - -from LArROD.LArRODFlags import larRODFlags -larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True) -larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True) - -include( "CaloConditions/CaloConditions_jobOptions.py") -include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) -include( "TileIdCnv/TileIdCnv_jobOptions.py" ) -include( "LArDetDescr/LArDetDescr_joboptions.py" ) -include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - -if SuperCells: - #SC conditiona folders are not set-up yet in LArConditionsCommon_comm_jobOptions.py, should go there at some point - conddb.addFolderWithTag("","<dbConnection>"+InputDB+"</dbConnection>/LAR/ElecCalibOflSC/Pedestals/Pedestal<key>LArPedestal</key>", - "LARElecCalibOflSCPedestalsPedestal-UPD3-00", - className="LArPedestalComplete") - conddb.addFolderWithTag("","<dbConnection>"+InputDB+"</dbConnection>/LAR/ElecCalibOflSC/Ramps/RampLinea", "LARElecCalibOflSCRampsRampLinea-UPD3-00", className="LArRampComplete") - conddb.addFolderWithTag("","<dbConnection>"+InputDB+"</dbConnection>/LAR/ElecCalibOflSC/MphysOverMcal/RTM", "LARElecCalibOflSCMphysOverMcalRTM-UPD3-00", className="LArMphysOverMcalComplete") - - -# for calib data we need: -conddb.addOverride("/CALO/Identifier/CaloTTOnAttrIdMapAtlas","CALOIdentifierCaloTTOnAttrIdMapAtlas-RUN2-0001") -conddb.addOverride("/CALO/Identifier/CaloTTOnOffIdMapAtlas","CALOIdentifierCaloTTOnOffIdMapAtlas-RUN2-0002") -conddb.addOverride("/CALO/Identifier/CaloTTPpmRxIdMapAtlas","CALOIdentifierCaloTTPpmRxIdMapAtlas-RUN2-0000") - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") -#svcMgr.EventSelector.InitialTimeStamp = 1284030331 -#import cx_Oracle -#import time -#import datetime -#connection=cx_Oracle.connect("ATLAS_SFO_T0_R/readmesfotz2008@atlr") -#cursor=connection.cursor() -#sRequest=("SELECT RUNNR,CREATION_TIME FROM SFO_TZ_RUN WHERE RUNNR='%s'")%(RunNumberList[0]) -#cursor.execute(sRequest) -#times= cursor.fetchall() -#d=times[0][1] -#iovtemp=int(time.mktime(d.timetuple())) -##print ("Setting timestamp for run ",RunNumberList[0]," to ",iovtemp) -##svcMgr.IOVDbSvc.forceTimestamp = 1283145454 -#svcMgr.IOVDbSvc.forceTimestamp = iovtemp - - -# Idmapping -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC - LArOnOffIdMappingSC() -else: - from LArCabling.LArCablingAccess import LArOnOffIdMapping - LArOnOffIdMapping() - - -#AutoCorrelation from data electronics noise -if not SuperCells: - conddb.addFolder("","<dbConnection>"+InputDB+"</dbConnection>/LAR/ElecCalibOfl/AutoCorrs/AutoCorr<key>LArAutoCorrRef</key>",className='LArAutoCorrComplete') - conddb.addOverride("/LAR/ElecCalibOfl/AutoCorrs/AutoCorr","LARElecCalibOflAutoCorrsAutoCorr-RUN2-UPD3-00") -else: - conddb.addFolder("","<dbConnection>"+InputDB+"</dbConnection>/LAR/ElecCalibOflSC/AutoCorrs/AutoCorr<key>LArAutoCorrRef</key>",className='LArAutoCorrComplete') - conddb.addOverride("/LAR/ElecCalibOflSC/AutoCorrs/AutoCorr","LARElecCalibOflSCAutoCorrsAutoCorr-UPD3-00") - -from LArRecUtils.LArRecUtilsConf import LArAutoCorrTotalCondAlg -theAutoCorrTotalCondAlg=LArAutoCorrTotalCondAlg() -theAutoCorrTotalCondAlg.Nsamples = NSamples -theAutoCorrTotalCondAlg.isMC = False -theAutoCorrTotalCondAlg.LArAutoCorrObjKey = "LArAutoCorrRef" -theAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey = KeyOutputAC -theAutoCorrTotalCondAlg.isSuperCell = SuperCells -theAutoCorrTotalCondAlg.NoPileUp = (NColl <=0) -if SuperCells: - theAutoCorrTotalCondAlg.LArADC2MeVObjKey = "LArADC2MeVSC" - theAutoCorrTotalCondAlg.LArOnOffIdMappingObjKey = "LArOnOffIdMapSC" - -#load fsampl, MinBias Average and PulseShape 32 samples from OFLP200 -from IOVDbSvc.CondDB import conddb -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") -if not SuperCells: - from LArRecUtils.LArRecUtilsConf import LArSymConditionsAlg_LArShape32MC_LArShape32Sym_ as LArShapeSymAlg - from LArRecUtils.LArRecUtilsConf import LArSymConditionsAlg_LArMinBiasMC_LArMinBiasSym_ as LArMinBiasSymAlg - from LArRecUtils.LArRecUtilsConf import LArSymConditionsAlg_LArfSamplMC_LArfSamplSym_ as LArfSamplSymAlg - mcfolders=[("LArShape32MC","/LAR/ElecCalibMC/Shape","LArShape","LARElecCalibMCShape-Apr2010",LArShapeSymAlg), - ("LArMinBiasMC","/LAR/ElecCalibMC/MinBias","LArMinBias","LARElecCalibMCMinBias-mc16-ofc25mc15mu20-25ns-A3MinBias_1",LArMinBiasSymAlg), - ("LArfSamplMC","/LAR/ElecCalibMC/fSampl","LArfSampl","LARElecCalibMCfSampl-G4101-20371-FTFP_BERT_BIRK_v2",LArfSamplSymAlg)] - for className,fldr,key,tag,calg in mcfolders: - keynew=key+"Sym" - conddb.addFolder("LAR_OFL",fldr, forceMC=True, className=className) - conddb.addOverride(fldr,tag) - condSeq+=calg(ReadKey=key,WriteKey=keynew) - -else: - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArShapeSC_ as LArShapeCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArRampSC_ as LArRampCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArMinBiasSC_ as LArMinBiasCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArfSamplSC_ as LArfSamplCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArfSamplSC_ as LArfSamplCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LAruA2MeVSC_ as LAruA2MeVCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArDAC2uASC_ as LArDAC2uACondAlg - - - mcfolders=[("CondAttrListCollection","/LAR/ElecCalibMCSC/Shape","LArShapeSC","LARElecCalibMCSCShape-000",LArShapeCondAlg), - ("CondAttrListCollection","/LAR/ElecCalibMCSC/Ramp","LArRampSC","LARElecCalibMCSRamp-mV-LSB",LArRampCondAlg), - ("CondAttrListCollection","/LAR/ElecCalibMCSC/MinBias","LArMinBiasSC","LARElecCalibMCSCMinBias-000",LArMinBiasCondAlg), - ("CondAttrListCollection","/LAR/ElecCalibMCSC/fSampl","LArfSamplSC","LARElecCalibMCSCfSampl-000",LArfSamplCondAlg), - ("CondAttrListCollection","/LAR/ElecCalibMCSC/uA2MeV","LAruA2MeVSC","LARElecCalibMCSCuA2MeV-000",LAruA2MeVCondAlg), - ("CondAttrListCollection","/LAR/ElecCalibMCSC/DAC2uA","LArDAC2uASC","LARElecCalibMCSCDAC2uA-000",LArDAC2uACondAlg), - ] - theAutoCorrTotalCondAlg.LArShapeObjKey = "LArShapeSC" - theAutoCorrTotalCondAlg.LArMinBiasObjKey = "LArMinBiasSC" - theAutoCorrTotalCondAlg.LArfSamplObjKey = "LArfSamplSC" - - for className,fldr,key,tag,calg in mcfolders: - conddb.addFolder("LAR_OFL",fldr, forceMC=True, className=className) - conddb.addOverride(fldr,tag) - condSeq+=calg(ReadKey=fldr,WriteKey=key) - - from LArRecUtils.LArADC2MeVSCCondAlgDefault import LArADC2MeVSCCondAlgDefault - - LArADC2MeVSCCondAlgDefault(isMC=True) - -condSeq += theAutoCorrTotalCondAlg - -# need to run Alg to create LArAutoCorrComplete for DB -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrAlgToDB -theLArAutoCorrAlgToDB=LArAutoCorrAlgToDB() -theLArAutoCorrAlgToDB.LArAutoCorrTotal=KeyOutputAC -theLArAutoCorrAlgToDB.isSC = SuperCells -theLArAutoCorrAlgToDB.NMinbias = NColl -theLArAutoCorrAlgToDB.GroupingType = GroupingType -theLArAutoCorrAlgToDB.OutAutoCorrKey = KeyOutputAC -topSequence += theLArAutoCorrAlgToDB - -###################################################################### -# # -# Output # -# # -###################################################################### - - - -if ( WriteNtuple ) : - - from LArCabling.LArCablingAccess import LArCalibIdMappingSC - LArCalibIdMappingSC() - - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" ) - LArAutoCorr2Ntuple.Nsamples = NSamples - LArAutoCorr2Ntuple.ContainerKey = KeyOutputAC - LArAutoCorr2Ntuple.isSC = SuperCells - - topSequence += LArAutoCorr2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName): - os.remove(OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputAutoCorrRootFileDir + "/" + OutputAutoCorrRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName): - os.remove(OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName, - [OutputObjectSpecAutoCorr],[OutputTagSpecAutoCorr],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2=IOVEnd - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = INFO - svcMgr.IOVRegistrationSvc.RecreateFolders = False - - - -#-------------------------------------------------------------- -#--- Dummy event loop parameters -#-------------------------------------------------------------- - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumberList[0]) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 5 -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_jobOptions.py deleted file mode 100644 index a38c21e096bec70c6f9dcde235b9ac834b544ffe..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_jobOptions.py +++ /dev/null @@ -1,497 +0,0 @@ - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to compute OFC cali in all 3 gains -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# Input selection (Autocorr, CaliWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## AutoCorr - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -if not 'InputAutoCorrPoolFileName' in dir(): - InputAutoCorrPoolFileName = "LArAutoCorr.pool.root" - -## CaliWave - -if not 'ReadCaliWaveFromCOOL' in dir(): - ReadCaliWaveFromCOOL = True - -if not 'InputCaliWavePoolDir' in dir(): - InputCaliWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputCaliWavePoolFileName' in dir(): - InputCaliWavePoolFileName = "LArCaliWave.pool.root" - - -## Options - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties -########################################################################### - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'Nphases' in dir(): - Nphases = 50 - -if not 'Dphases' in dir(): - Dphases = 1 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'ContainerKey' in dir(): - ContainerKey = "LArCaliWave" - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if not 'Normalize' in dir(): - Normalize = True - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'FillShape' in dir(): - FillShape = False # Do not fill a LArShapeComplete object for calibration OFC! - -if not 'DumpOFC' in dir(): - DumpOFC = False - -########################################################################### -# OFC output -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputOFCPoolFileDir' in dir(): - OutputOFCPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputShapePoolFileDir' in dir(): - OutputShapePoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -if (StripsXtalkCorr): - OFCFileTag += "_StripsXtalkCorr" - -OFCFileTag += "_"+str(Nsamples)+"samples" - -if (Dphases>1): - OFCFileTag += "_"+str(Dphases)+"Dphase" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCCali_"+OFCFileTag + ".root" - -if not 'OutputOFCPoolFileName' in dir(): - OutputOFCPoolFileName = "LArOFCCali_"+OFCFileTag + ".pool.root" - -if not 'OutputShapePoolFileName' in dir(): - OutputShapePoolFileName = "LArShapeCali_"+OFCFileTag + ".pool.root" - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecOFC' in dir(): - if ( ContainerKey == "LArCaliWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = "LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolder - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecOFC = "LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolderXtlk - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolderXtlk,LArCalibFolderOutputTag) - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolder - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolderXtlk - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolderXtlk,LArCalibFolderOutputTag) - -if not 'OutputObjectSpecShape' in dir(): - if ( ContainerKey == "LArCaliWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolder - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolderXtlk - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolderXtlk,LArCalibFolderOutputTag) - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+LArCalib_Flags.LArShapeMasterWaveFolder - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolder,LArCalibFolderOutputTag) - else: - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeMasterWaveFolderXtlk - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolderXtlk,LArCalibFolderOutputTag) - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if ( ReadCaliWaveFromCOOL ): - if 'InputCaliWaveSQLiteFile' in dir(): - InputDBConnectionCaliWave = DBConnectionFile(InputCaliWaveSQLiteFile) - else: - InputDBConnectionCaliWave = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadAutoCorrFromCOOL ): - OFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) -else : - OFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolFileName ) -if 'AutoCorrLArCalibFolderTag' in dir() : - OFCLog.info( " AutoCorrLArCalibFolderTag = "+AutoCorrLArCalibFolderTag ) -if ( ReadCaliWaveFromCOOL ): - OFCLog.info( " InputDBConnectionCaliWave = "+InputDBConnectionCaliWave ) -else : - OFCLog.info( " InputCaliWavePoolFileName = "+InputCaliWavePoolFileName ) -if ( (ReadAutoCorrFromCOOL or ReadCaliWaveFromCOOL) and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) -if 'CaliWaveLArCalibFolderTag' in dir() : - OFCLog.info( " CaliWaveLArCalibFolderTag = "+CaliWaveLArCalibFolderTag ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputOFCPoolFullFileName = "+OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName ) -OFCLog.info( " OutputShapePoolFileName = "+OutputShapePoolFileDir+"/"+OutputShapePoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " OutputObjectSpecShape = "+str(OutputObjectSpecShape) ) -OFCLog.info( " OutputObjectSpecTagShape = "+str(OutputObjectSpecTagShape) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) -########################################################################### - -########################################################################### -# # -# Global settings # -# # -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (AutoCorr, CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - - -if ( ReadAutoCorrFromCOOL or ReadCaliWaveFromCOOL ): - if not 'InputAutoCorrSQLiteFile' in dir(): - OFCLog.info( "Read AutoCorr from Oracle DB" ) - else : - OFCLog.info( "Read AutoCorr from SQLite file" ) - - if not 'InputCaliWaveSQLiteFile' in dir(): - OFCLog.info( "Read CaliWave from Oracle DB" ) - else : - OFCLog.info( "Read CaliWave from SQLite file" ) - -if ( ReadAutoCorrFromCOOL ): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder - if 'AutoCorrLArCalibFolderTag' in dir() : - AutoCorrTagSpec = LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) - else : - conddb.addFolder("",AutoCorrFolder+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) -else: - if 'InputAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read AutoCorr from POOL file" ) - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - -if ( ReadCaliWaveFromCOOL ): - if ( not StripsXtalkCorr ): - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolder - else: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolderXtlk - if 'CaliWaveLArCalibFolderTag' in dir() : - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder,CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",CaliWaveFolder+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) - -else: - if 'InputCaliWavePoolFileName' in dir(): - OFCLog.info( "Read CaliWave from POOL file" ) - PoolFileList += [ InputCaliWavePoolDir+"/"+InputCaliWavePoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg -LArCaliOFCAlg = LArOFCAlg("LArCaliOFCAlg") -LArCaliOFCAlg.ReadCaliWave = True -LArCaliOFCAlg.KeyList = [ ContainerKey ] -LArCaliOFCAlg.Nphase = Nphases -LArCaliOFCAlg.Dphase = Dphases -LArCaliOFCAlg.Ndelay = Ndelays -LArCaliOFCAlg.Nsample = Nsamples -LArCaliOFCAlg.Normalize = Normalize -LArCaliOFCAlg.TimeShift = TimeShift -LArCaliOFCAlg.TimeShiftByIndex = TimeShiftByIndex -LArCaliOFCAlg.Verify = True -LArCaliOFCAlg.FillShape = FillShape -if ( DumpOFC ) : - LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat" -LArCaliOFCAlg.GroupingType = GroupingType -topSequence+=LArCaliOFCAlg - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -ToolSvc += theLArAutoCorrDecoderTool - -########################################################################### - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.ContainerKey = OFCKey - topSequence+=LArOFC2Ntuple - - if ( FillShape ): - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = ShapeKey - topSequence+=LArShape2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName): - os.remove(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName) - OutputConditionsAlgOFC = OutputConditionsAlg("OutputConditionsAlgOFC",OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlgOFC.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgOFC.Run2 = IOVEnd - - if ( FillShape ): - - if os.path.exists(OutputShapePoolFileDir+"/"+OutputShapePoolFileName): - os.remove(OutputShapePoolFileDir+"/"+OutputShapePoolFileName) - OutputConditionsAlgShape = OutputConditionsAlg("OutputConditionsAlgShape",OutputShapePoolFileDir+"/"+OutputShapePoolFileName, - [OutputObjectSpecShape],[OutputObjectSpecTagShape],WriteIOV) - OutputConditionsAlgShape.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgShape.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumber) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_splitter_jobOptions.py deleted file mode 100644 index fd058f5c376845b66f0b701a5f756e64b80b9a25..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Cali_splitter_jobOptions.py +++ /dev/null @@ -1,589 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <pavol@mail.cern.ch> -# -# Example jobOptions to compute OFC cali in all 3 gains with splitted caliwaves -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# Input selection (Autocorr, CaliWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'AllWavesPerCh' in dir(): - AllWavesPerCh = True - -if not 'MaxCalLinePerCh' in dir(): - MaxCalLinePerCh = 4 - -if not 'doCaliWaveSelector' in dir(): - doCaliWaveSelector = True - -if not 'SubDet' in dir(): - SubDet = "EndCap" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## AutoCorr - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -if not 'InputAutoCorrPoolFileName' in dir(): - InputAutoCorrPoolFileName = "LArAutoCorr.pool.root" - -## CaliWave - -if not 'ReadCaliWaveFromCOOL' in dir(): - ReadCaliWaveFromCOOL = True - -if not 'InputCaliWavePoolDir' in dir(): - InputCaliWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputCaliWavePoolFileName' in dir(): - InputCaliWavePoolFileName = "LArCaliWave.pool.root" - - -## Options - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties -########################################################################### - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'Nphases' in dir(): - Nphases = 50 - -if not 'Dphases' in dir(): - Dphases = 1 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'ContainerKey' in dir(): - ContainerKey = "LArCaliWave" - -if AllWavesPerCh and (not 'ContainerKeySplitted' in dir()): - ContainerKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - if (doCaliWaveSelector): - ContainerKeySplitted.append(ContainerKey+str(i)+"Sel") - else: - ContainerKeySplitted.append(ContainerKey+str(i)) - -if (doCaliWaveSelector) and (not AllWavesPerCh): - ContainerKey += "Sel" - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if AllWavesPerCh and (not 'OFCKeySplitted' in dir()): - OFCKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - OFCKeySplitted.append(OFCKey+str(i+1)) - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if AllWavesPerCh and (not 'ShapeKeySplitted' in dir()): - ShapeKeySplitted = [] - for i in range(0, MaxCalLinePerCh): - ShapeKeySplitted.append(ShapeKey+str(i+1)) - -if not 'Normalize' in dir(): - Normalize = True - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'FillShape' in dir(): - FillShape = False # Do not fill a LArShapeComplete object for calibration OFC! - -if not 'DumpOFC' in dir(): - DumpOFC = False - -########################################################################### -# OFC output -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2" - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputOFCPoolFileDir' in dir(): - OutputOFCPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputShapePoolFileDir' in dir(): - OutputShapePoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -if (StripsXtalkCorr): - OFCFileTag += "_StripsXtalkCorr" - -OFCFileTag += "_"+str(Nsamples)+"samples" - -if (Dphases>1): - OFCFileTag += "_"+str(Dphases)+"Dphase" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCCali_"+OFCFileTag + ".root" - -if not 'OutputOFCPoolFileName' in dir(): - OutputOFCPoolFileName = "LArOFCCali_"+OFCFileTag + ".pool.root" - -if not 'OutputShapePoolFileName' in dir(): - OutputShapePoolFileName = "LArShapeCali_"+OFCFileTag + ".pool.root" - -if not 'LArCalibFolderOutputTag' in dir(): - rs=FolderTagResover() - LArCalibFolderOutputTag = rs.getFolderTagSuffix(LArCalib_Flags.LArOFCCaliFolder) - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecOFC' in dir(): - if ( AllWavesPerCh ) : - OutputObjectSpecOFC = [] - OutputObjectSpecTagOFC = [] - for i in range(0, MaxCalLinePerCh): - OutputObjectSpecOFC.append("LArOFCComplete#"+OFCKeySplitted[i]+"#"+ LArCalib_Flags.LArOFCCaliFolder+str(i) ) - OutputObjectSpecTagOFC.append(LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder+str(i),LArCalibFolderOutputTag)) - else: - if ( ContainerKey == "LArCaliWave" ) or (ContainerKey == "LArCaliWaveSel") or (ContainerKey == "LArCaliWaveSelPatch"): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = ["LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolder] - OutputObjectSpecTagOFC = [LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder,LArCalibFolderOutputTag)] - else: - OutputObjectSpecOFC = ["LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCCaliFolderXtlk] - OutputObjectSpecTagOFC = [LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolderXtlk,LArCalibFolderOutputTag)] - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecOFC = ["LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolder] - OutputObjectSpecTagOFC = [LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolder,LArCalibFolderOutputTag)] - else: - OutputObjectSpecOFC = ["LArOFCComplete#"+OFCKey+"#"+ LArCalib_Flags.LArOFCMasterWaveFolderXtlk] - OutputObjectSpecTagOFC = [LArCalibFolderTag(LArCalib_Flags.LArOFCMasterWaveFolderXtlk,LArCalibFolderOutputTag)] - -if not 'OutputObjectSpecShape' in dir(): - if ( AllWavesPerCh ) : - OutputObjectSpecShape = [] - OutputObjectSpecTagShape = [] - for i in range(0, MaxCalLinePerCh): - OutputObjectSpecShape.append("LArShapeComplete#"+ShapeKeySplitted[i]+"#"+ LArCalib_Flags.LArShapeCaliWaveFolder+str(i) ) - OutputObjectSpecTagShape.append(LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolder+str(i),LArCalibFolderOutputTag)) - else: - if ( ContainerKey == "LArCaliWave" ) or (ContainerKey == "LArCaliWaveSel") or (ContainerKey == "LArCaliWaveSelPatch"): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolder] - OutputObjectSpecTagShape = [LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolder,LArCalibFolderOutputTag)] - else: - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeCaliWaveFolderXtlk] - OutputObjectSpecTagShape = [LArCalibFolderTag(LArCalib_Flags.LArShapeCaliWaveFolderXtlk,LArCalibFolderOutputTag)] - - elif ( ContainerKey == "LArMasterWave" ): - if ( not StripsXtalkCorr ): - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+LArCalib_Flags.LArShapeMasterWaveFolder] - OutputObjectSpecTagShape = [LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolder,LArCalibFolderOutputTag)] - else: - OutputObjectSpecShape = ["LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeMasterWaveFolderXtlk] - OutputObjectSpecTagShape = [LArCalibFolderTag(LArCalib_Flags.LArShapeMasterWaveFolderXtlk,LArCalibFolderOutputTag)] - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if ( ReadCaliWaveFromCOOL ): - if 'InputCaliWaveSQLiteFile' in dir(): - InputDBConnectionCaliWave = DBConnectionFile(InputCaliWaveSQLiteFile) - else: - InputDBConnectionCaliWave = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadAutoCorrFromCOOL ): - OFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) -else : - OFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolFileName ) -if 'AutoCorrLArCalibFolderTag' in dir() : - OFCLog.info( " AutoCorrLArCalibFolderTag = "+AutoCorrLArCalibFolderTag ) -if ( ReadCaliWaveFromCOOL ): - OFCLog.info( " InputDBConnectionCaliWave = "+InputDBConnectionCaliWave ) -else : - OFCLog.info( " InputCaliWavePoolFileName = "+InputCaliWavePoolFileName ) -if ( (ReadAutoCorrFromCOOL or ReadCaliWaveFromCOOL) and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) -if 'CaliWaveLArCalibFolderTag' in dir() : - OFCLog.info( " CaliWaveLArCalibFolderTag = "+CaliWaveLArCalibFolderTag ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputOFCPoolFullFileName = "+OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName ) -OFCLog.info( " OutputShapePoolFileName = "+OutputShapePoolFileDir+"/"+OutputShapePoolFileName ) -#OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -#OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -#OFCLog.info( " OutputObjectSpecShape = "+str(OutputObjectSpecShape) ) -#OFCLog.info( " OutputObjectSpecTagShape = "+str(OutputObjectSpecTagShape) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) -########################################################################### - -########################################################################### -# # -# Global settings # -# # -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (AutoCorr, CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond09_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml"] - - -if ( ReadAutoCorrFromCOOL or ReadCaliWaveFromCOOL ): - if not 'InputAutoCorrSQLiteFile' in dir(): - OFCLog.info( "Read AutoCorr from Oracle DB" ) - else : - OFCLog.info( "Read AutoCorr from SQLite file" ) - - if not 'InputCaliWaveSQLiteFile' in dir(): - OFCLog.info( "Read CaliWave from Oracle DB" ) - else : - OFCLog.info( "Read CaliWave from SQLite file" ) - -if ( ReadAutoCorrFromCOOL ): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder - if 'AutoCorrLArCalibFolderTag' in dir() : - AutoCorrTagSpec = LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) - else : - conddb.addFolder("",AutoCorrFolder+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) -else: - if 'InputAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read AutoCorr from POOL file" ) - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - -if ( ReadCaliWaveFromCOOL ): - if ( not StripsXtalkCorr ): - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolder - else: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolderXtlk - if 'CaliWaveLArCalibFolderTag' in dir() : - if AllWavesPerCh: - for i in range(0, MaxCalLinePerCh): - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder+str(i),CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+str(i)+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) - else: - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder,CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",CaliWaveFolder+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) - -else: - if 'InputCaliWavePoolFileName' in dir(): - OFCLog.info( "Read CaliWave from POOL file" ) - PoolFileList += [ InputCaliWavePoolDir+"/"+InputCaliWavePoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -ToolSvc += theLArAutoCorrDecoderTool - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg -if ( AllWavesPerCh ) : - LArCaliOFCAlgVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence+=LArOFCAlg("LArCaliOFCAlg"+str(i+1)) - exec 'LArCaliOFCAlgVec.append( topSequence.LArCaliOFCAlg%(fn)s )' % {'fn' :i+1} - - LArCaliOFCAlgVec[i].ReadCaliWave = True - LArCaliOFCAlgVec[i].KeyList = [ ContainerKeySplitted[i] ] - LArCaliOFCAlgVec[i].Nphase = Nphases - LArCaliOFCAlgVec[i].Dphase = Dphases - LArCaliOFCAlgVec[i].Ndelay = Ndelays - LArCaliOFCAlgVec[i].Nsample = Nsamples - LArCaliOFCAlgVec[i].Normalize = Normalize - LArCaliOFCAlgVec[i].TimeShift = TimeShift - LArCaliOFCAlgVec[i].TimeShiftByIndex = TimeShiftByIndex - LArCaliOFCAlgVec[i].Verify = True - LArCaliOFCAlgVec[i].KeyOFC = OFCKeySplitted[i] # this is also the key for the output LArOFCComplete - LArCaliOFCAlgVec[i].FillShape = FillShape - LArCaliOFCAlgVec[i].KeyShape = ShapeKeySplitted[i] # this is the key for the output LArShapeComplete - if ( DumpOFC ) : - LArCaliOFCAlgVec[i].DumpOFCfile = "LArOFCCali"+str(i+1)+".dat" - LArCaliOFCAlgVec[i].GroupingType = GroupingType - LArCaliOFCAlgVec[i].DecoderTool=theLArAutoCorrDecoderTool - -else: - LArCaliOFCAlg = LArOFCAlg("LArCaliOFCAlg") - LArCaliOFCAlg.ReadCaliWave = True - LArCaliOFCAlg.KeyList = [ ContainerKey ] - LArCaliOFCAlg.Nphase = Nphases - LArCaliOFCAlg.Dphase = Dphases - LArCaliOFCAlg.Ndelay = Ndelays - LArCaliOFCAlg.Nsample = Nsamples - LArCaliOFCAlg.Normalize = Normalize - LArCaliOFCAlg.TimeShift = TimeShift - LArCaliOFCAlg.TimeShiftByIndex = TimeShiftByIndex - LArCaliOFCAlg.Verify = True - LArCaliOFCAlg.FillShape = FillShape - if ( DumpOFC ) : - LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat" - LArCaliOFCAlg.GroupingType = GroupingType - LArCaliOFCAlg.DecoderTool=theLArAutoCorrDecoderTool - topSequence+=LArCaliOFCAlg - -########################################################################### - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - if ( AllWavesPerCh ) : - LArOFC2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence += LArOFC2Ntuple("LArOFC2Ntuple"+str(i+1)) - exec 'LArOFC2NtupleVec.append( topSequence.LArOFC2Ntuple%(fn)s )' % {'fn': i+1} - LArOFC2NtupleVec[i].ContainerKey = OFCKeySplitted[i] - LArOFC2NtupleVec[i].NtupleName = "OFC"+str(i+1) - else: - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.ContainerKey = OFCKey - topSequence+=LArOFC2Ntuple - - if ( FillShape ): - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - if ( AllWavesPerCh ) : - LArOFC2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence += LArShape2Ntuple("LArOFC2Ntuple"+str(i+1)) - exec 'LArShape2NtupleVec.append( topSequence.LArShape2Ntuple%(fn)s )' % {'fn': i+1} - LArShape2NtupleVec[i].ContainerKey = ShapeKeySplitted[i] - LArShape2NtupleVec[i].NtupleName = "SHAPE"+str(i+1) - else: - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = ShapeKey - topSequence+=LArShape2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName): - os.remove(OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName) - OutputConditionsAlgOFC = OutputConditionsAlg("OutputConditionsAlgOFC",OutputOFCPoolFileDir+"/"+OutputOFCPoolFileName, - OutputObjectSpecOFC,OutputObjectSpecTagOFC,WriteIOV) - OutputConditionsAlgOFC.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgOFC.Run2 = IOVEnd - - if ( FillShape ): - - if os.path.exists(OutputShapePoolFileDir+"/"+OutputShapePoolFileName): - os.remove(OutputShapePoolFileDir+"/"+OutputShapePoolFileName) - OutputConditionsAlgShape = OutputConditionsAlg("OutputConditionsAlgShape",OutputShapePoolFileDir+"/"+OutputShapePoolFileName, - OutputObjectSpecShape,OutputObjectSpecTagShape,WriteIOV) - OutputConditionsAlgShape.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgShape.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumber) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = ERROR) - -#from AthenaCommon.AppMgr import theAuditorSvc -#from AthenaCommon.ConfigurableDb import getConfigurable -#theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = ERROR) -#theAuditorSvc += getConfigurable("ChronoAuditor")() -#theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py deleted file mode 100644 index 3c9841334d89dbe417cab11bea740a3583752cab..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py +++ /dev/null @@ -1,803 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# jobOptions to compute OFC phys in all gains for two different DeltaPhase -# settings, ad store the objects in parallel folders. -# -# Last update: 04/12/2009 <Marco.Delmastro@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# PhysWaveShifter properties # -########################################################################### - -if not "UseDelta" in dir(): - UseDelta=0 - -if not "NColl" in dir(): - NColl=0 - -if not 'doPhysWaveShifter' in dir(): - doPhysWaveShifter = True - -if not 'InputKey' in dir(): - if (doPhysWaveShifter) : - InputKey = "LArPhysWaveUnShifted" - else : - InputKey = "LArPhysWave" # no shift applied to the PhysWave - -if not 'isFCAL' in dir() : - isFCAL = False - -if not 'InputKey' in dir(): - InputKey = "LArPhysWaveUnShifted" - -if not 'ShiftMode' in dir(): - ShiftMode = 3 # 1 = minimum Tstart from helper in FEB - # 2 = minumum Tpeak-NindexFromPeak in FEB - # 3 = average Tpeak-NindexFromPeak in FEB - -if not 'Nsamplings' in dir(): - Nsamplings = 2 - -if not 'TimeShiftGuardRegion' in dir(): - TimeShiftGuardRegion = 12 - -if not 'UsePhysCaliTdiff' in dir(): - UsePhysCaliTdiff = True - -if not 'PhysCaliTdiffKey' in dir(): - PhysCaliTdiffKey = "LArPhysCaliTdiff" - -########################################################################### -# Input selection (Autocorr, PhysWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## AutoCorr - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -if not 'InputAutoCorrPoolFileName' in dir(): - InputAutoCorrPoolFileName = "LArAutoCorr.pool.root" - -## PhysWave - -if not 'ReadPhysWaveFromCOOL' in dir(): - ReadPhysWaveFromCOOL = True - -if not 'InputPhysWavePoolDir' in dir(): - InputPhysWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysWavePoolFileName' in dir(): - InputPhysWavePoolFileName = "LArPhysWave.pool.root" - -## PhysCaliTdiff - -if not 'ReadPhysCaliTdiffFromCOOL' in dir(): - ReadPhysCaliTdiffFromCOOL = True - -if not 'InputPhysCaliTdiffPoolDir' in dir(): - InputPhysCaliTdiffPoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysCaliTdiffPoolFileName' in dir(): - InputPhysCaliTdiffPoolFileName = "LArPhysCaliTdiff.pool.root" - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties (2 instances) -########################################################################### - -if not 'ContainerKey' in dir(): - ContainerKey = "LArPhysWave" - -if not 'Normalize' in dir(): - Normalize = True - -# -# First instance -# - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'Nphases' in dir(): - Nphases = 8 - -if not 'Dphases' in dir(): - Dphases = 3 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - - -if not 'ShiftKey' in dir(): - ShiftKey="LArPhysWaveShift" - -if not 'FillShape' in dir(): - FillShape = True - -if not 'OFCTreename' in dir(): - OFCTreename = "OFC" - -if not 'ShapeTreename' in dir(): - ShapeTreename = "Shape" - -# -# Second instance -# - -if not 'TimeShift2' in dir() : - TimeShift2 = False - -if not 'TimeShiftByIndex2' in dir() : - TimeShiftByIndex2 = -1 - -if not 'Nsamples2' in dir(): - Nsamples2 = 5 - -if not 'Nphases2' in dir(): - Nphases2 = 24 - -if not 'Dphases2' in dir(): - Dphases2 = 1 - -if not 'Ndelays2' in dir(): - Ndelays2 = 24 - -if not 'OFCKey2' in dir(): - OFCKey2 = "LArOFC_2" - -if not 'ShapeKey2' in dir(): - ShapeKey2 = "LArShape_2" - -if not 'FillShape2' in dir(): - FillShape2 = True - -if not 'OFCTreename2' in dir(): - OFCTreename2 = "OFC2" - -if not 'ShapeTreename2' in dir(): - ShapeTreename2 = "Shape2" - -########################################################################### -# OFC output -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") -OFCFileTag += "_"+str(Nsamples)+"samples" - -#if (Dphases>1): -# OFCFileTag += "_"+str(Dphases)+"Dphase" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCPhys_"+OFCFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys_"+OFCFileTag + ".pool.root" - - -#input folders: -if "AutoCorrFolder" not in dir(): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder -if "PhysCaliTdiffFolder" not in dir(): - PhysCaliTdiffFolder = LArCalib_Flags.LArPhysCaliTdiffFolder - -if isFCAL: - PhysWaveFolderFCAL="/LAR/ElecCalibOfl/PhysWaves/FCALFromTB" -else: - PhysWaveFolder = LArCalib_Flags.LArPhysWaveFolder - - -#Shift (can be output or input) -if "OFCBinFolder" not in dir(): - OFCBinFolder="/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts" - - -#output Folders: -if "FolderOFC" not in dir(): - FolderOFC = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples3bins17phases" - -if "FolderShape" not in dir(): - FolderShape = "/LAR/ElecCalibOfl/Shape/RTM/5samples3bins17phases" - -if "FolderOFC2" not in dir(): - FolderOFC2 = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples" - -if "FolderShape2" not in dir(): - FolderShape2 = "/LAR/ElecCalibOfl/Shape/RTM/5samples" - - -rs=FolderTagResover() -if not 'AutoCorrLArCalibFolderTag' in dir(): - AutoCorrLArCalibFolderTag=rs.getFolderTagSuffix(AutoCorrFolder) - -if not 'PhysWaveLArCalibFolderTag' in dir(): - if isFCAL: - PhysWaveLArCalibFolderTag=rs.getFolderTagSuffix(PhysWaveFolderFCAL) - else: - PhysWaveLArCalibFolderTag=rs.getFolderTagSuffix(PhysWaveFolder) - -if not 'PhysCaliTdiffLArCalibFolderTag' in dir(): - PhysCaliTdiffLArCalibFolderTag=rs.getFolderTagSuffix(PhysCaliTdiffFolder) - -if not 'OFCBinFolderTag' in dir(): - OFCBinFolderTag=rs.getFolderTagSuffix(OFCBinFolder) - - -#output Folders: -if "FolderTagOFC" not in dir(): - if "PhysicsAutoCorr" in AutoCorrFolder: - FolderTagOFC = "-mu-"+str(NColl)+rs.getFolderTagSuffix(FolderOFC) - else: - FolderTagOFC = rs.getFolderTagSuffix(FolderOFC) - -if "FolderTagShape" not in dir(): - FolderTagShape = rs.getFolderTagSuffix(FolderShape) - -if "FolderTagOFC2" not in dir(): - if "PhysicsAutoCorr" in AutoCorrFolder: - FolderTagOFC2 = "-mu-"+str(NColl)+rs.getFolderTagSuffix(FolderOFC) - else: - FolderTagOFC2 = rs.getFolderTagSuffix(FolderOFC2) - -if "FolderTagShape2" not in dir(): - FolderTagShape2 = rs.getFolderTagSuffix(FolderShape2) - - -del rs #close Database - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - - -OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ FolderOFC -OutputObjectSpecTagOFC = LArCalibFolderTag(FolderOFC,FolderTagOFC) - -OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ FolderShape -OutputObjectSpecTagShape = LArCalibFolderTag(FolderShape,FolderTagShape) - -OutputObjectSpecOFC2 = "LArOFCComplete#"+OFCKey2+"#"+ FolderOFC2 -OutputObjectSpecTagOFC2 = LArCalibFolderTag(FolderOFC2,FolderTagOFC2) - -OutputObjectSpecShape2 = "LArShapeComplete#"+ShapeKey2+"#"+ FolderShape2 -OutputObjectSpecTagShape2 = LArCalibFolderTag(FolderShape2,FolderTagShape2) - -OutputObjectSpecOFCBin="LArOFCBinComplete#"+ShiftKey+"#"+OFCBinFolder -OutputObjectSpecTagOFCBin = LArCalibFolderTag(OFCBinFolder,OFCBinFolderTag) - - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if ( ReadPhysWaveFromCOOL ): - if 'InputPhysWaveSQLiteFile' in dir(): - InputDBConnectionPhysWave = DBConnectionFile(InputPhysWaveSQLiteFile) - else: - InputDBConnectionPhysWave = DBConnectionCOOL - -if ( ReadPhysCaliTdiffFromCOOL ): - if 'InputPhysCaliTdiffSQLiteFile' in dir(): - InputDBConnectionPhysCaliTdiff = DBConnectionFile(InputPhysCaliTdiffSQLiteFile) - else: - InputDBConnectionPhysCaliTdiff = "COOLOFL_LAR/COMP200" -xxx -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadAutoCorrFromCOOL ): - OFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) - OFCLog.info( " AutoCorrLArCalibFolderTag = "+AutoCorrLArCalibFolderTag) -else : - OFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ) - - -if ( ReadPhysWaveFromCOOL ): - OFCLog.info( " InputDBConnectionPhysWave = "+InputDBConnectionPhysWave ) - OFCLog.info( " PhysWaveLArCalibFolderTag =" +PhysWaveLArCalibFolderTag ) -else : - OFCLog.info( " InputPhysWavePoolFileName = "+InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ) - -if ( (ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL) and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) - -if ( ReadPhysCaliTdiffFromCOOL ): - OFCLog.info( " InputDBConnectionPhysCaliTdiff = "+InputDBConnectionPhysCaliTdiff ) - OFCLog.info( " PhysCaliTdiffLArCalibFolderTag = "+PhysCaliTdiffLArCalibFolderTag ) -else : - OFCLog.info( " InputPhysCaliTdiffPoolFileName = "+InputPhysCaliTdiffPoolDir+"/"+InputPhysCaliTdiffPoolFileName ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputPoolFullFileName = "+OutputPoolFileDir+"/"+OutputPoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " OutputObjectSpecShape = "+str(OutputObjectSpecShape) ) -OFCLog.info( " OutputObjectSpecTagShape = "+str(OutputObjectSpecTagShape) ) -OFCLog.info( " OutputObjectSpecOFC2 = "+str(OutputObjectSpecOFC2) ) -OFCLog.info( " OutputObjectSpecTagOFC2 = "+str(OutputObjectSpecTagOFC2) ) -OFCLog.info( " OutputObjectSpecShape2 = "+str(OutputObjectSpecShape2) ) -OFCLog.info( " OutputObjectSpecTagShape2 = "+str(OutputObjectSpecTagShape2) ) -OFCLog.info( " OutputObjectSpecOFCBin = "+str(OutputObjectSpecOFCBin) ) -OFCLog.info( " OutputObjectSpecTagOFCBin = "+str(OutputObjectSpecTagOFCBin) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -########################################################################### -# # -# Input conditions data (AutoCorr, CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL ): - if not ('InputAutoCorrSQLiteFile') in dir(): - OFCLog.info( "Read AutoCorr from Oracle" ) - else : - OFCLog.info( "Read AutoCorr from SQLite file" ) - - if not ('InputPhysWaveSQLiteFile') in dir(): - OFCLog.info( "Read PhysWave from Oracle DB" ) - else : - OFCLog.info( "Read PhysWave from SQLite file" ) - -if ( ReadAutoCorrFromCOOL ): - if "PhysicsAutoCorr" in AutoCorrFolder: - AutoCorrTagSpec= LArCalibFolderTag(AutoCorrFolder,"-mu-"+str(NColl)+AutoCorrLArCalibFolderTag) - else: - AutoCorrTagSpec= LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) -else: - if 'InputAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read AutoCorr from POOL file") - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - -if ( ReadPhysWaveFromCOOL ): - if (doPhysWaveShifter or isFCAL) : - if isFCAL: - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolderFCAL,PhysWaveLArCalibFolderTag) - else: - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - if isFCAL: - conddb.addFolder("",PhysWaveFolderFCAL+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else: - conddb.addFolder("",PhysWaveFolder+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) -else: - if 'InputPhysWavePoolFileName' in dir(): - OFCLog.info( "Read PhysWave from POOL file" ) - PoolFileList += [ InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysWave or read from COOL." ) - theApp.exit(-1) - -if (UsePhysCaliTdiff): - if ( ReadPhysCaliTdiffFromCOOL ): - PhysCaliTdiffTagSpec = LArCalibFolderTag(PhysCaliTdiffFolder,PhysCaliTdiffLArCalibFolderTag) - conddb.addFolder("",PhysCaliTdiffFolder+"<key>"+PhysCaliTdiffKey+"</key><tag>"+PhysCaliTdiffTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysCaliTdiff+"</dbConnection>" + ChannelSelection) - else: - if 'InputPhysCaliTdiffPoolFileName' in dir(): - OFCLog.info( "Read PhysCaliTdiff from POOL file" ) - PoolFileList += [ InputPhysCaliTdiffPoolDir+"/"+InputPhysCaliTdiffPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysCaliTdiff or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if (doPhysWaveShifter) : - - ########################################################################### - # # - # Shift physics waveforms only for FCAL # - # # - ########################################################################### - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveShifter - LArPhysWaveShifter = LArPhysWaveShifter("LArPhysWaveShifter") - - LArPhysWaveShifter.KeyList = [ InputKey ] - LArPhysWaveShifter.KeyOutput = ContainerKey - LArPhysWaveShifter.GroupingType = GroupingType - - # - # Minimum Tstart per FEB computation - # - LArPhysWaveShifter.ComputeTimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftByFEBMode = ShiftMode - LArPhysWaveShifter.TimeShiftByFEBDump = True - LArPhysWaveShifter.TimeShiftByFEBDumpFile = "TimeShiftFEB.py" - - # - # Possible time shifts - # - LArPhysWaveShifter.TimeShiftByHelper = False - LArPhysWaveShifter.TimeShiftByIndex = 0 - LArPhysWaveShifter.TimeShiftFromPeak = False - LArPhysWaveShifter.NindexFromPeak = 0 # if 0 will use Ndelays*Nsampling - LArPhysWaveShifter.Ndelays = 24 - LArPhysWaveShifter.Nsamplings = Nsamplings - LArPhysWaveShifter.TimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftGuardRegion = TimeShiftGuardRegion - LArPhysWaveShifter.UsePhysCaliTdiff = UsePhysCaliTdiff - LArPhysWaveShifter.CellByCellShiftsKey = "LArPhysCaliTdiff" - LArPhysWaveShifter.OutputShiftsKey = ShiftKey - topSequence += LArPhysWaveShifter - -else: - #Load Shifts from DB: - conddb.addFolder("LAR_OFL",OFCBinFolder+"<tag>"+OutputObjectSpecTagOFCBin+"</tag><key>"+ShiftKey+"</key>"); - - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -theLArAutoCorrDecoderTool.UseAlwaysHighGain=True -if NColl > 0: - theLArAutoCorrDecoderTool.DecodeMode=1 - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg - -LArPhysOFCAlg = LArOFCAlg("LArPhysOFCAlg") - -LArPhysOFCAlg.ReadCaliWave = False -LArPhysOFCAlg.KeyList = [ InputKey ] -LArPhysOFCAlg.Normalize = Normalize -LArPhysOFCAlg.Verify = True -LArPhysOFCAlg.GroupingType = GroupingType -LArPhysOFCAlg.OutputLevel = DEBUG -LArPhysOFCAlg.Nphase = Nphases -LArPhysOFCAlg.Dphase = Dphases -LArPhysOFCAlg.Ndelay = Ndelays -LArPhysOFCAlg.Nsample = Nsamples -LArPhysOFCAlg.FillShape = FillShape -LArPhysOFCAlg.TimeShift = TimeShift -LArPhysOFCAlg.TimeShiftByIndex = TimeShiftByIndex -LArPhysOFCAlg.AddTimeOffset = -1.0*TimeShiftGuardRegion -LArPhysOFCAlg.LArPhysWaveBinKey = ShiftKey - -LArPhysOFCAlg.UseDelta = UseDelta -LArPhysOFCAlg.KeyOFC = OFCKey -LArPhysOFCAlg.KeyShape = ShapeKey -LArPhysOFCAlg.DecoderTool = theLArAutoCorrDecoderTool - -topSequence+=LArPhysOFCAlg - -LArPhysOFCAlg2 = LArOFCAlg("LArPhysOFCAlg2") - -LArPhysOFCAlg2.ReadCaliWave = False -LArPhysOFCAlg2.KeyList = [ InputKey ] -LArPhysOFCAlg2.Normalize = Normalize -LArPhysOFCAlg2.Verify = True -LArPhysOFCAlg2.GroupingType = GroupingType - -LArPhysOFCAlg2.Nphase = Nphases2 -LArPhysOFCAlg2.Dphase = Dphases2 -LArPhysOFCAlg2.Ndelay = Ndelays2 -LArPhysOFCAlg2.Nsample = Nsamples2 -LArPhysOFCAlg2.FillShape = FillShape2 -LArPhysOFCAlg2.TimeShift = TimeShift2 -LArPhysOFCAlg2.TimeShiftByIndex = TimeShiftByIndex2 -LArPhysOFCAlg2.AddTimeOffset = -1.0*TimeShiftGuardRegion -LArPhysOFCAlg2.LArPhysWaveBinKey = ShiftKey -LArPhysOFCAlg2.UseDelta = UseDelta - -LArPhysOFCAlg2.KeyOFC = OFCKey2 -LArPhysOFCAlg2.KeyShape = ShapeKey2 -LArPhysOFCAlg2.DecoderTool = theLArAutoCorrDecoderTool - -topSequence+=LArPhysOFCAlg2 - - -########################################################################### - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - - LArOFC2Ntuple1 = LArOFC2Ntuple("LArOFC2Ntuple1") - LArOFC2Ntuple1.ContainerKey = OFCKey - LArOFC2Ntuple1.NtupleName = OFCTreeName - LArOFC2Ntuple1.AddFEBTempInfo = False - topSequence+=LArOFC2Ntuple1 - - LArOFC2Ntuple2 = LArOFC2Ntuple("LArOFC2Ntuple2") - LArOFC2Ntuple2.ContainerKey = OFCKey2 - LArOFC2Ntuple2.NtupleName = OFCTreeName2 - LArOFC2Ntuple2.AddFEBTempInfo = False - topSequence+=LArOFC2Ntuple2 - - if ( FillShape ): - - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - - LArShape2Ntuple1 = LArShape2Ntuple("LArShape2Ntuple1") - LArShape2Ntuple1.ContainerKey = ShapeKey - LArShape2Ntuple1.NtupleName = ShapeTreeName - LArShape2Ntuple1.AddFEBTempInfo = False - topSequence+=LArShape2Ntuple1 - - LArShape2Ntuple2 = LArShape2Ntuple("LArShape2Ntuple2") - LArShape2Ntuple2.ContainerKey = ShapeKey2 - LArShape2Ntuple2.NtupleName = ShapeTreeName2 - LArShape2Ntuple2.AddFEBTempInfo = False - topSequence+=LArShape2Ntuple2 - - - if ( doPhysWaveShifter ): - from LArCalibTools.LArCalibToolsConf import LArFebTimeOffset2Ntuple - LArFebTimeOffset2Ntuple = LArFebTimeOffset2Ntuple( "LArFebTimeOffset2Ntuple" ) - LArFebTimeOffset2Ntuple.ContainerKey = "FebTimeOffset" - LArFebTimeOffset2Ntuple.AddFEBTempInfo = False - - topSequence+=LArFebTimeOffset2Ntuple - - from LArCalibTools.LArCalibToolsConf import LArWFParams2Ntuple - LArWFParams2Ntuple=LArWFParams2Ntuple("LArWFParams2Ntuple") - LArWFParams2Ntuple.DumpOFCBin=True - LArWFParams2Ntuple.AddFEBTempInfo = False - LArWFParams2Ntuple.OFCBinKey =ShiftKey - topSequence+=LArWFParams2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputPoolFileDir+"/"+OutputPoolFileName) - - OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFC2] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFC2] - - if ( FillShape ): - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape] - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape2] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape2] - - if ( doPhysWaveShifter): - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFCBin] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFCBin] - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumber) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py deleted file mode 100644 index 20a642d4fe8b5dcc74c358ac4d3ae0df53614fe1..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py +++ /dev/null @@ -1,947 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# jobOptions to compute OFC phys in all gains for two different DeltaPhase -# settings, ad store the objects in parallel folders. -# -# Last update: 04/12/2009 <Marco.Delmastro@cern.ch> -# -########################################################################### - -if not "SuperCells" in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -########################################################################### -# PhysWaveShifter properties # -########################################################################### - -if not "UseDelta" in dir(): - UseDelta=0 - -if not "NColl" in dir(): - NColl=0 - -if not 'doPhysWaveShifter' in dir(): - doPhysWaveShifter = True - -if not 'InputKey' in dir(): - if (doPhysWaveShifter) : - if not SuperCells: InputKey = "LArPhysWaveUnShifted" - if SuperCells: InputKey = "LArPhysWave" - else : - InputKey = "LArPhysWave" # no shift applied to the PhysWave - -if not 'isFCAL' in dir() : - isFCAL = False - -if not 'InputKey' in dir(): - InputKey = "LArPhysWaveUnShifted" - -if not 'ShiftMode' in dir(): - ShiftMode = 3 # 1 = minimum Tstart from helper in FEB - # 2 = minumum Tpeak-NindexFromPeak in FEB - # 3 = average Tpeak-NindexFromPeak in FEB - -if not 'Nsamplings' in dir(): - Nsamplings = 2 - -if not 'TimeShiftGuardRegion' in dir(): - TimeShiftGuardRegion = 12 - -if not 'UsePhysCaliTdiff' in dir(): - UsePhysCaliTdiff = True - -if not 'PhysCaliTdiffKey' in dir(): - PhysCaliTdiffKey = "LArPhysCaliTdiff" - -########################################################################### -# Input selection (Autocorr, PhysWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## AutoCorr - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -if not 'InputAutoCorrPoolFileName' in dir(): - InputAutoCorrPoolFileName = "LArAutoCorr.pool.root" - -## PhysWave - -if not 'ReadPhysWaveFromCOOL' in dir(): - ReadPhysWaveFromCOOL = True - -if not 'InputPhysWavePoolDir' in dir(): - InputPhysWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysWavePoolFileName' in dir(): - InputPhysWavePoolFileName = "LArPhysWave.pool.root" - -## PhysCaliTdiff - -if not 'ReadPhysCaliTdiffFromCOOL' in dir(): - ReadPhysCaliTdiffFromCOOL = True - -if not 'InputPhysCaliTdiffPoolDir' in dir(): - InputPhysCaliTdiffPoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysCaliTdiffPoolFileName' in dir(): - InputPhysCaliTdiffPoolFileName = "LArPhysCaliTdiff.pool.root" - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties (2 instances) -########################################################################### - -if not 'ContainerKey' in dir(): - ContainerKey = "LArPhysWave" - -if not 'Normalize' in dir(): - Normalize = True - -# -# First instance -# - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if Nsamples == 4: - if not 'ReadDSPCOnfig' in dir(): - ReadDSPConfig=True - if not 'DSPConfigFolder' in dir(): - DSPConfigFolder="/LAR/Configuration/DSPConfiguration" - -if not 'Nphases' in dir(): - Nphases = 8 - -if not 'Dphases' in dir(): - Dphases = 3 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - - -if not 'ShiftKey' in dir(): - ShiftKey="LArPhysWaveShift" - -if not 'FillShape' in dir(): - FillShape = True - -if not 'OFCTreename' in dir(): - OFCTreename = "OFC" - -if not 'ShapeTreename' in dir(): - ShapeTreename = "Shape" - -# -# Second instance -# - -if not 'TimeShift2' in dir() : - TimeShift2 = False - -if not 'TimeShiftByIndex2' in dir() : - TimeShiftByIndex2 = -1 - -if not 'Nsamples2' in dir(): - Nsamples2 = 5 - -if Nsamples2 == 4: - if not 'ReadDSPCOnfig2' in dir(): - ReadDSPConfig2=True - if not 'DSPConfigFolder2' in dir(): - DSPConfigFolder2="/LAR/Configuration/DSPConfiguration" - -if not 'Nphases2' in dir(): - Nphases2 = 24 - -if not 'Dphases2' in dir(): - Dphases2 = 1 - -if not 'Ndelays2' in dir(): - Ndelays2 = 24 - -if not 'OFCKey2' in dir(): - OFCKey2 = "LArOFC_2" - -if not 'ShapeKey2' in dir(): - ShapeKey2 = "LArShape_2" - -if not 'FillShape2' in dir(): - FillShape2 = True - -if not 'OFCTreename2' in dir(): - OFCTreename2 = "OFC2" - -if not 'ShapeTreename2' in dir(): - ShapeTreename2 = "Shape2" - -########################################################################### -# OFC output -########################################################################### - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputOFCPoolFileDir' in dir(): - OutputOFCPoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") -OFCFileTag += str(Nsamples)+"samples" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCPhys_"+OFCFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys_"+OFCFileTag + ".pool.root" - - -#input folders: -if "AutoCorrFolder" not in dir(): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder -if "PhysAutoCorrFolder" not in dir(): - PhysAutoCorrFolder = LArCalib_Flags.LArPhysAutoCorrFolder -if "PhysCaliTdiffFolder" not in dir(): - PhysCaliTdiffFolder = LArCalib_Flags.LArPhysCaliTdiffFolder - -if isFCAL: - PhysWaveFolderFCAL="/LAR/ElecCalibOfl/PhysWaves/FCALFromTB" -else: - PhysWaveFolder = LArCalib_Flags.LArPhysWaveFolder - - -#Shift (can be output or input) -if "OFCBinFolder" not in dir(): - if not SuperCells: OFCBinFolder="/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts" - if SuperCells: OFCBinFolder="/LAR/ElecCalibOflSC/OFCBin/PhysWaveShifts" - - -#output Folders: -if "FolderOFC" not in dir(): - if not SuperCells: FolderOFC = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+str(Nsamples)+"samples3bins17phases" - if SuperCells: FolderOFC = "/LAR/ElecCalibOflSC/OFC/PhysWave/RTM/"+str(Nsamples)+"samples3bins17phases" - -if "FolderShape" not in dir(): - if not SuperCells: FolderShape = "/LAR/ElecCalibOfl/Shape/RTM/"+str(Nsamples)+"samples3bins17phases" - if SuperCells: FolderShape = "/LAR/ElecCalibOflSC/Shape/RTM/"+str(Nsamples)+"samples3bins17phases" - -if "FolderOFC2" not in dir(): - if not SuperCells: FolderOFC2 = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+str(Nsamples2)+"samples" - if SuperCells: FolderOFC2 = "/LAR/ElecCalibOflSC/OFC/PhysWave/RTM/"+str(Nsamples2)+"samples" - -if "FolderShape2" not in dir(): - if not SuperCells: FolderShape2 = "/LAR/ElecCalibOfl/Shape/RTM/"+str(Nsamples2)+"samples" - if SuperCells: FolderShape2 = "/LAR/ElecCalibOflSC/Shape/RTM/"+str(Nsamples2)+"samples" - - -rs=FolderTagResover() -if not 'AutoCorrLArCalibFolderTag' in dir(): - AutoCorrLArCalibFolderTag=rs.getFolderTagSuffix(AutoCorrFolder) - - -if not 'PhysAutoCorrLArCalibFolderTag' in dir(): - PhysAutoCorrLArCalibFolderTag="_mu_"+str(NColl)+rs.getFolderTagSuffix(PhysAutoCorrFolder) - -if not 'PhysWaveLArCalibFolderTag' in dir(): - if isFCAL: - PhysWaveLArCalibFolderTag=rs.getFolderTagSuffix(PhysWaveFolderFCAL) - else: - PhysWaveLArCalibFolderTag=rs.getFolderTagSuffix(PhysWaveFolder) - -if not 'PhysCaliTdiffLArCalibFolderTag' in dir(): - PhysCaliTdiffLArCalibFolderTag=rs.getFolderTagSuffix(PhysCaliTdiffFolder) - -if not 'OFCBinFolderTag' in dir(): - OFCBinFolderTag=rs.getFolderTagSuffix(OFCBinFolder) - - -#output Folders: -if "FolderTagOFC" not in dir(): - FolderTagOFC = rs.getFolderTagSuffix(FolderOFC) -if "FolderTagOFCmu" not in dir(): - FolderTagOFCmu = "-mu-"+str(NColl)+rs.getFolderTagSuffix(FolderOFC) -if "FolderTagShape" not in dir(): - FolderTagShape = rs.getFolderTagSuffix(FolderShape) - -if "FolderTagOFC2" not in dir(): - FolderTagOFC2 = rs.getFolderTagSuffix(FolderOFC2) -if "FolderTagOFC2mu" not in dir(): - FolderTagOFC2mu = "-mu-"+str(NColl)+rs.getFolderTagSuffix(FolderOFC) - -if "FolderTagShape2" not in dir(): - FolderTagShape2 = rs.getFolderTagSuffix(FolderShape2) - - -del rs #close Database - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - - -OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+ FolderOFC -OutputObjectSpecTagOFC = LArCalibFolderTag(FolderOFC,FolderTagOFC) - -OutputObjectSpecOFCmu = "LArOFCComplete#"+OFCKey+"_mu"+"#"+ FolderOFC -OutputObjectSpecTagOFCmu = LArCalibFolderTag(FolderOFC,FolderTagOFCmu) - -OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ FolderShape -OutputObjectSpecTagShape = LArCalibFolderTag(FolderShape,FolderTagShape) - -OutputObjectSpecOFC2 = "LArOFCComplete#"+OFCKey2+"#"+ FolderOFC2 -OutputObjectSpecTagOFC2 = LArCalibFolderTag(FolderOFC2,FolderTagOFC2) - -OutputObjectSpecOFC2mu = "LArOFCComplete#"+OFCKey2+"_mu"+"#"+ FolderOFC2 -OutputObjectSpecTagOFC2mu = LArCalibFolderTag(FolderOFC2,FolderTagOFC2mu) - -OutputObjectSpecShape2 = "LArShapeComplete#"+ShapeKey2+"#"+ FolderShape2 -OutputObjectSpecTagShape2 = LArCalibFolderTag(FolderShape2,FolderTagShape2) - -OutputObjectSpecOFCBin="LArOFCBinComplete#"+ShiftKey+"#"+OFCBinFolder -OutputObjectSpecTagOFCBin = LArCalibFolderTag(OFCBinFolder,OFCBinFolderTag) - - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - if 'InputPhysAutoCorrSQLiteFile' in dir(): - InputDBConnectionPhysAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionPhysAutoCorr = InputDBConnectionAutoCorr - -if ( ReadPhysWaveFromCOOL ): - if 'InputPhysWaveSQLiteFile' in dir(): - InputDBConnectionPhysWave = DBConnectionFile(InputPhysWaveSQLiteFile) - else: - InputDBConnectionPhysWave = DBConnectionCOOL - -if ( ReadPhysCaliTdiffFromCOOL ): - if 'InputPhysCaliTdiffSQLiteFile' in dir(): - InputDBConnectionPhysCaliTdiff = DBConnectionFile(InputPhysCaliTdiffSQLiteFile) - else: - InputDBConnectionPhysCaliTdiff = "COOLOFL_LAR/COMP200" - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadAutoCorrFromCOOL ): - OFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) - OFCLog.info( " InputDBConnectionPhysAutoCorr = "+InputDBConnectionPhysAutoCorr ) - OFCLog.info( " AutoCorrLArCalibFolderTag = "+AutoCorrLArCalibFolderTag) -else : - OFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ) - OFCLog.info( " InputPhysAutoCorrPoolFileName = "+InputPhysAutoCorrPoolDir+"/"+InputPhysAutoCorrPoolFileName ) - - -if ( ReadPhysWaveFromCOOL ): - OFCLog.info( " InputDBConnectionPhysWave = "+InputDBConnectionPhysWave ) - OFCLog.info( " PhysWaveLArCalibFolderTag =" +PhysWaveLArCalibFolderTag ) -else : - OFCLog.info( " InputPhysWavePoolFileName = "+InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ) - -if ( (ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL) and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) - -if ( ReadPhysCaliTdiffFromCOOL ): - OFCLog.info( " InputDBConnectionPhysCaliTdiff = "+InputDBConnectionPhysCaliTdiff ) - OFCLog.info( " PhysCaliTdiffLArCalibFolderTag = "+PhysCaliTdiffLArCalibFolderTag ) -else : - OFCLog.info( " InputPhysCaliTdiffPoolFileName = "+InputPhysCaliTdiffPoolDir+"/"+InputPhysCaliTdiffPoolFileName ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputPoolFullFileName = "+OutputOFCPoolFileDir+"/"+OutputPoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " OutputObjectSpecOFCmu = "+str(OutputObjectSpecOFCmu) ) -OFCLog.info( " OutputObjectSpecTagOFCmu = "+str(OutputObjectSpecTagOFCmu) ) -OFCLog.info( " OutputObjectSpecShape = "+str(OutputObjectSpecShape) ) -OFCLog.info( " OutputObjectSpecTagShape = "+str(OutputObjectSpecTagShape) ) -OFCLog.info( " OutputObjectSpecOFC2 = "+str(OutputObjectSpecOFC2) ) -OFCLog.info( " OutputObjectSpecTagOFC2 = "+str(OutputObjectSpecTagOFC2) ) -OFCLog.info( " OutputObjectSpecOFC2mu = "+str(OutputObjectSpecOFC2mu) ) -OFCLog.info( " OutputObjectSpecTagOFC2mu = "+str(OutputObjectSpecTagOFC2mu) ) -OFCLog.info( " OutputObjectSpecShape2 = "+str(OutputObjectSpecShape2) ) -OFCLog.info( " OutputObjectSpecTagShape2 = "+str(OutputObjectSpecTagShape2) ) -OFCLog.info( " OutputObjectSpecOFCBin = "+str(OutputObjectSpecOFCBin) ) -OFCLog.info( " OutputObjectSpecTagOFCBin = "+str(OutputObjectSpecTagOFCBin) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") -#Get cabling -if not SuperCells: - from LArCabling.LArCablingAccess import LArCalibIdMapping,LArOnOffIdMapping - LArCalibIdMapping() - LArOnOffIdMapping() -else: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - -########################################################################### -# # -# Input conditions data (AutoCorr, CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL ): - if not ('InputAutoCorrSQLiteFile') in dir(): - OFCLog.info( "Read AutoCorr from Oracle" ) - else : - OFCLog.info( "Read AutoCorr from SQLite file" ) - - if not ('InputPhysWaveSQLiteFile') in dir(): - OFCLog.info( "Read PhysWave from Oracle DB" ) - else : - OFCLog.info( "Read PhysWave from SQLite file" ) - -if ( ReadAutoCorrFromCOOL ): - PhysAutoCorrTagSpec= LArCalibFolderTag(PhysAutoCorrFolder,PhysAutoCorrLArCalibFolderTag) - AutoCorrTagSpec= LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) - conddb.addFolder("",PhysAutoCorrFolder+"<tag>"+PhysAutoCorrTagSpec+"</tag><key>LArPhysAutoCorr</key>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) -else: - if 'InputAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read AutoCorr from POOL file") - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - if 'InputPhysAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read PhysAutoCorr from POOL file") - PoolFileList += [ InputPhysAutoCorrPoolDir+"/"+InputPhysAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysAutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - -if ( ReadPhysWaveFromCOOL ): - if (doPhysWaveShifter or isFCAL) : - if isFCAL: - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolderFCAL,PhysWaveLArCalibFolderTag) - else: - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - if isFCAL: - conddb.addFolder("",PhysWaveFolderFCAL+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else: - conddb.addFolder("",PhysWaveFolder+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) -else: - if 'InputPhysWavePoolFileName' in dir(): - OFCLog.info( "Read PhysWave from POOL file" ) - PoolFileList += [ InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysWave or read from COOL." ) - theApp.exit(-1) - -if (UsePhysCaliTdiff): - if ( ReadPhysCaliTdiffFromCOOL ): - PhysCaliTdiffTagSpec = LArCalibFolderTag(PhysCaliTdiffFolder,PhysCaliTdiffLArCalibFolderTag) - conddb.addFolder("",PhysCaliTdiffFolder+"<key>"+PhysCaliTdiffKey+"</key><tag>"+PhysCaliTdiffTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysCaliTdiff+"</dbConnection>" + ChannelSelection) - else: - if 'InputPhysCaliTdiffPoolFileName' in dir(): - OFCLog.info( "Read PhysCaliTdiff from POOL file" ) - PoolFileList += [ InputPhysCaliTdiffPoolDir+"/"+InputPhysCaliTdiffPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysCaliTdiff or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if (doPhysWaveShifter) : - - ########################################################################### - # # - # Shift physics waveforms only for FCAL # - # # - ########################################################################### - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveShifter - LArPhysWaveShifter = LArPhysWaveShifter("LArPhysWaveShifter") - - LArPhysWaveShifter.KeyList = [ InputKey ] - LArPhysWaveShifter.KeyOutput = ContainerKey - LArPhysWaveShifter.GroupingType = GroupingType - - # - # Minimum Tstart per FEB computation - # - LArPhysWaveShifter.ComputeTimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftByFEBMode = ShiftMode - LArPhysWaveShifter.TimeShiftByFEBDump = True - LArPhysWaveShifter.TimeShiftByFEBDumpFile = "TimeShiftFEB.py" - - # - # Possible time shifts - # - LArPhysWaveShifter.TimeShiftByHelper = False - LArPhysWaveShifter.TimeShiftByIndex = 0 - LArPhysWaveShifter.TimeShiftFromPeak = False - LArPhysWaveShifter.NindexFromPeak = 0 # if 0 will use Ndelays*Nsampling - LArPhysWaveShifter.Ndelays = 24 - LArPhysWaveShifter.Nsamplings = Nsamplings - LArPhysWaveShifter.TimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftGuardRegion = TimeShiftGuardRegion - LArPhysWaveShifter.UsePhysCaliTdiff = UsePhysCaliTdiff - LArPhysWaveShifter.CellByCellShiftsKey = "LArPhysCaliTdiff" - LArPhysWaveShifter.OutputShiftsKey = ShiftKey - LArPhysWaveShifter.isSC = SuperCells - topSequence += LArPhysWaveShifter - -else: - #Load Shifts from DB: - if not SuperCells: # FIXME when shift for SC available - conddb.addFolder("LAR_OFL",OFCBinFolder+"<tag>"+OutputObjectSpecTagOFCBin+"</tag><key>"+ShiftKey+"</key>"); - - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -theLArAutoCorrDecoderTool.UseAlwaysHighGain=True -theLArAutoCorrDecoderTool.isSC = SuperCells - -if NColl > 0: - theLArPhysAutoCorrDecoderTool = LArAutoCorrDecoderTool("LArPhysAutoCorrDecoderTool") - theLArPhysAutoCorrDecoderTool.DecodeMode=1 - theLArPhysAutoCorrDecoderTool.UseAlwaysHighGain=True - theLArPhysAutoCorrDecoderTool.isSC = SuperCells - theLArPhysAutoCorrDecoderTool.KeyAutoCorr="LArPhysAutoCorr" - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg - -LArPhysOFCAlg = LArOFCAlg("LArPhysOFCAlg") - -LArPhysOFCAlg.ReadCaliWave = False -LArPhysOFCAlg.KeyList = [ InputKey ] -LArPhysOFCAlg.Normalize = Normalize -LArPhysOFCAlg.Verify = True -LArPhysOFCAlg.GroupingType = GroupingType - -LArPhysOFCAlg.Nphase = Nphases -LArPhysOFCAlg.Dphase = Dphases -LArPhysOFCAlg.Ndelay = Ndelays -LArPhysOFCAlg.Nsample = Nsamples -LArPhysOFCAlg.FillShape = FillShape -LArPhysOFCAlg.TimeShift = TimeShift -LArPhysOFCAlg.TimeShiftByIndex = TimeShiftByIndex -LArPhysOFCAlg.AddTimeOffset = -1.0*TimeShiftGuardRegion -if not SuperCells: # FIXME when shift for SC available - LArPhysOFCAlg.LArPhysWaveBinKey = ShiftKey - -LArPhysOFCAlg.UseDelta = 0 #Only for high-mu OFCs -LArPhysOFCAlg.KeyOFC = OFCKey -LArPhysOFCAlg.KeyShape = ShapeKey -LArPhysOFCAlg.DecoderTool = theLArAutoCorrDecoderTool -LArPhysOFCAlg.isSC = SuperCells -if Nsamples==4: - LArPhysOFCAlg.ReadDSPConfig = ReadDSPConfig - LArPhysOFCAlg.DSPConfigFolder = DSPConfigFolder - - -topSequence+=LArPhysOFCAlg - -LArPhysOFCAlg2 = LArOFCAlg("LArPhysOFCAlg2") - -LArPhysOFCAlg2.ReadCaliWave = False -LArPhysOFCAlg2.KeyList = [ InputKey ] -LArPhysOFCAlg2.Normalize = Normalize -LArPhysOFCAlg2.Verify = True -LArPhysOFCAlg2.GroupingType = GroupingType - -LArPhysOFCAlg2.Nphase = Nphases2 -LArPhysOFCAlg2.Dphase = Dphases2 -LArPhysOFCAlg2.Ndelay = Ndelays2 -LArPhysOFCAlg2.Nsample = Nsamples2 -LArPhysOFCAlg2.FillShape = FillShape2 -LArPhysOFCAlg2.TimeShift = TimeShift2 -LArPhysOFCAlg2.TimeShiftByIndex = TimeShiftByIndex2 -LArPhysOFCAlg2.AddTimeOffset = -1.0*TimeShiftGuardRegion -if not SuperCells: # FIXME when shift for SC available - LArPhysOFCAlg2.LArPhysWaveBinKey = ShiftKey -LArPhysOFCAlg2.UseDelta = 0 #Only for high-mu OFCs - -LArPhysOFCAlg2.KeyOFC = OFCKey2 -LArPhysOFCAlg2.KeyShape = ShapeKey2 -LArPhysOFCAlg2.DecoderTool = theLArAutoCorrDecoderTool -LArPhysOFCAlg2.isSC = SuperCells - -if Nsamples2==4: - LArPhysOFCAlg2.ReadDSPConfig = ReadDSPConfig2 - LArPhysOFCAlg2.DSPConfigFolder = DSPConfigFolder2 - -topSequence+=LArPhysOFCAlg2 - -if NColl > 0: - LArPhysOFCAlgmu = LArOFCAlg("LArPhysOFCAlgmu") - - LArPhysOFCAlgmu.ReadCaliWave = False - LArPhysOFCAlgmu.KeyList = [ InputKey ] - LArPhysOFCAlgmu.Normalize = Normalize - LArPhysOFCAlgmu.Verify = True - LArPhysOFCAlgmu.GroupingType = GroupingType - - LArPhysOFCAlgmu.Nphase = Nphases - LArPhysOFCAlgmu.Dphase = Dphases - LArPhysOFCAlgmu.Ndelay = Ndelays - LArPhysOFCAlgmu.Nsample = Nsamples - LArPhysOFCAlgmu.FillShape = False - LArPhysOFCAlgmu.TimeShift = TimeShift - LArPhysOFCAlgmu.TimeShiftByIndex = TimeShiftByIndex - LArPhysOFCAlgmu.AddTimeOffset = -1.0*TimeShiftGuardRegion - if not SuperCells: # FIXME when shift for SC available - LArPhysOFCAlgmu.LArPhysWaveBinKey = ShiftKey - - LArPhysOFCAlgmu.UseDelta = UseDelta - LArPhysOFCAlgmu.KeyOFC = OFCKey+"_mu" - LArPhysOFCAlgmu.DecoderTool = theLArPhysAutoCorrDecoderTool - LArPhysOFCAlgmu.isSC = SuperCells - - if Nsamples==4: - LArPhysOFCAlgmu.ReadDSPConfig = ReadDSPConfig - LArPhysOFCAlgmu.DSPConfigFolder = DSPConfigFolder - - - topSequence+=LArPhysOFCAlgmu - - LArPhysOFCAlgmu2 = LArOFCAlg("LArPhysOFCAlgmu2") - - LArPhysOFCAlgmu2.ReadCaliWave = False - LArPhysOFCAlgmu2.KeyList = [ InputKey ] - LArPhysOFCAlgmu2.Normalize = Normalize - LArPhysOFCAlgmu2.Verify = True - LArPhysOFCAlgmu2.GroupingType = GroupingType - - LArPhysOFCAlgmu2.Nphase = Nphases2 - LArPhysOFCAlgmu2.Dphase = Dphases2 - LArPhysOFCAlgmu2.Ndelay = Ndelays2 - LArPhysOFCAlgmu2.Nsample = Nsamples2 - LArPhysOFCAlgmu2.FillShape = False - LArPhysOFCAlgmu2.TimeShift = TimeShift2 - LArPhysOFCAlgmu2.TimeShiftByIndex = TimeShiftByIndex2 - LArPhysOFCAlgmu2.AddTimeOffset = -1.0*TimeShiftGuardRegion - if not SuperCells: # FIXME when shift for SC available - LArPhysOFCAlgmu2.LArPhysWaveBinKey = ShiftKey - LArPhysOFCAlgmu2.UseDelta = UseDelta - - LArPhysOFCAlgmu2.KeyOFC = OFCKey2+"_mu" - LArPhysOFCAlgmu2.DecoderTool = theLArPhysAutoCorrDecoderTool - LArPhysOFCAlgmu2.isSC = SuperCells - - if Nsamples2==4: - LArPhysOFCAlgmu2.ReadDSPConfig = ReadDSPConfig2 - LArPhysOFCAlgmu2.DSPConfigFolder = DSPConfigFolder2 - - topSequence+=LArPhysOFCAlgmu2 -########################################################################### - -if ( WriteNtuple ) : - - if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") - else : - OFCLog.info( "Read Bad Channels from SQLite file") - - if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg - theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - condSeq+=theLArBadChannelCondAlg - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - - LArOFC2Ntuple1 = LArOFC2Ntuple("LArOFC2Ntuple1") - #LArOFC2Ntuple1.RealGeometry = True - #LArOFC2Ntuple1.OffId = True - LArOFC2Ntuple1.ContainerKey = OFCKey - LArOFC2Ntuple1.NtupleName = OFCTreeName - LArOFC2Ntuple1.AddFEBTempInfo = False - LArOFC2Ntuple1.isSC = SuperCells - topSequence+=LArOFC2Ntuple1 - - LArOFC2Ntuple2 = LArOFC2Ntuple("LArOFC2Ntuple2") - #LArOFC2Ntuple2.RealGeometry = True - #LArOFC2Ntuple2.OffId = True - LArOFC2Ntuple2.ContainerKey = OFCKey2 - LArOFC2Ntuple2.NtupleName = OFCTreeName2 - LArOFC2Ntuple2.AddFEBTempInfo = False - LArOFC2Ntuple2.isSC = SuperCells - topSequence+=LArOFC2Ntuple2 - - if NColl > 0: - LArOFC2Ntuple1mu = LArOFC2Ntuple("LArOFC2Ntuple1mu") - #LArOFC2Ntuple1mu.RealGeometry = True - #LArOFC2Ntuple1mu.OffId = True - LArOFC2Ntuple1mu.ContainerKey = OFCKey+"_mu" - LArOFC2Ntuple1mu.NtupleName = OFCTreeName+"_mu" - LArOFC2Ntuple1mu.AddFEBTempInfo = False - LArOFC2Ntuple1mu.isSC = SuperCells - topSequence+=LArOFC2Ntuple1mu - - LArOFC2Ntuple2mu = LArOFC2Ntuple("LArOFC2Ntuple2mu") - #LArOFC2Ntuple2mu.RealGeometry = True - #LArOFC2Ntuple2mu.OffId = True - LArOFC2Ntuple2mu.ContainerKey = OFCKey2+"_mu" - LArOFC2Ntuple2mu.NtupleName = OFCTreeName2+"_mu" - LArOFC2Ntuple2mu.AddFEBTempInfo = False - LArOFC2Ntuple2mu.isSC = SuperCells - topSequence+=LArOFC2Ntuple2mu - - if ( FillShape ): - - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - - LArShape2Ntuple1 = LArShape2Ntuple("LArShape2Ntuple1") - LArShape2Ntuple1.ContainerKey = ShapeKey - LArShape2Ntuple1.NtupleName = ShapeTreeName - LArShape2Ntuple1.AddFEBTempInfo = False - LArShape2Ntuple1.isSC = SuperCells - topSequence+=LArShape2Ntuple1 - - LArShape2Ntuple2 = LArShape2Ntuple("LArShape2Ntuple2") - LArShape2Ntuple2.ContainerKey = ShapeKey2 - LArShape2Ntuple2.NtupleName = ShapeTreeName2 - LArShape2Ntuple2.AddFEBTempInfo = False - LArShape2Ntuple2.isSC = SuperCells - topSequence+=LArShape2Ntuple2 - - - if ( doPhysWaveShifter ): - from LArCalibTools.LArCalibToolsConf import LArFebTimeOffset2Ntuple - LArFebTimeOffset2Ntuple = LArFebTimeOffset2Ntuple( "LArFebTimeOffset2Ntuple" ) - LArFebTimeOffset2Ntuple.ContainerKey = "FebTimeOffset" - LArFebTimeOffset2Ntuple.AddFEBTempInfo = False - LArFebTimeOffset2Ntuple.isSC = SuperCells - - topSequence+=LArFebTimeOffset2Ntuple - - from LArCalibTools.LArCalibToolsConf import LArWFParams2Ntuple - LArWFParams2Ntuple=LArWFParams2Ntuple("LArWFParams2Ntuple") - LArWFParams2Ntuple.DumpOFCBin=True - LArWFParams2Ntuple.AddFEBTempInfo = False - LArWFParams2Ntuple.isSC = SuperCells - topSequence+=LArWFParams2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputOFCPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputOFCPoolFileDir+"/"+OutputPoolFileName) - - OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputOFCPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFC2] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFC2] - - if NColl > 0: - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFCmu] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFCmu] - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFC2mu] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFC2mu] - - if ( FillShape ): - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape] - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape2] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape2] - - if ( doPhysWaveShifter): - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFCBin] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFCBin] - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumber) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_jobOptions.py deleted file mode 100644 index 0102f295a4ac718d314e52f26427cbbed146d455..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_jobOptions.py +++ /dev/null @@ -1,617 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to compute OFC phys in all 3 gains -# -# Last update: 09/12/2008 <Marco.Delmastro@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# PhysWaveShifter properties # -########################################################################### - -if not 'doPhysWaveShifter' in dir(): - doPhysWaveShifter = True - -if not 'doOFCPicker' in dir(): - doOFCPicker=False - -if not 'InputKey' in dir(): - if (doPhysWaveShifter) : - InputKey = "LArPhysWaveUnShifted" - else : - InputKey = "LArPhysWave" # no shift applied to the PhysWave - -if not 'isFCAL' in dir() : - isFCAL = False - -if not 'InputKey' in dir(): - InputKey = "LArPhysWaveUnShifted" - -if not 'ShiftMode' in dir(): - ShiftMode = 2 # 1 = minimum Tstart from helper in FEB - # 2 = minumum Tpeak-NindexFromPeak in FEB - # 3 = average Tpeak-NindexFromPeak in FEB - -if not 'Nsamplings' in dir(): - Nsamplings = 2 - -if not 'TimeShiftGuardRegion' in dir(): - TimeShiftGuardRegion = 5 - -if not 'UsePhysCaliTdiff' in dir(): - UsePhysCaliTdiff = False - -if not 'PhysCaliTdiffKey' in dir(): - PhysCaliTdiffKey = "LArPhysCaliTdiff" - - - -########################################################################### -# Input selection (Autocorr, PhysWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## AutoCorr - -if not 'ReadAutoCorrFromCOOL' in dir(): - ReadAutoCorrFromCOOL = True - -if not 'InputAutoCorrPoolDir' in dir(): - InputAutoCorrPoolDir = subprocess.getoutput("pwd") - -if not 'InputAutoCorrPoolFileName' in dir(): - InputAutoCorrPoolFileName = "LArAutoCorr.pool.root" - -## PhysWave - -if not 'ReadPhysWaveFromCOOL' in dir(): - ReadPhysWaveFromCOOL = True - -if not 'InputPhysWavePoolDir' in dir(): - InputPhysWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysWavePoolFileName' in dir(): - InputPhysWavePoolFileName = "LArPhysWave.pool.root" - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties -########################################################################### - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'Nphases' in dir(): - Nphases = 50 - -if not 'Dphases' in dir(): # not yest implemeented! - Dphases = 1 - -if not 'Ndelays' in dir(): - Ndelays = 24 - -if not 'ContainerKey' in dir(): - ContainerKey = "LArPhysWave" - -if not 'OFCKey' in dir(): - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if not 'Normalize' in dir(): - Normalize = True - -if not 'TimeShift' in dir() : - TimeShift = False - -if not 'TimeShiftByIndex' in dir() : - TimeShiftByIndex = -1 - -if not 'FillShape' in dir(): - FillShape = True # Do not fill a LArShapeComplete object for calibration OFC! - -if not 'DumpOFC' in dir(): - DumpOFC = False - -########################################################################### -# OFC output -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -OFCFileTag += "_"+str(Nsamples)+"samples" - -if (Dphases>1): # not yet implemented! - OFCFileTag += "_"+str(Dphases)+"Dphase" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCPhys_"+OFCFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys_"+OFCFileTag + ".pool.root" - -if not 'LArPhysFolderOutputTag' in dir(): - LArPhysFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecOFC' in dir(): - if doOFCPicker: - FolderOFC = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples1phase" - OutputObjectSpecOFC = "LArOFCComplete#LArOFC#"+FolderOFC - OutputObjectSpecTagOFC = LArCalibFolderTag(FolderOFC,LArPhysFolderOutputTag) - else: - OutputObjectSpecOFC = "LArOFCComplete#" +OFCKey +"#"+ LArCalib_Flags.LArOFCPhysFolder+str(Nsamples)+"samples" - OutputObjectSpecTagOFC = LArCalibFolderTag(LArCalib_Flags.LArOFCPhysFolder+str(Nsamples)+"samples",LArPhysFolderOutputTag) - -if not 'OutputObjectSpecShape' in dir(): - if doOFCPicker: - FolderShape = "/LAR/ElecCalibOfl/Shape/RTM/5samples1phase" - OutputObjectSpecShape = "LArShapeComplete#LArShape#"+FolderShape - OutputObjectSpecTagShape = LArCalibFolderTag(FolderShape,LArPhysFolderOutputTag) - else: - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+ LArCalib_Flags.LArShapeFolder+str(Nsamples)+"samples" - OutputObjectSpecTagShape = LArCalibFolderTag(LArCalib_Flags.LArShapeFolder+str(Nsamples)+"samples",LArPhysFolderOutputTag) - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if ( ReadAutoCorrFromCOOL ): - if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) - else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if ( ReadPhysWaveFromCOOL ): - if 'InputPhysWaveSQLiteFile' in dir(): - InputDBConnectionPhysWave = DBConnectionFile(InputPhysWaveSQLiteFile) - else: - InputDBConnectionPhysWave = DBConnectionCOOL - -if ( ReadPhysCaliTdiffFromCOOL ): - if 'InputPhysCaliTdiffSQLiteFile' in dir(): - InputDBConnectionPhysCaliTdiff = DBConnectionFile(InputPhysCaliTdiffSQLiteFile) - else: - InputDBConnectionPhysCaliTdiff = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadAutoCorrFromCOOL ): - OFCLog.info( " InputDBConnectionAutoCorr = "+InputDBConnectionAutoCorr ) -else : - OFCLog.info( " InputAutoCorrPoolFileName = "+InputAutoCorrPoolFileName ) -if 'AutoCorrLArCalibFolderTag' in dir() : - OFCLog.info( " AutoCorrLArCalibFolderTag = "+AutoCorrLArCalibFolderTag ) -if ( ReadPhysWaveFromCOOL ): - OFCLog.info( " InputDBConnectionPhysWave = "+InputDBConnectionPhysWave ) -else : - OFCLog.info( " InputPhysWavePoolFileName = "+InputPhysWavePoolFileName ) -if ( (ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL) and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) -if 'PhysWaveLArCalibFolderTag' in dir() : - OFCLog.info( " PhysWaveLArCalibFolderTag = "+PhysWaveLArCalibFolderTag ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputPoolFullFileName = "+OutputPoolFileDir+"/"+OutputPoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " OutputObjectSpecShape = "+str(OutputObjectSpecShape) ) -OFCLog.info( " OutputObjectSpecTagShape = "+str(OutputObjectSpecTagShape) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (AutoCorr, CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadAutoCorrFromCOOL or ReadPhysWaveFromCOOL ): - if not ('InputAutoCorrSQLiteFile') in dir(): - OFCLog.info( "Read AutoCorr from Oracle" ) - else : - OFCLog.info( "Read AutoCorr from SQLite file" ) - - if not ('InputPhysWaveSQLiteFile') in dir(): - OFCLog.info( "Read PhysWave from Oracle DB" ) - else : - OFCLog.info( "Read PhysWave from SQLite file" ) - -if ( ReadAutoCorrFromCOOL ): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder - if 'AutoCorrLArCalibFolderTag' in dir(): - - AutoCorrTagSpec = LArCalibFolderTag(AutoCorrFolder,AutoCorrLArCalibFolderTag) - conddb.addFolder("",AutoCorrFolder+"<tag>"+AutoCorrTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) - else : - conddb.addFolder("",AutoCorrFolder+"<dbConnection>"+InputDBConnectionAutoCorr+"</dbConnection>"+ ChannelSelection) -else: - if 'InputAutoCorrPoolFileName' in dir(): - OFCLog.info( "Read AutoCorr from POOL file") - PoolFileList += [ InputAutoCorrPoolDir+"/"+InputAutoCorrPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing AutoCorrelation Matrix or read from COOL." ) - theApp.exit(-1) - -if ( ReadPhysWaveFromCOOL ): - PhysWaveFolder = LArCalib_Flags.LArPhysWaveFolder - if not (isFCAL) : - if (doPhysWaveShifter) : - if 'PhysWaveLArCalibFolderTag' in dir() : - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",PhysWaveFolder+"<key>"+InputKey+"</key><dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - if 'PhysWaveLArCalibFolderTag' in dir() : - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",PhysWaveFolder+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - if 'PhysWaveLArCalibFolderTag' in dir() : - PhysWaveTagSpec = LArCalibFolderTag(PhysWaveFolder,PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<key>"+InputKey+"</key><tag>"+PhysWaveTagSpec+"</tag><dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - else : - PhysWaveFolderFCAL="/LAR/ElecCalibOfl/PhysWaves/FCALFromTB" - conddb.addFolder("",PhysWaveFolderFCAL+"<key>"+InputKey+"</key><dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - -else: - if 'InputPhysWavePoolFileName' in dir(): - OFCLog.info( "Read PhysWave from POOL file" ) - PoolFileList += [ InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL." ) - theApp.exit(-1) - - - - -if (UsePhysCaliTdiff): - if ( ReadPhysCaliTdiffFromCOOL ): - PhysCaliTdiffFolder = LArCalib_Flags.LArPhysCaliTdiffFolder - if 'PhysCaliTdiffLArCalibFolderTag' in dir() : - PhysCaliTdiffTagSpec = LArCalibFolderTag(PhysCaliTdiffFolder,PhysCaliTdiffLArCalibFolderTag) - conddb.addFolder("",PhysCaliTdiffFolder+"<key>"+PhysCaliTdiffKey+"</key><tag>"+PhysCaliTdiffTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysCaliTdiff+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",PhysCaliTdiffFolder+"<key>"+PhysCaliTdiffKey+"</key><dbConnection>"+InputDBConnectionPhysCaliTdiff+"</dbConnection>" + ChannelSelection) - else: - if 'InputPhysCaliTdiffPoolFileName' in dir(): - OFCLog.info( "Read PhysCaliTdiff from POOL file" ) - PoolFileList += [ InputPhysCaliTdiffPoolDir+"/"+InputPhysCaliTdiffPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing PhysCaliTdiff or read from COOL." ) - theApp.exit(-1) - - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if (doPhysWaveShifter) : - - ########################################################################### - # # - # Shift physics waveforms only for FCAL # - # # - ########################################################################### - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveShifter - LArPhysWaveShifter = LArPhysWaveShifter("LArPhysWaveShifter") - - LArPhysWaveShifter.KeyList = [ InputKey ] - LArPhysWaveShifter.KeyOutput = ContainerKey - LArPhysWaveShifter.GroupingType = GroupingType - - # - # Minimum Tstart per FEB computation - # - LArPhysWaveShifter.ComputeTimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftByFEBMode = ShiftMode - LArPhysWaveShifter.TimeShiftByFEBDump = True - LArPhysWaveShifter.TimeShiftByFEBDumpFile = "TimeShiftFEB.py" - - # - # Possible time shifts - # - LArPhysWaveShifter.TimeShiftByHelper = False - LArPhysWaveShifter.TimeShiftByIndex = 0 - LArPhysWaveShifter.TimeShiftByLayer = False - LArPhysWaveShifter.TshiftLayer = [ 0 , 0 , 0 , 0 ] - LArPhysWaveShifter.TimeShiftFromPeak = False - LArPhysWaveShifter.NindexFromPeak = 0 # if 0 will use Ndelays*Nsampling - LArPhysWaveShifter.Ndelays = 24 - LArPhysWaveShifter.Nsamplings = Nsamplings - LArPhysWaveShifter.TimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftGuardRegion = TimeShiftGuardRegion - LArPhysWaveShifter.UsePhysCaliTdiff = UsePhysCaliTdiff - - topSequence += LArPhysWaveShifter - -########################################################################### -# OFC computation -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg -LArPhysOFCAlg = LArOFCAlg("LArPhysOFCAlg") -LArPhysOFCAlg.ReadCaliWave = False -LArPhysOFCAlg.KeyList = [ ContainerKey ] -LArPhysOFCAlg.Nphase = Nphases -LArPhysOFCAlg.Dphase = Dphases -LArPhysOFCAlg.Ndelay = Ndelays -LArPhysOFCAlg.Nsample = Nsamples -LArPhysOFCAlg.Normalize = Normalize -LArPhysOFCAlg.TimeShift = TimeShift -LArPhysOFCAlg.TimeShiftByIndex = TimeShiftByIndex -LArPhysOFCAlg.Verify = True -LArPhysOFCAlg.FillShape = FillShape -if ( doOFCPicker): - LArPhysOFCAlg.KeyOFC = "tempOFC" - LArPhysOFCAlg.KeyShape = "tempShape" -else: - LArPhysOFCAlg.KeyOFC = OFCKey - LArPhysOFCAlg.KeyShape = ShapeKey - -if ( DumpOFC ) : - LArPhysOFCAlg.DumpOFCfile = "LArOFCPhys.dat" -LArPhysOFCAlg.GroupingType = GroupingType -topSequence+=LArPhysOFCAlg - -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -ToolSvc += theLArAutoCorrDecoderTool - - -if ( doOFCPicker): - conddb.addFolder("","/LAR/ElecCalibOfl/OFCBin/Dummy<dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ ChannelSelection) - from LArCalibUtils.LArCalibUtilsConf import LArOFPhasePicker - LArOFPhasePicker = LArOFPhasePicker("LArOFPhasePicker") - LArOFPhasePicker.KeyPhase = "LArOFCPhase" - LArOFPhasePicker.KeyOFC_new = OFCKey - LArOFPhasePicker.KeyOFC = "tempOFC" - - LArOFPhasePicker.KeyShape_new = ShapeKey - LArOFPhasePicker.KeyShape_newcorr = ShapeKeyCorr - LArOFPhasePicker.KeyShape = "tempShape" - LArOFPhasePicker.KeyShapeResidual = "LArResiduals" - LArOFPhasePicker.doShapeCorrection = FillShapeCorr - - LArOFPhasePicker.GroupingType = GroupingType - LArOFPhasePicker.DefaultPhase = DefaultPhase - LArOFPhasePicker.TimeOffsetCorrection = TimeOffsetCorrection - topSequence += LArOFPhasePicker - - - - -########################################################################### - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - #LArOFC2Ntuple.ContainerKey = "tempOFC" - LArOFC2Ntuple.ContainerKey = OFCKey - LArOFC2Ntuple.AddFEBTempInfo = False - topSequence+=LArOFC2Ntuple - - - if ( doPhysWaveShifter ): - from LArCalibTools.LArCalibToolsConf import LArFebTimeOffset2Ntuple - LArFebTimeOffset2Ntuple = LArFebTimeOffset2Ntuple( "LArFebTimeOffset2Ntuple" ) - LArFebTimeOffset2Ntuple.ContainerKey = "FebTimeOffset" - LArFebTimeOffset2Ntuple.AddFEBTempInfo = False - - topSequence+=LArFebTimeOffset2Ntuple - - - if ( FillShape ): - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = ShapeKey - #LArShape2Ntuple.ContainerKey = "tempShape" - LArShape2Ntuple.AddFEBTempInfo = False - topSequence+=LArShape2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputPoolFileDir+"/"+OutputPoolFileName) - OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - if ( FillShape ): - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape] - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumber) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py deleted file mode 100644 index 84832633f9df3b77a8ee816c65a6d277f91ee803..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py +++ /dev/null @@ -1,216 +0,0 @@ -include("LArCalibProcessing/LArCalib_Flags.py") - -if 'Runnumber' not in dir(): - Runnumber=2147483647 - -globaltag="LARCALIB-000-02" - -if "Objects" not in dir(): - Objects=["RAMP"]#,"CALIWAVE"] - -if "sqlite" in dir(): - InputDB="sqlite://;schema="+sqlite+";dbname=CONDBR2" -else: - InputDB="COOLOFL_LAR/CONDBR2" - - -if "output" in dir(): - OutputDB="sqlite://;schema="+output+";dbname=CONDBR2" -else: - if "sqlite" in dir(): - OutputDB=InputDB - else: - OutputDB="sqlite://;schema=AdditionalCorrections.db;dbname=CONDBR2" - -if 'poolcat' not in dir() and os.access("freshConstants.xml",os.R_OK): - poolcat="freshConstants.xml" - -if 'Partitions' not in dir(): - Partitions=['EMB','EC'] #means all -if 'Gains' not in dir(): - Gains=[0,1,2] - -if not "WriteNtuple" in dir(): - WriteNtuple=True - - -doCW=False -doCWxtalk=False -doRamp=False - -for obj in Objects: - if upper(obj).startswith("RAMP"): - doRamp=True - - elif upper(obj).startswith("CALIWAVE"): - for p in Partitions: - if p.startswith("E"): doCWxtalk=True - #if (p.startswith("EC") or p.startswith("HEC") or p.startswith("FCAL")): doCW=True - if (p.startswith("HEC") or p.startswith("FCAL")): doCW=True - if doCW and doCWxtalk: - printfunc ("ERROR: Can't do CaliWave patching for partitions",Partitions,"in one go.") - sys.exit(-1) - -inputFolders=[] -if doRamp: - inputFolders+=[LArCalib_Flags.LArRampFolder] - -if doCW: - inputFolders+=[ LArCalib_Flags.LArCaliWaveFolder] -elif doCWxtalk: - inputFolders+=[ LArCalib_Flags.LArCaliWaveFolderXtlk] - - -from LArConditionsCommon.LArExtendedSubDetGrouping import LArExtendedSubDetGrouping -g=LArExtendedSubDetGrouping() -g.setWithCorr(False) #ingore correction channels -sel=g.getChannelSelection(Partitions,Gains) -ccs="<channelSelection>"+sel+"</channelSelection>" - -from LArCalibProcessing.extractFolderInfo import * -folderInfo=extractFolderInfo(InputDB,globaltag,inputFolders,Runnumber,sel) -if folderInfo is None: - printfunc ("Failed to inspect database",InputDB) - sys.exit(-1) - -printfunc (folderInfo) -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="data" -globalflags.InputFormat="bytestream" - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -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 -from AtlasGeoModel import SetupRecoGeometry - -#Get identifier mapping (needed by LArConditionsContainer) -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannelsOfl/BadChannels</key>") -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannelsOfl/MissingFEBs</key>") -svcMgr.IOVDbSvc.GlobalTag=globaltag -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = Runnumber - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat - -IOVstart=Runnumber -IOVend=0 -OutputObjectSpec=[] -OutputTagSpec=[] - -printfunc (folderInfo) - -for f in folderInfo: - fn=f[0] - type=f[1] - key=f[2] - tag=f[3] - since=f[4] - until=f[5] - printfunc ("Working on folder",fn,"IOV:",since,"-",until) - OutputObjectSpec+=["#".join((type,key,fn))] - OutputTagSpec+=[tag] - if since<IOVstart: IOVstart=since - if until>IOVend: IOVend=until - conddb.addFolder("",fn+"<key>"+key+"Input</key><tag>"+tag+"</tag><db>"+InputDB+"</db>"+ccs) - - -printfunc (OutputObjectSpec) - - -i=0 -outputFileName="AdditionalCorrections_%i_%i.pool.root" % (IOVstart,i) -while (os.access(outputFileName,os.F_OK)): - i=i+1 - outputFileName="AdditionalCorrections_%i_%i.pool.root" % (IOVstart,i) - -outputRootFileName="AdditionalCorrections_%i_%i.root" % (IOVstart,i) -while (os.access(outputRootFileName,os.F_OK)): - i=i+1 - outputRootFileName="AdditionalCorrections_%i_%i.root" % (IOVstart,i) - - -if doRamp: - #Algo: - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArRampComplete_ - theLArRampPatcher=LArCalibPatchingAlg_LArRampComplete_("LArRampPatcher") - theLArRampPatcher.ContainerKey="LArRampInput" - theLArRampPatcher.NewContainerKey="LArRamp" - theLArRampPatcher.PatchMethod="PhiAverage" - #theLArRampPatcher.OutputLevel=DEBUG - theLArRampPatcher.ProblemsToPatch=[ - "deadCalib","deadReadout","deadPhys","almostDead","short", - "highNoiseHG","highNoiseMG","highNoiseLG"] - topSequence+=theLArRampPatcher - - if doCW or doCWxtalk: - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArCaliWaveContainer_ - theLArCaliWavePatcher=LArCalibPatchingAlg_LArCaliWaveContainer_("LArCaliWavePatcher") - theLArCaliWavePatcher.ContainerKey="LArCaliWaveInput" - theLArCaliWavePatcher.NewContainerKey="LArCaliWave" - theLArCaliWavePatcher.PatchMethod="PhiAverage" - #theLArCaliWavePatcher.OutputLevel=DEBUG - theLArCaliWavePatcher.ProblemsToPatch=[ - "deadCalib","deadReadout","deadPhys","almostDead","short", - "highNoiseHG","highNoiseMG","highNoiseLG"] - topSequence+=theLArCaliWavePatcher - - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg", outputFileName, - OutputObjectSpec,OutputTagSpec,True) - -theOutputConditionsAlg.Run1 = IOVstart -theOutputConditionsAlg.Run2 = IOVend -svcMgr.IOVDbSvc.dbConnection = OutputDB - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = False - - -if WriteNtuple: - from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple - LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") - LArRamps2Ntuple.NtupleName = "RAMPS" - LArRamps2Ntuple.RawRamp = False - LArRamps2Ntuple.ApplyCorr = True - - - - - - -svcMgr.DetectorStore.Dump=True - -svcMgr.IOVDbSvc.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py deleted file mode 100644 index 11c58f79c3b2da4aa6b0ff11c52d73d7a2c80a6b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py +++ /dev/null @@ -1,816 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -############################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to reconstruction one or more pedestal runs from data -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -############################################################################### - -if not "SuperCells" in dir(): - SuperCells=False - -if not "realGeometry" in dir(): - realGeometry=False - - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'SCProtectSourceId' in dir(): - SCProtectSourceId = True - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0026924' ] - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Pedestal" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2011/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'FullFileName' in dir(): - if 'Trigger' not in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Pedestal"+".*"+Partition - # Hack to allow ALL pedestals read properly - Trigger = "calibration_LArElec-Pedestal"+".*" - - - FullFileName =[] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - - -if not 'GainList' in dir(): - if not SuperCells: - GainList = [ "HIGH", "MEDIUM", "LOW" ] - else: - GainList = [ "SC" ] - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -if not 'SkipEvents' in dir(): - SkipEvents=0 - -if not 'doBadCatcher' in dir(): - doBadCatcher=True - - - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = True - -## LArFEBMon -if not 'doLArFEBMon' in dir(): - doLArFEBMon = True - -## LArOddCellMonTool -if not 'doLArOddCellMonTool' in dir(): - doLArOddCellMonTool= False - -## LArScaNoiseTool -if not 'doLArScaNoiseTool' in dir(): - doLArScaNoiseTool = False - -### LArDigitNoiseMonTool -#if not 'doLArDigitNoiseMonTool' in dir(): -# doLArDigitNoiseMonTool= False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = True - -## LAr Coherent Noise Mon -if not 'doLArCoherentNoise' in dir(): - doLArCoherentNoise = False - - -if not 'online' in dir(): - online = False - -if 'coherentNoiseFEBS' not in dir(): - coherentNoiseFEBS=[] - -if 'coherNoisePartSums' not in dir(): - coherNoisePartSums=False - -####################################################### -# Pedestal and AutoCorrelation properties -####################################################### - -if not 'Pedestal' in dir(): - Pedestal = True - -if not 'AutoCorr' in dir(): - AutoCorr = True - -if not 'EventsRef' in dir(): - EventsRef = 0 - -if not 'NSigma' in dir(): - NSigma = 5 - -if not 'NSamples' in dir(): - NSamples = 32 - -if not 'WhichSample' in dir(): - WhichSample = -1 - -if not 'MinSample' in dir(): - MinSample=-1 - -if not 'MaxSample' in dir(): - MaxSample=-1 - -####################################################### -# Pedestal and AutoCorrelation output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if not 'OutputPedAutoCorrRootFileDir' in dir(): - OutputPedAutoCorrRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPedAutoCorrPoolFileDir' in dir(): - OutputPedAutoCorrPoolFileDir = subprocess.getoutput("pwd") - -if not 'PedLArCalibFolderTag' in dir(): - rs=FolderTagResover() - PedLArCalibFolderTag = rs.getFolderTagSuffix(LArCalib_Flags.LArPedestalFolder) - ACLArCalibFolderTag = rs.getFolderTagSuffix(LArCalib_Flags.LArAutoCorrFolder) - del rs #Close DB connection - - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'KeyOutputAC' in dir(): - KeyOutputAC = "LArAutoCorr" - -if not 'KeyOutputPed' in dir(): - KeyOutputPed = "Pedestal" # need Pedestal to merge with oracle, LArPedestal doesn't work - -if not 'BaseFileNamePedAutoCorr' in dir(): - BaseFileNamePedAutoCorr = "LArPedAutoCorr" - -for RunNumber in RunNumberList : - BaseFileNamePedAutoCorr = BaseFileNamePedAutoCorr + "_" - BaseFileNamePedAutoCorr = BaseFileNamePedAutoCorr + str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputPedAutoCorrRootFileName' in dir(): - OutputPedAutoCorrRootFileName = BaseFileNamePedAutoCorr+ ".root" - -if not 'OutputPedAutoCorrPoolFileName' in dir(): - OutputPedAutoCorrPoolFileName = BaseFileNamePedAutoCorr + ".pool.root" - -if not 'OutputObjectSpecPed' in dir(): - OutputObjectSpecPed = "LArPedestalComplete#"+KeyOutputPed+"#"+LArCalib_Flags.LArPedestalFolder - OutputTagSpecPed=LArCalibFolderTag(LArCalib_Flags.LArPedestalFolder,PedLArCalibFolderTag) - -if not 'OutputObjectSpecAutoCorr' in dir(): - OutputObjectSpecAutoCorr = "LArAutoCorrComplete#"+KeyOutputAC+"#"+LArCalib_Flags.LArAutoCorrFolder - OutputTagSpecAutoCorr=LArCalibFolderTag(LArCalib_Flags.LArAutoCorrFolder,ACLArCalibFolderTag) - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - - -####################################################################################### -# print summary -####################################################################################### - -PedestalAutoCorrLog = logging.getLogger( "PedestalAutoCorrLog" ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " *** LAr Pedestal/AutoCorr summary *** " ) -PedestalAutoCorrLog.info( " ======================================================== " ) -PedestalAutoCorrLog.info( " RunNumber = "+str(RunNumberList) ) -PedestalAutoCorrLog.info( " SubDetector = "+SubDet ) -PedestalAutoCorrLog.info( " Partition = "+Partition ) -PedestalAutoCorrLog.info( " Type = Pedestal " ) -PedestalAutoCorrLog.info( " LArGain = "+str(GainList) ) -for i in range(len(FullFileName)): - PedestalAutoCorrLog.info( " FullFileName = "+FullFileName[i] ) -PedestalAutoCorrLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -PedestalAutoCorrLog.info( " OutputPedAutoCorrRootFullFileName = "+OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName ) -PedestalAutoCorrLog.info( " OutputPedAutoCorrPoolFullFileName = "+OutputPedAutoCorrPoolFileDir + "/" + OutputPedAutoCorrPoolFileName ) -PedestalAutoCorrLog.info( " OutputObjectSpecPed = "+OutputObjectSpecPed ) -PedestalAutoCorrLog.info( " OutputTagSpecPed = "+OutputTagSpecPed ) -PedestalAutoCorrLog.info( " OutputObjectSpecAutoCorr = "+OutputObjectSpecAutoCorr ) -PedestalAutoCorrLog.info( " OutputTagSpecAutoCorr = "+OutputTagSpecAutoCorr ) -PedestalAutoCorrLog.info( " IOVBegin = "+str(IOVBegin) ) -PedestalAutoCorrLog.info( " IOVEnd = "+str(IOVEnd) ) -PedestalAutoCorrLog.info( " LArCalibOutputDB = "+OutputDB ) -PedestalAutoCorrLog.info( " ======================================================== " ) - -####################################################################################### -include ("LArConditionsCommon/LArMinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -# new way to configure mapping: -# we need standard mapping for BadChannelAlg, there is no SC bad channel DB yet -from LArCabling.LArCablingAccess import LArCalibIdMapping,LArOnOffIdMapping -LArOnOffIdMapping() -LArCalibIdMapping() - -from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloAlignCondAlg -condSeq += CaloAlignCondAlg("CaloAlignCondAlg",LArAlignmentStore="",CaloCellPositionShiftFolder="") - -if SuperCells: - from LArCabling.LArCablingAccess import LArCalibIdMappingSC,LArOnOffIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg - condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import theApp, ServiceMgr, ToolSvc - - - -## define the DB Gobal Tag : -ServiceMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - ServiceMgr.IOVDbSvc.DBInstance="" -except: - pass - -theByteStreamInputSvc=ServiceMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - PedestalAutoCorrLog.info( "No FullFileName! Please give a FullFileName list") - theApp.exit(-1) -else : - ServiceMgr.EventSelector.Input=FullFileName - -ServiceMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -# else # -# ServiceMgr.EventSelector.Input=OneFileName # -# for i in range(len(ServiceMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -if runAccumulator: - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #theLArLATOMEDecoder.DumpFile = SC_DumpFile - #theLArLATOMEDecoder.RawDataFile = SC_RawDataFile - - from LArByteStream.LArByteStreamConf import LArRawSCDataReadingAlg - larRawSCDataReadingAlg = LArRawSCDataReadingAlg() - larRawSCDataReadingAlg.adcCollKey = Gain - larRawSCDataReadingAlg.adcBasCollKey = "" - larRawSCDataReadingAlg.etCollKey = "" - larRawSCDataReadingAlg.etIdCollKey = "" - larRawSCDataReadingAlg.LATOMEDecoder = theLArLATOMEDecoder - larRawSCDataReadingAlg.OutputLevel = INFO - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - - topSequence += larRawSCDataReadingAlg - - else: - ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/HIGH"] - ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/MEDIUM"] - ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/LOW"] - ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - - from LArROD.LArRODConf import LArDigitsAccumulator - larDigitsAccumulator = LArDigitsAccumulator("LArDigitsAccumulator") - larDigitsAccumulator.KeyList = [Gain] - larDigitsAccumulator.LArAccuDigitContainerName = "" - larDigitsAccumulator.NTriggersPerStep = 100 - larDigitsAccumulator.isSC = SuperCells - if SuperCells: larDigitsAccumulator.DropPercentTrig = 20 - larDigitsAccumulator.OutputLevel = INFO - - topSequence += larDigitsAccumulator - -else: - - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #theLArLATOMEDecoder.DumpFile = SC_DumpFile - #theLArLATOMEDecoder.RawDataFile = SC_RawDataFile - - from LArByteStream.LArByteStreamConf import LArRawSCCalibDataReadingAlg - LArRawSCCalibDataReadingAlg = LArRawSCCalibDataReadingAlg() - LArRawSCCalibDataReadingAlg.LArSCAccDigitKey = Gain - LArRawSCCalibDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.DumpFile = SC_DumpFile - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.RawDataFile = SC_RawDataFile - LArRawSCCalibDataReadingAlg.LATOMEDecoder.ProtectSourceId = SCProtectSourceId - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.OutputLevel = WARNING - - topSequence+=LArRawSCCalibDataReadingAlg - - else: - # Need to debug the raw data reading algo for legacy - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArAccDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - #temporarily - theLArRawCalibDataReadingAlg.FailOnCorruption=False - - topSequence+=theLArRawCalibDataReadingAlg - - -from IOVDbSvc.CondDB import conddb - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/" + conddb.dbname - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -if not SuperCells: - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False - - if doBadCatcher: - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=True - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList=GainList - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher - -####################################################### -# # -# Pedestal run reconstruction # -# # -####################################################### - - - -if not 'InputBadChannelSQLiteFile' in dir(): - PedestalAutoCorrLog.info( "Read Bad Channels from Oracle DB") -else : - PedestalAutoCorrLog.info( "Read Bad Channels from SQLite file") - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -ServiceMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -## define the DB Gobal Tag : -ServiceMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - ServiceMgr.IOVDbSvc.DBInstance="" -except: - pass - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") -#ServiceMgr.EventSelector.InitialTimeStamp = 1284030331 -#import cx_Oracle -#import time -#import datetime -#try: -# connection=cx_Oracle.connect("ATLAS_SFO_T0_R/readmesfotz2008@atlr") -# cursor=connection.cursor() -# sRequest=("SELECT RUNNR,CREATION_TIME FROM SFO_TZ_RUN WHERE RUNNR='%s'")%(RunNumberList[0]) -# cursor.execute(sRequest) -# times= cursor.fetchall() -# d=times[0][1] -# iovtemp=int(time.mktime(d.timetuple())) -#except: -# iovtemp=1284030331 - -#printfunc ("Setting timestamp for run ",RunNumberList[0]," to ",iovtemp) -#ServiceMgr.IOVDbSvc.forceTimestamp = 1283145454 -#ServiceMgr.IOVDbSvc.forceTimestamp = iovtemp - -if ( doLArCalibDataQuality ) : - if Pedestal : - ## The reference is the Oracle DB - conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Pedestal<key>PedestalRef</key>"+ChannelSelection) - - if AutoCorr : - ## The reference is the Oracle DB - conddb.addFolder("",LArCalib_Flags.LArAutoCorrFolder+"<key>LArAutoCorrRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - - -""" -if runAccumulator: - if Pedestal : - from LArCalibUtils.LArCalibUtilsConf import LArPedestalMaker - LArPedestalMaker=LArPedestalMaker("LArPedestalMaker") - LArPedestalMaker.events_ref = EventsRef - LArPedestalMaker.nsigma = NSigma - LArPedestalMaker.which_sample = WhichSample - LArPedestalMaker.KeyList = GainList - LArPedestalMaker.KeyOutput = KeyOutputPed - LArPedestalMaker.GroupingType = GroupingType - if not SuperCells: - LArPedestalMaker.sample_min = MinSample - LArPedestalMaker.sample_max = MaxSample - - topSequence += LArPedestalMaker - - if AutoCorr : - from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrMaker - LArAutoCorrMaker=LArAutoCorrMaker("LArAutoCorrMaker") - LArAutoCorrMaker.KeyList = GainList - LArAutoCorrMaker.events_ref = EventsRef - LArAutoCorrMaker.nsigma = NSigma - #LArAutoCorrMaker.Nsamples = NSamples - LArAutoCorrMaker.KeyOutput = KeyOutputAC - LArAutoCorrMaker.GroupingType = GroupingType - topSequence += LArAutoCorrMaker - -else : -""" -# pre computation in the DSP or acummulator -from LArCalibUtils.LArCalibUtilsConf import LArPedestalAutoCorrBuilder -LArPedACBuilder=LArPedestalAutoCorrBuilder("LArPedestalAutoCorrBuilder") -#LArPedACBuilder.isSC = SuperCells -LArPedACBuilder.KeyList = GainList -LArPedACBuilder.PedestalKey = KeyOutputPed -LArPedACBuilder.AutoCorrKey = KeyOutputAC -LArPedACBuilder.GroupingType = GroupingType -if not SuperCells: - LArPedACBuilder.sample_min = MinSample - LArPedACBuilder.sample_max = MaxSample - -LArPedACBuilder.OutputLevel = WARNING -topSequence += LArPedACBuilder - - -###################################################################### -# # -# Output # -# # -###################################################################### - - -if ( doLArCalibDataQuality ) : - - if Pedestal : - from LArCalibDataQuality.Thresholds import pedThr,rmsThr, pedThrFEB,rmsThrFEB - from LArCalibDataQuality.LArCalibDataQualityConf import LArPedestalValidationAlg - thePedestalValidationAlg=LArPedestalValidationAlg("PedestalVal") - thePedestalValidationAlg.ValidationKey="Pedestal" - thePedestalValidationAlg.ReferenceKey="PedestalRef" - thePedestalValidationAlg.PedestalTolerance=pedThr - thePedestalValidationAlg.PedestalRMSTolerance=rmsThr - thePedestalValidationAlg.PedestalToleranceFEB=pedThrFEB - thePedestalValidationAlg.PedestalRMSToleranceFEB=rmsThrFEB - thePedestalValidationAlg.MsgLevelForDeviations=WARNING - thePedestalValidationAlg.ListOfDevFEBs="pedFebs.txt" - thePedestalValidationAlg.CheckCompletness=True - thePedestalValidationAlg.PatchMissingFEBs=True - thePedestalValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels - topSequence+=thePedestalValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadPedestal=LArPedestalValidationAlg("PedestalFail") - theBadPedestal.ValidationKey="Pedestal" - theBadPedestal.ReferenceKey="PedestalRef" - theBadPedestal.PedestalTolerance = ["10,10,10"] - theBadPedestal.PedestalRMSTolerance = ["0.5, 0.5, 0.5"] - theBadPedestal.PedestalToleranceFEB = ["8, 8, 8"] - theBadPedestal.PedestalRMSToleranceFEB = ["1.2, 1.2, 1.2"] - - theBadPedestal.MsgLevelForDeviations=ERROR - theBadPedestal.CheckCompletness=False - theBadPedestal.ListOfDevFEBs="Bad_pedFebs.txt" - topSequence+=theBadPedestal - - if AutoCorr : - from LArCalibDataQuality.Thresholds import acThr, acThrFEB - from LArCalibDataQuality.LArCalibDataQualityConf import LArAutoCorrValidationAlg - theAutoCorrValidationAlg=LArAutoCorrValidationAlg("AutoCorrVal") - theAutoCorrValidationAlg.ValidationKey="LArAutoCorr" - theAutoCorrValidationAlg.ReferenceKey="LArAutoCorrRef" - theAutoCorrValidationAlg.AutoCorrTolerance=acThr - theAutoCorrValidationAlg.AutoCorrToleranceFEB=acThrFEB - theAutoCorrValidationAlg.MsgLevelForDeviations=WARNING - theAutoCorrValidationAlg.ListOfDevFEBs="ACFebs.txt" - theAutoCorrValidationAlg.CheckCompletness=True - theAutoCorrValidationAlg.PatchMissingFEBs=True - theAutoCorrValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels - topSequence+=theAutoCorrValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadAutoCorr=LArAutoCorrValidationAlg("AutoCorrFail") - theBadAutoCorr.ValidationKey="LArAutoCorr" - theBadAutoCorr.ReferenceKey="LArAutoCorrRef" - theBadAutoCorr.AutoCorrTolerance = ["0.15, 0.15, 0.15"] - theBadAutoCorr.AutoCorrToleranceFEB = ["0.15, 0.15, 0.15"] - theBadAutoCorr.MsgLevelForDeviations=ERROR - theBadAutoCorr.CheckFifthSample=True - theBadAutoCorr.ListOfDevFEBs="Bad_ACFebs.txt" - theBadAutoCorr.CheckCompletness=False - - topSequence+=theBadAutoCorr - - - -if ( doMonitoring ) : - - from AthenaMonitoring.DQMonFlags import DQMonFlags - DQMonFlags.enableLumiAccess.set_Value_and_Lock(False) - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - LArDigitKey = Gain_forCoherentNoise - - - if ( doLArCoherentNoise ) : - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - athenaCommonFlags.isOnline=online - from LArMonTools.LArMonFlags import LArMonFlags - ProblemsToMask=[ - "deadReadout","deadPhys","short","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise" - ] - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArPedestalFlat_ as LArPedestalCondAlg - svcMgr.IOVDbSvc.Folders.append("<db>COOLONL_LAR/CONDBR2</db>/LAR/ElecCalibFlat/Pedestal") - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - condSeq+=LArPedestalCondAlg(ReadKey="/LAR/ElecCalibFlat/Pedestal",WriteKey="LArPedestal") - condSeq.CondInputLoader.Load.add(("CondAttrListCollection","/LAR/ElecCalibFlat/Pedestal")) - - ## Coherent noise plots - include("LArMonTools/LArNoiseCorrelationMon_jobOptions.py") - for item in topSequence.LArMon.AthenaMonTools: - if item.getName()=='LArNoiseCorrelationMon': - item.LArPedestalKey="LArPedestal" - item.IsCalibrationRun=True - item.LArDigitContainerKey=Gain_forCoherentNoise - item.TriggerChain="" - item.TrigDecisionTool="" - item.FEBsToMonitor = coherentNoiseFEBS - item.PublishPartialSums = coherNoisePartSums - if 'EvtNo' in dir(): - theApp.EvtMax = EvtNo - pass - pass - - - if ( doLArFEBMon ) : - ## LArFEBMon - include("LArMonTools/LArFEBMon_jobOptions.py") - - if ( doLArOddCellMonTool ) : - ## LArOddCellMonTool - ReadCOOL = True ## Read pedestal from the DB - include("LArMonTools/LArOddCellsMonTool_jobOptions.py") - theLArOddCellsMonTool.LArPedestalKey = "PedestalRef" - - if ( doLArScaNoiseTool ) : - ## LArScaNoiseTool - include("LArRawConditions/LArIdMap_ATLAS_jobOptions.py") - include("LArMonTools/LArScaNoiseMonTool_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileNamePedAutoCorr+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputPedAutoCorrRootFileDir + "/" +RootHistOutputFileName): - os.remove(OutputPedAutoCorrRootFileDir + "/" +RootHistOutputFileName) - ServiceMgr += THistSvc() - ServiceMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputPedAutoCorrRootFileDir + "/" +RootHistOutputFileName+"' OPT='RECREATE'"] - - - -if ( WriteNtuple ) : - - if Pedestal : - from LArCalibTools.LArCalibToolsConf import LArPedestals2Ntuple - LArPedestals2Ntuple = LArPedestals2Ntuple("LArPedestals2Ntuple") - LArPedestals2Ntuple.RealGeometry = True - LArPedestals2Ntuple.OffId = True - LArPedestals2Ntuple.ContainerKey = KeyOutputPed - LArPedestals2Ntuple.AddFEBTempInfo = False - LArPedestals2Ntuple.isSC = SuperCells - if SuperCells: - LArPedestals2Ntuple.CablingKey = "LArOnOffIdMapSC" - LArPedestals2Ntuple.CalibMapKey = "LArCalibIdMapSC" - if realGeometry: - LArPedestals2Ntuple.RealGeometry = True - LArPedestals2Ntuple.OffId = True - - topSequence += LArPedestals2Ntuple - - if AutoCorr : - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" ) - LArAutoCorr2Ntuple.RealGeometry = True - LArAutoCorr2Ntuple.OffId = True - #LArAutoCorr2Ntuple.Nsamples = NSamples - LArAutoCorr2Ntuple.AddFEBTempInfo = False - LArAutoCorr2Ntuple.ContainerKey = KeyOutputAC - LArAutoCorr2Ntuple.isSC = SuperCells - if SuperCells: - LArAutoCorr2Ntuple.CablingKey = "LArOnOffIdMapSC" - LArAutoCorr2Ntuple.CalibMapKey = "LArCalibIdMapSC" - if realGeometry: - LArAutoCorr2Ntuple.RealGeometry = True - LArAutoCorr2Ntuple.OffId = True - - LArAutoCorr2Ntuple.ExtraInputs = {('CaloSuperCellDetDescrManager', 'ConditionStore+CaloSuperCellDetDescrManager')} - topSequence += LArAutoCorr2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName): - os.remove(OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName) - ServiceMgr += NTupleSvc() - ServiceMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if os.path.exists(OutputPedAutoCorrPoolFileDir + "/" + OutputPedAutoCorrPoolFileName): - os.remove(OutputPedAutoCorrPoolFileDir + "/" + OutputPedAutoCorrPoolFileName) - OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputPedAutoCorrPoolFileDir + "/" + OutputPedAutoCorrPoolFileName, - [OutputObjectSpecPed],[OutputTagSpecPed],WriteIOV) - OutputConditionsAlg.ObjectList += [OutputObjectSpecAutoCorr] - OutputConditionsAlg.IOVTagList += [OutputTagSpecAutoCorr] - - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2=IOVEnd - ServiceMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - ServiceMgr += IOVRegistrationSvc() - ServiceMgr.IOVRegistrationSvc.OutputLevel = WARNING - ServiceMgr.IOVRegistrationSvc.RecreateFolders = False - - - -########################################################################### - -ServiceMgr.EventSelector.SkipEvents = SkipEvents - -ServiceMgr.MessageSvc.OutputLevel = WARNING -ServiceMgr.MessageSvc.defaultLimit = 1000000000 -ServiceMgr.MessageSvc.infoLimit = 1000000000 -ServiceMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -ServiceMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theApp.AuditAlgorithms=True -theAuditorSvc += getConfigurable("ChronoAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("NameAuditor")(OutputLevel = WARNING) -ServiceMgr.ChronoStatSvc.OutputLevel = INFO - -########################################################################### -#printfunc (condSeq) diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_testing.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_testing.py deleted file mode 100644 index 1b3d8a97443db5c560f632492312b03e9c325c71..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_testing.py +++ /dev/null @@ -1,26 +0,0 @@ -## second instance of the validation tools to detect "bad" channels -theBadPedestal.OutputLevel = INFO -theBadPedestal.ListOfDevFEBs='BadPedestaldFebs.txt' -theBadPedestal.MsgLevelForDeviations=ERROR - -theBadAutoCorr.OutputLevel = INFO -theBadAutoCorr.ListOfDevFEBs='BadAutoCorrFebs.txt' -theBadAutoCorr.MsgLevelForDeviations=ERROR - -## first instance of the validation tools to detect "deviated" channels -thePedestalValidationAlg.OutputLevel = INFO -thePedestalValidationAlg.PatchMissingFEBs=True -thePedestalValidationAlg.UseCorrChannels=False -thePedestalValidationAlg.ListOfDevFEBs='PedestaldFebs.txt' -thePedestalValidationAlg.MsgLevelForDeviations=ERROR - -theAutoCorrValidationAlg.OutputLevel = INFO -theAutoCorrValidationAlg.PatchMissingFEBs=True -theAutoCorrValidationAlg.UseCorrChannels=False -theAutoCorrValidationAlg.ListOfDevFEBs='AutoCorrFebs.txt' -theAutoCorrValidationAlg.MsgLevelForDeviations=ERROR - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 9999999 # all messages - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py deleted file mode 100644 index 9043db2b7bec14436ea93f1a78f950bdce9f8200..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py +++ /dev/null @@ -1,795 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to compute PhysWavePredicted and Shifted -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -if not "SuperCells" in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -########################################################################### -# Input selection (CaliWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'isHEC' in dir(): - isHEC= False - -## HEC PhysWave -if not 'ReadHECPhysWaveFromCOOL' in dir(): - ReadHECPhysWaveFromCOOL = True - -if not 'InputHECPhysWavePoolFileDir' in dir(): - InputHECMapPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputHECPhysWavePoolFileName' in dir(): - InputHECPhysWavePoolFileName = "LArHECPhysWave.pool.root" - -## CaliWave -if not 'ReadCaliWaveFromCOOL' in dir(): - ReadCaliWaveFromCOOL = True - -if not 'InputCaliWavePoolFileDir' in dir(): - InputCaliWavePoolFileDir = subprocess.getoutput("pwd") - -if not 'InputCaliWavePoolFileName' in dir(): - InputCaliWavePoolFileName = "LArCaliWave.pool.root" - -## CaliPulseParams -if not 'ReadCaliPulseParamsFromCOOL' in dir(): - ReadCaliPulseParamsFromCOOL = True - -if not 'InputCaliPulseParamsPoolFileDir' in dir(): - InputCaliPulseParamsPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputCaliPulseParamsPoolFileName' in dir(): - InputCaliPulseParamsPoolFileName = "LArCaliPulseParamsVsCalib_AllBoards.pool.root" - -## DetCellParams -if not 'ReadDetCellParamsFromCOOL' in dir(): - ReadDetCellParamsFromCOOL = True - -if not 'InputDetCellParamsPoolFileDir' in dir(): - InputDetCellParamsPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputDetCellParamsPoolFileName' in dir(): - InputDetCellParamsPoolFileName = "detector_EMECA_C_v1.pool.root" - -## DTime -if not 'ReadDTimeFromCOOL' in dir(): - ReadDTimeFromCOOL = True - -if not 'InputDTimePoolFileDir' in dir(): - InputDTimePoolFileDir = subprocess.getoutput("pwd") - -if not 'InputDTimePoolFileName' in dir(): - InputDTimePoolFileName = "tdrift_EMECA_C_v1.pool.root" - -## Options - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True - -if (isHEC) : - StripsXtalkCorr=False - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if not 'InputCaliPulseParamsFolder' in dir(): - if not SuperCells: InputCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" - if SuperCells: InputCaliPulseParamsFolder = "/LAR/ElecCalibOflSC/CaliPulseParams/RTM" - -if not 'InputDetCellParamsFolder' in dir(): - if not SuperCells: InputDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - if SuperCells: InputDetCellParamsFolder = "/LAR/ElecCalibOflSC/DetCellParams/RTM" - -## If needed, reads the LArCalibPulseParams from COOL (Oracle/SQLite) - -if ( ReadCaliPulseParamsFromCOOL ): - if 'InputCaliPulseParamsSQLiteFile' in dir(): - InputDBConnectionCaliPulseParams = DBConnectionFile(InputCaliPulseParamsSQLiteFile) - else: - InputDBConnectionCaliPulseParams = DBConnectionCOOL - -## HEC PhysWave -if ( ReadHECPhysWaveFromCOOL ): - if 'InputHECPhysWaveSQLiteFile' in dir(): - InputDBConnectionHECPhysWave = DBConnectionFile(InputHECPhysWaveSQLiteFile) - else: - InputDBConnectionHECPhysWave = DBConnectionCOOL - -## CaliWave -if ( ReadCaliWaveFromCOOL ): - if 'InputCaliWaveSQLiteFile' in dir(): - InputDBConnectionCaliWave = DBConnectionFile(InputCaliWaveSQLiteFile) - else: - InputDBConnectionCaliWave = DBConnectionCOOL - - -## DetCellParams -if ( ReadDetCellParamsFromCOOL ): - if 'InputDetCellParamsSQLiteFile' in dir(): - InputDBConnectionDetCellParams= DBConnectionFile(InputDetCellParamsSQLiteFile) - else: - InputDBConnectionDetCellParams= DBConnectionCOOL - -## DTime -if ( ReadDTimeFromCOOL ): - if 'InputDTimeSQLiteFile' in dir(): - InputDBConnectionDTime = DBConnectionFile(InputDTimeSQLiteFile) - else: - InputDBConnectionDTime = DBConnectionCOOL - -########################################################################### -# PhysWavePredictor properties -########################################################################### - -if not 'HECPhysWaveKey' in dir(): - HECPhysWaveKey="LArPhysWaveHECIdeal" - -if not 'KeyCaliList' in dir(): - KeyCaliList = [ "LArCaliWave" ] - -if not 'LArMphysMcaliKey' in dir (): - LArMphysMcaliKey = "LArMphysOverMcal" - -if not 'doTest' in dir(): - doTest = False - - -############################################## - -# Tcali, Fstep -if not 'UseCaliPulseParamsFromJO' in dir(): - UseCaliPulseParamsFromJO = False # pb to read the poolfile - -# Omega0, Taur -if not 'UseDetCellParamsFromJO' in dir(): - UseDetCellParamsFromJO = False - -# Tdrift -if not 'UseTdriftFromJO' in dir(): - UseTdriftFromJO = False - -# Tdiff -if not 'UseTimeShiftFromJO' in dir(): - UseTimeShiftFromJO = True - -############################################### -# part of software + DB missing so use -if not 'UseDoubleTriangle' in dir(): - if (isHEC) : - UseDoubleTriangle = False - else : - UseDoubleTriangle = False ##normally True but software not ready - -if not 'HV' in dir(): - HV = 2000 - -if ( HV == 2000 ): - TdriftVector = [ 420 , 469 , 469 , 469 ] - TdriftVector2 = [ 420 , 921 , 921 , 921 ] - TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ] -elif ( HV == 1600 ): - TdriftVector = [ 451.92 , 504.644 , 504.644 , 504.644 ] - TdriftVector2 = [ 451.92 , 990.996 , 990.996 , 990.996 ] - TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ] - -if not 'InjPointCorrLayer' in dir(): - InjPointCorrLayer = [ 1, 1, 1, 1 ] - -if not 'InjPointUseTauR' in dir(): - InjPointUseTauR = [ 1, 1, 1, 1 ] - -if not 'WritePhysWave2NTuple' in dir(): - WritePhysWave2NTuple = True # write predicted LArPhysWave to ntuple - -if not 'WriteCaliWave2NTuple' in dir(): - WriteCaliWave2NTuple = False # add LArCaliWave to predicted LArPhysWave ntuple - -if not 'WriteMphyMcal2NTuple' in dir(): - WriteMphyMcal2NTuple = True # add LArMphysOverMcalComplete to predicted LArPhysWave ntuple - - -########################################################################### -# PhysWaveShifter properties # -########################################################################### - -if not 'doPhysWaveShifter' in dir(): - doPhysWaveShifter = False - -if not 'ShiftMode' in dir(): - ShiftMode = 2 # 1 = minimum Tstart from helper in FEB # 2 = minumum Tpeak-NindexFromPeak in FEB - -if not 'InputKey' in dir(): - if (doPhysWaveShifter) : - InputKey = "LArPhysWaveUnShifted" - else : - InputKey = "LArPhysWave" # no shift applied to the PhysWave - -if not 'OutputKey' in dir(): - OutputKey = "LArPhysWave" - -if not 'Nsamplings' in dir(): - Nsamplings = 2 - -if not 'TimeShiftGuardRegion' in dir(): - TimeShiftGuardRegion = 5 - -####################################################### -# PhysWavePredicted output -########################################################################### - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputPhysWaveRootFileDir' in dir(): - OutputPhysWaveRootFileDir= subprocess.getoutput("pwd") - -if not 'OutputPhysWavePoolFileDir' in dir(): - OutputPhysWavePoolFileDir= subprocess.getoutput("pwd") - -if not 'OutputMphysOverMcalPoolFileDir' in dir(): - OutputMphysOverMcalPoolFileDir= subprocess.getoutput("pwd") - -PhysWaveFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputPhysWaveRootFileName' in dir(): - OutputPhysWaveRootFileName = "LArPhysWave_RTM_"+PhysWaveFileTag + ".root" - -if not 'OutputPhysWavePoolFileName' in dir(): - OutputPhysWavePoolFileName = "LArPhysWave_RTM_"+PhysWaveFileTag + ".pool.root" - -if not 'OutputMphysOverMcalPoolFileName' in dir(): - OutputMphysOverMcalPoolFileName = "LArMphysOverMcal_RTM_"+ PhysWaveFileTag+ ".pool.root" - - -if not StripsXtalkCorr: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolder -else: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolderXtlk - - -HECPhysWaveFolder = "/LAR/ElecCalibOfl/PhysWaves/HECIdeal" - - -rs=FolderTagResover() -if not "LArDetCellParamsTag" in dir(): - LArDetCellParamsTag=rs.getFolderTagSuffix(InputDetCellParamsFolder) - -if not "LArCaliPulseParamsTag" in dir(): - LArCaliPulseParamsTag=rs.getFolderTagSuffix(InputCaliPulseParamsFolder) - -if not "CaliWaveLArCalibFolderTag" in dir (): - CaliWaveLArCalibFolderTag=rs.getFolderTagSuffix(CaliWaveFolder) - -if not 'LArPhysFolderOutputTag' in dir(): - LArPhysFolderOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArPhysWaveFolder) - -if not 'LArPhysFolderOutputTag' in dir(): - LArPhysFolderOutputTag=rs.getFolderTagSuffix(LArCalib_Flags.LArMphysOverMcalFolder) - -if not 'DTimeLArCalibFolderTag' in dir(): - DTimeLArCalibFolderTag=rs.getFolderTagSuffix(LArCalib_Flags.LArDTimeFolder) - -if not 'HECPhysWaveTagSpec' in dir(): - HECPhysWaveTagSpec=rs.getFolderTagSuffix(HECPhysWaveFolder) -del rs #Close database - - - - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecPhysWave' in dir(): - OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+"LArPhysWave"+"#"+ LArCalib_Flags.LArPhysWaveFolder - OutputObjectSpecTagPhysWave = LArCalibFolderTag(LArCalib_Flags.LArPhysWaveFolder,LArPhysFolderOutputTag) - -if not 'OutputObjectSpecMphysOverMcal' in dir(): - OutputObjectSpecMphysOverMcal = "LArMphysOverMcalComplete#"+"LArMphysOverMcal"+"#"+ LArCalib_Flags.LArMphysOverMcalFolder - OutputObjectSpecTagMphysOverMcal = LArCalibFolderTag(LArCalib_Flags.LArMphysOverMcalFolder,LArPhysFolderOutputTag) - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -PhysWaveLog = logging.getLogger( "PhysWaveLog" ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " *** LAr PredPhysWave summary *** " ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " RunNumber = "+str(RunNumber) ) - -if ( ReadCaliPulseParamsFromCOOL ): - PhysWaveLog.info( " InputDBConnectionCaliPulseParams = "+InputDBConnectionCaliPulseParams ) - PhysWaveLog.info( " InputCaliPulseParamsFolder = "+InputCaliPulseParamsFolder ) - if "CaliPulseParamsLArCalibFolderTag" in dir() : - PhysWaveLog.info( " CaliPulseParamsLArCalibFolderTag = "+CaliPulseParamsLArCalibFolderTag ) - - -if ( ReadCaliWaveFromCOOL ): - PhysWaveLog.info( " InputDBConnectionCaliWave = "+InputDBConnectionCaliWave ) -else : - PhysWaveLog.info( " InputCaliWavePoolFileName = "+InputCaliWavePoolFileName ) -if ( (ReadCaliWaveFromCOOL) and ChannelSelection != " " ): - PhysWaveLog.info( " ChannelSelection = "+ChannelSelection ) - -PhysWaveLog.info( " CaliWaveLArCalibFolderTag = "+CaliWaveLArCalibFolderTag ) -PhysWaveLog.info( " OutputPhysWaveRootFullFileName = "+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName ) -PhysWaveLog.info( " OutputPhysWavePoolFullFileName = "+OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName ) -PhysWaveLog.info( " OutputMphysOverMcalPoolFullFileName = "+OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName ) -PhysWaveLog.info( " OutputObjectSpecPhysWave = "+str(OutputObjectSpecPhysWave) ) -PhysWaveLog.info( " OutputObjectSpecTagPhysWave = "+str(OutputObjectSpecTagPhysWave) ) -PhysWaveLog.info( " OutputObjectSpecMphusOverMcal = "+str(OutputObjectSpecMphysOverMcal) ) -PhysWaveLog.info( " OutputObjectSpecTagMphysOverMcal = "+str(OutputObjectSpecTagMphysOverMcal) ) -PhysWaveLog.info( " IOVBegin = "+str(IOVBegin) ) -PhysWaveLog.info( " IOVEnd = "+str(IOVEnd) ) -PhysWaveLog.info( " LArCalibOutputDB = "+OutputDB ) -PhysWaveLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### -include ("LArConditionsCommon/LArMinimalSetup.py") -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArCalibIdMappingSC,LArOnOffIdMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - - -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - - -if not 'InputBadChannelSQLiteFile' in dir(): - PhysWaveLog.info( "Read Bad Channels from Oracle DB") -else : - PhysWaveLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - - - - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - - -if ( ReadCaliWaveFromCOOL ) : - if not 'InputCaliWaveSQLiteFile' in dir(): - PhysWaveLog.info( "Read CaliWave from Oracle DB" ) - else : - PhysWaveLog.info( "Read CaliWave from SQLite file" ) - -if ( ReadCaliPulseParamsFromCOOL ) : - if not 'InputCaliPulseParamsSQLiteFile' in dir(): - PhysWaveLog.info( "Read PulseParams from Oracle DB" ) - else : - PhysWaveLog.info( "Read PulseParams from SQLite file" ) - -if ( ReadDetCellParamsFromCOOL ) : - if not 'InputDetCellParamsSQLiteFile' in dir(): - PhysWaveLog.info( "Read DetCellParams from Oracle DB" ) - else : - PhysWaveLog.info( "Read DetCellParams from SQLite file" ) - -if ( ReadDTimeFromCOOL ) : - if not 'InputDTimeSQLiteFile' in dir(): - PhysWaveLog.info( "Read DTime from Oracle DB" ) - else : - PhysWaveLog.info( "Read DTime from SQLite file" ) - -if (isHEC): - if (ReadHECPhysWaveFromCOOL ): - if not 'InputHECPhysWaveSQLiteFile' in dir(): - PhysWaveLog.info( "Read HEC PhysWave from Oracle DB" ) - else : - PhysWaveLog.info( "Read HEC PhysWave form SQLite file" ) - - - if ( ReadHECPhysWaveFromCOOL ): - conddb.addFolder("",HECPhysWaveFolder+"<tag>"+HECPhysWaveTagSpec+"</tag>"+"<dbConnection>COOLOFL_LAR/COMP200</dbConnection>" + ChannelSelection) - - else: - if 'InputHECPhysWavePoolFileName' in dir(): - PhysWaveLog.info( "Read HECPhysWave form POOL file" ) - PoolFileList += [ InputHECPhysWavePoolFileDir +"/"+ InputHECPhysWavePoolFileName ] - else: - PhysWaveLog.info( "No PoolFileList found! Please list the POOL files containing HECPhysWave or read from COOL." ) - theApp.exit(-1) - -## CaliWave -if ( ReadCaliWaveFromCOOL ): - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder,CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) -else: - if 'InputCaliWavePoolFileName' in dir(): - PhysWaveLog.info( "Read CaliWave from POOL file" ) - PoolFileList += [ InputCaliWavePoolFileDir+"/"+InputCaliWavePoolFileName ] - else: - PhysWaveLog.info( "No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL." ) - theApp.exit(-1) - - -## PulseParams -if ( ReadCaliPulseParamsFromCOOL ): - PulseParamsFolder = InputCaliPulseParamsFolder - PulseParamsTagSpec = LArCalibFolderTag(PulseParamsFolder,LArCaliPulseParamsTag) - conddb.addFolder("",PulseParamsFolder+"<tag>"+PulseParamsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliPulseParams+"</dbConnection>" + ChannelSelection) - -else: - if 'InputCaliPulseParamsPoolFileName' in dir(): - PhysWaveLog.info( "Read PulseParams from POOL file" ) - PoolFileList += [ InputCaliPulseParamsPoolFileDir+"/"+InputCaliPulseParamsPoolFileName ] - else: - PhysWaveLog.info( "No PoolFileList found! Please list the POOL files containing PulseParams or read from COOL." ) - theApp.exit(-1) - -if not (isHEC) : - ## DetCellParams - if ( ReadDetCellParamsFromCOOL ): - DetCellParamsFolder = InputDetCellParamsFolder - DetCellParamsTagSpec = LArCalibFolderTag(DetCellParamsFolder,LArCaliPulseParamsTag) - conddb.addFolder("",DetCellParamsFolder+"<tag>"+DetCellParamsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionDetCellParams+"</dbConnection>" + ChannelSelection) - else: - if 'InputDetCellParamsPoolFileName' in dir(): - PhysWaveLog.info( "Read DetCellParams from POOL file" ) - PoolFileList += [ InputDetCellParamsPoolFileDir+"/"+InputDetCellParamsPoolFileName ] - else: - PhysWaveLog.info( "No PoolFileList found! Please list the POOL files containing DetCellParams or read from COOL." ) - theApp.exit(-1) - -## DTime -if ( ReadDTimeFromCOOL ): - DTimeTagSpec = LArCalibFolderTag(LArCalib_Flags.LArDTimeFolder,DTimeLArCalibFolderTag) - DTimeTagSpec = "LARElecCalibOflSCTdriftComputed-000" - # here TODO - replace this again later - conddb.addFolder("",LArCalib_Flags.LArDTimeFolder+"<tag>"+DTimeTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionDTime+"</dbConnection>")#,className='LArTdriftComplete') -else: - if 'InputDTimePoolFileName' in dir(): - PhysWaveLog.info( "Read DTime from POOL file" ) - PoolFileList += [ InputDTimePoolFileDir+"/"+InputDTimePoolFileName ] - else: - PhysWaveLog.info( "No PoolFileList found! Please list the POOL files containing DTrif or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - - -########################################################################### -# -# Predict physics waveforms from Cali/Master waveforms -# -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArPhysWavePredictor - -LArPhysWavePredictor = LArPhysWavePredictor( "LArPhysWavePredictor" ) -LArPhysWavePredictor.ProblemsToMask = ["deadCalib","deadReadout","deadPhys","almostDead","short"] -LArPhysWavePredictor.TestMode = doTest -LArPhysWavePredictor.isSC = SuperCells -LArPhysWavePredictor.KeyCaliList = KeyCaliList -LArPhysWavePredictor.UseCaliPulseParamsFromJO = UseCaliPulseParamsFromJO -LArPhysWavePredictor.UseDetCellParamsFromJO = UseDetCellParamsFromJO -LArPhysWavePredictor.UseTdriftFromJO = UseTdriftFromJO -LArPhysWavePredictor.Tdrift = TdriftVector -LArPhysWavePredictor.UseDoubleTriangle = UseDoubleTriangle -LArPhysWavePredictor.Tdrift2 = TdriftVector2 -LArPhysWavePredictor.WeightTriangle2 = TdriftWeight2 -LArPhysWavePredictor.UseTimeShiftFromJO = UseTimeShiftFromJO -LArPhysWavePredictor.GroupingType = GroupingType -LArPhysWavePredictor.NormalizeCali = True -if (isHEC) : - LArPhysWavePredictor.NormalizeCali = False -LArPhysWavePredictor.KeyMphysMcali = LArMphysMcaliKey -LArPhysWavePredictor.DumpMphysMcali = True # False # set to True to dump on a ASCII file -LArPhysWavePredictor.KeyPhys = InputKey -LArPhysWavePredictor.isHEC = isHEC -# -# Avoid using these settings, use LArPhysWaveShifter in a separate job -# -LArPhysWavePredictor.TimeShiftByHelper = False -LArPhysWavePredictor.TimeShiftByIndex = 0 -LArPhysWavePredictor.TimeShiftByLayer = False -LArPhysWavePredictor.Tshift = [ 0 , 0 , 0 , 0 ] -LArPhysWavePredictor.TimeShiftByFEB = False -LArPhysWavePredictor.TimeShiftGuardRegion = 0 - -#################### PHYSWAVE Prediction FOR EM #################### -if not (isHEC) : - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveTool - LArPhysWaveTool=LArPhysWaveTool() - LArPhysWaveTool.NormalizeCali = False # this is taken care by LArPhysWavePredictor - LArPhysWaveTool.TimeOriginShift = False - LArPhysWaveTool.SubtractBaseline = False - LArPhysWaveTool.InjPointCorrLayer = InjPointCorrLayer - LArPhysWaveTool.InjPointUseTauR = InjPointUseTauR - svcMgr.ToolSvc +=LArPhysWaveTool - -#################### PHYSWAVE Prediction FOR HEC #################### -else : - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveHECTool - LArPhysWaveHECTool=LArPhysWaveHECTool() - LArPhysWaveHECTool.NormalizeCali = False # this is taken care by LArPhysWavePredictor changed by FT to True was False - LArPhysWaveHECTool.TimeOriginShift = False - LArPhysWaveHECTool.SubtractBaseline = False - svcMgr.ToolSvc +=LArPhysWaveHECTool - -topSequence += LArPhysWavePredictor - -########################################################################### -# -# Shift physics waveforms will be done before OFC computation -# -########################################################################### -if (doPhysWaveShifter) : - - from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveShifter - LArPhysWaveShifter = LArPhysWaveShifter("LArPhysWaveShifter") - - LArPhysWaveShifter.KeyList = [ InputKey ] - LArPhysWaveShifter.KeyOutput = OutputKey - LArPhysWaveShifter.GroupingType = GroupingType - - # - # Minimum Tstart per FEB computation - # - LArPhysWaveShifter.ComputeTimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftByFEBMode = ShiftMode - LArPhysWaveShifter.TimeShiftByFEBDump = True - LArPhysWaveShifter.TimeShiftByFEBDumpFile = "TimeShiftFEB.py" - - # - # Possible time shifts - # - LArPhysWaveShifter.TimeShiftByHelper = False - LArPhysWaveShifter.TimeShiftByIndex = 0 - LArPhysWaveShifter.TimeShiftByLayer = False - LArPhysWaveShifter.TshiftLayer = [ 0 , 0 , 0 , 0 ] - LArPhysWaveShifter.TimeShiftFromPeak = False - LArPhysWaveShifter.NindexFromPeak = 0 # if 0 will use Ndelays*Nsampling - LArPhysWaveShifter.Ndelays = 24 - LArPhysWaveShifter.Nsamplings = Nsamplings - LArPhysWaveShifter.TimeShiftByFEB = True - LArPhysWaveShifter.TimeShiftGuardRegion = TimeShiftGuardRegion - - topSequence += LArPhysWaveShifter - -########################################################################## - -if ( WriteNtuple ) : - - if ( WritePhysWave2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple("LArPhysWaves2Ntuple") - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - LArPhysWaves2Ntuple.AddFEBTempInfo = False - LArPhysWaves2Ntuple.KeyList = [ OutputKey ] - LArPhysWaves2Ntuple.isSC = SuperCells - LArPhysWaves2Ntuple.OutputLevel = DEBUG # here here added this - topSequence += LArPhysWaves2Ntuple - - if ( WriteCaliWave2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.AddFEBTempInfo = False - LArCaliWaves2Ntuple.KeyList = KeyCaliList - LArCaliWaves2Ntuple.isSC = SuperCells - - topSequence += LArCaliWaves2Ntuple - - if ( WriteMphyMcal2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArMphysOverMcal2Ntuple - LArMphysOverMcal2Ntuple = LArMphysOverMcal2Ntuple( "LArMphysOverMcal2Ntuple" ) - LArMphysOverMcal2Ntuple.ContainerKey = "LArMphysOverMcal" - LArMphysOverMcal2Ntuple.AddFEBTempInfo = False - LArMphysOverMcal2Ntuple.isSC = SuperCells - - topSequence += LArMphysOverMcal2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName): - os.remove(OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - # writre PredPhysWave - if os.path.exists(OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName): - os.remove(OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName) - OutputConditionsAlgPhysWave = OutputConditionsAlg("OutputConditionsAlgPhysWave",OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName, - [OutputObjectSpecPhysWave],[OutputObjectSpecTagPhysWave],WriteIOV) - OutputConditionsAlgPhysWave.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgPhysWave.Run2 = IOVEnd - - # writre MphysOverMcal - if os.path.exists(OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName): - os.remove(OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName) - OutputConditionsAlgMphysOverMcal = OutputConditionsAlg("OutputConditionsAlgMphysOverMcal",OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName, - [OutputObjectSpecMphysOverMcal],[OutputObjectSpecTagMphysOverMcal],WriteIOV) - OutputConditionsAlgMphysOverMcal.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgMphysOverMcal.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = VERBOSE - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = VERBOSE # WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictor_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictor_jobOptions.py deleted file mode 100644 index 2e6b86dcf2a954c3c95c85a92faf8ba24199e58d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictor_jobOptions.py +++ /dev/null @@ -1,414 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to compute PredictedPhysWave -# -# Last update: 25/01/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# Input selection (CaliWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = 0 - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'ReadCaliWaveFromCOOL' in dir(): - ReadCaliWaveFromCOOL = True - -if not 'CaliWaveLArCalibFolderTag' in dir(): - CaliWaveLArCalibFolderTag = LArCalib_Flags.tagSuffix - -if not 'InputCaliWavePoolDir' in dir(): - InputCaliWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputCaliWavePoolFileName' in dir(): - InputCaliWavePoolFileName = "LArCaliWave.pool.root" - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# PhysWavePredictor properties -########################################################################### - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'KeyCaliList' in dir(): - KeyCaliList = [ "LArCaliWave" ] - -if not 'LArMphysMcaliKey' in dir (): - LArMphysMcaliKey = "LArMphysOverMcal" - -if not 'doTest' in dir(): - doTest = False - -# Tcali, Fstep -if not 'UseCaliPulseParamsFromJO' in dir(): - UseCaliPulseParamsFromJO = False - -# Omega0, Taur -if not 'UseDetCellParamsFromJO' in dir(): - UseDetCellParamsFromJO = False - -# Tdrift -if not 'UseTdriftFromJO' in dir(): - UseTdriftFromJO = True - -if not 'UseDoubleTriangle' in dir(): - UseDoubleTriangle = True - -if not 'HV' in dir(): - HV = 2000 - -if ( HV == 2000 ): - TdriftVector = [ 420 , 469 , 469 , 469 ] - TdriftVector2 = [ 420 , 921 , 921 , 921 ] - TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ] -elif ( HV == 1600 ): - TdriftVector = [ 451.92 , 504.644 , 504.644 , 504.644 ] - TdriftVector2 = [ 451.92 , 990.996 , 990.996 , 990.996 ] - TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ] - -# Tdiff -if not 'UseTimeShiftFromJO' in dir(): - UseTimeShiftFromJO = True - -if not 'InjPointCorrLayer' in dir(): - InjPointCorrLayer = [ 0, 0, 1, 0 ] - -if not 'InjPointUseTauR' in dir(): - InjPointUseTauR = [ 0, 0, 1, 0 ] - -if not 'WritePhysWave2NTuple' in dir(): - WritePhysWave2NTuple = True # write predicted LArPhysWave to ntuple - -if not 'WriteCaliWave2NTuple' in dir(): - WriteCaliWave2NTuple = False # add LArCaliWave to predicted LArPhysWave ntuple - -if not 'WriteMphyMcal2NTuple' in dir(): - WriteMphyMcal2NTuple = True # add LArMphysOverMcalComplete to predicted LArPhysWave ntuple - -########################################################################### -# PhysWavePredicted output -########################################################################### - -if not 'GroupingType' in dir(): - if SuperCells: - GroupingType = "SuperCells" - else: - GroupingType = "ExtendedSubDetector" -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = RunNumber - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputPhysWaveRootFileDir' in dir(): - OutputPhysWaveRootFileDir= subprocess.getoutput("pwd") - -if not 'OutputPhysWavePoolFileDir' in dir(): - OutputPhysWavePoolFileDir= subprocess.getoutput("pwd") - -if not 'OutputMphysOverMcalPoolFileDir' in dir(): - OutputMphysOverMcalPoolFileDir= subprocess.getoutput("pwd") - -PhysWaveFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputPhysWaveRootFileName' in dir(): - OutputPhysWaveRootFileName = "LArPhysWave_RTM_"+PhysWaveFileTag + ".root" - -if not 'OutputPhysWavePoolFileName' in dir(): - OutputPhysWavePoolFileName = "LArPhysWave_RTM_"+PhysWaveFileTag + ".pool.root" - -if not 'OutputMphysOverMcalPoolFileName' in dir(): - OutputMphysOverMcalPoolFileName = "LArMphysOverMcal_RTM_"+ PhysWaveFileTag+ ".pool.root" - -if not 'LArPhysFolderOutputTag' in dir(): - LArPhysFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecPhysWave' in dir(): - OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+"LArPhysWave"+"#"+ "/LAR/ElecCalibOfl/PhysWaves/TempWillExistOnlyInTheSQLiteFile" - OutputObjectSpecTagPhysWave = LArCalibFolderTag("/LAR/ElecCalibOfl/PhysWaves/TempWillExistOnlyInTheSQLiteFile",LArPhysFolderOutputTag) - -if not 'OutputObjectSpecMphysOverMcal' in dir(): - OutputObjectSpecMphysOverMcal = "LArMphysOverMcalComplete#"+"LArMphysOverMcal"+"#"+ LArCalib_Flags.LArMphysOverMcalFolder - OutputObjectSpecTagMphysOverMcal = LArCalibFolderTag(LArCalib_Flags.LArMphysOverMcalFolder,LArPhysFolderOutputTag) - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "impl=cool;techno=oracle;schema=ATLAS_COOLOFL_LAR;ATLAS_COOLPROD:CONDBR2:ATLAS_COOL_READER:" - -if ( ReadCaliWaveFromCOOL ): - if 'InputCaliWaveSQLiteFile' in dir(): - InputDBConnectionCaliWave = DBConnectionFile(InputCaliWaveSQLiteFile) - else: - InputDBConnectionCaliWave = DBConnectionCOOL - -########################################################################### -# Print summary -########################################################################### - -PhysWaveLog = logging.getLogger( "PhysWaveLog" ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " *** LAr PredPhysWave summary *** " ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadCaliWaveFromCOOL ): - PhysWaveLog.info( " InputDBConnectionCaliWave = "+InputDBConnectionCaliWave ) -else : - PhysWaveLog.info( " InputCaliWavePoolFileName = "+InputCaliWavePoolFileName ) -if ( (ReadCaliWaveFromCOOL) and ChannelSelection != " " ): - PhysWaveLog.info( " ChannelSelection = "+ChannelSelection ) -PhysWaveLog.info( " CaliWaveLArCalibFolderTag = "+CaliWaveLArCalibFolderTag ) -PhysWaveLog.info( " OutputPhysWaveRootFullFileName = "+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName ) -PhysWaveLog.info( " OutputPhysWavePoolFullFileName = "+OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName ) -PhysWaveLog.info( " OutputMphysOverMcalPoolFullFileName = "+OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName ) -PhysWaveLog.info( " OutputObjectSpecPhysWave = "+str(OutputObjectSpecPhysWave) ) -PhysWaveLog.info( " OutputObjectSpecTagPhysWave = "+str(OutputObjectSpecTagPhysWave) ) -PhysWaveLog.info( " OutputObjectSpecMphysOverMcal = "+str(OutputObjectSpecMphysOverMcal) ) -PhysWaveLog.info( " OutputObjectSpecTagMphysOverMcal = "+str(OutputObjectSpecTagMphysOverMcal) ) -PhysWaveLog.info( " IOVBegin = "+str(IOVBegin) ) -PhysWaveLog.info( " IOVEnd = "+str(IOVEnd) ) -PhysWaveLog.info( " LArCalibOutputDB = "+OutputDB ) -PhysWaveLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadCaliWaveFromCOOL ): - if ( not StripsXtalkCorr ): - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolder - else: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolderXtlk - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder,CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) -else: - if 'InputCaliWavePoolFileName' in dir(): - PoolFileList += [ InputCaliWavePoolDir+"/"+InputCaliWavePoolFileName ] - else: - printfunc ("No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL.") - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - - -########################################################################### -# -# Predict physics waveforms from Cali/Master waveforms -# -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArPhysWavePredictor - -LArPhysWavePredictor = LArPhysWavePredictor( "LArPhysWavePredictor" ) - -LArPhysWavePredictor.TestMode = doTest -LArPhysWavePredictor.KeyCaliList = KeyCaliList -LArPhysWavePredictor.UseCaliPulseParamsFromJO = UseCaliPulseParamsFromJO -LArPhysWavePredictor.UseDetCellParamsFromJO = UseDetCellParamsFromJO -LArPhysWavePredictor.UseTdriftFromJO = UseTdriftFromJO -LArPhysWavePredictor.Tdrift = TdriftVector -LArPhysWavePredictor.UseDoubleTriangle = UseDoubleTriangle -LArPhysWavePredictor.Tdrift2 = TdriftVector2 -LArPhysWavePredictor.WeightTriangle2 = TdriftWeight2 -LArPhysWavePredictor.UseTimeShiftFromJO = UseTimeShiftFromJO -LArPhysWavePredictor.GroupingType = GroupingType -LArPhysWavePredictor.NormalizeCali = True -LArPhysWavePredictor.KeyMphysMcali = LArMphysMcaliKey -LArPhysWavePredictor.DumpMphysMcali = False # set to True to dump on a ASCII file - -# -# Avoid using these settings, use LArPhysWaveShifter in a separate job -# - -LArPhysWavePredictor.TimeShiftByHelper = False -LArPhysWavePredictor.TimeShiftByIndex = 0 -LArPhysWavePredictor.TimeShiftByLayer = False -LArPhysWavePredictor.Tshift = [ 0 , 0 , 0 , 0 ] -LArPhysWavePredictor.TimeShiftByFEB = False -LArPhysWavePredictor.TimeShiftGuardRegion = 0 - -from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveTool -LArPhysWaveTool.NormalizeCali = False # this is taken care by LArPhysWavePredictor -LArPhysWaveTool.TimeOriginShift = False -LArPhysWaveTool.SubtractBaseline = False -LArPhysWaveTool.InjPointCorrLayer = InjPointCorrLayer -LArPhysWaveTool.InjPointUseTauR = InjPointUseTauR - -topSequence += LArPhysWavePredictor -########################################################################### - -if ( WriteNtuple ) : - - if ( WritePhysWave2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArWaves2Ntuple - LArPhysWaves2Ntuple = LArWaves2Ntuple("LArPhysWaves2Ntuple") - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - LArPhysWaves2Ntuple.KeyList = [ "LArPhysWave" ] - LArPhysWaves2Ntuple.ReadCaliWave = False - - topSequence += LArPhysWaves2Ntuple - - if ( WriteCaliWave2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArWaves2Ntuple - LArCaliWaves2Ntuple = LArWaves2Ntuple("LArCaliWaves2Ntuple") - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = KeyCaliList - - topSequence += LArCaliWaves2Ntuple - - if ( WriteMphyMcal2NTuple ) : - from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple - LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" ) - LArParams2Ntuple.KeyList += [ "LArMphysOverMcalComplete" ] - LArParams2Ntuple.DetStoreSuffix = "" - - topSequence += LArParams2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - # writre PredPhysWave - OutputConditionsAlgPhysWave = OutputConditionsAlg("OutputConditionsAlgPhysWave",OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName, - [OutputObjectSpecPhysWave],[OutputObjectSpecTagPhysWave],WriteIOV) - #OutputConditionsAlgPhysWave.WriteIOV = WriteIOV - OutputConditionsAlgPhysWave.Run1 = IOVBegin - - if IOVEnd>0: - OutputConditionsAlgPhysWave.Run2 = IOVEnd - - # writre MphysOverMcal - OutputConditionsAlgMphysOverMcal = OutputConditionsAlg("OutputConditionsAlgMphysOverMcal",OutputMphysOverMcalPoolFileDir+"/"+OutputMphysOverMcalPoolFileName, - [OutputObjectSpecMphysOverMcal],[OutputObjectSpecTagMphysOverMcal],WriteIOV) - #OutputConditionsAlgMphysOverMcal.WriteIOV = WriteIOV - OutputConditionsAlgMphysOverMcal.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.MphysOverMcal.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from AthenaCommon.AppMgr import ServiceMgr - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = VERBOSE - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWaveShifter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWaveShifter_jobOptions.py deleted file mode 100644 index b0218e2a7c8accf8cb0fda0b37f04a2dad81865d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWaveShifter_jobOptions.py +++ /dev/null @@ -1,316 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# LArCalib_PhysWaveShifter_jobOptions.py -# -# Example jobOption to shift LArPhysWave in time before OFC computation -# -# Last update: 25/09/2008 <Caroline.Collard@cern.ch> -# -########################################################################### - -include ("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# Input selection (PhysWave) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = 0 - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'ReadPhysWaveFromCOOL' in dir(): - ReadPhysWaveFromCOOL = True - -if not 'PhysWaveLArCalibFolderTag' in dir(): - PhysWaveLArCalibFolderTag = LArCalib_Flags.tagSuffix - -if not 'InputPhysWavePoolDir' in dir(): - InputPhysWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputPhysWavePoolFileName' in dir(): - InputPhysWavePoolFileName = "LArPhysWave.pool.root" - -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# PhysWaveShifter properties -########################################################################### - -if not 'InputKey' in dir(): - InputKey = "LArPhysWave" - -if not 'OutputKey' in dir(): - OutputKey = "LArPhysWave" - -########################################################################### -# PhysWaveShifter output -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = RunNumber - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputPhysWaveRootFileDir' in dir(): - OutputPhysWaveRootFileDir = subprocess.getoutput("pwd") - -PhysWaveFileTag = "Shifted_"+str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputPhysWaveRootFileName' in dir(): - OutputPhysWaveRootFileName = "LArPhysWave_"+ PhysWaveFileTag + ".root" - -if not 'OutputPhysWavePoolFileName' in dir(): - OutputPhysWavePoolFileName = "LArPhysWave_"+ PhysWaveFileTag + ".pool.root" - -if not 'LArPhysFolderOutputTag' in dir(): - LArPhysFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecPhysWave' in dir(): - OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+"LArPhysWave"+"#"+ LArCalib_Flags.LArPhysWaveFolder - OutputObjectSpecTagPhysWave = LArCalibFolderTag(LArCalib_Flags.LArPhysWaveFolder,LArPhysFolderOutputTag) - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "impl=cool;techno=oracle;schema=ATLAS_COOLOFL_LAR;ATLAS_COOLPROD:CONDBR2:ATLAS_COOL_READER:" - -if ( ReadPhysWaveFromCOOL ): - if 'InputPhysWaveSQLiteFile' in dir(): - InputDBConnectionPhysWave = DBConnectionFile(InputPhysWaveSQLiteFile) - else: - InputDBConnectionPhysWave = DBConnectionCOOL - -########################################################################### -# Print summary -########################################################################### - -PhysWaveLog = logging.getLogger( "PhysWaveLog" ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " *** LAr PhysWave summary *** " ) -PhysWaveLog.info( " ======================================================== " ) -PhysWaveLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadPhysWaveFromCOOL ): - PhysWaveLog.info( " InputDBConnectionPhysWave = "+InputDBConnectionPhysWave ) -else : - PhysWaveLog.info( " InputPhysWavePoolFileName = "+InputPhysWavePoolFileName ) -if ( (ReadPhysWaveFromCOOL) and ChannelSelection != " " ): - PhysWaveLog.info( " ChannelSelection = "+ChannelSelection ) -PhysWaveLog.info( " PhysWaveLArCalibFolderTag = "+PhysWaveLArCalibFolderTag ) -PhysWaveLog.info( " OutputPhysWaveRootFullFileName = "+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName ) -PhysWaveLog.info( " OutputPhysWavePoolFullFileName = "+OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName ) -PhysWaveLog.info( " OutputObjectSpecPhysWave = "+str(OutputObjectSpecPhysWave) ) -PhysWaveLog.info( " OutputObjectSpecTagPhysWave = "+str(OutputObjectSpecTagPhysWave) ) -PhysWaveLog.info( " IOVBegin = "+str(IOVBegin) ) -PhysWaveLog.info( " IOVEnd = "+str(IOVEnd) ) -PhysWaveLog.info( " LArCalibOutputDB = "+OutputDB ) -PhysWaveLog.info( " ======================================================== " ) -########################################################################### - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc. DBInstance="" -except: - pass - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadPhysWaveFromCOOL ): - PhysWaveFolder = "/LAR/ElecCalibOfl/PhysWaves/TempWillExistOnlyInTheSQLiteFile" - PhysWaveTagSpec = LArCalibFolderTag("/LAR/ElecCalibOfl/PhysWaves/TempWillExistOnlyInTheSQLiteFile",PhysWaveLArCalibFolderTag) - conddb.addFolder("",PhysWaveFolder+"<tag>"+PhysWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPhysWave+"</dbConnection>" + ChannelSelection) - -else: - if 'InputPhysWavePoolFileName' in dir(): - PoolFileList += [ InputPhysWavePoolDir+"/"+InputPhysWavePoolFileName ] - else: - printfunc ("No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL.") - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - - -########################################################################### -# -# Shift physics waveforms -# -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArPhysWaveShifter -LArPhysWaveShifter = LArPhysWaveShifter("LArPhysWaveShifter") - -LArPhysWaveShifter.KeyList = [ InputKey ] -LArPhysWaveShifter.KeyOutput = OutputKey -LArPhysWaveShifter.GroupingType = GroupingType - -# -# Minimum Tstart per FEB computation -# -LArPhysWaveShifter.ComputeTimeShiftByFEB = True -LArPhysWaveShifter.TimeShiftByFEBMode = 2 # 1 = minimum Tstart from helper in FEB - # 2 = minumum Tpeak-NindexFromPeak in FEB -LArPhysWaveShifter.TimeShiftByFEBDump = True -LArPhysWaveShifter.TimeShiftByFEBDumpFile = "TimeShiftFEB.py" - -# -# Possible time shifts -# -LArPhysWaveShifter.TimeShiftByHelper = False -LArPhysWaveShifter.TimeShiftByIndex = 0 -LArPhysWaveShifter.TimeShiftByLayer = False -LArPhysWaveShifter.TshiftLayer = [ 0 , 0 , 0 , 0 ] -LArPhysWaveShifter.TimeShiftFromPeak = False -LArPhysWaveShifter.NindexFromPeak = 0 # if 0 will use Ndelays*Nsampling -LArPhysWaveShifter.Ndelays = 24 -LArPhysWaveShifter.Nsamplings = 2 -LArPhysWaveShifter.TimeShiftByFEB = True -LArPhysWaveShifter.TimeShiftGuardRegion = 5 - - -topSequence += LArPhysWaveShifter - -########################################################################### -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArWaves2Ntuple - LArPhysWaves2Ntuple = LArWaves2Ntuple("LArPhysWaves2Ntuple") - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - LArPhysWaves2Ntuple.KeyList = [ OutputKey ] - LArPhysWaves2Ntuple.ReadCaliWave = False - - topSequence+=LArPhysWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - # writre PredPhysWave - OutputConditionsAlgPhysWave = OutputConditionsAlg("OutputConditionsAlgPhysWave",OutputPhysWavePoolFileDir+"/"+OutputPhysWavePoolFileName, - [OutputObjectSpecPhysWave],[OutputObjectSpecTagPhysWave],WriteIOV) - OutputConditionsAlgPhysWave.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgPhysWave.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from AthenaCommon.AppMgr import ServiceMgr - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = VERBOSE - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = DEBUG) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py deleted file mode 100644 index dccd26353cecc72205ea459834bdc398f39df15f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py +++ /dev/null @@ -1,781 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to extract RTM parameters from Cali/Master waveforms -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -if not "SuperCells" in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -########################################################################### -# Input selection -########################################################################### - -## RunNumber trigger IOV if reading from COOL is eneabled - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True - -if not 'ChannelSelection' in dir(): - ChannelSelection = " " # Read all - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - - -## CaliWave - -if not 'ReadCaliWaveFromCOOL' in dir(): - ReadCaliWaveFromCOOL = True - -if not 'InputCaliWavePoolDir' in dir(): - InputCaliWavePoolDir = subprocess.getoutput("pwd") - -if not 'InputCaliWavePoolFileName' in dir(): - InputCaliWavePoolFileName = "LArCaliWave.pool.root" - -## CaliPulseParams - -if not 'ReadCaliPulseParamsFromCOOL' in dir(): - ReadCaliPulseParamsFromCOOL = False - -if not 'InputCaliPulseParamsFolder' in dir(): - if not SuperCells: InputCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" - if SuperCells: InputCaliPulseParamsFolder = "/LAR/ElecCalibOflSC/CaliPulseParams/RTM" - - -if not 'InputCaliPulseParamsPoolDir' in dir(): - InputCaliPulseParamsPoolDir = subprocess.getoutput("pwd") - -if not 'InputCaliPulseParamsPoolFileName' in dir(): - InputPulseParamsPoolFileName = "LArCaliPulseParamsVsCalib_AllBoards.pool.root" - -## DetCellParams - -if not 'ReadDetCellParamsFromCOOL' in dir(): - ReadDetCellParamsFromCOOL = False - -if not 'InputDetCellParamsFolder' in dir(): - if not SuperCells: InputDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - if SuperCells: InputDetCellParamsFolder = "/LAR/ElecCalibOflSC/DetCellParams/RTM" - -if not 'InputDetCellParamsPoolDir' in dir(): - InputDetCellParamsPoolDir = subprocess.getoutput("pwd") - -if not 'InputDetCellParamsPoolFileName' in dir(): - InputDetCellParamsPoolFileName = "LArDetCellParams.pool.root" - -########################################################################### -# RTM algorithms steering option defaults -########################################################################### - -################################### -# Basic extraction defaults # -################################### - -if not 'ExtractTcal' in dir(): - ExtractTcal = True - -if not 'ExtractFstep' in dir(): - ExtractFstep = True - -if not 'ExtractOmega0' in dir(): - ExtractOmega0 = True - -if not 'ExtractTaur' in dir(): - ExtractTaur = True - -################################### -# Extract All Parameters # -################################### - -if ( 'ExtractAllParameters' in dir() and ExtractAllParameters ) : - - ReadCaliPulseParamsFromCOOL = False - ExtractTcal = True - ExtractFstep = True - - ReadDetCellParamsFromCOOL = False - ExtractOmega0 = True - ExtractTaur = True - -################################### -# Extract only tauR # -################################### - -if ( 'ExtractTauROnly' in dir() and ExtractTauROnly ) : - - ReadCaliPulseParamsFromCOOL = True - ExtractTcal = False - ExtractFstep = False - - ReadDetCellParamsFromCOOL = True - ExtractOmega0 = False - ExtractTaur = True - -## If needed, reads the LArCalibPulseParams from COOL (Oracle/SQLite) - -if ( ReadCaliPulseParamsFromCOOL ): - if 'InputCaliPulseParamsSQLiteFile' in dir(): - InputDBConnectionCaliPulseParams = DBConnectionFile(InputCaliPulseParamsSQLiteFile) - else: - InputDBConnectionCaliPulseParams = DBConnectionCOOL - -## If needed, reads the LArDetCellParams (for Omega0 values) from COOL (Oracle/SQLite) - -if ( ReadDetCellParamsFromCOOL ): - if 'InputDetCellParamsSQLiteFile' in dir(): - InputDBConnectionDetCellParams = DBConnectionFile(InputDetCellParamsSQLiteFile) - else: - InputDBConnectionDetCellParams = DBConnectionCOOL - -if ( ReadCaliWaveFromCOOL ): - if 'InputCaliWaveSQLiteFile' in dir(): - InputDBConnectionCaliWave = DBConnectionFile(InputCaliWaveSQLiteFile) - else: - InputDBConnectionCaliWave = DBConnectionCOOL - -########################################################################### - -if not 'doTest' in dir(): - doTest = False - -if not 'SuffixRetrievedCaliPulse' in dir(): - SuffixRetrievedCaliPulse = "" - -if not 'SuffixRetrievedDetCell' in dir(): - SuffixRetrievedDetCell = "" - -if not 'SuffixExtractedCaliPulse' in dir(): - SuffixExtractedCaliPulse = "_RTM" - -if not 'SuffixExtractedDetCell' in dir(): - SuffixExtractedDetCell = "_RTM" - -if not 'RecoverEmptyDB' in dir(): - RecoverEmptyDB = True - -# -# Cosine response scan -# - -if not 'UseOmegaScanHelper' in dir(): - UseOmegaScanHelper = True - -if not 'CosRespScan' in dir(): - CosRespScan = [ False , True , False , False ] # Strips only - -if not 'Omega0Min' in dir(): - Omega0Min = [ 0.100 , 0.220 , 0.060 , 0.100 ] - -if not 'Omega0Max' in dir(): - Omega0Max = [ 0.600 , 0.310 , 0.215 , 0.700 ] - -if not 'NpointScan' in dir(): - NpointScan = [ 800 , 900 , 310 , 120 ] - -if not 'TShaper' in dir(): - TShaper = 15 - -if not 'CosRespTtailMin' in dir(): - CosRespTtailMin = 0 - -if not 'CosRespTtailMax' in dir(): - CosRespTtailMax = 0 - -# -# Residual oscillation minimisation -# - -if not 'DeltaTtailTaur' in dir(): - DeltaTtailTaur = 100 - -# -# Special output -# - -if not 'DumpOmegaScan' in dir(): - DumpOmegaScan = False - -if not 'OmegaScanKey' in dir(): - OmegaScanKey = "OmegaScan" - -if not 'DumpResOscill' in dir(): - DumpResOscill = False - -if not 'ResOscillKeyBefore' in dir(): - ResOscillKeyBefore = "ResOscillBefore" - -if not 'ResOscillKeyAfter' in dir(): - ResOscillKeyAfter = "ResOscillAfter" - -if not 'StoreResOscill' in dir(): - StoreResOscill = [ False , False , False , False ] - -# -# FT/Slot selection -# - -if not 'PosNeg' in dir(): - PosNeg = 0 - -if not 'FT' in dir(): - FT = [] - -if not 'Slot' in dir(): - Slot = [] - -# -# Input wave type -# - -if not 'ContainerKey' in dir(): - ContainerKey = "LArCaliWave" - -if not 'IgnoreDACSelection' in dir(): - IgnoreDACSelection = True - -if not 'DAC' in dir(): - DAC = [ 500 , 4000, 40000 ] # High, Medium, Low - - -####################################################### -# Monitoring properties -####################################################### -if not 'CheckBadEvents' in dir(): - CheckBadEvents = True - - -########################################################################### -# RTMParams output # -########################################################################### - -if not 'GroupingType' in dir(): - if SuperCells: - GroupingType = "SuperCells" - else: - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputParamsRootFileDir' in dir(): - OutputParamsRootFileDir= subprocess.getoutput("pwd") - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir= subprocess.getoutput("pwd") - -if not 'RTMFileTag' in dir(): - RTMFileTag = "DefaultExtraction" - for RunNumber in RunNumberList : - RTMFileTag += "_"+str(RunNumber) - RTMFileTag = RTMFileTag+"_"+Partition.replace("*","") - -if not 'OutputParamsRootFileName' in dir(): - OutputParamsRootFileName = "LArParams_"+RTMFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArRTMParams_"+RTMFileTag + ".pool.root" - -if not 'OutputCaliPulseParamsFolder' in dir(): - if not SuperCells: OutputCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" - if SuperCells: OutputCaliPulseParamsFolder = "/LAR/ElecCalibOflSC/CaliPulseParams/RTM" - -if not 'OutputDetCellParamsFolder' in dir(): - if not SuperCells: OutputDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - if SuperCells: OutputDetCellParamsFolder = "/LAR/ElecCalibOflSC/DetCellParams/RTM" - -if not StripsXtalkCorr: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolder -else: - CaliWaveFolder = LArCalib_Flags.LArCaliWaveFolderXtlk - -rs=FolderTagResover() -if not "LArDetCellParamsTag" in dir(): - LArDetCellParamsTag=rs.getFolderTagSuffix(OutputDetCellParamsFolder) - -if not "LArCaliPulseParamsTag" in dir(): - LArCaliPulseParamsTag=rs.getFolderTagSuffix(OutputCaliPulseParamsFolder) - -if not "CaliWaveLArCalibFolderTag" in dir (): - CaliWaveLArCalibFolderTag=rs.getFolderTagSuffix(CaliWaveFolder) - -del rs #Close database - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'OutputObjectSpecCaliPulseParams' in dir(): - OutputObjectSpecCaliPulseParams = "LArCaliPulseParamsComplete#"+"LArCaliPulseParams_RTM#"+ OutputCaliPulseParamsFolder - OutputObjectSpecTagCaliPulseParams = LArCalibFolderTag(OutputCaliPulseParamsFolder,LArCaliPulseParamsTag,) - -if not 'OutputObjectSpecDetCellParams' in dir(): - OutputObjectSpecDetCellParams = "LArDetCellParamsComplete#"+"LArDetCellParams_RTM#"+ OutputDetCellParamsFolder - OutputObjectSpecTagDetCellParams = LArCalibFolderTag(OutputDetCellParamsFolder,LArDetCellParamsTag) - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -RTMParamsLog = logging.getLogger( "RTMParamsLog" ) -RTMParamsLog.info( " ========================================================= " ) -RTMParamsLog.info( " *** LAr RTMParams summary *** " ) -RTMParamsLog.info( " ========================================================= " ) -for RunNumber in RunNumberList : - RTMParamsLog.info( " RunNumber = "+str(RunNumber) ) - -if ( ReadCaliWaveFromCOOL ): - RTMParamsLog.info( " InputDBConnectionCaliWave = "+InputDBConnectionCaliWave ) - RTMParamsLog.info( " CaliWaveLArCalibFolderTag = "+CaliWaveLArCalibFolderTag ) -else : - RTMParamsLog.info( " InputCaliWavePoolFileName = "+InputCaliWavePoolFileName ) - -if ( ReadCaliWaveFromCOOL and ChannelSelection != " " ): - RTMParamsLog.info( " ChannelSelection = "+ChannelSelection ) - -if ( ReadCaliPulseParamsFromCOOL ): - RTMParamsLog.info( " InputDBConnectionCaliPulseParams = "+InputDBConnectionCaliPulseParams ) - RTMParamsLog.info( " InputCaliPulseParamsFolder = "+InputCaliPulseParamsFolder ) - if "CaliPulseParamsLArCalibFolderTag" in dir() : - RTMParamsLog.info( " CaliPulseParamsLArCalibFolderTag = "+CaliPulseParamsLArCalibFolderTag ) - -if ( ReadDetCellParamsFromCOOL ): - RTMParamsLog.info( " InputDBConnectionDetCellParams = "+InputDBConnectionDetCellParams ) - RTMParamsLog.info( " InputDetCellParamsFolder = "+InputDetCellParamsFolder ) - if "DetCellParamsLArCalibFolderTag" in dir() : - RTMParamsLog.info( " DetCellParamsLArCalibFolderTag = "+DetCellParamsLArCalibFolderTag ) - -if ( not ExtractTcal or not ExtractFstep and not ReadCaliPulseParamsFromCOOL ): - RTMParamsLog.info( " InputCaliPulseParamsPoolFileName = "+InputPulseParamsPoolFileName ) - -if ( not ExtractOmega0 or not ExtractTaur and not ReadDetCellParamsFromCOOL ): - RTMParamsLog.info( " InputDetCellParamsPoolFileName = "+InputDetCellParamsPoolFileName ) - -if ( WriteNtuple ): - RTMParamsLog.info( " OutputParamsRootFullFileName = "+OutputParamsRootFileDir+"/"+OutputParamsRootFileName ) - -if (WritePoolFile): - RTMParamsLog.info( " OutputParamsPoolFullFileName = "+OutputPoolFileDir+"/"+OutputPoolFileName ) - RTMParamsLog.info( " OutputObjectSpecCaliPulseParams = "+str(OutputObjectSpecCaliPulseParams) ) - RTMParamsLog.info( " OutputObjectSpecTagCaliPulseParams = "+str(OutputObjectSpecTagCaliPulseParams) ) - RTMParamsLog.info( " OutputObjectSpecDetCellParams = "+str(OutputObjectSpecDetCellParams) ) - RTMParamsLog.info( " OutputObjectSpecTagDetCellParams = "+str(OutputObjectSpecTagDetCellParams) ) - -if (WriteIOV): - RTMParamsLog.info( " IOVBegin = "+str(IOVBegin) ) - RTMParamsLog.info( " IOVEnd = "+str(IOVEnd) ) - RTMParamsLog.info( " LArCalibOutputDB = "+OutputDB ) - RTMParamsLog.info( " OutputDetCellParamsFolder = "+OutputDetCellParamsFolder ) - RTMParamsLog.info( " OutputDetCellParamsFolder = "+OutputDetCellParamsFolder ) - -RTMParamsLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -## Bad Channel - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -if not 'InputBadChannelSQLiteFile' in dir(): - RTMParamsLog.info( "Read Bad Channels from Oracle DB") -else : - RTMParamsLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -# This algorithm verifies that no FEBs are dropping out of the run -# If it finds corrupt events, it breaks the event loop and terminates the job rapidly -if not SuperCells: - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False - if CheckBadEvents: - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=True - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList=GainList - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadCaliWaveFromCOOL ) : - if not 'InputCaliWaveSQLiteFile' in dir(): - RTMParamsLog.info( "Read CaliWave from Oracle DB" ) - else : - RTMParamsLog.info( "Read CaliWave from SQLite file" ) - -if ( not ExtractTcal or not ExtractFstep ): - if ( ReadCaliPulseParamsFromCOOL ) : - if not 'InputCaliPulseParamsSQLiteFile' in dir(): - RTMParamsLog.info( "Read CaliPulseParams from Oracle DB" ) - else : - RTMParamsLog.info( "Read CaliPulseParams from SQLite file" ) - -if ( not ExtractOmega0 or not ExtractTaur): - if ( ReadDetCellParamsFromCOOL ) : - if not 'InputDetCellParamsSQLiteFile' in dir(): - RTMParamsLog.info( "Read DetCellParams from Oracle DB" ) - else : - RTMParamsLog.info( "Read DetCellParams from SQLite file" ) - -## CaliWave -if ( ReadCaliWaveFromCOOL ): - CaliWaveTagSpec = LArCalibFolderTag(CaliWaveFolder,CaliWaveLArCalibFolderTag) - conddb.addFolder("",CaliWaveFolder+"<tag>"+CaliWaveTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliWave+"</dbConnection>" + ChannelSelection) -else: - if 'InputCaliWavePoolFileName' in dir(): - RTMParamsLog.info("Read CaliWave from POOL file") - PoolFileList += [ InputCaliWavePoolFileDir+"/"+InputCaliWavePoolFileName ] - else: - RTMParamsLog.error("No PoolFileList found! Please list the POOL files containing CaliWave or read from COOL.") - theApp.exit(-1) - -## CaliPulseParams -if ( not ExtractTcal or not ExtractFstep ): # Load CaliPulseParams from COOL or POOL only if extraction is not selected - if ( ReadCaliPulseParamsFromCOOL ): - if 'CaliPulseParamsLArCalibFolderTag' in dir(): - CaliPulseParamsTagSpec = LArCalibFolderTag(InputCaliPulseParamsFolder,CaliPulseParamsLArCalibFolderTag) - conddb.addFolder("",InputCaliPulseParamsFolder+"<tag>"+CaliPulseParamsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionCaliPulseParams+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",InputCaliPulseParamsFolder+"<key>LArCaliPulseParams</key><dbConnection>"+InputDBConnectionCaliPulseParams+"</dbConnection>" + ChannelSelection) - else: - if 'InputCaliPulseParamsPoolFileName' in dir(): - RTMParamsLog.info("Read CaliPulseParams from POOL file") - PoolFileList += [ InputCaliPulseParamsPoolDir+"/"+InputCaliPulseParamsPoolFileName ] - else: - RTMParamsLog.error("No PoolFileList found! Please list the POOL files containing CaliPulseParams or read from COOL.") - theApp.exit(-1) - -## DetCellParams -if ( not ExtractOmega0 or not ExtractTaur): # Load DetCellParams from COOL or POOL only if extraction is not selected - if ( ReadDetCellParamsFromCOOL ): - if 'DetCellParamsLArCalibFolderTag' in dir(): - DetCellParamsTagSpec = LArCalibFolderTag(InputDetCellParamsFolder,DetCellParamsLArCalibFolderTag) - conddb.addFolder("",InputDetCellParamsFolder+"<tag>"+DetCellParamsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionDetCellParams+"</dbConnection>" + ChannelSelection) - else : - conddb.addFolder("",InputDetCellParamsFolder+"<key>LArDetCellParams</key><dbConnection>"+InputDBConnectionDetCellParams+"</dbConnection>" + ChannelSelection) - else: - if 'InputDetCellParamsPoolFileName' in dir(): - RTMParamsLog.info("Read DetCellParams from POOL file") - PoolFileList += [ InputDetCellParamsPoolDir+"/"+InputDetCellParamsPoolFileName ] - else: - RTMParamsLog.error("No PoolFileList found! Please list the POOL files containing DetCellParams or read from COOL.") - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################### -# # -# Extract RTM parameters Cali/Master waveforms # -# # -########################################################################### - -if not 'doTest' in dir(): - doTest = False - -from LArCalibUtils.LArCalibUtilsConf import LArRTMParamExtractor -LArRTMParamExtractor = LArRTMParamExtractor("LArRTMParamExtractor") - -LArRTMParamExtractor.KeyList = [ ContainerKey ] -LArRTMParamExtractor.TestMode = doTest -LArRTMParamExtractor.GroupingType = GroupingType -LArRTMParamExtractor.DAC = DAC -LArRTMParamExtractor.IgnoreDACSelection = IgnoreDACSelection -LArRTMParamExtractor.isSC = SuperCells - -LArRTMParamExtractor.ExtractTcal = ExtractTcal -LArRTMParamExtractor.ExtractFstep = ExtractFstep -LArRTMParamExtractor.ExtractOmega0 = ExtractOmega0 -LArRTMParamExtractor.ExtractTaur = ExtractTaur - -LArRTMParamExtractor.RecoverEmptyDB = RecoverEmptyDB - -LArRTMParamExtractor.SuffixRetrievedCaliPulse = SuffixRetrievedCaliPulse -LArRTMParamExtractor.SuffixRetrievedDetCell = SuffixRetrievedDetCell -LArRTMParamExtractor.SuffixExtractedCaliPulse = SuffixExtractedCaliPulse -LArRTMParamExtractor.SuffixExtractedDetCell = SuffixExtractedDetCell - -LArRTMParamExtractor.FT = FT -LArRTMParamExtractor.PosNeg = PosNeg - -LArRTMParamExtractor.Slot = Slot - -LArRTMParamExtractor.DumpOmegaScan = DumpOmegaScan -LArRTMParamExtractor.OmegaScanKey = OmegaScanKey - -LArRTMParamExtractor.DumpResOscill = DumpResOscill -LArRTMParamExtractor.ResOscillKeyBefore = ResOscillKeyBefore -LArRTMParamExtractor.ResOscillKeyAfter = ResOscillKeyAfter - -from LArCalibUtils.LArCalibUtilsConf import LArWFParamTool -theLArWFParamTool = LArWFParamTool() -theLArWFParamTool.isSC = SuperCells - -if 'NBaseline' in dir(): - theLArWFParamTool.NBaseline = NBaseline - -if 'SubtractBaseline' in dir(): - theLArWFParamTool.SubtractBaseline = SubtractBaseline - -if 'ShiftToStart' in dir(): - theLArWFParamTool.ShiftToStart = ShiftToStart - -if 'TShaper' in dir(): - theLArWFParamTool.TShaper = TShaper - -theLArWFParamTool.TtailMin = [ 0, 0, CosRespTtailMin, 0 ] -theLArWFParamTool.TtailMax = [ 0, 0, CosRespTtailMax, 0 ] - -if 'UseOmegaScanHelper' in dir(): - theLArWFParamTool.UseOmegaScanHelper = UseOmegaScanHelper -if 'CosRespScan'in dir(): - theLArWFParamTool.CosRespScan = CosRespScan - -if 'Omega0Min' in dir(): - theLArWFParamTool.Omega0Min = Omega0Min - -if 'Omega0Max' in dir(): - theLArWFParamTool.Omega0Max = Omega0Max - -if 'NpointScan' in dir(): - theLArWFParamTool.NpointScan = NpointScan - -if 'StoreResOscill' in dir(): - theLArWFParamTool.StoreResOscill = StoreResOscill - -LArRTMParamExtractor.LArWFParamTool=theLArWFParamTool -topSequence += LArRTMParamExtractor - -########################################################################### - -if ( WriteNtuple ): - - from LArCalibTools.LArCalibToolsConf import LArWFParams2Ntuple - LArWFParams2Ntuple = LArWFParams2Ntuple("LArWFParams2Ntuple") - LArWFParams2Ntuple.DumpCaliPulseParams = True - LArWFParams2Ntuple.DumpDetCellParams = True - LArWFParams2Ntuple.CaliPulseParamsKey="LArCaliPulseParams_RTM" - LArWFParams2Ntuple.DetCellParamsKey="LArDetCellParams_RTM" - LArWFParams2Ntuple.isSC = SuperCells - topSequence += LArWFParams2Ntuple - - if ( DumpOmegaScan ): - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple as LArOmegaScans2Ntuple - LArOmegaScans2Ntuple = LArOmegaScans2Ntuple( "LArOmegaScans2Ntuple" ) - LArOmegaScans2Ntuple.NtupleName = "OMEGASCAN" - LArOmegaScans2Ntuple.KeyList = [ OmegaScanKey ] - - topSequence += LArOmegaScans2Ntuple - - if ( DumpResOscill ): - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple as LArResOscillsBefore2Ntuple - LArResOscillsBefore2Ntuple = LArResOscillsBefore2Ntuple( "LArResOscillsBefore2Ntuple" ) - LArResOscillsBefore2Ntuple.NtupleName = "RESOSCILLBEFORE" - LArResOscillsBefore2Ntuple.KeyList = [ ResOscillKeyBefore ] - - topSequence += LArResOscillsBefore2Ntuple - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple as LArResOscillsAfter2Ntuple - LArResOscillsAfter2Ntuple = LArResOscillsAfter2Ntuple( "LArResOscillsAfter2Ntuple" ) - LArResOscillsAfter2Ntuple.NtupleName = "RESOSCILLAFTER" - LArResOscillsAfter2Ntuple.KeyList = [ ResOscillKeyAfter ] - - topSequence += LArResOscillsAfter2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputParamsRootFileDir+"/"+OutputParamsRootFileName): - os.remove(OutputParamsRootFileDir+"/"+OutputParamsRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputParamsRootFileDir+"/"+OutputParamsRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - # write CaliPulseParams and DetCellParams - if os.path.exists(OutputPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputPoolFileDir+"/"+OutputPoolFileName) - OutputConditionsAlgParams = OutputConditionsAlg("OutputConditionsAlgParams",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecCaliPulseParams],[OutputObjectSpecTagCaliPulseParams],WriteIOV) - OutputConditionsAlgParams.ObjectList += [OutputObjectSpecDetCellParams] - OutputConditionsAlgParams.IOVTagList += [OutputObjectSpecTagDetCellParams] - - OutputConditionsAlgParams.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlgParams.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = VERBOSE - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = int(RunNumberList[0]) -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py deleted file mode 100644 index bc76f2f520ba06d2b2f3541acd608d04cbfe2051..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py +++ /dev/null @@ -1,906 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to reconstruction one or more ramp run from data -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -if not "SuperCells" in dir(): - SuperCells=False -if not 'SC_SampleShift' in dir(): - SC_SampleShift=0 - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'SCProtectSourceId' in dir(): - SCProtectSourceId=True - -if not 'patchCalibs' in dir(): - patchCalibs = [] -else: - print("WARNING: will patch the following calibration boards:", patchCalibs) - - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") -include("LArCalibProcessing/GetInputFiles.py") - -###################################################### - Run properties -###################################################### - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0018660' ] - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Ramp" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'FullFileName' in dir(): - if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Ramp"+".*" - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - - -if not 'ChannelSelection' in dir(): - ## to read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - #ChannelSelection = "<channelSelection>0,0:1000</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -if not 'CheckBadEvents' in dir(): - CheckBadEvents = True - -####################################################### -# Ramp properties # -####################################################### - -if not 'isHEC' in dir(): - isHEC= False - -if not 'HECKey' in dir(): - HECKey="LArHEC_PAmap" - -if not 'PeakOF' in dir(): - PeakOF = True # OF reconstruction - -if not 'CorrectBias' in dir(): - CorrectBias = False # Set whether to correct for bias - if True, will look for peds from COOL - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not "ADCSaturation" in dir(): - ADCsaturation = 4090 # Set to 0 if you want to keep saturating pulses - -if not "RampRangeValue" in dir(): - RampRangeValue = 3600 # Check on the raw data ADC sample before ped subtraction and pulse reconstruction to include point in fit - -if not 'KeyOutput' in dir(): - KeyOutput = "LArRamp" # Key of LArRampComplete object in DetStore - -if not 'SaveRawRamp' in dir(): - SaveRawRamp = True - -if not 'SaveAverages' in dir(): - SaveAverages = False # Add averages to ROOT file - -if not 'ApplyCorr' in dir(): - ApplyCorr = False # Apply corr. before dumping to ROOT file - -if not 'SaveAllSamples' in dir(): - SaveAllSamples = False # Add Samples and RMS to RAMPS TTree - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=True - -if not 'ApplyAdHocCorrection' in dir(): - ApplyAdHocCorrection=False - -####################################################### -# Ramp output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "COOLOFL_LAR/CONDBR2" - -## HEC map -if not 'ReadHECMapFromCOOL' in dir(): - ReadHECMapFromCOOL = True - -if not 'InputHECMapPoolFileDir' in dir(): - InputHECMapPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputHECMapPoolFileName' in dir(): - InputHECMapPoolFileName = "LArHECMap.pool.root" - -## Pedestal -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - -## OFC Cali -if not 'ReadOFCFromCOOL' in dir(): - ReadOFCFromCOOL = True - -if not 'OFCRunNumber' in dir(): - OFCRunNumber = "30950" - -if not 'InputOFCPoolFileDir' in dir(): - InputOFCPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputOFCPoolFileName' in dir(): - if PeakOF : - InputOFCPoolFileName = "LArOFCCali_" + str(PedRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - if ( PeakOF and StripsXtalkCorr ) : - InputOFCPoolFileName = "LArOFCCali_StripsXtalkCorr_" + str(OFCRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - -if not 'CaliOFCFolder' in dir(): - if not StripsXtalkCorr: - CaliOFCFolder = LArCalib_Flags.LArOFCCaliFolder - else: - CaliOFCFolder = LArCalib_Flags.LArOFCCaliFolderXtlk - -if 'dbname' in dir(): - rs=FolderTagResover(dbname=dbname) -else: - rs=FolderTagResover() -if not 'LArRampFolderOutputTag' in dir(): - LArRampFolderOutputTag = rs.getFolderTagSuffix(LArCalib_Flags.LArRampFolder) -if not 'PedLArCalibFolderTag' in dir(): - PedLArCalibFolderTag = rs.getFolderTagSuffix(LArCalib_Flags.LArPedestalFolder) -if not 'LArCaliOFCFolderTag' in dir(): - LArCaliOFCFolderTag = rs.getFolderTagSuffix(CaliOFCFolder) -del rs - -if not 'OutputRampRootFileDir' in dir(): - OutputRampRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputRampPoolFileDir' in dir(): - OutputRampPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'BaseFileName' in dir(): - BaseFileName = "LArRamp" - - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - - if StripsXtalkCorr: - BaseFileName += "_StripsXtalkCorr" - if PeakOF: - BaseFileName += "_OFC" - -if not 'OutputRampRootFileName' in dir(): - OutputRampRootFileName = BaseFileName+".root" - -if not 'OutputRampPoolFileName' in dir(): - OutputRampPoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecRamp' in dir(): - OutputObjectSpecRamp = "LArRampComplete#"+KeyOutput+"#"+LArCalib_Flags.LArRampFolder - OutputObjectSpecTagRamp = LArCalibFolderTag(LArCalib_Flags.LArRampFolder,LArRampFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -if ( PeakOF and ReadOFCFromCOOL ): - if 'InputDBConnectionOFC' not in dir(): - if 'InputOFCSQLiteFile' in dir(): - InputDBConnectionOFC = DBConnectionFile(InputOFCSQLiteFile) - else: - InputDBConnectionOFC = DBConnectionCOOL - -if ( ReadHECMapFromCOOL ): - if 'InputHECMapSQLiteFile' in dir(): - InputDBConnectionHECMap = DBConnectionFile(InputHECMapSQLiteFile) - else: - InputDBConnectionHECMap = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -####################################################################################### -# print summary # -####################################################################################### - -RampLog = logging.getLogger( "RampLog" ) -RampLog.info( " ======================================================== " ) -RampLog.info( " *** LAr Ramp summary *** " ) -RampLog.info( " ======================================================== " ) -RampLog.info( " RunNumber = "+str(RunNumberList) ) -RampLog.info( " SubDetector = "+SubDet ) -RampLog.info( " Partition = "+Partition ) -RampLog.info( " Type = Ramp " ) -for i in range(len(FullFileName)): - RampLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - RampLog.info( " InputDBConnectionPed = "+InputDBConnectionPed ) -else : - RampLog.info( " InputPedPoolFileName = "+InputPedPoolFileName ) -RampLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -if ( PeakOF and ReadOFCFromCOOL ): - RampLog.info( " InputDBConnectionOFC = "+InputDBConnectionOFC ) -elif ( PeakOF) : - RampLog.info( " InputOFCPoolFileName = "+InputOFCPoolFileName ) -if 'LArCaliOFCFolderTag' in dir() : - RampLog.info( " LArCaliOFCFolderTag = "+LArCaliOFCFolderTag ) -RampLog.info( " OutputRampRootFullFileName = "+OutputRampRootFileDir+"/"+OutputRampRootFileName ) -RampLog.info( " OutputRampPoolFullFileName = "+OutputRampPoolFileDir+"/"+OutputRampPoolFileName ) -RampLog.info( " OutputObjectSpecRamp = "+OutputObjectSpecRamp ) -RampLog.info( " OutputObjectSpecTagRamp = "+OutputObjectSpecTagRamp ) -RampLog.info( " IOVBegin = "+str(IOVBegin) ) -RampLog.info( " IOVEnd = "+str(IOVEnd) ) -RampLog.info( " LArCalibOutputDB = "+OutputDB ) -for i in range(len(GainList)): - RampLog.info( " GainList = "+GainList[i] ) -RampLog.info( " ======================================================== " ) -####################################################################################### - -include ("LArConditionsCommon/LArMinimalSetup.py") -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import theApp, ServiceMgr, ToolSvc - -theByteStreamInputSvc=ServiceMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - ServiceMgr.EventSelector.Input=FullFileName - -ServiceMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -#else # -# ServiceMgr.EventSelector.Input=OneFileName # -# for i in range(len(ServiceMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -if ( runAccumulator ): - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #theLArLATOMEDecoder.DumpFile = SC_DumpFile - #theLArLATOMEDecoder.RawDataFile = SC_RawDataFile - from LArByteStream.LArByteStreamConf import LArRawSCDataReadingAlg - larRawSCDataReadingAlg = LArRawSCDataReadingAlg() - larRawSCDataReadingAlg.adcCollKey = Gain - larRawSCDataReadingAlg.adcBasCollKey = "" - larRawSCDataReadingAlg.etCollKey = "" - larRawSCDataReadingAlg.etIdCollKey = "" - larRawSCDataReadingAlg.LATOMEDecoder = theLArLATOMEDecoder - larRawSCDataReadingAlg.OutputLevel = WARNING - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - larRawSCDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - topSequence += larRawSCDataReadingAlg - else: - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - topSequence+=theLArRawCalibDataReadingAlg - include("./LArCalib_CalibrationPatterns_"+str(IOVBegin)+".py") - -else: - - if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - from LArByteStream.LArByteStreamConf import LArRawSCCalibDataReadingAlg - LArRawSCCalibDataReadingAlg = LArRawSCCalibDataReadingAlg() - LArRawSCCalibDataReadingAlg.LArSCAccCalibDigitKey = Gain - LArRawSCCalibDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.DumpFile = SC_DumpFile - #LArRawSCCalibDataReadingAlg.LATOMEDecoder.RawDataFile = SC_RawDataFile - LArRawSCCalibDataReadingAlg.LATOMEDecoder.ProtectSourceId = SCProtectSourceId - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.OutputLevel = WARNING - topSequence+=LArRawSCCalibDataReadingAlg - - else: - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArAccCalibDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - topSequence+=theLArRawCalibDataReadingAlg - -########################################################################## -# # -# Ramp run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -if not 'InputBadChannelSQLiteFile' in dir(): - RampLog.info( "Read Bad Channels from Oracle DB") -else : - RampLog.info( "Read Bad Channels from SQLite file") - -#if ( ReadBadChannelFromCOOL ): -# if 'InputBadChannelSQLiteFile' in dir(): -# InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) -# else: -# #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" -# if 'InputDBConnectionBadChannel' not in dir(): -# InputDBConnectionBadChannel = "COOLONL_LAR/" + conddb.dbname - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -if SuperCells: - theLArBadChannelCondAlg.isSC=True -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -if not SuperCells: - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False -if CheckBadEvents: - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=True - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList=GainList - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher - - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>",className="AthenaAttributeList") - -## define the DB Gobal Tag : -ServiceMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - ServiceMgr.IOVDbSvc.DBInstance="" -except: - pass - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") -#ServiceMgr.EventSelector.InitialTimeStamp = 1284030331 -#import cx_Oracle -#import time -#import datetime -#try: -# connection=cx_Oracle.connect("ATLAS_SFO_T0_R/readmesfotz2008@atlr") -# cursor=connection.cursor() -# sRequest=("SELECT RUNNR,CREATION_TIME FROM SFO_TZ_RUN WHERE RUNNR='%s'")%(RunNumberList[0]) -# cursor.execute(sRequest) -# times= cursor.fetchall() -# d=times[0][1] -# iovtemp=int(time.mktime(d.timetuple())) -#except: -# iovtemp=1283145454 - -#print "Setting timestamp for run ",RunNumberList[0]," to ",iovtemp -#ServiceMgr.IOVDbSvc.forceTimestamp = 1283145454 -#ServiceMgr.IOVDbSvc.forceTimestamp = iovtemp - - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -ServiceMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - if not SuperCells: - conddb.addFolder("LAR_ONL","/LAR/ElecCalibOnl/Ramp<key>LArRampRef</key>"+ChannelSelection) - else: - #FIXME once the SC calib data are in oracle - conddb.addFolder("","/LAR/ElecCalibOflSC/Ramps/RampLinea<key>LArRampRef</key><dbConnection>sqlite://;schema=/eos/atlas/atlascerngroupdisk/det-larg/SuperCells/CalibData/poolFiles/LATOMERun_EndcapWeekly_220411-182904/db_00417648_00417649_00417650.db;dbname=CONDBR2</dbConnection><tag>LARElecCalibOflSCRampsRampLinea-UPD3-00</tag>"+ChannelSelection) - -#if (CorrectBadChannels or StripsXtalkCorr): -# conddb.addFolder("LAR","/LAR/BadChannelsOfl/BadChannels") -# conddb.addFolder("LAR","/LAR/BadChannelsOfl/MissingFEBs") - -if (isHEC): - if ( ReadHECMapFromCOOL ): - if not 'InputHECMapSQLiteFile' in dir(): - RampLog.info( "Read HECMap from Oracle DB" ) - else : - RampLog.info( "Read HEC map from SQLite file" ) - - if ( ReadHECMapFromCOOL ): - HECMapFolder = "/LAR/ElecCalibOfl/HecPAMap" - if "HECMapTagSpec" in dir(): - conddb.addFolder("",HECMapFolder+"<tag>"+HECMapTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionHECMap+"</dbConnection>",className="LArRinjComplete") - else : - conddb.addFolder("",HECMapFolder+"<dbConnection>"+InputDBConnectionHECMap+"</dbConnection>",className="LArRinjComplete") - - else: - if 'InputHECMapPoolFileName' in dir(): - RampLog.info( "Read HECMap form POOL file" ) - PoolFileList += [ InputHECMapPoolFileDir +"/"+ InputHECMapPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing HECMap or read from COOL." ) - theApp.exit(-1) - -if (CorrectBias or PeakOF or StripsXtalkCorr): - if ( ReadPedFromCOOL or ReadOFCFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - RampLog.info( "Read Pedestal from Oracle DB" ) - else : - RampLog.info( "Read Pedestal from SQLite file" ) - - if not 'InputOFCSQLiteFile' in dir(): - RampLog.info( "Read OFC Cali from Oracle DB" ) - else : - RampLog.info( "Read OFC Cali from SQLite file" ) - -if ( ReadPedFromCOOL ): - if (CorrectBias or StripsXtalkCorr or PeakOF): - PedestalFolder = LArCalib_Flags.LArPedestalFolder - PedestalTagSpec = LArCalibFolderTag(PedestalFolder,PedLArCalibFolderTag) - #RampLog.info("Ped. folder:",PedestalFolder," ",PedestalTagSpec," ",InputDBConnectionPed) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection,className="LArPedestalComplete") - -else: - if 'InputPedPoolFileName' in dir(): - RampLog.info( "Read Pedestal from POOL file" ) - PoolFileList += [ InputPedPoolFileDir +"/"+ InputPedPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing Pedestal or read from COOL." ) - theApp.exit(-1) - -if ( ReadOFCFromCOOL ): - if PeakOF: - if not 'CaliOFCTagSpec' in dir(): - CaliOFCTagSpec = LArCalibFolderTag(CaliOFCFolder,LArCaliOFCFolderTag) - conddb.addFolder("",CaliOFCFolder+"<tag>"+CaliOFCTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ChannelSelection, className="LArOFCComplete") - -else: - if 'InputOFCPoolFileName' in dir(): - RampLog.info( "Read OFC Cali form POOL file" ) - PoolFileList += [ InputOFCPoolFileDir +"/"+ InputOFCPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing OFC or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - from AthenaCommon.ConfigurableDb import getConfigurable - ServiceMgr += getConfigurable( "ProxyProviderSvc" )() - ServiceMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - ServiceMgr += getConfigurable( "CondProxyProvider" )() - ServiceMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( StripsXtalkCorr ) : - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"] - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine","deadReadout"] - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - - - -from LArCalibUtils.LArCalibUtilsConf import LArRampBuilder -theLArRampBuilder = LArRampBuilder() -theLArRampBuilder.KeyList = GainList -theLArRampBuilder.SubtractDac0 = False -theLArRampBuilder.ProblemsToMask=["deadCalib","deadReadout","deadPhys","almostDead","short"] - -if ( PeakOF ): - theLArRampBuilder.RecoType = "OF" - from LArRecUtils.LArRecUtilsConf import LArOFPeakRecoTool - theLArOFPeakRecoTool=LArOFPeakRecoTool() - theLArOFPeakRecoTool.UseShape = False - theLArRampBuilder.PeakOFTool=theLArOFPeakRecoTool -else : - theLArRampBuilder.RecoType = "Parabola" - from LArRecUtils.LArRecUtilsConf import LArParabolaPeakRecoTool - theLArParabolaPeakRecoTool=LArParabolaPeakRecoTool() - theLArParabolaPeakRecoTool.correctBias = CorrectBias - ToolSvc+=theLArParabolaPeakRecoTool - -# As the first ramp point no longer is taken at DAC=0 -# this point should not have a special place. -theLArRampBuilder.DAC0 = -1 -theLArRampBuilder.StoreRawRamp = SaveRawRamp -theLArRampBuilder.StoreRecRamp = True -theLArRampBuilder.Polynom = 1 -theLArRampBuilder.RampRange = RampRangeValue # Check on the raw data ADC sample before ped subtraction - # and pulse reconstruction to include point in fit -theLArRampBuilder.correctBias = CorrectBias -theLArRampBuilder.minDAC = 10 # minimum DAC value to use in fit -theLArRampBuilder.KeyOutput = KeyOutput -theLArRampBuilder.DeadChannelCut = -9999 -theLArRampBuilder.GroupingType = GroupingType - -theLArRampBuilder.isSC = SuperCells - - -if ( isHEC ) : - theLArRampBuilder.isHEC = isHEC - theLArRampBuilder.HECKey = HECKey - -topSequence+=theLArRampBuilder - - -###################################################################### -# # -# Correction # -# # -###################################################################### - -if CorrectBadChannels: - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArRampComplete_ - theLArRampPatcher=LArCalibPatchingAlg_LArRampComplete_("LArRampPatcher") - theLArRampPatcher.ContainerKey=KeyOutput - theLArRampPatcher.PatchMethod="PhiAverage" - - theLArRampPatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"] - theLArRampPatcher.UseCorrChannels=False - - if SuperCells: - theLArRampPatcher.OnOffMap="LArOnOffIdMapSC" - theLArRampPatcher.CalibLineKey="LArCalibIdMapSC" - theLArRampPatcher.SuperCell=True - - ## block standard patching for this CB - if len(patchCalibs) > 1: - theLArRampPatcher.DoNotPatchCBs=patchCalibs - topSequence+=theLArRampPatcher - -if ( ApplyAdHocCorrection ): - from LArCalibUtils.LArCalibUtilsConf import LArRampAdHocPatchingAlg - LArRampAdHocPatchingAlg = LArRampAdHocPatchingAlg("LArRampAdHocPatchingAlg") - LArRampAdHocPatchingAlg.ContainerKey = KeyOutput - - if ( 'ChannelsToBePatchedHG' in dir() and 'PatchesToBeAppliedHG' in dir() ): - if ( len(ChannelsToBePatchedHG) and len(ChannelsToBePatchedHG)==len(PatchesToBeAppliedHG) ): - LArRampAdHocPatchingAlg.ChannelsToBePatchedHG = ChannelsToBePatchedHG - LArRampAdHocPatchingAlg.PatchesToBeAppliedHG = PatchesToBeAppliedHG - if 'ValuesToBePatchedHG' in dir(): - LArRampAdHocPatchingAlg.ValuesToBeAppliedHG = ValuesToBePatchedHG - - if ( 'ChannelsToBePatchedMG' in dir() and 'PatchesToBeAppliedMG' in dir() ): - if ( len(ChannelsToBePatchedMG) and len(ChannelsToBePatchedMG)==len(PatchesToBeAppliedMG) ): - LArRampAdHocPatchingAlg.ChannelsToBePatchedMG = ChannelsToBePatchedMG - LArRampAdHocPatchingAlg.PatchesToBeAppliedMG = PatchesToBeAppliedMG - if 'ValuesToBePatchedMG' in dir(): - LArRampAdHocPatchingAlg.ValuesToBeAppliedMG = ValuesToBePatchedMG - - if ( 'ChannelsToBePatchedLG' in dir() and 'PatchesToBeAppliedLG' in dir() ): - if ( len(ChannelsToBePatchedLG) and len(ChannelsToBePatchedLG)==len(PatchesToBeAppliedLG) ): - LArRampAdHocPatchingAlg.ChannelsToBePatchedLG = ChannelsToBePatchedLG - LArRampAdHocPatchingAlg.PatchesToBeAppliedLG = PatchesToBeAppliedLG - if 'ValuesToBePatchedLG' in dir(): - LArRampAdHocPatchingAlg.ValuesToBeAppliedLG = ValuesToBePatchedLG - - topSequence+=LArRampAdHocPatchingAlg - -###################################################################### -# # -# Output # -# # -###################################################################### - -if ( doLArCalibDataQuality ) : - from LArCalibDataQuality.LArCalibDataQualityConf import LArRampValidationAlg - from LArCalibDataQuality.Thresholds import rampThr, rampThrFEB - theRampValidationAlg=LArRampValidationAlg("RampVal") - theRampValidationAlg.RampTolerance=rampThr - theRampValidationAlg.RampToleranceFEB=rampThrFEB - theRampValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theRampValidationAlg.KeyList=GainList - if not SuperCells: - theRampValidationAlg.PatchMissingFEBs=True - else: - theRampValidationAlg.PatchMissingFEBs=False - theRampValidationAlg.CablingKey="LArOnOffIdMapSC" - theRampValidationAlg.CalibLineKey="LArCalibIdMapSC" - theRampValidationAlg.UseCorrChannels=False - theRampValidationAlg.ValidationKey="LArRamp" - theRampValidationAlg.ReferenceKey="LArRampRef" - - theRampValidationAlg.OutputLevel=INFO - theRampValidationAlg.MsgLevelForDeviations=WARNING - theRampValidationAlg.ListOfDevFEBs="rampFebs.txt" - - ##in case of CalibBoard patching, please uncomment: - ## adding new patching - if len(patchCalibs) > 1: - theRampValidationAlg.PatchCBs=patchCalibs - - topSequence+=theRampValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadRamp=LArRampValidationAlg("RampFail") - theBadRamp.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadRamp.RampTolerance=["0.05,0.05,0.05"] - theBadRamp.RampToleranceFEB=["0.05,0.05,0.05"] - theBadRamp.KeyList=GainList - theBadRamp.ValidationKey="LArRamp" - theBadRamp.ReferenceKey="LArRampRef" - theBadRamp.MsgLevelForDeviations=ERROR - theBadRamp.ListOfDevFEBs="Bad_rampFebs.txt" - theRampValidationAlg.PatchMissingFEBs=False - topSequence+=theBadRamp - - -if ( doMonitoring ) : - - from AthenaMonitoring.DQMonFlags import DQMonFlags - DQMonFlags.enableLumiAccess.set_Value_and_Lock(False) - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputRampRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputRampRootFileDir+ "/" +RootHistOutputFileName) - ServiceMgr += THistSvc() - - #ServiceMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputRampRootFileDir+ "/" +RootHistOutputFileName+"' OPT='NEW'"] - -if WriteNtuple or doMonitoring: - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputRampRootFileDir+"/"+OutputRampRootFileName): - os.remove(OutputRampRootFileDir+"/"+OutputRampRootFileName) - ServiceMgr += NTupleSvc() - ServiceMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRampRootFileDir+"/"+OutputRampRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ): - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputRampPoolFileDir+"/"+OutputRampPoolFileName): - os.remove(OutputRampPoolFileDir+"/"+OutputRampPoolFileName) - theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputRampPoolFileDir+"/"+OutputRampPoolFileName, - [OutputObjectSpecRamp],[OutputObjectSpecTagRamp],WriteIOV) - theOutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - theOutputConditionsAlg.Run2=IOVEnd - - ServiceMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - ServiceMgr += IOVRegistrationSvc() - ServiceMgr.IOVRegistrationSvc.OutputLevel = INFO - ServiceMgr.IOVRegistrationSvc.RecreateFolders = False - -if (WriteNtuple): - - # Ramp fit ntuple - from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple - LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") - klist=[] - for i in GainList: - klist+=["LArRamp"+i] - if not SuperCells: LArRamps2Ntuple.ContainerKey = klist #Only for raw ramp - if SuperCells: LArRamps2Ntuple.ContainerKey = ["LArRampHIGH"] # Modification to avoid problems in LArRampBuilder - LArRamps2Ntuple.RealGeometry = True - LArRamps2Ntuple.OffId = True - LArRamps2Ntuple.NtupleName = "RAMPS" - LArRamps2Ntuple.RawRamp = SaveRawRamp - LArRamps2Ntuple.SaveAllSamples = SaveAllSamples - LArRamps2Ntuple.ApplyCorr = ApplyCorr - LArRamps2Ntuple.AddFEBTempInfo = False - LArRamps2Ntuple.isSC = SuperCells - if SuperCells: - LArRamps2Ntuple.CalibMapKey = "LArCalibIdMapSC" - from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg - condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg") - LArRamps2Ntuple.ExtraInputs.add(('CaloSuperCellDetDescrManager', 'ConditionStore+CaloSuperCellDetDescrManager')) - - topSequence+= LArRamps2Ntuple - - if ( SaveAverages ): - # Ramp points ntuple(s) - from LArCalibTools.LArCalibToolsConf import LArAverages2Ntuple - - if not SuperCells: - for g in GainList: - LArAverages2NtupleMR=LArAverages2Ntuple("LArAverages2Ntuple"+g) - LArAverages2NtupleMR.ContainerKey = g - topSequence+= LArAverages2NtupleMR - - if SuperCells: - LArAverages2NtupleSC=LArAverages2Ntuple("LArAverages2NtupleSC") - LArAverages2NtupleSC.ContainerKey = "SC" - LArAverages2Ntuple.OffId = True - LArAverages2NtupleSC.RealGeometry = True - #LArAverages2NtupleSC.NSamples = 50 - LArAverages2NtupleSC.isSC = SuperCells - topSequence+= LArAverages2NtupleSC - -########################################################################### - -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 10000 -ServiceMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -ServiceMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py deleted file mode 100644 index d0d59f4eae94d26a024ba8b19dca39d665b70452..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py +++ /dev/null @@ -1,839 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <pavol@mail.cern.ch> -# -# jobOptions to reconstruction one or more ramp run from data per calibration line -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'SubDet' in dir(): - SubDet = "EndCap" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0018660' ] - -if not 'AllWavesPerCh' in dir(): - AllWavesPerCh = True - -if not 'MaxCalLinePerCh' in dir(): - MaxCalLinePerCh = 4 - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Ramp" - else : - FilePrefix = "data*" - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008/"+RunNumberList[0] - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -if not 'FullFileName' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - Trigger = "calibration_LArElec-Ramp"+".*"+Partition - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'ChannelSelection' in dir(): - ## to read all - ChannelSelection = " " - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - #ChannelSelection = "<channelSelection>0,0:1000</channelSelection>" - -if not 'runAccumulator' in dir(): - runAccumulator = False # averaged mode - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -####################################################### -# Monitoring properties -####################################################### - -if not 'doMonitoring' in dir(): - doMonitoring = False - -if not 'doLArCalibDataQuality' in dir(): - doLArCalibDataQuality = False - -if not 'online' in dir(): - online = False - -####################################################### -# Ramp properties # -####################################################### - -if not 'isHEC' in dir(): - isHEC= True - -if not 'HECKey' in dir(): - HECKey="LArHEC_PAmap" - -if not 'PeakOF' in dir(): - PeakOF = True # OF reconstruction - -if not 'CorrectBias' in dir(): - CorrectBias = False # Set whether to correct for bias - if True, will look for peds from COOL - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = False # Xtalk correction for strips - -if not "ADCSaturation" in dir(): - ADCsaturation = 4095 # Set to 0 if you want to keep saturating pulses - -if not 'KeyOutput' in dir(): - KeyOutput = "LArRamp" # Key of LArRampComplete object in DetStore - -if AllWavesPerCh and (not 'KeyOutputSplitted' in dir() ): - KeyOutputSplitted = [] - for i in range(0, MaxCalLinePerCh): - KeyOutputSplitted.append(KeyOutput+str(i+1)) - -if not 'SaveRawRamp' in dir(): - SaveRawRamp = True - -if not 'SaveAverages' in dir(): - SaveAverages = False # Add averages to ROOT file - -if not 'CorrectBadChannels' in dir(): - CorrectBadChannels=False - -####################################################### -# Ramp output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumberList[0]) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "COOLOFL_LAR/CONDBR2" - -## HEC map -if not 'ReadHECMapFromCOOL' in dir(): - ReadHECMapFromCOOL = True - -if not 'InputHECMapPoolFileDir' in dir(): - InputHECMapPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputHECMapPoolFileName' in dir(): - InputHECMapPoolFileName = "LArHECMap.pool.root" - -## Pedestal -if not 'ReadPedFromCOOL' in dir(): - ReadPedFromCOOL = True - -#if not 'PedLArCalibFolderTag' in dir(): -# PedLArCalibFolderTag = LArCalib_Flags.tagSuffix - -if not 'PedRunNumber' in dir(): - PedRunNumber = "1005020_1005021_1005022" - -if not 'InputPedPoolFileDir' in dir(): - InputPedPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputPedPoolFileName' in dir(): - InputPedPoolFileName = "LArPedestal_" + str(PedRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - -## OFC Cali -if not 'ReadOFCFromCOOL' in dir(): - ReadOFCFromCOOL = True - -#if not 'OFCLArCalibFolderTag' in dir(): -# OFCLArCalibFolderTag = LArCalib_Flags.tagSuffix - -if not 'OFCRunNumber' in dir(): - OFCRunNumber = "30950" - -if not 'InputOFCPoolFileDir' in dir(): - InputOFCPoolFileDir = subprocess.getoutput("pwd") - -if not 'InputOFCPoolFileName' in dir(): - if PeakOF : - InputOFCPoolFileName = "LArOFCCali_" + str(PedRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - if ( PeakOF and StripsXtalkCorr ) : - InputOFCPoolFileName = "LArOFCCali_StripsXtalkCorr_" + str(OFCRunNumber) +"_"+Partition.replace("*","")+ ".pool.root" - -## Output -if not 'LArCalibFolderOutputTag' in dir(): - rs=FolderTagResover() - LArCalibFolderOutputTag = rs.getFolderTagSuffix(LArCalib_Flags.LArRampFolder) - -if not 'OutputRampRootFileDir' in dir(): - OutputRampRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputRampPoolFileDir' in dir(): - OutputRampPoolFileDir = subprocess.getoutput("pwd") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -if not 'BaseFileName' in dir(): - BaseFileName = "LArRamp" - - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - - if StripsXtalkCorr: - BaseFileName += "_StripsXtalkCorr" - if PeakOF: - BaseFileName += "_OFC" - -if not 'OutputRampRootFileName' in dir(): - OutputRampRootFileName = BaseFileName+".root" - -if not 'OutputRampPoolFileName' in dir(): - OutputRampPoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecRamp' in dir(): - if ( AllWavesPerCh ) : - OutputObjectSpecRamp = [] - OutputObjectSpecRamp.append("LArRampComplete#"+KeyOutputSplitted[i]+"#"+LArCalib_Flags.LArRampFolder) - else: - OutputObjectSpecRamp = ["LArRampComplete#"+KeyOutput+"#"+LArCalib_Flags.LArRampFolder] - OutputObjectSpecTagRamp = LArCalibFolderTag(LArCalib_Flags.LArRampFolder,LArCalibFolderOutputTag) - -if ( ReadPedFromCOOL ): - if 'InputPedSQLiteFile' in dir(): - InputDBConnectionPed = DBConnectionFile(InputPedSQLiteFile) - else: - InputDBConnectionPed = DBConnectionCOOL - -if ( PeakOF and ReadOFCFromCOOL ): - if 'InputOFCSQLiteFile' in dir(): - InputDBConnectionOFC = DBConnectionFile(InputOFCSQLiteFile) - else: - InputDBConnectionOFC = DBConnectionCOOL - -if ( ReadHECMapFromCOOL ): - if 'InputHECMapSQLiteFile' in dir(): - InputDBConnectionHECMap = DBConnectionFile(InputHECMapSQLiteFile) - else: - InputDBConnectionHECMap = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;user=ATLAS_COOL_READER" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -####################################################################################### -# print summary # -####################################################################################### - -RampLog = logging.getLogger( "RampLog" ) -RampLog.info( " ======================================================== " ) -RampLog.info( " *** LAr Ramp summary *** " ) -RampLog.info( " ======================================================== " ) -RampLog.info( " RunNumber = "+str(RunNumberList) ) -RampLog.info( " SubDetector = "+SubDet ) -RampLog.info( " Partition = "+Partition ) -RampLog.info( " Type = Ramp " ) -for i in range(len(FullFileName)): - RampLog.info( " FullFileName = "+FullFileName[i] ) -if ( ReadPedFromCOOL ): - RampLog.info( " InputDBConnectionPed = "+InputDBConnectionPed ) -else : - RampLog.info( " InputPedPoolFileName = "+InputPedPoolFileName ) -if 'PedLArCalibFolderTag' in dir() : - RampLog.info( " PedLArCalibFolderTag = "+PedLArCalibFolderTag ) -if ( PeakOF and ReadOFCFromCOOL ): - RampLog.info( " InputDBConnectionOFC = "+InputDBConnectionOFC ) -elif ( PeakOF) : - RampLog.info( " InputOFCPoolFileName = "+InputOFCPoolFileName ) -if 'OFCLArCalibFolderTag' in dir() : - RampLog.info( " OFCLArCalibFolderTag = "+OFCLArCalibFolderTag ) -RampLog.info( " OutputRampRootFullFileName = "+OutputRampRootFileDir+"/"+OutputRampRootFileName ) -RampLog.info( " OutputRampPoolFullFileName = "+OutputRampPoolFileDir+"/"+OutputRampPoolFileName ) -#RampLog.info( " OutputObjectSpecRamp = "+OutputObjectSpecRamp ) -RampLog.info( " OutputObjectSpecTagRamp = "+OutputObjectSpecTagRamp ) -RampLog.info( " IOVBegin = "+str(IOVBegin) ) -RampLog.info( " IOVEnd = "+str(IOVEnd) ) -RampLog.info( " LArCalibOutputDB = "+OutputDB ) -RampLog.info( " ======================================================== " ) -####################################################################################### - -include ("LArConditionsCommon/LArMinimalSetup.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - svcMgr.EventSelector.Input=FullFileName - -scvMgr.EventSelector.MaxBadEvents = 0 - -############################################################################################## -# # -# FullFileName is already the list of files compute by the fonction GetInputFilesFromTokens # -# # -# maybe useful one day # -# # -#else # -# svcMgr.EventSelector.Input=OneFileName # -# for i in range(len(svcMgr.EventSelector.Input)): # -# theByteStreamInputSvc.NumFile+=[10000] # -############################################################################################## - -############################################################### -# # -# To read BS for one or more FT # -# # -############################################################### - -## For splitting the delay runs, there are three new jobOptions. -## All three are vectors of integers -################################################################# - -from LArByteStream.LArByteStreamConf import LArRodDecoder -svcMgr.ToolSvc += LArRodDecoder() - -#ToolSvc.LArRodDecoder.BEPreselection = [0] ## : [Barrel=0,Endcap=1] -#ToolSvc.LArRodDecoder.PosNegPreselection = [1] ## : [C-side (negative eta)=0, A-side (positive eta)=1] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ## : first half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] ## : second half of [EM barrel feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [0,1,4,7,8,11,12,13,14,17,18,19,20,23,24] ## : [EMEC Standard feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [2,9,15,21] ## : [EMEC Special feedthrough numbers] -#ToolSvc.LArRodDecoder.FTNumPreselection = [3,10,16,22] ## : [HEC feedthrough numbers] (note: slots 1&2 are EMEC slots) -#ToolSvc.LArRodDecoder.FTNumPreselection = [6] ## : [FCAL feedthrough number] - - - -########################################################################### -# # -# Accumulator # -# # -########################################################################### - -if ( runAccumulator ) : - # this is a OLD jobOptions which can maybe work but only for the barrel # - # can be used as a skeleton if needed but # - # need to be updated for the barrel and the patterns for EMEC, HEC and FCAL need to be added # - include("LArCalibProcessing/LArCalib_CalibrationPatterns.py") - -else : - theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - -## This algorithm verifies that no FEBs are dropping out of the run -## If it finds corrupt events, it breaks the event loop and terminates the job rapidly -include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") -#from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher -#theLArBadEventCatcher=LArBadEventCatcher() -#theLArBadEventCatcher.CheckAccCalibDigitCont=True -#theLArBadEventCatcher.CheckBSErrors=True -#theLArBadEventCatcher.KeyList=GainList -#theLArBadEventCatcher.StopOnError=False -#topSequence+=theLArBadEventCatcher - -########################################################################## -# # -# Ramp run reconstruction # -# # -########################################################################## - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - RampLog.info( "Read Bad Channels from Oracle DB") -else : - RampLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond09_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - -if ( doLArCalibDataQuality ) : - ## The reference is the Oracle DB - conddb.addFolder("",LArCalib_Flags.LArRampFolder+"<key>LArRampRef</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - -#if (CorrectBadChannels or StripsXtalkCorr): -# conddb.addFolder("LAR","/LAR/BadChannels/BadChannels") -# conddb.addFolder("LAR","/LAR/BadChannels/MissingFEBs") - -if (isHEC): - if ( ReadHECMapFromCOOL ): - if not 'InputHECMapSQLiteFile' in dir(): - svcMgr.PoolSvc.ReadCatalog += [ "prfile:poolcond/PoolCat_comcond_castor.xml", "prfile:poolcond/PoolCat_comcond.xml" ] - RampLog.info( "Read HECMap from Oracle DB" ) - else : - RampLog.info( "Read HEC map from SQLite file" ) - - if ( ReadHECMapFromCOOL ): - HECMapFolder = "/LAR/ElecCalibOfl/HecPAMap" - if "HECMapTagSpec" in dir(): - conddb.addFolder("",HECMapFolder+"<tag>"+HECMapTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionHECMap+"</dbConnection>") - else : - conddb.addFolder("",HECMapFolder+"<dbConnection>"+InputDBConnectionHECMap+"</dbConnection>") - - else: - if 'InputHECMapPoolFileName' in dir(): - RampLog.info( "Read HECMap form POOL file" ) - PoolFileList += [ InputHECMapPoolFileDir +"/"+ InputHECMapPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing HECMap or read from COOL." ) - theApp.exit(-1) - -if (CorrectBias or PeakOF or StripsXtalkCorr): - if ( ReadPedFromCOOL or ReadOFCFromCOOL ): - if not 'InputPedSQLiteFile' in dir(): - svcMgr.PoolSvc.ReadCatalog += [ "prfile:poolcond/PoolCat_comcond_castor.xml", "prfile:poolcond/PoolCat_comcond.xml" ] - RampLog.info( "Read Pedestal from Oracle DB" ) - else : - RampLog.info( "Read Pedestal from SQLite file" ) - - if not 'InputOFCSQLiteFile' in dir(): - svcMgr.PoolSvc.ReadCatalog += [ "prfile:poolcond/PoolCat_comcond_castor.xml", "prfile:poolcond/PoolCat_comcond.xml" ] - RampLog.info( "Read OFC Cali from Oracle DB" ) - else : - RampLog.info( "Read OFC Cali from SQLite file" ) - -if ( ReadPedFromCOOL ): - if (CorrectBias or StripsXtalkCorr or PeakOF): - PedestalFolder = LArCalib_Flags.LArPedestalFolder - if 'PedLArCalibFolderTag' in dir() : - PedestalTagSpec = LArCalibFolderTag(PedestalFolder,PedLArCalibFolderTag) - conddb.addFolder("",PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - else : - conddb.addFolder("",PedestalFolder+"<dbConnection>"+InputDBConnectionPed+"</dbConnection>"+ChannelSelection) - -else: - if 'InputPedPoolFileName' in dir(): - RampLog.info( "Read Pedestal from POOL file" ) - PoolFileList += [ InputPedPoolFileDir +"/"+ InputPedPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing Pedestal or read from COOL." ) - theApp.exit(-1) - - -if ( ReadOFCFromCOOL ): - if PeakOF: - if ( not StripsXtalkCorr ): - CaliOFCFolder = LArCalib_Flags.LArOFCCaliFolder - else: - CaliOFCFolder = LArCalib_Flags.LArOFCCaliFolderXtlk - if 'OFCLArCalibFolderTag' in dir() : - if AllWavesPerCh: - for i in range(0, MaxCalLinePerCh): - CaliOFCTagSpec = LArCalibFolderTag(CaliOFCFolder+str(i),OFCLArCalibFolderTag) - conddb.addFolder("",CaliOFCFolder+str(i)+"<tag>"+CaliOFCTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ChannelSelection) - else: - CaliOFCTagSpec = LArCalibFolderTag(CaliOFCFolder,OFCLArCalibFolderTag) - conddb.addFolder("",CaliOFCFolder+"<tag>"+CaliOFCTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ChannelSelection) - else : - conddb.addFolder("",CaliOFCFolder+"<dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ChannelSelection) - -else: - if 'InputOFCPoolFileName' in dir(): - RampLog.info( "Read OFC Cali form POOL file" ) - PoolFileList += [ InputOFCPoolFileDir +"/"+ InputOFCPoolFileName ] - else: - RampLog.info( "No PoolFileList found! Please list the POOL files containing OFC or read from COOL." ) - theApp.exit(-1) - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -if ( StripsXtalkCorr ) : - from LArCalibUtils.LArCalibUtilsConf import LArStripsCrossTalkCorrector - theLArStripsCrossTalkCorrector = LArStripsCrossTalkCorrector() - theLArStripsCrossTalkCorrector.KeyList = GainList - theLArStripsCrossTalkCorrector.ADCsaturation = ADCsaturation - theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"] - theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine"] - ) - theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent - topSequence +=theLArStripsCrossTalkCorrector - - -from LArCalibUtils.LArCalibUtilsConf import LArRampBuilder -#Bad-channel mask used by the LArRampBuilder and the Ramp-patcher - -if not PeakOF: - from LArRecUtils.LArRecUtilsConf import LArParabolaPeakRecoTool - theLArParabolaPeakRecoTool=LArParabolaPeakRecoTool() - theLArParabolaPeakRecoTool.correctBias = CorrectBias - ToolSvc+=theLArParabolaPeakRecoTool - -if ( AllWavesPerCh ) : - ContNameSplitted = [] - for i in range(0, MaxCalLinePerCh): - ContNameSplitted.append("CalLine"+str(i)) - from LArCalibUtils.LArCalibUtilsConf import LArAccumulatedCalibDigitContSplitter - LArAccCaDigContSplitter = [] - for j in range(0,len(GainList)): - ThisKeyOut = [] - for i in range(0, MaxCalLinePerCh): - ThisKeyOut.append(ContNameSplitted[i]+GainList[j]) - topSequence+=LArAccumulatedCalibDigitContSplitter("Splitter"+GainList[j]) - exec 'LArAccCaDigContSplitter.append( topSequence.Splitter%(fn)s )' % {'fn' : GainList[j]} - LArAccCaDigContSplitter[j].KeyList = [ GainList[j] ] - LArAccCaDigContSplitter[j].KeyOutputList = ThisKeyOut - LArAccCaDigContSplitter[j].NumberSplitted = MaxCalLinePerCh - LArAccCaDigContSplitter[j].OutputLevel = ERROR - - theLArRampBuilder = [] - for i in range(0, MaxCalLinePerCh): - ThisKeyList = [] - for j in range(0,len(GainList)): - ThisKeyList.append(ContNameSplitted[i]+GainList[j]) - - topSequence+=LArRampBuilder("LArRampBuilder"+str(i+1)) - exec 'theLArRampBuilder.append( topSequence.LArRampBuilder%(fn)s )' % {'fn' :i+1} - theLArRampBuilder[i].KeyList = ThisKeyList - theLArRampBuilder[i].SubtractDac0 = False - theLArRampBuilder[i].DAC0 = -1 - theLArRampBuilder[i].StoreRawRamp = SaveRawRamp - theLArRampBuilder[i].StoreRecRamp = True - theLArRampBuilder[i].Polynom = 1 - theLArRampBuilder[i].isHEC = isHEC - theLArRampBuilder[i].HECKey = HECKey - if ( PeakOF) : - theLArRampBuilder[i].RecoType = "OF" - from LArRecUtils.LArRecUtilsConf import LArOFPeakRecoTool - exec 'theLArOFPeakRecoTool%(fn)s=LArOFPeakRecoTool("LArOFPeakRecoTool%(fg)s")' % {'fn' :i+1, 'fg' : i+1} - exec 'svcMgr.ToolSvc+=theLArOFPeakRecoTool%(fn)s' % {'fn' :i+1} - theLArRampBuilder[i].PeakOFTool = "LArOFPeakRecoTool/LArOFPeakRecoTool"+str(i+1) - exec 'svcMgr.ToolSvc.LArOFPeakRecoTool%(fn)s.KeyShape="" ' % {'fn' :i+1} # Don't use shape here - exec 'svcMgr.ToolSvc.LArOFPeakRecoTool%(fn)s.KeyOFC="LArOFC%(fn)s" ' % {'fn' :i+1} -# exec 'svcMgr.ToolSvc.LArOFPeakRecoTool%(fn)s.Iterate=IterateOFC ' % {'fn' :i+1} - exec 'svcMgr.ToolSvc.LArOFPeakRecoTool%(fn)s.OutputLevel = WARNING ' % {'fn' :i+1} - else : - theLArRampBuilder[i].RecoType = "Parabola" - - theLArRampBuilder[i].RampRange = 3600 # Check on the raw data ADC sample before ped subtraction - # and pulse reconstruction to include point in fit - theLArRampBuilder[i].correctBias = CorrectBias - theLArRampBuilder[i].ConsecutiveADCs = 0; -# theLArRampBuilder[i].Iterate=IterateOFC - theLArRampBuilder[i].minDAC = 10 # minimum DAC value to use in fit - theLArRampBuilder[i].KeyOutput = KeyOutputSplitted[i] - theLArRampBuilder[i].ProblemsToMask=["deadCalib","deadReadout","deadPhys","almostDead","short"] - theLArRampBuilder[i].DeadChannelCut = -9999 - theLArRampBuilder[i].GroupingType = "ExtendedSubDetector" - theLArRampBuilder[i].OutputLevel = ERROR - -else: - - theLArRampBuilder = LArRampBuilder() - theLArRampBuilder.KeyList = GainList - theLArRampBuilder.SubtractDac0 = False - - if ( PeakOF ): - theLArRampBuilder.RecoType = "OF" - from LArRecUtils.LArRecUtilsConf import LArOFPeakRecoTool - theLArOFPeakRecoTool=LArOFPeakRecoTool() - theLArOFPeakRecoTool.UseShape = False - ToolSvc+=theLArOFPeakRecoTool - else : - theLArRampBuilder.RecoType = "Parabola" - - # As the first ramp point no longer is taken at DAC=0 - # this point should not have a special place. - theLArRampBuilder.DAC0 = -1 - theLArRampBuilder.StoreRawRamp = SaveRawRamp - theLArRampBuilder.StoreRecRamp = True - theLArRampBuilder.Polynom = 1 - theLArRampBuilder.RampRange = 3600 # Check on the raw data ADC sample before ped subtraction - # and pulse reconstruction to include point in fit - theLArRampBuilder.correctBias = CorrectBias - theLArRampBuilder.ConsecutiveADCs = 0; - theLArRampBuilder.minDAC = 10 # minimum DAC value to use in fit - theLArRampBuilder.KeyOutput = KeyOutput - theLArRampBuilder.ProblemsToMask=["deadCalib","deadReadout","deadPhys","almostDead","short"] - theLArRampBuilder.DeadChannelCut = -9999 - theLArRampBuilder.GroupingType = GroupingType - - if ( isHEC ) : - theLArRampBuilder.isHEC = isHEC - theLArRampBuilder.HECKey = HECKey - - topSequence+=theLArRampBuilder - - -###################################################################### -# # -# Correction # -# # -###################################################################### - -if CorrectBadChannels: - from LArCalibUtils.LArCalibUtilsConf import LArCalibPatchingAlg_LArRampComplete_ - theLArRampPatcher=LArCalibPatchingAlg_LArRampComplete_("LArRampPatcher") - theLArRampPatcher.ContainerKey=KeyOutput - theLArRampPatcher.PatchMethod="PhiAverage" - - theLArRampPatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"] - topSequence+=theLArRampPatcher - - - -###################################################################### -# # -# Output # -# # -###################################################################### - -if ( doLArCalibDataQuality ) : - - from LArCalibDataQuality.LArCalibDataQualityConf import LArRampValidationAlg - theRampValidationAlg=LArRampValidationAlg() - theRampValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theRampValidationAlg.KeyList=GainList - theRampValidationAlg.ValidationKey="LArRamp" - theRampValidationAlg.ReferenceKey="LArRampRef" - theRampValidationAlg.MsgLevelForDeviations=INFO - theRampValidationAlg.ListOfDevFEBs="rampFebs.txt" - topSequence+=theRampValidationAlg - - ## second instance of the validation tool to detect "bad" channel - theBadRamp=LArRampValidationAlg("theBadRamp") - theBadRamp.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG"] - theBadRamp.KeyList=GainList - theBadRamp.ValidationKey="LArRamp" - theBadRamp.ReferenceKey="LArRampRef" - theBadRamp.MsgLevelForDeviations=INFO - theBadRamp.ListOfDevFEBs="Bad_rampFebs.txt" - topSequence+=theBadRamp - - -if ( doMonitoring ) : - - from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager - topSequence += AthenaMonManager( "LArMon" ) - LArMon = topSequence.LArMon - - ## old style - #LArMon.FileKey = "AllMon" - #LArMon.ManualDataTypeSetup = True - #LArMon.Environment = "user" - #LArMon.ManualRunLBSetup = True - #LArMon.Run = 1 - #LArMon.LumiBlock = 1 - #LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - ## tier0 style - LArMon.FileKey = "GLOBAL" - LArMon.ManualDataTypeSetup = True - LArMon.Environment = "tier0" - LArMon.ManualRunLBSetup = True - LArMon.Run = int(RunNumberList[0]) - LArMon.LumiBlock = 1 - LArMon.CheckEveryNoEvents = 999999 #to do the check only at the end of the run - - include("LArMonTools/LArFEBMon_jobOptions.py") - - RootHistOutputFileName='RootHistos_'+BaseFileName+".root" - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(OutputRampRootFileDir+ "/" +RootHistOutputFileName): - os.remove(OutputRampRootFileDir+ "/" +RootHistOutputFileName) - svcMgr += THistSvc() - #svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+OutputRampRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - - svcMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputRampRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"] - -if (WriteNtuple): - - # Ramp fit ntuple - from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple - AllGainList = ["HIGH","MEDIUM","LOW"] - if ( AllWavesPerCh ) : - LArRamps2NtupleVec = [] - for i in range(0, MaxCalLinePerCh): - topSequence+=LArRamps2Ntuple("LArRamps2Ntuple"+str(i+1)) - exec 'LArRamps2NtupleVec.append( topSequence.LArRamps2Ntuple%(fn)s)' % {'fn': i+1} - if SaveRawRamp: - rawkeys = [] - for g in range(0, len(AllGainList)): - rawkeys += [ KeyOutputSplitted[i]+AllGainList[g] ] - LArRamps2NtupleVec[i].ContainerKey = rawkeys - LArRamps2NtupleVec[i].RampKey = KeyOutputSplitted[i] - LArRamps2NtupleVec[i].NtupleName = "RAMPS"+str(i) - LArRamps2NtupleVec[i].RawRamp = SaveRawRamp - LArRamps2NtupleVec[i].AddFEBTempInfo = False - LArRamps2NtupleVec[i].OutputLevel = ERROR - else: - LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") - if SaveRawRamp: - rawkeys = [] - for g in range(0, len(GainList)): - rawkeys += [ KeyOutput+AllGainList[g] ] - LArRamps2Ntuple.ContainerKey = rawkeys #Only for raw ramp - LArRamps2Ntuple.NtupleName = "RAMPS" - LArRamps2Ntuple.RawRamp = SaveRawRamp - LArRamps2Ntuple.AddFEBTempInfo = False - - topSequence+= LArRamps2Ntuple - - if ( SaveAverages ): - # Ramp points ntuple(s) - from LArCalibTools.LArCalibToolsConf import LArAverages2Ntuple - index = 0 - AveragesVec=[] - if ( AllWavesPerCh ) : - for i in range(0, MaxCalLinePerCh): - for j in range(0,len(AllGainList)): - if AllGainList[j] in GainList: - topSequence+=LArAverages2Ntuple("Averages"+str(i+1)+AllGainList[j]) - exec 'AveragesVec.append( topSequence.Averages%(fn)s%(fg)s )' % {'fn': i+1, 'fg':AllGainList[j]} - AveragesVec[index].ContainerKey = ContNameSplitted[i]+AllGainList[j] - index += 1 - if GainList.count("FREE"): - topSequence+=LArAverages2Ntuple("Averages"+str(i+1)) - exec 'AveragesVec.append( topSequence.Averages%(fn)s)' % {'fn': i+1} - AveragesVec[index].ContainerKey = ContNameSplitted[i] - index += 1 - else: - - for j in range(0,len(AllGainList)): - if AllGainList[j] in GainList: - topSequence+=LArAverages2Ntuple("Averages"+AllGainList[j]) - exec 'AveragesVec.append( topSequence.Averages%(fg)s )' % {'fg':AllGainList[j]} - AveragesVec[index].ContainerKey = AllGainList[j] - index += 1 - if GainList.count("FREE"): - topSequence+=LArAverages2Ntuple("Averages") - exec 'AveragesVec.append( topSequence.Averages)' - AveragesVec[index].ContainerKey = KeyOutput - index += 1 - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputRampRootFileDir+"/"+OutputRampRootFileName): - os.remove(OutputRampRootFileDir+"/"+OutputRampRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRampRootFileDir+"/"+OutputRampRootFileName+"' OPT='NEW'" ] - -if ( WritePoolFile ): - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputRampPoolFileDir+"/"+OutputRampPoolFileName): - os.remove(OutputRampPoolFileDir+"/"+OutputRampPoolFileName) - theOutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg",OutputRampPoolFileDir+"/"+OutputRampPoolFileName, - [OutputObjectSpecRamp],[OutputObjectSpecTagRamp],WriteIOV) - theOutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - theOutputConditionsAlg.Run2=IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = WARNING) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py deleted file mode 100644 index 183a56d3f3f334a28ff61c1e80cbc67b8d91bc88..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py +++ /dev/null @@ -1,29 +0,0 @@ -## second instance of the validation tools to detect "bad" channels -theBadRamp.OutputLevel = INFO -theBadRamp.ListOfDevFEBs='BadRampFebs.txt' -theBadRamp.MsgLevelForDeviations=ERROR -theBadRamp.RampTolerance=["0.1,0.1,0.1"] -theBadRamp.RampToleranceFEB=["0.1,0.1,0.1"] -theBadRamp.RawRampTimeTolerance=20. -theBadRamp.UseCorrChannels=False - - - -## first instance of the validation tools to detect "deviated" channels -theRampValidationAlg.OutputLevel = INFO -theRampValidationAlg.PatchMissingFEBs=True -theRampValidationAlg.ListOfDevFEBs='RampFebs.txt' -theRampValidationAlg.MsgLevelForDeviations=ERROR -theRampValidationAlg.RampTolerance=["0.1,0.1,0.1"] -theRampValidationAlg.RampToleranceFEB=["0.1,0.1,0.1"] -theRampValidationAlg.RawRampTimeTolerance=20. -theRampValidationAlg.UseCorrChannels=False - -theLArRampPatcher.OutputLevel = INFO - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 9999999 # all messages - -conddb.addOverride("/LAR/Align","LARAlign-UPD4-00") -conddb.addOverride("/LAR/LArCellPositionShift","LArCellPositionShift-ideal") -print(svcMgr.IOVDbSvc.Folders) diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArHVCool2Ntuple_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArHVCool2Ntuple_jobOptions.py deleted file mode 100755 index c50b5367f3230c376cf35707c7bd1c081afb5dcf..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArHVCool2Ntuple_jobOptions.py +++ /dev/null @@ -1,81 +0,0 @@ -############################################################## -# Job options read a LArRampComplete object from a POOL file # -# and dump it to an ROOT ntuple # -############################################################## - -from time import strptime,time -from calendar import timegm - - -if "date" not in dir(): - date="2015-02-06:09:45:00" - -if "TimeStamp" not in dir(): - try: - ts=strptime(date+'/UTC','%Y-%m-%d:%H:%M:%S/%Z') - TimeStamp=int(timegm(ts))*1000000000 - except ValueError: - printfunc ("ERROR in time specification, use e.g. 2007-05-25:14:01:00") - - -from LArCalibProcessing.TimeStampToRunLumi import TimeStampToRunLumi - -rlb=TimeStampToRunLumi(TimeStamp) -if rlb is None: - printfunc ("WARNING: Failed to convert time",TimeStamp,"into a run/lumi number") - myRunNumber=999999 - myLumiBlock=0 -else: - myRunNumber=rlb[0] - myLumiBlock=rlb[1] - -if "RunNumber" in dir(): - myRunNumber=RunNumber - myLumiBlock=0 - -printfunc ("Working on run",myRunNumber,"LB",myLumiBlock,"Timestamp:",TimeStamp) - -if "GlobalTag" not in dir(): - GlobalTag = 'CONDBR2-BLKPA-2015-05' - -from AthenaCommon.DetFlags import DetFlags -DetFlags.all_setOff() -DetFlags.em_setOn() - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -# the Tile, LAr and Calo detector description package -DetDescrVersion = "ATLAS-R2-2015-03-01-00" - -online = True -include ("LArConditionsCommon/LArMinimalSetup.py") - -svcMgr.EventSelector.RunNumber=myRunNumber -svcMgr.EventSelector.EventsPerRun=1 -svcMgr.EventSelector.FirstEvent=1 - -svcMgr.IOVDbSvc.GlobalTag = GlobalTag - -#from LArConditionsCommon.LArCondFlags import larCondFlags -#larCondFlags.SingleVersion = False -include ("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from LArCalibTools.LArCalibToolsConf import LArHVScaleCorr2Ntuple -theLArHVScaleCorr2Ntuple = LArHVScaleCorr2Ntuple("LArHVScaleCorr2Ntuple") -theLArHVScaleCorr2Ntuple.AddFEBTempInfo = False -theLArHVScaleCorr2Ntuple.OffId = True -topSequence += theLArHVScaleCorr2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='hvcorr_read.root' OPT='NEW'" ] - -theApp.EvtMax=1 -svcMgr.MessageSvc.OutputLevel=INFO - -#DetStore=Service("DetectorStore"); -#svcMgr.DetStore.Dump=TRUE diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArTimePhysPrediction_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArTimePhysPrediction_jobOptions.py deleted file mode 100755 index 66a0f593550453c42f264b3177b804c9021aa908..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArTimePhysPrediction_jobOptions.py +++ /dev/null @@ -1,206 +0,0 @@ -########################################################################### -# 01/2009 T. Guillemin -# JO for tphys prediction -# uses the algorithm LArTimePhysPrediction in LArCalibUtils -# 11/09 T. Guillemin -# corrections of the special crates fiber lengths -########################################################################### - -from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG - -#Pool file input -# PoolFileList = [ "/tmp/tguillem/LArCaliWave_89206_EB-EMBC_StripsXtalkCorr.pool.root"] -PoolFileList = [ "/afs/cern.ch/user/l/larcalib/w0/data/WorkingDirectory/00135322_00135323_00135326_Barrel-EMB-EMEC_MEDIUM_26_15.5.1_2/poolFiles/LArCaliWave_00135323_EB-EMBA_StripsXtalkCorr.pool.root"] - -########################################################################### -# -# Global settings -# -########################################################################### - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -# include modified version of LArCalibProcessing/LArCalib_P3C_MinimalSetup.py -# because of problems with detector flags -# include("LArCalibProcessing/LArCalib_P3C_MinimalSetup.py") - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DetGeo.set_commis() -GlobalFlags.Luminosity.set_zero() -GlobalFlags.DataSource.set_data() -GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() #Switched on for the prediction -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -include( "LArIdCnv/LArIdCnv_joboptions.py" ) - -# end of modified version of LArCalibProcessing/LArCalib_P3C_MinimalSetup.py - -#to read the Calo descriptor -include ("CaloConditions/CaloConditions_jobOptions.py") -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -############################################################################### -# -# Read POOL file(s) -# -############################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -conddb.setGlobalTag('COMCOND-006-00') - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -############################################################################### -# -# Cables/fibers lengths required for the prediction of the physics time -# -############################################################################### -# speed of the signal in the cables -# approximation: same speed in all the cables (neglect the cables resistance influence) -sCalib = 5.5 -sSignal = 5.5 -sPig = 5.5 -sLTP = 5.5 - -########### calibration cables -# all the vacuum cables and the warm cables have ~the same length for all the FTs -# ==> they do not introduce any relative delays (it may have to be taken into account for the FCAL) - -# barrel: divide in 16 bins of 0.1 -LCalib_EMB = [[4.58,4.58,4.62,4.62,4.7,4.7,4.81,4.81,4.94,4.94,5.19,5.19,5.46,5.46,5.62,5.62],[4.38,4.38,4.38,4.38,4.38,4.38,4.38,4.38,4.63,4.63,4.83,4.83,5.13,5.13,5.13,0],[3.03,3.03,3.03,3.03,3.03,3.03,3.03,3.03,3.28,3.28,3.48,3.48,3.78,3.78,0],[5.13,3.03,3.03,3.03,3.03,3.03,3.03,3.03,3.03,3.28,3.28,3.48,3.48,3.78,3.78,0,0]] -EtaMin_EMB = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5] -EtaMax_EMB = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6] -LPigCalib_EMB = 0.7 - -# EMEC -# only one length of calibration cables is used on the detector -LCalib_EMEC = 4.90 -LPigCalib_EMEC = 0.9 -# HEC -LCalib_HEC = 13.0 -# FCAL: signal injected at the FEB level => no calibration cables - -########### signal cables (only important for the FCAL) -#EMB -LSignal_EMB = [[3.35,3.35,3.06,3.06,2.75,2.75,2.41,2.41,2.03,2.03,1.58,1.58,1.06,1.06,0.58,0.58],[3.56,3.56,3.31,3.31,2.96,2.96,2.82,2.82,2.45,2.45,2.01,2.01,1.53,1.53,1.37],[3.03,3.03,3.03,3.03,2.31,2.31,2.31,2.31,1.37,1.37,1.37,1.37,0.45,0.45,1.37],[3.68,3.6,3.6,3.6,3.37,2.93,2.43,1.87,2.55,1.88,1.32,0.81,0.93,1.88]] -#EMEC (approximation for first iteration: lengths have to be coded for a dedicated study) -LSignal_EMEC = 4.0 -#HEC (takes pigtail into account) -LSignal_HEC = 13.0 -#FCAL (takes pigtail into account) -LSignal_FCAL = [8.4,7.55,7.4] - -########### TTC fibers -# The values can be found in the note ATL-AL-EN-0077 -# Delays in ns are given with respect to the longest fiber -# barrel: 2 * 32 FTs (0->C,1->A) -DeltaTTC_EMB = [[93.02,92.49,94.1,92.02,93.04,91.84,92.81,91.87,92.98,92.36,93.27,91.96,93.24,92.28,93.56,92.73,94.03,91.01,92.9,92.2,92.89,90.45,91.34,92.37,93.27,91.31,92.5,91.09,92.3,92.25,92.88,91.97],[93.49,91.02,92.6,92.99,94.21,92.36,93.55,91.93,93.24,92.21,92.98,92.95,94.04,92.5,93.44,92.1,93,92.74,93.64,97.16,98.24,90.42,91.96,91.05,92.75,91.89,93.1,92.4,93.09,93.38,94.36,91.97]] - -# end-caps: 2 * 25 FTs (0->C,1->A) -DeltaTTC_EC = [[14.4,14.5,0,0,13.6,15.1,15.4,12.7,14.3,0,0,1.7,2.5,12.7,14.1,0,0,13.4,14.5,11.7,13.1,0,0,12.7,14.3],[13.7,15.1,0,0,13.8,14.7,15.8,13.9,14.9,0,0,4.7,5.7,13.6,14.5,0,0,13.1,13.9,13.9,14.7,0,0,0,1]] -# special crates: 3 fibers per crate -DeltaTTC_ECC_SPEC = [[14.7,15.6,16.7],[13.6,14.9,17.3],[15.9,17.6,18.3],[13.5,14.5,14.5]] -DeltaTTC_ECA_SPEC = [[13.5,14.6,15.9],[13.8,15,18],[13.9,15,15.9],[12.5,14,15]] - -############################################################################### -# -# Algorithms -# -############################################################################### -# make sure that other subdetectors are not built -#from AthenaCommon.GlobalFlags import GlobalFlags -#GlobalFlags.DetGeo.set_atlas() -#GlobalFlags.DataSource.set_geant4() -#GlobalFlags.Luminosity.set_zero() - -DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) - -from LArCalibUtils.LArCalibUtilsConf import LArTimePhysPrediction -LArTimePhysPrediction = LArTimePhysPrediction() -LArTimePhysPrediction.KeyInput = "LArCaliWave" -LArTimePhysPrediction.nchannels_max = 1000000 -topSequence += LArTimePhysPrediction -LArTimePhysPrediction.sCalib = sCalib -LArTimePhysPrediction.sSignal = sSignal -LArTimePhysPrediction.sPig = sPig -LArTimePhysPrediction.sLTP = sLTP -LArTimePhysPrediction.vLCalib_EMB = LCalib_EMB -LArTimePhysPrediction.vEtaMin_EMB = EtaMin_EMB -LArTimePhysPrediction.vEtaMax_EMB = EtaMax_EMB -LArTimePhysPrediction.vLCalib_EMEC = LCalib_EMEC -LArTimePhysPrediction.vLCalib_HEC = LCalib_HEC -LArTimePhysPrediction.vLSignal_EMB = LSignal_EMB -LArTimePhysPrediction.vLSignal_EMEC = LSignal_EMEC -LArTimePhysPrediction.vLSignal_HEC = LSignal_HEC -LArTimePhysPrediction.vLSignal_FCAL = LSignal_FCAL -LArTimePhysPrediction.vDeltaTTC_EMB = DeltaTTC_EMB -LArTimePhysPrediction.vDeltaTTC_EC = DeltaTTC_EC -LArTimePhysPrediction.vDeltaTTC_ECC_SPEC = DeltaTTC_ECC_SPEC -LArTimePhysPrediction.vDeltaTTC_ECA_SPEC = DeltaTTC_ECA_SPEC - -########################################################################### -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = INFO -#MessageSvc.defaultLimit = 1000; -########################################################################### -#save the ntuple -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='Test.ntuple.root' OPT='NEW'" ] -########################################################################### -theApp.EvtMax = 1 # Leave this unchanged! -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LAr_updateHVcalib_online.sh b/LArCalorimeter/LArExample/LArCalibProcessing/share/LAr_updateHVcalib_online.sh index 66c8bf5887415f1bd3c7b390ab220e365068b9a2..65e5de183c0da43c092ef66c3d528b468f34d4f7 100755 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LAr_updateHVcalib_online.sh +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LAr_updateHVcalib_online.sh @@ -94,7 +94,7 @@ echo "Found current global tag $globalTag" echo " " echo "Running athena to read current HV scale factor correction in database for comparison" -python -m LArCalibProcessing.LArCalib_HVScale2NtupleConfig $time > readhv.log 2>&1 +python -m LArCalibTools.LArCalib_HVScale2NtupleConfig $time > readhv.log 2>&1 if [ $? -ne 0 ]; then echo "Athena reported an error ! Please check readhv.log!" exit @@ -282,7 +282,7 @@ AtlCoolCopy "sqlite://;schema=larnoisesqlite.db;dbname=CONDBR2" "sqlite://;schem echo "Doing check of the noise sqlite against P1HLT cache....." echo "Will take 3-5 minutes, be patient......" -(mkdir /tmp/noise_test_$$; cp caloSqlite_UPD1_online.db /tmp/noise_test_$$/; cd /tmp/noise_test_$$/; athena.py --threads=1 -c "sqlite='caloSqlite_UPD1_online.db'" TriggerJobOpts/test_hltConditions.py >/dev/null 2>&1 ) >/dev/null 2>&1 +(mkdir /tmp/noise_test_$$; cp caloSqlite_UPD1_online.db /tmp/noise_test_$$/; cd /tmp/noise_test_$$/; athena.py --CA --evtMax=10 -c "sqlite='caloSqlite_UPD1_online.db'" TriggerJobOpts/test_hltConditions.py >/dev/null 2>&1 ) >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "Testing job reported an error ! " echo "Please, do not upload constants to online ! " @@ -297,5 +297,4 @@ echo " (1) /afs/cern.ch/user/a/atlcond/utils22/AtlCoolMerge.py --online HVScale echo " (2) /afs/cern.ch/user/a/atlcond/utils22/AtlCoolMerge.py --online caloSqlite_UPD1_online.db CONDBR2 ATONR_COOL ATLAS_COOLONL_CALO_W <password>" echo " (3) /afs/cern.ch/user/a/atlcond/utilsflask/AtlCoolMerge.py --flask larnoisesqlite.db CONDBR2 ATONR_COOLOFL_GPN ATLAS_COOLOFL_LAR_W <password>" -echo " (note that password are different for LAr online,offline, Calo online offline databases" -exit + diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/README b/LArCalorimeter/LArExample/LArCalibProcessing/share/README deleted file mode 100644 index 288ad649fe57c44638d0033b844cbc99d185be83..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/README +++ /dev/null @@ -1,26 +0,0 @@ -============================================================================== -LArCalibProcessing jobOptions (last update: 08/05/2008) -============================================================================== - -* 'P3C' jobOptions: - -These are the most up-to-date jobOptions fragments for all the -electronics calibration jobs (the ones you should use!). The -Electronic Calibration developers are taking care to migrate them to -the latest reelase, see the following list for compatibility. - -Please note that all these jobOptions file are NOT supposed to -modified directly: all default settings can be externally set on the -Athena command line, or trough a topOptions file. Examples for the -different jobs are provided, please refer to them for guidelines. - -* 'CTB04' jobOptions: - -These are still here for hystorical reasons, even if they are -certainly outdated and might not run on latest releases. - -* 'Example' jobOptions: - -There are 'uncommon' jobOptions documenting the possibile use cases of -special algorithms. They might well be outdated. - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_AutoCorrPhys_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_AutoCorrPhys_jobOptions.py deleted file mode 100644 index 4d78633374968942fe9d90aa20312eb3119d6ae3..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_AutoCorrPhys_jobOptions.py +++ /dev/null @@ -1,30 +0,0 @@ - -#input bytestream files - -FullFileName = ["rfio:/castor/cern.ch/grid/atlas/DAQ/2009/00137909/express_express/data09_cos.00137909.express_express.daq.RAW._lb0000._SFO-1._0001.data"] - - -IOVBegin = 137909 - -RunNumberList = [137909] - -GainList = ["FREE"] - -NSamples = 5 - -WriteNtuple = True - -# some hack to avoid trying to access low gain presampler calibration for AutoCorr -# (not filled usually but we have a very old file not on disk anymore from a wrong upload long ago...) - -from LArConditionsCommon.LArCondFlags import larCondFlags -larCondFlags.LArCoolChannelSelection.set_Value_and_Lock("3:588,653:1036") - - -include("LArCalibProcessing/LArCalib_AutoCorrPhys_jobOptions.py") - -theApp.EvtMax=1000 - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_CaliWaveMerger.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_CaliWaveMerger.py deleted file mode 100644 index 5b28a731386bf5cfbf3a9146132919eca58a20c0..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_CaliWaveMerger.py +++ /dev/null @@ -1,11 +0,0 @@ -ContainerKeyList = [ "LArCaliWave1", "LArCaliWave2" ] -PoolFileList = [ "file1.pool.root", "file2.pool.root" ] - -OutDir = "." -KeyOutput = "LArCaliWave" - -############################################################################### - -include("LArCalibProcessing/LArCalib_CaliWaveMerger_jobOptions.py") - -############################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Delay.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Delay.py deleted file mode 100644 index 64505db5953d18b977729ad738f80850f7b26f50..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Delay.py +++ /dev/null @@ -1,122 +0,0 @@ -####################################### -# you can choose the number of event -#theApp.EvtMax = 500 -####################################### - -InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2009/00110555" -RunNumberList = [ '00110555' ] -IOVBegin = 110555 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -## where you want to put the outputfile -#OutputCaliWaveRootFileDir ="" -#OutputCaliWavePoolFileDir ="" - -StripsXtalkCorr = True -WriteNtuple = True - -################################################################### -# Check for empty (missing) phases -# If found in at least one channel, will abort run -# Don't enable if you;re running on a subset of events! -################################################################### -CheckEmptyPhases = False - - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - - -## Pedestal -####################### -## local SQlite file -#InputPedSQLiteFile = "myDB200.db" -# the folder tag -#PedLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -####################################### - -include("LArCalibProcessing/LArCalib_Delay_jobOptions.py") - -####################################### - -if ( StripsXtalkCorr ) : - theLArStripsCrossTalkCorrector.OutputLevel = INFO - -LArCaliWaveBuilder.OutputLevel = INFO - -if ( WriteNtuple ) : - LArCaliWaves2Ntuple.OutputLevel = INFO - -if (doCaliWaveSelector) : - LArCaliWaveSelector.OutputLevel = INFO - -## LArStripsCrossTalkCorrection -if (StripsXtalkCorr == True) : - theLArStripsCrossTalkCorrector.OutputLevel = INFO - -## LArMonTool -if ( doMonitoring ) : - ToolSvc.LArFEBMon.OutputLevel = INFO - -## LArCaliWave -LArCaliWaveBuilder.OutputLevel = INFO -LArCaliWaves2Ntuple.OutputLevel = INFO - -svcMgr.MessageSvc.OutputLevel = ERROR - -svcMgr.IOVDbSvc.OutputLevel = INFO - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Cali.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Cali.py deleted file mode 100644 index 39a9195f749ab9180652d70e97156e52f50a8b29..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Cali.py +++ /dev/null @@ -1,101 +0,0 @@ -# this will triogger IOV to retriev CaliWave -InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2009" -RunNumber = '00110555' -IOVBegin = 110555 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -############################################################################################# -## this cool channel selection is using to Read only BarrelPS Medium gain Delay from the DB -ChannelSelection='<channelSelection>385:416,1013</channelSelection>' -############################################################################################# - -## where you want to put the outputfile -#OutputOFCRootFileDir = "" -#OutputOFCPoolFileDir ="" -#OutputShapePoolFileDir = "" - -WriteNtuple = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - -## AutoCorr -####################### -## local SQlite file -#InputAutoCorrSQLiteFile = "myDB200.db" -# the folder tag -#AutoCorrLArCalibFolderTag = "-UPD3-00" -################################################################################# -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################# - -## CaliWave -####################### -## local SQlite file -#InputCaliWaveSQLiteFile = "myDB200.db" -# the folder tag -#CaliWaveLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -####################################### - -include("LArCalibProcessing/LArCalib_OFC_Cali_jobOptions.py") - -####################################### - - -## LArOFCCali -LArCaliOFCAlg.OutputLevel = INFO -LArOFC2Ntuple.OutputLevel = DEBUG - -svcMgr.IOVDbSvc.OutputLevel = DEBUG - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_One_Phase_Phys.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_One_Phase_Phys.py deleted file mode 100644 index 932c0b890b6025b3673e5cfda9ee23c3a43edd7e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_One_Phase_Phys.py +++ /dev/null @@ -1,82 +0,0 @@ -# this will triogger IOV to retriev AutoCorr and CaliWave -RunNumber = 69129 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "HIGH" ] - -## where you want to put the outputfile -#OutputOFCRootFileDir= "" -#OutputOFCPoolFileDir= "" - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - -## OFC -####################### -## local SQlite file -#InputOFCSQLiteFile = "myDB200.db" -#InputOFCSQLiteFile = "/afs/cern.ch/user/l/larcalib/w0/data/WorkingDirectory/69125_69129_69135_Barrel_24/poolFiles/myDB200_69125_69129_69135_EB-EMBA_OFCPhys.db" -# the folder tag -#OFCLArCalibFolderTag = "-comm-11" -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog - -######################### -# to read a POOL file -######################### - -## OFC -######################## -#ReadAutoCorrFromCOOL = False -# extern POOL file with the location -#InputAutoCorrPoolDir = "" -#InputAutoCorrPoolFileName = "" - -####################################### - -include ( "LArCalibProcessing/LArCalib_PickOFCOnePhase.py" ) - -####################################### - - -LArOFPhasePicker.OutputLevel = DEBUG -LArOFC2Ntuple.OutputLevel = DEBUG - -######################### -# options -######################### - -#------------ -# Message -#------------ -#svcMgr.MessageSvc = Service( "MessageSvc" ) -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#---------------- -# Dump StoreGate -#---------------- -#svcMgr.StoreGateSvc = Service("StoreGateSvc" ) -#svcMgr.StoreGateSvc.Dump = True -#svcMgr.StoreGateSvc.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#svcMgr.DetectorStore = Service("DetectorStore" ) -#svcMgr.DetectorStore.Dump = True -#svcMgr.DetectorStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#svcMgr.ConditionStore = Service("ConditionStore" ) -#svcMgr.ConditionStore.Dump = True -#svcMgr.ConditionStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Phys.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Phys.py deleted file mode 100644 index 55525b90b811f64db50b44351624b563425abfed..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_OFC_Phys.py +++ /dev/null @@ -1,102 +0,0 @@ -# this will triogger IOV to retriev CaliWave -RunNumber = '00110555' -IOVBegin = 110555 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -############################################################################################# -## this cool channel selection is using to Read only BarrelPS Medium gain Delay from the DB -ChannelSelection='<channelSelection>385:416,1013</channelSelection>' -############################################################################################# - - -## where you want to put the outputfile -#OutputOFCRootFileDir= "" -#OutputOFCPoolFileDir= "" -#OutputShapePoolFileDir= "" - -WriteNtuple = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - -## AutoCorr -####################### -## local SQlite file -#InputAutoCorrSQLiteFile = "myDB200.db" -# the folder tag -#AutoCorrLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## PhysWave -####################### -## local SQlite file -#InputPhysWaveSQLiteFile = "myDB200.db" -# the folder tag -#PhysWaveLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalo -################################################################################ - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -###################################### - -include("LArCalibProcessing/LArCalib_OFC_Phys_jobOptions.py") - -####################################### - -LArPhysOFCAlg.OutputLevel = INFO -LArOFC2Ntuple.OutputLevel = DEBUG -LArPhysWaveShifter.OutputLevel = INFO - -svcMgr.IOVDbSvc.OutputLevel = DEBUG - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Pedestal_AutoCorr.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Pedestal_AutoCorr.py deleted file mode 100644 index f31a8e3913b7d6558477b8c1d875b60c0af76c7b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Pedestal_AutoCorr.py +++ /dev/null @@ -1,108 +0,0 @@ -####################################### -# you can choose the number of event -#theApp.EvtMax = 500 - -####################################### - -InputDir="/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2009/00110554" -IOVBegin = 110554 -RunNumberList = [ '00110554' ] -SubDet = "Barrel" -Partition = "EB-EMBA" -GainList = ["MEDIUM"] -runAccumulator = False - -## where you want to put the outputfile -#OutputPedAutoCorrRootFileDir ="" -#OutputPedPoolFileDir = "" -#OutputAutoCorrPoolFileDir= "" - -WriteNtuple = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - - -####################################### - -include("LArCalibProcessing/LArCalib_PedestalAutoCorr_jobOptions.py") - -####################################### - -## LArPedestal -if ( Pedestal ) : - if runAccumulator : - LArPedestalMaker.OutputLevel = INFO - else : - LArPedACBuilder.OutputLevel = INFO - LArPedestals2Ntuple.OutputLevel = INFO - -## LArAutoCorr -if ( AutoCorr ) : - if runAccumulator : - LArAutoCorrMaker.OutputLevel = INFO - else : - LArPedACBuilder.OutputLevel = INFO - LArAutoCorr2Ntuple.OutputLevel = INFO - -## LArMonTool -if ( doMonitoring ) : - if (doLArFEBMon) : - theLArFEBMon.OutputLevel = INFO - - if (doLArOddCellMonTool) : - theLArOddCellsMonTool.OutputLevel = INFO - theLArOddCellsMonTool.minimumRefNoise = [0.5,0.5] - - if (doLArScaNoiseTool) : - theLArScaNoiseMonTool.OutputLevel = INFO - - if (doLArDigitNoiseMonTool) : - theLArDigitNoiseMon.OutputLevel = INFO - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredicted.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredicted.py deleted file mode 100644 index 3513da37a3295714c39a6ecb77d120b4c4ebc0fa..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredicted.py +++ /dev/null @@ -1,80 +0,0 @@ - -# this will triogger IOV to retriev CaliWave -RunNumber = 29142 -IOVBegin = 29142 -Partition = "EB-EMBA" -SubDet = 'Barrel' - -######################### -# to read official DB -######################### -# by default, -# nothing to do - -####################################### -# to read COOL in a local SQlite file -####################################### - -# local SQlite file -#InputCaliWaveSQLiteFile = "myDB200.db" - -# or a extern SQlite file with the location -#InputCaliWaveSQLiteFile = "myDB200_29142_29143_29146.db" -# if necessary give the folder tag -#CaliWaveLArCalibFolderTag = "-comm-05" -# you need to have your POOL files inserter in the PoolFileCatalog - -######################### -# to read a POOL file -######################### -#ReadCaliWaveFromCOOL = False - -# local POOL file -#RunNumberAutoCorr= 30944 - -# or a extern POOL file with the location -#InputCaliWavePoolDir = "/afs/cern.ch/user/l/" -#InputCaliWavePoolFileName = "LArCaliWave_29143_EB-EMBA.pool.root" - -# you need to have your POOL files inserter in the PoolFileCatalog -####################################### - -include("LArCalibProcessing/LArCalib_PhysWavePredictor_jobOptions.py") - -LArPhysWavePredictor.OutputLevel = INFO -LArPhysWaveTool.OutputLevel = INFO -LArPhysWaves2Ntuple.OutputLevel = INFO - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.OutputLevel = WARNING -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredictedAndShifted.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredictedAndShifted.py deleted file mode 100644 index 5e61c91ef30116fa28618adcefb03a56777ababc..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWavePredictedAndShifted.py +++ /dev/null @@ -1,130 +0,0 @@ -# this will triogger IOV to retriev CaliWave -RunNumber = '00110555' -IOVBegin = 110555 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -############################################################################################# -## this cool channel selection is using to Read only BarrelPS Medium gain Delay from the DB -ChannelSelection='<channelSelection>385:416,1013</channelSelection>' -############################################################################################# - -## where you want to put the outputfile -#OutputPhysWaveRootFileDir= "" -#OutputPhysWavePoolFileDir= "" -#OutputMphysOverMcalPoolFileDir ="" - -## Options - -UseDoubleTriangle = False - -isHEC=False -if (isHEC) : - StripsXtalkCorr=False - -## DB folders for Parameters - -InputCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" -InputDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - -WriteNtuple = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - - -## CaliWave -####################### -## local SQlite file -#InputCaliWaveSQLiteFile = "myDB200.db" -# the folder tag -#CaliWaveLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## PulseParams -######################## -## local SQlite file -#InputPulseParamsSQLiteFile = "myDB200.db" -# the folder tag -#PulseParamsLArCalibFolderTag= "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## DetCellParams -######################## -## local SQlite file -#InputDetCellParamsSQLiteFile = "myDB200.db" -# the folder tag -#DetCellParamsLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -####################################### - -include ( "LArCalibProcessing/LArCalib_PhysWavePredictorAndShifter_jobOptions.py" ) - -####################################### - -## LArPhysWave -LArPhysWavePredictor.OutputLevel = INFO -if not (isHEC) : - LArPhysWaveTool.OutputLevel = INFO -else : - LArPhysWaveHECTool.OutputLevel = INFO -LArPhysWaves2Ntuple.OutputLevel = INFO - -LArMphysOverMcal2Ntuple.OutputLevel = INFO - -svcMgr.IOVDbSvc.OutputLevel = DEBUG - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWaveShifted.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWaveShifted.py deleted file mode 100644 index 55a6ec27a7247d16e4214b67fec26380c0673b17..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_PhysWaveShifted.py +++ /dev/null @@ -1,77 +0,0 @@ - -# this will triogger IOV to retriev CaliWave -RunNumber = 29142 -IOVBegin = 29142 -Partition = "EB-EMBA" -SubDet = 'Barrel' - -######################### -# to read official DB -######################### -# by default, -# nothing to do - -####################################### -# to read COOL in a local SQlite file -####################################### - -# local SQlite file -#InputPhysWaveSQLiteFile = "myDB200.db" - -# or a extern SQlite file with the location -#InputPhysWaveSQLiteFile = "myDB200_29142_29143_29146.db" -# if necessary give the folder tag -#PhysWaveLArCalibFolderTag = "-comm-05" -# you need to have your POOL files inserter in the PoolFileCatalog - -######################### -# to read a POOL file -######################### -#ReadPhysWaveFromCOOL = False - -# or a extern POOL file with the location -#InputPhysWavePoolDir = "/afs/cern.ch/user/t/tarrade/scratch0/CommissioningMonitoring/AtlasOfflineRelease/Calibration/13.0.30/run" -#InputPhysWavePoolFileName = "FCalWave.pool.root" - -#InputPhysWavePoolDir = "/tmp/tarrade" -#InputPhysWavePoolFileName = "LArPhysWave_RTM_29142_EB-EMBA.pool.root" - -# you need to have your POOL files inserter in the PoolFileCatalog -####################################### - -include("LArCalibProcessing/LArCalib_PhysWaveShifter_jobOptions.py") - -LArPhysWaveShifter.OutputLevel = DEBUG - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.OutputLevel = WARNING -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_RTMParamsExtraction.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_RTMParamsExtraction.py deleted file mode 100644 index 3c2e10d97c803c6be3cf0d877957e50dc89987ef..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_RTMParamsExtraction.py +++ /dev/null @@ -1,128 +0,0 @@ -## this will triogger IOV to retriev CaliWave -RunNumber = '00110555' -IOVBegin = 110555 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -############################################################################################# -## this cool channel selection is using to Read only BarrelPS Medium gain Delay from the DB -ChannelSelection='<channelSelection>385:416,1013</channelSelection>' -############################################################################################# - - -## where you want to put the outputfile -#OutputParamsRootFileDir= "" -#OutputPulseParamsPoolFileDir= "" -#OutputDetCellParamsPoolFileDir= "" - -## DB folders for Parameters -## extracted using RTM methode : -InputCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" -InputDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - -WriteNtuple = True - -################################### -# Extract All Parameters # -################################### -ExtractAllParameters = True - -################################### -# Extract only tauR # -################################### -#ExtractTauROnly = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - - -## CaliWave -####################### -## local SQlite file -#InputCaliWaveSQLiteFile = "myDB200.db" -# the folder tag -#CaliWaveLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - - -## CaliPulseParams -######################## -## local SQlite file -#InputCaliPulseParamsSQLiteFile = "myDB200.db" -# folder tag -#CaliPulseParamsLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## DetCellParams -######################## -#InputDetCellParamsSQLiteFile = "myDB200.db" -# the folder tag -#DetCellParamsLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -####################################### - -include ( "LArCalibProcessing/LArCalib_RTMParams_jobOptions.py" ) - -####################################### - - -## LArRTMParams -LArRTMParamExtractor.OutputLevel = INFO -theLArWFParamTool.OutputLevel = INFO -LArWFParams2Ntuple.OutputLevel = INFO - -svcMgr.IOVDbSvc.OutputLevel = DEBUG - -######################### -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Ramp.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Ramp.py deleted file mode 100644 index f3ad1e1d8719b53e4b7308267033ec4469babce4..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/TopOptsExample_Ramp.py +++ /dev/null @@ -1,131 +0,0 @@ -####################################### -# you can choose the number fo event -#theApp.EvtMax = 500 -####################################### - -InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2009/00110556" -RunNumberList = [ '00110556' ] -IOVBegin = 110556 -Partition = "EB-EMBA" -SubDet = 'Barrel' -GainList = [ "MEDIUM" ] - -############################################################################################# -## this cool channel selection is using to Read only BarrelPS Medium gain Delay from the DB -ChannelSelection='<channelSelection>385:416,1013</channelSelection>' -############################################################################################# - -## where you want to put the outputfile -#OutputRampRootFileDir = "" -#OutputRampPoolFileDir = "" - -isHEC = False -CorrectBadChannels = True -ApplyAdHocCorrection = False -PeakOF = True -WriteNtuple = True - -######################### -# to read official DB -######################### -# by default, -# nothing to do it will pickup the GlobalTag - - -####################################### -# to read COOL in a local SQlite file -####################################### - -## Pedestal -####################### -## local SQlite file -#InputPedSQLiteFile = "myDB200.db" -# the folder tag -#PedLArCalibFolderTag = "-UPD3-00" -################################################################################# -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################# - -## OFC Cali -####################### -## local SQlite file -#InputOFCSQLiteFile = "myDB200.db" -# the folder tag -#OFCLArCalibFolderTag = "-UPD3-00" -################################################################################ -# >>>>>>>>>> you NEED to have your POOL files inserter in the PoolFileCatalog -################################################################################ - - -## Bad Channel -####################### -#InputBadChannelSQLiteFile = "myDB200.db" -# the folder tag -#BadChannelsLArCalibFolderTag = "-UPD3-00" -#MissingFEBsLArCalibFolderTag = "-empty" - -####################################### - -include("LArCalibProcessing/LArCalib_Ramp_jobOptions.py") - -####################################### - -if ( CorrectBadChannels ) : - theLArBadChannelTool.OutputLevel = INFO - theLArRampPatcher.OutputLevel = INFO - theLArRCBMasker.OutputLevel = DEBUG - -## LArStripsCrossTalkCorrection -if (StripsXtalkCorr == True) : - theLArStripsCrossTalkCorrector.OutputLevel = INFO - -## LArBadChannel -if (CorrectBadChannels) : - theLArRampPatcher.OutputLevel = INFO - theLArRCBMasker.OutputLevel = DEBUG - theLArBadChannelTool.OutputLevel =VERBOSE - -## LArMonTool -if ( doMonitoring ) : - ToolSvc.LArFEBMon.OutputLevel = INFO - -## LArRamp -theLArOFPeakRecoTool.OutputLevel = VERBOSE -theLArRampBuilder.OutputLevel = INFO -LArRamps2Ntuple.OutputLevel = DEBUG - -svcMgr.MessageSvc.OutputLevel = ERROR - -svcMgr.IOVDbSvc.OutputLevel = INFO - - -######################## -# options -######################### -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArMonTools/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArMonTools/ATLAS_CHECK_THREAD_SAFETY deleted file mode 100644 index 3b3de19430dbdf17559e21b4952ce2879814638b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/ATLAS_CHECK_THREAD_SAFETY +++ /dev/null @@ -1 +0,0 @@ -LArCalorimeter/LArMonTools diff --git a/LArCalorimeter/LArMonTools/CMakeLists.txt b/LArCalorimeter/LArMonTools/CMakeLists.txt deleted file mode 100644 index ff067e997615fed2ecb041a9fc7ac51b2982fa3f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -# Declare the package name: -atlas_subdir( LArMonTools ) - -# External dependencies: -find_package( CLHEP ) -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO ) - -# Component(s) in the package: -atlas_add_component( LArMonTools - src/*.cxx - src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloDetDescrLib CaloGeoHelpers CaloIdentifier EventContainers AthenaMonitoringLib StoreGateLib Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArCablingLib LWHists TrigDecisionToolLib CaloConditions AthenaKernel AthenaPoolUtilities xAODEventInfo LArCOOLConditions LArRawConditions LArRecEvent CaloInterfaceLib LArElecCalib TrigAnalysisInterfaces ) - -# Install files from the package: -atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.txt share/*.py ) - diff --git a/LArCalorimeter/LArMonTools/python/LArMonFlags.py b/LArCalorimeter/LArMonTools/python/LArMonFlags.py deleted file mode 100644 index aff95ffeb0c4a70a5dbc7131013b921c1046f2b2..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/python/LArMonFlags.py +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -## -## @file DataQualityTools/python/DQMonFlags.py -## @purpose Python module to hold common flags to configure JobOptions -## - -""" LArMonFlags - Python module to hold flags for Data Quality monitoring - -""" - -__author__ = "I. M. Nugent" -__version__= "$Revision: 1.11 $" -__doc__ = "LArMonFlags" - -__all__ = [ "LArMonFlags" ] - -# kindly stolen from InDetKeys by A. Wildauer - -##----------------------------------------------------------------------------- -## Import - -from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer -from AthenaCommon.JobProperties import jobproperties - -##----------------------------------------------------------------------------- -## 1st step: define JobProperty classes -list=[] - -class LArDigitKey(JobProperty): - """ Global switch for LArDigitKey """ - statusOn=True - allowedTypes=['str'] - StoredValue='FREE' -list+=[LArDigitKey] - -class EventBlockSize(JobProperty): - """ Global switch for EventBlockSize """ - statusOn=True - allowedTypes=['int'] - StoredValue=0 -list+=[EventBlockSize] - - -class doLArRawChannelMonEtaPhi(JobProperty): - """ Global switch for doLArRawChannelMonEtaPhi """ - statusOn=True - allowedTypes=['bool'] - StoredValue=False -list+=[doLArRawChannelMonEtaPhi] - - -class doLArRawMonitorSignal(JobProperty): - """ Global switch for monitor_signal """ - statusOn=True - allowedTypes=['bool'] - StoredValue=False -list+=[doLArRawMonitorSignal] - - -############################################################3 -# -# define the flags for each tool -# - -class doLArRawChannelMon(JobProperty): - """ Global switch for doLArRawChannelMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArRawChannelMon] - - -class doLArCollisionTimeMon(JobProperty): - """ Global switch for doLArCollisionTimeMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArCollisionTimeMon] - - -class doLArAffectedRegions(JobProperty): - """ Global switch for doLArAffectedRegions """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArAffectedRegions] - -class doLArFEBMon(JobProperty): - """ Global switch for doLArFEBMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArFEBMon] - -class doLArHVCorrectionMonTool(JobProperty): - """ Global switch for doLArHVCorrectionMonTool """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArHVCorrectionMonTool] - -class doLArCosmicsMonTool(JobProperty): - """ Global switch for doLArCosmicsMonTool """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArCosmicsMonTool] - -class doLArCoverage(JobProperty): - """ Global switch for doLArCoverage """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArCoverage] - -class doLArDigitMon(JobProperty): - """ Global switch for doLArDigitMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArDigitMon] - -class doLArNoisyROMon(JobProperty): - """ Global switch for doLArNoisyROMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArNoisyROMon] - -class doLArRODMonTool(JobProperty): - """ Global switch for doLArRODMonTool """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArRODMonTool] - -class doLArNoiseCorrelationMon(JobProperty): - """ Global switch for doLArNoiseCorrelationMon """ - statusOn=True - allowedTypes=['bool'] - StoredValue=True -list+=[doLArNoiseCorrelationMon] - -##----------------------------------------------------------------------------- -## 2nd step -## Definition of the LArMon flag container -class LArMonFlagsCont(JobPropertyContainer): - """Container for Data Quality Monitoring flags - """ - pass - -##----------------------------------------------------------------------------- -## 3rd step -## adding the container to the general top-level container -jobproperties.add_Container(LArMonFlagsCont) - -##----------------------------------------------------------------------------- -## 4th step -## adding properties to LArMonFlags container -for j in list: - jobproperties.LArMonFlagsCont.add_JobProperty(j) - -##----------------------------------------------------------------------------- -## 5th step -## short-cut -LArMonFlags = jobproperties.LArMonFlagsCont diff --git a/LArCalorimeter/LArMonTools/python/evolutionBadChannels.py b/LArCalorimeter/LArMonTools/python/evolutionBadChannels.py deleted file mode 100644 index e8d2d630e7c6d7bbc65257a40eeebbd8ffacf718..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/python/evolutionBadChannels.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin env python - -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from __future__ import print_function - -# ====================================================================== -def extractBad(histo,sp,hi,bin): - - for ix in range(1,histo.GetNbinsX()+1): - for iy in range (1,histo.GetNbinsY()+1): - flag = histo.GetBinContent(ix,iy) - if (flag == 5): - sp[returnPart(histo,ix)][bin]=sp[returnPart(histo,ix)][bin]+1 - if (flag == 6): - hi[returnPart(histo,ix)][bin]=hi[returnPart(histo,ix)][bin]+1 - histo.Print() - - return - -# ====================================================================== -def returnPart(h,xBin): - - partition = 0 - - if (h.GetNbinsX()) == 448: - if (xBin%14!=1): #EMB - partition = 0 - if (xBin%14==1): #EMB PS - partition = 1 - else: - if (xBin>90 and xBin<=105): - partition=3 # FCAL - else: - if ((xBin>49 and xBin<56) or (xBin>154 and xBin<161) or (xBin>244 and xBin<251) or (xBin>334 and xBin<341)): - partition=4 #HEC - else: - partition=2 - - - return partition - -# ====================================================================== -def returnPartName(partNb): - - partName = "Unknown" - if partNb == 0: - partName = "EMB" - if partNb == 1: - partName = "EMB PS" - if partNb == 2: - partName = "EMEC" - if partNb == 3: - partName = "FCAL" - if partNb == 4: - partName = "HEC" - - return partName - - -# Main ================================================================= -import sys -from numpy import array, zeros - -from ROOT import gROOT, gDirectory -from ROOT import gStyle, TCanvas -from ROOT import TRFIOFile -from ROOT import TGraph, TLegend - -gROOT.Reset() -gStyle.SetPalette(1) -gStyle.SetCanvasColor(0) -gStyle.SetOptStat(100110) - -tag = "UPD4" # UPD4 (used for the bulk) is the default -if len(sys.argv) == 2: - if (sys.argv[1] == "UPD1"): - tag = "UPD1" - -# Add new run here - Do not forget the AMI tag -# You should also remove runs that are no longer staged -if tag == "UPD1": - runNumber = array([160387,160472,160479,160530]) - tagxf = array([33,33,33,33]) - tagm = array([565,565,565,565]) -if tag == "UPD4": - runNumber = array([159224,160387,160472,160479,160530]) - tagxf = array([275,280,280,280,280]) - tagm = array([545,565,565,565,565]) - -nbOfRun = len(runNumber) -#nbOfRun = 2 - -nbOfPart=5 # 0->EMB 1->EMBPS 2->EC 3->FCAL 4->HEC - -sporadic=[] -highNoise=[] - -for iPart in range(0,nbOfPart): - sporadic.append(zeros(nbOfRun,dtype='int')) - highNoise.append(zeros(nbOfRun,dtype='int')) - -spEMBPS=zeros(nbOfRun,dtype='int') -hiEMBPS=zeros(nbOfRun,dtype='int') -spEMB=zeros(nbOfRun,dtype='int') -hiEMB=zeros(nbOfRun,dtype='int') - -xAxis=zeros(nbOfRun,dtype='int') - -# Read all the tier0 monitoring file -# You must define STAGE_SVCCLASS=atlcal - -for index in range(0,nbOfRun): - xAxis[index]=index - if tag == "UPD1": - nameFile = "/castor/cern.ch/grid/atlas/tzero/prod1/perm/data10_7TeV/physics_CosmicCalo/0%d/data10_7TeV.00%d.physics_CosmicCalo.merge.HIST.x%d_m%d/data10_7TeV.00%d.physics_CosmicCalo.merge.HIST.x%d_m%d._0001.1"%(runNumber[index],runNumber[index],tagxf[index],tagm[index],runNumber[index],tagxf[index],tagm[index]) - if tag == "UPD4": - nameFile = "/castor/cern.ch/grid/atlas/tzero/prod1/perm/data10_7TeV/physics_CosmicCalo/0%d/data10_7TeV.00%d.physics_CosmicCalo.merge.HIST.f%d_m%d/data10_7TeV.00%d.physics_CosmicCalo.merge.HIST.f%d_m%d._0001.1"%(runNumber[index],runNumber[index],tagxf[index],tagm[index],runNumber[index],tagxf[index],tagm[index]) - print (nameFile) - myfile = TRFIOFile(nameFile) - - emba = gDirectory.Get("run_%d/LAr/Coverage/BadChannels/DBBadChannelsBarrelA"%(runNumber[index])) - extractBad(emba,sporadic,highNoise,index) - embc = gDirectory.Get("run_%d/LAr/Coverage/BadChannels/DBBadChannelsBarrelC"%(runNumber[index])) - extractBad(embc,sporadic,highNoise,index) - eca = gDirectory.Get("run_%d/LAr/Coverage/BadChannels/DBBadChannelsEndcapA"%(runNumber[index])) - extractBad(eca,sporadic,highNoise,index) - ecc = gDirectory.Get("run_%d/LAr/Coverage/BadChannels/DBBadChannelsEndcapC"%(runNumber[index])) - extractBad(ecc,sporadic,highNoise,index) - - print ("**EMB : sporadicBurst=",sporadic[0][index]," - highNoise=",highNoise[0][index]) - print ("**EMB PS: sporadicBurst=",sporadic[1][index]," - highNoise=",highNoise[1][index]) - print ("**EMEC : sporadicBurst=",sporadic[2][index]," - highNoise=",highNoise[2][index]) - print ("**FCAL : sporadicBurst=",sporadic[3][index]," - highNoise=",highNoise[3][index]) - print ("**HEC : sporadicBurst=",sporadic[4][index]," - highNoise=",highNoise[4][index]) - -#Create 1 TGraph for each errorType/run - -spGraph=[] -hiGraph=[] -spLeg = TLegend(0.55,0.55,0.65,0.75) -hiLeg = TLegend(0.55,0.55,0.65,0.75) - -markerStyle = [20,21,22,23,29] -markerColor = [1,2,3,4,6] - -for iPart in range(0,nbOfPart): - spGraph.append(TGraph(nbOfRun,xAxis,sporadic[iPart])) - spGraph[iPart].SetMarkerStyle(markerStyle[iPart]) - spGraph[iPart].SetMarkerColor(markerColor[iPart]) - spLeg.AddEntry(spGraph[iPart],returnPartName(iPart),"p") - hiGraph.append(TGraph(nbOfRun,xAxis,highNoise[iPart])) - hiGraph[iPart].SetMarkerStyle(markerStyle[iPart]) - hiGraph[iPart].SetMarkerColor(markerColor[iPart]) - hiLeg.AddEntry(hiGraph[iPart],returnPartName(iPart),"p") - -# Plot all the TGraph in a single canvas - -c1 = TCanvas('c1','c1') -c1.Divide(1,2) -c1.cd(1) -for iPart in range(0,nbOfPart): - if iPart == 0: - spGraph[iPart].Draw("AP") - spGraph[iPart].SetMinimum(0) - spGraph[iPart].SetMinimum(90) - (spGraph[iPart].GetXaxis()).SetLabelSize(0.045) - spGraph[iPart].SetTitle("Number of channels flagged sporadicBurstNoise - %s"%(tag)) - else: - spGraph[iPart].Draw("P") -spLeg.Draw() - -c1.cd(2) -for iPart in range(0,nbOfPart): - if iPart == 0: - hiGraph[iPart].Draw("AP") - hiGraph[iPart].SetMinimum(0) - hiGraph[iPart].SetMaximum(60) - (hiGraph[iPart].GetXaxis()).SetLabelSize(0.045) - hiGraph[iPart].SetTitle("Number of channels flagged highNoise - %s"%(tag)) - else: - hiGraph[iPart].Draw("P") -hiLeg.Draw() - -for iRun in range(0,nbOfRun): - axis = spGraph[0].GetXaxis() - for iBin in range(1,axis.GetNbins()): - if ((iRun>=axis.GetBinLowEdge(iBin)) and (iRun<axis.GetBinUpEdge(iBin))): - (spGraph[0].GetXaxis()).SetBinLabel(iBin,"%d"%(runNumber[iRun])) - (hiGraph[0].GetXaxis()).SetBinLabel(iBin,"%d"%(runNumber[iRun])) - -c1.cd() - diff --git a/LArCalorimeter/LArMonTools/share/FindFile.py b/LArCalorimeter/LArMonTools/share/FindFile.py deleted file mode 100644 index a988d3564c1af9500b806c83bbf97b8c0c637bca..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/FindFile.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python - -import os - -def FindFile(pathenvvar, subdir="",filename=""): - if os.environ.has_key(pathenvvar): - path=os.environ[pathenvvar] - else: - print("Environment Variable",pathenvvar,"not found.") - return "" - - spath=path.split(":") - for thedir in spath: - if not subdir == "": - dir=thedir+"/"+subdir - else: - dir=thedir - if os.path.isdir(dir): - files=os.listdir(dir) - for file in files: - if file==filename: - print('FindFile: File',filename,'found') - return dir+"/"+filename - return "" - diff --git a/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py deleted file mode 100644 index be4e8df6b4cf1f4cfd26a3912adc1b7185f5d36b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArAffectedRegions_jobOptions.py +++ /dev/null @@ -1,15 +0,0 @@ -# import stuff -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - -# --- For athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -###### LAr Affected Region Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArAffectedRegions -theLArAffectedRegions = LArAffectedRegions(name="LArAffectedRegions", - ProcessNEvents = EventBlockSize, - IsOnline = athenaCommonFlags.isOnline() - ) -#ToolSvc += theLArAffectedRegions -LArMon.AthenaMonTools+=[ theLArAffectedRegions ] diff --git a/LArCalorimeter/LArMonTools/share/LArAllMonitoring_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArAllMonitoring_jobOptions.py deleted file mode 100755 index d1680123460ea20bcff2ad5a008b5448020e6159..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArAllMonitoring_jobOptions.py +++ /dev/null @@ -1,138 +0,0 @@ -include.block("LArMonTools/LArAllMonitoring_jobOptions.py") - -################################################################# -# -# Steers LAr monitoring based on beam type and Commissioning switches. -# Rob McPherson, first version 30 Sept 2008 -# -# Note: This is the LAr only version, 21 Oct 2008 -# -################################################################# - -from AthenaCommon.BeamFlags import jobproperties -from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags -from RecExConfig.RecFlags import rec -from AthenaMonitoring.DQMonFlags import DQMonFlags -from LArROD.LArRODFlags import larRODFlags -from LArMonTools.LArMonFlags import LArMonFlags - - -if DQMonFlags.monManEnvironment() == 'tier0Raw': - larRawMon=True - larESDMon=False -elif DQMonFlags.monManEnvironment() == 'tier0ESD': - larRawMon=False - larESDMon=True -else: # it should be 'tier0' - larRawMon=True - larESDMon=True - -from PyUtils.MetaReaderPeeker import metadata -if metadata['eventTypes'][0] == 'IS_SIMULATION': - LArMonFlags.doLArDigitMon = False - - -# Define ONE LArBadChannelMask for all Monitoring tools -ProblemsToMask=[ - "deadReadout","deadPhys","short","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise" - ] - -# Parameter to avoid the "procHist" offline. More efficient -if athenaCommonFlags.isOnline(): - LArMonFlags.EventBlockSize = 20 -else: - LArMonFlags.EventBlockSize = 0 - -if 'LArDigitKey' in dir() : - LArMonFlags.LArDigitKey=LArDigitKey - - - -# This is the main block choosing what monitoring to run. -# There is some repetition, but I think maintenance is easier (Rob). - -if jobproperties.Beam.beamType() == 'cosmics': - if larESDMon and not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArAffectedRegions(): - include ("LArRecUtils/LArAffectedRegion.py") - include ("LArMonTools/LArAffectedRegions_jobOptions.py") - if larRawMon: - if jobproperties.Global.DataSource.get_Value() == 'data': - if LArMonFlags.doLArFEBMon(): - include ("LArMonTools/LArFEBMon_jobOptions.py" ) - if LArMonFlags.doLArRODMonTool(): - include ("LArMonTools/LArRODMonTool_jobOptions.py") - if not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArHVCorrectionMonTool(): - include ("LArMonTools/LArHVCorrectionMonTool_jobOptions.py" ) - if LArMonFlags.doLArCosmicsMonTool(): - include ("LArMonTools/LArCosmicsMonTool_jobOptions.py") - if LArMonFlags.doLArCoverage(): - include ("LArMonTools/LArCoverage_jobOptions.py") - if LArMonFlags.doLArDigitMon(): - include ("LArMonTools/LArDigitMon_jobOptions.py") - if LArMonFlags.doLArNoiseCorrelationMon(): - include ("LArMonTools/LArNoiseCorrelationMon_jobOptions.py") - if LArMonFlags.doLArNoisyROMon(): - include ("LArMonTools/LArNoisyROMon_jobOptions.py") - if LArMonFlags.doLArRawChannelMon(): - include ("LArMonTools/LArRawChannelMonTool_jobOptions.py") - if LArMonFlags.doLArCollisionTimeMon(): - include("LArMonTools/LArCollisionTimeMonTool_jobOptions.py") - - -elif jobproperties.Beam.beamType() == 'singlebeam': - if larESDMon and not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArAffectedRegions(): - include ("LArRecUtils/LArAffectedRegion.py") - include ("LArMonTools/LArAffectedRegions_jobOptions.py") - if larRawMon: - if jobproperties.Global.DataSource.get_Value() == 'data': - if LArMonFlags.doLArFEBMon(): - include ("LArMonTools/LArFEBMon_jobOptions.py" ) - if LArMonFlags.doLArRODMonTool(): - include ("LArMonTools/LArRODMonTool_jobOptions.py") - if not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArHVCorrectionMonTool(): - include ("LArMonTools/LArHVCorrectionMonTool_jobOptions.py" ) - if LArMonFlags.doLArCoverage(): - include ("LArMonTools/LArCoverage_jobOptions.py") - if LArMonFlags.doLArDigitMon(): - include ("LArMonTools/LArDigitMon_jobOptions.py") - if LArMonFlags.doLArNoiseCorrelationMon(): - include ("LArMonTools/LArNoiseCorrelationMon_jobOptions.py") - if LArMonFlags.doLArNoisyROMon(): - include ("LArMonTools/LArNoisyROMon_jobOptions.py") - if LArMonFlags.doLArRawChannelMon(): - include("LArMonTools/LArRawChannelMonTool_jobOptions.py") - if LArMonFlags.doLArCollisionTimeMon(): - include("LArMonTools/LArCollisionTimeMonTool_jobOptions.py") -else: # should be jobproperties.Beam.beamType() =='collisions' - if larESDMon and not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArAffectedRegions(): - include ("LArRecUtils/LArAffectedRegion.py") - include ("LArMonTools/LArAffectedRegions_jobOptions.py") - if larRawMon: - if jobproperties.Global.DataSource.get_Value() == 'data': - if LArMonFlags.doLArFEBMon(): - include ("LArMonTools/LArFEBMon_jobOptions.py" ) - if LArMonFlags.doLArRODMonTool(): - include ("LArMonTools/LArRODMonTool_jobOptions.py") - if not athenaCommonFlags.isOnline(): - if LArMonFlags.doLArHVCorrectionMonTool(): - include ("LArMonTools/LArHVCorrectionMonTool_jobOptions.py" ) - if LArMonFlags.doLArCoverage(): - include ("LArMonTools/LArCoverage_jobOptions.py") - if LArMonFlags.doLArDigitMon(): - include ("LArMonTools/LArDigitMon_jobOptions.py") - if LArMonFlags.doLArNoiseCorrelationMon(): - include ("LArMonTools/LArNoiseCorrelationMon_jobOptions.py") - if LArMonFlags.doLArNoisyROMon(): - include ("LArMonTools/LArNoisyROMon_jobOptions.py") - if LArMonFlags.doLArRawChannelMon(): - include("LArMonTools/LArRawChannelMonTool_jobOptions.py") - if LArMonFlags.doLArCollisionTimeMon(): - include("LArMonTools/LArCollisionTimeMonTool_jobOptions.py") - - diff --git a/LArCalorimeter/LArMonTools/share/LArCalibRunMonitoringOffline.py b/LArCalorimeter/LArMonTools/share/LArCalibRunMonitoringOffline.py deleted file mode 100644 index 43ba848364303b5091ea3e9b390c65eebc18cabc..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArCalibRunMonitoringOffline.py +++ /dev/null @@ -1,34 +0,0 @@ -# Calibration runs - -#### to be run like this (from run/ directory): -# athena.py -s -c 'RunNumber='$rn';InputDir="'$folderIn'";OutputDir="'$outDataFolder'";OutName="'$aname'_'$gain'";Gain="'$gain'";Partition="ALL";EvtNo='$evts';FEBSforStatTest=["endcapAft04slot02","barrelCft01slot03"]' ../build/x86_64-slc6-gcc62-opt/jobOptions/LArMonTools/LArCalibRunMonitoringOffline.py -# -# OutName - if you want to modify the output name -# Gain=HIGH/MEDIUM/LOW -# EvtNo set if you want to run on a limited number of events, do not set otherwise -# FEBSforStatTest tellse the coherent noise what to run on, if not set there's a default -### - -from AthenaCommon.ConcurrencyFlags import jobproperties as jps - -online = False - -# -# Common header to all LArMon jobs -# - -coherent_noise_febs = FEBSforStatTest #list of FEBs to be monitored, if empty, runs on them all -print(coherent_noise_febs) -#coherent_noise_PublishPartialSums = True #if true, publish the partial sums histograms, can be useful for debugging. False by default -coherent_noise_calibration_run = True - - -from LArMonTools.LArMonFlags import LArMonFlags -include("LArMonTools/LArMonJobOptionsOffline.py") # contains the setting up of athena for the monitoring + rootfile naming + LArBuilders -svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2018-03" -# needed at P1 -#Service("PoolSvc").SortReplicas = False - -svcMgr.MessageSvc.OutputLevel = 4 #2 to set DEBUG mode, 4 to remove debug - - diff --git a/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py deleted file mode 100755 index 298fab02264906916a22598aaec98cc560a01a99..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArCollisionTimeMonTool_jobOptions.py +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################### -# Author : Vikas Bansal <Vikas.Bansal@cern.ch> -# Name : LArCollisionTimeMonTool_jobOptions.py -# Purpose: To configure and schedule LArCollisionTime Monitoring tool. -# This jobOptions tweaks Athena Algorithm Sequence so that the -# LArCollisionTimeAlg is called before LArMonManager. -############################################################################### - - -######### -# BunchCrossing info -from LumiBlockComps.BunchCrossingCondAlgDefault import BunchCrossingCondAlgDefault -BunchCrossingCondAlgDefault() - -# Now configure and schedule the monitoring tool - -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -# --- LArCollisionTimeMon configuration --- -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -from LArMonTools.LArMonToolsConf import LArCollisionTimeMonTool -LArCollisionTimeMon = LArCollisionTimeMonTool( - # --- Configure mon tool --- - name = "LArCollisionTimeMon", - timeDiffCut = 5000.0,#5.0 - nCells = 1,# Needs at least >=2 cells to get rid of electronic noise - m_lumi_blocks = 3000, - TrainFrontDistance = 20, - IsOnline = athenaCommonFlags.isOnline() - ) - - -LArCluCollTimeMonTool=LArCollisionTimeMonTool(Key="ClusterCollTime", - histPath="LArClusterCollTimeOldTool", - nCells=0, - m_lumi_blocks=3000, - TrainFrontDistance = 20, - IsOnline = athenaCommonFlags.isOnline() - ) - - -# --- register with toolservice --- -#ToolSvc += [LArCollisionTimeMon,LArCluCollTimeMonTool] -LArMon.AthenaMonTools+=[ LArCollisionTimeMon,LArCluCollTimeMonTool ] - diff --git a/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py deleted file mode 100755 index 30358bd4a0b64adaa49800c534aa6db79fa9ff7d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArCosmicsMonTool_jobOptions.py +++ /dev/null @@ -1,26 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() - -###### Cosmic Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArCosmicsMonTool -theLArCosmicsMonTool = LArCosmicsMonTool(name="LArCosmicsMonTool", - ProcessNEvents = EventBlockSize, - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - muonADCthreshold_EM_barrel = 30, # Sampling 2 - muonADCthreshold_EM_endcap = 40, # Sampling 2 - muonADCthreshold_HEC = 30, # Sampling 1 - muonADCthreshold_FCAL = 30, # Sampling 1 - ProblemsToMask = ProblemsToMask - ) - -theLArCosmicsMonTool.LArPedestalKey='LArPedestal' - - -#ToolSvc += theLArCosmicsMonTool -LArMon.AthenaMonTools+=[ theLArCosmicsMonTool ] - - diff --git a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py deleted file mode 100755 index 3fe48c4099797352d3e63f8d5a56bf235a4c0bba..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py +++ /dev/null @@ -1,22 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg -CaloNoiseCondAlg(noisetype="electronicNoise") - -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() - -###### LAr Coverage Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArCoverage -theLArCoverage = LArCoverage(name="LArCoverage", - ProcessNEvents = EventBlockSize, - ProblemsToMask = ProblemsToMask, - Nevents = 40 - ) -LArMon.AthenaMonTools+=[ theLArCoverage ] - - - - diff --git a/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py deleted file mode 100644 index 6cf7918c8cfd80a803b2b7672ece80ff44de7864..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArDigitMon_jobOptions.py +++ /dev/null @@ -1,53 +0,0 @@ -from LArCellRec.LArNoisyROFlags import larNoisyROFlags - -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -#Run is Online or Offline: -OnlineMode=athenaCommonFlags.isOnline() - -#retrieve the condition for the run in cool offline, in IS online -if OnlineMode: - peakSample_expected = FirstSample - LArSampleNumber = NSamples -else: - from LArConditionsCommon.LArCool import larcool - if (larcool is not None): - peakSample_expected = larcool.firstSample() - LArSampleNumber = larcool.nSamples() - else: - peakSample_expected = 0 - LArSampleNumber = 0 - -#Run is Cosmic or Beam: -CosmicMode=( jobproperties.Beam.beamType()== 'cosmics') - -#Declare stream if Cosmic or Beam: -if CosmicMode: - StreamsToMonitor = ["CosmicCalo","Standby","LArCellsEmpty","Background"] -else: - StreamsToMonitor = ["CosmicCalo","ZeroBias","Standby","express","Main","L1Calo","L1Topo","LArCells","LArCellsEmpty","Background","LArCellsEmpty"] - - -###### LArDigitMon Configuration ############### -from LArMonTools.LArMonToolsConf import LArDigitMon -theLArDigitMon = LArDigitMon(name="LArDigitMon", -# OutputLevel=VERBOSE, - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - IsOnline = OnlineMode, -# SampleRangeLow = 5, # If no value set, range defined -# SampleRangeUp = 7, # dynamically in the code - ExpectedSampleMax = peakSample_expected, - SampleNumberFromDB = LArSampleNumber, - ComputeHistError = False, - IgnoreBadChannels = True, - ProblemsToMask = ProblemsToMask, - ProcessNEvents = EventBlockSize, - NumberBadFebs = larNoisyROFlags.BadFEBCut(), - Streams = StreamsToMonitor - ) - -LArMon.AthenaMonTools+=[ theLArDigitMon ] - - diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py deleted file mode 100644 index 953c540fafb4437370d6d8126e590fe71b75dc2e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibEMB_jobOptions.py +++ /dev/null @@ -1,20 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -###### LAr FEBMon Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArFEBMon - -conddb.addFolder('LAR','/LAR/Configuration/DSPThreshold/Thresholds') - -theLArFEBMon = LArFEBMon(name="LArFEBMon", - ProcessNEvents = EventBlockSize, - IgnoreMissingHeaderPS = False, - IgnoreMissingHeaderEMB = False - ) -#ToolSvc += theLArFEBMon -LArMon.AthenaMonTools+=[ theLArFEBMon ] - -#to change an option later, do e.g -#ToolSvc.LArFEBMon.maxOfTimingHisto =100 -#ToolSvc.LArFEBMon.OutputLevel =DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py deleted file mode 100644 index 328423cc4f08009aa50c32daa4a70c00c8d62dfe..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_calibPS_jobOptions.py +++ /dev/null @@ -1,21 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -###### LAr FEBMon Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArFEBMon - -conddb.addFolder('LAR','/LAR/Configuration/DSPThreshold/Thresholds') - -theLArFEBMon = LArFEBMon(name="LArFEBMon", - ProcessNEvents = EventBlockSize, - IgnoreMissingHeaderPS = False, - IgnoreMissingHeaderEMB = True - ) -#ToolSvc += theLArFEBMon -LArMon.AthenaMonTools+=[ theLArFEBMon ] - - -#to change an option later, do e.g -#ToolSvc.LArFEBMon.maxOfTimingHisto =100 -#ToolSvc.LArFEBMon.OutputLevel =DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py deleted file mode 100755 index 8e35d8087cefe45305d8dcf376ce858f4c36b068..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py +++ /dev/null @@ -1,31 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -#Run is Online or Offline: -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -OnlineMode=athenaCommonFlags.isOnline() - -###### LAr FEBMon Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArFEBMon - -if conddb.dbname == "CONDBR2": - conddb.addFolder('LAR','/LAR/Configuration/DSPThresholdFlat/Thresholds') - keyDSPThr="/LAR/Configuration/DSPThresholdFlat/Thresholds" -else: - conddb.addFolder('LAR','/LAR/Configuration/DSPThreshold/Thresholds') - keyDSPThr="LArDSPThresholds" - -theLArFEBMon = LArFEBMon(name="LArFEBMon", - ProcessNEvents = EventBlockSize, - IgnoreMissingHeaderPS = False, - IgnoreMissingHeaderEMB = False, - keyDSPThresholds = keyDSPThr, - IsOnline = OnlineMode - ) -#ToolSvc += theLArFEBMon -LArMon.AthenaMonTools+=[ theLArFEBMon ] - -#to change an option later, do e.g -#ToolSvc.LArFEBMon.maxOfTimingHisto =100 -#ToolSvc.LArFEBMon.OutputLevel =DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py deleted file mode 100644 index a83529d70267b09f220d4c86048edb91e8b4b772..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArHVCorrectionMonTool_jobOptions.py +++ /dev/null @@ -1,18 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() - -###### LAr HV Correction Tool Configuration ############### -from LArMonTools.LArMonToolsConf import LArHVCorrectionMonTool -theLArHVCorrectionMonTool = LArHVCorrectionMonTool(name="LArHVCorrectionMonTool", - NumberOfLBs = 1000 - ) -# include LAr HV Correction cond alg -from LArConditionsCommon import LArHVDB - -#ToolSvc += theLArHVCorrectionMonTool -LArMon.AthenaMonTools+=[ theLArHVCorrectionMonTool ] - diff --git a/LArCalorimeter/LArMonTools/share/LArMonBuilders.py b/LArCalorimeter/LArMonTools/share/LArMonBuilders.py deleted file mode 100644 index cf17db51afdb742de86ec812b98d02fee74c71b0..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonBuilders.py +++ /dev/null @@ -1,125 +0,0 @@ -#################################################### -# -# last update Fabien.Tarrade AT cern.ch July 17th -# -#################################################### - -if Type == 'Cosmic': - if not 'UseOFC' in dir(): - UseOFC=True - - if UseOFC: - # This is a minimal version to do produce LArRawChannel - include( "CaloCosEx/LArCosmicFlags_jobOptions.py" ) - - ## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc - from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - - ## define the DB Gobal Tag : - svcMgr.IOVDbSvc.GlobalTag="COMCOND-ES1S-000-00" - - include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") - include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - include("CaloCosEx/LArSignalReco_Cosmics_jobOptions.py") - - theLArRawChannelBuilderPedestalDataBase.LArPedestalKey='LArPedestal' - - else: - # Use a simple Tool - ############################################### - # this is totaly obsolete and not working - # not sure if it make sense to have this part - ############################################### - - from LArRecUtils.LArADC2MeVCondAlgDefault import LArADC2MeVCondAlgDefault - LArADC2MeVCondAlgDefault() - - from LArROD.LArRODConf import LArRawChannelSimpleBuilder - theLArRawChannelBuilder = LArRawChannelSimpleBuilder() - theLArRawChannelBuilder.DataLocation = LArMonFlags.LArDigitKey() - theLArRawChannelBuilder.LArRawChannelContainerName = LArRawChannelKey - theLArRawChannelBuilder.maxSamp = 2 - topSequence += theLArRawChannelBuilder - -elif Type == 'Pedestal': - # This is a minimal version to do produce LArRawChannel - include( "CaloCosEx/LArCosmicFlags_jobOptions.py" ) - - ## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc - from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - - ## define the DB Gobal Tag : - svcMgr.IOVDbSvc.GlobalTag="COMCOND-ES1S-000-00" - - include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") - include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - include("CaloCosEx/LArSignalReco_Cosmics_jobOptions.py") - from AthenaCommon.BeamFlags import jobproperties - if jobproperties.Global.DataSource.get_Value() == 'data': - theLArRawChannelBuilderPedestalDataBase.LArPedestalKey='Pedestal' - else: - theLArRawChannelBuilderPedestalDataBase.LArPedestalKey='LArPedestal' - -elif Type == 'Ramp': - ## define the DB Gobal Tag : - svcMgr.IOVDbSvc.GlobalTag="COMCOND-ES1S-000-00" - - from LArCalibUtils.LArCalibUtilsConf import LArRampBuilder - theLArRampBuilder = LArRampBuilder() - theLArRampBuilder.KeyList = [ "HIGH", "MEDIUM", "LOW" ] # = [ LArMonFlags.LArDigitKey() ] - theLArRampBuilder.SubtractDac0 = False - if PeakOF: # doesn't work for now - theLArRampBuilder.RecoType = "OF" - from LArRecUtils.LArRecUtilsConf import LArOFPeakRecoTool - theLArOFPeakRecoTool = LArOFPeakRecoTool() - #theLArOFPeakRecoTool.KeyShape = "LArShape" - theLArOFPeakRecoTool.UseShape = False - ToolSvc += theLArOFPeakRecoTool - else : - theLArRampBuilder.RecoType = "Parabola" - from LArRecUtils.LArRecUtilsConf import LArParabolaPeakRecoTool - theLArParabolaPeakRecoTool = LArParabolaPeakRecoTool() - theLArParabolaPeakRecoTool.correctBias = False - ToolSvc += theLArParabolaPeakRecoTool - theLArRampBuilder.DAC0 = -1 # As the first ramp point no longer is taken at DAC=0, this point should not have a special place. - theLArRampBuilder.StoreRawRamp = True - theLArRampBuilder.StoreRecRamp = True - theLArRampBuilder.Polynom = 1 - theLArRampBuilder.RampRange = 4000; # The first DAC is not substracted, hence saturation occurs above 4000 - theLArRampBuilder.correctBias = False - theLArRampBuilder.ConsecutiveADCs = 0; # As the number of ramppoints was increased to 6, the demand that two points are 50 DAC counts apart no longer works - theLArRampBuilder.minDAC = 10 # minimum DAC value to use in fit - theLArRampBuilder.KeyOutput = "LArRamp" - theLArRampBuilder.DeadChannelCut = -9999 - theLArRampBuilder.GroupingType = "ExtendedFeedThrough" - theLArRampBuilder.OutputLevel = 4 - topSequence += theLArRampBuilder - -elif Type == 'Delay' or Type == 'Cabling': - ## define the DB Gobal Tag : - svcMgr.IOVDbSvc.GlobalTag="COMCOND-ES1S-000-00" - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilder - topSequence += LArCaliWaveBuilder( "LArCaliWaveBuilder" ) - LArCaliWaveBuilder = topSequence.LArCaliWaveBuilder - LArCaliWaveBuilder.KeyList = [LArMonFlags.LArDigitKey()] - LArCaliWaveBuilder.ADCsaturation = 4090 - LArCaliWaveBuilder.SubtractPed = False - LArCaliWaveBuilder.UseDacAndIsPulsedIndex = True # added for HEC, suitable to any subdet ? - - from LArCalibTools.LArCalibToolsConf import LArWaves2Ntuple - topSequence += LArWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple = topSequence.LArCaliWaves2Ntuple - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = ["LArCaliWave"] - -elif Type == 'DelayXtalk': - ## define the DB Gobal Tag : - svcMgr.IOVDbSvc.GlobalTag="COMCOND-ES1S-000-00" - from LArCalibUtils.LArCalibUtilsConf import LArCaliWaveBuilderXtalk - topSequence += LArCaliWaveBuilderXtalk("LArCaliWaveBuilderXtalk") - LArCaliWaveBuilderXtalk = topSequence.LArCaliWaveBuilderXtalk - LArCaliWaveBuilderXtalk.KeyList = [LArMonFlags.LArDigitKey()] - LArCaliWaveBuilderXtalk.ADCsaturation = 4090 - LArCaliWaveBuilderXtalk.CalibPattern = "StripSingle1" - LArCaliWaveBuilderXtalk.PartitionPulsed = "BarrelA" - LArCaliWaveBuilderXtalk.FeedthroughPul = 10 diff --git a/LArCalorimeter/LArMonTools/share/LArMonByteStream.py b/LArCalorimeter/LArMonTools/share/LArMonByteStream.py deleted file mode 100755 index b9c1830faae1bd7ce52e480723af615c281dc031..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonByteStream.py +++ /dev/null @@ -1,40 +0,0 @@ - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# -if not online: - theByteStreamInputSvc = svcMgr.ByteStreamInputSvc - svcMgr.EventSelector.Input = FullFileName - svcMgr.EventSelector.MaxBadEvents = 0 -else: - theApp.CreateSvc += ["ByteStreamCnvSvc"] - - - -# -# don't know if following lines working or not... should work with release 14 -# -#from LArByteStream.LArByteStreamConf import LArRodDecoder -#theLArRodDecoder = LArRodDecoder(name="LArRodDecoder", -# IgnoreCheckFEBs = [ 0x38080000 ] -# ) - - - -# -# Read LAr Digit depending of the type of the run -# -theByteStreamAddressProviderSvc = svcMgr.ByteStreamAddressProviderSvc -theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] -if Type == 'Pedestal' or Type == 'Cosmic': - theByteStreamAddressProviderSvc.TypeNames +=["LArDigitContainer/LOW"] - theByteStreamAddressProviderSvc.TypeNames +=["LArDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames +=["LArDigitContainer/HIGH"] -else: - if runAccumulator: - include("LArCalibUtils/LArCalib_CalibrationPatterns.py") - else: - theByteStreamAddressProviderSvc.TypeNames +=["LArAccumulatedCalibDigitContainer/LOW"] - theByteStreamAddressProviderSvc.TypeNames +=["LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames +=["LArAccumulatedCalibDigitContainer/HIGH"] - diff --git a/LArCalorimeter/LArMonTools/share/LArMonCalibBuilders.py b/LArCalorimeter/LArMonTools/share/LArMonCalibBuilders.py deleted file mode 100755 index 709047fb22267400b6ce073642eb720756e7ffd4..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonCalibBuilders.py +++ /dev/null @@ -1,34 +0,0 @@ -if Type == 'Ramp': - theApp.TopAlg+=["LArRampBuilder"] # test avec un t majuscule a top - LArRampBuilder=Algorithm("LArRampBuilder") - LArRampBuilder.SubtractDac0=FALSE - LArRampBuilder.DAC0=-1 # As the first ramp point no longer is taken at DAC=0, this point should not have a special place. - LArRampBuilder.StoreRawRamp=TRUE - LArRampBuilder.StoreRecRamp=TRUE - LArRampBuilder.Polynom=1 - LArRampBuilder.WriteDB=False - LArRampBuilder.RecoType="Parabola" - LArRampBuilder.RampRange = 4000; # The first DAC is not substracted, hence saturation occurs above 4000 - LArRampBuilder.correctBias=True; - LArRampBuilder.ConsecutiveADCs=0; # As the number of ramppoints was increased to 6, the demand that two points are 50 DAC counts apart no longer works - LArRampBuilder.KeyList =[ LArMonFlags.LArDigitKey() ] - -elif Type == 'Delay': - theApp.Dlls += ["LArCalibUtils"] - theApp.TopAlg += ["LArCaliWaveBuilder"] - LArCaliWaveBuilder=Algorithm("LArCaliWaveBuilder") - LArCaliWaveBuilder.KeyList = [LArMonFlags.LArDigitKey()] - LArCaliWaveBuilder.ADCsaturation = 4090 - LArCaliWaveBuilder.SubtractPed = False - LArCaliWaveBuilder.RecAllCells = False - LArCaliWaveBuilder.WriteDB = False - LArCaliWaveBuilder.PreviousRunToDB = 1 - # LArCaliWaveBuilder.FolderName = "LArElecCalibTB04" - # - - from LArCalibTools.LArCalibToolsConf import LArWaves2Ntuple - topSequence += LArWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple = topSequence.LArCaliWaves2Ntuple - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = ["LArCaliWave"] - diff --git a/LArCalorimeter/LArMonTools/share/LArMonCalibration.py b/LArCalorimeter/LArMonTools/share/LArMonCalibration.py deleted file mode 100644 index 3b52b45c8caf5b28946486cfe18c6db835804fd4..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonCalibration.py +++ /dev/null @@ -1,77 +0,0 @@ -import commands -import os -import os.path - -online = True -ReadCOOL=True -Type='Delay' - -if online: - include("RecExOnline/SimpleLarCondFlags.py") - if 'partition' not in dir(): - print("problem: partition not defined") - if not 'runAccumulator' in dir(): - runAccumulator = False # :average mode, = True:transparent mode -else: - include("LArMonTools/LArMonVariables.py") - -include("LArConditionsCommon/LArMinimalSetup.py") -include ("LArMonTools/LArMonByteStream.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") -topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False -topSequence.LArFebErrorSummaryMaker.PartitionId = partition -include("LArMonTools/LArMonManager.py") -svcMgr.IOVDbSvc.GlobalTag="COMCOND-MONC-003-00" - -## Define ONE LArBadChannelMask for all Monitoring tools -ProblemsToMask=[ - "deadReadout","deadPhys","short","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise" -] - -conddb.addFolder("LAR","/LAR/BadChannels/BadChannels") -conddb.addFolder("LAR","/LAR/BadChannels/MissingFEBs") - -## Use different jobOpts, to ignore PS FEBs in EM calib runs, and reversed. -if online and partition=='LArgEm': - include("LArMonTools/LArFEBMon_calibEMB_jobOptions.py") -elif online and partition=='BarrelPS': - include("LArMonTools/LArFEBMon_calibPS_jobOptions.py") -else: - include("LArMonTools/LArFEBMon_jobOptions.py") - -## To select additional monitoring tools from the TDAQ GUI -if online: - cmd='is_ls -p %(partition)s -n Monitoring -v -R "Monitoring"' % {"partition" : os.environ['TDAQ_PARTITION'] } - - fi, fo = os.popen2(cmd,'t') - for line in fo: - job = line.strip().split(' ',15)[0] - print('line=%(line)s job=%(job)s' % {"line" : line, "job": job}) - if job == 'DigitNoiseMon' : - include("LArMonTools/LArDigitNoiseMonTool_jobOptions.py") - if job == 'FebNoiseMon' : - include("LArMonTools/LArFebNoiseMonTool_jobOptions.py") - if job == 'FebNoiseMonAlt' : - include("LArMonTools/LArFebNoiseMonAltTool_jobOptions.py") - if job == 'OddCellMon' : - include("LArMonTools/LArOddCellsMonTool_jobOptions.py") - fo.close - -else: - include("LArMonTools/LArFebNoiseMonTool_jobOptions.py") - -## Online database path -if online: - svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/sw/DbData/poolcond/PoolCat_comcond.xml"] - svcMgr.PoolSvc.SortReplicas = False - -include("LArMonTools/LArMonCommonTrailer_jobOptions.py") diff --git a/LArCalorimeter/LArMonTools/share/LArMonCommonHeader_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArMonCommonHeader_jobOptions.py deleted file mode 100755 index d30fe2cbb6b3e2950513cf8438b542b68feffba5..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonCommonHeader_jobOptions.py +++ /dev/null @@ -1,40 +0,0 @@ -########################################################################### -# -# <Christophe.Le.Maner@cern.ch> -# -########################################################################### - -# -# Default values for parameters (input directory, file name etc) -# -include("LArMonTools/LArMonVariables.py") - -####################################################################################### -# print summary -####################################################################################### - -Log = logging.getLogger( "RunLog" ) -Log.info( " ======================================================== " ) -Log.info( " *** LAr Run summary *** " ) -Log.info( " ======================================================== " ) -Log.info( " RunNumber = " + str(RunNumber) ) -Log.info( " SubDetector = " + SubDet ) -Log.info( " Partition = " + Partition ) -Log.info( " Type = " + Type ) -Log.info( " online = " + str(online) ) -if not online: - Log.info( " RootHistOutputFileName = " + RootHistOutputFileName ) - - -include("LArConditionsCommon/LArMinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include ("LArMonTools/LArMonByteStream.py") # ByteStreamInputSvc and ByteStreamAddressProviderSvc -#include("LArMonTools/LArMonBuilders.py") # LArRampBuilder, LArCaliWaveBuilder, LArRawChannelBuilder... - diff --git a/LArCalorimeter/LArMonTools/share/LArMonCommonTrailer_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArMonCommonTrailer_jobOptions.py deleted file mode 100755 index 143b18a7b1754c76afe7e5d6b1af515a6cf3b3a8..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonCommonTrailer_jobOptions.py +++ /dev/null @@ -1,29 +0,0 @@ -#---------------------------------------------------------- -if not online: - from GaudiSvc.GaudiSvcConf import THistSvc - if os.path.exists(RootHistOutputFileName): - os.remove(RootHistOutputFileName) - svcMgr += THistSvc() - svcMgr.THistSvc.Output = ["AllMon DATAFILE='"+RootHistOutputFileName+"' OPT='APPEND'"] - if Type == 'Delay' and DelayNtuple: - theApp.Dlls += [ "RootHistCnv" ] - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = "FILE1 DATAFILE='"+DelayOutputFile+"' OPT='NEW'" - - -# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) -svcMgr.MessageSvc.OutputLevel = 4 -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -if not online: - svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = 5) - from AthenaCommon.AppMgr import theAuditorSvc - from AthenaCommon.ConfigurableDb import getConfigurable - theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = FATAL) - theAuditorSvc += getConfigurable("ChronoAuditor")() - theAuditorSvc += getConfigurable("NameAuditor")() - theApp.EvtMax = EvtNo - diff --git a/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOffline.py b/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOffline.py deleted file mode 100755 index 80a6f07c7bee5b8efc94dc25e5fb9ded95b3eb10..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOffline.py +++ /dev/null @@ -1,22 +0,0 @@ -########################################################################### -# -# <Christophe.Le.Maner@cern.ch> -# -########################################################################### - -# -# Common header to all LArMon jobs -# -include("LArMonTools/LArMonCommonHeader_jobOptions.py") # contains the setting up of athena for the monitoring + rootfile naming + LArBuilders - -include("LArMonTools/LArMonManager.py") # LArMon topSequence defined here - -# -# Specific LAr Monitoring tools you want to include according to the processed run type -# -include("LArMonTools/LArMonTools.py") - -# -# Common trailer to all LArMon jobs -# -include("LArMonTools/LArMonCommonTrailer_jobOptions.py") # here are set the output message levels diff --git a/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOnline.py b/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOnline.py deleted file mode 100644 index 098fd12dc37441e420bad1b1cdfcd57bb65fdaba..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonJobOptionsOnline.py +++ /dev/null @@ -1,65 +0,0 @@ -import os -import os.path - -online = True -ReadCOOL=True -Type='Pedestal' - -#LarDBConnection="<dbConnection>impl=cool;techno=sqlite;schema=/det/lar/project/databases/COMCOND200.db;X:COMP200:</dbConnection>" - -from LArConditionsCommon.LArCondFlags import larCondFlags -larCondFlags.SingleVersion=True -larCondFlags.OFCShapeFolder = "" -# When release will be > 15.0.1, replace the 3 previous lines with : -# include("RecExOnline/SimpleLarCondFlags.py") - -include("LArMonTools/LArMonCommonHeader_jobOptions.py") -include("LArMonTools/LArMonManager.py") -svcMgr.IOVDbSvc.GlobalTag="COMCOND-MONC-001-00" - -# Define ONE LArBadChannelMask for all Monitoring tools -ProblemsToMask=[ - "deadReadout","deadPhys","short","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise" - ] - -#if job == 'FebMon' : -include("LArMonTools/LArFEBMon_jobOptions.py") - -#cmd='is_ls -p %(partition)s -n Monitoring -v -R "Monitoring" | tail -5 ' % {"partition" : os.environ['TDAQ_PARTITION'] } -cmd='is_ls -p %(partition)s -n Monitoring -v -R "Monitoring"' % {"partition" : os.environ['TDAQ_PARTITION'] } - - -fi, fo = os.popen2(cmd,'t') -for line in fo: - job = line.strip().split(' ',15)[0] - print('line=%(line)s job=%(job)s' % {"line" : line, "job": job}) - if job == 'DigitNoiseMon' : - include("LArMonTools/LArDigitNoiseMonTool_jobOptions.py") - if job == 'FebNoiseMon' : - include("LArMonTools/LArFebNoiseMonTool_jobOptions.py") - if job == 'FebNoiseMonAlt' : - include("LArMonTools/LArFebNoiseMonAltTool_jobOptions.py") - if job == 'OddCellMon' : - include("LArMonTools/LArOddCellsMonTool_jobOptions.py") -fo.close - -try: - print('Trying to remove PoolCat_comcond_castor.xml') - svcMgr.PoolSvc.ReadCatalog.remove("prfile:poolcond/PoolCat_comcond_castor.xml") -except ValueError: - print('PoolCat_comcond_castor.xml cannot be removed') - -svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/det/lar/project/databases/cond09_data.000001.lar.COND/PoolFileCatalog.xml"] -svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/det/lar/project/databases/cond08_data.000001.lar.COND/PoolFileCatalog.xml"] -svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/det/lar/project/databases/comcond.000006.lar_conditions.recon.pool.v0000/PoolFileCatalog.xml"] -svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/det/lar/project/databases/comcond.000004.lar_conditions.recon.pool.v0000/PoolFileCatalog.xml"] -svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:/det/lar/project/databases/oflcond.000003.conditions.simul.pool.v0000/PoolFileCatalog.xml"] -svcMgr.PoolSvc.ReadCatalog.remove("xmlcatalog_file:/det/lar/project/databases/poolcond/PoolCat_oflcond.xml") - -include("LArMonTools/LArMyJob.py") - -print(svcMgr.PoolSvc.ReadCatalog) - -# -include("LArMonTools/LArMonCommonTrailer_jobOptions.py") diff --git a/LArCalorimeter/LArMonTools/share/LArMonManager.py b/LArCalorimeter/LArMonTools/share/LArMonManager.py deleted file mode 100755 index d8130607e18178236d5d4fe935a63ea73b72c3af..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonManager.py +++ /dev/null @@ -1,17 +0,0 @@ -print("Welcome in LArMonManager.py") - -from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager -topSequence += AthenaMonManager( "LArMon" ) -LArMon = topSequence.LArMon -LArMon.FileKey = "AllMon" -LArMon.ManualDataTypeSetup = True -##LArMon.DataType = "cosmics" -if online: - LArMon.Environment = "online" - LArMon.CheckEveryNoEvents = 50 -else: - LArMon.Environment = "user" - LArMon.CheckEveryNoEvents = 9999999 -LArMon.ManualRunLBSetup = True -LArMon.Run = 1 -LArMon.LumiBlock = 1 diff --git a/LArCalorimeter/LArMonTools/share/LArMonOutputFileName.py b/LArCalorimeter/LArMonTools/share/LArMonOutputFileName.py deleted file mode 100755 index 2e4dfc659dc13eacca5b21921e2ba87368f32547..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonOutputFileName.py +++ /dev/null @@ -1,45 +0,0 @@ - -rootHisto="RootHistos" -if 'OutName' in dir(): - rootHisto='RootHistos_%(stuff)s' % {"stuff" : OutName} - - -if not online: - if not runAccumulator: - if not 'RootHistOutputFileName' in dir(): - if Type == 'Delay': - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_Wave_avg_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "partition" : Partition} - elif Type == 'Pedestal': - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type, "partition" : Partition} - elif Type == 'Cosmic': - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type} - else: - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s_avg_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type, "partition" : Partition} - if Type == "Pedestal": - if not 'RootHistReferenceFileName' in dir(): - RootHistReferenceFileName='%(dir)s/RootHistos_%(No)d_%(Type)s_%(partition)s.root' % {"dir" : OutputDir, "No" : RefRunNumber, "Type" : Type, "partition" : Partition} - if Type == "Cosmic": - if not 'RootHistReferenceFileName' in dir(): - RootHistReferenceFileName='%(dir)s/RootHistos_%(No)d_%(Type)s_%(partition)s.root' % {"dir" : OutputDir, "No" : RefRunNumber, "Type" : Type, "partition" : Partition} - if Type == 'Delay': - if not 'DelayOutputFile' in dir(): - DelayOutputFile = '%(dir)s/RootHistos_%(No)d_%(Type)s_avg_%(partition)s.root' % {"dir" : OutputNtupleDir, "No" : RunNumber, "Type" : Type, "partition" : Partition} - else: - if Type == 'Delay': - if not 'RootHistOutputFileName' in dir(): - RootHistOutputFileName = '%(dir)s/%(rootHisto)s_%(No)d_%Wave_trans_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type, "partition" : Partition} - if not 'DelayOutputFile' in dir(): - DelayOutputFile = '%(dir)s/RootHistos_%(No)d_%(Type)s_trans_%(partition)s.root' % {"dir" : OutputNtupleDir, "No" : RunNumber, "Type" : Type, "partition" : Partition} - elif Type == 'Pedestal': - if not 'RootHistOutputFileName' in dir(): - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type, "partition" : Partition} - if not 'RootHistReferenceFileName' in dir(): - RootHistReferenceFileName='%(dir)s/RootHistos_%(No)d_%(Type)s_%(partition)s.root' % {"dir" : OutputDir, "No" : RefRunNumber, "Type" : Type, "partition" : Partition} - elif Type == 'Cosmic': - if not 'RootHistOutputFileName' in dir(): - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type} - if not 'RootHistReferenceFileName' in dir(): - RootHistReferenceFileName='%(dir)s/RootHistos_%(No)d_%(Type)s.root' % {"dir" : OutputDir, "No" : RefRunNumber, "Type" : Type} - else: - if not 'RootHistOutputFileName' in dir(): - RootHistOutputFileName='%(dir)s/%(rootHisto)s_%(No)d_%(Type)s_trans_%(partition)s.root' % {"dir" : OutputDir, "rootHisto" : rootHisto, "No" : RunNumber, "Type" : Type, "partition" : Partition} diff --git a/LArCalorimeter/LArMonTools/share/LArMonTools.py b/LArCalorimeter/LArMonTools/share/LArMonTools.py deleted file mode 100755 index 774cb32eb462eb3b7c2f1165735f05b82e41bc63..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonTools.py +++ /dev/null @@ -1,26 +0,0 @@ -# Define ONE LArBadChannelMask for all Monitoring tools -ProblemsToMask=[ - "deadReadout","deadPhys","short","almostDead", - "highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise" - ] - -include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - -from LArMonTools.LArMonFlags import LArMonFlags -if LArMonFlags.doLArFEBMon: - include("LArMonTools/LArFEBMon_jobOptions.py") # Data integrity checks - Includes LArFEBMon tool and LArEventInfo - -if Type == 'Pedestal': - coherent_noise_calibration_run=True - include("LArMonTools/LArNoiseCorrelationMon_jobOptions.py") # Coherent noise plots - - -elif Type == 'Delay': - include("LArMonTools/LArDelayMon_jobOptions.py") # includes LArWaveMon tool and LArJitterMon -# include("LArMonTools/LArXtalk_jobOptions.py") # includes LArWaveXtalk tool -elif Type == 'Ramp': - include("LArMonTools/LArRampMon_jobOptions.py") -elif Type == 'Cosmic': - include("LArMonTools/LArDigitMon_jobOptions.py") -else: - print("Unknown Type !!!") diff --git a/LArCalorimeter/LArMonTools/share/LArMonTools_RTT_postJob.C b/LArCalorimeter/LArMonTools/share/LArMonTools_RTT_postJob.C deleted file mode 100755 index 878d661cb99b6f3bf4b61b5b1edb0ee3f707de3f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonTools_RTT_postJob.C +++ /dev/null @@ -1,246 +0,0 @@ -//##################################################################### -//## AUTHOR: Tayfun Ince (Tayfun.Ince@cern.ch) -//## FILE: LArMonTools_RTT_postJob.C -//## MODIFIED: 2006/04/04 -//## DESCRIPTION: Runs once the RTT finishes the athena job on a -//## pedestal run 1268 for 1k events and dumps some of -//## the histos from the root file to a ps file. -//##################################################################### - -#include <TROOT.h> -#include <TCanvas.h> -#include <TString.h> -#include <TFile.h> -#include <TPostScript.h> -#include <iostream> -#include <iomanip> -using namespace std; - -TFile *rootFile = 0; -TH1 *h1d = 0; -TH2 *h2d = 0; -TString rootFileName = "RootHistos_1268.root"; -TString psFileName = "LArMonTools_RTT_postJob.ps"; -TString dirLArDigit0Noise = "/LArDigit0Noise/"; -TString dirLArRawChannelNoise = "/LArRawChannelNoise/"; -TString dirLArRawChannel = "/LArRawChannel/"; - -//##################################################################### -//##################################################################### -void LArMonTools_RTT_postJob() -{ - gROOT->SetStyle("Plain"); - gStyle->SetPaperSize(TStyle::kUSLetter); - gStyle->SetOptStat("e"); - gStyle->SetStatW(0.12); - gStyle->SetStatFontSize(0.05); - gStyle->SetStatX(0.99); - gStyle->SetStatY(0.99); - - //###################### - // open all files - ofstream textFile("LArMonTools_RTT_postJob.txt"); - textFile << "Processing LArMonTools_RTT_postJob.C...\n"; - Long_t *id, *sz, *flgs, *mt; - int fileExist = gSystem->GetPathInfo(rootFileName, id, sz, flgs, mt); - if(fileExist != 0){ - textFile << "\nERROR ==>> ROOT FILE DOES NOT EXIST!\n"; - return; - } else{ - rootFile = new TFile(rootFileName); - textFile << "\nINFO ==>> FILE:" << rootFileName << " is opened.\n"; - } - if(rootFile->IsZombie()){ - textFile << "\nERROR ==>> NOT A ROOT FILE OR CORRUPTED!\n"; - textFile.close(); - rootFile = 0; - return; - } - TCanvas *canvas = new TCanvas("canvas"); - canvas->Print(psFileName+"["); - - //###################### - // Check existing directories - textFile << "\nINFO ==>> Existing subdirectories in the root file:\n"; - rootFile->cd(); - TKey *key; TIter next(gDirectory->GetListOfKeys()); - while(key = (TKey*)next()){ - TString dirName = key->GetName(); - textFile << setw(12) << " " << dirName << "\n"; - } - - //###################### - // Save all summary plots from LArDigit0Noise and LArRawChannelNoise - canvas->Divide(1,2); - int padIndex = 1; - TList *histoList = new TList(); - int nhisto = 0, counter = 0; - - textFile << "\nINFO ==>> List of histos saved in the ps file:\n"; - - Int_t colors[] = {10, 3, 2}; gStyle->SetPalette(3,colors); - TPaveText *pt= new TPaveText(0.832,0.830,0.99,0.99,"trNDC"); - TText *t1 = pt->AddText("White(0) Unconnected"); - TText *t2 = pt->AddText("Green(1) Good"); - TText *t3 = pt->AddText("Red(2) Warning"); - t2->SetTextColor(3); t3->SetTextColor(2); - pt->SetBorderSize(1); pt->SetTextAlign(12); - - TString dirName = dirLArDigit0Noise; - if(gDirectory->Get(dirName.Remove(3,'/')) != 0){ - rootFile->cd(dirLArDigit0Noise); - if(gDirectory->Get("summary") != 0){ - gDirectory->cd("summary"); - histoList = gDirectory->GetListOfKeys(); - nhisto = histoList->GetSize(); - TIter next(histoList); - while(key = (TKey*)next()){ - TString histoName = key->GetName(); - textFile << setw(12) << " " << histoName << "\n"; - h2d = (TH2*)gDirectory->Get(histoName); - canvas->cd(padIndex); - h2d->SetStats(0); h2d->SetMinimum(0); h2d->SetMaximum(2); - h2d->Draw("COL:TEXT"); pt->Draw(); - if(padIndex == 2){ - canvas->Print(psFileName); - canvas->Clear("D"); - padIndex = 1; - continue; - } - padIndex++; - } - } - } - rootFile->cd(); - nhisto = 0; counter = 0; - histoList->Clear(); - dirName = dirLArRawChannelNoise; - if(gDirectory->Get(dirName.Remove(3,'/')) != 0){ - rootFile->cd(dirLArRawChannelNoise); - if(gDirectory->Get("summary") != 0){ - gDirectory->cd("summary"); - histoList = gDirectory->GetListOfKeys(); - nhisto = histoList->GetSize(); - TIter next(histoList); - while(key = (TKey*)next()){ - TString histoName = key->GetName(); - textFile << setw(12) << " " << histoName << "\n"; - h2d = (TH2*)gDirectory->Get(histoName); - canvas->cd(padIndex); - h2d->SetStats(0); h2d->SetMinimum(0); h2d->SetMaximum(2); - h2d->Draw("COL:TEXT"); pt->Draw(); counter++; - if(padIndex == 2 || counter == nhisto){ - canvas->Print(psFileName); - canvas->Clear("D"); - padIndex = 1; - continue; - } - padIndex++; - } - } - } - - //###################### - // Save all rms plots from LArDigit0Noise and LArRawChannelNoise - canvas->Clear(); - canvas->Divide(2,2); - padIndex = 1; - - rootFile->cd(); - nhisto = 0; counter = 0; - histoList->Clear(); - dirName = dirLArDigit0Noise; - if(gDirectory->Get(dirName.Remove(3,'/')) != 0){ - rootFile->cd(dirLArDigit0Noise); - if(gDirectory->Get("perFebRms") != 0){ - gDirectory->cd("perFebRms"); - histoList = gDirectory->GetListOfKeys(); - nhisto = histoList->GetSize(); - TIter next(histoList); - while(key = (TKey*)next()){ - TString histoName = key->GetName(); - textFile << setw(12) << " " << histoName << "\n"; - h1d = (TH1*)gDirectory->Get(histoName); - canvas->cd(padIndex); - h1d->Draw(); counter++; - if(padIndex == 4 || counter == nhisto){ - canvas->Print(psFileName); - canvas->Clear("D"); - padIndex = 1; - continue; - } - padIndex++; - } - } - } - rootFile->cd(); - nhisto = 0; counter = 0; - histoList->Clear(); - dirName = dirLArRawChannelNoise; - if(gDirectory->Get(dirName.Remove(3,'/')) != 0){ - rootFile->cd(dirLArRawChannelNoise); - if(gDirectory->Get("perFebRms") != 0){ - gDirectory->cd("perFebRms"); - histoList = gDirectory->GetListOfKeys(); - nhisto = histoList->GetSize(); - TIter next(histoList); - while(key = (TKey*)next()){ - TString histoName = key->GetName(); - textFile << setw(12) << " " << histoName << "\n"; - h1d = (TH1*)gDirectory->Get(histoName); - canvas->cd(padIndex); - h1d->Draw(); counter++; - if(padIndex == 4 || counter == nhisto){ - canvas->Print(psFileName); - canvas->Clear("D"); - padIndex = 1; - continue; - } - padIndex++; - } - } - } - - //###################### - // Save all energy plots from LArRawChannel - gStyle->SetOptStat("emr"); - canvas->Clear(); - canvas->Divide(2,2); - padIndex = 1; - - rootFile->cd(); - nhisto = 0; counter = 0; - histoList->Clear(); - dirName = dirLArRawChannel; - if(gDirectory->Get(dirName.Remove(3,'/')) != 0){ - rootFile->cd(dirLArRawChannel); - if(gDirectory->Get("febEnergy") != 0){ - gDirectory->cd("febEnergy"); - histoList = gDirectory->GetListOfKeys(); - nhisto = histoList->GetSize(); - TIter next(histoList); - while(key = (TKey*)next()){ - TString histoName = key->GetName(); - textFile << setw(12) << " " << histoName << "\n"; - h1d = (TH1*)gDirectory->Get(histoName); - canvas->cd(padIndex); - h1d->Draw(); counter++; - if(padIndex == 4 || counter == nhisto){ - canvas->Print(psFileName); - canvas->Clear("D"); - padIndex = 1; - continue; - } - padIndex++; - } - } - } - - // Close all files - textFile << "\nMacro is processed successfully.\n"; - textFile.close(); - canvas->Print(psFileName+"]"); - canvas->Close(); - rootFile->Close(); -} -//##################################################################### diff --git a/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions.py deleted file mode 100755 index 232c39ba1f77d23a48617308c5355102815d5079..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions.py +++ /dev/null @@ -1,26 +0,0 @@ - -# most of them should be initialized already in RecExCommission -ToolSvc = Service( "ToolSvc" ) - -if not 'CheckEveryNoEvents' in dir(): - CheckEveryNoEvents=100 - -#---------------------------------------------------------- -theApp.Dlls += [ "AthenaMonitoring"] -theApp.Dlls += [ "LArMonTools"] -theApp.TopAlg += ["AthenaMon/LArMon1"] -LArMon1 = Algorithm( "LArMon1" ) -LArMon1.CheckEveryNoEvents=CheckEveryNoEvents - -# include all monitoring tools -include ("LArMonTools/LAr2DNoiseMonTool_jobOptions.py" ) -include ("LArMonTools/LArDigitNoiseMonTool_jobOptions.py" ) -# include ("LArMonTools/LArDigitSimpleMonTool_jobOptions.py" ) -#include ("LArMonTools/LArDigMonTool_jobOptions.py" ) -include ("LArMonTools/LArFEBMon_jobOptions.py" ) -#include ("LArMonTools/LArRawChannelMonTool_jobOptions.py" ) -#include ("LArMonTools/LArRawChannelNoiseMonTool_jobOptions.py" ) -include ("LArMonTools/LArScaNoiseMonTool_jobOptions.py" ) -include ("LArMonTools/LArEventInfoMonTool_jobOptions.py" ) -#include ("LArMonTools/LArAccumDigMonTool_jobOptions.py") -#include ("LArMonTools/LArFebNoiseMonTool_jobOptions.py") diff --git a/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions_withOddCells.py b/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions_withOddCells.py deleted file mode 100755 index fdeb466c1e4d98dc42670897d1a9cecf12eb5aea..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonTools_jobOptions_withOddCells.py +++ /dev/null @@ -1,28 +0,0 @@ - -# most of them should be initialized already in RecExCommission -ToolSvc = Service( "ToolSvc" ) - -if not 'CheckEveryNoEvents' in dir(): - CheckEveryNoEvents=100 - -#---------------------------------------------------------- -theApp.Dlls += [ "AthenaMonitoring"] -theApp.Dlls += [ "LArMonTools"] -theApp.TopAlg += ["AthenaMon/LArMon1"] -LArMon1 = Algorithm( "LArMon1" ) -LArMon1.CheckEveryNoEvents=CheckEveryNoEvents - -# include all monitoring tools -#include ("LArMonTools/LAr2DNoiseMonTool_jobOptions.py" ) -#include ("LArMonTools/LArDigitNoiseMonTool_jobOptions.py" ) -# include ("LArMonTools/LArDigitSimpleMonTool_jobOptions.py" ) -#include ("LArMonTools/LArDigMonTool_jobOptions.py" ) -#include ("LArMonTools/LArFEBMon_jobOptions.py" ) -#include ("LArMonTools/LArRawChannelMonTool_jobOptions.py" ) -#include ("LArMonTools/LArRawChannelNoiseMonTool_jobOptions.py" ) -#include ("LArMonTools/LArScaNoiseMonTool_jobOptions.py" ) -include ("LArMonTools/LArEventInfoMonTool_jobOptions.py" ) -#include ("LArMonTools/LArAccumDigMonTool_jobOptions.py") -#include ("LArMonTools/LArFebNoiseMonTool_jobOptions.py") -#include ("LArMonTools/LArOddCellsMonTool_jobOptions.py") -#include ("LArMonTools/LArRoughCorrelMonTool_jobOptions.py") diff --git a/LArCalorimeter/LArMonTools/share/LArMonVariables.py b/LArCalorimeter/LArMonTools/share/LArMonVariables.py deleted file mode 100755 index 19b4a82bb2e3dcedb1a32c95d35dabd5a7ea98e5..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMonVariables.py +++ /dev/null @@ -1,77 +0,0 @@ -# -# All needed variables are set below -# -if 'EvtNo' not in dir(): - EvtNo=10000000 # Number of events to process - -if 'SubDet' not in dir(): - SubDet = 'Barrel' - -if 'InputDir' not in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2009/00102562" - -if 'FullFileName' in dir(): - if 'RunNumber' not in dir(): - RunNumber = int(FullFileName.strip().split('.')[1]) - - if 'Type' not in dir(): - Type = str(FullFileName.strip().split('.')[2].strip().split('-')[1]) - print(Type) - - if 'Partition' not in dir(): - Partition = str(FullFileName.strip().split('.')[6].split('-')[1]) - print(Partition) - - if not 'FullFileNameTab' in dir(): - FullFileNameTab = [ InputDir+"/"+FullFileName ] - - pass - -if 'FullFileName' not in dir(): - include("LArCalibProcessing/GetInputFiles.py") - if 'FilePrefix' not in dir(): - FilePrefix="data18" - FullFileName =[] - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,".*") - if len(FullFileName) == 0: - print("No input files !!!") - sys.exit(-1) - word = FullFileName[0].split('-') - Type = word[1] - - -if not 'online' in dir(): - online = False - -if not 'OutputDir' in dir(): - OutputDir="rootFiles/" - -if not 'OutputNtupleDir' in dir(): - OutputNtupleDir = "rootFiles/" - -if not 'runAccumulator' in dir(): - runAccumulator = False # :average mode, = True:transparent mode - -if not 'RefRunNumber' in dir(): - RefRunNumber = 2095 # runnumber of reference file - -if not 'LArDigitKey' in dir(): - LArMonFlags.LArDigitKey = 'HIGH' # for LArRawChannelBuilder - -if not 'LArRawChannelKey' in dir(): - LArRawChannelKey="LArRawChannels" - - -if not 'DelayNtuple' in dir(): - DelayNtuple = False - -if not 'PeakOF' in dir(): - PeakOF = False - -if not 'simpleBuilder' in dir(): - simpleBuilder = False - -# -# Output file naming -# -include('LArMonTools/LArMonOutputFileName.py') diff --git a/LArCalorimeter/LArMonTools/share/LArMyJob.py b/LArCalorimeter/LArMonTools/share/LArMyJob.py deleted file mode 100644 index 19ec3b573c84d8f4fcf736fa0ecd3477c098180c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArMyJob.py +++ /dev/null @@ -1 +0,0 @@ -## Put your own customization here and enjoy ! diff --git a/LArCalorimeter/LArMonTools/share/LArNoiseCorrelationMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArNoiseCorrelationMon_jobOptions.py deleted file mode 100644 index 0de35029438617373d40d7339acaf8357adc858f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArNoiseCorrelationMon_jobOptions.py +++ /dev/null @@ -1,84 +0,0 @@ -#from LArCellRec.LArNoisyROFlags import larNoisyROFlags - -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 -if 'doNoiseCorr' not in dir(): - doNoiseCorr = True -if 'doCNF' not in dir(): - doCNF = True - - -#Run is Online or Offline: -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -OnlineMode=athenaCommonFlags.isOnline() - - -#some FEBs to be monitored (updated 04 may 2018) -MiniNoiseBurstFlagging_FEBs = ["barrelAft09slot02","barrelAft09slot14","barrelAft10slot10","barrelAft10slot14","barrelAft31slot14","barrelCft08slot14","barrelCft22slot07","barrelCft27slot05","barrelCft27slot14"] -NewlyNoisy_FEBs = ["barrelCft02slot14","barrelCft01slot14","barrelCft07slot09","barrelCft07slot11","barrelCft06slot14"] -NoisyRegionsInOuterWheel_FEBs = ["endcapCft21slot04","endcapCft21slot02","endcapCft02slot04","endcapCft02slot02","endcapCft09slot02","endcapCft09slot03","endcapAft21slot04","endcapAft21slot02","endcapAft21slot03"] -NotNoisyRegionForComparison_FEBs = ["endcapAft02slot04"] -FEBs_from_DQ_run_350440 = ["endcapAft19slot12","endcapAft19slot09","endcapAft20slot09"] - -defaultFEBs=NotNoisyRegionForComparison_FEBs+NoisyRegionsInOuterWheel_FEBs+NewlyNoisy_FEBs+MiniNoiseBurstFlagging_FEBs+FEBs_from_DQ_run_350440 -if 'coherent_noise_febs' in dir(): - defaultFEBs=coherent_noise_febs - pass - -if doNoiseCorr: - ###### LArNoiseCorrelationMon Configuration ############### - from LArMonTools.LArMonToolsConf import LArNoiseCorrelationMon - theLArNoiseCorrelationMon = LArNoiseCorrelationMon(name="LArNoiseCorrelationMon", - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - IsOnline = OnlineMode, - IgnoreBadChannels = True, - ProblemsToMask = ProblemsToMask, - ProcessNEvents = EventBlockSize, - TriggerChain = "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY", - FEBsToMonitor = defaultFEBs, - IsCalibrationRun = False, - ) - - - - - if 'coherent_noise_calibration_run' in dir(): - if coherent_noise_calibration_run: - theLArNoiseCorrelationMon.IsCalibrationRun=True - theLArNoiseCorrelationMon.LArDigitContainerKey=Gain - theLArNoiseCorrelationMon.TriggerChain="" - theLArNoiseCorrelationMon.TrigDecisionTool="" - pass - pass - - if 'coherent_noise_PublishPartialSums' in dir(): - theLArNoiseCorrelationMon.PublishPartialSums = coherent_noise_PublishPartialSums - pass - - LArMon.AthenaMonTools+=[ theLArNoiseCorrelationMon ] - -if doCNF: - ###### LArCoherentNoisefractionMon Configuration ############### - from LArMonTools.LArMonToolsConf import LArCoherentNoisefractionMon - theLArCNFMon = LArCoherentNoisefractionMon(name="LArCoherentNoisefractionMon", - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - IsOnline = OnlineMode, - ProcessNEvents = EventBlockSize, - TriggerChain = "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY", - FEBsToMonitor = defaultFEBs, - IsCalibrationRun = False, - OutputLevel = WARNING - ) - - if 'coherent_noise_calibration_run' in dir(): - if coherent_noise_calibration_run: - theLArCNFMon.IsCalibrationRun=True - theLArCNFMon.LArDigitContainerKey=Gain - theLArCNFMon.TriggerChain="" - theLArCNFMon.TrigDecisionTool="" - pass - pass - - LArMon.AthenaMonTools+=[ theLArCNFMon ] - diff --git a/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py deleted file mode 100755 index d212701429d7869d0d6554f7b7656d37096e3a17..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArNoiseMonTools_jobOptions.py +++ /dev/null @@ -1,40 +0,0 @@ -# all the following stuff was requested by Gabe for the EndCap -ToolSvc.LArDigitNoiseMonTool.febNamesFor2dCorrCoef = ["ALL"]#added by Gabe 14 Feb 2007 -ToolSvc.LArDigitNoiseMonTool.regionIDs = [0] # [0] to turn on all regions, [] to turn off -# ToolSvc.LArDigitNoiseMonTool.resetHistosAtCheckHists = True - -from LArMonTools.LArMonToolsConf import LArFebNoiseMonTool -theLArFebNoiseMonTool = LArFebNoiseMonTool(name="LArFebNoiseMonTool", - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - histoPathBase = "LAr/FebNoiseOldTool", - febIDs = [ 0 ], - TriggerSign = +1, - AlternateSum = False, - SingleTrigger = False, - ## SingleTriggerSide = 1, # 0:C side 1:A side - ## SingleTriggerFT = 1, - ## SingleTriggerSlot = 1 - ) - -#ToolSvc += theLArFebNoiseMonTool -LArMon.AthenaMonTools+=[ theLArFebNoiseMonTool ] - -# ToolSvc.LArFebNoiseMonTool.OutputLevel=DEBUG - -from LArMonTools.LArMonToolsConf import LArFebNoiseMonTool -theLArFebNoiseMonToolAlt = LArFebNoiseMonTool(name="LArFebNoiseMonToolAlt", - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - histoPathBase = "LAr/FebNoiseAltOldTool", - febIDs = [ 0 ], - TriggerSign = +1, - AlternateSum = True, - SingleTrigger = False, - ## SingleTriggerSide = 1, # 0:C side 1:A side - ## SingleTriggerFT = 1, - ## SingleTriggerSlot = 1 - ) - -#ToolSvc += theLArFebNoiseMonToolAlt -LArMon.AthenaMonTools+=[ theLArFebNoiseMonToolAlt ] - -# ToolSvc.LArFebNoiseMonToolAlt.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py deleted file mode 100644 index 711f5791e722151b2d837593164ae2ebb6dd91e0..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_jobOptions.py +++ /dev/null @@ -1,65 +0,0 @@ - -# --- for athena online running -- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - - -from LArMonTools.LArMonToolsConf import LArNoisyROMon - -OnlineMode=athenaCommonFlags.isOnline() - -# variable for testing on ESD -try: - LArNoisyROMonForceTrigger -except NameError: - LArNoisyROMonForceTrigger = False - -from LArCellRec.LArNoisyROFlags import larNoisyROFlags - -theLArNoisyROMon = LArNoisyROMon(name="LArNoisyROMon") -theLArNoisyROMon.IsOnline = OnlineMode -theLArNoisyROMon.ProcessNEvents= EventBlockSize -theLArNoisyROMon.NoisyFEBDefStr = '(>'+str(larNoisyROFlags.BadChanPerFEB())+' chan with Q>'+str(larNoisyROFlags.CellQualityCut())+')' -theLArNoisyROMon.MNBLooseFEBDefStr = '(>'+str(larNoisyROFlags.MNBLooseCut())+' chan with Q>'+str(larNoisyROFlags.CellQualityCut())+')' -theLArNoisyROMon.MNBTightFEBDefStr = '(>'+str(larNoisyROFlags.MNBTightCut())+' chan with Q>'+str(larNoisyROFlags.CellQualityCut())+')' -theLArNoisyROMon.MNBTight_PsVetoFEBDefStr = '(>'+str(larNoisyROFlags.MNBTight_PsVetoCut()[0])+' chan with Q>'+str(larNoisyROFlags.CellQualityCut())+') + PS veto (<'+str(larNoisyROFlags.MNBTight_PsVetoCut()[1])+' channels)' -theLArNoisyROMon.BadFEBCut = larNoisyROFlags.BadFEBCut() - -from RecExConfig.RecFlags import rec -if rec.doTrigger or LArNoisyROMonForceTrigger: - theLArNoisyROMon.doTrigger = True - theLArNoisyROMon.EFNoiseBurstTriggers = [ - "EF_j165_u0uchad_LArNoiseBurst", - "EF_j30_u0uchad_empty_LArNoiseBurst", - "EF_j55_u0uchad_firstempty_LArNoiseBurst", - "EF_j55_u0uchad_empty_LArNoiseBurst", - "EF_xe45_LArNoiseBurst", - "EF_xe55_LArNoiseBurst", - "EF_xe60_LArNoiseBurst", - "EF_j55_u0uchad_firstempty_LArNoiseBurstT", - "EF_j100_u0uchad_LArNoiseBurstT", - "EF_j165_u0uchad_LArNoiseBurstT", - "EF_j130_u0uchad_LArNoiseBurstT", - "EF_j35_u0uchad_empty_LArNoiseBurst", - "EF_j35_u0uchad_firstempty_LArNoiseBurst", - "EF_j80_u0uchad_LArNoiseBurstT" - ] - theLArNoisyROMon.L1NoiseBurstTriggers = [ - "L1_J75", - "L1_J10_EMPTY", - "L1_J30_FIRSTEMPTY", - "L1_J30_EMPTY", - "L1_XE40", - "L1_XE50", - "L1_XE50_BGRP7", - "L1_XE70" - ] - - # for TrigDecisionTool - from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter - cfg = TriggerConfigGetter() -else: - theLArNoisyROMon.doTrigger = False - -#ToolSvc += theLArNoisyROMon -LArMon.AthenaMonTools += [theLArNoisyROMon] diff --git a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py b/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py deleted file mode 100644 index bfe243fed238260bbca23d191e6a648ac96933ca..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArNoisyROMon_standalone.py +++ /dev/null @@ -1,179 +0,0 @@ -# Trying to run standalone only Noisy monitoring on ESD -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -if 'inputFiles' in dir(): - athenaCommonFlags.FilesInput.set_Value_and_Lock(inputFiles.split(',')) - del inputFiles - -if 'outHistFile' not in dir(): - outHistFile="LArMon.root" - -if 'maxEvents' not in dir(): - maxEvents = -1 - -if 'MNBLoose' not in dir(): - MNBLoose=5 - -if 'MNBTight' not in dir(): - MNBTight=17 - -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -#globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.InputFormat.set_Value_and_Lock('pool') -globalflags.DataSource.set_Value_and_Lock('data') -#globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') -# Not sure that this is correct -# In LArCAF, BSRDOInput was used but here; ESDInput does not work... - -from RecExConfig.RecFlags import rec -from RecExConfig.RecAlgsFlags import recAlgs -from RecExConfig.AutoConfiguration import GetProjectName,ConfigureGeo -rec.projectName=GetProjectName() - -ConfigureGeo() - -rec.readRDO.set_Value_and_Lock(False) -rec.readTAG.set_Value_and_Lock(False) -rec.readESD.set_Value_and_Lock(True) -rec.readAOD.set_Value_and_Lock(False) -rec.doWriteESD.set_Value_and_Lock(False) -rec.doWriteAOD.set_Value_and_Lock(False) -rec.doWriteTAG.set_Value_and_Lock(False) -rec.doHist.set_Value_and_Lock(False) -rec.doCBNT.set_Value_and_Lock(False) -rec.doAOD.set_Value_and_Lock(False) -rec.doTrigger.set_Value_and_Lock(False) - -rec.doPerfMon.set_Value_and_Lock(False) -rec.doDPD.set_Value_and_Lock(False) -rec.doWriteAOD=False - -from AthenaCommon.JobProperties import jobproperties -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -DetFlags.Print() - - -#from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit -from AtlasGeoModel import SetupRecoGeometry - -svcMgr.GeoModelSvc.AtlasVersion=globalflags.DetDescrVersion() - -from LArConditionsCommon.LArCondFlags import larCondFlags -include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") -include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") - -# Event selector -import AthenaPoolCnvSvc.ReadAthenaPool -svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() - -if 'conditionsTag' not in dir(): - print("Resolving 'CURRENT' express conditions tag ...") - sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/') - from AtlCoolBKLib import resolveAlias - resolver=resolveAlias() - currentGlobalES=resolver.getCurrentES().replace("*","ST") - print("Found ",currentGlobalES) - svcMgr.IOVDbSvc.GlobalTag=currentGlobalES -else: - svcMgr.IOVDbSvc.GlobalTag=conditionsTag - -from RecExConfig.ObjKeyStore import objKeyStore, CfgKeyStore - -# First block the reading of LArNoisyROSummary from ESD -#objKeyStore.readInputFile('RecExPers/OKS_streamESD.py') -#objKeyStore['inputFile'].removeItem(["LArNoisyROSummary#LArNoisyROSummary"]) - -# unlock EventInfo -from RecAlgs.RecAlgsConf import EventInfoUnlocker -topSequence+=EventInfoUnlocker("UnlockEventInfo") - -# then create a new LArNoisyROSummary - - -from LArCellRec.LArNoisyROFlags import larNoisyROFlags -from LArCellRec.LArCellRecConf import LArNoisyROAlg,LArNoisyROTool -theLArNoisyROTool=LArNoisyROTool(PrintSummary=True, - CellQualityCut=larNoisyROFlags.CellQualityCut(), - BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(), - BadFEBCut=larNoisyROFlags.BadFEBCut(), - MNBLooseCut=MNBLoose, MNBTightCut=MNBTight - ) -theLArNoisyROAlg=LArNoisyROAlg() -theLArNoisyROAlg.OutputKey="LArNoisyROSummary_reco" -theLArNoisyROAlg.Tool=theLArNoisyROTool -theLArNoisyROAlg.writeEventInfo=True - -#theLArNoisyROAlg.BadFEBCut = 2000 -#theLArNoisyROAlg.SaturatedCellQualityCut = 111165535 -#from RecExConfig.ObjKeyStore import objKeyStore -#objKeyStore.addStreamESD("LArNoisyROSummary","LArNoisyROSummary") -topSequence += theLArNoisyROAlg - -# and then run monitoring on it -from GaudiSvc.GaudiSvcConf import THistSvc -svcMgr += THistSvc() - -svcMgr.THistSvc.Output += ["LArMon DATAFILE='"+outHistFile+"' OPT='RECREATE'"] - -from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager -larRawMon=False -larESDMon=True -from AthenaMonitoring.DQMonFlags import DQMonFlags -from LArMonTools.LArMonFlags import LArMonFlags -LArMonFlags.doLArDigitMon = False -LArMonFlags.EventBlockSize = 0 - -LArMon = AthenaMonManager(name="LArMonManager", - FileKey = "LArMon", - Environment = DQMonFlags.monManEnvironment(), - ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), - DataType = DQMonFlags.monManDataType()) -topSequence += LArMon - -from LArMonTools.LArMonToolsConf import LArNoisyROMon - -# variable for testing on ESD -try: - LArNoisyROMonForceTrigger -except NameError: - LArNoisyROMonForceTrigger = False - -from LArCellRec.LArNoisyROFlags import larNoisyROFlags - -theLArNoisyROMon = LArNoisyROMon(name="LArNoisyROMon") -theLArNoisyROMon.IsOnline = False -theLArNoisyROMon.inputKey = "LArNoisyROSummary_reco" -theLArNoisyROMon.ProcessNEvents= LArMonFlags.EventBlockSize() -theLArNoisyROMon.NoisyFEBDefStr = '(>'+str(larNoisyROFlags.BadChanPerFEB())+' chan with Q>'+str(larNoisyROFlags.CellQualityCut())+')' #LArNoisyROCutHelper('BadChanPerFEB') -theLArNoisyROMon.BadFEBCut = larNoisyROFlags.BadFEBCut() #LArNoisyROFEBCutHelper() -theLArNoisyROMon.doTrigger = False -theLArNoisyROMon.doHisto = False - -#ToolSvc += theLArNoisyROMon -LArMon.AthenaMonTools += [theLArNoisyROMon] - -######### -from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr -svcMgr += AthenaEventLoopMgr() -svcMgr.AthenaEventLoopMgr.EventPrintoutInterval = 100 - -theApp.EvtMax=maxEvents - -svcMgr.MessageSvc.Format = "% F%50W%S%7W%R%T %0W%M" -svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -svcMgr.MessageSvc.useColors = False -svcMgr.MessageSvc.defaultLimit=1000000 -#svcMgr.MessageSvc.OutputLevel=DEBUG - diff --git a/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py deleted file mode 100755 index 0c71fc6c7511bbc5b580d29c116907895dbc15cf..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArRODMonTool_jobOptions.py +++ /dev/null @@ -1,122 +0,0 @@ -# --- for athena online running --- -if 'EventBlockSize' not in dir(): - EventBlockSize=0 - -if 'dumpdir' not in dir(): - dumpdir = "" # "" - -######## NOTE ON OPTIONS FOR LArRODMonTool ###### -### TimeOFCUnitOnline --> This depends on the version of OnlineDB/WeightsMaker (old version prepare OFC with LSB = 1ns, new version prepare OFC with LSB = 10ps) -### TimeOFCUnitOffline --> Time offline is given in picoseconds, so this should be set to 1. If you want time offline in ns, set to 1000. -### -### WARNING : This goes along with a proper version of LArCnv/LArByteStream/LArRodBlockPhysicsV5 ! ( >= LArByteStream-00-01-13 for "new" WeightsMaker) -### WARNING : Ranges and precision values should be adapted to these units ! : -### -### If "old" weightsmaker, precision is 1ns for all ranges: -### -### PrecisionTRange0 = 1000, # ps -### PrecisionTRange1 = 1000, -### PrecisionTRange2 = 1000, -### PrecisionTRange3 = 1000, -### PrecisionTRangeMax = 1000, -### -### If "new" weightsmaker, precision is : -### PrecisionTRange0 = 10, # ps -### PrecisionTRange1 = 20, -### PrecisionTRange2 = 30, -### PrecisionTRange3 = 50, -### PrecisionTRangeMax = 50, -### -### -### TQthreshold --> threshold to calculate T and Q in the DSP. Typical value is 250 MeV, however some tests are made with this threshold at 0. -################################################# - - -# Retrieve first sample from DB if possible. Default is 3, most usual case in 7 samples. -# This info will be used to tune the timeOffset option (default is 0 for now) -from LArConditionsCommon.LArCool import larcool -if (larcool is not None): - firstsample = larcool.firstSample() -else: - firstsample = 3 - -#timeoffset = (firstsample - 3) or (3 - firstsample) ... to be checked. - -from LArMonTools.LArMonToolsConf import LArRODMonTool -theLArRODMonTool = LArRODMonTool(name="LArRODMonTool", - LArDigitContainerKey = LArMonFlags.LArDigitKey(), - useEvtCounter = True, - LArRawChannelKey_fromBytestream = "LArRawChannels", #for Tier0 - LArRawChannelKey_fromDigits = "LArRawChannels_FromDigits", #for Tier0 -# LArRawChannelKey_fromBytestream = "LArRawChannels_fB", #for lxplus and online -# LArRawChannelKey_fromDigits = "LArRawChannels", #for lxplus and online - DigitsFileName = dumpdir + "digits.txt", - EnergyFileName = dumpdir + "energy.txt", - AiFileName = dumpdir + "Calib_ai.dat", - DumpCellsFileName = dumpdir + "DumpCells.txt", - DoDspTestDump = False, #F - DoCellsDump = False, #F - DoCheckSum = True, # Check the Checksum - DoRodStatus = True, # Check the Rod Status - PrintEnergyErrors = True, #True, - # Energy ranges (in MeV) - ERange0 = 8192, # MeV - ERange1 = 65536, - ERange2 = 524288, - ERange3 = 4194304, - # Time ranges (in ps) - TRange0 = 1000, # ps - TRange1 = 5000, - TRange2 = 25000, - TRange3 = 50000, - # Quality factor ranges - # Only 1 range for now, and Q < 2^16 anyway - QRange0 = 65536, # only one range for now ... - QRange1 = 65536, - QRange2 = 65536, - QRange3 = 65536, - # Expected precision for E calculation (in MeV) - #PrecisionERange0 = 1, # MeV (Precision on E is on Eoff - Eonl) - #PrecisionERange1 = 8, - #PrecisionERange2 = 64, - #PrecisionERange3 = 512, - #PrecisionERangeMax = 8192, - - #Adding 1MeV on request of Alexis (truncating difference) (May 2016): - - PrecisionERange0 = 2, # MeV (Precision on E is on Eoff - Eonl) - PrecisionERange1 = 9, - PrecisionERange2 = 65, - PrecisionERange3 = 513, - PrecisionERangeMax = 8192, - - - # Expected precision for T calculation (in ps) - PrecisionTRange0 = 340, # ps (Precision on T is on Toff - Tonl) - PrecisionTRange1 = 340, - PrecisionTRange2 = 340, - PrecisionTRange3 = 340, - PrecisionTRangeMax = 340, - # Expected precision for Q calculation - PrecisionQRange0 = 3, # ADC (Precision on Q is on (Qoff - Qonl)/Sqrt(Qoff)) - PrecisionQRange1 = 3, - PrecisionQRange2 = 3, - PrecisionQRange3 = 3, - PrecisionQRangeMax = 3, - # Some other flags - ProblemsToMask = ProblemsToMask, - SkipKnownProblematicChannels = False, - SkipNullPed = False, - SkipNullQT = True, - TimeOFCUnitOnline = 1., - TimeOFCUnitOffline = 1., - TimeOffset = 0., # BC # just to keep the possibility to offset the time by hand - ADCthreshold = 0, - peakTimeCut = 5., - IsOnline = False, - numberOfLB = 3000., - Streams = ["express","L1Calo","L1CaloEM","CosmicCalo","MinBias"], - ProcessNEvents = EventBlockSize - ) - -LArMon.AthenaMonTools+=[ theLArRODMonTool ] diff --git a/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py deleted file mode 100755 index 316f5c09f86534ddfaa257ce673abf097ce903b7..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/share/LArRawChannelMonTool_jobOptions.py +++ /dev/null @@ -1,160 +0,0 @@ -# --- for athena online running --- -# For Atlas Ready Filter. Not needed. -from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool - -from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg -CaloNoiseCondAlg ('totalNoise') - -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() - - -# ---- Local Variables ---- -# ---specify trigger tool and trigger chain here -LArRawChannelMonTool_TrigToolName = "Trig::TrigDecisionTool/TrigDecisionTool" -LArRawChannelMonTool_TriggerChain = "L1_RD0_EMPTY" #"L1_RD0_FILLED" - -# --- LArRawChannelMon configuration --- -from LArMonTools.LArMonToolsConf import LArRawChannelMonTool -LArRawChannelMon = LArRawChannelMonTool( - # --- set up mon tool --- - name = "LArRawChannelMon", - LArRawChannelContainerKey = "LArRawChannels", - histoPathBase = "LAr/RawChannelOldTool", - OutputLevel = 3, - # ATLAS Ready Filter Tool - - ATLASReadyFilterTool = [GetAtlasReadyFilterTool()], - - # --- specify trigger options --- - # These will be specified for different streams below - TrigDecisionTool = "", - TriggerChain = "", - #Added by Louis Stream Aware, add the stream this tool should monitor: - noise_streams = [], #["RNDM"] - - # --- delay between procHistograms() calls --- - ProcessNEvents = LArMonFlags.EventBlockSize(), - - # --- histogram thresholds --- - occupancy_thresholds = [ 100 * MeV, # EMBA - 100 * MeV, # EMBC - 100 * MeV, # EMECA - 100 * MeV, # EMECC - 500 * MeV, # HECA - 500 * MeV, # HECC - 700 * MeV, # FCALA - 700 * MeV ],# FCALC - - signal_thresholds = [ -9999. * GeV, # EMBA - -9999. * GeV, # EMBC - -9999. * GeV, # EMECA - -9999. * GeV, # EMECC - -9999. * GeV, # HECA - -9999. * GeV, # HECC - -9999. * GeV, # FCALA - -9999. * GeV ],# FCALC - - pos_noise_thresholds = [ 3, # EMBA - 3, # EMBC - 3, # EMECA - 3, # EMECC - 3, # HECA - 3, # HECC - 3, # FCALA - 3 ],# FCALC - - neg_noise_thresholds = [ 3, # EMBA - 3, # EMBC - 3, # EMECA - 3, # EMECC - 3, # HECA - 3, # HECC - 3, # FCALA - 3 ],# FCALC - - bcid_signal_threshold = 500. * MeV, - time_threshold = 5, - quality_threshold = 65530, - noise_burst_percent_threshold = [ 1, # EMBA - 1, # EMBC - 1, # EMECA - 1, # EMECC - 1, # HECA - 1, # HECC - 2, # FCALA - 2 ],# FCALC - - noise_burst_nChannel_threshold = [ 10, # EMBA - 10, # EMBC - 10, # EMECA - 10, # EMECC - 10, # HECA - 10, # HECC - 10, # FCALA - 10 ],# FCALC - - - # --- Histogram Types --- - monitor_occupancy = False, - monitor_signal = LArMonFlags.doLArRawMonitorSignal(), - - monitor_positive_noise = LArMonFlags.doLArRawMonitorSignal(), - monitor_negative_noise = LArMonFlags.doLArRawMonitorSignal(), - monitor_time = False, - monitor_quality = LArMonFlags.doLArRawMonitorSignal(), - - # --- Detector Views --- - monitor_febs = False, - monitor_feedthroughs = False, - monitor_detectors = True, - - # --- OFC as peak finder only --- - db_and_ofc_only = True, - - # --- histogram registration --- - interval = "run", - - ProblemsToMask = ProblemsToMask, - # Number of luminosity blocks to display in histograms - n_lumi_blocks = 3000, - -) - - -## Monitor signal and noise if cosmic run is being taken. Feb 2012 - VB -from AthenaCommon.BeamFlags import jobproperties -if jobproperties.Beam.beamType.get_Value() == 'cosmics': - CaloNoiseCondAlg ('electronicNoise') - LArRawChannelMon.NoiseKey = 'electronicNoise' - LArRawChannelMon.monitor_signal=True - LArRawChannelMon.monitor_positive_noise=True - LArRawChannelMon.monitor_negative_noise=True - - -#The next line is actually getting all the information. I'm sure this is available offline at the T0, but -#this shouldn't be available online, so be careful when you use it.... - -#TK: Only do this when trigger is enabled. - -from AthenaMonitoring.DQMonFlags import DQMonFlags - -if DQMonFlags.useTrigger() and not athenaCommonFlags.isOnline(): - from PyUtils.MetaReaderPeeker import metadata - # this retrieve the stream the file open belongs to the output is like: express_express or physics_CosmicCalo - # so retrieve the chain, split it in the "_" char and get the second part (ie CosmicCalo or express...) - if "stream" in metadata: - if '_' in metadata['stream']: - streamFromFile = metadata['stream'].split("_")[1] - if streamFromFile == 'express': - LArRawChannelMon.noise_streams = ["RNDM"] - LArRawChannelMon.TrigDecisionTool = LArRawChannelMonTool_TrigToolName - LArRawChannelMon.TriggerChain = LArRawChannelMonTool_TriggerChain - if streamFromFile == 'RNDM': - LArRawChannelMon.noise_streams = ["RNDM"] - LArRawChannelMon.TrigDecisionTool = LArRawChannelMonTool_TrigToolName - LArRawChannelMon.TriggerChain = LArRawChannelMonTool_TriggerChain - -# --- register with toolservice --- -#ToolSvc += LArRawChannelMon -LArMon.AthenaMonTools+=[ LArRawChannelMon ] diff --git a/LArCalorimeter/LArMonTools/src/LArAffectedRegions.cxx b/LArCalorimeter/LArMonTools/src/LArAffectedRegions.cxx deleted file mode 100644 index c095af5014c8474e4d01bcb4c5e5adea71980586..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArAffectedRegions.cxx +++ /dev/null @@ -1,604 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArAffectedRegions.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Jessica Leveque -// -// Class for monitoring : Map of Affected Regions -// built from "Affected Region" metadata, stored in ESDs. -// ******************************************************************** - -#include "LArAffectedRegions.h" - -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" -#include "TMath.h" -#include "TString.h" - -#include "CaloConditions/CaloAffectedRegionInfoVec.h" - -#include <sstream> -#include <iomanip> -#include <fstream> -#include <string> -#include <vector> -#include <cstdlib> -#include <functional> -#include <map> -#include <utility> - -using namespace std; - -/*---------------------------------------------------------*/ -LArAffectedRegions::LArAffectedRegions(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_rootStore(nullptr) - { - declareProperty("IsOnline",m_isonline=false); - declareProperty("EtaGranularity",m_delta_eta=0.01); - declareProperty("PhiGranularity",m_delta_phi=0.01); - - m_eventsCounter = 0; - - m_hLArAffectedRegionsEMBPS[0] = nullptr; - m_hLArAffectedRegionsEMBPS[1] = nullptr; - - m_hLArAffectedRegionsEMB[0] = nullptr; - m_hLArAffectedRegionsEMB[1] = nullptr; - - m_hLArAffectedRegionsEMECPS[0] = nullptr; - m_hLArAffectedRegionsEMECPS[1] = nullptr; - - m_hLArAffectedRegionsEMEC[0] = nullptr; - m_hLArAffectedRegionsEMEC[1] = nullptr; - - m_hLArAffectedRegionsHECA[0] = nullptr; - m_hLArAffectedRegionsHECA[1] = nullptr; - m_hLArAffectedRegionsHECA[2] = nullptr; - m_hLArAffectedRegionsHECA[3] = nullptr; - - m_hLArAffectedRegionsHECC[0] = nullptr; - m_hLArAffectedRegionsHECC[1] = nullptr; - m_hLArAffectedRegionsHECC[2] = nullptr; - m_hLArAffectedRegionsHECC[3] = nullptr; - - m_hLArAffectedRegionsFCALA[0] = nullptr; - m_hLArAffectedRegionsFCALA[1] = nullptr; - m_hLArAffectedRegionsFCALA[2] = nullptr; - - m_hLArAffectedRegionsFCALC[0] = nullptr; - m_hLArAffectedRegionsFCALC[1] = nullptr; - m_hLArAffectedRegionsFCALC[2] = nullptr; - - } - -/*---------------------------------------------------------*/ -LArAffectedRegions::~LArAffectedRegions() -{ -} - -/*---------------------------------------------------------*/ -StatusCode -LArAffectedRegions::initialize() -{ - ATH_MSG_DEBUG( "Initialize LArAffectedRegions" ); - - ManagedMonitorToolBase::initialize().ignore(); - - ATH_CHECK(m_affKey.initialize()); - - ATH_MSG_DEBUG( "Successful Initialize LArAffectedRegions " ); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArAffectedRegions::bookHistograms() -{ - ATH_MSG_DEBUG( "in bookHists()" ); - - // if(isNewRun ){ // Commented by B.Trocme to comply with new ManagedMonitorToolBase - - // Create top folder for histos - MonGroup generalGroup( this, "/LAr/AffectedRegionsOldTool", run, ATTRIB_MANAGED,"", "weightedAverage"); - - // EM Calorimeter - Barrel - PS - m_hLArAffectedRegionsEMBPS[0] = TH2I_LW::create("LArAffectedRegionsEMBAPS", - "HV Affected Regions - EMBA - Presampler", - 8, 0.,1.6,32,-3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsEMBPS[0]); - generalGroup.regHist(m_hLArAffectedRegionsEMBPS[0]).ignore(); - - m_hLArAffectedRegionsEMBPS[1] = TH2I_LW::create("LArAffectedRegionsEMBCPS", - "HV Affected Regions - EMBC - Presampler", - 8,-1.61, -0.01,32,-3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsEMBPS[1]); - generalGroup.regHist(m_hLArAffectedRegionsEMBPS[1]).ignore(); - - // EM Calorimeter - Barrel - Layers 1-3 - m_hLArAffectedRegionsEMB[0] = TH2I_LW::create("LArAffectedRegionsEMBA", - "HV Affected Regions - EMBA - Samplings 1-3", - 7,0.,1.4,128,-3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsEMB[0]); - generalGroup.regHist(m_hLArAffectedRegionsEMB[0]).ignore(); - - m_hLArAffectedRegionsEMB[1] = TH2I_LW::create("LArAffectedRegionsEMBC", - "HV Affected Regions - EMBC - Samplings 1-3", - 7,-1.41, -0.01,128,-3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsEMB[1]); - generalGroup.regHist(m_hLArAffectedRegionsEMB[1]).ignore(); - - // EM Calorimeter - Endcap - PS - - float etabin_EMECP[] = {1.375,1.50,1.6,1.8,2.0,2.1,2.3,2.5,2.8,3.2}; - float etabin_EMECM[] = {-3.21,-2.81,-2.51,-2.31,-2.11,-2.01,-1.81,-1.61,-1.51,-1.385}; - float phibin_EMECPS[65];float phibin_EMEC[257]; - - for(int ibin=0;ibin<=64;ibin++) phibin_EMECPS[ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/64; - for(int ibin=0;ibin<=256;ibin++) phibin_EMEC[ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/256; - - m_hLArAffectedRegionsEMECPS[0] = TH2I_LW::create("LArAffectedRegionsEMECAPS", - "HV Affected Regions - EMECA - Presampler", - 9,etabin_EMECP,64,phibin_EMECPS); - SetHistoStyle(m_hLArAffectedRegionsEMECPS[0]); - generalGroup.regHist(m_hLArAffectedRegionsEMECPS[0]).ignore(); - - m_hLArAffectedRegionsEMECPS[1] = TH2I_LW::create("LArAffectedRegionsEMECCPS", - "HV Affected Regions - EMECC - Presampler", - 9,etabin_EMECM,64,phibin_EMECPS); - SetHistoStyle(m_hLArAffectedRegionsEMECPS[1]); - generalGroup.regHist(m_hLArAffectedRegionsEMECPS[1]).ignore(); - - // EM Calorimeter - Endcap - Layers 1-3 - m_hLArAffectedRegionsEMEC[0] = TH2I_LW::create("LArAffectedRegionsEMECA", - "HV Affected Regions - EMECA - Samplings 1-3", - 9,etabin_EMECP,256,phibin_EMEC); - SetHistoStyle(m_hLArAffectedRegionsEMEC[0]); - generalGroup.regHist(m_hLArAffectedRegionsEMEC[0]).ignore(); - - m_hLArAffectedRegionsEMEC[1] = TH2I_LW::create("LArAffectedRegionsEMECC", - "HV Affected Regions - EMECC - Samplings 1-3", - 9,etabin_EMECM,256,phibin_EMEC); - SetHistoStyle(m_hLArAffectedRegionsEMEC[1]); - generalGroup.regHist(m_hLArAffectedRegionsEMEC[1]).ignore(); - - - // HEC - for(int iS=0;iS<4;iS++){ - m_hLArAffectedRegionsHECA[iS] = TH2I_LW::create(Form("LArAffectedRegionsHECA%i",iS), - Form("HV Affected Regions - HECA - Layer %i",iS+1), - 1,1.5, 3.2, 32, -3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsHECA[iS]); - generalGroup.regHist(m_hLArAffectedRegionsHECA[iS]).ignore(); - - m_hLArAffectedRegionsHECC[iS] = TH2I_LW::create(Form("LArAffectedRegionsHECC%i",iS), - Form("HV Affected Regions - HECC - Layer %i",iS+1), - 1,-3.21, -1.51, 32, -3.15, 3.15); - SetHistoStyle(m_hLArAffectedRegionsHECC[iS]); - generalGroup.regHist(m_hLArAffectedRegionsHECC[iS]).ignore(); - } - - // FCAL - for(int iS=0;iS<3;iS++){ - m_hLArAffectedRegionsFCALA[iS] = TH2I_LW::create(Form("LArAffectedRegionsFCALA%i",iS), - Form("LAr Affected Regions - FCALA - Layer %i",iS+1), - 1, 2.9, 4.9, 16, -3.2, 3.2); - SetHistoStyle(m_hLArAffectedRegionsFCALA[iS]); - generalGroup.regHist(m_hLArAffectedRegionsFCALA[iS]).ignore(); - - m_hLArAffectedRegionsFCALC[iS] = TH2I_LW::create(Form("LArAffectedRegionsFCALC%i",iS), - Form("LAr Affected Regions - FCALC - Layer %i",iS+1), - 1, -4.91, -3.11, 16, -3.2, 3.2); - SetHistoStyle(m_hLArAffectedRegionsFCALC[iS]); - generalGroup.regHist(m_hLArAffectedRegionsFCALC[iS]).ignore(); - } - - return StatusCode::SUCCESS; - - //}// end isNewRun// Commented by B.Trocme to comply with new ManagedMonitorToolBase - - // return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArAffectedRegions::fillHistograms() -{ - ATH_MSG_DEBUG( "in fillHists()" ); - - m_eventsCounter++; - - if(m_eventsCounter > 1 ) return StatusCode::SUCCESS; - - // Retrieve CaloAffected Regions - if(!m_isonline){ - //Get affected info for this event - SG::ReadCondHandle<CaloAffectedRegionInfoVec> affHdl{m_affKey}; - const CaloAffectedRegionInfoVec* affRegVec=*affHdl; - if (!affRegVec) { - ATH_MSG_WARNING( " Cannot find LArAffectedRegion in DetectorStore " ); - return StatusCode::SUCCESS; - } - - /////////////////////// - // Problem Types // - /////////////////////// - // 0: Missing FEB // - // 1: Non nominal HV // - // 2: Dead HV // - /////////////////////// - - std::vector<CaloAffectedRegionInfo>::const_iterator reg1 = affRegVec->begin(); - std::vector<CaloAffectedRegionInfo>::const_iterator reg2 = affRegVec->end(); - for (;reg1 != reg2; ++reg1) { - const CaloAffectedRegionInfo* region = &(*reg1); - int problem=region->get_problem(); - if (problem == 0) continue; - int layermin=region->get_layer_min(); - int layermax=region->get_layer_max(); - float phimin=region->get_phi_min(); - float phimax=region->get_phi_max(); - float etamin=region->get_eta_min(); - float etamax=region->get_eta_max(); - - ATH_MSG_DEBUG( " Print list of affected regions:" ); - ATH_MSG_DEBUG( region << " " - << region->get_eta_min() << " " << region->get_eta_max() << " " - << region->get_phi_min() << " " << region->get_phi_max() << " " - << region->get_layer_min() << " " << region->get_layer_max() << " " << region->get_problem() ); - ///////////////////////////////// - // Build Affected Regions maps // - ///////////////////////////////// - // CaloSample - ///////////////////////////////// - // PreSamplerB=0, EMB1=1, EMB2=2, EMB3=3 // LAr barrel - // PreSamplerE=4, EME1=5, EME2=6, EME3=7 // LAr EM endcap - // HEC0=8, HEC1=9, HEC2=10, HEC3=11 // Hadronic end cap cal. - // TileBar0=12, TileBar1=13, TileBar2=14 // Tile barrel - // TileGap1=15, TileGap2=16, TileGap3=17 // Tile gap (ITC & scint) - // TileExt0=18, TileExt1=19, TileExt2=20 // Tile extended barrel - // FCAL0=21, FCAL1=22, FCAL2=23 // Forward EM endcap - ///////////////////////////////// - - // EM Barrel - PS - if(layermin==0){ - float eta = etamin+0.01; - while(eta<etamax){ - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin+0.01; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMBPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMBPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin > phimax - }else{ - float phi = phimin+0.01; - while(phi<TMath::Pi()){ - if(eta>=0){ - m_hLArAffectedRegionsEMBPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMBPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi(); - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMBPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMBPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - } - eta+=0.2; - } - } - - // EM Barrel - Other Layers - if(layermin==1){ - float eta = etamin; - while(eta < etamax){ - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin+0.01; - while(phi<phimax){ - if(eta >=0){ - m_hLArAffectedRegionsEMB[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta <0){ - m_hLArAffectedRegionsEMB[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/128); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin > phimax: go over Pi - }else{ - float phi = phimin+0.01; - while(phi<TMath::Pi()){ - if(eta >=0){ - m_hLArAffectedRegionsEMB[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta <0){ - m_hLArAffectedRegionsEMB[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/128); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi(); - while(phi<phimax){ - if(eta >=0){ - m_hLArAffectedRegionsEMB[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta <0){ - m_hLArAffectedRegionsEMB[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMBC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/128); - if(fabs(phi)<1.e-4) phi=0.; - } - } - eta+=0.2; - } - } - - // EM endcap - PS - if(layermin==4){ - float eta = etamin; - while(eta<etamax){ - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMECPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMECPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/64); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin > phimax - }else{ - float phi = phimin+0.01; - while(phi<TMath::Pi()){ - if(eta>=0){ - m_hLArAffectedRegionsEMECPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMECPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/64); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi(); - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMECPS[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECAPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMECPS[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECCPS " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/64); - if(fabs(phi)<1.e-4) phi=0.; - } - } - if(fabs(eta)<2.5)eta+=0.2; - if(fabs(eta)>=2.5)eta+=0.3; - } - } - - // EM Endcap - Other Layers - if(layermin==5){ - float eta = etamin+0.01; - while(eta<etamax){ - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin+0.01; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMEC[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMEC[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/256); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin > phimax - }else{ - float phi = phimin+0.01; - while(phi<TMath::Pi()){ - if(eta>=0){ - m_hLArAffectedRegionsEMEC[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMEC[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/256); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi()+0.01; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsEMEC[0]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsEMEC[1]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "EMECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/256); - if(fabs(phi)<1.e-4) phi=0.; - } - } - if(fabs(eta)>=2.8) eta+=0.4; - else if(fabs(eta)>=2.5)eta+=0.3; - else eta+=0.2; - } - } - - // HEC - if(layermin>=8 && layermin<=11){ - float eta = etamin; - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin+0.01; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsHECA[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsHECC[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin < phimax - }else{ - float phi = phimin+0.01; - while(phi<TMath::Pi()){ - if(eta>=0){ - m_hLArAffectedRegionsHECA[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsHECC[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi(); - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsHECA[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsHECC[layermin-8]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "HECC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/32); - if(fabs(phi)<1.e-4) phi=0.; - } - } - } - - // FCAL - if(layermin>=21 && layermin<=23){ - float eta = etamin; - // phimin < phimax - if(phimin<=phimax){ - float phi = phimin+0.1; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsFCALA[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsFCALC[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/16); - if(fabs(phi)<1.e-4) phi=0.; - } - // phimin > phimax - }else{ - float phi = phimin+0.1; - while(phi<TMath::Pi()){ - if(eta>=0){ - m_hLArAffectedRegionsFCALA[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsFCALC[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/16); - if(fabs(phi)<1.e-4) phi=0.; - } - phi = -TMath::Pi()+0.1; - while(phi<phimax){ - if(eta>=0){ - m_hLArAffectedRegionsFCALA[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALA " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - if(eta<0){ - m_hLArAffectedRegionsFCALC[layermin-21]->Fill(eta,phi,problem); - ATH_MSG_DEBUG( "FCALC " << eta << " " << phi << " " << problem << " " << layermin << " " << layermax << " " << region ); - } - phi+=(2*TMath::Pi()/16); - if(fabs(phi)<1.e-4) phi=0.; - } - } - } - - } // End Calo Affected Regions - } // End of event treatment - return StatusCode::SUCCESS; -} -/*---------------------------------------------------------*/ -StatusCode LArAffectedRegions::procHistograms() -{ - - ATH_MSG_DEBUG( "In procHistograms " ); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -void LArAffectedRegions::SetHistoStyle(TH2I_LW* h) -{ - h->GetXaxis()->SetTitle("#eta"); - h->GetYaxis()->SetTitle("#phi"); - h->SetMinimum(0); - h->SetMaximum(2); - return; -} -/*---------------------------------------------------------*/ - diff --git a/LArCalorimeter/LArMonTools/src/LArAffectedRegions.h b/LArCalorimeter/LArMonTools/src/LArAffectedRegions.h deleted file mode 100644 index 837fb45fdbab1b2d0617cf8c6054f977f1ce3c2c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArAffectedRegions.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArAffectedRegions - * @author Jessica Leveque <jleveque@in2p3.fr> - * - */ - -#ifndef LARMONTOOLS_LARAFFECTEDREGIONS_H -#define LARMONTOOLS_LARAFFECTEDREGIONS_H - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "StoreGate/StoreGateSvc.h" - -#include "StoreGate/ReadCondHandleKey.h" -#include "CaloConditions/CaloAffectedRegionInfoVec.h" - -#include <string> -#include <map> - -class ITHistSvc; - -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" -class TProfile_LW; - -class LArAffectedRegions: public ManagedMonitorToolBase -{ - public: - LArAffectedRegions(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArAffectedRegions(); - - /** @brief Overwrite dummy method from AlgTool */ - StatusCode initialize(); - - /** Book general histograms - * Implement pure virtual methods of IMonitorToolBase */ - StatusCode bookHistograms(); - - /** Called each event */ - StatusCode fillHistograms(); - - /** Regularly called to fill noise maps - * Overwrite dummy method from MonitorToolBase */ - StatusCode procHistograms(); - - /** Style function */ - static void SetHistoStyle(TH2I_LW* h); - - protected: - - // services - ITHistSvc* m_rootStore; - - private: - - SG::ReadCondHandleKey<CaloAffectedRegionInfoVec> m_affKey{this, - "LArAffectedRegionKey", "LArAffectedRegionInfo", "SG key for affected regions cond object"}; - // Properties - bool m_isonline; - float m_delta_phi; - float m_delta_eta; - - // Other things - int m_eventsCounter; - - // Coverage Maps - TH2I_LW* m_hLArAffectedRegionsEMBPS[2]{}; - TH2I_LW* m_hLArAffectedRegionsEMB[2]{}; - TH2I_LW* m_hLArAffectedRegionsEMECPS[2]{}; - TH2I_LW* m_hLArAffectedRegionsEMEC[2]{}; - TH2I_LW* m_hLArAffectedRegionsHECA[4]{}; - TH2I_LW* m_hLArAffectedRegionsHECC[4]{}; - TH2I_LW* m_hLArAffectedRegionsFCALA[3]{}; - TH2I_LW* m_hLArAffectedRegionsFCALC[3]{}; - -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.cxx b/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.cxx deleted file mode 100644 index 5e133534cd83ffe8ae01b2b8954f7078d4b16f42..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.cxx +++ /dev/null @@ -1,593 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// NAME: LArCoherentNoisefractionMon.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: pavol Strizenec, based on codes from M. Spalla and Y. Enari -// -// Computes and plots the coherent noise fraction (CNF) for some group of the channels on the FEB -// -// CNF are computed per FEB. The FEBs to be monitored are set in the JO. -// -// Available parameters in the jo file: -// 1) List of FEBs to be monitored: should be passed as a list of strings of the form 'BarrelCFT00Slot02', case insensitive (corresponding to type LARONLINEID defined in the package atlas/LArCalorimeter/LArMonTools/LArMonTools/LArOnlineIDStrHelper.h). If the list is empty, all FEBs are monitored. -// 2) list of triggers to be used ('TriggerChain'): to be passed as a single string "trigger_chain_1, trigger_chain_2". The default is "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY", for the latter, only events in the abort gap are used, selection done by hand. -// 3) control IsCalibrationRun: to be set to true when running on calibration, it switches off the trigger selection. -// 4) list of groups to be computed, vector of strings, possible values: ["tot","top","bot","left","right","q1","q2","q3","q4","qs1","qs2","qs3","qs4"] - default is empty list, which means all groups are computed -// -// ******************************************************************** - -//Histograms -#include "GaudiKernel/ITHistSvc.h" -#include "LWHists/TProfile_LW.h" -#include "LWHists/TH2F_LW.h" -#include "LWHists/TH1F_LW.h" - -//STL: -#include <sstream> -#include <iomanip> -#include <cmath> -#include <vector> -#include <algorithm> - -//LAr infos: -#include "Identifier/HWIdentifier.h" -#include "LArOnlineIDStrHelper.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRawEvent/LArDigit.h" -#include "LArRawEvent/LArDigitContainer.h" -#include "LArRecEvent/LArNoisyROSummary.h" -#include "TrigDecisionTool/TrigDecisionTool.h" - -//Events infos: -#include "xAODEventInfo/EventInfo.h" - -//for looping on FEBs -#include "LArRawEvent/LArFebHeaderContainer.h" - -//Header: -#include "LArCoherentNoisefractionMon.h" - - -// BCIDs of the abort gap -const int ABORT_GAP_START = 3446; -const int ABORT_GAP_END = 3563; - -static const std::vector<std::string> groupNames={"total","top","bottom","left","right","quad1","quad2","quad3","quad4","interval1","interval2","interval3","interval4"}; -static const std::vector<std::string> groupIn={"tot","top","bot","left","right","q1","q2","q3","q4","qs11","qs22","qs3","qs4"}; -static const std::vector<unsigned> groupNChan={128,64,64,64,64,32,32,32,32,32,32,32,32}; - -/*---------------------------------------------------------*/ -LArCoherentNoisefractionMon::LArCoherentNoisefractionMon(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_strHelper(nullptr), - m_LArOnlineIDHelper(nullptr), - m_nGroups(0) -{ - /** FEBs to be monitored. If empty, all FEBs will be monitored*/ - std::vector<std::string> empty_vector(0); - declareProperty("FEBsToMonitor",m_FEBsToMonitor=empty_vector); - - /** To be set to true when running on calibration run. It swithces off trigger selection*/ - declareProperty("IsCalibrationRun",m_isCalibrationRun=false); - - /** list of the groups to compute **/ - declareProperty("ListOfGroups", m_groupNamesToMonitor={}); - - /**bool use to mask the bad channels*/ - declareProperty("LArDigitContainerKey", m_LArDigitContainerKey = "FREE"); - declareProperty("IsOnline", m_IsOnline=false); -} - -/*---------------------------------------------------------*/ -LArCoherentNoisefractionMon::~LArCoherentNoisefractionMon() -{ -} - -StatusCode -LArCoherentNoisefractionMon::finalize() -{ - ATH_MSG_INFO( "finalHists LArCoherentNoisefractionMon" ); - - /** delete tmp histograms. */ - if(m_IsOnline) - { - for (auto const& feb_entry : m_FEBhistograms) - { - auto histos=feb_entry.second; - if(histos.first) - { - LWHist::safeDelete(&*(histos.first)); - histos.first=nullptr; - } - if(histos.second) - { - LWHist::safeDelete(histos.second); - histos.second=nullptr; - } - } - } - - delete m_strHelper; - return StatusCode::SUCCESS; - -} - -/*---------------------------------------------------------*/ -StatusCode -LArCoherentNoisefractionMon::initialize() -{ - - ATH_MSG_INFO( "Initialize LArCoherentNoisefractionMon" ); - - m_evtCounter=0; - - /** Get LAr Online Id Helper*/ - ATH_CHECK(detStore()->retrieve( m_LArOnlineIDHelper, "LArOnlineID" )); - - - /** Init cabling kay */ - ATH_CHECK(m_cablingKey.initialize()); - - /** Retrieve pedestals container*/ - ATH_CHECK(m_keyPedestal.initialize()); - - /** get the trigger list from the 'm_triggerChainProp'*/ - m_triggers.clear(); - if(m_isCalibrationRun) { - ATH_MSG_INFO( "Running as 'calibration run'. No trigger selection will be applied..."); - } else { - ATH_MSG_DEBUG( "Parsing trigger chain list" ); - StatusCode sc=ManagedMonitorToolBase::parseList(m_triggerChainProp, m_triggers); - if(sc.isFailure()) { - ATH_MSG_ERROR( "Error parsing the trigger chain list, exiting." ); - return StatusCode::FAILURE; - } - } - - /** parse the list of group names **/ - if(m_groupNamesToMonitor.size()==0) { //all groups - ATH_MSG_DEBUG("Running for all groups ..."); - m_nGroups = groupNames.size(); - for (unsigned i=0; i<m_nGroups; ++i) { - m_processGroup.push_back(true); - } - } else { //only selected groups - ATH_MSG_DEBUG("Running for selected groups ..."); - m_processGroup.resize(m_nGroups, false); - for(unsigned group=0; group<m_groupNamesToMonitor.size(); ++group) { - for(unsigned i=0; i< m_nGroups; ++i) { - if(groupIn[i] == m_groupNamesToMonitor[group] ) { // should monitor this group - m_processGroup[group] = true; - ++m_nGroups; - break; - } - } - } - if(m_nGroups==0) { // something wrong - ATH_MSG_ERROR(" List of groups to monitor is not valid !!! "); - return StatusCode::FAILURE; - } - } - - return ManagedMonitorToolBase::initialize(); -} - -/*---------------------------------------------------------*/ -StatusCode -LArCoherentNoisefractionMon::bookHistograms() -{ - /** lar noise correlation */ - m_Nchan=128; - m_chan_low=-0.5; - m_chan_up=127.5; - - MonGroup GroupEMBA( this, "/LAr/CoherentNoiseFraction/EMBA", run, ATTRIB_MANAGED ); - MonGroup GroupEMBC( this, "/LAr/CoherentNoiseFraction/EMBC", run, ATTRIB_MANAGED ); - MonGroup GroupEMECA( this, "/LAr/CoherentNoiseFraction/EMECA", run, ATTRIB_MANAGED ); - MonGroup GroupEMECC( this, "/LAr/CoherentNoiseFraction/EMECC", run, ATTRIB_MANAGED ); - MonGroup GroupHECA( this, "/LAr/CoherentNoiseFraction/HECA", run, ATTRIB_MANAGED ); - MonGroup GroupHECC( this, "/LAr/CoherentNoiseFraction/HECC", run, ATTRIB_MANAGED ); - MonGroup GroupFCALA( this, "/LAr/CoherentNoiseFraction/FCALA", run, ATTRIB_MANAGED ); - MonGroup GroupFCALC( this, "/LAr/CoherentNoiseFraction/FCALC", run, ATTRIB_MANAGED ); - - /**declare strings for histograms title*/ - m_hist_name = "CoherentNoiseFraction_"; - m_hist_title = "Coherent Noise Fraction "; - m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - /** Check which (if any) FEBs we want to monitor*/ - if(m_FEBsToMonitor.size()==0) { - bookAllFEBs(GroupEMBA,GroupEMBC,GroupEMECA,GroupEMECC,GroupHECA,GroupHECC,GroupFCALA,GroupFCALC); - } - else bookSelectedFEBs(GroupEMBA,GroupEMBC,GroupEMECA,GroupEMECC,GroupHECA,GroupHECC,GroupFCALA,GroupFCALC); - - ATH_MSG_DEBUG("m_FEBhistograms size: " << m_FEBhistograms.size()); - - return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArCoherentNoisefractionMon::fillHistograms() -{ - ATH_MSG_DEBUG("in fillHists()" ); - - /**increase internal event counter, for calibration run only */ - m_evtCounter++; - - /** check trigger */ - bool passTrig = m_isCalibrationRun; - if(!m_isCalibrationRun) { - /**EventID is a part of EventInfo, search event informations:*/ - const xAOD::EventInfo* thisEvent=nullptr; - ATH_CHECK(evtStore()->retrieve(thisEvent)); - - if(thisEvent) m_evtId = thisEvent->eventNumber(); else m_evtId = 0; - ATH_MSG_DEBUG("Event nb " << m_evtId ); - - bool passBCID=false; - if(!m_trigDecTool.empty()) { - for(const auto& trig_chain : m_triggers) { - passBCID = ((trig_chain == "HLT_noalg_cosmiccalo_L1RD1_EMPTY")?(thisEvent->bcid() >= ABORT_GAP_START && thisEvent->bcid() <= ABORT_GAP_END):true); - passTrig=(passTrig || (passBCID && m_trigDecTool->isPassed(trig_chain))); - } - } - } - - if (!passTrig) { - ATH_MSG_DEBUG ( " Failed trigger selection " ); - return StatusCode::SUCCESS; - } else { - ATH_MSG_DEBUG ( " Pass trigger selection " ); - } - - /*retrieve cabling*/ - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; - const LArOnOffIdMapping* cabling=*cablingHdl; - if(!cabling) { - ATH_MSG_ERROR("Do not have cabling map with key: "<<m_cablingKey.key()); - return StatusCode::FAILURE; - } - - - /*retrieve pedestal*/ - SG::ReadCondHandle<ILArPedestal> pedestalHdl{m_keyPedestal}; - const ILArPedestal* pedestals=*pedestalHdl; - - /** retrieve LArDigitContainer*/ - const LArDigitContainer* pLArDigitContainer=nullptr; - ATH_CHECK(evtStore()->retrieve(pLArDigitContainer, m_LArDigitContainerKey)); - - /** reset tmp arrays **/ - for (auto & arr_entry : m_div) arr_entry.second.clear(); - - ATH_MSG_DEBUG ( " LArDigitContainer size "<<pLArDigitContainer->size()<<" for key "<<m_LArDigitContainerKey); - /** Define iterators to loop over Digits containers*/ - LArDigitContainer::const_iterator itDig = pLArDigitContainer->begin(); - LArDigitContainer::const_iterator itDig_e= pLArDigitContainer->end(); - - HWIdentifier febID; - unsigned chan; - - /** Loop over digits*/ - for ( ; itDig!=itDig_e;++itDig) { - const LArDigit* pLArDigit = *itDig; - - /** Retrieve pedestals */ - HWIdentifier id = pLArDigit->hardwareID(); - CaloGain::CaloGain gain = pLArDigit->gain(); - float pedestal = pedestals->pedestal(id,gain); - - /** Retrieve samples*/ - const std::vector<short>* digito = &pLArDigit->samples(); - - /** Retrieve once, all the cell info:*/ - febID = m_LArOnlineIDHelper->feb_Id(id); - chan = m_LArOnlineIDHelper->channel(id); - - for(unsigned group=0; group < m_processGroup.size(); ++group) { - - if(!m_processGroup[group]) continue; - try { - std::vector<float> &tmparr=m_div.at(std::make_pair(febID,group)); - short sample=digito->at(2); - float sdiff = sample-pedestal; - if(group==0) { - tmparr.push_back(sdiff); - }else if (group==1 && chan%2==0) { - tmparr.push_back(sdiff); - }else if (group==2 && chan%2==1) { - tmparr.push_back(sdiff); - }else if (group==3 && chan<64) { - tmparr.push_back(sdiff); - }else if (group==4 && chan>63) { - tmparr.push_back(sdiff); - }else if (group==5 && chan%2==0 && chan<64) { - tmparr.push_back(sdiff); - }else if (group==6 && chan%2==1 && chan<64) { - tmparr.push_back(sdiff); - }else if (group==7 && chan%2==0 && chan>63) { - tmparr.push_back(sdiff); - }else if (group==8 && chan%2==1 && chan>63) { - tmparr.push_back(sdiff); - }else if (group==9 && chan<32) { - tmparr.push_back(sdiff); - }else if (group==10 && chan>31 && chan<64) { - tmparr.push_back(sdiff); - }else if (group==11 && chan>63 && chan<96) { - tmparr.push_back(sdiff); - }else if (group==12 && chan>95) { - tmparr.push_back(sdiff); - } - } - catch (const std::out_of_range& oor) { - continue; - } - } //over groups - - }/** End of loop on LArDigit*/ - - for (auto const& feb_entry : m_FEBhistograms) { - if(m_div[feb_entry.first].size() == 0) { - ATH_MSG_WARNING("Zero accumulted array for FEB " << feb_entry.first ); - } - feb_entry.second.first->Fill(calc_sum_dev(&m_div[feb_entry.first])); - feb_entry.second.second->Fill(calc_dev(&m_div[feb_entry.first])); - } - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArCoherentNoisefractionMon::procHistograms() -{ - if(endOfRunFlag()) { - fillInCNF(); - } - return StatusCode::SUCCESS; -} - - - -/*---------------------------------------------------------*/ -/**Compute correlations and fill in the plots*/ -void LArCoherentNoisefractionMon::fillInCNF() -{ - ATH_MSG_DEBUG("fillInCNF()" ); - double tot_noi, noncoh_noi; - double coh_fraction; - int slot, ft; - for (auto const& feb_entry : m_FEBhistograms) { - tot_noi = feb_entry.second.first->getROOTHist()->GetRMS(); - noncoh_noi = feb_entry.second.second->getROOTHist()->GetMean()*groupNChan[feb_entry.first.second]; - double dtmp=tot_noi*tot_noi - noncoh_noi; - slot = m_LArOnlineIDHelper->slot(feb_entry.first.first); - ft = m_LArOnlineIDHelper->feedthrough(feb_entry.first.first); - if(dtmp < 0. || tot_noi == 0) { - ATH_MSG_WARNING("FT "<< ft << " slot " << slot << " group " <<feb_entry.first.second <<" has tot noise " << tot_noi << " but ncoh part :" << noncoh_noi << " with " << groupNChan[feb_entry.first.second] << " channnels"); - coh_fraction=0.; - } else { - coh_fraction=100.*sqrt(tot_noi*tot_noi - noncoh_noi) / (tot_noi/sqrt(groupNChan[feb_entry.first.second]) * groupNChan[feb_entry.first.second]); - } - ATH_MSG_DEBUG("feb_entry.first.second " << feb_entry.first.second ); - // EMB - if(m_LArOnlineIDHelper->isEMBchannel( feb_entry.first.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first.first) ){ - m_h_summary_plot_EMBA[feb_entry.first.second]->SetBinContent( slot, ft+1, coh_fraction); - } - else{ - m_h_summary_plot_EMBC[feb_entry.first.second]->SetBinContent( slot, ft+1, coh_fraction); - } - } - // EMEC - else if(m_LArOnlineIDHelper->isEMECchannel( feb_entry.first.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first.first)){ - m_h_summary_plot_EMECA[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - else{ - m_h_summary_plot_EMECC[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - } - // HEC - else if(m_LArOnlineIDHelper->isHECchannel( feb_entry.first.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first.first)){ - m_h_summary_plot_HECA[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - else{ - m_h_summary_plot_HECC[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - } - // FCAL - else if(m_LArOnlineIDHelper->isFCALchannel( feb_entry.first.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first.first)){ - m_h_summary_plot_FCALA[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - else{ - m_h_summary_plot_FCALC[feb_entry.first.second]->SetBinContent( slot, ft, coh_fraction); - } - } - } -} - - -/*---------------------------------------------------------*/ -/**Loops on selected FEBS to book and define histograms.*/ -void LArCoherentNoisefractionMon::bookSelectedFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - ATH_MSG_INFO( "Booking selected FEBs: " << m_FEBsToMonitor.size() << " provided." ); - std::string aFEB; /**aFEB is the feb to monitor*/ - HWIdentifier febid; - for(uint feb_i=0;feb_i<m_FEBsToMonitor.size();feb_i++) { - aFEB=m_FEBsToMonitor[feb_i]; - febid=m_strHelper->feb_id(aFEB); - if(!febid.is_valid()) { - ATH_MSG_WARNING( "FEB id " << aFEB << " not valid. It will not be monitored." ); - continue; - } - for(unsigned i=0; i<m_processGroup.size(); ++i) { - if(m_processGroup[i]) bookThisFEB(febid, i, grEMBA,grEMBC,grEMECA,grEMECC,grHECA,grHECC,grFCALA,grFCALC); - } - } - // now book summaries for all groups - for(unsigned i=0; i<m_processGroup.size(); ++i) { - if(m_processGroup[i]) { - - TH2F_LW *h_EMBA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMBC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMECA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMECC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_HECA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_HECC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_FCALA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_FCALC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - grEMBA.regHist(h_EMBA).ignore(); - m_h_summary_plot_EMBA.push_back(h_EMBA); - grEMBC.regHist(h_EMBC).ignore(); - m_h_summary_plot_EMBC.push_back(h_EMBC); - grEMECA.regHist(h_EMECA).ignore(); - m_h_summary_plot_EMECA.push_back(h_EMECA); - grEMECC.regHist(h_EMECC).ignore(); - m_h_summary_plot_EMECC.push_back(h_EMECC); - grHECA.regHist(h_HECA).ignore(); - m_h_summary_plot_HECA.push_back(h_HECA); - grHECC.regHist(h_HECC).ignore(); - m_h_summary_plot_HECC.push_back(h_HECC); - grFCALA.regHist(h_FCALA).ignore(); - m_h_summary_plot_FCALA.push_back(h_FCALA); - grFCALC.regHist(h_FCALC).ignore(); - m_h_summary_plot_FCALC.push_back(h_FCALC); - } - }// over groups -} - - -/*---------------------------------------------------------*/ -/**Loops on all FEBS to book and define histograms.*/ -void LArCoherentNoisefractionMon::bookAllFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - ATH_MSG_INFO( "No selected FEBs provided: booking all FEBs."); - - /** loop on FEBs to init histograms */ - std::vector<HWIdentifier>::const_iterator feb_it = m_LArOnlineIDHelper->feb_begin(); - std::vector<HWIdentifier>::const_iterator feb_it_e = m_LArOnlineIDHelper->feb_end(); - for ( ; feb_it!=feb_it_e;++feb_it) { - for(unsigned i=0; i<m_groupNamesToMonitor.size(); ++i) { - if(m_processGroup[i]) bookThisFEB((*feb_it), i, grEMBA,grEMBC,grEMECA,grEMECC,grHECA,grHECC,grFCALA,grFCALC); - } - } - // now book summaries for all groups - for(unsigned i=0; i<m_groupNamesToMonitor.size(); ++i) { - if(m_processGroup[i]) { - - TH2F_LW *h_EMBA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMBC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMECA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_EMECC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_HECA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_HECC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_FCALA = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - TH2F_LW *h_FCALC = TH2F_LW::create((m_hist_name+groupNames[i]).c_str(), (m_hist_title+groupNames[i]).c_str() ,14, 1, 15, 33, 0, 33); - grEMBA.regHist(h_EMBA).ignore(); - m_h_summary_plot_EMBA.push_back(h_EMBA); - grEMBC.regHist(h_EMBC).ignore(); - m_h_summary_plot_EMBC.push_back(h_EMBC); - grEMECA.regHist(h_EMECA).ignore(); - m_h_summary_plot_EMECA.push_back(h_EMECA); - grEMECC.regHist(h_EMECC).ignore(); - m_h_summary_plot_EMECC.push_back(h_EMECC); - grHECA.regHist(h_HECA).ignore(); - m_h_summary_plot_HECA.push_back(h_HECA); - grHECC.regHist(h_HECC).ignore(); - m_h_summary_plot_HECC.push_back(h_HECC); - grFCALA.regHist(h_FCALA).ignore(); - m_h_summary_plot_FCALA.push_back(h_FCALA); - grFCALC.regHist(h_FCALC).ignore(); - m_h_summary_plot_FCALC.push_back(h_FCALC); - } - }// over groups -} - -/*---------------------------------------------------------*/ -/**Book and defines histogramms for a given FEB.*/ -void LArCoherentNoisefractionMon::bookThisFEB(HWIdentifier id, unsigned group, MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - ATH_MSG_DEBUG("Booking " << id.getString() ); - int num_slot = m_LArOnlineIDHelper->slot(id); - int num_feedthrough = m_LArOnlineIDHelper->feedthrough(id); - - std::string this_name=m_strHelper->feb_str(id)+"_"+std::to_string(group)+"_tot"; - std::string slot_feed_title = std::to_string(num_slot) + "_" + std::to_string(num_feedthrough)+"_tot"; - TH1F_LW* h_tot = TH1F_LW::create((this_name).c_str(), slot_feed_title.c_str(), 80, -400., 400.); - - this_name=m_strHelper->feb_str(id)+"_"+std::to_string(group)+"_noncoh"; - slot_feed_title = std::to_string(num_slot) + "_" + std::to_string(num_feedthrough)+"_noncoh"; - TH1F_LW* h_noncoh = TH1F_LW::create((this_name).c_str(), slot_feed_title.c_str(), 120, -40., 200.); - - m_FEBhistograms[std::make_pair(id, group)]=std::make_pair(h_tot,h_noncoh); - m_div[std::make_pair(id, group)]=std::vector<float>(); - - ATH_MSG_DEBUG("size " << m_FEBhistograms.size() ); - if(m_LArOnlineIDHelper->isEMBchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grEMBA.regHist(h_noncoh).ignore(); - grEMBA.regHist(h_tot).ignore(); - } else { - grEMBC.regHist(h_noncoh).ignore(); - grEMBC.regHist(h_tot).ignore(); - } - } else { - if(m_LArOnlineIDHelper->isEMECchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grEMECA.regHist(h_noncoh).ignore(); - grEMECA.regHist(h_tot).ignore(); - } else { - grEMECC.regHist(h_noncoh).ignore(); - grEMECC.regHist(h_tot).ignore(); - } - } else { - if(m_LArOnlineIDHelper->isHECchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grHECA.regHist(h_noncoh).ignore(); - grHECA.regHist(h_tot).ignore(); - } else { - grHECC.regHist(h_noncoh).ignore(); - grHECC.regHist(h_tot).ignore(); - } - } else { - if(m_LArOnlineIDHelper->isFCALchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grFCALA.regHist(h_noncoh).ignore(); - grFCALA.regHist(h_tot).ignore(); - } else { - grFCALC.regHist(h_noncoh).ignore(); - grFCALC.regHist(h_tot).ignore(); - } - } - } - } - } -} - -double LArCoherentNoisefractionMon::calc_dev(std::vector<float> *input_vector) const { - double tmean=0.; - double tdiv = 0.; - for(unsigned it=0;it<input_vector->size();it++) tmean += input_vector->at(it); - tmean = tmean / input_vector->size(); - for(unsigned it=0;it<input_vector->size();it++) tdiv += (tmean - input_vector->at(it))*(tmean - input_vector->at(it)); - tdiv = tdiv / input_vector->size(); - return tdiv; -} - -double LArCoherentNoisefractionMon::calc_sum_dev(std::vector<float> *input_vector) const { - double tsum=0.; - for(unsigned it=0;it<input_vector->size();it++) tsum += input_vector->at(it); - return tsum; -} diff --git a/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.h b/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.h deleted file mode 100644 index 37909d57903de80d87f8953da156cae0e0042783..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoherentNoisefractionMon.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArNoiseCorrelationMon - * @author Pavol Strizenec, based on codes from M. Spalla and Y. Enari - * - */ - -#ifndef LARCOHMON_H -#define LARCOHMON_H - -//inheritance: -#include "AthenaMonitoring/ManagedMonitorToolBase.h" - - -//LAr services: -#include "LArElecCalib/ILArPedestal.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "LArCabling/LArOnOffIdMapping.h" - - -//STL: -#include <string> - - - -class LArOnlineID; -class HWIdentifier; -class LArOnlineIDStrHelper; -class TH2F_LW; -class TH1F_LW; - -class LArCoherentNoisefractionMon: public ManagedMonitorToolBase -{ - - -public: - LArCoherentNoisefractionMon(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArCoherentNoisefractionMon(); - - - - virtual StatusCode initialize() override; - virtual StatusCode finalize() override; - virtual StatusCode bookHistograms() override; - virtual StatusCode fillHistograms() override; - virtual StatusCode procHistograms() override; - -protected: - - - /** services */ - LArOnlineIDStrHelper* m_strHelper; - const LArOnlineID* m_LArOnlineIDHelper; - - /** Handle to cabling */ - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - - /** Handle to pedestal */ - SG::ReadCondHandleKey<ILArPedestal> m_keyPedestal{this,"LArPedestalKey","LArPedestal","SG key of LArPedestal CDO"}; - -private: - - /**correlation histograms*/ - int m_Nchan = 0; - double m_chan_low = 0.0,m_chan_up = 0.0; - std::string m_hist_name; - std::string m_hist_title; - - /** The intermediate histos*/ - std::map<std::pair<HWIdentifier,unsigned>, std::pair<TH1F_LW*,TH1F_LW*> > m_FEBhistograms; - /** per event arrays to compute sigma **/ - std::map<std::pair<HWIdentifier,unsigned>, std::vector<float> > m_div; - - /** Summary histos, vector of 2D histograms FT:slot*/ - std::vector<TH2F_LW *> m_h_summary_plot_EMBA; - std::vector<TH2F_LW *> m_h_summary_plot_EMBC; - std::vector<TH2F_LW *> m_h_summary_plot_EMECA; - std::vector<TH2F_LW *> m_h_summary_plot_EMECC; - std::vector<TH2F_LW *> m_h_summary_plot_HECA; - std::vector<TH2F_LW *> m_h_summary_plot_HECC; - std::vector<TH2F_LW *> m_h_summary_plot_FCALA; - std::vector<TH2F_LW *> m_h_summary_plot_FCALC; - - /** list of FEBs to monitor. FEB names are expected to be of the type LARONLINEID defined in the package atlas/LArCalorimeter/LArMonTools/LArMonTools/LArOnlineIDStrHelper.h e.g. 'BarrelCFT00Slot02' */ - std::vector<std::string> m_FEBsToMonitor; - - /** list of groups of the channels to monitor on each FEB - empty means all**/ - std::vector<std::string> m_groupNamesToMonitor; - std::vector<bool> m_processGroup; - unsigned int m_nGroups; - - /** to avoid asking for triggers in case of a calibration run*/ - bool m_isCalibrationRun; - - /**declare identifier*/ - HWIdentifier m_febID; - - /**other variables used in joboptions*/ - bool m_IsOnline; - - std::string m_LArDigitContainerKey; - - /** Private members*/ - int m_evtId = 0; - std::vector<std::string> m_triggers; - int m_evtCounter = 0; - - /** Declare methods used*/ - void fillInCNF(); - void bookSelectedFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - void bookAllFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - void bookThisFEB(HWIdentifier id, unsigned group, MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - double calc_dev(std::vector<float> *input_vector) const; - double calc_sum_dev(std::vector<float> *input_vector) const; -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.cxx deleted file mode 100755 index 35f8b4650fcfcaf3c4011a2f7aaf7c47cd28b42b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.cxx +++ /dev/null @@ -1,334 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArCollisionTimeMonTool.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Vikas Bansal -// -// Class for monitoring : EC timing from LArCollisionTime Container - -// -// ******************************************************************** - - -#include "LArCollisionTimeMonTool.h" - -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH2F_LW.h" - - -#include "xAODEventInfo/EventInfo.h" - -#include <sstream> -#include <iomanip> -#include <fstream> -#include <string> -#include <vector> -#include <cstdlib> -#include <functional> -#include <map> -#include <utility> -#include <algorithm> - -using namespace std; - -/*---------------------------------------------------------*/ -LArCollisionTimeMonTool::LArCollisionTimeMonTool(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_lumi_blocks( 1500 ), - m_ECTimeDiff(0), - m_ECTimeAvg(0), - m_timeCut(5.0), - m_minCells(2), - m_eWeighted(true), - m_newrun(true), - m_bcid_init(false) -{ - declareProperty( "m_lumi_blocks" , m_lumi_blocks = 1000 ); - declareProperty( "timeDiffCut" , m_timeCut = 5.0 ); - declareProperty( "nCells" , m_minCells = 2 ); - declareProperty( "eWeighted" , m_eWeighted = true ); - declareProperty( "histPath" , m_histPath="LArCollisionTimeOldTool"); - declareProperty( "TrainFrontDistance" , m_distance = 30); - declareProperty( "IsOnline" , m_IsOnline=false); - - m_eventsCounter = 0; - - m_LArCollTime_h = nullptr; - m_LArCollTime_lb_h = nullptr; - m_LArCollTime_lb_timeCut_h = nullptr; - m_LArCollTime_lb_singlebeam_timeCut_h = nullptr; - m_LArCollTime_vs_LB_h = nullptr; - m_LArCollTime_vs_BCID_h = nullptr; - m_LArCollAvgTime_h = nullptr; - m_LArCollAvgTime_vs_LB_h = nullptr; - m_LArCollAvgTime_vs_BCID_h = nullptr; - - m_nhist=1; -} - -/*---------------------------------------------------------*/ -LArCollisionTimeMonTool::~LArCollisionTimeMonTool() -{ - cleanup(); -} - -/*---------------------------------------------------------*/ -StatusCode -LArCollisionTimeMonTool::initialize() { - - ManagedMonitorToolBase::initialize().ignore(); - ATH_CHECK( m_EventInfoKey.initialize() ); - ATH_CHECK( m_key.initialize() ); - ATH_CHECK( m_bcDataKey.initialize() ); - ATH_MSG_DEBUG( "Successful Initialize LArCollisionTimeMonTool " ); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArCollisionTimeMonTool::bookHistograms() { - - cleanup(); //to be sure... - - if(m_IsOnline) m_nhist=2; else m_nhist=1; - // So far 2 histos, all bcid and inside the train - m_LArCollTime_h=new TH1F_LW*[m_nhist]; - m_LArCollAvgTime_h=new TH1F_LW*[m_nhist]; - m_LArCollTime_lb_h=new TH1F_LW*[m_nhist]; - m_LArCollTime_lb_timeCut_h=new TH1F_LW*[m_nhist]; - m_LArCollTime_lb_singlebeam_timeCut_h=new TH1F_LW*[m_nhist]; - m_LArCollTime_vs_LB_h=new TH2F_LW*[m_nhist]; - m_LArCollTime_vs_BCID_h=new TH2F_LW*[m_nhist]; - m_LArCollAvgTime_vs_LB_h=new TH2F_LW*[m_nhist]; - m_LArCollAvgTime_vs_BCID_h=new TH2F_LW*[m_nhist]; - - std::vector<std::string> hnameadd(m_nhist); - if(m_IsOnline) hnameadd={"","_intrain"}; else hnameadd={""}; - std::vector<std::string> htitadd(m_nhist); - if(m_IsOnline) htitadd={"",", inside the train"}; else htitadd={""}; - - MonGroup generalGroupShift( this, "/LAr/"+m_histPath+"/", run, ATTRIB_MANAGED); - MonGroup generalGroupLB( this, "/LAr/"+m_histPath+"/", run, ATTRIB_X_VS_LB, "", "merge"); - //if(isNewRun ){ // Commented by B.Trocme to comply with new ManagedMonitorToolBase - m_newrun=true; - // - // Create top folder for histos - // - for(unsigned i=0; i<m_nhist; ++i) { - m_LArCollTime_h[i] = TH1F_LW::create(("LArCollTime"+hnameadd[i]).data(), - ("LArCollisionTime - difference of avg time from ECC and ECA"+htitadd[i]).data(), - 101, -50.5, 50.5 ); - - m_LArCollTime_h[i]->GetYaxis()->SetTitle("Number of events (weighted by energy/GeV) per ns"); - m_LArCollTime_h[i]->GetXaxis()->SetTitle("<t_{C}> - <t_{A}> (ns)"); - generalGroupShift.regHist(m_LArCollTime_h[i]).ignore(); - - m_LArCollTime_lb_h[i] = TH1F_LW::create(("LArCollTimeLumiBlock"+hnameadd[i]).data(), - ("LArCollisionTime - difference of avg time from ECC and ECA"+htitadd[i]).data(), - 101, -50.5, 50.5 ); - - m_LArCollTime_lb_h[i]->GetYaxis()->SetTitle("Number of events (weighted by energy/GeV) per ns"); - m_LArCollTime_lb_h[i]->GetXaxis()->SetTitle("<t_{C}> - <t_{A}> (ns)"); - generalGroupShift.regHist(m_LArCollTime_lb_h[i]).ignore(); - - - - m_LArCollTime_vs_LB_h[i] = TH2F_LW::create(("LArCollTime_vs_LB"+hnameadd[i]).data(), - ("LArCollisionTime Vs Luminosity Block - difference of avg time of ECC and ECA as a function of luminosity block"+htitadd[i]).data(), - m_lumi_blocks, 0.5, double(m_lumi_blocks)+0.5, 101, -50.5, 50.5 ); - - m_LArCollTime_vs_LB_h[i]->GetXaxis()->SetTitle("Luminosity Block Number"); - m_LArCollTime_vs_LB_h[i]->GetYaxis()->SetTitle("<t_{C}> - <t_{A}> (ns)"); - m_LArCollTime_vs_LB_h[i]->GetZaxis()->SetTitle("Number of events (weighted by energy/GeV)"); - generalGroupLB.regHist(m_LArCollTime_vs_LB_h[i]).ignore(); - - m_LArCollTime_vs_BCID_h[i] = TH2F_LW::create(("LArCollTime_vs_BCID"+hnameadd[i]).data(), - ("LArCollisionTime Vs BCID - difference of avg time of ECC and ECA as a function of BCID"+htitadd[i]).data(), - 3564, 0.5, 3564.5, 101, -50.5, 50.5 ); - - m_LArCollTime_vs_BCID_h[i]->GetXaxis()->SetTitle("Bunch Crossing Number"); - m_LArCollTime_vs_BCID_h[i]->GetYaxis()->SetTitle("<t_{C}> - <t_{A}> (ns)"); - m_LArCollTime_vs_BCID_h[i]->GetZaxis()->SetTitle("Number of events (weighted by energy/GeV)"); - generalGroupShift.regHist(m_LArCollTime_vs_BCID_h[i]).ignore(); - - // Average Time - - m_LArCollAvgTime_h[i] = TH1F_LW::create(("LArCollAvgTime"+hnameadd[i]).data(), - ("LArCollisionAverageTime - avg time of ECC and ECA"+htitadd[i]).data(), - 320, -40., 40. ); - - m_LArCollAvgTime_h[i]->GetYaxis()->SetTitle("Number of events (weighted by energy/GeV) per ns"); - m_LArCollAvgTime_h[i]->GetXaxis()->SetTitle("(<t_{C}> + <t_{A}>) / 2 (ns)"); - generalGroupShift.regHist(m_LArCollAvgTime_h[i]).ignore(); - - m_LArCollAvgTime_vs_LB_h[i] = TH2F_LW::create(("LArCollAvgTime_vs_LB"+hnameadd[i]).data(), - ("LArCollisionAvgTime Vs Luminosity Block - avg time of ECC and ECA as a function of luminosity block"+htitadd[i]).data(), - m_lumi_blocks, 0.5, double(m_lumi_blocks)+0.5, 320, -40., 40. ); - - m_LArCollAvgTime_vs_LB_h[i]->GetXaxis()->SetTitle("Luminosity Block Number"); - m_LArCollAvgTime_vs_LB_h[i]->GetYaxis()->SetTitle("(<t_{C}> + <t_{A}>) / 2 (ns)"); - m_LArCollAvgTime_vs_LB_h[i]->GetZaxis()->SetTitle("Number of events (weighted by energy/GeV)"); - generalGroupLB.regHist(m_LArCollAvgTime_vs_LB_h[i]).ignore(); - - m_LArCollAvgTime_vs_BCID_h[i] = TH2F_LW::create(("LArCollAvgTime_vs_BCID"+hnameadd[i]).data(), - ("LArCollisionAvgTime Vs BCID - avg time of ECC and ECA as a function of luminosity block"+htitadd[i]).data(), - m_lumi_blocks, 0.5, double(m_lumi_blocks)+0.5, 320, -40., 40. ); - - m_LArCollAvgTime_vs_BCID_h[i]->GetXaxis()->SetTitle("Bunch Crossing Number"); - m_LArCollAvgTime_vs_BCID_h[i]->GetYaxis()->SetTitle("(<t_{C}> + <t_{A}>) / 2 (ns)"); - m_LArCollAvgTime_vs_BCID_h[i]->GetZaxis()->SetTitle("Number of events (weighted by energy/GeV)"); - generalGroupShift.regHist(m_LArCollAvgTime_vs_BCID_h[i]).ignore(); - - //Monitoring events as a function of LB when events lie in a time window of +/-10ns - m_LArCollTime_lb_timeCut_h[i] = TH1F_LW::create(("LArCollTimeLumiBlockTimeCut"+hnameadd[i]).data(), - ("Events with abs(<t_{C}> - <t_{A}>) < 10ns as a function of LB"+htitadd[i]).data(), - m_lumi_blocks, 0.5, double(m_lumi_blocks)+0.5 ); - - m_LArCollTime_lb_timeCut_h[i]->GetYaxis()->SetTitle("Number of events per LB"); - m_LArCollTime_lb_timeCut_h[i]->GetXaxis()->SetTitle("Luminosity Block Number"); - generalGroupShift.regHist(m_LArCollTime_lb_timeCut_h[i]).ignore(); - - //Monitoring events as a function of LB when events lie in a time window of +/-[20-30]ns - m_LArCollTime_lb_singlebeam_timeCut_h[i] = TH1F_LW::create(("LArCollTimeLumiBlockSingleBeamTimeCut"+hnameadd[i]).data(), - ("Events with 20 ns < abs(<t_{C}> - <t_{A}>) < 30ns as a function of LB"+htitadd[i]).data(), - m_lumi_blocks, 0.5, double(m_lumi_blocks)+0.5 ); - - m_LArCollTime_lb_singlebeam_timeCut_h[i]->GetYaxis()->SetTitle("Number of events per LB"); - m_LArCollTime_lb_singlebeam_timeCut_h[i]->GetXaxis()->SetTitle("Luminosity Block Number"); - generalGroupShift.regHist(m_LArCollTime_lb_singlebeam_timeCut_h[i]).ignore(); - - } - return StatusCode::SUCCESS; - - // }// end isNewRun - -} - - -/*---------------------------------------------------------*/ -StatusCode -LArCollisionTimeMonTool::fillHistograms() -{ - ATH_MSG_DEBUG( "in fillHists()" ); - - // Increment event counter - m_eventsCounter++; - - // --- retrieve event information --- - SG::ReadHandle<xAOD::EventInfo> event_info{m_EventInfoKey}; - unsigned bunch_crossing_id = 0; - unsigned lumi_block = 0; - //double event_time_minutes = -1; - if (!event_info.isValid()) { - ATH_MSG_ERROR( "Failed to retrieve EventInfo object" ); - return StatusCode::FAILURE; - } - - SG::ReadCondHandle<BunchCrossingCondData> bccd (m_bcDataKey); - const BunchCrossingCondData* bunchCrossing=*bccd; - if (!bunchCrossing) { - ATH_MSG_ERROR("Failed to retrieve Bunch Crossing obj"); - return StatusCode::FAILURE; - } - - // bunch crossing ID: - bunch_crossing_id = event_info->bcid(); - - // luminosity block number - lumi_block = event_info->lumiBlock(); - - if(bunchCrossing->bcType(bunch_crossing_id) == BunchCrossingCondData::Empty) { - ATH_MSG_INFO("BCID: "<<bunch_crossing_id<<" empty ? not filling the coll. time" ); - return StatusCode::SUCCESS; // not filling anything in empty bunches - } - - int bcid_distance = bunchCrossing->distanceFromFront(bunch_crossing_id, BunchCrossingCondData::BunchCrossings); - - // Retrieve LArCollision Timing information - SG::ReadHandle<LArCollisionTime> larTime{m_key}; - if(!larTime.isValid()) - { - ATH_MSG_WARNING( "Unable to retrieve LArCollisionTime with key " << m_key); - return StatusCode::SUCCESS; // Check if failure shd be returned. VB - } else { - ATH_MSG_DEBUG( "LArCollisionTime successfully retrieved from event store" ); - } - - if (!(event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,3))) {// Do not fill histo if noise burst suspected - // Calculate the time diff between ECC and ECA - m_ECTimeDiff = larTime->timeC() - larTime->timeA(); - m_ECTimeAvg = (larTime->timeC() + larTime->timeA()) / 2.0; - if (larTime->ncellA() > m_minCells && larTime->ncellC() > m_minCells && std::fabs(m_ECTimeDiff) < m_timeCut ) { // Only fill histograms if a minimum number of cells were found and time difference was sensible - double weight = 1; - if (m_eWeighted) weight = (larTime->energyA()+larTime->energyC())*1e-3; - m_LArCollTime_h[0]->Fill(m_ECTimeDiff,weight); - m_LArCollTime_lb_h[0]->Fill(m_ECTimeDiff,weight); - m_LArCollTime_vs_LB_h[0]->Fill(lumi_block, m_ECTimeDiff,weight); - m_LArCollTime_vs_BCID_h[0]->Fill(bunch_crossing_id, m_ECTimeDiff,weight); - m_LArCollAvgTime_h[0]->Fill(m_ECTimeAvg,weight); - m_LArCollAvgTime_vs_LB_h[0]->Fill(lumi_block, m_ECTimeAvg,weight); - m_LArCollAvgTime_vs_BCID_h[0]->Fill(bunch_crossing_id, m_ECTimeAvg,weight); - if ( fabs(m_ECTimeDiff) < 10 ) m_LArCollTime_lb_timeCut_h[0]->Fill(lumi_block); - if ( fabs(m_ECTimeDiff) > 20 && fabs(m_ECTimeDiff) < 30 ) m_LArCollTime_lb_singlebeam_timeCut_h[0]->Fill(lumi_block); - if(m_IsOnline && bcid_distance > m_distance) { // fill histos inside the train - ATH_MSG_INFO("BCID: "<<bunch_crossing_id<<" distance from Front: "<<bcid_distance<<"Filling in train..."); - m_LArCollTime_h[1]->Fill(m_ECTimeDiff,weight); - m_LArCollTime_lb_h[1]->Fill(m_ECTimeDiff,weight); - m_LArCollTime_vs_LB_h[1]->Fill(lumi_block, m_ECTimeDiff,weight); - m_LArCollTime_vs_BCID_h[1]->Fill(bunch_crossing_id, m_ECTimeDiff,weight); - m_LArCollAvgTime_h[1]->Fill(m_ECTimeAvg,weight); - m_LArCollAvgTime_vs_LB_h[1]->Fill(lumi_block, m_ECTimeAvg,weight); - m_LArCollAvgTime_vs_BCID_h[1]->Fill(bunch_crossing_id, m_ECTimeAvg,weight); - if ( fabs(m_ECTimeDiff) < 10 ) m_LArCollTime_lb_timeCut_h[1]->Fill(lumi_block); - if ( fabs(m_ECTimeDiff) > 20 && fabs(m_ECTimeDiff) < 30 ) m_LArCollTime_lb_singlebeam_timeCut_h[1]->Fill(lumi_block); - } - } - } - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArCollisionTimeMonTool::procHistograms() -{ - - if(endOfLumiBlockFlag() ){ - // For online monitoring, reset the histogram after Lumi block finishes - for(unsigned i=0; i<m_nhist; ++i) m_LArCollTime_lb_h[i]->Reset(); - } - - ATH_MSG_DEBUG( "End of procHistograms " ); - return StatusCode::SUCCESS; -} - - -void LArCollisionTimeMonTool::cleanup() { - //Delete the array of pointers to histograms - //The histograms themselves should be owned by THistSvc at this point - delete[] m_LArCollTime_h; - m_LArCollTime_h=nullptr; - delete[] m_LArCollTime_lb_h; - m_LArCollTime_lb_h=nullptr; - delete[] m_LArCollTime_lb_timeCut_h; - m_LArCollTime_lb_timeCut_h=nullptr; - delete[] m_LArCollTime_lb_singlebeam_timeCut_h; - m_LArCollTime_lb_singlebeam_timeCut_h=nullptr; - delete[] m_LArCollTime_vs_LB_h; - m_LArCollTime_vs_LB_h=nullptr; - delete[] m_LArCollTime_vs_BCID_h; - m_LArCollTime_vs_BCID_h=nullptr; - delete[] m_LArCollAvgTime_h; - m_LArCollAvgTime_h=nullptr; - delete[] m_LArCollAvgTime_vs_LB_h; - m_LArCollAvgTime_vs_LB_h=nullptr; - delete[] m_LArCollAvgTime_vs_BCID_h; - m_LArCollAvgTime_vs_BCID_h=nullptr; -} - diff --git a/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.h b/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.h deleted file mode 100755 index 0c45dbb7f5f4fa2d982efc585398acad36e13d69..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCollisionTimeMonTool.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArCollisionTimeMonTool - * @author Vikas Bansal <Vikas@uvic.ca> - * - */ - -#ifndef LARMONTOOLS_LARCOLLISIONTIMEMONTOOL_H -#define LARMONTOOLS_LARCOLLISIONTIMEMONTOOL_H - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" - -#include "LArRecEvent/LArCollisionTime.h" - -#include "LumiBlockData/BunchCrossingCondData.h" - -#include <map> -#include <string> -#include <bitset> -#include <vector> -#include "TMath.h" -#include "TTree.h" - -class ITHistSvc; - -class TTree; -class TH1F_LW; -class TH2F_LW; - - -class LArCollisionTimeMonTool: public ManagedMonitorToolBase -{ - public: - LArCollisionTimeMonTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArCollisionTimeMonTool(); - - /** @brief Overwrite dummy method from AlgTool */ - StatusCode initialize(); - - /** Book general histograms - * Implement pure virtual methods of IMonitorToolBase */ - StatusCode bookHistograms(); - - /** Called each event */ - StatusCode fillHistograms(); - - /** Regularly called to fill noise maps - * Overwrite dummy method from MonitorToolBase */ - StatusCode procHistograms(); - - // hack to use this function to update the bcid numbers cache - StatusCode updateBCID(IOVSVC_CALLBACK_ARGS); - - protected: - - // services - //const EventInfo* m_evtInfo; - - //ITHistSvc* m_rootStore; - - private: - - // Properties - unsigned int m_lumi_blocks; - - float m_ECTimeDiff; - float m_ECTimeAvg; - - unsigned m_nhist; - TH1F_LW** m_LArCollTime_h; - TH1F_LW** m_LArCollTime_lb_h; - TH1F_LW** m_LArCollTime_lb_timeCut_h; - TH1F_LW** m_LArCollTime_lb_singlebeam_timeCut_h; - TH2F_LW** m_LArCollTime_vs_LB_h; - TH2F_LW** m_LArCollTime_vs_BCID_h; - TH1F_LW** m_LArCollAvgTime_h; - TH2F_LW** m_LArCollAvgTime_vs_LB_h; - TH2F_LW** m_LArCollAvgTime_vs_BCID_h; - - int m_distance; // distance from train front to fill second histos - bool m_IsOnline; - - // Counters - int m_eventsCounter; - - float m_timeCut; - int m_minCells; - bool m_eWeighted; - bool m_newrun; - - std::vector<unsigned int> m_bcid_allowed; - bool m_bcid_init; - - - std::string m_histPath; - SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"}; - SG::ReadHandleKey<LArCollisionTime> m_key{this, "Key", "LArCollisionTime"}; - SG::ReadCondHandleKey<BunchCrossingCondData> m_bcDataKey - {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"}; - - void cleanup(); -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.cxx deleted file mode 100644 index 77e09633c3dafef56d6c58035b9f7ff08100a47a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.cxx +++ /dev/null @@ -1,466 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArCosmicsMonTool.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Jessica Leveque -// -// Class for monitoring : Detector Timing -// Cosmics Signal Reconstruction -// Development towards LAr Data Quality Flags -// -// ******************************************************************** - -#include "LArCosmicsMonTool.h" - -#include "StoreGate/ReadCondHandle.h" -#include "Identifier/IdentifierHash.h" - -#include <sstream> -#include <iomanip> -#include <fstream> -#include <string> -#include <vector> -#include <cstdlib> -#include <functional> -#include <map> -#include <utility> - -using namespace std; - -// To create a map containing seeds and their energy -struct order { - bool operator()( float s1, float s2 ) const { - return s1 > s2; - } -}; -typedef map<float,pair<Identifier,bool>, order> MAP; - -/*---------------------------------------------------------*/ -LArCosmicsMonTool::LArCosmicsMonTool(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_rootStore(nullptr), - m_newrun(true) -{ - declareProperty("LArDigitContainerKey", m_LArDigitContainerKey = "FREE"); - declareProperty("muonADCthreshold_EM_barrel", m_muonADCthreshold_EM_barrel = 30); - declareProperty("muonADCthreshold_EM_endcap", m_muonADCthreshold_EM_endcap = 40); - declareProperty("muonADCthreshold_HEC", m_muonADCthreshold_HEC = 40); - declareProperty("muonADCthreshold_FCAL", m_muonADCthreshold_FCAL = 40); - - m_eventsCounter = 0; - - m_LArOnlineIDHelper = nullptr; - m_LArEM_IDHelper = nullptr; - m_LArFCAL_IDHelper = nullptr; - m_LArHEC_IDHelper = nullptr; - m_caloIdMgr = nullptr; - - m_hMuonMapEMDig = nullptr; - m_hMuonMapHECDig = nullptr; - m_hMuonMapFCALDig = nullptr; - - for( unsigned i = 0; i < 4; ++i ) - { - m_hMuonTimeEMDig[i] = nullptr; - m_hMuonEnergyEMDig[i] = nullptr; - m_hMuonEvsTimeEMDig[i] = nullptr; - m_hMuonShapeEMDig[i] = nullptr; - } - for( unsigned i = 0; i < 2; ++i ) - { - m_hMuonTimeHECDig[i] = nullptr; - m_hMuonTimeFCALDig[i] = nullptr; - m_hMuonEnergyHECDig[i] = nullptr; - m_hMuonEnergyFCALDig[i] = nullptr; - m_hMuonEvsTimeHECDig[i] = nullptr; - m_hMuonEvsTimeFCALDig[i] = nullptr; - m_hMuonShapeHECDig[i] = nullptr; - m_hMuonShapeFCALDig[i] = nullptr; - } -} - -/*---------------------------------------------------------*/ -LArCosmicsMonTool::~LArCosmicsMonTool() -{ -} - -/*---------------------------------------------------------*/ -StatusCode -LArCosmicsMonTool::initialize() -{ - ATH_MSG_INFO( "Initialize LArCosmicsMonTool" ); - - // Retrieve ID helpers - ATH_CHECK( detStore()->retrieve( m_caloIdMgr ) ); - m_LArEM_IDHelper = m_caloIdMgr->getEM_ID(); - m_LArHEC_IDHelper = m_caloIdMgr->getHEC_ID(); - m_LArFCAL_IDHelper = m_caloIdMgr->getFCAL_ID(); - - ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") ); - - ATH_CHECK(m_bcContKey.initialize()); - ATH_CHECK(m_bcMask.buildBitMask(m_problemsToMask,msg())); - - ATH_CHECK( this->initMonInfo() ); - ATH_CHECK( m_larPedestalKey.initialize() ); - ATH_CHECK( m_cablingKey.initialize() ); - ATH_CHECK( m_caloMgrKey.initialize() ); - // End Initialize - ManagedMonitorToolBase::initialize().ignore(); - ATH_MSG_DEBUG( "Successful Initialize LArCosmicsMonTool " ); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArCosmicsMonTool::bookHistograms() { - - ATH_MSG_DEBUG( "in bookHists()" ); - - // if(isNewRun ){// Commented by B.Trocme to comply with new ManagedMonitorToolBase - m_newrun=true; - // - // Create top folder for histos - // - - MonGroup generalGroupShift( this, "/LAr/CosmicsOldTool/", run, ATTRIB_MANAGED ); - - // Store cells granularity and plots boundaries for each sampling in ECAL - float etaminECAL = -3.2 ; float etamaxECAL = 3.2; - float phiminECAL = -TMath::Pi(); float phimaxECAL = TMath::Pi(); - float detaECAL[] = { 0.025, 0.025/8, 0.025, 0.050}; - float dphiECAL[] = { (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/256), - (float)(2*TMath::Pi()/256)}; - - // Store cells granularity and plots boundaries for each sampling in HCAL - float etaminHCAL = -3.2 ; float etamaxHCAL = 3.2; - float phiminHCAL = -TMath::Pi(); float phimaxHCAL = TMath::Pi(); - float detaHCAL[] = { 0.1, 0.1, 0.1, 0.1}; - float dphiHCAL[] = { (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/64)}; - - // Store cells granularity and plots boundaries in FCAL - float etaminFCAL = -4.9 ; float etamaxFCAL = 4.9; - float phiminFCAL = -TMath::Pi(); float phimaxFCAL = TMath::Pi(); - float detaFCAL[] = {1111, 0.1, 0.2, 0.2}; - float dphiFCAL[] = {1111, - (float)(2*TMath::Pi()/64), - (float)(2*TMath::Pi()/32), - (float)(2*TMath::Pi()/32)}; - - // - // Muon Seeds - Digits - // - - // ECAL - - m_hMuonMapEMDig = new TH2F("Muon2DHitsECAL", - Form("Cosmics Seeds - Digit Max > %i/%i [ADC] in S2 Barrel/Endcap - EM", - int(m_muonADCthreshold_EM_barrel),int(m_muonADCthreshold_EM_endcap)), - int(fabs(etamaxECAL-etaminECAL)/detaECAL[2]),etaminECAL,etamaxECAL, - int(fabs(phimaxECAL-phiminECAL)/dphiECAL[2]),phiminECAL,phimaxECAL); - m_hMuonMapEMDig->GetXaxis()->SetTitle("#eta cell"); - m_hMuonMapEMDig->GetYaxis()->SetTitle("#phi cell"); - m_hMuonMapEMDig->GetZaxis()->SetTitle("Number of Hits"); - generalGroupShift.regHist(m_hMuonMapEMDig).ignore(); - - - // HCAL - - m_hMuonMapHECDig = new TH2F("Muon2DHitsHCAL", - Form("Cosmics Seeds - Digit Max > %i [ADC] in S1 - HEC", int(m_muonADCthreshold_HEC)), - int(fabs(etamaxHCAL-etaminHCAL)/detaHCAL[1]),etaminHCAL,etamaxHCAL, - int(fabs(phimaxHCAL-phiminHCAL)/dphiHCAL[1]),phiminHCAL,phimaxHCAL); - m_hMuonMapHECDig->GetXaxis()->SetTitle("#eta cell"); - m_hMuonMapHECDig->GetYaxis()->SetTitle("#phi cell"); - m_hMuonMapHECDig->GetZaxis()->SetTitle("Number of Hits"); - generalGroupShift.regHist(m_hMuonMapHECDig).ignore(); - - // FCAL - - m_hMuonMapFCALDig = new TH2F("Muon2DHitsFCAL", - Form("Cosmics Seeds - Digit Max > %i [ADC] in S2 - FCAL",int(m_muonADCthreshold_FCAL)), - int(fabs(etamaxFCAL-etaminFCAL)/detaFCAL[1]),etaminFCAL,etamaxFCAL, - int(fabs(phimaxFCAL-phiminFCAL)/dphiFCAL[1]),phiminFCAL,phimaxFCAL); - m_hMuonMapFCALDig->GetXaxis()->SetTitle("#eta cell"); - m_hMuonMapFCALDig->GetYaxis()->SetTitle("#phi cell"); - m_hMuonMapFCALDig->GetZaxis()->SetTitle("Number of Hits"); - generalGroupShift.regHist(m_hMuonMapFCALDig).ignore(); - - return StatusCode::SUCCESS; - - // }// end isNewRun - -// // this is just to avoid warnings at compilation -// else if(isNewLumiBlock || isNewEventsBlock){ -// return StatusCode::SUCCESS; -// } -// -// return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArCosmicsMonTool::fillHistograms() { - const EventContext& ctx = Gaudi::Hive::currentContext(); - ATH_MSG_DEBUG( "in fillHists()" ); - StatusCode sc; - - // Increment event counter - m_eventsCounter++; - - SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx}; - ATH_CHECK(caloMgrHandle.isValid()); - const CaloDetDescrManager* ddman = *caloMgrHandle; - - ///////////////////////////////// - // Work with the LArDigits // - ///////////////////////////////// - - // retrieve LArDigits - const LArDigitContainer* pLArDigitContainer = nullptr; - sc = evtStore()->retrieve(pLArDigitContainer, m_LArDigitContainerKey); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Can\'t retrieve LArDigitContainer with key " - << m_LArDigitContainerKey ); - return StatusCode::SUCCESS; - } - - // Retrieve pedestals container - SG::ReadCondHandle<ILArPedestal> pedestals (m_larPedestalKey, ctx); - - //retrieve BadChannel info: - SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey,ctx}; - const LArBadChannelCont* bcCont{*bcContHdl}; - - SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx); - - // loop over LArDigits - LArDigitContainer::const_iterator itDig = pLArDigitContainer->begin(); - LArDigitContainer::const_iterator itDig_e= pLArDigitContainer->end(); - const LArDigit* pLArDigit; - for ( ; itDig!=itDig_e;++itDig) { - pLArDigit = *itDig; - HWIdentifier id = pLArDigit->hardwareID(); - Identifier offlineID = cabling->cnvToIdentifier(id); - - // Skip disconnected channels - if(!cabling->isOnlineConnected(id)) continue; - - // Get Physical Coordinates - float eta = 0; float phi = 0; - sc = returnEtaPhiCoord(ddman, offlineID, eta, phi); - if(sc.isFailure()) { - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates" ); - continue; - } - - // Fix phi range in HEC - if (m_LArOnlineIDHelper->isHECchannel(id)) phi = CaloPhiRange::fix(phi); - - // Retrieve pedestals - CaloGain::CaloGain gain = pLArDigit->gain(); - float pedestal = pedestals->pedestal(id,gain); - - // Skip channel with no pedestal ref in db - if(pedestal <= (1.0+LArElecCalib::ERRORCODE)) continue; - - // Remove problematic channels - if (m_bcMask.cellShouldBeMasked(bcCont,id)) continue; - // - // HEC - // - - if(m_LArOnlineIDHelper->isHECchannel(id)){ - - int sampling = m_LArHEC_IDHelper->sampling(offlineID); - const std::vector < short >& samples = pLArDigit->samples(); - - // Look for Muons Candidates in sampling 1 - if(sampling != 1) continue; - - // Get highest energy sample - float sample_max = 0.; //float time_max = 0.; - int nsamples = samples.size(); - for (int im = 0 ; im < nsamples; im++) { - if (samples[im] > sample_max){ - sample_max = samples[im]; - //time_max = im; - } - } - sample_max = sample_max-pedestal; - - // If energy above threshold, we found a muon in the HEC - if( (sample_max) > m_muonADCthreshold_HEC){ - - m_hMuonMapHECDig->Fill(eta,phi, 1.); - - } - - } // End HEC - - - // - // FCAL - Fill coverage / conditions / pedestal maps - // - - if(m_LArOnlineIDHelper->isFCALchannel(id)){ - - int sampling = m_LArFCAL_IDHelper->module(offlineID); - const std::vector < short >& samples = pLArDigit->samples(); - - // Look for Muons Candidates in sampling 2 - if(sampling != 2) continue; - - // Get highest energy sample - float sample_max = 0.; //float time_max = 0.; - int nsamples = samples.size(); - for (int im = 0 ; im < nsamples; im++) { - if (samples[im] > sample_max){ - sample_max = samples[im]; - //time_max = im; - } - } - sample_max = sample_max-pedestal; - - // If energy above threshold, we found a muon in the FCAL - if( (sample_max) > m_muonADCthreshold_FCAL){ - - m_hMuonMapFCALDig->Fill(eta,phi, 1.); - - } - - }//end FCAL - - // - // ECAL - // - if(m_LArOnlineIDHelper->isEMECchannel(id) || m_LArOnlineIDHelper->isEMBchannel(id) ){ - - int sampling = m_LArEM_IDHelper->sampling(offlineID); - const std::vector < short >& samples = pLArDigit->samples(); - - // Look for Muons Candidates in second sampling - if(sampling != 2) continue; - - // Get highest energy sample - float sample_max = 0.; //float time_max = 0.; - int nsamples = samples.size(); - for (int im = 0 ; im < nsamples; im++) { - if (samples[im] > sample_max){ - sample_max = samples[im]; - //time_max = im; - } - } - sample_max = sample_max-pedestal; - - // If energy above threshold, we found a muon in the barrel - if( m_LArEM_IDHelper->is_em_barrel(offlineID) - && (sample_max) > m_muonADCthreshold_EM_barrel ){ - - m_hMuonMapEMDig->Fill(eta,phi, 1.); - - } - - // If energy above threshold, we found a muon in the endcap - if(m_LArEM_IDHelper->is_em_endcap(offlineID) - && (sample_max) > m_muonADCthreshold_EM_endcap ){ - - m_hMuonMapEMDig->Fill(eta,phi, 1.); - - } - - } // end EM - - }// end of LArDigits loop - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArCosmicsMonTool::procHistograms() -{ - - ATH_MSG_DEBUG( "End of procHistograms " ); - return StatusCode::SUCCESS; -} -/*---------------------------------------------------------*/ -StatusCode LArCosmicsMonTool::initMonInfo() -{ - ATH_MSG_DEBUG( "in initMonInfo()" ); - - std::vector<CaloGain::CaloGain> gains; - gains.push_back(CaloGain::LARHIGHGAIN); - gains.push_back(CaloGain::LARMEDIUMGAIN); - gains.push_back(CaloGain::LARLOWGAIN); - - ATH_MSG_DEBUG( "Init Monitoring ended successfully " ); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArCosmicsMonTool::returnEtaPhiCoord(const CaloDetDescrManager* ddman, - Identifier offlineID,float& eta,float& phi) -{ - // Get Calo detector description element to retrieve true eta/phi - const CaloDetDescrElement* caloDetElement = ddman->get_element(offlineID); - - if(caloDetElement == nullptr ){ - return StatusCode::FAILURE; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - return StatusCode::SUCCESS; - } -} -/*------------------------------------------------------*/ -std::string LArCosmicsMonTool::gain_str(CaloGain::CaloGain gain) -{ - // return a string for the gain - std::string gStr = ""; - if (gain == CaloGain::LARHIGHGAIN) { - gStr = "High"; - } else if (gain == CaloGain::LARMEDIUMGAIN) { - gStr = "Medium"; - } else if (gain == CaloGain::LARLOWGAIN) { - gStr = "Low"; - } else if (gain == CaloGain::UNKNOWNGAIN) { - gStr = "Unknown"; - } - return gStr; -} - -/*----------------------------------------------------------*/ -std::string LArCosmicsMonTool::sampling_str(int sampling) -{ - // return a string for the sampling - std::string sStr = ""; - switch(sampling){ - case 0: - sStr = "PS"; - break; - case 1: - sStr = "Front"; - break; - case 2: - sStr = "Middle"; - break; - case 3: - sStr = "Back"; - break; - } - - return sStr; -} diff --git a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h b/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h deleted file mode 100644 index 005ef0a4e17bbf2a15f8a9a7d5a5d245d8e527a3..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArCosmicsMonTool - * @author Jessica Leveque <jleveque@in2p3.fr> - * - */ - -#ifndef LARMONTOOLS_LARCOSMICSMONTOOL_H -#define LARMONTOOLS_LARCOSMICSMONTOOL_H - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "Identifier/HWIdentifier.h" -#include "CaloDetDescr/CaloDetDescrManager.h" -#include "CaloDetDescr/CaloDetDescriptor.h" -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloGeoHelpers/CaloPhiRange.h" -#include "CaloIdentifier/CaloGain.h" -#include "CaloIdentifier/CaloCell_ID.h" -#include "CaloIdentifier/CaloIdManager.h" -#include "LArElecCalib/ILArPedestal.h" -#include "LArRawEvent/LArDigit.h" -#include "LArRawEvent/LArDigitContainer.h" -#include "LArRawEvent/LArRawChannel.h" -#include "LArRawEvent/LArRawChannelContainer.h" -#include "LArCabling/LArOnOffIdMapping.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRecConditions/LArBadChannelMask.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "StoreGate/ReadCondHandleKey.h" - - -#include <map> -#include <string> -#include <bitset> -#include <vector> -#include "TH1.h" -#include "TH2I.h" -#include "TH2F.h" -#include "TMath.h" -#include "TProfile2D.h" -#include "TTree.h" - -class LArEM_ID; -class LArOnlineID; -class CaloDetDescrElement; -class StoreGateSvc; -class ITHistSvc; - -class TH1I; -class TH2I; -class TH2F; -class TProfile2D; -class TTree; - -class LArCosmicsMonTool: public ManagedMonitorToolBase -{ - public: - LArCosmicsMonTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArCosmicsMonTool(); - - /** @brief Overwrite dummy method from AlgTool */ - virtual StatusCode initialize() override; - - /** Book general histograms - * Implement pure virtual methods of IMonitorToolBase */ - virtual StatusCode bookHistograms() override; - - /** Called each event */ - virtual StatusCode fillHistograms() override; - - /** Regularly called to fill noise maps - * Overwrite dummy method from MonitorToolBase */ - virtual StatusCode procHistograms() override; - - protected: - - // services - const LArOnlineID* m_LArOnlineIDHelper; - const LArEM_ID* m_LArEM_IDHelper; - const LArFCAL_ID* m_LArFCAL_IDHelper; - const LArHEC_ID* m_LArHEC_IDHelper; - const CaloIdManager* m_caloIdMgr; - - - //LArOnlineIDStrHelper* m_strHelper; - ITHistSvc* m_rootStore; - /** Handle to bad-channel mask */ - LArBadChannelMask m_bcMask; - SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - private: - - // initialize monitoring bookkeeping info - StatusCode initMonInfo(); - - // Properties - std::string m_LArDigitContainerKey; - SG::ReadCondHandleKey<ILArPedestal> m_larPedestalKey - { this, "LArPedestalKey", "Pedestal", "" }; - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey - {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this - , "CaloDetDescrManager" - , "CaloDetDescrManager" - , "SG Key for CaloDetDescrManager in the Condition Store" }; - std::string m_channelKey; - float m_muonADCthreshold_EM_barrel; - float m_muonADCthreshold_EM_endcap; - float m_muonADCthreshold_HEC; - float m_muonADCthreshold_FCAL; - - // utilities - int channelInSlotMax(HWIdentifier hardwareID); - int feedthroughSlotMax(HWIdentifier id); - static std::string gain_str(CaloGain::CaloGain gain); - static std::string sampling_str(int sampling); - - // To get physical coordinates - static StatusCode returnEtaPhiCoord(const CaloDetDescrManager* ddmgr, - Identifier offlineID,float& eta,float& phi); - - // Muon Seeds with Digits - TH2F* m_hMuonMapEMDig; TH2F* m_hMuonMapHECDig; TH2F* m_hMuonMapFCALDig; - TH1F* m_hMuonTimeEMDig[4]{}; TH1F* m_hMuonTimeHECDig[2]{}; TH1F* m_hMuonTimeFCALDig[2]{}; - TH1F* m_hMuonEnergyEMDig[4]{}; TH1F* m_hMuonEnergyHECDig[2]{}; TH1F* m_hMuonEnergyFCALDig[2]{}; - TH2F* m_hMuonEvsTimeEMDig[4]{}; TH2F* m_hMuonEvsTimeHECDig[2]{}; TH2F* m_hMuonEvsTimeFCALDig[2]{}; - TProfile* m_hMuonShapeEMDig[4]{}; TProfile* m_hMuonShapeHECDig[2]{}; TProfile* m_hMuonShapeFCALDig[2]{}; - - // Counters - int m_eventsCounter; - - bool m_newrun; - -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArCoverage.cxx b/LArCalorimeter/LArMonTools/src/LArCoverage.cxx deleted file mode 100644 index 0688148da8461ed018857ff8f3496a42173b6570..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoverage.cxx +++ /dev/null @@ -1,1243 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArCoverage.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Jessica Leveque -// -// Class for monitoring : Detector cells in the readout -// Masked Channels from database -// Availability of calibration constants -// Bad calibration at FEB level -// ******************************************************************** - -#include "LArCoverage.h" -#include "LArCoverageFCALBins.h" - -#include "Identifier/IdentifierHash.h" - -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" -#include "TMath.h" -#include "xAODEventInfo/EventInfo.h" - -#include <sstream> -#include <iomanip> -#include <fstream> -#include <string> -#include <vector> -#include <cstdlib> -#include <functional> -#include <map> -#include <utility> - -#include "StoreGate/ReadHandle.h" - -using namespace std; - -/*---------------------------------------------------------*/ -LArCoverage::LArCoverage(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_hCoverageEMBA(), - m_hCoverageEMBC(), - m_hCoverageEMECA(), - m_hCoverageEMECC(), - m_hCoverageHECA(), - m_hCoverageHECC(), - m_hCoverageFCALA(), - m_hCoverageFCALC(), - m_hCoverageHWEMBA(nullptr), - m_hCoverageHWEMBC(nullptr), - m_hCoverageHWEMECA(nullptr), - m_hCoverageHWEMECC(nullptr), - m_hCoverageHWHECA(nullptr), - m_hCoverageHWHECC(nullptr), - m_hCoverageHWFCALA(nullptr), - m_hCoverageHWFCALC(nullptr), - m_hCaloNoiseEM(), - m_hCaloNoiseHEC(), - m_hCaloNoiseFCAL() -{ - declareProperty("Nevents",m_nevents = 50); - - m_eventsCounter = 0; - - m_LArOnlineIDHelper = nullptr; - m_LArEM_IDHelper = nullptr; - m_LArFCAL_IDHelper = nullptr; - m_LArHEC_IDHelper = nullptr; - m_caloIdMgr = nullptr; - m_hBadChannelsBarrelA = nullptr; - m_hBadChannelsBarrelC = nullptr; - m_hBadChannelsEndcapA = nullptr; - m_hBadChannelsEndcapC = nullptr; - m_rootStore = nullptr; - } - -/*---------------------------------------------------------*/ -LArCoverage::~LArCoverage() -{ -} - -/*---------------------------------------------------------*/ -StatusCode -LArCoverage::initialize() -{ - ATH_MSG_INFO( "Initialize LArCoverage" ); - - ATH_CHECK( detStore()->retrieve( m_caloIdMgr ) ); - m_LArEM_IDHelper = m_caloIdMgr->getEM_ID(); - m_LArHEC_IDHelper = m_caloIdMgr->getHEC_ID(); - m_LArFCAL_IDHelper = m_caloIdMgr->getFCAL_ID(); - - ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") ); - ATH_CHECK( m_BCKey.initialize() ); - ATH_CHECK( m_BFKey.initialize() ); - ATH_CHECK( m_caloMgrKey.initialize() ); - ATH_CHECK( m_bcMask.buildBitMask(m_problemsToMask,msg())); - - // LArOnlineIDStrHelper - m_strHelper = std::make_unique<LArOnlineIDStrHelper>(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - ATH_CHECK( m_EventInfoKey.initialize() ); - ATH_CHECK( m_noiseCDOKey.initialize() ); - ATH_CHECK( m_cablingKey.initialize() ); - ATH_CHECK( m_rawChannelsKey.initialize() ); - // End Initialize - ManagedMonitorToolBase::initialize().ignore(); - ATH_MSG_DEBUG( "Successful Initialize LArCoverage " ); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArCoverage::bookHistograms() -{ - ATH_MSG_DEBUG( "in bookHists()" ); - - // if(isNewRun ){// Commented by B.Trocme to comply with new ManagedMonitorToolBase - - SG::ReadHandle<xAOD::EventInfo> thisEventInfo{m_EventInfoKey}; - uint32_t lb1 = 0; - if (!thisEventInfo.isValid()) - ATH_MSG_WARNING( "No EventInfo object found! Can't read run number!" ); - else{ - lb1 = thisEventInfo->lumiBlock(); - } - - // Create top folder for histos - MonGroup generalGroup( this, "/LAr/CoverageOldTool", run, ATTRIB_MANAGED ); - - // - // Book Maps vs eta/phi - One map per sampling - // - MonGroup CovGroupShift( this, "/LAr/CoverageOldTool/perPartition", run, ATTRIB_MANAGED, "", "lowerLB" ); - - // - // Coverage EM Barrel - Store Granularity - // - - const int size = 4; - int nbinsphiEMBarrel[] = {64,256,256,256}; - int nbinsetaEMBarrel[] = {61,450,57,27}; - - float** etaEMBarrelA=nullptr; - etaEMBarrelA = new float*[size]; - for(int it=0;it<4;it++) - etaEMBarrelA[it]= new float[nbinsetaEMBarrel[it]+1]; - - float** etaEMBarrelC=nullptr; - etaEMBarrelC = new float*[size]; - for(int it=0;it<4;it++) - etaEMBarrelC[it]= new float[nbinsetaEMBarrel[it]+1]; - - float** phiEMBarrel=nullptr; - phiEMBarrel = new float*[size]; - for(int it=0;it<4;it++) - phiEMBarrel[it]= new float[nbinsphiEMBarrel[it]+1]; - - // Sampling 0 - for(int ibin=0;ibin<=64;ibin++) phiEMBarrel[0][ibin] = -TMath::Pi()+ ibin*2*TMath::Pi()/64; - for(int ibin=0;ibin<=61;ibin++) etaEMBarrelA[0][ibin] = (ibin)*0.025; - for(int ibin=0;ibin<=61;ibin++) etaEMBarrelC[0][ibin] = -(ibin)*0.025; - sort(etaEMBarrelC[0],etaEMBarrelC[0]+nbinsetaEMBarrel[0]+1); - // Sampling 1 - // First strip : twice the size in eta - // Last 3 eta bins are 4 times smaller in phi - for(int ibin=0;ibin<=256;ibin++) phiEMBarrel[1][ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/256; - etaEMBarrelA[1][0] = 0; etaEMBarrelC[1][0] = 0; - for(int ibin=1;ibin<=446;ibin++) etaEMBarrelA[1][ibin] = 0.025/4+(ibin-1)*0.025/8; - for(int ibin=447;ibin<=450;ibin++) etaEMBarrelA[1][ibin] = 1.4+(ibin-447)*0.025; - for(int ibin=1;ibin<=446;ibin++) etaEMBarrelC[1][ibin] = -(0.025/4+(ibin-1)*0.025/8); - for(int ibin=447;ibin<=450;ibin++) etaEMBarrelC[1][ibin] = -(1.4+(ibin-447)*0.025); - sort(etaEMBarrelC[1],etaEMBarrelC[1]+nbinsetaEMBarrel[1]+1); - // Sampling 2 - // 57th cell : three time bigger in eta - for(int ibin=0;ibin<=256;ibin++) phiEMBarrel[2][ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/256; - for(int ibin=0;ibin<=56;ibin++) etaEMBarrelA[2][ibin] = ibin*0.025; - for(int ibin=0;ibin<=56;ibin++) etaEMBarrelC[2][ibin] = -(ibin*0.025); - etaEMBarrelA[2][57] = 1.475; etaEMBarrelC[2][57] = -1.475; - sort(etaEMBarrelC[2],etaEMBarrelC[2]+nbinsetaEMBarrel[2]+1); - // Sampling 3 - for(int ibin=0;ibin<=256;ibin++) phiEMBarrel[3][ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/256; - for(int ibin=0;ibin<=27;ibin++) etaEMBarrelA[3][ibin] = ibin*0.050; - for(int ibin=0;ibin<=27;ibin++) etaEMBarrelC[3][ibin] = -(ibin*0.050); - sort(etaEMBarrelC[3],etaEMBarrelC[3]+nbinsetaEMBarrel[3]+1); - - // Instantiate histograms - for(int iS=0; iS<4; iS++){ - m_hCoverageEMBA[iS] = TH2I_LW::create(Form("CoverSampling%iEMBA",iS), - Form("Coverage - Sampling %i - EMB A - LB %4d",iS,lb1), - nbinsetaEMBarrel[iS],etaEMBarrelA[iS],nbinsphiEMBarrel[iS],phiEMBarrel[iS]); - SetPartCoverageStyle(m_hCoverageEMBA[iS]); - CovGroupShift.regHist(m_hCoverageEMBA[iS]).ignore(); - - m_hCoverageEMBC[iS] = TH2I_LW::create(Form("CoverSampling%iEMBC",iS), - Form("Coverage - Sampling %i - EMB C - LB %4d",iS,lb1), - nbinsetaEMBarrel[iS],etaEMBarrelC[iS],nbinsphiEMBarrel[iS],phiEMBarrel[iS]); - SetPartCoverageStyle(m_hCoverageEMBC[iS]); - CovGroupShift.regHist(m_hCoverageEMBC[iS]).ignore(); - } - - // Delete pointers - for(int it=0;it<4;it++) - delete [] etaEMBarrelA[it]; - delete [] etaEMBarrelA; - for(int it=0;it<4;it++) - delete [] etaEMBarrelC[it]; - delete [] etaEMBarrelC; - for(int it=0;it<4;it++) - delete [] phiEMBarrel[it]; - delete [] phiEMBarrel; - - // - // Coverage EM Endcap - Store cells granularity - // - - int nbinsphiEMEndcap[] = {64,64,256,256}; - int nbinsetaEMEndcap[] = {12,223,51,20}; - - float** etaEMEndcapA=nullptr; - etaEMEndcapA = new float*[size]; - for(int it=0;it<4;it++) - etaEMEndcapA[it]= new float[nbinsetaEMEndcap[it]+1]; - - float** etaEMEndcapC=nullptr; - etaEMEndcapC = new float*[size]; - for(int it=0;it<4;it++) - etaEMEndcapC[it]= new float[nbinsetaEMEndcap[it]+1]; - - float** phiEMEndcap=nullptr; - phiEMEndcap = new float*[size]; - for(int it=0;it<4;it++) - phiEMEndcap[it]= new float[nbinsphiEMEndcap[it]+1]; - - // Sampling 0 - for(int ibin=0;ibin<=64;ibin++) phiEMEndcap[0][ibin] = -TMath::Pi()+ ibin*(2*M_PI/64); - for(int ibin=0;ibin<=12;ibin++) etaEMEndcapA[0][ibin] = 1.5+ibin*0.025; - for(int ibin=0;ibin<=12;ibin++) etaEMEndcapC[0][ibin] = -(1.5+ibin*0.025); - sort(etaEMEndcapC[0],etaEMEndcapC[0]+nbinsetaEMEndcap[0]+1); - // Sampling 1 - for(int ibin=0;ibin<=64;ibin++) phiEMEndcap[1][ibin] = -TMath::Pi()+ ibin*(2*M_PI/64); - etaEMEndcapA[1][0] = 1.375; - for(int ibin=1;ibin<=3;ibin++) etaEMEndcapA[1][ibin] = 1.425+(ibin-1)*0.025; - for(int ibin=4;ibin<=99;ibin++) etaEMEndcapA[1][ibin] = 1.5+(ibin-4)*(0.025/8); - for(int ibin=100;ibin<=147;ibin++) etaEMEndcapA[1][ibin] = 1.8+(ibin-100)*(0.025/6); - for(int ibin=148;ibin<=211;ibin++) etaEMEndcapA[1][ibin] = 2.0+(ibin-148)*(0.025/4); - for(int ibin=212;ibin<=215;ibin++) etaEMEndcapA[1][ibin] = 2.4+(ibin-212)*0.025; - for(int ibin=216;ibin<=223;ibin++) etaEMEndcapA[1][ibin] = 2.5+(ibin-216)*0.1; - etaEMEndcapC[1][0] = -1.375; - for(int ibin=1;ibin<=3;ibin++) etaEMEndcapC[1][ibin] = -(1.425+(ibin-1)*0.025); - for(int ibin=4;ibin<=99;ibin++) etaEMEndcapC[1][ibin] = -(1.5+(ibin-4)*(0.025/8)); - for(int ibin=100;ibin<=147;ibin++) etaEMEndcapC[1][ibin] = -(1.8+(ibin-100)*(0.025/6)); - for(int ibin=148;ibin<=211;ibin++) etaEMEndcapC[1][ibin] = -(2.0+(ibin-148)*(0.025/4)); - for(int ibin=212;ibin<=215;ibin++) etaEMEndcapC[1][ibin] = -(2.4+(ibin-212)*0.025); - for(int ibin=216;ibin<=223;ibin++) etaEMEndcapC[1][ibin] = -(2.5+(ibin-216)*0.1); - sort(etaEMEndcapC[1],etaEMEndcapC[1]+nbinsetaEMEndcap[1]+1); - // Sampling 2 - // Last 7 eta bins are 4 times bigger in phi - for(int ibin=0;ibin<=256;ibin++) phiEMEndcap[2][ibin] = -TMath::Pi()+ ibin*(2*M_PI/256); - etaEMEndcapA[2][0] = 1.375; - for(int ibin=1;ibin<=43;ibin++) etaEMEndcapA[2][ibin] = 1.425+(ibin-1)*0.025; - for(int ibin=44;ibin<=51;ibin++) etaEMEndcapA[2][ibin] = 2.5+(ibin-44)*0.1; - etaEMEndcapC[2][0] = -1.375; - for(int ibin=1;ibin<=43;ibin++) etaEMEndcapC[2][ibin] = -(1.425+(ibin-1)*0.025); - for(int ibin=44;ibin<=51;ibin++) etaEMEndcapC[2][ibin] = -(2.5+(ibin-44)*0.1); - sort(etaEMEndcapC[2],etaEMEndcapC[2]+nbinsetaEMEndcap[2]+1); - // Sampling 3 - for(int ibin=0;ibin<=256;ibin++) phiEMEndcap[3][ibin] = -TMath::Pi()+ ibin*(2*M_PI/256); - for(int ibin=0;ibin<=20;ibin++) etaEMEndcapA[3][ibin] = 1.5+ibin*0.05; - for(int ibin=0;ibin<=20;ibin++) etaEMEndcapC[3][ibin] = -(1.5+ibin*0.05); - sort(etaEMEndcapC[3],etaEMEndcapC[3]+nbinsetaEMEndcap[3]+1); - - // Instantiate histograms - for(int iS=0; iS<4; iS++){ - m_hCoverageEMECA[iS] = TH2I_LW::create(Form("CoverSampling%iEMECA",iS), - Form("Coverage - Sampling %i - EMEC A - LB %4d",iS,lb1), - nbinsetaEMEndcap[iS],etaEMEndcapA[iS],nbinsphiEMEndcap[iS],phiEMEndcap[iS]); - SetPartCoverageStyle(m_hCoverageEMECA[iS]); - CovGroupShift.regHist(m_hCoverageEMECA[iS]).ignore(); - - m_hCoverageEMECC[iS] = TH2I_LW::create(Form("CoverSampling%iEMECC",iS), - Form("Coverage - Sampling %i - EMEC C - LB %4d",iS,lb1), - nbinsetaEMEndcap[iS],etaEMEndcapC[iS],nbinsphiEMEndcap[iS],phiEMEndcap[iS]); - SetPartCoverageStyle(m_hCoverageEMECC[iS]); - CovGroupShift.regHist(m_hCoverageEMECC[iS]).ignore(); - } - - // Delete pointers - for(int it=0;it<4;it++) - delete [] etaEMEndcapA[it]; - delete [] etaEMEndcapA; - for(int it=0;it<4;it++) - delete [] etaEMEndcapC[it]; - delete [] etaEMEndcapC; - for(int it=0;it<4;it++) - delete [] phiEMEndcap[it]; - delete [] phiEMEndcap; - - // - // Coverage HEC - Store cells granularity - // - - int nbinsphiHEC[] = {64,64,64,64}; - int nbinsetaHEC[] = {14,13,12,12}; - - float** etaHECA=nullptr; - etaHECA = new float*[size]; - for(int it=0;it<4;it++) - etaHECA[it]= new float[nbinsetaHEC[it]+1]; - - float** etaHECC=nullptr; - etaHECC = new float*[size]; - for(int it=0;it<4;it++) - etaHECC[it]= new float[nbinsetaHEC[it]+1]; - - float** phiHEC=nullptr; - phiHEC = new float*[size]; - for(int it=0;it<4;it++) - phiHEC[it]= new float[nbinsphiHEC[it]+1]; - - for (int iS=0;iS<4;iS++){ - for(int ibin=0;ibin<=64;ibin++) phiHEC[iS][ibin] = -TMath::Pi()+ibin*2*TMath::Pi()/64; - } - - for(int ibin=0;ibin<=10;ibin++) etaHECA[0][ibin] = 1.5+ibin*0.1; - for(int ibin=11;ibin<=14;ibin++) etaHECA[0][ibin] = 2.5+(ibin-10)*0.2; - for(int ibin=0;ibin<=10;ibin++) etaHECA[1][ibin] = 1.5+ibin*0.1; - for(int ibin=11;ibin<=13;ibin++) etaHECA[1][ibin] = 2.5+(ibin-10)*0.2; - for(int ibin=0;ibin<=9;ibin++) etaHECA[2][ibin] = 1.6+ibin*0.1; - for(int ibin=10;ibin<=12;ibin++) etaHECA[2][ibin] = 2.5+(ibin-9)*0.2; - for(int ibin=0;ibin<=8;ibin++) etaHECA[3][ibin] = 1.7+ibin*0.1; - for(int ibin=9;ibin<=12;ibin++) etaHECA[3][ibin] = 2.5+(ibin-8)*0.2; - - for(int ibin=0;ibin<=10;ibin++) etaHECC[0][ibin] = -(1.5+ibin*0.1); - for(int ibin=11;ibin<=14;ibin++) etaHECC[0][ibin] = -(2.5+(ibin-10)*0.2); - for(int ibin=0;ibin<=10;ibin++) etaHECC[1][ibin] = -(1.5+ibin*0.1); - for(int ibin=11;ibin<=13;ibin++) etaHECC[1][ibin] = -(2.5+(ibin-10)*0.2); - for(int ibin=0;ibin<=9;ibin++) etaHECC[2][ibin] = -(1.6+ibin*0.1); - for(int ibin=10;ibin<=12;ibin++) etaHECC[2][ibin] = -(2.5+(ibin-9)*0.2); - for(int ibin=0;ibin<=8;ibin++) etaHECC[3][ibin] = -(1.7+ibin*0.1); - for(int ibin=9;ibin<=12;ibin++) etaHECC[3][ibin] = -(2.5+(ibin-8)*0.2); - for(int iS=0;iS<4;iS++) sort(etaHECC[iS],etaHECC[iS]+nbinsetaHEC[iS]+1); - - // Instantiate histograms - for(int iS=0; iS<4; iS++){ - m_hCoverageHECA[iS] = TH2I_LW::create(Form("CoverSampling%iHECA",iS), - Form("Coverage - Sampling %i - HEC A - LB %4d",iS,lb1), - nbinsetaHEC[iS],etaHECA[iS],nbinsphiHEC[iS],phiHEC[iS]); - SetPartCoverageStyle(m_hCoverageHECA[iS]); - CovGroupShift.regHist(m_hCoverageHECA[iS]).ignore(); - - m_hCoverageHECC[iS] = TH2I_LW::create(Form("CoverSampling%iHECC",iS), - Form("Coverage - Sampling %i - HEC C - LB %4d",iS,lb1), - nbinsetaHEC[iS],etaHECC[iS],nbinsphiHEC[iS],phiHEC[iS]); - SetPartCoverageStyle(m_hCoverageHECC[iS]); - CovGroupShift.regHist(m_hCoverageHECC[iS]).ignore(); - } - - // Delete pointers - for(int it=0;it<4;it++) - delete [] etaHECA[it]; - delete [] etaHECA; - for(int it=0;it<4;it++) - delete [] etaHECC[it]; - delete [] etaHECC; - for(int it=0;it<4;it++){ - delete [] phiHEC[it]; - } - delete [] phiHEC; - - // - // Coverage FCAL - Store Cells granularity - // - - - // Instantiate histograms - for(int iS=1; iS<4; iS++){ - m_hCoverageFCALA[iS] = TH2I_LW::create(Form("CoverSampling%iFCALA",iS), - Form("Coverage - Sampling %i - FCAL A - LB %4d",iS,lb1), - LArCoverageFCALBins::getXBins(+2,iS), - -LArCoverageFCALBins::getRMax(+2,iS), - LArCoverageFCALBins::getRMax(+2,iS), - LArCoverageFCALBins::getYBins(+2,iS), - -LArCoverageFCALBins::getRMax(+2,iS), - LArCoverageFCALBins::getRMax(+2,iS)); - - SetPartCoverageStyle(m_hCoverageFCALA[iS]); - // in theta-phi space - // m_hCoverageFCALA[iS]->GetXaxis()->SetTitle("|tan(#theta)| #times sin(#phi)"); - // m_hCoverageFCALA[iS]->GetYaxis()->SetTitle("|tan(#theta)| #times cos(#phi)"); - // in x-y space - m_hCoverageFCALA[iS]->GetXaxis()->SetTitle("x (mm)"); - m_hCoverageFCALA[iS]->GetYaxis()->SetTitle("y (mm)"); - - CovGroupShift.regHist(m_hCoverageFCALA[iS]).ignore(); - - m_hCoverageFCALC[iS] = TH2I_LW::create(Form("CoverSampling%iFCALC",iS), - Form("Coverage - Sampling %i - FCAL C - LB %4d",iS,lb1), - LArCoverageFCALBins::getXBins(-2,iS), - -LArCoverageFCALBins::getRMax(-2,iS), - LArCoverageFCALBins::getRMax(-2,iS), - LArCoverageFCALBins::getYBins(-2,iS), - -LArCoverageFCALBins::getRMax(-2,iS), - LArCoverageFCALBins::getRMax(-2,iS)); - SetPartCoverageStyle(m_hCoverageFCALC[iS]); - // in theta-phi space - // m_hCoverageFCALC[iS]->GetXaxis()->SetTitle("|tan(#theta)| #times sin(#phi)"); - // m_hCoverageFCALC[iS]->GetYaxis()->SetTitle("|tan(#theta)| #times cos(#phi)"); - // in x-y space - m_hCoverageFCALC[iS]->GetXaxis()->SetTitle("x (mm)"); - m_hCoverageFCALC[iS]->GetYaxis()->SetTitle("y (mm)"); - - CovGroupShift.regHist(m_hCoverageFCALC[iS]).ignore(); - } - - // - // Coverage histograms per FT/slot - One per partition. - // - - m_hCoverageHWEMBA = TH2I_LW::create("CoverageHWEMBA",Form("Coverage - EMBA - LB %4d",lb1),448,0.,32.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWEMBA).ignore(); - SetHWCoverageStyle(m_hCoverageHWEMBA); - CovGroupShift.regHist(m_hCoverageHWEMBA).ignore(); - - m_hCoverageHWEMBC = TH2I_LW::create("CoverageHWEMBC",Form("Coverage - EMBC - LB %4d",lb1),448,0.,32.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWEMBC).ignore(); - SetHWCoverageStyle(m_hCoverageHWEMBC); - CovGroupShift.regHist(m_hCoverageHWEMBC).ignore(); - - m_hCoverageHWEMECA = TH2I_LW::create("CoverageHWEMECA",Form("Coverage - EMECA - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWEMECA).ignore(); - SetHWCoverageStyle(m_hCoverageHWEMECA); - CovGroupShift.regHist(m_hCoverageHWEMECA).ignore(); - - m_hCoverageHWEMECC = TH2I_LW::create("CoverageHWEMECC",Form("Coverage - EMECC - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWEMECC).ignore(); - SetHWCoverageStyle(m_hCoverageHWEMECC); - CovGroupShift.regHist(m_hCoverageHWEMECC).ignore(); - - m_hCoverageHWHECA = TH2I_LW::create("CoverageHWHECA",Form("Coverage - HECA - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWHECA).ignore(); - SetHWCoverageStyle(m_hCoverageHWHECA); - CovGroupShift.regHist(m_hCoverageHWHECA).ignore(); - - m_hCoverageHWHECC = TH2I_LW::create("CoverageHWHECC",Form("Coverage - HECC - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWHECC).ignore(); - SetHWCoverageStyle(m_hCoverageHWHECC); - CovGroupShift.regHist(m_hCoverageHWHECC).ignore(); - - m_hCoverageHWFCALA = TH2I_LW::create("CoverageHWFCALA",Form("Coverage - FCALA - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWFCALA).ignore(); - SetHWCoverageStyle(m_hCoverageHWFCALA); - CovGroupShift.regHist(m_hCoverageHWFCALA).ignore(); - - m_hCoverageHWFCALC = TH2I_LW::create("CoverageHWFCALC",Form("Coverage - FCALC - LB %4d",lb1),375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hCoverageHWFCALC).ignore(); - SetHWCoverageStyle(m_hCoverageHWFCALC); - CovGroupShift.regHist(m_hCoverageHWFCALC).ignore(); - - // - // CaloNoise histograms - per FT/Slot - // - - MonGroup CaloNoiseGroupShift( this, "/LAr/CoverageOldTool/CaloNoiseTool", run, ATTRIB_MANAGED, "", "lowerLB"); - - // EM histos - for (int i=0; i<4;i++){ - m_hCaloNoiseEM[i] = TProfile_LW::create(Form("CaloNoiseEMSampling%i",i), - Form("DBNoise in EM Sampling %i - LB %4d",i,lb1), - 320, -3.2,3.2); - m_hCaloNoiseEM[i]->GetXaxis()->SetTitle("#eta"); - m_hCaloNoiseEM[i]->GetYaxis()->SetTitle("[MeV]"); - CaloNoiseGroupShift.regHist(m_hCaloNoiseEM[i]).ignore(); - } - - // HEC histos - for (int i=0; i<4;i++){ - m_hCaloNoiseHEC[i] = TProfile_LW::create(Form("CaloNoiseHECSampling%i",i), - Form("DBNoise in HEC Sampling %i - LB %4d",i,lb1), - 320, -3.2,3.2); - m_hCaloNoiseHEC[i]->GetXaxis()->SetTitle("#eta"); - m_hCaloNoiseHEC[i]->GetYaxis()->SetTitle("[MeV]"); - CaloNoiseGroupShift.regHist(m_hCaloNoiseHEC[i]).ignore(); - } - - // FCAL histos - for (int i=1; i<4;i++){ - m_hCaloNoiseFCAL[i] = TProfile_LW::create(Form("CaloNoiseFCALSampling%i",i), - Form("DBNoise in FCAL Sampling %i - LB %4d",i,lb1), - 500, -5.0,5.0); - m_hCaloNoiseFCAL[i]->GetXaxis()->SetTitle("#eta"); - m_hCaloNoiseFCAL[i]->GetYaxis()->SetTitle("[MeV]"); - CaloNoiseGroupShift.regHist(m_hCaloNoiseFCAL[i]).ignore(); - } - - // - // Bad Channels DataBase content - // - - MonGroup BadChannelsGroupShift( this, "/LAr/CoverageOldTool/BadChannels/", run, ATTRIB_MANAGED, "", "lowerLB"); - - m_hBadChannelsBarrelA = TH2I_LW::create("DBBadChannelsBarrelA",Form("Known Bad Channels - Barrel A - LB %4d",lb1), - 448,0.,32.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hBadChannelsBarrelA).ignore(); - SetBadChannelZaxisLabels(m_hBadChannelsBarrelA); - BadChannelsGroupShift.regHist(m_hBadChannelsBarrelA).ignore(); - - m_hBadChannelsBarrelC = TH2I_LW::create("DBBadChannelsBarrelC",Form("Known Bad Channels - Barrel C - LB %4d",lb1), - 448,0.,32.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hBadChannelsBarrelC).ignore(); - SetBadChannelZaxisLabels(m_hBadChannelsBarrelC); - BadChannelsGroupShift.regHist(m_hBadChannelsBarrelC).ignore(); - - m_hBadChannelsEndcapA = TH2I_LW::create("DBBadChannelsEndcapA",Form("Known Bad Channels - Endcap A - LB %4d",lb1), - 375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hBadChannelsEndcapA).ignore(); - SetBadChannelZaxisLabels(m_hBadChannelsEndcapA); - BadChannelsGroupShift.regHist(m_hBadChannelsEndcapA).ignore(); - - m_hBadChannelsEndcapC = TH2I_LW::create("DBBadChannelsEndcapC",Form("Known Bad Channels - Endcap C - LB %4d",lb1), - 375,0.,25.,128,-0.5,127.5); - m_strHelper->definePartitionSummProp2(m_hBadChannelsEndcapC).ignore(); - SetBadChannelZaxisLabels(m_hBadChannelsEndcapC); - BadChannelsGroupShift.regHist(m_hBadChannelsEndcapC).ignore(); - - return StatusCode::SUCCESS; - - // }// end isNewRun - -} - - -/*---------------------------------------------------------*/ -StatusCode -LArCoverage::fillHistograms() -{ - ATH_MSG_DEBUG( "in fillHists()" ); - - const EventContext& ctx = Gaudi::Hive::currentContext(); - - m_eventsCounter++; - - if(m_eventsCounter > m_nevents ) return StatusCode::SUCCESS; - - SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx}; - ATH_CHECK(caloMgrHandle.isValid()); - const CaloDetDescrManager* ddman = *caloMgrHandle; - - // Retrieve Raw Channels Container - - SG::ReadHandle<LArRawChannelContainer> pRawChannelsContainer(m_rawChannelsKey, ctx); - if(!pRawChannelsContainer.isValid()) { - ATH_MSG_ERROR( " Can not retrieve LArRawChannelContainer: " - << m_rawChannelsKey.key() ); - return StatusCode::FAILURE; - } - - - SG::ReadCondHandle<LArBadChannelCont> bch{m_BCKey, ctx}; - const LArBadChannelCont* bcCont{*bch}; - - SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey, ctx}; - const CaloNoise* noiseCDO=*noiseHdl; - - SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx); - - for (const LArRawChannel& pRawChannel : *pRawChannelsContainer) { - int provenanceChan = pRawChannel.provenance(); - float energyChan = pRawChannel.energy(); - HWIdentifier id = pRawChannel.hardwareID(); - //CaloGain::CaloGain gain = pRawChannel->gain(); - Identifier offlineID = cabling->cnvToIdentifier(id); - - // Skip disconnected channels - if(!cabling->isOnlineConnected(id)) continue; - - // Get ft/slot info - HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(id); - int channel = m_LArOnlineIDHelper->channel(id); - int slot = m_LArOnlineIDHelper->slot(febID); - int ft = m_LArOnlineIDHelper->feedthrough(feedthroughID); - - // Get Physical Coordinates - float etaChan = 0; float phiChan = 0.; - const CaloDetDescrElement* caloDetElement = ddman->get_element(offlineID); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - etaChan = caloDetElement->eta_raw(); - phiChan = caloDetElement->phi_raw(); - } - - // Fix phi range in HEC - if (m_LArOnlineIDHelper->isHECchannel(id)) phiChan = CaloPhiRange::fix(phiChan); - - // Retrieve expected noise - float noise = noiseCDO->getNoise(offlineID,m_highestGain[caloDetElement->getSubCalo()]); - - if(m_eventsCounter == 1){ - - // Plot the average expected noise vs eta for reference - if(m_LArOnlineIDHelper->isEMBchannel(id) || m_LArOnlineIDHelper->isEMECchannel(id)){ - int sampling = m_LArEM_IDHelper->sampling(offlineID); - m_hCaloNoiseEM[sampling]->Fill(etaChan, noise); - } - if(m_LArOnlineIDHelper->isHECchannel(id)){ - int sampling = m_LArHEC_IDHelper->sampling(offlineID); - m_hCaloNoiseHEC[sampling]->Fill(etaChan, noise); - } - if(m_LArOnlineIDHelper->isFCALchannel(id)){ - int sampling = m_LArFCAL_IDHelper->module(offlineID); - m_hCaloNoiseFCAL[sampling]->Fill(etaChan, noise); - } - - // Fill Bad Channels histograms - int flag = DBflag(ctx, id); - if (flag==0) continue; - - // A-Side - if(etaChan >= 0){ - if(m_LArOnlineIDHelper->isEMBchannel(id)){ - m_hBadChannelsBarrelA->SetBinContent(ft*14+slot,channel+1,flag); - }else{ - m_hBadChannelsEndcapA->SetBinContent(ft*15+slot,channel+1,flag); - } - // C-side - } else { - if(m_LArOnlineIDHelper->isEMBchannel(id)){ - m_hBadChannelsBarrelC->SetBinContent(ft*14+slot,channel+1,flag); - }else{ - m_hBadChannelsEndcapC->SetBinContent(ft*15+slot,channel+1,flag); - } - } - } - - // - // Compute cells status - // - - int cellContent = 0; - - // Cell is connected and in the Readout - // Select raw channels properly reconstructed, with all calib constants available - // provenance&0x00ff == 0x00a5 : raw channels from OFC iteration, all calib constants found in DB - // provenance&0x1000 == 0x1000 : raw channels from DSP. If no constant loaded in DSP, energy==0 - if ( (provenanceChan&0x00ff) == 0x00a5 || (provenanceChan&0x1000) == 0x1000 ){ - - if(m_bcMask.cellShouldBeMasked(bcCont,id)) cellContent=2; - else if(energyChan != 0) cellContent=3; - - } - - // - // Fill Coverage histograms - // - - // A-Side - if(etaChan >= 0){ - - // EM Barrel - if(m_LArOnlineIDHelper->isEMBchannel(id) ){ - int sampling = m_LArEM_IDHelper->sampling(offlineID); - int ix = m_hCoverageEMBA[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageEMBA[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageEMBA[sampling]->GetBinContent(ix,iy))); - m_hCoverageEMBA[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWEMBA->SetBinContent(ft*14+slot,channel+1,cellContent); - } - - // EM Endcap - if(m_LArOnlineIDHelper->isEMECchannel(id)){ - int sampling = m_LArEM_IDHelper->sampling(offlineID); - int ix = m_hCoverageEMECA[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageEMECA[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageEMECA[sampling]->GetBinContent(ix,iy))); - m_hCoverageEMECA[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWEMECA->SetBinContent(ft*15+slot,channel+1,cellContent); - } - - // HEC - if (m_LArOnlineIDHelper->isHECchannel(id)){ - int sampling = m_LArHEC_IDHelper->sampling(offlineID); - int ix = m_hCoverageHECA[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageHECA[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageHECA[sampling]->GetBinContent(ix,iy))); - m_hCoverageHECA[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWHECA->SetBinContent(ft*15+slot,channel+1,cellContent); - } - // FCAL - if (m_LArOnlineIDHelper->isFCALchannel(id)){ - int sampling = m_LArFCAL_IDHelper->module(offlineID); - int iEta = m_LArFCAL_IDHelper->eta(offlineID); - int iPhi = m_LArFCAL_IDHelper->phi(offlineID); - const unsigned short * iBin = LArCoverageFCALBins::getBins(+2,sampling,iEta,iPhi); - if ( iBin[0] > 0 && iBin[1] > 0 ) { - unsigned short ix = iBin[1]%(LArCoverageFCALBins::getXBins(+2,sampling)+2); - unsigned short iy = (iBin[1]-ix)/(LArCoverageFCALBins::getXBins(+2,sampling)+2); - cellContent = TMath::Max(cellContent, int(m_hCoverageFCALA[sampling]->GetBinContent(ix,iy))); - m_hCoverageFCALA[sampling]->SetBinContent(ix,iy,cellContent); - } - m_hCoverageHWFCALA->SetBinContent(ft*15+slot,channel+1,cellContent); - } - - // C-Side - }else{ - - // EM Barrel - if(m_LArOnlineIDHelper->isEMBchannel(id)){ - int sampling = m_LArEM_IDHelper->sampling(offlineID); - int ix = m_hCoverageEMBC[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageEMBC[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageEMBC[sampling]->GetBinContent(ix,iy))); - m_hCoverageEMBC[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWEMBC->SetBinContent(ft*14+slot,channel+1,cellContent); - } - - // EM Endcap - if(m_LArOnlineIDHelper->isEMECchannel(id)){ - int sampling = m_LArEM_IDHelper->sampling(offlineID); - int ix = m_hCoverageEMECC[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageEMECC[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageEMECC[sampling]->GetBinContent(ix,iy))); - m_hCoverageEMECC[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWEMECC->SetBinContent(ft*15+slot,channel+1,cellContent); - } - - // HEC - if (m_LArOnlineIDHelper->isHECchannel(id)){ - int sampling = m_LArHEC_IDHelper->sampling(offlineID); - int ix = m_hCoverageHECC[sampling]->GetXaxis()->FindBin(etaChan); - int iy = m_hCoverageHECC[sampling]->GetYaxis()->FindBin(phiChan); - cellContent = TMath::Max(cellContent, int(m_hCoverageHECC[sampling]->GetBinContent(ix,iy))); - m_hCoverageHECC[sampling]->SetBinContent(ix,iy,cellContent); - m_hCoverageHWHECC->SetBinContent(ft*15+slot,channel+1,cellContent); - } - // FCAL - if (m_LArOnlineIDHelper->isFCALchannel(id)){ - int sampling = m_LArFCAL_IDHelper->module(offlineID); - int iEta = m_LArFCAL_IDHelper->eta(offlineID); - int iPhi = m_LArFCAL_IDHelper->phi(offlineID); - const unsigned short * iBin = LArCoverageFCALBins::getBins(-2,sampling,iEta,iPhi); - if ( iBin[0] > 0 && iBin[1] > 0 ) { - unsigned short ix = iBin[1]%(LArCoverageFCALBins::getXBins(-2,sampling)+2); - unsigned short iy = (iBin[1]-ix)/(LArCoverageFCALBins::getXBins(-2,sampling)+2); - cellContent = TMath::Max(cellContent, int(m_hCoverageFCALC[sampling]->GetBinContent(ix,iy))); - m_hCoverageFCALC[sampling]->SetBinContent(ix,iy,cellContent); - } - m_hCoverageHWFCALC->SetBinContent(ft*15+slot,channel+1,cellContent); - } - } - - }// end Raw Channels Loop - - - // - // Fill known missing FEBs with -1 - // - - FillKnownMissingFEBs(ctx, ddman); - - // - // Fix for Cosmetic : Fill "empty bins" in plots - // where granularity varies vs eta&phi - // - - FixEmptyBins(); - - // End of event treatment - - return StatusCode::SUCCESS; -} -/*---------------------------------------------------------*/ -StatusCode LArCoverage::procHistograms() -{ - - ATH_MSG_DEBUG( "In procHistograms " ); - - return StatusCode::SUCCESS; - -} -/*---------------------------------------------------------*/ -int LArCoverage::DBflag(const EventContext& ctx, HWIdentifier onID){ - - SG::ReadCondHandle<LArBadChannelCont> bch{m_BCKey, ctx}; - const LArBadChannelCont* bcCont{*bch}; - if(!bcCont) { - ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); - return -1; - } - - LArBadChannel bc = bcCont->status(onID); - - int flag = 0; - if(bc.deadCalib()) flag = 1; - if(bc.lowNoiseHG()||bc.lowNoiseMG()||bc.lowNoiseLG()) flag = 2; - if(bc.distorted()) flag = 3; - if(bc.unstable()) flag = 4; - if(bc.sporadicBurstNoise()) flag = 5; - if(bc.highNoiseHG()|| bc.highNoiseMG() || bc.highNoiseLG()) flag = 6; - if(bc.deadReadout()||bc.deadPhys()||bc.almostDead()||bc.shortProblem()) flag = 7; - - return flag; -} -/*---------------------------------------------------------*/ -void LArCoverage::SetPartCoverageStyle(TH2I_LW* h){ - - h->GetXaxis()->SetTitle("#eta cell"); - h->GetYaxis()->SetTitle("#phi cell"); - h->SetMinimum(1.); - h->SetMaximum(4.4); -} -/*---------------------------------------------------------*/ -void LArCoverage::SetHWCoverageStyle(TH2I_LW* h){ - - h->SetMinimum(1.); - h->SetMaximum(4.4); -} -/*---------------------------------------------------------*/ -void LArCoverage::SetBadChannelZaxisLabels(TH2I_LW* h){ - - h->SetMinimum(0.); - h->SetMaximum(10.); -} -/*---------------------------------------------------------*/ -void LArCoverage::FillKnownMissingFEBs(const EventContext& ctx, - const CaloDetDescrManager* caloDetDescrMgr){ - - SG::ReadCondHandle<LArBadFebCont> mfCont{m_BFKey, ctx}; - - SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx); - - // Loop over all FEBs - for (std::vector<HWIdentifier>::const_iterator allFeb = m_LArOnlineIDHelper->feb_begin(); - allFeb != m_LArOnlineIDHelper->feb_end(); ++allFeb) { - HWIdentifier febid = HWIdentifier(*allFeb); - - // Known missing FEB: set content to 1 - // Known missing FEB but cells actually readout: set content to 4 - // Known FEB with error: set content to 0 (CaloCells not produced) - - const LArBadFeb febStatus = mfCont->status(febid); - - if(febStatus.deadAll() || febStatus.deadReadout() || febStatus.inError()){ - - int barrel_ec = m_LArOnlineIDHelper->barrel_ec(febid); - int pos_neg = m_LArOnlineIDHelper->pos_neg(febid); - int ft = m_LArOnlineIDHelper->feedthrough(febid); - int slot = m_LArOnlineIDHelper->slot(febid); - - // EMBA - if (barrel_ec==0 and pos_neg==1){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWEMBA->GetBinContent(ft*14+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWEMBA->SetBinContent(ft*14+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArEM_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageEMBA[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageEMBA[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageEMBA[sampling]->SetBinContent(ix,iy,replace); - } - } - - // EMBC - if (barrel_ec==0 and pos_neg==0){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWEMBC->GetBinContent(ft*14+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWEMBC->SetBinContent(ft*14+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArEM_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageEMBC[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageEMBC[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageEMBC[sampling]->SetBinContent(ix,iy,replace); - } - } - - // ENDCAP A - if (barrel_ec==1 and pos_neg==1){ - // First find out if it's EMEC, HEC or FCAL ! - HWIdentifier test_chid = m_LArOnlineIDHelper->channel_Id(febid,1); - - // EMECA - if( m_LArOnlineIDHelper->isEMECchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWEMECA->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWEMECA->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArEM_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageEMECA[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageEMECA[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageEMECA[sampling]->SetBinContent(ix,iy,replace); - } - } - - // HECA - if( m_LArOnlineIDHelper->isHECchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWHECA->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWHECA->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArHEC_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageHECA[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageHECA[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageHECA[sampling]->SetBinContent(ix,iy,replace); - } - } - - // FCALA - if( m_LArOnlineIDHelper->isFCALchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWFCALA->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWFCALA->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArFCAL_IDHelper->module(offid); - int ieta = m_LArFCAL_IDHelper->eta(offid); - int iphi = m_LArFCAL_IDHelper->phi(offid); - const unsigned short * iBin = LArCoverageFCALBins::getBins(+2,sampling,ieta,iphi); - if ( iBin[0] > 0 && iBin[1] > 0 ) { - unsigned short ix = iBin[1]%(LArCoverageFCALBins::getXBins(+2,sampling)+2); - unsigned short iy = (iBin[1]-ix)/(LArCoverageFCALBins::getXBins(+2,sampling)+2); - m_hCoverageFCALA[sampling]->SetBinContent(ix,iy,replace); - } - } - } - } - - // ENDCAP C - if (barrel_ec==1 and pos_neg==0){ - // First find out if it's EMEC, HEC or FCAL ! - HWIdentifier test_chid = m_LArOnlineIDHelper->channel_Id(febid,1); - - // EMECC - if( m_LArOnlineIDHelper->isEMECchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWEMECC->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWEMECC->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArEM_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageEMECC[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageEMECC[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageEMECC[sampling]->SetBinContent(ix,iy,replace); - } - } - - // HECC - if( m_LArOnlineIDHelper->isHECchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWHECC->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWHECC->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArHEC_IDHelper->sampling(offid); - float eta, phi; - const CaloDetDescrElement* caloDetElement = caloDetDescrMgr->get_element(offid); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - eta = caloDetElement->eta_raw(); - phi = caloDetElement->phi_raw(); - } - int ix = m_hCoverageHECC[sampling]->GetXaxis()->FindBin(eta); - int iy = m_hCoverageHECC[sampling]->GetYaxis()->FindBin(phi); - m_hCoverageHECC[sampling]->SetBinContent(ix,iy,replace); - } - } - - // FCALC - if( m_LArOnlineIDHelper->isFCALchannel(test_chid)){ - int content; int replace = 0; - if (febStatus.deadAll() || febStatus.deadReadout()){ - content = int(m_hCoverageHWFCALC->GetBinContent(ft*15+slot,1)); - if(content==0 || content==1) replace = 1; - else replace = 4; - } - if (febStatus.inError()) replace = 1; - for (int ichan=0;ichan<128;ichan++){ - HWIdentifier chid = m_LArOnlineIDHelper->channel_Id(febid,ichan); - // Skip disconnected channels - if(!cabling->isOnlineConnected(chid)) continue; - m_hCoverageHWFCALC->SetBinContent(ft*15+slot,ichan+1,replace); - - Identifier offid = cabling->cnvToIdentifier(chid); - int sampling = m_LArFCAL_IDHelper->module(offid); - int ieta = m_LArFCAL_IDHelper->eta(offid); - int iphi = m_LArFCAL_IDHelper->phi(offid); - const unsigned short * iBin = LArCoverageFCALBins::getBins(-2,sampling,ieta,iphi); - if ( iBin[0] > 0 && iBin[1] > 0 ) { - unsigned short ix = iBin[1]%(LArCoverageFCALBins::getXBins(-2,sampling)+2); - unsigned short iy = (iBin[1]-ix)/(LArCoverageFCALBins::getXBins(-2,sampling)+2); - m_hCoverageFCALC[sampling]->SetBinContent(ix,iy,replace); - } - } - } - } - } // end missing FEB - } // end FEB loop - - return; -} -/*---------------------------------------------------------*/ -void LArCoverage::FixEmptyBins(){ - - // Sampling 1, EM Barrel, |eta| < 1.4 - for (int iphi=1;iphi<=256;iphi+=4){ - for (int ieta=1;ieta<448;ieta++){ - int contentA = int(m_hCoverageEMBA[1]->GetBinContent(ieta,iphi+1)); - float errorA = m_hCoverageEMBA[1]->GetBinError(ieta,iphi+1); - m_hCoverageEMBA[1]->SetBinContent(ieta,iphi,contentA); - m_hCoverageEMBA[1]->SetBinContent(ieta,iphi+2,contentA); - m_hCoverageEMBA[1]->SetBinContent(ieta,iphi+3,contentA); - m_hCoverageEMBA[1]->SetBinError(ieta,iphi,errorA); - m_hCoverageEMBA[1]->SetBinError(ieta,iphi+2,errorA); - m_hCoverageEMBA[1]->SetBinError(ieta,iphi+3,errorA); - } - } - for (int iphi=1;iphi<=256;iphi+=4){ - for (int ieta=4;ieta<451;ieta++){ - int contentC = int(m_hCoverageEMBC[1]->GetBinContent(ieta,iphi+2)); - float errorC = m_hCoverageEMBC[1]->GetBinError(ieta,iphi+2); - m_hCoverageEMBC[1]->SetBinContent(ieta,iphi,contentC); - m_hCoverageEMBC[1]->SetBinContent(ieta,iphi+1,contentC); - m_hCoverageEMBC[1]->SetBinContent(ieta,iphi+3,contentC); - m_hCoverageEMBC[1]->SetBinError(ieta,iphi,errorC); - m_hCoverageEMBC[1]->SetBinError(ieta,iphi+1,errorC); - m_hCoverageEMBC[1]->SetBinError(ieta,iphi+3,errorC); - } - } - - // Sampling 2, EM Endcap, |eta| > 2.5 - - for (int iphi=1;iphi<=256;iphi+=4){ - for (int ieta=44;ieta<52;ieta++){ - int contentA = int(m_hCoverageEMECA[2]->GetBinContent(ieta,iphi+1)); - float errorA = m_hCoverageEMECA[2]->GetBinError(ieta,iphi+1); - m_hCoverageEMECA[2]->SetBinContent(ieta,iphi,contentA); - m_hCoverageEMECA[2]->SetBinContent(ieta,iphi+2,contentA); - m_hCoverageEMECA[2]->SetBinContent(ieta,iphi+3,contentA); - m_hCoverageEMECA[2]->SetBinError(ieta,iphi,errorA); - m_hCoverageEMECA[2]->SetBinError(ieta,iphi+2,errorA); - m_hCoverageEMECA[2]->SetBinError(ieta,iphi+3,errorA); - } - } - for (int iphi=1;iphi<=256;iphi+=4){ - for (int ieta=1;ieta<8;ieta++){ - int contentC = int(m_hCoverageEMECC[2]->GetBinContent(ieta,iphi+2)); - float errorC = m_hCoverageEMECC[2]->GetBinError(ieta,iphi+2); - m_hCoverageEMECC[2]->SetBinContent(ieta,iphi,contentC); - m_hCoverageEMECC[2]->SetBinContent(ieta,iphi+1,contentC); - m_hCoverageEMECC[2]->SetBinContent(ieta,iphi+3,contentC); - m_hCoverageEMECC[2]->SetBinError(ieta,iphi,errorC); - m_hCoverageEMECC[2]->SetBinError(ieta,iphi+1,errorC); - m_hCoverageEMECC[2]->SetBinError(ieta,iphi+3,errorC); - } - } - - // All Samplings, HEC, |eta| > 2.5 - - int etabinmin[]={11,11,9,9}; - int etabinmax[]={14,13,12,12}; - - for (int iS=0;iS<4;iS++){ - - for (int iphi=1;iphi<=64;iphi+=2){ - for (int ieta=etabinmin[iS];ieta<=etabinmax[iS];ieta++){ - int contentA = int(m_hCoverageHECA[iS]->GetBinContent(ieta,iphi+1)); - float errorA = m_hCoverageHECA[iS]->GetBinError(ieta,iphi+1); - m_hCoverageHECA[iS]->SetBinContent(ieta,iphi,contentA); - m_hCoverageHECA[iS]->SetBinError(ieta,iphi,errorA); - } - } - - for (int iphi=1;iphi<=64;iphi+=2){ - for (int ieta=1; ieta<=(etabinmax[iS]-etabinmin[iS])+1;ieta++){ - int contentC = int(m_hCoverageHECC[iS]->GetBinContent(ieta,iphi+1)); - float errorC = m_hCoverageHECC[iS]->GetBinError(ieta,iphi+1); - m_hCoverageHECC[iS]->SetBinContent(ieta,iphi,contentC); - m_hCoverageHECC[iS]->SetBinError(ieta,iphi,errorC); - } - } - } - - // All Samplings, FCAL - - int nBinsEtaFCAL[4] = {0,63,32,16}; - - for (int iSFCal=1;iSFCal<4;iSFCal++){ - - for (int iphi=0;iphi<16;iphi++) { - for (int ieta=0;ieta<nBinsEtaFCAL[iSFCal];ieta++) { - const unsigned short * theBins = LArCoverageFCALBins::getBins(+2,iSFCal,ieta,iphi); - int iBin = 2; - if ( theBins[0] > 0 && theBins[1] > 0 ) { - unsigned short ix = theBins[1]%(LArCoverageFCALBins::getXBins(+2,iSFCal)+2); - unsigned short iy = (theBins[1]-ix)/(LArCoverageFCALBins::getXBins(+2,iSFCal)+2); - int cellContent = m_hCoverageFCALA[iSFCal]->GetBinContent(ix,iy); - while ( theBins[iBin] > 0 ) { - ix = theBins[iBin]%(LArCoverageFCALBins::getXBins(+2,iSFCal)+2); - iy = (theBins[iBin]-ix)/(LArCoverageFCALBins::getXBins(+2,iSFCal)+2); - m_hCoverageFCALA[iSFCal]->SetBinContent(ix,iy,cellContent); - iBin++; - } - } - theBins = LArCoverageFCALBins::getBins(-2,iSFCal,ieta,iphi); - iBin = 2; - if ( theBins[0] > 0 && theBins[1] > 0 ) { - unsigned short ix = theBins[1]%(LArCoverageFCALBins::getXBins(-2,iSFCal)+2); - unsigned short iy = (theBins[1]-ix)/(LArCoverageFCALBins::getXBins(-2,iSFCal)+2); - int cellContent = m_hCoverageFCALC[iSFCal]->GetBinContent(ix,iy); - while ( theBins[iBin] > 0 ) { - ix = theBins[iBin]%(LArCoverageFCALBins::getXBins(-2,iSFCal)+2); - iy = (theBins[iBin]-ix)/(LArCoverageFCALBins::getXBins(-2,iSFCal)+2); - m_hCoverageFCALC[iSFCal]->SetBinContent(ix,iy,cellContent); - iBin++; - } - } - } - } - } -} - diff --git a/LArCalorimeter/LArMonTools/src/LArCoverage.h b/LArCalorimeter/LArMonTools/src/LArCoverage.h deleted file mode 100644 index 03a886588700f441a3fc5aca7a24e98444ed3873..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoverage.h +++ /dev/null @@ -1,156 +0,0 @@ -//Dear emacs, this is -*-c++-*- -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArCoverage - * @author Jessica Leveque <jleveque@in2p3.fr> - * - */ - -#ifndef LARMONTOOLS_LARCOVERAGE_H -#define LARMONTOOLS_LARCOVERAGE_H - -#include "LArOnlineIDStrHelper.h" - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "CaloIdentifier/CaloGain.h" -#include "CaloIdentifier/CaloIdManager.h" -#include "CaloIdentifier/CaloCell_ID.h" -#include "CaloDetDescr/CaloDetDescrManager.h" -#include "CaloDetDescr/CaloDetDescriptor.h" -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloGeoHelpers/CaloPhiRange.h" - -#include "Identifier/HWIdentifier.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRawEvent/LArRawChannelContainer.h" -#include "LArCabling/LArOnOffIdMapping.h" -#include "LArRecConditions/LArBadChannelMask.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "CaloConditions/CaloNoise.h" - -#include <string> -#include <map> -#include <memory> - -class LArEM_ID; -class LArOnlineID; -class CaloDetDescrElement; -class ITHistSvc; -class LArCoverageFCALBins; - -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" -class TProfile_LW; - -class LArCoverage: public ManagedMonitorToolBase -{ - public: - LArCoverage(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArCoverage(); - - /** @brief Overwrite dummy method from AlgTool */ - virtual StatusCode initialize() override; - - /** Book general histograms - * Implement pure virtual methods of IMonitorToolBase */ - virtual StatusCode bookHistograms() override; - - /** Called each event */ - virtual StatusCode fillHistograms() override; - - /** Regularly called to fill noise maps - * Overwrite dummy method from MonitorToolBase */ - virtual StatusCode procHistograms() override; - -private: - - // services - const LArOnlineID* m_LArOnlineIDHelper; - const LArEM_ID* m_LArEM_IDHelper; - const LArFCAL_ID* m_LArFCAL_IDHelper; - const LArHEC_ID* m_LArHEC_IDHelper; - const CaloIdManager* m_caloIdMgr; - - std::unique_ptr<LArOnlineIDStrHelper> m_strHelper; - ITHistSvc* m_rootStore; - /** Handle to bad-channel tools */ - LArBadChannelMask m_bcMask; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"}; - SG::ReadHandleKey<LArRawChannelContainer> m_rawChannelsKey{this, "LArRawChannelKey", "LArRawChannels"}; - SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; - SG::ReadCondHandleKey<LArBadFebCont> m_BFKey{this, "MFKey", "LArBadFeb", "SG missing FEBs key"}; - SG::ReadCondHandleKey<CaloNoise> m_noiseCDOKey{this,"CaloNoiseKey","electronicNoise","SG Key of CaloNoise data object"}; - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey - {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this - , "CaloDetDescrManager" - , "CaloDetDescrManager" - , "SG Key for CaloDetDescrManager in the Condition Store" }; - - // To retrieve bad channel DB keywords - int DBflag(const EventContext& ctx, HWIdentifier onID); - - // To set histos Style - static void SetHWCoverageStyle(TH2I_LW* h); - static void SetPartCoverageStyle(TH2I_LW* h); - static void SetBadChannelZaxisLabels(TH2I_LW* h); - - // To keep track of known disabled FEBs - void FillKnownMissingFEBs(const EventContext& ctx, - const CaloDetDescrManager* caloDetDescrMgr); - - // To fix empty bins in histos with variable bin size - void FixEmptyBins(); - - // Properties - int m_nevents; - - // Other things - int m_eventsCounter; - - // Coverage Maps - TH2I_LW* m_hCoverageEMBA[4]; TH2I_LW* m_hCoverageEMBC[4]; - TH2I_LW* m_hCoverageEMECA[4]; TH2I_LW* m_hCoverageEMECC[4]; - TH2I_LW* m_hCoverageHECA[4]; TH2I_LW* m_hCoverageHECC[4]; - TH2I_LW* m_hCoverageFCALA[4]; TH2I_LW* m_hCoverageFCALC[4]; - - TH2I_LW* m_hCoverageHWEMBA; TH2I_LW* m_hCoverageHWEMBC; - TH2I_LW* m_hCoverageHWEMECA; TH2I_LW* m_hCoverageHWEMECC; - TH2I_LW* m_hCoverageHWHECA; TH2I_LW* m_hCoverageHWHECC; - TH2I_LW* m_hCoverageHWFCALA; TH2I_LW* m_hCoverageHWFCALC; - - // CaloNoise histograms - TProfile_LW* m_hCaloNoiseEM[4]; - TProfile_LW* m_hCaloNoiseHEC[4]; - TProfile_LW* m_hCaloNoiseFCAL[4]; - - // Bad Channels from DB - TH2I_LW* m_hBadChannelsBarrelA; - TH2I_LW* m_hBadChannelsBarrelC; - TH2I_LW* m_hBadChannelsEndcapA; - TH2I_LW* m_hBadChannelsEndcapC; - - - const std::array<CaloGain::CaloGain,CaloCell_Base_ID::NSUBCALO> m_highestGain{ - CaloGain::LARHIGHGAIN, //LAREM - CaloGain::LARMEDIUMGAIN, //LARHEC - CaloGain::LARHIGHGAIN, //LARFCAL - CaloGain::TILEHIGHHIGH, //TILE - CaloGain::LARHIGHGAIN //LARMINIFCAL - }; - - -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.cxx b/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.cxx deleted file mode 100644 index ad03df06cbfb856fb91907a41321180e3e7535b1..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.cxx +++ /dev/null @@ -1,1841 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArCoverageFCALBins.h" - -int LArCoverageFCALBins::getXBins(int /*iSide*/, int iSamp) { - static const int nbinsXFCAL[] = {240,216,200}; - - return nbinsXFCAL[iSamp-1]; -} - -int LArCoverageFCALBins::getYBins(int /*iSide*/, int iSamp) { - static const int nbinsYFCAL[] = {138,126,114}; - - return nbinsYFCAL[iSamp-1]; -} - -float LArCoverageFCALBins::getRMax(int /*iSide*/, int iSamp) { - // for |tan(theta)| * cos/sin(phi) - //static const float rmaxFCAL[] = {0.0901834, - // 0.0821644, - // 0.0756658}; - // for x/y in mm - static const float rmaxFCAL[] = {444.92, - 442.70, - 443.25}; - - return rmaxFCAL[iSamp-1]; -} - -float LArCoverageFCALBins::getRMin(int /*iSide*/) { - - // for |tan(theta)| * cos/sin(phi) - //static const float rminFCAL = 0.015; - // for x/y in mm - static const float rminFCAL = 74.00; - return rminFCAL; -} - -const unsigned short * LArCoverageFCALBins::getBins(int /*iSide*/, int iSamp, int iEta, int iPhi) { - - static const unsigned short dummy[] = {0}; - - static const unsigned short FCal_Bins_AC1[16*63][77] = { - {21773,21288,21289,21530,21531,21772,21773,22014,22015,0} - ,{17421,17178,17179,17420,17421,17422,17662,17663,0} - ,{18389,17904,17905,18146,18147,18388,18389,18630,18631,0} - ,{19113,18872,18873,19110,19111,19112,19113,19354,19355,0} - ,{20563,20078,20079,20320,20321,20562,20563,20804,20805,0} - ,{19595,19352,19353,19594,19595,19836,19837,19838,19839,0} - ,{18870,18626,18627,18628,18629,18868,18869,18870,18871,0} - ,{22494,22006,22007,22008,22009,22010,22011,22012,22013,22248,22249,22250,22251,22252,22253,22254,22255,22490,22491,22492,22493,22494,22495,22496,22497,22732,22733,22734,22735,22736,22737,22738,22739,0} - ,{23218,22974,22975,22976,22977,23216,23217,23218,23219,0} - ,{18386,18142,18143,18144,18145,18384,18385,18386,18387,0} - ,{17902,17658,17659,17660,17661,17900,17901,17902,17903,0} - ,{17418,17174,17175,17176,17177,17416,17417,17418,17419,0} - ,{21526,21038,21039,21040,21041,21042,21043,21044,21045,21280,21281,21282,21283,21284,21285,21286,21287,21522,21523,21524,21525,21526,21527,21528,21529,21764,21765,21766,21767,21768,21769,21770,21771,0} - ,{20558,20070,20071,20072,20073,20074,20075,20076,20077,20312,20313,20314,20315,20316,20317,20318,20319,20554,20555,20556,20557,20558,20559,20560,20561,20796,20797,20798,20799,20800,20801,20802,20803,0} - ,{19590,19102,19103,19104,19105,19106,19107,19108,19109,19344,19345,19346,19347,19348,19349,19350,19351,19586,19587,19588,19589,19590,19591,19592,19593,19828,19829,19830,19831,19832,19833,19834,19835,0} - ,{18622,18134,18135,18136,18137,18138,18139,18140,18141,18376,18377,18378,18379,18380,18381,18382,18383,18618,18619,18620,18621,18622,18623,18624,18625,18860,18861,18862,18863,18864,18865,18866,18867,0} - ,{17654,17166,17167,17168,17169,17170,17171,17172,17173,17408,17409,17410,17411,17412,17413,17414,17415,17650,17651,17652,17653,17654,17655,17656,17657,17892,17893,17894,17895,17896,17897,17898,17899,0} - ,{22486,21998,21999,22000,22001,22002,22003,22004,22005,22240,22241,22242,22243,22244,22245,22246,22247,22482,22483,22484,22485,22486,22487,22488,22489,22724,22725,22726,22727,22728,22729,22730,22731,0} - ,{21518,21030,21031,21032,21033,21034,21035,21036,21037,21272,21273,21274,21275,21276,21277,21278,21279,21514,21515,21516,21517,21518,21519,21520,21521,21756,21757,21758,21759,21760,21761,21762,21763,0} - ,{20550,20062,20063,20064,20065,20066,20067,20068,20069,20304,20305,20306,20307,20308,20309,20310,20311,20546,20547,20548,20549,20550,20551,20552,20553,20788,20789,20790,20791,20792,20793,20794,20795,0} - ,{19582,19094,19095,19096,19097,19098,19099,19100,19101,19336,19337,19338,19339,19340,19341,19342,19343,19578,19579,19580,19581,19582,19583,19584,19585,19820,19821,19822,19823,19824,19825,19826,19827,0} - ,{18614,18126,18127,18128,18129,18130,18131,18132,18133,18368,18369,18370,18371,18372,18373,18374,18375,18610,18611,18612,18613,18614,18615,18616,18617,18852,18853,18854,18855,18856,18857,18858,18859,0} - ,{17646,17158,17159,17160,17161,17162,17163,17164,17165,17400,17401,17402,17403,17404,17405,17406,17407,17642,17643,17644,17645,17646,17647,17648,17649,17884,17885,17886,17887,17888,17889,17890,17891,0} - ,{21510,21022,21023,21024,21025,21026,21027,21028,21029,21264,21265,21266,21267,21268,21269,21270,21271,21506,21507,21508,21509,21510,21511,21512,21513,21748,21749,21750,21751,21752,21753,21754,21755,0} - ,{20542,20054,20055,20056,20057,20058,20059,20060,20061,20296,20297,20298,20299,20300,20301,20302,20303,20538,20539,20540,20541,20542,20543,20544,20545,20780,20781,20782,20783,20784,20785,20786,20787,0} - ,{19574,19086,19087,19088,19089,19090,19091,19092,19093,19328,19329,19330,19331,19332,19333,19334,19335,19570,19571,19572,19573,19574,19575,19576,19577,19812,19813,19814,19815,19816,19817,19818,19819,0} - ,{18606,18118,18119,18120,18121,18122,18123,18124,18125,18360,18361,18362,18363,18364,18365,18366,18367,18602,18603,18604,18605,18606,18607,18608,18609,18844,18845,18846,18847,18848,18849,18850,18851,0} - ,{17638,17150,17151,17152,17153,17154,17155,17156,17157,17392,17393,17394,17395,17396,17397,17398,17399,17634,17635,17636,17637,17638,17639,17640,17641,17876,17877,17878,17879,17880,17881,17882,17883,0} - ,{21501,21014,21015,21016,21017,21018,21019,21020,21021,21256,21257,21258,21259,21260,21261,21262,21263,21498,21499,21500,21501,21502,21503,21504,21505,21740,21741,21742,21743,21744,21745,21746,21747,0} - ,{20533,20046,20047,20048,20049,20050,20051,20052,20053,20288,20289,20290,20291,20292,20293,20294,20295,20530,20531,20532,20533,20534,20535,20536,20537,20772,20773,20774,20775,20776,20777,20778,20779,0} - ,{19565,19078,19079,19080,19081,19082,19083,19084,19085,19320,19321,19322,19323,19324,19325,19326,19327,19562,19563,19564,19565,19566,19567,19568,19569,19804,19805,19806,19807,19808,19809,19810,19811,0} - ,{18597,18110,18111,18112,18113,18114,18115,18116,18117,18352,18353,18354,18355,18356,18357,18358,18359,18594,18595,18596,18597,18598,18599,18600,18601,18836,18837,18838,18839,18840,18841,18842,18843,0} - ,{17629,17142,17143,17144,17145,17146,17147,17148,17149,17384,17385,17386,17387,17388,17389,17390,17391,17626,17627,17628,17629,17630,17631,17632,17633,17868,17869,17870,17871,17872,17873,17874,17875,0} - ,{20525,20038,20039,20040,20041,20042,20043,20044,20045,20280,20281,20282,20283,20284,20285,20286,20287,20522,20523,20524,20525,20526,20527,20528,20529,20764,20765,20766,20767,20768,20769,20770,20771,0} - ,{19557,19070,19071,19072,19073,19074,19075,19076,19077,19312,19313,19314,19315,19316,19317,19318,19319,19554,19555,19556,19557,19558,19559,19560,19561,19796,19797,19798,19799,19800,19801,19802,19803,0} - ,{18589,18102,18103,18104,18105,18106,18107,18108,18109,18344,18345,18346,18347,18348,18349,18350,18351,18586,18587,18588,18589,18590,18591,18592,18593,18828,18829,18830,18831,18832,18833,18834,18835,0} - ,{17621,17134,17135,17136,17137,17138,17139,17140,17141,17376,17377,17378,17379,17380,17381,17382,17383,17618,17619,17620,17621,17622,17623,17624,17625,17860,17861,17862,17863,17864,17865,17866,17867,0} - ,{20517,20030,20031,20032,20033,20034,20035,20036,20037,20272,20273,20274,20275,20276,20277,20278,20279,20514,20515,20516,20517,20518,20519,20520,20521,20756,20757,20758,20759,20760,20761,20762,20763,0} - ,{19549,19062,19063,19064,19065,19066,19067,19068,19069,19304,19305,19306,19307,19308,19309,19310,19311,19546,19547,19548,19549,19550,19551,19552,19553,19788,19789,19790,19791,19792,19793,19794,19795,0} - ,{18581,18094,18095,18096,18097,18098,18099,18100,18101,18336,18337,18338,18339,18340,18341,18342,18343,18578,18579,18580,18581,18582,18583,18584,18585,18820,18821,18822,18823,18824,18825,18826,18827,0} - ,{17613,17126,17127,17128,17129,17130,17131,17132,17133,17368,17369,17370,17371,17372,17373,17374,17375,17610,17611,17612,17613,17614,17615,17616,17617,17852,17853,17854,17855,17856,17857,17858,17859,0} - ,{20509,20022,20023,20024,20025,20026,20027,20028,20029,20264,20265,20266,20267,20268,20269,20270,20271,20506,20507,20508,20509,20510,20511,20512,20513,20748,20749,20750,20751,20752,20753,20754,20755,0} - ,{19541,19054,19055,19056,19057,19058,19059,19060,19061,19296,19297,19298,19299,19300,19301,19302,19303,19538,19539,19540,19541,19542,19543,19544,19545,19780,19781,19782,19783,19784,19785,19786,19787,0} - ,{18573,18086,18087,18088,18089,18090,18091,18092,18093,18328,18329,18330,18331,18332,18333,18334,18335,18570,18571,18572,18573,18574,18575,18576,18577,18812,18813,18814,18815,18816,18817,18818,18819,0} - ,{17605,17118,17119,17120,17121,17122,17123,17124,17125,17360,17361,17362,17363,17364,17365,17366,17367,17602,17603,17604,17605,17606,17607,17608,17609,17844,17845,17846,17847,17848,17849,17850,17851,0} - ,{19533,19046,19047,19048,19049,19050,19051,19052,19053,19288,19289,19290,19291,19292,19293,19294,19295,19530,19531,19532,19533,19534,19535,19536,19537,19772,19773,19774,19775,19776,19777,19778,19779,0} - ,{18565,18078,18079,18080,18081,18082,18083,18084,18085,18320,18321,18322,18323,18324,18325,18326,18327,18562,18563,18564,18565,18566,18567,18568,18569,18804,18805,18806,18807,18808,18809,18810,18811,0} - ,{17597,17110,17111,17112,17113,17114,17115,17116,17117,17352,17353,17354,17355,17356,17357,17358,17359,17594,17595,17596,17597,17598,17599,17600,17601,17836,17837,17838,17839,17840,17841,17842,17843,0} - ,{19525,19038,19039,19040,19041,19042,19043,19044,19045,19280,19281,19282,19283,19284,19285,19286,19287,19522,19523,19524,19525,19526,19527,19528,19529,19764,19765,19766,19767,19768,19769,19770,19771,0} - ,{18557,18070,18071,18072,18073,18074,18075,18076,18077,18312,18313,18314,18315,18316,18317,18318,18319,18554,18555,18556,18557,18558,18559,18560,18561,18796,18797,18798,18799,18800,18801,18802,18803,0} - ,{17589,17102,17103,17104,17105,17106,17107,17108,17109,17344,17345,17346,17347,17348,17349,17350,17351,17586,17587,17588,17589,17590,17591,17592,17593,17828,17829,17830,17831,17832,17833,17834,17835,0} - ,{18549,18062,18063,18064,18065,18066,18067,18068,18069,18304,18305,18306,18307,18308,18309,18310,18311,18546,18547,18548,18549,18550,18551,18552,18553,18788,18789,18790,18791,18792,18793,18794,18795,0} - ,{17581,17094,17095,17096,17097,17098,17099,17100,17101,17336,17337,17338,17339,17340,17341,17342,17343,17578,17579,17580,17581,17582,17583,17584,17585,17820,17821,17822,17823,17824,17825,17826,17827,0} - ,{18785,18542,18543,18544,18545,18784,18785,18786,18787,0} - ,{18301,18058,18059,18060,18061,18300,18301,18302,18303,0} - ,{17817,17574,17575,17576,17577,17816,17817,17818,17819,0} - ,{17333,17090,17091,17092,17093,17332,17333,17334,17335,0} - ,{18297,18054,18055,18056,18057,18296,18297,18298,18299,0} - ,{17813,17570,17571,17572,17573,17812,17813,17814,17815,0} - ,{17329,17086,17087,17088,17089,17328,17329,17330,17331,0} - ,{18293,18050,18051,18052,18053,18292,18293,18294,18295,0} - ,{17809,17566,17567,17568,17569,17808,17809,17810,17811,0} - ,{17325,17082,17083,17084,17085,17324,17325,17326,17327,0} - ,{27799,27556,27557,27558,27559,27798,27799,28040,28041,0} - ,{24427,24184,24185,24186,24187,24426,24427,24668,24669,0} - ,{23461,23458,23459,23460,23461,23462,23463,23704,23705,0} - ,{25150,24906,24907,24908,24909,25148,25149,25150,25151,0} - ,{27076,26832,26833,26834,26835,27076,27077,27316,27317,0} - ,{23944,23700,23701,23702,23703,23942,23943,23944,23945,0} - ,{28277,27790,27791,27792,27793,27794,27795,27796,27797,28032,28033,28034,28035,28036,28037,28038,28039,28274,28275,28276,28277,28278,28279,28280,28281,28516,28517,28518,28519,28520,28521,28760,28761,0} - ,{25630,25386,25387,25388,25389,25628,25629,25630,25631,0} - ,{27073,26830,26831,27072,27073,27074,27075,27314,27315,0} - ,{25146,24902,24903,24904,24905,25144,25145,25146,25147,0} - ,{26350,25862,25863,25864,25865,25866,25867,25868,25869,25870,25871,26104,26105,26106,26107,26108,26109,26110,26111,26112,26113,26346,26347,26348,26349,26350,26351,26588,26589,26590,26591,26592,26593,0} - ,{24422,23934,23935,23936,23937,23938,23939,23940,23941,24176,24177,24178,24179,24180,24181,24182,24183,24418,24419,24420,24421,24422,24423,24424,24425,24660,24661,24662,24663,24664,24665,24666,24667,0} - ,{27309,26822,26823,26824,26825,26826,26827,26828,26829,27064,27065,27066,27067,27068,27069,27070,27071,27306,27307,27308,27309,27310,27311,27312,27313,27548,27549,27550,27551,27552,27553,27554,27555,0} - ,{23454,22966,22967,22968,22969,22970,22971,22972,22973,23208,23209,23210,23211,23212,23213,23214,23215,23450,23451,23452,23453,23454,23455,23456,23457,23692,23693,23694,23695,23696,23697,23698,23699,0} - ,{25382,24894,24895,24896,24897,24898,24899,24900,24901,25136,25137,25138,25139,25140,25141,25142,25143,25378,25379,25380,25381,25382,25383,25384,25385,25620,25621,25622,25623,25624,25625,25626,25627,0} - ,{26341,25854,25855,25856,25857,25858,25859,25860,25861,26096,26097,26098,26099,26100,26101,26102,26103,26338,26339,26340,26341,26342,26343,26344,26345,26580,26581,26582,26583,26584,26585,26586,26587,0} - ,{24414,23926,23927,23928,23929,23930,23931,23932,23933,24168,24169,24170,24171,24172,24173,24174,24175,24410,24411,24412,24413,24414,24415,24416,24417,24652,24653,24654,24655,24656,24657,24658,24659,0} - ,{27301,26814,26815,26816,26817,26818,26819,26820,26821,27056,27057,27058,27059,27060,27061,27062,27063,27298,27299,27300,27301,27302,27303,27304,27305,27540,27541,27542,27543,27544,27545,27546,27547,0} - ,{25373,24886,24887,24888,24889,24890,24891,24892,24893,25128,25129,25130,25131,25132,25133,25134,25135,25370,25371,25372,25373,25374,25375,25376,25377,25612,25613,25614,25615,25616,25617,25618,25619,0} - ,{23446,22958,22959,22960,22961,22962,22963,22964,22965,23200,23201,23202,23203,23204,23205,23206,23207,23442,23443,23444,23445,23446,23447,23448,23449,23684,23685,23686,23687,23688,23689,23690,23691,0} - ,{26333,25846,25847,25848,25849,25850,25851,25852,25853,26088,26089,26090,26091,26092,26093,26094,26095,26330,26331,26332,26333,26334,26335,26336,26337,26572,26573,26574,26575,26576,26577,26578,26579,0} - ,{22478,21990,21991,21992,21993,21994,21995,21996,21997,22232,22233,22234,22235,22236,22237,22238,22239,22474,22475,22476,22477,22478,22479,22480,22481,22716,22717,22718,22719,22720,22721,22722,22723,0} - ,{24405,23918,23919,23920,23921,23922,23923,23924,23925,24160,24161,24162,24163,24164,24165,24166,24167,24402,24403,24404,24405,24406,24407,24408,24409,24644,24645,24646,24647,24648,24649,24650,24651,0} - ,{25365,24878,24879,24880,24881,24882,24883,24884,24885,25120,25121,25122,25123,25124,25125,25126,25127,25362,25363,25364,25365,25366,25367,25368,25369,25604,25605,25606,25607,25608,25609,25610,25611,0} - ,{23437,22950,22951,22952,22953,22954,22955,22956,22957,23192,23193,23194,23195,23196,23197,23198,23199,23434,23435,23436,23437,23438,23439,23440,23441,23676,23677,23678,23679,23680,23681,23682,23683,0} - ,{26325,25838,25839,25840,25841,25842,25843,25844,25845,26080,26081,26082,26083,26084,26085,26086,26087,26322,26323,26324,26325,26326,26327,26328,26329,26564,26565,26566,26567,26568,26569,26570,26571,0} - ,{22469,21982,21983,21984,21985,21986,21987,21988,21989,22224,22225,22226,22227,22228,22229,22230,22231,22466,22467,22468,22469,22470,22471,22472,22473,22708,22709,22710,22711,22712,22713,22714,22715,0} - ,{24397,23910,23911,23912,23913,23914,23915,23916,23917,24152,24153,24154,24155,24156,24157,24158,24159,24394,24395,24396,24397,24398,24399,24400,24401,24636,24637,24638,24639,24640,24641,24642,24643,0} - ,{25357,24870,24871,24872,24873,24874,24875,24876,24877,25112,25113,25114,25115,25116,25117,25118,25119,25354,25355,25356,25357,25358,25359,25360,25361,25596,25597,25598,25599,25600,25601,25602,25603,0} - ,{23429,22942,22943,22944,22945,22946,22947,22948,22949,23184,23185,23186,23187,23188,23189,23190,23191,23426,23427,23428,23429,23430,23431,23432,23433,23668,23669,23670,23671,23672,23673,23674,23675,0} - ,{24389,23902,23903,23904,23905,23906,23907,23908,23909,24144,24145,24146,24147,24148,24149,24150,24151,24386,24387,24388,24389,24390,24391,24392,24393,24628,24629,24630,24631,24632,24633,24634,24635,0} - ,{22461,21974,21975,21976,21977,21978,21979,21980,21981,22216,22217,22218,22219,22220,22221,22222,22223,22458,22459,22460,22461,22462,22463,22464,22465,22700,22701,22702,22703,22704,22705,22706,22707,0} - ,{25349,24862,24863,24864,24865,24866,24867,24868,24869,25104,25105,25106,25107,25108,25109,25110,25111,25346,25347,25348,25349,25350,25351,25352,25353,25588,25589,25590,25591,25592,25593,25594,25595,0} - ,{21493,21006,21007,21008,21009,21010,21011,21012,21013,21248,21249,21250,21251,21252,21253,21254,21255,21490,21491,21492,21493,21494,21495,21496,21497,21732,21733,21734,21735,21736,21737,21738,21739,0} - ,{23421,22934,22935,22936,22937,22938,22939,22940,22941,23176,23177,23178,23179,23180,23181,23182,23183,23418,23419,23420,23421,23422,23423,23424,23425,23660,23661,23662,23663,23664,23665,23666,23667,0} - ,{24381,23894,23895,23896,23897,23898,23899,23900,23901,24136,24137,24138,24139,24140,24141,24142,24143,24378,24379,24380,24381,24382,24383,24384,24385,24620,24621,24622,24623,24624,24625,24626,24627,0} - ,{22453,21966,21967,21968,21969,21970,21971,21972,21973,22208,22209,22210,22211,22212,22213,22214,22215,22450,22451,22452,22453,22454,22455,22456,22457,22692,22693,22694,22695,22696,22697,22698,22699,0} - ,{23413,22926,22927,22928,22929,22930,22931,22932,22933,23168,23169,23170,23171,23172,23173,23174,23175,23410,23411,23412,23413,23414,23415,23416,23417,23652,23653,23654,23655,23656,23657,23658,23659,0} - ,{21485,20998,20999,21000,21001,21002,21003,21004,21005,21240,21241,21242,21243,21244,21245,21246,21247,21482,21483,21484,21485,21486,21487,21488,21489,21724,21725,21726,21727,21728,21729,21730,21731,0} - ,{22445,21958,21959,21960,21961,21962,21963,21964,21965,22200,22201,22202,22203,22204,22205,22206,22207,22442,22443,22444,22445,22446,22447,22448,22449,22684,22685,22686,22687,22688,22689,22690,22691,0} - ,{23405,22918,22919,22920,22921,22922,22923,22924,22925,23160,23161,23162,23163,23164,23165,23166,23167,23402,23403,23404,23405,23406,23407,23408,23409,23644,23645,23646,23647,23648,23649,23650,23651,0} - ,{21477,20990,20991,20992,20993,20994,20995,20996,20997,21232,21233,21234,21235,21236,21237,21238,21239,21474,21475,21476,21477,21478,21479,21480,21481,21716,21717,21718,21719,21720,21721,21722,21723,0} - ,{22437,21950,21951,21952,21953,21954,21955,21956,21957,22192,22193,22194,22195,22196,22197,22198,22199,22434,22435,22436,22437,22438,22439,22440,22441,22676,22677,22678,22679,22680,22681,22682,22683,0} - ,{21469,20982,20983,20984,20985,20986,20987,20988,20989,21224,21225,21226,21227,21228,21229,21230,21231,21466,21467,21468,21469,21470,21471,21472,21473,21708,21709,21710,21711,21712,21713,21714,21715,0} - ,{22429,21942,21943,21944,21945,21946,21947,21948,21949,22184,22185,22186,22187,22188,22189,22190,22191,22426,22427,22428,22429,22430,22431,22432,22433,22668,22669,22670,22671,22672,22673,22674,22675,0} - ,{20501,20014,20015,20016,20017,20018,20019,20020,20021,20256,20257,20258,20259,20260,20261,20262,20263,20498,20499,20500,20501,20502,20503,20504,20505,20740,20741,20742,20743,20744,20745,20746,20747,0} - ,{21461,20974,20975,20976,20977,20978,20979,20980,20981,21216,21217,21218,21219,21220,21221,21222,21223,21458,21459,21460,21461,21462,21463,21464,21465,21700,21701,21702,21703,21704,21705,21706,21707,0} - ,{20493,20006,20007,20008,20009,20010,20011,20012,20013,20248,20249,20250,20251,20252,20253,20254,20255,20490,20491,20492,20493,20494,20495,20496,20497,20732,20733,20734,20735,20736,20737,20738,20739,0} - ,{21453,20966,20967,20968,20969,20970,20971,20972,20973,21208,21209,21210,21211,21212,21213,21214,21215,21450,21451,21452,21453,21454,21455,21456,21457,21692,21693,21694,21695,21696,21697,21698,21699,0} - ,{20485,19998,19999,20000,20001,20002,20003,20004,20005,20240,20241,20242,20243,20244,20245,20246,20247,20482,20483,20484,20485,20486,20487,20488,20489,20724,20725,20726,20727,20728,20729,20730,20731,0} - ,{19517,19030,19031,19032,19033,19034,19035,19036,19037,19272,19273,19274,19275,19276,19277,19278,19279,19514,19515,19516,19517,19518,19519,19520,19521,19756,19757,19758,19759,19760,19761,19762,19763,0} - ,{20477,19990,19991,19992,19993,19994,19995,19996,19997,20232,20233,20234,20235,20236,20237,20238,20239,20474,20475,20476,20477,20478,20479,20480,20481,20716,20717,20718,20719,20720,20721,20722,20723,0} - ,{19753,19510,19511,19512,19513,19752,19753,19754,19755,0} - ,{19269,19026,19027,19028,19029,19268,19269,19270,19271,0} - ,{19749,19506,19507,19508,19509,19748,19749,19750,19751,0} - ,{19265,19022,19023,19024,19025,19264,19265,19266,19267,0} - ,{19745,19502,19503,19504,19505,19744,19745,19746,19747,0} - ,{18781,18538,18539,18540,18541,18780,18781,18782,18783,0} - ,{19261,19018,19019,19020,19021,19260,19261,19262,19263,0} - ,{18777,18534,18535,18536,18537,18776,18777,18778,18779,0} - ,{19257,19014,19015,19016,19017,19256,19257,19258,19259,0} - ,{19013,18772,18773,18774,18775,19012,19013,19254,19255,0} - ,{18289,18048,18049,18290,18291,18530,18531,18532,18533,0} - ,{29722,29480,29481,29482,29483,29720,29721,29962,29963,0} - ,{31874,31630,31631,31632,31633,31634,31635,31874,31875,0} - ,{31396,30912,30913,31154,31155,31396,31397,31636,31637,0} - ,{29959,29716,29717,29718,29719,29958,29959,29960,29961,0} - ,{31871,31628,31629,31870,31871,31872,31873,32112,32113,0} - ,{31868,31624,31625,31626,31627,31868,31869,32110,32111,0} - ,{29238,28750,28751,28752,28753,28754,28755,28756,28757,28758,28759,28992,28993,28994,28995,28996,28997,28998,28999,29000,29001,29234,29235,29236,29237,29238,29239,29240,29241,29476,29477,29478,29479,0} - ,{30914,30670,30671,30672,30673,30674,30675,30914,30915,0} - ,{30194,29952,29953,29954,29955,30194,30195,30436,30437,0} - ,{29955,29710,29711,29712,29713,29714,29715,29956,29957,0} - ,{31149,30662,30663,30664,30665,30666,30667,30668,30669,30904,30905,30906,30907,30908,30909,30910,30911,31146,31147,31148,31149,31150,31151,31152,31153,31388,31389,31390,31391,31392,31393,31394,31395,0} - ,{30189,29702,29703,29704,29705,29706,29707,29708,29709,29944,29945,29946,29947,29948,29949,29950,29951,30186,30187,30188,30189,30190,30191,30192,30193,30428,30429,30430,30431,30432,30433,30434,30435,0} - ,{29229,28742,28743,28744,28745,28746,28747,28748,28749,28984,28985,28986,28987,28988,28989,28990,28991,29226,29227,29228,29229,29230,29231,29232,29233,29468,29469,29470,29471,29472,29473,29474,29475,0} - ,{28269,27782,27783,27784,27785,27786,27787,27788,27789,28024,28025,28026,28027,28028,28029,28030,28031,28266,28267,28268,28269,28270,28271,28272,28273,28508,28509,28510,28511,28512,28513,28514,28515,0} - ,{31141,30654,30655,30656,30657,30658,30659,30660,30661,30896,30897,30898,30899,30900,30901,30902,30903,31138,31139,31140,31141,31142,31143,31144,31145,31380,31381,31382,31383,31384,31385,31386,31387,0} - ,{30181,29694,29695,29696,29697,29698,29699,29700,29701,29936,29937,29938,29939,29940,29941,29942,29943,30178,30179,30180,30181,30182,30183,30184,30185,30420,30421,30422,30423,30424,30425,30426,30427,0} - ,{29221,28734,28735,28736,28737,28738,28739,28740,28741,28976,28977,28978,28979,28980,28981,28982,28983,29218,29219,29220,29221,29222,29223,29224,29225,29460,29461,29462,29463,29464,29465,29466,29467,0} - ,{28261,27774,27775,27776,27777,27778,27779,27780,27781,28016,28017,28018,28019,28020,28021,28022,28023,28258,28259,28260,28261,28262,28263,28264,28265,28500,28501,28502,28503,28504,28505,28506,28507,0} - ,{30173,29686,29687,29688,29689,29690,29691,29692,29693,29928,29929,29930,29931,29932,29933,29934,29935,30170,30171,30172,30173,30174,30175,30176,30177,30412,30413,30414,30415,30416,30417,30418,30419,0} - ,{29213,28726,28727,28728,28729,28730,28731,28732,28733,28968,28969,28970,28971,28972,28973,28974,28975,29210,29211,29212,29213,29214,29215,29216,29217,29452,29453,29454,29455,29456,29457,29458,29459,0} - ,{28253,27766,27767,27768,27769,27770,27771,27772,27773,28008,28009,28010,28011,28012,28013,28014,28015,28250,28251,28252,28253,28254,28255,28256,28257,28492,28493,28494,28495,28496,28497,28498,28499,0} - ,{27293,26806,26807,26808,26809,26810,26811,26812,26813,27048,27049,27050,27051,27052,27053,27054,27055,27290,27291,27292,27293,27294,27295,27296,27297,27532,27533,27534,27535,27536,27537,27538,27539,0} - ,{29205,28718,28719,28720,28721,28722,28723,28724,28725,28960,28961,28962,28963,28964,28965,28966,28967,29202,29203,29204,29205,29206,29207,29208,29209,29444,29445,29446,29447,29448,29449,29450,29451,0} - ,{28245,27758,27759,27760,27761,27762,27763,27764,27765,28000,28001,28002,28003,28004,28005,28006,28007,28242,28243,28244,28245,28246,28247,28248,28249,28484,28485,28486,28487,28488,28489,28490,28491,0} - ,{27285,26798,26799,26800,26801,26802,26803,26804,26805,27040,27041,27042,27043,27044,27045,27046,27047,27282,27283,27284,27285,27286,27287,27288,27289,27524,27525,27526,27527,27528,27529,27530,27531,0} - ,{29197,28710,28711,28712,28713,28714,28715,28716,28717,28952,28953,28954,28955,28956,28957,28958,28959,29194,29195,29196,29197,29198,29199,29200,29201,29436,29437,29438,29439,29440,29441,29442,29443,0} - ,{28237,27750,27751,27752,27753,27754,27755,27756,27757,27992,27993,27994,27995,27996,27997,27998,27999,28234,28235,28236,28237,28238,28239,28240,28241,28476,28477,28478,28479,28480,28481,28482,28483,0} - ,{27277,26790,26791,26792,26793,26794,26795,26796,26797,27032,27033,27034,27035,27036,27037,27038,27039,27274,27275,27276,27277,27278,27279,27280,27281,27516,27517,27518,27519,27520,27521,27522,27523,0} - ,{26317,25830,25831,25832,25833,25834,25835,25836,25837,26072,26073,26074,26075,26076,26077,26078,26079,26314,26315,26316,26317,26318,26319,26320,26321,26556,26557,26558,26559,26560,26561,26562,26563,0} - ,{28229,27742,27743,27744,27745,27746,27747,27748,27749,27984,27985,27986,27987,27988,27989,27990,27991,28226,28227,28228,28229,28230,28231,28232,28233,28468,28469,28470,28471,28472,28473,28474,28475,0} - ,{27269,26782,26783,26784,26785,26786,26787,26788,26789,27024,27025,27026,27027,27028,27029,27030,27031,27266,27267,27268,27269,27270,27271,27272,27273,27508,27509,27510,27511,27512,27513,27514,27515,0} - ,{26309,25822,25823,25824,25825,25826,25827,25828,25829,26064,26065,26066,26067,26068,26069,26070,26071,26306,26307,26308,26309,26310,26311,26312,26313,26548,26549,26550,26551,26552,26553,26554,26555,0} - ,{27261,26774,26775,26776,26777,26778,26779,26780,26781,27016,27017,27018,27019,27020,27021,27022,27023,27258,27259,27260,27261,27262,27263,27264,27265,27500,27501,27502,27503,27504,27505,27506,27507,0} - ,{26301,25814,25815,25816,25817,25818,25819,25820,25821,26056,26057,26058,26059,26060,26061,26062,26063,26298,26299,26300,26301,26302,26303,26304,26305,26540,26541,26542,26543,26544,26545,26546,26547,0} - ,{25341,24854,24855,24856,24857,24858,24859,24860,24861,25096,25097,25098,25099,25100,25101,25102,25103,25338,25339,25340,25341,25342,25343,25344,25345,25580,25581,25582,25583,25584,25585,25586,25587,0} - ,{26293,25806,25807,25808,25809,25810,25811,25812,25813,26048,26049,26050,26051,26052,26053,26054,26055,26290,26291,26292,26293,26294,26295,26296,26297,26532,26533,26534,26535,26536,26537,26538,26539,0} - ,{25333,24846,24847,24848,24849,24850,24851,24852,24853,25088,25089,25090,25091,25092,25093,25094,25095,25330,25331,25332,25333,25334,25335,25336,25337,25572,25573,25574,25575,25576,25577,25578,25579,0} - ,{24373,23886,23887,23888,23889,23890,23891,23892,23893,24128,24129,24130,24131,24132,24133,24134,24135,24370,24371,24372,24373,24374,24375,24376,24377,24612,24613,24614,24615,24616,24617,24618,24619,0} - ,{26285,25798,25799,25800,25801,25802,25803,25804,25805,26040,26041,26042,26043,26044,26045,26046,26047,26282,26283,26284,26285,26286,26287,26288,26289,26524,26525,26526,26527,26528,26529,26530,26531,0} - ,{25325,24838,24839,24840,24841,24842,24843,24844,24845,25080,25081,25082,25083,25084,25085,25086,25087,25322,25323,25324,25325,25326,25327,25328,25329,25564,25565,25566,25567,25568,25569,25570,25571,0} - ,{24365,23878,23879,23880,23881,23882,23883,23884,23885,24120,24121,24122,24123,24124,24125,24126,24127,24362,24363,24364,24365,24366,24367,24368,24369,24604,24605,24606,24607,24608,24609,24610,24611,0} - ,{25317,24830,24831,24832,24833,24834,24835,24836,24837,25072,25073,25074,25075,25076,25077,25078,25079,25314,25315,25316,25317,25318,25319,25320,25321,25556,25557,25558,25559,25560,25561,25562,25563,0} - ,{24357,23870,23871,23872,23873,23874,23875,23876,23877,24112,24113,24114,24115,24116,24117,24118,24119,24354,24355,24356,24357,24358,24359,24360,24361,24596,24597,24598,24599,24600,24601,24602,24603,0} - ,{23397,22910,22911,22912,22913,22914,22915,22916,22917,23152,23153,23154,23155,23156,23157,23158,23159,23394,23395,23396,23397,23398,23399,23400,23401,23636,23637,23638,23639,23640,23641,23642,23643,0} - ,{24349,23862,23863,23864,23865,23866,23867,23868,23869,24104,24105,24106,24107,24108,24109,24110,24111,24346,24347,24348,24349,24350,24351,24352,24353,24588,24589,24590,24591,24592,24593,24594,24595,0} - ,{23389,22902,22903,22904,22905,22906,22907,22908,22909,23144,23145,23146,23147,23148,23149,23150,23151,23386,23387,23388,23389,23390,23391,23392,23393,23628,23629,23630,23631,23632,23633,23634,23635,0} - ,{23381,22894,22895,22896,22897,22898,22899,22900,22901,23136,23137,23138,23139,23140,23141,23142,23143,23378,23379,23380,23381,23382,23383,23384,23385,23620,23621,23622,23623,23624,23625,23626,23627,0} - ,{22421,21934,21935,21936,21937,21938,21939,21940,21941,22176,22177,22178,22179,22180,22181,22182,22183,22418,22419,22420,22421,22422,22423,22424,22425,22660,22661,22662,22663,22664,22665,22666,22667,0} - ,{23373,22886,22887,22888,22889,22890,22891,22892,22893,23128,23129,23130,23131,23132,23133,23134,23135,23370,23371,23372,23373,23374,23375,23376,23377,23612,23613,23614,23615,23616,23617,23618,23619,0} - ,{22413,21926,21927,21928,21929,21930,21931,21932,21933,22168,22169,22170,22171,22172,22173,22174,22175,22410,22411,22412,22413,22414,22415,22416,22417,22652,22653,22654,22655,22656,22657,22658,22659,0} - ,{22405,21918,21919,21920,21921,21922,21923,21924,21925,22160,22161,22162,22163,22164,22165,22166,22167,22402,22403,22404,22405,22406,22407,22408,22409,22644,22645,22646,22647,22648,22649,22650,22651,0} - ,{21445,20958,20959,20960,20961,20962,20963,20964,20965,21200,21201,21202,21203,21204,21205,21206,21207,21442,21443,21444,21445,21446,21447,21448,21449,21684,21685,21686,21687,21688,21689,21690,21691,0} - ,{21437,20950,20951,20952,20953,20954,20955,20956,20957,21192,21193,21194,21195,21196,21197,21198,21199,21434,21435,21436,21437,21438,21439,21440,21441,21676,21677,21678,21679,21680,21681,21682,21683,0} - ,{20713,20470,20471,20472,20473,20712,20713,20714,20715,0} - ,{20709,20466,20467,20468,20469,20708,20709,20710,20711,0} - ,{20229,19986,19987,19988,19989,20228,20229,20230,20231,0} - ,{20705,20462,20463,20464,20465,20704,20705,20706,20707,0} - ,{20225,19982,19983,19984,19985,20224,20225,20226,20227,0} - ,{20221,19978,19979,19980,19981,20220,20221,20222,20223,0} - ,{19741,19498,19499,19500,19501,19740,19741,19742,19743,0} - ,{20217,19974,19975,19976,19977,20216,20217,20218,20219,0} - ,{19737,19494,19495,19496,19497,19736,19737,19738,19739,0} - ,{19732,19492,19493,19730,19731,19732,19733,19734,19735,0} - ,{33763,33518,33519,33520,33521,33522,33523,33524,33525,0} - ,{32828,32584,32585,32586,32587,32588,32589,32826,32827,0} - ,{32350,32108,32109,32348,32349,32350,32351,32352,32353,0} - ,{32823,32580,32581,32582,32583,32822,32823,32824,32825,0} - ,{32818,32574,32575,32576,32577,32578,32579,32816,32817,0} - ,{33045,32558,32559,32560,32561,32562,32563,32564,32565,32800,32801,32802,32803,32804,32805,32806,32807,33042,33043,33044,33045,33046,33047,33048,33049,33284,33285,33286,33287,33288,33289,33290,33291,0} - ,{32813,32570,32571,32572,32573,32812,32813,32814,32815,0} - ,{33037,32550,32551,32552,32553,32554,32555,32556,32557,32792,32793,32794,32795,32796,32797,32798,32799,33034,33035,33036,33037,33038,33039,33040,33041,33276,33277,33278,33279,33280,33281,33282,33283,0} - ,{31864,31622,31623,31864,31865,31866,31867,32106,32107,0} - ,{32809,32566,32567,32568,32569,32808,32809,32810,32811,0} - ,{32101,31614,31615,31616,31617,31618,31619,31620,31621,31856,31857,31858,31859,31860,31861,31862,31863,32098,32099,32100,32101,32102,32103,32104,32105,32340,32341,32342,32343,32344,32345,32346,32347,0} - ,{32093,31606,31607,31608,31609,31610,31611,31612,31613,31848,31849,31850,31851,31852,31853,31854,31855,32090,32091,32092,32093,32094,32095,32096,32097,32332,32333,32334,32335,32336,32337,32338,32339,0} - ,{32085,31598,31599,31600,31601,31602,31603,31604,31605,31840,31841,31842,31843,31844,31845,31846,31847,32082,32083,32084,32085,32086,32087,32088,32089,32324,32325,32326,32327,32328,32329,32330,32331,0} - ,{32077,31590,31591,31592,31593,31594,31595,31596,31597,31832,31833,31834,31835,31836,31837,31838,31839,32074,32075,32076,32077,32078,32079,32080,32081,32316,32317,32318,32319,32320,32321,32322,32323,0} - ,{32069,31582,31583,31584,31585,31586,31587,31588,31589,31824,31825,31826,31827,31828,31829,31830,31831,32066,32067,32068,32069,32070,32071,32072,32073,32308,32309,32310,32311,32312,32313,32314,32315,0} - ,{31133,30646,30647,30648,30649,30650,30651,30652,30653,30888,30889,30890,30891,30892,30893,30894,30895,31130,31131,31132,31133,31134,31135,31136,31137,31372,31373,31374,31375,31376,31377,31378,31379,0} - ,{31125,30638,30639,30640,30641,30642,30643,30644,30645,30880,30881,30882,30883,30884,30885,30886,30887,31122,31123,31124,31125,31126,31127,31128,31129,31364,31365,31366,31367,31368,31369,31370,31371,0} - ,{31117,30630,30631,30632,30633,30634,30635,30636,30637,30872,30873,30874,30875,30876,30877,30878,30879,31114,31115,31116,31117,31118,31119,31120,31121,31356,31357,31358,31359,31360,31361,31362,31363,0} - ,{31109,30622,30623,30624,30625,30626,30627,30628,30629,30864,30865,30866,30867,30868,30869,30870,30871,31106,31107,31108,31109,31110,31111,31112,31113,31348,31349,31350,31351,31352,31353,31354,31355,0} - ,{31101,30614,30615,30616,30617,30618,30619,30620,30621,30856,30857,30858,30859,30860,30861,30862,30863,31098,31099,31100,31101,31102,31103,31104,31105,31340,31341,31342,31343,31344,31345,31346,31347,0} - ,{30165,29678,29679,29680,29681,29682,29683,29684,29685,29920,29921,29922,29923,29924,29925,29926,29927,30162,30163,30164,30165,30166,30167,30168,30169,30404,30405,30406,30407,30408,30409,30410,30411,0} - ,{30157,29670,29671,29672,29673,29674,29675,29676,29677,29912,29913,29914,29915,29916,29917,29918,29919,30154,30155,30156,30157,30158,30159,30160,30161,30396,30397,30398,30399,30400,30401,30402,30403,0} - ,{30149,29662,29663,29664,29665,29666,29667,29668,29669,29904,29905,29906,29907,29908,29909,29910,29911,30146,30147,30148,30149,30150,30151,30152,30153,30388,30389,30390,30391,30392,30393,30394,30395,0} - ,{30141,29654,29655,29656,29657,29658,29659,29660,29661,29896,29897,29898,29899,29900,29901,29902,29903,30138,30139,30140,30141,30142,30143,30144,30145,30380,30381,30382,30383,30384,30385,30386,30387,0} - ,{30133,29646,29647,29648,29649,29650,29651,29652,29653,29888,29889,29890,29891,29892,29893,29894,29895,30130,30131,30132,30133,30134,30135,30136,30137,30372,30373,30374,30375,30376,30377,30378,30379,0} - ,{29189,28702,28703,28704,28705,28706,28707,28708,28709,28944,28945,28946,28947,28948,28949,28950,28951,29186,29187,29188,29189,29190,29191,29192,29193,29428,29429,29430,29431,29432,29433,29434,29435,0} - ,{29181,28694,28695,28696,28697,28698,28699,28700,28701,28936,28937,28938,28939,28940,28941,28942,28943,29178,29179,29180,29181,29182,29183,29184,29185,29420,29421,29422,29423,29424,29425,29426,29427,0} - ,{29173,28686,28687,28688,28689,28690,28691,28692,28693,28928,28929,28930,28931,28932,28933,28934,28935,29170,29171,29172,29173,29174,29175,29176,29177,29412,29413,29414,29415,29416,29417,29418,29419,0} - ,{29165,28678,28679,28680,28681,28682,28683,28684,28685,28920,28921,28922,28923,28924,28925,28926,28927,29162,29163,29164,29165,29166,29167,29168,29169,29404,29405,29406,29407,29408,29409,29410,29411,0} - ,{28221,27734,27735,27736,27737,27738,27739,27740,27741,27976,27977,27978,27979,27980,27981,27982,27983,28218,28219,28220,28221,28222,28223,28224,28225,28460,28461,28462,28463,28464,28465,28466,28467,0} - ,{28213,27726,27727,27728,27729,27730,27731,27732,27733,27968,27969,27970,27971,27972,27973,27974,27975,28210,28211,28212,28213,28214,28215,28216,28217,28452,28453,28454,28455,28456,28457,28458,28459,0} - ,{28205,27718,27719,27720,27721,27722,27723,27724,27725,27960,27961,27962,27963,27964,27965,27966,27967,28202,28203,28204,28205,28206,28207,28208,28209,28444,28445,28446,28447,28448,28449,28450,28451,0} - ,{28197,27710,27711,27712,27713,27714,27715,27716,27717,27952,27953,27954,27955,27956,27957,27958,27959,28194,28195,28196,28197,28198,28199,28200,28201,28436,28437,28438,28439,28440,28441,28442,28443,0} - ,{27253,26766,26767,26768,26769,26770,26771,26772,26773,27008,27009,27010,27011,27012,27013,27014,27015,27250,27251,27252,27253,27254,27255,27256,27257,27492,27493,27494,27495,27496,27497,27498,27499,0} - ,{27245,26758,26759,26760,26761,26762,26763,26764,26765,27000,27001,27002,27003,27004,27005,27006,27007,27242,27243,27244,27245,27246,27247,27248,27249,27484,27485,27486,27487,27488,27489,27490,27491,0} - ,{27237,26750,26751,26752,26753,26754,26755,26756,26757,26992,26993,26994,26995,26996,26997,26998,26999,27234,27235,27236,27237,27238,27239,27240,27241,27476,27477,27478,27479,27480,27481,27482,27483,0} - ,{27229,26742,26743,26744,26745,26746,26747,26748,26749,26984,26985,26986,26987,26988,26989,26990,26991,27226,27227,27228,27229,27230,27231,27232,27233,27468,27469,27470,27471,27472,27473,27474,27475,0} - ,{26277,25790,25791,25792,25793,25794,25795,25796,25797,26032,26033,26034,26035,26036,26037,26038,26039,26274,26275,26276,26277,26278,26279,26280,26281,26516,26517,26518,26519,26520,26521,26522,26523,0} - ,{26269,25782,25783,25784,25785,25786,25787,25788,25789,26024,26025,26026,26027,26028,26029,26030,26031,26266,26267,26268,26269,26270,26271,26272,26273,26508,26509,26510,26511,26512,26513,26514,26515,0} - ,{26261,25774,25775,25776,25777,25778,25779,25780,25781,26016,26017,26018,26019,26020,26021,26022,26023,26258,26259,26260,26261,26262,26263,26264,26265,26500,26501,26502,26503,26504,26505,26506,26507,0} - ,{25309,24822,24823,24824,24825,24826,24827,24828,24829,25064,25065,25066,25067,25068,25069,25070,25071,25306,25307,25308,25309,25310,25311,25312,25313,25548,25549,25550,25551,25552,25553,25554,25555,0} - ,{25301,24814,24815,24816,24817,24818,24819,24820,24821,25056,25057,25058,25059,25060,25061,25062,25063,25298,25299,25300,25301,25302,25303,25304,25305,25540,25541,25542,25543,25544,25545,25546,25547,0} - ,{25293,24806,24807,24808,24809,24810,24811,24812,24813,25048,25049,25050,25051,25052,25053,25054,25055,25290,25291,25292,25293,25294,25295,25296,25297,25532,25533,25534,25535,25536,25537,25538,25539,0} - ,{24341,23854,23855,23856,23857,23858,23859,23860,23861,24096,24097,24098,24099,24100,24101,24102,24103,24338,24339,24340,24341,24342,24343,24344,24345,24580,24581,24582,24583,24584,24585,24586,24587,0} - ,{24333,23846,23847,23848,23849,23850,23851,23852,23853,24088,24089,24090,24091,24092,24093,24094,24095,24330,24331,24332,24333,24334,24335,24336,24337,24572,24573,24574,24575,24576,24577,24578,24579,0} - ,{24325,23838,23839,23840,23841,23842,23843,23844,23845,24080,24081,24082,24083,24084,24085,24086,24087,24322,24323,24324,24325,24326,24327,24328,24329,24564,24565,24566,24567,24568,24569,24570,24571,0} - ,{23365,22878,22879,22880,22881,22882,22883,22884,22885,23120,23121,23122,23123,23124,23125,23126,23127,23362,23363,23364,23365,23366,23367,23368,23369,23604,23605,23606,23607,23608,23609,23610,23611,0} - ,{23357,22870,22871,22872,22873,22874,22875,22876,22877,23112,23113,23114,23115,23116,23117,23118,23119,23354,23355,23356,23357,23358,23359,23360,23361,23596,23597,23598,23599,23600,23601,23602,23603,0} - ,{22397,21910,21911,21912,21913,21914,21915,21916,21917,22152,22153,22154,22155,22156,22157,22158,22159,22394,22395,22396,22397,22398,22399,22400,22401,22636,22637,22638,22639,22640,22641,22642,22643,0} - ,{22389,21902,21903,21904,21905,21906,21907,21908,21909,22144,22145,22146,22147,22148,22149,22150,22151,22386,22387,22388,22389,22390,22391,22392,22393,22628,22629,22630,22631,22632,22633,22634,22635,0} - ,{21673,21430,21431,21432,21433,21672,21673,21674,21675,0} - ,{21669,21426,21427,21428,21429,21668,21669,21670,21671,0} - ,{21665,21422,21423,21424,21425,21664,21665,21666,21667,0} - ,{21661,21418,21419,21420,21421,21660,21661,21662,21663,0} - ,{21189,20946,20947,20948,20949,21188,21189,21190,21191,0} - ,{21185,20942,20943,20944,20945,21184,21185,21186,21187,0} - ,{21181,20938,20939,20940,20941,21180,21181,21182,21183,0} - ,{21177,20934,20935,20936,20937,21176,21177,21178,21179,0} - ,{20701,20458,20459,20460,20461,20700,20701,20702,20703,0} - ,{20697,20454,20455,20456,20457,20696,20697,20698,20699,0} - ,{20693,20450,20451,20452,20453,20692,20693,20694,20695,0} - ,{20213,19970,19971,19972,19973,20212,20213,20214,20215,0} - ,{20209,19966,19967,19968,19969,20208,20209,20210,20211,0} - ,{33755,33510,33511,33512,33513,33514,33515,33516,33517,0} - ,{32510,32508,32509,32510,32511,32512,32513,0} - ,{32756,32514,32515,32516,32517,32756,32757,32758,32759,0} - ,{32760,32518,32519,32520,32521,32760,32761,32762,32763,0} - ,{32020,31534,31535,31536,31537,31538,31539,31540,31541,31776,31777,31778,31779,31780,31781,31782,31783,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32262,32263,32264,32265,32266,32267,0} - ,{32765,32522,32523,32524,32525,32766,32767,32768,32769,0} - ,{33020,32534,32535,32536,32537,32538,32539,32540,32541,32776,32777,32778,32779,32780,32781,32782,32783,33018,33019,33020,33021,33022,33023,33024,33025,33260,33261,33262,33263,33264,33265,33266,33267,0} - ,{32769,32526,32527,32528,32529,32770,32771,32772,32773,0} - ,{33028,32542,32543,32544,32545,32546,32547,32548,32549,32784,32785,32786,32787,32788,32789,32790,32791,33026,33027,33028,33029,33030,33031,33032,33033,33268,33269,33270,33271,33272,33273,33274,33275,0} - ,{32773,32530,32531,32532,32533,32774,32775,33016,33017,0} - ,{32028,31542,31543,31544,31545,31546,31547,31548,31549,31784,31785,31786,31787,31788,31789,31790,31791,32026,32027,32028,32029,32030,32031,32032,32033,32268,32269,32270,32271,32272,32273,32274,32275,0} - ,{32036,31550,31551,31552,31553,31554,31555,31556,31557,31792,31793,31794,31795,31796,31797,31798,31799,32034,32035,32036,32037,32038,32039,32040,32041,32276,32277,32278,32279,32280,32281,32282,32283,0} - ,{32044,31558,31559,31560,31561,31562,31563,31564,31565,31800,31801,31802,31803,31804,31805,31806,31807,32042,32043,32044,32045,32046,32047,32048,32049,32284,32285,32286,32287,32288,32289,32290,32291,0} - ,{32052,31566,31567,31568,31569,31570,31571,31572,31573,31808,31809,31810,31811,31812,31813,31814,31815,32050,32051,32052,32053,32054,32055,32056,32057,32292,32293,32294,32295,32296,32297,32298,32299,0} - ,{32060,31574,31575,31576,31577,31578,31579,31580,31581,31816,31817,31818,31819,31820,31821,31822,31823,32058,32059,32060,32061,32062,32063,32064,32065,32300,32301,32302,32303,32304,32305,32306,32307,0} - ,{31060,30574,30575,30576,30577,30578,30579,30580,30581,30816,30817,30818,30819,30820,30821,30822,30823,31058,31059,31060,31061,31062,31063,31064,31065,31300,31301,31302,31303,31304,31305,31306,31307,0} - ,{31068,30582,30583,30584,30585,30586,30587,30588,30589,30824,30825,30826,30827,30828,30829,30830,30831,31066,31067,31068,31069,31070,31071,31072,31073,31308,31309,31310,31311,31312,31313,31314,31315,0} - ,{31076,30590,30591,30592,30593,30594,30595,30596,30597,30832,30833,30834,30835,30836,30837,30838,30839,31074,31075,31076,31077,31078,31079,31080,31081,31316,31317,31318,31319,31320,31321,31322,31323,0} - ,{31084,30598,30599,30600,30601,30602,30603,30604,30605,30840,30841,30842,30843,30844,30845,30846,30847,31082,31083,31084,31085,31086,31087,31088,31089,31324,31325,31326,31327,31328,31329,31330,31331,0} - ,{31092,30606,30607,30608,30609,30610,30611,30612,30613,30848,30849,30850,30851,30852,30853,30854,30855,31090,31091,31092,31093,31094,31095,31096,31097,31332,31333,31334,31335,31336,31337,31338,31339,0} - ,{30092,29606,29607,29608,29609,29610,29611,29612,29613,29848,29849,29850,29851,29852,29853,29854,29855,30090,30091,30092,30093,30094,30095,30096,30097,30332,30333,30334,30335,30336,30337,30338,30339,0} - ,{30100,29614,29615,29616,29617,29618,29619,29620,29621,29856,29857,29858,29859,29860,29861,29862,29863,30098,30099,30100,30101,30102,30103,30104,30105,30340,30341,30342,30343,30344,30345,30346,30347,0} - ,{30108,29622,29623,29624,29625,29626,29627,29628,29629,29864,29865,29866,29867,29868,29869,29870,29871,30106,30107,30108,30109,30110,30111,30112,30113,30348,30349,30350,30351,30352,30353,30354,30355,0} - ,{30116,29630,29631,29632,29633,29634,29635,29636,29637,29872,29873,29874,29875,29876,29877,29878,29879,30114,30115,30116,30117,30118,30119,30120,30121,30356,30357,30358,30359,30360,30361,30362,30363,0} - ,{30124,29638,29639,29640,29641,29642,29643,29644,29645,29880,29881,29882,29883,29884,29885,29886,29887,30122,30123,30124,30125,30126,30127,30128,30129,30364,30365,30366,30367,30368,30369,30370,30371,0} - ,{29132,28646,28647,28648,28649,28650,28651,28652,28653,28888,28889,28890,28891,28892,28893,28894,28895,29130,29131,29132,29133,29134,29135,29136,29137,29372,29373,29374,29375,29376,29377,29378,29379,0} - ,{29140,28654,28655,28656,28657,28658,28659,28660,28661,28896,28897,28898,28899,28900,28901,28902,28903,29138,29139,29140,29141,29142,29143,29144,29145,29380,29381,29382,29383,29384,29385,29386,29387,0} - ,{29148,28662,28663,28664,28665,28666,28667,28668,28669,28904,28905,28906,28907,28908,28909,28910,28911,29146,29147,29148,29149,29150,29151,29152,29153,29388,29389,29390,29391,29392,29393,29394,29395,0} - ,{29156,28670,28671,28672,28673,28674,28675,28676,28677,28912,28913,28914,28915,28916,28917,28918,28919,29154,29155,29156,29157,29158,29159,29160,29161,29396,29397,29398,29399,29400,29401,29402,29403,0} - ,{28164,27678,27679,27680,27681,27682,27683,27684,27685,27920,27921,27922,27923,27924,27925,27926,27927,28162,28163,28164,28165,28166,28167,28168,28169,28404,28405,28406,28407,28408,28409,28410,28411,0} - ,{28172,27686,27687,27688,27689,27690,27691,27692,27693,27928,27929,27930,27931,27932,27933,27934,27935,28170,28171,28172,28173,28174,28175,28176,28177,28412,28413,28414,28415,28416,28417,28418,28419,0} - ,{28180,27694,27695,27696,27697,27698,27699,27700,27701,27936,27937,27938,27939,27940,27941,27942,27943,28178,28179,28180,28181,28182,28183,28184,28185,28420,28421,28422,28423,28424,28425,28426,28427,0} - ,{28188,27702,27703,27704,27705,27706,27707,27708,27709,27944,27945,27946,27947,27948,27949,27950,27951,28186,28187,28188,28189,28190,28191,28192,28193,28428,28429,28430,28431,28432,28433,28434,28435,0} - ,{27196,26710,26711,26712,26713,26714,26715,26716,26717,26952,26953,26954,26955,26956,26957,26958,26959,27194,27195,27196,27197,27198,27199,27200,27201,27436,27437,27438,27439,27440,27441,27442,27443,0} - ,{27204,26718,26719,26720,26721,26722,26723,26724,26725,26960,26961,26962,26963,26964,26965,26966,26967,27202,27203,27204,27205,27206,27207,27208,27209,27444,27445,27446,27447,27448,27449,27450,27451,0} - ,{27212,26726,26727,26728,26729,26730,26731,26732,26733,26968,26969,26970,26971,26972,26973,26974,26975,27210,27211,27212,27213,27214,27215,27216,27217,27452,27453,27454,27455,27456,27457,27458,27459,0} - ,{27220,26734,26735,26736,26737,26738,26739,26740,26741,26976,26977,26978,26979,26980,26981,26982,26983,27218,27219,27220,27221,27222,27223,27224,27225,27460,27461,27462,27463,27464,27465,27466,27467,0} - ,{26236,25750,25751,25752,25753,25754,25755,25756,25757,25992,25993,25994,25995,25996,25997,25998,25999,26234,26235,26236,26237,26238,26239,26240,26241,26476,26477,26478,26479,26480,26481,26482,26483,0} - ,{26244,25758,25759,25760,25761,25762,25763,25764,25765,26000,26001,26002,26003,26004,26005,26006,26007,26242,26243,26244,26245,26246,26247,26248,26249,26484,26485,26486,26487,26488,26489,26490,26491,0} - ,{26252,25766,25767,25768,25769,25770,25771,25772,25773,26008,26009,26010,26011,26012,26013,26014,26015,26250,26251,26252,26253,26254,26255,26256,26257,26492,26493,26494,26495,26496,26497,26498,26499,0} - ,{25268,24782,24783,24784,24785,24786,24787,24788,24789,25024,25025,25026,25027,25028,25029,25030,25031,25266,25267,25268,25269,25270,25271,25272,25273,25508,25509,25510,25511,25512,25513,25514,25515,0} - ,{25276,24790,24791,24792,24793,24794,24795,24796,24797,25032,25033,25034,25035,25036,25037,25038,25039,25274,25275,25276,25277,25278,25279,25280,25281,25516,25517,25518,25519,25520,25521,25522,25523,0} - ,{25284,24798,24799,24800,24801,24802,24803,24804,24805,25040,25041,25042,25043,25044,25045,25046,25047,25282,25283,25284,25285,25286,25287,25288,25289,25524,25525,25526,25527,25528,25529,25530,25531,0} - ,{24300,23814,23815,23816,23817,23818,23819,23820,23821,24056,24057,24058,24059,24060,24061,24062,24063,24298,24299,24300,24301,24302,24303,24304,24305,24540,24541,24542,24543,24544,24545,24546,24547,0} - ,{24308,23822,23823,23824,23825,23826,23827,23828,23829,24064,24065,24066,24067,24068,24069,24070,24071,24306,24307,24308,24309,24310,24311,24312,24313,24548,24549,24550,24551,24552,24553,24554,24555,0} - ,{24316,23830,23831,23832,23833,23834,23835,23836,23837,24072,24073,24074,24075,24076,24077,24078,24079,24314,24315,24316,24317,24318,24319,24320,24321,24556,24557,24558,24559,24560,24561,24562,24563,0} - ,{23340,22854,22855,22856,22857,22858,22859,22860,22861,23096,23097,23098,23099,23100,23101,23102,23103,23338,23339,23340,23341,23342,23343,23344,23345,23580,23581,23582,23583,23584,23585,23586,23587,0} - ,{23348,22862,22863,22864,22865,22866,22867,22868,22869,23104,23105,23106,23107,23108,23109,23110,23111,23346,23347,23348,23349,23350,23351,23352,23353,23588,23589,23590,23591,23592,23593,23594,23595,0} - ,{22372,21886,21887,21888,21889,21890,21891,21892,21893,22128,22129,22130,22131,22132,22133,22134,22135,22370,22371,22372,22373,22374,22375,22376,22377,22612,22613,22614,22615,22616,22617,22618,22619,0} - ,{22380,21894,21895,21896,21897,21898,21899,21900,21901,22136,22137,22138,22139,22140,22141,22142,22143,22378,22379,22380,22381,22382,22383,22384,22385,22620,22621,22622,22623,22624,22625,22626,22627,0} - ,{21644,21402,21403,21404,21405,21644,21645,21646,21647,0} - ,{21648,21406,21407,21408,21409,21648,21649,21650,21651,0} - ,{21652,21410,21411,21412,21413,21652,21653,21654,21655,0} - ,{21656,21414,21415,21416,21417,21656,21657,21658,21659,0} - ,{21160,20918,20919,20920,20921,21160,21161,21162,21163,0} - ,{21164,20922,20923,20924,20925,21164,21165,21166,21167,0} - ,{21168,20926,20927,20928,20929,21168,21169,21170,21171,0} - ,{21172,20930,20931,20932,20933,21172,21173,21174,21175,0} - ,{20680,20438,20439,20440,20441,20680,20681,20682,20683,0} - ,{20684,20442,20443,20444,20445,20684,20685,20686,20687,0} - ,{20688,20446,20447,20448,20449,20688,20689,20690,20691,0} - ,{20200,19958,19959,19960,19961,20200,20201,20202,20203,0} - ,{20204,19962,19963,19964,19965,20204,20205,20206,20207,0} - ,{31525,31282,31283,31524,31525,31526,31527,31528,31529,0} - ,{29569,29568,29569,29570,29571,29572,29573,0} - ,{31772,31530,31531,31532,31533,31772,31773,31774,31775,0} - ,{29814,29574,29575,29814,29815,29816,29817,29818,29819,0} - ,{30794,30550,30551,30552,30553,30554,30555,30796,30797,0} - ,{31039,30556,30557,30798,30799,31038,31039,31040,31041,0} - ,{29084,28596,28597,28598,28599,28600,28601,28602,28603,28604,28605,28840,28841,28842,28843,28844,28845,28846,28847,29082,29083,29084,29085,29086,29087,29088,29089,29326,29327,29328,29329,29330,29331,0} - ,{30062,29822,29823,30062,30063,30064,30065,30306,30307,0} - ,{29819,29576,29577,29578,29579,29580,29581,29820,29821,0} - ,{31044,30558,30559,30560,30561,30562,30563,30564,30565,30800,30801,30802,30803,30804,30805,30806,30807,31042,31043,31044,31045,31046,31047,31048,31049,31284,31285,31286,31287,31288,31289,31290,31291,0} - ,{30068,29582,29583,29584,29585,29586,29587,29588,29589,29824,29825,29826,29827,29828,29829,29830,29831,30066,30067,30068,30069,30070,30071,30072,30073,30308,30309,30310,30311,30312,30313,30314,30315,0} - ,{28116,27630,27631,27632,27633,27634,27635,27636,27637,27872,27873,27874,27875,27876,27877,27878,27879,28114,28115,28116,28117,28118,28119,28120,28121,28356,28357,28358,28359,28360,28361,28362,28363,0} - ,{29092,28606,28607,28608,28609,28610,28611,28612,28613,28848,28849,28850,28851,28852,28853,28854,28855,29090,29091,29092,29093,29094,29095,29096,29097,29332,29333,29334,29335,29336,29337,29338,29339,0} - ,{31052,30566,30567,30568,30569,30570,30571,30572,30573,30808,30809,30810,30811,30812,30813,30814,30815,31050,31051,31052,31053,31054,31055,31056,31057,31292,31293,31294,31295,31296,31297,31298,31299,0} - ,{30076,29590,29591,29592,29593,29594,29595,29596,29597,29832,29833,29834,29835,29836,29837,29838,29839,30074,30075,30076,30077,30078,30079,30080,30081,30316,30317,30318,30319,30320,30321,30322,30323,0} - ,{29100,28614,28615,28616,28617,28618,28619,28620,28621,28856,28857,28858,28859,28860,28861,28862,28863,29098,29099,29100,29101,29102,29103,29104,29105,29340,29341,29342,29343,29344,29345,29346,29347,0} - ,{28124,27638,27639,27640,27641,27642,27643,27644,27645,27880,27881,27882,27883,27884,27885,27886,27887,28122,28123,28124,28125,28126,28127,28128,28129,28364,28365,28366,28367,28368,28369,28370,28371,0} - ,{30084,29598,29599,29600,29601,29602,29603,29604,29605,29840,29841,29842,29843,29844,29845,29846,29847,30082,30083,30084,30085,30086,30087,30088,30089,30324,30325,30326,30327,30328,30329,30330,30331,0} - ,{29108,28622,28623,28624,28625,28626,28627,28628,28629,28864,28865,28866,28867,28868,28869,28870,28871,29106,29107,29108,29109,29110,29111,29112,29113,29348,29349,29350,29351,29352,29353,29354,29355,0} - ,{28132,27646,27647,27648,27649,27650,27651,27652,27653,27888,27889,27890,27891,27892,27893,27894,27895,28130,28131,28132,28133,28134,28135,28136,28137,28372,28373,28374,28375,28376,28377,28378,28379,0} - ,{27156,26670,26671,26672,26673,26674,26675,26676,26677,26912,26913,26914,26915,26916,26917,26918,26919,27154,27155,27156,27157,27158,27159,27160,27161,27396,27397,27398,27399,27400,27401,27402,27403,0} - ,{29116,28630,28631,28632,28633,28634,28635,28636,28637,28872,28873,28874,28875,28876,28877,28878,28879,29114,29115,29116,29117,29118,29119,29120,29121,29356,29357,29358,29359,29360,29361,29362,29363,0} - ,{28140,27654,27655,27656,27657,27658,27659,27660,27661,27896,27897,27898,27899,27900,27901,27902,27903,28138,28139,28140,28141,28142,28143,28144,28145,28380,28381,28382,28383,28384,28385,28386,28387,0} - ,{27164,26678,26679,26680,26681,26682,26683,26684,26685,26920,26921,26922,26923,26924,26925,26926,26927,27162,27163,27164,27165,27166,27167,27168,27169,27404,27405,27406,27407,27408,27409,27410,27411,0} - ,{29124,28638,28639,28640,28641,28642,28643,28644,28645,28880,28881,28882,28883,28884,28885,28886,28887,29122,29123,29124,29125,29126,29127,29128,29129,29364,29365,29366,29367,29368,29369,29370,29371,0} - ,{28148,27662,27663,27664,27665,27666,27667,27668,27669,27904,27905,27906,27907,27908,27909,27910,27911,28146,28147,28148,28149,28150,28151,28152,28153,28388,28389,28390,28391,28392,28393,28394,28395,0} - ,{27172,26686,26687,26688,26689,26690,26691,26692,26693,26928,26929,26930,26931,26932,26933,26934,26935,27170,27171,27172,27173,27174,27175,27176,27177,27412,27413,27414,27415,27416,27417,27418,27419,0} - ,{26196,25710,25711,25712,25713,25714,25715,25716,25717,25952,25953,25954,25955,25956,25957,25958,25959,26194,26195,26196,26197,26198,26199,26200,26201,26436,26437,26438,26439,26440,26441,26442,26443,0} - ,{28156,27670,27671,27672,27673,27674,27675,27676,27677,27912,27913,27914,27915,27916,27917,27918,27919,28154,28155,28156,28157,28158,28159,28160,28161,28396,28397,28398,28399,28400,28401,28402,28403,0} - ,{27180,26694,26695,26696,26697,26698,26699,26700,26701,26936,26937,26938,26939,26940,26941,26942,26943,27178,27179,27180,27181,27182,27183,27184,27185,27420,27421,27422,27423,27424,27425,27426,27427,0} - ,{26204,25718,25719,25720,25721,25722,25723,25724,25725,25960,25961,25962,25963,25964,25965,25966,25967,26202,26203,26204,26205,26206,26207,26208,26209,26444,26445,26446,26447,26448,26449,26450,26451,0} - ,{27188,26702,26703,26704,26705,26706,26707,26708,26709,26944,26945,26946,26947,26948,26949,26950,26951,27186,27187,27188,27189,27190,27191,27192,27193,27428,27429,27430,27431,27432,27433,27434,27435,0} - ,{26212,25726,25727,25728,25729,25730,25731,25732,25733,25968,25969,25970,25971,25972,25973,25974,25975,26210,26211,26212,26213,26214,26215,26216,26217,26452,26453,26454,26455,26456,26457,26458,26459,0} - ,{25236,24750,24751,24752,24753,24754,24755,24756,24757,24992,24993,24994,24995,24996,24997,24998,24999,25234,25235,25236,25237,25238,25239,25240,25241,25476,25477,25478,25479,25480,25481,25482,25483,0} - ,{26220,25734,25735,25736,25737,25738,25739,25740,25741,25976,25977,25978,25979,25980,25981,25982,25983,26218,26219,26220,26221,26222,26223,26224,26225,26460,26461,26462,26463,26464,26465,26466,26467,0} - ,{24268,23782,23783,23784,23785,23786,23787,23788,23789,24024,24025,24026,24027,24028,24029,24030,24031,24266,24267,24268,24269,24270,24271,24272,24273,24508,24509,24510,24511,24512,24513,24514,24515,0} - ,{25244,24758,24759,24760,24761,24762,24763,24764,24765,25000,25001,25002,25003,25004,25005,25006,25007,25242,25243,25244,25245,25246,25247,25248,25249,25484,25485,25486,25487,25488,25489,25490,25491,0} - ,{26228,25742,25743,25744,25745,25746,25747,25748,25749,25984,25985,25986,25987,25988,25989,25990,25991,26226,26227,26228,26229,26230,26231,26232,26233,26468,26469,26470,26471,26472,26473,26474,26475,0} - ,{25252,24766,24767,24768,24769,24770,24771,24772,24773,25008,25009,25010,25011,25012,25013,25014,25015,25250,25251,25252,25253,25254,25255,25256,25257,25492,25493,25494,25495,25496,25497,25498,25499,0} - ,{24276,23790,23791,23792,23793,23794,23795,23796,23797,24032,24033,24034,24035,24036,24037,24038,24039,24274,24275,24276,24277,24278,24279,24280,24281,24516,24517,24518,24519,24520,24521,24522,24523,0} - ,{25260,24774,24775,24776,24777,24778,24779,24780,24781,25016,25017,25018,25019,25020,25021,25022,25023,25258,25259,25260,25261,25262,25263,25264,25265,25500,25501,25502,25503,25504,25505,25506,25507,0} - ,{24284,23798,23799,23800,23801,23802,23803,23804,23805,24040,24041,24042,24043,24044,24045,24046,24047,24282,24283,24284,24285,24286,24287,24288,24289,24524,24525,24526,24527,24528,24529,24530,24531,0} - ,{23308,22822,22823,22824,22825,22826,22827,22828,22829,23064,23065,23066,23067,23068,23069,23070,23071,23306,23307,23308,23309,23310,23311,23312,23313,23548,23549,23550,23551,23552,23553,23554,23555,0} - ,{24292,23806,23807,23808,23809,23810,23811,23812,23813,24048,24049,24050,24051,24052,24053,24054,24055,24290,24291,24292,24293,24294,24295,24296,24297,24532,24533,24534,24535,24536,24537,24538,24539,0} - ,{23316,22830,22831,22832,22833,22834,22835,22836,22837,23072,23073,23074,23075,23076,23077,23078,23079,23314,23315,23316,23317,23318,23319,23320,23321,23556,23557,23558,23559,23560,23561,23562,23563,0} - ,{23324,22838,22839,22840,22841,22842,22843,22844,22845,23080,23081,23082,23083,23084,23085,23086,23087,23322,23323,23324,23325,23326,23327,23328,23329,23564,23565,23566,23567,23568,23569,23570,23571,0} - ,{22348,21862,21863,21864,21865,21866,21867,21868,21869,22104,22105,22106,22107,22108,22109,22110,22111,22346,22347,22348,22349,22350,22351,22352,22353,22588,22589,22590,22591,22592,22593,22594,22595,0} - ,{23332,22846,22847,22848,22849,22850,22851,22852,22853,23088,23089,23090,23091,23092,23093,23094,23095,23330,23331,23332,23333,23334,23335,23336,23337,23572,23573,23574,23575,23576,23577,23578,23579,0} - ,{22356,21870,21871,21872,21873,21874,21875,21876,21877,22112,22113,22114,22115,22116,22117,22118,22119,22354,22355,22356,22357,22358,22359,22360,22361,22596,22597,22598,22599,22600,22601,22602,22603,0} - ,{22364,21878,21879,21880,21881,21882,21883,21884,21885,22120,22121,22122,22123,22124,22125,22126,22127,22362,22363,22364,22365,22366,22367,22368,22369,22604,22605,22606,22607,22608,22609,22610,22611,0} - ,{21388,20902,20903,20904,20905,20906,20907,20908,20909,21144,21145,21146,21147,21148,21149,21150,21151,21386,21387,21388,21389,21390,21391,21392,21393,21628,21629,21630,21631,21632,21633,21634,21635,0} - ,{21396,20910,20911,20912,20913,20914,20915,20916,20917,21152,21153,21154,21155,21156,21157,21158,21159,21394,21395,21396,21397,21398,21399,21400,21401,21636,21637,21638,21639,21640,21641,21642,21643,0} - ,{20668,20426,20427,20428,20429,20668,20669,20670,20671,0} - ,{20672,20430,20431,20432,20433,20672,20673,20674,20675,0} - ,{20184,19942,19943,19944,19945,20184,20185,20186,20187,0} - ,{20676,20434,20435,20436,20437,20676,20677,20678,20679,0} - ,{20188,19946,19947,19948,19949,20188,20189,20190,20191,0} - ,{20192,19950,19951,19952,19953,20192,20193,20194,20195,0} - ,{19704,19462,19463,19464,19465,19704,19705,19706,19707,0} - ,{20196,19954,19955,19956,19957,20196,20197,20198,20199,0} - ,{19709,19466,19467,19708,19709,19710,19711,19712,19713,0} - ,{19224,18982,18983,19224,19225,19226,19227,19468,19469,0} - ,{19714,19470,19471,19714,19715,19716,19717,19718,19719,0} - ,{24456,24214,24215,24216,24217,24458,24459,24700,24701,0} - ,{27374,27132,27133,27376,27377,27378,27379,27618,27619,0} - ,{23971,23730,23731,23732,23733,23972,23973,23974,23975,0} - ,{24943,24702,24703,24704,24705,24944,24945,24946,24947,0} - ,{26889,26648,26649,26650,26651,26890,26891,26892,26893,0} - ,{23487,23246,23247,23248,23249,23488,23489,23490,23491,0} - ,{28107,27620,27621,27622,27623,27624,27625,27626,27627,27628,27629,27864,27865,27866,27867,27868,27869,27870,27871,28106,28107,28108,28109,28110,28111,28112,28113,28350,28351,28352,28353,28354,28355,0} - ,{25431,25188,25189,25190,25191,25192,25193,25434,25435,0} - ,{27134,26652,26653,26894,26895,27134,27135,27136,27137,0} - ,{24947,24706,24707,24708,24709,24948,24949,24950,24951,0} - ,{26163,25676,25677,25678,25679,25680,25681,25682,25683,25684,25685,25920,25921,25922,25923,25924,25925,25926,25927,26162,26163,26164,26165,26166,26167,26168,26169,26406,26407,26408,26409,26410,26411,0} - ,{24219,23734,23735,23736,23737,23738,23739,23740,23741,23976,23977,23978,23979,23980,23981,23982,23983,24218,24219,24220,24221,24222,24223,24224,24225,24460,24461,24462,24463,24464,24465,24466,24467,0} - ,{27140,26654,26655,26656,26657,26658,26659,26660,26661,26896,26897,26898,26899,26900,26901,26902,26903,27138,27139,27140,27141,27142,27143,27144,27145,27380,27381,27382,27383,27384,27385,27386,27387,0} - ,{23251,22766,22767,22768,22769,22770,22771,22772,22773,23008,23009,23010,23011,23012,23013,23014,23015,23250,23251,23252,23253,23254,23255,23256,23257,23492,23493,23494,23495,23496,23497,23498,23499,0} - ,{25195,24710,24711,24712,24713,24714,24715,24716,24717,24952,24953,24954,24955,24956,24957,24958,24959,25194,25195,25196,25197,25198,25199,25200,25201,25436,25437,25438,25439,25440,25441,25442,25443,0} - ,{26172,25686,25687,25688,25689,25690,25691,25692,25693,25928,25929,25930,25931,25932,25933,25934,25935,26170,26171,26172,26173,26174,26175,26176,26177,26412,26413,26414,26415,26416,26417,26418,26419,0} - ,{24227,23742,23743,23744,23745,23746,23747,23748,23749,23984,23985,23986,23987,23988,23989,23990,23991,24226,24227,24228,24229,24230,24231,24232,24233,24468,24469,24470,24471,24472,24473,24474,24475,0} - ,{27148,26662,26663,26664,26665,26666,26667,26668,26669,26904,26905,26906,26907,26908,26909,26910,26911,27146,27147,27148,27149,27150,27151,27152,27153,27388,27389,27390,27391,27392,27393,27394,27395,0} - ,{25204,24718,24719,24720,24721,24722,24723,24724,24725,24960,24961,24962,24963,24964,24965,24966,24967,25202,25203,25204,25205,25206,25207,25208,25209,25444,25445,25446,25447,25448,25449,25450,25451,0} - ,{23259,22774,22775,22776,22777,22778,22779,22780,22781,23016,23017,23018,23019,23020,23021,23022,23023,23258,23259,23260,23261,23262,23263,23264,23265,23500,23501,23502,23503,23504,23505,23506,23507,0} - ,{26180,25694,25695,25696,25697,25698,25699,25700,25701,25936,25937,25938,25939,25940,25941,25942,25943,26178,26179,26180,26181,26182,26183,26184,26185,26420,26421,26422,26423,26424,26425,26426,26427,0} - ,{22291,21806,21807,21808,21809,21810,21811,21812,21813,22048,22049,22050,22051,22052,22053,22054,22055,22290,22291,22292,22293,22294,22295,22296,22297,22532,22533,22534,22535,22536,22537,22538,22539,0} - ,{24236,23750,23751,23752,23753,23754,23755,23756,23757,23992,23993,23994,23995,23996,23997,23998,23999,24234,24235,24236,24237,24238,24239,24240,24241,24476,24477,24478,24479,24480,24481,24482,24483,0} - ,{25212,24726,24727,24728,24729,24730,24731,24732,24733,24968,24969,24970,24971,24972,24973,24974,24975,25210,25211,25212,25213,25214,25215,25216,25217,25452,25453,25454,25455,25456,25457,25458,25459,0} - ,{23268,22782,22783,22784,22785,22786,22787,22788,22789,23024,23025,23026,23027,23028,23029,23030,23031,23266,23267,23268,23269,23270,23271,23272,23273,23508,23509,23510,23511,23512,23513,23514,23515,0} - ,{26188,25702,25703,25704,25705,25706,25707,25708,25709,25944,25945,25946,25947,25948,25949,25950,25951,26186,26187,26188,26189,26190,26191,26192,26193,26428,26429,26430,26431,26432,26433,26434,26435,0} - ,{22300,21814,21815,21816,21817,21818,21819,21820,21821,22056,22057,22058,22059,22060,22061,22062,22063,22298,22299,22300,22301,22302,22303,22304,22305,22540,22541,22542,22543,22544,22545,22546,22547,0} - ,{24244,23758,23759,23760,23761,23762,23763,23764,23765,24000,24001,24002,24003,24004,24005,24006,24007,24242,24243,24244,24245,24246,24247,24248,24249,24484,24485,24486,24487,24488,24489,24490,24491,0} - ,{25220,24734,24735,24736,24737,24738,24739,24740,24741,24976,24977,24978,24979,24980,24981,24982,24983,25218,25219,25220,25221,25222,25223,25224,25225,25460,25461,25462,25463,25464,25465,25466,25467,0} - ,{23276,22790,22791,22792,22793,22794,22795,22796,22797,23032,23033,23034,23035,23036,23037,23038,23039,23274,23275,23276,23277,23278,23279,23280,23281,23516,23517,23518,23519,23520,23521,23522,23523,0} - ,{24252,23766,23767,23768,23769,23770,23771,23772,23773,24008,24009,24010,24011,24012,24013,24014,24015,24250,24251,24252,24253,24254,24255,24256,24257,24492,24493,24494,24495,24496,24497,24498,24499,0} - ,{22308,21822,21823,21824,21825,21826,21827,21828,21829,22064,22065,22066,22067,22068,22069,22070,22071,22306,22307,22308,22309,22310,22311,22312,22313,22548,22549,22550,22551,22552,22553,22554,22555,0} - ,{25228,24742,24743,24744,24745,24746,24747,24748,24749,24984,24985,24986,24987,24988,24989,24990,24991,25226,25227,25228,25229,25230,25231,25232,25233,25468,25469,25470,25471,25472,25473,25474,25475,0} - ,{21340,20854,20855,20856,20857,20858,20859,20860,20861,21096,21097,21098,21099,21100,21101,21102,21103,21338,21339,21340,21341,21342,21343,21344,21345,21580,21581,21582,21583,21584,21585,21586,21587,0} - ,{23284,22798,22799,22800,22801,22802,22803,22804,22805,23040,23041,23042,23043,23044,23045,23046,23047,23282,23283,23284,23285,23286,23287,23288,23289,23524,23525,23526,23527,23528,23529,23530,23531,0} - ,{24260,23774,23775,23776,23777,23778,23779,23780,23781,24016,24017,24018,24019,24020,24021,24022,24023,24258,24259,24260,24261,24262,24263,24264,24265,24500,24501,24502,24503,24504,24505,24506,24507,0} - ,{22316,21830,21831,21832,21833,21834,21835,21836,21837,22072,22073,22074,22075,22076,22077,22078,22079,22314,22315,22316,22317,22318,22319,22320,22321,22556,22557,22558,22559,22560,22561,22562,22563,0} - ,{23292,22806,22807,22808,22809,22810,22811,22812,22813,23048,23049,23050,23051,23052,23053,23054,23055,23290,23291,23292,23293,23294,23295,23296,23297,23532,23533,23534,23535,23536,23537,23538,23539,0} - ,{21348,20862,20863,20864,20865,20866,20867,20868,20869,21104,21105,21106,21107,21108,21109,21110,21111,21346,21347,21348,21349,21350,21351,21352,21353,21588,21589,21590,21591,21592,21593,21594,21595,0} - ,{22324,21838,21839,21840,21841,21842,21843,21844,21845,22080,22081,22082,22083,22084,22085,22086,22087,22322,22323,22324,22325,22326,22327,22328,22329,22564,22565,22566,22567,22568,22569,22570,22571,0} - ,{23300,22814,22815,22816,22817,22818,22819,22820,22821,23056,23057,23058,23059,23060,23061,23062,23063,23298,23299,23300,23301,23302,23303,23304,23305,23540,23541,23542,23543,23544,23545,23546,23547,0} - ,{21356,20870,20871,20872,20873,20874,20875,20876,20877,21112,21113,21114,21115,21116,21117,21118,21119,21354,21355,21356,21357,21358,21359,21360,21361,21596,21597,21598,21599,21600,21601,21602,21603,0} - ,{22332,21846,21847,21848,21849,21850,21851,21852,21853,22088,22089,22090,22091,22092,22093,22094,22095,22330,22331,22332,22333,22334,22335,22336,22337,22572,22573,22574,22575,22576,22577,22578,22579,0} - ,{21364,20878,20879,20880,20881,20882,20883,20884,20885,21120,21121,21122,21123,21124,21125,21126,21127,21362,21363,21364,21365,21366,21367,21368,21369,21604,21605,21606,21607,21608,21609,21610,21611,0} - ,{22340,21854,21855,21856,21857,21858,21859,21860,21861,22096,22097,22098,22099,22100,22101,22102,22103,22338,22339,22340,22341,22342,22343,22344,22345,22580,22581,22582,22583,22584,22585,22586,22587,0} - ,{20396,19910,19911,19912,19913,19914,19915,19916,19917,20152,20153,20154,20155,20156,20157,20158,20159,20394,20395,20396,20397,20398,20399,20400,20401,20636,20637,20638,20639,20640,20641,20642,20643,0} - ,{21372,20886,20887,20888,20889,20890,20891,20892,20893,21128,21129,21130,21131,21132,21133,21134,21135,21370,21371,21372,21373,21374,21375,21376,21377,21612,21613,21614,21615,21616,21617,21618,21619,0} - ,{20404,19918,19919,19920,19921,19922,19923,19924,19925,20160,20161,20162,20163,20164,20165,20166,20167,20402,20403,20404,20405,20406,20407,20408,20409,20644,20645,20646,20647,20648,20649,20650,20651,0} - ,{21380,20894,20895,20896,20897,20898,20899,20900,20901,21136,21137,21138,21139,21140,21141,21142,21143,21378,21379,21380,21381,21382,21383,21384,21385,21620,21621,21622,21623,21624,21625,21626,21627,0} - ,{20412,19926,19927,19928,19929,19930,19931,19932,19933,20168,20169,20170,20171,20172,20173,20174,20175,20410,20411,20412,20413,20414,20415,20416,20417,20652,20653,20654,20655,20656,20657,20658,20659,0} - ,{19444,18958,18959,18960,18961,18962,18963,18964,18965,19200,19201,19202,19203,19204,19205,19206,19207,19442,19443,19444,19445,19446,19447,19448,19449,19684,19685,19686,19687,19688,19689,19690,19691,0} - ,{20420,19934,19935,19936,19937,19938,19939,19940,19941,20176,20177,20178,20179,20180,20181,20182,20183,20418,20419,20420,20421,20422,20423,20424,20425,20660,20661,20662,20663,20664,20665,20666,20667,0} - ,{19692,19450,19451,19452,19453,19692,19693,19694,19695,0} - ,{19208,18966,18967,18968,18969,19208,19209,19210,19211,0} - ,{18724,18482,18483,18484,18485,18724,18725,18726,18727,0} - ,{19696,19454,19455,19456,19457,19696,19697,19698,19699,0} - ,{19212,18970,18971,18972,18973,19212,19213,19214,19215,0} - ,{19700,19458,19459,19460,19461,19700,19701,19702,19703,0} - ,{18728,18486,18487,18488,18489,18728,18729,18730,18731,0} - ,{19216,18974,18975,18976,18977,19216,19217,19218,19219,0} - ,{18732,18490,18491,18492,18493,18732,18733,18734,18735,0} - ,{19220,18978,18979,18980,18981,19220,19221,19222,19223,0} - ,{18494,18252,18253,18494,18495,18736,18737,18738,18739,0} - ,{23000,22758,22759,22760,22761,23002,23003,23244,23245,0} - ,{18152,17670,17671,17912,17913,18154,18155,18396,18397,0} - ,{17184,16944,16945,17186,17187,17426,17427,17428,17429,0} - ,{21302,20820,20821,21062,21063,21304,21305,21546,21547,0} - ,{19121,18638,18639,18880,18881,19124,19125,19366,19367,0} - ,{20092,19610,19611,19852,19853,20094,20095,20336,20337,0} - ,{18639,18398,18399,18400,18401,18640,18641,18642,18643,0} - ,{22275,21790,21791,21792,21793,21794,21795,21796,21797,22032,22033,22034,22035,22036,22037,22038,22039,22274,22275,22276,22277,22278,22279,22280,22281,22516,22517,22518,22519,22520,22521,22522,22523,0} - ,{23003,22762,22763,22764,22765,23004,23005,23006,23007,0} - ,{19124,18882,18883,18884,18885,19126,19127,19368,19369,0} - ,{18155,17914,17915,17916,17917,18156,18157,18158,18159,0} - ,{17671,17430,17431,17432,17433,17672,17673,17674,17675,0} - ,{17187,16946,16947,16948,16949,17188,17189,17190,17191,0} - ,{21307,20822,20823,20824,20825,20826,20827,20828,20829,21064,21065,21066,21067,21068,21069,21070,21071,21306,21307,21308,21309,21310,21311,21312,21313,21548,21549,21550,21551,21552,21553,21554,21555,0} - ,{20339,19854,19855,19856,19857,19858,19859,19860,19861,20096,20097,20098,20099,20100,20101,20102,20103,20338,20339,20340,20341,20342,20343,20344,20345,20580,20581,20582,20583,20584,20585,20586,20587,0} - ,{19371,18886,18887,18888,18889,18890,18891,18892,18893,19128,19129,19130,19131,19132,19133,19134,19135,19370,19371,19372,19373,19374,19375,19376,19377,19612,19613,19614,19615,19616,19617,19618,19619,0} - ,{18403,17918,17919,17920,17921,17922,17923,17924,17925,18160,18161,18162,18163,18164,18165,18166,18167,18402,18403,18404,18405,18406,18407,18408,18409,18644,18645,18646,18647,18648,18649,18650,18651,0} - ,{17435,16950,16951,16952,16953,16954,16955,16956,16957,17192,17193,17194,17195,17196,17197,17198,17199,17434,17435,17436,17437,17438,17439,17440,17441,17676,17677,17678,17679,17680,17681,17682,17683,0} - ,{22283,21798,21799,21800,21801,21802,21803,21804,21805,22040,22041,22042,22043,22044,22045,22046,22047,22282,22283,22284,22285,22286,22287,22288,22289,22524,22525,22526,22527,22528,22529,22530,22531,0} - ,{21315,20830,20831,20832,20833,20834,20835,20836,20837,21072,21073,21074,21075,21076,21077,21078,21079,21314,21315,21316,21317,21318,21319,21320,21321,21556,21557,21558,21559,21560,21561,21562,21563,0} - ,{20347,19862,19863,19864,19865,19866,19867,19868,19869,20104,20105,20106,20107,20108,20109,20110,20111,20346,20347,20348,20349,20350,20351,20352,20353,20588,20589,20590,20591,20592,20593,20594,20595,0} - ,{19379,18894,18895,18896,18897,18898,18899,18900,18901,19136,19137,19138,19139,19140,19141,19142,19143,19378,19379,19380,19381,19382,19383,19384,19385,19620,19621,19622,19623,19624,19625,19626,19627,0} - ,{18411,17926,17927,17928,17929,17930,17931,17932,17933,18168,18169,18170,18171,18172,18173,18174,18175,18410,18411,18412,18413,18414,18415,18416,18417,18652,18653,18654,18655,18656,18657,18658,18659,0} - ,{17443,16958,16959,16960,16961,16962,16963,16964,16965,17200,17201,17202,17203,17204,17205,17206,17207,17442,17443,17444,17445,17446,17447,17448,17449,17684,17685,17686,17687,17688,17689,17690,17691,0} - ,{21323,20838,20839,20840,20841,20842,20843,20844,20845,21080,21081,21082,21083,21084,21085,21086,21087,21322,21323,21324,21325,21326,21327,21328,21329,21564,21565,21566,21567,21568,21569,21570,21571,0} - ,{20355,19870,19871,19872,19873,19874,19875,19876,19877,20112,20113,20114,20115,20116,20117,20118,20119,20354,20355,20356,20357,20358,20359,20360,20361,20596,20597,20598,20599,20600,20601,20602,20603,0} - ,{19387,18902,18903,18904,18905,18906,18907,18908,18909,19144,19145,19146,19147,19148,19149,19150,19151,19386,19387,19388,19389,19390,19391,19392,19393,19628,19629,19630,19631,19632,19633,19634,19635,0} - ,{18419,17934,17935,17936,17937,17938,17939,17940,17941,18176,18177,18178,18179,18180,18181,18182,18183,18418,18419,18420,18421,18422,18423,18424,18425,18660,18661,18662,18663,18664,18665,18666,18667,0} - ,{17451,16966,16967,16968,16969,16970,16971,16972,16973,17208,17209,17210,17211,17212,17213,17214,17215,17450,17451,17452,17453,17454,17455,17456,17457,17692,17693,17694,17695,17696,17697,17698,17699,0} - ,{21332,20846,20847,20848,20849,20850,20851,20852,20853,21088,21089,21090,21091,21092,21093,21094,21095,21330,21331,21332,21333,21334,21335,21336,21337,21572,21573,21574,21575,21576,21577,21578,21579,0} - ,{20364,19878,19879,19880,19881,19882,19883,19884,19885,20120,20121,20122,20123,20124,20125,20126,20127,20362,20363,20364,20365,20366,20367,20368,20369,20604,20605,20606,20607,20608,20609,20610,20611,0} - ,{19396,18910,18911,18912,18913,18914,18915,18916,18917,19152,19153,19154,19155,19156,19157,19158,19159,19394,19395,19396,19397,19398,19399,19400,19401,19636,19637,19638,19639,19640,19641,19642,19643,0} - ,{18428,17942,17943,17944,17945,17946,17947,17948,17949,18184,18185,18186,18187,18188,18189,18190,18191,18426,18427,18428,18429,18430,18431,18432,18433,18668,18669,18670,18671,18672,18673,18674,18675,0} - ,{17460,16974,16975,16976,16977,16978,16979,16980,16981,17216,17217,17218,17219,17220,17221,17222,17223,17458,17459,17460,17461,17462,17463,17464,17465,17700,17701,17702,17703,17704,17705,17706,17707,0} - ,{20372,19886,19887,19888,19889,19890,19891,19892,19893,20128,20129,20130,20131,20132,20133,20134,20135,20370,20371,20372,20373,20374,20375,20376,20377,20612,20613,20614,20615,20616,20617,20618,20619,0} - ,{19404,18918,18919,18920,18921,18922,18923,18924,18925,19160,19161,19162,19163,19164,19165,19166,19167,19402,19403,19404,19405,19406,19407,19408,19409,19644,19645,19646,19647,19648,19649,19650,19651,0} - ,{18436,17950,17951,17952,17953,17954,17955,17956,17957,18192,18193,18194,18195,18196,18197,18198,18199,18434,18435,18436,18437,18438,18439,18440,18441,18676,18677,18678,18679,18680,18681,18682,18683,0} - ,{17468,16982,16983,16984,16985,16986,16987,16988,16989,17224,17225,17226,17227,17228,17229,17230,17231,17466,17467,17468,17469,17470,17471,17472,17473,17708,17709,17710,17711,17712,17713,17714,17715,0} - ,{20380,19894,19895,19896,19897,19898,19899,19900,19901,20136,20137,20138,20139,20140,20141,20142,20143,20378,20379,20380,20381,20382,20383,20384,20385,20620,20621,20622,20623,20624,20625,20626,20627,0} - ,{19412,18926,18927,18928,18929,18930,18931,18932,18933,19168,19169,19170,19171,19172,19173,19174,19175,19410,19411,19412,19413,19414,19415,19416,19417,19652,19653,19654,19655,19656,19657,19658,19659,0} - ,{18444,17958,17959,17960,17961,17962,17963,17964,17965,18200,18201,18202,18203,18204,18205,18206,18207,18442,18443,18444,18445,18446,18447,18448,18449,18684,18685,18686,18687,18688,18689,18690,18691,0} - ,{17476,16990,16991,16992,16993,16994,16995,16996,16997,17232,17233,17234,17235,17236,17237,17238,17239,17474,17475,17476,17477,17478,17479,17480,17481,17716,17717,17718,17719,17720,17721,17722,17723,0} - ,{20388,19902,19903,19904,19905,19906,19907,19908,19909,20144,20145,20146,20147,20148,20149,20150,20151,20386,20387,20388,20389,20390,20391,20392,20393,20628,20629,20630,20631,20632,20633,20634,20635,0} - ,{19420,18934,18935,18936,18937,18938,18939,18940,18941,19176,19177,19178,19179,19180,19181,19182,19183,19418,19419,19420,19421,19422,19423,19424,19425,19660,19661,19662,19663,19664,19665,19666,19667,0} - ,{18452,17966,17967,17968,17969,17970,17971,17972,17973,18208,18209,18210,18211,18212,18213,18214,18215,18450,18451,18452,18453,18454,18455,18456,18457,18692,18693,18694,18695,18696,18697,18698,18699,0} - ,{17484,16998,16999,17000,17001,17002,17003,17004,17005,17240,17241,17242,17243,17244,17245,17246,17247,17482,17483,17484,17485,17486,17487,17488,17489,17724,17725,17726,17727,17728,17729,17730,17731,0} - ,{19428,18942,18943,18944,18945,18946,18947,18948,18949,19184,19185,19186,19187,19188,19189,19190,19191,19426,19427,19428,19429,19430,19431,19432,19433,19668,19669,19670,19671,19672,19673,19674,19675,0} - ,{18460,17974,17975,17976,17977,17978,17979,17980,17981,18216,18217,18218,18219,18220,18221,18222,18223,18458,18459,18460,18461,18462,18463,18464,18465,18700,18701,18702,18703,18704,18705,18706,18707,0} - ,{17492,17006,17007,17008,17009,17010,17011,17012,17013,17248,17249,17250,17251,17252,17253,17254,17255,17490,17491,17492,17493,17494,17495,17496,17497,17732,17733,17734,17735,17736,17737,17738,17739,0} - ,{19436,18950,18951,18952,18953,18954,18955,18956,18957,19192,19193,19194,19195,19196,19197,19198,19199,19434,19435,19436,19437,19438,19439,19440,19441,19676,19677,19678,19679,19680,19681,19682,19683,0} - ,{18468,17982,17983,17984,17985,17986,17987,17988,17989,18224,18225,18226,18227,18228,18229,18230,18231,18466,18467,18468,18469,18470,18471,18472,18473,18708,18709,18710,18711,18712,18713,18714,18715,0} - ,{17500,17014,17015,17016,17017,17018,17019,17020,17021,17256,17257,17258,17259,17260,17261,17262,17263,17498,17499,17500,17501,17502,17503,17504,17505,17740,17741,17742,17743,17744,17745,17746,17747,0} - ,{18476,17990,17991,17992,17993,17994,17995,17996,17997,18232,18233,18234,18235,18236,18237,18238,18239,18474,18475,18476,18477,18478,18479,18480,18481,18716,18717,18718,18719,18720,18721,18722,18723,0} - ,{17508,17022,17023,17024,17025,17026,17027,17028,17029,17264,17265,17266,17267,17268,17269,17270,17271,17506,17507,17508,17509,17510,17511,17512,17513,17748,17749,17750,17751,17752,17753,17754,17755,0} - ,{18240,17998,17999,18000,18001,18240,18241,18242,18243,0} - ,{17756,17514,17515,17516,17517,17756,17757,17758,17759,0} - ,{17272,17030,17031,17032,17033,17272,17273,17274,17275,0} - ,{18244,18002,18003,18004,18005,18244,18245,18246,18247,0} - ,{17760,17518,17519,17520,17521,17760,17761,17762,17763,0} - ,{17276,17034,17035,17036,17037,17276,17277,17278,17279,0} - ,{18248,18006,18007,18008,18009,18248,18249,18250,18251,0} - ,{17764,17522,17523,17524,17525,17764,17765,17766,17767,0} - ,{17280,17038,17039,17040,17041,17280,17281,17282,17283,0} - ,{12106,11866,11867,12108,12109,12350,12351,12592,12593,0} - ,{16458,16218,16219,16458,16459,16460,16461,16702,16703,0} - ,{15490,15250,15251,15492,15493,15734,15735,15976,15977,0} - ,{14766,14526,14527,14768,14769,14770,14771,15008,15009,0} - ,{13316,13076,13077,13318,13319,13560,13561,13802,13803,0} - ,{14284,14042,14043,14044,14045,14286,14287,14528,14529,0} - ,{15009,15010,15011,15012,15013,15252,15253,15254,15255,0} - ,{11385,11142,11143,11144,11145,11146,11147,11148,11149,11384,11385,11386,11387,11388,11389,11390,11391,11626,11627,11628,11629,11630,11631,11632,11633,11868,11869,11870,11871,11872,11873,11874,11875,0} - ,{10661,10662,10663,10664,10665,10904,10905,10906,10907,0} - ,{15493,15494,15495,15496,15497,15736,15737,15738,15739,0} - ,{15977,15978,15979,15980,15981,16220,16221,16222,16223,0} - ,{16461,16462,16463,16464,16465,16704,16705,16706,16707,0} - ,{12353,12110,12111,12112,12113,12114,12115,12116,12117,12352,12353,12354,12355,12356,12357,12358,12359,12594,12595,12596,12597,12598,12599,12600,12601,12836,12837,12838,12839,12840,12841,12842,12843,0} - ,{13321,13078,13079,13080,13081,13082,13083,13084,13085,13320,13321,13322,13323,13324,13325,13326,13327,13562,13563,13564,13565,13566,13567,13568,13569,13804,13805,13806,13807,13808,13809,13810,13811,0} - ,{14289,14046,14047,14048,14049,14050,14051,14052,14053,14288,14289,14290,14291,14292,14293,14294,14295,14530,14531,14532,14533,14534,14535,14536,14537,14772,14773,14774,14775,14776,14777,14778,14779,0} - ,{15257,15014,15015,15016,15017,15018,15019,15020,15021,15256,15257,15258,15259,15260,15261,15262,15263,15498,15499,15500,15501,15502,15503,15504,15505,15740,15741,15742,15743,15744,15745,15746,15747,0} - ,{16225,15982,15983,15984,15985,15986,15987,15988,15989,16224,16225,16226,16227,16228,16229,16230,16231,16466,16467,16468,16469,16470,16471,16472,16473,16708,16709,16710,16711,16712,16713,16714,16715,0} - ,{11393,11150,11151,11152,11153,11154,11155,11156,11157,11392,11393,11394,11395,11396,11397,11398,11399,11634,11635,11636,11637,11638,11639,11640,11641,11876,11877,11878,11879,11880,11881,11882,11883,0} - ,{12361,12118,12119,12120,12121,12122,12123,12124,12125,12360,12361,12362,12363,12364,12365,12366,12367,12602,12603,12604,12605,12606,12607,12608,12609,12844,12845,12846,12847,12848,12849,12850,12851,0} - ,{13329,13086,13087,13088,13089,13090,13091,13092,13093,13328,13329,13330,13331,13332,13333,13334,13335,13570,13571,13572,13573,13574,13575,13576,13577,13812,13813,13814,13815,13816,13817,13818,13819,0} - ,{14297,14054,14055,14056,14057,14058,14059,14060,14061,14296,14297,14298,14299,14300,14301,14302,14303,14538,14539,14540,14541,14542,14543,14544,14545,14780,14781,14782,14783,14784,14785,14786,14787,0} - ,{15265,15022,15023,15024,15025,15026,15027,15028,15029,15264,15265,15266,15267,15268,15269,15270,15271,15506,15507,15508,15509,15510,15511,15512,15513,15748,15749,15750,15751,15752,15753,15754,15755,0} - ,{16233,15990,15991,15992,15993,15994,15995,15996,15997,16232,16233,16234,16235,16236,16237,16238,16239,16474,16475,16476,16477,16478,16479,16480,16481,16716,16717,16718,16719,16720,16721,16722,16723,0} - ,{12369,12126,12127,12128,12129,12130,12131,12132,12133,12368,12369,12370,12371,12372,12373,12374,12375,12610,12611,12612,12613,12614,12615,12616,12617,12852,12853,12854,12855,12856,12857,12858,12859,0} - ,{13337,13094,13095,13096,13097,13098,13099,13100,13101,13336,13337,13338,13339,13340,13341,13342,13343,13578,13579,13580,13581,13582,13583,13584,13585,13820,13821,13822,13823,13824,13825,13826,13827,0} - ,{14305,14062,14063,14064,14065,14066,14067,14068,14069,14304,14305,14306,14307,14308,14309,14310,14311,14546,14547,14548,14549,14550,14551,14552,14553,14788,14789,14790,14791,14792,14793,14794,14795,0} - ,{15273,15030,15031,15032,15033,15034,15035,15036,15037,15272,15273,15274,15275,15276,15277,15278,15279,15514,15515,15516,15517,15518,15519,15520,15521,15756,15757,15758,15759,15760,15761,15762,15763,0} - ,{16241,15998,15999,16000,16001,16002,16003,16004,16005,16240,16241,16242,16243,16244,16245,16246,16247,16482,16483,16484,16485,16486,16487,16488,16489,16724,16725,16726,16727,16728,16729,16730,16731,0} - ,{12378,12134,12135,12136,12137,12138,12139,12140,12141,12376,12377,12378,12379,12380,12381,12382,12383,12618,12619,12620,12621,12622,12623,12624,12625,12860,12861,12862,12863,12864,12865,12866,12867,0} - ,{13346,13102,13103,13104,13105,13106,13107,13108,13109,13344,13345,13346,13347,13348,13349,13350,13351,13586,13587,13588,13589,13590,13591,13592,13593,13828,13829,13830,13831,13832,13833,13834,13835,0} - ,{14314,14070,14071,14072,14073,14074,14075,14076,14077,14312,14313,14314,14315,14316,14317,14318,14319,14554,14555,14556,14557,14558,14559,14560,14561,14796,14797,14798,14799,14800,14801,14802,14803,0} - ,{15282,15038,15039,15040,15041,15042,15043,15044,15045,15280,15281,15282,15283,15284,15285,15286,15287,15522,15523,15524,15525,15526,15527,15528,15529,15764,15765,15766,15767,15768,15769,15770,15771,0} - ,{16250,16006,16007,16008,16009,16010,16011,16012,16013,16248,16249,16250,16251,16252,16253,16254,16255,16490,16491,16492,16493,16494,16495,16496,16497,16732,16733,16734,16735,16736,16737,16738,16739,0} - ,{13354,13110,13111,13112,13113,13114,13115,13116,13117,13352,13353,13354,13355,13356,13357,13358,13359,13594,13595,13596,13597,13598,13599,13600,13601,13836,13837,13838,13839,13840,13841,13842,13843,0} - ,{14322,14078,14079,14080,14081,14082,14083,14084,14085,14320,14321,14322,14323,14324,14325,14326,14327,14562,14563,14564,14565,14566,14567,14568,14569,14804,14805,14806,14807,14808,14809,14810,14811,0} - ,{15290,15046,15047,15048,15049,15050,15051,15052,15053,15288,15289,15290,15291,15292,15293,15294,15295,15530,15531,15532,15533,15534,15535,15536,15537,15772,15773,15774,15775,15776,15777,15778,15779,0} - ,{16258,16014,16015,16016,16017,16018,16019,16020,16021,16256,16257,16258,16259,16260,16261,16262,16263,16498,16499,16500,16501,16502,16503,16504,16505,16740,16741,16742,16743,16744,16745,16746,16747,0} - ,{13362,13118,13119,13120,13121,13122,13123,13124,13125,13360,13361,13362,13363,13364,13365,13366,13367,13602,13603,13604,13605,13606,13607,13608,13609,13844,13845,13846,13847,13848,13849,13850,13851,0} - ,{14330,14086,14087,14088,14089,14090,14091,14092,14093,14328,14329,14330,14331,14332,14333,14334,14335,14570,14571,14572,14573,14574,14575,14576,14577,14812,14813,14814,14815,14816,14817,14818,14819,0} - ,{15298,15054,15055,15056,15057,15058,15059,15060,15061,15296,15297,15298,15299,15300,15301,15302,15303,15538,15539,15540,15541,15542,15543,15544,15545,15780,15781,15782,15783,15784,15785,15786,15787,0} - ,{16266,16022,16023,16024,16025,16026,16027,16028,16029,16264,16265,16266,16267,16268,16269,16270,16271,16506,16507,16508,16509,16510,16511,16512,16513,16748,16749,16750,16751,16752,16753,16754,16755,0} - ,{13370,13126,13127,13128,13129,13130,13131,13132,13133,13368,13369,13370,13371,13372,13373,13374,13375,13610,13611,13612,13613,13614,13615,13616,13617,13852,13853,13854,13855,13856,13857,13858,13859,0} - ,{14338,14094,14095,14096,14097,14098,14099,14100,14101,14336,14337,14338,14339,14340,14341,14342,14343,14578,14579,14580,14581,14582,14583,14584,14585,14820,14821,14822,14823,14824,14825,14826,14827,0} - ,{15306,15062,15063,15064,15065,15066,15067,15068,15069,15304,15305,15306,15307,15308,15309,15310,15311,15546,15547,15548,15549,15550,15551,15552,15553,15788,15789,15790,15791,15792,15793,15794,15795,0} - ,{16274,16030,16031,16032,16033,16034,16035,16036,16037,16272,16273,16274,16275,16276,16277,16278,16279,16514,16515,16516,16517,16518,16519,16520,16521,16756,16757,16758,16759,16760,16761,16762,16763,0} - ,{14346,14102,14103,14104,14105,14106,14107,14108,14109,14344,14345,14346,14347,14348,14349,14350,14351,14586,14587,14588,14589,14590,14591,14592,14593,14828,14829,14830,14831,14832,14833,14834,14835,0} - ,{15314,15070,15071,15072,15073,15074,15075,15076,15077,15312,15313,15314,15315,15316,15317,15318,15319,15554,15555,15556,15557,15558,15559,15560,15561,15796,15797,15798,15799,15800,15801,15802,15803,0} - ,{16282,16038,16039,16040,16041,16042,16043,16044,16045,16280,16281,16282,16283,16284,16285,16286,16287,16522,16523,16524,16525,16526,16527,16528,16529,16764,16765,16766,16767,16768,16769,16770,16771,0} - ,{14354,14110,14111,14112,14113,14114,14115,14116,14117,14352,14353,14354,14355,14356,14357,14358,14359,14594,14595,14596,14597,14598,14599,14600,14601,14836,14837,14838,14839,14840,14841,14842,14843,0} - ,{15322,15078,15079,15080,15081,15082,15083,15084,15085,15320,15321,15322,15323,15324,15325,15326,15327,15562,15563,15564,15565,15566,15567,15568,15569,15804,15805,15806,15807,15808,15809,15810,15811,0} - ,{16290,16046,16047,16048,16049,16050,16051,16052,16053,16288,16289,16290,16291,16292,16293,16294,16295,16530,16531,16532,16533,16534,16535,16536,16537,16772,16773,16774,16775,16776,16777,16778,16779,0} - ,{15330,15086,15087,15088,15089,15090,15091,15092,15093,15328,15329,15330,15331,15332,15333,15334,15335,15570,15571,15572,15573,15574,15575,15576,15577,15812,15813,15814,15815,15816,15817,15818,15819,0} - ,{16298,16054,16055,16056,16057,16058,16059,16060,16061,16296,16297,16298,16299,16300,16301,16302,16303,16538,16539,16540,16541,16542,16543,16544,16545,16780,16781,16782,16783,16784,16785,16786,16787,0} - ,{15094,15094,15095,15096,15097,15336,15337,15338,15339,0} - ,{15578,15578,15579,15580,15581,15820,15821,15822,15823,0} - ,{16062,16062,16063,16064,16065,16304,16305,16306,16307,0} - ,{16546,16546,16547,16548,16549,16788,16789,16790,16791,0} - ,{15582,15582,15583,15584,15585,15824,15825,15826,15827,0} - ,{16066,16066,16067,16068,16069,16308,16309,16310,16311,0} - ,{16550,16550,16551,16552,16553,16792,16793,16794,16795,0} - ,{15586,15586,15587,15588,15589,15828,15829,15830,15831,0} - ,{16070,16070,16071,16072,16073,16312,16313,16314,16315,0} - ,{16554,16554,16555,16556,16557,16796,16797,16798,16799,0} - ,{6080,5840,5841,6082,6083,6322,6323,6324,6325,0} - ,{9452,9212,9213,9454,9455,9694,9695,9696,9697,0} - ,{10418,10176,10177,10418,10419,10420,10421,10422,10423,0} - ,{8729,8730,8731,8732,8733,8972,8973,8974,8975,0} - ,{6803,6564,6565,6804,6805,7046,7047,7048,7049,0} - ,{9935,9936,9937,9938,9939,10178,10179,10180,10181,0} - ,{5602,5120,5121,5360,5361,5362,5363,5364,5365,5600,5601,5602,5603,5604,5605,5606,5607,5842,5843,5844,5845,5846,5847,5848,5849,6084,6085,6086,6087,6088,6089,6090,6091,0} - ,{8249,8250,8251,8252,8253,8492,8493,8494,8495,0} - ,{6806,6566,6567,6806,6807,6808,6809,7050,7051,0} - ,{8733,8734,8735,8736,8737,8976,8977,8978,8979,0} - ,{7529,7288,7289,7290,7291,7292,7293,7530,7531,7532,7533,7534,7535,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,0} - ,{9457,9214,9215,9216,9217,9218,9219,9220,9221,9456,9457,9458,9459,9460,9461,9462,9463,9698,9699,9700,9701,9702,9703,9704,9705,9940,9941,9942,9943,9944,9945,9946,9947,0} - ,{6570,6326,6327,6328,6329,6330,6331,6332,6333,6568,6569,6570,6571,6572,6573,6574,6575,6810,6811,6812,6813,6814,6815,6816,6817,7052,7053,7054,7055,7056,7057,7058,7059,0} - ,{10425,10182,10183,10184,10185,10186,10187,10188,10189,10424,10425,10426,10427,10428,10429,10430,10431,10666,10667,10668,10669,10670,10671,10672,10673,10908,10909,10910,10911,10912,10913,10914,10915,0} - ,{8497,8254,8255,8256,8257,8258,8259,8260,8261,8496,8497,8498,8499,8500,8501,8502,8503,8738,8739,8740,8741,8742,8743,8744,8745,8980,8981,8982,8983,8984,8985,8986,8987,0} - ,{7538,7294,7295,7296,7297,7298,7299,7300,7301,7536,7537,7538,7539,7540,7541,7542,7543,7778,7779,7780,7781,7782,7783,7784,7785,8020,8021,8022,8023,8024,8025,8026,8027,0} - ,{9465,9222,9223,9224,9225,9226,9227,9228,9229,9464,9465,9466,9467,9468,9469,9470,9471,9706,9707,9708,9709,9710,9711,9712,9713,9948,9949,9950,9951,9952,9953,9954,9955,0} - ,{6578,6334,6335,6336,6337,6338,6339,6340,6341,6576,6577,6578,6579,6580,6581,6582,6583,6818,6819,6820,6821,6822,6823,6824,6825,7060,7061,7062,7063,7064,7065,7066,7067,0} - ,{8506,8262,8263,8264,8265,8266,8267,8268,8269,8504,8505,8506,8507,8508,8509,8510,8511,8746,8747,8748,8749,8750,8751,8752,8753,8988,8989,8990,8991,8992,8993,8994,8995,0} - ,{10433,10190,10191,10192,10193,10194,10195,10196,10197,10432,10433,10434,10435,10436,10437,10438,10439,10674,10675,10676,10677,10678,10679,10680,10681,10916,10917,10918,10919,10920,10921,10922,10923,0} - ,{7546,7302,7303,7304,7305,7306,7307,7308,7309,7544,7545,7546,7547,7548,7549,7550,7551,7786,7787,7788,7789,7790,7791,7792,7793,8028,8029,8030,8031,8032,8033,8034,8035,0} - ,{11401,11158,11159,11160,11161,11162,11163,11164,11165,11400,11401,11402,11403,11404,11405,11406,11407,11642,11643,11644,11645,11646,11647,11648,11649,11884,11885,11886,11887,11888,11889,11890,11891,0} - ,{9474,9230,9231,9232,9233,9234,9235,9236,9237,9472,9473,9474,9475,9476,9477,9478,9479,9714,9715,9716,9717,9718,9719,9720,9721,9956,9957,9958,9959,9960,9961,9962,9963,0} - ,{8514,8270,8271,8272,8273,8274,8275,8276,8277,8512,8513,8514,8515,8516,8517,8518,8519,8754,8755,8756,8757,8758,8759,8760,8761,8996,8997,8998,8999,9000,9001,9002,9003,0} - ,{10442,10198,10199,10200,10201,10202,10203,10204,10205,10440,10441,10442,10443,10444,10445,10446,10447,10682,10683,10684,10685,10686,10687,10688,10689,10924,10925,10926,10927,10928,10929,10930,10931,0} - ,{7554,7310,7311,7312,7313,7314,7315,7316,7317,7552,7553,7554,7555,7556,7557,7558,7559,7794,7795,7796,7797,7798,7799,7800,7801,8036,8037,8038,8039,8040,8041,8042,8043,0} - ,{11410,11166,11167,11168,11169,11170,11171,11172,11173,11408,11409,11410,11411,11412,11413,11414,11415,11650,11651,11652,11653,11654,11655,11656,11657,11892,11893,11894,11895,11896,11897,11898,11899,0} - ,{9482,9238,9239,9240,9241,9242,9243,9244,9245,9480,9481,9482,9483,9484,9485,9486,9487,9722,9723,9724,9725,9726,9727,9728,9729,9964,9965,9966,9967,9968,9969,9970,9971,0} - ,{8522,8278,8279,8280,8281,8282,8283,8284,8285,8520,8521,8522,8523,8524,8525,8526,8527,8762,8763,8764,8765,8766,8767,8768,8769,9004,9005,9006,9007,9008,9009,9010,9011,0} - ,{10450,10206,10207,10208,10209,10210,10211,10212,10213,10448,10449,10450,10451,10452,10453,10454,10455,10690,10691,10692,10693,10694,10695,10696,10697,10932,10933,10934,10935,10936,10937,10938,10939,0} - ,{9490,9246,9247,9248,9249,9250,9251,9252,9253,9488,9489,9490,9491,9492,9493,9494,9495,9730,9731,9732,9733,9734,9735,9736,9737,9972,9973,9974,9975,9976,9977,9978,9979,0} - ,{11418,11174,11175,11176,11177,11178,11179,11180,11181,11416,11417,11418,11419,11420,11421,11422,11423,11658,11659,11660,11661,11662,11663,11664,11665,11900,11901,11902,11903,11904,11905,11906,11907,0} - ,{8530,8286,8287,8288,8289,8290,8291,8292,8293,8528,8529,8530,8531,8532,8533,8534,8535,8770,8771,8772,8773,8774,8775,8776,8777,9012,9013,9014,9015,9016,9017,9018,9019,0} - ,{12386,12142,12143,12144,12145,12146,12147,12148,12149,12384,12385,12386,12387,12388,12389,12390,12391,12626,12627,12628,12629,12630,12631,12632,12633,12868,12869,12870,12871,12872,12873,12874,12875,0} - ,{10458,10214,10215,10216,10217,10218,10219,10220,10221,10456,10457,10458,10459,10460,10461,10462,10463,10698,10699,10700,10701,10702,10703,10704,10705,10940,10941,10942,10943,10944,10945,10946,10947,0} - ,{9498,9254,9255,9256,9257,9258,9259,9260,9261,9496,9497,9498,9499,9500,9501,9502,9503,9738,9739,9740,9741,9742,9743,9744,9745,9980,9981,9982,9983,9984,9985,9986,9987,0} - ,{11426,11182,11183,11184,11185,11186,11187,11188,11189,11424,11425,11426,11427,11428,11429,11430,11431,11666,11667,11668,11669,11670,11671,11672,11673,11908,11909,11910,11911,11912,11913,11914,11915,0} - ,{10466,10222,10223,10224,10225,10226,10227,10228,10229,10464,10465,10466,10467,10468,10469,10470,10471,10706,10707,10708,10709,10710,10711,10712,10713,10948,10949,10950,10951,10952,10953,10954,10955,0} - ,{12394,12150,12151,12152,12153,12154,12155,12156,12157,12392,12393,12394,12395,12396,12397,12398,12399,12634,12635,12636,12637,12638,12639,12640,12641,12876,12877,12878,12879,12880,12881,12882,12883,0} - ,{11434,11190,11191,11192,11193,11194,11195,11196,11197,11432,11433,11434,11435,11436,11437,11438,11439,11674,11675,11676,11677,11678,11679,11680,11681,11916,11917,11918,11919,11920,11921,11922,11923,0} - ,{10474,10230,10231,10232,10233,10234,10235,10236,10237,10472,10473,10474,10475,10476,10477,10478,10479,10714,10715,10716,10717,10718,10719,10720,10721,10956,10957,10958,10959,10960,10961,10962,10963,0} - ,{12402,12158,12159,12160,12161,12162,12163,12164,12165,12400,12401,12402,12403,12404,12405,12406,12407,12642,12643,12644,12645,12646,12647,12648,12649,12884,12885,12886,12887,12888,12889,12890,12891,0} - ,{11442,11198,11199,11200,11201,11202,11203,11204,11205,11440,11441,11442,11443,11444,11445,11446,11447,11682,11683,11684,11685,11686,11687,11688,11689,11924,11925,11926,11927,11928,11929,11930,11931,0} - ,{12410,12166,12167,12168,12169,12170,12171,12172,12173,12408,12409,12410,12411,12412,12413,12414,12415,12650,12651,12652,12653,12654,12655,12656,12657,12892,12893,12894,12895,12896,12897,12898,12899,0} - ,{11450,11206,11207,11208,11209,11210,11211,11212,11213,11448,11449,11450,11451,11452,11453,11454,11455,11690,11691,11692,11693,11694,11695,11696,11697,11932,11933,11934,11935,11936,11937,11938,11939,0} - ,{13378,13134,13135,13136,13137,13138,13139,13140,13141,13376,13377,13378,13379,13380,13381,13382,13383,13618,13619,13620,13621,13622,13623,13624,13625,13860,13861,13862,13863,13864,13865,13866,13867,0} - ,{12418,12174,12175,12176,12177,12178,12179,12180,12181,12416,12417,12418,12419,12420,12421,12422,12423,12658,12659,12660,12661,12662,12663,12664,12665,12900,12901,12902,12903,12904,12905,12906,12907,0} - ,{13386,13142,13143,13144,13145,13146,13147,13148,13149,13384,13385,13386,13387,13388,13389,13390,13391,13626,13627,13628,13629,13630,13631,13632,13633,13868,13869,13870,13871,13872,13873,13874,13875,0} - ,{12426,12182,12183,12184,12185,12186,12187,12188,12189,12424,12425,12426,12427,12428,12429,12430,12431,12666,12667,12668,12669,12670,12671,12672,12673,12908,12909,12910,12911,12912,12913,12914,12915,0} - ,{13394,13150,13151,13152,13153,13154,13155,13156,13157,13392,13393,13394,13395,13396,13397,13398,13399,13634,13635,13636,13637,13638,13639,13640,13641,13876,13877,13878,13879,13880,13881,13882,13883,0} - ,{14362,14118,14119,14120,14121,14122,14123,14124,14125,14360,14361,14362,14363,14364,14365,14366,14367,14602,14603,14604,14605,14606,14607,14608,14609,14844,14845,14846,14847,14848,14849,14850,14851,0} - ,{13402,13158,13159,13160,13161,13162,13163,13164,13165,13400,13401,13402,13403,13404,13405,13406,13407,13642,13643,13644,13645,13646,13647,13648,13649,13884,13885,13886,13887,13888,13889,13890,13891,0} - ,{14126,14126,14127,14128,14129,14368,14369,14370,14371,0} - ,{14610,14610,14611,14612,14613,14852,14853,14854,14855,0} - ,{14130,14130,14131,14132,14133,14372,14373,14374,14375,0} - ,{14614,14614,14615,14616,14617,14856,14857,14858,14859,0} - ,{14134,14134,14135,14136,14137,14376,14377,14378,14379,0} - ,{15098,15098,15099,15100,15101,15340,15341,15342,15343,0} - ,{14618,14618,14619,14620,14621,14860,14861,14862,14863,0} - ,{15102,15102,15103,15104,15105,15344,15345,15346,15347,0} - ,{14622,14622,14623,14624,14625,14864,14865,14866,14867,0} - ,{14866,14626,14627,14868,14869,15106,15107,15108,15109,0} - ,{15590,15348,15349,15350,15351,15590,15591,15832,15833,0} - ,{4157,3918,3919,4160,4161,4398,4399,4400,4401,0} - ,{2005,2006,2007,2246,2247,2248,2249,2250,2251,0} - ,{2483,2244,2245,2484,2485,2726,2727,2968,2969,0} - ,{3920,3920,3921,3922,3923,4162,4163,4164,4165,0} - ,{2008,1768,1769,2008,2009,2010,2011,2252,2253,0} - ,{2011,1770,1771,2012,2013,2254,2255,2256,2257,0} - ,{4641,4402,4403,4404,4405,4640,4641,4642,4643,4644,4645,4646,4647,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,0} - ,{2965,2966,2967,3206,3207,3208,3209,3210,3211,0} - ,{3685,3444,3445,3686,3687,3926,3927,3928,3929,0} - ,{3924,3924,3925,4166,4167,4168,4169,4170,4171,0} - ,{2730,2486,2487,2488,2489,2490,2491,2492,2493,2728,2729,2730,2731,2732,2733,2734,2735,2970,2971,2972,2973,2974,2975,2976,2977,3212,3213,3214,3215,3216,3217,3218,3219,0} - ,{3690,3446,3447,3448,3449,3450,3451,3452,3453,3688,3689,3690,3691,3692,3693,3694,3695,3930,3931,3932,3933,3934,3935,3936,3937,4172,4173,4174,4175,4176,4177,4178,4179,0} - ,{5610,5366,5367,5368,5369,5370,5371,5372,5373,5608,5609,5610,5611,5612,5613,5614,5615,5850,5851,5852,5853,5854,5855,5856,5857,6092,6093,6094,6095,6096,6097,6098,6099,0} - ,{4650,4406,4407,4408,4409,4410,4411,4412,4413,4648,4649,4650,4651,4652,4653,4654,4655,4890,4891,4892,4893,4894,4895,4896,4897,5132,5133,5134,5135,5136,5137,5138,5139,0} - ,{2738,2494,2495,2496,2497,2498,2499,2500,2501,2736,2737,2738,2739,2740,2741,2742,2743,2978,2979,2980,2981,2982,2983,2984,2985,3220,3221,3222,3223,3224,3225,3226,3227,0} - ,{3698,3454,3455,3456,3457,3458,3459,3460,3461,3696,3697,3698,3699,3700,3701,3702,3703,3938,3939,3940,3941,3942,3943,3944,3945,4180,4181,4182,4183,4184,4185,4186,4187,0} - ,{4658,4414,4415,4416,4417,4418,4419,4420,4421,4656,4657,4658,4659,4660,4661,4662,4663,4898,4899,4900,4901,4902,4903,4904,4905,5140,5141,5142,5143,5144,5145,5146,5147,0} - ,{5618,5374,5375,5376,5377,5378,5379,5380,5381,5616,5617,5618,5619,5620,5621,5622,5623,5858,5859,5860,5861,5862,5863,5864,5865,6100,6101,6102,6103,6104,6105,6106,6107,0} - ,{3706,3462,3463,3464,3465,3466,3467,3468,3469,3704,3705,3706,3707,3708,3709,3710,3711,3946,3947,3948,3949,3950,3951,3952,3953,4188,4189,4190,4191,4192,4193,4194,4195,0} - ,{4666,4422,4423,4424,4425,4426,4427,4428,4429,4664,4665,4666,4667,4668,4669,4670,4671,4906,4907,4908,4909,4910,4911,4912,4913,5148,5149,5150,5151,5152,5153,5154,5155,0} - ,{5626,5382,5383,5384,5385,5386,5387,5388,5389,5624,5625,5626,5627,5628,5629,5630,5631,5866,5867,5868,5869,5870,5871,5872,5873,6108,6109,6110,6111,6112,6113,6114,6115,0} - ,{6586,6342,6343,6344,6345,6346,6347,6348,6349,6584,6585,6586,6587,6588,6589,6590,6591,6826,6827,6828,6829,6830,6831,6832,6833,7068,7069,7070,7071,7072,7073,7074,7075,0} - ,{4674,4430,4431,4432,4433,4434,4435,4436,4437,4672,4673,4674,4675,4676,4677,4678,4679,4914,4915,4916,4917,4918,4919,4920,4921,5156,5157,5158,5159,5160,5161,5162,5163,0} - ,{5634,5390,5391,5392,5393,5394,5395,5396,5397,5632,5633,5634,5635,5636,5637,5638,5639,5874,5875,5876,5877,5878,5879,5880,5881,6116,6117,6118,6119,6120,6121,6122,6123,0} - ,{6594,6350,6351,6352,6353,6354,6355,6356,6357,6592,6593,6594,6595,6596,6597,6598,6599,6834,6835,6836,6837,6838,6839,6840,6841,7076,7077,7078,7079,7080,7081,7082,7083,0} - ,{4682,4438,4439,4440,4441,4442,4443,4444,4445,4680,4681,4682,4683,4684,4685,4686,4687,4922,4923,4924,4925,4926,4927,4928,4929,5164,5165,5166,5167,5168,5169,5170,5171,0} - ,{5642,5398,5399,5400,5401,5402,5403,5404,5405,5640,5641,5642,5643,5644,5645,5646,5647,5882,5883,5884,5885,5886,5887,5888,5889,6124,6125,6126,6127,6128,6129,6130,6131,0} - ,{6602,6358,6359,6360,6361,6362,6363,6364,6365,6600,6601,6602,6603,6604,6605,6606,6607,6842,6843,6844,6845,6846,6847,6848,6849,7084,7085,7086,7087,7088,7089,7090,7091,0} - ,{7562,7318,7319,7320,7321,7322,7323,7324,7325,7560,7561,7562,7563,7564,7565,7566,7567,7802,7803,7804,7805,7806,7807,7808,7809,8044,8045,8046,8047,8048,8049,8050,8051,0} - ,{5650,5406,5407,5408,5409,5410,5411,5412,5413,5648,5649,5650,5651,5652,5653,5654,5655,5890,5891,5892,5893,5894,5895,5896,5897,6132,6133,6134,6135,6136,6137,6138,6139,0} - ,{6610,6366,6367,6368,6369,6370,6371,6372,6373,6608,6609,6610,6611,6612,6613,6614,6615,6850,6851,6852,6853,6854,6855,6856,6857,7092,7093,7094,7095,7096,7097,7098,7099,0} - ,{7570,7326,7327,7328,7329,7330,7331,7332,7333,7568,7569,7570,7571,7572,7573,7574,7575,7810,7811,7812,7813,7814,7815,7816,7817,8052,8053,8054,8055,8056,8057,8058,8059,0} - ,{6618,6374,6375,6376,6377,6378,6379,6380,6381,6616,6617,6618,6619,6620,6621,6622,6623,6858,6859,6860,6861,6862,6863,6864,6865,7100,7101,7102,7103,7104,7105,7106,7107,0} - ,{7578,7334,7335,7336,7337,7338,7339,7340,7341,7576,7577,7578,7579,7580,7581,7582,7583,7818,7819,7820,7821,7822,7823,7824,7825,8060,8061,8062,8063,8064,8065,8066,8067,0} - ,{8538,8294,8295,8296,8297,8298,8299,8300,8301,8536,8537,8538,8539,8540,8541,8542,8543,8778,8779,8780,8781,8782,8783,8784,8785,9020,9021,9022,9023,9024,9025,9026,9027,0} - ,{7586,7342,7343,7344,7345,7346,7347,7348,7349,7584,7585,7586,7587,7588,7589,7590,7591,7826,7827,7828,7829,7830,7831,7832,7833,8068,8069,8070,8071,8072,8073,8074,8075,0} - ,{9506,9262,9263,9264,9265,9266,9267,9268,9269,9504,9505,9506,9507,9508,9509,9510,9511,9746,9747,9748,9749,9750,9751,9752,9753,9988,9989,9990,9991,9992,9993,9994,9995,0} - ,{8546,8302,8303,8304,8305,8306,8307,8308,8309,8544,8545,8546,8547,8548,8549,8550,8551,8786,8787,8788,8789,8790,8791,8792,8793,9028,9029,9030,9031,9032,9033,9034,9035,0} - ,{7594,7350,7351,7352,7353,7354,7355,7356,7357,7592,7593,7594,7595,7596,7597,7598,7599,7834,7835,7836,7837,7838,7839,7840,7841,8076,8077,8078,8079,8080,8081,8082,8083,0} - ,{8554,8310,8311,8312,8313,8314,8315,8316,8317,8552,8553,8554,8555,8556,8557,8558,8559,8794,8795,8796,8797,8798,8799,8800,8801,9036,9037,9038,9039,9040,9041,9042,9043,0} - ,{9514,9270,9271,9272,9273,9274,9275,9276,9277,9512,9513,9514,9515,9516,9517,9518,9519,9754,9755,9756,9757,9758,9759,9760,9761,9996,9997,9998,9999,10000,10001,10002,10003,0} - ,{8562,8318,8319,8320,8321,8322,8323,8324,8325,8560,8561,8562,8563,8564,8565,8566,8567,8802,8803,8804,8805,8806,8807,8808,8809,9044,9045,9046,9047,9048,9049,9050,9051,0} - ,{9522,9278,9279,9280,9281,9282,9283,9284,9285,9520,9521,9522,9523,9524,9525,9526,9527,9762,9763,9764,9765,9766,9767,9768,9769,10004,10005,10006,10007,10008,10009,10010,10011,0} - ,{10482,10238,10239,10240,10241,10242,10243,10244,10245,10480,10481,10482,10483,10484,10485,10486,10487,10722,10723,10724,10725,10726,10727,10728,10729,10964,10965,10966,10967,10968,10969,10970,10971,0} - ,{9530,9286,9287,9288,9289,9290,9291,9292,9293,9528,9529,9530,9531,9532,9533,9534,9535,9770,9771,9772,9773,9774,9775,9776,9777,10012,10013,10014,10015,10016,10017,10018,10019,0} - ,{10490,10246,10247,10248,10249,10250,10251,10252,10253,10488,10489,10490,10491,10492,10493,10494,10495,10730,10731,10732,10733,10734,10735,10736,10737,10972,10973,10974,10975,10976,10977,10978,10979,0} - ,{10498,10254,10255,10256,10257,10258,10259,10260,10261,10496,10497,10498,10499,10500,10501,10502,10503,10738,10739,10740,10741,10742,10743,10744,10745,10980,10981,10982,10983,10984,10985,10986,10987,0} - ,{11458,11214,11215,11216,11217,11218,11219,11220,11221,11456,11457,11458,11459,11460,11461,11462,11463,11698,11699,11700,11701,11702,11703,11704,11705,11940,11941,11942,11943,11944,11945,11946,11947,0} - ,{10506,10262,10263,10264,10265,10266,10267,10268,10269,10504,10505,10506,10507,10508,10509,10510,10511,10746,10747,10748,10749,10750,10751,10752,10753,10988,10989,10990,10991,10992,10993,10994,10995,0} - ,{11466,11222,11223,11224,11225,11226,11227,11228,11229,11464,11465,11466,11467,11468,11469,11470,11471,11706,11707,11708,11709,11710,11711,11712,11713,11948,11949,11950,11951,11952,11953,11954,11955,0} - ,{11474,11230,11231,11232,11233,11234,11235,11236,11237,11472,11473,11474,11475,11476,11477,11478,11479,11714,11715,11716,11717,11718,11719,11720,11721,11956,11957,11958,11959,11960,11961,11962,11963,0} - ,{12434,12190,12191,12192,12193,12194,12195,12196,12197,12432,12433,12434,12435,12436,12437,12438,12439,12674,12675,12676,12677,12678,12679,12680,12681,12916,12917,12918,12919,12920,12921,12922,12923,0} - ,{12442,12198,12199,12200,12201,12202,12203,12204,12205,12440,12441,12442,12443,12444,12445,12446,12447,12682,12683,12684,12685,12686,12687,12688,12689,12924,12925,12926,12927,12928,12929,12930,12931,0} - ,{13166,13166,13167,13168,13169,13408,13409,13410,13411,0} - ,{13170,13170,13171,13172,13173,13412,13413,13414,13415,0} - ,{13650,13650,13651,13652,13653,13892,13893,13894,13895,0} - ,{13174,13174,13175,13176,13177,13416,13417,13418,13419,0} - ,{13654,13654,13655,13656,13657,13896,13897,13898,13899,0} - ,{13658,13658,13659,13660,13661,13900,13901,13902,13903,0} - ,{14138,14138,14139,14140,14141,14380,14381,14382,14383,0} - ,{13662,13662,13663,13664,13665,13904,13905,13906,13907,0} - ,{14142,14142,14143,14144,14145,14384,14385,14386,14387,0} - ,{14147,14146,14147,14148,14149,14150,14151,14388,14389,0} - ,{358,356,357,358,359,360,361,362,363,0} - ,{1051,1054,1055,1292,1293,1294,1295,1296,1297,0} - ,{1529,1528,1529,1530,1531,1532,1533,1772,1773,0} - ,{1056,1056,1057,1058,1059,1298,1299,1300,1301,0} - ,{1061,1064,1065,1302,1303,1304,1305,1306,1307,0} - ,{834,590,591,592,593,594,595,596,597,832,833,834,835,836,837,838,839,1074,1075,1076,1077,1078,1079,1080,1081,1316,1317,1318,1319,1320,1321,1322,1323,0} - ,{1066,1066,1067,1068,1069,1308,1309,1310,1311,0} - ,{842,598,599,600,601,602,603,604,605,840,841,842,843,844,845,846,847,1082,1083,1084,1085,1086,1087,1088,1089,1324,1325,1326,1327,1328,1329,1330,1331,0} - ,{2015,1774,1775,2014,2015,2016,2017,2258,2259,0} - ,{1070,1070,1071,1072,1073,1312,1313,1314,1315,0} - ,{1778,1534,1535,1536,1537,1538,1539,1540,1541,1776,1777,1778,1779,1780,1781,1782,1783,2018,2019,2020,2021,2022,2023,2024,2025,2260,2261,2262,2263,2264,2265,2266,2267,0} - ,{1786,1542,1543,1544,1545,1546,1547,1548,1549,1784,1785,1786,1787,1788,1789,1790,1791,2026,2027,2028,2029,2030,2031,2032,2033,2268,2269,2270,2271,2272,2273,2274,2275,0} - ,{1794,1550,1551,1552,1553,1554,1555,1556,1557,1792,1793,1794,1795,1796,1797,1798,1799,2034,2035,2036,2037,2038,2039,2040,2041,2276,2277,2278,2279,2280,2281,2282,2283,0} - ,{1802,1558,1559,1560,1561,1562,1563,1564,1565,1800,1801,1802,1803,1804,1805,1806,1807,2042,2043,2044,2045,2046,2047,2048,2049,2284,2285,2286,2287,2288,2289,2290,2291,0} - ,{1810,1566,1567,1568,1569,1570,1571,1572,1573,1808,1809,1810,1811,1812,1813,1814,1815,2050,2051,2052,2053,2054,2055,2056,2057,2292,2293,2294,2295,2296,2297,2298,2299,0} - ,{2746,2502,2503,2504,2505,2506,2507,2508,2509,2744,2745,2746,2747,2748,2749,2750,2751,2986,2987,2988,2989,2990,2991,2992,2993,3228,3229,3230,3231,3232,3233,3234,3235,0} - ,{2754,2510,2511,2512,2513,2514,2515,2516,2517,2752,2753,2754,2755,2756,2757,2758,2759,2994,2995,2996,2997,2998,2999,3000,3001,3236,3237,3238,3239,3240,3241,3242,3243,0} - ,{2762,2518,2519,2520,2521,2522,2523,2524,2525,2760,2761,2762,2763,2764,2765,2766,2767,3002,3003,3004,3005,3006,3007,3008,3009,3244,3245,3246,3247,3248,3249,3250,3251,0} - ,{2770,2526,2527,2528,2529,2530,2531,2532,2533,2768,2769,2770,2771,2772,2773,2774,2775,3010,3011,3012,3013,3014,3015,3016,3017,3252,3253,3254,3255,3256,3257,3258,3259,0} - ,{2778,2534,2535,2536,2537,2538,2539,2540,2541,2776,2777,2778,2779,2780,2781,2782,2783,3018,3019,3020,3021,3022,3023,3024,3025,3260,3261,3262,3263,3264,3265,3266,3267,0} - ,{3714,3470,3471,3472,3473,3474,3475,3476,3477,3712,3713,3714,3715,3716,3717,3718,3719,3954,3955,3956,3957,3958,3959,3960,3961,4196,4197,4198,4199,4200,4201,4202,4203,0} - ,{3722,3478,3479,3480,3481,3482,3483,3484,3485,3720,3721,3722,3723,3724,3725,3726,3727,3962,3963,3964,3965,3966,3967,3968,3969,4204,4205,4206,4207,4208,4209,4210,4211,0} - ,{3730,3486,3487,3488,3489,3490,3491,3492,3493,3728,3729,3730,3731,3732,3733,3734,3735,3970,3971,3972,3973,3974,3975,3976,3977,4212,4213,4214,4215,4216,4217,4218,4219,0} - ,{3738,3494,3495,3496,3497,3498,3499,3500,3501,3736,3737,3738,3739,3740,3741,3742,3743,3978,3979,3980,3981,3982,3983,3984,3985,4220,4221,4222,4223,4224,4225,4226,4227,0} - ,{3746,3502,3503,3504,3505,3506,3507,3508,3509,3744,3745,3746,3747,3748,3749,3750,3751,3986,3987,3988,3989,3990,3991,3992,3993,4228,4229,4230,4231,4232,4233,4234,4235,0} - ,{4690,4446,4447,4448,4449,4450,4451,4452,4453,4688,4689,4690,4691,4692,4693,4694,4695,4930,4931,4932,4933,4934,4935,4936,4937,5172,5173,5174,5175,5176,5177,5178,5179,0} - ,{4698,4454,4455,4456,4457,4458,4459,4460,4461,4696,4697,4698,4699,4700,4701,4702,4703,4938,4939,4940,4941,4942,4943,4944,4945,5180,5181,5182,5183,5184,5185,5186,5187,0} - ,{4706,4462,4463,4464,4465,4466,4467,4468,4469,4704,4705,4706,4707,4708,4709,4710,4711,4946,4947,4948,4949,4950,4951,4952,4953,5188,5189,5190,5191,5192,5193,5194,5195,0} - ,{4714,4470,4471,4472,4473,4474,4475,4476,4477,4712,4713,4714,4715,4716,4717,4718,4719,4954,4955,4956,4957,4958,4959,4960,4961,5196,5197,5198,5199,5200,5201,5202,5203,0} - ,{5658,5414,5415,5416,5417,5418,5419,5420,5421,5656,5657,5658,5659,5660,5661,5662,5663,5898,5899,5900,5901,5902,5903,5904,5905,6140,6141,6142,6143,6144,6145,6146,6147,0} - ,{5666,5422,5423,5424,5425,5426,5427,5428,5429,5664,5665,5666,5667,5668,5669,5670,5671,5906,5907,5908,5909,5910,5911,5912,5913,6148,6149,6150,6151,6152,6153,6154,6155,0} - ,{5674,5430,5431,5432,5433,5434,5435,5436,5437,5672,5673,5674,5675,5676,5677,5678,5679,5914,5915,5916,5917,5918,5919,5920,5921,6156,6157,6158,6159,6160,6161,6162,6163,0} - ,{5682,5438,5439,5440,5441,5442,5443,5444,5445,5680,5681,5682,5683,5684,5685,5686,5687,5922,5923,5924,5925,5926,5927,5928,5929,6164,6165,6166,6167,6168,6169,6170,6171,0} - ,{6626,6382,6383,6384,6385,6386,6387,6388,6389,6624,6625,6626,6627,6628,6629,6630,6631,6866,6867,6868,6869,6870,6871,6872,6873,7108,7109,7110,7111,7112,7113,7114,7115,0} - ,{6634,6390,6391,6392,6393,6394,6395,6396,6397,6632,6633,6634,6635,6636,6637,6638,6639,6874,6875,6876,6877,6878,6879,6880,6881,7116,7117,7118,7119,7120,7121,7122,7123,0} - ,{6642,6398,6399,6400,6401,6402,6403,6404,6405,6640,6641,6642,6643,6644,6645,6646,6647,6882,6883,6884,6885,6886,6887,6888,6889,7124,7125,7126,7127,7128,7129,7130,7131,0} - ,{6650,6406,6407,6408,6409,6410,6411,6412,6413,6648,6649,6650,6651,6652,6653,6654,6655,6890,6891,6892,6893,6894,6895,6896,6897,7132,7133,7134,7135,7136,7137,7138,7139,0} - ,{7602,7358,7359,7360,7361,7362,7363,7364,7365,7600,7601,7602,7603,7604,7605,7606,7607,7842,7843,7844,7845,7846,7847,7848,7849,8084,8085,8086,8087,8088,8089,8090,8091,0} - ,{7610,7366,7367,7368,7369,7370,7371,7372,7373,7608,7609,7610,7611,7612,7613,7614,7615,7850,7851,7852,7853,7854,7855,7856,7857,8092,8093,8094,8095,8096,8097,8098,8099,0} - ,{7618,7374,7375,7376,7377,7378,7379,7380,7381,7616,7617,7618,7619,7620,7621,7622,7623,7858,7859,7860,7861,7862,7863,7864,7865,8100,8101,8102,8103,8104,8105,8106,8107,0} - ,{8570,8326,8327,8328,8329,8330,8331,8332,8333,8568,8569,8570,8571,8572,8573,8574,8575,8810,8811,8812,8813,8814,8815,8816,8817,9052,9053,9054,9055,9056,9057,9058,9059,0} - ,{8578,8334,8335,8336,8337,8338,8339,8340,8341,8576,8577,8578,8579,8580,8581,8582,8583,8818,8819,8820,8821,8822,8823,8824,8825,9060,9061,9062,9063,9064,9065,9066,9067,0} - ,{8586,8342,8343,8344,8345,8346,8347,8348,8349,8584,8585,8586,8587,8588,8589,8590,8591,8826,8827,8828,8829,8830,8831,8832,8833,9068,9069,9070,9071,9072,9073,9074,9075,0} - ,{9538,9294,9295,9296,9297,9298,9299,9300,9301,9536,9537,9538,9539,9540,9541,9542,9543,9778,9779,9780,9781,9782,9783,9784,9785,10020,10021,10022,10023,10024,10025,10026,10027,0} - ,{9546,9302,9303,9304,9305,9306,9307,9308,9309,9544,9545,9546,9547,9548,9549,9550,9551,9786,9787,9788,9789,9790,9791,9792,9793,10028,10029,10030,10031,10032,10033,10034,10035,0} - ,{9554,9310,9311,9312,9313,9314,9315,9316,9317,9552,9553,9554,9555,9556,9557,9558,9559,9794,9795,9796,9797,9798,9799,9800,9801,10036,10037,10038,10039,10040,10041,10042,10043,0} - ,{10514,10270,10271,10272,10273,10274,10275,10276,10277,10512,10513,10514,10515,10516,10517,10518,10519,10754,10755,10756,10757,10758,10759,10760,10761,10996,10997,10998,10999,11000,11001,11002,11003,0} - ,{10522,10278,10279,10280,10281,10282,10283,10284,10285,10520,10521,10522,10523,10524,10525,10526,10527,10762,10763,10764,10765,10766,10767,10768,10769,11004,11005,11006,11007,11008,11009,11010,11011,0} - ,{11482,11238,11239,11240,11241,11242,11243,11244,11245,11480,11481,11482,11483,11484,11485,11486,11487,11722,11723,11724,11725,11726,11727,11728,11729,11964,11965,11966,11967,11968,11969,11970,11971,0} - ,{11490,11246,11247,11248,11249,11250,11251,11252,11253,11488,11489,11490,11491,11492,11493,11494,11495,11730,11731,11732,11733,11734,11735,11736,11737,11972,11973,11974,11975,11976,11977,11978,11979,0} - ,{12206,12206,12207,12208,12209,12448,12449,12450,12451,0} - ,{12210,12210,12211,12212,12213,12452,12453,12454,12455,0} - ,{12214,12214,12215,12216,12217,12456,12457,12458,12459,0} - ,{12218,12218,12219,12220,12221,12460,12461,12462,12463,0} - ,{12690,12690,12691,12692,12693,12932,12933,12934,12935,0} - ,{12694,12694,12695,12696,12697,12936,12937,12938,12939,0} - ,{12698,12698,12699,12700,12701,12940,12941,12942,12943,0} - ,{12702,12702,12703,12704,12705,12944,12945,12946,12947,0} - ,{13178,13178,13179,13180,13181,13420,13421,13422,13423,0} - ,{13182,13182,13183,13184,13185,13424,13425,13426,13427,0} - ,{13186,13186,13187,13188,13189,13428,13429,13430,13431,0} - ,{13666,13666,13667,13668,13669,13908,13909,13910,13911,0} - ,{13670,13670,13671,13672,13673,13912,13913,13914,13915,0} - ,{366,364,365,366,367,368,369,370,371,0} - ,{1369,1368,1369,1370,1371,1372,1373,0} - ,{1123,1122,1123,1124,1125,1364,1365,1366,1367,0} - ,{1119,1118,1119,1120,1121,1360,1361,1362,1363,0} - ,{1859,1614,1615,1616,1617,1618,1619,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,2098,2099,2100,2101,2102,2103,2104,2105,2340,2341,2342,2343,2344,2345,2346,2347,0} - ,{1114,1112,1113,1114,1115,1356,1357,1358,1359,0} - ,{859,614,615,616,617,618,619,620,621,856,857,858,859,860,861,862,863,1098,1099,1100,1101,1102,1103,1104,1105,1340,1341,1342,1343,1344,1345,1346,1347,0} - ,{1110,1108,1109,1110,1111,1352,1353,1354,1355,0} - ,{851,606,607,608,609,610,611,612,613,848,849,850,851,852,853,854,855,1090,1091,1092,1093,1094,1095,1096,1097,1332,1333,1334,1335,1336,1337,1338,1339,0} - ,{1106,864,865,1106,1107,1348,1349,1350,1351,0} - ,{1851,1606,1607,1608,1609,1610,1611,1612,1613,1848,1849,1850,1851,1852,1853,1854,1855,2090,2091,2092,2093,2094,2095,2096,2097,2332,2333,2334,2335,2336,2337,2338,2339,0} - ,{1843,1598,1599,1600,1601,1602,1603,1604,1605,1840,1841,1842,1843,1844,1845,1846,1847,2082,2083,2084,2085,2086,2087,2088,2089,2324,2325,2326,2327,2328,2329,2330,2331,0} - ,{1835,1590,1591,1592,1593,1594,1595,1596,1597,1832,1833,1834,1835,1836,1837,1838,1839,2074,2075,2076,2077,2078,2079,2080,2081,2316,2317,2318,2319,2320,2321,2322,2323,0} - ,{1827,1582,1583,1584,1585,1586,1587,1588,1589,1824,1825,1826,1827,1828,1829,1830,1831,2066,2067,2068,2069,2070,2071,2072,2073,2308,2309,2310,2311,2312,2313,2314,2315,0} - ,{1819,1574,1575,1576,1577,1578,1579,1580,1581,1816,1817,1818,1819,1820,1821,1822,1823,2058,2059,2060,2061,2062,2063,2064,2065,2300,2301,2302,2303,2304,2305,2306,2307,0} - ,{2819,2574,2575,2576,2577,2578,2579,2580,2581,2816,2817,2818,2819,2820,2821,2822,2823,3058,3059,3060,3061,3062,3063,3064,3065,3300,3301,3302,3303,3304,3305,3306,3307,0} - ,{2811,2566,2567,2568,2569,2570,2571,2572,2573,2808,2809,2810,2811,2812,2813,2814,2815,3050,3051,3052,3053,3054,3055,3056,3057,3292,3293,3294,3295,3296,3297,3298,3299,0} - ,{2803,2558,2559,2560,2561,2562,2563,2564,2565,2800,2801,2802,2803,2804,2805,2806,2807,3042,3043,3044,3045,3046,3047,3048,3049,3284,3285,3286,3287,3288,3289,3290,3291,0} - ,{2795,2550,2551,2552,2553,2554,2555,2556,2557,2792,2793,2794,2795,2796,2797,2798,2799,3034,3035,3036,3037,3038,3039,3040,3041,3276,3277,3278,3279,3280,3281,3282,3283,0} - ,{2787,2542,2543,2544,2545,2546,2547,2548,2549,2784,2785,2786,2787,2788,2789,2790,2791,3026,3027,3028,3029,3030,3031,3032,3033,3268,3269,3270,3271,3272,3273,3274,3275,0} - ,{3787,3542,3543,3544,3545,3546,3547,3548,3549,3784,3785,3786,3787,3788,3789,3790,3791,4026,4027,4028,4029,4030,4031,4032,4033,4268,4269,4270,4271,4272,4273,4274,4275,0} - ,{3779,3534,3535,3536,3537,3538,3539,3540,3541,3776,3777,3778,3779,3780,3781,3782,3783,4018,4019,4020,4021,4022,4023,4024,4025,4260,4261,4262,4263,4264,4265,4266,4267,0} - ,{3771,3526,3527,3528,3529,3530,3531,3532,3533,3768,3769,3770,3771,3772,3773,3774,3775,4010,4011,4012,4013,4014,4015,4016,4017,4252,4253,4254,4255,4256,4257,4258,4259,0} - ,{3763,3518,3519,3520,3521,3522,3523,3524,3525,3760,3761,3762,3763,3764,3765,3766,3767,4002,4003,4004,4005,4006,4007,4008,4009,4244,4245,4246,4247,4248,4249,4250,4251,0} - ,{3755,3510,3511,3512,3513,3514,3515,3516,3517,3752,3753,3754,3755,3756,3757,3758,3759,3994,3995,3996,3997,3998,3999,4000,4001,4236,4237,4238,4239,4240,4241,4242,4243,0} - ,{4747,4502,4503,4504,4505,4506,4507,4508,4509,4744,4745,4746,4747,4748,4749,4750,4751,4986,4987,4988,4989,4990,4991,4992,4993,5228,5229,5230,5231,5232,5233,5234,5235,0} - ,{4739,4494,4495,4496,4497,4498,4499,4500,4501,4736,4737,4738,4739,4740,4741,4742,4743,4978,4979,4980,4981,4982,4983,4984,4985,5220,5221,5222,5223,5224,5225,5226,5227,0} - ,{4731,4486,4487,4488,4489,4490,4491,4492,4493,4728,4729,4730,4731,4732,4733,4734,4735,4970,4971,4972,4973,4974,4975,4976,4977,5212,5213,5214,5215,5216,5217,5218,5219,0} - ,{4723,4478,4479,4480,4481,4482,4483,4484,4485,4720,4721,4722,4723,4724,4725,4726,4727,4962,4963,4964,4965,4966,4967,4968,4969,5204,5205,5206,5207,5208,5209,5210,5211,0} - ,{5715,5470,5471,5472,5473,5474,5475,5476,5477,5712,5713,5714,5715,5716,5717,5718,5719,5954,5955,5956,5957,5958,5959,5960,5961,6196,6197,6198,6199,6200,6201,6202,6203,0} - ,{5707,5462,5463,5464,5465,5466,5467,5468,5469,5704,5705,5706,5707,5708,5709,5710,5711,5946,5947,5948,5949,5950,5951,5952,5953,6188,6189,6190,6191,6192,6193,6194,6195,0} - ,{5699,5454,5455,5456,5457,5458,5459,5460,5461,5696,5697,5698,5699,5700,5701,5702,5703,5938,5939,5940,5941,5942,5943,5944,5945,6180,6181,6182,6183,6184,6185,6186,6187,0} - ,{5691,5446,5447,5448,5449,5450,5451,5452,5453,5688,5689,5690,5691,5692,5693,5694,5695,5930,5931,5932,5933,5934,5935,5936,5937,6172,6173,6174,6175,6176,6177,6178,6179,0} - ,{6683,6438,6439,6440,6441,6442,6443,6444,6445,6680,6681,6682,6683,6684,6685,6686,6687,6922,6923,6924,6925,6926,6927,6928,6929,7164,7165,7166,7167,7168,7169,7170,7171,0} - ,{6675,6430,6431,6432,6433,6434,6435,6436,6437,6672,6673,6674,6675,6676,6677,6678,6679,6914,6915,6916,6917,6918,6919,6920,6921,7156,7157,7158,7159,7160,7161,7162,7163,0} - ,{6667,6422,6423,6424,6425,6426,6427,6428,6429,6664,6665,6666,6667,6668,6669,6670,6671,6906,6907,6908,6909,6910,6911,6912,6913,7148,7149,7150,7151,7152,7153,7154,7155,0} - ,{6659,6414,6415,6416,6417,6418,6419,6420,6421,6656,6657,6658,6659,6660,6661,6662,6663,6898,6899,6900,6901,6902,6903,6904,6905,7140,7141,7142,7143,7144,7145,7146,7147,0} - ,{7643,7398,7399,7400,7401,7402,7403,7404,7405,7640,7641,7642,7643,7644,7645,7646,7647,7882,7883,7884,7885,7886,7887,7888,7889,8124,8125,8126,8127,8128,8129,8130,8131,0} - ,{7635,7390,7391,7392,7393,7394,7395,7396,7397,7632,7633,7634,7635,7636,7637,7638,7639,7874,7875,7876,7877,7878,7879,7880,7881,8116,8117,8118,8119,8120,8121,8122,8123,0} - ,{7627,7382,7383,7384,7385,7386,7387,7388,7389,7624,7625,7626,7627,7628,7629,7630,7631,7866,7867,7868,7869,7870,7871,7872,7873,8108,8109,8110,8111,8112,8113,8114,8115,0} - ,{8611,8366,8367,8368,8369,8370,8371,8372,8373,8608,8609,8610,8611,8612,8613,8614,8615,8850,8851,8852,8853,8854,8855,8856,8857,9092,9093,9094,9095,9096,9097,9098,9099,0} - ,{8603,8358,8359,8360,8361,8362,8363,8364,8365,8600,8601,8602,8603,8604,8605,8606,8607,8842,8843,8844,8845,8846,8847,8848,8849,9084,9085,9086,9087,9088,9089,9090,9091,0} - ,{8595,8350,8351,8352,8353,8354,8355,8356,8357,8592,8593,8594,8595,8596,8597,8598,8599,8834,8835,8836,8837,8838,8839,8840,8841,9076,9077,9078,9079,9080,9081,9082,9083,0} - ,{9579,9334,9335,9336,9337,9338,9339,9340,9341,9576,9577,9578,9579,9580,9581,9582,9583,9818,9819,9820,9821,9822,9823,9824,9825,10060,10061,10062,10063,10064,10065,10066,10067,0} - ,{9571,9326,9327,9328,9329,9330,9331,9332,9333,9568,9569,9570,9571,9572,9573,9574,9575,9810,9811,9812,9813,9814,9815,9816,9817,10052,10053,10054,10055,10056,10057,10058,10059,0} - ,{9563,9318,9319,9320,9321,9322,9323,9324,9325,9560,9561,9562,9563,9564,9565,9566,9567,9802,9803,9804,9805,9806,9807,9808,9809,10044,10045,10046,10047,10048,10049,10050,10051,0} - ,{10539,10294,10295,10296,10297,10298,10299,10300,10301,10536,10537,10538,10539,10540,10541,10542,10543,10778,10779,10780,10781,10782,10783,10784,10785,11020,11021,11022,11023,11024,11025,11026,11027,0} - ,{10531,10286,10287,10288,10289,10290,10291,10292,10293,10528,10529,10530,10531,10532,10533,10534,10535,10770,10771,10772,10773,10774,10775,10776,10777,11012,11013,11014,11015,11016,11017,11018,11019,0} - ,{11507,11262,11263,11264,11265,11266,11267,11268,11269,11504,11505,11506,11507,11508,11509,11510,11511,11746,11747,11748,11749,11750,11751,11752,11753,11988,11989,11990,11991,11992,11993,11994,11995,0} - ,{11499,11254,11255,11256,11257,11258,11259,11260,11261,11496,11497,11498,11499,11500,11501,11502,11503,11738,11739,11740,11741,11742,11743,11744,11745,11980,11981,11982,11983,11984,11985,11986,11987,0} - ,{12235,12234,12235,12236,12237,12476,12477,12478,12479,0} - ,{12231,12230,12231,12232,12233,12472,12473,12474,12475,0} - ,{12227,12226,12227,12228,12229,12468,12469,12470,12471,0} - ,{12223,12222,12223,12224,12225,12464,12465,12466,12467,0} - ,{12719,12718,12719,12720,12721,12960,12961,12962,12963,0} - ,{12715,12714,12715,12716,12717,12956,12957,12958,12959,0} - ,{12711,12710,12711,12712,12713,12952,12953,12954,12955,0} - ,{12707,12706,12707,12708,12709,12948,12949,12950,12951,0} - ,{13199,13198,13199,13200,13201,13440,13441,13442,13443,0} - ,{13195,13194,13195,13196,13197,13436,13437,13438,13439,0} - ,{13191,13190,13191,13192,13193,13432,13433,13434,13435,0} - ,{13679,13678,13679,13680,13681,13920,13921,13922,13923,0} - ,{13675,13674,13675,13676,13677,13916,13917,13918,13919,0} - ,{2354,2352,2353,2354,2355,2356,2357,2598,2599,0} - ,{4310,4308,4309,4310,4311,4312,4313,0} - ,{2107,2106,2107,2108,2109,2348,2349,2350,2351,0} - ,{4065,4062,4063,4064,4065,4066,4067,4306,4307,0} - ,{3085,3084,3085,3326,3327,3328,3329,3330,3331,0} - ,{2840,2840,2841,2842,2843,3082,3083,3324,3325,0} - ,{4795,4550,4551,4552,4553,4554,4555,4792,4793,4794,4795,4796,4797,4798,4799,5034,5035,5036,5037,5038,5039,5040,5041,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,0} - ,{3817,3574,3575,3816,3817,3818,3819,4058,4059,0} - ,{4060,4060,4061,4300,4301,4302,4303,4304,4305,0} - ,{2835,2590,2591,2592,2593,2594,2595,2596,2597,2832,2833,2834,2835,2836,2837,2838,2839,3074,3075,3076,3077,3078,3079,3080,3081,3316,3317,3318,3319,3320,3321,3322,3323,0} - ,{3811,3566,3567,3568,3569,3570,3571,3572,3573,3808,3809,3810,3811,3812,3813,3814,3815,4050,4051,4052,4053,4054,4055,4056,4057,4292,4293,4294,4295,4296,4297,4298,4299,0} - ,{4787,4542,4543,4544,4545,4546,4547,4548,4549,4784,4785,4786,4787,4788,4789,4790,4791,5026,5027,5028,5029,5030,5031,5032,5033,5268,5269,5270,5271,5272,5273,5274,5275,0} - ,{5763,5518,5519,5520,5521,5522,5523,5524,5525,5760,5761,5762,5763,5764,5765,5766,5767,6002,6003,6004,6005,6006,6007,6008,6009,6244,6245,6246,6247,6248,6249,6250,6251,0} - ,{2827,2582,2583,2584,2585,2586,2587,2588,2589,2824,2825,2826,2827,2828,2829,2830,2831,3066,3067,3068,3069,3070,3071,3072,3073,3308,3309,3310,3311,3312,3313,3314,3315,0} - ,{3803,3558,3559,3560,3561,3562,3563,3564,3565,3800,3801,3802,3803,3804,3805,3806,3807,4042,4043,4044,4045,4046,4047,4048,4049,4284,4285,4286,4287,4288,4289,4290,4291,0} - ,{4779,4534,4535,4536,4537,4538,4539,4540,4541,4776,4777,4778,4779,4780,4781,4782,4783,5018,5019,5020,5021,5022,5023,5024,5025,5260,5261,5262,5263,5264,5265,5266,5267,0} - ,{5755,5510,5511,5512,5513,5514,5515,5516,5517,5752,5753,5754,5755,5756,5757,5758,5759,5994,5995,5996,5997,5998,5999,6000,6001,6236,6237,6238,6239,6240,6241,6242,6243,0} - ,{3795,3550,3551,3552,3553,3554,3555,3556,3557,3792,3793,3794,3795,3796,3797,3798,3799,4034,4035,4036,4037,4038,4039,4040,4041,4276,4277,4278,4279,4280,4281,4282,4283,0} - ,{4771,4526,4527,4528,4529,4530,4531,4532,4533,4768,4769,4770,4771,4772,4773,4774,4775,5010,5011,5012,5013,5014,5015,5016,5017,5252,5253,5254,5255,5256,5257,5258,5259,0} - ,{5747,5502,5503,5504,5505,5506,5507,5508,5509,5744,5745,5746,5747,5748,5749,5750,5751,5986,5987,5988,5989,5990,5991,5992,5993,6228,6229,6230,6231,6232,6233,6234,6235,0} - ,{6723,6478,6479,6480,6481,6482,6483,6484,6485,6720,6721,6722,6723,6724,6725,6726,6727,6962,6963,6964,6965,6966,6967,6968,6969,7204,7205,7206,7207,7208,7209,7210,7211,0} - ,{4763,4518,4519,4520,4521,4522,4523,4524,4525,4760,4761,4762,4763,4764,4765,4766,4767,5002,5003,5004,5005,5006,5007,5008,5009,5244,5245,5246,5247,5248,5249,5250,5251,0} - ,{5739,5494,5495,5496,5497,5498,5499,5500,5501,5736,5737,5738,5739,5740,5741,5742,5743,5978,5979,5980,5981,5982,5983,5984,5985,6220,6221,6222,6223,6224,6225,6226,6227,0} - ,{6715,6470,6471,6472,6473,6474,6475,6476,6477,6712,6713,6714,6715,6716,6717,6718,6719,6954,6955,6956,6957,6958,6959,6960,6961,7196,7197,7198,7199,7200,7201,7202,7203,0} - ,{4755,4510,4511,4512,4513,4514,4515,4516,4517,4752,4753,4754,4755,4756,4757,4758,4759,4994,4995,4996,4997,4998,4999,5000,5001,5236,5237,5238,5239,5240,5241,5242,5243,0} - ,{5731,5486,5487,5488,5489,5490,5491,5492,5493,5728,5729,5730,5731,5732,5733,5734,5735,5970,5971,5972,5973,5974,5975,5976,5977,6212,6213,6214,6215,6216,6217,6218,6219,0} - ,{6707,6462,6463,6464,6465,6466,6467,6468,6469,6704,6705,6706,6707,6708,6709,6710,6711,6946,6947,6948,6949,6950,6951,6952,6953,7188,7189,7190,7191,7192,7193,7194,7195,0} - ,{7683,7438,7439,7440,7441,7442,7443,7444,7445,7680,7681,7682,7683,7684,7685,7686,7687,7922,7923,7924,7925,7926,7927,7928,7929,8164,8165,8166,8167,8168,8169,8170,8171,0} - ,{5723,5478,5479,5480,5481,5482,5483,5484,5485,5720,5721,5722,5723,5724,5725,5726,5727,5962,5963,5964,5965,5966,5967,5968,5969,6204,6205,6206,6207,6208,6209,6210,6211,0} - ,{6699,6454,6455,6456,6457,6458,6459,6460,6461,6696,6697,6698,6699,6700,6701,6702,6703,6938,6939,6940,6941,6942,6943,6944,6945,7180,7181,7182,7183,7184,7185,7186,7187,0} - ,{7675,7430,7431,7432,7433,7434,7435,7436,7437,7672,7673,7674,7675,7676,7677,7678,7679,7914,7915,7916,7917,7918,7919,7920,7921,8156,8157,8158,8159,8160,8161,8162,8163,0} - ,{6691,6446,6447,6448,6449,6450,6451,6452,6453,6688,6689,6690,6691,6692,6693,6694,6695,6930,6931,6932,6933,6934,6935,6936,6937,7172,7173,7174,7175,7176,7177,7178,7179,0} - ,{7667,7422,7423,7424,7425,7426,7427,7428,7429,7664,7665,7666,7667,7668,7669,7670,7671,7906,7907,7908,7909,7910,7911,7912,7913,8148,8149,8150,8151,8152,8153,8154,8155,0} - ,{8643,8398,8399,8400,8401,8402,8403,8404,8405,8640,8641,8642,8643,8644,8645,8646,8647,8882,8883,8884,8885,8886,8887,8888,8889,9124,9125,9126,9127,9128,9129,9130,9131,0} - ,{7659,7414,7415,7416,7417,7418,7419,7420,7421,7656,7657,7658,7659,7660,7661,7662,7663,7898,7899,7900,7901,7902,7903,7904,7905,8140,8141,8142,8143,8144,8145,8146,8147,0} - ,{9611,9366,9367,9368,9369,9370,9371,9372,9373,9608,9609,9610,9611,9612,9613,9614,9615,9850,9851,9852,9853,9854,9855,9856,9857,10092,10093,10094,10095,10096,10097,10098,10099,0} - ,{8635,8390,8391,8392,8393,8394,8395,8396,8397,8632,8633,8634,8635,8636,8637,8638,8639,8874,8875,8876,8877,8878,8879,8880,8881,9116,9117,9118,9119,9120,9121,9122,9123,0} - ,{7651,7406,7407,7408,7409,7410,7411,7412,7413,7648,7649,7650,7651,7652,7653,7654,7655,7890,7891,7892,7893,7894,7895,7896,7897,8132,8133,8134,8135,8136,8137,8138,8139,0} - ,{8627,8382,8383,8384,8385,8386,8387,8388,8389,8624,8625,8626,8627,8628,8629,8630,8631,8866,8867,8868,8869,8870,8871,8872,8873,9108,9109,9110,9111,9112,9113,9114,9115,0} - ,{9603,9358,9359,9360,9361,9362,9363,9364,9365,9600,9601,9602,9603,9604,9605,9606,9607,9842,9843,9844,9845,9846,9847,9848,9849,10084,10085,10086,10087,10088,10089,10090,10091,0} - ,{8619,8374,8375,8376,8377,8378,8379,8380,8381,8616,8617,8618,8619,8620,8621,8622,8623,8858,8859,8860,8861,8862,8863,8864,8865,9100,9101,9102,9103,9104,9105,9106,9107,0} - ,{9595,9350,9351,9352,9353,9354,9355,9356,9357,9592,9593,9594,9595,9596,9597,9598,9599,9834,9835,9836,9837,9838,9839,9840,9841,10076,10077,10078,10079,10080,10081,10082,10083,0} - ,{10571,10326,10327,10328,10329,10330,10331,10332,10333,10568,10569,10570,10571,10572,10573,10574,10575,10810,10811,10812,10813,10814,10815,10816,10817,11052,11053,11054,11055,11056,11057,11058,11059,0} - ,{9587,9342,9343,9344,9345,9346,9347,9348,9349,9584,9585,9586,9587,9588,9589,9590,9591,9826,9827,9828,9829,9830,9831,9832,9833,10068,10069,10070,10071,10072,10073,10074,10075,0} - ,{10563,10318,10319,10320,10321,10322,10323,10324,10325,10560,10561,10562,10563,10564,10565,10566,10567,10802,10803,10804,10805,10806,10807,10808,10809,11044,11045,11046,11047,11048,11049,11050,11051,0} - ,{10555,10310,10311,10312,10313,10314,10315,10316,10317,10552,10553,10554,10555,10556,10557,10558,10559,10794,10795,10796,10797,10798,10799,10800,10801,11036,11037,11038,11039,11040,11041,11042,11043,0} - ,{11531,11286,11287,11288,11289,11290,11291,11292,11293,11528,11529,11530,11531,11532,11533,11534,11535,11770,11771,11772,11773,11774,11775,11776,11777,12012,12013,12014,12015,12016,12017,12018,12019,0} - ,{10547,10302,10303,10304,10305,10306,10307,10308,10309,10544,10545,10546,10547,10548,10549,10550,10551,10786,10787,10788,10789,10790,10791,10792,10793,11028,11029,11030,11031,11032,11033,11034,11035,0} - ,{11523,11278,11279,11280,11281,11282,11283,11284,11285,11520,11521,11522,11523,11524,11525,11526,11527,11762,11763,11764,11765,11766,11767,11768,11769,12004,12005,12006,12007,12008,12009,12010,12011,0} - ,{11515,11270,11271,11272,11273,11274,11275,11276,11277,11512,11513,11514,11515,11516,11517,11518,11519,11754,11755,11756,11757,11758,11759,11760,11761,11996,11997,11998,11999,12000,12001,12002,12003,0} - ,{12491,12246,12247,12248,12249,12250,12251,12252,12253,12488,12489,12490,12491,12492,12493,12494,12495,12730,12731,12732,12733,12734,12735,12736,12737,12972,12973,12974,12975,12976,12977,12978,12979,0} - ,{12483,12238,12239,12240,12241,12242,12243,12244,12245,12480,12481,12482,12483,12484,12485,12486,12487,12722,12723,12724,12725,12726,12727,12728,12729,12964,12965,12966,12967,12968,12969,12970,12971,0} - ,{13211,13210,13211,13212,13213,13452,13453,13454,13455,0} - ,{13207,13206,13207,13208,13209,13448,13449,13450,13451,0} - ,{13695,13694,13695,13696,13697,13936,13937,13938,13939,0} - ,{13203,13202,13203,13204,13205,13444,13445,13446,13447,0} - ,{13691,13690,13691,13692,13693,13932,13933,13934,13935,0} - ,{13687,13686,13687,13688,13689,13928,13929,13930,13931,0} - ,{14175,14174,14175,14176,14177,14416,14417,14418,14419,0} - ,{13683,13682,13683,13684,13685,13924,13925,13926,13927,0} - ,{14170,14168,14169,14170,14171,14172,14173,14414,14415,0} - ,{14655,14412,14413,14654,14655,14656,14657,14898,14899,0} - ,{14165,14162,14163,14164,14165,14166,14167,14410,14411,0} - ,{9423,9180,9181,9422,9423,9664,9665,9666,9667,0} - ,{6505,6262,6263,6502,6503,6504,6505,6748,6749,0} - ,{9908,9906,9907,9908,9909,10148,10149,10150,10151,0} - ,{8936,8934,8935,8936,8937,9176,9177,9178,9179,0} - ,{6990,6988,6989,6990,6991,7230,7231,7232,7233,0} - ,{10392,10390,10391,10392,10393,10632,10633,10634,10635,0} - ,{5772,5526,5527,5528,5529,5530,5531,5768,5769,5770,5771,5772,5773,5774,5775,6010,6011,6012,6013,6014,6015,6016,6017,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,0} - ,{8448,8446,8447,8688,8689,8690,8691,8692,8693,0} - ,{6745,6744,6745,6746,6747,6986,6987,7228,7229,0} - ,{8932,8930,8931,8932,8933,9172,9173,9174,9175,0} - ,{7716,7470,7471,7472,7473,7474,7475,7712,7713,7714,7715,7716,7717,7718,7719,7954,7955,7956,7957,7958,7959,7960,7961,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,0} - ,{9660,9414,9415,9416,9417,9418,9419,9420,9421,9656,9657,9658,9659,9660,9661,9662,9663,9898,9899,9900,9901,9902,9903,9904,9905,10140,10141,10142,10143,10144,10145,10146,10147,0} - ,{6739,6494,6495,6496,6497,6498,6499,6500,6501,6736,6737,6738,6739,6740,6741,6742,6743,6978,6979,6980,6981,6982,6983,6984,6985,7220,7221,7222,7223,7224,7225,7226,7227,0} - ,{10628,10382,10383,10384,10385,10386,10387,10388,10389,10624,10625,10626,10627,10628,10629,10630,10631,10866,10867,10868,10869,10870,10871,10872,10873,11108,11109,11110,11111,11112,11113,11114,11115,0} - ,{8684,8438,8439,8440,8441,8442,8443,8444,8445,8680,8681,8682,8683,8684,8685,8686,8687,8922,8923,8924,8925,8926,8927,8928,8929,9164,9165,9166,9167,9168,9169,9170,9171,0} - ,{7707,7462,7463,7464,7465,7466,7467,7468,7469,7704,7705,7706,7707,7708,7709,7710,7711,7946,7947,7948,7949,7950,7951,7952,7953,8188,8189,8190,8191,8192,8193,8194,8195,0} - ,{9652,9406,9407,9408,9409,9410,9411,9412,9413,9648,9649,9650,9651,9652,9653,9654,9655,9890,9891,9892,9893,9894,9895,9896,9897,10132,10133,10134,10135,10136,10137,10138,10139,0} - ,{6731,6486,6487,6488,6489,6490,6491,6492,6493,6728,6729,6730,6731,6732,6733,6734,6735,6970,6971,6972,6973,6974,6975,6976,6977,7212,7213,7214,7215,7216,7217,7218,7219,0} - ,{8675,8430,8431,8432,8433,8434,8435,8436,8437,8672,8673,8674,8675,8676,8677,8678,8679,8914,8915,8916,8917,8918,8919,8920,8921,9156,9157,9158,9159,9160,9161,9162,9163,0} - ,{10620,10374,10375,10376,10377,10378,10379,10380,10381,10616,10617,10618,10619,10620,10621,10622,10623,10858,10859,10860,10861,10862,10863,10864,10865,11100,11101,11102,11103,11104,11105,11106,11107,0} - ,{7699,7454,7455,7456,7457,7458,7459,7460,7461,7696,7697,7698,7699,7700,7701,7702,7703,7938,7939,7940,7941,7942,7943,7944,7945,8180,8181,8182,8183,8184,8185,8186,8187,0} - ,{11588,11342,11343,11344,11345,11346,11347,11348,11349,11584,11585,11586,11587,11588,11589,11590,11591,11826,11827,11828,11829,11830,11831,11832,11833,12068,12069,12070,12071,12072,12073,12074,12075,0} - ,{9643,9398,9399,9400,9401,9402,9403,9404,9405,9640,9641,9642,9643,9644,9645,9646,9647,9882,9883,9884,9885,9886,9887,9888,9889,10124,10125,10126,10127,10128,10129,10130,10131,0} - ,{8667,8422,8423,8424,8425,8426,8427,8428,8429,8664,8665,8666,8667,8668,8669,8670,8671,8906,8907,8908,8909,8910,8911,8912,8913,9148,9149,9150,9151,9152,9153,9154,9155,0} - ,{10611,10366,10367,10368,10369,10370,10371,10372,10373,10608,10609,10610,10611,10612,10613,10614,10615,10850,10851,10852,10853,10854,10855,10856,10857,11092,11093,11094,11095,11096,11097,11098,11099,0} - ,{7691,7446,7447,7448,7449,7450,7451,7452,7453,7688,7689,7690,7691,7692,7693,7694,7695,7930,7931,7932,7933,7934,7935,7936,7937,8172,8173,8174,8175,8176,8177,8178,8179,0} - ,{11579,11334,11335,11336,11337,11338,11339,11340,11341,11576,11577,11578,11579,11580,11581,11582,11583,11818,11819,11820,11821,11822,11823,11824,11825,12060,12061,12062,12063,12064,12065,12066,12067,0} - ,{9635,9390,9391,9392,9393,9394,9395,9396,9397,9632,9633,9634,9635,9636,9637,9638,9639,9874,9875,9876,9877,9878,9879,9880,9881,10116,10117,10118,10119,10120,10121,10122,10123,0} - ,{8659,8414,8415,8416,8417,8418,8419,8420,8421,8656,8657,8658,8659,8660,8661,8662,8663,8898,8899,8900,8901,8902,8903,8904,8905,9140,9141,9142,9143,9144,9145,9146,9147,0} - ,{10603,10358,10359,10360,10361,10362,10363,10364,10365,10600,10601,10602,10603,10604,10605,10606,10607,10842,10843,10844,10845,10846,10847,10848,10849,11084,11085,11086,11087,11088,11089,11090,11091,0} - ,{9627,9382,9383,9384,9385,9386,9387,9388,9389,9624,9625,9626,9627,9628,9629,9630,9631,9866,9867,9868,9869,9870,9871,9872,9873,10108,10109,10110,10111,10112,10113,10114,10115,0} - ,{11571,11326,11327,11328,11329,11330,11331,11332,11333,11568,11569,11570,11571,11572,11573,11574,11575,11810,11811,11812,11813,11814,11815,11816,11817,12052,12053,12054,12055,12056,12057,12058,12059,0} - ,{8651,8406,8407,8408,8409,8410,8411,8412,8413,8648,8649,8650,8651,8652,8653,8654,8655,8890,8891,8892,8893,8894,8895,8896,8897,9132,9133,9134,9135,9136,9137,9138,9139,0} - ,{12539,12294,12295,12296,12297,12298,12299,12300,12301,12536,12537,12538,12539,12540,12541,12542,12543,12778,12779,12780,12781,12782,12783,12784,12785,13020,13021,13022,13023,13024,13025,13026,13027,0} - ,{10595,10350,10351,10352,10353,10354,10355,10356,10357,10592,10593,10594,10595,10596,10597,10598,10599,10834,10835,10836,10837,10838,10839,10840,10841,11076,11077,11078,11079,11080,11081,11082,11083,0} - ,{9619,9374,9375,9376,9377,9378,9379,9380,9381,9616,9617,9618,9619,9620,9621,9622,9623,9858,9859,9860,9861,9862,9863,9864,9865,10100,10101,10102,10103,10104,10105,10106,10107,0} - ,{11563,11318,11319,11320,11321,11322,11323,11324,11325,11560,11561,11562,11563,11564,11565,11566,11567,11802,11803,11804,11805,11806,11807,11808,11809,12044,12045,12046,12047,12048,12049,12050,12051,0} - ,{10587,10342,10343,10344,10345,10346,10347,10348,10349,10584,10585,10586,10587,10588,10589,10590,10591,10826,10827,10828,10829,10830,10831,10832,10833,11068,11069,11070,11071,11072,11073,11074,11075,0} - ,{12531,12286,12287,12288,12289,12290,12291,12292,12293,12528,12529,12530,12531,12532,12533,12534,12535,12770,12771,12772,12773,12774,12775,12776,12777,13012,13013,13014,13015,13016,13017,13018,13019,0} - ,{11555,11310,11311,11312,11313,11314,11315,11316,11317,11552,11553,11554,11555,11556,11557,11558,11559,11794,11795,11796,11797,11798,11799,11800,11801,12036,12037,12038,12039,12040,12041,12042,12043,0} - ,{10579,10334,10335,10336,10337,10338,10339,10340,10341,10576,10577,10578,10579,10580,10581,10582,10583,10818,10819,10820,10821,10822,10823,10824,10825,11060,11061,11062,11063,11064,11065,11066,11067,0} - ,{12523,12278,12279,12280,12281,12282,12283,12284,12285,12520,12521,12522,12523,12524,12525,12526,12527,12762,12763,12764,12765,12766,12767,12768,12769,13004,13005,13006,13007,13008,13009,13010,13011,0} - ,{11547,11302,11303,11304,11305,11306,11307,11308,11309,11544,11545,11546,11547,11548,11549,11550,11551,11786,11787,11788,11789,11790,11791,11792,11793,12028,12029,12030,12031,12032,12033,12034,12035,0} - ,{12515,12270,12271,12272,12273,12274,12275,12276,12277,12512,12513,12514,12515,12516,12517,12518,12519,12754,12755,12756,12757,12758,12759,12760,12761,12996,12997,12998,12999,13000,13001,13002,13003,0} - ,{11539,11294,11295,11296,11297,11298,11299,11300,11301,11536,11537,11538,11539,11540,11541,11542,11543,11778,11779,11780,11781,11782,11783,11784,11785,12020,12021,12022,12023,12024,12025,12026,12027,0} - ,{13483,13238,13239,13240,13241,13242,13243,13244,13245,13480,13481,13482,13483,13484,13485,13486,13487,13722,13723,13724,13725,13726,13727,13728,13729,13964,13965,13966,13967,13968,13969,13970,13971,0} - ,{12507,12262,12263,12264,12265,12266,12267,12268,12269,12504,12505,12506,12507,12508,12509,12510,12511,12746,12747,12748,12749,12750,12751,12752,12753,12988,12989,12990,12991,12992,12993,12994,12995,0} - ,{13475,13230,13231,13232,13233,13234,13235,13236,13237,13472,13473,13474,13475,13476,13477,13478,13479,13714,13715,13716,13717,13718,13719,13720,13721,13956,13957,13958,13959,13960,13961,13962,13963,0} - ,{12499,12254,12255,12256,12257,12258,12259,12260,12261,12496,12497,12498,12499,12500,12501,12502,12503,12738,12739,12740,12741,12742,12743,12744,12745,12980,12981,12982,12983,12984,12985,12986,12987,0} - ,{13467,13222,13223,13224,13225,13226,13227,13228,13229,13464,13465,13466,13467,13468,13469,13470,13471,13706,13707,13708,13709,13710,13711,13712,13713,13948,13949,13950,13951,13952,13953,13954,13955,0} - ,{14435,14190,14191,14192,14193,14194,14195,14196,14197,14432,14433,14434,14435,14436,14437,14438,14439,14674,14675,14676,14677,14678,14679,14680,14681,14916,14917,14918,14919,14920,14921,14922,14923,0} - ,{13459,13214,13215,13216,13217,13218,13219,13220,13221,13456,13457,13458,13459,13460,13461,13462,13463,13698,13699,13700,13701,13702,13703,13704,13705,13940,13941,13942,13943,13944,13945,13946,13947,0} - ,{14187,14186,14187,14188,14189,14428,14429,14430,14431,0} - ,{14671,14670,14671,14672,14673,14912,14913,14914,14915,0} - ,{15155,15154,15155,15156,15157,15396,15397,15398,15399,0} - ,{14183,14182,14183,14184,14185,14424,14425,14426,14427,0} - ,{14667,14666,14667,14668,14669,14908,14909,14910,14911,0} - ,{14179,14178,14179,14180,14181,14420,14421,14422,14423,0} - ,{15151,15150,15151,15152,15153,15392,15393,15394,15395,0} - ,{14663,14662,14663,14664,14665,14904,14905,14906,14907,0} - ,{15147,15146,15147,15148,15149,15388,15389,15390,15391,0} - ,{14659,14658,14659,14660,14661,14900,14901,14902,14903,0} - ,{15385,15142,15143,15144,15145,15386,15387,15628,15629,0} - ,{10879,10636,10637,10878,10879,11120,11121,11122,11123,0} - ,{15727,15484,15485,15726,15727,15968,15969,16210,16211,0} - ,{16695,16452,16453,16454,16694,16695,16936,16937,0} - ,{12577,12334,12335,12576,12577,12818,12819,13060,13061,0} - ,{14758,14514,14515,14756,14757,15000,15001,15242,15243,0} - ,{13787,13544,13545,13786,13787,14028,14029,14270,14271,0} - ,{15240,15238,15239,15240,15241,15480,15481,15482,15483,0} - ,{11604,11358,11359,11360,11361,11362,11363,11364,11365,11600,11601,11602,11603,11604,11605,11606,11607,11842,11843,11844,11845,11846,11847,11848,11849,12084,12085,12086,12087,12088,12089,12090,12091,0} - ,{10876,10874,10875,10876,10877,11116,11117,11118,11119,0} - ,{14755,14512,14513,14754,14755,14996,14997,14998,14999,0} - ,{15724,15722,15723,15724,15725,15964,15965,15966,15967,0} - ,{16208,16206,16207,16208,16209,16448,16449,16450,16451,0} - ,{16692,16690,16691,16692,16693,16932,16933,16934,16935,0} - ,{12572,12326,12327,12328,12329,12330,12331,12332,12333,12568,12569,12570,12571,12572,12573,12574,12575,12810,12811,12812,12813,12814,12815,12816,12817,13052,13053,13054,13055,13056,13057,13058,13059,0} - ,{13540,13294,13295,13296,13297,13298,13299,13300,13301,13536,13537,13538,13539,13540,13541,13542,13543,13778,13779,13780,13781,13782,13783,13784,13785,14020,14021,14022,14023,14024,14025,14026,14027,0} - ,{14508,14262,14263,14264,14265,14266,14267,14268,14269,14504,14505,14506,14507,14508,14509,14510,14511,14746,14747,14748,14749,14750,14751,14752,14753,14988,14989,14990,14991,14992,14993,14994,14995,0} - ,{15476,15230,15231,15232,15233,15234,15235,15236,15237,15472,15473,15474,15475,15476,15477,15478,15479,15714,15715,15716,15717,15718,15719,15720,15721,15956,15957,15958,15959,15960,15961,15962,15963,0} - ,{16444,16198,16199,16200,16201,16202,16203,16204,16205,16440,16441,16442,16443,16444,16445,16446,16447,16682,16683,16684,16685,16686,16687,16688,16689,16924,16925,16926,16927,16928,16929,16930,16931,0} - ,{11596,11350,11351,11352,11353,11354,11355,11356,11357,11592,11593,11594,11595,11596,11597,11598,11599,11834,11835,11836,11837,11838,11839,11840,11841,12076,12077,12078,12079,12080,12081,12082,12083,0} - ,{12564,12318,12319,12320,12321,12322,12323,12324,12325,12560,12561,12562,12563,12564,12565,12566,12567,12802,12803,12804,12805,12806,12807,12808,12809,13044,13045,13046,13047,13048,13049,13050,13051,0} - ,{13532,13286,13287,13288,13289,13290,13291,13292,13293,13528,13529,13530,13531,13532,13533,13534,13535,13770,13771,13772,13773,13774,13775,13776,13777,14012,14013,14014,14015,14016,14017,14018,14019,0} - ,{14500,14254,14255,14256,14257,14258,14259,14260,14261,14496,14497,14498,14499,14500,14501,14502,14503,14738,14739,14740,14741,14742,14743,14744,14745,14980,14981,14982,14983,14984,14985,14986,14987,0} - ,{15468,15222,15223,15224,15225,15226,15227,15228,15229,15464,15465,15466,15467,15468,15469,15470,15471,15706,15707,15708,15709,15710,15711,15712,15713,15948,15949,15950,15951,15952,15953,15954,15955,0} - ,{16436,16190,16191,16192,16193,16194,16195,16196,16197,16432,16433,16434,16435,16436,16437,16438,16439,16674,16675,16676,16677,16678,16679,16680,16681,16916,16917,16918,16919,16920,16921,16922,16923,0} - ,{12556,12310,12311,12312,12313,12314,12315,12316,12317,12552,12553,12554,12555,12556,12557,12558,12559,12794,12795,12796,12797,12798,12799,12800,12801,13036,13037,13038,13039,13040,13041,13042,13043,0} - ,{13524,13278,13279,13280,13281,13282,13283,13284,13285,13520,13521,13522,13523,13524,13525,13526,13527,13762,13763,13764,13765,13766,13767,13768,13769,14004,14005,14006,14007,14008,14009,14010,14011,0} - ,{14492,14246,14247,14248,14249,14250,14251,14252,14253,14488,14489,14490,14491,14492,14493,14494,14495,14730,14731,14732,14733,14734,14735,14736,14737,14972,14973,14974,14975,14976,14977,14978,14979,0} - ,{15460,15214,15215,15216,15217,15218,15219,15220,15221,15456,15457,15458,15459,15460,15461,15462,15463,15698,15699,15700,15701,15702,15703,15704,15705,15940,15941,15942,15943,15944,15945,15946,15947,0} - ,{16428,16182,16183,16184,16185,16186,16187,16188,16189,16424,16425,16426,16427,16428,16429,16430,16431,16666,16667,16668,16669,16670,16671,16672,16673,16908,16909,16910,16911,16912,16913,16914,16915,0} - ,{12547,12302,12303,12304,12305,12306,12307,12308,12309,12544,12545,12546,12547,12548,12549,12550,12551,12786,12787,12788,12789,12790,12791,12792,12793,13028,13029,13030,13031,13032,13033,13034,13035,0} - ,{13515,13270,13271,13272,13273,13274,13275,13276,13277,13512,13513,13514,13515,13516,13517,13518,13519,13754,13755,13756,13757,13758,13759,13760,13761,13996,13997,13998,13999,14000,14001,14002,14003,0} - ,{14483,14238,14239,14240,14241,14242,14243,14244,14245,14480,14481,14482,14483,14484,14485,14486,14487,14722,14723,14724,14725,14726,14727,14728,14729,14964,14965,14966,14967,14968,14969,14970,14971,0} - ,{15451,15206,15207,15208,15209,15210,15211,15212,15213,15448,15449,15450,15451,15452,15453,15454,15455,15690,15691,15692,15693,15694,15695,15696,15697,15932,15933,15934,15935,15936,15937,15938,15939,0} - ,{16419,16174,16175,16176,16177,16178,16179,16180,16181,16416,16417,16418,16419,16420,16421,16422,16423,16658,16659,16660,16661,16662,16663,16664,16665,16900,16901,16902,16903,16904,16905,16906,16907,0} - ,{13507,13262,13263,13264,13265,13266,13267,13268,13269,13504,13505,13506,13507,13508,13509,13510,13511,13746,13747,13748,13749,13750,13751,13752,13753,13988,13989,13990,13991,13992,13993,13994,13995,0} - ,{14475,14230,14231,14232,14233,14234,14235,14236,14237,14472,14473,14474,14475,14476,14477,14478,14479,14714,14715,14716,14717,14718,14719,14720,14721,14956,14957,14958,14959,14960,14961,14962,14963,0} - ,{15443,15198,15199,15200,15201,15202,15203,15204,15205,15440,15441,15442,15443,15444,15445,15446,15447,15682,15683,15684,15685,15686,15687,15688,15689,15924,15925,15926,15927,15928,15929,15930,15931,0} - ,{16411,16166,16167,16168,16169,16170,16171,16172,16173,16408,16409,16410,16411,16412,16413,16414,16415,16650,16651,16652,16653,16654,16655,16656,16657,16892,16893,16894,16895,16896,16897,16898,16899,0} - ,{13499,13254,13255,13256,13257,13258,13259,13260,13261,13496,13497,13498,13499,13500,13501,13502,13503,13738,13739,13740,13741,13742,13743,13744,13745,13980,13981,13982,13983,13984,13985,13986,13987,0} - ,{14467,14222,14223,14224,14225,14226,14227,14228,14229,14464,14465,14466,14467,14468,14469,14470,14471,14706,14707,14708,14709,14710,14711,14712,14713,14948,14949,14950,14951,14952,14953,14954,14955,0} - ,{15435,15190,15191,15192,15193,15194,15195,15196,15197,15432,15433,15434,15435,15436,15437,15438,15439,15674,15675,15676,15677,15678,15679,15680,15681,15916,15917,15918,15919,15920,15921,15922,15923,0} - ,{16403,16158,16159,16160,16161,16162,16163,16164,16165,16400,16401,16402,16403,16404,16405,16406,16407,16642,16643,16644,16645,16646,16647,16648,16649,16884,16885,16886,16887,16888,16889,16890,16891,0} - ,{13491,13246,13247,13248,13249,13250,13251,13252,13253,13488,13489,13490,13491,13492,13493,13494,13495,13730,13731,13732,13733,13734,13735,13736,13737,13972,13973,13974,13975,13976,13977,13978,13979,0} - ,{14459,14214,14215,14216,14217,14218,14219,14220,14221,14456,14457,14458,14459,14460,14461,14462,14463,14698,14699,14700,14701,14702,14703,14704,14705,14940,14941,14942,14943,14944,14945,14946,14947,0} - ,{15427,15182,15183,15184,15185,15186,15187,15188,15189,15424,15425,15426,15427,15428,15429,15430,15431,15666,15667,15668,15669,15670,15671,15672,15673,15908,15909,15910,15911,15912,15913,15914,15915,0} - ,{16395,16150,16151,16152,16153,16154,16155,16156,16157,16392,16393,16394,16395,16396,16397,16398,16399,16634,16635,16636,16637,16638,16639,16640,16641,16876,16877,16878,16879,16880,16881,16882,16883,0} - ,{14451,14206,14207,14208,14209,14210,14211,14212,14213,14448,14449,14450,14451,14452,14453,14454,14455,14690,14691,14692,14693,14694,14695,14696,14697,14932,14933,14934,14935,14936,14937,14938,14939,0} - ,{15419,15174,15175,15176,15177,15178,15179,15180,15181,15416,15417,15418,15419,15420,15421,15422,15423,15658,15659,15660,15661,15662,15663,15664,15665,15900,15901,15902,15903,15904,15905,15906,15907,0} - ,{16387,16142,16143,16144,16145,16146,16147,16148,16149,16384,16385,16386,16387,16388,16389,16390,16391,16626,16627,16628,16629,16630,16631,16632,16633,16868,16869,16870,16871,16872,16873,16874,16875,0} - ,{14443,14198,14199,14200,14201,14202,14203,14204,14205,14440,14441,14442,14443,14444,14445,14446,14447,14682,14683,14684,14685,14686,14687,14688,14689,14924,14925,14926,14927,14928,14929,14930,14931,0} - ,{15411,15166,15167,15168,15169,15170,15171,15172,15173,15408,15409,15410,15411,15412,15413,15414,15415,15650,15651,15652,15653,15654,15655,15656,15657,15892,15893,15894,15895,15896,15897,15898,15899,0} - ,{16379,16134,16135,16136,16137,16138,16139,16140,16141,16376,16377,16378,16379,16380,16381,16382,16383,16618,16619,16620,16621,16622,16623,16624,16625,16860,16861,16862,16863,16864,16865,16866,16867,0} - ,{15403,15158,15159,15160,15161,15162,15163,15164,15165,15400,15401,15402,15403,15404,15405,15406,15407,15642,15643,15644,15645,15646,15647,15648,15649,15884,15885,15886,15887,15888,15889,15890,15891,0} - ,{16371,16126,16127,16128,16129,16130,16131,16132,16133,16368,16369,16370,16371,16372,16373,16374,16375,16610,16611,16612,16613,16614,16615,16616,16617,16852,16853,16854,16855,16856,16857,16858,16859,0} - ,{15639,15638,15639,15640,15641,15880,15881,15882,15883,0} - ,{16123,16122,16123,16124,16125,16364,16365,16366,16367,0} - ,{16607,16606,16607,16608,16609,16848,16849,16850,16851,0} - ,{15635,15634,15635,15636,15637,15876,15877,15878,15879,0} - ,{16119,16118,16119,16120,16121,16360,16361,16362,16363,0} - ,{16603,16602,16603,16604,16605,16844,16845,16846,16847,0} - ,{15631,15630,15631,15632,15633,15872,15873,15874,15875,0} - ,{16115,16114,16115,16116,16117,16356,16357,16358,16359,0} - ,{16599,16598,16599,16600,16601,16840,16841,16842,16843,0} - }; - - static const unsigned short FCal_Bins_AC2[16*32][77] = { - {15692,15473,15474,15475,15476,15691,15692,15693,15694,15909,15910,15911,15912,0} - ,{15038,14819,14820,14821,14822,15037,15038,15039,15040,15255,15256,15257,15258,0} - ,{14384,14165,14166,14167,14168,14383,14384,14385,14386,14601,14602,14603,14604,0} - ,{18737,18081,18082,18083,18084,18085,18086,18087,18088,18299,18300,18301,18302,18303,18304,18305,18306,18517,18518,18519,18520,18521,18522,18523,18524,18735,18736,18737,18738,18739,18740,18953,18954,18955,18956,18957,18958,19171,19172,19173,19174,19389,19390,19391,19392,19607,19608,19825,19826,0} - ,{17430,16773,16774,16775,16776,16777,16778,16779,16780,16991,16992,16993,16994,16995,16996,16997,16998,17209,17210,17211,17212,17213,17214,17215,17216,17427,17428,17429,17430,17431,17432,17433,17434,17645,17646,17647,17648,17649,17650,17651,17652,17863,17864,17865,17866,17867,17868,17869,17870,0} - ,{16122,15465,15466,15467,15468,15469,15470,15471,15472,15683,15684,15685,15686,15687,15688,15689,15690,15901,15902,15903,15904,15905,15906,15907,15908,16119,16120,16121,16122,16123,16124,16125,16126,16337,16338,16339,16340,16341,16342,16343,16344,16555,16556,16557,16558,16559,16560,16561,16562,0} - ,{14814,14157,14158,14159,14160,14161,14162,14163,14164,14375,14376,14377,14378,14379,14380,14381,14382,14593,14594,14595,14596,14597,14598,14599,14600,14811,14812,14813,14814,14815,14816,14817,14818,15029,15030,15031,15032,15033,15034,15035,15036,15247,15248,15249,15250,15251,15252,15253,15254,0} - ,{18730,18073,18074,18075,18076,18077,18078,18079,18080,18291,18292,18293,18294,18295,18296,18297,18298,18509,18510,18511,18512,18513,18514,18515,18516,18727,18728,18729,18730,18731,18732,18733,18734,18945,18946,18947,18948,18949,18950,18951,18952,19163,19164,19165,19166,19167,19168,19169,19170,0} - ,{17422,16765,16766,16767,16768,16769,16770,16771,16772,16983,16984,16985,16986,16987,16988,16989,16990,17201,17202,17203,17204,17205,17206,17207,17208,17419,17420,17421,17422,17423,17424,17425,17426,17637,17638,17639,17640,17641,17642,17643,17644,17855,17856,17857,17858,17859,17860,17861,17862,0} - ,{16114,15457,15458,15459,15460,15461,15462,15463,15464,15675,15676,15677,15678,15679,15680,15681,15682,15893,15894,15895,15896,15897,15898,15899,15900,16111,16112,16113,16114,16115,16116,16117,16118,16329,16330,16331,16332,16333,16334,16335,16336,16547,16548,16549,16550,16551,16552,16553,16554,0} - ,{14806,14149,14150,14151,14152,14153,14154,14155,14156,14367,14368,14369,14370,14371,14372,14373,14374,14585,14586,14587,14588,14589,14590,14591,14592,14803,14804,14805,14806,14807,14808,14809,14810,15021,15022,15023,15024,15025,15026,15027,15028,15239,15240,15241,15242,15243,15244,15245,15246,0} - ,{17414,16757,16758,16759,16760,16761,16762,16763,16764,16975,16976,16977,16978,16979,16980,16981,16982,17193,17194,17195,17196,17197,17198,17199,17200,17411,17412,17413,17414,17415,17416,17417,17418,17629,17630,17631,17632,17633,17634,17635,17636,17847,17848,17849,17850,17851,17852,17853,17854,0} - ,{16106,15449,15450,15451,15452,15453,15454,15455,15456,15667,15668,15669,15670,15671,15672,15673,15674,15885,15886,15887,15888,15889,15890,15891,15892,16103,16104,16105,16106,16107,16108,16109,16110,16321,16322,16323,16324,16325,16326,16327,16328,16539,16540,16541,16542,16543,16544,16545,16546,0} - ,{14798,14141,14142,14143,14144,14145,14146,14147,14148,14359,14360,14361,14362,14363,14364,14365,14366,14577,14578,14579,14580,14581,14582,14583,14584,14795,14796,14797,14798,14799,14800,14801,14802,15013,15014,15015,15016,15017,15018,15019,15020,15231,15232,15233,15234,15235,15236,15237,15238,0} - ,{17406,16749,16750,16751,16752,16753,16754,16755,16756,16967,16968,16969,16970,16971,16972,16973,16974,17185,17186,17187,17188,17189,17190,17191,17192,17403,17404,17405,17406,17407,17408,17409,17410,17621,17622,17623,17624,17625,17626,17627,17628,17839,17840,17841,17842,17843,17844,17845,17846,0} - ,{16098,15441,15442,15443,15444,15445,15446,15447,15448,15659,15660,15661,15662,15663,15664,15665,15666,15877,15878,15879,15880,15881,15882,15883,15884,16095,16096,16097,16098,16099,16100,16101,16102,16313,16314,16315,16316,16317,16318,16319,16320,16531,16532,16533,16534,16535,16536,16537,16538,0} - ,{14790,14133,14134,14135,14136,14137,14138,14139,14140,14351,14352,14353,14354,14355,14356,14357,14358,14569,14570,14571,14572,14573,14574,14575,14576,14787,14788,14789,14790,14791,14792,14793,14794,15005,15006,15007,15008,15009,15010,15011,15012,15223,15224,15225,15226,15227,15228,15229,15230,0} - ,{17398,16741,16742,16743,16744,16745,16746,16747,16748,16959,16960,16961,16962,16963,16964,16965,16966,17177,17178,17179,17180,17181,17182,17183,17184,17395,17396,17397,17398,17399,17400,17401,17402,17613,17614,17615,17616,17617,17618,17619,17620,17831,17832,17833,17834,17835,17836,17837,17838,0} - ,{16090,15433,15434,15435,15436,15437,15438,15439,15440,15651,15652,15653,15654,15655,15656,15657,15658,15869,15870,15871,15872,15873,15874,15875,15876,16087,16088,16089,16090,16091,16092,16093,16094,16305,16306,16307,16308,16309,16310,16311,16312,16523,16524,16525,16526,16527,16528,16529,16530,0} - ,{14782,14125,14126,14127,14128,14129,14130,14131,14132,14343,14344,14345,14346,14347,14348,14349,14350,14561,14562,14563,14564,14565,14566,14567,14568,14779,14780,14781,14782,14783,14784,14785,14786,14997,14998,14999,15000,15001,15002,15003,15004,15215,15216,15217,15218,15219,15220,15221,15222,0} - ,{16082,15425,15426,15427,15428,15429,15430,15431,15432,15643,15644,15645,15646,15647,15648,15649,15650,15861,15862,15863,15864,15865,15866,15867,15868,16079,16080,16081,16082,16083,16084,16085,16086,16297,16298,16299,16300,16301,16302,16303,16304,16515,16516,16517,16518,16519,16520,16521,16522,0} - ,{14774,14117,14118,14119,14120,14121,14122,14123,14124,14335,14336,14337,14338,14339,14340,14341,14342,14553,14554,14555,14556,14557,14558,14559,14560,14771,14772,14773,14774,14775,14776,14777,14778,14989,14990,14991,14992,14993,14994,14995,14996,15207,15208,15209,15210,15211,15212,15213,15214,0} - ,{16074,15417,15418,15419,15420,15421,15422,15423,15424,15635,15636,15637,15638,15639,15640,15641,15642,15853,15854,15855,15856,15857,15858,15859,15860,16071,16072,16073,16074,16075,16076,16077,16078,16289,16290,16291,16292,16293,16294,16295,16296,16507,16508,16509,16510,16511,16512,16513,16514,0} - ,{14766,14109,14110,14111,14112,14113,14114,14115,14116,14327,14328,14329,14330,14331,14332,14333,14334,14545,14546,14547,14548,14549,14550,14551,14552,14763,14764,14765,14766,14767,14768,14769,14770,14981,14982,14983,14984,14985,14986,14987,14988,15199,15200,15201,15202,15203,15204,15205,15206,0} - ,{16066,15409,15410,15411,15412,15413,15414,15415,15416,15627,15628,15629,15630,15631,15632,15633,15634,15845,15846,15847,15848,15849,15850,15851,15852,16063,16064,16065,16066,16067,16068,16069,16070,16281,16282,16283,16284,16285,16286,16287,16288,16499,16500,16501,16502,16503,16504,16505,16506,0} - ,{14758,14101,14102,14103,14104,14105,14106,14107,14108,14319,14320,14321,14322,14323,14324,14325,14326,14537,14538,14539,14540,14541,14542,14543,14544,14755,14756,14757,14758,14759,14760,14761,14762,14973,14974,14975,14976,14977,14978,14979,14980,15191,15192,15193,15194,15195,15196,15197,15198,0} - ,{14750,14093,14094,14095,14096,14097,14098,14099,14100,14311,14312,14313,14314,14315,14316,14317,14318,14529,14530,14531,14532,14533,14534,14535,14536,14747,14748,14749,14750,14751,14752,14753,14754,14965,14966,14967,14968,14969,14970,14971,14972,15183,15184,15185,15186,15187,15188,15189,15190,0} - ,{14742,14085,14086,14087,14088,14089,14090,14091,14092,14303,14304,14305,14306,14307,14308,14309,14310,14521,14522,14523,14524,14525,14526,14527,14528,14739,14740,14741,14742,14743,14744,14745,14746,14957,14958,14959,14960,14961,14962,14963,14964,15175,15176,15177,15178,15179,15180,15181,15182,0} - ,{14955,14735,14736,14737,14738,14953,14954,14955,14956,15171,15172,15173,15174,0} - ,{14300,14081,14082,14083,14084,14299,14300,14301,14302,14517,14518,14519,14520,0} - ,{0} - ,{0} - ,{23511,23291,23292,23293,23294,23295,23296,23509,23510,23511,23512,23729,23730,0} - ,{22644,22425,22426,22427,22428,22643,22644,22645,22646,22861,22862,22863,22864,0} - ,{20909,20689,20690,20691,20692,20693,20694,20695,20696,20907,20908,20909,20910,0} - ,{22209,21989,21990,21991,21992,21993,21994,22207,22208,22209,22210,22211,22212,0} - ,{20038,19381,19382,19383,19384,19385,19386,19387,19388,19599,19600,19601,19602,19603,19604,19605,19606,19817,19818,19819,19820,19821,19822,19823,19824,20035,20036,20037,20038,20039,20040,20041,20042,20253,20254,20255,20256,20257,20258,20259,20260,20471,20472,20473,20474,20475,20476,20477,20478,0} - ,{22638,21981,21982,21983,21984,21985,21986,21987,21988,22199,22200,22201,22202,22203,22204,22205,22206,22417,22418,22419,22420,22421,22422,22423,22424,22635,22636,22637,22638,22639,22640,22641,22642,22853,22854,22855,22856,22857,22858,22859,22860,23071,23072,23073,23074,23075,23076,23077,23078,0} - ,{21338,20681,20682,20683,20684,20685,20686,20687,20688,20899,20900,20901,20902,20903,20904,20905,20906,21117,21118,21119,21120,21121,21122,21123,21124,21125,21126,21335,21336,21337,21338,21339,21340,21341,21342,21553,21554,21555,21556,21557,21558,21559,21560,21771,21772,21773,21774,21775,21776,0} - ,{20030,19373,19374,19375,19376,19377,19378,19379,19380,19591,19592,19593,19594,19595,19596,19597,19598,19809,19810,19811,19812,19813,19814,19815,19816,20027,20028,20029,20030,20031,20032,20033,20034,20245,20246,20247,20248,20249,20250,20251,20252,20463,20464,20465,20466,20467,20468,20469,20470,0} - ,{22630,21973,21974,21975,21976,21977,21978,21979,21980,22191,22192,22193,22194,22195,22196,22197,22198,22409,22410,22411,22412,22413,22414,22415,22416,22627,22628,22629,22630,22631,22632,22633,22634,22845,22846,22847,22848,22849,22850,22851,22852,23063,23064,23065,23066,23067,23068,23069,23070,0} - ,{21330,20673,20674,20675,20676,20677,20678,20679,20680,20891,20892,20893,20894,20895,20896,20897,20898,21109,21110,21111,21112,21113,21114,21115,21116,21327,21328,21329,21330,21331,21332,21333,21334,21545,21546,21547,21548,21549,21550,21551,21552,21763,21764,21765,21766,21767,21768,21769,21770,0} - ,{18722,18065,18066,18067,18068,18069,18070,18071,18072,18283,18284,18285,18286,18287,18288,18289,18290,18501,18502,18503,18504,18505,18506,18507,18508,18719,18720,18721,18722,18723,18724,18725,18726,18937,18938,18939,18940,18941,18942,18943,18944,19155,19156,19157,19158,19159,19160,19161,19162,0} - ,{20022,19365,19366,19367,19368,19369,19370,19371,19372,19583,19584,19585,19586,19587,19588,19589,19590,19801,19802,19803,19804,19805,19806,19807,19808,20019,20020,20021,20022,20023,20024,20025,20026,20237,20238,20239,20240,20241,20242,20243,20244,20455,20456,20457,20458,20459,20460,20461,20462,0} - ,{21322,20665,20666,20667,20668,20669,20670,20671,20672,20883,20884,20885,20886,20887,20888,20889,20890,21101,21102,21103,21104,21105,21106,21107,21108,21319,21320,21321,21322,21323,21324,21325,21326,21537,21538,21539,21540,21541,21542,21543,21544,21755,21756,21757,21758,21759,21760,21761,21762,0} - ,{18714,18057,18058,18059,18060,18061,18062,18063,18064,18275,18276,18277,18278,18279,18280,18281,18282,18493,18494,18495,18496,18497,18498,18499,18500,18711,18712,18713,18714,18715,18716,18717,18718,18929,18930,18931,18932,18933,18934,18935,18936,19147,19148,19149,19150,19151,19152,19153,19154,0} - ,{21314,20657,20658,20659,20660,20661,20662,20663,20664,20875,20876,20877,20878,20879,20880,20881,20882,21093,21094,21095,21096,21097,21098,21099,21100,21311,21312,21313,21314,21315,21316,21317,21318,21529,21530,21531,21532,21533,21534,21535,21536,21747,21748,21749,21750,21751,21752,21753,21754,0} - ,{20014,19357,19358,19359,19360,19361,19362,19363,19364,19575,19576,19577,19578,19579,19580,19581,19582,19793,19794,19795,19796,19797,19798,19799,19800,20011,20012,20013,20014,20015,20016,20017,20018,20229,20230,20231,20232,20233,20234,20235,20236,20447,20448,20449,20450,20451,20452,20453,20454,0} - ,{18706,18049,18050,18051,18052,18053,18054,18055,18056,18267,18268,18269,18270,18271,18272,18273,18274,18485,18486,18487,18488,18489,18490,18491,18492,18703,18704,18705,18706,18707,18708,18709,18710,18921,18922,18923,18924,18925,18926,18927,18928,19139,19140,19141,19142,19143,19144,19145,19146,0} - ,{20006,19349,19350,19351,19352,19353,19354,19355,19356,19567,19568,19569,19570,19571,19572,19573,19574,19785,19786,19787,19788,19789,19790,19791,19792,20003,20004,20005,20006,20007,20008,20009,20010,20221,20222,20223,20224,20225,20226,20227,20228,20439,20440,20441,20442,20443,20444,20445,20446,0} - ,{18698,18041,18042,18043,18044,18045,18046,18047,18048,18259,18260,18261,18262,18263,18264,18265,18266,18477,18478,18479,18480,18481,18482,18483,18484,18695,18696,18697,18698,18699,18700,18701,18702,18913,18914,18915,18916,18917,18918,18919,18920,19131,19132,19133,19134,19135,19136,19137,19138,0} - ,{19998,19341,19342,19343,19344,19345,19346,19347,19348,19559,19560,19561,19562,19563,19564,19565,19566,19777,19778,19779,19780,19781,19782,19783,19784,19995,19996,19997,19998,19999,20000,20001,20002,20213,20214,20215,20216,20217,20218,20219,20220,20431,20432,20433,20434,20435,20436,20437,20438,0} - ,{17390,16733,16734,16735,16736,16737,16738,16739,16740,16951,16952,16953,16954,16955,16956,16957,16958,17169,17170,17171,17172,17173,17174,17175,17176,17387,17388,17389,17390,17391,17392,17393,17394,17605,17606,17607,17608,17609,17610,17611,17612,17823,17824,17825,17826,17827,17828,17829,17830,0} - ,{18690,18033,18034,18035,18036,18037,18038,18039,18040,18251,18252,18253,18254,18255,18256,18257,18258,18469,18470,18471,18472,18473,18474,18475,18476,18687,18688,18689,18690,18691,18692,18693,18694,18905,18906,18907,18908,18909,18910,18911,18912,19123,19124,19125,19126,19127,19128,19129,19130,0} - ,{17382,16725,16726,16727,16728,16729,16730,16731,16732,16943,16944,16945,16946,16947,16948,16949,16950,17161,17162,17163,17164,17165,17166,17167,17168,17379,17380,17381,17382,17383,17384,17385,17386,17597,17598,17599,17600,17601,17602,17603,17604,17815,17816,17817,17818,17819,17820,17821,17822,0} - ,{18682,18025,18026,18027,18028,18029,18030,18031,18032,18243,18244,18245,18246,18247,18248,18249,18250,18461,18462,18463,18464,18465,18466,18467,18468,18679,18680,18681,18682,18683,18684,18685,18686,18897,18898,18899,18900,18901,18902,18903,18904,19115,19116,19117,19118,19119,19120,19121,19122,0} - ,{17374,16717,16718,16719,16720,16721,16722,16723,16724,16935,16936,16937,16938,16939,16940,16941,16942,17153,17154,17155,17156,17157,17158,17159,17160,17371,17372,17373,17374,17375,17376,17377,17378,17589,17590,17591,17592,17593,17594,17595,17596,17807,17808,17809,17810,17811,17812,17813,17814,0} - ,{17366,16709,16710,16711,16712,16713,16714,16715,16716,16927,16928,16929,16930,16931,16932,16933,16934,17145,17146,17147,17148,17149,17150,17151,17152,17363,17364,17365,17366,17367,17368,17369,17370,17581,17582,17583,17584,17585,17586,17587,17588,17799,17800,17801,17802,17803,17804,17805,17806,0} - ,{16058,15401,15402,15403,15404,15405,15406,15407,15408,15619,15620,15621,15622,15623,15624,15625,15626,15837,15838,15839,15840,15841,15842,15843,15844,16055,16056,16057,16058,16059,16060,16061,16062,16273,16274,16275,16276,16277,16278,16279,16280,16491,16492,16493,16494,16495,16496,16497,16498,0} - ,{17358,16701,16702,16703,16704,16705,16706,16707,16708,16919,16920,16921,16922,16923,16924,16925,16926,17137,17138,17139,17140,17141,17142,17143,17144,17355,17356,17357,17358,17359,17360,17361,17362,17573,17574,17575,17576,17577,17578,17579,17580,17791,17792,17793,17794,17795,17796,17797,17798,0} - ,{16050,15393,15394,15395,15396,15397,15398,15399,15400,15611,15612,15613,15614,15615,15616,15617,15618,15829,15830,15831,15832,15833,15834,15835,15836,16047,16048,16049,16050,16051,16052,16053,16054,16265,16266,16267,16268,16269,16270,16271,16272,16483,16484,16485,16486,16487,16488,16489,16490,0} - ,{16263,16043,16044,16045,16046,16261,16262,16263,16264,16479,16480,16481,16482,0} - ,{15608,15389,15390,15391,15392,15607,15608,15609,15610,15825,15826,15827,15828,0} - ,{15605,15169,15170,15387,15388,15603,15604,15605,15606,15821,15822,15823,15824,0} - ,{24161,23727,23728,23941,23942,23943,23944,24159,24160,24161,24162,24377,24378,0} - ,{26101,25667,25668,25881,25882,25883,25884,25885,25886,26099,26100,26101,26102,0} - ,{26314,25879,25880,26095,26096,26097,26098,26313,26314,26315,26316,26529,26530,0} - ,{24807,24587,24588,24589,24590,24591,24592,24593,24594,24803,24804,24805,24806,0} - ,{26093,25873,25874,25875,25876,25877,25878,26091,26092,26093,26094,26311,26312,0} - ,{24801,24581,24582,24583,24584,24585,24586,24799,24800,24801,24802,25019,25020,0} - ,{23721,23281,23282,23283,23284,23285,23286,23287,23288,23289,23290,23499,23500,23501,23502,23503,23504,23505,23506,23507,23508,23717,23718,23719,23720,23721,23722,23723,23724,23725,23726,23935,23936,23937,23938,23939,23940,24153,24154,24155,24156,24157,24158,24371,24372,24373,24374,24375,24376,0} - ,{25231,24573,24574,24575,24576,24577,24578,24579,24580,24791,24792,24793,24794,24795,24796,24797,24798,25009,25010,25011,25012,25013,25014,25015,25016,25017,25018,25227,25228,25229,25230,25231,25232,25233,25234,25235,25236,25445,25446,25447,25448,25449,25450,25451,25452,25663,25664,25665,25666,0} - ,{25222,24565,24566,24567,24568,24569,24570,24571,24572,24783,24784,24785,24786,24787,24788,24789,24790,25001,25002,25003,25004,25005,25006,25007,25008,25219,25220,25221,25222,25223,25224,25225,25226,25437,25438,25439,25440,25441,25442,25443,25444,25655,25656,25657,25658,25659,25660,25661,25662,0} - ,{23930,23273,23274,23275,23276,23277,23278,23279,23280,23491,23492,23493,23494,23495,23496,23497,23498,23709,23710,23711,23712,23713,23714,23715,23716,23927,23928,23929,23930,23931,23932,23933,23934,24145,24146,24147,24148,24149,24150,24151,24152,24363,24364,24365,24366,24367,24368,24369,24370,0} - ,{23922,23265,23266,23267,23268,23269,23270,23271,23272,23483,23484,23485,23486,23487,23488,23489,23490,23701,23702,23703,23704,23705,23706,23707,23708,23919,23920,23921,23922,23923,23924,23925,23926,24137,24138,24139,24140,24141,24142,24143,24144,24355,24356,24357,24358,24359,24360,24361,24362,0} - ,{22622,21965,21966,21967,21968,21969,21970,21971,21972,22183,22184,22185,22186,22187,22188,22189,22190,22401,22402,22403,22404,22405,22406,22407,22408,22619,22620,22621,22622,22623,22624,22625,22626,22837,22838,22839,22840,22841,22842,22843,22844,23055,23056,23057,23058,23059,23060,23061,23062,0} - ,{23914,23257,23258,23259,23260,23261,23262,23263,23264,23475,23476,23477,23478,23479,23480,23481,23482,23693,23694,23695,23696,23697,23698,23699,23700,23911,23912,23913,23914,23915,23916,23917,23918,24129,24130,24131,24132,24133,24134,24135,24136,24347,24348,24349,24350,24351,24352,24353,24354,0} - ,{23906,23249,23250,23251,23252,23253,23254,23255,23256,23467,23468,23469,23470,23471,23472,23473,23474,23685,23686,23687,23688,23689,23690,23691,23692,23903,23904,23905,23906,23907,23908,23909,23910,24121,24122,24123,24124,24125,24126,24127,24128,24339,24340,24341,24342,24343,24344,24345,24346,0} - ,{22614,21957,21958,21959,21960,21961,21962,21963,21964,22175,22176,22177,22178,22179,22180,22181,22182,22393,22394,22395,22396,22397,22398,22399,22400,22611,22612,22613,22614,22615,22616,22617,22618,22829,22830,22831,22832,22833,22834,22835,22836,23047,23048,23049,23050,23051,23052,23053,23054,0} - ,{22606,21949,21950,21951,21952,21953,21954,21955,21956,22167,22168,22169,22170,22171,22172,22173,22174,22385,22386,22387,22388,22389,22390,22391,22392,22603,22604,22605,22606,22607,22608,22609,22610,22821,22822,22823,22824,22825,22826,22827,22828,23039,23040,23041,23042,23043,23044,23045,23046,0} - ,{21306,20649,20650,20651,20652,20653,20654,20655,20656,20867,20868,20869,20870,20871,20872,20873,20874,21085,21086,21087,21088,21089,21090,21091,21092,21303,21304,21305,21306,21307,21308,21309,21310,21521,21522,21523,21524,21525,21526,21527,21528,21739,21740,21741,21742,21743,21744,21745,21746,0} - ,{22598,21941,21942,21943,21944,21945,21946,21947,21948,22159,22160,22161,22162,22163,22164,22165,22166,22377,22378,22379,22380,22381,22382,22383,22384,22595,22596,22597,22598,22599,22600,22601,22602,22813,22814,22815,22816,22817,22818,22819,22820,23031,23032,23033,23034,23035,23036,23037,23038,0} - ,{21298,20641,20642,20643,20644,20645,20646,20647,20648,20859,20860,20861,20862,20863,20864,20865,20866,21077,21078,21079,21080,21081,21082,21083,21084,21295,21296,21297,21298,21299,21300,21301,21302,21513,21514,21515,21516,21517,21518,21519,21520,21731,21732,21733,21734,21735,21736,21737,21738,0} - ,{21290,20633,20634,20635,20636,20637,20638,20639,20640,20851,20852,20853,20854,20855,20856,20857,20858,21069,21070,21071,21072,21073,21074,21075,21076,21287,21288,21289,21290,21291,21292,21293,21294,21505,21506,21507,21508,21509,21510,21511,21512,21723,21724,21725,21726,21727,21728,21729,21730,0} - ,{19990,19333,19334,19335,19336,19337,19338,19339,19340,19551,19552,19553,19554,19555,19556,19557,19558,19769,19770,19771,19772,19773,19774,19775,19776,19987,19988,19989,19990,19991,19992,19993,19994,20205,20206,20207,20208,20209,20210,20211,20212,20423,20424,20425,20426,20427,20428,20429,20430,0} - ,{21282,20625,20626,20627,20628,20629,20630,20631,20632,20843,20844,20845,20846,20847,20848,20849,20850,21061,21062,21063,21064,21065,21066,21067,21068,21279,21280,21281,21282,21283,21284,21285,21286,21497,21498,21499,21500,21501,21502,21503,21504,21715,21716,21717,21718,21719,21720,21721,21722,0} - ,{19982,19325,19326,19327,19328,19329,19330,19331,19332,19543,19544,19545,19546,19547,19548,19549,19550,19761,19762,19763,19764,19765,19766,19767,19768,19979,19980,19981,19982,19983,19984,19985,19986,20197,20198,20199,20200,20201,20202,20203,20204,20415,20416,20417,20418,20419,20420,20421,20422,0} - ,{19974,19317,19318,19319,19320,19321,19322,19323,19324,19535,19536,19537,19538,19539,19540,19541,19542,19753,19754,19755,19756,19757,19758,19759,19760,19971,19972,19973,19974,19975,19976,19977,19978,20189,20190,20191,20192,20193,20194,20195,20196,20407,20408,20409,20410,20411,20412,20413,20414,0} - ,{18674,18017,18018,18019,18020,18021,18022,18023,18024,18235,18236,18237,18238,18239,18240,18241,18242,18453,18454,18455,18456,18457,18458,18459,18460,18671,18672,18673,18674,18675,18676,18677,18678,18889,18890,18891,18892,18893,18894,18895,18896,19107,19108,19109,19110,19111,19112,19113,19114,0} - ,{18666,18009,18010,18011,18012,18013,18014,18015,18016,18227,18228,18229,18230,18231,18232,18233,18234,18445,18446,18447,18448,18449,18450,18451,18452,18663,18664,18665,18666,18667,18668,18669,18670,18881,18882,18883,18884,18885,18886,18887,18888,19099,19100,19101,19102,19103,19104,19105,19106,0} - ,{18658,18001,18002,18003,18004,18005,18006,18007,18008,18219,18220,18221,18222,18223,18224,18225,18226,18437,18438,18439,18440,18441,18442,18443,18444,18655,18656,18657,18658,18659,18660,18661,18662,18873,18874,18875,18876,18877,18878,18879,18880,19091,19092,19093,19094,19095,19096,19097,19098,0} - ,{17350,16693,16694,16695,16696,16697,16698,16699,16700,16911,16912,16913,16914,16915,16916,16917,16918,17129,17130,17131,17132,17133,17134,17135,17136,17347,17348,17349,17350,17351,17352,17353,17354,17565,17566,17567,17568,17569,17570,17571,17572,17783,17784,17785,17786,17787,17788,17789,17790,0} - ,{17342,16685,16686,16687,16688,16689,16690,16691,16692,16903,16904,16905,16906,16907,16908,16909,16910,17121,17122,17123,17124,17125,17126,17127,17128,17339,17340,17341,17342,17343,17344,17345,17346,17557,17558,17559,17560,17561,17562,17563,17564,17775,17776,17777,17778,17779,17780,17781,17782,0} - ,{16259,16039,16040,16041,16042,16257,16258,16259,16260,16475,16476,16477,16478,0} - ,{16255,15819,15820,16035,16036,16037,16038,16255,16256,16471,16472,16473,16474,0} - ,{16468,16251,16252,16253,16254,16463,16464,16465,16466,16467,16468,16469,16470,0} - ,{27367,27141,27142,27143,27144,27145,27146,27147,27148,27149,27150,27151,27152,27153,27154,27155,27156,27157,27158,27159,27160,27359,27360,27361,27362,27363,27364,27365,27366,27367,27368,27369,27370,27371,27372,27577,27578,27579,27580,27581,27582,27583,27584,27585,27586,27587,27588,27589,27590,0} - ,{26523,25865,25866,25867,25868,25869,25870,25871,25872,26083,26084,26085,26086,26087,26088,26089,26090,26301,26302,26303,26304,26305,26306,26307,26308,26309,26310,26519,26520,26521,26522,26523,26524,26525,26526,26527,26528,26737,26738,26739,26740,26741,26742,26743,26744,26955,26956,26957,26958,0} - ,{26514,25857,25858,25859,25860,25861,25862,25863,25864,26075,26076,26077,26078,26079,26080,26081,26082,26293,26294,26295,26296,26297,26298,26299,26300,26511,26512,26513,26514,26515,26516,26517,26518,26729,26730,26731,26732,26733,26734,26735,26736,26947,26948,26949,26950,26951,26952,26953,26954,0} - ,{26506,25849,25850,25851,25852,25853,25854,25855,25856,26067,26068,26069,26070,26071,26072,26073,26074,26285,26286,26287,26288,26289,26290,26291,26292,26503,26504,26505,26506,26507,26508,26509,26510,26721,26722,26723,26724,26725,26726,26727,26728,26939,26940,26941,26942,26943,26944,26945,26946,0} - ,{26498,25841,25842,25843,25844,25845,25846,25847,25848,26059,26060,26061,26062,26063,26064,26065,26066,26277,26278,26279,26280,26281,26282,26283,26284,26495,26496,26497,26498,26499,26500,26501,26502,26713,26714,26715,26716,26717,26718,26719,26720,26931,26932,26933,26934,26935,26936,26937,26938,0} - ,{26490,25833,25834,25835,25836,25837,25838,25839,25840,26051,26052,26053,26054,26055,26056,26057,26058,26269,26270,26271,26272,26273,26274,26275,26276,26487,26488,26489,26490,26491,26492,26493,26494,26705,26706,26707,26708,26709,26710,26711,26712,26923,26924,26925,26926,26927,26928,26929,26930,0} - ,{25214,24557,24558,24559,24560,24561,24562,24563,24564,24775,24776,24777,24778,24779,24780,24781,24782,24993,24994,24995,24996,24997,24998,24999,25000,25211,25212,25213,25214,25215,25216,25217,25218,25429,25430,25431,25432,25433,25434,25435,25436,25647,25648,25649,25650,25651,25652,25653,25654,0} - ,{25206,24549,24550,24551,24552,24553,24554,24555,24556,24767,24768,24769,24770,24771,24772,24773,24774,24985,24986,24987,24988,24989,24990,24991,24992,25203,25204,25205,25206,25207,25208,25209,25210,25421,25422,25423,25424,25425,25426,25427,25428,25639,25640,25641,25642,25643,25644,25645,25646,0} - ,{25198,24541,24542,24543,24544,24545,24546,24547,24548,24759,24760,24761,24762,24763,24764,24765,24766,24977,24978,24979,24980,24981,24982,24983,24984,25195,25196,25197,25198,25199,25200,25201,25202,25413,25414,25415,25416,25417,25418,25419,25420,25631,25632,25633,25634,25635,25636,25637,25638,0} - ,{25190,24533,24534,24535,24536,24537,24538,24539,24540,24751,24752,24753,24754,24755,24756,24757,24758,24969,24970,24971,24972,24973,24974,24975,24976,25187,25188,25189,25190,25191,25192,25193,25194,25405,25406,25407,25408,25409,25410,25411,25412,25623,25624,25625,25626,25627,25628,25629,25630,0} - ,{25182,24525,24526,24527,24528,24529,24530,24531,24532,24743,24744,24745,24746,24747,24748,24749,24750,24961,24962,24963,24964,24965,24966,24967,24968,25179,25180,25181,25182,25183,25184,25185,25186,25397,25398,25399,25400,25401,25402,25403,25404,25615,25616,25617,25618,25619,25620,25621,25622,0} - ,{23898,23241,23242,23243,23244,23245,23246,23247,23248,23459,23460,23461,23462,23463,23464,23465,23466,23677,23678,23679,23680,23681,23682,23683,23684,23895,23896,23897,23898,23899,23900,23901,23902,24113,24114,24115,24116,24117,24118,24119,24120,24331,24332,24333,24334,24335,24336,24337,24338,0} - ,{23890,23233,23234,23235,23236,23237,23238,23239,23240,23451,23452,23453,23454,23455,23456,23457,23458,23669,23670,23671,23672,23673,23674,23675,23676,23887,23888,23889,23890,23891,23892,23893,23894,24105,24106,24107,24108,24109,24110,24111,24112,24323,24324,24325,24326,24327,24328,24329,24330,0} - ,{23882,23225,23226,23227,23228,23229,23230,23231,23232,23443,23444,23445,23446,23447,23448,23449,23450,23661,23662,23663,23664,23665,23666,23667,23668,23879,23880,23881,23882,23883,23884,23885,23886,24097,24098,24099,24100,24101,24102,24103,24104,24315,24316,24317,24318,24319,24320,24321,24322,0} - ,{23874,23217,23218,23219,23220,23221,23222,23223,23224,23435,23436,23437,23438,23439,23440,23441,23442,23653,23654,23655,23656,23657,23658,23659,23660,23871,23872,23873,23874,23875,23876,23877,23878,24089,24090,24091,24092,24093,24094,24095,24096,24307,24308,24309,24310,24311,24312,24313,24314,0} - ,{22590,21933,21934,21935,21936,21937,21938,21939,21940,22151,22152,22153,22154,22155,22156,22157,22158,22369,22370,22371,22372,22373,22374,22375,22376,22587,22588,22589,22590,22591,22592,22593,22594,22805,22806,22807,22808,22809,22810,22811,22812,23023,23024,23025,23026,23027,23028,23029,23030,0} - ,{22582,21925,21926,21927,21928,21929,21930,21931,21932,22143,22144,22145,22146,22147,22148,22149,22150,22361,22362,22363,22364,22365,22366,22367,22368,22579,22580,22581,22582,22583,22584,22585,22586,22797,22798,22799,22800,22801,22802,22803,22804,23015,23016,23017,23018,23019,23020,23021,23022,0} - ,{22574,21917,21918,21919,21920,21921,21922,21923,21924,22135,22136,22137,22138,22139,22140,22141,22142,22353,22354,22355,22356,22357,22358,22359,22360,22571,22572,22573,22574,22575,22576,22577,22578,22789,22790,22791,22792,22793,22794,22795,22796,23007,23008,23009,23010,23011,23012,23013,23014,0} - ,{22566,21909,21910,21911,21912,21913,21914,21915,21916,22127,22128,22129,22130,22131,22132,22133,22134,22345,22346,22347,22348,22349,22350,22351,22352,22563,22564,22565,22566,22567,22568,22569,22570,22781,22782,22783,22784,22785,22786,22787,22788,22999,23000,23001,23002,23003,23004,23005,23006,0} - ,{21274,20617,20618,20619,20620,20621,20622,20623,20624,20835,20836,20837,20838,20839,20840,20841,20842,21053,21054,21055,21056,21057,21058,21059,21060,21271,21272,21273,21274,21275,21276,21277,21278,21489,21490,21491,21492,21493,21494,21495,21496,21707,21708,21709,21710,21711,21712,21713,21714,0} - ,{21266,20609,20610,20611,20612,20613,20614,20615,20616,20827,20828,20829,20830,20831,20832,20833,20834,21045,21046,21047,21048,21049,21050,21051,21052,21263,21264,21265,21266,21267,21268,21269,21270,21481,21482,21483,21484,21485,21486,21487,21488,21699,21700,21701,21702,21703,21704,21705,21706,0} - ,{21258,20601,20602,20603,20604,20605,20606,20607,20608,20819,20820,20821,20822,20823,20824,20825,20826,21037,21038,21039,21040,21041,21042,21043,21044,21255,21256,21257,21258,21259,21260,21261,21262,21473,21474,21475,21476,21477,21478,21479,21480,21691,21692,21693,21694,21695,21696,21697,21698,0} - ,{19966,19309,19310,19311,19312,19313,19314,19315,19316,19527,19528,19529,19530,19531,19532,19533,19534,19745,19746,19747,19748,19749,19750,19751,19752,19963,19964,19965,19966,19967,19968,19969,19970,20181,20182,20183,20184,20185,20186,20187,20188,20399,20400,20401,20402,20403,20404,20405,20406,0} - ,{19958,19301,19302,19303,19304,19305,19306,19307,19308,19519,19520,19521,19522,19523,19524,19525,19526,19737,19738,19739,19740,19741,19742,19743,19744,19955,19956,19957,19958,19959,19960,19961,19962,20173,20174,20175,20176,20177,20178,20179,20180,20391,20392,20393,20394,20395,20396,20397,20398,0} - ,{19950,19293,19294,19295,19296,19297,19298,19299,19300,19511,19512,19513,19514,19515,19516,19517,19518,19729,19730,19731,19732,19733,19734,19735,19736,19947,19948,19949,19950,19951,19952,19953,19954,20165,20166,20167,20168,20169,20170,20171,20172,20383,20384,20385,20386,20387,20388,20389,20390,0} - ,{18650,17993,17994,17995,17996,17997,17998,17999,18000,18211,18212,18213,18214,18215,18216,18217,18218,18429,18430,18431,18432,18433,18434,18435,18436,18647,18648,18649,18650,18651,18652,18653,18654,18865,18866,18867,18868,18869,18870,18871,18872,19083,19084,19085,19086,19087,19088,19089,19090,0} - ,{18642,17985,17986,17987,17988,17989,17990,17991,17992,18203,18204,18205,18206,18207,18208,18209,18210,18421,18422,18423,18424,18425,18426,18427,18428,18639,18640,18641,18642,18643,18644,18645,18646,18857,18858,18859,18860,18861,18862,18863,18864,19075,19076,19077,19078,19079,19080,19081,19082,0} - ,{17555,17335,17336,17337,17338,17553,17554,17555,17556,17771,17772,17773,17774,0} - ,{17551,17331,17332,17333,17334,17549,17550,17551,17552,17767,17768,17769,17770,0} - ,{16900,16681,16682,16683,16684,16899,16900,16901,16902,17117,17118,17119,17120,0} - ,{16896,16677,16678,16679,16680,16895,16896,16897,16898,17113,17114,17115,17116,0} - ,{0} - ,{27350,27121,27122,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27133,27134,27135,27136,27137,27138,27139,27140,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27357,27358,27565,27566,27567,27568,27569,27570,27571,27572,27573,27574,27575,27576,0} - ,{26450,25793,25794,25795,25796,25797,25798,25799,25800,26011,26012,26013,26014,26015,26016,26017,26018,26229,26230,26231,26232,26233,26234,26235,26236,26443,26444,26445,26446,26447,26448,26449,26450,26451,26452,26453,26454,26665,26666,26667,26668,26669,26670,26671,26672,26887,26888,26889,26890,0} - ,{26459,25801,25802,25803,25804,25805,25806,25807,25808,26019,26020,26021,26022,26023,26024,26025,26026,26237,26238,26239,26240,26241,26242,26243,26244,26455,26456,26457,26458,26459,26460,26461,26462,26673,26674,26675,26676,26677,26678,26679,26680,26891,26892,26893,26894,26895,26896,26897,26898,0} - ,{26467,25809,25810,25811,25812,25813,25814,25815,25816,26027,26028,26029,26030,26031,26032,26033,26034,26245,26246,26247,26248,26249,26250,26251,26252,26463,26464,26465,26466,26467,26468,26469,26470,26681,26682,26683,26684,26685,26686,26687,26688,26899,26900,26901,26902,26903,26904,26905,26906,0} - ,{26475,25817,25818,25819,25820,25821,25822,25823,25824,26035,26036,26037,26038,26039,26040,26041,26042,26253,26254,26255,26256,26257,26258,26259,26260,26471,26472,26473,26474,26475,26476,26477,26478,26689,26690,26691,26692,26693,26694,26695,26696,26907,26908,26909,26910,26911,26912,26913,26914,0} - ,{26483,25825,25826,25827,25828,25829,25830,25831,25832,26043,26044,26045,26046,26047,26048,26049,26050,26261,26262,26263,26264,26265,26266,26267,26268,26479,26480,26481,26482,26483,26484,26485,26486,26697,26698,26699,26700,26701,26702,26703,26704,26915,26916,26917,26918,26919,26920,26921,26922,0} - ,{25143,24485,24486,24487,24488,24489,24490,24491,24492,24703,24704,24705,24706,24707,24708,24709,24710,24921,24922,24923,24924,24925,24926,24927,24928,25139,25140,25141,25142,25143,25144,25145,25146,25357,25358,25359,25360,25361,25362,25363,25364,25575,25576,25577,25578,25579,25580,25581,25582,0} - ,{25151,24493,24494,24495,24496,24497,24498,24499,24500,24711,24712,24713,24714,24715,24716,24717,24718,24929,24930,24931,24932,24933,24934,24935,24936,25147,25148,25149,25150,25151,25152,25153,25154,25365,25366,25367,25368,25369,25370,25371,25372,25583,25584,25585,25586,25587,25588,25589,25590,0} - ,{25159,24501,24502,24503,24504,24505,24506,24507,24508,24719,24720,24721,24722,24723,24724,24725,24726,24937,24938,24939,24940,24941,24942,24943,24944,25155,25156,25157,25158,25159,25160,25161,25162,25373,25374,25375,25376,25377,25378,25379,25380,25591,25592,25593,25594,25595,25596,25597,25598,0} - ,{25167,24509,24510,24511,24512,24513,24514,24515,24516,24727,24728,24729,24730,24731,24732,24733,24734,24945,24946,24947,24948,24949,24950,24951,24952,25163,25164,25165,25166,25167,25168,25169,25170,25381,25382,25383,25384,25385,25386,25387,25388,25599,25600,25601,25602,25603,25604,25605,25606,0} - ,{25175,24517,24518,24519,24520,24521,24522,24523,24524,24735,24736,24737,24738,24739,24740,24741,24742,24953,24954,24955,24956,24957,24958,24959,24960,25171,25172,25173,25174,25175,25176,25177,25178,25389,25390,25391,25392,25393,25394,25395,25396,25607,25608,25609,25610,25611,25612,25613,25614,0} - ,{23843,23185,23186,23187,23188,23189,23190,23191,23192,23403,23404,23405,23406,23407,23408,23409,23410,23621,23622,23623,23624,23625,23626,23627,23628,23839,23840,23841,23842,23843,23844,23845,23846,24057,24058,24059,24060,24061,24062,24063,24064,24275,24276,24277,24278,24279,24280,24281,24282,0} - ,{23851,23193,23194,23195,23196,23197,23198,23199,23200,23411,23412,23413,23414,23415,23416,23417,23418,23629,23630,23631,23632,23633,23634,23635,23636,23847,23848,23849,23850,23851,23852,23853,23854,24065,24066,24067,24068,24069,24070,24071,24072,24283,24284,24285,24286,24287,24288,24289,24290,0} - ,{23859,23201,23202,23203,23204,23205,23206,23207,23208,23419,23420,23421,23422,23423,23424,23425,23426,23637,23638,23639,23640,23641,23642,23643,23644,23855,23856,23857,23858,23859,23860,23861,23862,24073,24074,24075,24076,24077,24078,24079,24080,24291,24292,24293,24294,24295,24296,24297,24298,0} - ,{23867,23209,23210,23211,23212,23213,23214,23215,23216,23427,23428,23429,23430,23431,23432,23433,23434,23645,23646,23647,23648,23649,23650,23651,23652,23863,23864,23865,23866,23867,23868,23869,23870,24081,24082,24083,24084,24085,24086,24087,24088,24299,24300,24301,24302,24303,24304,24305,24306,0} - ,{22535,21877,21878,21879,21880,21881,21882,21883,21884,22095,22096,22097,22098,22099,22100,22101,22102,22313,22314,22315,22316,22317,22318,22319,22320,22531,22532,22533,22534,22535,22536,22537,22538,22749,22750,22751,22752,22753,22754,22755,22756,22967,22968,22969,22970,22971,22972,22973,22974,0} - ,{22543,21885,21886,21887,21888,21889,21890,21891,21892,22103,22104,22105,22106,22107,22108,22109,22110,22321,22322,22323,22324,22325,22326,22327,22328,22539,22540,22541,22542,22543,22544,22545,22546,22757,22758,22759,22760,22761,22762,22763,22764,22975,22976,22977,22978,22979,22980,22981,22982,0} - ,{22551,21893,21894,21895,21896,21897,21898,21899,21900,22111,22112,22113,22114,22115,22116,22117,22118,22329,22330,22331,22332,22333,22334,22335,22336,22547,22548,22549,22550,22551,22552,22553,22554,22765,22766,22767,22768,22769,22770,22771,22772,22983,22984,22985,22986,22987,22988,22989,22990,0} - ,{22559,21901,21902,21903,21904,21905,21906,21907,21908,22119,22120,22121,22122,22123,22124,22125,22126,22337,22338,22339,22340,22341,22342,22343,22344,22555,22556,22557,22558,22559,22560,22561,22562,22773,22774,22775,22776,22777,22778,22779,22780,22991,22992,22993,22994,22995,22996,22997,22998,0} - ,{21235,20577,20578,20579,20580,20581,20582,20583,20584,20795,20796,20797,20798,20799,20800,20801,20802,21013,21014,21015,21016,21017,21018,21019,21020,21231,21232,21233,21234,21235,21236,21237,21238,21449,21450,21451,21452,21453,21454,21455,21456,21667,21668,21669,21670,21671,21672,21673,21674,0} - ,{21243,20585,20586,20587,20588,20589,20590,20591,20592,20803,20804,20805,20806,20807,20808,20809,20810,21021,21022,21023,21024,21025,21026,21027,21028,21239,21240,21241,21242,21243,21244,21245,21246,21457,21458,21459,21460,21461,21462,21463,21464,21675,21676,21677,21678,21679,21680,21681,21682,0} - ,{21251,20593,20594,20595,20596,20597,20598,20599,20600,20811,20812,20813,20814,20815,20816,20817,20818,21029,21030,21031,21032,21033,21034,21035,21036,21247,21248,21249,21250,21251,21252,21253,21254,21465,21466,21467,21468,21469,21470,21471,21472,21683,21684,21685,21686,21687,21688,21689,21690,0} - ,{19927,19269,19270,19271,19272,19273,19274,19275,19276,19487,19488,19489,19490,19491,19492,19493,19494,19705,19706,19707,19708,19709,19710,19711,19712,19923,19924,19925,19926,19927,19928,19929,19930,20141,20142,20143,20144,20145,20146,20147,20148,20359,20360,20361,20362,20363,20364,20365,20366,0} - ,{19935,19277,19278,19279,19280,19281,19282,19283,19284,19495,19496,19497,19498,19499,19500,19501,19502,19713,19714,19715,19716,19717,19718,19719,19720,19931,19932,19933,19934,19935,19936,19937,19938,20149,20150,20151,20152,20153,20154,20155,20156,20367,20368,20369,20370,20371,20372,20373,20374,0} - ,{19943,19285,19286,19287,19288,19289,19290,19291,19292,19503,19504,19505,19506,19507,19508,19509,19510,19721,19722,19723,19724,19725,19726,19727,19728,19939,19940,19941,19942,19943,19944,19945,19946,20157,20158,20159,20160,20161,20162,20163,20164,20375,20376,20377,20378,20379,20380,20381,20382,0} - ,{18627,17969,17970,17971,17972,17973,17974,17975,17976,18187,18188,18189,18190,18191,18192,18193,18194,18405,18406,18407,18408,18409,18410,18411,18412,18623,18624,18625,18626,18627,18628,18629,18630,18841,18842,18843,18844,18845,18846,18847,18848,19059,19060,19061,19062,19063,19064,19065,19066,0} - ,{18635,17977,17978,17979,17980,17981,17982,17983,17984,18195,18196,18197,18198,18199,18200,18201,18202,18413,18414,18415,18416,18417,18418,18419,18420,18631,18632,18633,18634,18635,18636,18637,18638,18849,18850,18851,18852,18853,18854,18855,18856,19067,19068,19069,19070,19071,19072,19073,19074,0} - ,{17543,17323,17324,17325,17326,17541,17542,17543,17544,17759,17760,17761,17762,0} - ,{17547,17327,17328,17329,17330,17545,17546,17547,17548,17763,17764,17765,17766,0} - ,{16888,16669,16670,16671,16672,16887,16888,16889,16890,17105,17106,17107,17108,0} - ,{16892,16673,16674,16675,16676,16891,16892,16893,16894,17109,17110,17111,17112,0} - ,{26000,25561,25562,25779,25780,25781,25782,25783,25784,25999,26000,26001,26002,0} - ,{23579,23359,23360,23361,23362,23577,23578,23579,23580,23795,23796,23797,23798,0} - ,{0} - ,{26004,25785,25786,25787,25788,26003,26004,26005,26006,26221,26222,26223,26224,0} - ,{24680,24459,24460,24461,24462,24463,24464,24677,24678,24679,24680,24681,24682,0} - ,{26008,25789,25790,25791,25792,26007,26008,26009,26010,26225,26226,26227,26228,0} - ,{24684,24465,24466,24467,24468,24683,24684,24685,24686,24901,24902,24903,24904,0} - ,{23803,23145,23146,23147,23148,23149,23150,23151,23152,23363,23364,23365,23366,23367,23368,23369,23370,23581,23582,23583,23584,23585,23586,23587,23588,23799,23800,23801,23802,23803,23804,23805,23806,24017,24018,24019,24020,24021,24022,24023,24024,24235,24236,24237,24238,24239,24240,24241,24242,0} - ,{25126,24469,24470,24471,24472,24473,24474,24475,24476,24687,24688,24689,24690,24691,24692,24693,24694,24905,24906,24907,24908,24909,24910,24911,24912,25121,25122,25123,25124,25125,25126,25127,25128,25129,25130,25341,25342,25343,25344,25345,25346,25347,25348,25559,25560,25563,25564,25565,25566,0} - ,{25135,24477,24478,24479,24480,24481,24482,24483,24484,24695,24696,24697,24698,24699,24700,24701,24702,24913,24914,24915,24916,24917,24918,24919,24920,25131,25132,25133,25134,25135,25136,25137,25138,25349,25350,25351,25352,25353,25354,25355,25356,25567,25568,25569,25570,25571,25572,25573,25574,0} - ,{23811,23153,23154,23155,23156,23157,23158,23159,23160,23371,23372,23373,23374,23375,23376,23377,23378,23589,23590,23591,23592,23593,23594,23595,23596,23807,23808,23809,23810,23811,23812,23813,23814,24025,24026,24027,24028,24029,24030,24031,24032,24243,24244,24245,24246,24247,24248,24249,24250,0} - ,{23819,23161,23162,23163,23164,23165,23166,23167,23168,23379,23380,23381,23382,23383,23384,23385,23386,23597,23598,23599,23600,23601,23602,23603,23604,23815,23816,23817,23818,23819,23820,23821,23822,24033,24034,24035,24036,24037,24038,24039,24040,24251,24252,24253,24254,24255,24256,24257,24258,0} - ,{22503,21845,21846,21847,21848,21849,21850,21851,21852,22063,22064,22065,22066,22067,22068,22069,22070,22281,22282,22283,22284,22285,22286,22287,22288,22499,22500,22501,22502,22503,22504,22505,22506,22717,22718,22719,22720,22721,22722,22723,22724,22935,22936,22937,22938,22939,22940,22941,22942,0} - ,{23827,23169,23170,23171,23172,23173,23174,23175,23176,23387,23388,23389,23390,23391,23392,23393,23394,23605,23606,23607,23608,23609,23610,23611,23612,23823,23824,23825,23826,23827,23828,23829,23830,24041,24042,24043,24044,24045,24046,24047,24048,24259,24260,24261,24262,24263,24264,24265,24266,0} - ,{23835,23177,23178,23179,23180,23181,23182,23183,23184,23395,23396,23397,23398,23399,23400,23401,23402,23613,23614,23615,23616,23617,23618,23619,23620,23831,23832,23833,23834,23835,23836,23837,23838,24049,24050,24051,24052,24053,24054,24055,24056,24267,24268,24269,24270,24271,24272,24273,24274,0} - ,{22511,21853,21854,21855,21856,21857,21858,21859,21860,22071,22072,22073,22074,22075,22076,22077,22078,22289,22290,22291,22292,22293,22294,22295,22296,22507,22508,22509,22510,22511,22512,22513,22514,22725,22726,22727,22728,22729,22730,22731,22732,22943,22944,22945,22946,22947,22948,22949,22950,0} - ,{22519,21861,21862,21863,21864,21865,21866,21867,21868,22079,22080,22081,22082,22083,22084,22085,22086,22297,22298,22299,22300,22301,22302,22303,22304,22515,22516,22517,22518,22519,22520,22521,22522,22733,22734,22735,22736,22737,22738,22739,22740,22951,22952,22953,22954,22955,22956,22957,22958,0} - ,{21203,20545,20546,20547,20548,20549,20550,20551,20552,20763,20764,20765,20766,20767,20768,20769,20770,20981,20982,20983,20984,20985,20986,20987,20988,21199,21200,21201,21202,21203,21204,21205,21206,21417,21418,21419,21420,21421,21422,21423,21424,21635,21636,21637,21638,21639,21640,21641,21642,0} - ,{22527,21869,21870,21871,21872,21873,21874,21875,21876,22087,22088,22089,22090,22091,22092,22093,22094,22305,22306,22307,22308,22309,22310,22311,22312,22523,22524,22525,22526,22527,22528,22529,22530,22741,22742,22743,22744,22745,22746,22747,22748,22959,22960,22961,22962,22963,22964,22965,22966,0} - ,{21211,20553,20554,20555,20556,20557,20558,20559,20560,20771,20772,20773,20774,20775,20776,20777,20778,20989,20990,20991,20992,20993,20994,20995,20996,21207,21208,21209,21210,21211,21212,21213,21214,21425,21426,21427,21428,21429,21430,21431,21432,21643,21644,21645,21646,21647,21648,21649,21650,0} - ,{21219,20561,20562,20563,20564,20565,20566,20567,20568,20779,20780,20781,20782,20783,20784,20785,20786,20997,20998,20999,21000,21001,21002,21003,21004,21215,21216,21217,21218,21219,21220,21221,21222,21433,21434,21435,21436,21437,21438,21439,21440,21651,21652,21653,21654,21655,21656,21657,21658,0} - ,{19903,19245,19246,19247,19248,19249,19250,19251,19252,19463,19464,19465,19466,19467,19468,19469,19470,19681,19682,19683,19684,19685,19686,19687,19688,19899,19900,19901,19902,19903,19904,19905,19906,20117,20118,20119,20120,20121,20122,20123,20124,20335,20336,20337,20338,20339,20340,20341,20342,0} - ,{21227,20569,20570,20571,20572,20573,20574,20575,20576,20787,20788,20789,20790,20791,20792,20793,20794,21005,21006,21007,21008,21009,21010,21011,21012,21223,21224,21225,21226,21227,21228,21229,21230,21441,21442,21443,21444,21445,21446,21447,21448,21659,21660,21661,21662,21663,21664,21665,21666,0} - ,{19911,19253,19254,19255,19256,19257,19258,19259,19260,19471,19472,19473,19474,19475,19476,19477,19478,19689,19690,19691,19692,19693,19694,19695,19696,19907,19908,19909,19910,19911,19912,19913,19914,20125,20126,20127,20128,20129,20130,20131,20132,20343,20344,20345,20346,20347,20348,20349,20350,0} - ,{19919,19261,19262,19263,19264,19265,19266,19267,19268,19479,19480,19481,19482,19483,19484,19485,19486,19697,19698,19699,19700,19701,19702,19703,19704,19915,19916,19917,19918,19919,19920,19921,19922,20133,20134,20135,20136,20137,20138,20139,20140,20351,20352,20353,20354,20355,20356,20357,20358,0} - ,{18603,17945,17946,17947,17948,17949,17950,17951,17952,18163,18164,18165,18166,18167,18168,18169,18170,18381,18382,18383,18384,18385,18386,18387,18388,18599,18600,18601,18602,18603,18604,18605,18606,18817,18818,18819,18820,18821,18822,18823,18824,19035,19036,19037,19038,19039,19040,19041,19042,0} - ,{18611,17953,17954,17955,17956,17957,17958,17959,17960,18171,18172,18173,18174,18175,18176,18177,18178,18389,18390,18391,18392,18393,18394,18395,18396,18607,18608,18609,18610,18611,18612,18613,18614,18825,18826,18827,18828,18829,18830,18831,18832,19043,19044,19045,19046,19047,19048,19049,19050,0} - ,{18619,17961,17962,17963,17964,17965,17966,17967,17968,18179,18180,18181,18182,18183,18184,18185,18186,18397,18398,18399,18400,18401,18402,18403,18404,18615,18616,18617,18618,18619,18620,18621,18622,18833,18834,18835,18836,18837,18838,18839,18840,19051,19052,19053,19054,19055,19056,19057,19058,0} - ,{17311,16653,16654,16655,16656,16657,16658,16659,16660,16871,16872,16873,16874,16875,16876,16877,16878,17089,17090,17091,17092,17093,17094,17095,17096,17307,17308,17309,17310,17311,17312,17313,17314,17525,17526,17527,17528,17529,17530,17531,17532,17743,17744,17745,17746,17747,17748,17749,17750,0} - ,{17319,16661,16662,16663,16664,16665,16666,16667,16668,16879,16880,16881,16882,16883,16884,16885,16886,17097,17098,17099,17100,17101,17102,17103,17104,17315,17316,17317,17318,17319,17320,17321,17322,17533,17534,17535,17536,17537,17538,17539,17540,17751,17752,17753,17754,17755,17756,17757,17758,0} - ,{16438,16217,16218,16219,16220,16221,16222,16435,16436,16437,16438,16439,16440,0} - ,{16225,16007,16008,16223,16224,16225,16226,16227,16228,16441,16442,16443,16444,0} - ,{16449,16229,16230,16231,16232,16445,16446,16447,16448,16449,16450,16451,16452,0} - ,{23139,22919,22920,22921,22922,23137,23138,23139,23140,23355,23356,23357,23358,0} - ,{22043,21823,21824,21825,21826,22041,22042,22043,22044,22261,22262,22479,22480,0} - ,{20729,20509,20510,20511,20512,20727,20728,20729,20730,20947,20948,21165,21166,0} - ,{22925,22705,22706,22707,22708,22923,22924,22925,22926,23141,23142,23143,23144,0} - ,{19855,19197,19198,19199,19200,19201,19202,19203,19204,19415,19416,19417,19418,19419,19420,19421,19422,19633,19634,19635,19636,19637,19638,19639,19640,19851,19852,19853,19854,19855,19856,19857,19858,20069,20070,20071,20072,20073,20074,20075,20076,20287,20288,20289,20290,20291,20292,20293,20294,0} - ,{22267,21827,21828,21829,21830,21831,21832,21833,21834,21835,21836,22045,22046,22047,22048,22049,22050,22051,22052,22053,22054,22263,22264,22265,22266,22267,22268,22269,22270,22271,22272,22481,22482,22483,22484,22485,22486,22487,22488,22489,22490,22699,22700,22701,22702,22703,22704,22917,22918,0} - ,{21171,20513,20514,20515,20516,20517,20518,20519,20520,20731,20732,20733,20734,20735,20736,20737,20738,20949,20950,20951,20952,20953,20954,20955,20956,21167,21168,21169,21170,21171,21172,21173,21174,21385,21386,21387,21388,21389,21390,21391,21392,21603,21604,21605,21606,21607,21608,21609,21610,0} - ,{19863,19205,19206,19207,19208,19209,19210,19211,19212,19423,19424,19425,19426,19427,19428,19429,19430,19641,19642,19643,19644,19645,19646,19647,19648,19859,19860,19861,19862,19863,19864,19865,19866,20077,20078,20079,20080,20081,20082,20083,20084,20295,20296,20297,20298,20299,20300,20301,20302,0} - ,{22495,21837,21838,21839,21840,21841,21842,21843,21844,22055,22056,22057,22058,22059,22060,22061,22062,22273,22274,22275,22276,22277,22278,22279,22280,22491,22492,22493,22494,22495,22496,22497,22498,22709,22710,22711,22712,22713,22714,22715,22716,22927,22928,22929,22930,22931,22932,22933,22934,0} - ,{21179,20521,20522,20523,20524,20525,20526,20527,20528,20739,20740,20741,20742,20743,20744,20745,20746,20957,20958,20959,20960,20961,20962,20963,20964,21175,21176,21177,21178,21179,21180,21181,21182,21393,21394,21395,21396,21397,21398,21399,21400,21611,21612,21613,21614,21615,21616,21617,21618,0} - ,{18555,17897,17898,17899,17900,17901,17902,17903,17904,18115,18116,18117,18118,18119,18120,18121,18122,18333,18334,18335,18336,18337,18338,18339,18340,18551,18552,18553,18554,18555,18556,18557,18558,18769,18770,18771,18772,18773,18774,18775,18776,18987,18988,18989,18990,18991,18992,18993,18994,0} - ,{19871,19213,19214,19215,19216,19217,19218,19219,19220,19431,19432,19433,19434,19435,19436,19437,19438,19649,19650,19651,19652,19653,19654,19655,19656,19867,19868,19869,19870,19871,19872,19873,19874,20085,20086,20087,20088,20089,20090,20091,20092,20303,20304,20305,20306,20307,20308,20309,20310,0} - ,{21187,20529,20530,20531,20532,20533,20534,20535,20536,20747,20748,20749,20750,20751,20752,20753,20754,20965,20966,20967,20968,20969,20970,20971,20972,21183,21184,21185,21186,21187,21188,21189,21190,21401,21402,21403,21404,21405,21406,21407,21408,21619,21620,21621,21622,21623,21624,21625,21626,0} - ,{18563,17905,17906,17907,17908,17909,17910,17911,17912,18123,18124,18125,18126,18127,18128,18129,18130,18341,18342,18343,18344,18345,18346,18347,18348,18559,18560,18561,18562,18563,18564,18565,18566,18777,18778,18779,18780,18781,18782,18783,18784,18995,18996,18997,18998,18999,19000,19001,19002,0} - ,{21195,20537,20538,20539,20540,20541,20542,20543,20544,20755,20756,20757,20758,20759,20760,20761,20762,20973,20974,20975,20976,20977,20978,20979,20980,21191,21192,21193,21194,21195,21196,21197,21198,21409,21410,21411,21412,21413,21414,21415,21416,21627,21628,21629,21630,21631,21632,21633,21634,0} - ,{19879,19221,19222,19223,19224,19225,19226,19227,19228,19439,19440,19441,19442,19443,19444,19445,19446,19657,19658,19659,19660,19661,19662,19663,19664,19875,19876,19877,19878,19879,19880,19881,19882,20093,20094,20095,20096,20097,20098,20099,20100,20311,20312,20313,20314,20315,20316,20317,20318,0} - ,{18571,17913,17914,17915,17916,17917,17918,17919,17920,18131,18132,18133,18134,18135,18136,18137,18138,18349,18350,18351,18352,18353,18354,18355,18356,18567,18568,18569,18570,18571,18572,18573,18574,18785,18786,18787,18788,18789,18790,18791,18792,19003,19004,19005,19006,19007,19008,19009,19010,0} - ,{19887,19229,19230,19231,19232,19233,19234,19235,19236,19447,19448,19449,19450,19451,19452,19453,19454,19665,19666,19667,19668,19669,19670,19671,19672,19883,19884,19885,19886,19887,19888,19889,19890,20101,20102,20103,20104,20105,20106,20107,20108,20319,20320,20321,20322,20323,20324,20325,20326,0} - ,{18579,17921,17922,17923,17924,17925,17926,17927,17928,18139,18140,18141,18142,18143,18144,18145,18146,18357,18358,18359,18360,18361,18362,18363,18364,18575,18576,18577,18578,18579,18580,18581,18582,18793,18794,18795,18796,18797,18798,18799,18800,19011,19012,19013,19014,19015,19016,19017,19018,0} - ,{19895,19237,19238,19239,19240,19241,19242,19243,19244,19455,19456,19457,19458,19459,19460,19461,19462,19673,19674,19675,19676,19677,19678,19679,19680,19891,19892,19893,19894,19895,19896,19897,19898,20109,20110,20111,20112,20113,20114,20115,20116,20327,20328,20329,20330,20331,20332,20333,20334,0} - ,{17271,16613,16614,16615,16616,16617,16618,16619,16620,16831,16832,16833,16834,16835,16836,16837,16838,17049,17050,17051,17052,17053,17054,17055,17056,17267,17268,17269,17270,17271,17272,17273,17274,17485,17486,17487,17488,17489,17490,17491,17492,17703,17704,17705,17706,17707,17708,17709,17710,0} - ,{18587,17929,17930,17931,17932,17933,17934,17935,17936,18147,18148,18149,18150,18151,18152,18153,18154,18365,18366,18367,18368,18369,18370,18371,18372,18583,18584,18585,18586,18587,18588,18589,18590,18801,18802,18803,18804,18805,18806,18807,18808,19019,19020,19021,19022,19023,19024,19025,19026,0} - ,{17279,16621,16622,16623,16624,16625,16626,16627,16628,16839,16840,16841,16842,16843,16844,16845,16846,17057,17058,17059,17060,17061,17062,17063,17064,17275,17276,17277,17278,17279,17280,17281,17282,17493,17494,17495,17496,17497,17498,17499,17500,17711,17712,17713,17714,17715,17716,17717,17718,0} - ,{18595,17937,17938,17939,17940,17941,17942,17943,17944,18155,18156,18157,18158,18159,18160,18161,18162,18373,18374,18375,18376,18377,18378,18379,18380,18591,18592,18593,18594,18595,18596,18597,18598,18809,18810,18811,18812,18813,18814,18815,18816,19027,19028,19029,19030,19031,19032,19033,19034,0} - ,{17287,16629,16630,16631,16632,16633,16634,16635,16636,16847,16848,16849,16850,16851,16852,16853,16854,17065,17066,17067,17068,17069,17070,17071,17072,17283,17284,17285,17286,17287,17288,17289,17290,17501,17502,17503,17504,17505,17506,17507,17508,17719,17720,17721,17722,17723,17724,17725,17726,0} - ,{17295,16637,16638,16639,16640,16641,16642,16643,16644,16855,16856,16857,16858,16859,16860,16861,16862,17073,17074,17075,17076,17077,17078,17079,17080,17291,17292,17293,17294,17295,17296,17297,17298,17509,17510,17511,17512,17513,17514,17515,17516,17727,17728,17729,17730,17731,17732,17733,17734,0} - ,{15987,15329,15330,15331,15332,15333,15334,15335,15336,15547,15548,15549,15550,15551,15552,15553,15554,15765,15766,15767,15768,15769,15770,15771,15772,15983,15984,15985,15986,15987,15988,15989,15990,16201,16202,16203,16204,16205,16206,16207,16208,16419,16420,16421,16422,16423,16424,16425,16426,0} - ,{17303,16645,16646,16647,16648,16649,16650,16651,16652,16863,16864,16865,16866,16867,16868,16869,16870,17081,17082,17083,17084,17085,17086,17087,17088,17299,17300,17301,17302,17303,17304,17305,17306,17517,17518,17519,17520,17521,17522,17523,17524,17735,17736,17737,17738,17739,17740,17741,17742,0} - ,{15995,15337,15338,15339,15340,15341,15342,15343,15344,15555,15556,15557,15558,15559,15560,15561,15562,15773,15774,15775,15776,15777,15778,15779,15780,15991,15992,15993,15994,15995,15996,15997,15998,16209,16210,16211,16212,16213,16214,16215,16216,16427,16428,16429,16430,16431,16432,16433,16434,0} - ,{16002,15781,15782,15783,15784,15785,15786,15999,16000,16001,16002,16003,16004,0} - ,{15566,15345,15346,15347,15348,15349,15350,15563,15564,15565,15566,15567,15568,0} - ,{15570,15131,15132,15351,15352,15569,15570,15787,15788,15789,15790,16005,16006,0} - ,{15481,15261,15262,15263,15264,15479,15480,15481,15482,15699,15700,15917,15918,0} - ,{14173,13953,13954,13955,13956,14171,14172,14173,14174,14389,14390,14391,14392,0} - ,{14827,14607,14608,14609,14610,14825,14826,14827,14828,15043,15044,15045,15046,0} - ,{18540,17881,17882,17883,17884,17885,17886,17887,17888,18099,18100,18101,18102,18103,18104,18105,18106,18319,18320,18321,18322,18323,18324,18537,18538,18539,18540,18541,18542,18757,18758,18759,18760,18973,18974,18975,18976,18977,18978,19193,19194,19195,19196,19411,19412,19413,19414,19631,19632,0} - ,{17231,16573,16574,16575,16576,16577,16578,16579,16580,16791,16792,16793,16794,16795,16796,16797,16798,17009,17010,17011,17012,17013,17014,17015,17016,17227,17228,17229,17230,17231,17232,17233,17234,17445,17446,17447,17448,17449,17450,17451,17452,17663,17664,17665,17666,17667,17668,17669,17670,0} - ,{15923,15265,15266,15267,15268,15269,15270,15271,15272,15483,15484,15485,15486,15487,15488,15489,15490,15701,15702,15703,15704,15705,15706,15707,15708,15919,15920,15921,15922,15923,15924,15925,15926,16137,16138,16139,16140,16141,16142,16143,16144,16355,16356,16357,16358,16359,16360,16361,16362,0} - ,{14615,13957,13958,13959,13960,13961,13962,13963,13964,14175,14176,14177,14178,14179,14180,14181,14182,14393,14394,14395,14396,14397,14398,14399,14400,14611,14612,14613,14614,14615,14616,14617,14618,14829,14830,14831,14832,14833,14834,14835,14836,15047,15048,15049,15050,15051,15052,15053,15054,0} - ,{18547,17889,17890,17891,17892,17893,17894,17895,17896,18107,18108,18109,18110,18111,18112,18113,18114,18325,18326,18327,18328,18329,18330,18331,18332,18543,18544,18545,18546,18547,18548,18549,18550,18761,18762,18763,18764,18765,18766,18767,18768,18979,18980,18981,18982,18983,18984,18985,18986,0} - ,{17239,16581,16582,16583,16584,16585,16586,16587,16588,16799,16800,16801,16802,16803,16804,16805,16806,17017,17018,17019,17020,17021,17022,17023,17024,17235,17236,17237,17238,17239,17240,17241,17242,17453,17454,17455,17456,17457,17458,17459,17460,17671,17672,17673,17674,17675,17676,17677,17678,0} - ,{15931,15273,15274,15275,15276,15277,15278,15279,15280,15491,15492,15493,15494,15495,15496,15497,15498,15709,15710,15711,15712,15713,15714,15715,15716,15927,15928,15929,15930,15931,15932,15933,15934,16145,16146,16147,16148,16149,16150,16151,16152,16363,16364,16365,16366,16367,16368,16369,16370,0} - ,{14623,13965,13966,13967,13968,13969,13970,13971,13972,14183,14184,14185,14186,14187,14188,14189,14190,14401,14402,14403,14404,14405,14406,14407,14408,14619,14620,14621,14622,14623,14624,14625,14626,14837,14838,14839,14840,14841,14842,14843,14844,15055,15056,15057,15058,15059,15060,15061,15062,0} - ,{17247,16589,16590,16591,16592,16593,16594,16595,16596,16807,16808,16809,16810,16811,16812,16813,16814,17025,17026,17027,17028,17029,17030,17031,17032,17243,17244,17245,17246,17247,17248,17249,17250,17461,17462,17463,17464,17465,17466,17467,17468,17679,17680,17681,17682,17683,17684,17685,17686,0} - ,{15939,15281,15282,15283,15284,15285,15286,15287,15288,15499,15500,15501,15502,15503,15504,15505,15506,15717,15718,15719,15720,15721,15722,15723,15724,15935,15936,15937,15938,15939,15940,15941,15942,16153,16154,16155,16156,16157,16158,16159,16160,16371,16372,16373,16374,16375,16376,16377,16378,0} - ,{14631,13973,13974,13975,13976,13977,13978,13979,13980,14191,14192,14193,14194,14195,14196,14197,14198,14409,14410,14411,14412,14413,14414,14415,14416,14627,14628,14629,14630,14631,14632,14633,14634,14845,14846,14847,14848,14849,14850,14851,14852,15063,15064,15065,15066,15067,15068,15069,15070,0} - ,{17255,16597,16598,16599,16600,16601,16602,16603,16604,16815,16816,16817,16818,16819,16820,16821,16822,17033,17034,17035,17036,17037,17038,17039,17040,17251,17252,17253,17254,17255,17256,17257,17258,17469,17470,17471,17472,17473,17474,17475,17476,17687,17688,17689,17690,17691,17692,17693,17694,0} - ,{15947,15289,15290,15291,15292,15293,15294,15295,15296,15507,15508,15509,15510,15511,15512,15513,15514,15725,15726,15727,15728,15729,15730,15731,15732,15943,15944,15945,15946,15947,15948,15949,15950,16161,16162,16163,16164,16165,16166,16167,16168,16379,16380,16381,16382,16383,16384,16385,16386,0} - ,{14639,13981,13982,13983,13984,13985,13986,13987,13988,14199,14200,14201,14202,14203,14204,14205,14206,14417,14418,14419,14420,14421,14422,14423,14424,14635,14636,14637,14638,14639,14640,14641,14642,14853,14854,14855,14856,14857,14858,14859,14860,15071,15072,15073,15074,15075,15076,15077,15078,0} - ,{17263,16605,16606,16607,16608,16609,16610,16611,16612,16823,16824,16825,16826,16827,16828,16829,16830,17041,17042,17043,17044,17045,17046,17047,17048,17259,17260,17261,17262,17263,17264,17265,17266,17477,17478,17479,17480,17481,17482,17483,17484,17695,17696,17697,17698,17699,17700,17701,17702,0} - ,{15955,15297,15298,15299,15300,15301,15302,15303,15304,15515,15516,15517,15518,15519,15520,15521,15522,15733,15734,15735,15736,15737,15738,15739,15740,15951,15952,15953,15954,15955,15956,15957,15958,16169,16170,16171,16172,16173,16174,16175,16176,16387,16388,16389,16390,16391,16392,16393,16394,0} - ,{14647,13989,13990,13991,13992,13993,13994,13995,13996,14207,14208,14209,14210,14211,14212,14213,14214,14425,14426,14427,14428,14429,14430,14431,14432,14643,14644,14645,14646,14647,14648,14649,14650,14861,14862,14863,14864,14865,14866,14867,14868,15079,15080,15081,15082,15083,15084,15085,15086,0} - ,{15963,15305,15306,15307,15308,15309,15310,15311,15312,15523,15524,15525,15526,15527,15528,15529,15530,15741,15742,15743,15744,15745,15746,15747,15748,15959,15960,15961,15962,15963,15964,15965,15966,16177,16178,16179,16180,16181,16182,16183,16184,16395,16396,16397,16398,16399,16400,16401,16402,0} - ,{14655,13997,13998,13999,14000,14001,14002,14003,14004,14215,14216,14217,14218,14219,14220,14221,14222,14433,14434,14435,14436,14437,14438,14439,14440,14651,14652,14653,14654,14655,14656,14657,14658,14869,14870,14871,14872,14873,14874,14875,14876,15087,15088,15089,15090,15091,15092,15093,15094,0} - ,{15971,15313,15314,15315,15316,15317,15318,15319,15320,15531,15532,15533,15534,15535,15536,15537,15538,15749,15750,15751,15752,15753,15754,15755,15756,15967,15968,15969,15970,15971,15972,15973,15974,16185,16186,16187,16188,16189,16190,16191,16192,16403,16404,16405,16406,16407,16408,16409,16410,0} - ,{14663,14005,14006,14007,14008,14009,14010,14011,14012,14223,14224,14225,14226,14227,14228,14229,14230,14441,14442,14443,14444,14445,14446,14447,14448,14659,14660,14661,14662,14663,14664,14665,14666,14877,14878,14879,14880,14881,14882,14883,14884,15095,15096,15097,15098,15099,15100,15101,15102,0} - ,{15979,15321,15322,15323,15324,15325,15326,15327,15328,15539,15540,15541,15542,15543,15544,15545,15546,15757,15758,15759,15760,15761,15762,15763,15764,15975,15976,15977,15978,15979,15980,15981,15982,16193,16194,16195,16196,16197,16198,16199,16200,16411,16412,16413,16414,16415,16416,16417,16418,0} - ,{14671,14013,14014,14015,14016,14017,14018,14019,14020,14231,14232,14233,14234,14235,14236,14237,14238,14449,14450,14451,14452,14453,14454,14455,14456,14667,14668,14669,14670,14671,14672,14673,14674,14885,14886,14887,14888,14889,14890,14891,14892,15103,15104,15105,15106,15107,15108,15109,15110,0} - ,{14679,14021,14022,14023,14024,14025,14026,14027,14028,14239,14240,14241,14242,14243,14244,14245,14246,14457,14458,14459,14460,14461,14462,14463,14464,14675,14676,14677,14678,14679,14680,14681,14682,14893,14894,14895,14896,14897,14898,14899,14900,15111,15112,15113,15114,15115,15116,15117,15118,0} - ,{14687,14029,14030,14031,14032,14033,14034,14035,14036,14247,14248,14249,14250,14251,14252,14253,14254,14465,14466,14467,14468,14469,14470,14471,14472,14683,14684,14685,14686,14687,14688,14689,14690,14901,14902,14903,14904,14905,14906,14907,14908,15119,15120,15121,15122,15123,15124,15125,15126,0} - ,{14911,14691,14692,14693,14694,14909,14910,14911,14912,15127,15128,15129,15130,0} - ,{14256,14037,14038,14039,14040,14255,14256,14257,14258,14473,14474,14475,14476,0} - ,{0} - ,{0} - ,{13519,13299,13300,13301,13302,13517,13518,13519,13520,13735,13736,13737,13738,0} - ,{12865,12645,12646,12647,12648,12863,12864,12865,12866,13081,13082,13083,13084,0} - ,{12211,11991,11992,11993,11994,12209,12210,12211,12212,12427,12428,12429,12430,0} - ,{9166,8077,8078,8295,8296,8511,8512,8513,8514,8729,8730,8731,8732,8945,8946,8947,8948,8949,8950,9163,9164,9165,9166,9167,9168,9379,9380,9381,9382,9383,9384,9385,9386,9597,9598,9599,9600,9601,9602,9603,9604,9815,9816,9817,9818,9819,9820,9821,9822,0} - ,{10473,10033,10034,10035,10036,10037,10038,10039,10040,10251,10252,10253,10254,10255,10256,10257,10258,10469,10470,10471,10472,10473,10474,10475,10476,10687,10688,10689,10690,10691,10692,10693,10694,10905,10906,10907,10908,10909,10910,10911,10912,11123,11124,11125,11126,11127,11128,11129,11130,0} - ,{11781,11341,11342,11343,11344,11345,11346,11347,11348,11559,11560,11561,11562,11563,11564,11565,11566,11777,11778,11779,11780,11781,11782,11783,11784,11995,11996,11997,11998,11999,12000,12001,12002,12213,12214,12215,12216,12217,12218,12219,12220,12431,12432,12433,12434,12435,12436,12437,12438,0} - ,{13089,12649,12650,12651,12652,12653,12654,12655,12656,12867,12868,12869,12870,12871,12872,12873,12874,13085,13086,13087,13088,13089,13090,13091,13092,13303,13304,13305,13306,13307,13308,13309,13310,13521,13522,13523,13524,13525,13526,13527,13528,13739,13740,13741,13742,13743,13744,13745,13746,0} - ,{9173,8733,8734,8735,8736,8737,8738,8739,8740,8951,8952,8953,8954,8955,8956,8957,8958,9169,9170,9171,9172,9173,9174,9175,9176,9387,9388,9389,9390,9391,9392,9393,9394,9605,9606,9607,9608,9609,9610,9611,9612,9823,9824,9825,9826,9827,9828,9829,9830,0} - ,{10481,10041,10042,10043,10044,10045,10046,10047,10048,10259,10260,10261,10262,10263,10264,10265,10266,10477,10478,10479,10480,10481,10482,10483,10484,10695,10696,10697,10698,10699,10700,10701,10702,10913,10914,10915,10916,10917,10918,10919,10920,11131,11132,11133,11134,11135,11136,11137,11138,0} - ,{11789,11349,11350,11351,11352,11353,11354,11355,11356,11567,11568,11569,11570,11571,11572,11573,11574,11785,11786,11787,11788,11789,11790,11791,11792,12003,12004,12005,12006,12007,12008,12009,12010,12221,12222,12223,12224,12225,12226,12227,12228,12439,12440,12441,12442,12443,12444,12445,12446,0} - ,{13097,12657,12658,12659,12660,12661,12662,12663,12664,12875,12876,12877,12878,12879,12880,12881,12882,13093,13094,13095,13096,13097,13098,13099,13100,13311,13312,13313,13314,13315,13316,13317,13318,13529,13530,13531,13532,13533,13534,13535,13536,13747,13748,13749,13750,13751,13752,13753,13754,0} - ,{10489,10049,10050,10051,10052,10053,10054,10055,10056,10267,10268,10269,10270,10271,10272,10273,10274,10485,10486,10487,10488,10489,10490,10491,10492,10703,10704,10705,10706,10707,10708,10709,10710,10921,10922,10923,10924,10925,10926,10927,10928,11139,11140,11141,11142,11143,11144,11145,11146,0} - ,{11797,11357,11358,11359,11360,11361,11362,11363,11364,11575,11576,11577,11578,11579,11580,11581,11582,11793,11794,11795,11796,11797,11798,11799,11800,12011,12012,12013,12014,12015,12016,12017,12018,12229,12230,12231,12232,12233,12234,12235,12236,12447,12448,12449,12450,12451,12452,12453,12454,0} - ,{13105,12665,12666,12667,12668,12669,12670,12671,12672,12883,12884,12885,12886,12887,12888,12889,12890,13101,13102,13103,13104,13105,13106,13107,13108,13319,13320,13321,13322,13323,13324,13325,13326,13537,13538,13539,13540,13541,13542,13543,13544,13755,13756,13757,13758,13759,13760,13761,13762,0} - ,{10497,10057,10058,10059,10060,10061,10062,10063,10064,10275,10276,10277,10278,10279,10280,10281,10282,10493,10494,10495,10496,10497,10498,10499,10500,10711,10712,10713,10714,10715,10716,10717,10718,10929,10930,10931,10932,10933,10934,10935,10936,11147,11148,11149,11150,11151,11152,11153,11154,0} - ,{11805,11365,11366,11367,11368,11369,11370,11371,11372,11583,11584,11585,11586,11587,11588,11589,11590,11801,11802,11803,11804,11805,11806,11807,11808,12019,12020,12021,12022,12023,12024,12025,12026,12237,12238,12239,12240,12241,12242,12243,12244,12455,12456,12457,12458,12459,12460,12461,12462,0} - ,{13113,12673,12674,12675,12676,12677,12678,12679,12680,12891,12892,12893,12894,12895,12896,12897,12898,13109,13110,13111,13112,13113,13114,13115,13116,13327,13328,13329,13330,13331,13332,13333,13334,13545,13546,13547,13548,13549,13550,13551,13552,13763,13764,13765,13766,13767,13768,13769,13770,0} - ,{10505,10065,10066,10067,10068,10069,10070,10071,10072,10283,10284,10285,10286,10287,10288,10289,10290,10501,10502,10503,10504,10505,10506,10507,10508,10719,10720,10721,10722,10723,10724,10725,10726,10937,10938,10939,10940,10941,10942,10943,10944,11155,11156,11157,11158,11159,11160,11161,11162,0} - ,{11813,11373,11374,11375,11376,11377,11378,11379,11380,11591,11592,11593,11594,11595,11596,11597,11598,11809,11810,11811,11812,11813,11814,11815,11816,12027,12028,12029,12030,12031,12032,12033,12034,12245,12246,12247,12248,12249,12250,12251,12252,12463,12464,12465,12466,12467,12468,12469,12470,0} - ,{13121,12681,12682,12683,12684,12685,12686,12687,12688,12899,12900,12901,12902,12903,12904,12905,12906,13117,13118,13119,13120,13121,13122,13123,13124,13335,13336,13337,13338,13339,13340,13341,13342,13553,13554,13555,13556,13557,13558,13559,13560,13771,13772,13773,13774,13775,13776,13777,13778,0} - ,{11821,11381,11382,11383,11384,11385,11386,11387,11388,11599,11600,11601,11602,11603,11604,11605,11606,11817,11818,11819,11820,11821,11822,11823,11824,12035,12036,12037,12038,12039,12040,12041,12042,12253,12254,12255,12256,12257,12258,12259,12260,12471,12472,12473,12474,12475,12476,12477,12478,0} - ,{13129,12689,12690,12691,12692,12693,12694,12695,12696,12907,12908,12909,12910,12911,12912,12913,12914,13125,13126,13127,13128,13129,13130,13131,13132,13343,13344,13345,13346,13347,13348,13349,13350,13561,13562,13563,13564,13565,13566,13567,13568,13779,13780,13781,13782,13783,13784,13785,13786,0} - ,{11829,11389,11390,11391,11392,11393,11394,11395,11396,11607,11608,11609,11610,11611,11612,11613,11614,11825,11826,11827,11828,11829,11830,11831,11832,12043,12044,12045,12046,12047,12048,12049,12050,12261,12262,12263,12264,12265,12266,12267,12268,12479,12480,12481,12482,12483,12484,12485,12486,0} - ,{13137,12697,12698,12699,12700,12701,12702,12703,12704,12915,12916,12917,12918,12919,12920,12921,12922,13133,13134,13135,13136,13137,13138,13139,13140,13351,13352,13353,13354,13355,13356,13357,13358,13569,13570,13571,13572,13573,13574,13575,13576,13787,13788,13789,13790,13791,13792,13793,13794,0} - ,{11837,11397,11398,11399,11400,11401,11402,11403,11404,11615,11616,11617,11618,11619,11620,11621,11622,11833,11834,11835,11836,11837,11838,11839,11840,12051,12052,12053,12054,12055,12056,12057,12058,12269,12270,12271,12272,12273,12274,12275,12276,12487,12488,12489,12490,12491,12492,12493,12494,0} - ,{13145,12705,12706,12707,12708,12709,12710,12711,12712,12923,12924,12925,12926,12927,12928,12929,12930,13141,13142,13143,13144,13145,13146,13147,13148,13359,13360,13361,13362,13363,13364,13365,13366,13577,13578,13579,13580,13581,13582,13583,13584,13795,13796,13797,13798,13799,13800,13801,13802,0} - ,{13153,12713,12714,12715,12716,12717,12718,12719,12720,12931,12932,12933,12934,12935,12936,12937,12938,13149,13150,13151,13152,13153,13154,13155,13156,13367,13368,13369,13370,13371,13372,13373,13374,13585,13586,13587,13588,13589,13590,13591,13592,13803,13804,13805,13806,13807,13808,13809,13810,0} - ,{13161,12721,12722,12723,12724,12725,12726,12727,12728,12939,12940,12941,12942,12943,12944,12945,12946,13157,13158,13159,13160,13161,13162,13163,13164,13375,13376,13377,13378,13379,13380,13381,13382,13593,13594,13595,13596,13597,13598,13599,13600,13811,13812,13813,13814,13815,13816,13817,13818,0} - ,{12948,12729,12730,12731,12732,12947,12948,12949,12950,13165,13166,13167,13168,0} - ,{13603,13383,13384,13385,13386,13601,13602,13603,13604,13819,13820,13821,13822,0} - ,{0} - ,{0} - ,{4392,4173,4174,4391,4392,4393,4394,4607,4608,4609,4610,4611,4612,0} - ,{5259,5039,5040,5041,5042,5257,5258,5259,5260,5475,5476,5477,5478,0} - ,{6994,6993,6994,6995,6996,7207,7208,7209,7210,7211,7212,7213,7214,0} - ,{5694,5691,5692,5693,5694,5695,5696,5909,5910,5911,5912,5913,5914,0} - ,{7865,7425,7426,7427,7428,7429,7430,7431,7432,7643,7644,7645,7646,7647,7648,7649,7650,7861,7862,7863,7864,7865,7866,7867,7868,8079,8080,8081,8082,8083,8084,8085,8086,8297,8298,8299,8300,8301,8302,8303,8304,8515,8516,8517,8518,8519,8520,8521,8522,0} - ,{5265,4825,4826,4827,4828,4829,4830,4831,4832,5043,5044,5045,5046,5047,5048,5049,5050,5261,5262,5263,5264,5265,5266,5267,5268,5479,5480,5481,5482,5483,5484,5485,5486,5697,5698,5699,5700,5701,5702,5703,5704,5915,5916,5917,5918,5919,5920,5921,5922,0} - ,{6565,6127,6128,6129,6130,6131,6132,6343,6344,6345,6346,6347,6348,6349,6350,6561,6562,6563,6564,6565,6566,6567,6568,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6997,6998,6999,7000,7001,7002,7003,7004,7215,7216,7217,7218,7219,7220,7221,7222,0} - ,{7873,7433,7434,7435,7436,7437,7438,7439,7440,7651,7652,7653,7654,7655,7656,7657,7658,7869,7870,7871,7872,7873,7874,7875,7876,8087,8088,8089,8090,8091,8092,8093,8094,8305,8306,8307,8308,8309,8310,8311,8312,8523,8524,8525,8526,8527,8528,8529,8530,0} - ,{5273,4833,4834,4835,4836,4837,4838,4839,4840,5051,5052,5053,5054,5055,5056,5057,5058,5269,5270,5271,5272,5273,5274,5275,5276,5487,5488,5489,5490,5491,5492,5493,5494,5705,5706,5707,5708,5709,5710,5711,5712,5923,5924,5925,5926,5927,5928,5929,5930,0} - ,{6573,6133,6134,6135,6136,6137,6138,6139,6140,6351,6352,6353,6354,6355,6356,6357,6358,6569,6570,6571,6572,6573,6574,6575,6576,6787,6788,6789,6790,6791,6792,6793,6794,7005,7006,7007,7008,7009,7010,7011,7012,7223,7224,7225,7226,7227,7228,7229,7230,0} - ,{9181,8741,8742,8743,8744,8745,8746,8747,8748,8959,8960,8961,8962,8963,8964,8965,8966,9177,9178,9179,9180,9181,9182,9183,9184,9395,9396,9397,9398,9399,9400,9401,9402,9613,9614,9615,9616,9617,9618,9619,9620,9831,9832,9833,9834,9835,9836,9837,9838,0} - ,{7881,7441,7442,7443,7444,7445,7446,7447,7448,7659,7660,7661,7662,7663,7664,7665,7666,7877,7878,7879,7880,7881,7882,7883,7884,8095,8096,8097,8098,8099,8100,8101,8102,8313,8314,8315,8316,8317,8318,8319,8320,8531,8532,8533,8534,8535,8536,8537,8538,0} - ,{6581,6141,6142,6143,6144,6145,6146,6147,6148,6359,6360,6361,6362,6363,6364,6365,6366,6577,6578,6579,6580,6581,6582,6583,6584,6795,6796,6797,6798,6799,6800,6801,6802,7013,7014,7015,7016,7017,7018,7019,7020,7231,7232,7233,7234,7235,7236,7237,7238,0} - ,{9189,8749,8750,8751,8752,8753,8754,8755,8756,8967,8968,8969,8970,8971,8972,8973,8974,9185,9186,9187,9188,9189,9190,9191,9192,9403,9404,9405,9406,9407,9408,9409,9410,9621,9622,9623,9624,9625,9626,9627,9628,9839,9840,9841,9842,9843,9844,9845,9846,0} - ,{6589,6149,6150,6151,6152,6153,6154,6155,6156,6367,6368,6369,6370,6371,6372,6373,6374,6585,6586,6587,6588,6589,6590,6591,6592,6803,6804,6805,6806,6807,6808,6809,6810,7021,7022,7023,7024,7025,7026,7027,7028,7239,7240,7241,7242,7243,7244,7245,7246,0} - ,{7889,7449,7450,7451,7452,7453,7454,7455,7456,7667,7668,7669,7670,7671,7672,7673,7674,7885,7886,7887,7888,7889,7890,7891,7892,8103,8104,8105,8106,8107,8108,8109,8110,8321,8322,8323,8324,8325,8326,8327,8328,8539,8540,8541,8542,8543,8544,8545,8546,0} - ,{9197,8757,8758,8759,8760,8761,8762,8763,8764,8975,8976,8977,8978,8979,8980,8981,8982,9193,9194,9195,9196,9197,9198,9199,9200,9411,9412,9413,9414,9415,9416,9417,9418,9629,9630,9631,9632,9633,9634,9635,9636,9847,9848,9849,9850,9851,9852,9853,9854,0} - ,{7897,7457,7458,7459,7460,7461,7462,7463,7464,7675,7676,7677,7678,7679,7680,7681,7682,7893,7894,7895,7896,7897,7898,7899,7900,8111,8112,8113,8114,8115,8116,8117,8118,8329,8330,8331,8332,8333,8334,8335,8336,8547,8548,8549,8550,8551,8552,8553,8554,0} - ,{9205,8765,8766,8767,8768,8769,8770,8771,8772,8983,8984,8985,8986,8987,8988,8989,8990,9201,9202,9203,9204,9205,9206,9207,9208,9419,9420,9421,9422,9423,9424,9425,9426,9637,9638,9639,9640,9641,9642,9643,9644,9855,9856,9857,9858,9859,9860,9861,9862,0} - ,{7905,7465,7466,7467,7468,7469,7470,7471,7472,7683,7684,7685,7686,7687,7688,7689,7690,7901,7902,7903,7904,7905,7906,7907,7908,8119,8120,8121,8122,8123,8124,8125,8126,8337,8338,8339,8340,8341,8342,8343,8344,8555,8556,8557,8558,8559,8560,8561,8562,0} - ,{10513,10073,10074,10075,10076,10077,10078,10079,10080,10291,10292,10293,10294,10295,10296,10297,10298,10509,10510,10511,10512,10513,10514,10515,10516,10727,10728,10729,10730,10731,10732,10733,10734,10945,10946,10947,10948,10949,10950,10951,10952,11163,11164,11165,11166,11167,11168,11169,11170,0} - ,{9213,8773,8774,8775,8776,8777,8778,8779,8780,8991,8992,8993,8994,8995,8996,8997,8998,9209,9210,9211,9212,9213,9214,9215,9216,9427,9428,9429,9430,9431,9432,9433,9434,9645,9646,9647,9648,9649,9650,9651,9652,9863,9864,9865,9866,9867,9868,9869,9870,0} - ,{10521,10081,10082,10083,10084,10085,10086,10087,10088,10299,10300,10301,10302,10303,10304,10305,10306,10517,10518,10519,10520,10521,10522,10523,10524,10735,10736,10737,10738,10739,10740,10741,10742,10953,10954,10955,10956,10957,10958,10959,10960,11171,11172,11173,11174,11175,11176,11177,11178,0} - ,{9221,8781,8782,8783,8784,8785,8786,8787,8788,8999,9000,9001,9002,9003,9004,9005,9006,9217,9218,9219,9220,9221,9222,9223,9224,9435,9436,9437,9438,9439,9440,9441,9442,9653,9654,9655,9656,9657,9658,9659,9660,9871,9872,9873,9874,9875,9876,9877,9878,0} - ,{10529,10089,10090,10091,10092,10093,10094,10095,10096,10307,10308,10309,10310,10311,10312,10313,10314,10525,10526,10527,10528,10529,10530,10531,10532,10743,10744,10745,10746,10747,10748,10749,10750,10961,10962,10963,10964,10965,10966,10967,10968,11179,11180,11181,11182,11183,11184,11185,11186,0} - ,{10537,10097,10098,10099,10100,10101,10102,10103,10104,10315,10316,10317,10318,10319,10320,10321,10322,10533,10534,10535,10536,10537,10538,10539,10540,10751,10752,10753,10754,10755,10756,10757,10758,10969,10970,10971,10972,10973,10974,10975,10976,11187,11188,11189,11190,11191,11192,11193,11194,0} - ,{11845,11405,11406,11407,11408,11409,11410,11411,11412,11623,11624,11625,11626,11627,11628,11629,11630,11841,11842,11843,11844,11845,11846,11847,11848,12059,12060,12061,12062,12063,12064,12065,12066,12277,12278,12279,12280,12281,12282,12283,12284,12495,12496,12497,12498,12499,12500,12501,12502,0} - ,{10545,10105,10106,10107,10108,10109,10110,10111,10112,10323,10324,10325,10326,10327,10328,10329,10330,10541,10542,10543,10544,10545,10546,10547,10548,10759,10760,10761,10762,10763,10764,10765,10766,10977,10978,10979,10980,10981,10982,10983,10984,11195,11196,11197,11198,11199,11200,11201,11202,0} - ,{11853,11413,11414,11415,11416,11417,11418,11419,11420,11631,11632,11633,11634,11635,11636,11637,11638,11849,11850,11851,11852,11853,11854,11855,11856,12067,12068,12069,12070,12071,12072,12073,12074,12285,12286,12287,12288,12289,12290,12291,12292,12503,12504,12505,12506,12507,12508,12509,12510,0} - ,{11640,11421,11422,11423,11424,11639,11640,11641,11642,11857,11858,11859,11860,0} - ,{12295,12075,12076,12077,12078,12293,12294,12295,12296,12511,12512,12513,12514,0} - ,{12298,12079,12080,12081,12082,12297,12298,12299,12300,12515,12516,12733,12734,0} - ,{3742,3525,3526,3741,3742,3743,3744,3959,3960,3961,3962,4175,4176,0} - ,{1802,1801,1802,1803,1804,2017,2018,2019,2020,2021,2022,2235,2236,0} - ,{1589,1373,1374,1587,1588,1589,1590,1805,1806,1807,1808,2023,2024,0} - ,{3096,3097,3098,3099,3100,3309,3310,3311,3312,3313,3314,3315,3316,0} - ,{1810,1591,1592,1809,1810,1811,1812,2025,2026,2027,2028,2029,2030,0} - ,{3102,2883,2884,3101,3102,3103,3104,3317,3318,3319,3320,3321,3322,0} - ,{4182,3527,3528,3529,3530,3531,3532,3745,3746,3747,3748,3749,3750,3963,3964,3965,3966,3967,3968,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,0} - ,{2672,2237,2238,2239,2240,2451,2452,2453,2454,2455,2456,2457,2458,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,3105,3106,3107,3108,3109,3110,3111,3112,3323,3324,3325,3326,3327,3328,3329,3330,0} - ,{2681,2241,2242,2243,2244,2245,2246,2247,2248,2459,2460,2461,2462,2463,2464,2465,2466,2677,2678,2679,2680,2681,2682,2683,2684,2895,2896,2897,2898,2899,2900,2901,2902,3113,3114,3115,3116,3117,3118,3119,3120,3331,3332,3333,3334,3335,3336,3337,3338,0} - ,{3973,3533,3534,3535,3536,3537,3538,3539,3540,3751,3752,3753,3754,3755,3756,3757,3758,3969,3970,3971,3972,3973,3974,3975,3976,4187,4188,4189,4190,4191,4192,4193,4194,4405,4406,4407,4408,4409,4410,4411,4412,4623,4624,4625,4626,4627,4628,4629,4630,0} - ,{3981,3541,3542,3543,3544,3545,3546,3547,3548,3759,3760,3761,3762,3763,3764,3765,3766,3977,3978,3979,3980,3981,3982,3983,3984,4195,4196,4197,4198,4199,4200,4201,4202,4413,4414,4415,4416,4417,4418,4419,4420,4631,4632,4633,4634,4635,4636,4637,4638,0} - ,{5281,4841,4842,4843,4844,4845,4846,4847,4848,5059,5060,5061,5062,5063,5064,5065,5066,5277,5278,5279,5280,5281,5282,5283,5284,5495,5496,5497,5498,5499,5500,5501,5502,5713,5714,5715,5716,5717,5718,5719,5720,5931,5932,5933,5934,5935,5936,5937,5938,0} - ,{3989,3549,3550,3551,3552,3553,3554,3555,3556,3767,3768,3769,3770,3771,3772,3773,3774,3985,3986,3987,3988,3989,3990,3991,3992,4203,4204,4205,4206,4207,4208,4209,4210,4421,4422,4423,4424,4425,4426,4427,4428,4639,4640,4641,4642,4643,4644,4645,4646,0} - ,{3997,3557,3558,3559,3560,3561,3562,3563,3564,3775,3776,3777,3778,3779,3780,3781,3782,3993,3994,3995,3996,3997,3998,3999,4000,4211,4212,4213,4214,4215,4216,4217,4218,4429,4430,4431,4432,4433,4434,4435,4436,4647,4648,4649,4650,4651,4652,4653,4654,0} - ,{5289,4849,4850,4851,4852,4853,4854,4855,4856,5067,5068,5069,5070,5071,5072,5073,5074,5285,5286,5287,5288,5289,5290,5291,5292,5503,5504,5505,5506,5507,5508,5509,5510,5721,5722,5723,5724,5725,5726,5727,5728,5939,5940,5941,5942,5943,5944,5945,5946,0} - ,{5297,4857,4858,4859,4860,4861,4862,4863,4864,5075,5076,5077,5078,5079,5080,5081,5082,5293,5294,5295,5296,5297,5298,5299,5300,5511,5512,5513,5514,5515,5516,5517,5518,5729,5730,5731,5732,5733,5734,5735,5736,5947,5948,5949,5950,5951,5952,5953,5954,0} - ,{6597,6157,6158,6159,6160,6161,6162,6163,6164,6375,6376,6377,6378,6379,6380,6381,6382,6593,6594,6595,6596,6597,6598,6599,6600,6811,6812,6813,6814,6815,6816,6817,6818,7029,7030,7031,7032,7033,7034,7035,7036,7247,7248,7249,7250,7251,7252,7253,7254,0} - ,{5305,4865,4866,4867,4868,4869,4870,4871,4872,5083,5084,5085,5086,5087,5088,5089,5090,5301,5302,5303,5304,5305,5306,5307,5308,5519,5520,5521,5522,5523,5524,5525,5526,5737,5738,5739,5740,5741,5742,5743,5744,5955,5956,5957,5958,5959,5960,5961,5962,0} - ,{6605,6165,6166,6167,6168,6169,6170,6171,6172,6383,6384,6385,6386,6387,6388,6389,6390,6601,6602,6603,6604,6605,6606,6607,6608,6819,6820,6821,6822,6823,6824,6825,6826,7037,7038,7039,7040,7041,7042,7043,7044,7255,7256,7257,7258,7259,7260,7261,7262,0} - ,{6613,6173,6174,6175,6176,6177,6178,6179,6180,6391,6392,6393,6394,6395,6396,6397,6398,6609,6610,6611,6612,6613,6614,6615,6616,6827,6828,6829,6830,6831,6832,6833,6834,7045,7046,7047,7048,7049,7050,7051,7052,7263,7264,7265,7266,7267,7268,7269,7270,0} - ,{7913,7473,7474,7475,7476,7477,7478,7479,7480,7691,7692,7693,7694,7695,7696,7697,7698,7909,7910,7911,7912,7913,7914,7915,7916,8127,8128,8129,8130,8131,8132,8133,8134,8345,8346,8347,8348,8349,8350,8351,8352,8563,8564,8565,8566,8567,8568,8569,8570,0} - ,{6621,6181,6182,6183,6184,6185,6186,6187,6188,6399,6400,6401,6402,6403,6404,6405,6406,6617,6618,6619,6620,6621,6622,6623,6624,6835,6836,6837,6838,6839,6840,6841,6842,7053,7054,7055,7056,7057,7058,7059,7060,7271,7272,7273,7274,7275,7276,7277,7278,0} - ,{7921,7481,7482,7483,7484,7485,7486,7487,7488,7699,7700,7701,7702,7703,7704,7705,7706,7917,7918,7919,7920,7921,7922,7923,7924,8135,8136,8137,8138,8139,8140,8141,8142,8353,8354,8355,8356,8357,8358,8359,8360,8571,8572,8573,8574,8575,8576,8577,8578,0} - ,{7929,7489,7490,7491,7492,7493,7494,7495,7496,7707,7708,7709,7710,7711,7712,7713,7714,7925,7926,7927,7928,7929,7930,7931,7932,8143,8144,8145,8146,8147,8148,8149,8150,8361,8362,8363,8364,8365,8366,8367,8368,8579,8580,8581,8582,8583,8584,8585,8586,0} - ,{9229,8789,8790,8791,8792,8793,8794,8795,8796,9007,9008,9009,9010,9011,9012,9013,9014,9225,9226,9227,9228,9229,9230,9231,9232,9443,9444,9445,9446,9447,9448,9449,9450,9661,9662,9663,9664,9665,9666,9667,9668,9879,9880,9881,9882,9883,9884,9885,9886,0} - ,{9237,8797,8798,8799,8800,8801,8802,8803,8804,9015,9016,9017,9018,9019,9020,9021,9022,9233,9234,9235,9236,9237,9238,9239,9240,9451,9452,9453,9454,9455,9456,9457,9458,9669,9670,9671,9672,9673,9674,9675,9676,9887,9888,9889,9890,9891,9892,9893,9894,0} - ,{9245,8805,8806,8807,8808,8809,8810,8811,8812,9023,9024,9025,9026,9027,9028,9029,9030,9241,9242,9243,9244,9245,9246,9247,9248,9459,9460,9461,9462,9463,9464,9465,9466,9677,9678,9679,9680,9681,9682,9683,9684,9895,9896,9897,9898,9899,9900,9901,9902,0} - ,{10553,10113,10114,10115,10116,10117,10118,10119,10120,10331,10332,10333,10334,10335,10336,10337,10338,10549,10550,10551,10552,10553,10554,10555,10556,10767,10768,10769,10770,10771,10772,10773,10774,10985,10986,10987,10988,10989,10990,10991,10992,11203,11204,11205,11206,11207,11208,11209,11210,0} - ,{10561,10121,10122,10123,10124,10125,10126,10127,10128,10339,10340,10341,10342,10343,10344,10345,10346,10557,10558,10559,10560,10561,10562,10563,10564,10775,10776,10777,10778,10779,10780,10781,10782,10993,10994,10995,10996,10997,10998,10999,11000,11211,11212,11213,11214,11215,11216,11217,11218,0} - ,{11644,11425,11426,11427,11428,11643,11644,11645,11646,11861,11862,11863,11864,0} - ,{11648,11429,11430,11431,11432,11647,11648,11865,11866,11867,11868,12083,12084,0} - ,{11435,11433,11434,11435,11436,11437,11438,11439,11440,11649,11650,11651,11652,0} - ,{536,313,314,315,316,317,318,319,320,321,322,323,324,325,326,531,532,533,534,535,536,537,538,539,540,541,542,543,544,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,0} - ,{1380,945,946,947,948,1159,1160,1161,1162,1163,1164,1165,1166,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1813,1814,1815,1816,1817,1818,1819,1820,2031,2032,2033,2034,2035,2036,2037,2038,0} - ,{1389,949,950,951,952,953,954,955,956,1167,1168,1169,1170,1171,1172,1173,1174,1385,1386,1387,1388,1389,1390,1391,1392,1603,1604,1605,1606,1607,1608,1609,1610,1821,1822,1823,1824,1825,1826,1827,1828,2039,2040,2041,2042,2043,2044,2045,2046,0} - ,{1397,957,958,959,960,961,962,963,964,1175,1176,1177,1178,1179,1180,1181,1182,1393,1394,1395,1396,1397,1398,1399,1400,1611,1612,1613,1614,1615,1616,1617,1618,1829,1830,1831,1832,1833,1834,1835,1836,2047,2048,2049,2050,2051,2052,2053,2054,0} - ,{1405,965,966,967,968,969,970,971,972,1183,1184,1185,1186,1187,1188,1189,1190,1401,1402,1403,1404,1405,1406,1407,1408,1619,1620,1621,1622,1623,1624,1625,1626,1837,1838,1839,1840,1841,1842,1843,1844,2055,2056,2057,2058,2059,2060,2061,2062,0} - ,{1413,973,974,975,976,977,978,979,980,1191,1192,1193,1194,1195,1196,1197,1198,1409,1410,1411,1412,1413,1414,1415,1416,1627,1628,1629,1630,1631,1632,1633,1634,1845,1846,1847,1848,1849,1850,1851,1852,2063,2064,2065,2066,2067,2068,2069,2070,0} - ,{2689,2249,2250,2251,2252,2253,2254,2255,2256,2467,2468,2469,2470,2471,2472,2473,2474,2685,2686,2687,2688,2689,2690,2691,2692,2903,2904,2905,2906,2907,2908,2909,2910,3121,3122,3123,3124,3125,3126,3127,3128,3339,3340,3341,3342,3343,3344,3345,3346,0} - ,{2697,2257,2258,2259,2260,2261,2262,2263,2264,2475,2476,2477,2478,2479,2480,2481,2482,2693,2694,2695,2696,2697,2698,2699,2700,2911,2912,2913,2914,2915,2916,2917,2918,3129,3130,3131,3132,3133,3134,3135,3136,3347,3348,3349,3350,3351,3352,3353,3354,0} - ,{2705,2265,2266,2267,2268,2269,2270,2271,2272,2483,2484,2485,2486,2487,2488,2489,2490,2701,2702,2703,2704,2705,2706,2707,2708,2919,2920,2921,2922,2923,2924,2925,2926,3137,3138,3139,3140,3141,3142,3143,3144,3355,3356,3357,3358,3359,3360,3361,3362,0} - ,{2713,2273,2274,2275,2276,2277,2278,2279,2280,2491,2492,2493,2494,2495,2496,2497,2498,2709,2710,2711,2712,2713,2714,2715,2716,2927,2928,2929,2930,2931,2932,2933,2934,3145,3146,3147,3148,3149,3150,3151,3152,3363,3364,3365,3366,3367,3368,3369,3370,0} - ,{2721,2281,2282,2283,2284,2285,2286,2287,2288,2499,2500,2501,2502,2503,2504,2505,2506,2717,2718,2719,2720,2721,2722,2723,2724,2935,2936,2937,2938,2939,2940,2941,2942,3153,3154,3155,3156,3157,3158,3159,3160,3371,3372,3373,3374,3375,3376,3377,3378,0} - ,{4005,3565,3566,3567,3568,3569,3570,3571,3572,3783,3784,3785,3786,3787,3788,3789,3790,4001,4002,4003,4004,4005,4006,4007,4008,4219,4220,4221,4222,4223,4224,4225,4226,4437,4438,4439,4440,4441,4442,4443,4444,4655,4656,4657,4658,4659,4660,4661,4662,0} - ,{4013,3573,3574,3575,3576,3577,3578,3579,3580,3791,3792,3793,3794,3795,3796,3797,3798,4009,4010,4011,4012,4013,4014,4015,4016,4227,4228,4229,4230,4231,4232,4233,4234,4445,4446,4447,4448,4449,4450,4451,4452,4663,4664,4665,4666,4667,4668,4669,4670,0} - ,{4021,3581,3582,3583,3584,3585,3586,3587,3588,3799,3800,3801,3802,3803,3804,3805,3806,4017,4018,4019,4020,4021,4022,4023,4024,4235,4236,4237,4238,4239,4240,4241,4242,4453,4454,4455,4456,4457,4458,4459,4460,4671,4672,4673,4674,4675,4676,4677,4678,0} - ,{4029,3589,3590,3591,3592,3593,3594,3595,3596,3807,3808,3809,3810,3811,3812,3813,3814,4025,4026,4027,4028,4029,4030,4031,4032,4243,4244,4245,4246,4247,4248,4249,4250,4461,4462,4463,4464,4465,4466,4467,4468,4679,4680,4681,4682,4683,4684,4685,4686,0} - ,{5313,4873,4874,4875,4876,4877,4878,4879,4880,5091,5092,5093,5094,5095,5096,5097,5098,5309,5310,5311,5312,5313,5314,5315,5316,5527,5528,5529,5530,5531,5532,5533,5534,5745,5746,5747,5748,5749,5750,5751,5752,5963,5964,5965,5966,5967,5968,5969,5970,0} - ,{5321,4881,4882,4883,4884,4885,4886,4887,4888,5099,5100,5101,5102,5103,5104,5105,5106,5317,5318,5319,5320,5321,5322,5323,5324,5535,5536,5537,5538,5539,5540,5541,5542,5753,5754,5755,5756,5757,5758,5759,5760,5971,5972,5973,5974,5975,5976,5977,5978,0} - ,{5329,4889,4890,4891,4892,4893,4894,4895,4896,5107,5108,5109,5110,5111,5112,5113,5114,5325,5326,5327,5328,5329,5330,5331,5332,5543,5544,5545,5546,5547,5548,5549,5550,5761,5762,5763,5764,5765,5766,5767,5768,5979,5980,5981,5982,5983,5984,5985,5986,0} - ,{5337,4897,4898,4899,4900,4901,4902,4903,4904,5115,5116,5117,5118,5119,5120,5121,5122,5333,5334,5335,5336,5337,5338,5339,5340,5551,5552,5553,5554,5555,5556,5557,5558,5769,5770,5771,5772,5773,5774,5775,5776,5987,5988,5989,5990,5991,5992,5993,5994,0} - ,{6629,6189,6190,6191,6192,6193,6194,6195,6196,6407,6408,6409,6410,6411,6412,6413,6414,6625,6626,6627,6628,6629,6630,6631,6632,6843,6844,6845,6846,6847,6848,6849,6850,7061,7062,7063,7064,7065,7066,7067,7068,7279,7280,7281,7282,7283,7284,7285,7286,0} - ,{6637,6197,6198,6199,6200,6201,6202,6203,6204,6415,6416,6417,6418,6419,6420,6421,6422,6633,6634,6635,6636,6637,6638,6639,6640,6851,6852,6853,6854,6855,6856,6857,6858,7069,7070,7071,7072,7073,7074,7075,7076,7287,7288,7289,7290,7291,7292,7293,7294,0} - ,{6645,6205,6206,6207,6208,6209,6210,6211,6212,6423,6424,6425,6426,6427,6428,6429,6430,6641,6642,6643,6644,6645,6646,6647,6648,6859,6860,6861,6862,6863,6864,6865,6866,7077,7078,7079,7080,7081,7082,7083,7084,7295,7296,7297,7298,7299,7300,7301,7302,0} - ,{7937,7497,7498,7499,7500,7501,7502,7503,7504,7715,7716,7717,7718,7719,7720,7721,7722,7933,7934,7935,7936,7937,7938,7939,7940,8151,8152,8153,8154,8155,8156,8157,8158,8369,8370,8371,8372,8373,8374,8375,8376,8587,8588,8589,8590,8591,8592,8593,8594,0} - ,{7945,7505,7506,7507,7508,7509,7510,7511,7512,7723,7724,7725,7726,7727,7728,7729,7730,7941,7942,7943,7944,7945,7946,7947,7948,8159,8160,8161,8162,8163,8164,8165,8166,8377,8378,8379,8380,8381,8382,8383,8384,8595,8596,8597,8598,8599,8600,8601,8602,0} - ,{7953,7513,7514,7515,7516,7517,7518,7519,7520,7731,7732,7733,7734,7735,7736,7737,7738,7949,7950,7951,7952,7953,7954,7955,7956,8167,8168,8169,8170,8171,8172,8173,8174,8385,8386,8387,8388,8389,8390,8391,8392,8603,8604,8605,8606,8607,8608,8609,8610,0} - ,{9253,8813,8814,8815,8816,8817,8818,8819,8820,9031,9032,9033,9034,9035,9036,9037,9038,9249,9250,9251,9252,9253,9254,9255,9256,9467,9468,9469,9470,9471,9472,9473,9474,9685,9686,9687,9688,9689,9690,9691,9692,9903,9904,9905,9906,9907,9908,9909,9910,0} - ,{9261,8821,8822,8823,8824,8825,8826,8827,8828,9039,9040,9041,9042,9043,9044,9045,9046,9257,9258,9259,9260,9261,9262,9263,9264,9475,9476,9477,9478,9479,9480,9481,9482,9693,9694,9695,9696,9697,9698,9699,9700,9911,9912,9913,9914,9915,9916,9917,9918,0} - ,{10348,10129,10130,10131,10132,10347,10348,10349,10350,10565,10566,10567,10568,0} - ,{10352,10133,10134,10135,10136,10351,10352,10353,10354,10569,10570,10571,10572,0} - ,{11003,10783,10784,10785,10786,11001,11002,11003,11004,11219,11220,11221,11222,0} - ,{11007,10787,10788,10789,10790,11005,11006,11007,11008,11223,11224,11225,11226,0} - ,{0} - ,{553,327,328,329,330,331,332,333,334,335,336,337,338,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,0} - ,{1453,1013,1014,1015,1016,1231,1232,1233,1234,1235,1236,1237,1238,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1667,1668,1669,1670,1671,1672,1673,1674,1885,1886,1887,1888,1889,1890,1891,1892,2103,2104,2105,2106,2107,2108,2109,2110,0} - ,{1444,1005,1006,1007,1008,1009,1010,1011,1012,1223,1224,1225,1226,1227,1228,1229,1230,1441,1442,1443,1444,1445,1446,1447,1448,1659,1660,1661,1662,1663,1664,1665,1666,1877,1878,1879,1880,1881,1882,1883,1884,2095,2096,2097,2098,2099,2100,2101,2102,0} - ,{1436,997,998,999,1000,1001,1002,1003,1004,1215,1216,1217,1218,1219,1220,1221,1222,1433,1434,1435,1436,1437,1438,1439,1440,1651,1652,1653,1654,1655,1656,1657,1658,1869,1870,1871,1872,1873,1874,1875,1876,2087,2088,2089,2090,2091,2092,2093,2094,0} - ,{1428,989,990,991,992,993,994,995,996,1207,1208,1209,1210,1211,1212,1213,1214,1425,1426,1427,1428,1429,1430,1431,1432,1643,1644,1645,1646,1647,1648,1649,1650,1861,1862,1863,1864,1865,1866,1867,1868,2079,2080,2081,2082,2083,2084,2085,2086,0} - ,{1420,981,982,983,984,985,986,987,988,1199,1200,1201,1202,1203,1204,1205,1206,1417,1418,1419,1420,1421,1422,1423,1424,1635,1636,1637,1638,1639,1640,1641,1642,1853,1854,1855,1856,1857,1858,1859,1860,2071,2072,2073,2074,2075,2076,2077,2078,0} - ,{2760,2321,2322,2323,2324,2325,2326,2327,2328,2539,2540,2541,2542,2543,2544,2545,2546,2757,2758,2759,2760,2761,2762,2763,2764,2975,2976,2977,2978,2979,2980,2981,2982,3193,3194,3195,3196,3197,3198,3199,3200,3411,3412,3413,3414,3415,3416,3417,3418,0} - ,{2752,2313,2314,2315,2316,2317,2318,2319,2320,2531,2532,2533,2534,2535,2536,2537,2538,2749,2750,2751,2752,2753,2754,2755,2756,2967,2968,2969,2970,2971,2972,2973,2974,3185,3186,3187,3188,3189,3190,3191,3192,3403,3404,3405,3406,3407,3408,3409,3410,0} - ,{2744,2305,2306,2307,2308,2309,2310,2311,2312,2523,2524,2525,2526,2527,2528,2529,2530,2741,2742,2743,2744,2745,2746,2747,2748,2959,2960,2961,2962,2963,2964,2965,2966,3177,3178,3179,3180,3181,3182,3183,3184,3395,3396,3397,3398,3399,3400,3401,3402,0} - ,{2736,2297,2298,2299,2300,2301,2302,2303,2304,2515,2516,2517,2518,2519,2520,2521,2522,2733,2734,2735,2736,2737,2738,2739,2740,2951,2952,2953,2954,2955,2956,2957,2958,3169,3170,3171,3172,3173,3174,3175,3176,3387,3388,3389,3390,3391,3392,3393,3394,0} - ,{2728,2289,2290,2291,2292,2293,2294,2295,2296,2507,2508,2509,2510,2511,2512,2513,2514,2725,2726,2727,2728,2729,2730,2731,2732,2943,2944,2945,2946,2947,2948,2949,2950,3161,3162,3163,3164,3165,3166,3167,3168,3379,3380,3381,3382,3383,3384,3385,3386,0} - ,{4060,3621,3622,3623,3624,3625,3626,3627,3628,3839,3840,3841,3842,3843,3844,3845,3846,4057,4058,4059,4060,4061,4062,4063,4064,4275,4276,4277,4278,4279,4280,4281,4282,4493,4494,4495,4496,4497,4498,4499,4500,4711,4712,4713,4714,4715,4716,4717,4718,0} - ,{4052,3613,3614,3615,3616,3617,3618,3619,3620,3831,3832,3833,3834,3835,3836,3837,3838,4049,4050,4051,4052,4053,4054,4055,4056,4267,4268,4269,4270,4271,4272,4273,4274,4485,4486,4487,4488,4489,4490,4491,4492,4703,4704,4705,4706,4707,4708,4709,4710,0} - ,{4044,3605,3606,3607,3608,3609,3610,3611,3612,3823,3824,3825,3826,3827,3828,3829,3830,4041,4042,4043,4044,4045,4046,4047,4048,4259,4260,4261,4262,4263,4264,4265,4266,4477,4478,4479,4480,4481,4482,4483,4484,4695,4696,4697,4698,4699,4700,4701,4702,0} - ,{4036,3597,3598,3599,3600,3601,3602,3603,3604,3815,3816,3817,3818,3819,3820,3821,3822,4033,4034,4035,4036,4037,4038,4039,4040,4251,4252,4253,4254,4255,4256,4257,4258,4469,4470,4471,4472,4473,4474,4475,4476,4687,4688,4689,4690,4691,4692,4693,4694,0} - ,{5368,4929,4930,4931,4932,4933,4934,4935,4936,5147,5148,5149,5150,5151,5152,5153,5154,5365,5366,5367,5368,5369,5370,5371,5372,5583,5584,5585,5586,5587,5588,5589,5590,5801,5802,5803,5804,5805,5806,5807,5808,6019,6020,6021,6022,6023,6024,6025,6026,0} - ,{5360,4921,4922,4923,4924,4925,4926,4927,4928,5139,5140,5141,5142,5143,5144,5145,5146,5357,5358,5359,5360,5361,5362,5363,5364,5575,5576,5577,5578,5579,5580,5581,5582,5793,5794,5795,5796,5797,5798,5799,5800,6011,6012,6013,6014,6015,6016,6017,6018,0} - ,{5352,4913,4914,4915,4916,4917,4918,4919,4920,5131,5132,5133,5134,5135,5136,5137,5138,5349,5350,5351,5352,5353,5354,5355,5356,5567,5568,5569,5570,5571,5572,5573,5574,5785,5786,5787,5788,5789,5790,5791,5792,6003,6004,6005,6006,6007,6008,6009,6010,0} - ,{5344,4905,4906,4907,4908,4909,4910,4911,4912,5123,5124,5125,5126,5127,5128,5129,5130,5341,5342,5343,5344,5345,5346,5347,5348,5559,5560,5561,5562,5563,5564,5565,5566,5777,5778,5779,5780,5781,5782,5783,5784,5995,5996,5997,5998,5999,6000,6001,6002,0} - ,{6668,6229,6230,6231,6232,6233,6234,6235,6236,6447,6448,6449,6450,6451,6452,6453,6454,6665,6666,6667,6668,6669,6670,6671,6672,6883,6884,6885,6886,6887,6888,6889,6890,7101,7102,7103,7104,7105,7106,7107,7108,7319,7320,7321,7322,7323,7324,7325,7326,0} - ,{6660,6221,6222,6223,6224,6225,6226,6227,6228,6439,6440,6441,6442,6443,6444,6445,6446,6657,6658,6659,6660,6661,6662,6663,6664,6875,6876,6877,6878,6879,6880,6881,6882,7093,7094,7095,7096,7097,7098,7099,7100,7311,7312,7313,7314,7315,7316,7317,7318,0} - ,{6652,6213,6214,6215,6216,6217,6218,6219,6220,6431,6432,6433,6434,6435,6436,6437,6438,6649,6650,6651,6652,6653,6654,6655,6656,6867,6868,6869,6870,6871,6872,6873,6874,7085,7086,7087,7088,7089,7090,7091,7092,7303,7304,7305,7306,7307,7308,7309,7310,0} - ,{7976,7537,7538,7539,7540,7541,7542,7543,7544,7755,7756,7757,7758,7759,7760,7761,7762,7973,7974,7975,7976,7977,7978,7979,7980,8191,8192,8193,8194,8195,8196,8197,8198,8409,8410,8411,8412,8413,8414,8415,8416,8627,8628,8629,8630,8631,8632,8633,8634,0} - ,{7968,7529,7530,7531,7532,7533,7534,7535,7536,7747,7748,7749,7750,7751,7752,7753,7754,7965,7966,7967,7968,7969,7970,7971,7972,8183,8184,8185,8186,8187,8188,8189,8190,8401,8402,8403,8404,8405,8406,8407,8408,8619,8620,8621,8622,8623,8624,8625,8626,0} - ,{7960,7521,7522,7523,7524,7525,7526,7527,7528,7739,7740,7741,7742,7743,7744,7745,7746,7957,7958,7959,7960,7961,7962,7963,7964,8175,8176,8177,8178,8179,8180,8181,8182,8393,8394,8395,8396,8397,8398,8399,8400,8611,8612,8613,8614,8615,8616,8617,8618,0} - ,{9276,8837,8838,8839,8840,8841,8842,8843,8844,9055,9056,9057,9058,9059,9060,9061,9062,9273,9274,9275,9276,9277,9278,9279,9280,9491,9492,9493,9494,9495,9496,9497,9498,9709,9710,9711,9712,9713,9714,9715,9716,9927,9928,9929,9930,9931,9932,9933,9934,0} - ,{9268,8829,8830,8831,8832,8833,8834,8835,8836,9047,9048,9049,9050,9051,9052,9053,9054,9265,9266,9267,9268,9269,9270,9271,9272,9483,9484,9485,9486,9487,9488,9489,9490,9701,9702,9703,9704,9705,9706,9707,9708,9919,9920,9921,9922,9923,9924,9925,9926,0} - ,{10360,10141,10142,10143,10144,10359,10360,10361,10362,10577,10578,10579,10580,0} - ,{10356,10137,10138,10139,10140,10355,10356,10357,10358,10573,10574,10575,10576,0} - ,{11015,10795,10796,10797,10798,11013,11014,11015,11016,11231,11232,11233,11234,0} - ,{11011,10791,10792,10793,10794,11009,11010,11011,11012,11227,11228,11229,11230,0} - ,{0} - ,{1903,1901,1902,1903,1904,2119,2120,2121,2122,2123,2124,2341,2342,0} - ,{4324,4105,4106,4107,4108,4323,4324,4325,4326,4541,4542,4543,4544,0} - ,{1899,1679,1680,1681,1682,1897,1898,1899,1900,2115,2116,2117,2118,0} - ,{3223,3221,3222,3223,3224,3225,3226,3439,3440,3441,3442,3443,3444,0} - ,{1895,1675,1676,1677,1678,1893,1894,1895,1896,2111,2112,2113,2114,0} - ,{3219,2999,3000,3001,3002,3217,3218,3219,3220,3435,3436,3437,3438,0} - ,{4100,3661,3662,3663,3664,3665,3666,3667,3668,3879,3880,3881,3882,3883,3884,3885,3886,4097,4098,4099,4100,4101,4102,4103,4104,4315,4316,4317,4318,4319,4320,4321,4322,4533,4534,4535,4536,4537,4538,4539,4540,4751,4752,4753,4754,4755,4756,4757,4758,0} - ,{2777,2337,2338,2339,2340,2343,2344,2555,2556,2557,2558,2559,2560,2561,2562,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2991,2992,2993,2994,2995,2996,2997,2998,3209,3210,3211,3212,3213,3214,3215,3216,3427,3428,3429,3430,3431,3432,3433,3434,0} - ,{2768,2329,2330,2331,2332,2333,2334,2335,2336,2547,2548,2549,2550,2551,2552,2553,2554,2765,2766,2767,2768,2769,2770,2771,2772,2983,2984,2985,2986,2987,2988,2989,2990,3201,3202,3203,3204,3205,3206,3207,3208,3419,3420,3421,3422,3423,3424,3425,3426,0} - ,{4092,3653,3654,3655,3656,3657,3658,3659,3660,3871,3872,3873,3874,3875,3876,3877,3878,4089,4090,4091,4092,4093,4094,4095,4096,4307,4308,4309,4310,4311,4312,4313,4314,4525,4526,4527,4528,4529,4530,4531,4532,4743,4744,4745,4746,4747,4748,4749,4750,0} - ,{4084,3645,3646,3647,3648,3649,3650,3651,3652,3863,3864,3865,3866,3867,3868,3869,3870,4081,4082,4083,4084,4085,4086,4087,4088,4299,4300,4301,4302,4303,4304,4305,4306,4517,4518,4519,4520,4521,4522,4523,4524,4735,4736,4737,4738,4739,4740,4741,4742,0} - ,{5400,4961,4962,4963,4964,4965,4966,4967,4968,5179,5180,5181,5182,5183,5184,5185,5186,5397,5398,5399,5400,5401,5402,5403,5404,5615,5616,5617,5618,5619,5620,5621,5622,5833,5834,5835,5836,5837,5838,5839,5840,6051,6052,6053,6054,6055,6056,6057,6058,0} - ,{4076,3637,3638,3639,3640,3641,3642,3643,3644,3855,3856,3857,3858,3859,3860,3861,3862,4073,4074,4075,4076,4077,4078,4079,4080,4291,4292,4293,4294,4295,4296,4297,4298,4509,4510,4511,4512,4513,4514,4515,4516,4727,4728,4729,4730,4731,4732,4733,4734,0} - ,{4068,3629,3630,3631,3632,3633,3634,3635,3636,3847,3848,3849,3850,3851,3852,3853,3854,4065,4066,4067,4068,4069,4070,4071,4072,4283,4284,4285,4286,4287,4288,4289,4290,4501,4502,4503,4504,4505,4506,4507,4508,4719,4720,4721,4722,4723,4724,4725,4726,0} - ,{5392,4953,4954,4955,4956,4957,4958,4959,4960,5171,5172,5173,5174,5175,5176,5177,5178,5389,5390,5391,5392,5393,5394,5395,5396,5607,5608,5609,5610,5611,5612,5613,5614,5825,5826,5827,5828,5829,5830,5831,5832,6043,6044,6045,6046,6047,6048,6049,6050,0} - ,{5384,4945,4946,4947,4948,4949,4950,4951,4952,5163,5164,5165,5166,5167,5168,5169,5170,5381,5382,5383,5384,5385,5386,5387,5388,5599,5600,5601,5602,5603,5604,5605,5606,5817,5818,5819,5820,5821,5822,5823,5824,6035,6036,6037,6038,6039,6040,6041,6042,0} - ,{6700,6261,6262,6263,6264,6265,6266,6267,6268,6479,6480,6481,6482,6483,6484,6485,6486,6697,6698,6699,6700,6701,6702,6703,6704,6915,6916,6917,6918,6919,6920,6921,6922,7133,7134,7135,7136,7137,7138,7139,7140,7351,7352,7353,7354,7355,7356,7357,7358,0} - ,{5376,4937,4938,4939,4940,4941,4942,4943,4944,5155,5156,5157,5158,5159,5160,5161,5162,5373,5374,5375,5376,5377,5378,5379,5380,5591,5592,5593,5594,5595,5596,5597,5598,5809,5810,5811,5812,5813,5814,5815,5816,6027,6028,6029,6030,6031,6032,6033,6034,0} - ,{6692,6253,6254,6255,6256,6257,6258,6259,6260,6471,6472,6473,6474,6475,6476,6477,6478,6689,6690,6691,6692,6693,6694,6695,6696,6907,6908,6909,6910,6911,6912,6913,6914,7125,7126,7127,7128,7129,7130,7131,7132,7343,7344,7345,7346,7347,7348,7349,7350,0} - ,{6684,6245,6246,6247,6248,6249,6250,6251,6252,6463,6464,6465,6466,6467,6468,6469,6470,6681,6682,6683,6684,6685,6686,6687,6688,6899,6900,6901,6902,6903,6904,6905,6906,7117,7118,7119,7120,7121,7122,7123,7124,7335,7336,7337,7338,7339,7340,7341,7342,0} - ,{8000,7561,7562,7563,7564,7565,7566,7567,7568,7779,7780,7781,7782,7783,7784,7785,7786,7997,7998,7999,8000,8001,8002,8003,8004,8215,8216,8217,8218,8219,8220,8221,8222,8433,8434,8435,8436,8437,8438,8439,8440,8651,8652,8653,8654,8655,8656,8657,8658,0} - ,{6676,6237,6238,6239,6240,6241,6242,6243,6244,6455,6456,6457,6458,6459,6460,6461,6462,6673,6674,6675,6676,6677,6678,6679,6680,6891,6892,6893,6894,6895,6896,6897,6898,7109,7110,7111,7112,7113,7114,7115,7116,7327,7328,7329,7330,7331,7332,7333,7334,0} - ,{7992,7553,7554,7555,7556,7557,7558,7559,7560,7771,7772,7773,7774,7775,7776,7777,7778,7989,7990,7991,7992,7993,7994,7995,7996,8207,8208,8209,8210,8211,8212,8213,8214,8425,8426,8427,8428,8429,8430,8431,8432,8643,8644,8645,8646,8647,8648,8649,8650,0} - ,{7984,7545,7546,7547,7548,7549,7550,7551,7552,7763,7764,7765,7766,7767,7768,7769,7770,7981,7982,7983,7984,7985,7986,7987,7988,8199,8200,8201,8202,8203,8204,8205,8206,8417,8418,8419,8420,8421,8422,8423,8424,8635,8636,8637,8638,8639,8640,8641,8642,0} - ,{9300,8861,8862,8863,8864,8865,8866,8867,8868,9079,9080,9081,9082,9083,9084,9085,9086,9297,9298,9299,9300,9301,9302,9303,9304,9515,9516,9517,9518,9519,9520,9521,9522,9733,9734,9735,9736,9737,9738,9739,9740,9951,9952,9953,9954,9955,9956,9957,9958,0} - ,{9292,8853,8854,8855,8856,8857,8858,8859,8860,9071,9072,9073,9074,9075,9076,9077,9078,9289,9290,9291,9292,9293,9294,9295,9296,9507,9508,9509,9510,9511,9512,9513,9514,9725,9726,9727,9728,9729,9730,9731,9732,9943,9944,9945,9946,9947,9948,9949,9950,0} - ,{9284,8845,8846,8847,8848,8849,8850,8851,8852,9063,9064,9065,9066,9067,9068,9069,9070,9281,9282,9283,9284,9285,9286,9287,9288,9499,9500,9501,9502,9503,9504,9505,9506,9717,9718,9719,9720,9721,9722,9723,9724,9935,9936,9937,9938,9939,9940,9941,9942,0} - ,{10592,10153,10154,10155,10156,10157,10158,10159,10160,10371,10372,10373,10374,10375,10376,10377,10378,10589,10590,10591,10592,10593,10594,10595,10596,10807,10808,10809,10810,10811,10812,10813,10814,11025,11026,11027,11028,11029,11030,11031,11032,11243,11244,11245,11246,11247,11248,11249,11250,0} - ,{10584,10145,10146,10147,10148,10149,10150,10151,10152,10363,10364,10365,10366,10367,10368,10369,10370,10581,10582,10583,10584,10585,10586,10587,10588,10799,10800,10801,10802,10803,10804,10805,10806,11017,11018,11019,11020,11021,11022,11023,11024,11235,11236,11237,11238,11239,11240,11241,11242,0} - ,{11465,11463,11464,11465,11466,11467,11468,11681,11682,11683,11684,11685,11686,0} - ,{11678,11459,11460,11461,11462,11675,11676,11677,11678,11679,11680,11895,11896,0} - ,{11454,11451,11452,11453,11454,11455,11456,11457,11458,11671,11672,11673,11674,0} - ,{4764,4545,4546,4547,4548,4763,4764,4765,4766,4981,4982,4983,4984,0} - ,{5860,5423,5424,5641,5642,5859,5860,5861,5862,6077,6078,6079,6080,0} - ,{7174,6737,6738,6955,6956,7173,7174,7175,7176,7391,7392,7393,7394,0} - ,{4978,4759,4760,4761,4762,4977,4978,4979,4980,5195,5196,5197,5198,0} - ,{8048,7609,7610,7611,7612,7613,7614,7615,7616,7827,7828,7829,7830,7831,7832,7833,7834,8045,8046,8047,8048,8049,8050,8051,8052,8263,8264,8265,8266,8267,8268,8269,8270,8481,8482,8483,8484,8485,8486,8487,8488,8699,8700,8701,8702,8703,8704,8705,8706,0} - ,{5636,4985,4986,5199,5200,5201,5202,5203,5204,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,0} - ,{6732,6293,6294,6295,6296,6297,6298,6299,6300,6511,6512,6513,6514,6515,6516,6517,6518,6729,6730,6731,6732,6733,6734,6735,6736,6947,6948,6949,6950,6951,6952,6953,6954,7165,7166,7167,7168,7169,7170,7171,7172,7383,7384,7385,7386,7387,7388,7389,7390,0} - ,{8040,7601,7602,7603,7604,7605,7606,7607,7608,7819,7820,7821,7822,7823,7824,7825,7826,8037,8038,8039,8040,8041,8042,8043,8044,8255,8256,8257,8258,8259,8260,8261,8262,8473,8474,8475,8476,8477,8478,8479,8480,8691,8692,8693,8694,8695,8696,8697,8698,0} - ,{5408,4969,4970,4971,4972,4973,4974,4975,4976,5187,5188,5189,5190,5191,5192,5193,5194,5405,5406,5407,5408,5409,5410,5411,5412,5623,5624,5625,5626,5627,5628,5629,5630,5841,5842,5843,5844,5845,5846,5847,5848,6059,6060,6061,6062,6063,6064,6065,6066,0} - ,{6724,6285,6286,6287,6288,6289,6290,6291,6292,6503,6504,6505,6506,6507,6508,6509,6510,6721,6722,6723,6724,6725,6726,6727,6728,6939,6940,6941,6942,6943,6944,6945,6946,7157,7158,7159,7160,7161,7162,7163,7164,7375,7376,7377,7378,7379,7380,7381,7382,0} - ,{9348,8909,8910,8911,8912,8913,8914,8915,8916,9127,9128,9129,9130,9131,9132,9133,9134,9345,9346,9347,9348,9349,9350,9351,9352,9563,9564,9565,9566,9567,9568,9569,9570,9781,9782,9783,9784,9785,9786,9787,9788,9999,10000,10001,10002,10003,10004,10005,10006,0} - ,{8032,7593,7594,7595,7596,7597,7598,7599,7600,7811,7812,7813,7814,7815,7816,7817,7818,8029,8030,8031,8032,8033,8034,8035,8036,8247,8248,8249,8250,8251,8252,8253,8254,8465,8466,8467,8468,8469,8470,8471,8472,8683,8684,8685,8686,8687,8688,8689,8690,0} - ,{6716,6277,6278,6279,6280,6281,6282,6283,6284,6495,6496,6497,6498,6499,6500,6501,6502,6713,6714,6715,6716,6717,6718,6719,6720,6931,6932,6933,6934,6935,6936,6937,6938,7149,7150,7151,7152,7153,7154,7155,7156,7367,7368,7369,7370,7371,7372,7373,7374,0} - ,{9340,8901,8902,8903,8904,8905,8906,8907,8908,9119,9120,9121,9122,9123,9124,9125,9126,9337,9338,9339,9340,9341,9342,9343,9344,9555,9556,9557,9558,9559,9560,9561,9562,9773,9774,9775,9776,9777,9778,9779,9780,9991,9992,9993,9994,9995,9996,9997,9998,0} - ,{6708,6269,6270,6271,6272,6273,6274,6275,6276,6487,6488,6489,6490,6491,6492,6493,6494,6705,6706,6707,6708,6709,6710,6711,6712,6923,6924,6925,6926,6927,6928,6929,6930,7141,7142,7143,7144,7145,7146,7147,7148,7359,7360,7361,7362,7363,7364,7365,7366,0} - ,{8024,7585,7586,7587,7588,7589,7590,7591,7592,7803,7804,7805,7806,7807,7808,7809,7810,8021,8022,8023,8024,8025,8026,8027,8028,8239,8240,8241,8242,8243,8244,8245,8246,8457,8458,8459,8460,8461,8462,8463,8464,8675,8676,8677,8678,8679,8680,8681,8682,0} - ,{9332,8893,8894,8895,8896,8897,8898,8899,8900,9111,9112,9113,9114,9115,9116,9117,9118,9329,9330,9331,9332,9333,9334,9335,9336,9547,9548,9549,9550,9551,9552,9553,9554,9765,9766,9767,9768,9769,9770,9771,9772,9983,9984,9985,9986,9987,9988,9989,9990,0} - ,{8016,7577,7578,7579,7580,7581,7582,7583,7584,7795,7796,7797,7798,7799,7800,7801,7802,8013,8014,8015,8016,8017,8018,8019,8020,8231,8232,8233,8234,8235,8236,8237,8238,8449,8450,8451,8452,8453,8454,8455,8456,8667,8668,8669,8670,8671,8672,8673,8674,0} - ,{9324,8885,8886,8887,8888,8889,8890,8891,8892,9103,9104,9105,9106,9107,9108,9109,9110,9321,9322,9323,9324,9325,9326,9327,9328,9539,9540,9541,9542,9543,9544,9545,9546,9757,9758,9759,9760,9761,9762,9763,9764,9975,9976,9977,9978,9979,9980,9981,9982,0} - ,{8008,7569,7570,7571,7572,7573,7574,7575,7576,7787,7788,7789,7790,7791,7792,7793,7794,8005,8006,8007,8008,8009,8010,8011,8012,8223,8224,8225,8226,8227,8228,8229,8230,8441,8442,8443,8444,8445,8446,8447,8448,8659,8660,8661,8662,8663,8664,8665,8666,0} - ,{10632,10193,10194,10195,10196,10197,10198,10199,10200,10411,10412,10413,10414,10415,10416,10417,10418,10629,10630,10631,10632,10633,10634,10635,10636,10847,10848,10849,10850,10851,10852,10853,10854,11065,11066,11067,11068,11069,11070,11071,11072,11283,11284,11285,11286,11287,11288,11289,11290,0} - ,{9316,8877,8878,8879,8880,8881,8882,8883,8884,9095,9096,9097,9098,9099,9100,9101,9102,9313,9314,9315,9316,9317,9318,9319,9320,9531,9532,9533,9534,9535,9536,9537,9538,9749,9750,9751,9752,9753,9754,9755,9756,9967,9968,9969,9970,9971,9972,9973,9974,0} - ,{10624,10185,10186,10187,10188,10189,10190,10191,10192,10403,10404,10405,10406,10407,10408,10409,10410,10621,10622,10623,10624,10625,10626,10627,10628,10839,10840,10841,10842,10843,10844,10845,10846,11057,11058,11059,11060,11061,11062,11063,11064,11275,11276,11277,11278,11279,11280,11281,11282,0} - ,{9308,8869,8870,8871,8872,8873,8874,8875,8876,9087,9088,9089,9090,9091,9092,9093,9094,9305,9306,9307,9308,9309,9310,9311,9312,9523,9524,9525,9526,9527,9528,9529,9530,9741,9742,9743,9744,9745,9746,9747,9748,9959,9960,9961,9962,9963,9964,9965,9966,0} - ,{10616,10177,10178,10179,10180,10181,10182,10183,10184,10395,10396,10397,10398,10399,10400,10401,10402,10613,10614,10615,10616,10617,10618,10619,10620,10831,10832,10833,10834,10835,10836,10837,10838,11049,11050,11051,11052,11053,11054,11055,11056,11267,11268,11269,11270,11271,11272,11273,11274,0} - ,{10608,10169,10170,10171,10172,10173,10174,10175,10176,10387,10388,10389,10390,10391,10392,10393,10394,10605,10606,10607,10608,10609,10610,10611,10612,10823,10824,10825,10826,10827,10828,10829,10830,11041,11042,11043,11044,11045,11046,11047,11048,11259,11260,11261,11262,11263,11264,11265,11266,0} - ,{11916,11477,11478,11479,11480,11481,11482,11483,11484,11695,11696,11697,11698,11699,11700,11701,11702,11913,11914,11915,11916,11917,11918,11919,11920,12131,12132,12133,12134,12135,12136,12137,12138,12349,12350,12351,12352,12353,12354,12355,12356,12567,12568,12569,12570,12571,12572,12573,12574,0} - ,{10600,10161,10162,10163,10164,10165,10166,10167,10168,10379,10380,10381,10382,10383,10384,10385,10386,10597,10598,10599,10600,10601,10602,10603,10604,10815,10816,10817,10818,10819,10820,10821,10822,11033,11034,11035,11036,11037,11038,11039,11040,11251,11252,11253,11254,11255,11256,11257,11258,0} - ,{11908,11469,11470,11471,11472,11473,11474,11475,11476,11687,11688,11689,11690,11691,11692,11693,11694,11905,11906,11907,11908,11909,11910,11911,11912,12123,12124,12125,12126,12127,12128,12129,12130,12341,12342,12343,12344,12345,12346,12347,12348,12559,12560,12561,12562,12563,12564,12565,12566,0} - ,{11901,11899,11900,11901,11902,11903,11904,12117,12118,12119,12120,12121,12122,0} - ,{12337,12335,12336,12337,12338,12339,12340,12553,12554,12555,12556,12557,12558,0} - ,{12333,11897,11898,12113,12114,12115,12116,12333,12334,12551,12552,12771,12772,0} - ,{12422,11985,11986,12203,12204,12421,12422,12423,12424,12639,12640,12641,12642,0} - ,{13730,13511,13512,13513,13514,13729,13730,13731,13732,13947,13948,13949,13950,0} - ,{13076,12857,12858,12859,12860,13075,13076,13077,13078,13293,13294,13295,13296,0} - ,{9363,8271,8272,8489,8490,8491,8492,8707,8708,8709,8710,8925,8926,8927,8928,8929,8930,9143,9144,9145,9146,9361,9362,9363,9364,9365,9366,9579,9580,9581,9582,9583,9584,9797,9798,9799,9800,9801,9802,9803,9804,10015,10016,10017,10018,10019,10020,10021,10022,0} - ,{10672,10233,10234,10235,10236,10237,10238,10239,10240,10451,10452,10453,10454,10455,10456,10457,10458,10669,10670,10671,10672,10673,10674,10675,10676,10887,10888,10889,10890,10891,10892,10893,10894,11105,11106,11107,11108,11109,11110,11111,11112,11323,11324,11325,11326,11327,11328,11329,11330,0} - ,{11980,11541,11542,11543,11544,11545,11546,11547,11548,11759,11760,11761,11762,11763,11764,11765,11766,11977,11978,11979,11980,11981,11982,11983,11984,12195,12196,12197,12198,12199,12200,12201,12202,12413,12414,12415,12416,12417,12418,12419,12420,12631,12632,12633,12634,12635,12636,12637,12638,0} - ,{13288,12849,12850,12851,12852,12853,12854,12855,12856,13067,13068,13069,13070,13071,13072,13073,13074,13285,13286,13287,13288,13289,13290,13291,13292,13503,13504,13505,13506,13507,13508,13509,13510,13721,13722,13723,13724,13725,13726,13727,13728,13939,13940,13941,13942,13943,13944,13945,13946,0} - ,{9356,8917,8918,8919,8920,8921,8922,8923,8924,9135,9136,9137,9138,9139,9140,9141,9142,9353,9354,9355,9356,9357,9358,9359,9360,9571,9572,9573,9574,9575,9576,9577,9578,9789,9790,9791,9792,9793,9794,9795,9796,10007,10008,10009,10010,10011,10012,10013,10014,0} - ,{10664,10225,10226,10227,10228,10229,10230,10231,10232,10443,10444,10445,10446,10447,10448,10449,10450,10661,10662,10663,10664,10665,10666,10667,10668,10879,10880,10881,10882,10883,10884,10885,10886,11097,11098,11099,11100,11101,11102,11103,11104,11315,11316,11317,11318,11319,11320,11321,11322,0} - ,{11972,11533,11534,11535,11536,11537,11538,11539,11540,11751,11752,11753,11754,11755,11756,11757,11758,11969,11970,11971,11972,11973,11974,11975,11976,12187,12188,12189,12190,12191,12192,12193,12194,12405,12406,12407,12408,12409,12410,12411,12412,12623,12624,12625,12626,12627,12628,12629,12630,0} - ,{13280,12841,12842,12843,12844,12845,12846,12847,12848,13059,13060,13061,13062,13063,13064,13065,13066,13277,13278,13279,13280,13281,13282,13283,13284,13495,13496,13497,13498,13499,13500,13501,13502,13713,13714,13715,13716,13717,13718,13719,13720,13931,13932,13933,13934,13935,13936,13937,13938,0} - ,{10656,10217,10218,10219,10220,10221,10222,10223,10224,10435,10436,10437,10438,10439,10440,10441,10442,10653,10654,10655,10656,10657,10658,10659,10660,10871,10872,10873,10874,10875,10876,10877,10878,11089,11090,11091,11092,11093,11094,11095,11096,11307,11308,11309,11310,11311,11312,11313,11314,0} - ,{11964,11525,11526,11527,11528,11529,11530,11531,11532,11743,11744,11745,11746,11747,11748,11749,11750,11961,11962,11963,11964,11965,11966,11967,11968,12179,12180,12181,12182,12183,12184,12185,12186,12397,12398,12399,12400,12401,12402,12403,12404,12615,12616,12617,12618,12619,12620,12621,12622,0} - ,{13272,12833,12834,12835,12836,12837,12838,12839,12840,13051,13052,13053,13054,13055,13056,13057,13058,13269,13270,13271,13272,13273,13274,13275,13276,13487,13488,13489,13490,13491,13492,13493,13494,13705,13706,13707,13708,13709,13710,13711,13712,13923,13924,13925,13926,13927,13928,13929,13930,0} - ,{10648,10209,10210,10211,10212,10213,10214,10215,10216,10427,10428,10429,10430,10431,10432,10433,10434,10645,10646,10647,10648,10649,10650,10651,10652,10863,10864,10865,10866,10867,10868,10869,10870,11081,11082,11083,11084,11085,11086,11087,11088,11299,11300,11301,11302,11303,11304,11305,11306,0} - ,{11956,11517,11518,11519,11520,11521,11522,11523,11524,11735,11736,11737,11738,11739,11740,11741,11742,11953,11954,11955,11956,11957,11958,11959,11960,12171,12172,12173,12174,12175,12176,12177,12178,12389,12390,12391,12392,12393,12394,12395,12396,12607,12608,12609,12610,12611,12612,12613,12614,0} - ,{13264,12825,12826,12827,12828,12829,12830,12831,12832,13043,13044,13045,13046,13047,13048,13049,13050,13261,13262,13263,13264,13265,13266,13267,13268,13479,13480,13481,13482,13483,13484,13485,13486,13697,13698,13699,13700,13701,13702,13703,13704,13915,13916,13917,13918,13919,13920,13921,13922,0} - ,{10640,10201,10202,10203,10204,10205,10206,10207,10208,10419,10420,10421,10422,10423,10424,10425,10426,10637,10638,10639,10640,10641,10642,10643,10644,10855,10856,10857,10858,10859,10860,10861,10862,11073,11074,11075,11076,11077,11078,11079,11080,11291,11292,11293,11294,11295,11296,11297,11298,0} - ,{11948,11509,11510,11511,11512,11513,11514,11515,11516,11727,11728,11729,11730,11731,11732,11733,11734,11945,11946,11947,11948,11949,11950,11951,11952,12163,12164,12165,12166,12167,12168,12169,12170,12381,12382,12383,12384,12385,12386,12387,12388,12599,12600,12601,12602,12603,12604,12605,12606,0} - ,{13256,12817,12818,12819,12820,12821,12822,12823,12824,13035,13036,13037,13038,13039,13040,13041,13042,13253,13254,13255,13256,13257,13258,13259,13260,13471,13472,13473,13474,13475,13476,13477,13478,13689,13690,13691,13692,13693,13694,13695,13696,13907,13908,13909,13910,13911,13912,13913,13914,0} - ,{11940,11501,11502,11503,11504,11505,11506,11507,11508,11719,11720,11721,11722,11723,11724,11725,11726,11937,11938,11939,11940,11941,11942,11943,11944,12155,12156,12157,12158,12159,12160,12161,12162,12373,12374,12375,12376,12377,12378,12379,12380,12591,12592,12593,12594,12595,12596,12597,12598,0} - ,{13248,12809,12810,12811,12812,12813,12814,12815,12816,13027,13028,13029,13030,13031,13032,13033,13034,13245,13246,13247,13248,13249,13250,13251,13252,13463,13464,13465,13466,13467,13468,13469,13470,13681,13682,13683,13684,13685,13686,13687,13688,13899,13900,13901,13902,13903,13904,13905,13906,0} - ,{11932,11493,11494,11495,11496,11497,11498,11499,11500,11711,11712,11713,11714,11715,11716,11717,11718,11929,11930,11931,11932,11933,11934,11935,11936,12147,12148,12149,12150,12151,12152,12153,12154,12365,12366,12367,12368,12369,12370,12371,12372,12583,12584,12585,12586,12587,12588,12589,12590,0} - ,{13240,12801,12802,12803,12804,12805,12806,12807,12808,13019,13020,13021,13022,13023,13024,13025,13026,13237,13238,13239,13240,13241,13242,13243,13244,13455,13456,13457,13458,13459,13460,13461,13462,13673,13674,13675,13676,13677,13678,13679,13680,13891,13892,13893,13894,13895,13896,13897,13898,0} - ,{11924,11485,11486,11487,11488,11489,11490,11491,11492,11703,11704,11705,11706,11707,11708,11709,11710,11921,11922,11923,11924,11925,11926,11927,11928,12139,12140,12141,12142,12143,12144,12145,12146,12357,12358,12359,12360,12361,12362,12363,12364,12575,12576,12577,12578,12579,12580,12581,12582,0} - ,{13232,12793,12794,12795,12796,12797,12798,12799,12800,13011,13012,13013,13014,13015,13016,13017,13018,13229,13230,13231,13232,13233,13234,13235,13236,13447,13448,13449,13450,13451,13452,13453,13454,13665,13666,13667,13668,13669,13670,13671,13672,13883,13884,13885,13886,13887,13888,13889,13890,0} - ,{13224,12785,12786,12787,12788,12789,12790,12791,12792,13003,13004,13005,13006,13007,13008,13009,13010,13221,13222,13223,13224,13225,13226,13227,13228,13439,13440,13441,13442,13443,13444,13445,13446,13657,13658,13659,13660,13661,13662,13663,13664,13875,13876,13877,13878,13879,13880,13881,13882,0} - ,{13216,12777,12778,12779,12780,12781,12782,12783,12784,12995,12996,12997,12998,12999,13000,13001,13002,13213,13214,13215,13216,13217,13218,13219,13220,13431,13432,13433,13434,13435,13436,13437,13438,13649,13650,13651,13652,13653,13654,13655,13656,13867,13868,13869,13870,13871,13872,13873,13874,0} - ,{12992,12773,12774,12775,12776,12991,12992,12993,12994,13209,13210,13211,13212,0} - ,{13647,13427,13428,13429,13430,13645,13646,13647,13648,13863,13864,13865,13866,0} - }; - - static const unsigned short FCal_Bins_AC3[16*16][77] = { - {12319,11914,11915,12116,12117,12118,12318,12319,12520,12521,12522,12722,12723,12924,12925,0} - ,{14937,14326,14327,14328,14329,14330,14331,14332,14333,14334,14335,14528,14529,14530,14531,14532,14533,14534,14535,14536,14537,14730,14731,14732,14733,14734,14735,14736,14737,14738,14739,14932,14933,14934,14935,14936,14937,14938,14939,14940,14941,14942,14943,15134,15135,15136,15137,15138,15139,15140,15141,15142,15143,15336,15337,15338,15339,15340,15341,15342,15343,15344,15345,15538,15539,15540,15541,15542,15543,15744,15745,15946,15947,0} - ,{13524,13114,13115,13116,13117,13118,13119,13120,13121,13122,13123,13124,13125,13126,13127,13316,13317,13318,13319,13320,13321,13322,13323,13324,13325,13326,13327,13328,13329,13518,13519,13520,13521,13522,13523,13524,13525,13526,13527,13528,13529,13720,13721,13722,13723,13724,13725,13726,13727,13728,13729,13730,13731,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,14124,14125,14126,14127,14128,14129,14130,14131,14132,14133,0} - ,{12514,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12710,12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,0} - ,{14926,14314,14315,14316,14317,14318,14319,14320,14321,14322,14323,14324,14325,14516,14517,14518,14519,14520,14521,14522,14523,14524,14525,14526,14527,14718,14719,14720,14721,14722,14723,14724,14725,14726,14727,14728,14729,14920,14921,14922,14923,14924,14925,14926,14927,14928,14929,14930,14931,15122,15123,15124,15125,15126,15127,15128,15129,15130,15131,15132,15133,15324,15325,15326,15327,15328,15329,15330,15331,15332,15333,15334,15335,0} - ,{13714,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113,13304,13305,13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13506,13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13708,13709,13710,13711,13712,13713,13714,13715,13716,13717,13718,13719,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919,13920,13921,14112,14113,14114,14115,14116,14117,14118,14119,14120,14121,14122,14123,0} - ,{12502,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,12092,12093,12094,12095,12096,12097,12098,12099,12100,12101,12102,12103,12294,12295,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12698,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,0} - ,{14914,14302,14303,14304,14305,14306,14307,14308,14309,14310,14311,14312,14313,14504,14505,14506,14507,14508,14509,14510,14511,14512,14513,14514,14515,14706,14707,14708,14709,14710,14711,14712,14713,14714,14715,14716,14717,14908,14909,14910,14911,14912,14913,14914,14915,14916,14917,14918,14919,15110,15111,15112,15113,15114,15115,15116,15117,15118,15119,15120,15121,15312,15313,15314,15315,15316,15317,15318,15319,15320,15321,15322,15323,0} - ,{13702,13090,13091,13092,13093,13094,13095,13096,13097,13098,13099,13100,13101,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,13303,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13696,13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13898,13899,13900,13901,13902,13903,13904,13905,13906,13907,13908,13909,14100,14101,14102,14103,14104,14105,14106,14107,14108,14109,14110,14111,0} - ,{12490,11878,11879,11880,11881,11882,11883,11884,11885,11886,11887,11888,11889,12080,12081,12082,12083,12084,12085,12086,12087,12088,12089,12090,12091,12282,12283,12284,12285,12286,12287,12288,12289,12290,12291,12292,12293,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695,12696,12697,12888,12889,12890,12891,12892,12893,12894,12895,12896,12897,12898,12899,0} - ,{13689,13078,13079,13080,13081,13082,13083,13084,13085,13086,13087,13088,13089,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13482,13483,13484,13485,13486,13487,13488,13489,13490,13491,13492,13493,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13886,13887,13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,14088,14089,14090,14091,14092,14093,14094,14095,14096,14097,14098,14099,0} - ,{12477,11866,11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,12068,12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12876,12877,12878,12879,12880,12881,12882,12883,12884,12885,12886,12887,0} - ,{13677,13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13268,13269,13270,13271,13272,13273,13274,13275,13276,13277,13278,13279,13470,13471,13472,13473,13474,13475,13476,13477,13478,13479,13480,13481,13672,13673,13674,13675,13676,13677,13678,13679,13680,13681,13682,13683,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,14076,14077,14078,14079,14080,14081,14082,14083,14084,14085,14086,14087,0} - ,{12465,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,12056,12057,12058,12059,12060,12061,12062,12063,12064,12065,12066,12067,12258,12259,12260,12261,12262,12263,12264,12265,12266,12267,12268,12269,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12864,12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,0} - ,{12453,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053,12054,12055,12246,12247,12248,12249,12250,12251,12252,12253,12254,12255,12256,12257,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,12862,12863,0} - ,{12243,11838,11839,11840,11841,12042,12043,12242,12243,12244,12245,12444,12445,12446,12447,12646,12647,12648,12649,0} - ,{16146,15740,15741,15742,15743,15942,15943,15944,15945,16144,16145,16146,16147,16148,16149,16346,16347,16348,16349,0} - ,{18557,17344,17345,17346,17347,17546,17547,17548,17549,17748,17749,17750,17751,17752,17753,17950,17951,17952,17953,17954,17955,18152,18153,18154,18155,18156,18157,18158,18159,18354,18355,18356,18357,18358,18359,18556,18557,18558,18559,18560,18561,18758,18759,18760,18761,18762,18763,18960,18961,18962,18963,18964,18965,19156,19157,19158,19159,19160,19161,19162,19163,19164,19165,19358,19359,19360,19361,19362,19363,19364,19365,19564,19565,0} - ,{17150,16548,16549,16550,16551,16738,16739,16740,16741,16742,16743,16744,16745,16746,16747,16748,16749,16750,16751,16752,16753,16940,16941,16942,16943,16944,16945,16946,16947,16948,16949,16950,16951,16952,16953,16954,16955,17142,17143,17144,17145,17146,17147,17148,17149,17150,17151,17152,17153,17154,17155,17348,17349,17350,17351,17352,17353,17354,17355,17356,17357,17550,17551,17552,17553,17554,17555,17754,17755,17756,17757,17956,17957,0} - ,{18550,17938,17939,17940,17941,17942,17943,17944,17945,17946,17947,17948,17949,18140,18141,18142,18143,18144,18145,18146,18147,18148,18149,18150,18151,18342,18343,18344,18345,18346,18347,18348,18349,18350,18351,18352,18353,18544,18545,18546,18547,18548,18549,18550,18551,18552,18553,18554,18555,18746,18747,18748,18749,18750,18751,18752,18753,18754,18755,18756,18757,18948,18949,18950,18951,18952,18953,18954,18955,18956,18957,18958,18959,0} - ,{16138,15526,15527,15528,15529,15530,15531,15532,15533,15534,15535,15536,15537,15728,15729,15730,15731,15732,15733,15734,15735,15736,15737,15738,15739,15930,15931,15932,15933,15934,15935,15936,15937,15938,15939,15940,15941,16132,16133,16134,16135,16136,16137,16138,16139,16140,16141,16142,16143,16334,16335,16336,16337,16338,16339,16340,16341,16342,16343,16344,16345,16536,16537,16538,16539,16540,16541,16542,16543,16544,16545,16546,16547,0} - ,{17338,16726,16727,16728,16729,16730,16731,16732,16733,16734,16735,16736,16737,16928,16929,16930,16931,16932,16933,16934,16935,16936,16937,16938,16939,17130,17131,17132,17133,17134,17135,17136,17137,17138,17139,17140,17141,17332,17333,17334,17335,17336,17337,17338,17339,17340,17341,17342,17343,17534,17535,17536,17537,17538,17539,17540,17541,17542,17543,17544,17545,17736,17737,17738,17739,17740,17741,17742,17743,17744,17745,17746,17747,0} - ,{16126,15514,15515,15516,15517,15518,15519,15520,15521,15522,15523,15524,15525,15716,15717,15718,15719,15720,15721,15722,15723,15724,15725,15726,15727,15918,15919,15920,15921,15922,15923,15924,15925,15926,15927,15928,15929,16120,16121,16122,16123,16124,16125,16126,16127,16128,16129,16130,16131,16322,16323,16324,16325,16326,16327,16328,16329,16330,16331,16332,16333,16524,16525,16526,16527,16528,16529,16530,16531,16532,16533,16534,16535,0} - ,{17325,16714,16715,16716,16717,16718,16719,16720,16721,16722,16723,16724,16725,16916,16917,16918,16919,16920,16921,16922,16923,16924,16925,16926,16927,17118,17119,17120,17121,17122,17123,17124,17125,17126,17127,17128,17129,17320,17321,17322,17323,17324,17325,17326,17327,17328,17329,17330,17331,17522,17523,17524,17525,17526,17527,17528,17529,17530,17531,17532,17533,17724,17725,17726,17727,17728,17729,17730,17731,17732,17733,17734,17735,0} - ,{16113,15502,15503,15504,15505,15506,15507,15508,15509,15510,15511,15512,15513,15704,15705,15706,15707,15708,15709,15710,15711,15712,15713,15714,15715,15906,15907,15908,15909,15910,15911,15912,15913,15914,15915,15916,15917,16108,16109,16110,16111,16112,16113,16114,16115,16116,16117,16118,16119,16310,16311,16312,16313,16314,16315,16316,16317,16318,16319,16320,16321,16512,16513,16514,16515,16516,16517,16518,16519,16520,16521,16522,16523,0} - ,{14901,14290,14291,14292,14293,14294,14295,14296,14297,14298,14299,14300,14301,14492,14493,14494,14495,14496,14497,14498,14499,14500,14501,14502,14503,14694,14695,14696,14697,14698,14699,14700,14701,14702,14703,14704,14705,14896,14897,14898,14899,14900,14901,14902,14903,14904,14905,14906,14907,15098,15099,15100,15101,15102,15103,15104,15105,15106,15107,15108,15109,15300,15301,15302,15303,15304,15305,15306,15307,15308,15309,15310,15311,0} - ,{16101,15490,15491,15492,15493,15494,15495,15496,15497,15498,15499,15500,15501,15692,15693,15694,15695,15696,15697,15698,15699,15700,15701,15702,15703,15894,15895,15896,15897,15898,15899,15900,15901,15902,15903,15904,15905,16096,16097,16098,16099,16100,16101,16102,16103,16104,16105,16106,16107,16298,16299,16300,16301,16302,16303,16304,16305,16306,16307,16308,16309,16500,16501,16502,16503,16504,16505,16506,16507,16508,16509,16510,16511,0} - ,{14889,14278,14279,14280,14281,14282,14283,14284,14285,14286,14287,14288,14289,14480,14481,14482,14483,14484,14485,14486,14487,14488,14489,14490,14491,14682,14683,14684,14685,14686,14687,14688,14689,14690,14691,14692,14693,14884,14885,14886,14887,14888,14889,14890,14891,14892,14893,14894,14895,15086,15087,15088,15089,15090,15091,15092,15093,15094,15095,15096,15097,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,0} - ,{14877,14266,14267,14268,14269,14270,14271,14272,14273,14274,14275,14276,14277,14468,14469,14470,14471,14472,14473,14474,14475,14476,14477,14478,14479,14670,14671,14672,14673,14674,14675,14676,14677,14678,14679,14680,14681,14872,14873,14874,14875,14876,14877,14878,14879,14880,14881,14882,14883,15074,15075,15076,15077,15078,15079,15080,15081,15082,15083,15084,15085,15276,15277,15278,15279,15280,15281,15282,15283,15284,15285,15286,15287,0} - ,{13665,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065,13256,13257,13258,13259,13260,13261,13262,13263,13264,13265,13266,13267,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13660,13661,13662,13663,13664,13665,13666,13667,13668,13669,13670,13671,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871,13872,13873,14064,14065,14066,14067,14068,14069,14070,14071,14072,14073,14074,14075,0} - ,{13657,13254,13255,13452,13453,13454,13455,13456,13457,13656,13657,13658,13659,13858,13859,13860,13861,14062,14063,0} - ,{13049,12848,12849,12850,12851,13046,13047,13048,13049,13050,13051,13052,13053,13248,13249,13250,13251,13252,13253,0} - ,{19960,19150,19151,19152,19153,19154,19155,19352,19353,19354,19355,19356,19357,19554,19555,19556,19557,19558,19559,19560,19561,19562,19563,19756,19757,19758,19759,19760,19761,19762,19763,19764,19765,19766,19767,19958,19959,19960,19961,19962,19963,19964,19965,20160,20161,20162,20163,20164,20165,20166,20167,20356,20357,20358,20359,20360,20361,20362,20363,20364,20365,20560,20561,20562,20563,20564,20565,20566,20567,20762,20763,20764,20765,0} - ,{21555,20944,20945,20946,20947,20948,20949,20950,20951,20952,20953,20954,20955,21146,21147,21148,21149,21150,21151,21152,21153,21154,21155,21156,21157,21348,21349,21350,21351,21352,21353,21354,21355,21356,21357,21358,21359,21548,21549,21550,21551,21552,21553,21554,21555,21556,21557,21558,21559,21560,21561,21752,21753,21754,21755,21756,21757,21758,21759,21760,21761,21762,21763,21764,21765,21954,21955,21956,21957,21958,21959,21960,21961,0} - ,{20752,20338,20339,20340,20341,20342,20343,20344,20345,20346,20347,20348,20349,20350,20351,20352,20353,20354,20355,20540,20541,20542,20543,20544,20545,20546,20547,20548,20549,20550,20551,20552,20553,20554,20555,20556,20557,20558,20559,20742,20743,20744,20745,20746,20747,20748,20749,20750,20751,20752,20753,20754,20755,20756,20757,20758,20759,20760,20761,20956,20957,20958,20959,20960,20961,20962,20963,21158,21159,21160,21161,21360,21361,0} - ,{19749,19138,19139,19140,19141,19142,19143,19144,19145,19146,19147,19148,19149,19340,19341,19342,19343,19344,19345,19346,19347,19348,19349,19350,19351,19542,19543,19544,19545,19546,19547,19548,19549,19550,19551,19552,19553,19744,19745,19746,19747,19748,19749,19750,19751,19752,19753,19754,19755,19946,19947,19948,19949,19950,19951,19952,19953,19954,19955,19956,19957,20148,20149,20150,20151,20152,20153,20154,20155,20156,20157,20158,20159,0} - ,{19737,19126,19127,19128,19129,19130,19131,19132,19133,19134,19135,19136,19137,19328,19329,19330,19331,19332,19333,19334,19335,19336,19337,19338,19339,19530,19531,19532,19533,19534,19535,19536,19537,19538,19539,19540,19541,19732,19733,19734,19735,19736,19737,19738,19739,19740,19741,19742,19743,19934,19935,19936,19937,19938,19939,19940,19941,19942,19943,19944,19945,20136,20137,20138,20139,20140,20141,20142,20143,20144,20145,20146,20147,0} - ,{18537,17926,17927,17928,17929,17930,17931,17932,17933,17934,17935,17936,17937,18128,18129,18130,18131,18132,18133,18134,18135,18136,18137,18138,18139,18330,18331,18332,18333,18334,18335,18336,18337,18338,18339,18340,18341,18532,18533,18534,18535,18536,18537,18538,18539,18540,18541,18542,18543,18734,18735,18736,18737,18738,18739,18740,18741,18742,18743,18744,18745,18936,18937,18938,18939,18940,18941,18942,18943,18944,18945,18946,18947,0} - ,{19725,19114,19115,19116,19117,19118,19119,19120,19121,19122,19123,19124,19125,19316,19317,19318,19319,19320,19321,19322,19323,19324,19325,19326,19327,19518,19519,19520,19521,19522,19523,19524,19525,19526,19527,19528,19529,19720,19721,19722,19723,19724,19725,19726,19727,19728,19729,19730,19731,19922,19923,19924,19925,19926,19927,19928,19929,19930,19931,19932,19933,20124,20125,20126,20127,20128,20129,20130,20131,20132,20133,20134,20135,0} - ,{18525,17914,17915,17916,17917,17918,17919,17920,17921,17922,17923,17924,17925,18116,18117,18118,18119,18120,18121,18122,18123,18124,18125,18126,18127,18318,18319,18320,18321,18322,18323,18324,18325,18326,18327,18328,18329,18520,18521,18522,18523,18524,18525,18526,18527,18528,18529,18530,18531,18722,18723,18724,18725,18726,18727,18728,18729,18730,18731,18732,18733,18924,18925,18926,18927,18928,18929,18930,18931,18932,18933,18934,18935,0} - ,{18513,17902,17903,17904,17905,17906,17907,17908,17909,17910,17911,17912,17913,18104,18105,18106,18107,18108,18109,18110,18111,18112,18113,18114,18115,18306,18307,18308,18309,18310,18311,18312,18313,18314,18315,18316,18317,18508,18509,18510,18511,18512,18513,18514,18515,18516,18517,18518,18519,18710,18711,18712,18713,18714,18715,18716,18717,18718,18719,18720,18721,18912,18913,18914,18915,18916,18917,18918,18919,18920,18921,18922,18923,0} - ,{17313,16702,16703,16704,16705,16706,16707,16708,16709,16710,16711,16712,16713,16904,16905,16906,16907,16908,16909,16910,16911,16912,16913,16914,16915,17106,17107,17108,17109,17110,17111,17112,17113,17114,17115,17116,17117,17308,17309,17310,17311,17312,17313,17314,17315,17316,17317,17318,17319,17510,17511,17512,17513,17514,17515,17516,17517,17518,17519,17520,17521,17712,17713,17714,17715,17716,17717,17718,17719,17720,17721,17722,17723,0} - ,{17301,16690,16691,16692,16693,16694,16695,16696,16697,16698,16699,16700,16701,16892,16893,16894,16895,16896,16897,16898,16899,16900,16901,16902,16903,17094,17095,17096,17097,17098,17099,17100,17101,17102,17103,17104,17105,17296,17297,17298,17299,17300,17301,17302,17303,17304,17305,17306,17307,17498,17499,17500,17501,17502,17503,17504,17505,17506,17507,17508,17509,17700,17701,17702,17703,17704,17705,17706,17707,17708,17709,17710,17711,0} - ,{16089,15478,15479,15480,15481,15482,15483,15484,15485,15486,15487,15488,15489,15680,15681,15682,15683,15684,15685,15686,15687,15688,15689,15690,15691,15882,15883,15884,15885,15886,15887,15888,15889,15890,15891,15892,15893,16084,16085,16086,16087,16088,16089,16090,16091,16092,16093,16094,16095,16286,16287,16288,16289,16290,16291,16292,16293,16294,16295,16296,16297,16488,16489,16490,16491,16492,16493,16494,16495,16496,16497,16498,16499,0} - ,{16077,15466,15467,15468,15469,15470,15471,15472,15473,15474,15475,15476,15477,15668,15669,15670,15671,15672,15673,15674,15675,15676,15677,15678,15679,15870,15871,15872,15873,15874,15875,15876,15877,15878,15879,15880,15881,16072,16073,16074,16075,16076,16077,16078,16079,16080,16081,16082,16083,16274,16275,16276,16277,16278,16279,16280,16281,16282,16283,16284,16285,16476,16477,16478,16479,16480,16481,16482,16483,16484,16485,16486,16487,0} - ,{14865,14254,14255,14256,14257,14258,14259,14260,14261,14262,14263,14264,14265,14456,14457,14458,14459,14460,14461,14462,14463,14464,14465,14466,14467,14658,14659,14660,14661,14662,14663,14664,14665,14666,14667,14668,14669,14860,14861,14862,14863,14864,14865,14866,14867,14868,14869,14870,14871,15062,15063,15064,15065,15066,15067,15068,15069,15070,15071,15072,15073,15264,15265,15266,15267,15268,15269,15270,15271,15272,15273,15274,15275,0} - ,{13652,13448,13449,13450,13451,13650,13651,13652,13653,13654,13655,13854,13855,13856,13857,14058,14059,14060,14061,0} - ,{14051,13848,13849,13850,13851,13852,13853,14046,14047,14048,14049,14050,14051,14052,14053,14054,14055,14056,14057,0} - ,{22936,22732,22733,22734,22735,22736,22737,22934,22935,22936,22937,22938,22939,23136,23137,23138,23139,23140,23141,0} - ,{22930,22726,22727,22728,22729,22730,22731,22928,22929,22930,22931,22932,22933,23130,23131,23132,23133,23134,23135,0} - ,{22147,21538,21539,21540,21541,21542,21543,21544,21545,21546,21547,21740,21741,21742,21743,21744,21745,21746,21747,21748,21749,21750,21751,21942,21943,21944,21945,21946,21947,21948,21949,21950,21951,21952,21953,22142,22143,22144,22145,22146,22147,22148,22149,22150,22151,22152,22153,22154,22155,22342,22343,22344,22345,22346,22347,22348,22349,22350,22351,22352,22353,22544,22545,22546,22547,22548,22549,22550,22551,22552,22553,22554,22555,0} - ,{22136,21526,21527,21528,21529,21530,21531,21532,21533,21534,21535,21536,21537,21728,21729,21730,21731,21732,21733,21734,21735,21736,21737,21738,21739,21930,21931,21932,21933,21934,21935,21936,21937,21938,21939,21940,21941,22132,22133,22134,22135,22136,22137,22138,22139,22140,22141,22334,22335,22336,22337,22338,22339,22340,22341,22536,22537,22538,22539,22540,22541,22542,22543,22738,22739,22740,22741,22742,22743,22744,22745,22940,22941,0} - ,{22125,21514,21515,21516,21517,21518,21519,21520,21521,21522,21523,21524,21525,21716,21717,21718,21719,21720,21721,21722,21723,21724,21725,21726,21727,21918,21919,21920,21921,21922,21923,21924,21925,21926,21927,21928,21929,22120,22121,22122,22123,22124,22125,22126,22127,22128,22129,22130,22131,22322,22323,22324,22325,22326,22327,22328,22329,22330,22331,22332,22333,22524,22525,22526,22527,22528,22529,22530,22531,22532,22533,22534,22535,0} - ,{20937,20326,20327,20328,20329,20330,20331,20332,20333,20334,20335,20336,20337,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20538,20539,20730,20731,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20932,20933,20934,20935,20936,20937,20938,20939,20940,20941,20942,20943,21134,21135,21136,21137,21138,21139,21140,21141,21142,21143,21144,21145,21336,21337,21338,21339,21340,21341,21342,21343,21344,21345,21346,21347,0} - ,{20925,20314,20315,20316,20317,20318,20319,20320,20321,20322,20323,20324,20325,20516,20517,20518,20519,20520,20521,20522,20523,20524,20525,20526,20527,20718,20719,20720,20721,20722,20723,20724,20725,20726,20727,20728,20729,20920,20921,20922,20923,20924,20925,20926,20927,20928,20929,20930,20931,21122,21123,21124,21125,21126,21127,21128,21129,21130,21131,21132,21133,21324,21325,21326,21327,21328,21329,21330,21331,21332,21333,21334,21335,0} - ,{20913,20302,20303,20304,20305,20306,20307,20308,20309,20310,20311,20312,20313,20504,20505,20506,20507,20508,20509,20510,20511,20512,20513,20514,20515,20706,20707,20708,20709,20710,20711,20712,20713,20714,20715,20716,20717,20908,20909,20910,20911,20912,20913,20914,20915,20916,20917,20918,20919,21110,21111,21112,21113,21114,21115,21116,21117,21118,21119,21120,21121,21312,21313,21314,21315,21316,21317,21318,21319,21320,21321,21322,21323,0} - ,{19713,19102,19103,19104,19105,19106,19107,19108,19109,19110,19111,19112,19113,19304,19305,19306,19307,19308,19309,19310,19311,19312,19313,19314,19315,19506,19507,19508,19509,19510,19511,19512,19513,19514,19515,19516,19517,19708,19709,19710,19711,19712,19713,19714,19715,19716,19717,19718,19719,19910,19911,19912,19913,19914,19915,19916,19917,19918,19919,19920,19921,20112,20113,20114,20115,20116,20117,20118,20119,20120,20121,20122,20123,0} - ,{19701,19090,19091,19092,19093,19094,19095,19096,19097,19098,19099,19100,19101,19292,19293,19294,19295,19296,19297,19298,19299,19300,19301,19302,19303,19494,19495,19496,19497,19498,19499,19500,19501,19502,19503,19504,19505,19696,19697,19698,19699,19700,19701,19702,19703,19704,19705,19706,19707,19898,19899,19900,19901,19902,19903,19904,19905,19906,19907,19908,19909,20100,20101,20102,20103,20104,20105,20106,20107,20108,20109,20110,20111,0} - ,{18501,17890,17891,17892,17893,17894,17895,17896,17897,17898,17899,17900,17901,18092,18093,18094,18095,18096,18097,18098,18099,18100,18101,18102,18103,18294,18295,18296,18297,18298,18299,18300,18301,18302,18303,18304,18305,18496,18497,18498,18499,18500,18501,18502,18503,18504,18505,18506,18507,18698,18699,18700,18701,18702,18703,18704,18705,18706,18707,18708,18709,18900,18901,18902,18903,18904,18905,18906,18907,18908,18909,18910,18911,0} - ,{18489,17878,17879,17880,17881,17882,17883,17884,17885,17886,17887,17888,17889,18080,18081,18082,18083,18084,18085,18086,18087,18088,18089,18090,18091,18282,18283,18284,18285,18286,18287,18288,18289,18290,18291,18292,18293,18484,18485,18486,18487,18488,18489,18490,18491,18492,18493,18494,18495,18686,18687,18688,18689,18690,18691,18692,18693,18694,18695,18696,18697,18888,18889,18890,18891,18892,18893,18894,18895,18896,18897,18898,18899,0} - ,{17289,16678,16679,16680,16681,16682,16683,16684,16685,16686,16687,16688,16689,16880,16881,16882,16883,16884,16885,16886,16887,16888,16889,16890,16891,17082,17083,17084,17085,17086,17087,17088,17089,17090,17091,17092,17093,17284,17285,17286,17287,17288,17289,17290,17291,17292,17293,17294,17295,17486,17487,17488,17489,17490,17491,17492,17493,17494,17495,17496,17497,17688,17689,17690,17691,17692,17693,17694,17695,17696,17697,17698,17699,0} - ,{17277,16666,16667,16668,16669,16670,16671,16672,16673,16674,16675,16676,16677,16868,16869,16870,16871,16872,16873,16874,16875,16876,16877,16878,16879,17070,17071,17072,17073,17074,17075,17076,17077,17078,17079,17080,17081,17272,17273,17274,17275,17276,17277,17278,17279,17280,17281,17282,17283,17474,17475,17476,17477,17478,17479,17480,17481,17482,17483,17484,17485,17676,17677,17678,17679,17680,17681,17682,17683,17684,17685,17686,17687,0} - ,{16065,15454,15455,15456,15457,15458,15459,15460,15461,15462,15463,15464,15465,15656,15657,15658,15659,15660,15661,15662,15663,15664,15665,15666,15667,15858,15859,15860,15861,15862,15863,15864,15865,15866,15867,15868,15869,16060,16061,16062,16063,16064,16065,16066,16067,16068,16069,16070,16071,16262,16263,16264,16265,16266,16267,16268,16269,16270,16271,16272,16273,16464,16465,16466,16467,16468,16469,16470,16471,16472,16473,16474,16475,0} - ,{14853,14242,14243,14244,14245,14246,14247,14248,14249,14250,14251,14252,14253,14444,14445,14446,14447,14448,14449,14450,14451,14452,14453,14454,14455,14646,14647,14648,14649,14650,14651,14652,14653,14654,14655,14656,14657,14848,14849,14850,14851,14852,14853,14854,14855,14856,14857,14858,14859,15050,15051,15052,15053,15054,15055,15056,15057,15058,15059,15060,15061,15252,15253,15254,15255,15256,15257,15258,15259,15260,15261,15262,15263,0} - ,{22918,22714,22715,22716,22717,22718,22719,22916,22917,22918,22919,22920,22921,23118,23119,23120,23121,23122,23123,0} - ,{22924,22720,22721,22722,22723,22724,22725,22922,22923,22924,22925,22926,22927,23124,23125,23126,23127,23128,23129,0} - ,{22090,21478,21479,21480,21481,21482,21483,21484,21485,21486,21487,21488,21489,21680,21681,21682,21683,21684,21685,21686,21687,21688,21689,21690,21691,21882,21883,21884,21885,21886,21887,21888,21889,21890,21891,21892,21893,22086,22087,22088,22089,22090,22091,22092,22093,22094,22095,22096,22097,22098,22099,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22494,22495,22496,22497,22498,22499,22500,22501,22502,22503,0} - ,{22101,21490,21491,21492,21493,21494,21495,21496,21497,21498,21499,21500,21501,21692,21693,21694,21695,21696,21697,21698,21699,21700,21701,21702,21703,21894,21895,21896,21897,21898,21899,21900,21901,21902,21903,21904,21905,22100,22101,22102,22103,22104,22105,22106,22107,22300,22301,22302,22303,22304,22305,22306,22307,22308,22309,22504,22505,22506,22507,22508,22509,22510,22511,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,0} - ,{22112,21502,21503,21504,21505,21506,21507,21508,21509,21510,21511,21512,21513,21704,21705,21706,21707,21708,21709,21710,21711,21712,21713,21714,21715,21906,21907,21908,21909,21910,21911,21912,21913,21914,21915,21916,21917,22108,22109,22110,22111,22112,22113,22114,22115,22116,22117,22118,22119,22310,22311,22312,22313,22314,22315,22316,22317,22318,22319,22320,22321,22512,22513,22514,22515,22516,22517,22518,22519,22520,22521,22522,22523,0} - ,{20876,20266,20267,20268,20269,20270,20271,20272,20273,20274,20275,20276,20277,20468,20469,20470,20471,20472,20473,20474,20475,20476,20477,20478,20479,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20872,20873,20874,20875,20876,20877,20878,20879,20880,20881,20882,20883,21074,21075,21076,21077,21078,21079,21080,21081,21082,21083,21084,21085,21276,21277,21278,21279,21280,21281,21282,21283,21284,21285,21286,21287,0} - ,{20888,20278,20279,20280,20281,20282,20283,20284,20285,20286,20287,20288,20289,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20682,20683,20684,20685,20686,20687,20688,20689,20690,20691,20692,20693,20884,20885,20886,20887,20888,20889,20890,20891,20892,20893,20894,20895,21086,21087,21088,21089,21090,21091,21092,21093,21094,21095,21096,21097,21288,21289,21290,21291,21292,21293,21294,21295,21296,21297,21298,21299,0} - ,{20900,20290,20291,20292,20293,20294,20295,20296,20297,20298,20299,20300,20301,20492,20493,20494,20495,20496,20497,20498,20499,20500,20501,20502,20503,20694,20695,20696,20697,20698,20699,20700,20701,20702,20703,20704,20705,20896,20897,20898,20899,20900,20901,20902,20903,20904,20905,20906,20907,21098,21099,21100,21101,21102,21103,21104,21105,21106,21107,21108,21109,21300,21301,21302,21303,21304,21305,21306,21307,21308,21309,21310,21311,0} - ,{19676,19066,19067,19068,19069,19070,19071,19072,19073,19074,19075,19076,19077,19268,19269,19270,19271,19272,19273,19274,19275,19276,19277,19278,19279,19470,19471,19472,19473,19474,19475,19476,19477,19478,19479,19480,19481,19672,19673,19674,19675,19676,19677,19678,19679,19680,19681,19682,19683,19874,19875,19876,19877,19878,19879,19880,19881,19882,19883,19884,19885,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,0} - ,{19688,19078,19079,19080,19081,19082,19083,19084,19085,19086,19087,19088,19089,19280,19281,19282,19283,19284,19285,19286,19287,19288,19289,19290,19291,19482,19483,19484,19485,19486,19487,19488,19489,19490,19491,19492,19493,19684,19685,19686,19687,19688,19689,19690,19691,19692,19693,19694,19695,19886,19887,19888,19889,19890,19891,19892,19893,19894,19895,19896,19897,20088,20089,20090,20091,20092,20093,20094,20095,20096,20097,20098,20099,0} - ,{18464,17854,17855,17856,17857,17858,17859,17860,17861,17862,17863,17864,17865,18056,18057,18058,18059,18060,18061,18062,18063,18064,18065,18066,18067,18258,18259,18260,18261,18262,18263,18264,18265,18266,18267,18268,18269,18460,18461,18462,18463,18464,18465,18466,18467,18468,18469,18470,18471,18662,18663,18664,18665,18666,18667,18668,18669,18670,18671,18672,18673,18864,18865,18866,18867,18868,18869,18870,18871,18872,18873,18874,18875,0} - ,{18476,17866,17867,17868,17869,17870,17871,17872,17873,17874,17875,17876,17877,18068,18069,18070,18071,18072,18073,18074,18075,18076,18077,18078,18079,18270,18271,18272,18273,18274,18275,18276,18277,18278,18279,18280,18281,18472,18473,18474,18475,18476,18477,18478,18479,18480,18481,18482,18483,18674,18675,18676,18677,18678,18679,18680,18681,18682,18683,18684,18685,18876,18877,18878,18879,18880,18881,18882,18883,18884,18885,18886,18887,0} - ,{17252,16642,16643,16644,16645,16646,16647,16648,16649,16650,16651,16652,16653,16844,16845,16846,16847,16848,16849,16850,16851,16852,16853,16854,16855,17046,17047,17048,17049,17050,17051,17052,17053,17054,17055,17056,17057,17248,17249,17250,17251,17252,17253,17254,17255,17256,17257,17258,17259,17450,17451,17452,17453,17454,17455,17456,17457,17458,17459,17460,17461,17652,17653,17654,17655,17656,17657,17658,17659,17660,17661,17662,17663,0} - ,{17264,16654,16655,16656,16657,16658,16659,16660,16661,16662,16663,16664,16665,16856,16857,16858,16859,16860,16861,16862,16863,16864,16865,16866,16867,17058,17059,17060,17061,17062,17063,17064,17065,17066,17067,17068,17069,17260,17261,17262,17263,17264,17265,17266,17267,17268,17269,17270,17271,17462,17463,17464,17465,17466,17467,17468,17469,17470,17471,17472,17473,17664,17665,17666,17667,17668,17669,17670,17671,17672,17673,17674,17675,0} - ,{16052,15442,15443,15444,15445,15446,15447,15448,15449,15450,15451,15452,15453,15644,15645,15646,15647,15648,15649,15650,15651,15652,15653,15654,15655,15846,15847,15848,15849,15850,15851,15852,15853,15854,15855,15856,15857,16048,16049,16050,16051,16052,16053,16054,16055,16056,16057,16058,16059,16250,16251,16252,16253,16254,16255,16256,16257,16258,16259,16260,16261,16452,16453,16454,16455,16456,16457,16458,16459,16460,16461,16462,16463,0} - ,{14840,14230,14231,14232,14233,14234,14235,14236,14237,14238,14239,14240,14241,14432,14433,14434,14435,14436,14437,14438,14439,14440,14441,14442,14443,14634,14635,14636,14637,14638,14639,14640,14641,14642,14643,14644,14645,14836,14837,14838,14839,14840,14841,14842,14843,14844,14845,14846,14847,15038,15039,15040,15041,15042,15043,15044,15045,15046,15047,15048,15049,15240,15241,15242,15243,15244,15245,15246,15247,15248,15249,15250,15251,0} - ,{19629,19020,19021,19022,19023,19024,19025,19026,19027,19028,19029,19222,19223,19224,19225,19226,19227,19228,19229,19230,19231,19422,19423,19424,19425,19426,19427,19428,19429,19430,19431,19432,19433,19626,19627,19628,19629,19630,19631,19632,19633,19634,19635,19828,19829,19830,19831,19832,19833,19834,19835,19836,19837,20034,20035,20036,20037,20038,20039,20236,20237,20238,20239,20240,20241,20242,20243,20442,20443,20444,20445,20646,20647,0} - ,{20856,20244,20245,20246,20247,20248,20249,20250,20251,20252,20253,20446,20447,20448,20449,20450,20451,20452,20453,20454,20455,20648,20649,20650,20651,20652,20653,20654,20655,20656,20657,20852,20853,20854,20855,20856,20857,20858,20859,20860,20861,20862,20863,20864,20865,21056,21057,21058,21059,21060,21061,21062,21063,21064,21065,21066,21067,21262,21263,21264,21265,21266,21267,21268,21269,21466,21467,21468,21469,21470,21471,21672,21673,0} - ,{20865,20254,20255,20256,20257,20258,20259,20260,20261,20262,20263,20264,20265,20456,20457,20458,20459,20460,20461,20462,20463,20464,20465,20466,20467,20658,20659,20660,20661,20662,20663,20664,20665,20666,20667,20668,20669,20866,20867,20868,20869,20870,20871,21068,21069,21070,21071,21072,21073,21270,21271,21272,21273,21274,21275,21472,21473,21474,21475,21476,21477,21674,21675,21676,21677,21678,21679,21876,21877,21878,21879,21880,21881,0} - ,{19640,19030,19031,19032,19033,19034,19035,19036,19037,19038,19039,19040,19041,19232,19233,19234,19235,19236,19237,19238,19239,19240,19241,19242,19243,19434,19435,19436,19437,19438,19439,19440,19441,19442,19443,19444,19445,19636,19637,19638,19639,19640,19641,19642,19643,19644,19645,19646,19647,19838,19839,19840,19841,19842,19843,19844,19845,19846,19847,19848,19849,20040,20041,20042,20043,20044,20045,20046,20047,20048,20049,20050,20051,0} - ,{19652,19042,19043,19044,19045,19046,19047,19048,19049,19050,19051,19052,19053,19244,19245,19246,19247,19248,19249,19250,19251,19252,19253,19254,19255,19446,19447,19448,19449,19450,19451,19452,19453,19454,19455,19456,19457,19648,19649,19650,19651,19652,19653,19654,19655,19656,19657,19658,19659,19850,19851,19852,19853,19854,19855,19856,19857,19858,19859,19860,19861,20052,20053,20054,20055,20056,20057,20058,20059,20060,20061,20062,20063,0} - ,{18428,17818,17819,17820,17821,17822,17823,17824,17825,17826,17827,17828,17829,18020,18021,18022,18023,18024,18025,18026,18027,18028,18029,18030,18031,18222,18223,18224,18225,18226,18227,18228,18229,18230,18231,18232,18233,18424,18425,18426,18427,18428,18429,18430,18431,18432,18433,18434,18435,18626,18627,18628,18629,18630,18631,18632,18633,18634,18635,18636,18637,18828,18829,18830,18831,18832,18833,18834,18835,18836,18837,18838,18839,0} - ,{19664,19054,19055,19056,19057,19058,19059,19060,19061,19062,19063,19064,19065,19256,19257,19258,19259,19260,19261,19262,19263,19264,19265,19266,19267,19458,19459,19460,19461,19462,19463,19464,19465,19466,19467,19468,19469,19660,19661,19662,19663,19664,19665,19666,19667,19668,19669,19670,19671,19862,19863,19864,19865,19866,19867,19868,19869,19870,19871,19872,19873,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,0} - ,{18440,17830,17831,17832,17833,17834,17835,17836,17837,17838,17839,17840,17841,18032,18033,18034,18035,18036,18037,18038,18039,18040,18041,18042,18043,18234,18235,18236,18237,18238,18239,18240,18241,18242,18243,18244,18245,18436,18437,18438,18439,18440,18441,18442,18443,18444,18445,18446,18447,18638,18639,18640,18641,18642,18643,18644,18645,18646,18647,18648,18649,18840,18841,18842,18843,18844,18845,18846,18847,18848,18849,18850,18851,0} - ,{18452,17842,17843,17844,17845,17846,17847,17848,17849,17850,17851,17852,17853,18044,18045,18046,18047,18048,18049,18050,18051,18052,18053,18054,18055,18246,18247,18248,18249,18250,18251,18252,18253,18254,18255,18256,18257,18448,18449,18450,18451,18452,18453,18454,18455,18456,18457,18458,18459,18650,18651,18652,18653,18654,18655,18656,18657,18658,18659,18660,18661,18852,18853,18854,18855,18856,18857,18858,18859,18860,18861,18862,18863,0} - ,{17228,16618,16619,16620,16621,16622,16623,16624,16625,16626,16627,16628,16629,16820,16821,16822,16823,16824,16825,16826,16827,16828,16829,16830,16831,17022,17023,17024,17025,17026,17027,17028,17029,17030,17031,17032,17033,17224,17225,17226,17227,17228,17229,17230,17231,17232,17233,17234,17235,17426,17427,17428,17429,17430,17431,17432,17433,17434,17435,17436,17437,17628,17629,17630,17631,17632,17633,17634,17635,17636,17637,17638,17639,0} - ,{17240,16630,16631,16632,16633,16634,16635,16636,16637,16638,16639,16640,16641,16832,16833,16834,16835,16836,16837,16838,16839,16840,16841,16842,16843,17034,17035,17036,17037,17038,17039,17040,17041,17042,17043,17044,17045,17236,17237,17238,17239,17240,17241,17242,17243,17244,17245,17246,17247,17438,17439,17440,17441,17442,17443,17444,17445,17446,17447,17448,17449,17640,17641,17642,17643,17644,17645,17646,17647,17648,17649,17650,17651,0} - ,{16028,15418,15419,15420,15421,15422,15423,15424,15425,15426,15427,15428,15429,15620,15621,15622,15623,15624,15625,15626,15627,15628,15629,15630,15631,15822,15823,15824,15825,15826,15827,15828,15829,15830,15831,15832,15833,16024,16025,16026,16027,16028,16029,16030,16031,16032,16033,16034,16035,16226,16227,16228,16229,16230,16231,16232,16233,16234,16235,16236,16237,16428,16429,16430,16431,16432,16433,16434,16435,16436,16437,16438,16439,0} - ,{16040,15430,15431,15432,15433,15434,15435,15436,15437,15438,15439,15440,15441,15632,15633,15634,15635,15636,15637,15638,15639,15640,15641,15642,15643,15834,15835,15836,15837,15838,15839,15840,15841,15842,15843,15844,15845,16036,16037,16038,16039,16040,16041,16042,16043,16044,16045,16046,16047,16238,16239,16240,16241,16242,16243,16244,16245,16246,16247,16248,16249,16440,16441,16442,16443,16444,16445,16446,16447,16448,16449,16450,16451,0} - ,{14828,14218,14219,14220,14221,14222,14223,14224,14225,14226,14227,14228,14229,14420,14421,14422,14423,14424,14425,14426,14427,14428,14429,14430,14431,14622,14623,14624,14625,14626,14627,14628,14629,14630,14631,14632,14633,14824,14825,14826,14827,14828,14829,14830,14831,14832,14833,14834,14835,15026,15027,15028,15029,15030,15031,15032,15033,15034,15035,15036,15037,15228,15229,15230,15231,15232,15233,15234,15235,15236,15237,15238,15239,0} - ,{14025,13820,13821,13822,13823,13824,13825,13826,13827,14022,14023,14024,14025,14026,14027,14028,14029,14030,14031,0} - ,{0} - ,{18002,17196,17197,17198,17199,17392,17393,17394,17395,17396,17397,17398,17399,17400,17401,17594,17595,17596,17597,17598,17599,17600,17601,17602,17603,17796,17797,17798,17799,17800,17801,17802,17803,17804,17805,18000,18001,18002,18003,18004,18005,18006,18007,18204,18205,18206,18207,18208,18209,18408,18409,18410,18411,18608,18609,18610,18611,18612,18613,18812,18813,18814,18815,19014,19015,19016,19017,19018,19019,19218,19219,19220,19221,0} - ,{16784,15972,15973,15974,15975,16174,16175,16176,16177,16376,16377,16378,16379,16578,16579,16580,16581,16582,16583,16584,16585,16586,16587,16588,16589,16590,16591,16592,16593,16780,16781,16782,16783,16784,16785,16786,16787,16788,16789,16790,16791,16792,16793,16794,16795,16982,16983,16984,16985,16986,16987,16988,16989,16990,16991,16992,16993,16994,16995,16996,16997,17186,17187,17188,17189,17190,17191,17192,17193,17194,17195,17390,17391,0} - ,{18415,17806,17807,17808,17809,17810,17811,17812,17813,17814,17815,17816,17817,18008,18009,18010,18011,18012,18013,18014,18015,18016,18017,18018,18019,18210,18211,18212,18213,18214,18215,18216,18217,18218,18219,18220,18221,18412,18413,18414,18415,18416,18417,18418,18419,18420,18421,18422,18423,18614,18615,18616,18617,18618,18619,18620,18621,18622,18623,18624,18625,18816,18817,18818,18819,18820,18821,18822,18823,18824,18825,18826,18827,0} - ,{15979,15370,15371,15372,15373,15374,15375,15376,15377,15378,15379,15380,15381,15572,15573,15574,15575,15576,15577,15578,15579,15580,15581,15582,15583,15774,15775,15776,15777,15778,15779,15780,15781,15782,15783,15784,15785,15976,15977,15978,15979,15980,15981,15982,15983,15984,15985,15986,15987,16178,16179,16180,16181,16182,16183,16184,16185,16186,16187,16188,16189,16380,16381,16382,16383,16384,16385,16386,16387,16388,16389,16390,16391,0} - ,{17203,16594,16595,16596,16597,16598,16599,16600,16601,16602,16603,16604,16605,16796,16797,16798,16799,16800,16801,16802,16803,16804,16805,16806,16807,16998,16999,17000,17001,17002,17003,17004,17005,17006,17007,17008,17009,17200,17201,17202,17203,17204,17205,17206,17207,17208,17209,17210,17211,17402,17403,17404,17405,17406,17407,17408,17409,17410,17411,17412,17413,17604,17605,17606,17607,17608,17609,17610,17611,17612,17613,17614,17615,0} - ,{15991,15382,15383,15384,15385,15386,15387,15388,15389,15390,15391,15392,15393,15584,15585,15586,15587,15588,15589,15590,15591,15592,15593,15594,15595,15786,15787,15788,15789,15790,15791,15792,15793,15794,15795,15796,15797,15988,15989,15990,15991,15992,15993,15994,15995,15996,15997,15998,15999,16190,16191,16192,16193,16194,16195,16196,16197,16198,16199,16200,16201,16392,16393,16394,16395,16396,16397,16398,16399,16400,16401,16402,16403,0} - ,{17216,16606,16607,16608,16609,16610,16611,16612,16613,16614,16615,16616,16617,16808,16809,16810,16811,16812,16813,16814,16815,16816,16817,16818,16819,17010,17011,17012,17013,17014,17015,17016,17017,17018,17019,17020,17021,17212,17213,17214,17215,17216,17217,17218,17219,17220,17221,17222,17223,17414,17415,17416,17417,17418,17419,17420,17421,17422,17423,17424,17425,17616,17617,17618,17619,17620,17621,17622,17623,17624,17625,17626,17627,0} - ,{16004,15394,15395,15396,15397,15398,15399,15400,15401,15402,15403,15404,15405,15596,15597,15598,15599,15600,15601,15602,15603,15604,15605,15606,15607,15798,15799,15800,15801,15802,15803,15804,15805,15806,15807,15808,15809,16000,16001,16002,16003,16004,16005,16006,16007,16008,16009,16010,16011,16202,16203,16204,16205,16206,16207,16208,16209,16210,16211,16212,16213,16404,16405,16406,16407,16408,16409,16410,16411,16412,16413,16414,16415,0} - ,{14792,14182,14183,14184,14185,14186,14187,14188,14189,14190,14191,14192,14193,14384,14385,14386,14387,14388,14389,14390,14391,14392,14393,14394,14395,14586,14587,14588,14589,14590,14591,14592,14593,14594,14595,14596,14597,14788,14789,14790,14791,14792,14793,14794,14795,14796,14797,14798,14799,14990,14991,14992,14993,14994,14995,14996,14997,14998,14999,15000,15001,15192,15193,15194,15195,15196,15197,15198,15199,15200,15201,15202,15203,0} - ,{16016,15406,15407,15408,15409,15410,15411,15412,15413,15414,15415,15416,15417,15608,15609,15610,15611,15612,15613,15614,15615,15616,15617,15618,15619,15810,15811,15812,15813,15814,15815,15816,15817,15818,15819,15820,15821,16012,16013,16014,16015,16016,16017,16018,16019,16020,16021,16022,16023,16214,16215,16216,16217,16218,16219,16220,16221,16222,16223,16224,16225,16416,16417,16418,16419,16420,16421,16422,16423,16424,16425,16426,16427,0} - ,{14804,14194,14195,14196,14197,14198,14199,14200,14201,14202,14203,14204,14205,14396,14397,14398,14399,14400,14401,14402,14403,14404,14405,14406,14407,14598,14599,14600,14601,14602,14603,14604,14605,14606,14607,14608,14609,14800,14801,14802,14803,14804,14805,14806,14807,14808,14809,14810,14811,15002,15003,15004,15005,15006,15007,15008,15009,15010,15011,15012,15013,15204,15205,15206,15207,15208,15209,15210,15211,15212,15213,15214,15215,0} - ,{14816,14206,14207,14208,14209,14210,14211,14212,14213,14214,14215,14216,14217,14408,14409,14410,14411,14412,14413,14414,14415,14416,14417,14418,14419,14610,14611,14612,14613,14614,14615,14616,14617,14618,14619,14620,14621,14812,14813,14814,14815,14816,14817,14818,14819,14820,14821,14822,14823,15014,15015,15016,15017,15018,15019,15020,15021,15022,15023,15024,15025,15216,15217,15218,15219,15220,15221,15222,15223,15224,15225,15226,15227,0} - ,{13604,12994,12995,12996,12997,12998,12999,13000,13001,13002,13003,13004,13005,13196,13197,13198,13199,13200,13201,13202,13203,13204,13205,13206,13207,13398,13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13600,13601,13602,13603,13604,13605,13606,13607,13608,13609,13610,13611,13802,13803,13804,13805,13806,13807,13808,13809,13810,13811,13812,13813,14004,14005,14006,14007,14008,14009,14010,14011,14012,14013,14014,14015,0} - ,{13815,13612,13613,13614,13615,13616,13617,13814,13815,13816,13817,13818,13819,14016,14017,14018,14019,14020,14021,0} - ,{13007,12804,12805,12806,12807,12808,12809,13006,13007,13008,13009,13010,13011,13208,13209,13210,13211,13410,13411,0} - ,{13415,13212,13213,13214,13215,13412,13413,13414,13415,13416,13417,13418,13419,13618,13619,13620,13621,13622,13623,0} - ,{12122,11718,11719,11720,11721,11922,11923,12122,12123,12124,12125,12326,12327,12526,12527,12528,12529,12730,12731,0} - ,{14959,14152,14153,14154,14155,14156,14157,14352,14353,14354,14355,14356,14357,14358,14359,14552,14553,14554,14555,14556,14557,14558,14559,14560,14561,14754,14755,14756,14757,14758,14759,14760,14761,14762,14763,14956,14957,14958,14959,14960,14961,14962,14963,14964,14965,15160,15161,15162,15163,15164,15165,15166,15167,15362,15363,15364,15365,15366,15367,15368,15369,15566,15567,15568,15569,15570,15571,15768,15769,15770,15771,15772,15773,0} - ,{13543,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942,12943,12944,12945,13136,13137,13138,13139,13140,13141,13142,13143,13144,13145,13146,13147,13338,13339,13340,13341,13342,13343,13344,13345,13346,13347,13348,13349,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13744,13745,13746,13747,13748,13749,13750,13751,13752,13753,13946,13947,13948,13949,13950,13951,13952,13953,13954,13955,14148,14149,14150,14151,0} - ,{12331,11722,11723,11724,11725,11726,11727,11728,11729,11730,11731,11732,11733,11924,11925,11926,11927,11928,11929,11930,11931,11932,11933,11934,11935,12126,12127,12128,12129,12130,12131,12132,12133,12134,12135,12136,12137,12328,12329,12330,12331,12332,12333,12334,12335,12336,12337,12338,12339,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539,12540,12541,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742,12743,0} - ,{14767,14158,14159,14160,14161,14162,14163,14164,14165,14166,14167,14168,14169,14360,14361,14362,14363,14364,14365,14366,14367,14368,14369,14370,14371,14562,14563,14564,14565,14566,14567,14568,14569,14570,14571,14572,14573,14764,14765,14766,14767,14768,14769,14770,14771,14772,14773,14774,14775,14966,14967,14968,14969,14970,14971,14972,14973,14974,14975,14976,14977,15168,15169,15170,15171,15172,15173,15174,15175,15176,15177,15178,15179,0} - ,{13555,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,12957,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13159,13350,13351,13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13552,13553,13554,13555,13556,13557,13558,13559,13560,13561,13562,13563,13754,13755,13756,13757,13758,13759,13760,13761,13762,13763,13764,13765,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967,0} - ,{12343,11734,11735,11736,11737,11738,11739,11740,11741,11742,11743,11744,11745,11936,11937,11938,11939,11940,11941,11942,11943,11944,11945,11946,11947,12138,12139,12140,12141,12142,12143,12144,12145,12146,12147,12148,12149,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,12552,12553,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,0} - ,{14779,14170,14171,14172,14173,14174,14175,14176,14177,14178,14179,14180,14181,14372,14373,14374,14375,14376,14377,14378,14379,14380,14381,14382,14383,14574,14575,14576,14577,14578,14579,14580,14581,14582,14583,14584,14585,14776,14777,14778,14779,14780,14781,14782,14783,14784,14785,14786,14787,14978,14979,14980,14981,14982,14983,14984,14985,14986,14987,14988,14989,15180,15181,15182,15183,15184,15185,15186,15187,15188,15189,15190,15191,0} - ,{13567,12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170,13171,13362,13363,13364,13365,13366,13367,13368,13369,13370,13371,13372,13373,13564,13565,13566,13567,13568,13569,13570,13571,13572,13573,13574,13575,13766,13767,13768,13769,13770,13771,13772,13773,13774,13775,13776,13777,13968,13969,13970,13971,13972,13973,13974,13975,13976,13977,13978,13979,0} - ,{12355,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11948,11949,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959,12150,12151,12152,12153,12154,12155,12156,12157,12158,12159,12160,12161,12352,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,0} - ,{13580,12970,12971,12972,12973,12974,12975,12976,12977,12978,12979,12980,12981,13172,13173,13174,13175,13176,13177,13178,13179,13180,13181,13182,13183,13374,13375,13376,13377,13378,13379,13380,13381,13382,13383,13384,13385,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586,13587,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13980,13981,13982,13983,13984,13985,13986,13987,13988,13989,13990,13991,0} - ,{12368,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,12162,12163,12164,12165,12166,12167,12168,12169,12170,12171,12172,12173,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,12779,0} - ,{13592,12982,12983,12984,12985,12986,12987,12988,12989,12990,12991,12992,12993,13184,13185,13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13790,13791,13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13992,13993,13994,13995,13996,13997,13998,13999,14000,14001,14002,14003,0} - ,{12380,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11972,11973,11974,11975,11976,11977,11978,11979,11980,11981,11982,11983,12174,12175,12176,12177,12178,12179,12180,12181,12182,12183,12184,12185,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12578,12579,12580,12581,12582,12583,12584,12585,12586,12587,12588,12589,12780,12781,12782,12783,12784,12785,12786,12787,12788,12789,12790,12791,0} - ,{12392,11782,11783,11784,11785,11786,11787,11788,11789,11790,11791,11792,11793,11984,11985,11986,11987,11988,11989,11990,11991,11992,11993,11994,11995,12186,12187,12188,12189,12190,12191,12192,12193,12194,12195,12196,12197,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803,0} - ,{12198,11794,11795,11996,11997,11998,11999,12198,12199,12200,12201,12400,12401,12402,12403,12602,12603,12604,12605,0} - ,{11112,10508,10509,10710,10711,10910,10911,10912,10913,11114,11115,11314,11315,11316,11317,11518,11519,0} - ,{8494,7486,7487,7688,7689,7890,7891,7892,7893,7894,7895,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,0} - ,{9907,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,9915,10104,10105,10106,10107,10108,10109,10110,10111,10112,10113,10114,10115,10116,10117,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,0} - ,{10917,10510,10511,10512,10513,10514,10515,10516,10517,10518,10519,10520,10521,10712,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10914,10915,10916,10917,10918,10919,10920,10921,10922,10923,10924,10925,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11318,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,11530,11531,0} - ,{8505,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,0} - ,{9717,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9916,9917,9918,9919,9920,9921,9922,9923,9924,9925,9926,9927,10118,10119,10120,10121,10122,10123,10124,10125,10126,10127,10128,10129,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,0} - ,{10929,10522,10523,10524,10525,10526,10527,10528,10529,10530,10531,10532,10533,10724,10725,10726,10727,10728,10729,10730,10731,10732,10733,10734,10735,10926,10927,10928,10929,10930,10931,10932,10933,10934,10935,10936,10937,11128,11129,11130,11131,11132,11133,11134,11135,11136,11137,11138,11139,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11532,11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,0} - ,{8517,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,0} - ,{9729,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,10141,10332,10333,10334,10335,10336,10337,10338,10339,10340,10341,10342,10343,0} - ,{10941,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,10544,10545,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150,11151,11342,11343,11344,11345,11346,11347,11348,11349,11350,11351,11352,11353,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,0} - ,{9742,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9738,9739,9740,9741,9742,9743,9744,9745,9746,9747,9748,9749,9940,9941,9942,9943,9944,9945,9946,9947,9948,9949,9950,9951,10142,10143,10144,10145,10146,10147,10148,10149,10150,10151,10152,10153,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,0} - ,{10954,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10950,10951,10952,10953,10954,10955,10956,10957,10958,10959,10960,10961,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,11162,11163,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11556,11557,11558,11559,11560,11561,11562,11563,11564,11565,11566,11567,0} - ,{9754,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9952,9953,9954,9955,9956,9957,9958,9959,9960,9961,9962,9963,10154,10155,10156,10157,10158,10159,10160,10161,10162,10163,10164,10165,10356,10357,10358,10359,10360,10361,10362,10363,10364,10365,10366,10367,0} - ,{10966,10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,10568,10569,10760,10761,10762,10763,10764,10765,10766,10767,10768,10769,10770,10771,10962,10963,10964,10965,10966,10967,10968,10969,10970,10971,10972,10973,11164,11165,11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578,11579,0} - ,{10978,10570,10571,10572,10573,10574,10575,10576,10577,10578,10579,10580,10581,10772,10773,10774,10775,10776,10777,10778,10779,10780,10781,10782,10783,10974,10975,10976,10977,10978,10979,10980,10981,10982,10983,10984,10985,11176,11177,11178,11179,11180,11181,11182,11183,11184,11185,11186,11187,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,0} - ,{11188,10784,10785,10786,10787,10986,10987,10988,10989,11188,11189,11190,11191,11390,11391,11592,11593,11594,11595,0} - ,{7285,7084,7085,7086,7087,7284,7285,7286,7287,7288,7289,7488,7489,7490,7491,7690,7691,7692,7693,0} - ,{4874,3868,3869,4068,4069,4070,4071,4072,4073,4074,4075,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4468,4469,4470,4471,4472,4473,4670,4671,4672,4673,4674,4675,4872,4873,4874,4875,4876,4877,5074,5075,5076,5077,5078,5079,5274,5275,5276,5277,5278,5279,5280,5281,5478,5479,5480,5481,5482,5483,5680,5681,5682,5683,5684,5685,5884,5885,5886,5887,6086,6087,6088,6089,0} - ,{6281,5476,5477,5676,5677,5678,5679,5878,5879,5880,5881,5882,5883,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6882,6883,6884,6885,0} - ,{4881,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,0} - ,{7293,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,0} - ,{6093,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,0} - ,{7305,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,0} - ,{6106,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,0} - ,{7318,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,0} - ,{8530,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,0} - ,{7330,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,0} - ,{8542,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8942,8943,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,9144,9145,9146,9147,9148,9149,9150,9151,9152,9153,9154,9155,0} - ,{8554,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,0} - ,{9766,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9964,9965,9966,9967,9968,9969,9970,9971,9972,9973,9974,9975,10166,10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10368,10369,10370,10371,10372,10373,10374,10375,10376,10377,10378,10379,0} - ,{9774,9370,9371,9572,9573,9574,9575,9774,9775,9776,9777,9976,9977,9978,9979,9980,9981,10178,10179,0} - ,{10382,10180,10181,10182,10183,10184,10185,10380,10381,10382,10383,10384,10385,10386,10387,10582,10583,10584,10585,0} - ,{3471,2668,2669,2670,2671,2866,2867,2868,2869,2870,2871,2872,2873,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3266,3267,3268,3269,3270,3271,3272,3273,3468,3469,3470,3471,3472,3473,3474,3475,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,4076,4077,4078,4079,4080,4081,4278,4279,4280,4281,4282,4283,0} - ,{1876,1472,1473,1474,1475,1476,1477,1478,1479,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,0} - ,{2679,2072,2073,2272,2273,2274,2275,2470,2471,2472,2473,2474,2475,2476,2477,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,0} - ,{3682,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,0} - ,{3694,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3903,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,0} - ,{4894,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,0} - ,{3706,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,0} - ,{4906,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,0} - ,{4918,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,0} - ,{6118,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,0} - ,{6130,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,0} - ,{7342,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,0} - ,{7354,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,0} - ,{8566,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,0} - ,{9779,9372,9373,9374,9375,9576,9577,9578,9579,9778,9779,9780,9781,9782,9783,9982,9983,9984,9985,0} - ,{9380,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9580,9581,9582,9583,9584,9585,0} - ,{495,292,293,294,295,296,297,494,495,496,497,498,499,696,697,698,699,700,701,0} - ,{501,298,299,300,301,302,303,500,501,502,503,504,505,702,703,704,705,706,707,0} - ,{1284,878,879,880,881,882,883,884,885,886,887,888,889,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,0} - ,{1295,492,493,688,689,690,691,692,693,694,695,890,891,892,893,894,895,896,897,1092,1093,1094,1095,1096,1097,1098,1099,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,0} - ,{1306,898,899,900,901,902,903,904,905,906,907,908,909,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,0} - ,{2494,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,0} - ,{2506,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2300,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,0} - ,{2518,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,0} - ,{3718,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,0} - ,{3730,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,0} - ,{4930,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,0} - ,{4942,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,0} - ,{6142,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,0} - ,{6154,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,0} - ,{7366,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,0} - ,{8578,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,0} - ,{513,310,311,312,313,314,315,512,513,514,515,516,517,714,715,716,717,718,719,0} - ,{507,304,305,306,307,308,309,506,507,508,509,510,511,708,709,710,711,712,713,0} - ,{1341,930,931,932,933,934,935,936,937,938,939,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,0} - ,{1330,720,721,722,723,724,725,726,727,728,729,922,923,924,925,926,927,928,929,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1326,1327,1328,1329,1330,1331,1332,1333,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,0} - ,{1319,910,911,912,913,914,915,916,917,918,919,920,921,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,0} - ,{2555,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,0} - ,{2543,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,0} - ,{2531,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,0} - ,{3755,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,0} - ,{3743,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,0} - ,{4967,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,0} - ,{4955,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,0} - ,{6179,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,0} - ,{6167,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,0} - ,{7379,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,0} - ,{8591,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,9000,9001,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,0} - ,{3802,2786,2787,2988,2989,2990,2991,3190,3191,3192,3193,3194,3195,3196,3197,3394,3395,3396,3397,3398,3399,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3798,3799,3800,3801,3802,3803,3804,3805,3806,3807,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,0} - ,{2575,1760,1761,1962,1963,1964,1965,1966,1967,2164,2165,2166,2167,2168,2169,2170,2171,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,0} - ,{2566,1552,1553,1554,1555,1556,1557,1754,1755,1756,1757,1758,1759,1956,1957,1958,1959,1960,1961,2158,2159,2160,2161,2162,2163,2360,2361,2362,2363,2364,2365,2562,2563,2564,2565,2566,2567,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,0} - ,{3791,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,0} - ,{3779,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,0} - ,{5003,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4998,4999,5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,0} - ,{3767,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,0} - ,{4991,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,0} - ,{4979,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,0} - ,{6203,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,0} - ,{6191,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,0} - ,{7403,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,0} - ,{7391,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7992,7993,7994,7995,7996,7997,7998,7999,8000,8001,8002,8003,0} - ,{8603,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,0} - ,{9406,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9606,9607,9608,9609,9610,9611,9612,9613,0} - ,{0} - ,{5429,4212,4213,4214,4215,4414,4415,4416,4417,4418,4419,4618,4619,4620,4621,4820,4821,4822,4823,4824,4825,5022,5023,5024,5025,5224,5225,5226,5227,5228,5229,5426,5427,5428,5429,5430,5431,5432,5433,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6234,6235,6236,6237,0} - ,{6647,6042,6043,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,7054,7055,7056,7057,7256,7257,7258,7259,7458,7459,7460,7461,0} - ,{5016,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,0} - ,{7452,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,0} - ,{6228,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,0} - ,{7440,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,0} - ,{6215,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,0} - ,{7427,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,0} - ,{8639,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,9250,9251,0} - ,{7415,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,0} - ,{8627,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,0} - ,{8615,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,0} - ,{9827,9418,9419,9420,9421,9422,9423,9424,9425,9426,9427,9428,9429,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10226,10227,10228,10229,10230,10231,10232,10233,10234,10235,10236,10237,10428,10429,10430,10431,10432,10433,10434,10435,10436,10437,10438,10439,0} - ,{9616,9412,9413,9414,9415,9416,9417,9614,9615,9616,9617,9618,9619,9816,9817,9818,9819,9820,9821,0} - ,{10424,10022,10023,10222,10223,10224,10225,10422,10423,10424,10425,10426,10427,10624,10625,10626,10627,10628,10629,0} - ,{10016,9810,9811,9812,9813,9814,9815,10014,10015,10016,10017,10018,10019,10020,10021,10218,10219,10220,10221,0} - ,{11309,10702,10703,10904,10905,10906,11106,11107,11308,11309,11310,11510,11511,11712,11713,11714,0} - ,{8472,7660,7661,7662,7663,7664,7665,7862,7863,7864,7865,7866,7867,8064,8065,8066,8067,8068,8069,8070,8071,8266,8267,8268,8269,8270,8271,8272,8273,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,9074,9075,9076,9077,9078,9079,9080,9081,9276,9277,9278,9279,9280,9281,0} - ,{9888,9282,9283,9284,9285,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9680,9681,9682,9683,9684,9685,9686,9687,9688,9689,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,10084,10085,10086,10087,10088,10089,10090,10091,10092,10093,10094,10095,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498,10499,10500,10501,0} - ,{11100,10690,10691,10692,10693,10694,10695,10696,10697,10698,10699,10700,10701,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11296,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,11307,11498,11499,11500,11501,11502,11503,11504,11505,11506,11507,11508,11509,11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,0} - ,{8664,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,0} - ,{9876,9466,9467,9468,9469,9470,9471,9472,9473,9474,9475,9476,9477,9668,9669,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10476,10477,10478,10479,10480,10481,10482,10483,10484,10485,10486,10487,0} - ,{11088,10678,10679,10680,10681,10682,10683,10684,10685,10686,10687,10688,10689,10880,10881,10882,10883,10884,10885,10886,10887,10888,10889,10890,10891,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11284,11285,11286,11287,11288,11289,11290,11291,11292,11293,11294,11295,11486,11487,11488,11489,11490,11491,11492,11493,11494,11495,11496,11497,11688,11689,11690,11691,11692,11693,11694,11695,11696,11697,11698,11699,0} - ,{8652,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,0} - ,{9864,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,10060,10061,10062,10063,10064,10065,10066,10067,10068,10069,10070,10071,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,10464,10465,10466,10467,10468,10469,10470,10471,10472,10473,10474,10475,0} - ,{11076,10666,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677,10868,10869,10870,10871,10872,10873,10874,10875,10876,10877,10878,10879,11070,11071,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11272,11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11474,11475,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685,11686,11687,0} - ,{9851,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452,9453,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,10048,10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,0} - ,{11063,10654,10655,10656,10657,10658,10659,10660,10661,10662,10663,10664,10665,10856,10857,10858,10859,10860,10861,10862,10863,10864,10865,10866,10867,11058,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11462,11463,11464,11465,11466,11467,11468,11469,11470,11471,11472,11473,11664,11665,11666,11667,11668,11669,11670,11671,11672,11673,11674,11675,0} - ,{9839,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9632,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10238,10239,10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10440,10441,10442,10443,10444,10445,10446,10447,10448,10449,10450,10451,0} - ,{11051,10642,10643,10644,10645,10646,10647,10648,10649,10650,10651,10652,10653,10844,10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,11046,11047,11048,11049,11050,11051,11052,11053,11054,11055,11056,11057,11248,11249,11250,11251,11252,11253,11254,11255,11256,11257,11258,11259,11450,11451,11452,11453,11454,11455,11456,11457,11458,11459,11460,11461,11652,11653,11654,11655,11656,11657,11658,11659,11660,11661,11662,11663,0} - ,{11039,10630,10631,10632,10633,10634,10635,10636,10637,10638,10639,10640,10641,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044,11045,11236,11237,11238,11239,11240,11241,11242,11243,11244,11245,11246,11247,11438,11439,11440,11441,11442,11443,11444,11445,11446,11447,11448,11449,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,0} - ,{11233,10828,10829,10830,10831,11030,11031,11032,11033,11232,11233,11234,11235,11434,11435,11436,11437,11638,11639,0} - }; - - switch (iSamp) { - case 1: - return FCal_Bins_AC1[63*iPhi+iEta]; - break; - case 2: - return FCal_Bins_AC2[32*iPhi+iEta]; - break; - case 3: - return FCal_Bins_AC3[16*iPhi+iEta]; - break; - default: - return dummy; - } -} diff --git a/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.h b/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.h deleted file mode 100644 index 53f49a0ddb8bd705d004a609a985c096ac5f355c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArCoverageFCALBins.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @author Sven Menke <menke@mppmu.mpg.de> - * - * @class LArCoverageFCALBins - * @brief definitions for FCal coverage histos based on atlasdd - * LArFCalElectrodes-04 first used with DC3-05-Comm-01 - * - * The bins are for 2d histograms with y = |tan(theta)| sin(phi) and x - * = |tan(theta)| cos(phi) and the following binning per sampling: - * - * TH2F * fcal[0] = new - * TH2F("FCal1","FCal1",240,-0.0901834,0.0901834,138,-0.0901834,0.0901834); - * TH2F * fcal[1] = new - * TH2F("FCal2","FCal2",216,-0.0821644,0.0821644,126,-0.0821644,0.0821644); - * TH2F * fcal[2] = new - * TH2F("FCal3","FCal3",200,-0.0756658,0.0756658,114,-0.0756658,0.0756658); - * - * alternatively the coordinates can be chosen in physical space (mm) - * but with the same number of bins: - * - * TH2F * fcal[0] = new - * TH2F("FCal1","FCal1",240,-444.92,444.92,138,-444.92,444.92); - * TH2F * fcal[1] = new - * TH2F("FCal2","FCal2",216,-442.70,442.70,126,-442.70,442.70); - * TH2F * fcal[2] = new - * TH2F("FCal3","FCal3",200,-443.25,443.25,114,-443.25,443.25); - * - */ - -#ifndef LARMONTOOLS_LARCOVERAGEFCALBINS_H -#define LARMONTOOLS_LARCOVERAGEFCALBINS_H - -class LArCoverageFCALBins -{ -public: - static int getXBins(int iSide, int iSamp); - - static int getYBins(int iSide, int iSamp); - - static float getRMax(int iSide, int iSamp); - - static float getRMin(int iSide); - - static const unsigned short * getBins(int iSide, int iSamp, int iEta, int iPhi); - -}; - -#endif // LARCOVERAGEFCALBINS_H - - diff --git a/LArCalorimeter/LArMonTools/src/LArDigitMon.cxx b/LArCalorimeter/LArMonTools/src/LArDigitMon.cxx deleted file mode 100755 index bf7c541e8aad807d50bbb30e18b904b15690bf77..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArDigitMon.cxx +++ /dev/null @@ -1,1129 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArDigitMon.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Helary Louis (helary@lapp.in2p3.fr) -// Originaly From LArOddCellsMonTool.cxx by Benjamin Trocme -// -// Monitor a few things in the LArDigit... -// -// 1) Check that the highest value of the LArDigit is contained in an interval. -// If it is not the case increment 3 histograms for each subdetector: -// a) Out of range histograms -// b) The average histograms: give the average value of the highest digit sample -// c) Channel VS FEB histograms: gives wich slot on wich FEB has his highest digit sample ou of the range -// 2) Check if a digits samples are in saturation. If it's the case increment the saturation histograms. -// -// Available cuts in the jo file: -// -// a) SampleRangeLow-SampleRangeUp: range to check the digit sample. -// b) ADCcut : To select Digits Samples with signal. -// c) ADCsature: lowest value to check if a Digit sample is in saturation. -// ******************************************************************** - -#include "LArDigitMon.h" -#include "LArOnlineIDStrHelper.h" - -//Histograms -#include "LWHists/TProfile2D_LW.h" -#include "LWHists/TProfile_LW.h" - -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH2I_LW.h" -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH2F_LW.h" - -//LAr infos: -#include "Identifier/HWIdentifier.h" -#include "LArCabling/LArOnOffIdMapping.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRawEvent/LArDigit.h" -#include "LArRawEvent/LArDigitContainer.h" - -#include "LArTrigStreamMatching.h" - -//STL: -#include <sstream> -#include <iomanip> -#include <cmath> -#include <vector> -#include <algorithm> - -/*---------------------------------------------------------*/ -LArDigitMon::LArDigitMon(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_strbisHelper(nullptr), - m_strHelper(nullptr), - m_LArOnlineIDHelper(nullptr), - m_LArEM_IDHelper(nullptr), - m_summary(nullptr), - m_feedthroughID(0), - m_slot(0), - m_feedthrough(0), - m_febHash(0), - m_channel(0), - m_PercComputed(false), - m_Samplenbr(0), - m_eventsCounter(0), - m_evtId(0) -{ - /**bool use to mask the bad channels*/ - declareProperty("IgnoreBadChannels", m_ignoreKnownBadChannels=false); - /**default cut to select events*/ - declareProperty("SigmaCut", m_SigmaCut=5); - /**default saturation cuts*/ - declareProperty("ADCSatureCut", m_ADCsatureCut=4095); - - /**Range to check for the max sample. If min and max=0, the range is set dynamically */ - declareProperty("SampleRangeLow", m_SampleRangeLow=0); - declareProperty("SampleRangeUp", m_SampleRangeUp=0); - - /** Allow to compute error on histograms, default is false */ - declareProperty("ComputeHistError",m_ComputeHistError=false); - /** Switch to online/offline mode*/ - declareProperty("IsOnline", m_IsOnline=false); - - /** Give the name of the streams you want to monitor:*/ - declareProperty("Streams",m_streams); - - /** Use the SampleMax expected and the SampleNumber from DB*/ - declareProperty("ExpectedSampleMax",m_ExpectedSampleMax=0); - declareProperty("SampleNumberFromDB",m_SampleNumberFromDB=0); - - /** Number of Bad FEBs used to declare an event noisy and exclude it from monitoring*/ - declareProperty("NumberBadFebs", m_NumberBadFebs=5); - - /** Treshold to declare a bad event*/ - declareProperty("TreshOut",m_TreshOut=5); - declareProperty("TreshSat",m_TreshSat=5); - declareProperty("TreshNull",m_TreshNull=5); - -} - -/*---------------------------------------------------------*/ -LArDigitMon::~LArDigitMon() -{ -} - -StatusCode -LArDigitMon::finalize() -{ - ATH_MSG_INFO( "finalHists LArDigitMon" ); - DeleteHist(m_BarrelA); - DeleteHist(m_BarrelC); - DeleteHist(m_EmecA); - DeleteHist(m_EmecC); - DeleteHist(m_HecA); - DeleteHist(m_HecC); - DeleteHist(m_FcalA); - DeleteHist(m_FcalC); - - return StatusCode::SUCCESS; - -} - -/*---------------------------------------------------------*/ -StatusCode -LArDigitMon::initialize() -{ - - ATH_MSG_INFO( "Initialize LArDigitMon" ); - - StatusCode sc; - - /** Get LAr Online Id Helper*/ - if ( detStore()->retrieve( m_LArOnlineIDHelper, "LArOnlineID" ).isSuccess() ) { - - ATH_MSG_DEBUG("connected non-tool: LArOnlineID" ); - - } else { - - ATH_MSG_FATAL( "unable to connect non-tool: LArOnlineID" ); - return StatusCode::FAILURE; - - } - - - // Get LArEM Id Helper, not used now... - if ( detStore()->retrieve( m_LArEM_IDHelper, "LArEM_ID" ).isSuccess() ) { - - ATH_MSG_DEBUG("connected non-tool: LArEM_ID" ); - - } else { - - ATH_MSG_FATAL( "unable to connect non-tool: LArEM_ID" ); - return StatusCode::FAILURE; - - } - - ATH_CHECK(m_digitContainerKey.initialize()); - ATH_CHECK(m_eventInfoKey.initialize()); - ATH_CHECK(m_keyPedestal.initialize()); - ATH_CHECK(m_cablingKey.initialize()); - ATH_CHECK(m_noisyROSummaryKey.initialize()); - - - - /** Get bad-channel mask (only if jO IgnoreBadChannels is true)*/ - ATH_CHECK( m_bcContKey.initialize(m_ignoreKnownBadChannels)); - ATH_CHECK( m_bcMask.buildBitMask(m_problemsToMask,msg())); - - /** Bool used for online*/ - m_PercComputed=false; - - return ManagedMonitorToolBase::initialize(); -} - -/*---------------------------------------------------------*/ -StatusCode -LArDigitMon::bookHistograms() -{ - //ATH_MSG_DEBUG("in bookHists()" << isNewEventsBlock << " " << isNewLumiBlock << " " << isNewRun ); - - // if(isNewRun){// Commented by B.Trocme to comply with new ManagedMonitorToolBase - - - /** Reset event counter*/ - m_eventsCounter=0; - - /**Book Histograms of Barrel.*/ - MonGroup GroupBarrelShift( this, "/LAr/DigitsOldTool/Barrel", run, ATTRIB_MANAGED ); - MonGroup GroupBarrelExpert( this, "/LAr/DigitsOldTool/Barrel", run, ATTRIB_MANAGED ); - MonGroup GroupBarrelExpertEff( this, "/LAr/DigitsOldTool/Barrel", run, ATTRIB_MANAGED ,"","weightedEff"); - - LArDigitMon::BookPartitions(m_BarrelA,"BarrelA",GroupBarrelShift,GroupBarrelExpert,GroupBarrelExpertEff); - LArDigitMon::BookPartitions(m_BarrelC,"BarrelC",GroupBarrelShift,GroupBarrelExpert,GroupBarrelExpertEff); - - /**Book Histogram of EMEC*/ - MonGroup GroupEMECShift( this, "/LAr/DigitsOldTool/EMEC", run, ATTRIB_MANAGED ); - MonGroup GroupEMECExpert( this, "/LAr/DigitsOldTool/EMEC", run, ATTRIB_MANAGED ); - MonGroup GroupEMECExpertEff( this, "/LAr/DigitsOldTool/EMEC", run, ATTRIB_MANAGED,"","weightedEff"); - - LArDigitMon::BookPartitions(m_EmecA,"EmecA",GroupEMECShift,GroupEMECExpert,GroupEMECExpertEff); - LArDigitMon::BookPartitions(m_EmecC,"EmecC",GroupEMECShift,GroupEMECExpert,GroupEMECExpertEff); - - /**Book Histogram of HEC*/ - MonGroup GroupHECShift( this, "/LAr/DigitsOldTool/HEC", run, ATTRIB_MANAGED ); - MonGroup GroupHECExpert( this, "/LAr/DigitsOldTool/HEC", run, ATTRIB_MANAGED ); - MonGroup GroupHECExpertEff( this, "/LAr/DigitsOldTool/HEC", run, ATTRIB_MANAGED,"","weightedEff"); - - LArDigitMon::BookPartitions(m_HecA,"HecA",GroupHECShift,GroupHECExpert,GroupHECExpertEff); - LArDigitMon::BookPartitions(m_HecC,"HecC",GroupHECShift,GroupHECExpert,GroupHECExpertEff); - - /**Book Histogram of FCAL.*/ - MonGroup GroupFCALShift( this, "/LAr/DigitsOldTool/FCAL", run, ATTRIB_MANAGED ); - MonGroup GroupFCALExpert( this, "/LAr/DigitsOldTool/FCAL", run, ATTRIB_MANAGED ); - MonGroup GroupFCALExpertEff( this, "/LAr/DigitsOldTool/FCAL", run, ATTRIB_MANAGED,"","weightedEff"); - - LArDigitMon::BookPartitions(m_FcalA,"FcalA",GroupFCALShift,GroupFCALExpert,GroupFCALExpertEff); - LArDigitMon::BookPartitions(m_FcalC,"FcalC",GroupFCALShift,GroupFCALExpert,GroupFCALExpertEff); - - - /**Book summary histo*/ - MonGroup generalGroup( this, "/LAr/DigitsOldTool", run, ATTRIB_MANAGED ); - const char * hName = "summary"; - const char * hTitle = "LArDigit Summary"; - - m_summary = TH2F_LW::create(hName, hTitle,4,0.,4.,8,0.,8.); - m_summary->GetXaxis()->SetTitle("Status"); - m_summary->GetYaxis()->SetTitle("Partition"); - m_summary->GetYaxis()->SetBinLabel(1,"EMBC"); - m_summary->GetYaxis()->SetBinLabel(2,"EMBA"); - m_summary->GetYaxis()->SetBinLabel(3,"EMECC"); - m_summary->GetYaxis()->SetBinLabel(4,"EMECA"); - m_summary->GetYaxis()->SetBinLabel(5,"HECC"); - m_summary->GetYaxis()->SetBinLabel(6,"HECA"); - m_summary->GetYaxis()->SetBinLabel(7,"FCalC"); - m_summary->GetYaxis()->SetBinLabel(8,"FCalA"); - m_summary->GetXaxis()->SetBinLabel(1,"OutOfRange"); - m_summary->GetXaxis()->SetBinLabel(2,"Saturation"); - m_summary->GetXaxis()->SetBinLabel(3,"Null Digits"); - m_summary->GetXaxis()->SetBinLabel(4,"Mean Time"); - m_summary->GetXaxis()->SetLabelSize(0.055); - m_summary->GetYaxis()->SetLabelSize(0.055); - generalGroup.regHist(m_summary).ignore(); - - hName = "summaryGain"; - hTitle = "Gain per partition (only cells with LArDigit available)"; - m_summaryGain = TH2F_LW::create(hName, hTitle,3,0.,3.,8,0.,8.); - m_summaryGain->GetXaxis()->SetTitle("Gain"); - m_summaryGain->GetYaxis()->SetTitle("Sub Detector"); - m_summaryGain->GetYaxis()->SetTitle("Partition"); - m_summaryGain->GetYaxis()->SetBinLabel(1,"EMBC"); - m_summaryGain->GetYaxis()->SetBinLabel(2,"EMBA"); - m_summaryGain->GetYaxis()->SetBinLabel(3,"EMECC"); - m_summaryGain->GetYaxis()->SetBinLabel(4,"EMECA"); - m_summaryGain->GetYaxis()->SetBinLabel(5,"HECC"); - m_summaryGain->GetYaxis()->SetBinLabel(6,"HECA"); - m_summaryGain->GetYaxis()->SetBinLabel(7,"FCalC"); - m_summaryGain->GetYaxis()->SetBinLabel(8,"FCalA"); - m_summaryGain->GetXaxis()->SetBinLabel(1,"HIGH"); - m_summaryGain->GetXaxis()->SetBinLabel(2,"MEDIUM"); - m_summaryGain->GetXaxis()->SetBinLabel(3,"LOW"); - m_summaryGain->GetXaxis()->SetLabelSize(0.055); - m_summaryGain->GetYaxis()->SetLabelSize(0.055); - generalGroup.regHist(m_summaryGain).ignore(); - - //} - - return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArDigitMon::fillHistograms() -{ - - ATH_MSG_DEBUG("in fillHists()" ); - - - /** Increment event counter */ - m_eventsCounter++; - - // retrieve LArNoisyROSummary and skip the event if number of FEB is greater than the one declare in JO. - SG::ReadHandle<LArNoisyROSummary> noisyRO{m_noisyROSummaryKey}; - - const std::vector<HWIdentifier>& noisyFEB = noisyRO->get_noisy_febs(); - if(int(noisyFEB.size())>m_NumberBadFebs) - { - ATH_MSG_DEBUG("Skip this Noisy event "); - return StatusCode::SUCCESS; - } - - /**EventID is a part of EventInfo, search event informations:*/ - SG::ReadHandle<xAOD::EventInfo> thisEvent{m_eventInfoKey}; - - m_evtId = thisEvent->eventNumber(); - unsigned l1Trig = thisEvent->level1TriggerType(); - ATH_MSG_DEBUG("Event nb " << m_evtId ); - unsigned LBN = thisEvent->lumiBlock(); - ATH_MSG_DEBUG("LB id: " << LBN ); - - m_streamsThisEvent=trigStreamMatching(m_streams,thisEvent->streamTags()); - - SG::ReadCondHandle<ILArPedestal> pedestalHdl{m_keyPedestal}; - const ILArPedestal* pedestals=*pedestalHdl; - - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; - const LArOnOffIdMapping* cabling=*cablingHdl; - - - SG::ReadHandle<LArDigitContainer> pLArDigitContainer{m_digitContainerKey}; - - const LArBadChannelCont* bcCont=nullptr; - if (m_ignoreKnownBadChannels ) { - SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey}; - bcCont=*bcContHdl; - } - - /** Define iterators to loop over Digits containers*/ - LArDigitContainer::const_iterator itDig = pLArDigitContainer->begin(); - LArDigitContainer::const_iterator itDig_e= pLArDigitContainer->end(); - const LArDigit* pLArDigit; - - - - /** First event : define range to look for max sample. - If not set by user, depends on number of samples*/ - - - if(m_eventsCounter==1) - { - if(m_SampleNumberFromDB!=0) - { - m_Samplenbr=m_SampleNumberFromDB; - ATH_MSG_DEBUG("Retrieve nSamples from DB" ); - } - - else - { - if (itDig!=itDig_e) - { - pLArDigit = *itDig; - m_Samplenbr=pLArDigit->nsamples(); - ATH_MSG_DEBUG("Retrieve nSamples from first event" ); - } - } - - if(m_SampleRangeLow == m_SampleRangeUp) - { - if(m_ExpectedSampleMax!=0) - { - m_SampleRangeLow=m_ExpectedSampleMax-1; - m_SampleRangeUp=m_ExpectedSampleMax+1; - ATH_MSG_DEBUG("Set Range number according to DB" ); - } - - else - { - ATH_MSG_DEBUG("Set range by hand " ); - /** Set range to look for the maximum*/ - if(m_Samplenbr == 5) - { - m_SampleRangeLow=2; - m_SampleRangeUp=4; - } - - if(m_Samplenbr == 7) - { - m_SampleRangeLow=3;//nota has to be checked in real run, none are available now... - m_SampleRangeUp=5; - } - - if(m_Samplenbr == 10) - { - m_SampleRangeLow=4; - m_SampleRangeUp=6; - } - - if(m_Samplenbr == 32) - { - m_SampleRangeLow=5; - m_SampleRangeUp=9; - } - - /** Now if we have an exotic configuration...*/ - if(m_Samplenbr < 10&&m_Samplenbr!=5&&m_Samplenbr!=7) - { - m_SampleRangeLow=2;//default is 4,7 - m_SampleRangeUp=4; - } - - if(m_Samplenbr <= 20&&m_Samplenbr>10) - { - m_SampleRangeLow=4;//default is 4,7 - m_SampleRangeUp=7; - } - - if(m_Samplenbr > 20&&m_Samplenbr!=32) - { - m_SampleRangeLow=5;//default is 4,7 - m_SampleRangeUp=9; - } - } - } - - else ATH_MSG_DEBUG("Range has been set by user" ); - - /** Now set histos titles, in order that it contains the range*/ - LArDigitMon::HistTitleSum(m_summary); - LArDigitMon::OutHistTitle(m_BarrelA); - LArDigitMon::OutHistTitle(m_BarrelC); - LArDigitMon::OutHistTitle(m_EmecA); - LArDigitMon::OutHistTitle(m_EmecC); - LArDigitMon::OutHistTitle(m_HecA); - LArDigitMon::OutHistTitle(m_HecC); - LArDigitMon::OutHistTitle(m_FcalA); - LArDigitMon::OutHistTitle(m_FcalC); - }//Range and sample max are known now.... - - - - - /** Loop over digits*/ - for ( ; itDig!=itDig_e;++itDig) { - pLArDigit = *itDig; - - - /** Remove problematic channels*/ - if (m_ignoreKnownBadChannels ) { - HWIdentifier id = pLArDigit->hardwareID(); - if ( m_bcMask.cellShouldBeMasked(bcCont,id)) { - continue; - } - } - - /** Retrieve pedestals */ - HWIdentifier id = pLArDigit->hardwareID(); - CaloGain::CaloGain gain = pLArDigit->gain(); - float pedestal = pedestals->pedestal(id,gain); - float pedestalRMS=pedestals->pedestalRMS(id,gain); - - /**skip cells with no pedestals reference in db.*/ - if(pedestal <= (1.0+LArElecCalib::ERRORCODE)) continue; - - - /** Determine to which partition this channel belongs to*/ - //int sampling = m_LArEM_IDHelper->sampling(id); - - /**skip disconnected channels:*/ - if(!cabling->isOnlineConnected(id)) continue; - - - /** Determine to which partition this channel belongs to*/ - LArDigitMon::partition &ThisPartition=WhatPartition(id); - - /** Fill the gain*/ - m_summaryGain->Fill(gain,ThisPartition.sumpos); - - - /** Retrieve samples*/ - const std::vector<short>* digito = &pLArDigit->samples(); - - /**retrieve the max sample digit ie digitot.back().*/ - std::vector<short>::const_iterator maxSam = std::max_element(digito->begin(), digito->end()); - std::vector<short>::const_iterator minSam = std::min_element(digito->begin(), digito->end()); - int maxPos=(maxSam-digito->begin()); - std::vector<short>::const_iterator iterSam= digito->begin(); - - /** Retrieve once, all the cell info:*/ - m_feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(id); - m_channel = m_LArOnlineIDHelper->channel(id); - m_slot = m_LArOnlineIDHelper->slot(m_LArOnlineIDHelper->feb_Id(id)); - m_feedthrough = m_LArOnlineIDHelper->feedthrough(m_LArOnlineIDHelper->feedthrough_Id(id)); - m_febHash = m_LArOnlineIDHelper->feb_Hash(m_LArOnlineIDHelper->feb_Id(id)); - - /** if event pass the sigma cut:*/ - if((*maxSam-pedestal)>pedestalRMS*m_SigmaCut) - { - /** Loop over the samples and get signal shape:*/ - for(int i=0;i<pLArDigit->nsamples();++i,++iterSam)FillSignShape(ThisPartition,i,(*iterSam-pedestal),(*maxSam-pedestal)); - - /** Then fill histo about max sample:*/ - FillAverMaxDig(ThisPartition,maxPos,(*maxSam-pedestal),l1Trig,LBN); - - /** Finally fill histo out of range:*/ - if(!(maxPos>=m_SampleRangeLow&&maxPos<=m_SampleRangeUp))FillOutOfRange(ThisPartition); - } - - /**Second monitoring of the saturating cells.*/ - if ((*maxSam)>=m_ADCsatureCut && (gain==0 || gain==1))FillSaturation(ThisPartition); - - /**Third monitoring cells containing one sample==0.*/ - if((*minSam)==0)FillNullHisto(ThisPartition); - - - }/** End of loop on LArDigit*/ - - // Loop on all partition histograms to renormalise by the number of channels - ScalePartition(m_BarrelA); - ScalePartition(m_BarrelC); - ScalePartition(m_EmecA); - ScalePartition(m_EmecC); - ScalePartition(m_HecA); - ScalePartition(m_HecC); - ScalePartition(m_FcalA); - ScalePartition(m_FcalC); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArDigitMon::procHistograms() -{ - /** Don't do anything*/ - - if(endOfRunFlag() || endOfEventsBlockFlag() ) - { - FillSumary(m_BarrelA); - FillSumary(m_BarrelC); - FillSumary(m_EmecA); - FillSumary(m_EmecC); - FillSumary(m_HecA); - FillSumary(m_HecC); - FillSumary(m_FcalA); - FillSumary(m_FcalC); - /** Properly Delete the LW hists*/ - if(endOfRunFlag()){ - EndOfRun(m_BarrelA); - EndOfRun(m_BarrelC); - EndOfRun(m_EmecA); - EndOfRun(m_EmecC); - EndOfRun(m_HecA); - EndOfRun(m_HecC); - EndOfRun(m_FcalA); - EndOfRun(m_FcalC); - } - - return StatusCode::SUCCESS; - } - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -/**Book and defines histogramms for a given partition.*/ -void LArDigitMon::BookPartitions(partition& sub, const std::string& PartitionName,MonGroup& ShiftGroup, MonGroup& ExpertGroup, MonGroup& ExpertGroupEff) - -{ - /**give a name to the partition*/ - sub.name=PartitionName; - - /**declare a partition number for the summary histogram:*/ - if(sub.name=="BarrelC") sub.sumpos=0; - if(sub.name=="BarrelA") sub.sumpos=1; - if(sub.name=="EmecC") sub.sumpos=2; - if(sub.name=="EmecA") sub.sumpos=3; - if(sub.name=="HecC") sub.sumpos=4; - if(sub.name=="HecA" ) sub.sumpos=5; - if(sub.name=="FcalC") sub.sumpos=6; - if(sub.name=="FcalA") sub.sumpos=7; - - /**declare strings for histograms title*/ - m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - std::string titlesat="% chan/FEB/events with max=4095 ADC - "; - std::string titleout="% chan/FEB/events with max out of "; - std::string titlemaxdi="Average position of Max Digit - "; - std::string titlenull="% chan/FEB/events with min=0 ADC - "; - - std::string titlesatchan="% events with max=4095 ADC - "; - std::string titleoutchan="% events with max out of "; - std::string titlenullchan="% events with min=0 ADC - "; - - char cutadc[50]; - sprintf(cutadc," - Cut: %d #sigma ",m_SigmaCut); - - char expectedSamp[50]; - if(m_ExpectedSampleMax!=0) sprintf(expectedSamp," - Exp Max =%d ",m_ExpectedSampleMax); - else sprintf(expectedSamp," - No Exp Max DB "); - - /**declare histograms properties - 1)for Endcaps*/ - int chan=128,FEB=25,slot=15,crates=375; - double chan_low=-0.5,chan_up=127.5,FEB_low=-0.5,FEB_up=24.5,slot_low=0.5,slot_up=15.5,crates_low=0.5,crates_up=375.5; - /**2)for Barrel*/ - if(sub.sumpos==0||sub.sumpos==1) - { - chan=128,FEB=32,slot=14,crates=448; - chan_low=-0.5,chan_up=127.5,FEB_low=-0.5,FEB_up=31.5,slot_low=0.5,slot_up=14.5,crates_low=0.5,crates_up=448.5; - } - - - - - /** Book histograms*/ - - // For 3 the types of errors (saturation, null, outOfRange), 3 histograms are booked but only 2 saved: - // m_[Type]Digit : (FT,slot) histogram. Number of errors per FEB. Histograms not saved as it needs to be normalized - // by the number of channels per FEB (128) - // m_P[Type]Digit : (FT,slot) histogram. Derived by m_[Type]Digit after normalization by the number of channels - // m_[Type]DigitChan : (FT+Slot; chan) histogram. Number of errors per channel. - - std::string hName = "tSaturation_"; - hName =hName+PartitionName; - std::string hTitle=titlesat+" Med/High Gain - "+PartitionName; - sub.m_SatDigit = TH2I_LW::create(hName.c_str(), hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - hName = "tSaturationLow_"; - hName =hName+PartitionName; - hTitle=titlesat+" Low Gain - "+PartitionName; - sub.m_SatDigitLow = TH2I_LW::create(hName.c_str(), hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - hName = "Saturation_"; - hName =hName+PartitionName; - hTitle=titlesat+PartitionName; - sub.m_PSatDigit = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - ExpertGroup.regHist(sub.m_PSatDigit).ignore(); - m_strHelper->definePartitionSummProp(sub.m_PSatDigit).ignore(); - hName = "SaturationLow_"; - hName =hName+PartitionName; - hTitle=titlesat+PartitionName; - sub.m_PSatDigitLow = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - ExpertGroup.regHist(sub.m_PSatDigitLow).ignore(); - m_strHelper->definePartitionSummProp(sub.m_PSatDigitLow).ignore(); - - hName = "tNullDigit_"; - hName =hName+PartitionName; - hTitle=titlenull+PartitionName; - sub.m_NullDigit= TH2I_LW::create(hName.c_str(), hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - hName = "NullDigit_"; - hName =hName+PartitionName; - hTitle=titlenull+PartitionName; - sub.m_PNullDigit = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - ExpertGroup.regHist(sub.m_PNullDigit).ignore(); - m_strHelper->definePartitionSummProp(sub.m_PNullDigit).ignore(); - - hName = "tOutOfRange_"; - hName =hName+PartitionName; - hTitle=titleout; - sub.m_OutDigit = TH2I_LW::create(hName.c_str(), hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - hName = "OutOfRange_"; - hName =hName+PartitionName; - hTitle=titleout; - sub.m_POutDigit = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - ExpertGroup.regHist(sub.m_POutDigit).ignore(); - m_strHelper->definePartitionSummProp(sub.m_POutDigit).ignore(); - - hName = "SaturationChan_"; - hName =hName+PartitionName; - hTitle=titlesatchan+PartitionName+" - Med/High Gain - All Stream"; - sub.m_SatDigitChan = TH2F_LW::create(hName.c_str(), hTitle.c_str(),crates,crates_low,crates_up,chan,chan_low,chan_up); - ExpertGroupEff.regHist(sub.m_SatDigitChan).ignore(); - m_strHelper->definePartitionSummProp2(sub.m_SatDigitChan).ignore(); - hName = "SaturationChanLow_"; - hName =hName+PartitionName; - hTitle=titlesatchan+PartitionName+" - Low Gain - All Stream"; - sub.m_SatDigitChanLow = TH2F_LW::create(hName.c_str(), hTitle.c_str(),crates,crates_low,crates_up,chan,chan_low,chan_up); - ExpertGroupEff.regHist(sub.m_SatDigitChanLow).ignore(); - m_strHelper->definePartitionSummProp2(sub.m_SatDigitChanLow).ignore(); - - hName = "NullDigitChan_"; - hName =hName+PartitionName; - hTitle=titlenullchan+PartitionName+" - All Gain - All Stream"; - sub.m_NullDigitChan = TH2F_LW::create(hName.c_str(), hTitle.c_str(),crates,crates_low,crates_up,chan,chan_low,chan_up); - ExpertGroupEff.regHist(sub.m_NullDigitChan).ignore(); - m_strHelper->definePartitionSummProp2(sub.m_NullDigitChan).ignore(); - - hName = "OutDigitChan_"; - hName =hName+PartitionName; - hTitle=titleoutchan; - sub.m_OutDigitChan = TH2F_LW::create(hName.c_str(), hTitle.c_str(),crates,crates_low,crates_up,chan,chan_low,chan_up); - ExpertGroupEff.regHist(sub.m_OutDigitChan).ignore(); - m_strHelper->definePartitionSummProp2(sub.m_OutDigitChan).ignore(); - - // Booking of histograms monitoring the highest sample position - hName = "AvePosMaxDig_"; - hName =hName+PartitionName; - hTitle=titlemaxdi+PartitionName+cutadc+expectedSamp; - sub.m_AverDig = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - ExpertGroup.regHist(sub.m_AverDig).ignore(); - m_strHelper->definePartitionSummProp(sub.m_AverDig).ignore(); - - - - hName = "EnVsTime_"; - hName =hName+PartitionName; - hTitle=" Energy vs max sample - " +PartitionName+cutadc+expectedSamp; - sub.m_EnTime = TH2F_LW::create(hName.c_str(),hTitle.c_str(),32,-0.5,31.5, 300, 0., 3000.); - sub.m_EnTime->GetXaxis()->SetTitle("Sample Number"); - sub.m_EnTime->GetYaxis()->SetTitle("Energy [ADC]"); - ExpertGroup.regHist(sub.m_EnTime).ignore(); - - - hName = "SignShape_"; - hName =hName+PartitionName; - hTitle=" Normalized Signal Shape - "+PartitionName+cutadc+expectedSamp; - sub.m_SignShape = TProfile_LW::create(hName.c_str(),hTitle.c_str(),32,-0.5,31.5); - sub.m_SignShape->GetXaxis()->SetTitle("Sample Number"); - sub.m_SignShape->GetYaxis()->SetTitle("Normalized Signal Shape"); - //Not supported in LWHists: sub.m_SignShape->GetYaxis()->SetTitleOffset(1.2); - ExpertGroup.regHist(sub.m_SignShape).ignore(); - - - hName = "TriggerWord_"; - hName =hName+PartitionName; - hTitle=" Position of max sample per L1 trigger word (8 bits) | "+PartitionName+cutadc+expectedSamp; - sub.m_TriggerType = TProfile_LW::create(hName.c_str(),hTitle.c_str(), 256, -0.5, 255.5); - sub.m_TriggerType->GetXaxis()->SetTitle("L1 trigger word"); - sub.m_TriggerType->GetYaxis()->SetTitle("Position of max Sample"); - ExpertGroup.regHist(sub.m_TriggerType).ignore(); - - hName = "MaxVsTime_"; - hName =hName+PartitionName; - hTitle="Average Max Sample vs LumiBlock - "+PartitionName+expectedSamp; - sub.m_MaxVsTime = TProfile_LW::create(hName.c_str(),hTitle.c_str(), 3000, 0.5, 3000.5); - sub.m_MaxVsTime->GetXaxis()->SetTitle("Luminosity Block"); - sub.m_MaxVsTime->GetYaxis()->SetTitle("Average Max Sample"); - ShiftGroup.regHist(sub.m_MaxVsTime).ignore(); - - - int nStreams = m_streams.size(); - hName = "MaxSample_PerStream_"; - hName =hName+PartitionName; - hTitle="Position of the Max Sample - "+PartitionName+cutadc+expectedSamp; - sub.m_AverTempPos_PerStream = TH2I_LW::create(hName.c_str(), hTitle.c_str(),32,-0.5,31.5,nStreams+1,-0.5,nStreams+0.5); - sub.m_AverTempPos_PerStream->GetXaxis()->SetTitle("Sample Number"); - for (int str = 0; str < nStreams; str++) { - sub.m_AverTempPos_PerStream->GetYaxis()->SetBinLabel(str+1,m_streams[str].c_str()); - } - sub.m_AverTempPos_PerStream->GetYaxis()->SetBinLabel(nStreams+1,"others"); - ShiftGroup.regHist(sub.m_AverTempPos_PerStream).ignore(); - - // In online, we need to have a temp histogram to record the number of errors. And periodically, these histograms are dumped - // in the regular histograms after normalisation by the current number of events. - if(m_IsOnline) - { - sub.m_Temp_NullDigitChan=TH2I_LW::create(("temp_NullDigit_"+PartitionName).c_str(), "",crates,crates_low,crates_up,chan,chan_low,chan_up); - sub.m_Temp_SatDigitChan=TH2I_LW::create(("temp_SatDigitChan_"+PartitionName).c_str(), "",crates,crates_low,crates_up,chan,chan_low,chan_up); - sub.m_Temp_SatDigitChanLow=TH2I_LW::create(("temp_SatDigitChanLow_"+PartitionName).c_str(), "",crates,crates_low,crates_up,chan,chan_low,chan_up); - sub.m_Temp_OutDigitChan=TH2I_LW::create(("temp_OutDigitChan_"+PartitionName).c_str(), "",crates,crates_low,crates_up,chan,chan_low,chan_up); - } - - - delete m_strHelper; -} - - -/*---------------------------------------------------------*/ -/** Add ADCCut and range to this histogram name */ -void LArDigitMon::HistTitle(LWHist2D* hist,partition& sub) const{ - std::string hTitle; - char cutint[128]; - char buf[128]; - - sprintf(buf,"[%d,%d] - ",m_SampleRangeLow,m_SampleRangeUp); - - if(m_ExpectedSampleMax!=0)sprintf(cutint," - Cut: %d #sigma - Exp Max=%d ",m_SigmaCut,m_ExpectedSampleMax); - else sprintf(cutint," - Cut: %d #sigma - No Exp Max DB ",m_SigmaCut); - - hTitle=hist->GetTitle(); - hTitle=hTitle+buf+sub.name+cutint; - hist->SetTitle(hTitle.c_str()); -} -/*---------------------------------------------------------*/ -/** Add ADCCut and range to this histogram name */ -void LArDigitMon::HistTitle(TProfile2D_LW* hist,partition& sub) const{ - std::string hTitle; - char cutint[128]; - char buf[128]; - - sprintf(buf,"[%d,%d] - ",m_SampleRangeLow,m_SampleRangeUp); - - if(m_ExpectedSampleMax!=0)sprintf(cutint," - Cut: %d #sigma - Exp Max=%d ",m_SigmaCut,m_ExpectedSampleMax); - else sprintf(cutint," - Cut: %d #sigma - No Exp Max DB",m_SigmaCut); - - hTitle=hist->GetTitle(); - hTitle=hTitle+buf+sub.name+cutint; - hist->SetTitle(hTitle.c_str()); -} - -/*---------------------------------------------------------*/ -/** Add ADCCut,range and ADCsature to this histogram name */ -void LArDigitMon::HistTitleSum(LWHist2D* hist) const{ - std::string hTitle; - char buf[128]; - if(m_ExpectedSampleMax!=0)sprintf(buf," - Cut: %d #sigma - range=[%d,%d] - Exp Max=%d ",m_SigmaCut,m_SampleRangeLow,m_SampleRangeUp,m_ExpectedSampleMax); - else sprintf(buf," - Cut: %d #sigma - range=[%d,%d] - No Exp Max DB ",m_SigmaCut,m_SampleRangeLow,m_SampleRangeUp); - - hTitle=hist->GetTitle(); - hTitle=hTitle+buf; - hist->SetTitle(hTitle.c_str()); -} -/*---------------------------------------------------------*/ -void LArDigitMon::OutHistTitle(partition& sub) -{ - - HistTitle(sub.m_POutDigit,sub); - HistTitle(sub.m_OutDigit,sub); - HistTitle(sub.m_OutDigitChan,sub); -} - -/*---------------------------------------------------------*/ -/** Say which partition is a channel*/ -LArDigitMon::partition& LArDigitMon::WhatPartition(HWIdentifier id) -{ - - /** return EM Barrel*/ - if (m_LArOnlineIDHelper->isEmBarrelOnline(id)) - { - if((m_LArOnlineIDHelper->pos_neg(m_feedthroughID))==0) return m_BarrelC; - else return m_BarrelA; - } - - /** return EM Endcap*/ - else if (m_LArOnlineIDHelper-> isEMECchannel(id)) - { - if((m_LArOnlineIDHelper->pos_neg(m_feedthroughID))==0) return m_EmecC; - else return m_EmecA; - } - - /** return HEC*/ - else if (m_LArOnlineIDHelper->isHECchannel(id)) - { - if((m_LArOnlineIDHelper->pos_neg(m_feedthroughID))==0) return m_HecC; - else return m_HecA; - } - - /** return FCAL*/ - else - { - if((m_LArOnlineIDHelper->pos_neg(m_feedthroughID))==0) return m_FcalC; - else return m_FcalA; - } - -} -/*---------------------------------------------------------*/ -/** Fill histograms if a channel is out of the given range*/ -void LArDigitMon::FillOutOfRange(partition& sub) const -{ - - sub.m_OutDigit->Fill(m_slot,m_feedthrough); - int numb=15; - if(sub.sumpos==0||sub.sumpos==1) numb=14; - if(m_IsOnline) sub.m_Temp_OutDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); - else sub.m_OutDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); -} - -/*---------------------------------------------------------*/ - -void LArDigitMon::FillAverMaxDig(partition& sub, int& i,float nrj, unsigned int& l1Trig,unsigned int& lumiblock) -{ - /** Declare iterator to monitor:*/ - // std::vector<int>::const_iterator streamBeg=m_streamsThisEvent.begin(); - //std::vector<int>::const_iterator streamEnd=m_streamsThisEvent.end(); - //if(int(m_streamsThisEvent.size())!=0)for(;streamBeg!=streamEnd;++streamBeg){ - for (auto stream : m_streamsThisEvent) { - sub.m_AverTempPos_PerStream->Fill(i,stream); - } - - sub.m_AverDig->Fill(m_slot,m_feedthrough,i); - sub.m_EnTime->Fill(i,(nrj)); - sub.m_MaxVsTime->Fill(lumiblock,i); - - sub.m_TriggerType->Fill(l1Trig,i); -} -/*---------------------------------------------------------*/ - -void LArDigitMon::FillSignShape(partition& sub, int& i,float nrj,float sample_max) -{ - sub.m_SignShape->Fill(float(i),nrj/(sample_max),(sample_max)); -} - - -/*---------------------------------------------------------*/ -void LArDigitMon::FillSaturation(partition& sub) const -{ - sub.m_SatDigit->Fill(m_slot,m_feedthrough); - int numb=15; - if(sub.sumpos==0||sub.sumpos==1) numb=14; - if(m_IsOnline) sub.m_Temp_SatDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); - else sub.m_SatDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); -} -/*---------------------------------------------------------*/ -void LArDigitMon::FillSaturationLow(partition& sub) const -{ - sub.m_SatDigitLow->Fill(m_slot,m_feedthrough); - int numb=15; - if(sub.sumpos==0||sub.sumpos==1) numb=14; - if(m_IsOnline) sub.m_Temp_SatDigitChanLow->Fill(m_slot+(numb*m_feedthrough),m_channel); - else sub.m_SatDigitChanLow->Fill(m_slot+(numb*m_feedthrough),m_channel); -} -/*---------------------------------------------------------*/ -void LArDigitMon::FillNullHisto(partition& sub) const -{ - sub.m_NullDigit->Fill(m_slot,m_feedthrough); - int numb=15; - if(sub.sumpos==0||sub.sumpos==1) numb=14; - if(m_IsOnline) sub.m_Temp_NullDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); - else sub.m_NullDigitChan->Fill(m_slot+(numb*m_feedthrough),m_channel); - -} -/*---------------------------------------------------------*/ -void LArDigitMon::FillSumary(partition& sub) -{ - //remove 0.9 because, bin are starting from 1 while sumpos starts at 0.......... - - m_summary->SetBinContent(int(1),int(sub.sumpos+1),GetNumberCells(sub.m_POutDigit,m_TreshOut)); - m_summary->SetBinContent(2,sub.sumpos+1,GetNumberCells(sub.m_PSatDigit,m_TreshSat)); - m_summary->SetBinContent(3,sub.sumpos+1,GetNumberCells(sub.m_PNullDigit,m_TreshNull)); - m_summary->SetBinContent(4,sub.sumpos+1,GetMeanVal(sub.m_EnTime)); -} -/*---------------------------------------------------------*/ -void LArDigitMon::ScalePartition(partition& sub) -// -{ - //DumpHisto(sub.m_NullDigit,sub.m_PNullDigit); - //DumpHisto(sub.m_SatDigit,sub.m_PSatDigit); - //DumpHisto(sub.m_OutDigit,sub.m_POutDigit); - - if(m_IsOnline){ - DumpOnlineHisto(sub.m_Temp_NullDigitChan,sub.m_NullDigitChan); - DumpOnlineHisto(sub.m_Temp_SatDigitChan,sub.m_SatDigitChan); - DumpOnlineHisto(sub.m_Temp_SatDigitChanLow,sub.m_SatDigitChanLow); - DumpOnlineHisto(sub.m_Temp_OutDigitChan,sub.m_OutDigitChan); - } - // BT on 10/4/2015 : originally the DumpHisto was 4 lines before (see comments above). - // I have the feeling that the online normalisation was wrong. - DumpHisto(sub.m_NullDigit,sub.m_PNullDigit); - DumpHisto(sub.m_SatDigit,sub.m_PSatDigit); - DumpHisto(sub.m_SatDigitLow,sub.m_PSatDigitLow); - DumpHisto(sub.m_OutDigit,sub.m_POutDigit); - - ATH_MSG_DEBUG("End of Scale Histograms " ); -} - -/*---------------------------------------------------------*/ -/** Scale histograms to get percentage, compute error, and change the entrie number*/ -void LArDigitMon::ScaleHisto(LWHist2D * hist,int& events) const -{ - if (m_ComputeHistError)ComputeError(hist,events); - if(events!=0) - { - hist->scaleContentsAndErrors(100./events); - hist->SetEntries(events); - } -} - -/*---------------------------------------------------------*/ -void LArDigitMon::ComputeError(LWHist2D* hist,int& events) -{ - int normFactor=events; - if (normFactor == 0) return; - double inv_normFactor2 = 1. / (static_cast<double> (normFactor) * static_cast<double> (normFactor)); - unsigned xbin, ybin; - double numer, error; - hist->resetActiveBinLoop(); - while(hist->getNextActiveBin(xbin,ybin,numer,error)) - { - if(numer>normFactor)continue;//protection against sqrt(neg) - if(numer>0) - { - float tabError = 100*sqrt(numer*normFactor*(normFactor-numer))*inv_normFactor2; - hist->SetBinError(xbin,ybin,tabError); - } - } -} -/*---------------------------------------------------------*/ -void LArDigitMon::DumpHisto(LWHist2D* hist1,TProfile2D_LW* hist2) -// At the end of run/processing, renormalize the (FT,Slot) histograms -// by the number of FEB channels (128) -{ - unsigned xbin, ybin; - - hist1->resetActiveBinLoop(); - for (xbin=1;xbin<=hist1->GetNbinsX();xbin++){ - for (ybin=1;ybin<=hist1->GetNbinsY();ybin++){ - hist2->Fill(xbin,ybin-1.5,100.*(hist1->GetBinContent(xbin,ybin))/128); - } - } - hist1->Reset(); -} -/*---------------------------------------------------------*/ -void LArDigitMon::DumpOnlineHisto(LWHist2D* hist1,LWHist2D* hist2) const -{ - unsigned xbin, ybin; - double numer, error; - hist1->resetActiveBinLoop(); - - while(hist1->getNextActiveBin(xbin,ybin,numer,error)) - { - hist2->SetBinContentAndError(xbin,ybin,100*numer/m_eventsCounter,error); - } - hist2->SetEntries(m_eventsCounter); -} -/*---------------------------------------------------------*/ -double LArDigitMon::GetMeanVal(LWHist2D* hist1) -{ - unsigned xbin, ybin,sum=0,compx,compy,sumx=0; - double binsize; - compx=hist1->GetNbinsX(); - compy=hist1->GetNbinsY(); - for (xbin=0;xbin<compx;xbin++){ - binsize=(hist1->getXMax()-hist1->getXMin())/hist1->GetNbinsX(); - sumx=0; - for (ybin=0;ybin<compy;ybin++){ - sumx+=hist1->GetBinContent(xbin,ybin); - } - sum+=(sumx*binsize*(xbin-1)); - } - if(hist1->GetEntries()!=0) return double(sum)/double(hist1->GetEntries()); - else return 0; -} -/*---------------------------------------------------------*/ -int LArDigitMon::GetNumberCells(TProfile2D_LW* hist1,double treshold) -{ - unsigned xbin, ybin,sum=0,compx,compy; - compx=hist1->GetNbinsX(); - compy=hist1->GetNbinsY(); - for (xbin=0;xbin<compx;xbin++) - for (ybin=0;ybin<compy;ybin++) - if(hist1->GetBinContent(xbin,ybin)>treshold)sum++; - - return sum; -} -/*---------------------------------------------------------*/ -void LArDigitMon::EndOfRun(partition& sub) -// This method was formerly named DeleteHists. -// Renamed by BT on 10/4/2015 as it does more than this, e.g: -// Normalisation by the number of events. -{ - if(sub.m_OutDigit){ - sub.m_OutDigit->Reset(); - } - - if(sub.m_NullDigit){ - sub.m_NullDigit->Reset(); - } - - if(sub.m_SatDigit){ - sub.m_SatDigit->Reset() ; - } - - if(sub.m_SatDigitLow){ - sub.m_SatDigitLow->Reset() ; - } - - if(m_IsOnline) - { - if(sub.m_Temp_NullDigitChan){ - sub.m_Temp_NullDigitChan->Reset(); - } - - if(sub.m_Temp_SatDigitChan){ - sub.m_Temp_SatDigitChan->Reset(); - } - - if(sub.m_Temp_SatDigitChanLow){ - sub.m_Temp_SatDigitChanLow->Reset(); - } - - if(sub.m_Temp_OutDigitChan){ - sub.m_Temp_OutDigitChan->Reset(); - } - } - else{ - ScaleHisto(sub.m_NullDigitChan,m_eventsCounter); - ScaleHisto(sub.m_SatDigitChan,m_eventsCounter); - ScaleHisto(sub.m_SatDigitChanLow,m_eventsCounter); - ScaleHisto(sub.m_OutDigitChan,m_eventsCounter); - } -} - - -void LArDigitMon::DeleteHist(partition& sub) const -// deleting local histograms -{ - if(sub.m_OutDigit){ - LWHist::safeDelete(sub.m_OutDigit); - sub.m_OutDigit=nullptr; - } - - if(sub.m_NullDigit){ - LWHist::safeDelete(sub.m_NullDigit); - sub.m_NullDigit=nullptr; - } - - if(sub.m_SatDigit){ - LWHist::safeDelete(sub.m_SatDigit); - sub.m_SatDigit=nullptr; - } - - if(sub.m_SatDigitLow){ - LWHist::safeDelete(sub.m_SatDigitLow); - sub.m_SatDigitLow=nullptr; - } - - if(m_IsOnline) - { - if(sub.m_Temp_NullDigitChan){ - LWHist::safeDelete(sub.m_Temp_NullDigitChan); - sub.m_Temp_NullDigitChan=nullptr; - } - - if(sub.m_Temp_SatDigitChan){ - LWHist::safeDelete(sub.m_Temp_SatDigitChan); - sub.m_Temp_SatDigitChan=nullptr; - } - - if(sub.m_Temp_SatDigitChanLow){ - LWHist::safeDelete(sub.m_Temp_SatDigitChanLow); - sub.m_Temp_SatDigitChanLow=nullptr; - } - - if(sub.m_Temp_OutDigitChan){ - LWHist::safeDelete(sub.m_Temp_OutDigitChan); - sub.m_Temp_OutDigitChan=nullptr; - } - } - -} - - diff --git a/LArCalorimeter/LArMonTools/src/LArDigitMon.h b/LArCalorimeter/LArMonTools/src/LArDigitMon.h deleted file mode 100755 index 612fc5c5aa07e98f5023de66b3b76f01de49d1f1..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArDigitMon.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArDigitMon - * @author Louis Helary - * - */ - -#ifndef LARMONTOOLS_LARDIGITMON_H -#define LARMONTOOLS_LARDIGITMON_H - -//inheritance: -#include "AthenaMonitoring/ManagedMonitorToolBase.h" - -//Cannot forward declare this: -//#include "CaloIdentifier/CaloGain.h" - -//LAr services: -#include "LArElecCalib/ILArPedestal.h" -#include "LArRecConditions/LArBadChannelMask.h" -#include "LArRecConditions/LArBadChannelCont.h" - -//STL: -#include <string> - -#include "StoreGate/ReadCondHandleKey.h" -#include "StoreGate/ReadHandleKey.h" - -//Events infos: -#include "xAODEventInfo/EventInfo.h" -#include "LArRecEvent/LArNoisyROSummary.h" - -class LArDigitContainer; -class LArOnOffIdMapping; - -class LArEM_ID; -class LArOnlineID; -class HWIdentifier; -class LArOnlineIDStrHelper; -class LArOnOffIdMapping; -class TProfile2D_LW; -class TProfile_LW; - -class LWHist1D; -class LWHist2D; -class TH1F_LW; -class TH1I_LW; -class TH2F_LW; -class TH2I_LW; - -class LArDigitMon: public ManagedMonitorToolBase -{ - - -public: - LArDigitMon(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArDigitMon(); - - - - - StatusCode initialize(); - StatusCode finalize(); - StatusCode bookHistograms(); - StatusCode fillHistograms(); - StatusCode procHistograms(); - -protected: - - - /** services*/ - LArOnlineIDStrHelper* m_strbisHelper; - LArOnlineIDStrHelper* m_strHelper; - const LArOnlineID* m_LArOnlineIDHelper; - const LArEM_ID* m_LArEM_IDHelper; - - //** Handle to cabling */ - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap","Cabling key"}; - - /** Handle to bad-channel mask */ - LArBadChannelMask m_bcMask; - SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - - /** Handle to pedestal */ - SG::ReadCondHandleKey<ILArPedestal> m_keyPedestal{this,"LArPedestalKey","LArPedestal","SG key of LArPedestal CDO"}; - - SG::ReadHandleKey<LArNoisyROSummary> m_noisyROSummaryKey{this,"NoisyROSumKey","LArNoisyROSummary","SG key of LArNoisyROSummary object"}; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","SG Key of EventInfo object"}; - - SG::ReadHandleKey<LArDigitContainer> m_digitContainerKey{this,"LArDigitContainerKey","FREE","SG key of LArDigitContainer read from Bytestream"}; - - - -private: - - /**declaration histo summary*/ - TH2F_LW* m_summary; - TH2F_LW* m_summaryGain = nullptr; - - - /** Define the monitoring histograms used for each partitions of the LArCalorimeter*/ - struct partition { - partition(): - m_NullDigit(0), - m_SatDigit(0), - m_SatDigitLow(0), - m_OutDigit(0), - m_NullDigitChan(0), - m_SatDigitChan(0), - m_SatDigitChanLow(0), - m_OutDigitChan(0), - m_Temp_NullDigitChan(0), - m_Temp_SatDigitChan(0), - m_Temp_SatDigitChanLow(0), - m_Temp_OutDigitChan(0), - m_PNullDigit(0), - m_PSatDigit(0), - m_PSatDigitLow(0), - m_POutDigit(0), - m_AverDig(0), - m_AverTempPos_PerStream(0), - m_EnTime(0), - m_SignShape(0), - m_MaxVsTime(0), - m_TriggerType(0), - sumpos(0) - { - }; - - TH2I_LW* m_NullDigit; - TH2I_LW* m_SatDigit; - TH2I_LW* m_SatDigitLow; - TH2I_LW* m_OutDigit; - - //define histograms at channel levels - TH2F_LW* m_NullDigitChan; - TH2F_LW* m_SatDigitChan; - TH2F_LW* m_SatDigitChanLow; - TH2F_LW* m_OutDigitChan; - - //Declare temporary histograms to be used online... - TH2I_LW* m_Temp_NullDigitChan; - TH2I_LW* m_Temp_SatDigitChan; - TH2I_LW* m_Temp_SatDigitChanLow; - TH2I_LW* m_Temp_OutDigitChan; - - TProfile2D_LW* m_PNullDigit; - TProfile2D_LW* m_PSatDigit; - TProfile2D_LW* m_PSatDigitLow; - TProfile2D_LW* m_POutDigit; - TProfile2D_LW* m_AverDig; - - TH2I_LW* m_AverTempPos_PerStream; - - TH2F_LW* m_EnTime; - - TProfile_LW* m_SignShape; - TProfile_LW* m_MaxVsTime; - TProfile_LW* m_TriggerType; - - std::string name; - int sumpos; - - }; - - /** Now define the 8 partitions of the LArCalorimeter*/ - partition m_BarrelA; - partition m_BarrelC; - partition m_EmecA; - partition m_EmecC; - partition m_HecA; - partition m_HecC; - partition m_FcalA; - partition m_FcalC; - - - /**declare identifier*/ - HWIdentifier m_feedthroughID; - int m_slot; - int m_feedthrough; - int m_febHash; - int m_channel; - - - /**declaration variables used in joboptions*/ - int m_SampleRangeLow; - int m_SampleRangeUp; - int m_ADCsatureCut; - int m_SigmaCut; - int m_ExpectedSampleMax; - int m_SampleNumberFromDB; - int m_NumberBadFebs; - bool m_ignoreKnownBadChannels; - bool m_ComputeHistError; - bool m_PercComputed; - bool m_IsOnline; - double m_TreshOut; - double m_TreshNull; - double m_TreshSat; - - //Added for Stream aware: - std::vector<std::string> m_streams; - std::vector<unsigned> m_streamsThisEvent; - - /** Private members*/ - int m_Samplenbr; - int m_eventsCounter; - int m_evtId; - - - /** Declare methods used*/ - void BookPartitions(partition& sub, const std::string& hTitle,MonGroup& ShiftGroup,MonGroup& ExpertGroup, MonGroup& ExpertGroupEff); - void HistTitle(LWHist2D* hist,partition& sub) const; - void HistTitle(TProfile2D_LW* hist,partition& sub) const; - void HistTitleSum(LWHist2D* hist) const; - void FillSaturation(partition& sub) const; - void FillSaturationLow(partition& sub) const; - void FillOutOfRange(partition& sub) const; - void FillAverMaxDig(partition& sub, int& i, float nrj, unsigned int& m_l1Trig,unsigned int& lumiblock); - void FillSumary(partition& sub); - void OutHistTitle(partition& sub); - static void FillSignShape(partition& sub, int& i,float nrj,float sample_max); - void FillNullHisto(partition& sub) const; - void ScalePartition(partition& sub); - void EndOfRun(partition& sub); - void DeleteHist(partition& sub) const; - void ScaleHisto(LWHist2D * h,int& events) const; - static void ComputeError(LWHist2D* hist,int& events); - partition& WhatPartition(HWIdentifier id); - static int GetNumberCells(TProfile2D_LW* hist1,double treshold); - static double GetMeanVal(LWHist2D* hist1); - - void ScaleOnlinePartition(partition& sub); - static void DumpHisto(LWHist2D* hist1,TProfile2D_LW* hist2); - void DumpOnlineHisto(LWHist2D* hist1,LWHist2D* hist2) const; - - /** control string name types for histo names and titles*/ - // LArOnlineIDStrHelper::NameType m_histoNameType; // dws << never used - // LArOnlineIDStrHelper::NameType m_histoTitleType; // dws << never used -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx b/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx deleted file mode 100755 index 8498d561f7d05035c6e037416721ba06158d8845..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx +++ /dev/null @@ -1,1354 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// NAME: LArFEBMon.cxx -// -// AUTHORS: R. Kehoe 10/15/2005 -// Andy Haas 12/25/2005 -// R. Kehoe 06/10/2006 -// P. Krieger 06/10/2006 -// 2007- : Algorithm fully rewritten and optimized by B.Trocme -// ******************************************************************** - -#include "LArFEBMon.h" - -#include "LArRecEvent/LArEventBitInfo.h" - -#include "LArRawConditions/LArDSPThresholdsComplete.h" -#include "AthenaPoolUtilities/AthenaAttributeList.h" -#include "LArCOOLConditions/LArDSPThresholdsFlat.h" - -#include "TTree.h" -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH2I_LW.h" -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH2F_LW.h" -#include "LWHists/TProfile2D_LW.h" -#include "LWHists/TProfile_LW.h" - -#include "xAODEventInfo/EventInfo.h" -#include "LArTrigStreamMatching.h" - -#include <algorithm> -#include <cmath> -#include <cstdint> -#include <sys/types.h> - -const unsigned nFEBnominal=1524; - -// ******************************************************************** -LArFEBMon::LArFEBMon(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_eventRejected(false), - m_currentFebStatus(false), - m_eventTime(0), - m_eventTime_ns(0), - m_l1Trig(0), - m_strHelper(nullptr), - m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), - m_trigok(false), - m_barrelCSummary(), - m_barrelASummary(), - m_emecCSummary(), - m_emecASummary(), - m_hecCSummary(), - m_hecASummary(), - m_fcalCSummary(), - m_fcalASummary(), - m_febInError(), - m_anyfebIE(false) -{ - declareProperty("IgnoreMissingHeaderEMB",m_ignoreMissingHeaderEMB = false); - declareProperty("IgnoreMissingHeaderPS",m_ignoreMissingHeaderPS = false); - declareProperty("keyDSPThresholds",m_keyDSPThresholds="LArDSPThresholds"); - /** Give the name of the streams you want to monitor, if empty, only simple profile per partition (offline case):*/ - declareProperty("Streams",m_streams); - declareProperty("ExcludeCosmicCalo",m_excoscalo); - - declareProperty("IsOnline",m_isOnline=true); - - declareProperty("m_lumi_blocks", m_lumi_blocks = 3000 ); - - m_onlineHelper = nullptr; - m_strHelper = nullptr; - - m_eventsCounter = 0; - - for (unsigned i = 0;i < nFEBnominal; i++) { - m_febInError[i] = nullptr; - m_bfebIE[i] = false; - } - - m_FEBmin = -20.5; - m_FEBmax = 1599.5; - m_FEBnbins = 1620; - - m_LArAllErrors_dE = nullptr; - m_rejectedYield = nullptr; - m_rejectedHisto = nullptr; - m_rejectedLBProfile = nullptr; - m_rejBitsHisto = nullptr; - - m_eventsLB = nullptr; - m_rejectedYieldLB = nullptr; - m_rejectedYieldLBout = nullptr; - m_eventSizeLB = nullptr; - m_nbOfEvts2D = nullptr; - m_eventType = nullptr; - m_nbOfSamples = nullptr; - m_totNbSw2 = nullptr; - m_dspThresholds_ADC = nullptr; - m_dspThresholds_qtime = nullptr; - - m_hTriggerType = nullptr; - m_hTriggerTypeAllDSP = nullptr; - m_hTimeDistrib = nullptr; - m_nbOfFebBlocksTotal = nullptr; - - m_CorruptTree = nullptr; - m_stream_eventSizeLB = nullptr; - - //m_useLumi = false; // Turn off lumi-feature of base-class -} - -// ******************************************************************** -LArFEBMon::~LArFEBMon() { - if( m_strHelper != nullptr ) delete m_strHelper; -} - -// ******************************************************************** -StatusCode LArFEBMon::initialize() { - - ATH_MSG_DEBUG( "Initializing LArFEBMon " ); - - StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not get LArOnlineID helper !" ); - return StatusCode::FAILURE; - } - - m_strHelper = new LArOnlineIDStrHelper(m_onlineHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - sc=m_BFKey.initialize(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not initialize Missing FEBs key " << m_BFKey.key() ); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG( "Missing FEBs key" << m_BFKey.key() << " initialized" ); - } - - ATH_CHECK( m_EventInfoKey.initialize() ); - ATH_CHECK( m_LArFebHeaderContainerKey.initialize() ); - ATH_CHECK( m_LArFebErrorSummaryKey.initialize() ); - - ManagedMonitorToolBase::initialize().ignore(); - - return sc; -} - -// ******************************************************************** -StatusCode LArFEBMon::bookHistograms() { - - // General summary histos - - StatusCode sc = StatusCode::SUCCESS; - - // if(isNewRun){ - MonGroup summaryGroupW( this, "/LAr/FEBMonOldTool/Summary", run, ATTRIB_MANAGED, "", "weightedEff" ); - MonGroup summaryGroup( this, "/LAr/FEBMonOldTool/Summary", run, ATTRIB_MANAGED ); - MonGroup perPartitionDataGroup( this, "/LAr/FEBMonOldTool/perPartitionData", run, ATTRIB_MANAGED ); - MonGroup perPartitionDataGroupLowerLB( this, "/LAr/FEBMonOldTool/perPartitionData", run, ATTRIB_MANAGED, "", "lowerLB" ); - // General summary histos - m_rejectedHisto = TH1F_LW::create("EventsRejected","Nb of events rejected (at least one error)",3,0.5,3.5); - (m_rejectedHisto->GetXaxis())->SetBinLabel(1,"Whole event corrupted"); - (m_rejectedHisto->GetXaxis())->SetBinLabel(2,"Single FEB corrupted"); - (m_rejectedHisto->GetXaxis())->SetBinLabel(3,"Accepted"); - //sc &= summaryGroup.regHist(m_rejectedHisto); - - sc = regHist(m_rejectedHisto, "/LAr/FEBMonOldTool/Summary", run); - - m_rejectedYield = TH1F_LW::create("EventsRejectedYield","Data corruption yield",3,0.5,3.5); - (m_rejectedYield->GetXaxis())->SetBinLabel(1,"Whole event corrupted"); - (m_rejectedYield->GetXaxis())->SetBinLabel(2,"Single FEB corrupted"); - (m_rejectedYield->GetXaxis())->SetBinLabel(3,"Accepted"); - (m_rejectedYield->GetYaxis())->SetTitle("Yield(%)"); - sc &= summaryGroupW.regHist(m_rejectedYield); - - if (m_isOnline){ // Histo useless offline -> switch off in order to avoid merging warning - m_rejectedLBProfile = TProfile_LW::create("EventsRejectedLB","% of events rejected in current LB (online only)",1,0,1); - (m_rejectedLBProfile->GetXaxis())->SetBinLabel(1,"% of events"); - m_rejectedLBProfile->SetMinimum(0); - m_rejectedLBProfile->SetMaximum(100); - sc &= summaryGroup.regHist(m_rejectedLBProfile); - } - - m_rejBitsHisto = TH1I_LW::create("rejectionBits","Errors at the origin of event rejection",8192,0.5,8191.5); - (m_rejBitsHisto->GetYaxis())->SetTitle("Number of (rejected) events"); - sc &= summaryGroup.regHist(m_rejBitsHisto); - - m_LArAllErrors_dE = TH2I_LW::create("NbOfLArFEBMonErrors_dE","# of data corruption errors",13,0.5,13.5,8,-0.5,7.5); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(1,"Parity"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(2,"BCID"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(3,"Sample Header"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(4,"EVTID"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(5,"SCAC status"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(6,"Sca out of range"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(7,"Gain mismatch"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(8,"Type mismatch"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(9,"# of samples"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(10,"Empty data block"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(11,"Checksum / block size"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(12,"Missing header"); - (m_LArAllErrors_dE->GetXaxis())->SetBinLabel(13,"Bad gain"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(2,"EMBA"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(1,"EMBC"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(4,"EMECA"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(3,"EMECC"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(6,"HECA"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(5,"HECC"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(8,"FCALA"); - (m_LArAllErrors_dE->GetYaxis())->SetBinLabel(7,"FCALC"); - sc &= summaryGroup.regHist(m_LArAllErrors_dE); - - // Number of events per minute vs LB - m_eventsLB = TH1I_LW::create("NbOfEventsVsLB","Nb of events per LB",m_lumi_blocks+1,-0.5,(float)m_lumi_blocks+0.5); - (m_eventsLB->GetXaxis())->SetTitle("Luminosity Block"); - sc &= summaryGroup.regHist(m_eventsLB); - - // Number of events rejected per LB - m_rejectedYieldLB = TProfile_LW::create("YieldOfRejectedEventsVsLB","Yield of corrupted events",m_lumi_blocks+1,-0.5,(float)m_lumi_blocks+0.5); - (m_rejectedYieldLB->GetXaxis())->SetTitle("Luminosity Block"); - (m_rejectedYieldLB->GetYaxis())->SetTitle("Yield(%)"); - m_rejectedYieldLB->SetMinimum(-5.); - sc &= summaryGroup.regHist(m_rejectedYieldLB); - - // Number of events rejected per LB outside time veto window - m_rejectedYieldLBout = TProfile_LW::create("YieldOfRejectedEventsVsLBout","Yield of corrupted events not vetoed by time window",m_lumi_blocks+1,-0.5,(float)m_lumi_blocks+0.5); - (m_rejectedYieldLBout->GetXaxis())->SetTitle("Luminosity Block"); - m_rejectedYieldLBout->SetMinimum(-5.); - sc &= summaryGroup.regHist(m_rejectedYieldLBout); - - // Mean event size per LB - m_eventSizeLB = TProfile_LW::create("eventSizeVsLB","LAr event size (w/o ROS headers)",m_lumi_blocks+1,-0.5,(float)m_lumi_blocks+0.5); - (m_eventSizeLB->GetXaxis())->SetTitle("Luminosity Block"); - (m_eventSizeLB->GetYaxis())->SetTitle("Megabytes"); - sc &= summaryGroup.regHist(m_eventSizeLB); - - if (m_isOnline){ // Histo useless offline -> switch off in order to avoid merging warning - // Mean event size per stream per LB - int nStreams = m_streams.size(); - if(nStreams > 0) { - m_stream_eventSizeLB = TProfile2D_LW::create("eventSizeStreamVsLB","LAr event size per stream per LB (w/o ROS headers)",m_lumi_blocks+1,-0.5,(float)m_lumi_blocks+0.5,nStreams+1,-0.5,nStreams+0.5); - (m_stream_eventSizeLB->GetXaxis())->SetTitle("Luminosity Block"); - for (int str = 0; str < nStreams; str++) { - (m_stream_eventSizeLB->GetYaxis())->SetBinLabel(str+1,m_streams[str].c_str()); - } - (m_stream_eventSizeLB->GetYaxis())->SetBinLabel(nStreams+1,"others"); - sc &= summaryGroup.regHist(m_stream_eventSizeLB); - } - } - - - // All nb of readout FEB per partition in one TH2 - m_nbOfEvts2D = TH2I_LW::create("NbOfEvts2d","# of readout FEB/DSP header",500,-20.5,479.5,4,-0.5,3.5); - (m_nbOfEvts2D->GetYaxis())->SetBinLabel(2,"Barrel A"); - (m_nbOfEvts2D->GetYaxis())->SetBinLabel(1,"Barrel C"); - (m_nbOfEvts2D->GetYaxis())->SetBinLabel(4,"Endcap A"); - (m_nbOfEvts2D->GetYaxis())->SetBinLabel(3,"Endcap C"); - sc &= perPartitionDataGroup.regHist(m_nbOfEvts2D); - - // Global nb of readout FEB - m_nbOfFebBlocksTotal = TH1I_LW::create("NbOfReadoutFEBGlobal","# of readout FEB/DSP header",m_FEBnbins,m_FEBmin,m_FEBmax); - sc &= perPartitionDataGroup.regHist(m_nbOfFebBlocksTotal); - - // DSP threshold - m_dspThresholds_ADC = TH1I_LW::create("dspThresholdsADC","DSP thresholds to readout samples",2000,-100.5,1899.5); - m_dspThresholds_ADC->GetYaxis()->SetTitle("Number of cells"); - m_dspThresholds_ADC->GetXaxis()->SetTitle("Cell threshold in ADC counts"); - sc &= perPartitionDataGroupLowerLB.regHist(m_dspThresholds_ADC); - m_dspThresholds_qtime = TH1I_LW::create("dspThresholds_qfactortime","DSP thresholds to readout (qfactor+time)",2000,-100.5,1899.5); - m_dspThresholds_qtime->GetYaxis()->SetTitle("Number of cells"); - m_dspThresholds_qtime->GetXaxis()->SetTitle("Cell threshold in ADC counts"); - sc &= perPartitionDataGroupLowerLB.regHist(m_dspThresholds_qtime); - - // Event type - m_eventType = TH1I_LW::create("Eventtype","Event type (1st readout FEB)",5,0.,15.); - (m_eventType->GetXaxis())->SetBinLabel(1,"Raw data - Transparent"); - (m_eventType->GetXaxis())->SetBinLabel(2,"Result - Physic"); - (m_eventType->GetXaxis())->SetBinLabel(3,"Calibration"); - (m_eventType->GetXaxis())->SetBinLabel(4,"Pedestals"); - (m_eventType->GetXaxis())->SetBinLabel(5,"Raw data+Result"); - sc &= perPartitionDataGroup.regHist(m_eventType); - - // Trigger types - m_hTriggerType = TH1I_LW::create("TriggerWord","Number of Events per L1 trigger word (8 bits)", 256, -0.5, 255.5); - m_hTriggerType->GetXaxis()->SetTitle("L1 trigger word"); - sc &= perPartitionDataGroup.regHist(m_hTriggerType); - m_hTriggerTypeAllDSP = TH1I_LW::create("TriggerWordAllDSP","Number L1 trigger word per DSP (8 bits)", 256, -0.5, 255.5); - m_hTriggerTypeAllDSP->GetXaxis()->SetTitle("L1 trigger word"); - (m_hTriggerTypeAllDSP->GetYaxis())->SetTitle("Number of events"); - sc &= perPartitionDataGroup.regHist(m_hTriggerTypeAllDSP); - - // Nb of samples - m_nbOfSamples = TH1I_LW::create("NbOfSamples","# of samples (1st readout FEB)",35,-1.5,33.5); - (m_nbOfSamples->GetYaxis())->SetTitle("Number of events"); - sc &= perPartitionDataGroup.regHist(m_nbOfSamples); - - // Nb of cells above DSP samples threshold - m_totNbSw2 = TH1I_LW::create("NbOfSw2","# of cells with samples readout",2000,-1000,199000); - (m_totNbSw2->GetXaxis())->SetTitle("Number of cells"); - (m_totNbSw2->GetYaxis())->SetTitle("Number of events"); - sc &= perPartitionDataGroup.regHist(m_totNbSw2); - - // Book per partition set of histograms - sc &= bookNewPartitionSumm(m_barrelCSummary,"EMBC"); - sc &= bookNewPartitionSumm(m_barrelASummary,"EMBA"); - sc &= bookNewPartitionSumm(m_emecCSummary,"EMECC"); - sc &= bookNewPartitionSumm(m_emecASummary,"EMECA"); - sc &= bookNewPartitionSumm(m_hecCSummary,"HECC"); - sc &= bookNewPartitionSumm(m_hecASummary,"HECA"); - sc &= bookNewPartitionSumm(m_fcalCSummary,"FcalC"); - sc &= bookNewPartitionSumm(m_fcalASummary,"FcalA"); - - plotMaskedFEB(); - - if(m_isOnline) { - // setup trigger decision tool - m_trigDec.retrieve().ignore(); - const Trig::ChainGroup* allL1 = m_trigDec->getChainGroup("L1_.*"); - std::vector<std::string> l1triggers = allL1->getListOfTriggers(); - - ATH_MSG_INFO( "lvl1 item names: [" ); - for (unsigned int i=0;i< l1triggers.size();i++) { - ATH_MSG_INFO( i << " " << l1triggers.at(i) << " , " ); - } - ATH_MSG_INFO( "] " ); - - m_trigok = !l1triggers.empty(); - } - - // - m_CorruptTree = new TTree("LArCorrupted","Timestamps of corrupted LAr events"); - m_CorruptTree->Branch("time",&m_eventTime,"time/i"); - m_CorruptTree->Branch("time_ns",&m_eventTime_ns,"time_ns/i"); - m_CorruptTree->Branch("febHwId",&m_febInErrorTree); - m_CorruptTree->Branch("febErrorType",&m_febErrorTypeTree); - summaryGroup.regTree(m_CorruptTree).ignore(); - // } - - ATH_MSG_DEBUG( "done with bookHists()" ); - - if (sc.isFailure()) { - ATH_MSG_ERROR( "Bookhists failed" ); - } - - return sc; -} - - -// ******************************************************************** -//called on each event -StatusCode LArFEBMon::fillHistograms() { - - m_eventRejected = false; - m_rejectionBits.reset(); - m_febInErrorTree.clear(); - m_febErrorTypeTree.clear(); - - m_eventsCounter++; - - // Retrieve event info to get event time,trigger type... - // Retrieved at beg of method now to get the LVL1 type - // to check consistency with DSP trigger type - SG::ReadHandle<xAOD::EventInfo> thisEvent{m_EventInfoKey}; - - if(!thisEvent.isValid()) { - ATH_MSG_WARNING( "Failed to retrieve EventInfo object" ); - return StatusCode::FAILURE; - } - - m_l1Trig = thisEvent->level1TriggerType(); - m_hTriggerType->Fill(m_l1Trig); - - m_eventTime=thisEvent->timeStamp(); - m_eventTime_ns=thisEvent->timeStampNSOffset(); - - unsigned lumi_block = thisEvent->lumiBlock(); - bool lar_inerror = thisEvent->errorState(xAOD::EventInfo::LAr)==xAOD::EventInfo::Error; - - //ATH_MSG_INFO( "LArFEBMon Lumi block: "<<lumi_block); - - SG::ReadHandle<LArFebHeaderContainer> hdrCont{m_LArFebHeaderContainerKey}; - SG::ReadHandle<LArFebErrorSummary> lArFebErrorSummary{m_LArFebErrorSummaryKey}; - if (!hdrCont.isValid()) { - ATH_MSG_WARNING( "No LArFebHeaderContainer found in TDS" ); - return StatusCode::FAILURE; - } - - if (hdrCont->empty()) { - ATH_MSG_WARNING( "Got empty LArFebHeaderContainer. Do nothing" ); - return StatusCode::FAILURE; - } - - if (!lArFebErrorSummary.isValid()) { - ATH_MSG_WARNING( "No LArFebErrorSummary found in TDS" ); - return StatusCode::FAILURE; - } - - StatusCode sc; - uint32_t firstEventType = (*hdrCont->begin())->DetEventType(); - - // At 1st event, retrieve DSP thresholds and fill histogram with values for all channels - if (m_eventsCounter == 1 && firstEventType == 4) { - m_dspThresholds_ADC->SetTitle(Form("DSP thresholds for ADC-sample transmission (only in physics) - LB %4d",lumi_block)); - m_dspThresholds_qtime->SetTitle(Form("DSP thresholds for qfactor+time calculation (only in physics) - LB %4d",lumi_block)); - if (!m_keyDSPThresholds.empty()) { - if (detStore()->contains<LArDSPThresholdsComplete>(m_keyDSPThresholds)) { - ATH_MSG_DEBUG("Loading run1 version of LAr DSP Thresholds"); - const LArDSPThresholdsComplete* dspThresh=nullptr; - sc=detStore()->retrieve(dspThresh,m_keyDSPThresholds); - if(!sc.isSuccess()) { - ATH_MSG_WARNING(" Failed to retrieve LArDSPThresholds with key " << m_keyDSPThresholds - << ". Will not fill histograms" ); - } - else { - auto chIt=m_onlineHelper->channel_begin(); - auto chIt_e=m_onlineHelper->channel_end(); - for (;chIt!=chIt_e;++chIt) { - m_dspThresholds_ADC->Fill(dspThresh->samplesThr(*chIt)); - m_dspThresholds_qtime->Fill(dspThresh->tQThr(*chIt)); - }//end loop over channels - }//end got DSP Thresholds - } //end if contains LArDSPThresholdsComplete - - else { - ATH_MSG_DEBUG("Loading run2 version of LAr DSP Thresholds"); - const AthenaAttributeList* dspThrshAttr=nullptr; - sc=detStore()->retrieve(dspThrshAttr,m_keyDSPThresholds); - if (sc.isFailure()) { - ATH_MSG_WARNING( "Failed to retrieve AttributeList with key (folder) " << m_keyDSPThresholds - << ", containing DSP Thresholds. Will not fill histograms." ); - } - else { - const LArDSPThresholdsFlat* dspThreshFlat=new LArDSPThresholdsFlat(dspThrshAttr); - if (!dspThreshFlat->good()) { - ATH_MSG_WARNING( "Failed to initialize LArDSPThresholdFlat from attribute list loaded from " << m_keyDSPThresholds - << ". Will not fill histograms." ); - }//end if not good - const IdentifierHash chanMax=m_onlineHelper->channelHashMax(); - for (unsigned iChan=0;iChan<chanMax;++iChan) { - m_dspThresholds_ADC->Fill(dspThreshFlat->samplesThrByHash(iChan)); - m_dspThresholds_qtime->Fill(dspThreshFlat->tQThrByHash(iChan)); - } - - delete dspThreshFlat; - }//end else got DSP Thresholds - }// else run 2 - }// end load DSP thresholds from DB - else - ATH_MSG_WARNING( "No LArDSPThresholds key specificed. Will not fill these histograms" ); - }//end if eventsCounter==1 - - - //Adjust event type if we have raw data in the ROD block - if (firstEventType == 4 && (*hdrCont->begin())->RodRawDataSize() != 0) firstEventType = 14; - - unsigned int nfeb[8] = {0,0,0,0,0,0,0,0}; - unsigned int firstEventNbSp=0; - unsigned int totNbOfSweet2 = 0; - float larEventSize = 0; - float larEventSize_part[8] = {0.,0.,0.,0.,0.,0.,0.,0.}; - - LArFebHeaderContainer::const_iterator it = hdrCont->begin(); - LArFebHeaderContainer::const_iterator it_e = hdrCont->end(); - - // Loop on all available FEBHeader to fill basic parameters histogram : event type, event size, nb of sweet cells... - for ( ; it!=it_e;++it) { - HWIdentifier febid=(*it)->FEBId(); - - if (febid.get_identifier32().get_compact() >= 0x38000000 && febid.get_identifier32().get_compact() <= 0x3bc60000 && !(febid.get_identifier32().get_compact() & 0xFFF)) { - int barrel_ec = m_onlineHelper->barrel_ec(febid); - int pos_neg = m_onlineHelper->pos_neg(febid); - int ft = m_onlineHelper->feedthrough(febid); - int slot = m_onlineHelper->slot(febid); - int partitionNb_dE = returnPartition(barrel_ec,pos_neg,ft,slot); - - if (partitionNb_dE >= 0) - nfeb[partitionNb_dE]++ ; - larEventSize += (float) ((*it)->RodRawDataSize() + (*it)->RodResults1Size() + (*it)->RodResults2Size()); // This quantity is now in megabytes - if(partitionNb_dE>=0 && partitionNb_dE<8) larEventSize_part[partitionNb_dE] += (float) ((*it)->RodRawDataSize() + (*it)->RodResults1Size() + (*it)->RodResults2Size()); - - // Eventype = 2 : transparent/raw data - 4 : Physic - 7 : calibration - 10 : pedestal - 14 : raw data + results - uint32_t eventType = (*it)->DetEventType(); - // If physic mode && raw data != 0, we are in rawdata+results - if (eventType == 4 && (*it)->RodRawDataSize() != 0) eventType = 14; - //if (firstEventType == 999) firstEventType = eventType; - if (firstEventNbSp == 0) - if ((*it)->NbSamples() != 0) - firstEventNbSp=(*it)->NbSamples(); - - - m_hTriggerTypeAllDSP->Fill((*it)->LVL1TigType()); - if (firstEventType == 4) totNbOfSweet2 = totNbOfSweet2+(*it)->NbSweetCells2(); - // Fill (nb of sweet cells per FEB) histos - switch (partitionNb_dE){ - case 0: - (m_barrelCSummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_barrelCSummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_barrelCSummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_barrelCSummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" EMBC : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 1: - (m_barrelASummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_barrelASummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_barrelASummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_barrelASummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" EMBA : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 2: - (m_emecCSummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_emecCSummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_emecCSummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_emecCSummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" EMECC : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 3: - (m_emecASummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_emecASummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_emecASummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_emecASummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" EMECA : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 4: - (m_hecCSummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_hecCSummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_hecCSummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_hecCSummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" HECC : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 5: - (m_hecASummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_hecASummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_hecASummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_hecASummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" HECA : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 6: - (m_fcalCSummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_fcalCSummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_fcalCSummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_fcalCSummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" FCALC : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - case 7: - (m_fcalASummary.nbOfEvts)->Fill(slot,ft); - if (firstEventType == 4) (m_fcalASummary.nbOfSweet1)->Fill(slot,ft,(*it)->NbSweetCells1()); - if (firstEventType == 4) (m_fcalASummary.nbOfSweet2)->Fill(slot,ft,(*it)->NbSweetCells2()); - if ((*it)->LVL1TigType() == 0 || (*it)->LVL1TigType() == 170 || (*it)->LVL1TigType() != m_l1Trig) (m_fcalASummary.missingTriggerType)->Fill(slot,ft); - ATH_MSG_DEBUG(" FCALA : " << m_onlineHelper->show_to_string(febid) << " LVL1 type" << (*it)->LVL1TigType()); - break; - } - }//Test on FEBid - }//end of loop over FEB headers - - // Loop over all febs to plot the error from statusword - // This is mandatory to also monitor the FEBs with missing headers - m_anyfebIE = false; - for (std::vector<HWIdentifier>::const_iterator allFeb = m_onlineHelper->feb_begin(); - allFeb != m_onlineHelper->feb_end(); ++allFeb) { - HWIdentifier febid = HWIdentifier(*allFeb); - m_currentFebStatus = false; - uint16_t feberrorSummary = lArFebErrorSummary->feb_error(febid); - - if ( feberrorSummary != 0 ){ - int barrel_ec = m_onlineHelper->barrel_ec(febid); - int pos_neg = m_onlineHelper->pos_neg(febid); - int ft = m_onlineHelper->feedthrough(febid); - int slot = m_onlineHelper->slot(febid); - int partitionNb_dE = returnPartition(barrel_ec,pos_neg,ft,slot); - - // Fill the errors in partition histograms - switch (partitionNb_dE){ - case 0: - fillErrorsSummary(m_barrelCSummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 1: - fillErrorsSummary(m_barrelASummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 2: - fillErrorsSummary(m_emecCSummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 3: - fillErrorsSummary(m_emecASummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 4: - fillErrorsSummary(m_hecCSummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 5: - fillErrorsSummary(m_hecASummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 6: - fillErrorsSummary(m_fcalCSummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - case 7: - fillErrorsSummary(m_fcalASummary,partitionNb_dE,ft,slot,feberrorSummary,lumi_block,lar_inerror); - break; - } - if (m_currentFebStatus && m_febInErrorTree.size()<33){ - m_febInErrorTree.push_back(febid.get_identifier32().get_compact()); - m_febErrorTypeTree.push_back(m_rejectionBits.to_ulong()); - } - } - if(m_currentFebStatus) m_anyfebIE = m_currentFebStatus; - } - // Check and reset the rejected histo per partition - // Use the ENTRIES variable to store the LB and reset if needed! - if (m_isOnline){ - if ((m_barrelCSummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_barrelCSummary.m_rejectedLBProfilePart)->Reset(); - (m_barrelCSummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_barrelASummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_barrelASummary.m_rejectedLBProfilePart)->Reset(); - (m_barrelASummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_emecASummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_emecASummary.m_rejectedLBProfilePart)->Reset(); - (m_emecASummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_emecCSummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_emecCSummary.m_rejectedLBProfilePart)->Reset(); - (m_emecCSummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_hecCSummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_hecCSummary.m_rejectedLBProfilePart)->Reset(); - (m_hecCSummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_hecASummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_hecASummary.m_rejectedLBProfilePart)->Reset(); - (m_hecASummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_fcalASummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_fcalASummary.m_rejectedLBProfilePart)->Reset(); - (m_fcalASummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - if ((m_fcalCSummary.m_rejectedLBProfilePart)->GetEntries() != lumi_block) { - (m_fcalCSummary.m_rejectedLBProfilePart)->Reset(); - (m_fcalCSummary.m_rejectedLBProfilePart)->SetEntries(lumi_block); - } - } - - //Fill general data histos - m_eventType->Fill(firstEventType); - float nbOfFeb = (float) (nfeb[0]+nfeb[1]+nfeb[2]+nfeb[3]+nfeb[4]+nfeb[5]+nfeb[6]+nfeb[7]); - if (firstEventType == 2 || firstEventType == 4 || firstEventType == 14) m_nbOfSamples->Fill(firstEventNbSp); - - // Fill the total number of FEB (test on DSP headers) and for each partition (Dirac plots) - m_nbOfFebBlocksTotal->Fill(nbOfFeb); - - m_barrelASummary.nbOfFebBlocks->Fill(nfeb[1]); - m_nbOfEvts2D->Fill(nfeb[1],1); - - m_barrelCSummary.nbOfFebBlocks->Fill(nfeb[0]); - m_nbOfEvts2D->Fill(nfeb[0],0); - - m_nbOfEvts2D->Fill(nfeb[3]+nfeb[5]+nfeb[7],3); - m_emecASummary.nbOfFebBlocks->Fill(nfeb[3]); - m_hecASummary.nbOfFebBlocks->Fill(nfeb[5]); - m_fcalASummary.nbOfFebBlocks->Fill(nfeb[7]); - - m_nbOfEvts2D->Fill(nfeb[2]+nfeb[4]+nfeb[6],2); - m_emecCSummary.nbOfFebBlocks->Fill(nfeb[2]); - m_hecCSummary.nbOfFebBlocks->Fill(nfeb[4]); - m_fcalCSummary.nbOfFebBlocks->Fill(nfeb[6]); - - // If the nb of DSP headers is lower than the maximum, this means that there are some missing FEBs, probably - // due to missing ROS fragment - // This assumes that the maximum of DSP headers found is the expected one - // ATH_MSG_ERROR( "ICI" << nbOfFeb << " " << m_nbOfFebBlocksTotal->GetBinLowEdge(m_nbOfFebBlocksTotal->GetMaximumBin()) ); - - if (nbOfFebOK(nbOfFeb,m_nbOfFebBlocksTotal)){ - // The nb of readout FEB is lower than the maximum number of FEBs observed in this run - m_rejectedHisto->Fill(1); - // m_rejectedLBProfile->Fill(0.5,100); - } - else{ - // There was at least one FEB in error - if (m_eventRejected) { - m_rejectedHisto->Fill(2); - m_rejBitsHisto->Fill(m_rejectionBits.to_ulong()); - // m_rejectedLBProfile->Fill(0.5,100); - } - // The event is accepted - else { - m_rejectedHisto->Fill(3); - //m_rejectedLBProfile->Fill(0.5,0); - } - } - - - m_eventsLB->Fill(lumi_block); - m_totNbSw2->Fill(totNbOfSweet2); - larEventSize = larEventSize/262144; - m_eventSizeLB->Fill(lumi_block,larEventSize); - - // Use the ENTRIES variable to store the LB and reset if needed! - if (m_isOnline){ - if (m_rejectedLBProfile->GetEntries() != lumi_block) - m_rejectedLBProfile->Reset(); - } - - if(m_anyfebIE) { m_CorruptTree->Fill(); } - - if ((m_eventRejected) || nbOfFebOK(nbOfFeb,m_nbOfFebBlocksTotal) || nbOfFeb < nFEBnominal){ - if ((m_eventRejected) || nbOfFebOK(nbOfFeb,m_nbOfFebBlocksTotal)) m_rejectedYieldLB->Fill(lumi_block,100); else m_rejectedYieldLB->Fill(lumi_block,50); - - if (!(thisEvent->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::DATACORRUPTEDVETO))) - m_rejectedYieldLBout->Fill(lumi_block,100); - else - m_rejectedYieldLBout->Fill(lumi_block,0); - - if (m_isOnline) { - if (lar_inerror) m_rejectedLBProfile->Fill(0.5,100); else m_rejectedLBProfile->Fill(0.5,50); - } - } else{ - m_rejectedYieldLB->Fill(lumi_block,0); - m_rejectedYieldLBout->Fill(lumi_block,0); - if (m_isOnline) m_rejectedLBProfile->Fill(0.5,0); - } - if (m_isOnline) m_rejectedLBProfile->SetEntries(lumi_block); - - - //Trigger part: Already done at the beginning of this function - //uint m_l1Trig = (uint) (trig->level1TriggerType()); - //m_hTriggerType->Fill(m_l1Trig); - - if(m_isOnline && !m_streams.empty()) { - m_streamsThisEvent=trigStreamMatching(m_streams,thisEvent->streamTags()); - - // Now we could fill the event size - - unsigned ie; - for(unsigned int str=0; str<m_streamsThisEvent.size(); ++str) { - if(m_streamsThisEvent[str] > m_streams.size()) break; - if(m_trigok && m_streamsThisEvent[str] < m_streams.size() && (m_streams[m_streamsThisEvent[str]].find("CosmicCalo") != std::string::npos)) { // test excluding events - for(ie=0; ie<m_excoscalo.size(); ++ie) { - if(m_trigDec->isPassed(m_excoscalo[ie])) break; - } - if(ie<m_excoscalo.size()) { - std::cout<<"Skipping "<<m_excoscalo[ie]<<" for CosmicCalo "<<std::endl; - continue; // we should skip this trigger - } - } - - m_stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize) ; - - m_barrelASummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[1]/262144); - m_barrelCSummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[0]/262144); - - m_emecASummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[3]/262144); - m_hecASummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[5]/262144); - m_fcalASummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[7]/262144); - - m_emecCSummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[2]/262144); - m_hecCSummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[4]/262144); - m_fcalCSummary.stream_eventSizeLB->Fill(lumi_block, m_streamsThisEvent[str], larEventSize_part[6]/262144); - } - } else { // we are filling only simple profiles - m_barrelASummary.eventSizeLB->Fill(lumi_block, larEventSize_part[1]/262144); - m_barrelCSummary.eventSizeLB->Fill(lumi_block, larEventSize_part[0]/262144); - - m_emecASummary.eventSizeLB->Fill(lumi_block, larEventSize_part[3]/262144); - m_hecASummary.eventSizeLB->Fill(lumi_block, larEventSize_part[5]/262144); - m_fcalASummary.eventSizeLB->Fill(lumi_block, larEventSize_part[7]/262144); - - m_emecCSummary.eventSizeLB->Fill(lumi_block, larEventSize_part[2]/262144); - m_hecCSummary.eventSizeLB->Fill(lumi_block, larEventSize_part[4]/262144); - m_fcalCSummary.eventSizeLB->Fill(lumi_block, larEventSize_part[6]/262144); - } - - - return sc; -} - - -// ******************************************************************** -void LArFEBMon::fillErrorsSummary(summaryPartition& summ,int partitNb_2,int ft,int slot,uint16_t error, unsigned lumi_block, bool lar_inerror) -{ - if (summ.maskedFEB->GetBinContent(slot,ft+1) != 0) return; - - if ( error & (1<<0) ){ - (summ.parity)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(0); - m_LArAllErrors_dE->Fill(1,partitNb_2); - } - - if ( error & (1<<1) ){ - (summ.BCID_2halves)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(1); - m_LArAllErrors_dE->Fill(2,partitNb_2); - } - - if ( error & (1<<2) ){ - (summ.RADD_2halves)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(2); - m_LArAllErrors_dE->Fill(3,partitNb_2); - } - - if ( error & (1<<3) ){ - (summ.EVTID_2halves)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(3); - m_LArAllErrors_dE->Fill(4,partitNb_2); - } - - if ( error & (1<<4) ){ - (summ.SCACStatus)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(4); - m_LArAllErrors_dE->Fill(5,partitNb_2); - } - - if ( error & (1<<5) ){ - (summ.scaOutOfRange)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(5); - m_LArAllErrors_dE->Fill(6,partitNb_2); - } - - if ( error & (1<<6) ){ - (summ.gainMismatch)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(6); - m_LArAllErrors_dE->Fill(7,partitNb_2); - } - - if ( error & (1<<7) ){ - (summ.typeMismatch)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(7); - m_LArAllErrors_dE->Fill(8,partitNb_2); - } - - if ( error & (1<<8) ){ - (summ.badNbOfSamp)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(8); - m_LArAllErrors_dE->Fill(9,partitNb_2); - } - - if ( error & (1<<9) ){ - (summ.zeroSamp)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(9); - m_LArAllErrors_dE->Fill(10,partitNb_2); - } - - - if ( error & (1<<11) ){ - (summ.checkSum)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(10); - m_LArAllErrors_dE->Fill(11,partitNb_2); - } - - if ( error & (1<<12) ){ - // Check whether this error can be ignored. Useful for calibration run of PS or EMB - if (!((m_ignoreMissingHeaderEMB && partitNb_2<2 && slot>=2) || (m_ignoreMissingHeaderPS && partitNb_2<2 && slot==1))){ - (summ.missingHeader)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(11); - m_LArAllErrors_dE->Fill(12,partitNb_2); - } - } - - if ( error & (1<<13) ){ - (summ.badGain)->Fill(slot,ft); - m_currentFebStatus = true; - m_rejectionBits.set(12); - m_LArAllErrors_dE->Fill(13,partitNb_2); - } - - - if (m_currentFebStatus){ - (summ.LArAllErrors)->Fill(slot,ft); - if (lar_inerror) {// LArinError - m_eventRejected = true; - if (m_isOnline) (summ.m_rejectedLBProfilePart)->Fill(0.5,100); - } else { - if (m_isOnline) (summ.m_rejectedLBProfilePart)->Fill(0.5,50); - } - } else { - if (m_isOnline) (summ.m_rejectedLBProfilePart)->Fill(0.5,0); - } - - if (m_isOnline) { - (summ.m_rejectedLBProfilePart)->SetEntries(lumi_block); - //std::cout<<" Setting m_rejectedLBProfilePart Entries: "<<lumi_block<<std::endl; - } - - return; -} - -//******************************************************************** -StatusCode LArFEBMon::bookNewPartitionSumm(summaryPartition& summ,const std::string& summName) -{ - ATH_MSG_DEBUG( "In bookNewPartitionSumm ->" << summName ); - - MonGroup perPartitionGroup( this, "/LAr/FEBMonOldTool/perPartition", run, ATTRIB_MANAGED ); - MonGroup perPartitionYieldGroup( this, "/LAr/FEBMonOldTool/perPartition", run, ATTRIB_MANAGED, "" , "weightedEff" ); - MonGroup perPartitionDataGroup( this, "/LAr/FEBMonOldTool/perPartitionData", run, ATTRIB_MANAGED ); - MonGroup perPartitionMiscGroup( this, "/LAr/FEBMonOldTool/perPartitionMisc", run, ATTRIB_MANAGED ); - - int nbOfFT = 25; - int nbOfSlot = 15; - if (summName.find('B',0) != std::string::npos){ - nbOfFT = 32; - nbOfSlot = 14; - } - double ftMax = (double) nbOfFT - 0.5; - double slotMax = (double) nbOfSlot + 0.5; - - StatusCode sc = StatusCode::SUCCESS; - - // These are error histograms-This should be empty - // They are stored in /perPartition directory - std::string hName = "Parity"+summName; - std::string hTitle = "Parity error - " + summName; - summ.parity = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.parity); - sc &= perPartitionGroup.regHist(summ.parity); - - hName = "BCID"+summName; - hTitle = "BCID mismatch betw. 2 halves of FEB - " + summName; - summ.BCID_2halves = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.BCID_2halves); - sc &= perPartitionGroup.regHist(summ.BCID_2halves); - - hName = "RADD"+summName; - hTitle = "Sample header mismatch betw. 2 halves of FEB - " + summName; - summ.RADD_2halves = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.RADD_2halves); - sc &= perPartitionGroup.regHist(summ.RADD_2halves); - - hName = "EVTID"+summName; - hTitle = "EVTID mismatch betw. 2 halves of FEB - " + summName; - summ.EVTID_2halves = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.EVTID_2halves); - sc &= perPartitionGroup.regHist(summ.EVTID_2halves); - - hName = "SCACStatus"+summName; - hTitle = "Wrong SCAC status in one half of a FEB - " + summName; - summ.SCACStatus = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.SCACStatus); - sc &= perPartitionGroup.regHist(summ.SCACStatus); - - hName = "scaOutOfRange"+summName; - hTitle = "Sca out of range - " + summName; - summ.scaOutOfRange = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.scaOutOfRange); - sc &= perPartitionGroup.regHist(summ.scaOutOfRange); - - hName = "gainMismatch"+summName; - hTitle = "Gain mismatch within time samples - " + summName; - summ.gainMismatch = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.gainMismatch); - sc &= perPartitionGroup.regHist(summ.gainMismatch); - - hName = "typeMismatch"+summName; - hTitle = "Event type mismatch - " + summName; - summ.typeMismatch = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.typeMismatch); - sc &= perPartitionGroup.regHist(summ.typeMismatch); - - hName = "badNbOfSamp"+summName; - hTitle = "Non uniform number of samples - " + summName; - summ.badNbOfSamp = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.badNbOfSamp); - sc &= perPartitionGroup.regHist(summ.badNbOfSamp); - - hName = "zeroSamp"+summName; - hTitle = "Empty FEB data blocks - " + summName; - summ.zeroSamp = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.zeroSamp); - sc &= perPartitionGroup.regHist(summ.zeroSamp); - - hName = "checkSum"+summName; - hTitle = "Checksum / DSP block size - " + summName; - summ.checkSum = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.checkSum); - sc &= perPartitionGroup.regHist(summ.checkSum); - - hName = "missingHeader"+summName; - hTitle = "Missing header " + summName; - summ.missingHeader = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.missingHeader); - sc &= perPartitionGroup.regHist(summ.missingHeader); - - hName = "badGain"+summName; - hTitle = "Bad gain " + summName; - summ.badGain = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.badGain); - sc &= perPartitionGroup.regHist(summ.badGain); - - hName = "LArFEBMonErrorsAbsolute"+summName; - hTitle = "Nb of events with at least one error - " + summName; - summ.LArAllErrors = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.LArAllErrors); - sc &= perPartitionGroup.regHist(summ.LArAllErrors); - - hName = "LArFEBMonErrors"+summName; - hTitle = "% of events with at least one error - " + summName; - summ.LArAllErrorsYield = TH2F_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.LArAllErrorsYield); - sc &= perPartitionYieldGroup.regHist(summ.LArAllErrorsYield); - - hName = "knownFaultyFEB"+summName; - hTitle = "FEB with known errors (1:err. ignored 2:FEB masked) - " + summName; - summ.maskedFEB = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.maskedFEB); - sc &= perPartitionGroup.regHist(summ.maskedFEB); - - // These are misc histograms-This may be changed in error histograms if needed - // They are stored in /perPartitionMisc directory - hName = "missingTriggerType"+summName; - hTitle = "LVL1 trigger type missing or different from event type - " + summName; - summ.missingTriggerType = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.missingTriggerType); - sc &= perPartitionMiscGroup.regHist(summ.missingTriggerType); - - - // These are general data histograms - // They are stored in /perPartitionData directory - hName = "nbOfEvts"+summName; - hTitle = "Nb of events (DSP header check only) - " + summName; - summ.nbOfEvts = TH2I_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.nbOfEvts); - sc &= perPartitionDataGroup.regHist(summ.nbOfEvts); - - hName = "NbOfSweet1PerFEB"+summName; - hTitle = "Average # of cells with (qfactor+time) readout - " + summName; - summ.nbOfSweet1 = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.nbOfSweet1); - sc &= perPartitionDataGroup.regHist(summ.nbOfSweet1); - - hName = "NbOfSweet2PerFEB"+summName; - hTitle = "Average # of cells with samples readout - " + summName; - summ.nbOfSweet2 = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),nbOfSlot,0.5,slotMax,nbOfFT,-0.5,ftMax); - sc &= m_strHelper->definePartitionSummProp(summ.nbOfSweet2); - sc &= perPartitionDataGroup.regHist(summ.nbOfSweet2); - - hName = "nbOfFebBlocks"+summName; - hTitle = "# of readout FEBs (DSP header check only) - " + summName; - summ.nbOfFebBlocks = TH1I_LW::create(hName.c_str(),hTitle.c_str(),600,-99.5,500.5); - (summ.nbOfFebBlocks)->GetXaxis()->SetTitle("# of readout FEBs"); - sc &= perPartitionDataGroup.regHist(summ.nbOfFebBlocks); - - int nStreams=m_streams.size(); - if(m_isOnline && nStreams > 0) { // book 2d histo with asked streams - hName = "eventSizeStreamVsLB"+summName; - hTitle = "LAr event size per stream per LB (w/o ROS headers)" + summName; - summ.stream_eventSizeLB = TProfile2D_LW::create(hName.c_str(),hTitle.c_str(),m_lumi_blocks,-0.5,(float)m_lumi_blocks+0.5,nStreams+1,-0.5,nStreams+0.5); - (summ.stream_eventSizeLB)->GetXaxis()->SetTitle("Luminosity Block"); - for (int str = 0; str < nStreams; str++) { - (summ.stream_eventSizeLB->GetYaxis())->SetBinLabel(str+1,m_streams[str].c_str()); - } - (summ.stream_eventSizeLB->GetYaxis())->SetBinLabel(nStreams+1,"others"); - sc &= perPartitionDataGroup.regHist(summ.stream_eventSizeLB); - } else { // book simple profile - hName = "eventSizeVsLB"+summName; - hTitle = "LAr event size per LB (w/o ROS headers)" + summName; - summ.eventSizeLB = TProfile_LW::create(hName.c_str(),hTitle.c_str(),m_lumi_blocks,-0.5,(float)m_lumi_blocks+0.5); - (summ.eventSizeLB)->GetXaxis()->SetTitle("Luminosity Block"); - sc &= perPartitionDataGroup.regHist(summ.eventSizeLB); - } - - if(m_isOnline) { - hName = "EventsRejectedLB"+summName; - hTitle = " % of events rejected in current LB (online only) - " + summName; - summ.m_rejectedLBProfilePart = TProfile_LW::create(hName.c_str(),hTitle.c_str(),1,0,1); - (summ.m_rejectedLBProfilePart)->GetXaxis()->SetBinLabel(1,"% of events"); - (summ.m_rejectedLBProfilePart)->SetMinimum(0); - (summ.m_rejectedLBProfilePart)->SetMaximum(100); - sc &= perPartitionDataGroup.regHist(summ.m_rejectedLBProfilePart); - - if (sc.isFailure()) { - ATH_MSG_FATAL( "Unable to book partitions histograms" ); - } - } - return sc; -} - -/*---------------------------------------------------------*/ -StatusCode -LArFEBMon::procHistograms() -{ - - if (m_eventsCounter != 0 && endOfEventsBlockFlag()){ - float scaleFactor = 100./((float) m_eventsCounter); - AddHistos(m_rejectedYield,m_rejectedHisto,m_rejectedHisto,scaleFactor,0.); - m_rejectedYield->SetEntries(m_eventsCounter); - } - - // Reset now done manually to be sure it works online! - // if (isEndOfLumiBlockFlag(){ - // m_rejectedLBProfile->Reset(); - // } - - if (endOfRunFlag() || endOfEventsBlockFlag()){ - // Book dynamically all FEBs in error - for (int iError = 1;iError<14;iError++){ - fillFebInError(m_barrelCSummary,iError,0,0,"EMBC"); - fillFebInError(m_barrelASummary,iError,0,1,"EMBA"); - fillFebInError(m_emecCSummary,iError,1,0,"EMECC"); - fillFebInError(m_emecASummary,iError,1,1,"EMECA"); - fillFebInError(m_hecCSummary,iError,1,0,"HECC"); - fillFebInError(m_hecASummary,iError,1,1,"HECA"); - fillFebInError(m_fcalCSummary,iError,1,0,"FCALC"); - fillFebInError(m_fcalASummary,iError,1,1,"FCALA"); - } - } - - // if (isEndOfLumiBlockFlag() && m_iovStart!=0){ - // m_iovStop=m_iovStop+1; // Add 1second to cope with time needed to resync the QPLL (S.Simion June LAr week) - // } - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -void -LArFEBMon::plotMaskedFEB(){ - - SG::ReadCondHandle<LArBadFebCont> badFebHdl{m_BFKey}; - const LArBadFebCont* badFebCont=(*badFebHdl); - if(!badFebCont) { - ATH_MSG_WARNING( "Do not have Misisng FEB container, no plots !!!" ); - return; - } - // Loop over all FEBs - for (std::vector<HWIdentifier>::const_iterator allFeb = m_onlineHelper->feb_begin(); - allFeb != m_onlineHelper->feb_end(); ++allFeb) { - HWIdentifier febid = HWIdentifier(*allFeb); - const LArBadFeb febStatus = badFebCont->status(febid); - int binContent = 0; - if (febStatus.inError() || febStatus.deadReadout() || febStatus.deadAll() || febStatus.deactivatedInOKS()) binContent = 2; - if (febStatus.ignoreErrors() > 0) binContent = 1; - if (binContent != 0){ - int barrel_ec = m_onlineHelper->barrel_ec(febid); - int pos_neg = m_onlineHelper->pos_neg(febid); - int ft = m_onlineHelper->feedthrough(febid); - int slot = m_onlineHelper->slot(febid); - int partitionNb_dE = returnPartition(barrel_ec,pos_neg,ft,slot); - - switch (partitionNb_dE){ - case 0: - m_barrelCSummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 1: - m_barrelASummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 2: - m_emecCSummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 3: - m_emecASummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 4: - m_hecCSummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 5: - m_hecASummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 6: - m_fcalCSummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - case 7: - m_fcalASummary.maskedFEB->SetBinContent(slot,ft+1,binContent); - break; - } - } - } -} - - -/*---------------------------------------------------------*/ -void -LArFEBMon::fillFebInError(const summaryPartition& summ,int errorType,int barrel_ec,int pos_neg,const std::string& summName) -{ - ATH_MSG_DEBUG( "In fillFebInError" ); - - // TH2I* tempHisto = TH2I_LW::create(*summ.parity); - - std::string hName = "/LAr/FEBMonOldTool/perPartition/FebInErrors/" + summName; - - MonGroup generalGroup( this, hName.c_str(), run, ATTRIB_MANAGED); - - // Loop on TH2D to find which FEB is in error - // parity is used to extract binning range. Ok as this is uniform along different errors - int nbOfFEBErrors = 0; - - for (unsigned int ix=1; ix <= (summ.parity)->GetNbinsX();ix++){ - for (unsigned int iy=1; iy <= (summ.parity)->GetNbinsY();iy++){ - // Found a faulty FEB - // If more than 15 FEBs in error in a partition, ignore other FEBs (mandatory to avoid - // creation of 1500 histos when a run is bad!). - double binContent =0; - switch (errorType){ - case 1: - binContent = (summ.parity)->GetBinContent(ix,iy); - break; - case 2: - binContent = (summ.BCID_2halves)->GetBinContent(ix,iy); - break; - case 3: - binContent = (summ.RADD_2halves)->GetBinContent(ix,iy); - break; - case 4: - binContent = (summ.EVTID_2halves)->GetBinContent(ix,iy); - break; - case 5: - binContent = (summ.SCACStatus)->GetBinContent(ix,iy); - break; - case 6: - binContent = (summ.scaOutOfRange)->GetBinContent(ix,iy); - break; - case 7: - binContent = (summ.gainMismatch)->GetBinContent(ix,iy); - break; - case 8: - binContent = (summ.typeMismatch)->GetBinContent(ix,iy); - break; - case 9: - binContent = (summ.badNbOfSamp)->GetBinContent(ix,iy); - break; - case 10: - binContent = (summ.zeroSamp)->GetBinContent(ix,iy); - break; - case 11: - binContent = (summ.checkSum)->GetBinContent(ix,iy); - break; - case 12: - binContent = (summ.missingHeader)->GetBinContent(ix,iy); - break; - case 13: - binContent = (summ.badGain)->GetBinContent(ix,iy); - break; - } - - if (binContent>0 && nbOfFEBErrors < 15){ - HWIdentifier errorFebId = m_onlineHelper->feb_Id(barrel_ec,pos_neg,iy-1,ix); - IdentifierHash hashId = m_onlineHelper->feb_Hash(errorFebId); - if (!m_bfebIE[hashId]) { - m_febInError[hashId] = TH1F_LW::create((m_strHelper->feb_str(errorFebId)).c_str(),(m_strHelper->feb_str(errorFebId)+"(UNRELIABLE if # of faulty FEBs>15)").c_str(),13,0.5,13.5); - // tempHisto->Print(); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(1,"Parity"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(2,"BCID"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(3,"Sample Header"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(4,"EVTID"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(5,"SCAC status"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(6,"Sca out of range"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(7,"Gain mismatch"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(8,"Type mismatch"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(9,"# of samples"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(10,"Empty data block"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(11,"Checksum / block size"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(12,"Missing header"); - (m_febInError[hashId]->GetXaxis())->SetBinLabel(13,"Bad gain"); - (m_febInError[hashId]->GetYaxis())->SetTitle("Number of errors"); - - StatusCode sc = generalGroup.regHist(m_febInError[hashId]); - if (sc.isFailure()) ATH_MSG_ERROR( "Failed to register Feb histogram!" ); - else m_bfebIE[hashId] = true; - } - m_febInError[hashId]->SetBinContent(errorType,binContent); - m_febInError[hashId]->SetEntries(m_eventsCounter); - nbOfFEBErrors++; - } - } - } - - fillYieldHistos(summ.LArAllErrors,summ.LArAllErrorsYield); - - return; -} - -/*---------------------------------------------------------*/ -void LArFEBMon::fillYieldHistos(TH2I_LW* summaryHisto,TH2F_LW* statusHisto) -// Compute the yield of odd events in error per FEB -// The number of events in error is stored in summaryHisto and the yield is stored in statusHisto -{ - ATH_MSG_DEBUG( "in fillYieldHistos() - " << m_eventsCounter ); - - if (m_eventsCounter != 0){ - for (unsigned int ix=1;ix<=summaryHisto->GetNbinsX();ix++){ - for (unsigned int iy=1;iy<=summaryHisto->GetNbinsY();iy++){ - // Initialize normalization factor - float normFactor = (float)m_eventsCounter; - - float numer = (float) (summaryHisto->GetBinContent(ix,iy)); - float propOfErrors = numer/normFactor*100; - statusHisto->SetBinContent(ix,iy,propOfErrors); - //statusHisto->SetBinError(ix,iy,0);// BT:Winter 12 histo cleaning - }// End of loop on y axis - }//End of loop on x axis - }//End of test on nb of events - statusHisto->SetEntries(m_eventsCounter); - - return; -} - -/*---------------------------------------------------------*/ -int LArFEBMon::returnPartition(int be,int pn,int ft,int sl){ - // partitionNb_dE = 0 : EMBC / 1 : EMBA / 2 : EMECC / 3 : EMECA / 4 : HECC / 5 : HECA / 6 : FCALC / 7 : FCALA - int part = be*2+pn; - if (be == 1){ - // This is a HEC FEB - Dirty method as IsHECOnlineFEBId is buggy! - if ((ft == 3 || ft == 10 || ft == 16 || ft == 22) && (sl > 2)) part = be*2+pn + 2; - if (ft == 6) part = be*2 + pn + 4; // This is FCAL FEB - } - return part; -} - - -/*---------------------------------------------------------*/ -void LArFEBMon::AddHistos(TH2F_LW* h0,TH2F_LW* h1,TH2F_LW* h2){ - for (unsigned int ix=1;ix<=h1->GetNbinsX();ix++){ - for (unsigned int iy=1;iy<=h2->GetNbinsY();iy++){ - h0->SetBinContent(ix,iy,h1->GetBinContent(ix,iy)+h2->GetBinContent(ix,iy)); - h0->SetBinError(ix,iy,sqrt(pow(h1->GetBinError(ix,iy),2.0)+pow(h2->GetBinError(ix,iy),2.0))); - } - } -} - -/*---------------------------------------------------------*/ -void LArFEBMon::AddHistos(TH1F_LW* h0,TH1F_LW* h1,TH1F_LW* h2,float s1,float s2){ - for (unsigned int ix=1;ix<=h1->GetNbinsX();ix++){ - h0->SetBinContent(ix,s1*h1->GetBinContent(ix)+s2*h2->GetBinContent(ix)); - // h0->SetBinError(ix,sqrt(pow(s1*s1*h1->GetBinError(ix),2.0)+pow(s2*s2*h2->GetBinError(ix),2.0))); - } -} - - -/*---------------------------------------------------------*/ -bool LArFEBMon::nbOfFebOK(float nfeb,TH1I_LW* h) const{ - int ixmax(0); - float imax(0); - for (unsigned int ix=1;ix<=h->GetNbinsX();ix++){ - float i=h->GetBinContent(ix); - if(i>imax){ - imax=i; - ixmax=ix; - } - } - return (nfeb<((m_FEBmax-m_FEBmin)/m_FEBnbins)*((float)(ixmax-1))+m_FEBmin); -} - diff --git a/LArCalorimeter/LArMonTools/src/LArFEBMon.h b/LArCalorimeter/LArMonTools/src/LArFEBMon.h deleted file mode 100755 index 4cfc6e88c97dc9f69d23f128b0f37ba0e709d618..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArFEBMon.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARMONTOOLS_LARFEBMON_H -#define LARMONTOOLS_LARFEBMON_H - -#include "LArOnlineIDStrHelper.h" - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" - -#include "LArIdentifier/LArOnlineID.h" -#include "Identifier/HWIdentifier.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "LArRawEvent/LArFebHeaderContainer.h" -#include "LArRawEvent/LArFebErrorSummary.h" - -#include "TrigDecisionTool/TrigDecisionTool.h" - -#include <string> -#include <vector> -#include <bitset> - -class TH1I_LW; -class TH1F_LW; -class TH2F_LW; -class TH2I_LW; -class TProfile2D_LW; -class TProfile_LW; -class LArFebErrorSummary; -class TTree; - -class LArFEBMon : public ManagedMonitorToolBase { - -public: - - LArFEBMon(const std::string & type, const std::string& name, - const IInterface* parent); - ~LArFEBMon(); - - StatusCode initialize(); - StatusCode bookHistograms(); - StatusCode fillHistograms(); - StatusCode procHistograms(); - - static void AddHistos(TH2F_LW* h0,TH2F_LW* h1,TH2F_LW* h2); - static void AddHistos(TH1F_LW* h0,TH1F_LW* h1,TH1F_LW* h2, float s1, float s2); - bool nbOfFebOK(float nfeb,TH1I_LW* h) const; - -private: - - float m_FEBmin,m_FEBmax; - int m_FEBnbins; - /* global params */ - int m_eventsCounter; - bool m_ignoreMissingHeaderEMB; - bool m_ignoreMissingHeaderPS; - std::string m_keyDSPThresholds; - bool m_isOnline; - unsigned int m_lumi_blocks; - bool m_eventRejected; - std::bitset<13> m_rejectionBits; - bool m_currentFebStatus; - unsigned int m_eventTime; - unsigned int m_eventTime_ns; - - //Added for Stream aware: - std::vector<std::string> m_streams; - std::vector<unsigned int> m_streamsThisEvent; - std::vector<std::string> m_excoscalo; - - unsigned int m_l1Trig; - - std::vector<int> m_febInErrorTree; - std::vector<int> m_febErrorTypeTree; - - const LArOnlineID* m_onlineHelper; - LArOnlineIDStrHelper* m_strHelper; - SG::ReadCondHandleKey<LArBadFebCont> m_BFKey{this, "MissingFEBKey", "LArBadFeb", "SG key for missing FEBs"}; - SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"}; - SG::ReadHandleKey<LArFebHeaderContainer> m_LArFebHeaderContainerKey{this, "LArFebHeaderContainerKey", "LArFebHeader"}; - SG::ReadHandleKey<LArFebErrorSummary> m_LArFebErrorSummaryKey{this, "LArFebErrorSummaryKey", "LArFebErrorSummary"}; - // trig. decision tool - ToolHandle<Trig::TrigDecisionTool> m_trigDec; - bool m_trigok; - - // the histograms - struct summaryPartition{ - // These are error histograms-This should be empty - - summaryPartition() - { - parity = NULL; - BCID_2halves = NULL; - RADD_2halves = NULL; - EVTID_2halves = NULL; - SCACStatus = NULL; - scaOutOfRange = NULL; - gainMismatch = NULL; - typeMismatch = NULL; - badNbOfSamp = NULL; - zeroSamp = NULL; - checkSum = NULL; - missingHeader = NULL; - badGain = NULL; - LArAllErrors = NULL; - LArAllErrorsYield = NULL; - maskedFEB = NULL; - missingTriggerType = NULL; - nbOfEvts = NULL; - nbOfSweet1 = NULL; - nbOfSweet2 = NULL; - nbOfFebBlocks = NULL; - stream_eventSizeLB = NULL; - eventSizeLB = NULL; - m_rejectedLBProfilePart = NULL; - - histBooked = false; - } - - TH2I_LW* parity; - TH2I_LW* BCID_2halves; - TH2I_LW* RADD_2halves; - TH2I_LW* EVTID_2halves; - TH2I_LW* SCACStatus; - TH2I_LW* scaOutOfRange; - TH2I_LW* gainMismatch; - TH2I_LW* typeMismatch; - TH2I_LW* badNbOfSamp; - TH2I_LW* zeroSamp; - TH2I_LW* checkSum; - TH2I_LW* missingHeader; - TH2I_LW* badGain; - TH2I_LW* LArAllErrors; - TH2F_LW* LArAllErrorsYield; - TH2I_LW* maskedFEB; - // Not (yet?) an error - Stored in Misc directory - TH2I_LW* missingTriggerType; - // These are general data histograms - TH2I_LW* nbOfEvts; - TProfile2D_LW* nbOfSweet1; - TProfile2D_LW* nbOfSweet2; - TH1I_LW* nbOfFebBlocks; - // Per stream, per partition event size vs. lumiblock - TProfile2D_LW* stream_eventSizeLB; - // Per partition event size vs. lumiblock - TProfile_LW* eventSizeLB; - // Per partition rejected events ? - TProfile_LW* m_rejectedLBProfilePart; - // Other flags - bool histBooked; - }; - - summaryPartition m_barrelCSummary; - summaryPartition m_barrelASummary; - - // Partition below are instantiated only if m_compactEndCap == false - summaryPartition m_emecCSummary; - summaryPartition m_emecASummary; - summaryPartition m_hecCSummary; - summaryPartition m_hecASummary; - summaryPartition m_fcalCSummary; - summaryPartition m_fcalASummary; - - TH2I_LW* m_LArAllErrors_dE; - TH1F_LW* m_rejectedYield; - TH1F_LW* m_rejectedHisto; - TProfile_LW* m_rejectedLBProfile; - TH1I_LW* m_rejBitsHisto; - - TH1I_LW* m_eventsLB; - // TH1I_LW* m_rejectedEventsTime; - TProfile_LW* m_rejectedYieldLB; - TProfile_LW* m_rejectedYieldLBout; - TProfile_LW* m_eventSizeLB; - TProfile2D_LW* m_stream_eventSizeLB; - TH2I_LW* m_nbOfEvts2D; - TH1I_LW* m_eventType; - TH1I_LW* m_nbOfSamples; - TH1I_LW* m_totNbSw2; - TH1I_LW* m_dspThresholds_ADC; - TH1I_LW* m_dspThresholds_qtime; - - TH1I_LW* m_hTriggerType; - TH1I_LW* m_hTriggerTypeAllDSP; - TH1I_LW* m_hTimeDistrib; - TH1I_LW* m_nbOfFebBlocksTotal; - - TH1F_LW* m_febInError[1524]; - bool m_bfebIE[1524]{}; - bool m_anyfebIE; - - TTree* m_CorruptTree; - - StatusCode bookNewPartitionSumm(summaryPartition& summ,const std::string& summName); - void fillErrorsSummary(summaryPartition& summ,int partitNb_2,int ft,int slot,uint16_t error, unsigned lumi_block = 0, bool lar_inerror = false ); - void plotMaskedFEB(); - void fillFebInError(const summaryPartition& summ,int errorType,int barrel_ec,int pos_neg,const std::string& summName); - void fillYieldHistos(TH2I_LW* summaryHisto,TH2F_LW* statusHisto); - static int returnPartition(int be,int pn,int ft,int sl); -}; - -#endif // LArFEBMon_H diff --git a/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.cxx deleted file mode 100644 index 10a8fd2c819699d1a8f416565edb5010b61c3828..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.cxx +++ /dev/null @@ -1,405 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// NAME: LArHVCorrectionMonTool.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Jessica Leveque -// -// Class for monitoring offline HV corrections based in DCS infos -// ******************************************************************** - -#include "LArHVCorrectionMonTool.h" - -#include "Identifier/IdentifierHash.h" - -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" -#include "TMath.h" - -#include "xAODEventInfo/EventInfo.h" - -#include <sstream> -#include <iomanip> -#include <fstream> -#include <string> -#include <vector> -#include <cstdlib> -#include <functional> -#include <map> -#include <utility> - -using namespace std; - -/*---------------------------------------------------------*/ -LArHVCorrectionMonTool::LArHVCorrectionMonTool(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_LArOnlineIDHelper(nullptr), - m_LArEM_IDHelper(nullptr), - m_LArFCAL_IDHelper(nullptr), - m_LArHEC_IDHelper(nullptr), - m_caloIdMgr(nullptr), - m_rootStore(nullptr), - m_eventsCounter(0) -{ - declareProperty("ErrorThreshold",m_threshold=0.02); - declareProperty("EtaGranularity",m_delta_eta=0.01); - declareProperty("PhiGranularity",m_delta_phi=0.01); - declareProperty("NumberOfLBs",m_nlumi_blocks=1500); - - for( unsigned i = 0; i < 2; ++i ) - { - m_hLArHVCorrectionEMB[i] = nullptr; - m_hLArHVCorrectionEMEC[i] = nullptr; - m_hLArHVCorrectionHEC[i] = nullptr; - m_hLArHVCorrectionFCAL[i] = nullptr; - m_hNDeviatingChannelsEMB[i] = nullptr; - m_hNDeviatingChannelsEMEC[i] = nullptr; - m_hNDeviatingChannelsHEC[i] = nullptr; - m_hNDeviatingChannelsFCAL[i] = nullptr; - } - -} - -/*---------------------------------------------------------*/ -LArHVCorrectionMonTool::~LArHVCorrectionMonTool() -{ -} - -/*---------------------------------------------------------*/ -StatusCode LArHVCorrectionMonTool::initialize() -{ - - ATH_MSG_INFO( "Initialize LArHVCorrectionMonTool" ); - - ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") ); - - // Retrieve ID helpers - const CaloCell_ID* idHelper = nullptr; - ATH_CHECK( detStore()->retrieve( idHelper, "CaloCell_ID" ) ); - m_LArEM_IDHelper = idHelper->em_idHelper(); - m_LArHEC_IDHelper = idHelper->hec_idHelper(); - m_LArFCAL_IDHelper = idHelper->fcal_idHelper(); - - ATH_CHECK( m_scaleCorrKey.initialize() ); - ATH_CHECK( m_onlineScaleCorrKey.initialize() ); - ATH_CHECK( m_cablingKey.initialize() ); - - ATH_CHECK( m_channelKey.initialize() ); - ATH_CHECK( m_caloMgrKey.initialize() ); - - // LArOnlineIDStrHelper - m_strHelper = std::make_unique<LArOnlineIDStrHelper>(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - // End Initialize - ManagedMonitorToolBase::initialize().ignore(); - ATH_MSG_DEBUG( "Successful Initialize LArHVCorrection " ); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArHVCorrectionMonTool::bookHistograms() -{ - ATH_MSG_DEBUG( "in bookHists()" ); - - // if(isNewRun){ - - // Create top folder for histos - MonGroup generalGroup( this, "/LAr/HVCorrectionOldTool", run, ATTRIB_MANAGED, "", "weightedAverage" ); - - // EM Calorimeter - Barrel - m_hLArHVCorrectionEMB[0] = TH2F_LW::create("LArHVCorrectionEMBA", - "HV deviation (nominal - corrected) - EMBA", - int(1.6/m_delta_eta), 0.,1.6,int(6.3/m_delta_phi),-3.15, 3.15); - SetTH2Style(m_hLArHVCorrectionEMB[0]); - generalGroup.regHist(m_hLArHVCorrectionEMB[0]).ignore(); - - m_hLArHVCorrectionEMB[1] = TH2F_LW::create("LArHVCorrectionEMBC", - "HV deviation (nominal - corrected) - EMBC", - int(1.6/m_delta_eta),-1.61, -0.01,int(6.3/m_delta_phi),-3.15, 3.15); - SetTH2Style(m_hLArHVCorrectionEMB[1]); - generalGroup.regHist(m_hLArHVCorrectionEMB[1]).ignore(); - - m_hNDeviatingChannelsEMB[0] = TH1I_LW::create("NDeviatingChannelsEMBA", - Form("Number of channels per LB with HV corr>%.0f%% - EMBA",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsEMB[0]); - generalGroup.regHist(m_hNDeviatingChannelsEMB[0]).ignore(); - - m_hNDeviatingChannelsEMB[1] = TH1I_LW::create("NDeviatingChannelsEMBC", - Form("Number of channels per LB with HV corr>%.0f%% - EMBC",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsEMB[1]); - generalGroup.regHist(m_hNDeviatingChannelsEMB[1]).ignore(); - - // EM Calorimeter - Endcap - m_hLArHVCorrectionEMEC[0] = TH2F_LW::create("LArHVCorrectionEMECA", - "HV deviation (nominal - corrected) - EMECA", - int(1.8/m_delta_eta),1.375,3.2,int(6.3/m_delta_phi),-3.15, 3.15); - SetTH2Style(m_hLArHVCorrectionEMEC[0]); - generalGroup.regHist(m_hLArHVCorrectionEMEC[0]).ignore(); - - m_hLArHVCorrectionEMEC[1] = TH2F_LW::create("LArHVCorrectionEMECC", - "HV deviation (nominal - corrected) - EMECC", - int(1.8/m_delta_eta),-3.21,-1.385,int(6.3/m_delta_phi),-3.15, 3.15); - SetTH2Style(m_hLArHVCorrectionEMEC[1]); - generalGroup.regHist(m_hLArHVCorrectionEMEC[1]).ignore(); - - m_hNDeviatingChannelsEMEC[0] = TH1I_LW::create("NDeviatingChannelsEMECA", - Form("Number of channels per LB with HV corr>%.0f%% - EMECA",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsEMEC[0]); - generalGroup.regHist(m_hNDeviatingChannelsEMEC[0]).ignore(); - - m_hNDeviatingChannelsEMEC[1] = TH1I_LW::create("NDeviatingChannelsEMECC", - Form("Number of channels per LB with HV corr>%.0f%% - EMECC",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsEMEC[1]); - generalGroup.regHist(m_hNDeviatingChannelsEMEC[1]).ignore(); - - // HEC - m_hLArHVCorrectionHEC[0] = TH2F_LW::create("LArHVCorrectionHECA", - "HV deviation (nominal - corrected) - HECA", - int(1.7/m_delta_eta),1.5, 3.2,int(6.3/m_delta_phi), -3.15, 3.15); - - SetTH2Style(m_hLArHVCorrectionHEC[0]); - generalGroup.regHist(m_hLArHVCorrectionHEC[0]).ignore(); - - - m_hLArHVCorrectionHEC[1] = TH2F_LW::create("LArHVCorrectionHECC", - "HV deviation (nominal - corrected) - HECC", - int(1.7/m_delta_eta),-3.21, -1.51, int(6.3/m_delta_phi), -3.15, 3.15); - SetTH2Style(m_hLArHVCorrectionHEC[1]); - generalGroup.regHist(m_hLArHVCorrectionHEC[1]).ignore(); - - m_hNDeviatingChannelsHEC[0] = TH1I_LW::create("NDeviatingChannelsHECA", - Form("Number of channels per LB with HV corr>%.0f%% - HECA",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsHEC[0]); - generalGroup.regHist(m_hNDeviatingChannelsHEC[0]).ignore(); - - m_hNDeviatingChannelsHEC[1] = TH1I_LW::create("NDeviatingChannelsHECC", - Form("Number of channels per LB with HV corr>%.0f%% - HECC",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsHEC[1]); - generalGroup.regHist(m_hNDeviatingChannelsHEC[1]).ignore(); - - // FCAL - m_hLArHVCorrectionFCAL[0] = TH2F_LW::create("LArHVCorrectionFCALA", - "HV deviation (nominal - corrected) - FCalA", - int(3./m_delta_eta), 2.9, 4.9,int(6.4/m_delta_phi), -3.2, 3.2); - SetTH2Style(m_hLArHVCorrectionFCAL[0]); - generalGroup.regHist(m_hLArHVCorrectionFCAL[0]).ignore(); - - m_hLArHVCorrectionFCAL[1] = TH2F_LW::create("LArHVCorrectionFCALC", - "HV deviation (nominal - corrected) - FCalC", - int(3./m_delta_eta), -4.91, -3.11, int(6.4/m_delta_phi), -3.2, 3.2); - SetTH2Style(m_hLArHVCorrectionFCAL[1]); - generalGroup.regHist(m_hLArHVCorrectionFCAL[1]).ignore(); - - m_hNDeviatingChannelsFCAL[0] = TH1I_LW::create("NDeviatingChannelsFCALA", - Form("Number of channels with HV corr>%.0f%% - FCALA",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsFCAL[0]); - generalGroup.regHist(m_hNDeviatingChannelsFCAL[0]).ignore(); - - m_hNDeviatingChannelsFCAL[1] = TH1I_LW::create("NDeviatingChannelsFCALC", - Form("Number of channels with HV corr>%.0f%% - FCALC",m_threshold*100), - m_nlumi_blocks, 0.5, double(m_nlumi_blocks)+0.5); - SetTH1Style(m_hNDeviatingChannelsFCAL[1]); - generalGroup.regHist(m_hNDeviatingChannelsFCAL[1]).ignore(); - - //return StatusCode::SUCCESS; - - // }// end isNewRun - - // Reset event counter at the start of each LB - if(newLumiBlockFlag()){ - - m_eventsCounter = 0; - - } - - return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArHVCorrectionMonTool::fillHistograms() -{ - ATH_MSG_DEBUG( "in fillHists()" ); - - m_eventsCounter++; - - if(m_eventsCounter == 1){ // Fill only at the beginning of LB. m_eventsCounter is reset at the begining of each LB. - - // Retrieve event information - const EventContext& ctx = Gaudi::Hive::currentContext(); - int lumi_block = ctx.eventID().lumi_block(); - - SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx}; - ATH_CHECK(caloMgrHandle.isValid()); - const CaloDetDescrManager* ddman = *caloMgrHandle; - - - // Counter for deviating channels in each partition - float nonNominal[] = {0.,0.,0.,0.,0.,0.,0.,0.}; - - // Retrieve Raw Channels Container - SG::ReadHandle<LArRawChannelContainer> pRawChannelsContainer{m_channelKey}; - if(!pRawChannelsContainer.isValid()) { - ATH_MSG_WARNING( "Can't retrieve LArRawChannelContainer with key " << m_channelKey.key() ); - return StatusCode::SUCCESS; - } - - SG::ReadCondHandle<ILArHVScaleCorr> scaleCorr (m_scaleCorrKey, ctx); - SG::ReadCondHandle<ILArHVScaleCorr> onlineScaleCorr (m_onlineScaleCorrKey, ctx); - SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx); - - // Loop over LArRawChannels - //SelectAllLArRawChannels AllRaw(pRawChannelsContainer); - //for (SelectAllLArRawChannels::const_iterator itRaw = AllRaw.begin(); itRaw != AllRaw.end(); ++itRaw) { - //const LArRawChannel* pRawChannel = (*itRaw) ; - //FIXME: If we loop over CaloCells we get the offline identifer directly! - //Or: Why don't loop over channels w/o retrieving any event data object? - for (const LArRawChannel& rawChannel : *pRawChannelsContainer) { - HWIdentifier id = rawChannel.hardwareID(); - //CaloGain::CaloGain gain = pRawChannel->gain(); - Identifier offlineID = cabling->cnvToIdentifier(id); - - // Skip disconnected channels - if(!cabling->isOnlineConnected(id)) continue; - - // Get Physical Coordinates - float etaChan = 0; float phiChan = 0.; - const CaloDetDescrElement* caloDetElement = ddman->get_element(offlineID); - if(caloDetElement == nullptr ){ - ATH_MSG_ERROR( "Cannot retrieve (eta,phi) coordinates for raw channels" ); - continue; - }else{ - etaChan = caloDetElement->eta_raw(); - phiChan = caloDetElement->phi_raw(); - } - - // Fix phi range in HEC - if (m_LArOnlineIDHelper->isHECchannel(id)) phiChan = CaloPhiRange::fix(phiChan); - - // Retrieve HV correction info - float hvdev = 0; - float hvonline = onlineScaleCorr->HVScaleCorr(id); - if (hvonline<=0) continue; //No valid online correction - // Correction in scaleCorr has already been divided by hvonline. - float hvcorr = scaleCorr->HVScaleCorr(id) * hvonline; - //ATH_MSG_VERBOSE( "hvcorr" << hvcorr ); - //ATH_MSG_VERBOSE( "hvonline" << hvonline ); - if (hvcorr>hvonline) hvdev = hvonline-hvcorr; //Monitor only channels that get a higher correction from DCS (eg are at a lower voltage). - - //ATH_MSG_VERBOSE( "hvdev" << hvdev ); - - if (fabs(hvdev/hvonline)> m_threshold){ - - // A-Side - if(etaChan >= 0){ - if(m_LArOnlineIDHelper->isEMBchannel(id)){ - nonNominal[0]++; - m_hLArHVCorrectionEMB[0]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isEMECchannel(id)){ - nonNominal[1]++; - m_hLArHVCorrectionEMEC[0]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isHECchannel(id)){ - nonNominal[2]++; - m_hLArHVCorrectionHEC[0]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isFCALchannel(id)){ - nonNominal[3]++; - m_hLArHVCorrectionFCAL[0]->Fill(etaChan,phiChan, hvdev); - } - - // C-side - } else { - if(m_LArOnlineIDHelper->isEMBchannel(id)){ - nonNominal[4]++; - m_hLArHVCorrectionEMB[1]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isEMECchannel(id)){ - nonNominal[5]++; - m_hLArHVCorrectionEMEC[1]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isHECchannel(id)){ - //std::cout << "HECC, hvdev=" << hvdev << ", onlCorr=" << hvonline << ", oflCorr=" << hvcorr << std::endl; - nonNominal[6]++; - m_hLArHVCorrectionHEC[1]->Fill(etaChan,phiChan, hvdev); - } - if(m_LArOnlineIDHelper->isFCALchannel(id)){ - nonNominal[7]++; - m_hLArHVCorrectionFCAL[1]->Fill(etaChan,phiChan, hvdev); - } - } - } - }// end Raw Channels Loop - - // Fill number of problematic cell per LUMI_BLOCK - m_hNDeviatingChannelsEMB[0]->Fill(lumi_block,nonNominal[0]); - m_hNDeviatingChannelsEMEC[0]->Fill(lumi_block,nonNominal[1]); - m_hNDeviatingChannelsHEC[0]->Fill(lumi_block,nonNominal[2]); - m_hNDeviatingChannelsFCAL[0]->Fill(lumi_block,nonNominal[3]); - - m_hNDeviatingChannelsEMB[1]->Fill(lumi_block,nonNominal[4]); - m_hNDeviatingChannelsEMEC[1]->Fill(lumi_block,nonNominal[5]); - m_hNDeviatingChannelsHEC[1]->Fill(lumi_block,nonNominal[6]); - m_hNDeviatingChannelsFCAL[1]->Fill(lumi_block,nonNominal[7]); - - } else { - - return StatusCode::SUCCESS; - - }// End of event treatment - - return StatusCode::SUCCESS; -} -/*---------------------------------------------------------*/ -StatusCode LArHVCorrectionMonTool::procHistograms() -{ - - ATH_MSG_DEBUG( "In procHistograms " ); - -// // -// // Normalize and fix bins only at the end of a block, and only ONCE ! Otherwise it's a mess -// // -// -// if (isEndOfEventsBlock || isEndOfLumiBlock || isEndOfRun){ -// -// return StatusCode::SUCCESS; -// -// } - - return StatusCode::SUCCESS; -} -/*---------------------------------------------------------*/ -void LArHVCorrectionMonTool::SetTH2Style(TH2F_LW* h){ - - h->GetXaxis()->SetTitle("cell #eta"); - h->GetYaxis()->SetTitle("cell #phi"); - - return; -} -/*---------------------------------------------------------*/ -void LArHVCorrectionMonTool::SetTH1Style(TH1I_LW* h){ - - h->GetYaxis()->SetTitle("Number of channels deviating from nominal HV"); - h->GetXaxis()->SetTitle("Luminosity Block"); - - return; -} -/*---------------------------------------------------------*/ - - diff --git a/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.h b/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.h deleted file mode 100644 index 43d21734caa4c1362162456e16714bec641fbbae..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArHVCorrectionMonTool.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArHVCorrectionMonTool - * @author Jessica Leveque <jleveque@in2p3.fr> - * - */ - -#ifndef LARMONTOOLS_LARHVCORRECTIONMONTOOL_H -#define LARMONTOOLS_LARHVCORRECTIONMONTOOL_H - -#include "SelectAllLArRawChannels.h" -#include "LArOnlineIDStrHelper.h" - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "CaloIdentifier/CaloIdManager.h" -#include "CaloIdentifier/CaloCell_ID.h" -#include "CaloDetDescr/CaloDetDescrManager.h" -#include "CaloDetDescr/CaloDetDescriptor.h" -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloGeoHelpers/CaloPhiRange.h" -#include "StoreGate/ReadCondHandleKey.h" - -#include "Identifier/HWIdentifier.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRawEvent/LArRawChannel.h" -#include "LArRawEvent/LArRawChannelContainer.h" -#include "EventContainers/SelectAllObject.h" -#include "LArCabling/LArOnOffIdMapping.h" -#include "LArElecCalib/ILArHVScaleCorr.h" - -#include <string> -#include <map> - -class LArEM_ID; -class LArOnlineID; -class CaloDetDescrElement; -class ITHistSvc; - -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH2F_LW.h" -#include "LWHists/TProfile_LW.h" -#include <memory> - -class TProfile_LW; - -class LArHVCorrectionMonTool: public ManagedMonitorToolBase -{ - public: - LArHVCorrectionMonTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArHVCorrectionMonTool(); - - /** @brief Overwrite dummy method from AlgTool */ - virtual StatusCode initialize() override; - - /** Book general histograms - * Implement pure virtual methods of IMonitorToolBase */ - virtual StatusCode bookHistograms() override; - - /** Called each event */ - virtual StatusCode fillHistograms() override; - - /** Regularly called to fill noise maps - * Overwrite dummy method from MonitorToolBase */ - virtual StatusCode procHistograms() override; - - protected: - - // services - const LArOnlineID* m_LArOnlineIDHelper; - const LArEM_ID* m_LArEM_IDHelper; - const LArFCAL_ID* m_LArFCAL_IDHelper; - const LArHEC_ID* m_LArHEC_IDHelper; - const CaloIdManager* m_caloIdMgr; - - std::unique_ptr<LArOnlineIDStrHelper> m_strHelper; - ITHistSvc* m_rootStore; - - SG::ReadCondHandleKey<ILArHVScaleCorr> m_scaleCorrKey - { this, "LArHVScaleCorr", "LArHVScaleCorrRecomputed", "" }; - SG::ReadCondHandleKey<ILArHVScaleCorr> m_onlineScaleCorrKey - { this, "OnlineLArHVScaleCorr", "LArHVScaleCorr", "" }; - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey - {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this - , "CaloDetDescrManager" - , "CaloDetDescrManager" - , "SG Key for CaloDetDescrManager in the Condition Store" }; - - private: - - // To retrieve bad channel DB keywords - int DBflag(HWIdentifier onID); - - // To set histos Style - static void SetTH2Style(TH2F_LW* h); - static void SetTH1Style(TH1I_LW* h); - - // Properties - SG::ReadHandleKey<LArRawChannelContainer> m_channelKey{this, "LArRawChannelKey", "LArRawChannels"}; - float m_threshold; - float m_delta_eta; - float m_delta_phi; - int m_nlumi_blocks; - - // Other things - int m_eventsCounter; - - // Non-nominal Maps - TH2F_LW* m_hLArHVCorrectionEMB[2]{}; - TH2F_LW* m_hLArHVCorrectionEMEC[2]{}; - TH2F_LW* m_hLArHVCorrectionHEC[2]{}; - TH2F_LW* m_hLArHVCorrectionFCAL[2]{}; - - TH1I_LW* m_hNDeviatingChannelsEMB[2]{}; - TH1I_LW* m_hNDeviatingChannelsEMEC[2]{}; - TH1I_LW* m_hNDeviatingChannelsHEC[2]{}; - TH1I_LW* m_hNDeviatingChannelsFCAL[2]{}; - -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.cxx b/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.cxx deleted file mode 100644 index 0a0ccc0f028a3329ca65022cec486366f009f173..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.cxx +++ /dev/null @@ -1,716 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ -/* -*/ - - -// ******************************************************************** -// NAME: LArNoiseCorrelationMon.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Margherita Spalla (margherita.spalla@cern.ch) -// Based on structure of LArDigitMon by Helary Louis (helary@lapp.in2p3.fr) -// -// Computes and plots the correlation between single channels to monitor coherent noise. -// The correlation is computed as: -// corr(i,j) = Cov(i,j)/sqrt(Var(i)*Var(j)) where 'Cov(i,j)' is the sample covariance of channels i and j and 'Var(i)' is the sample variance of channel i. -// Variance and covariance are computed summing over all samples and all events for each channel: Cov(i,j)=[sum(x_i*x_j)-N*mean_i*mean_j]/(N-1) , where x_i is the single sample minus the pedestal. -// -// Correlation histograms are computed per FEB. The FEBs to be monitored are set in the JO. -// -// Available parameters in the jo file: -// 1) List of FEBs to be monitored: should be passed as a list of strings of the form 'BarrelCFT00Slot02', case insensitive (corresponding to type LARONLINEID defined in the package atlas/LArCalorimeter/LArMonTools/LArMonTools/LArOnlineIDStrHelper.h). If the list is empty, all FEBs are monitored. -// 2) control PublishAllFebsOnline: if it is set to true, switched off the monitoring in case the FEB list (1) is empty and the algorithm is running online. -// 3) list of triggers to be used ('TriggerChain'): to be passed as a single string "trigger_chain_1, trigger_chain_2". The default is "HLT_noalg_zb_L1ZB, HLT_noalg_cosmiccalo_L1RD1_EMPTY", for the latter, only events in the abort gap are used, selection done by hand. -// 4) control IsCalibrationRun: to be set to true when running on calibration, it switches off the trigger selection. -// 5) control PublishPartialSums: tells the algorithm to also publish the partial sum histograms. default is false. - -// -// ******************************************************************** - -//Histograms -#include "GaudiKernel/ITHistSvc.h" -#include "LWHists/TProfile_LW.h" -#include "LWHists/TH2F_LW.h" - -//STL: -#include <sstream> -#include <iomanip> -#include <cmath> -#include <vector> -#include <algorithm> - -//ROOT -#include "TPRegexp.h" -#include "TF1.h" - -//LAr infos: -#include "Identifier/HWIdentifier.h" -#include "LArOnlineIDStrHelper.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRawEvent/LArDigit.h" -#include "LArRawEvent/LArDigitContainer.h" -#include "LArRecEvent/LArNoisyROSummary.h" -#include "TrigDecisionTool/TrigDecisionTool.h" - -//Events infos: -#include "xAODEventInfo/EventInfo.h" - -//for looping on FEBs -#include "LArRawEvent/LArFebHeaderContainer.h" - -//Header: -#include "LArNoiseCorrelationMon.h" - - -// BCIDs of the abort gap -const int ABORT_GAP_START = 3446; -const int ABORT_GAP_END = 3563; - - - - -/*---------------------------------------------------------*/ -LArNoiseCorrelationMon::LArNoiseCorrelationMon(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_strHelper(nullptr), - m_LArOnlineIDHelper(nullptr) -{ - /** FEBs to be monitored. If empty, all FEBs will be monitored*/ - std::vector<std::string> empty_vector(0); - declareProperty("FEBsToMonitor",m_FEBsToMonitor=empty_vector); - - /** If false, blocks the histogram booking in case it's running online and the 'm_FEBsToMonitor' list is empty. i.e. prevents the algorithm from publishing one histogram per FEB for all FEBs in online environnement */ - declareProperty("PublishAllFebsOnline",m_publishAllFebsOnline=true); - declareProperty("PublishPartialSums",m_publishPartialSums=false); - - /** To be set to true when running on calibration run. It swithces off trigger selection*/ - declareProperty("IsCalibrationRun",m_isCalibrationRun=false); - - /**bool use to mask the bad channels*/ - declareProperty("IgnoreBadChannels", m_ignoreKnownBadChannels=false); - declareProperty("LArDigitContainerKey", m_LArDigitContainerKey = "FREE"); - declareProperty("IsOnline", m_IsOnline=false); - - /**bool enable summary plot */ - declareProperty("DoSummary", m_DoSummary=true); -} - -/*---------------------------------------------------------*/ -LArNoiseCorrelationMon::~LArNoiseCorrelationMon() -{ -} - -StatusCode -LArNoiseCorrelationMon::finalize() -{ - ATH_MSG_INFO( "finalHists LArNoiseCorrelationMon" ); - - /** delete local histograms. */ - if(m_IsOnline) - { - for (auto const& feb_entry : m_FEBhistograms) - { - m_histos=feb_entry.second; - if(m_histos.second.first) - { - LWHist::safeDelete(m_histos.second.first); - m_histos.second.first=nullptr; - } - if(m_histos.second.second) - { - LWHist::safeDelete(m_histos.second.second); - m_histos.second.second=nullptr; - } - } - } - - delete m_strHelper; - return StatusCode::SUCCESS; - -} - -/*---------------------------------------------------------*/ -StatusCode -LArNoiseCorrelationMon::initialize() -{ - - ATH_MSG_INFO( "Initialize LArNoiseCorrelationMon" ); - - m_evtCounter=0; - - /** Get LAr Online Id Helper*/ - ATH_CHECK(detStore()->retrieve( m_LArOnlineIDHelper, "LArOnlineID" )); - - - /** Init cabling kay */ - ATH_CHECK(m_cablingKey.initialize()); - - - /** Get bad-channel mask (only if jO IgnoreBadChannels is true)*/ - ATH_CHECK( m_bcContKey.initialize(m_ignoreKnownBadChannels)); - ATH_CHECK( m_bcMask.buildBitMask(m_problemsToMask,msg())); - - /** Retrieve pedestals container*/ - ATH_CHECK(m_keyPedestal.initialize()); - - /** Configure event info */ - ATH_CHECK(m_eventInfoKey.initialize()); - - /** get the trigger list from the 'm_triggerChainProp'*/ - m_triggers.clear(); - if(m_isCalibrationRun) { - ATH_MSG_INFO( "Running as 'calibration run'. No trigger selection will be applied."); - } - else { - ATH_MSG_DEBUG( "Parsing trigger chain list" ); - StatusCode sc=ManagedMonitorToolBase::parseList(m_triggerChainProp, m_triggers); - if(sc.isFailure()) { - ATH_MSG_ERROR( "Error parsing the trigger chain list, exiting." ); - return StatusCode::FAILURE; - } - } - - return ManagedMonitorToolBase::initialize(); -} - -/*---------------------------------------------------------*/ -StatusCode -LArNoiseCorrelationMon::bookHistograms() -{ - /** lar noise correlation */ - m_Nchan=128; - m_chan_low=-0.5; - m_chan_up=127.5; - - MonGroup GroupEMBA( this, "/LAr/NoiseCorrelationOldTool/EMBA", run, ATTRIB_MANAGED ); - MonGroup GroupEMBC( this, "/LAr/NoiseCorrelationOldTool/EMBC", run, ATTRIB_MANAGED ); - MonGroup GroupEMECA( this, "/LAr/NoiseCorrelationOldTool/EMECA", run, ATTRIB_MANAGED ); - MonGroup GroupEMECC( this, "/LAr/NoiseCorrelationOldTool/EMECC", run, ATTRIB_MANAGED ); - MonGroup GroupHECA( this, "/LAr/NoiseCorrelationOldTool/HECA", run, ATTRIB_MANAGED ); - MonGroup GroupHECC( this, "/LAr/NoiseCorrelationOldTool/HECC", run, ATTRIB_MANAGED ); - MonGroup GroupFCALA( this, "/LAr/NoiseCorrelationOldTool/FCALA", run, ATTRIB_MANAGED ); - MonGroup GroupFCALC( this, "/LAr/NoiseCorrelationOldTool/FCALC", run, ATTRIB_MANAGED ); - - /**declare strings for histograms title*/ - m_hist_name = "NoiseCorr_"; - m_hist_summary_name1 = "SummaryPlot_maximumCorr"; - m_hist_summary_name2 = "SummaryPlot_maximumCorr_sigma"; - m_hist_title = "LAr Noise Correlation"; - m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - /** Check which (if any) FEBs we want to monitor*/ - if(m_FEBsToMonitor.empty()) { - if(!m_publishAllFebsOnline && m_IsOnline) { - ATH_MSG_INFO("'m_publishAllFebsOnline' set to false: cannot publish all FEBs in online run. Do nothing."); - return StatusCode::SUCCESS; - } - bookAllFEBs(GroupEMBA,GroupEMBC,GroupEMECA,GroupEMECC,GroupHECA,GroupHECC,GroupFCALA,GroupFCALC); - } - else bookSelectedFEBs(GroupEMBA,GroupEMBC,GroupEMECA,GroupEMECC,GroupHECA,GroupHECC,GroupFCALA,GroupFCALC); - - return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -StatusCode -LArNoiseCorrelationMon::fillHistograms() -{ - /** if publishing all FEBs has been forbidden and m_FEBsToMonitor is empty, then no histogram will be published anyway: no need to loop over channels */ - if(!m_publishAllFebsOnline && m_IsOnline && m_FEBsToMonitor.empty()) { - ATH_MSG_DEBUG("'m_publishAllFebsOnline' set to false and empty FEB list in online run. No FEB will be monitored."); - return StatusCode::SUCCESS; - } - - ATH_MSG_DEBUG("in fillHists()" ); - - /**increase internal event counter, for calibration run only */ - m_evtCounter++; - - /** check trigger */ - bool passTrig = m_isCalibrationRun; - if(!m_isCalibrationRun) { - /**EventID is a part of EventInfo, search event informations:*/ - SG::ReadHandle<xAOD::EventInfo> thisEvent{m_eventInfoKey}; - - if (!thisEvent.isValid()) { - ATH_MSG_ERROR("xAOD::EventInfo retrieval failed"); - return StatusCode::FAILURE; - } - - m_evtId = thisEvent->eventNumber(); - ATH_MSG_DEBUG("Event nb " << m_evtId ); - - bool passBCID; - if(!m_trigDecTool.empty()) { - for(const auto& trig_chain : m_triggers) { - passBCID = ((trig_chain == "HLT_noalg_cosmiccalo_L1RD1_EMPTY")?(thisEvent->bcid() >= ABORT_GAP_START && thisEvent->bcid() <= ABORT_GAP_END):true); - passTrig=(passTrig || (passBCID && m_trigDecTool->isPassed(trig_chain))); - } - } - } - - if (!passTrig) { - ATH_MSG_DEBUG ( " Failed trigger selection " ); - if(m_IsOnline && (endOfLumiBlockFlag() || endOfEventsBlockFlag())) fillInCorrelations(); //seems not to work offline, so done for online only - return StatusCode::SUCCESS; - } else { - ATH_MSG_DEBUG ( " Pass trigger selection " ); - } - - /*retrieve cabling*/ - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; - const LArOnOffIdMapping* cabling=*cablingHdl; - if(!cabling) { - ATH_MSG_ERROR("Do not have cabling map with key: "<<m_cablingKey.key()); - return StatusCode::FAILURE; - } - - - /*retrieve pedestal*/ - SG::ReadCondHandle<ILArPedestal> pedestalHdl{m_keyPedestal}; - const ILArPedestal* pedestals=*pedestalHdl; - - /** retrieve LArDigitContainer*/ - const LArDigitContainer* pLArDigitContainer=nullptr; - ATH_CHECK(evtStore()->retrieve(pLArDigitContainer, m_LArDigitContainerKey)); - - const LArBadChannelCont* bcCont=nullptr; - if (m_ignoreKnownBadChannels ) { - SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey}; - bcCont=*bcContHdl; - } - - - ATH_MSG_DEBUG ( " LArDigitContainer size "<<pLArDigitContainer->size()<<" for key "<<m_LArDigitContainerKey); - /** Define iterators to loop over Digits containers*/ - LArDigitContainer::const_iterator itDig = pLArDigitContainer->begin(); - LArDigitContainer::const_iterator itDig_2; - LArDigitContainer::const_iterator itDig_e= pLArDigitContainer->end(); - - /** Loop over digits*/ - for ( ; itDig!=itDig_e;++itDig) { - const LArDigit* pLArDigit = *itDig; - - /** Retrieve pedestals */ - HWIdentifier id = pLArDigit->hardwareID(); - CaloGain::CaloGain gain = pLArDigit->gain(); - float pedestal = pedestals->pedestal(id,gain); - - if(!isGoodChannel(id,pedestal,cabling,bcCont)) - continue; - - /** Retrieve samples*/ - const std::vector<short>* digito = &pLArDigit->samples(); - - /** Retrieve once, all the cell info:*/ - m_febID = m_LArOnlineIDHelper->feb_Id(id); - m_ch1 = m_LArOnlineIDHelper->channel(id); - - try { - m_histos=m_FEBhistograms.at(m_febID); - } - catch (const std::out_of_range& oor) { - continue; - } - - /** Second loop over digit */ - bool av_set=false; - for(itDig_2 = itDig; itDig_2!=itDig_e;++itDig_2) - { - const LArDigit* pLArDigit2 = *itDig_2; - HWIdentifier id2 = pLArDigit2->hardwareID(); - if(m_LArOnlineIDHelper->feb_Id(id2)!=m_febID) continue; - - /** get the pedestal */ - CaloGain::CaloGain gain2 = pLArDigit2->gain(); - float pedestal2 = pedestals->pedestal(id2,gain2); - - if(!isGoodChannel(id2,pedestal2,cabling,bcCont)) continue; - - /** get the channel number */ - m_ch2 = m_LArOnlineIDHelper->channel(id2); - - /** get the samples */ - const std::vector<short>* digito2 = &pLArDigit2->samples(); - std::vector<short>::const_iterator iterSam2= digito2->begin(); - std::vector<short>::const_iterator iterSam= digito->begin(); - - double part_sum=0; - int Nsam=pLArDigit->nsamples(); - if(pLArDigit2->nsamples()!=Nsam) - { - ATH_MSG_WARNING( Form("Different number of samples between channels %d vs %d: skipping these two",Nsam,pLArDigit2->nsamples()) ); - continue; - } - - /** Loop over the samples and compute average and sum of squares*/ - for(int i=0;i<Nsam;++i,++iterSam,++iterSam2) - { - if(!av_set) { /** fill the mean only once per ch1. This code is here to avoid one additional loop over samples before the second loop. */ - m_histos.second.second->Fill(m_ch1,(*iterSam-pedestal)); - } - /** now compute sum of squares */ - part_sum+=((*iterSam-pedestal)*(*iterSam2-pedestal2)); - } - av_set=true; /** now the average is set and I won't do this again in next ch2 loop*/ - m_histos.second.first->Fill(m_ch1,m_ch2,part_sum); - m_histos.second.first->Fill(m_ch2,m_ch1,part_sum); - }/** End of second loop on LArDigit*/ - }/** End of loop on LArDigit*/ - - - /** compute correlation and update the published plot once per LB (seems not to work offline, so done for online only)*/ - if(m_IsOnline && (endOfLumiBlockFlag() || endOfEventsBlockFlag())) fillInCorrelations(); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode LArNoiseCorrelationMon::procHistograms() -{ - if(endOfRunFlag()) - { - fillInCorrelations(); - if(m_IsOnline) - { - for (auto const& feb_entry : m_FEBhistograms) - { - m_histos=feb_entry.second; - if(m_histos.second.first) m_histos.second.first->Reset(); - if(m_histos.second.second) m_histos.second.second->Reset(); - } - } - } - return StatusCode::SUCCESS; -} - - -/*---------------------------------------------------------*/ -/** check if channel is ok for monitoring */ -bool LArNoiseCorrelationMon::isGoodChannel(const HWIdentifier ID,const float ped, const LArOnOffIdMapping *cabling, const LArBadChannelCont* bcCont) const - { - /** Remove problematic channels*/ - if (m_ignoreKnownBadChannels ) { - if ( m_bcMask.cellShouldBeMasked(bcCont,ID)) { - return false; - } - } - - /**skip cells with no pedestals reference in db.*/ - if(ped <= (1.0+LArElecCalib::ERRORCODE)) - return false; - - /**skip disconnected channels:*/ - if(!cabling->isOnlineConnected(ID)) - return false; - - return true; - } - - -/*---------------------------------------------------------*/ -/**Compute correlations and fill in the plots*/ -void LArNoiseCorrelationMon::fillInCorrelations() -{ - double mean1,mean2; - double sumVar1,sumVar2; - double N; - double cor; - for (auto const& feb_entry : m_FEBhistograms) - { - double tmp_maxcorr = 0.0; - TH1F *hist_tmp_correlation; - hist_tmp_correlation = new TH1F("Tmp_correlation_value", "TMP correlation value", 40, -1.0, 1.0 ); - double tmp_RMS = 0.0; - m_histos=feb_entry.second; - for(int i=1;i<=m_Nchan;i++) - { - mean1=m_histos.second.second->GetBinContent(i); - sumVar1=m_histos.second.first->GetBinContent(i,i); - N=m_histos.second.second->GetBinEntries(i); - if(N==0) - { - ATH_MSG_DEBUG( "Bin " << i << " has 0 entries" ); - continue; - } - for(int j=i+1;j<=m_Nchan;j++) - { - mean2=m_histos.second.second->GetBinContent(j); - sumVar2=m_histos.second.first->GetBinContent(j,j); - if((sumVar1-N*mean1*mean1)*(sumVar2-N*mean2*mean2)==0) { - ATH_MSG_DEBUG( "sigma_i*sigma_j is zero for bin (" << i << "," << j << "). Correlation cannot be computed." ); - continue; - } - cor=(m_histos.second.first->GetBinContent(i,j)-N*mean1*mean2)/TMath::Sqrt((sumVar1-N*mean1*mean1)*(sumVar2-N*mean2*mean2)); - m_histos.first->SetBinContent(i,j,cor); - m_histos.first->SetBinContent(j,i,cor); - /** calculate maximum correlation */ - /** First variable: maximum correlation in the FEB */ - if ( tmp_maxcorr < std::abs(cor) ) - tmp_maxcorr = std::abs(cor); - /** Second valiable: RMS value in correlation distribution */ - hist_tmp_correlation->Fill(cor); - } - } - - tmp_RMS = hist_tmp_correlation->GetRMS(); - - // Fill in summary histogram - TPMERegexp tmp('_'); - int nsplit = tmp.Split( m_histos.first->GetTitle() ); - if(m_DoSummary){ - if(nsplit > 1){ - // EMB - if(m_LArOnlineIDHelper->isEMBchannel( feb_entry.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first) ){ - m_h_summary_plot1_EMBA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr); - m_h_summary_plot2_EMBA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS); - } - else{ - m_h_summary_plot1_EMBC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr); - m_h_summary_plot2_EMBC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS); - } - } - // EMEC - else if(m_LArOnlineIDHelper->isEMECchannel( feb_entry.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first)){ - m_h_summary_plot1_EMECA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr); - m_h_summary_plot2_EMECA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS); - } - else{ - m_h_summary_plot1_EMECC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr); - m_h_summary_plot2_EMECC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS); - } - } - // HEC - else if(m_LArOnlineIDHelper->isHECchannel( feb_entry.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first)){ - m_h_summary_plot1_HECA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr ); - m_h_summary_plot2_HECA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS ); - } - else{ - m_h_summary_plot1_HECC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr ); - m_h_summary_plot2_HECC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS ); - } - } - // FCAL - else if(m_LArOnlineIDHelper->isFCALchannel( feb_entry.first )){ - if(m_LArOnlineIDHelper->pos_neg(feb_entry.first)){ - m_h_summary_plot1_FCALA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr ); - m_h_summary_plot2_FCALA->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS ); - } - else{ - m_h_summary_plot1_FCALC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_maxcorr ); - m_h_summary_plot2_FCALC->SetBinContent( atoi(tmp[0])+1, atoi(tmp[1])+1, tmp_RMS ); - } - } - } - } - // Delete them in order to save the memory - delete hist_tmp_correlation; - - } -} - - - - - -/*---------------------------------------------------------*/ -/**Loops on selected FEBS to book and define histograms.*/ -void LArNoiseCorrelationMon::bookSelectedFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - ATH_MSG_INFO( "Booking selected FEBs: " << m_FEBsToMonitor.size() << " provided." ); - std::string aFEB; /**aFEB is the feb to monitor*/ - HWIdentifier febid; - for(uint feb_i=0;feb_i<m_FEBsToMonitor.size();feb_i++) { - aFEB=m_FEBsToMonitor[feb_i]; - febid=m_strHelper->feb_id(aFEB); - if(!febid.is_valid()) { - ATH_MSG_WARNING( "FEB id " << aFEB << " not valid. It will not be monitored." ); - continue; - } - bookThisFEB(febid,grEMBA,grEMBC,grEMECA,grEMECC,grHECA,grHECC,grFCALA,grFCALC); - } - // summary plot - if(m_DoSummary){ - m_h_summary_plot1_EMBA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMBA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMBC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMBC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMECA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMECC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_HECA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot HECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_HECC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot HECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_FCALA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot FCALA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_FCALC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot FCALC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMBA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMBA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMBC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMBC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMECA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMECC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_HECA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot HECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_HECC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot HECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_FCALA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot FCALA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_FCALC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot FCALC" ,16, 0, 16, 34, 0, 34); - grEMBA.regHist(m_h_summary_plot1_EMBA).ignore(); - grEMBC.regHist(m_h_summary_plot1_EMBC).ignore(); - grEMECA.regHist(m_h_summary_plot1_EMECA).ignore(); - grEMECC.regHist(m_h_summary_plot1_EMECC).ignore(); - grHECA.regHist(m_h_summary_plot1_HECA).ignore(); - grHECC.regHist(m_h_summary_plot1_HECC).ignore(); - grFCALA.regHist(m_h_summary_plot1_FCALA).ignore(); - grFCALC.regHist(m_h_summary_plot1_FCALC).ignore(); - grEMBA.regHist(m_h_summary_plot2_EMBA).ignore(); - grEMBC.regHist(m_h_summary_plot2_EMBC).ignore(); - grEMECA.regHist(m_h_summary_plot2_EMECA).ignore(); - grEMECC.regHist(m_h_summary_plot2_EMECC).ignore(); - grHECA.regHist(m_h_summary_plot2_HECA).ignore(); - grHECC.regHist(m_h_summary_plot2_HECC).ignore(); - grFCALA.regHist(m_h_summary_plot2_FCALA).ignore(); - grFCALC.regHist(m_h_summary_plot2_FCALC).ignore(); - } -} - - -/*---------------------------------------------------------*/ -/**Loops on all FEBS to book and define histograms.*/ -void LArNoiseCorrelationMon::bookAllFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - ATH_MSG_INFO( "No selected FEBs provided: booking all FEBs."); - - /** loop on FEBs to init histograms */ - std::vector<HWIdentifier>::const_iterator feb_it = m_LArOnlineIDHelper->feb_begin(); - std::vector<HWIdentifier>::const_iterator feb_it_e = m_LArOnlineIDHelper->feb_end(); - for ( ; feb_it!=feb_it_e;++feb_it) { - bookThisFEB((*feb_it),grEMBA,grEMBC,grEMECA,grEMECC,grHECA,grHECC,grFCALA,grFCALC); - } - // summary plot - if(m_DoSummary){ - m_h_summary_plot1_EMBA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMBA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMBC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMBC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMECA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_EMECC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot EMECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_HECA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot HECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_HECC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot HECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_FCALA = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot FCALA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot1_FCALC = TH2F_LW::create(m_hist_summary_name1.c_str(), "Summary1 plot FCALC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMBA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMBA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMBC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMBC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMECA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_EMECC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot EMECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_HECA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot HECA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_HECC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot HECC" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_FCALA = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot FCALA" ,16, 0, 16, 34, 0, 34); - m_h_summary_plot2_FCALC = TH2F_LW::create(m_hist_summary_name2.c_str(), "Summary2 plot FCALC" ,16, 0, 16, 34, 0, 34); - - grEMBA.regHist(m_h_summary_plot1_EMBA).ignore(); - grEMBC.regHist(m_h_summary_plot1_EMBC).ignore(); - grEMECA.regHist(m_h_summary_plot1_EMECA).ignore(); - grEMECC.regHist(m_h_summary_plot1_EMECC).ignore(); - grHECA.regHist(m_h_summary_plot1_HECA).ignore(); - grHECC.regHist(m_h_summary_plot1_HECC).ignore(); - grFCALA.regHist(m_h_summary_plot1_FCALA).ignore(); - grFCALC.regHist(m_h_summary_plot1_FCALC).ignore(); - - grEMBA.regHist(m_h_summary_plot2_EMBA).ignore(); - grEMBC.regHist(m_h_summary_plot2_EMBC).ignore(); - grEMECA.regHist(m_h_summary_plot2_EMECA).ignore(); - grEMECC.regHist(m_h_summary_plot2_EMECC).ignore(); - grHECA.regHist(m_h_summary_plot2_HECA).ignore(); - grHECC.regHist(m_h_summary_plot2_HECC).ignore(); - grFCALA.regHist(m_h_summary_plot2_FCALA).ignore(); - grFCALC.regHist(m_h_summary_plot2_FCALC).ignore(); - - } -} - -/*---------------------------------------------------------*/ -/**Book and defines histogramms for a given FEB.*/ -void LArNoiseCorrelationMon::bookThisFEB(HWIdentifier id,MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC) -{ - std::string this_name=m_strHelper->feb_str(id); - int num_slot = m_LArOnlineIDHelper->slot(id); - int num_feedthrough = m_LArOnlineIDHelper->feedthrough(id); - std::string slot_feed_title = std::to_string(num_slot) + "_" + std::to_string(num_feedthrough); - - TH2F_LW* h_corr = TH2F_LW::create((m_hist_name+this_name).c_str(), slot_feed_title.c_str(), m_Nchan,m_chan_low,m_chan_up,m_Nchan,m_chan_low,m_chan_up); - TH2F_LW* h_TMP_sums = TH2F_LW::create((m_hist_name+this_name+"_TMP_sum").c_str(),(m_hist_title+" TMP sum").c_str(),m_Nchan,m_chan_low,m_chan_up,m_Nchan,m_chan_low,m_chan_up); - TProfile_LW* h_av = TProfile_LW::create((m_hist_name+this_name+"_TMP_av").c_str(),(m_hist_title+" TMP av").c_str(),m_Nchan,m_chan_low,m_chan_up,"s"); - m_FEBhistograms[id]=std::make_pair(h_corr,std::make_pair(h_TMP_sums,h_av)); - - if(m_LArOnlineIDHelper->isEMBchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grEMBA.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grEMBA.regHist(h_av).ignore(); - grEMBA.regHist(h_TMP_sums).ignore(); - } - } - else { - grEMBC.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grEMBC.regHist(h_av).ignore(); - grEMBC.regHist(h_TMP_sums).ignore(); - } - } - } - else - if(m_LArOnlineIDHelper->isEMECchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grEMECA.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grEMECA.regHist(h_av).ignore(); - grEMECA.regHist(h_TMP_sums).ignore(); - } - } - else { - grEMECC.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grEMECC.regHist(h_av).ignore(); - grEMECC.regHist(h_TMP_sums).ignore(); - } - } - } - else - if(m_LArOnlineIDHelper->isHECchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grHECA.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grHECA.regHist(h_av).ignore(); - grHECA.regHist(h_TMP_sums).ignore(); - } - } - else { - grHECC.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grHECC.regHist(h_av).ignore(); - grHECC.regHist(h_TMP_sums).ignore(); - } - } - } - else - if(m_LArOnlineIDHelper->isFCALchannel(id)) { - if(m_LArOnlineIDHelper->pos_neg(id)==1) { - grFCALA.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grFCALA.regHist(h_av).ignore(); - grFCALA.regHist(h_TMP_sums).ignore(); - } - } - else { - grFCALC.regHist(h_corr).ignore(); - if(m_publishPartialSums && !m_IsOnline) { - grFCALC.regHist(h_av).ignore(); - grFCALC.regHist(h_TMP_sums).ignore(); - } - } - } -} - - - - diff --git a/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.h b/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.h deleted file mode 100644 index ae1bb48c013ac9ad92311cb9ad1c88f97000b2ed..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArNoiseCorrelationMon.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArNoiseCorrelationMon - * @author Margherita Spalla - * - */ - -#ifndef LARCORRMON_H -#define LARCORRMON_H - -//inheritance: -#include "AthenaMonitoring/ManagedMonitorToolBase.h" - - -//LAr services: -#include "LArElecCalib/ILArPedestal.h" -#include "LArRecConditions/LArBadChannelMask.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "StoreGate/ReadHandleKey.h" -#include "LArCabling/LArOnOffIdMapping.h" - - -//STL: -#include <string> - - - -class LArOnlineID; -class HWIdentifier; -class LArOnlineIDStrHelper; -class TProfile2D_LW; -class TProfile_LW; -class TH2F_LW; - -class LArNoiseCorrelationMon: public ManagedMonitorToolBase -{ - - -public: - LArNoiseCorrelationMon(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArNoiseCorrelationMon(); - - - - virtual StatusCode initialize() override; - virtual StatusCode finalize() override; - virtual StatusCode bookHistograms() override; - virtual StatusCode fillHistograms() override; - virtual StatusCode procHistograms() override; - -protected: - - - /** services */ - LArOnlineIDStrHelper* m_strHelper; - const LArOnlineID* m_LArOnlineIDHelper; - - /** Handle to bad-channel mask */ - LArBadChannelMask m_bcMask; - SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - /** Handle to cabling */ - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - - /** Handle to pedestal */ - SG::ReadCondHandleKey<ILArPedestal> m_keyPedestal{this,"LArPedestalKey","LArPedestal","SG key of LArPedestal CDO"}; - - /** Handle to event info */ - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"}; - -private: - - /**correlation histograms*/ - int m_Nchan = 0; - double m_chan_low = 0.0,m_chan_up = 0.0; - std::string m_hist_name; - std::string m_hist_summary_name1; - std::string m_hist_summary_name2; - std::string m_hist_title; - - /** The FEB map*/ - std::map<HWIdentifier,std::pair<TH2F_LW*,std::pair<TH2F_LW*,TProfile_LW*> > > m_FEBhistograms; - std::pair<TH2F_LW*,std::pair<TH2F_LW*,TProfile_LW*> > m_histos; //for handling histograms - - /** Summary plot*/ - TH2F_LW * m_h_summary_plot1_EMBA = nullptr; - TH2F_LW * m_h_summary_plot1_EMBC = nullptr; - TH2F_LW * m_h_summary_plot1_EMECA = nullptr; - TH2F_LW * m_h_summary_plot1_EMECC = nullptr; - TH2F_LW * m_h_summary_plot1_HECA = nullptr; - TH2F_LW * m_h_summary_plot1_HECC = nullptr; - TH2F_LW * m_h_summary_plot1_FCALA = nullptr; - TH2F_LW * m_h_summary_plot1_FCALC = nullptr; - - TH2F_LW * m_h_summary_plot2_EMBA = nullptr; - TH2F_LW * m_h_summary_plot2_EMBC = nullptr; - TH2F_LW * m_h_summary_plot2_EMECA = nullptr; - TH2F_LW * m_h_summary_plot2_EMECC = nullptr; - TH2F_LW * m_h_summary_plot2_HECA = nullptr; - TH2F_LW * m_h_summary_plot2_HECC = nullptr; - TH2F_LW * m_h_summary_plot2_FCALA = nullptr; - TH2F_LW * m_h_summary_plot2_FCALC = nullptr; - - - /** list of FEBs to monitor. FEB names are expected to be of the type LARONLINEID defined in the package atlas/LArCalorimeter/LArMonTools/LArMonTools/LArOnlineIDStrHelper.h e.g. 'BarrelCFT00Slot02' */ - std::vector<std::string> m_FEBsToMonitor; - - /** to publish partial sums (offline only) if needed*/ - bool m_publishPartialSums; - - /** to avoid publishing tons of histograms online, in case it's a problem*/ - bool m_publishAllFebsOnline; - - /** to avoid asking for triggers in case of a calibration run*/ - bool m_isCalibrationRun; - - /**declare identifier*/ - HWIdentifier m_febID; - int m_ch1 = 0,m_ch2 = 0; - - /**other variables used in joboptions*/ - bool m_IsOnline; - bool m_ignoreKnownBadChannels; - bool m_DoSummary; - - std::string m_LArDigitContainerKey; - - /** Private members*/ - int m_evtId = 0; - std::vector<std::string> m_triggers; - int m_evtCounter = 0; - - /** Declare methods used*/ - bool isGoodChannel(const HWIdentifier id,const float ped,const LArOnOffIdMapping *cabling, const LArBadChannelCont* bcCont) const; - void fillInCorrelations(); - void bookSelectedFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - void bookAllFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - void bookThisFEB(HWIdentifier id,MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC); - -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArNoisyROMon.cxx b/LArCalorimeter/LArMonTools/src/LArNoisyROMon.cxx deleted file mode 100644 index 3246355d84b6ffe42b03c3dd15f7202fd814f025..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArNoisyROMon.cxx +++ /dev/null @@ -1,951 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArNoisyROMon.h" -#include "LArOnlineIDStrHelper.h" - -#include "LArRecEvent/LArEventBitInfo.h" -#include "LArIdentifier/LArOnlineID.h" -#include "xAODEventInfo/EventInfo.h" - -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH2I_LW.h" -#include "LWHists/TH2F_LW.h" -#include "TBranch.h" - - -#include <sstream> -#include <stdexcept> -#include <cmath> - -LArNoisyROMon::LArNoisyROMon(const std::string& type, - const std::string& name, - const IInterface* parent): - ManagedMonitorToolBase(type, name, parent), - m_NoiseTimeTree(nullptr), m_CandidateMNBTree(nullptr), m_eventCounter(0), m_LArOnlineIDHelper(nullptr), m_strHelper(nullptr), m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), m_EF_NoiseBurst_Triggers(), m_L1_NoiseBurst_Triggers() -{ - declareProperty("IsOnline", m_IsOnline=false); - declareProperty("NoisyFEBDefStr", m_NoisyFEBDefStr="(unknown)"); - declareProperty("MNBTightFEBDefStr", m_MNBTightFEBDefStr="(unknown)"); - declareProperty("MNBTight_PsVetoFEBDefStr", m_MNBTight_PsVetoFEBDefStr="(unknown)"); - declareProperty("MNBLooseFEBDefStr", m_MNBLooseFEBDefStr="(unknown)"); - declareProperty("BadFEBCut", m_BadFEBCut=999999); - declareProperty("doTrigger", m_doTrigger=true); - declareProperty("storeLooseMNBFEBs", m_storeLooseMNBFEBs=false); - declareProperty("EFNoiseBurstTriggers",m_EF_NoiseBurst_Triggers); - declareProperty("L1NoiseBurstTriggers",m_L1_NoiseBurst_Triggers); - declareProperty("m_lumi_blocks", m_lumi_blocks = 3000 ); - declareProperty("doHisto", m_doHisto=true); - - m_NoiseTime.time = 0; - m_NoiseTime.time_ns = 0; - m_NoiseTime.algo = 0; - - m_CandidateMNB.candidate_MNB_time = 0; - m_CandidateMNB.candidate_MNB_time_ns = 0; - m_CandidateMNB.n_candidate_MNBTight_FEB = 0; - m_CandidateMNB.n_candidate_MNBTight_PsVeto_FEB = 0; - m_CandidateMNB.n_candidate_MNBLoose_FEB = 0; - m_CandidateMNB.v_candidate_MNBTightFEB = new std::vector<int>; - m_CandidateMNB.v_candidate_MNBTight_PsVetoFEB = new std::vector<int>; - m_CandidateMNB.v_candidate_MNBLooseFEB = new std::vector<int>; - - m_h_NoisyFEB = nullptr; - m_h_LBN = nullptr; -} - -LArNoisyROMon::~LArNoisyROMon() -{ - if ( m_strHelper ) delete m_strHelper; - - // don't delete m_NoiseTimeTree, it is not owned by this alg. - -} - - -StatusCode LArNoisyROMon::initialize() -{ - ATH_CHECK( m_inputKey.initialize() ); - ATH_CHECK( m_eventInfoKey.initialize() ); - - if ( !(detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID" ).isSuccess()) ) - { - ATH_MSG_FATAL( "unable to retrieve LArOnlineID from detStore" ); - return StatusCode::FAILURE; - } - - m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper); - m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - - if ( m_doTrigger ) - { - StatusCode sc = m_trigDec.retrieve(); - if ( !sc.isSuccess() ) - { - ATH_MSG_FATAL( "unable to initialize TrigDecisionTool " ); - return StatusCode::FAILURE; - } - } - ManagedMonitorToolBase::initialize().ignore(); - - return StatusCode::SUCCESS; -} - -StatusCode LArNoisyROMon::bookHistograms() -{ - - m_eventCounter=0; - std::string hTitle; - std::stringstream tit; - - MonGroup overall(this, "/LAr/NoisyROOldTool", run, ATTRIB_MANAGED ); - if(m_doHisto) { - // Book histograms per partitions - MonGroup GroupBarrel(this, "/LAr/NoisyROiOldTool/Barrel", run, ATTRIB_MANAGED ); - MonGroup GroupBarrelFrac(this, "/LAr/NoisyROOldTool/Barrel", run, ATTRIB_MANAGED ,"", "weightedEff"); - MonGroup GroupBarrelFracBin(this, "/LAr/NoisyROOldTool/Barrel", run, ATTRIB_MANAGED ,"", "perBinEffPerCent"); - m_partHistos.resize(4); - bookPartitionHistos(m_partHistos[1],"EMBA",GroupBarrel,GroupBarrelFrac,GroupBarrelFracBin); - bookPartitionHistos(m_partHistos[2],"EMBC",GroupBarrel,GroupBarrelFrac,GroupBarrelFracBin); - - MonGroup GroupEMEC(this, "/LAr/NoisyROOldTool/EMEC", run, ATTRIB_MANAGED ); - MonGroup GroupEMECFrac(this, "/LAr/NoisyROOldTool/EMEC", run, ATTRIB_MANAGED,"", "weightedEff" ); - MonGroup GroupEMECFracBin(this, "/LAr/NoisyROOldTool/EMEC", run, ATTRIB_MANAGED,"", "perBinEffPerCent" ); - bookPartitionHistos(m_partHistos[0],"EMECA",GroupEMEC,GroupEMECFrac,GroupEMECFracBin); - bookPartitionHistos(m_partHistos[3],"EMECC",GroupEMEC,GroupEMECFrac,GroupEMECFracBin); - - - // Book general histograms - Number of RNB noisy FEBs - hTitle = "Number of noisy FEB "+m_NoisyFEBDefStr+ " per event"; - m_h_NoisyFEB = TH1I_LW::create("NoisyFEB", hTitle.c_str(), 50,0.,50.); - m_h_NoisyFEB->GetXaxis()->SetTitle("# of noisy FEB"); - overall.regHist(m_h_NoisyFEB).ignore(); - - m_h_LBN = TH1I_LW::create("LBN", "Event counter per LB", m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - - // Fill Suspicious MNB FEBs - for (uint i=0;i<m_knownMNBFEBs.size();i++){ - const HWIdentifier& febid = HWIdentifier(m_knownMNBFEBs[i]); - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(febid,0); - int FT = m_LArOnlineIDHelper->feedthrough(id); - int slot = m_LArOnlineIDHelper->slot(id); - int partition = partitionNumber(febid); - m_partHistos[partition].h_MNBKnownFEB->Fill(slot,FT); - } - - - } - - m_NoiseTimeTree = new TTree("LArNoise","LAr noisy events"); - m_NoiseTimeTree->Branch("time",&m_NoiseTime.time,"time/i"); - m_NoiseTimeTree->Branch("time_ns",&m_NoiseTime.time_ns,"time_ns/i"); - m_NoiseTimeTree->Branch("algo",&m_NoiseTime.algo,"algo/b"); - overall.regTree(m_NoiseTimeTree).ignore(); - - m_CandidateMNBTree = new TTree("CandidateMNBFebs","Candidate MNB Febs"); - m_CandidateMNBTree->Branch("candidate_MNB_time",&m_CandidateMNB.candidate_MNB_time,"candidate_MNB_time/i"); - m_CandidateMNBTree->Branch("candidate_MNB_time_ns",&m_CandidateMNB.candidate_MNB_time_ns,"candidate_MNB_time_ns/i"); - m_CandidateMNBTree->Branch("n_candidate_MNBTight_FEB",&m_CandidateMNB.n_candidate_MNBTight_FEB,"n_candidate_MNBTight_FEB/i"); - m_CandidateMNBTree->Branch("n_candidate_MNBTight_PsVeto_FEB",&m_CandidateMNB.n_candidate_MNBTight_PsVeto_FEB,"n_candidate_MNBTight_PsVeto_FEB/i"); - m_CandidateMNBTree->Branch("n_candidate_MNBLoose_FEB",&m_CandidateMNB.n_candidate_MNBLoose_FEB,"n_candidate_MNBLoose_FEB/i"); - m_CandidateMNBTree->Branch("v_candidate_MNBTightFEB", "vector<int>", &m_CandidateMNB.v_candidate_MNBTightFEB); - m_CandidateMNBTree->Branch("v_candidate_MNBTight_PsVeto_FEB", "vector<int>", &m_CandidateMNB.v_candidate_MNBTightFEB); - m_CandidateMNBTree->Branch("v_candidate_MNBLooseFEB", "vector<int>", &m_CandidateMNB.v_candidate_MNBLooseFEB); - overall.regTree(m_CandidateMNBTree).ignore(); - - return StatusCode::SUCCESS; -} - -StatusCode LArNoisyROMon::fillHistograms() -{ - StatusCode sc(StatusCode::SUCCESS); - - m_eventCounter++; - - // retrieve - SG::ReadHandle<LArNoisyROSummary> noisyRO{m_inputKey}; - if (!noisyRO.isValid()) - { - ATH_MSG_WARNING( "Can't retrieve LArNoisyROSummary " ); - return StatusCode::SUCCESS; - } - - - SG::ReadHandle<xAOD::EventInfo> eventInfo{m_eventInfoKey}; - if (!eventInfo.isValid()) - { - ATH_MSG_WARNING( "Can't retrieve EventInfo " ); - return StatusCode::SUCCESS; - } - - unsigned int LBN = eventInfo->lumiBlock(); - bool burstveto = eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::NOISEBURSTVETO); - - // Filling Candidate MNB Tree - m_CandidateMNB.candidate_MNB_time=eventInfo->timeStamp(); - m_CandidateMNB.candidate_MNB_time_ns=eventInfo->timeStampNSOffset(); - m_CandidateMNB.v_candidate_MNBTightFEB->clear(); - m_CandidateMNB.v_candidate_MNBTight_PsVetoFEB->clear(); - m_CandidateMNB.v_candidate_MNBLooseFEB->clear(); - const std::vector<HWIdentifier>& mnbtightFEB = noisyRO->get_MNBTight_febs(); - const std::vector<HWIdentifier>& mnbtight_PsVetoFEB = noisyRO->get_MNBTight_PsVeto_febs(); - const std::vector<HWIdentifier>& mnblooseFEB = noisyRO->get_MNBLoose_febs(); - m_CandidateMNB.n_candidate_MNBTight_FEB = mnbtightFEB.size(); - m_CandidateMNB.n_candidate_MNBTight_PsVeto_FEB = mnbtightFEB.size(); - m_CandidateMNB.n_candidate_MNBLoose_FEB = mnblooseFEB.size(); - - for(unsigned int iFeb=0; iFeb<mnbtightFEB.size(); iFeb++) - m_CandidateMNB.v_candidate_MNBTightFEB->push_back(mnbtightFEB.at(iFeb).get_identifier32().get_compact()); - - for(unsigned int iFeb=0; iFeb<mnbtight_PsVetoFEB.size(); iFeb++) - m_CandidateMNB.v_candidate_MNBTight_PsVetoFEB->push_back(mnbtight_PsVetoFEB.at(iFeb).get_identifier32().get_compact()); - - if (m_storeLooseMNBFEBs){ // joboption - By default the FEB flagged as MNB-Loose are not stored in the TTree - for(unsigned int iFeb=0; iFeb<mnblooseFEB.size(); iFeb++) - m_CandidateMNB.v_candidate_MNBLooseFEB->push_back(mnblooseFEB.at(iFeb).get_identifier32().get_compact()); - } - - if(!m_CandidateMNB.v_candidate_MNBLooseFEB->empty() || !m_CandidateMNB.v_candidate_MNBTightFEB->empty()) - m_CandidateMNBTree->Fill(); - - // Fill the noise bursts timestamp ttree - m_NoiseTime.time = eventInfo->timeStamp(); - m_NoiseTime.time_ns = eventInfo->timeStampNSOffset(); // Modification by B.Trocme to get the ns precision - m_NoiseTime.algo = 0; - if ( eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::BADFEBS) ) - { - m_NoiseTime.algo |= 0x1; - } - if ( eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::TIGHTSATURATEDQ) ) - { - m_NoiseTime.algo |= 0x2; - } - if ( eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::BADFEBS_W) ) - { - m_NoiseTime.algo |= 0x8; - } - if (eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::MININOISEBURSTLOOSE)) - { - m_NoiseTime.algo |= 0x10; - } - if (eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::MININOISEBURSTTIGHT)) - { - m_NoiseTime.algo |= 0x20; - } - if (eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::MININOISEBURSTTIGHT_PSVETO)) - { - m_NoiseTime.algo |= 0x40; - } - - if ( m_NoiseTime.algo != 0 ) - { - if ( burstveto ) m_NoiseTime.algo |= 0x4; - //unsigned uf=m_NoiseTime.algo; - //std::cout<<"LArNoisyROMon flag: "<<uf<<std::endl; - m_NoiseTimeTree->Fill(); - } - - // Triggers - uint8_t trigbits = 0; - uint8_t L1trigbits = 0; - if ( m_doTrigger ) - { - for ( size_t i = 0; i < m_EF_NoiseBurst_Triggers.size(); i++) - { - if ( m_trigDec->isPassed(m_EF_NoiseBurst_Triggers[i])) trigbits |= (0x1 << i); - } - for ( size_t i = 0; i < m_L1_NoiseBurst_Triggers.size(); i++) - { - if ( m_trigDec->isPassed(m_L1_NoiseBurst_Triggers[i])) L1trigbits |= (0x1 << i); - } - } - if(!m_doHisto) return sc; - - // Fill the 2D map of noisy and mini-noisy FEBs - const std::vector<HWIdentifier>& noisyFEB = noisyRO->get_noisy_febs(); - - // Loop on all FEBs noisy in Std definition (i.e >30 channels with q factor > 4000) - // And fill the 2D maps of fraction of fraction of noisy events - unsigned int NbNoisyFEB = 0; - std::array<unsigned,4> partMask({{LArNoisyROSummary::EMECAMask,LArNoisyROSummary::EMBAMask,LArNoisyROSummary::EMBCMask,LArNoisyROSummary::EMECCMask}}); - - for (size_t i = 0; i<noisyFEB.size(); i++) - { - //std::cout << "Noisy FEB " << noisyFEB[i].get_compact() << std::endl; - NbNoisyFEB++; - const HWIdentifier& febid = noisyFEB[i]; - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(febid,0); - int FT = m_LArOnlineIDHelper->feedthrough(id); - int slot = m_LArOnlineIDHelper->slot(id); - int partition = partitionNumber(febid); - - if (partition<4){ - if (m_IsOnline) - m_partHistos[partition].h_NoisyFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - else - m_partHistos[partition].h_NoisyFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - - } // End of loop on all RNB - noisy FEB - m_h_NoisyFEB->Fill(NbNoisyFEB); - - // Loop on all FEBs noisy in MNB-tight definition - // And fill the 2D maps of fraction of fraction of noisy events - // Fill two histograms with veto cut and all events - for (size_t i = 0; i<mnbtightFEB.size(); i++) - { - //std::cout << "MNBTight FEB " << noisyFEB[i].get_compact() << std::endl; - const HWIdentifier& febid = mnbtightFEB[i]; - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(febid,0); - int FT = m_LArOnlineIDHelper->feedthrough(id); - int slot = m_LArOnlineIDHelper->slot(id); - int partition = partitionNumber(febid); - - if (partition<4){ - if (m_IsOnline) - { - m_partHistos[partition].h_CandidateMNBTightFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBTightFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBTightFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - else - { - m_partHistos[partition].h_CandidateMNBTightFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBTightFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBTightFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - } - - }// End of loop on all MNB-Tight - noisy FEB - - // Loop on all FEBs noisy in MNB-tight-PsVeto definition - // And fill the 2D maps of fraction of fraction of noisy events - // Fill two histograms with veto cut and all events - // std::cout << "Nb of tight_PsVeto FEB" << mnbtightFEB.size() << std::endl; - for (size_t i = 0; i<mnbtight_PsVetoFEB.size(); i++) - { - const HWIdentifier& febid = mnbtight_PsVetoFEB[i]; - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(febid,0); - int FT = m_LArOnlineIDHelper->feedthrough(id); - int slot = m_LArOnlineIDHelper->slot(id); - int partition = partitionNumber(febid); -// std::cout << "MNBTight_PsVeto FEB " << mnbtight_PsVetoFEB[i].get_compact() << std::endl; -// std::cout << "Partitions : " << (noisyRO->MNBTight_PsVetoFlaggedPartitions() & partMask[partition]) << std::endl; - - if (partition<4){ - if (m_IsOnline) - { - m_partHistos[partition].h_CandidateMNBTight_PsVetoFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBTight_PsVetoFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBTight_PsVetoFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - else - { - m_partHistos[partition].h_CandidateMNBTight_PsVetoFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBTight_PsVetoFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBTight_PsVetoFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - } - - }// End of loop on all MNB-Tight-PsVeto - noisy FEB - - // Loop on all FEBs noisy in MNB-loose definition - // And fill the 2D maps of fraction of fraction of noisy events - // Fill two histograms with veto cut and all events - for (size_t i = 0; i<mnblooseFEB.size(); i++) - { - //std::cout << "MNBLoose FEB " << noisyFEB[i].get_compact() << std::endl; - const HWIdentifier& febid = mnblooseFEB[i]; - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(febid,0); - int FT = m_LArOnlineIDHelper->feedthrough(id); - int slot = m_LArOnlineIDHelper->slot(id); - int partition = partitionNumber(febid); - - if (partition<4){ - if (m_IsOnline) - { - m_partHistos[partition].h_CandidateMNBLooseFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBLooseFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBLooseFEBPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - else - { - m_partHistos[partition].h_CandidateMNBLooseFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - if((noisyRO->MNBLooseFlaggedPartitions() & partMask[partition]) != 0) - m_partHistos[partition].h_MNBLooseFEBFracPerEvt->Fill(static_cast<double>(slot), static_cast<double>(FT)+0.1); - } - } - - }// End of loop on all MNB-Loose - noisy FEB - - - // End of 2D map of FEB found as noisy (in any definition : Std, MNB-Tight, MNB-Tight-PsVeto or MNB-Loose) - // Now fill 1D histograms of fraction of events found as noisy vetoed or not - m_h_LBN->Fill(LBN); - // Event found noisy by Std method - uint8_t BadFEBPartitions = noisyRO->BadFEBFlaggedPartitions(); - if ( BadFEBPartitions != 0) { - for (int i= 0;i<4;i++){ - if ( (BadFEBPartitions & partMask[i]) != 0 ) { - m_partHistos[i].h_NoisyEvent->Fill(LBN); - if ( m_doTrigger ) fillTriggerHisto(m_partHistos[i],trigbits,L1trigbits); - if ( ! burstveto ) m_partHistos[i].h_NoisyEventTimeVeto->Fill(LBN); - } - } - } // End of test on RNB - - // event flagged by # of saturated quality cells - uint8_t SatTightPartitions = noisyRO->SatTightFlaggedPartitions(); - if ( eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::TIGHTSATURATEDQ) ) { - for (int i= 0;i<4;i++){ - if ( (SatTightPartitions & partMask[i]) != 0 ) { - m_partHistos[i].h_SaturatedNoisyEvent->Fill(LBN); - if ( ! burstveto ) m_partHistos[i].h_SaturatedNoisyEventTimeVeto->Fill(LBN); - } - } - } // end of test on RNB-Saturated - - - // event flagged by tight-MNB - uint8_t MNBTightPartitions = noisyRO->MNBTightFlaggedPartitions(); - if ( MNBTightPartitions != 0) { - for (int i= 0;i<4;i++){ - if ( (MNBTightPartitions & partMask[i]) != 0 ) { - m_partHistos[i].h_MNBTightEvent->Fill(LBN); - if ( ! burstveto ) m_partHistos[i].h_MNBTightEventTimeVeto->Fill(LBN); - } - } - } // End of test on MNB-Tight - - // event flagged by tight-MNB-PsVeto - uint8_t MNBTight_PsVetoPartitions = noisyRO->MNBTight_PsVetoFlaggedPartitions(); - if ( MNBTight_PsVetoPartitions != 0) { - for (int i= 0;i<4;i++){ - if ( (MNBTight_PsVetoPartitions & partMask[i]) != 0 ) { - m_partHistos[i].h_MNBTight_PsVetoEvent->Fill(LBN); - if ( ! burstveto ) m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto->Fill(LBN); - } - } - } // End of test on MNB-Tight-PsVeto - - // event flagged by loose-MNB - uint8_t MNBLoosePartitions = noisyRO->MNBLooseFlaggedPartitions(); - if ( MNBLoosePartitions != 0) { - for (int i= 0;i<4;i++){ - if ( (MNBLoosePartitions & partMask[i]) != 0 ) { - m_partHistos[i].h_MNBLooseEvent->Fill(LBN); - if ( ! burstveto ) m_partHistos[i].h_MNBLooseEventTimeVeto->Fill(LBN); - } - } - } // end fo test on MNB-Loose - - return sc; -} - -StatusCode LArNoisyROMon::checkHists(bool fromFinalize) -{ - if(fromFinalize){ - ///std::cout << "LArNoisyROMon::checkHists -- if statement to stop warnings" << std::endl; - } - return StatusCode::SUCCESS; -} - -StatusCode LArNoisyROMon::procHistograms() -{ - if(!m_doHisto) return StatusCode::SUCCESS; - - if ( endOfRunFlag() || endOfEventsBlockFlag()){ - if ( m_IsOnline ){ - // copy the "running" histo to the final ones, to be normalised - for (int i=0;i<4;i++){ - copyHisto(m_partHistos[i].h_NoisyFEBPerEvt,m_partHistos[i].h_NoisyFEBFracPerEvt); - copyHisto(m_partHistos[i].h_MNBTightFEBPerEvt,m_partHistos[i].h_MNBTightFEBFracPerEvt); - copyHisto(m_partHistos[i].h_MNBTight_PsVetoFEBPerEvt,m_partHistos[i].h_MNBTight_PsVetoFEBFracPerEvt); - copyHisto(m_partHistos[i].h_MNBLooseFEBPerEvt,m_partHistos[i].h_MNBLooseFEBFracPerEvt); - copyHisto(m_partHistos[i].h_CandidateMNBTightFEBPerEvt,m_partHistos[i].h_CandidateMNBTightFEBFracPerEvt); - copyHisto(m_partHistos[i].h_CandidateMNBTight_PsVetoFEBPerEvt,m_partHistos[i].h_CandidateMNBTight_PsVetoFEBFracPerEvt); - copyHisto(m_partHistos[i].h_CandidateMNBLooseFEBPerEvt,m_partHistos[i].h_CandidateMNBLooseFEBFracPerEvt); - } - } - - if (m_eventCounter>0) { - const double scale = 100./static_cast<double>(m_eventCounter); - - for (int i=0;i<4;i++){ - m_partHistos[i].h_NoisyFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_NoisyFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_MNBTightFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_MNBTightFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_MNBTight_PsVetoFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_MNBTight_PsVetoFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_MNBLooseFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_MNBLooseFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_CandidateMNBTightFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_CandidateMNBTightFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_CandidateMNBTight_PsVetoFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_CandidateMNBTight_PsVetoFEBFracPerEvt->SetEntries(m_eventCounter); - m_partHistos[i].h_CandidateMNBLooseFEBFracPerEvt->scaleContentsAndErrors(scale); - m_partHistos[i].h_CandidateMNBLooseFEBFracPerEvt->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_NoisyEventFrac,m_partHistos[i].h_NoisyEvent,m_h_LBN); - m_partHistos[i].h_NoisyEventFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_SaturatedNoisyEventFrac,m_partHistos[i].h_SaturatedNoisyEvent,m_h_LBN); - m_partHistos[i].h_SaturatedNoisyEventFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBTightEventFrac,m_partHistos[i].h_MNBTightEvent,m_h_LBN); - m_partHistos[i].h_MNBTightEventFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBTight_PsVetoEventFrac,m_partHistos[i].h_MNBTight_PsVetoEvent,m_h_LBN); - m_partHistos[i].h_MNBTight_PsVetoEventFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBLooseEventFrac,m_partHistos[i].h_MNBLooseEvent,m_h_LBN); - m_partHistos[i].h_MNBLooseEventFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_NoisyEventTimeVetoFrac,m_partHistos[i].h_NoisyEventTimeVeto,m_h_LBN); - m_partHistos[i].h_NoisyEventTimeVetoFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_SaturatedNoisyEventTimeVetoFrac,m_partHistos[i].h_SaturatedNoisyEventTimeVeto,m_h_LBN); - m_partHistos[i].h_SaturatedNoisyEventTimeVetoFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBTightEventTimeVetoFrac,m_partHistos[i].h_MNBTightEventTimeVeto,m_h_LBN); - m_partHistos[i].h_MNBTightEventTimeVetoFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBTight_PsVetoEventTimeVetoFrac,m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto,m_h_LBN); - m_partHistos[i].h_MNBTight_PsVetoEventTimeVetoFrac->SetEntries(m_eventCounter); - divideHisto(m_partHistos[i].h_MNBLooseEventTimeVetoFrac,m_partHistos[i].h_MNBLooseEventTimeVeto,m_h_LBN); - m_partHistos[i].h_MNBLooseEventTimeVetoFrac->SetEntries(m_eventCounter); - } - }//end if m_eventCounter>0 - } - - if ( endOfRunFlag() ) { - if ( m_h_LBN ) m_h_LBN->Reset(); - - for (int i=0;i<4;i++){ - - if (m_partHistos[i].h_NoisyEvent) m_partHistos[i].h_NoisyEvent->Reset(); - if (m_partHistos[i].h_NoisyEventTimeVeto) m_partHistos[i].h_NoisyEventTimeVeto->Reset(); - if (m_partHistos[i].h_SaturatedNoisyEvent) m_partHistos[i].h_SaturatedNoisyEvent->Reset(); - if (m_partHistos[i].h_SaturatedNoisyEventTimeVeto) m_partHistos[i].h_SaturatedNoisyEventTimeVeto->Reset(); - if (m_partHistos[i].h_MNBTightEvent) m_partHistos[i].h_MNBTightEvent->Reset(); - if (m_partHistos[i].h_MNBTightEventTimeVeto) m_partHistos[i].h_MNBTightEventTimeVeto->Reset(); - if (m_partHistos[i].h_MNBTight_PsVetoEvent) m_partHistos[i].h_MNBTight_PsVetoEvent->Reset(); - if (m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto) m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto->Reset(); - if (m_partHistos[i].h_MNBLooseEvent) m_partHistos[i].h_MNBLooseEvent->Reset(); - if (m_partHistos[i].h_MNBLooseEventTimeVeto) m_partHistos[i].h_MNBLooseEventTimeVeto->Reset(); - } - } - - return StatusCode::SUCCESS; -} - -void LArNoisyROMon::copyHisto(LWHist2D* from,LWHist2D* to) -{ - unsigned xbin, ybin; - double numer, error; - from->resetActiveBinLoop(); - - while(from->getNextActiveBin(xbin,ybin,numer,error)) - { - to->SetBinContentAndError(xbin,ybin,numer,error); - } -} - - -void LArNoisyROMon::copyHisto(LWHist1D* from,LWHist1D* to) -{ - unsigned xbin; - double numer, error; - from->resetActiveBinLoop(); - - while(from->getNextActiveBin(xbin,numer,error)) - { - to->SetBinContentAndError(xbin,numer,error); - } -} - - -void LArNoisyROMon::divideHisto(LWHist1D* to,LWHist1D* num,LWHist1D* denom) -{ - static const double OneSigOneSided = 0.159; // 0.5*(1-0.681) where 0.681 means 68%CL - - to->Reset(); - unsigned Nbins = num->GetNbinsX(); - - // can I throw an exception in the monitoring ? - if ( to->GetNbinsX() != Nbins || denom->GetNbinsX() != Nbins ) - throw(std::logic_error("Trying to divide histograms with different number of bins !")); - - for ( unsigned i = 0; i < Nbins; i++ ) - { - double N = denom->GetBinContent(i); - if ( N > 0) - { - double eps = num->GetBinContent(i) / N; - double err = std::sqrt(eps*(1.-eps)/N); - // specific cases for efficiency 0 or 1 - if ( eps == 0 ) err = 1.-std::pow(OneSigOneSided,1./N); - else if ( eps > 0.99 ) err = 1.-std::pow(OneSigOneSided,1./N); - eps *= 100.; - err *= 100.; - to->SetBinContentAndError(i,eps,err); - } - } -} - - -void LArNoisyROMon::bookPartitionHistos(partitionHistos& partition, const std::string& name, MonGroup& group, MonGroup& groupfrac, MonGroup& groupfracbin ) -{ - std::string hName, hTitle; - std::stringstream tit; - - // declare histograms properties - // Endcaps - int FEB=25,slot=15; - double FEB_low=-0.5, FEB_up=24.5, slot_low=0.5, slot_up=15.5; - // for Barrel - if( name == "EMBA" || name == "EMBC") - { - FEB=32, slot=14; - FEB_low=-0.5, FEB_up=31.5, slot_low=0.5, slot_up=14.5; - } - - // 2D FEB maps (x : slot / y : FT) with z: fraction of events for which the FEB is noisy or mini-noisy. - hName = "MNBKnownFEB_"+name; - hTitle = "Suspicious MNB FEBs - "+name; - partition.h_MNBKnownFEB = TH2I_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_MNBKnownFEB->GetXaxis()->SetTitle("Slot"); - partition.h_MNBKnownFEB->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_MNBKnownFEB).ignore(); - - - hName = "NoisyFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB noisy "+m_NoisyFEBDefStr+" - "+name; - partition.h_NoisyFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_NoisyFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_NoisyFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_NoisyFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_NoisyFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_NoisyFEBPerEvt).ignore(); - } - - hName = "MNBTightFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Tight " + m_MNBTightFEBDefStr+ " - "+name+" (only vetoed events)"; - partition.h_MNBTightFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_MNBTightFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_MNBTightFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_MNBTightFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_MNBTightFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_MNBTightFEBPerEvt).ignore(); - } - - hName = "MNBTight_PsVetoFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Tight_PsVeto " + m_MNBTight_PsVetoFEBDefStr+ " - "+name+" (only vetoed events)"; - partition.h_MNBTight_PsVetoFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_MNBTight_PsVetoFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_MNBTight_PsVetoFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_MNBTight_PsVetoFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_MNBTight_PsVetoFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_MNBTight_PsVetoFEBPerEvt).ignore(); - } - - hName = "MNBLooseFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Loose " + m_MNBLooseFEBDefStr + " - "+name+" (only vetoed events)"; - partition.h_MNBLooseFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_MNBLooseFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_MNBLooseFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_MNBLooseFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_MNBLooseFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_MNBLooseFEBPerEvt).ignore(); - } - - hName = "CandidateMNBTightFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Tight "+ m_MNBTightFEBDefStr+ " - "+name; - partition.h_CandidateMNBTightFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_CandidateMNBTightFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_CandidateMNBTightFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_CandidateMNBTightFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_CandidateMNBTightFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_CandidateMNBTightFEBPerEvt).ignore(); - } - - hName = "CandidateMNBTight_PsVetoFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Tight_PsVeto "+ m_MNBTight_PsVetoFEBDefStr+ " - "+name; - partition.h_CandidateMNBTight_PsVetoFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_CandidateMNBTight_PsVetoFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_CandidateMNBTight_PsVetoFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_CandidateMNBTight_PsVetoFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_CandidateMNBTight_PsVetoFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_CandidateMNBTight_PsVetoFEBPerEvt).ignore(); - } - - hName = "CandidateMNBLooseFEBFracPerEvt_"+name; - hTitle = "Yield of events with FEB MNB-Loose " + m_MNBLooseFEBDefStr + " - "+name; - partition.h_CandidateMNBLooseFEBFracPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - partition.h_CandidateMNBLooseFEBFracPerEvt->GetXaxis()->SetTitle("Slot"); - partition.h_CandidateMNBLooseFEBFracPerEvt->GetYaxis()->SetTitle("Feedthrough"); - groupfrac.regHist(partition.h_CandidateMNBLooseFEBFracPerEvt).ignore(); - - if ( m_IsOnline ) - { - hName="temp_"+hName; - partition.h_CandidateMNBLooseFEBPerEvt = TH2F_LW::create(hName.c_str(), hTitle.c_str(), slot,slot_low,slot_up,FEB,FEB_low,FEB_up); - group.regHist(partition.h_CandidateMNBLooseFEBPerEvt).ignore(); - } - - // Fraction of events found noisy per LB - Regular Noise Burst(RNB) Standard flag - hName = "NoisyEvent_"+name; - hTitle = "Yield of events flagged as RNB-Standard - " + name; - partition.h_NoisyEventFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_NoisyEventFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_NoisyEventFrac).ignore(); - // Histogram below is temporary. Normalized at the end of run to produce the above histograms - hName = "temp_NoisyEvent_"+name; - partition.h_NoisyEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_NoisyEvent->GetXaxis()->SetTitle("Luminosity Block"); - - // Fraction of events found noisy per LB - RNB-Saturated flag - hName = "SaturatedNoisyEvent_"+name; - hTitle = "Yield of events flagged as RNB-Saturated - "+name; - partition.h_SaturatedNoisyEventFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_SaturatedNoisyEventFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_SaturatedNoisyEventFrac).ignore(); - // Histogram below is temporary. Normalized at the end of run to produce the above histograms - hName = "temp_NoisyEvent_"+name; - partition.h_SaturatedNoisyEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_SaturatedNoisyEvent->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBTightEvent_"+name; - hTitle = "Yield of events flagged as MNB-Tight - "+name; - partition.h_MNBTightEventFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTightEventFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBTightEventFrac).ignore(); - // Histogram below is temporary. Normalized at the end of run to produce the above histograms - hName = "temp_MNBTightEvent_"+name; - partition.h_MNBTightEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTightEvent->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBTight_PsVetoEvent_"+name; - hTitle = "Yield of events flagged as MNB-Tight_PsVeto - "+name; - partition.h_MNBTight_PsVetoEventFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTight_PsVetoEventFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBTight_PsVetoEventFrac).ignore(); - // Histogram below is temporary. Normalized at the end of run to produce the above histograms - hName = "temp_MNBTight_PsVetoEvent_"+name; - partition.h_MNBTight_PsVetoEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTight_PsVetoEvent->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBLooseEvent_"+name; - hTitle = "Yield of events flagged as MNB-Loose - "+name; - partition.h_MNBLooseEventFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBLooseEventFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBLooseEventFrac).ignore(); - // Histogram below is temporary. Normalized at the end of run to produce the above histograms - hName = "temp_MNBLooseEvent_"+name; - partition.h_MNBLooseEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBLooseEvent->GetXaxis()->SetTitle("Luminosity Block"); - -// // Fraction of events found noisy per LB - Weighted flag -// hName = "NoisyWEvent_"+name; -// partition.h_NoisyWEventFrac = TH1F_LW::create(hName.c_str(), "Yield of events flagged as LArNoisyRO_StdOpt", m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); -// partition.h_NoisyWEventFrac->GetXaxis()->SetTitle("Luminosity Block"); -// groupfracbin.regHist(partition.h_NoisyWEventFrac).ignore(); -// hName = "temp_NoisyWEvent_"+name; -// partition.h_NoisyWEvent = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); -// partition.h_NoisyWEvent->GetXaxis()->SetTitle("Luminosity Block"); - - // Fraction of events found noisy per LB after time veto - Std flag - hName = "NoisyEvent_TimeVeto_"+name; - hTitle = "Yield of events flagged as RNB-Standard not vetoed by time window - "+name; - partition.h_NoisyEventTimeVetoFrac = TH1F_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_NoisyEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_NoisyEventTimeVetoFrac).ignore(); - - hName = "temp_NoisyEvent_TimeVeto_"+name; - partition.h_NoisyEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_NoisyEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - - // Fraction of events found noisy per LB after time veto - Sat flag - hName = "SaturatedNoisyEvent_TimeVeto_"+name; - hTitle = "Yield of events flagged as RNB-Saturated not vetoed by time window - "+ name; - partition.h_SaturatedNoisyEventTimeVetoFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_SaturatedNoisyEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_SaturatedNoisyEventTimeVetoFrac).ignore(); - - hName = "temp_SaturatedNoisyEvent_TimeVeto_"+name; - partition.h_SaturatedNoisyEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_SaturatedNoisyEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBTightEvent_TimeVeto_"+name; - hTitle = "Yield of events flagged as MNB-Tight not vetoed by time window - " + name; - partition.h_MNBTightEventTimeVetoFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTightEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBTightEventTimeVetoFrac).ignore(); - - hName = "temp_MNBTightEvent_TimeVeto_"+name; - partition.h_MNBTightEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTightEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBTight_PsVetoEvent_TimeVeto_"+name; - hTitle = "Yield of events flagged as MNB-Tight_PsVeto not vetoed by time window - " + name; - partition.h_MNBTight_PsVetoEventTimeVetoFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTight_PsVetoEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBTight_PsVetoEventTimeVetoFrac).ignore(); - - hName = "temp_MNBTight_PsVetoEvent_TimeVeto_"+name; - partition.h_MNBTight_PsVetoEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBTight_PsVetoEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - - hName = "MNBLooseEvent_TimeVeto_"+name; - hTitle = "Yield of events flagged as MNB-Loose not vetoed by time window - " + name; - partition.h_MNBLooseEventTimeVetoFrac = TH1F_LW::create(hName.c_str(),hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBLooseEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); - groupfracbin.regHist(partition.h_MNBLooseEventTimeVetoFrac).ignore(); - - hName = "temp_MNBLooseEvent_TimeVeto_"+name; - partition.h_MNBLooseEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); - partition.h_MNBLooseEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - -// // Fraction of events found noisy per LB after time veto - Weighted flag -// hName = "NoisyWEvent_TimeVeto_"+name; -// partition.h_NoisyWEventTimeVetoFrac = TH1F_LW::create(hName.c_str(), "Yield of events flagged as RNB-StandardOpt not vetoed by time window", m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); -// partition.h_NoisyWEventTimeVetoFrac->GetXaxis()->SetTitle("Luminosity Block"); -// groupfracbin.regHist(partition.h_NoisyWEventTimeVetoFrac).ignore(); -// -// hName = "temp_NoisyWEvent_TimeVeto_"+name; -// partition.h_NoisyWEventTimeVeto = TH1I_LW::create(hName.c_str(), hTitle.c_str(), m_lumi_blocks+1, -0.5, (float)m_lumi_blocks+0.5); -// partition.h_NoisyWEventTimeVeto->GetXaxis()->SetTitle("Luminosity Block"); - - if ( m_doTrigger ) - { - unsigned int siz = m_EF_NoiseBurst_Triggers.size(); - hName = "NoisyEventTrigger_"+name; - hTitle = "Trigger fired for RNB flagged events - "+name; - partition.h_NoisyEventTrigger = TH1I_LW::create(hName.c_str(), hTitle.c_str(), siz+1, 0.5, siz+1.5); - LWHist::LWHistAxis* axis = partition.h_NoisyEventTrigger->GetXaxis(); - axis->SetTitle("Special trigger fired"); - for ( size_t i = 0; i < siz; i++) - { - axis->SetBinLabel(i+1,m_EF_NoiseBurst_Triggers[i].c_str()); - } - axis->SetBinLabel(siz+1,"NONE"); - group.regHist(partition.h_NoisyEventTrigger).ignore(); - - - siz = m_L1_NoiseBurst_Triggers.size(); - hName = "NoisyEventL1Term_"+name; - hTitle = "L1 term fired for RNB flagged events - "+name; - partition.h_NoisyEventTriggerL1 = TH1I_LW::create(hName.c_str(), hTitle.c_str(), siz+1, 0.5, siz+1.5); - axis = partition.h_NoisyEventTriggerL1->GetXaxis(); - axis->SetTitle("L1 term fired"); - for ( size_t i = 0; i < siz; i++) - { - axis->SetBinLabel(i+1,m_L1_NoiseBurst_Triggers[i].c_str()); - } - axis->SetBinLabel(siz+1,"NONE"); - group.regHist(partition.h_NoisyEventTriggerL1).ignore(); - } -} - - -void LArNoisyROMon::fillTriggerHisto(partitionHistos& partition, uint8_t triggerbits, uint8_t L1triggerbits) -{ - if ( triggerbits ==0 ) - { - partition.h_NoisyEventTrigger->Fill(double(m_EF_NoiseBurst_Triggers.size()+1)); - } - else - { - for ( size_t i = 0; i < m_EF_NoiseBurst_Triggers.size(); i++) - { - if ( triggerbits & (0x1 << i) ) partition.h_NoisyEventTrigger->Fill(double(i+1)); - } - } - - if ( L1triggerbits ==0 ) - { - partition.h_NoisyEventTriggerL1->Fill(double(m_L1_NoiseBurst_Triggers.size()+1)); - } - else - { - for ( size_t i = 0; i < m_L1_NoiseBurst_Triggers.size(); i++) - { - if ( L1triggerbits & (0x1 << i) ) partition.h_NoisyEventTriggerL1->Fill(double(i+1)); - } - } - -} - -StatusCode LArNoisyROMon::finalize() -{ - ATH_MSG_INFO( " in LArNoisyROMon::finalize() " ); - // delete temposary histograms - - if ( m_h_LBN ) { - LWHist::safeDelete(m_h_LBN); - m_h_LBN = nullptr; - } - - // for (partitionHistos* part : {&m_BarrelA, &m_BarrelC, &m_EMECA, &m_EMECC}) { - for (unsigned i=0;i<m_partHistos.size();i++){ - if(m_partHistos[i].h_NoisyEvent) LWHist::safeDelete(m_partHistos[i].h_NoisyEvent); - m_partHistos[i].h_NoisyEvent = nullptr; - -// LWHist::safeDelete(part->h_NoisyWEvent); -// part->h_NoisyWEvent = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_NoisyEventTimeVeto); - m_partHistos[i].h_NoisyEventTimeVeto = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBTightEvent); - m_partHistos[i].h_MNBTightEvent = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBTightEventTimeVeto); - m_partHistos[i].h_MNBTightEventTimeVeto = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBTight_PsVetoEvent); - m_partHistos[i].h_MNBTight_PsVetoEvent = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto); - m_partHistos[i].h_MNBTight_PsVetoEventTimeVeto = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBLooseEvent); - m_partHistos[i].h_MNBLooseEvent = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_MNBLooseEventTimeVeto); - m_partHistos[i].h_MNBLooseEventTimeVeto = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_SaturatedNoisyEvent); - m_partHistos[i].h_SaturatedNoisyEvent = nullptr; - - LWHist::safeDelete(m_partHistos[i].h_SaturatedNoisyEventTimeVeto); - m_partHistos[i].h_SaturatedNoisyEventTimeVeto = nullptr; - -// LWHist::safeDelete(part->h_NoisyWEventTimeVeto); -// part->h_NoisyWEventTimeVeto=nullptr; - } - - - - return StatusCode::SUCCESS; -} - diff --git a/LArCalorimeter/LArMonTools/src/LArNoisyROMon.h b/LArCalorimeter/LArMonTools/src/LArNoisyROMon.h deleted file mode 100644 index 9c9edc9392c0df9cf147266ad3fcc15d77a3401a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArNoisyROMon.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArNoisyROMon - * @author Laurent Duflot <duflot at lal.in2p3.fr> - * 2017 : major upgrade/rewriting by B.Trocme (LPSC Grenoble) - */ - -#ifndef LARMONTOOLS_LARNOISYROMON_H -#define LARMONTOOLS_LARNOISYROMON_H - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TrigDecisionTool/TrigDecisionTool.h" -#include "TTree.h" - -#include "Identifier/HWIdentifier.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArRecEvent/LArNoisyROSummary.h" - -#include <string> -#include <array> - -class TH1I_LW; -class TH1F_LW; -class TH2I_LW; -class TH2F_LW; -class LWHist2D; -class LWHist1D; -//class LArOnlineID; -class LArOnlineIDStrHelper; - -class LArNoisyROMon: public ManagedMonitorToolBase -{ -public: - LArNoisyROMon(const std::string& type, - const std::string& name, - const IInterface* parent); - - virtual ~LArNoisyROMon(); - - StatusCode initialize(); - StatusCode finalize(); - StatusCode bookHistograms(); - StatusCode fillHistograms(); - StatusCode checkHists(bool fromFinalize); - StatusCode procHistograms(); - - size_t partitionNumber(const HWIdentifier); - -private: - - struct NoiseTime - { - unsigned int time; - unsigned int time_ns; - UChar_t algo; - }; - NoiseTime m_NoiseTime{}; - TTree* m_NoiseTimeTree; - - struct CandidateMNB - { - unsigned int candidate_MNB_time; - unsigned int candidate_MNB_time_ns; - int n_candidate_MNBTight_FEB; - int n_candidate_MNBTight_PsVeto_FEB; - int n_candidate_MNBLoose_FEB; - std::vector<int>* v_candidate_MNBTightFEB; - std::vector<int>* v_candidate_MNBTight_PsVetoFEB; - std::vector<int>* v_candidate_MNBLooseFEB; - }; - CandidateMNB m_CandidateMNB{}; - TTree* m_CandidateMNBTree; - - struct partitionHistos - { - TH2F_LW* h_NoisyFEBFracPerEvt=nullptr; - TH2F_LW* h_MNBTightFEBFracPerEvt=nullptr; - TH2F_LW* h_MNBTight_PsVetoFEBFracPerEvt=nullptr; - TH2F_LW* h_MNBLooseFEBFracPerEvt=nullptr; - TH2F_LW* h_CandidateMNBTightFEBFracPerEvt=nullptr; - TH2F_LW* h_CandidateMNBTight_PsVetoFEBFracPerEvt=nullptr; - TH2F_LW* h_CandidateMNBLooseFEBFracPerEvt=nullptr; - TH1F_LW* h_NoisyEventFrac=nullptr; - TH1F_LW* h_SaturatedNoisyEventFrac=nullptr; - TH1F_LW* h_MNBTightEventFrac=nullptr; - TH1F_LW* h_MNBTight_PsVetoEventFrac=nullptr; - TH1F_LW* h_MNBLooseEventFrac=nullptr; - // TH1F_LW* h_NoisyWEventFrac=nullptr; - TH1F_LW* h_NoisyEventTimeVetoFrac=nullptr; - TH1F_LW* h_SaturatedNoisyEventTimeVetoFrac=nullptr; - TH1F_LW* h_MNBTightEventTimeVetoFrac=nullptr; - TH1F_LW* h_MNBTight_PsVetoEventTimeVetoFrac=nullptr; - TH1F_LW* h_MNBLooseEventTimeVetoFrac=nullptr; - // TH1F_LW* h_NoisyWEventTimeVetoFrac=nullptr; - TH2I_LW* h_MNBKnownFEB=nullptr; - TH1I_LW* h_NoisyEventTrigger=nullptr; - TH1I_LW* h_NoisyEventTriggerL1=nullptr; - - // this are temporary histogram that never gets normalised - // in 'online' mode they are used to produce regularly the 'Frac' - // histograms - TH2F_LW* h_NoisyFEBPerEvt=nullptr; - TH2F_LW* h_MNBTightFEBPerEvt=nullptr; - TH2F_LW* h_MNBTight_PsVetoFEBPerEvt=nullptr; - TH2F_LW* h_MNBLooseFEBPerEvt=nullptr; - TH2F_LW* h_CandidateMNBTightFEBPerEvt=nullptr; - TH2F_LW* h_CandidateMNBLooseFEBPerEvt=nullptr; - TH1I_LW* h_NoisyEvent=nullptr; - TH1I_LW* h_SaturatedNoisyEvent=nullptr; - TH1I_LW* h_MNBTightEvent=nullptr; - TH1I_LW* h_MNBTight_PsVetoEvent=nullptr; - TH2F_LW* h_CandidateMNBTight_PsVetoFEBPerEvt=nullptr; - TH1I_LW* h_MNBLooseEvent=nullptr; - // TH1I_LW* h_NoisyWEvent=nullptr; - TH1I_LW* h_NoisyEventTimeVeto=nullptr; - TH1I_LW* h_SaturatedNoisyEventTimeVeto=nullptr; - TH1I_LW* h_MNBTightEventTimeVeto=nullptr; - TH1I_LW* h_MNBTight_PsVetoEventTimeVeto=nullptr; - TH1I_LW* h_MNBLooseEventTimeVeto=nullptr; - //TH1I_LW* h_NoisyWEventTimeVeto=nullptr; - }; - - TH1I_LW* m_h_NoisyFEB=nullptr; - TH1I_LW* m_h_LBN=nullptr; - - - void bookPartitionHistos(partitionHistos&, const std::string& name, MonGroup& group, MonGroup& groupfrac, MonGroup& groupfracbin); - static void copyHisto(LWHist2D* from,LWHist2D* to); - static void copyHisto(LWHist1D* from,LWHist1D* to); - - // divide num by denom and store in to, assuming num is a subset of denom - static void divideHisto(LWHist1D* to,LWHist1D* num,LWHist1D* denom); - - // fill histogram of triggers - void fillTriggerHisto(partitionHistos& partition, uint8_t triggerbits, uint8_t L1triggerbits); - - bool m_IsOnline; - bool m_doTrigger; - bool m_storeLooseMNBFEBs; - unsigned int m_eventCounter; - - // partitionHistos m_BarrelA, m_BarrelC, m_EMECA, m_EMECC; - std::vector<partitionHistos> m_partHistos; - - - const LArOnlineID* m_LArOnlineIDHelper; - LArOnlineIDStrHelper* m_strHelper; - ToolHandle<Trig::TrigDecisionTool> m_trigDec; - - - std::string m_NoisyFEBDefStr; - std::string m_MNBTightFEBDefStr; - std::string m_MNBTight_PsVetoFEBDefStr; - std::string m_MNBLooseFEBDefStr; - std::vector<unsigned int> m_knownMNBFEBs; - unsigned int m_BadFEBCut; - - std::vector<std::string> m_EF_NoiseBurst_Triggers; - std::vector<std::string> m_L1_NoiseBurst_Triggers; - unsigned int m_lumi_blocks; - bool m_doHisto; - SG::ReadHandleKey<LArNoisyROSummary> m_inputKey{this, "inputKey", "LArNoisyROSummary"}; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "eventInfoKey", "EventInfo"}; -}; - -inline size_t LArNoisyROMon::partitionNumber(const HWIdentifier hwid) { - - int pn=m_LArOnlineIDHelper->pos_neg(hwid); - if (m_LArOnlineIDHelper->isEMECchannel(hwid)) { - if (pn) - return 0; //positive EMECA side - else - return 3; //negative EMECC side - } - if (m_LArOnlineIDHelper->isEMBchannel(hwid)) { - if (pn) - return 1; //positive EMBA side - else - return 2; //negative EMBC side - } - - return 4;//Anything else -} - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.cxx b/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.cxx deleted file mode 100755 index 9845bb664f16e7329d97aed05c7cd7f7d8cf0ac8..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.cxx +++ /dev/null @@ -1,750 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArOnlineIDStrHelper.cxx -// PACKAGE: LArMonTools -// AUTHOR: Michel Lefebvre -// -// Simple helper that returns string to describe FT/FEB in different styles -// and provides uniform ways to label histograms with FT/FEB names -// -// ******************************************************************** - -#include "Identifier/IdentifierHash.h" -#include "LArIdentifier/LArOnlineID.h" - -#include "LArOnlineIDStrHelper.h" - -#include "TAxis.h" -#include "TH2.h" - - -#include <iostream> -#include <iomanip> -#include <sstream> - - -/*---------------------------------------------------------*/ -LArOnlineIDStrHelper::LArOnlineIDStrHelper(const LArOnlineID* pLArOnlineIDHelper, - NameType defaultNameType) -{ - // keep the LArOnlineIDHelper pointer - m_LArOnlineIDHelper = pLArOnlineIDHelper; - - // set default name type - this->setDefaultNameType(defaultNameType); - - // fill feedthrough experts names vector - this->fillFeedthroughExpertsNames(); - - // fill feb experts names vectors - this->fillFebExpertsNames(); - - // fill feedthrough HWId map, keyed by feedthrough names (all upper case) - this->fillFeedthroughHWIds(); - - // fill feb HWId map, keyed by feb names (all upper case) - this->fillFebHWIds(); -} - -/*---------------------------------------------------------*/ -LArOnlineIDStrHelper::~LArOnlineIDStrHelper() -{ -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::setDefaultNameType(NameType defaultNameType) -{ - // set default name type - // if not valid, use EXPERT as default of defaults - if (defaultNameType <= DEFAULT || defaultNameType >= BEYONDLASTNAMETYPE) { - m_defaultNameType = EXPERTS; // default of defaults! - } else { - m_defaultNameType = defaultNameType; - } -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::nameType_str(NameType nameType) -{ - // get name type string - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - std::string outStr = ""; - if (type == EXPERTS) { - outStr = "EXPERTS"; - } else if (type == EXPERTSCOMPACT) { - outStr = "EXPERTSCOMPACT"; - } else if (type == LARONLINEID) { - outStr = "LARONLINEID"; - } else if (type == LARONLINEIDCOMPACT) { - outStr = "LARONLINEIDCOMPACT"; - } - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::cryostatEnd_str(HWIdentifier id, - NameType nameType) -{ - // return a string for the cryostatEnd - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - std::string outStr = ""; - if (type == EXPERTS || type == LARONLINEID) { - bool sideA = (bool)m_LArOnlineIDHelper->pos_neg(id); - if (m_LArOnlineIDHelper->isEmBarrelOnline(id)) { - outStr = sideA ? "BarrelA" : "BarrelC"; - } else if (m_LArOnlineIDHelper->isEndcapOnline(id)) { - outStr = sideA ? "EndcapA" : "EndcapC"; - } - } else if (type == EXPERTSCOMPACT) { - bool sideA = (bool)m_LArOnlineIDHelper->pos_neg(id); - if (m_LArOnlineIDHelper->isEmBarrelOnline(id)) { - outStr = sideA ? "EMA" : "EMC"; - } else if (m_LArOnlineIDHelper->isEndcapOnline(id)) { - outStr = sideA ? "ECA" : "ECC"; - } - } else if (type == LARONLINEIDCOMPACT) { - IdContext cryostatEndC = m_LArOnlineIDHelper->cryostatEndContext(); - outStr = m_LArOnlineIDHelper->show_to_string(id, &cryostatEndC); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::feedthrough_str(HWIdentifier id, - NameType nameType, - bool noSpaces) -{ - // return a string for a feedthrough - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - if (type == LARONLINEIDCOMPACT) { - IdContext feedthroughC = m_LArOnlineIDHelper->feedthroughContext(); - return m_LArOnlineIDHelper->show_to_string(id, &feedthroughC); - } - - // get the cryostatEnd part - std::string outStr = this->cryostatEnd_str(id, nameType); - - if (type == EXPERTS) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(id); - IdentifierHash feedthroughHash = m_LArOnlineIDHelper->feedthrough_Hash(feedthroughID); - std::string s = (noSpaces) ? "" : " "; - outStr += s + "FT" + m_feedthroughExpertsNames[feedthroughHash]; - } else if (type == EXPERTSCOMPACT) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(id); - IdentifierHash feedthroughHash = m_LArOnlineIDHelper->feedthrough_Hash(feedthroughID); - outStr += m_feedthroughExpertsNames[feedthroughHash]; - } else if (type == LARONLINEID) { - std::string s = (noSpaces) ? "" : " "; - outStr += s + "FT" + LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->feedthrough(id), 2, true); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::feedthroughOnly_str(HWIdentifier id, - NameType nameType) -{ - // return a string for a feedthrough only - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - std::string outStr = ""; - - if (type == EXPERTS || type == EXPERTSCOMPACT) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(id); - IdentifierHash feedthroughHash = m_LArOnlineIDHelper->feedthrough_Hash(feedthroughID); - outStr = m_feedthroughExpertsNames[feedthroughHash]; - } else if (type == LARONLINEID || type == LARONLINEIDCOMPACT) { - outStr = LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->feedthrough(id), 2, true); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::feb_str(HWIdentifier id, - NameType nameType, - bool noSpaces) -{ - // return a string for a feb - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - if (type == LARONLINEIDCOMPACT) { - IdContext febC = m_LArOnlineIDHelper->febContext(); - return m_LArOnlineIDHelper->show_to_string(id, &febC); - } - - // get the cryostatEnd and feedthrough part - std::string outStr = this->feedthrough_str(id, nameType, noSpaces); - - if (type == EXPERTS) { - HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); - IdentifierHash febHash = m_LArOnlineIDHelper->feb_Hash(febID); - std::string s = (noSpaces) ? "" : " "; - outStr += s + m_febExpertsNames[febHash]; - } else if (type == EXPERTSCOMPACT) { - HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); - IdentifierHash febHash = m_LArOnlineIDHelper->feb_Hash(febID); - outStr += m_febExpertsCompactNames[febHash]; - } else if (type == LARONLINEID) { - std::string s = (noSpaces) ? "" : " "; - outStr += s + "Slot" + LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->slot(id), 2, true); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::febOnly_str(HWIdentifier id, - NameType nameType) -{ - // return a string for a feb only - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - std::string outStr = ""; - - if (type == EXPERTS) { - HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); - IdentifierHash febHash = m_LArOnlineIDHelper->feb_Hash(febID); - outStr = m_febExpertsNames[febHash]; - } else if (type == EXPERTSCOMPACT) { - HWIdentifier febID = m_LArOnlineIDHelper->feb_Id(id); - IdentifierHash febHash = m_LArOnlineIDHelper->feb_Hash(febID); - outStr = m_febExpertsCompactNames[febHash]; - } else if (type == LARONLINEID || type == LARONLINEIDCOMPACT) { - outStr = LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->slot(id), 2, true); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::channel_str(HWIdentifier id, - NameType nameType, - bool noSpaces) -{ - // return a string for a channel - - // get the name type - NameType type = (nameType <= DEFAULT || nameType >= BEYONDLASTNAMETYPE) ? m_defaultNameType : nameType; - - if (type == LARONLINEIDCOMPACT) { - IdContext channelC = m_LArOnlineIDHelper->channelContext(); - return m_LArOnlineIDHelper->show_to_string(id, &channelC); - } - - // get the cryostatEnd, feedthrough and feb part - std::string outStr = this->feb_str(id, nameType, noSpaces); - - if (type == EXPERTS || type == LARONLINEID) { - std::string s = (noSpaces) ? "" : " "; - outStr += s + "Channel" + LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->channel(id), 3, true); - } else if (type == EXPERTSCOMPACT) { - outStr += "Ch" + LArOnlineIDStrHelper::int_to_str(m_LArOnlineIDHelper->channel(id), 3, true); - } - - return outStr; -} - -/*---------------------------------------------------------*/ -HWIdentifier -LArOnlineIDStrHelper::feedthrough_id(const std::string& feedthroughName) -{ - // get feedthrough HWId from feedthrough name (case insensitive) - std::map<std::string, HWIdentifier>::iterator iFeed = m_feedthroughHWIds.find(LArOnlineIDStrHelper::str_to_upper(feedthroughName)); - if (iFeed != m_feedthroughHWIds.end()) return iFeed->second; - // invalid name, returns an invalid id - HWIdentifier idInvalid; - idInvalid.clear(); - return idInvalid; -} - -/*---------------------------------------------------------*/ -HWIdentifier -LArOnlineIDStrHelper::feb_id(const std::string& febName) -{ - // get feb HWId from feb name (case insensitive) - std::map<std::string, HWIdentifier>::iterator iFeb = m_febHWIds.find(LArOnlineIDStrHelper::str_to_upper(febName)); - if (iFeb != m_febHWIds.end()) return iFeb->second; - // invalid name, returns an invalid id - HWIdentifier idInvalid; - idInvalid.clear(); - return idInvalid; -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::fillFeedthroughExpertsNames() -{ - // feedthrough experts names (based on baseplane numbers) vector - // From ATL-AP-IN-0003, Numberings for the Barrel Feedthroughs - - // Barrel A and C feedthrough experts names - // indexed by feedthrough number (which starts at 0) - std::vector<std::string> ftBarrelA, ftBarrelC; - ftBarrelA.resize(32); ftBarrelC.resize(32); - ftBarrelA[0] = "01L"; ftBarrelC[0] = "09L"; - ftBarrelA[1] = "02R"; ftBarrelC[1] = "08R"; - ftBarrelA[2] = "02L"; ftBarrelC[2] = "08L"; - ftBarrelA[3] = "03R"; ftBarrelC[3] = "07R"; - ftBarrelA[4] = "03L"; ftBarrelC[4] = "07L"; - ftBarrelA[5] = "04R"; ftBarrelC[5] = "06R"; - ftBarrelA[6] = "04L"; ftBarrelC[6] = "06L"; - ftBarrelA[7] = "05R"; ftBarrelC[7] = "05R"; - ftBarrelA[8] = "05L"; ftBarrelC[8] = "05L"; - ftBarrelA[9] = "06R"; ftBarrelC[9] = "04R"; - ftBarrelA[10] = "06L"; ftBarrelC[10] = "04L"; - ftBarrelA[11] = "07R"; ftBarrelC[11] = "03R"; - ftBarrelA[12] = "07L"; ftBarrelC[12] = "03L"; - ftBarrelA[13] = "08R"; ftBarrelC[13] = "02R"; - ftBarrelA[14] = "08L"; ftBarrelC[14] = "02L"; - ftBarrelA[15] = "09R"; ftBarrelC[15] = "01R"; - ftBarrelA[16] = "09L"; ftBarrelC[16] = "01L"; - ftBarrelA[17] = "10R"; ftBarrelC[17] = "16R"; - ftBarrelA[18] = "10L"; ftBarrelC[18] = "16L"; - ftBarrelA[19] = "11R"; ftBarrelC[19] = "15R"; - ftBarrelA[20] = "11L"; ftBarrelC[20] = "15L"; - ftBarrelA[21] = "12R"; ftBarrelC[21] = "14R"; - ftBarrelA[22] = "12L"; ftBarrelC[22] = "14L"; - ftBarrelA[23] = "13R"; ftBarrelC[23] = "13R"; - ftBarrelA[24] = "13L"; ftBarrelC[24] = "13L"; - ftBarrelA[25] = "14R"; ftBarrelC[25] = "12R"; - ftBarrelA[26] = "14L"; ftBarrelC[26] = "12L"; - ftBarrelA[27] = "15R"; ftBarrelC[27] = "11R"; - ftBarrelA[28] = "15L"; ftBarrelC[28] = "11L"; - ftBarrelA[29] = "16R"; ftBarrelC[29] = "10R"; - ftBarrelA[30] = "16L"; ftBarrelC[30] = "10L"; - ftBarrelA[31] = "01R"; ftBarrelC[31] = "09R"; - - // Endcap A and C feedthrough experts names, indexed by feedthrough number - std::vector<std::string> ftEndcapA, ftEndcapC; - ftEndcapA.resize(25); ftEndcapC.resize(25); - ftEndcapA[0] = "01R"; ftEndcapC[0] = "07R"; - ftEndcapA[1] = "01L"; ftEndcapC[1] = "07L"; - ftEndcapA[2] = "02R"; ftEndcapC[2] = "06R"; - ftEndcapA[3] = "02L"; ftEndcapC[3] = "06L"; - ftEndcapA[4] = "03R"; ftEndcapC[4] = "05R"; - ftEndcapA[5] = "03L"; ftEndcapC[5] = "05L"; - ftEndcapA[6] = "04R"; ftEndcapC[6] = "04L"; // the FCAL baseplane - ftEndcapA[7] = "05R"; ftEndcapC[7] = "03R"; - ftEndcapA[8] = "05L"; ftEndcapC[8] = "03L"; - ftEndcapA[9] = "06R"; ftEndcapC[9] = "02R"; - ftEndcapA[10] = "06L"; ftEndcapC[10] = "02L"; - ftEndcapA[11] = "07R"; ftEndcapC[11] = "01R"; - ftEndcapA[12] = "07L"; ftEndcapC[12] = "01L"; - ftEndcapA[13] = "08R"; ftEndcapC[13] = "13R"; - ftEndcapA[14] = "08L"; ftEndcapC[14] = "13L"; - ftEndcapA[15] = "09R"; ftEndcapC[15] = "12R"; - ftEndcapA[16] = "09L"; ftEndcapC[16] = "12L"; - ftEndcapA[17] = "10R"; ftEndcapC[17] = "11R"; - ftEndcapA[18] = "10L"; ftEndcapC[18] = "11L"; - ftEndcapA[19] = "11R"; ftEndcapC[19] = "10R"; - ftEndcapA[20] = "11L"; ftEndcapC[20] = "10L"; - ftEndcapA[21] = "12R"; ftEndcapC[21] = "09R"; - ftEndcapA[22] = "12L"; ftEndcapC[22] = "09L"; - ftEndcapA[23] = "13R"; ftEndcapC[23] = "08R"; - ftEndcapA[24] = "13L"; ftEndcapC[24] = "08L"; - - // fill the feedthrough_hash indexed vector of feedthrough experts names - m_feedthroughExpertsNames.resize(m_LArOnlineIDHelper->feedthroughHashMax()); - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feedthrough_begin(); - p != m_LArOnlineIDHelper->feedthrough_end(); ++p) { - HWIdentifier feedthroughID = HWIdentifier(*p); - IdentifierHash feedthroughHash = m_LArOnlineIDHelper->feedthrough_Hash(feedthroughID); - int feedthrough = m_LArOnlineIDHelper->feedthrough(feedthroughID); - bool sideA = (bool)m_LArOnlineIDHelper->pos_neg(feedthroughID); - if (m_LArOnlineIDHelper->isEmBarrelOnline(feedthroughID)) { - m_feedthroughExpertsNames[feedthroughHash] = - (sideA) ? ftBarrelA[feedthrough] : ftBarrelC[feedthrough]; - } else if (m_LArOnlineIDHelper->isEndcapOnline(feedthroughID)) { - m_feedthroughExpertsNames[feedthroughHash] = - (sideA) ? ftEndcapA[feedthrough] : ftEndcapC[feedthrough]; - } - } -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::fillFebExpertsNames() -{ - // feb experts names vectors - // inspired from ATL-A-EN-0001, Cabling of the ATLAS liquid argon calorimeters - - // feb experts names for Barrel feedthroughs - // indexed using slotIndex = slot number - 1 (which starts at 0) - std::vector<std::string> febBarrel, febBarrelCompact; - febBarrel.resize(14); febBarrelCompact.resize(14); - febBarrel[0] = "Presampler"; febBarrelCompact[0] = "Ps"; // slot 1 - febBarrel[1] = "Front0"; febBarrelCompact[1] = "F0"; - febBarrel[2] = "Front1"; febBarrelCompact[2] = "F1"; - febBarrel[3] = "Front2"; febBarrelCompact[3] = "F2"; - febBarrel[4] = "Front3"; febBarrelCompact[4] = "F3"; - febBarrel[5] = "Front4"; febBarrelCompact[5] = "F4"; - febBarrel[6] = "Front5"; febBarrelCompact[6] = "F5"; - febBarrel[7] = "Front6"; febBarrelCompact[7] = "F6"; - febBarrel[8] = "Back0"; febBarrelCompact[8] = "B0"; - febBarrel[9] = "Back1"; febBarrelCompact[9] = "B1"; - febBarrel[10] = "Middle0"; febBarrelCompact[10] = "M0"; - febBarrel[11] = "Middle1"; febBarrelCompact[11] = "M1"; - febBarrel[12] = "Middle2"; febBarrelCompact[12] = "M2"; - febBarrel[13] = "Middle3"; febBarrelCompact[13] = "M3"; - - // feb experts names for Endcap EM Standard feedthroughs - // indexed using slotIndex = slot number - 1 (which starts at 0) - std::vector<std::string> febStd, febStdCompact; - febStd.resize(13); febStdCompact.resize(13); - febStd[0] = "StdPresampler"; febStdCompact[0] = "StdPs"; // slot 1 - febStd[1] = "StdFront0"; febStdCompact[1] = "StdF0"; - febStd[2] = "StdFront1"; febStdCompact[2] = "StdF1"; - febStd[3] = "StdFront2"; febStdCompact[3] = "StdF2"; - febStd[4] = "StdFront3"; febStdCompact[4] = "StdF3"; - febStd[5] = "StdFront4"; febStdCompact[5] = "StdF4"; - febStd[6] = "StdFront5"; febStdCompact[6] = "StdF5"; - febStd[7] = "StdBack0"; febStdCompact[7] = "StdB0"; - febStd[8] = "StdBack1"; febStdCompact[8] = "StdB1"; - febStd[9] = "StdMiddle0"; febStdCompact[9] = "StdM0"; - febStd[10] = "StdMiddle1"; febStdCompact[10] = "StdM1"; - febStd[11] = "StdMiddle2"; febStdCompact[11] = "StdM2"; - febStd[12] = "StdMiddle3"; febStdCompact[12] = "StdM3"; - - // feb experts names for Endcap EM Special feedthroughs - // indexed using slotIndex = slot number - 1 (which starts at 0) - std::vector<std::string> febSpe, febSpeCompact; - febSpe.resize(15); febSpeCompact.resize(15); - febSpe[0] = "SpePresampler"; febSpeCompact[0] = "SpePs"; // slot 1 - febSpe[1] = "SpeFront0"; febSpeCompact[1] = "SpeF0"; - febSpe[2] = "SpeMiddle0"; febSpeCompact[2] = "SpeM0"; - febSpe[3] = "SpeMiddle1"; febSpeCompact[3] = "SpeM1"; - febSpe[4] = "SpeFront1"; febSpeCompact[4] = "SpeF1"; - febSpe[5] = "SpeFront2"; febSpeCompact[5] = "SpeF2"; - febSpe[6] = "SpeFront3"; febSpeCompact[6] = "SpeF3"; - febSpe[7] = "SpeFront4"; febSpeCompact[7] = "SpeF4"; - febSpe[8] = "SpeBack0"; febSpeCompact[8] = "SpeB0"; - febSpe[9] = "SpeMiddle2"; febSpeCompact[9] = "SpeM2"; - febSpe[10] = "SpeMiddle3"; febSpeCompact[10] = "SpeM3"; - febSpe[11] = "SpeFront5"; febSpeCompact[11] = "SpeF5"; - febSpe[12] = "SpeBack1"; febSpeCompact[12] = "SpeB1"; - febSpe[13] = "SpeMiddle4"; febSpeCompact[13] = "SpeM4"; - febSpe[14] = "SpeMiddle5"; febSpeCompact[14] = "SpeM5"; - - // feb experts names for Endcap HEC feedthroughs - // indexed using slotIndex = slot number - 1 (which starts at 0) - std::vector<std::string> febHEC, febHECCompact; - febHEC.resize(10); febHECCompact.resize(10); - febHEC[0] = "EMInner1"; febHECCompact[0] = "EMI1"; // slot 1 - febHEC[1] = "EMInner2"; febHECCompact[1] = "EMI2"; // note: slot 3 and 4 not used - febHEC[4] = "HECL1"; febHECCompact[4] = "HECL1"; - febHEC[5] = "HECL2"; febHECCompact[5] = "HECL2"; - febHEC[6] = "HECM1"; febHECCompact[6] = "HECM1"; - febHEC[7] = "HECM2"; febHECCompact[7] = "HECM2"; - febHEC[8] = "HECH1"; febHECCompact[8] = "HECH1"; - febHEC[9] = "HECH2"; febHECCompact[9] = "HECH2"; - - // feb experts names for Endcap FCAL feedthroughs - // indexed using slotIndex = slot number - 1 (which starts at 0) - std::vector<std::string> febFCal; - febFCal.resize(15); - febFCal[0] = "FCal100"; // slot 1 - febFCal[1] = "FCal101"; - febFCal[2] = "FCal102"; - febFCal[3] = "FCal103"; - febFCal[4] = "FCal104"; - febFCal[5] = "FCal105"; - febFCal[6] = "FCal106"; - febFCal[7] = "Slot08"; // note: slot 8 not used, but valid feb number! - febFCal[8] = "FCal107"; - febFCal[9] = "FCal200"; - febFCal[10] = "FCal201"; - febFCal[11] = "FCal202"; - febFCal[12] = "FCal203"; - febFCal[13] = "FCal300"; - febFCal[14] = "FCal301"; - - // fill the feb_hash indexed vector of feb experts names - m_febExpertsNames.resize(m_LArOnlineIDHelper->febHashMax()); - m_febExpertsCompactNames.resize(m_LArOnlineIDHelper->febHashMax()); - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feb_begin(); - p != m_LArOnlineIDHelper->feb_end(); ++p) { - HWIdentifier febID = HWIdentifier(*p); - IdentifierHash febHash = m_LArOnlineIDHelper->feb_Hash(febID); - int slot = m_LArOnlineIDHelper->slot(febID); // starts at 1 - int slotIndex = slot - 1; // starts at 0 - if (m_LArOnlineIDHelper->isEmBarrelOnline(febID)) { - m_febExpertsNames[febHash] = febBarrel[slotIndex]; - m_febExpertsCompactNames[febHash] = febBarrelCompact[slotIndex]; - } else if (m_LArOnlineIDHelper->isEmEndcapStandardOnline(febID)) { - m_febExpertsNames[febHash] = febStd[slotIndex]; - m_febExpertsCompactNames[febHash] = febStdCompact[slotIndex]; - } else if (m_LArOnlineIDHelper->isEmEndcapSpecialOnline(febID)) { - m_febExpertsNames[febHash] = febSpe[slotIndex]; - m_febExpertsCompactNames[febHash] = febSpeCompact[slotIndex]; - } else if (m_LArOnlineIDHelper->isHecOnlineFebId(febID)) { - m_febExpertsNames[febHash] = febHEC[slotIndex]; - m_febExpertsCompactNames[febHash] = febHECCompact[slotIndex]; - } else if (m_LArOnlineIDHelper->isFcalOnline(febID)) { - m_febExpertsNames[febHash] = febFCal[slotIndex]; - m_febExpertsCompactNames[febHash] = febFCal[slotIndex]; - } - } -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::fillFeedthroughHWIds() -{ - // fill feedthrough HWId map, keyed by feedthrough names (all upper case) - - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feedthrough_begin(); - p != m_LArOnlineIDHelper->feedthrough_end(); ++p) { - HWIdentifier feedthroughID = HWIdentifier(*p); - std::string feedthroughNameUpper; - feedthroughNameUpper = str_to_upper(this->feedthrough_str(feedthroughID, EXPERTS)); - m_feedthroughHWIds[feedthroughNameUpper] = feedthroughID; - // std::cout << this->feedthrough_str(feedthroughID, EXPERTS) << " " << feedthroughNameUpper << std::endl; - feedthroughNameUpper = str_to_upper(this->feedthrough_str(feedthroughID, EXPERTSCOMPACT)); - m_feedthroughHWIds[feedthroughNameUpper] = feedthroughID; - feedthroughNameUpper = str_to_upper(this->feedthrough_str(feedthroughID, LARONLINEID)); - m_feedthroughHWIds[feedthroughNameUpper] = feedthroughID; - feedthroughNameUpper = str_to_upper(this->feedthrough_str(feedthroughID, LARONLINEIDCOMPACT)); - m_feedthroughHWIds[feedthroughNameUpper] = feedthroughID; - } -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::fillFebHWIds() -{ - // fill feb HWId map, keyed by feb names (all upper case) - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feb_begin(); - p != m_LArOnlineIDHelper->feb_end(); ++p) { - HWIdentifier febID = HWIdentifier(*p); - std::string febNameUpper; - febNameUpper = str_to_upper(this->feb_str(febID, EXPERTS)); - m_febHWIds[febNameUpper] = febID; - // std::cout << this->feb_str(febID, EXPERTS) << " " << febNameUpper << std::endl; - febNameUpper = str_to_upper(this->feb_str(febID, EXPERTSCOMPACT)); - m_febHWIds[febNameUpper] = febID; - febNameUpper = str_to_upper(this->feb_str(febID, LARONLINEID)); - m_febHWIds[febNameUpper] = febID; - febNameUpper = str_to_upper(this->feb_str(febID, LARONLINEIDCOMPACT)); - m_febHWIds[febNameUpper] = febID; - } -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::int_to_str(int n, int width, bool leadingZeros) -{ - // integer to string converter - // width <= 0 means no setw used and no leading zeros - - std::ostringstream o; - if (width <= 0) { - o << n; - } else { - if (leadingZeros) { - o << std::setfill('0') << std::setw(width) << n; - } else { - o << std::setw(width) << n; - } - } - - return o.str(); -} - -/*---------------------------------------------------------*/ -std::string -LArOnlineIDStrHelper::str_to_upper(std::string stringToConvert) -{ - // convert a string to an all upper case string - for (unsigned int i = 0; i < stringToConvert.size(); i++) { - stringToConvert[i] = toupper(stringToConvert[i]); - } - return stringToConvert; -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::setAxisBinLabelsFeedthroughs(TAxis* axis, const std::string& detector) -{ - // set the axis bin labels for a feedthrough axis - // see setAxisBinLabelsFeedthroughNames - - this->setAxisBinLabelsFeedthroughNames(axis, detector, false); -} - -/*---------------------------------------------------------*/ -void -LArOnlineIDStrHelper::test() -{ - std::ios_base::fmtflags coutflags = std::cout.flags(); - std::cout << "LArOnlineIDStrHelper: Default name type = " - << this->nameType_str(m_defaultNameType) << std::endl; - - std::cout << "Feedthroughs" << std::endl; - std::cout << "HWId EXPERTS EXPERTSCOMPACT LARONLINEID LARONLINEIDCOMPACT" << std::endl; - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feedthrough_begin(); - p != m_LArOnlineIDHelper->feedthrough_end(); ++p) { - HWIdentifier feedthroughID = HWIdentifier(*p); - std::string nameEXPERTS = this->feedthrough_str(feedthroughID, EXPERTS); - std::string nameEXPERTSCOMPACT = this->feedthrough_str(feedthroughID, EXPERTSCOMPACT); - std::string nameLARONLINEID = this->feedthrough_str(feedthroughID, LARONLINEID); - std::string nameLARONLINEIDCOMPACT = this->feedthrough_str(feedthroughID, LARONLINEIDCOMPACT); - std::string nameOnlyEXPERTS = this->feedthroughOnly_str(feedthroughID, EXPERTS); - std::string nameOnlyLARONLINEID = this->feedthroughOnly_str(feedthroughID, LARONLINEID); - HWIdentifier idEXPERTS = this->feedthrough_id(nameEXPERTS); - HWIdentifier idEXPERTSCOMPACT = this->feedthrough_id(nameEXPERTSCOMPACT); - HWIdentifier idLARONLINEID = this->feedthrough_id(nameLARONLINEID); - HWIdentifier idLARONLINEIDCOMPACT = this->feedthrough_id(nameLARONLINEIDCOMPACT); - std::stringstream coutx; - if (idEXPERTS == feedthroughID - && idEXPERTSCOMPACT == feedthroughID - && idLARONLINEID == feedthroughID - && idLARONLINEIDCOMPACT == feedthroughID) - { - coutx << std::setw(11) << std::left << std::hex << feedthroughID << std::dec - << std::setw(15) << nameEXPERTS - << std::setw(9) << nameEXPERTSCOMPACT - << std::setw(14) << nameLARONLINEID - << std::setw(13) << nameLARONLINEIDCOMPACT - << std::setw(4) << nameOnlyEXPERTS - << std::setw(3) << nameOnlyLARONLINEID - << std::endl; - } else { - coutx << "Bad HWId extraction for " << nameEXPERTS << ", " << idEXPERTS << std::endl; - } - std::cout<<coutx.str(); - } - - std::cout << "Febs" << std::endl; - std::cout << "HWId EXPERTS EXPERTSCOMPACT LARONLINEID LARONLINEIDCOMPACT" << std::endl; - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feb_begin(); - p != m_LArOnlineIDHelper->feb_end(); ++p) { - HWIdentifier febID = HWIdentifier(*p); - std::string nameEXPERTS = this->feb_str(febID, EXPERTS); - std::string nameEXPERTSCOMPACT = this->feb_str(febID, EXPERTSCOMPACT); - std::string nameLARONLINEID = this->feb_str(febID, LARONLINEID); - std::string nameLARONLINEIDCOMPACT = this->feb_str(febID, LARONLINEIDCOMPACT); - std::string nameOnlyEXPERTS = this->febOnly_str(febID, EXPERTS); - std::string nameOnlyEXPERTSCOMPACT = this->febOnly_str(febID, EXPERTSCOMPACT); - std::string nameOnlyLARONLINEID = this->febOnly_str(febID, LARONLINEID); - HWIdentifier idEXPERTS = this->feb_id(nameEXPERTS); - HWIdentifier idEXPERTSCOMPACT = this->feb_id(nameEXPERTSCOMPACT); - HWIdentifier idLARONLINEID = this->feb_id(nameLARONLINEID); - HWIdentifier idLARONLINEIDCOMPACT = this->feb_id(nameLARONLINEIDCOMPACT); - if (idEXPERTS == febID - && idEXPERTSCOMPACT == febID - && idLARONLINEID == febID - && idLARONLINEIDCOMPACT == febID) - { - std::cout << std::setw(11) << std::left << std::hex << febID << std::dec - << std::setw(28) << nameEXPERTS - << std::setw(17) << nameEXPERTSCOMPACT - << std::setw(22) << nameLARONLINEID - << std::setw(16) << nameLARONLINEIDCOMPACT - << std::setw(15) << nameOnlyEXPERTS - << std::setw(8) << nameOnlyEXPERTSCOMPACT - << std::setw(3) << nameOnlyLARONLINEID - << std::endl; - } else { - std::cout << "Bad HWId extraction for " << nameEXPERTS << ", " << idEXPERTS << std::endl; - } - } - - std::cout << "A few channels" << std::endl; -// int barrel_ec = 1; // endcap -// int pos_neg = 1; // A side -// int feedthrough = 6; // start at 0; 6 is FCal -// int slot = 14; // start at 1; 15 is where the FCal ID bug is - int barrel_ec = 0; // barrel - int pos_neg = 0; // C side - int feedthrough = 4; // start at 0 - int slot = 1; // start at 1 - std::vector<int> channels; - channels.push_back(5); - channels.push_back(10); - channels.push_back(105); - std::cout << "HWId EXPERTS" << std::endl; - for (int j = 0; j < (int)channels.size(); ++j) { - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(barrel_ec, pos_neg, feedthrough, slot, channels[j]); - std::cout << std::setw(11) << std::left << std::hex << id << std::dec - << this->channel_str(id, EXPERTS) << " " - << this->feb_str(id, EXPERTS) << " " - << this->feedthrough_str(id, EXPERTS) << " " - << this->cryostatEnd_str(id, EXPERTS) << " " - << " febHash = " << m_LArOnlineIDHelper->feb_Hash(id) - << std::endl; - } - std::cout << "HWId EXPERTSCOMPACT" << std::endl; - for (int j = 0; j < (int)channels.size(); ++j) { - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(barrel_ec, pos_neg, feedthrough, slot, channels[j]); - std::cout << std::setw(11) << std::left << std::hex << id << std::dec - << this->channel_str(id, EXPERTSCOMPACT) << " " - << this->feb_str(id, EXPERTSCOMPACT) << " " - << this->feedthrough_str(id, EXPERTSCOMPACT) << " " - << this->cryostatEnd_str(id, EXPERTSCOMPACT) - << std::endl; - } - std::cout << "HWId LARONLINEID" << std::endl; - for (int j = 0; j < (int)channels.size(); ++j) { - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(barrel_ec, pos_neg, feedthrough, slot, channels[j]); - std::cout << std::setw(11) << std::left << std::hex << id << std::dec - << this->channel_str(id, LARONLINEID) << " " - << this->feb_str(id, LARONLINEID) << " " - << this->feedthrough_str(id, LARONLINEID) << " " - << this->cryostatEnd_str(id, LARONLINEID) - << std::endl; - } - std::cout << "HWId LARONLINEIDCOMPACT" << std::endl; - for (int j = 0; j < (int)channels.size(); ++j) { - HWIdentifier id = m_LArOnlineIDHelper->channel_Id(barrel_ec, pos_neg, feedthrough, slot, channels[j]); - std::cout << std::setw(11) << std::left << std::hex << id << std::dec - << this->channel_str(id, LARONLINEIDCOMPACT) << " " - << this->feb_str(id, LARONLINEIDCOMPACT) << " " - << this->feedthrough_str(id, LARONLINEIDCOMPACT) << " " - << this->cryostatEnd_str(id, LARONLINEIDCOMPACT) - << std::endl; - } - - std::cout << "Id searches" << std::endl; - std::vector<std::string> febNames; - febNames.emplace_back("banana"); - febNames.emplace_back("BarrelCFT09LMiddle3"); - febNames.emplace_back("BarrelCfT09Lmiddle3"); - for (std::vector<std::string>::iterator it = febNames.begin(); it != febNames.end(); ++it) { - std::string febName = *it; - HWIdentifier febID = this->feb_id(febName); - if (febID.is_valid()) { - std::cout << febName << " has valid feb id = " << std::hex << febID << std::dec << std::endl; - } else { - std::cout << febName << " has invalid feb id = " << std::hex << febID << std::dec << std::endl; - } - } - std::cout.flags( coutflags ); -} - diff --git a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.h b/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.h deleted file mode 100755 index 2839184e46bb84239d1213546d811b2649dc6cfb..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @class LArOnlineIDStrHelper - * @author Michel Lefebvre <lefebvre@uvic.ca> - * @date 09-March-2006 - * @brief Helper class to manipulate strings for LArOnlineID names - * - * Helper class to manipulate strings for LArOnlineID names: - * cryostatEnd, feedthroug, feb, channel, partition names - * Four different types of names are supported: see enum NameType below */ - -#ifndef LARMONTOOLS_LARONLINEIDSTRHELPER_H -#define LARMONTOOLS_LARONLINEIDSTRHELPER_H - -#include "Identifier/HWIdentifier.h" - -#include <vector> -#include <string> -#include <map> - -class LArOnlineID; -class TAxis; -class TH2; - -//NB: Some methods are templated to support both ROOT and LW hists - - -class LArOnlineIDStrHelper -{ - public: - /** @brief enum of name types */ - enum NameType { // example for feb id 38008000 - DEFAULT = 0, // must be min - EXPERTS = 1, // BarrelCFT09LFront0 - EXPERTSCOMPACT = 2, // EMC09LF0 - LARONLINEID = 3, // BarrelCFT00Slot02 - LARONLINEIDCOMPACT = 4, // [4.4.0.0.0.2] - BEYONDLASTNAMETYPE = 5 // must be max - }; - - /** @brief constructructor */ - LArOnlineIDStrHelper(const LArOnlineID* pLArOnlineIDHelper, - NameType defaultNameType = EXPERTS); - - /** @brief default destructor */ - ~LArOnlineIDStrHelper(); - - /** @brief set default name type */ - void setDefaultNameType(NameType defaultNameType); - - /** @brief name type string */ - std::string nameType_str(NameType nameType); - - /** @brief get cryostatEnd name */ - std::string cryostatEnd_str(HWIdentifier id, - NameType nameType = DEFAULT); - - /** @brief get feedthrough name, as BarrelCFT09L or BarrelCFT00*/ - std::string feedthrough_str(HWIdentifier id, - NameType nameType = DEFAULT, - bool noSpaces = true); - - /** @brief get feedthrough only name, as 09L or 00*/ - std::string feedthroughOnly_str(HWIdentifier id, - NameType nameType = DEFAULT); - - /** @brief get feb name */ - std::string feb_str(HWIdentifier id, - NameType nameType = DEFAULT, - bool noSpaces = true); - - /** @brief get feb only name, as Presampler, or Ps, or 01 */ - std::string febOnly_str(HWIdentifier id, - NameType nameType = DEFAULT); - - /** @brief get channel name */ - std::string channel_str(HWIdentifier id, - NameType nameType = DEFAULT, - bool noSpaces = true); - - /** @brief get feedthrough HWId from feedthrough name (case insensitive)*/ - HWIdentifier feedthrough_id(const std::string& feedthroughName); - - /** @brief get feb HWId from feb name (case insensitive)*/ - HWIdentifier feb_id(const std::string& febName); - - /** @brief set the axis bin labels for a feedthrough axis*/ - // labels are feedthrough expert names associated to the relavant feedthroughs - // works also for variable bin sizes - // possible detector strings (not case sensitive) - // BARRELA, BARRELC, EMBA (EMA), EMBC (EMC) - // ENDCAPA, ENDCAPC, EMECA (ECA), EMECC (ECC), HECA, HECC, FCALA, FCALC - void setAxisBinLabelsFeedthroughs(TAxis* axis, - const std::string& detector); - - /** @brief set the axis bin labels for an all Febs feb axis*/ - // labels are feedthrough expert names associated to the first relevant feb in a feedthrough - // works also for variable bin sizes - // possible detector strings (not case sensitive) - // BARRELA, BARRELC, EMBA (EMA), EMBC (EMC) - // ENDCAPA, ENDCAPC, EMECA (ECA), EMECC (ECC), HECA, HECC, FCALA, FCALC - template<class Taxis> - void setAxisBinLabelsAllFebs(Taxis* axis, - const std::string& detector); - - /** @brief set the axis bin labels for a feb axis*/ - // labels are experts compact feb names for the desired feedthrough - // works also for variable bin sizes - template<class Taxis> - void setAxisBinLabelsFebs(Taxis* axis, - HWIdentifier feedthroughID); - - - template<class THist2D> - StatusCode definePartitionSummProp(THist2D* hist,bool HWNaming = false); - template<class THist2D> - StatusCode definePartitionSummProp2(THist2D* hist,bool HWNaming = false); - - /** @brief test function for this class */ - void test(); - - private: - - // preclude the use of the default constructor - LArOnlineIDStrHelper() {}; - - // fill feedthrough experts names vector - void fillFeedthroughExpertsNames(); - - // fill feb experts names vectors - void fillFebExpertsNames(); - - // fill feedthrough HWId map, keyed by feedthrough names (all upper case) - void fillFeedthroughHWIds(); - - // fill feb HWId map, keyed by feb names (all upper case) - void fillFebHWIds(); - - // set axis bin labels with feedthrough names - // common code for setAxisBinLabelsAllfebs and setAxisBinLabelsFeedthroughs - template<class Taxis> - void setAxisBinLabelsFeedthroughNames(Taxis* axis, - const std::string& detector, - bool allFebs = false); - - // integer to string converter - // width <= 0 means no setw used and no leading zeros - static std::string int_to_str(int n, int width = 0, bool leadingZeros = false); - - // convert a string to an all upper case string - static std::string str_to_upper(std::string stringToConvert); - - //FindFixBin which works for both root and LW hists: - template<class Taxis> - int findFixBin(Taxis*,const double&) const; - - // service - const LArOnlineID* m_LArOnlineIDHelper; - - // keep track of default name type - NameType m_defaultNameType; - - // feedthrough experts name string vector, indexed with feedthrough_hash - std::vector<std::string> m_feedthroughExpertsNames; // as 09L - - // feb experts name string vector, indexed with feb_hash - std::vector<std::string> m_febExpertsNames; - std::vector<std::string> m_febExpertsCompactNames; - - // feedthrough HWId map, keyex with feedthrough names of all types - std::map<std::string, HWIdentifier> m_feedthroughHWIds; - - // feb HWId map, keyex with feb names of all types - std::map<std::string, HWIdentifier> m_febHWIds; - -}; - -#include "LArOnlineIDStrHelper.icc" - -#endif - diff --git a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.icc b/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.icc deleted file mode 100644 index 33f8d78e417e20f6233c4fb96385a9a25d936d14..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArOnlineIDStrHelper.icc +++ /dev/null @@ -1,419 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -#include "LArIdentifier/LArOnlineID.h" -#include "TAxis.h" - -/*---------------------------------------------------------*/ -template<class THist2D> -inline StatusCode -LArOnlineIDStrHelper::definePartitionSummProp(THist2D* hist,bool HWNaming) -// Define the labels for a TH2 with FT on Y axis -// The name of the histogram should contain the name of -// the partition -// Typically used for summary TH2 : (FTs) vs (slots) (1 bin per FEB) -// Beware: bins start at 1, feedthroughs start at 0 -{ - hist->SetMinimum(0); - hist->GetXaxis()->SetTitle("Slot"); - if (HWNaming) hist->GetYaxis()->SetTitle("Half Crate"); - else hist->GetYaxis()->SetTitle("Feedthrough"); - - const unsigned nx(hist->GetNbinsX()); - for (unsigned ix = 1;ix <= nx;ix++) (hist->GetXaxis())->SetBinLabel(ix,Form("%d",ix)); - - if (HWNaming){ - std::string hName = hist->GetName(); - - if ( hName.find("BarrelA",0) != std::string::npos || - hName.find("EMBA",0) != std::string::npos ){ - int barrel_ec = 0; // Barrel - int pos_neg = 1; // A - for (int ft = 0; ft < 32; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "I"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if ( hName.find("BarrelC",0) != std::string::npos || - hName.find("EMBC",0) != std::string::npos ){ - int barrel_ec = 0; // Barrel - int pos_neg = 0; // C - for (int ft = 0; ft < 32; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "H"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if (hName.find("EndcapA",0) != std::string::npos || - hName.find("EmecA",0) != std::string::npos || - hName.find("EMECA",0) != std::string::npos ){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - // select which feedthroughs to have labels for - int ftL[] = {0,1,4,5,6,7,8,11,12,15,16,19,20,23,24}; // 15 labels - for (int i = 0; i < 15; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if (hName.find("HecA",0) != std::string::npos || - hName.find("HECA",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - // select which feedthroughs to have labels for - int ftL[] = {3,10,16,22}; // 4 labels - for (int i = 0; i < 4; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if (hName.find("FcalA",0) != std::string::npos - || hName.find("FCALA",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - int ft = 6; // FCal only feedthrough - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - - if (hName.find("EndcapC",0) != std::string::npos || - hName.find("EmecC",0) != std::string::npos || - hName.find("EMECC",0) != std::string::npos ){ - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - // select which feedthroughs to have labels for - int ftL[] = {0,1,4,5,6,7,8,11,12,15,16,19,20,23,24}; // 15 labels - for (int i = 0; i < 15; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if (hName.find("HecC",0) != std::string::npos || - hName.find("HECC",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - // select which feedthroughs to have labels for - int ftL[] = {3,10,16,22}; // 4 labels - for (int i = 0; i < 4; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - if (hName.find("FcalC",0) != std::string::npos || - hName.find("FCALC",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - int ft = 6; // FCal only feedthrough - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - (hist->GetYaxis())->SetBinLabel(ft+1, label.c_str()); - } - } - - (hist->GetYaxis())->SetLabelSize(0.045); - //Not supported in LWHists: (hist->GetYaxis())->SetTitleOffset(1.2); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -template<class THist2D> -inline StatusCode -LArOnlineIDStrHelper::definePartitionSummProp2(THist2D* hist,bool HWNaming) -// Define the labels for a TH2 with FT+FEB on X axis -// The name of the histogram should contain the name of -// the partition -// Typically used for TH2 (All FEBs) vs (Channels) (1 bin per channel) -// Both slots and bins start at 1 -{ - hist->SetMinimum(0); - if (HWNaming) hist->GetXaxis()->SetTitle("Half Crate(+Slot increasing)"); - else hist->GetXaxis()->SetTitle("Feedthrough(+Slot increasing)"); - hist->GetYaxis()->SetTitle("Channel"); - - std::string hName = hist->GetName(); - - if (hName.find("BarrelA",0) != std::string::npos || - hName.find("EMBA",0) != std::string::npos ){ - int barrel_ec = 0; // Barrel - int pos_neg = 1; // A - for (int ft = 0; ft < 32; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "I"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*14 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("BarrelC",0) != std::string::npos || - hName.find("EMBC",0) != std::string::npos ){ - int barrel_ec = 0; // Barrel - int pos_neg = 0; // C - for (int ft = 0; ft < 32; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "H"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*14 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("EndcapA",0) != std::string::npos || hName.find("EmecA",0) != std::string::npos - || hName.find("EMECA",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - for (int ft = 0; ft < 25; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("HecA",0) != std::string::npos || hName.find("HECA",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - // select which feedthroughs to have labels for - int ftL[] = {3,10,16,22}; // 4 labels - for (int i = 0; i < 4; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("FcalA",0) != std::string::npos){ - int barrel_ec = 1; // Endcap - int pos_neg = 1; // A - int ft = 6; // FCal only feedthrough - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "A"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - - if (hName.find("EndcapC",0) != std::string::npos || - hName.find("EmecC",0) != std::string::npos || - hName.find("EMECC",0)!= std::string::npos) { - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - for (int ft = 0; ft < 25; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("HecC",0) != std::string::npos || hName.find("HECC",0)!= std::string::npos ){ - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - // select which feedthroughs to have labels for - int ftL[] = {3,10,16,22}; // 4 labels - for (int i = 0; i < 4; ++i) { - int ft = ftL[i]; - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - } - - if (hName.find("FcalC",0) != std::string::npos || hName.find("FCALC",0)!= std::string::npos ){ - int barrel_ec = 1; // Endcap - int pos_neg = 0; // C - int ft = 6; // FCal only feedthrough - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - std::string label; - if (HWNaming) label = "C"+this->feedthroughOnly_str(feedthroughID, EXPERTS); - else label = int_to_str(ft); - int bin = ft*15 + 1; // feedthrough label on first slot of desired feedthroughs - (hist->GetXaxis())->SetBinLabel(bin, label.c_str()); - } - - (hist->GetXaxis())->SetLabelSize(0.04); - //Not supported in LWHists: (hist->GetXaxis())->SetTitleOffset(1.5); - - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -/*---------------------------------------------------------*/ -template<class Taxis> -inline void -LArOnlineIDStrHelper::setAxisBinLabelsFebs(Taxis* axis, HWIdentifier feedthroughID) -{ - // labels are experts compact feb names for the desired feedthrough - - int nSlots = (m_LArOnlineIDHelper->isEmBarrelOnline(feedthroughID)) ? 14 : 15; - int nBins = axis->GetNbins(); - if (nSlots > nBins) nSlots = nBins; - bool changeAxis = false; - - // loop over all febs and look for matching feedthrough - // slow, but ensures blank fields for unused slots - for (std::vector<HWIdentifier>::const_iterator p = m_LArOnlineIDHelper->feb_begin(); - p != m_LArOnlineIDHelper->feb_end(); ++p) { - HWIdentifier febID = HWIdentifier(*p); - if (m_LArOnlineIDHelper->feedthrough_Id(febID) == feedthroughID) { - int slot = m_LArOnlineIDHelper->slot(febID); - if (slot <= nSlots) { - std::string label = this->febOnly_str(febID, EXPERTSCOMPACT); - axis->SetBinLabel(slot, label.c_str()); // slots and bins start at 1 - changeAxis = true; - } - } - } - - if (changeAxis) { - axis->SetLabelSize(0.045); - //Not supported in LWHists: axis->SetTitleOffset(1.2); - } - -} - -/*---------------------------------------------------------*/ -template<class Taxis> -inline void -LArOnlineIDStrHelper::setAxisBinLabelsAllFebs(Taxis* axis, const std::string& detector) -{ - // set the axis bin labels of an all febs axis with feedthrough names - // see setAxisBinLabelsFeedthroughNames - - this->setAxisBinLabelsFeedthroughNames(axis, detector, true); -} - -/*---------------------------------------------------------*/ -template<class Taxis> -inline int LArOnlineIDStrHelper::findFixBin(Taxis*a,const double& x) const { return a->FindBin(x); }//LWHists never rebin (unless root backed) -template<> -inline int LArOnlineIDStrHelper::findFixBin(TAxis*a,const double& x) const { return a->FindFixBin(x); }//Root specialisation - -/*---------------------------------------------------------*/ -template<class Taxis> -inline void -LArOnlineIDStrHelper::setAxisBinLabelsFeedthroughNames(Taxis* axis, const std::string& detector, bool allFebs) -{ - // set the axis bin labels with feedthrough names - // for feedthrough axis: labels are feedthrough expert names associated to the relavant feedthroughs - // for all febs axis: labels are feedthrough expert names associated to the first relevant feb in a feedthrough - // works also for variable bin sizes - // possible detector strings (not case sensitive) - // BARRELA, BARRELC, EMBA (EMA), EMBC (EMC) - // ENDCAPA, ENDCAPC, EMECA (ECA), EMECC (ECC), HECA, HECC, FCALA, FCALC - - int nBins = axis->GetNbins(); - std::string detStr = this->str_to_upper(detector); - int barrel_ec = -1 ; // invalid value - - if (detStr == "BARRELA" || detStr == "EMBA" || detStr == "EMA" || - detStr == "BARRELC" || detStr == "EMBC" || detStr == "EMC") { - barrel_ec = 0; // Barrel - int pos_neg = (detStr == "BARRELA" || detStr == "EMBA" || detStr == "EMA") ? 1 : 0; // 0=C, 1=A - for (int ft = 0; ft < 32; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - int x = (allFebs) ? ft*14 + 1 : ft; // allFebs: feedthrough label on first slot of desired feedthroughs - int bin = findFixBin(axis,x); - if (bin > 0 && bin <= nBins) { - std::string label = this->feedthroughOnly_str(feedthroughID, m_defaultNameType); - axis->SetBinLabel(bin, label.c_str()); - } - } - } else if (detStr == "ENDCAPA" || detStr == "ENDCAPC") { - barrel_ec = 1; // Endcap - int pos_neg = (detStr == "ENDCAPA") ? 1 : 0; // 0=C, 1=A - for (int ft = 0; ft < 25; ++ft) { - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - int x = (allFebs) ? ft*15 + 1 : ft; // allFebs: feedthrough label on first slot of desired feedthroughs - int bin = findFixBin(axis,x); - if (bin > 0 && bin <= nBins) { - std::string label = this->feedthroughOnly_str(feedthroughID, m_defaultNameType); - axis->SetBinLabel(bin, label.c_str()); - } - } - } else if (detStr == "EMECA" || detStr == "ECA" || - detStr == "EMECC" || detStr == "ECC") { - barrel_ec = 1; // Endcap - int pos_neg = (detStr == "EMECA" || detStr == "ECA") ? 1 : 0; // 0=C, 1=A - for (int ft = 0; ft < 25; ++ft) { - // select which feedthroughs to have labels for - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - // emec standard or emec special or HEC feedthrough - // the first slot of all these feedthroughs is an EMEC slot - if (m_LArOnlineIDHelper->isEmEndcapOnline(feedthroughID) || m_LArOnlineIDHelper->isHecOnline(feedthroughID)) { - int x = (allFebs) ? ft*15 + 1 : ft; // allFebs: feedthrough label on first slot of desired feedthroughs - int bin = findFixBin(axis,x); - if (bin > 0 && bin <= nBins) { - std::string label = this->feedthroughOnly_str(feedthroughID, m_defaultNameType); - axis->SetBinLabel(bin, label.c_str()); - } - } - } - } else if (detStr == "HECA" || detStr == "HECC") { - barrel_ec = 1; // Endcap - int pos_neg = (detStr == "HECA") ? 1 : 0; // 0=C, 1=A - for (int ft = 0; ft < 25; ++ft) { - // select which feedthroughs to have labels for - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - // only select HEC feedthroughs - if (m_LArOnlineIDHelper->isHecOnline(feedthroughID)) { - int x = (allFebs) ? ft*15 + 5 : ft; // allFebs: fifth slot of HEC feedthtoughs is first HEC feb - int bin = findFixBin(axis,x); - if (bin > 0 && bin <= nBins) { - std::string label = this->feedthroughOnly_str(feedthroughID, m_defaultNameType); - axis->SetBinLabel(bin, label.c_str()); - } - } - } - } else if (detStr == "FCALA" || detStr == "FCALC") { - barrel_ec = 1; // Endcap - int pos_neg = (detStr == "FCALA") ? 1 : 0; // 0=C, 1=A - int ft = 6; // FCal only feedthrough - HWIdentifier feedthroughID = m_LArOnlineIDHelper->feedthrough_Id(barrel_ec, pos_neg, ft); - int x = (allFebs) ? ft*15 + 1 : ft; // allFebs: feedthrough label on first slot of desired feedthroughs - int bin = findFixBin(axis,x); - if (bin > 0 && bin <= nBins) { - std::string label = this->feedthroughOnly_str(feedthroughID, m_defaultNameType); - axis->SetBinLabel(bin, label.c_str()); - } - } - - if (barrel_ec >= 0) { - axis->SetLabelSize(0.045); - //axis->SetTitleOffset(1.2); - } - -} diff --git a/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx deleted file mode 100755 index 6846b9ef64e9a7e1edef9a316997476a9d1d3214..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx +++ /dev/null @@ -1,1366 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: LArRODMonTool.cxx -// PACKAGE: LArMonTools -// -// AUTHOR: Mathieu Aurousseau -// -// -// -// ******************************************************************** - -#include "LArRODMonTool.h" -#include "LArOnlineIDStrHelper.h" - -#include "Identifier/IdentifierHash.h" -#include "LArIdentifier/LArOnlineID.h" -#include "CaloIdentifier/CaloCell_ID.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile2D.h" -#include "CaloIdentifier/CaloGain.h" -#include "LArRawEvent/LArDigit.h" -#include "LArRawEvent/LArDigitContainer.h" -#include "LArRawEvent/LArRawChannel.h" -#include "LArRawEvent/LArRawChannelContainer.h" - -#include "LArRawEvent/LArFebHeader.h" - -#include "LArCabling/LArOnOffIdMapping.h" - -#include "CaloDetDescr/CaloDetDescrElement.h" - -#include "AthenaKernel/errorcheck.h" -#include <cmath> - -const unsigned max_dump=100; - -/*---------------------------------------------------------*/ -LArRODMonTool::LArRODMonTool(const std::string& type, - const std::string& name, - const IInterface* parent) - : ManagedMonitorToolBase(type, name, parent), - m_LArOnlineIDHelper(nullptr), - m_counter(0), - m_eventsCounter(0), - m_ndump(0), - m_histos(N_PARTITIONS), - m_errcounters(N_PARTITIONS), - m_BC(0), - m_dumpDigits(false) - -{ - declareProperty("useEvtCounter", m_useEvtCounter = true); - declareProperty("DigitsFileName",m_DigitsFileName = "digits.txt"); - declareProperty("EnergyFileName",m_EnergyFileName = "energy.txt"); - declareProperty("AiFileName",m_AiFileName = "Calib_ai.dat"); - declareProperty("DumpCellsFileName",m_DumpCellsFileName = "dumpCells.txt"); - declareProperty("DoDspTestDump",m_doDspTestDump = false); - declareProperty("DoCellsDump",m_doCellsDump = false); - declareProperty("DoCheckSum",m_doCheckSum = true); - declareProperty("DoRodStatus",m_doRodStatus = true); - declareProperty("PrintEnergyErrors",m_printEnergyErrors = true); - declareProperty("RemoveNoiseBursts",m_removeNoiseBursts = true); - - // Ranges and precisions for energy - declareProperty("ERange0",m_range_E_0 = 8192); - declareProperty("ERange1",m_range_E_1 = 65536); - declareProperty("ERange2",m_range_E_2 = 524288); - declareProperty("ERange3",m_range_E_3 = 4194304); - declareProperty("PrecisionERange0",m_precision_E_0 = 1); - declareProperty("PrecisionERange1",m_precision_E_1 = 8); - declareProperty("PrecisionERange2",m_precision_E_2 = 64); - declareProperty("PrecisionERange3",m_precision_E_3 = 512); - declareProperty("PrecisionERangeMax",m_precision_E_max = 8192); - // Ranges and precisions for time - declareProperty("TRange0",m_range_T_0); - declareProperty("TRange1",m_range_T_1); - declareProperty("TRange2",m_range_T_2); - declareProperty("TRange3",m_range_T_3); - declareProperty("PrecisionTRange0",m_precision_T_0 = 10); - declareProperty("PrecisionTRange1",m_precision_T_1 = 20); - declareProperty("PrecisionTRange2",m_precision_T_2 = 30); - declareProperty("PrecisionTRange3",m_precision_T_3 = 50); - declareProperty("PrecisionTRangeMax",m_precision_T_max = 50); - // Ranges and precisions for quality factor - declareProperty("QRange0",m_range_Q_0); - declareProperty("QRange1",m_range_Q_1); - declareProperty("QRange2",m_range_Q_2); - declareProperty("QRange3",m_range_Q_3); - declareProperty("PrecisionQRange0",m_precision_Q_0 = 1); - declareProperty("PrecisionQRange1",m_precision_Q_1 = 1); - declareProperty("PrecisionQRange2",m_precision_Q_2 = 1); - declareProperty("PrecisionQRange3",m_precision_Q_3 = 1); - declareProperty("PrecisionQRangeMax",m_precision_Q_max = 1); - - declareProperty("OnlineHistorySize",m_history_size = 20); - declareProperty("OnlineHistoryGranularity",m_history_granularity = 5); - - declareProperty("TimeOFCUnitOnline",m_unit_online = 1); - declareProperty("TimeOFCUnitOffline",m_unit_offline = 1); - - declareProperty("TimeOffset",m_timeOffset = 0); - - declareProperty("ADCthreshold",m_adc_th = 50); // Minimal number of ADC amplitude among samples required to compare online/offline - declareProperty("peakTimeCut",m_peakTime_cut = 5.); // Cut on abs(peak time) to compare online/offline (all quantities) - - declareProperty("SkipKnownProblematicChannels",m_skipKnownProblematicChannels = false); - declareProperty("SkipNullPed",m_skipNullPed = false); - declareProperty("SkipNullQT",m_skipNullQT = false); - - declareProperty("Streams",m_streams); - declareProperty("numberOfLB",m_nb_lb = 2000.); - - declareProperty("IsOnline",m_IsOnline = false); //for online/offline histos - - m_count_gain[0]=0; - m_count_gain[1]=0; - m_count_gain[2]=0; - - m_fai = nullptr; - m_fdump = nullptr; - - m_hSummaryErrors_Energy = nullptr; - m_hSummaryErrors_Time = nullptr; - m_hSummaryErrors_Quality = nullptr; - - m_hE_all = nullptr; - m_hT_all = nullptr; - m_hQ_all = nullptr; - - m_hE_ranges_all = nullptr; - - m_hEErrors_LB_part = nullptr; - m_hTErrors_LB_part = nullptr; - m_hQErrors_LB_part = nullptr; - - m_hEErrors_LB_stream = nullptr; - m_hTErrors_LB_stream = nullptr; - m_hQErrors_LB_stream = nullptr; - - m_last_lb = -1; - m_curr_lb = -1; - - m_hsize=0; -} - -/*---------------------------------------------------------*/ -LArRODMonTool::~LArRODMonTool() -{ -} - -/*---------------------------------------------------------*/ -StatusCode -LArRODMonTool::initialize() { - ATH_MSG_VERBOSE( "In LArRODMonTool::initialize() "); - - StatusCode sc = detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID"); - if (sc.isFailure()) { - ATH_MSG_FATAL( "Could not get LArOnlineIDHelper" ); - return sc; - } - - m_dumpDigits=(m_doDspTestDump || m_doCellsDump || (m_adc_th != 0)); - - ATH_CHECK(m_channelKey_fromDigits.initialize()); - ATH_CHECK(m_channelKey_fromBytestream.initialize()); - ATH_CHECK(m_digitContainerKey.initialize()); - ATH_CHECK(m_eventInfoKey.initialize()); - ATH_CHECK(m_febContKey.initialize()); - - ATH_CHECK(m_keyOFC.initialize()); - ATH_CHECK(m_keyShape.initialize()); - ATH_CHECK(m_keyHVScaleCorr.initialize()); - ATH_CHECK(m_keyPedestal.initialize()); - - ATH_CHECK(m_adc2mevKey.initialize()); - - - ATH_CHECK(m_cablingKey.initialize()); - ATH_CHECK(m_caloMgrKey.initialize()); - - /** Get bad-channel mask (only if jO IgnoreBadChannels is true)*/ - ATH_CHECK( m_bcContKey.initialize(m_skipKnownProblematicChannels)); - ATH_CHECK( m_bcMask.buildBitMask(m_problemsToMask,msg())); - - // Open output files for DspTest - if (m_doDspTestDump) { - m_fai = std::fopen(m_AiFileName.c_str(),"w"); - m_fdig.open(m_DigitsFileName.c_str()); - m_fen.open(m_EnergyFileName.c_str()); - } - - // Output file - if (m_doCellsDump) { - m_fdump = std::fopen(m_DumpCellsFileName.c_str(),"w"); - fprintf(m_fdump,"febid "); - fprintf(m_fdump,"channel "); - fprintf(m_fdump,"CellID "); - fprintf(m_fdump,"slot "); - fprintf(m_fdump,"FT "); - fprintf(m_fdump,"barrel_ec "); - fprintf(m_fdump,"posneg "); - fprintf(m_fdump,"partition "); - // fprintf(m_fdump,"eta "); - //fprintf(m_fdump,"phi "); - fprintf(m_fdump,"gain "); - //fprintf(m_fdump,"isConnected "); - fprintf(m_fdump,"E_off "); - fprintf(m_fdump,"E_on "); - fprintf(m_fdump,"T_off "); - fprintf(m_fdump,"T_on "); - fprintf(m_fdump,"Q_off "); - fprintf(m_fdump,"Q_on "); - fprintf(m_fdump,"event \n"); - } - - // Time unit : - m_BC = 25000.; // picoseconds - - ATH_MSG_DEBUG("Setting an offset time of " << m_timeOffset << " BC, i.e. " << m_timeOffset*m_BC << " ps"); - - - ManagedMonitorToolBase::initialize().ignore(); - - - if(m_history_granularity <= 0 || m_history_size < 1 ) { - ATH_MSG_ERROR("Wrong history size ("<<m_history_size<<") or granularity ("<<m_history_granularity<<")"); - return StatusCode::FAILURE; - } else { - m_hsize = m_history_size/m_history_granularity; - if (m_hsize < 1){ - ATH_MSG_ERROR("Wrong hsize in initialize"<<m_hsize); - return StatusCode::FAILURE; - } - } - ATH_MSG_INFO("Resetting history size: "<<m_hsize); - m_hdone.assign(m_hsize,false); - return StatusCode::SUCCESS; -} - -/*---------------------------------------------------------*/ -StatusCode -LArRODMonTool::bookHistograms() -{ - ATH_MSG_VERBOSE( "In LArRODMonTool::bookHistograms() "); - - StatusCode sc = StatusCode::SUCCESS; - - // if(isNewRun){ - std::string hName ; - std::string hTitle ; - LArOnlineIDStrHelper strHelper(m_LArOnlineIDHelper); - strHelper.setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - - // EMB A and C - MonGroup generalGroupBarrel( this, "/LAr/DSPMonitoringOldTool/EMB", run, ATTRIB_MANAGED ); - MonGroup generalGroupEndcap( this, "/LAr/DSPMonitoringOldTool/Emec", run, ATTRIB_MANAGED ); - MonGroup generalGroupHec( this, "/LAr/DSPMonitoringOldTool/Hec", run, ATTRIB_MANAGED ); - MonGroup generalGroupFcal( this, "/LAr/DSPMonitoringOldTool/Fcal", run, ATTRIB_MANAGED ); - - m_histos[EMBA].m_partName="EMBA"; - m_histos[EMBA].m_monGroup=&generalGroupBarrel; - - m_histos[EMBC].m_partName="EMBC"; - m_histos[EMBC].m_monGroup=&generalGroupBarrel; - - m_histos[EMECA].m_partName="EMECA"; - m_histos[EMECA].m_monGroup=&generalGroupEndcap; - - m_histos[EMECC].m_partName="EMECC"; - m_histos[EMECC].m_monGroup=&generalGroupEndcap; - - m_histos[HECA].m_partName="HECA"; - m_histos[HECA].m_monGroup=&generalGroupHec; - - m_histos[HECC].m_partName="HECC"; - m_histos[HECC].m_monGroup=&generalGroupHec; - - m_histos[FCALA].m_partName="FcalA"; - m_histos[FCALA].m_monGroup=&generalGroupFcal; - - m_histos[FCALC].m_partName="FcalC"; - m_histos[FCALC].m_monGroup=&generalGroupFcal; - - - for (unsigned p=0;p<N_PARTITIONS;++p) { - HistGroup& hg=m_histos[p]; - const std::string& Part = hg.m_partName; - hName = "DE_" + Part; - hTitle = "E_{offline} - E_{online}-" + Part; - hg.m_hDE = new TH1F(hName.c_str(), hTitle.c_str(),400,-40.,40.); - hg.m_hDE->GetXaxis()->SetTitle("E_{offline} - E_{online}"); - CHECK(hg.m_monGroup->regHist(hg.m_hDE)); - - hName = "DT_" + Part; - hTitle = "T_{offline} - T_{online}-" + Part; - hg.m_hDT = new TH1F(hName.c_str(), hTitle.c_str(),400,-800.,800.); - hg.m_hDT->GetXaxis()->SetTitle("T_{offline} - T_{online}"); - CHECK(hg.m_monGroup->regHist(hg.m_hDT)); - - hName = "DQ_" + Part; - hTitle = "Q_{offline} - Q_{online} / #sqrt{Q_{offline}}-" + Part; - hg.m_hDQ = new TH1F(hName.c_str(), hTitle.c_str(),400,-3000.,1000.); - hg.m_hDQ->GetXaxis()->SetTitle("Q_{offline} - Q_{online} / #sqrt{Q_{offline}}"); - CHECK(hg.m_monGroup->regHist(hg.m_hDQ)); - - hName = "Out_E_FT_vs_SLOT_" + Part; - hTitle = "# of cells with E_{offline} - E_{online} > numerical precision "; - hTitle = hTitle + Part; - hg.m_hOut_E_FT_vs_SLOT = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - hg.m_hOut_E_FT_vs_SLOT->GetXaxis()->SetTitle("Slot"); - hg.m_hOut_E_FT_vs_SLOT->GetYaxis()->SetTitle("Feedthrough"); - sc &= strHelper.definePartitionSummProp(hg.m_hOut_E_FT_vs_SLOT); - CHECK(hg.m_monGroup->regHist(hg.m_hOut_E_FT_vs_SLOT)); - - if(m_IsOnline) { // book shadow histograms for subtracting - hg.m_hOut_E_FT_vs_SLOT_shadow=new TH2F*[m_hsize]; - hName += "_shadow"; - for(int i=0; i<m_hsize; ++i) { - hg.m_hOut_E_FT_vs_SLOT_shadow[i] = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - } - } - - hName = "Out_T_FT_vs_SLOT_" + Part; - hTitle = "# of cells with T_{offline} - T_{online} > numerical precision "; - hTitle = hTitle + Part; - hg.m_hOut_T_FT_vs_SLOT = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - hg.m_hOut_T_FT_vs_SLOT->GetXaxis()->SetTitle("Slot"); - hg.m_hOut_T_FT_vs_SLOT->GetYaxis()->SetTitle("FT"); - sc &= strHelper.definePartitionSummProp(hg.m_hOut_T_FT_vs_SLOT); - CHECK(hg.m_monGroup->regHist(hg.m_hOut_T_FT_vs_SLOT)); - - if(m_IsOnline) { // book shadow histograms for subtracting - hg.m_hOut_T_FT_vs_SLOT_shadow=new TH2F*[m_hsize]; - hName += "_shadow"; - for(int i=0; i<m_hsize; ++i) { - hg.m_hOut_T_FT_vs_SLOT_shadow[i] = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - } - } - - hName = "Out_Q_FT_vs_SLOT_" + Part; - hTitle = "# of cells with Q_{offline} - Q_{online} / #sqrt{Q_{offline}} > numerical precision "; - hTitle = hTitle + Part; - hg.m_hOut_Q_FT_vs_SLOT = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - hg.m_hOut_Q_FT_vs_SLOT->GetXaxis()->SetTitle("Slot"); - hg.m_hOut_Q_FT_vs_SLOT->GetYaxis()->SetTitle("FT"); - sc &= strHelper.definePartitionSummProp(hg.m_hOut_Q_FT_vs_SLOT); - CHECK(hg.m_monGroup->regHist(hg.m_hOut_Q_FT_vs_SLOT)); - - if(m_IsOnline) { // book shadow histograms for subtracting - hg.m_hOut_Q_FT_vs_SLOT_shadow=new TH2F*[m_hsize]; - hName += "_shadow"; - for(int i=0; i<m_hsize; ++i) { - hg.m_hOut_Q_FT_vs_SLOT_shadow[i] = new TH2F(hName.c_str(), hTitle.c_str(),15,0.5,15.5,32,-0.5,31.5); - } - } - - hName = "Eon_VS_Eoff_" + Part; - hTitle = "E_{online} VS E_{offline}-" + Part; - hg.m_hEon_VS_Eoff = new TH2F(hName.c_str(), hTitle.c_str(),300,-20000.,20000.,300,-20000.,20000.); - hg.m_hEon_VS_Eoff->GetXaxis()->SetTitle("E_{offline} (MeV)"); - hg.m_hEon_VS_Eoff->GetYaxis()->SetTitle("E_{online} (MeV)"); - CHECK(hg.m_monGroup->regHist(hg.m_hEon_VS_Eoff)); - - hName = "Ton_VS_Toff_" + Part; - hTitle = "T_{online} VS T_{offline}-" + Part; - hg.m_hTon_VS_Toff = new TH2F(hName.c_str(), hTitle.c_str(),300,-80000.,80000.,300,-80000.,80000.); - hg.m_hTon_VS_Toff->GetXaxis()->SetTitle("T_{offline} (ps)"); - hg.m_hTon_VS_Toff->GetYaxis()->SetTitle("T_{online} (ps)"); - CHECK(hg.m_monGroup->regHist(hg.m_hTon_VS_Toff)); - - hName = "Qon_VS_Qoff_" + Part; - hTitle = "Q_{online} VS Q_{offline}-" + Part; - hg.m_hQon_VS_Qoff = new TH2F(hName.c_str(), hTitle.c_str(),300,0.,66000.,300,0.,66000.); - hg.m_hQon_VS_Qoff->GetXaxis()->SetTitle("Q_{offline}"); - hg.m_hQon_VS_Qoff->GetYaxis()->SetTitle("Q_{online}"); - CHECK(hg.m_monGroup->regHist(hg.m_hQon_VS_Qoff)); - - hName = "Sweet_cells_" + Part; - hTitle = "Number of sweet Cells in LAr" + Part; - hg.m_Sweet = new TH1F(hName.c_str(), hTitle.c_str(),128,-0.5,127.5); - hg.m_Sweet->GetXaxis()->SetTitle("Sweet cells per feb"); - CHECK(hg.m_monGroup->regHist(hg.m_Sweet)); - }//end loop over partitions - - // Summary histogram - MonGroup generalGroup( this, "/LAr/DSPMonitoringOldTool/Summary", run, ATTRIB_MANAGED ); - - hName = "Summary_E"; - hTitle = "Summary of errors on Energy per partition and per gain"; - m_hSummaryErrors_Energy = new TH2F(hName.c_str(),hTitle.c_str(),8,0.,8.,3,0.,3.); - m_hSummaryErrors_Energy->GetXaxis()->SetTitle("Partition"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(1,"EMBC"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(2,"EMBA"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(3,"EMECC"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(4,"EMECA"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(5,"HECC"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(6,"HECA"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(7,"FcalC"); - m_hSummaryErrors_Energy->GetXaxis()->SetBinLabel(8,"FcalA"); - m_hSummaryErrors_Energy->GetYaxis()->SetTitle("Gain"); - m_hSummaryErrors_Energy->GetYaxis()->SetBinLabel(3,"Low Gain"); - m_hSummaryErrors_Energy->GetYaxis()->SetBinLabel(2,"Medium Gain"); - m_hSummaryErrors_Energy->GetYaxis()->SetBinLabel(1,"High Gain"); - CHECK(generalGroup.regHist(m_hSummaryErrors_Energy)); - - hName = "Summary_T"; - hTitle = "Summary of errors on Time per partition and per gain"; - m_hSummaryErrors_Time = new TH2F(hName.c_str(),hTitle.c_str(),8,0.,8.,3,0.,3.); - m_hSummaryErrors_Time->GetXaxis()->SetTitle("Partition"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(1,"EMBC"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(2,"EMBA"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(3,"EMECC"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(4,"EMECA"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(5,"HECC"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(6,"HECA"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(7,"FcalC"); - m_hSummaryErrors_Time->GetXaxis()->SetBinLabel(8,"FcalA"); - m_hSummaryErrors_Time->GetYaxis()->SetTitle("Gain"); - m_hSummaryErrors_Time->GetYaxis()->SetBinLabel(3,"Low Gain"); - m_hSummaryErrors_Time->GetYaxis()->SetBinLabel(2,"Medium Gain"); - m_hSummaryErrors_Time->GetYaxis()->SetBinLabel(1,"High Gain"); - CHECK(generalGroup.regHist(m_hSummaryErrors_Time)); - - hName = "Summary_Q"; - hTitle = "Summary of errors on Quality per partition and per gain"; - m_hSummaryErrors_Quality = new TH2F(hName.c_str(),hTitle.c_str(),8,0.,8.,3,0.,3.); - m_hSummaryErrors_Quality->GetXaxis()->SetTitle("Partition"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(1,"EMBC"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(2,"EMBA"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(3,"EMECC"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(4,"EMECA"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(5,"HECC"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(6,"HECA"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(7,"FcalC"); - m_hSummaryErrors_Quality->GetXaxis()->SetBinLabel(8,"FcalA"); - m_hSummaryErrors_Quality->GetYaxis()->SetTitle("Gain"); - m_hSummaryErrors_Quality->GetYaxis()->SetBinLabel(3,"Low Gain"); - m_hSummaryErrors_Quality->GetYaxis()->SetBinLabel(2,"Medium Gain"); - m_hSummaryErrors_Quality->GetYaxis()->SetBinLabel(1,"High Gain"); - CHECK(generalGroup.regHist(m_hSummaryErrors_Quality)); - - hName = "E_all"; - hTitle = "E_{offline} - E_{online} for all partitions"; - m_hE_all = new TH1F(hName.c_str(),hTitle.c_str(),400,-40.,40.); - m_hE_all->GetXaxis()->SetTitle("E_{offline} - E_{online} (MeV)"); - CHECK(generalGroup.regHist(m_hE_all)); - - hName = "T_all"; - hTitle = "T_{offline} - T_{online} for all partitions"; - m_hT_all = new TH1F(hName.c_str(),hTitle.c_str(),400,-800.,800.); - m_hT_all->GetXaxis()->SetTitle("T_{offline} - T_{online} (ps)"); - CHECK(generalGroup.regHist(m_hT_all)); - - hName = "Q_all"; - hTitle = "Q_{offline} - Q_{online} / #sqrt{Q_{offline}} for all partitions"; - m_hQ_all = new TH1F(hName.c_str(),hTitle.c_str(),400,-3000.,1000.); - m_hQ_all->GetXaxis()->SetTitle("Q_{offline} - Q_{online} / #sqrt{Q_{offline}}"); - CHECK(generalGroup.regHist(m_hQ_all)); - - MonGroup debugGroup( this, "/LAr/DSPMonitoringOldTool/DQMD", run, ATTRIB_MANAGED ); // "shift" SHOULD BE CHANGED do "debug" ? - - for (unsigned p=0;p<N_PARTITIONS;++p) { - HistGroup& hg=m_histos[p]; - const std::string& Part = hg.m_partName; - - hName = "DE_ranges_" + Part; - hTitle = "E_{online} - E_{offline} for all ranges " + Part; - hg.m_hDE_ranges = new TH2F(hName.c_str(), hTitle.c_str(),5000,-515,515,4,0,4); - hg.m_hDE_ranges->GetXaxis()->SetTitle("E_{offline} - E_{online} (MeV)"); - hg.m_hDE_ranges->GetYaxis()->SetTitle("Energy range"); - hg.m_hDE_ranges->GetYaxis()->SetBinLabel(1,"E < 2^{13} MeV"); - hg.m_hDE_ranges->GetYaxis()->SetBinLabel(2,"E < 2^{16} MeV"); - hg.m_hDE_ranges->GetYaxis()->SetBinLabel(3,"E < 2^{19} MeV"); - hg.m_hDE_ranges->GetYaxis()->SetBinLabel(4,"E < 2^{22} MeV"); - CHECK(debugGroup.regHist(hg.m_hDE_ranges)); - }//end loop over partitions - - hName = "E_ranges_all"; - hTitle = "E_{online} - E_{offline} for all ranges and all partitions "; - m_hE_ranges_all = new TH2F(hName.c_str(), hTitle.c_str(),5000,-515,515,4,0,4); - m_hE_ranges_all->GetXaxis()->SetTitle("E_{offline} - E_{online} (MeV)"); - m_hE_ranges_all->GetYaxis()->SetTitle("Energy range"); - m_hE_ranges_all->GetYaxis()->SetBinLabel(1,"E < 2^{13} MeV"); - m_hE_ranges_all->GetYaxis()->SetBinLabel(2,"E < 2^{16} MeV"); - m_hE_ranges_all->GetYaxis()->SetBinLabel(3,"E < 2^{19} MeV"); - m_hE_ranges_all->GetYaxis()->SetBinLabel(4,"E < 2^{22} MeV"); - CHECK(debugGroup.regHist(m_hE_ranges_all)); - - - MonGroup infosGroup( this, "/LAr/DSPMonitoringOldTool/Infos", run, ATTRIB_MANAGED ); - - hName = "EErrorsPerLB"; - std::string cut = "#delta ADC>"+std::to_string(m_adc_th)+" and |t_{offline}| < "+std::to_string(int(m_peakTime_cut))+"ns"; - hTitle = "Nb of errors in E per LB - "+ cut; - m_hEErrors_LB_part = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,8,0,8); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(1,"EMBC"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(2,"EMBA"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(3,"EMECC"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(4,"EMECA"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(5,"HECC"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(6,"HECA"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(7,"FcalC"); - m_hEErrors_LB_part->GetYaxis()->SetBinLabel(8,"FcalA"); - m_hEErrors_LB_part->GetXaxis()->SetTitle("Luminosity Block"); - CHECK(infosGroup.regHist(m_hEErrors_LB_part)); - - hName = "TErrorsPerLB"; - hTitle = "Nb of errors in T per LB - "+cut; - m_hTErrors_LB_part = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,8,0,8); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(1,"EMBC"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(2,"EMBA"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(3,"EMECC"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(4,"EMECA"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(5,"HECC"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(6,"HECA"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(7,"FcalC"); - m_hTErrors_LB_part->GetYaxis()->SetBinLabel(8,"FcalA"); - m_hTErrors_LB_part->GetXaxis()->SetTitle("Luminosity Block"); - CHECK(infosGroup.regHist(m_hTErrors_LB_part)); - - hName = "QErrorsPerLB"; - hTitle = "Nb of errors in Q per LB - "+cut; - m_hQErrors_LB_part = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,8,0,8); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(1,"EMBC"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(2,"EMBA"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(3,"EMECC"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(4,"EMECA"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(5,"HECC"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(6,"HECA"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(7,"FcalC"); - m_hQErrors_LB_part->GetYaxis()->SetBinLabel(8,"FcalA"); - m_hQErrors_LB_part->GetXaxis()->SetTitle("Luminosity Block"); - CHECK(infosGroup.regHist(m_hQErrors_LB_part)); - - int nStreams = m_streams.size(); - - hName = "EErrorsPerLBStream"; - hTitle = "Nb of errors in E per LB and per stream"; - m_hEErrors_LB_stream = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,nStreams+1,0,nStreams+1); - for (int str = 0; str < nStreams; str++) { - char n[50]; - sprintf(n,"%s",m_streams[str].c_str()); - m_hEErrors_LB_stream->GetYaxis()->SetBinLabel(str+1,n); - } - m_hEErrors_LB_stream->GetYaxis()->SetBinLabel(nStreams+1,"others"); - CHECK(infosGroup.regHist(m_hEErrors_LB_stream)); - - hName = "TErrorsPerLBStream"; - hTitle = "Nb of errors in T per LB and per stream"; - m_hTErrors_LB_stream = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,nStreams+1,0,nStreams+1); - for (int str = 0; str < nStreams; str++) { - char n[50]; - sprintf(n,"%s",m_streams[str].c_str()); - m_hTErrors_LB_stream->GetYaxis()->SetBinLabel(str+1,n); - } - m_hTErrors_LB_stream->GetYaxis()->SetBinLabel(nStreams+1,"others"); - CHECK(infosGroup.regHist(m_hTErrors_LB_stream)); - - hName = "QErrorsPerLBStream"; - hTitle = "Nb of errors in Q per LB and per stream"; - m_hQErrors_LB_stream = new TH2I(hName.c_str(), hTitle.c_str(),m_nb_lb,-0.5,m_nb_lb-0.5,nStreams+1,0,nStreams+1); - for (int str = 0; str < nStreams; str++) { - char n[50]; - sprintf(n,"%s",m_streams[str].c_str()); - m_hQErrors_LB_stream->GetYaxis()->SetBinLabel(str+1,n); - } - m_hQErrors_LB_stream->GetYaxis()->SetBinLabel(nStreams+1,"others"); - CHECK(infosGroup.regHist(m_hQErrors_LB_stream)); - // } - - if (sc.isFailure()) { - ATH_MSG_ERROR( "Bookhistograms failed" ); - } - - return sc; - -} - -bool LArRODMonTool::FebStatus_Check() { - m_ignoreFEBs.clear(); - SG::ReadHandle<LArFebHeaderContainer> febCont{m_febContKey}; - if (!febCont.isValid()) { - ATH_MSG_WARNING( "No LArFEB container found in TDS" ); - return false; - } - LArFebHeaderContainer::const_iterator itFEB = febCont->begin(); - LArFebHeaderContainer::const_iterator itFEB_e = febCont->end(); - for ( ; itFEB!=itFEB_e;++itFEB) { - if (((m_doCheckSum && !(*itFEB)->ChecksumVerification())) || - (m_doRodStatus && (*itFEB)->RodStatus()!=0)) - m_ignoreFEBs.insert((*itFEB)->FEBId()); - } - return true; -} - -StatusCode LArRODMonTool::fillHistograms() { - ATH_MSG_VERBOSE( "In LArRODMonTool::fillHistograms()"); - - const EventContext& ctx = Gaudi::Hive::currentContext(); - - // Increment event counter - m_eventsCounter++; - - /* - // Expected precision for energy calculation, depending on energy (ranges) : - // Between -213 and 213 MeV (~ 8 GeV) 2**0=1 MeV precision (range 0) - // Between -216 and 216 MeV (~ 64 GeV) 2**3=8 MeV precision (range 1) - // Between -219 and 219 MeV (~ 512 GeV) 2**6=64 MeV precision (range 2) - // Between -222 and 222 MeV (~ 4 TeV) 2**9=512 MeV precision (range 3) - */ - - SG::ReadHandle<xAOD::EventInfo> thisEventInfo(m_eventInfoKey); - - SG::ReadCondHandle<ILArPedestal> pedestalHdl{m_keyPedestal}; - const ILArPedestal* pedestals=*pedestalHdl; - - m_curr_lb=thisEventInfo->lumiBlock(); - if(m_last_lb < 0) m_last_lb = m_curr_lb; - bool isEventFlaggedByLArNoisyROAlg = false; // keep default as false - bool isEventFlaggedByLArNoisyROAlgInTimeW = false; // keep deault as false - - if ( thisEventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,0) ) { - isEventFlaggedByLArNoisyROAlg = true; - ATH_MSG_DEBUG( " !!! Noisy event found from LArNoisyROAlg !!!" ); - } - - if ( thisEventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,3) ) { - isEventFlaggedByLArNoisyROAlgInTimeW = true; - ATH_MSG_DEBUG( " !!! Noisy event found by LArNoisyROAlg in Time window of 500ms!!!" ); - } - - // Noise bursts cleaning (LArNoisyRO_Std or TimeWindowVeto) added by B.Trocme - 19/7/12 - if (m_removeNoiseBursts && (isEventFlaggedByLArNoisyROAlg || isEventFlaggedByLArNoisyROAlgInTimeW)) return StatusCode::SUCCESS; - - // Retrieve stream info - int nStreams = m_streams.size(); - // if ((nStreams == 1 && m_streams[0] == "all") || nStreams <= 0) selectstreams = false; - - - //Fixme: Use LArTrigStreamMatching also here. - const int streamsize = nStreams + 1; - std::vector<int> hasStream(streamsize,0); - // for (int str = 0; str < nStreams + 1; str++) hasStream[str] = 0; - - bool hasstrlist = false; - const std::vector< xAOD::EventInfo::StreamTag >& evtStreamTags=thisEventInfo->streamTags(); - for (const auto& evtStreamTag : evtStreamTags) { - std::vector<std::string>::const_iterator evtStreamTagIt=std::find(m_streams.begin(),m_streams.end(),evtStreamTag.name()); - if (evtStreamTagIt!=m_streams.end()) { - const unsigned str=evtStreamTagIt-m_streams.begin(); - ATH_MSG_VERBOSE( "Keeping Stream Tag: " << evtStreamTag.type() << "_" << evtStreamTag.name()); - hasStream[str] = 1; - hasstrlist = true; - } - } - if (! hasstrlist) hasStream[nStreams] = 1; - - - /* - if(oldtriggerInfo!= 0){ - std::vector<TriggerInfo::StreamTag> oldstream = oldtriggerInfo->streamTags(); - std::vector<TriggerInfo::StreamTag>::const_iterator oldstreamI = oldstream.begin(); - std::vector<TriggerInfo::StreamTag>::const_iterator oldstreamE = oldstream.end(); - bool hasstrlist = false; - for(;oldstreamI!=oldstreamE; ++oldstreamI){ - ATH_MSG_VERBOSE( "Keeping Stream Tag: " << oldstreamI->type() << "_" << oldstreamI->name()); - for (int str = 0; str < nStreams; str++) { - if (m_streams[str] == oldstreamI->name()) { - hasStream[str] = 1; - hasstrlist = true; - break; - } - } - } - if (! hasstrlist) hasStream[nStreams] = 1; - } - */ - - - SG::ReadHandle<LArRawChannelContainer> rawColl_fromDigits(m_channelKey_fromDigits); - - SG::ReadHandle<LArRawChannelContainer> rawColl_fromBytestream(m_channelKey_fromBytestream); - - SG::ReadHandle<LArDigitContainer> pLArDigitContainer(m_digitContainerKey); - - SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx}; - ATH_CHECK(caloMgrHandle.isValid()); - const CaloDetDescrManager* ddman = *caloMgrHandle; - - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey,ctx}; - const LArOnOffIdMapping* cabling=*cablingHdl; - - SG::ReadCondHandle<ILArOFC> ofcHdl{m_keyOFC,ctx}; - const ILArOFC* ofcs=*ofcHdl; - - SG::ReadCondHandle<ILArShape> shapeHdl{m_keyShape,ctx}; - const ILArShape* shapes=*shapeHdl; - - SG::ReadCondHandle<ILArHVScaleCorr> hvScaleCorrHdl{m_keyHVScaleCorr,ctx}; - const ILArHVScaleCorr* hvScaleCorrs=*hvScaleCorrHdl; - - SG::ReadCondHandle<LArADC2MeV> adc2MeVHdl{m_adc2mevKey,ctx}; - const LArADC2MeV* adc2mev=*adc2MeVHdl; - - - const LArBadChannelCont* bcCont=nullptr; - if (m_skipKnownProblematicChannels) { - SG::ReadCondHandle<LArBadChannelCont> bcContHdl{m_bcContKey}; - bcCont=*bcContHdl; - } - - if (m_doCheckSum || m_doRodStatus) { - FebStatus_Check(); - ATH_MSG_DEBUG("Found " << m_ignoreFEBs.size() << " FEBs with checksum errors or statatus errors. Will ignore these FEBs."); - } - - for (unsigned p=0;p<N_PARTITIONS;++p) - m_errcounters[p].clear(); - - m_errsPerFEB.clear(); - m_errsPerFEB.resize(m_LArOnlineIDHelper->febHashMax(),0); - - const bool ignoreFebs=(!m_ignoreFEBs.empty()); - std::set<HWIdentifier>::const_iterator ignoreFebsEnd=m_ignoreFEBs.end(); - - //Build an assoiciation of channels in the two LArRawChannelContainers. - //The LArRawChannelContainers are unordered collections of LArRawChannels. - //But we know that they have the same order because they were built from the same source (namely the LArDigits and RawChannels in the Bytestream) - //and we know that the LArRawChannels built offline are a subset of the LArRawChannelContainers read from Bytestream. - //Therfore we can search much more efficiently - LArRawChannelContainer::const_iterator rcDigIt=rawColl_fromDigits->begin(); - LArRawChannelContainer::const_iterator rcDigIt_e=rawColl_fromDigits->end(); - LArRawChannelContainer::const_iterator rcBSIt=rawColl_fromBytestream->begin(); - LArRawChannelContainer::const_iterator rcBSIt_e=rawColl_fromBytestream->end(); - - //Loop over indices in LArRawChannelContainer built offline (the small one) - ATH_MSG_DEBUG( "Entering the LArRawChannel loop." ); - - for (;rcDigIt!=rcDigIt_e;++rcDigIt) { - const HWIdentifier idDig=rcDigIt->hardwareID(); - const HWIdentifier febId=m_LArOnlineIDHelper->feb_Id(idDig); - // Check if this FEB should be ignored - if (ignoreFebs) { - if (m_ignoreFEBs.find(febId)!=ignoreFebsEnd) continue; - } - //Check if this is a bad channel - if (m_skipKnownProblematicChannels && m_bcMask.cellShouldBeMasked(bcCont,idDig)) continue; - - //Check pedestal if needed - if (m_skipNullPed) { - const CaloGain::CaloGain gain = rcDigIt->gain(); - const float ped = pedestals->pedestal(idDig,gain); - if(ped <= (1.0+LArElecCalib::ERRORCODE)) continue; - } - - //Now look for corresponding channel in the LArRawChannelContainer read from Bytestream (the big one) - LArRawChannelContainer::const_iterator currIt=rcBSIt; //Remember current position in container - for (;rcBSIt!=rcBSIt_e && rcBSIt->hardwareID() != idDig; ++rcBSIt); - if (rcBSIt==rcBSIt_e) { - ATH_MSG_WARNING( "LArRawChannelContainer not in the expected order. Change of LArByteStream format?" ); - //Wrap-around - for (rcBSIt=rawColl_fromBytestream->begin();rcBSIt!=currIt && rcBSIt->hardwareID() != idDig; ++rcBSIt); - if (rcBSIt==currIt) { - ATH_MSG_ERROR( "Channel " << m_LArOnlineIDHelper->channel_name(idDig) << " not found." ); - return StatusCode::FAILURE; - } - } - - const LArDigit* dig=nullptr; -// For Eon/Eoff dump -// if (m_dumpDigits) { - unsigned index=rcDigIt-rawColl_fromDigits->begin(); - const unsigned digContSize=pLArDigitContainer->size(); - for(;index<digContSize && pLArDigitContainer->at(index)->hardwareID()!=idDig;++index); - if (index==digContSize) { - ATH_MSG_ERROR( "Can't find LArDigit corresponding to channel " << m_LArOnlineIDHelper->channel_name(idDig) << ". Turn off digit dump" ); - closeDumpfiles(); - m_dumpDigits=false; - m_doDspTestDump=false; - m_doCellsDump=false; - } - else{ - dig=pLArDigitContainer->at(index); - } -// } - short minSamples = 4095; - short maxSamples = 0; - if (dig){ - const std::vector<short>& samples=dig->samples(); - for (unsigned int k = 0; k<samples.size(); k++) { - if (samples.at(k) > maxSamples) maxSamples = samples.at(k); - if (samples.at(k) < minSamples) minSamples = samples.at(k); - } - } - - if ((maxSamples-minSamples) > m_adc_th || m_adc_th <= 0) { - compareChannels(ddman, cabling, ofcs, shapes, - hvScaleCorrs, pedestals, adc2mev, - idDig,(*rcDigIt),(*rcBSIt),dig).ignore(); - } - else { - if (dig) ATH_MSG_DEBUG( "Samples : "<< maxSamples << " " << minSamples ); - } - - }//end loop over rawColl_fromDigits - ATH_MSG_DEBUG( "End of rawChannels loop" ); - - if(m_IsOnline && m_last_lb < m_curr_lb && (m_curr_lb - m_last_lb) % m_history_granularity == m_history_granularity -1 ) { // if new LB subtract the old for Out_[E,Q,T]_FT_vs_SLOT - ATH_MSG_INFO( " Last LB: "<<m_last_lb<<" curr. LB: "<<m_curr_lb<<" subtracting histos"); - // subtract all previously not done bins.... - int hbin = (m_curr_lb % m_history_size) / m_history_granularity; - for(int i=0; i<=hbin; ++i) { - if(!m_hdone[i]) { - ATH_MSG_INFO( " Going to subtract and reset the: "<< i << " bin of shadow histo"); - for(unsigned l=0; l<m_histos.size(); ++l) {// go through all histo groups - m_histos[l].m_hOut_E_FT_vs_SLOT->Add(m_histos[l].m_hOut_E_FT_vs_SLOT_shadow[i], -1.); - m_histos[l].m_hOut_E_FT_vs_SLOT_shadow[i]->Reset(); - m_histos[l].m_hOut_Q_FT_vs_SLOT->Add(m_histos[l].m_hOut_Q_FT_vs_SLOT_shadow[i], -1.); - m_histos[l].m_hOut_Q_FT_vs_SLOT_shadow[i]->Reset(); - m_histos[l].m_hOut_T_FT_vs_SLOT->Add(m_histos[l].m_hOut_T_FT_vs_SLOT_shadow[i], -1.); - m_histos[l].m_hOut_T_FT_vs_SLOT_shadow[i]->Reset(); - }// histos.size - m_hdone[i]=true; - } - }// hbin - } - - for (unsigned i=0;i<m_LArOnlineIDHelper->febHashMax();++i) { - const HWIdentifier febid=m_LArOnlineIDHelper->feb_Id(i); - const PARTITION p=getPartition(febid); - m_histos[p].m_Sweet->Fill(m_errsPerFEB[i]); - } - - ERRCOUNTER allEC; - unsigned allErr_E=0; - unsigned allErr_T=0; - unsigned allErr_Q=0; - - for (unsigned g=0;g<3;++g) { - for (unsigned p=0;p<N_PARTITIONS;++p) { - allEC.errors_E[g]+=m_errcounters[p].errors_E[g]; - allEC.errors_T[g]+=m_errcounters[p].errors_T[g]; - allEC.errors_Q[g]+=m_errcounters[p].errors_Q[g]; - } - allErr_E+=allEC.errors_E[g]; - allErr_T+=allEC.errors_T[g]; - allErr_Q+=allEC.errors_Q[g]; - } - - - - if (msgLvl(MSG::VERBOSE)) { - ATH_MSG_VERBOSE( "*Number of errors in Energy Computation : " ); - ATH_MSG_VERBOSE( "* Low Gain : " << MSG::dec << allEC.errors_E[2] << " / " << m_count_gain[2] ); - ATH_MSG_VERBOSE( "* Medium Gain : " << MSG::dec << allEC.errors_E[1] << " / " << m_count_gain[1] ); - ATH_MSG_VERBOSE( "* High Gain : " << MSG::dec << allEC.errors_E[0] << " / " << m_count_gain[0] ); - ATH_MSG_VERBOSE( "*Number of errors in Time Computation : " ); - ATH_MSG_VERBOSE( "* Low Gain : " << MSG::dec << allEC.errors_T[2] << " / " << m_count_gain[2] ); - ATH_MSG_VERBOSE( "* Medium Gain : " << MSG::dec << allEC.errors_T[1] << " / " << m_count_gain[1] ); - ATH_MSG_VERBOSE( "* High Gain : " << MSG::dec << allEC.errors_T[0] << " / " << m_count_gain[0] ); - ATH_MSG_VERBOSE( "*Number of errors in Quality Computation : " << " / " << m_count_gain[2] ); - ATH_MSG_VERBOSE( "* Low Gain : " << MSG::dec << allEC.errors_Q[2] << " / " << m_count_gain[2] ); - ATH_MSG_VERBOSE( "* Medium Gain : " << MSG::dec << allEC.errors_Q[1] << " / " << m_count_gain[1] ); - ATH_MSG_VERBOSE( "* High Gain : " << MSG::dec << allEC.errors_Q[0] << " / " << m_count_gain[0] ); - }// end if verbose - - - for (unsigned p=0;p<N_PARTITIONS;++p) { - unsigned allErrsPartE=0; - unsigned allErrsPartT=0; - unsigned allErrsPartQ=0; - for (unsigned g=0;g<3;++g) { - m_hSummaryErrors_Energy->Fill((float)p,(float)g,(float)m_errcounters[p].errors_E[g]); - m_hSummaryErrors_Time->Fill((float)p,(float)g,(float)m_errcounters[p].errors_T[g]); - m_hSummaryErrors_Quality->Fill((float)p,(float)g,(float)m_errcounters[p].errors_Q[g]); - allErrsPartE+=m_errcounters[p].errors_E[g]; - allErrsPartT+=m_errcounters[p].errors_T[g]; - allErrsPartQ+=m_errcounters[p].errors_Q[g]; - } - m_hEErrors_LB_part->Fill((float)m_curr_lb,(float)p,(float)allErrsPartE); - m_hTErrors_LB_part->Fill((float)m_curr_lb,(float)p,(float)allErrsPartT); - m_hQErrors_LB_part->Fill((float)m_curr_lb,(float)p,(float)allErrsPartQ); - } - - for(int str = 0; str < nStreams + 1; str++) { - if (hasStream[str] == 1) { - m_hEErrors_LB_stream->Fill((float)m_curr_lb,(float)str,(float)allErr_E); - m_hTErrors_LB_stream->Fill((float)m_curr_lb,(float)str,(float)allErr_T); - m_hQErrors_LB_stream->Fill((float)m_curr_lb,(float)str,(float)allErr_Q); - } - } - - if (m_IsOnline && m_curr_lb - m_last_lb >= m_history_size) { - m_last_lb = m_curr_lb; - for(int i=0; i<m_hsize; ++i) m_hdone[i]=false; - } - - return StatusCode::SUCCESS; -} - -void LArRODMonTool::DumpCellEvent(int count, // counter - ILArOFC::OFCRef_t ofc, // vector containing OFC's - ILArOFC::OFCRef_t ofcb, // vector containing OFCb's - ILArShape::ShapeRef_t ofch, // vector containing OFCh's - ILArShape::ShapeRef_t ofcd, // vector containing OFCd's - float Escale, // ADC2MeV factor - float Ramp0, // ramp intercept - float pedestal, // pedestal - const std::vector<short>* digits, // vector containing samples (digits) - int E_off, // Energy calculated offline (i.e. fromDigits) - int E_on, // Energy calculated online (i.e. fromBytestream) - FILE* ofcfile, // output file containing ofc's - std::ofstream& digitsfile, // output file containing digits - std::ofstream& energyfile, // output file containing energies - HWIdentifier chid, // Channel HW ID - int event) // Event # -{ - // Dumping file with coefficients - const int channel=m_LArOnlineIDHelper->channel(chid); - const HWIdentifier febid=m_LArOnlineIDHelper->feb_Id(chid); - ATH_MSG_VERBOSE("Dumping OFC, energies and digits for cell " << channel << " of FEB " << febid); - - float sumai = 0.; - for (unsigned int a = 0; a<ofc.size(); a++) { - sumai += ofc.at(a); - } - float pedplusoffset; - if (Escale*sumai != 0) pedplusoffset = pedestal - Ramp0/(Escale*sumai); - else pedplusoffset = 0; - const float inv_Escale = 1. / Escale; - - fprintf(ofcfile,"\t%d\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\n", - channel, pedestal, pedplusoffset, - ofc.at(0)*Escale, ofc.at(1)*Escale, ofc.at(2)*Escale, ofc.at(3)*Escale, ofc.at(4)*Escale, - ofcb.at(0)*Escale, ofcb.at(1)*Escale, ofcb.at(2)*Escale, ofcb.at(3)*Escale, ofcb.at(4)*Escale, - ofch.at(0)*inv_Escale, ofch.at(1)*inv_Escale, ofch.at(2)*inv_Escale, ofch.at(3)*inv_Escale, ofch.at(4)*inv_Escale, - ofcd.at(0)*inv_Escale, ofcd.at(1)*inv_Escale, ofcd.at(2)*inv_Escale, ofcd.at(3)*inv_Escale, ofcd.at(4)*inv_Escale); - // 0.0, 0.0, 0.0, 0.0, 0.0); - - // Dumping file with offline energy and online energ - energyfile << count << " " << E_off << " " << E_on ; - energyfile << " // FEB " << febid.get_identifier32().get_compact() << " ( channel " << channel << " ), event " << event << std::endl; - - // Dumping file with digits - digitsfile << channel << " "; - for (unsigned int k = 0; k<digits->size(); k++) { - digitsfile << digits->at(k) << " "; - } - digitsfile << " // FEB " << febid.get_identifier32().get_compact() << " ( channel " << channel << " ), event " << event << std::endl; -} - -void LArRODMonTool::DumpCellInfo(HWIdentifier chid, // FEB HW ID - //int channel, // channel # - //HWIdentifier CellID, // Channel HW ID - //int slot, // slot - //int FT, // Feedthrough - //int barrel_ec, - //int posneg, - //std::string part, - const char* partc, - int gain, - int event, - int E_off, // Energy calculated offline (i.e. fromDigits) - int E_on, // Energy calculated online (i.e. fromBytestream) - float T_off, // Time calculated offline (i.e. fromDigits) - float T_on, // Time calculated online (i.e. fromBytestream) - float Q_off, // Quality Factor calculated offline (i.e. fromDigits) - float Q_on, // Quality Factor calculated online (i.e. fromBytestream) - FILE* dumpfile) -{ - - // Dumping cell information in a text file so that it can be compared to unhappy channels lists for instance ... - - const int barrel_ec=m_LArOnlineIDHelper->barrel_ec(chid); - const int posneg=m_LArOnlineIDHelper->pos_neg(chid); - const int slot = m_LArOnlineIDHelper->slot(chid); - const int FT = m_LArOnlineIDHelper->feedthrough(chid); - const int channel = m_LArOnlineIDHelper->channel(chid); - const HWIdentifier febid= m_LArOnlineIDHelper->feb_Id(chid); - - - fprintf(dumpfile,"0x%8x ",febid.get_identifier32().get_compact()); - fprintf(dumpfile,"%3d ",channel); - fprintf(dumpfile,"0x%8x ",chid.get_identifier32().get_compact()); - fprintf(dumpfile,"%2d ",slot); - fprintf(dumpfile,"%2d ",FT); - fprintf(dumpfile,"%2d ",barrel_ec); - fprintf(dumpfile,"%2d ",posneg); - fprintf(dumpfile,"%7s ",partc); - //fprintf(dumpfile,"%3d ",(int)eta); - //fprintf(dumpfile,"%3d ",(int)phi); - fprintf(dumpfile,"%3d ",gain); - //fprintf(dumpfile,"%3d ",isConnected); - fprintf(dumpfile,"%5d ",E_off); - fprintf(dumpfile,"%5d ",E_on); - fprintf(dumpfile,"%5f ",T_off); - fprintf(dumpfile,"%5f ",T_on); - fprintf(dumpfile,"%5f ",Q_off); - fprintf(dumpfile,"%5f ",Q_on); - fprintf(dumpfile,"%3d \n",event); -} - -StatusCode LArRODMonTool::finalize() { - ATH_MSG_VERBOSE("Finalize LArRODMonTool"); - closeDumpfiles(); - return StatusCode::SUCCESS; -} - -void LArRODMonTool::closeDumpfiles() { - // Close output files - if (m_doDspTestDump) { - std::fclose(m_fai); - m_fdig.close(); - m_fen.close(); - } - if (m_doCellsDump) { - std::fclose(m_fdump); - } -} - -StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* /*ddman*/, - const LArOnOffIdMapping* /*cabling*/, - const ILArOFC* ofcs, - const ILArShape* shapes, - const ILArHVScaleCorr* hvScaleCorrs, - const ILArPedestal* pedestals, - const LArADC2MeV* adc2mev, - const HWIdentifier chid, - const LArRawChannel& rcDig, - const LArRawChannel& rcBS, - const LArDigit* dig) { - ATH_MSG_DEBUG( " I am entering compareChannels method" ); - - const int slot_fD = m_LArOnlineIDHelper->slot(chid); - const int feedthrough_fD = m_LArOnlineIDHelper->feedthrough(chid); - const float timeOffline = rcDig.time()/m_unit_offline - m_timeOffset*m_BC; - - const unsigned q_gain = (int)rcDig.gain(); - - - const float& en_fB=rcBS.energy(); - const float& en_fD=rcDig.energy(); - const float abs_en_fB=fabs(en_fB); - - if (fabs(timeOffline) > m_peakTime_cut*1000.){ - ATH_MSG_DEBUG( " timeOffline too large " << timeOffline ); - return StatusCode::SUCCESS; - } -// Set the cuts corresponding to the range - int energyrange, DECut, DTCut, DQCut; - if (abs_en_fB < m_range_E_0) { - DECut = m_precision_E_0; - energyrange=0; - } - else if (abs_en_fB < m_range_E_1) { - DECut = m_precision_E_1; - energyrange=1; - } - else if (abs_en_fB < m_range_E_2) { - DECut = m_precision_E_2; - energyrange=2; - } - else if (abs_en_fB < m_range_E_3) { - DECut = m_precision_E_3; - energyrange=3; - } - else { //>= m_range_E_3 - DECut = m_precision_E_max; - energyrange=4; - } // not sure of this value ... seems the max, though ... - - const float& t_fB=rcBS.time(); - const float abs_t_fB=std::abs(t_fB); - if (abs_t_fB < m_range_T_0) DTCut = m_precision_T_0; - else if (abs_t_fB < m_range_T_1) - DTCut = m_precision_T_1; - else if (abs_t_fB < m_range_T_2) - DTCut = m_precision_T_2; - else if (abs_t_fB < m_range_T_3) - DTCut = m_precision_T_3; - else DTCut = m_precision_T_max; // not sure of this value ... seems the max, though ... - - const float q_fB=rcBS.quality(); - const float abs_q_fB=std::abs(q_fB); - const float q_fD=rcDig.quality(); - - - if (abs_q_fB < m_range_Q_0) - DQCut = m_precision_Q_0; - else if (abs_q_fB < m_range_Q_1) - DQCut = m_precision_Q_1; - else if (abs_q_fB < m_range_Q_2) - DQCut = m_precision_Q_2; - else if (abs_q_fB < m_range_Q_3) - DQCut = m_precision_Q_3; - else - DQCut = m_precision_Q_max; // not sure of this value ... seems the max, though ... - - - // Variable used to reset the histos ranges - const float& maxE1 = en_fD; - const float& maxE2 = en_fB; - const float& maxT1 = timeOffline; - const float& maxT2 = t_fB; - const float& maxQ1 = q_fD; - const float& maxQ2 = q_fB; - const float DiffE = en_fD - en_fB; - const float DiffT = timeOffline - t_fB; // because time offline in ps and time online in ns - - //Flags - const bool keepE = true; - bool keepT = true; - bool keepQ = true; - - float DiffQ = 65535.0; - if (rcDig.quality() > 0.) DiffQ = (rcDig.quality() - q_fB)/std::sqrt(rcDig.quality()); - - // If q is not calculated online/offline, don't keep event ? - if (m_skipNullQT && (q_fB <= 0 || rcDig.quality()<= 0)) { - keepT = false; - keepQ = false; - } - - // if overflow for T, skip the event - if (fabs(timeOffline) > 327680) { // 2**15 * 10 ps - keepT = false; - } - - const PARTITION p=getPartition(chid); - HistGroup& hg=m_histos[p]; - ERRCOUNTER& ec=m_errcounters[p]; - - if (keepE) {//Energy histograms: - //Partition histogram - if (fabs(hg.m_hDE->GetXaxis()->GetXmax()) < fabs(DiffE) && m_IsOnline ) { // Set the histo axis - hg.m_hDE->SetCanExtend(TH1::kAllAxes); - hg.m_hDE->RebinAxis(DiffE,hg.m_hDE->GetXaxis()); - } - hg.m_hDE->Fill(DiffE); - hg.m_hDE_ranges->Fill(DiffE,energyrange); - - //'ALL' histogram - if (fabs(m_hE_all->GetXaxis()->GetXmax()) < fabs(DiffE) && m_IsOnline ) { - m_hE_all->SetCanExtend(TH1::kAllAxes); - m_hE_all->RebinAxis(DiffE,m_hE_all->GetXaxis()); - } - m_hE_all->Fill(DiffE); - m_hE_ranges_all->Fill(DiffE,energyrange); - - //online vs offline histograms - if (fabs(hg.m_hEon_VS_Eoff->GetXaxis()->GetXmax()) < fabs(maxE1) && m_IsOnline) { - hg.m_hEon_VS_Eoff->SetCanExtend(TH1::kAllAxes); - hg.m_hEon_VS_Eoff->RebinAxis(maxE1,hg.m_hEon_VS_Eoff->GetXaxis()); - } - if (fabs(hg.m_hEon_VS_Eoff->GetYaxis()->GetXmax()) < fabs(maxE2) && m_IsOnline ) { - hg.m_hEon_VS_Eoff->SetCanExtend(TH1::kAllAxes); - hg.m_hEon_VS_Eoff->RebinAxis(maxE2,hg.m_hEon_VS_Eoff->GetYaxis()); - } - hg.m_hEon_VS_Eoff->Fill(rcDig.energy(),en_fB); - // For Eon/Eoff or Qon/Qoff dump - const float hvscale = hvScaleCorrs->HVScaleCorr(chid); - //if ( ((fabs(DiffE) > DECut && hvscale == 1.) || (keepQ && (fabs(DiffQ) > DQCut))) && dig) { - if ( ((fabs(DiffE) > DECut) || (keepQ && (fabs(DiffQ) > DQCut))) && dig) { - // absolute cut on energy 1.MeV - //if ( ((fabs(DiffE) > 1.) || (keepQ && (fabs(DiffQ) > DQCut))) && dig) { - ++ec.errors_E[q_gain]; - hg.m_hOut_E_FT_vs_SLOT->Fill(slot_fD,feedthrough_fD); - if(m_IsOnline) { - hg.m_hOut_E_FT_vs_SLOT_shadow[(m_curr_lb % m_history_size) / m_history_granularity ]->Fill(slot_fD,feedthrough_fD); - } - //adding dumper - if(m_IsOnline && m_ndump<max_dump) { - const int channel=m_LArOnlineIDHelper->channel(chid); - const HWIdentifier febid=m_LArOnlineIDHelper->feb_Id(chid); - ATH_MSG_INFO( "Channel: " << channel << " of FEB " << febid ); - //if(fabs(DiffE) > DECut && hvscale == 1.) { // only for channels without HV corrections - if(fabs(DiffE) > DECut ) { - // absolute cut on energy 1.MeV - //if(fabs(DiffE) > 1.) { - ATH_MSG_INFO( "DSP Energy Error : " << m_LArOnlineIDHelper->channel_name(chid) ); - ATH_MSG_INFO( " Eonl = " << en_fB << " , Eoff = " << rcDig.energy() - << " , Eoff - Eonl = " << rcDig.energy() - en_fB ); - ATH_MSG_INFO( " Qonl = " << q_fB << " , Qoff = " << rcDig.quality() - << " (Qoff - Qnl)/sqrt(Qoff) = " << (rcDig.quality() - q_fB)/std::sqrt(rcDig.quality()) ); - } - if(keepQ && (fabs(DiffQ) > DQCut)) { - ATH_MSG_INFO( "DSP Quality Error : " << m_LArOnlineIDHelper->channel_name(chid) ); - ATH_MSG_INFO( " Qonl = " << q_fB << " , Qoff = " << rcDig.quality() - << " (Qoff - Qnl)/sqrt(Qoff) = " << (rcDig.quality() - q_fB)/std::sqrt(rcDig.quality()) ); - ATH_MSG_INFO( " Eonl = " << en_fB << " , Eoff = " << rcDig.energy() - << " , Eoff - Eonl = " << rcDig.energy() - en_fB ); - } - ATH_MSG_INFO( " Tauonl = " << rcBS.time() << " , Tauoff = " << rcDig.time() ); - const std::vector<short>& samples=dig->samples(); - std::ostringstream os; - os << "Digits : "; - for (unsigned int k = 0; k<samples.size(); k++) {os << samples.at(k) << " ";} - ATH_MSG_INFO( os.str() ); - ILArOFC::OFCRef_t this_OFC_a_test = ofcs->OFC_a(chid,rcDig.gain()); - os.clear(); os.seekp(0); - os << "OFCa : "; - for (unsigned int k = 0; k<this_OFC_a_test.size(); ++k) {os << this_OFC_a_test.at(k) << " ";} - ATH_MSG_INFO( os.str() ); - ILArOFC::OFCRef_t this_OFC_b_test = ofcs->OFC_b(chid,rcDig.gain()); - os.clear(); os.seekp(0); - os << "OFCb : "; - for (unsigned int k = 0; k<this_OFC_b_test.size(); ++k) {os << this_OFC_b_test.at(k) << " ";} - ATH_MSG_INFO( os.str() ); - ILArShape::ShapeRef_t this_Shape_test = shapes->Shape(chid,rcDig.gain()); - os.clear(); os.seekp(0); - os << "Shape : "; - for (unsigned int k = 0; k<this_Shape_test.size(); ++k) {os << this_Shape_test.at(k) << " ";} - ATH_MSG_INFO( os.str() ); - ILArShape::ShapeRef_t this_ShapeDer_test = shapes->ShapeDer(chid,rcDig.gain()); - os.clear(); os.seekp(0); - os << "ShapeDer : "; - for (unsigned int k = 0; k<this_ShapeDer_test.size(); ++k) {os << this_ShapeDer_test.at(k) << " ";} - ATH_MSG_INFO( os.str() ); - const auto ramp=adc2mev->ADC2MEV(chid,rcDig.gain()); - const float escale = ramp[1]; - float ramp0 = ramp[0]; - if (q_gain == 0) ramp0 = 0.; // no ramp intercepts in HG - const float ped = pedestals->pedestal(chid,rcDig.gain()); - ATH_MSG_INFO( "Escale: "<<escale<<" intercept: "<<ramp0<<" pedestal: "<<ped<<" gain: "<<rcDig.gain() ); - ATH_MSG_INFO( "HVScaleCorr: "<<hvscale); - double emon=0.; - const unsigned nOFCSamp=std::min(samples.size(),this_OFC_a_test.size()); - for (unsigned k=0; k<nOFCSamp; ++k) emon += (samples.at(k)-ped)*this_OFC_a_test.at(k); - emon *= escale; - emon += ramp0; - ATH_MSG_INFO( "intercept + Escale*Sum[(sample-ped)*OFCa] "<<emon); - ++m_ndump; - } // DE cut - } // dumper - }// end energy histograms - - if (keepT) { //Time histograms - //partition histogram - if (fabs(hg.m_hDT->GetXaxis()->GetXmax()) < fabs(DiffT) && m_IsOnline ) { // Set the histo axis - hg.m_hDT->SetCanExtend(TH1::kAllAxes); - hg.m_hDT->RebinAxis(DiffT,hg.m_hDT->GetXaxis()); - } - hg.m_hDT->Fill(DiffT); - - //'ALL' histogram: - if (fabs(m_hT_all->GetXaxis()->GetXmax()) < fabs(DiffT) && m_IsOnline) { - m_hT_all->SetCanExtend(TH1::kAllAxes); - m_hT_all->RebinAxis(DiffT,m_hT_all->GetXaxis()); - } - m_hT_all->Fill(DiffT); - - //online vs offline histogram - if (fabs(hg.m_hTon_VS_Toff->GetXaxis()->GetXmax()) < fabs(maxT1) && m_IsOnline) { - hg.m_hTon_VS_Toff->SetCanExtend(TH1::kAllAxes); - hg.m_hTon_VS_Toff->RebinAxis(maxT1,hg.m_hTon_VS_Toff->GetXaxis()); - } - if (fabs(hg.m_hTon_VS_Toff->GetYaxis()->GetXmax()) < fabs(maxT2) && m_IsOnline) { - hg.m_hTon_VS_Toff->SetCanExtend(TH1::kAllAxes); - hg.m_hTon_VS_Toff->RebinAxis(maxT2,hg.m_hTon_VS_Toff->GetYaxis()); - } - hg.m_hTon_VS_Toff->Fill(timeOffline,t_fB); - - if (fabs(DiffT) > DTCut) { - ++(ec.errors_T[q_gain]); - hg.m_hOut_T_FT_vs_SLOT->Fill(slot_fD,feedthrough_fD); - if(m_IsOnline) { - hg.m_hOut_T_FT_vs_SLOT_shadow[(m_curr_lb % m_history_size) / m_history_granularity]->Fill(slot_fD,feedthrough_fD); - } - } - } //end time histos - - - if (keepQ) { //Quality histograms - //Partition histogram - if (fabs(hg.m_hDQ->GetXaxis()->GetXmax()) < fabs(DiffQ) && m_IsOnline) { // Set the histo axis - hg.m_hDQ->SetCanExtend(TH1::kAllAxes); - hg.m_hDQ->RebinAxis(DiffQ,hg.m_hDQ->GetXaxis()); - } - hg.m_hDQ->Fill(DiffQ); - - //'ALL' histograms - if (fabs(m_hQ_all->GetXaxis()->GetXmax()) < fabs(DiffQ) && m_IsOnline) { - m_hQ_all->SetCanExtend(TH1::kAllAxes); - m_hQ_all->RebinAxis(DiffQ,m_hQ_all->GetXaxis()); - } - m_hQ_all->Fill(DiffQ); - - //online vs offline histograms - if (fabs(hg.m_hQon_VS_Qoff->GetXaxis()->GetXmax()) < fabs(maxQ1) && m_IsOnline) { - hg.m_hQon_VS_Qoff->SetCanExtend(TH1::kAllAxes); - hg.m_hQon_VS_Qoff->RebinAxis(maxQ1,hg.m_hQon_VS_Qoff->GetXaxis()); - } - if (fabs(hg.m_hQon_VS_Qoff->GetYaxis()->GetXmax()) < fabs(maxQ2) && m_IsOnline) { - hg.m_hQon_VS_Qoff->SetCanExtend(TH1::kAllAxes); - hg.m_hQon_VS_Qoff->RebinAxis(maxQ2,hg.m_hQon_VS_Qoff->GetYaxis()); - } - hg.m_hQon_VS_Qoff->Fill(rcDig.quality(),q_fB); - - if (fabs(DiffQ) > DQCut) { - ++(ec.errors_Q[q_gain]); - hg.m_hOut_Q_FT_vs_SLOT->Fill(slot_fD,feedthrough_fD); - if(m_IsOnline) { - hg.m_hOut_Q_FT_vs_SLOT_shadow[(m_curr_lb % m_history_size) / m_history_granularity]->Fill(slot_fD,feedthrough_fD); - } - } - } - - if (m_printEnergyErrors && msgLvl(MSG::DEBUG)) { - if (fabs(rcDig.energy() - en_fB) > DECut) { - ATH_MSG_DEBUG( "DSP Energy Error : " << m_LArOnlineIDHelper->channel_name(chid) ); - ATH_MSG_DEBUG( " Eonl = " << en_fB << " , Eoff = " << rcDig.energy() - << " , Eoff - Eonl = " << rcDig.energy() - en_fB ); - } - } - - if (keepQ) { - const HWIdentifier febId=m_LArOnlineIDHelper->feb_Id(chid); - const IdentifierHash febHash=m_LArOnlineIDHelper->feb_Hash(febId); - ++(m_errsPerFEB[febHash]); - } - - - - //Detailed text dump if requested: - if (dig) { - if ((keepE && fabs(DiffE)>DECut) || (keepT && fabs(DiffT)>DTCut) || (keepQ && DiffQ > DQCut)) { - if (m_doDspTestDump) { - int Ind = 0; - const float timeBinWidth_test=ofcs->timeBinWidth(chid,q_gain); - unsigned delayIdx_test=(unsigned)floor(0.5+Ind/timeBinWidth_test); - ILArOFC::OFCRef_t this_OFC_a_test = ofcs->OFC_a(chid,q_gain,delayIdx_test); - ILArOFC::OFCRef_t this_OFC_b_test = ofcs->OFC_b(chid,q_gain,delayIdx_test); - ILArShape::ShapeRef_t this_OFC_h_test = shapes->Shape(chid,q_gain,delayIdx_test); - ILArShape::ShapeRef_t this_OFC_d_test = shapes->ShapeDer(chid,q_gain,delayIdx_test); - const auto ramp=adc2mev->ADC2MEV(chid,q_gain); - const std::vector<short>& samples=dig->samples(); - const float escale = ramp[1]; - float ramp0 = ramp[0]; - if (q_gain == 0) ramp0 = 0.; // no ramp intercepts in HG - const float ped = pedestals->pedestal(chid,q_gain); - this->DumpCellEvent((int)m_counter,this_OFC_a_test,this_OFC_b_test,this_OFC_h_test,this_OFC_d_test,escale,ramp0,ped,&samples,(int)(rcDig.energy()),(int)(en_fB),m_fai,m_fdig,m_fen, chid, (int)m_eventsCounter); - } - if (m_doCellsDump) { - this->DumpCellInfo(chid,hg.m_partName.c_str(),(int)q_gain,(int)m_eventsCounter,(int)rcDig.energy(),(int)(en_fB),rcDig.time(),t_fB,rcDig.quality(),q_fB,m_fdump); - } - m_counter++; - }//end if E,t or Q cut passed - }//end if dig - ATH_MSG_DEBUG( " I am leaving compareChannels method" ); - return StatusCode::SUCCESS; -} - - -void LArRODMonTool::ERRCOUNTER::clear() { - for (unsigned i=0;i<3;++i) { - errors_E[i]=0; - errors_T[i]=0; - errors_Q[i]=0; - } - return; -} diff --git a/LArCalorimeter/LArMonTools/src/LArRODMonTool.h b/LArCalorimeter/LArMonTools/src/LArRODMonTool.h deleted file mode 100644 index 11f23aad8c1723168fee0f48204a0dcef1cf69ac..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRODMonTool.h +++ /dev/null @@ -1,360 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -//Dear emacs, this is -*-c++-*- - -/** - * @class LArRODMonTool - * @author Mathieu Aurousseau <mathieu.aurousseau@lapp.in2p3.fr> - * - */ - -#ifndef LARMONTOOLS_LARRODMONTOOL_H -#define LARMONTOOLS_LARRODMONTOOL_H - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "LArElecCalib/ILArPedestal.h" //in template -#include "LArElecCalib/ILArOFC.h" //in template -#include "LArElecCalib/ILArShape.h" //in template -#include "LArElecCalib/ILArHVScaleCorr.h" //in template -#include "LArIdentifier/LArOnlineID.h" //inline usage -#include "LArRawConditions/LArADC2MeV.h" //in template -#include "StoreGate/ReadCondHandleKey.h" -#include "StoreGate/ReadHandleKey.h" -#include "CaloDetDescr/CaloDetDescrManager.h" //in template - -//Events infos: - -#include "LArRawEvent/LArFebHeaderContainer.h" //in template -//Events infos: -#include "xAODEventInfo/EventInfo.h" //in template - -#include "LArRecConditions/LArBadChannelMask.h" //member -#include "LArRecConditions/LArBadChannelCont.h" //in template - -#include <iosfwd> -#include <cstdio> //FILE* typedef -#include <ios> //for std::hex -#include <fstream> //for std::ofstream -#include <set> -#include <vector> - -class LArRawChannel; -class HWIdentifier; -class LArOnOffIdMapping; -class LArRawChannelContainer; -class LArDigitContainer; - -class LArEM_ID; -class TH1F; -class TH2I; -class TH2F; -class TProfile2D; -class LArDigit; - -//using namespace std; - -class LArRODMonTool: public ManagedMonitorToolBase -{ - public: - LArRODMonTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - /** @brief Default destructor */ - virtual ~LArRODMonTool(); - - virtual StatusCode initialize() override; - - virtual StatusCode finalize() override; - - // Book general histograms - virtual StatusCode bookHistograms() override; - - // Called each event - virtual StatusCode fillHistograms() override; - - //StatusCode procHistograms(bool isEndOfEventsBlock, bool isEndOfLumiBlock, bool isEndOfRun); - - //bool Checksum_Check(std::vector<int>& myFEBvector); - - //bool RodStatus_Check(std::vector<int>& myStatusvector); - - /** @brief For a given cell, dump info that can be used by DspTest, into two txt files and one dat file */ - void DumpCellEvent(int count, // counter - ILArOFC::OFCRef_t ofc, // vector containing OFC's - ILArOFC::OFCRef_t ofcb, // vector containing OFCb's - ILArShape::ShapeRef_t ofch, // vector containing OFCh's - ILArShape::ShapeRef_t ofcd, // vector containing OFCd's - float Escale, // ADC2MeV factor - float Ramp0, // ramp intercept - float pedestal, // pedestal - const std::vector<short>* digits, // vector containing samples (digits) - int E_off, // Energy calculated offline (i.e. fromDigits) - int E_on, // Energy calculated online (i.e. fromBytestream) - FILE* ofcfile, // output file containing ofc's - std::ofstream& digitsfile, // output file containing digits - std::ofstream& energyfile, // output file containing energies - const HWIdentifier chid, // FEB HW ID - int event); // Event # - - - /** @brief Dump a cell's information and calculated energies into a txt file */ - void DumpCellInfo(HWIdentifier chid, // Channel HW ID - const char* partc, - int gain, - int event, - int E_off, // Energy calculated offline (i.e. fromDigits) - int E_on, // Energy calculated online (i.e. fromBytestream) - float T_off, // Time calculated offline (i.e. fromDigits) - float T_on, // Time calculated online (i.e. fromBytestream) - float Q_off, // Quality Factor calculated offline (i.e. fromDigits) - float Q_on, // Quality Factor calculated online (i.e. fromBytestream) - FILE* dumpfile); - -private: - const LArOnlineID* m_LArOnlineIDHelper; - unsigned m_counter; - unsigned m_eventsCounter; - unsigned m_ndump; - enum PARTITION {EMBC=0,EMBA,EMECC,EMECA,HECC,HECA,FCALC,FCALA,N_PARTITIONS}; - - - - - PARTITION getPartition(const HWIdentifier chid) const; - - struct HistGroup{ - public: - HistGroup(): - m_hDE(NULL),m_hDT(NULL), m_hDQ(NULL), - m_hOut_E_FT_vs_SLOT(NULL), m_hOut_T_FT_vs_SLOT(NULL),m_hOut_Q_FT_vs_SLOT(NULL), - m_hOut_E_FT_vs_SLOT_shadow(NULL), m_hOut_T_FT_vs_SLOT_shadow(NULL),m_hOut_Q_FT_vs_SLOT_shadow(NULL), - m_hEon_VS_Eoff(NULL),m_hTon_VS_Toff(NULL), - m_hQon_VS_Qoff(NULL),m_Sweet(NULL), - m_hDE_ranges(0), - m_monGroup(0) - {}; - - TH1F* m_hDE; - TH1F* m_hDT; - TH1F* m_hDQ; - TH2F* m_hOut_E_FT_vs_SLOT; - TH2F* m_hOut_T_FT_vs_SLOT; - TH2F* m_hOut_Q_FT_vs_SLOT; - TH2F** m_hOut_E_FT_vs_SLOT_shadow; - TH2F** m_hOut_T_FT_vs_SLOT_shadow; - TH2F** m_hOut_Q_FT_vs_SLOT_shadow; - TH2F* m_hEon_VS_Eoff; - TH2F* m_hTon_VS_Toff; - TH2F* m_hQon_VS_Qoff; - TH1F* m_Sweet; - TH2F* m_hDE_ranges; - std::string m_partName; - MonGroup* m_monGroup; - }; - - std::vector<HistGroup> m_histos; - - std::vector<unsigned> m_errsPerFEB; - - // initialize monitoring bookkeeping info - //StatusCode initMonInfo(); - - bool FebStatus_Check(); - - StatusCode compareChannels(const CaloDetDescrManager* ddman, - const LArOnOffIdMapping* cabling, - const ILArOFC* ofcs, - const ILArShape* shapes, - const ILArHVScaleCorr* hvScaleCorrs, - const ILArPedestal* pedestals, - const LArADC2MeV* adc2mev, - const HWIdentifier chid, - const LArRawChannel& rcDig, - const LArRawChannel& rcBS, - const LArDigit* dig=nullptr - - ); - - class ERRCOUNTER { - public: - ERRCOUNTER() { - clear(); - }; - void clear(); - unsigned errors_E[3]; - unsigned errors_T[3]; - unsigned errors_Q[3]; - }; - - std::vector<ERRCOUNTER> m_errcounters; - - unsigned m_count_gain[3]{}; - - TH2F* m_hSummaryErrors_Energy; - TH2F* m_hSummaryErrors_Time; - TH2F* m_hSummaryErrors_Quality; - - TH1F* m_hE_all; - TH1F* m_hT_all; - TH1F* m_hQ_all; - - TH2F* m_hE_ranges_all; - - TH2I* m_hEErrors_LB_part; - TH2I* m_hTErrors_LB_part; - TH2I* m_hQErrors_LB_part; - - TH2I* m_hEErrors_LB_stream; - TH2I* m_hTErrors_LB_stream; - TH2I* m_hQErrors_LB_stream; - - - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","SG Key of EventInfo object"}; - SG::ReadHandleKey<LArFebHeaderContainer> m_febContKey{this, "LArFebHeaderContainerKey", "LArFebHeader"}; - // Keys for LArRawChannels containers - SG::ReadHandleKey<LArRawChannelContainer> m_channelKey_fromBytestream{this,"LArRawChannelKey_fromBytestream","LArRawChannels","SG key of LArRawChannels produced by teh DSP"}; - SG::ReadHandleKey<LArRawChannelContainer> m_channelKey_fromDigits{this,"LArRawChannelKey_fromDigits","LArRawChannels_FromDigits","SG key of LArRawChannels produced offline"}; - - SG::ReadHandleKey<LArDigitContainer> m_digitContainerKey{this,"LArDigitContainerKey","FREE","SG key of LArDigitContainer read from Bytestream"}; - - - SG::ReadCondHandleKey<ILArOFC> m_keyOFC{this,"KeyOFC","LArOFC","SG key of LArOFC CDO"}; - SG::ReadCondHandleKey<ILArShape> m_keyShape{this,"KeyShape","LArShape","SG key of LArShape CDO"}; - SG::ReadCondHandleKey<ILArHVScaleCorr> m_keyHVScaleCorr{this,"KeyHVScaleCorr","LArHVScaleCorr","SG key of LArHVScaleCorr CDO"}; - SG::ReadCondHandleKey<ILArPedestal> m_keyPedestal{this,"LArPedestalKey","LArPedestal","SG key of LArPedestal CDO"}; - - SG::ReadCondHandleKey<LArADC2MeV> m_adc2mevKey{this,"LArADC2MeVKey","LArADC2MeV","SG Key of the LArADC2MeV CDO"}; - - - LArBadChannelMask m_bcMask; - SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping CDO"}; - SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey {this, "CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" }; - - - // Output files names - std::string m_DigitsFileName; - std::string m_EnergyFileName; - std::string m_AiFileName; - std::string m_DumpCellsFileName; - - // Ofstream / files for test outputs - std::ofstream m_fdig, m_fen; // ,ai - FILE* m_fdump; - FILE* m_fai; - - void closeDumpfiles(); - - bool m_doDspTestDump; - bool m_doCellsDump; - bool m_doCheckSum; - bool m_doRodStatus; - bool m_printEnergyErrors; - bool m_removeNoiseBursts; - bool m_useEvtCounter; - - int m_range_E_0; - int m_range_E_1; - int m_range_E_2; - int m_range_E_3; - - int m_range_T_0 = 0; - int m_range_T_1 = 0; - int m_range_T_2 = 0; - int m_range_T_3 = 0; - - int m_range_Q_0 = 0; - int m_range_Q_1 = 0; - int m_range_Q_2 = 0; - int m_range_Q_3 = 0; - - int m_precision_E_0; - int m_precision_E_1; - int m_precision_E_2; - int m_precision_E_3; - int m_precision_E_max; - - int m_precision_T_0; - int m_precision_T_1; - int m_precision_T_2; - int m_precision_T_3; - int m_precision_T_max; - - int m_precision_Q_0; - int m_precision_Q_1; - int m_precision_Q_2; - int m_precision_Q_3; - int m_precision_Q_max; - - int m_history_size; - int m_history_granularity; - int m_hsize; - //bool *m_hdone; - std::vector<bool> m_hdone; - - bool m_skipKnownProblematicChannels; - bool m_skipNullPed; - bool m_skipNullQT; - - float m_unit_online; - float m_unit_offline; - float m_timeOffset; - short m_adc_th; - float m_peakTime_cut; - float m_nb_lb; - - float m_BC; // value of 1 bunch-crossing = 25ns - - bool m_IsOnline; - int m_last_lb; - int m_curr_lb; - - std::vector<std::string> m_streams; - - std::set<HWIdentifier> m_ignoreFEBs; - - bool m_dumpDigits; - -}; - - -inline -LArRODMonTool::PARTITION LArRODMonTool::getPartition(const HWIdentifier chid) const{ - const int side=m_LArOnlineIDHelper->pos_neg(chid); - if (m_LArOnlineIDHelper->isEMBchannel(chid)) { - if (side==0) - return EMBC; - else - return EMBA; - } - if (m_LArOnlineIDHelper->isEMECchannel(chid)) { - if (side==0) - return EMECC; - else - return EMECA; - } - if (m_LArOnlineIDHelper->isHECchannel(chid)){ - if (side==0) - return HECC; - else - return HECA; - } - if (m_LArOnlineIDHelper->isFCALchannel(chid)) { - if (side==0) - return FCALC; - else - return FCALA; - } - - msg(MSG::FATAL) << "Channel 0x "<< std::hex << chid.get_identifier32().get_compact() << std::dec << " neither EMB nor EMEC nor HEC nor FCAL???" << std::endl; - return N_PARTITIONS; -} - - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.cxx deleted file mode 100644 index cccf2fd8e133a48b37003672d87a644df6d786b5..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.cxx +++ /dev/null @@ -1,2027 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArRawChannelMonTool.h" -#include "LArOnlineIDStrHelper.h" - -// --- athena --- -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloIdentifier/LArID_Exception.h" -#include "CLHEP/Units/SystemOfUnits.h" -#include "xAODEventInfo/EventInfo.h" -#include "Identifier/HWIdentifier.h" -#include "Identifier/Identifier.h" -#include "Identifier/IdentifierHash.h" -#include "Identifier/Range.h" -#include "LArIdentifier/LArOnlineID.h" -#include "LArIdentifier/LArOnlID_Exception.h" -#include "LArRawEvent/LArRawChannel.h" -#include "LArRecEvent/LArEventBitInfo.h" -#include "AthenaKernel/Units.h" -#include "StoreGate/ReadCondHandle.h" -#include "CaloConditions/CaloNoise.h" -#include "GaudiKernel/ThreadLocalContext.h" - -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH2F_LW.h" -#include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile2D_LW.h" -#include "LWHists/TProfile_LW.h" -#include "LWHistFactory.h" - -// --- stl --- -#include <algorithm> -#include <cfloat> -#include <climits> -#include <cmath> -#include <deque> -#include <iostream> -#include <iomanip> -#include <iterator> -#include <stdexcept> -#include <typeinfo> -#include <utility> - - -namespace Units = Athena::Units; -using Units::nanosecond; -using Units::picosecond; -using Units::MeV; - - -using namespace LArMonTools; - -using std::shared_ptr; - -typedef std::map<RawChHisto,std::shared_ptr<IHistoProxyBase> > map_str_th2; -using map_idhash_str_th2 = std::map<IdentifierHash, map_str_th2>; -using map_det_idhash_str_th2 = std::map<Detector, map_idhash_str_th2>; - -using citer_vect_hwid = std::vector<HWIdentifier>::const_iterator; - -//typedef std::pair<Detector,TH2*> pair_det_th2ptr; -using map_det_th2ptr = std::map<Detector, std::shared_ptr<IHistoProxyBase> >; -using citer_det_th2ptr = map_det_th2ptr::const_iterator; - -//typedef std::map<Detector, std::map<Sampling, std::deque<Region> > > det_region_map_t; -//typedef std::map<Sampling, std::deque<Region> > sam_region_map_t; - - -//static const double coarse_pi = 3.2; - - -/*----------------------------------------------------------------------------*/ -LArRawChannelMonTool::LArRawChannelMonTool( const std::string & type, - const std::string & name, - const IInterface* parent ) - : ManagedMonitorToolBase(type, name, parent) - , m_occupancy_thresholds( 8, 500. * MeV ) - , m_signal_thresholds(8, 500. * MeV ) - , m_pos_noise_thresholds( 8, 3 ) - , m_neg_noise_thresholds( 8, 3 ) - , m_bcid_signal_threshold( 500. * MeV ) - , m_time_threshold ( 5 ) - , m_quality_threshold( 4000 ) - , m_noise_burst_percent_thresholds( 8, 1. ) - , m_noise_burst_nChannel_thresholds( 8, 10 ) - , m_n_lumi_blocks( 1500 ) - , m_lar_online_id_ptr ( nullptr ) - , m_calo_id_mgr_ptr( nullptr ) - , m_filterAtlasReady_tools (this) - , m_atlas_ready( false ) - , m_lar_online_id_str_helper_ptr ( nullptr ) - , m_has_lar_raw_channels( false ) - // , _global_bcid_occupancy(0) - // , _global_lar_eta_phi_acc( 0 ) - , m_interval( lowStat ) - , m_is_noise_event( false ) - , m_timeResolution( 30, 1 ) - , m_event_counter( 0 ) - , m_noise_stream_event_counter( 0 ) -{ - - declareProperty( "dataNameBase", m_data_name_base = "LArRawChannel" ); - declareProperty( "ATLASReadyFilterTool", m_filterAtlasReady_tools ); - - declareProperty( "occupancy_thresholds", m_occupancy_thresholds ); - declareProperty( "signal_thresholds", m_signal_thresholds ); - declareProperty( "pos_noise_thresholds", m_pos_noise_thresholds ); - declareProperty( "neg_noise_thresholds", m_neg_noise_thresholds ); - - declareProperty( "bcid_signal_threshold", m_bcid_signal_threshold = 500. * MeV ); - declareProperty( "time_threshold", m_time_threshold = 5 ); - declareProperty( "quality_threshold", m_quality_threshold = 4000 ); - declareProperty( "noise_threshold", m_noise_threshold = 3 ); - declareProperty( "noise_burst_percent_threshold", m_noise_burst_percent_thresholds ); - declareProperty( "noise_burst_nChannel_threshold", m_noise_burst_nChannel_thresholds ); - - declareProperty( "monitor_occupancy", m_monitor_occupancy = false ); - declareProperty( "monitor_signal", m_monitor_signal = true ); - declareProperty( "monitor_positive_noise", m_monitor_positive_noise = true ); - declareProperty( "monitor_negative_noise", m_monitor_negative_noise = true); - declareProperty( "monitor_time", m_monitor_time = true ); - declareProperty( "monitor_quality", m_monitor_quality = false ); - declareProperty( "monitor_burst", m_monitor_burst = true ); - - declareProperty( "monitor_febs", m_monitor_febs = false ); - declareProperty( "monitor_feedthroughs", m_monitor_feedthroughs = false ); - declareProperty( "monitor_detectors", m_monitor_detectors = true ); - - declareProperty( "db_and_ofc_only", m_db_and_ofc_only = true ); - - declareProperty( "interval", m_interval_str = "lowStat" ); - - declareProperty( "n_lumi_blocks", m_n_lumi_blocks = 1500 ); - - declareProperty( "noise_streams", m_noise_streams); - -} - - -/*----------------------------------------------------------------------------*/ -LArRawChannelMonTool::~LArRawChannelMonTool() -{ - delete m_lar_online_id_str_helper_ptr; -} - -/*----------------------------------------------------------------------------*/ -StatusCode LArRawChannelMonTool::initialize() -{ - ATH_MSG_DEBUG( "===> start " << name() << "::initialize <=== " ); - - m_event_counter = 0; - m_noise_stream_event_counter = 0; - - m_interval = intervalStringToEnum( m_interval_str ); - - ATH_CHECK( ManagedMonitorToolBase::initialize() ); - - ATH_CHECK( m_EventInfoKey.initialize() ); - ATH_CHECK( m_LArRawChannel_container_key.initialize() ); - - ATH_CHECK( detStore()->retrieve( m_lar_online_id_ptr, "LArOnlineID" ) ); - ATH_CHECK( detStore()->retrieve( m_calo_id_mgr_ptr ) ); - ATH_CHECK( m_bcContKey.initialize()); - ATH_CHECK( m_bcMask.buildBitMask(m_problemsToMask,msg())); - - - ATH_CHECK( m_filterAtlasReady_tools.retrieve() ); - - ATH_CHECK( m_noiseKey.initialize() ); - ATH_CHECK( m_cablingKey.initialize() ); - ATH_CHECK(m_caloMgrKey.initialize()); - - // --- - // Get Michel's LArOnlineIDStrHelper: All names are Expert view - m_lar_online_id_str_helper_ptr = new - LArOnlineIDStrHelper( m_lar_online_id_ptr,LArOnlineIDStrHelper::LARONLINEID); - if ( msgLvl(MSG::DEBUG) ) m_lar_online_id_str_helper_ptr->test(); - - - // --- - // Create FEB -> Detector and FEB -> Feedthrough maps - Identifier::size_type feb_hash_max = m_lar_online_id_ptr->febHashMax(); - m_feb_hash_to_detector.resize( feb_hash_max ); - m_feb_hash_to_ft_hash.resize( feb_hash_max ); - - - citer_vect_hwid end_feb = m_lar_online_id_ptr->feb_end(); - for ( citer_vect_hwid itr_feb = m_lar_online_id_ptr->feb_begin(); - itr_feb != end_feb ; ++itr_feb) { - - HWIdentifier feb_id = *itr_feb; - HWIdentifier feedthrough_id = m_lar_online_id_ptr->feedthrough_Id( feb_id ); - - IdentifierHash feb_hash = m_lar_online_id_ptr->feb_Hash( feb_id ); - IdentifierHash ft_hash = m_lar_online_id_ptr->feedthrough_Hash( feedthrough_id ); - - std::string ft_name = m_lar_online_id_ptr->feedthrough_name( feb_id ); - - Detector det(UNDEF); - - // Determine if the FEB is on the Airport's or Charlie's side - if ( m_lar_online_id_ptr->pos_neg( *itr_feb ) ) { - - // Determine if the FEB is in: the EMB, EMEC, HEC, FCAL - if ( m_lar_online_id_ptr->isEMBchannel (*itr_feb) ) det = EMBA; - else if( m_lar_online_id_ptr->isEMECchannel(*itr_feb) ) det = EMECA; - else if( m_lar_online_id_ptr->isHECchannel (*itr_feb) ) det = HECA; - else if( m_lar_online_id_ptr->isFCALchannel(*itr_feb) ) det = FCALA; - - } else { - - // Determine if the FEB is in: the EMB, EMEC, HEC, FCAL - if ( m_lar_online_id_ptr->isEMBchannel (*itr_feb) ) det = EMBC; - else if( m_lar_online_id_ptr->isEMECchannel(*itr_feb) ) det = EMECC; - else if( m_lar_online_id_ptr->isHECchannel (*itr_feb) ) det = HECC; - else if( m_lar_online_id_ptr->isFCALchannel(*itr_feb) ) det = FCALC; - - } - - try { - - m_feb_hash_to_detector.at( feb_hash ) = det; - m_feb_hash_to_ft_hash.at( feb_hash ) = ft_hash; - - } catch ( std::out_of_range &err ) { - - ATH_MSG_WARNING( "FEB hash out of range" << err.what() ); - - } - - } - - // --- loop over channels to determine number of channels in each detector --- - // (looping over all channels so this can easlily be done for FEBs and - // feedthroughs later ... ) - m_det_to_nchannels[EMBA] = 0; - m_det_to_nchannels[EMECA] = 0; - m_det_to_nchannels[HECA] = 0; - m_det_to_nchannels[FCALA] = 0; - m_det_to_nchannels[EMBC] = 0; - m_det_to_nchannels[EMECC] = 0; - m_det_to_nchannels[HECC] = 0; - m_det_to_nchannels[FCALC] = 0; - - citer_vect_hwid channel_end = m_lar_online_id_ptr->channel_end(); - for ( citer_vect_hwid channel_itr = m_lar_online_id_ptr->channel_begin(); - channel_itr != channel_end ; ++channel_itr ) { - - // fixme: skip masked and disconnected channels - - Detector det(UNDEF); - - // Determine if the FEB is on the Airport's or Charlie's side - if ( m_lar_online_id_ptr->pos_neg( *channel_itr ) ) { - - // Determine if the FEB is in: the EMB, EMEC, HEC, FCAL - if ( m_lar_online_id_ptr->isEMBchannel (*channel_itr) ) det = EMBA; - else if( m_lar_online_id_ptr->isEMECchannel(*channel_itr) ) det = EMECA; - else if( m_lar_online_id_ptr->isHECchannel (*channel_itr) ) det = HECA; - else if( m_lar_online_id_ptr->isFCALchannel(*channel_itr) ) det = FCALA; - - } else { - - // Determine if the FEB is in: the EMB, EMEC, HEC, FCAL - if ( m_lar_online_id_ptr->isEMBchannel (*channel_itr) ) det = EMBC; - else if( m_lar_online_id_ptr->isEMECchannel(*channel_itr) ) det = EMECC; - else if( m_lar_online_id_ptr->isHECchannel (*channel_itr) ) det = HECC; - else if( m_lar_online_id_ptr->isFCALchannel(*channel_itr) ) det = FCALC; - - } - - m_det_to_nchannels[det] += 1; - - } - - if (msgLvl(MSG::DEBUG)) { - ATH_MSG_DEBUG( "Number of channels in detectors: " ); - using det_int_map_t = std::map<Detector, unsigned int>; - for( det_int_map_t::value_type i : m_det_to_nchannels){ - ATH_MSG_DEBUG( detector_str( i.first ) << " has " << i.second << "channels " ); - } - } - - - std::deque<Detector> detectors{ EMBA , EMBC , EMECA , EMECC , HECA , HECC , FCALA , FCALC }; - for( const Detector & det : detectors ){ - m_selectionContext[det].quality( m_quality_threshold ); - } - - - m_noise_streams_set.insert(m_noise_streams.begin(),m_noise_streams.end()); - ATH_MSG_DEBUG( "===> end " << name() << "::initialize <=== " ); - - return StatusCode::SUCCESS; - -} - - -/*----------------------------------------------------------------------------*/ -StatusCode LArRawChannelMonTool::bookHistograms() -{ - - ATH_MSG_DEBUG( "===> start " << name() << "::bookHistograms <=== " ); - - std::deque<Detector> detectors{ EMBA , EMBC , EMECA , EMECC , HECA , HECC , FCALA , FCALC }; - - // --- determine whether new histograms need booking --- - bool is_new_interval = true; -// switch ( m_interval ) { -// -// case eventsBlock: -// is_new_interval = isNewEventsBlock; -// break; -// case lumiBlock: -// is_new_interval = isNewLumiBlock; -// break; -// case lowStat: -// is_new_interval = newLowStatInterval; -// break; -// case medStat: -// is_new_interval = newMedStatInterval; -// break; -// case higStat: -// is_new_interval = newHigStatInterval; -// break; -// case run: -// is_new_interval = isNewRun; -// break; -// case fill: -// case file: -// case all: -// default: -// ATH_MSG_WARNING( "given bad interval job-option: " << m_interval_str -// << " ... booking histograms per run ..." ); -// is_new_interval = isNewRun; -// } -// -// -// // --- book histograms --- - if ( is_new_interval ) { - - // --- exit if no LArRawChannelContainer exists --- - m_has_lar_raw_channels = SG::ReadHandle<LArRawChannelContainer>(m_LArRawChannel_container_key).isValid(); - if ( !m_has_lar_raw_channels ) return StatusCode::SUCCESS; - - // --- To remeber which ft have been booked in which detector --- - map_det_idhash_str_th2 det_ft_type_hists; - - Identifier::size_type feb_hash_max = m_lar_online_id_ptr->febHashMax(); - - // --- Per FEB Histograms --- - m_per_feb_hists.clear(); - m_per_feb_hists[occ_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[sig_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[gain_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[pos_noise_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[neg_noise_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[time_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feb_hists[quality_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_occu = m_per_feb_hists[occ_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_sign = m_per_feb_hists[sig_h]; - //std::vector<shared_ptr<IHistoProxyBase> >& per_feb_gain = m_per_feb_hists[gain_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_posn = m_per_feb_hists[pos_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_negn = m_per_feb_hists[neg_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_time = m_per_feb_hists[time_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_qual = m_per_feb_hists[quality_h]; - - // --- Per Feedthrough Histograms --- - m_per_feedthrough_hists.clear(); - m_per_feedthrough_hists[occ_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feedthrough_hists[sig_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feedthrough_hists[pos_noise_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feedthrough_hists[neg_noise_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - m_per_feedthrough_hists[quality_h] = std::vector<shared_ptr<IHistoProxyBase> >( feb_hash_max ); - - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_occu = m_per_feedthrough_hists[occ_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_sign = m_per_feedthrough_hists[sig_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_posn = m_per_feedthrough_hists[pos_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_negn = m_per_feedthrough_hists[neg_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_qual = m_per_feedthrough_hists[quality_h]; - - // --- clear per detector maps --- - m_per_detector_hists.clear(); - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_occu = m_per_detector_hists[occ_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_sign = m_per_detector_hists[sig_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_gain = m_per_detector_hists[gain_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_posn = m_per_detector_hists[pos_noise_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_negn = m_per_detector_hists[neg_noise_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_burs = m_per_detector_hists[burst_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_timeVetoBurs = m_per_detector_hists[timeVetoBurst_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfrac= m_per_detector_hists[noise_fraction_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracNeg= m_per_detector_hists[noise_fraction_Neg_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfrac_W= m_per_detector_hists[noise_fraction_W_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracNoLArNoisyRO= m_per_detector_hists[noise_fraction_NoLArNoisyRO_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracTimeVetoLArNoisyRO= m_per_detector_hists[noise_fraction_TimeVetoLArNoisyRO_h]; - - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_pede = m_per_detector_hists[pedestal_evolution_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_sumE_BCID = m_per_detector_hists[sumE_vs_BCID_h]; - - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_mfebt= m_per_detector_hists[mean_feb_time_h]; - // map<Detector,shared_ptr<IHistoProxyBase> >& per_det_dtdet= m_per_detector_hists["det_time_diff"];// VB - // map<Detector,shared_ptr<IHistoProxyBase> >& per_det_lbdt = m_per_detector_hists["det_lb_time_diff"];// VB - // map<Detector,shared_ptr<IHistoProxyBase> >& per_det_lbvdt= m_per_detector_hists["lb_v_time_diff"];// VB - - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qual = m_per_detector_hists[quality_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qnChan= m_per_detector_hists[quality_nChannel_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qburs= m_per_detector_hists[quality_burst_h]; - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nChan_qburs= m_per_detector_hists[quality_nChannel_burst_h]; - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_mevbc= m_per_detector_hists[E_v_bc_h]; - - citer_vect_hwid end_feb = m_lar_online_id_ptr->feb_end(); - - - - // --- histogram factories --- - std::map<Detector,std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > > feb_histogram_factories; - std::map<Detector,std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > > ft_histogram_factories; - std::map<Detector,std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > > det_histogram_factories; - shared_ptr<LWHistFactoryBase> factory_ptr; - // --- FEB histogram factories --- - if ( m_monitor_febs ) { - - for ( const Detector& det : detectors ) { - - if ( m_monitor_occupancy ) { - std::string title = "Number" + - threshold_histogram_title_snippet(m_occupancy_thresholds.at(det)) - + m_data_name_base + " in "; - factory_ptr.reset(new LWHist1DFactory<TH1I_LW>(title.c_str(),128,-0.5,127.5)); - factory_ptr->SetXTitle("Channel"); - feb_histogram_factories[det][occ_h] = factory_ptr; - } - - if ( m_monitor_signal ) { - std::string title= "Average Energy (MeV)" + - threshold_histogram_title_snippet( m_signal_thresholds.at(det) ) + - m_data_name_base + " in "; - factory_ptr.reset( new LWHistProfileFactory(title.c_str(), 128, -0.5, 127.5) ); - factory_ptr->SetXTitle("Channel"); - factory_ptr->SetYTitle("Average Signal (MeV)"); - feb_histogram_factories[det][sig_h] = factory_ptr; - } - - if ( m_monitor_positive_noise ) { - std::string title= "Percentage of events above positive " + - threshold_histogram_title_snippet(m_pos_noise_thresholds.at(det))+ - m_data_name_base + " in "; - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(title.c_str(),128, -0.5, 127.5)); - factory_ptr->SetXTitle("Channel"); - factory_ptr->SetYTitle("Percentage Accepted"); - feb_histogram_factories[det][pos_noise_h] = factory_ptr; - } - - if ( m_monitor_negative_noise ) { - std::string title= "Percentage of events below negative " + - threshold_histogram_title_snippet(m_neg_noise_thresholds.at(det)) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(title.c_str(),128, -0.5, 127.5)); - factory_ptr->SetXTitle("Channel"); - factory_ptr->SetYTitle("Percentage Accepted"); - feb_histogram_factories[det][neg_noise_h] = factory_ptr; - } - - if ( m_monitor_time ) { - std::string title= "Time (ns)" + - threshold_histogram_title_snippet( m_time_threshold ) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(title.c_str(),101, -50.5, 50.5)); - factory_ptr->SetXTitle( "Time (ns)" ); - feb_histogram_factories[det][time_h] = factory_ptr; - } - - if ( m_monitor_quality ) { - std::string title = "Perceantage of events above " + - std::to_string( m_quality_threshold ) + " q-factor as" + - " function of " + m_data_name_base + " in "; - factory_ptr.reset(new LWHist1DFactory<TH1I_LW>(title.c_str(),128,-0.5,127.5)); - factory_ptr->SetXTitle( "Quality Factor" ); - feb_histogram_factories[det][quality_h] = factory_ptr; - } - } - } - - if ( m_monitor_feedthroughs ) { - for( const Detector &det : detectors ) { - - int n_slots = n_slots_in_feedthroughs( det ); - double x_slots_max = double( n_slots ) + 0.5; - - if ( m_monitor_occupancy ) { - std::string title = "Number" + - threshold_histogram_title_snippet( m_occupancy_thresholds.at(det) ) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist2DFactory<TH2I_LW>(title.c_str(),128, -0.5, 127.5, n_slots, 0.5, x_slots_max)); - factory_ptr->SetXTitle( "Channel" ); - factory_ptr->SetYTitle( "Front End Board" ); - ft_histogram_factories[det][occ_h] = factory_ptr; - } - - if ( m_monitor_signal ) { - std::string title = "Mean Energy (MeV)" + - threshold_histogram_title_snippet( m_signal_thresholds.at(det) ) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHistProfile2DFactory(title.c_str(),128, -0.5, 127.5, n_slots, 0.5, x_slots_max )); - factory_ptr->SetXTitle("Channel"); - factory_ptr->SetYTitle("Front End Board"); - factory_ptr->SetZTitle("Average Signal (MeV)"); - ft_histogram_factories[det][sig_h] = factory_ptr; - } - - if ( m_monitor_positive_noise ) { - std::string title = "Percentage of events above " + - threshold_histogram_title_snippet( m_pos_noise_thresholds.at(det) ) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist2DFactory<TH2F_LW>(title.c_str(),128, -0.5, 127.5, n_slots, 0.5, x_slots_max )); - factory_ptr->SetXTitle( "Channel" ); - factory_ptr->SetYTitle( "Front End Board" ); - factory_ptr->SetZTitle( "Percentage Accepted" ); - ft_histogram_factories[det][pos_noise_h] = factory_ptr; - } - - if ( m_monitor_negative_noise ) { - std::string title = "Percentage of events below " + - threshold_histogram_title_snippet( m_neg_noise_thresholds.at(det) ) + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist2DFactory<TH2F_LW>(title.c_str(), 128, -0.5, 127.5, n_slots, 0.5, x_slots_max )); - factory_ptr->SetXTitle( "Channel" ); - factory_ptr->SetYTitle( "Front End Board" ); - factory_ptr->SetZTitle( "Percentage Accepted" ); - ft_histogram_factories[det][neg_noise_h] = factory_ptr; - } - - if ( m_monitor_quality ) { - std::string title = "Percentage of events above " + - std::to_string( m_quality_threshold ) + " q-factor as a function of " + - m_data_name_base + " in "; - factory_ptr.reset(new LWHist2DFactory<TH2F_LW>(title.c_str(), 128, -0.5, 127.5, n_slots, 0.5, x_slots_max )); - factory_ptr->SetXTitle( "Channel" ); - factory_ptr->SetYTitle( "Front End Board" ); - factory_ptr->SetZTitle( "Percentage Accepted" ); - ft_histogram_factories[det][quality_h] = factory_ptr; - } - } - } - - - if ( m_monitor_detectors ) { - - for( Detector det : detectors ) { - - std::vector<double> axis = detector_superslot_axis( det, m_lar_online_id_ptr ); - int n_bins = axis.size() - 1; - - if ( m_monitor_occupancy ) { - std::string title = "Number" + threshold_histogram_title_snippet( m_occupancy_thresholds.at(det) ) + - "FEB and " + m_data_name_base + " in " + detector_str( det ); - factory_ptr.reset(new LWHist2DFactory<TH2I_LW>(title.c_str(), n_bins, &axis[0], 128, -0.5, 127.5 )); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][occ_h] = factory_ptr; - } - - if ( m_monitor_signal ) { - std::string title = "Average Energy (MeV)" + threshold_histogram_title_snippet( m_signal_thresholds.at(det) ) + - "FEB and " + m_data_name_base + " in " + detector_str( det ) + " (no LArEventInfo::ERROR)"; - factory_ptr.reset(new LWHistProfile2DFactory(title.c_str(), n_bins, &axis[0],128, -0.5, 127.5)); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->SetZTitle("Average Energy (MeV)"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][sig_h] = factory_ptr; - - title = "Average gain FEB and " + m_data_name_base + " in " + detector_str( det ) + " (no LArEventInfo::ERROR)"; - factory_ptr.reset(new LWHistProfile2DFactory(title.c_str(), n_bins, &axis[0],128, -0.5, 127.5)); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->SetZTitle("Average gain"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][gain_h] = factory_ptr; - } - - if ( m_monitor_positive_noise ) { - std::string his_title = "Percentage of events above positive " + - threshold_histogram_title_snippet( m_pos_noise_thresholds.at(det) ) + - "FEB and " + m_data_name_base + " in " + detector_str( det ) + " (no LArEventInfo::ERROR)"; - factory_ptr.reset(new LWHistProfile2DFactory(his_title.c_str(), n_bins, &axis[0], 128, -0.5, 127.5 )); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->SetZTitle("Percentage Accepted"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][pos_noise_h] = factory_ptr; - } - - if ( m_monitor_negative_noise ) { - std::string his_title = "Percentage of events below negative " + - threshold_histogram_title_snippet( m_neg_noise_thresholds.at(det) ) + - "FEB and " + m_data_name_base + " in " + detector_str( det ) + " (no LArEventInfo::ERROR)"; - factory_ptr.reset(new LWHistProfile2DFactory(his_title.c_str(),n_bins,&axis[0],128,-0.5,127.5 )); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->SetZTitle("Percentage Accepted"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][neg_noise_h] = factory_ptr; - } - - - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_title = "Yield of channels with +E > " + std::to_string( m_noise_threshold ) +" #sigma -"+ detector_str( det ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),375, 0., 7.5 )); - factory_ptr->SetXTitle("Percent of Channels"); - factory_ptr->SetYTitle("Number of Events per 0.02 %"); - det_histogram_factories[det][noise_fraction_h] = factory_ptr; - } - - - if ( m_monitor_burst){ - // if ( m_monitor_negative_noise ) { - std::string his_title = "Yield of channels with -E > " + std::to_string( m_noise_threshold ) +" #sigma - " + detector_str( det ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),375, 0., 7.5 )); - factory_ptr->SetXTitle("Percent of Channels"); - factory_ptr->SetYTitle("Number of Events per 0.02 %"); - det_histogram_factories[det][noise_fraction_Neg_h] = factory_ptr; - } - - // Noise fraction (Positive only) histogram when not flagged by LArNoisyROAlg_W - if ( m_monitor_burst){ - // if ( m_monitor_negative_noise ) { - std::string his_title = "Yield of channels with +E > " + std::to_string( m_noise_threshold ) +" #sigma (no LArNoisyRO_StdOpt) -"+ detector_str( det ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),375, 0., 7.5 )); - factory_ptr->SetXTitle("Percent of Channels"); - factory_ptr->SetYTitle("Number of Events per 0.02 %"); - det_histogram_factories[det][noise_fraction_W_h] = factory_ptr; - } - - - // Noise fraction (Positive only) histogram when not flagged by LArNoisyROAlg - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_title = "Yield of channels with +E > " + std::to_string( m_noise_threshold ) +" #sigma (no LArNoisyRO_Std) -"+ detector_str( det ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),375, 0., 7.5 )); - factory_ptr->SetXTitle("Percent of Channels"); - factory_ptr->SetYTitle("Number of Events per 0.02 %"); - det_histogram_factories[det][noise_fraction_NoLArNoisyRO_h] = factory_ptr; - } - - // Noise fraction (Positive only) histogram when flagged by LArNoisyROAlg but without time bit set (time veto) - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_title = "Yield of channels with +E > " + std::to_string( m_noise_threshold ) +" #sigma (time vetoed) -"+ detector_str( det ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),375, 0., 7.5 )); - factory_ptr->SetXTitle("Percent of Channels"); - factory_ptr->SetYTitle("Number of Events per 0.02 %"); - det_histogram_factories[det][noise_fraction_TimeVetoLArNoisyRO_h] = factory_ptr; - } - - if ( m_monitor_signal ) { - std::string his_title = "Energy sum (time vetoed) " + detector_str( det ); - factory_ptr.reset(new LWHistProfileFactory(his_title.c_str(),m_n_lumi_blocks, 0.5, double(m_n_lumi_blocks)+0.5 )); - factory_ptr->SetXTitle("Luminosity Block"); - factory_ptr->SetYTitle("Mean total energy(MeV)"); - det_histogram_factories[det][pedestal_evolution_h] = factory_ptr; - } - - if ( m_monitor_burst ) { - std::string his_title = "# of Events With Y_{3#sigma}>" + std::string( Form( "%.2f", m_noise_burst_percent_thresholds[det]) ) + " % - " + detector_str(det); - // TH1F graft( ("det_burst_graft"+detector_str(det)).c_str(), his_title.c_str(), 1440, -0.5, 1439.5 ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),m_n_lumi_blocks, 0.5, double(m_n_lumi_blocks)+0.5)); - factory_ptr->SetXTitle("Luminosity Block"); - factory_ptr->SetYTitle("Number of Events per lumi block"); - det_histogram_factories[det][burst_h] = factory_ptr; - } - - // With Time Veto - if ( m_monitor_burst ) { - std::string his_title = "# of Events With Y_{3#sigma}>" + std::string( Form( "%.2f", m_noise_burst_percent_thresholds[det]) ) + " % (time vetoed)- " + detector_str(det); - // TH1F graft( ("det_burst_graft"+detector_str(det)).c_str(), his_title.c_str(), 1440, -0.5, 1439.5 ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),m_n_lumi_blocks, 0.5, double(m_n_lumi_blocks)+0.5)); - factory_ptr->SetXTitle("Luminosity Block"); - factory_ptr->SetYTitle("Number of Events per lumi block"); - det_histogram_factories[det][timeVetoBurst_h] = factory_ptr; - } - - - if ( m_monitor_time ) { - std::string his_title = "Average time of " + m_data_name_base + - " in each FEB of the " + detector_str(det) + " Reporting E > " + - std::to_string( m_time_threshold ) + " #sigma"; - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),101, -50.5, 50.5)); - factory_ptr->SetXTitle("<t_{FEB}> - <t_{event}> (ns)"); - factory_ptr->SetYTitle("Number of FEBs per ns"); - det_histogram_factories[det][mean_feb_time_h] = factory_ptr; - } - - if ( m_monitor_quality ) { - std::string his_title = "Percentage of events above " + - std::to_string( m_quality_threshold ) +" q-factor as function"+ - " of FEB and " + m_data_name_base + " in " + detector_str( det ) + " (no LArEventInfo::ERROR)"; - factory_ptr.reset(new LWHistProfile2DFactory(his_title.c_str(),n_bins,&axis[0],128,-0.5,127.5 )); - factory_ptr->SetXTitle("Halfcrate (+ increasing slot)"); - factory_ptr->SetYTitle("Channel"); - factory_ptr->SetZTitle("Percentage Accepted"); - factory_ptr->setXAxisBinLabelsAllFebs(m_lar_online_id_str_helper_ptr,detector_str(det)); - det_histogram_factories[det][quality_h] = factory_ptr; - } - - if ( m_monitor_quality ) { - std::string his_title = "Number of Channels in the " + detector_str( det ) + - " with q-factor > " + std::to_string( m_quality_threshold ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),50, -0.5, 49.5 )); - factory_ptr->SetXTitle("Number of Channels"); - factory_ptr->SetYTitle("Number of Events per channel"); - det_histogram_factories[det][quality_nChannel_h] = factory_ptr; - } - - - if ( m_monitor_quality ) { - std::string his_title = "Number Of Events With More Than " + - std::string( Form( "%.2f", m_noise_burst_percent_thresholds[det]) ) + - " % Of All Channels In The " + detector_str(det) + " Reporting q-factor > " + - std::to_string( m_quality_threshold ); - factory_ptr.reset(new LWHist1DFactory<TH1F_LW>(his_title.c_str(),m_n_lumi_blocks, 0.5, double(m_n_lumi_blocks)+0.5)); - factory_ptr->SetXTitle("Luminosity Block"); - factory_ptr->SetYTitle("Number of Events per lumi block"); - det_histogram_factories[det][quality_burst_h] = factory_ptr; - } - - if ( m_monitor_signal ) { - std::string his_title = "Energy sum per bunch crossing - " + detector_str( det ); - factory_ptr.reset(new LWHistProfileFactory(his_title.c_str(),3564, 0.5, 3564.5 )); - factory_ptr->SetXTitle("Bunch Crossing Number"); - factory_ptr->SetYTitle("Mean total energy (MeV)"); - det_histogram_factories[det][sumE_vs_BCID_h] = factory_ptr; - } - - } - - } - - - for ( citer_vect_hwid itr_feb = m_lar_online_id_ptr->feb_begin(); - itr_feb != end_feb ; ++itr_feb) { - - try { - - HWIdentifier feedthrough_online_id = m_lar_online_id_ptr->feedthrough_Id(*itr_feb); - IdentifierHash feb_hash = m_lar_online_id_ptr->feb_Hash( *itr_feb ); - IdentifierHash ft_hash = m_feb_hash_to_ft_hash.at( feb_hash ); - Detector feb_pos = m_feb_hash_to_detector.at( feb_hash ); - std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > &the_feb_histo_factories = feb_histogram_factories[feb_pos]; - std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > &the_ft_histo_factories = ft_histogram_factories[feb_pos]; - - std::string dir_name = m_path + "/" + detector_str( feb_pos ); - - // --- Book and Register per FEB histograms --- - if ( m_monitor_febs ) { - - std::string feb_name = m_lar_online_id_str_helper_ptr->feb_str( *itr_feb ); - std::string his_name; - - if ( m_monitor_occupancy ) { - std::string dir_name_occ = dir_name + "/per_feb_occupancy"; - his_name = detector_str( feb_pos ) + "Occupancy"+feb_name; - LWHist* histo = the_feb_histo_factories[occ_h]->create(his_name,feb_name); - if ( registerHistogram( histo, dir_name_occ ) ) - per_feb_occu.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - if ( m_monitor_signal ) { - std::string dir_name_sig = dir_name + "/per_feb_signal"; - his_name = detector_str( feb_pos ) + "Signal" + feb_name + "_AVG"; - LWHist* histo = ( the_feb_histo_factories[sig_h]->create(his_name,feb_name) ); - if ( registerHistogram( histo,dir_name_sig ) ) - per_feb_sign.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - if ( m_monitor_positive_noise ) { - std::string dir_name_acc = dir_name + "/per_feb_acceptance"; - his_name = detector_str( feb_pos ) + "Acceptance" + feb_name + "_AVG"; - LWHist* histo = ( the_feb_histo_factories[pos_noise_h]->create(his_name,feb_name) ); - if ( registerHistogram( histo, dir_name_acc, "effAsPerCent" ) ) - per_feb_posn.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - if ( m_monitor_negative_noise ) { - std::string dir_name_acc = dir_name + "/per_feb_noise_acceptance"; - his_name = detector_str( feb_pos ) + "NoiseAcceptance" + feb_name + "_AVG"; - LWHist* histo = ( the_feb_histo_factories[neg_noise_h]->create(his_name,feb_name) ); - - if ( registerHistogram( histo, dir_name_acc, "effAsPerCent" ) ) - per_feb_negn.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - if ( m_monitor_time ) { - std::string this_dir_name = dir_name + "/per_feb_time"; - his_name = detector_str( feb_pos ) + "Time" + feb_name; - LWHist* histo = ( the_feb_histo_factories[time_h]->create(his_name,feb_name) ); - if ( registerHistogram( histo, this_dir_name ) ) - per_feb_time.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - if ( m_monitor_quality ) { - std::string this_dir_name = dir_name + "/per_feb_quality"; - his_name = detector_str( feb_pos ) + "_quality_" + feb_name; - LWHist *histo = ( the_feb_histo_factories[quality_h]->create(his_name,feb_name) ); - if ( registerHistogram( histo, this_dir_name ) ) - per_feb_qual.at( feb_hash ) = shared_ptr<IHistoProxyBase>( createLWHistProxy( histo ) ); - else return StatusCode::FAILURE; - } - - } - - // --- Book and register per Feedthrough Histograms --- - if ( m_monitor_feedthroughs ) { - - ATH_MSG_DEBUG( " - Booking per feedthrough histos" ); - - // --- Look for existing feedthough histogram --- - bool is_new_ft = false; - map_det_idhash_str_th2::const_iterator itr_det_ft_type_hists; - map_idhash_str_th2::const_iterator itr_idhash_str_th2; - - // --- Have feedthrough histograms been booked for this - // --- detector? - itr_det_ft_type_hists = det_ft_type_hists.find( feb_pos ); - if ( itr_det_ft_type_hists == det_ft_type_hists.end() ) - is_new_ft = true; - - // --- If histograms exist for this detector, do they exist - // --- for this feedthrough in this detector? - if ( !is_new_ft ) { - itr_idhash_str_th2 = (itr_det_ft_type_hists->second).find( ft_hash ); - if ( itr_idhash_str_th2 == (itr_det_ft_type_hists->second).end() ) - is_new_ft = true; - } - - // --- If histos already booked use same feedthrough histo --- - if ( !is_new_ft ) { - - if ( m_monitor_occupancy ) { - per_ft_occu.at( feb_hash ) = det_ft_type_hists[feb_pos][ft_hash][occ_h]; - } - - if ( m_monitor_signal ) { - per_ft_sign.at( feb_hash ) = det_ft_type_hists[feb_pos][ft_hash][sig_h]; - } - - if ( m_monitor_positive_noise ) { - per_ft_posn.at( feb_hash ) = det_ft_type_hists[feb_pos][ft_hash][pos_noise_h]; - } - - if ( m_monitor_negative_noise ) { - per_ft_negn.at( feb_hash ) = det_ft_type_hists[feb_pos][ft_hash][neg_noise_h]; - } - - if ( m_monitor_quality ) { - per_ft_qual.at( feb_hash ) = det_ft_type_hists[feb_pos][ft_hash][quality_h]; - } - - } else { - - std::string ft_name = m_lar_online_id_str_helper_ptr->feedthrough_str( *itr_feb ); - - // --- new occupancy histogram --- - if ( m_monitor_occupancy ) { - std::string the_dir_name = dir_name + "/per_ft_occupancy"; - std::string his_name = detector_str( feb_pos ) + "Occupancy" + ft_name; - LWHist2D* histo = static_cast<LWHist2D*>( the_ft_histo_factories[occ_h]->create(his_name,ft_name) ); - m_lar_online_id_str_helper_ptr->setAxisBinLabelsFebs( histo->GetYaxis(), feedthrough_online_id ); - if ( registerHistogram( histo, the_dir_name ) ) { - shared_ptr<IHistoProxyBase> b( createLWHistProxy(histo) ); - per_ft_occu.at( feb_hash ) = b; - det_ft_type_hists[feb_pos][ft_hash][occ_h] = b; - } else return StatusCode::FAILURE; - } - - // --- new signal histogram --- - if ( m_monitor_signal ) { - std::string the_dir_name = dir_name + "/per_ft_signal"; - std::string his_name = detector_str( feb_pos ) + "Signal" + ft_name + "_AVG"; - LWHist2D* histo = static_cast<LWHist2D*>( the_ft_histo_factories[sig_h]->create(his_name,ft_name) ); - m_lar_online_id_str_helper_ptr->setAxisBinLabelsFebs( histo->GetYaxis(), feedthrough_online_id ); - if ( registerHistogram( histo, the_dir_name ) ) { - shared_ptr<IHistoProxyBase> b( createLWHistProxy(histo) ); - per_ft_sign.at( feb_hash ) = b; - det_ft_type_hists[feb_pos][ft_hash][sig_h] = b; - } else return StatusCode::FAILURE; - } - - // --- new acceptance histogram --- - if ( m_monitor_positive_noise ) { - std::string the_dir_name = dir_name + "/per_ft_acceptance"; - std::string his_name = detector_str( feb_pos ) + "Acceptance" + ft_name + "_AVG"; - LWHist2D* histo = static_cast<LWHist2D*>( the_ft_histo_factories[pos_noise_h]->create(his_name,ft_name) ); - m_lar_online_id_str_helper_ptr->setAxisBinLabelsFebs( histo->GetYaxis(), feedthrough_online_id ); - if ( registerHistogram( histo, the_dir_name, "effAsPerCent" ) ) { - shared_ptr<IHistoProxyBase> b( createLWHistProxy(histo) ); - per_ft_posn.at( feb_hash ) = b; - det_ft_type_hists[feb_pos][ft_hash][pos_noise_h] = b; - } else return StatusCode::FAILURE; - } - - // --- new per feedthrough noise acceptance --- - if ( m_monitor_negative_noise ) { - - std::string the_dir_name = dir_name + "/per_ft_noise_acceptance"; - std::string his_name = detector_str( feb_pos ) + "NoiseAcceptance" + ft_name + "_AVG"; - LWHist2D* histo = static_cast<LWHist2D*>( the_ft_histo_factories[neg_noise_h]->create(his_name,ft_name) ); - m_lar_online_id_str_helper_ptr->setAxisBinLabelsFebs( histo->GetYaxis(), feedthrough_online_id ); - if ( registerHistogram( histo, the_dir_name, "effAsPerCent" ) ) { - shared_ptr<IHistoProxyBase> b( createLWHistProxy(histo) ); - per_ft_negn.at( feb_hash ) = b; - det_ft_type_hists[feb_pos][ft_hash][neg_noise_h] = b; - } else return StatusCode::FAILURE; - } - - // --- new per feedthrough quality acceptance --- - if ( m_monitor_quality ) { - - std::string the_dir_name = dir_name + "/per_ft_quality"; - std::string his_name = detector_str( feb_pos ) + "Quality" + ft_name + "_AVG"; - LWHist2D* histo = static_cast<LWHist2D*>( the_ft_histo_factories[quality_h]->create(his_name,ft_name) ); - m_lar_online_id_str_helper_ptr->setAxisBinLabelsFebs( histo->GetYaxis(), feedthrough_online_id ); - if ( registerHistogram( histo, the_dir_name, "effAsPerCent" ) ) { - shared_ptr<IHistoProxyBase> b( createLWHistProxy(histo) ); - per_ft_qual.at( feb_hash ) = b; - det_ft_type_hists[feb_pos][ft_hash][quality_h] = b; - } else return StatusCode::FAILURE; - - } - - } // --- end new feedthrough booking --- - - } // --- end feedthrough booking --- - - } catch ( std::out_of_range &err ){ - - ATH_MSG_WARNING( "FEB hash out of range: " << err.what() ); - - } - - } // --- end loop over FEBs --- - - // --- per detector histograms --- - if ( m_monitor_detectors ) { - - // --- occupancy histograms --- - for( Detector det : detectors ) { - - std::map<RawChHisto,shared_ptr<LWHistFactoryBase> > &the_det_histo_factories = det_histogram_factories[det]; - - if ( m_monitor_occupancy ) { - std::string his_name = detector_str( det ) + "_occupancy"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist2D* histo = static_cast<LWHist2D*>( the_det_histo_factories[occ_h]->create( his_name ) ); - if ( registerHistogram( histo, dir_name ) ) { -// pair_det_th2ptr dummy = make_pair(det, histo ); -// per_det_occu.insert( dummy ); - per_det_occu[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - if ( m_monitor_signal ) { - std::string his_name = detector_str( det ) + "_signal" + "_AVG"; - std::string dir_name = m_path + "/" + detector_str( det ); - TProfile2D_LW* histo = static_cast<TProfile2D_LW*>( the_det_histo_factories[sig_h]->create( his_name ) ); - if ( registerHistogram( histo, dir_name ) ) { -// pair_det_th2ptr dummy = make_pair(det, histo ); -// per_det_sign.insert( dummy ); - per_det_sign[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - - his_name = detector_str( det ) + "_gain"; - dir_name = m_path + "/" + detector_str( det ); - TProfile2D_LW* histog = static_cast<TProfile2D_LW*>( the_det_histo_factories[gain_h]->create( his_name ) ); - if ( registerHistogram( histog, dir_name ) ) { -// pair_det_th2ptr dummy = make_pair(det, histo ); -// per_det_sign.insert( dummy ); - per_det_gain[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histog) ); - } else return StatusCode::FAILURE; - } - - if ( m_monitor_positive_noise ) { - std::string his_name = detector_str( det ) + "_acceptance" + "_AVG"; - std::string dir_name = m_path + "/" + detector_str( det ); - TProfile2D_LW* histo = static_cast<TProfile2D_LW*>( the_det_histo_factories[pos_noise_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - // if ( registerHistogram( histo, dir_name, "", "effAsPerCent" ) ) { - if ( registerHistogram( histo, dir_name ) ) { - per_det_posn[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - - } - - if ( m_monitor_negative_noise ) { - std::string his_name = detector_str( det ) + "_noise_acceptance" + "_AVG"; - std::string dir_name = m_path + "/" + detector_str( det ); - TProfile2D_LW* histo = static_cast<TProfile2D_LW*>( the_det_histo_factories[neg_noise_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_negn[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - - if ( m_monitor_time ) { - std::string his_name = detector_str( det ) + "_mean_feb_time"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[mean_feb_time_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_mfebt[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - if ( m_monitor_quality ) { - std::string his_name = detector_str( det ) + "_quality" + "_AVG"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist2D* histo = static_cast<LWHist2D*>( the_det_histo_factories[quality_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_qual[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - - } - - if ( m_monitor_quality ) { - std::string his_name = detector_str( det ) + "_quality_nChannel"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[quality_nChannel_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_qnChan[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - - if ( m_monitor_quality ) { - std::string his_name = detector_str( det ) + "_quality_burst"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[quality_burst_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_qburs[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - // per_det_nfra - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_name = detector_str( det ) + "_noise_fraction"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[noise_fraction_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_nfrac[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - if ( m_monitor_burst){ - // if ( m_monitor_negative_noise ) { - std::string his_name = detector_str( det ) + "_noise_fraction_Neg"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[noise_fraction_Neg_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_nfracNeg[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_name = detector_str( det ) + "_noise_fraction_W"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[noise_fraction_W_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_nfrac_W[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - - - // per_det_nfra (for positive energy only ) when Not flagged by LArNoisyROAlg - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_name = detector_str( det ) + "_noise_fraction_NoLArNoisyRO"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[noise_fraction_NoLArNoisyRO_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_nfracNoLArNoisyRO[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - // per_det_nfra (for positive energy only ) when Not flagged by LArNoisyROAlg within time window of 500ms ( no LArEventInfo::ERROR) - if ( m_monitor_burst){ - // if ( m_monitor_positive_noise ) { - std::string his_name = detector_str( det ) + "_noise_fraction_TimeVetoLArNoisyRO"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[noise_fraction_TimeVetoLArNoisyRO_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_nfracTimeVetoLArNoisyRO[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - // per detector pedestal evolution - if ( m_monitor_signal ) { - std::string his_name = detector_str( det ) + "_pedestal_evolution"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[pedestal_evolution_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_pede[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - // per detector sumE vs BCID - if ( m_monitor_signal ) { - std::string his_name = detector_str( det ) + "_sumE_vs_BCID"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[sumE_vs_BCID_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_sumE_BCID[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - if ( m_monitor_burst ) { - std::string his_name = detector_str( det ) + "_burst"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[burst_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_burs[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - // With LArNoisyRO Time Veto - if ( m_monitor_burst ) { - std::string his_name = detector_str( det ) + "_timeVetoBurst"; - std::string dir_name = m_path + "/" + detector_str( det ); - LWHist* histo = ( the_det_histo_factories[timeVetoBurst_h]->create( his_name ) ); - //TK: REMOVED//histo->Sumw2(); - if ( registerHistogram( histo, dir_name ) ) { - per_det_timeVetoBurs[det] = shared_ptr<IHistoProxyBase>( createLWHistProxy(histo) ); - } else return StatusCode::FAILURE; - } - - } - - } // --- end detector histograms --- - - } // --- end booking for monitoring interval --- - - ATH_MSG_DEBUG( "===> end " << name() << "::bookHistograms <=== " ); - - return StatusCode::SUCCESS; - -} - - -/*----------------------------------------------------------------------------*/ -StatusCode LArRawChannelMonTool::fillHistograms() -{ - - ATH_MSG_DEBUG( "===> start " << name() << "::fillHistograms boulou <=== " ); - - const EventContext& ctx = Gaudi::Hive::currentContext(); - - // -- Set ATLAS Ready Filter - setIsATLASReady(); - // ATH_MSG_DEBUG( "Vikas Says: ATLAS READY Flag is set to " << isATLASReady() ); - - // --- check set in bookHistogram --- - if ( !m_has_lar_raw_channels ) return StatusCode::SUCCESS; - - SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx}; - ATH_CHECK(caloMgrHandle.isValid()); - const CaloDetDescrManager *ddman = *caloMgrHandle; - - // --- retrieve raw channels --- - SG::ReadHandle<LArRawChannelContainer> raw_channels (m_LArRawChannel_container_key, ctx); - if ( !raw_channels.isValid() ) { - - ATH_MSG_WARNING( "Cannot retrieve LArRawChannelContainer with key: " - << m_LArRawChannel_container_key.key() ); - return StatusCode::FAILURE; - - } - - // --- retrieve event information --- - SG::ReadHandle<xAOD::EventInfo> event_info (m_EventInfoKey, ctx); - uint32_t bunch_crossing_id = 0; - uint32_t lumi_block = 0; - bool isEventFlaggedByLArNoisyROAlg = false; // keep default as false - bool isEventFlaggedByLArNoisyROAlgInTimeW = false; // keep deault as false - bool isEventFlaggedByLArNoisyROAlg_W =false; // keep deault as false - // double event_time_minutes = -1; - if ( event_info.isValid() ) { - - //ATH_MSG_DEBUG( "event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,0"<<event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,0) ); - // Check for LArNoisyROAlg event info - // if (event_info->errorState(EventInfo::LAr) == EventInfo::Warning) { - if ( event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::BADFEBS) ) { - isEventFlaggedByLArNoisyROAlg = true; - ATH_MSG_DEBUG( " !!! Noisy event found from LArNoisyROAlg !!!" ); - } - - - if ( event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,LArEventBitInfo::BADFEBS_W) ) { - isEventFlaggedByLArNoisyROAlg_W = true; - ATH_MSG_DEBUG( " !!! Noisy event found from LArNoisyROAlg_W !!!" ); - } - - - if ( event_info->isEventFlagBitSet(xAOD::EventInfo::LAr,3) ) { - isEventFlaggedByLArNoisyROAlgInTimeW = true; - ATH_MSG_DEBUG( " !!! Noisy event found by LArNoisyROAlg in Time window of 500ms!!!" ); - } - - - // bunch crossing ID: - bunch_crossing_id = event_info->bcid(); - - // luminosity block number - lumi_block = event_info->lumiBlock(); - - // event time (GMT). note: - // - time_stamp() returns Unix time (No of seconds since 1/1/1970) - // - 86400s in a day - // event_time_minutes = (event_info->event_ID()->time_stamp()%86400) / 60.; - - - - if (m_noise_streams_set.empty()) m_is_noise_event=true; - const std::vector<xAOD::EventInfo::StreamTag>& event_stream_tags=event_info->streamTags(); - for (const xAOD::EventInfo::StreamTag& stream_tag: event_stream_tags) { - if (m_noise_streams_set.find(stream_tag.name())!=m_noise_streams_set.end()) { - m_is_noise_event = true; - break; - } - } - - /* - // Added by Louis Stream Aware info... - const TriggerInfo* trig; - trig = event_info->triggerInfo(); - if( trig ) { - m_is_noise_event = m_noise_streams.size() == 0; - //Loop on the JO defined streams - std::vector<TriggerInfo::StreamTag> event_stream_tags = trig->streamTags(); - for( const std::string & stream_name : m_noise_streams ) { - for( const TriggerInfo::StreamTag stream_tag : event_stream_tags ) { - ATH_MSG_DEBUG( "Keeping Stream Tag: " << stream_tag.type() << "_" << stream_tag.name() ); - if( stream_name == stream_tag.name()) { - m_is_noise_event = true; - break; - } - } - } - } - */ - } else ATH_MSG_DEBUG( "Cannot retrieve EventInfo" ); - - - ++m_event_counter; - if ( m_is_noise_event ) ++m_noise_stream_event_counter; - - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_occu = m_per_feb_hists[occ_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_sign = m_per_feb_hists[sig_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_posn = m_per_feb_hists[pos_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_negn = m_per_feb_hists[neg_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_time = m_per_feb_hists[time_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_feb_qual = m_per_feb_hists[quality_h]; - - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_occu = m_per_feedthrough_hists[occ_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_sign = m_per_feedthrough_hists[sig_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_posn = m_per_feedthrough_hists[pos_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_negn = m_per_feedthrough_hists[neg_noise_h]; - std::vector<shared_ptr<IHistoProxyBase> >& per_ft_qual = m_per_feedthrough_hists[quality_h]; - - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_occu = m_per_detector_hists[occ_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_sign = m_per_detector_hists[sig_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_gain = m_per_detector_hists[gain_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_posn = m_per_detector_hists[pos_noise_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_negn = m_per_detector_hists[neg_noise_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qual = m_per_detector_hists[quality_h]; - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_mfebt= m_per_detector_hists[mean_feb_time_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qnChan= m_per_detector_hists[quality_nChannel_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_qburs= m_per_detector_hists[quality_burst_h]; - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nChan_qburs= m_per_detector_hists[quality_nChannel_burst_h]; - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_mevbc= m_per_detector_hists[E_v_bc_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfrac= m_per_detector_hists[noise_fraction_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracNeg= m_per_detector_hists[noise_fraction_Neg_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfrac_W= m_per_detector_hists[noise_fraction_W_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracNoLArNoisyRO= m_per_detector_hists[noise_fraction_NoLArNoisyRO_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_nfracTimeVetoLArNoisyRO= m_per_detector_hists[noise_fraction_TimeVetoLArNoisyRO_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_burs = m_per_detector_hists[burst_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_timeVetoBurs = m_per_detector_hists[timeVetoBurst_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_pede = m_per_detector_hists[pedestal_evolution_h]; - std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_sumE_BCID = m_per_detector_hists[sumE_vs_BCID_h]; - - shared_ptr<IHistoProxyBase> perdethist_occu; - shared_ptr<IHistoProxyBase> perdethist_sign; - shared_ptr<IHistoProxyBase> perdethist_gain; - shared_ptr<IHistoProxyBase> perdethist_posn; - shared_ptr<IHistoProxyBase> perdethist_negn; - shared_ptr<IHistoProxyBase> perdethist_qual; - // shared_ptr<IHistoProxyBase> perdethist_mevbc; - double detthreshold_occupancy(0); - double detthreshold_signal(0); - double detthreshold_pos_noise(0); - double detthreshold_neg_noise(0); - - // TProfile2D_LW* perdetsamplinghist_eta_phi_signal(0); - // TH1I_LW* perdetsamplinghist_phi_occupancy(0); - // TH1I_LW* perdetsamplinghist_eta_occupancy(0); - - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_dtdet= m_per_detector_hists["det_time_diff"];//VB - // std::map<Detector,shared_ptr<IHistoProxyBase> >& per_det_lbdt = m_per_detector_hists["det_lb_time_diff"];// VB - - // int channels_above_bcid_threshold = 0; - - std::map<Detector,unsigned int> det_n_noisy_channels{{EMBA,0},{EMECA,0},{HECA,0},{FCALA,0},{EMBC,0},{EMECC,0},{HECC,0},{FCALC,0}}; - - std::map<Detector,unsigned int> det_n_noisy_channels_Neg{{EMBA,0},{EMECA,0},{HECA,0},{FCALA,0},{EMBC,0},{EMECC,0},{HECC,0},{FCALC,0}}; - - std::map<Detector,unsigned int> det_n_possibly_problematic_channels{{EMBA,0},{EMECA,0},{HECA,0},{FCALA,0},{EMBC,0},{EMECC,0},{HECC,0},{FCALC,0}}; - - MeanCalculator event_mean_time; - std::map<Detector,MeanCalculator> mean_detector_times; - std::map<Detector,std::map<HWIdentifier, MeanCalculator> > mean_feb_times; - std::map<Detector,double> per_detector_total_energy{{EMBA,0.},{EMECA,0.},{HECA,0.},{FCALA,0.},{EMBC,0.},{EMECC,0.},{HECC,0.},{FCALC,0.}}; - - - Detector lastdet(UNDEF); - //bool firstsampling=true; - //Sampling lastsampling(presampler); - - SG::ReadCondHandle<CaloNoise> noiseH (m_noiseKey, ctx); - - SG::ReadCondHandle<LArBadChannelCont> bcContHdl (m_bcContKey, ctx); - const LArBadChannelCont* bcCont={*bcContHdl}; - - SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey, ctx); - - // --- Loop over RawChannels --- - for( const LArRawChannel &chan : *raw_channels ){ - - // --- Channel Information --- - HWIdentifier hardware_id = chan.hardwareID(); - - Identifier offline_id; - const CaloDetDescrElement *calo_element_ptr; - HWIdentifier feb_id; - IdentifierHash feb_hash; - unsigned int number; - int slot_number; - int feedthrough_number; - Detector det(UNDEF); - // Sampling sampling; - - float energy; - float time; - float noise; - float significance; - int gain; - - try { - - offline_id = cabling->cnvToIdentifier( hardware_id ); - calo_element_ptr = ddman->get_element( offline_id ); - - // --- skip unconnected channels --- - if ( !calo_element_ptr ) continue; - - // --- skipp masked channels --- - if ( m_bcMask.cellShouldBeMasked(bcCont, hardware_id ) ) continue; - - - // --- monitor properly reconstructed channels only --- - // --- provenance&0x00ff == 0x00a5 : - // raw channels from OFC iteration, all calib constants found in DB - // --- provenance&0x1000 == 0x1000 : - // raw channels from DSP. If no constant loaded in DSP, energy==0 - if ( !( m_db_and_ofc_only || - (chan.provenance()&0x00ff) == 0x00A5 || - (chan.provenance()&0x1000) == 0x1000 ) ) continue; - - feb_id = m_lar_online_id_ptr->feb_Id( hardware_id ); - feb_hash = m_lar_online_id_ptr->feb_Hash( feb_id ); - - det = m_feb_hash_to_detector.at( feb_hash ); - bool detchanged=(det!=lastdet); - if (detchanged) { - //There are ~200k cells, but we only change detector ~10 - //times. Thus the following is a way to cut down on the cpu - //usage due to map lookups (even better would of course be to stop - //using maps!). - shared_ptr<IHistoProxyBase> hnull((IHistoProxyBase*)nullptr); - std::map<Detector,shared_ptr<IHistoProxyBase> >::iterator it; - it = per_det_occu.find(det); perdethist_occu = ((it==per_det_occu.end())?hnull:it->second); - it = per_det_sign.find(det); perdethist_sign = (it==per_det_sign.end()?hnull:it->second); - it = per_det_gain.find(det); perdethist_gain = (it==per_det_gain.end()?hnull:it->second); - it = per_det_posn.find(det); perdethist_posn = (it==per_det_posn.end()?hnull:it->second); - it = per_det_negn.find(det); perdethist_negn = (it==per_det_negn.end()?hnull:it->second); - it = per_det_qual.find(det); perdethist_qual = (it==per_det_qual.end()?hnull:it->second); - // it = per_det_mevbc.find(det); perdethist_mevbc = (it==per_det_mevbc.end()?hnull:it->second); - detthreshold_occupancy = m_occupancy_thresholds.at( det ); - detthreshold_signal = m_signal_thresholds.at( det ); - detthreshold_pos_noise = m_pos_noise_thresholds.at( det ); - detthreshold_neg_noise = m_neg_noise_thresholds.at( det ); - } - - lastdet=det; - // sampling = static_cast<Sampling>( channel_sampling( det, offline_id ) ); - //if ( sampling == -1 ) continue; // skip channel if sampling is undetermined - - slot_number = m_lar_online_id_ptr->slot( hardware_id ); - feedthrough_number = m_lar_online_id_ptr->feedthrough( hardware_id ); - - number = m_lar_online_id_ptr->channel( hardware_id ) - 1; - energy = chan.energy() * MeV ; // energy is in fixed in MeV by DSP - time = chan.time() * picosecond; // time is fixed in ps by DSP - gain = chan.gain(); - //eta = calo_element_ptr->eta(); - //phi = calo_element_ptr->phi(); - // This noise get the value at HIGH gain - // Get hold of noise (electronic + Pileup) at the gain the channel is configured to. - noise = noiseH->getNoise (offline_id, chan.gain()); - - significance = energy / noise ; - //quality = short( chan.quality() ); - - if (detchanged) m_qualitySelector.selectionContext( &m_selectionContext[det] ); - - } catch ( const LArOnlID_Exception &err ) { - - continue; // skip this channel - - } catch ( const std::out_of_range &err ) { - - ATH_MSG_WARNING( "FEB hash out of range. Detector undefined" - << err.what() ); - continue; // skip this channel - - } catch ( const LArID_Exception& err ) { - - ATH_MSG_WARNING( "channel offline id undefined ... skipping" - ); - continue; // skip this channel - - } - - // --- Fill per FEB Histograms --- - if ( m_monitor_febs ) { - - try { - - if ( m_is_noise_event && m_monitor_occupancy && energy > detthreshold_occupancy ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_occu.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number ); - } - - if ( m_is_noise_event && m_monitor_signal && energy > detthreshold_signal ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_sign.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number, energy ); - } - - if ( m_is_noise_event && m_monitor_positive_noise && significance > detthreshold_pos_noise ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_posn.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number ); - } - - if ( m_is_noise_event && m_monitor_negative_noise && (-1.) * significance > detthreshold_neg_noise ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_negn.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number ); - } - - if ( m_monitor_time && significance > m_time_threshold ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_time.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( time ); - } - - if ( m_monitor_quality && m_qualitySelector.Select( chan ) ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_feb_qual.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number ); - } - - } catch ( std::out_of_range &err ) { - - ATH_MSG_WARNING("failed per FEB monitoring "<< err.what() ); - - } catch ( std::bad_cast &err ) { - - ATH_MSG_WARNING("failed per FEB monitoring "<< err.what() ); - - } - - } - - - // --- Fill per Feethrough Histograms --- - if ( m_monitor_feedthroughs ) { - - try { - - if ( m_is_noise_event && m_monitor_occupancy && energy > detthreshold_occupancy ) { - shared_ptr<IHistoProxyBase> histo = per_ft_occu.at( feb_hash ); - if ( histo ) histo->Fill( number, slot_number ); - } - - if ( m_is_noise_event && m_monitor_signal && energy > detthreshold_signal ) { - shared_ptr<IHistoProxyBase> histo = per_ft_sign.at( feb_hash ); - if ( histo ) histo->Fill( number, slot_number, energy ); - } - - if ( m_is_noise_event && m_monitor_positive_noise && significance > detthreshold_pos_noise ) { - shared_ptr<IHistoProxyBase>histo = per_ft_posn.at( feb_hash ); - if ( histo ) histo->Fill( number, slot_number ); - } - - if ( m_is_noise_event && m_monitor_negative_noise && (-1.) * significance > detthreshold_neg_noise ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_ft_negn.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number, slot_number ); - } - - if ( m_monitor_quality && m_qualitySelector.Select( chan ) ) { - shared_ptr<IHistoProxyBase> const histo_cptr = per_ft_qual.at( feb_hash ); - if ( histo_cptr ) histo_cptr->Fill( number, slot_number ); - } - - } catch ( std::out_of_range &err ) { - - ATH_MSG_WARNING( "failed per feedthrough monitoring " << err.what() - ); - - } - - } // --- End fill per Feedthrough histograms --- - - - // --- Fill per detector histograms --- - if ( m_monitor_detectors ) { - - // --- Skip channel if detector is undefined --- - if ( det == UNDEF ) continue;//TK: Only having this check inside - //the m_monitor_detectors block - //causes interference between the - //various options. - - try { - - // --- Calculate super-slot number --- - const unsigned int n_slots = - n_slots_in_feedthroughs( det ); - const unsigned int super_slot_number = - feedthrough_number * n_slots + slot_number; - - // --- look up spare bin number --- - int x_bin = super_slot_number; - int y_bin = number + 1; - - - // --- Fill occupancy histogram --- - if ( m_is_noise_event && m_monitor_occupancy && energy > detthreshold_occupancy ) { - if (perdethist_occu) perdethist_occu->Fill( super_slot_number, number ); - } - - - // --- fill signal histogram --- - // Sep 30, 2011. Now with no LArEventInfo::ERROR and isATLASReady - if ( m_is_noise_event && m_monitor_signal && energy > detthreshold_signal && isATLASReady() ) { - if (perdethist_sign && !isEventFlaggedByLArNoisyROAlgInTimeW) perdethist_sign->Fill( x_bin, y_bin, energy ); - if (perdethist_gain && !isEventFlaggedByLArNoisyROAlgInTimeW) perdethist_gain->Fill( x_bin, y_bin, gain ); - } - - - - // --- fill acceptance histogram --- - // Sep 30, 2011. Now with no LArEventInfo::ERROR and isATLASReady - if ( m_is_noise_event && m_monitor_positive_noise && significance > detthreshold_pos_noise && isATLASReady() && !isEventFlaggedByLArNoisyROAlgInTimeW) { - if (perdethist_posn) perdethist_posn->Fill( x_bin, y_bin, 100 ); - } else { - if (perdethist_posn) perdethist_posn->Fill( x_bin, y_bin, 0 ); - } - - // --- per detector noise acceptance --- - // Sep 30, 2011. Now with no LArEventInfo::ERROR and isATLASReady - if ( m_is_noise_event && m_monitor_negative_noise && (-1.) * significance > detthreshold_neg_noise && isATLASReady() && !isEventFlaggedByLArNoisyROAlgInTimeW) { - if (perdethist_negn) perdethist_negn->Fill( x_bin, y_bin, 100 ); - } else { - if (perdethist_negn) perdethist_negn->Fill( x_bin, y_bin, 0 ); - } - - // Sep 30, 2011. Now with no LArEventInfo::ERROR and isATLASReady - if ( m_monitor_quality && m_qualitySelector.Select( chan ) && isATLASReady() && !isEventFlaggedByLArNoisyROAlgInTimeW) { - if (perdethist_qual) perdethist_qual->Fill( x_bin, y_bin, 100 ); - } else { - if (perdethist_qual) perdethist_qual->Fill( x_bin, y_bin, 0 ); - } - - /* - // --- per detector mean energy vs bunch crossing --- - if ( m_monitor_signal ) { - if(perdethist_mevbc) perdethist_mevbc->Fill( bunch_crossing_id, energy ); - } - */ - - - // if ( significance > m_noise_threshold ) det_n_noisy_channels[det] += 1; - if ( significance > detthreshold_pos_noise ) det_n_noisy_channels[det] += 1; - if ( (-1.) * significance > detthreshold_neg_noise ) det_n_noisy_channels_Neg[det] += 1; - if ( m_qualitySelector.Select( chan ) ) det_n_possibly_problematic_channels[det] += 1; - if ( m_monitor_time && significance > m_time_threshold ) { - double res = m_timeResolution( significance ); - double weight = res > 0. ? 1 / (res*res) : 0.; - event_mean_time.Add( time, weight ); - mean_detector_times[det].Add( time, weight ); - mean_feb_times[det][feb_id].Add( time, weight ); - } - - switch (det) { - - case 0: - per_detector_total_energy[EMBA] += energy; break; - case 1: - per_detector_total_energy[EMBC] += energy; break; - case 2: - per_detector_total_energy[EMECA] += energy; break; - case 3: - per_detector_total_energy[EMECC] += energy; break; - case 4: - per_detector_total_energy[HECA] += energy; break; - case 5: - per_detector_total_energy[HECC] += energy; break; - case 6: - per_detector_total_energy[FCALA] += energy; break; - case 7: - per_detector_total_energy[FCALC] += energy; break; - default: - ATH_MSG_WARNING( "Something is wrong with choosing of detector partition " ); - } - - - - } catch ( const std::out_of_range &err ) { - - ATH_MSG_WARNING( "Failed monitoring " << err.what() ); - - } catch ( const std::bad_cast &err ) { - - ATH_MSG_WARNING( "Failed monitoring " << err.what() ); - - } - - } // --- end filling detector histograms - -// {// --- fill global lar histograms --- -// -// // if ( m_is_noise_event ) -// // _global_lar_eta_phi_acc->Fill( eta, phi, (significance > detthreshold_neg_noise?1.:0.) ); -// -// if ( energy > m_bcid_signal_threshold ) channels_above_bcid_threshold++; -// -// } // --- end global lar histograms --- - - } // --- End loop over LArRawChannels --- - - // if ( bunch_crossing_id ) _global_bcid_occupancy->Fill( bunch_crossing_id, double(channels_above_bcid_threshold) ); - - - std::vector<Detector> detectors{ EMBA , EMBC , EMECA , EMECC , HECA , HECC , FCALA , FCALC }; - if ( m_monitor_burst ) { - for( Detector det : detectors ) { - - double noisy_channel_percent = - double(det_n_noisy_channels[det]) / - double(m_det_to_nchannels[det]) * 100.; - - double noisy_channel_percent_Neg = - double(det_n_noisy_channels_Neg[det]) / - double(m_det_to_nchannels[det]) * 100.; - - citer_det_th2ptr hist_itr = per_det_burs.find( det ); - if ( noisy_channel_percent > m_noise_burst_percent_thresholds[det] && hist_itr != per_det_burs.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - // if ( histo ) histo->Fill( event_time_minutes ); - if ( histo ) histo->Fill( lumi_block ); - } - - hist_itr = per_det_timeVetoBurs.find( det ); - if ( noisy_channel_percent > m_noise_burst_percent_thresholds[det] && !isEventFlaggedByLArNoisyROAlgInTimeW && hist_itr != per_det_timeVetoBurs.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - // if ( histo ) histo->Fill( event_time_minutes ); - if ( histo ) histo->Fill( lumi_block ); - } - - // For positive energy - hist_itr = per_det_nfrac.find( det ); - if ( hist_itr != per_det_nfrac.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo ) histo->Fill( noisy_channel_percent ); - } - - //For negative energy - hist_itr = per_det_nfracNeg.find( det ); - if ( hist_itr != per_det_nfracNeg.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo ) histo->Fill( noisy_channel_percent_Neg ); - } - - // Weighted Flag - hist_itr = per_det_nfrac_W.find( det ); - if ( hist_itr != per_det_nfrac_W.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo && !isEventFlaggedByLArNoisyROAlg_W ) histo->Fill( noisy_channel_percent ); - } - - //New Plot. Fill when event is not flagged by LArNoisyROAlg - hist_itr = per_det_nfracNoLArNoisyRO.find( det ); - if ( hist_itr != per_det_nfracNoLArNoisyRO.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo && !isEventFlaggedByLArNoisyROAlg) histo->Fill( noisy_channel_percent ); - } - - //New Plot. Fill when event is not flagged by LArNoisyROAlg within time window of 500ms (no LArEventInfo::ERROR) - hist_itr = per_det_nfracTimeVetoLArNoisyRO.find( det ); - if ( hist_itr != per_det_nfracTimeVetoLArNoisyRO.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo && !isEventFlaggedByLArNoisyROAlgInTimeW) histo->Fill( noisy_channel_percent ); - } - - double possibly_problematic_channel_percent = - double(det_n_possibly_problematic_channels[det]) / - double(m_det_to_nchannels[det]) * 100.; - - hist_itr = per_det_qnChan.find( det ); - if ( hist_itr != per_det_qnChan.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo ) histo->Fill( det_n_possibly_problematic_channels[det] ); - } - - hist_itr = per_det_qburs.find( det ); - if ( possibly_problematic_channel_percent > m_noise_burst_percent_thresholds[det] && - hist_itr != per_det_qburs.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - // if ( histo ) histo->Fill( event_time_minutes ); - if ( histo ) histo->Fill( lumi_block ); - } - - /* - // Sep 30, 2011. Now with no LArEventInfo::ERROR - hist_itr = per_det_nChan_qburs.find( det ); - if ( det_n_possibly_problematic_channels[det] > m_noise_burst_nChannel_thresholds[det] && - hist_itr != per_det_nChan_qburs.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - // if ( histo ) histo->Fill( event_time_minutes ); - if ( histo && !isEventFlaggedByLArNoisyROAlgInTimeW) histo->Fill( lumi_block ); - } - */ - - // Sep 30, 2011. Now with no LArEventInfo::ERROR - hist_itr = per_det_pede.find(det); - if ( m_monitor_signal && hist_itr != per_det_pede.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo && !isEventFlaggedByLArNoisyROAlgInTimeW) histo->Fill( lumi_block ,per_detector_total_energy[det] ); - } - - hist_itr = per_det_sumE_BCID.find(det); - if ( m_monitor_signal && hist_itr != per_det_sumE_BCID.end() ) { - shared_ptr<IHistoProxyBase> histo = hist_itr->second; - if ( histo ) histo->Fill( bunch_crossing_id ,per_detector_total_energy[det] ); - } - - } - } - - - if ( m_monitor_time ) { - double t = event_mean_time.result(); - using element_mean_calculator = std::map<HWIdentifier, MeanCalculator>; - using det_element_mean_calculator = std::map<Detector, element_mean_calculator>; - for( const det_element_mean_calculator::value_type & a : mean_feb_times ) { - const Detector & detector = a.first; - for( const element_mean_calculator::value_type & b : a.second ) { - const MeanCalculator &avg= b.second; - m_per_detector_hists[mean_feb_time_h][detector]->Fill( (avg.result() - t) / nanosecond ); - } - } - } - - /* - if ( m_monitor_time ) { // C-A side averge time plots// VB - - typedef std::map<Detector,MeanCalculator> det_mean_calculator; - det_mean_calculator::const_iterator itr_end = mean_detector_times.end(); - if ( mean_detector_times.find(EMBA) != itr_end && - mean_detector_times.find(EMBC) != itr_end ) { - double dt = mean_detector_times[EMBA].result() - mean_detector_times[EMBC].result(); - // per_det_dtdet[EMBA]->Fill( dt ); - per_det_dtdet[EMBC]->Fill( -1. * dt ); - // per_det_lbdt[EMBA]->Fill( dt ); - per_det_lbdt[EMBC]->Fill( -1. * dt ); - if ( lumi_block < m_n_lumi_blocks ) { - m_per_detector_hists["lb_v_time_diff"][EMBA]->Fill( lumi_block, dt ); - m_per_detector_hists["lb_v_time_diff"][EMBC]->Fill( lumi_block, -1. * dt ); - } - } - - if ( mean_detector_times.find(EMECA) != itr_end && - mean_detector_times.find(EMECC) != itr_end ) { - double dt = mean_detector_times[EMECA].result() - mean_detector_times[EMECC].result(); - // per_det_dtdet[EMECA]->Fill( dt ); - per_det_dtdet[EMECC]->Fill( -1. * dt ); - // per_det_lbdt[EMECA]->Fill( dt ); - per_det_lbdt[EMECC]->Fill( -1. * dt ); - if ( lumi_block < m_n_lumi_blocks ) { - m_per_detector_hists["lb_v_time_diff"][EMECA]->Fill( lumi_block, dt ); - m_per_detector_hists["lb_v_time_diff"][EMECC]->Fill( lumi_block, -1. * dt ); - } - } - - if ( mean_detector_times.find(HECA) != itr_end && - mean_detector_times.find(HECC) != itr_end ) { - double dt = mean_detector_times[HECA].result() - mean_detector_times[HECC].result(); - // per_det_dtdet[HECA]->Fill( dt ); - per_det_dtdet[HECC]->Fill( -1. * dt ); - // per_det_lbdt[HECA]->Fill( dt ); - per_det_lbdt[HECC]->Fill( -1. * dt ); - if ( lumi_block < m_n_lumi_blocks ) { - m_per_detector_hists["lb_v_time_diff"][HECA]->Fill( lumi_block, dt ); - m_per_detector_hists["lb_v_time_diff"][HECC]->Fill( lumi_block, -1. * dt ); - } - } - - if ( mean_detector_times.find(FCALA) != itr_end && - mean_detector_times.find(FCALC) != itr_end ) { - double dt = mean_detector_times[FCALA].result() - mean_detector_times[FCALC].result(); - // per_det_dtdet[FCALA]->Fill( dt ); - per_det_dtdet[FCALC]->Fill( -1. * dt ); - // per_det_lbdt[FCALA]->Fill( dt ); - per_det_lbdt[FCALC]->Fill( -1. * dt ); - if ( lumi_block < m_n_lumi_blocks ) { - m_per_detector_hists["lb_v_time_diff"][FCALA]->Fill( lumi_block, dt ); - m_per_detector_hists["lb_v_time_diff"][FCALC]->Fill( lumi_block, -1. * dt ); - } - } - - } - */ - - return StatusCode::SUCCESS; - -} - - -/*----------------------------------------------------------------------------*/ -StatusCode LArRawChannelMonTool::procHistograms() -{ - - ATH_MSG_DEBUG( "===> start " << name() << "::procHistograms <=== " ); - - bool is_new_interval = false; - switch ( m_interval ) { - -// BT : what about endOfEventsBlock???? - case lumiBlock: - is_new_interval = endOfLumiBlockFlag(); - break; - case lowStat: - is_new_interval = newLowStatFlag(); - break; - case run: - is_new_interval = endOfRunFlag(); - break; - default: - ATH_MSG_WARNING( "given bad interval job-option: " << m_interval_str - << " ... booking histograms per run ..." ); - is_new_interval = endOfRunFlag(); - } - - if ( is_new_interval ) { - - if ( m_event_counter != 0 ) { - - // divide the efficiency histograms by number of events - - // scale per feedthrough efficiency histograms - if ( m_monitor_febs ) { - - std::vector<std::vector<shared_ptr<IHistoProxyBase> >*> per_feb_hists_to_scale; - if ( m_monitor_quality ) per_feb_hists_to_scale.push_back(&m_per_feb_hists[quality_h]); - - for( const std::vector<shared_ptr<IHistoProxyBase> >* const th1_vect_cptr : per_feb_hists_to_scale ) - for( const shared_ptr<IHistoProxyBase>& histo_cptr : *th1_vect_cptr ) - if ( histo_cptr ) - histo_cptr->Scale( 100. / float( m_event_counter ) ); - - } - - // scale per feedthrough efficiency histograms - if ( m_monitor_feedthroughs ) { - std::vector<std::vector<shared_ptr<IHistoProxyBase> >*> per_ft_hists_to_scale; - if ( m_monitor_quality ) per_ft_hists_to_scale.push_back(&m_per_feedthrough_hists[quality_h]); - - for( const std::vector<shared_ptr<IHistoProxyBase> >* const th2_vect_cptr : per_ft_hists_to_scale ) - for( const shared_ptr<IHistoProxyBase>& histo_cptr : *th2_vect_cptr ) - if ( histo_cptr ) - histo_cptr->Scale( 100. / float( m_event_counter ) ); - } - - // --- reset event counter --- - m_event_counter = 0; - - } - - if ( m_noise_stream_event_counter != 0 ) { - // divide the efficiency histograms by number of events - - // scale per feedthrough efficiency histograms - if ( m_monitor_febs ) { - - std::vector<std::vector<shared_ptr<IHistoProxyBase> >*> per_feb_hists_to_scale; - if ( m_monitor_positive_noise ) per_feb_hists_to_scale.push_back(&m_per_feb_hists[pos_noise_h]); - if ( m_monitor_negative_noise ) per_feb_hists_to_scale.push_back(&m_per_feb_hists[neg_noise_h]); - - for( const std::vector<shared_ptr<IHistoProxyBase> >* const th1_vect_cptr : per_feb_hists_to_scale ) - for( const shared_ptr<IHistoProxyBase>& histo_cptr : *th1_vect_cptr ) - if ( histo_cptr ) - histo_cptr->Scale( 100. / float( m_noise_stream_event_counter ) ); - - } - - // scale per feedthrough efficiency histograms - if ( m_monitor_feedthroughs ) { - std::vector<std::vector<shared_ptr<IHistoProxyBase> >*> per_ft_hists_to_scale; - if ( m_monitor_positive_noise ) per_ft_hists_to_scale.push_back(&m_per_feedthrough_hists[pos_noise_h]); - if ( m_monitor_negative_noise ) per_ft_hists_to_scale.push_back(&m_per_feedthrough_hists[neg_noise_h]); - - for( const std::vector<shared_ptr<IHistoProxyBase> >* const th2_vect_cptr : per_ft_hists_to_scale ) - for( const shared_ptr<IHistoProxyBase>& histo_cptr : *th2_vect_cptr ) - if ( histo_cptr ) - histo_cptr->Scale( 100. / float( m_noise_stream_event_counter ) ); - } - // --- reset event counter --- - m_noise_stream_event_counter = 0; - - - } - - } - - ATH_MSG_DEBUG( "===> end " << name() << "::procHistograms <=== " ); - - return StatusCode::SUCCESS; - -} - - -/*----------------------------------------------------------------------------*/ -std::string LArRawChannelMonTool::threshold_histogram_title_snippet( const double& t) -{ - - return " of events above " + std::to_string( int( t / MeV ) ) + - " MeV as a function of "; - -} - - -/*----------------------------------------------------------------------------*/ -std::string LArRawChannelMonTool::threshold_histogram_title_snippet( const int& t) -{ - - return std::to_string( t ) + " sigma total noise as a function of "; - -} - -bool LArRawChannelMonTool::registerHistogram( LWHist* histo, const std::string& dir, const std::string& merge){ - - MonGroup histGroup(this,dir,m_interval,ATTRIB_MANAGED,"",merge); - if ( !histGroup.regHist(histo).isSuccess() ) { - - ATH_MSG_ERROR( "Cannot book: " << histo->GetName() ); - return false; - - } else { - - ATH_MSG_DEBUG( "Booked: " << histo->GetName() ); - return true; - - } - -} - -IHistoProxyBase * LArRawChannelMonTool::createLWHistProxy(LWHist*h) { - if (dynamic_cast<LWHist1D*>(h)) return new LWHistoProxy1D(static_cast<LWHist1D*>(h)); - if (dynamic_cast<LWHist2D*>(h)) return new LWHistoProxy2D(static_cast<LWHist2D*>(h)); - if (dynamic_cast<TProfile_LW*>(h)) return new LWHistoProxyProfile(static_cast<TProfile_LW*>(h)); - assert(dynamic_cast<TProfile2D_LW*>(h)); - return new LWHistoProxyProfile2D(dynamic_cast<TProfile2D_LW*>(h)); -} - -void LArRawChannelMonTool::setIsATLASReady(){ - bool filterresult(true); - if (! m_filterAtlasReady_tools.empty()) { - ToolHandleArray<IDQFilterTool>::const_iterator ifilter(m_filterAtlasReady_tools.begin()), filterend(m_filterAtlasReady_tools.end()); - for (; filterresult && (ifilter != filterend); - ++ifilter) { - filterresult = (filterresult && (*ifilter)->accept()); - } - } - m_atlas_ready = filterresult; -} diff --git a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.h b/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.h deleted file mode 100644 index 7a2fea14fdb4dec1208fde44a4a2b9d923be8c71..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTool.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARMONTOOLS_LARRAWCHANNELMONTOOL_H -#define LARMONTOOLS_LARRAWCHANNELMONTOOL_H - -/** - * @class LArRawChannelMonTool - * @author Frank Berghaus <Frank.Olaf.Berghaus@cern.ch> - */ - -#include "LArRawChannelMonTools.h" - -// --- athena --- -#include "GaudiKernel/ToolHandle.h" -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "AthenaMonitoring/DQAtlasReadyFilterTool.h" -#include "CaloIdentifier/CaloIdManager.h" -#include "LArCabling/LArOnOffIdMapping.h" -#include "LArRecConditions/LArBadChannelMask.h" -#include "LArRecConditions/LArBadChannelCont.h" -#include "LArRawEvent/LArRawChannelContainer.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "CaloDetDescr/CaloDetDescrManager.h" - -#include <memory> -// --- stl --- -#include <string> -#include <vector> -#include <set> - - - -// --- forward declarations --- -class CaloIdManager; -class LArOnlineID; -class LArOnlineIDStrHelper; - -class TProfile_LW; -class TProfile2D_LW; -class TH2F_LW; -class TH1I_LW; -class LWHist; -class CaloNoise; - -//! A monitor for the LArg's Raw Channels -/*! - A tool desigened to monitor the raw output of the liquid argon - calorimeter channels. Originally written by Rob McPherson, - re-written and expanded by Frank Berghaus <frank@uvic.ca> - - The tool inherits from ManagedMonitorToolBase. The job options - are described in their detail sections. -*/ -class LArRawChannelMonTool: public ManagedMonitorToolBase -{ - - public: - - //! The constructor - LArRawChannelMonTool(const std::string&, const std::string&, - const IInterface*); - - //! The Destructor - virtual ~LArRawChannelMonTool(); - - - //! Connects to services and tools - /*! - The LArOnlineID and LArCablingService are retrieved. Mapping - from FEB hash to feedthrough hash, from FEB hash to sub-detector, and - from superslot (Halfcrate+slot number) to sparcified axis bin are - created. - */ - virtual StatusCode initialize() override; - - - //! Book and register histograms - /*! - The histograms demaded by the job options are booked for the - Interval_t and LevelOfDetail_t specified in the job options. - automatically called through ManagedMonitorToolBase everytime - an interval expires. - \param isNewEventsBlock true if bookHistograms was called because a new events block has begun - \param isNewLumiBlock true if bookHistograms was called because a new luminosity block has begun - \param isNewRun true if bookHistograms was called because a new run has begun - */ - virtual StatusCode bookHistograms() override; - - - //! Fill histograms with monitoring quantities - /*! - Returns success if no LArRawChannelContainer exists, returns failure if - LArRawChannelContainer cannot be retrieved. Retrieves the bunch crossing - ID from the EventInfo, then loops over all LArRawChannels in the - LArRawChannelContainer and fills requested monitoring histograms. - */ - virtual StatusCode fillHistograms() override; - - - //! Fill RMS histograms - /*! - Fills histograms that use information from many events such as the - histograms of noise RMS. - */ - virtual StatusCode procHistograms() override; - - - private: - - // --- Job Option Variables --- - bool m_monitor_occupancy; - bool m_monitor_signal; - bool m_monitor_positive_noise; - bool m_monitor_negative_noise; - bool m_monitor_time; - bool m_monitor_quality; - bool m_monitor_burst; - - bool m_monitor_febs; - bool m_monitor_feedthroughs; - bool m_monitor_detectors; - - // --- Naming Conventions --- - std::string m_data_name_base; - SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"}; - SG::ReadHandleKey<LArRawChannelContainer> m_LArRawChannel_container_key{this, "LArRawChannelContainerKey", "LArRawChannels"}; - - // --- Monitoring Controls --- - std::vector<double> m_occupancy_thresholds; - std::vector<double> m_signal_thresholds; - std::vector<int> m_pos_noise_thresholds; - std::vector<int> m_neg_noise_thresholds; - double m_bcid_signal_threshold; - short m_time_threshold; - unsigned short m_quality_threshold; - short m_noise_threshold; - std::vector<double> m_noise_burst_percent_thresholds; - std::vector<unsigned int> m_noise_burst_nChannel_thresholds; - unsigned int m_n_lumi_blocks; - std::vector<std::string> m_noise_streams; - std::set<std::string> m_noise_streams_set; - - // --- tools --- - const LArOnlineID *m_lar_online_id_ptr; //!< LAr online structure - const CaloIdManager *m_calo_id_mgr_ptr; //!< offline calo structure - - - /** Handle to bad-channel mask */ - LArBadChannelMask m_bcMask; - SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; - Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"}; - - SG::ReadCondHandleKey<CaloNoise> m_noiseKey - { this, "NoiseKey", "totalNoise", "SG key for noise" }; - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey - {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey - { this,"CaloDetDescrManager","CaloDetDescrManager","SG Key for CaloDetDescrManager in the Condition Store" }; - - // -- for ATLAS Ready Filter - bool isATLASReady() { return m_atlas_ready; } - void setIsATLASReady(); - ToolHandleArray<IDQFilterTool> m_filterAtlasReady_tools; //!< DQ ATLAS Ready Filter Tool - bool m_atlas_ready; - - LArOnlineIDStrHelper *m_lar_online_id_str_helper_ptr; //!< naming convetions - - //! Switches tool off if there is no data in _LArRawChannel_container_key - bool m_has_lar_raw_channels; - //! Use channels only if pedestal and adc2e value from DB and OFC was used - bool m_db_and_ofc_only; - - // --- Histograms --- - //! pointers to per FEB histograms - std::map< LArMonTools::RawChHisto, std::vector<std::shared_ptr<LArMonTools::IHistoProxyBase> > > m_per_feb_hists; - - //! pointers to per feedthrough 2D histograms - std::map< LArMonTools::RawChHisto, std::vector<std::shared_ptr<LArMonTools::IHistoProxyBase> > > m_per_feedthrough_hists; - - // per detector view - std::map< LArMonTools::RawChHisto, std::map<LArMonTools::Detector,std::shared_ptr<LArMonTools::IHistoProxyBase> > > - m_per_detector_hists; - - - // global lar histograms - // TProfile2D_LW* _global_lar_eta_phi_acc; - // TProfile_LW* _global_bcid_occupancy; - - std::map<LArMonTools::Detector,std::vector<TProfile2D_LW*> > m_eta_phi_signal; - std::map<LArMonTools::Detector,std::vector<TH2F_LW*> > m_eta_phi_noise; - - std::map<LArMonTools::Detector,std::map< LArMonTools::Sampling, TH1I_LW* > > m_phi_occupancy; - std::map<LArMonTools::Detector,std::map< LArMonTools::Sampling, TH1I_LW* > > m_eta_occupancy; - - std::vector<LArMonTools::Detector> m_feb_hash_to_detector; - std::vector<IdentifierHash> m_feb_hash_to_ft_hash; - // std::map<LArMonTools::Detector,std::vector<int> > _superslot_to_sparse_bin_number; - - //! number of LArRawChannels connected in each detector - std::map<LArMonTools::Detector,unsigned int> m_det_to_nchannels; - //! monitoring interval - /*! - Interval to book monitoring histograms with. Valid strings in job options - are: "all", "fill", "run" , "minutes90", "minutes30", "minutes10", - "lumiBlock", "eventsBlock", "file". Set though intervalStringToEnum. - */ - Interval_t m_interval; - - - //! monitoring level of detail - /*! - Level of detail to book monitoring histograms with. Valid strings in job - options are: "summary", "runstat", "shift", "expert", "debug" , "transient". - Set though levelOfDetailStringToEnum - */ - - std::string m_interval_str; //!< strings to set interval with job option - - //! true if the event is in a stream specified by noise_stream job option - bool m_is_noise_event; - - std::map<LArMonTools::Detector,LArMonTools::SelectionContext> m_selectionContext; - LArMonTools::QualitySelector m_qualitySelector; - - //! Calculates approximate time resolution of a channel - /*! - Time resolution is given by: - \f[ - \sigma_t = \frac{a}{E/\sigma_{E}} \oplus b - \f] - Where a and b depend on the position (partition - and layer) of the channel. Practically since - \f$\sigma_{E}\f$ is also a function of position - we approximate \f$a \approx 30\f$ns and - \f$b \approx 1\f$ns. - @See LArMonTools::SelectionContext - */ - LArMonTools::ResolutionCalculator m_timeResolution; - - // --- some tool specific helpers --- - std::string threshold_histogram_title_snippet( const double& ); - std::string threshold_histogram_title_snippet( const int& ); - void book_eta_phi_histograms(); - void book_emb_eta_phi_histograms ( const LArMonTools::Detector &detector ); - void book_emec_eta_phi_histograms( const LArMonTools::Detector &detector ); - void book_hec_eta_phi_histograms ( const LArMonTools::Detector &detector ); - void book_fcal_eta_phi_histograms( const LArMonTools::Detector &detector ); - - //! retrieve sampling of a channel - int channel_sampling( const LArMonTools::Detector &detector, const Identifier &id ); - - //! fix empty bins in eta/phi histograms - // typedef const std::pair<LArMonTools::Detector,std::vector<LWHist*> > det_eta_phi_hists_t; - - void fix_eta_phi_bins( const std::pair<LArMonTools::Detector,std::vector<TProfile2D_LW*> >& ); - void fix_eta_phi_bins( const std::pair<LArMonTools::Detector,std::vector<TH2F_LW*> >& ); - - - LArMonTools::lar_axis_maker m_phi_axes; //!< handle phi-axes - LArMonTools::lar_axis_maker m_eta_axes; //!< handle eta-axes - - unsigned int m_event_counter; - unsigned int m_noise_stream_event_counter; - - //! Lable histogram axis of 1440 bins with 24h clock - //void label_gmt_axis( TAxis * ); - - //! to register histograms -// bool registerHistogram( TH1* histo, const std::string& dir, -// const std::string& chain = "", const std::string& merge = "");//tk: retire - bool registerHistogram( LWHist* histo, const std::string& dir, - const std::string& merge = ""); - - static LArMonTools::IHistoProxyBase * createLWHistProxy(LWHist*h); -}; - - -#endif // LAR_RAW_CHANNEL_MON_TOOL_H diff --git a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.cxx b/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.cxx deleted file mode 100644 index 6e6d25d38a7feb578f8f8b590ef1dabdb133558b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.cxx +++ /dev/null @@ -1,511 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArRawChannelMonTools.h" - -#include "LArIdentifier/LArOnlineID.h" -#include "LArIdentifier/LArOnlID_Exception.h" - -#include <stdexcept> -#include <cmath> -#include <cfloat> - -using namespace LArMonTools; -using namespace std; - -typedef vector<HWIdentifier>::const_iterator citer_vect_hwid; - -using det_region_map_t = map<Detector, map<Sampling, deque<Region> > >; -using sam_region_map_t = map<Sampling, deque<Region> >; - - -/*----------------------------------------------------------------------------*/ -string LArMonTools::detector_str( const Detector& d ) -{ - - switch ( d ) { - - case EMBA: - return "EMBA"; - break; - - case EMBC: - return "EMBC"; - break; - - case EMECA: - return "EMECA"; - break; - - case EMECC: - return "EMECC"; - break; - - case HECA: - return "HECA"; - break; - - case HECC: - return "HECC"; - break; - - case FCALA: - return "FCALA"; - break; - - case FCALC: - return "FCALC"; - break; - - default: - return "UNDEF"; - - } - -} - - -/*----------------------------------------------------------------------------*/ -string LArMonTools::sampling_str( const Sampling& d ) -{ - - switch ( d ) { - - case presampler: - return "PS"; - break; - - case sampling_one: - return "S1"; - break; - - case sampling_two: - return "S2"; - break; - - case sampling_three: - return "S3"; - break; - - default: - return "UNDEF"; - - } - -} - -int LArMonTools::n_slots_in_feedthroughs( const Detector& d ) -{ - - return ( d == EMBA || d == EMBC ) ? n_slots_in_barrel : - n_slots_in_endcap ; - -} - - -int LArMonTools::n_feedthroughs( const Detector& d ) -{ - - return ( d == EMBA || d == EMBC ) ? n_feedthroughs_in_barrel : - n_feedthroughs_in_endcap ; - -} - - -vector<double> LArMonTools::detector_superslot_axis( Detector const &detector, - const LArOnlineID *lar_online_id ) -{ - - // define detector_test type as a reference to a member function of - // LArOnlineID taking a constant HWIdentifier as argument and - // returning a bool: - // --- Warning these only have meaning in conjunction with an - // --- instance of the class: - // - // --- ((*lar_online_id).*is_in_detector_ptr)( some_bool ) // works - // - // --- ( lar_online_id->*is_in_detector_ptr )( some_bool ) // compiler - // --- // error - - using detector_test = bool (LArOnlineID::*)(const HWIdentifier) const; - // Define such a beast ... to be set later. - detector_test is_in_detector_ptr; - - // --- FEBs from which detector should we consider --- - switch ( detector ){ - - case EMBA: - case EMBC: - is_in_detector_ptr = &LArOnlineID::isEMBchannel; - break; - case EMECA: - case EMECC: - is_in_detector_ptr = &LArOnlineID::isEMECchannel; - break; - case HECA: - case HECC: - is_in_detector_ptr = &LArOnlineID::isHECchannel; - break; - case FCALA: - case FCALC: - is_in_detector_ptr = &LArOnlineID::isFCALchannel; - break; - - case UNDEF: - default: - throw domain_error("Detector badly defined. Cannot determine position in LAr."); - - } - - // --- FEBS from which side should we consider --- - int correct_side = 0; - switch ( detector ){ - - case EMBA: - case EMECA: - case HECA: - case FCALA: - correct_side = 1; - break; - case EMBC: - case EMECC: - case HECC: - case FCALC: - correct_side = 0; - break; - case UNDEF: - default: - throw std::domain_error("Detector badly defined. Cannot determine position in LAr."); - - } - - const int n_slots = n_slots_in_feedthroughs( detector ); - const int superslot_max = n_slots * n_feedthroughs( detector ); - - vector<int> super_slots_to_fill; - - // --- loop over FEBS --- - citer_vect_hwid end_feb = lar_online_id->feb_end(); - for ( citer_vect_hwid itr_feb = lar_online_id->feb_begin(); - itr_feb != end_feb ; ++itr_feb) { - - // --- If the FEB isn't on the correct side skip it --- - if ( lar_online_id->pos_neg( *itr_feb ) != correct_side ) continue; - - // --- If the FEB isn't in the correct detector skip it --- - if ( !((*lar_online_id).*is_in_detector_ptr)( *itr_feb ) ) continue; - - // Calculate the FEB's superslot number and remeber it. - int i_feedthrough = lar_online_id->feedthrough( *itr_feb ); - int i_slot = lar_online_id->slot( *itr_feb ); - int i_super_slot = i_feedthrough * n_slots + i_slot; - - super_slots_to_fill.push_back( i_super_slot ); - - } - - // Return axis assigning only one bin for regions without FEBs - return sparse_bins_vector( super_slots_to_fill, 1, superslot_max ); - -} - - -template <class Container> -vector<double> LArMonTools::sparse_bins_vector( Container const &bins, - typename Container::value_type min, - typename Container::value_type max, - double const &bin_size ) -{ - - typename Container::value_type max_bin_given = *max_element( bins.begin(), bins.end() ); - typename Container::value_type min_bin_given = *min_element( bins.begin(), bins.end() ); - - // --- If min and max were not set, determine them from the bins given - if ( min == max && min == 0 ) { - - max = max_bin_given; - min = min_bin_given; - - } - - // --- Above if statement should negate these, but just in case --- - if ( max < max_bin_given ) - throw std::domain_error("Largest bin requested exceeds given maximum"); - - if ( min > min_bin_given ) - throw std::domain_error("Smallest bin requested exceeds given minimum"); - - // --- Determine Number of bins necessary --- - vector<double>::size_type n_elements = max - min + static_cast<typename Container::value_type>( bin_size ); - - vector<double> result( n_elements, min ); - - for( typename Container::value_type x : bins ) - result.at( x - min ) = ( static_cast<double>( x ) - 0.5 ) * bin_size; - - if ( result.front() == min ) result.front() = min - 0.5 * bin_size; - if ( result.back() != min ) result.push_back( result.back() + bin_size ); - if ( result.back() != max + 0.5 * bin_size ) result.push_back( max + 0.5 * bin_size ); - - bool is_first_zero_in_row = false; - bool is_first_entry = true; - double last = static_cast<double>( min ); - - for ( double &d : result ){ - - if ( is_first_entry ) { - - is_first_entry = false; - continue; - - } - - if ( d != min ) { - - is_first_zero_in_row = true; - last = d; - - } else if ( is_first_zero_in_row ) { - - d = last + bin_size; - is_first_zero_in_row = false; - last = d; - - } - - } - - - vector<double>::iterator itr = std::remove(result.begin(), result.end(), min); - result.resize (itr - result.begin()); - - return result; - -} - - - -int LArMonTools::pos_neg( const Detector &detector ) -{ - - int result = 0; - - switch ( detector ) { - - case EMBA: - case EMECA: - case HECA: - case FCALA: - result = 1; - break; - - case EMBC: - case EMECC: - case HECC: - case FCALC: - result = -1; - break; - - default: - break; - - } - - return result; - -} - - - -lar_axis_maker::lar_axis_maker() -{ -} - - -lar_axis_maker::lar_axis_maker( const map<Detector, map<Sampling, deque<Region> > > ®ions ) - : m_regions( regions ) -{ - - generate(); - -} - - -lar_axis_maker::~lar_axis_maker() -{ -} - - -const vector<double> lar_axis_maker::operator() (const Detector &d, const Sampling &s) -{ - - return m_bins[d][s]; - -} - - -void lar_axis_maker::generate() -{ - - m_bins.clear(); - - // for each detector - for( const det_region_map_t::value_type &det_regions : m_regions ) { - - const Detector &det = det_regions.first; - - // for each sampling - for( const sam_region_map_t::value_type &sam_regions : det_regions.second ) { - - const Sampling &samp = sam_regions.first; - m_bins[det][samp] = vector<double>(); - - // for each region - for( const Region ®ion : sam_regions.second ) { - - double lo = region.lower; - const double &up = region.upper; - const double &size = region.size; - - double diff = DBL_MAX; - double last_diff = DBL_MAX; - if ( size <= 0 ) break; - while ( diff > 1.0e-10 ) { // float computaation => - // 0 + 1 - 1 != 0 ... - m_bins[det][samp].push_back( lo ); - lo += size; - last_diff = diff; - diff = fabs( lo - up ); - if ( diff > last_diff ) break; - - } - - } - - m_bins[det][samp].push_back( sam_regions.second.back().upper ); - - } - - } - -} - - -const map<Detector, map<Sampling, deque<Region> > > &lar_axis_maker::regions() const { return m_regions; } - -void lar_axis_maker::regions( const map<Detector, map<Sampling, deque<Region> > >& regions ) -{ - - m_regions = regions; - generate(); - -} - -bool LArMonTools::operator< ( const Region &lhs, const Region &rhs ) -{ - - return lhs.lower < rhs.lower && lhs.upper < rhs.upper; - -} - - - -/* -------------------------------------------------------------------------- */ -/* helper classes */ -/* -------------------------------------------------------------------------- */ - - - -SelectionContext::SelectionContext() - : m_positive_noise(0), - m_negative_noise(0), - m_quality( DBL_MAX ), - m_energy(0) -{} - -SelectionContext::SelectionContext( const double& quality ) - : m_positive_noise(0), - m_negative_noise(0), - m_quality( quality ), - m_energy(0) -{} - -SelectionContext::~SelectionContext() {} - - -// Setters: -void SelectionContext::quality( const double& quality) { m_quality = quality; } - - - -QualitySelector::QualitySelector() - : m_pSelectionContext(nullptr) -{} - - -// Getters: -const SelectionContext * QualitySelector::selectionContext() const { return m_pSelectionContext; } - - -// Setters: -void QualitySelector::selectionContext( const SelectionContext * pSelectionContext ) { - m_pSelectionContext = pSelectionContext; -} - - -QualitySelector::~QualitySelector() {} - - - - -MeanCalculator::MeanCalculator() - : m_moment0( 0. ) - , m_moment1( 0. ) - , m_mean( 0. ) -{} - - -MeanCalculator::~MeanCalculator() {} - -double& MeanCalculator::Add( const double & x , const double & w ) { - m_moment0 += w; - m_moment1 += x * w; - m_mean = ( m_moment0 > 0. ) - ? m_moment1 / m_moment0 - : 0.; - return m_mean; -} - -double MeanCalculator::result() const { return m_mean; } - -void MeanCalculator::result( const double & mean) { m_mean = mean; } - - - -ResolutionCalculator::ResolutionCalculator() - : m_a ( 0. ) - , m_b ( 0. ) -{} - - -ResolutionCalculator::ResolutionCalculator( const double &a, const double &b ) - : m_a ( a ) - , m_b ( b ) -{} - - -ResolutionCalculator::~ResolutionCalculator() {} - - -double ResolutionCalculator::operator() ( const double& x ) const{ - - double numerator = x*x; - double denominator = m_a * m_a + m_b * m_b * x * x; - - return (denominator > 0. ) - ? sqrt( numerator / denominator ) - : 0.; - -} - diff --git a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.h b/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.h deleted file mode 100644 index 8b94b6b31500c15b0eb3859a738b5dc174604a50..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArRawChannelMonTools.h +++ /dev/null @@ -1,360 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARMONTOOLS_LARRAWCHANNELMONTOOLS_H -#define LARMONTOOLS_LARRAWCHANNELMONTOOLS_H - -#include "CLHEP/Units/SystemOfUnits.h" - -#include "TH1.h" -#include "TH2.h" - -#include "LWHists/LWHist1D.h" -#include "LWHists/LWHist2D.h" -#include "LWHists/TProfile_LW.h" -#include "LWHists/TProfile2D_LW.h" -#include "LArRawEvent/LArRawChannel.h" - -#include <deque> -#include <map> -#include <string> -#include <vector> - -class LArOnlineID; - -// --- Some tools to help with LAr Description --- -namespace LArMonTools { - - // --- Detector Navigation --- - enum Detector { - EMBA = 0, - EMBC = 1, - EMECA = 2, - EMECC = 3, - HECA = 4, - HECC = 5, - FCALA = 6, - FCALC = 7, - UNDEF = 8 - }; - - enum Sampling { - presampler = 0, - sampling_one = 1, - sampling_two = 2, - sampling_three = 3 - }; - - // --- Histo Navigation --- - enum RawChHisto { - occ_h = 0, - sig_h = 1, - pos_noise_h = 2, - neg_noise_h = 3, - time_h = 4, - quality_h = 5, - burst_h = 6, - noise_fraction_h = 7, - noise_fraction_Neg_h = 8, - noise_fraction_NoLArNoisyRO_h = 9, - pedestal_evolution_h = 10, - sumE_vs_BCID_h = 11, - mean_feb_time_h = 12, - quality_nChannel_h = 13, - quality_burst_h = 14, - quality_nChannel_burst_h = 15, - E_v_bc_h = 16, - noise_fraction_TimeVetoLArNoisyRO_h = 17, - timeVetoBurst_h = 18, - noise_fraction_W_h = 19,//Modif done by Camincher C. - gain_h = 20 - }; - - std::string detector_str( const Detector& ); - std::string sampling_str( const Sampling& d ); - - std::vector<double> detector_superslot_axis( Detector const& , - const LArOnlineID * ); - - template <class Container> - std::vector<double> sparse_bins_vector(Container const &bins, - typename Container::value_type min=0, - typename Container::value_type max=0, - double const &bin_size = 1.0 ); - - // --- Return number of slots in the feedthroughs in given detector: - // --- 14 in the barrel (EMB?), 15 in the Endcaps (EMEC?, HEC?, FCAL?) - int n_slots_in_feedthroughs( const LArMonTools::Detector& ); - - - // --- Return number of feedthroughs in given detector: - // --- 32 in the barrel (EMB?), 25 in the Endcaps (EMEC?, HEC?, FCAL?) - int n_feedthroughs( const LArMonTools::Detector& ); - - //! Returns 1 for A side, -1 for C side, 0 as error - /*! - Tool to get the proper eta sign for the side of the detector from - the Detector enum. - \param detector Detector enum (EMBA, EMBC, etc. ) - */ - int pos_neg( const Detector &detector ); - - const int n_slots_in_barrel = 14; //!< slots per feedthrough in barrel - const int n_slots_in_endcap = 15; //!< slots per feedthrough in endcap - const int n_feedthroughs_in_barrel = 32; //!< feedthroughs in barrel - const int n_feedthroughs_in_endcap = 25; //!< feedthroughs in endcap - - struct Region; - bool operator< ( const Region &, const Region& ); - struct Region { - - friend bool operator< ( const Region &, const Region& ); - - double lower; //!< lower edge - double upper; //!< upper edge - double size; //!< bin/cell/channel size - - }; - - //! create eta and phi axis for different subdetectors of LArg Calo - class lar_axis_maker { - - public: - lar_axis_maker(); - - lar_axis_maker( const std::map<Detector, std::map<Sampling, std::deque<Region> > >& ); - - ~lar_axis_maker(); - - const std::vector<double> operator() (const Detector&, const Sampling&); - - const std::map<Detector, std::map<Sampling, std::deque<Region> > > & regions() const; - - void regions( const std::map<Detector, std::map<Sampling, std::deque<Region> > >& ); - - protected: - std::map<Detector, std::map<Sampling, std::deque<Region> > > m_regions; //!< regions - std::map<Detector, std::map<Sampling, std::vector<double> > > m_bins; - - //! takes edges and bin sizes and creates bin vector. - void generate(); - - }; - - //! virtual base class to define bhaviour of histogram proxy - /*! - This class defines the behavour of a proxy to ROOT's histograms. The - motivation for the proxy is to allow one stl container to interact with - TH1, TH2, and TH3 histograms. The class is implemented through HistoBase. - */ - class IHistoProxyBase { - - public: - IHistoProxyBase() {} - - virtual ~IHistoProxyBase() {} - - virtual void Fill( double x ) = 0; - virtual void Fill( double x, double y ) = 0; - virtual void Fill( double x, double y, double z ) = 0; - virtual void Fill( double x, double y, double z, double w ) = 0; - - virtual void Scale( double s = 1. ) = 0; - virtual void Reset( ) = 0; - - }; - - //! implementation of the behaviour defined by IHistoProxyBase - /*! - This class holds a pointer histogram (without claiming ownership) - and calles it's Fill and Scale functions. Template specializations - exist for the case of TH1 and TH2 histograms, since TH1 does not - define a fill function with three doubles as arguments. - */ - template <class HISTOGRAM> - class HistoProxy : public IHistoProxyBase { - - private: - HISTOGRAM * m_h_ptr; - - public: - HistoProxy( ) - : m_h_ptr( 0 ) {} - - HistoProxy( HISTOGRAM * h_ptr ) - : m_h_ptr( h_ptr ) {} - - virtual void Fill( double x ) { m_h_ptr->Fill( x ); } - virtual void Fill( double x, double y ) { m_h_ptr->Fill( x, y ); } - virtual void Fill( double x, double y, double z ) { m_h_ptr->Fill( x, y, z ); } - virtual void Fill( double x, double y, double z, double w ) { m_h_ptr->Fill( x, y, z, w ); } - - virtual void Scale( double s = 1. ) { m_h_ptr->Scale( s ); } - virtual void Reset( ){ m_h_ptr->Reset( ); } - - }; - - - //The LWHistoProxy implementations: - class LWHistoProxy1D : public IHistoProxyBase { - private: - LWHist1D * m_h_ptr; - public: - LWHistoProxy1D( ) : m_h_ptr( 0 ) {} - LWHistoProxy1D( LWHist1D * h_ptr ) : m_h_ptr( h_ptr ) {} - virtual void Fill( double x ) { m_h_ptr->Fill( x );} - virtual void Fill( double x, double y ) { m_h_ptr->Fill( x, y ); } - virtual void Fill( double, double, double) {} - virtual void Fill( double, double, double, double ) {} - virtual void Scale( double s = 1. ) { m_h_ptr->scaleContentsAndErrors( s ); } - virtual void Reset(){ m_h_ptr->Reset(); } - }; - class LWHistoProxy2D : public IHistoProxyBase { - private: - LWHist2D * m_h_ptr; - public: - LWHistoProxy2D( ) : m_h_ptr( 0 ) {} - LWHistoProxy2D( LWHist2D * h_ptr ) : m_h_ptr( h_ptr ) {} - virtual void Fill( double ) {} - virtual void Fill( double x, double y ) { m_h_ptr->Fill( x, y ); } - virtual void Fill( double x, double y, double z ) { m_h_ptr->Fill( x, y, z ); } - virtual void Fill( double, double, double, double ) { } - virtual void Scale( double s = 1.) { m_h_ptr->scaleContentsAndErrors( s ); } - virtual void Reset(){ m_h_ptr->Reset(); } - }; - class LWHistoProxyProfile : public IHistoProxyBase { - private: - TProfile_LW * m_h_ptr; - public: - LWHistoProxyProfile( ) : m_h_ptr( 0 ) {} - LWHistoProxyProfile( TProfile_LW* h_ptr ) : m_h_ptr( h_ptr ) {} - virtual void Fill( double ) {} - virtual void Fill( double x, double y ) { m_h_ptr->Fill( x, y ); } - virtual void Fill( double x, double y, double z ) { m_h_ptr->Fill( x, y, z ); } - virtual void Fill( double, double, double, double ) { } - virtual void Scale( double) { } - virtual void Reset(){ m_h_ptr->Reset(); } - }; - class LWHistoProxyProfile2D : public IHistoProxyBase { - private: - TProfile2D_LW * m_h_ptr; - public: - LWHistoProxyProfile2D( ) : m_h_ptr( 0 ) {} - LWHistoProxyProfile2D( TProfile2D_LW* h_ptr ) : m_h_ptr( h_ptr ) {} - virtual void Fill( double ) {} - virtual void Fill( double, double ) { } - virtual void Fill( double x, double y, double z ) { m_h_ptr->Fill( x, y, z ); } - virtual void Fill( double x, double y, double z, double w ) { m_h_ptr->Fill( x, y,z,w ); } - virtual void Scale( double) { } - virtual void Reset(){ m_h_ptr->Reset(); } - }; - - class SelectionContext{ - - public: - SelectionContext(); - SelectionContext( const double& ); - - virtual ~SelectionContext(); - - // Getters: - int positive_noise() const; - int negative_noise() const; - inline double quality() const { return m_quality; } - double energy() const; - - - - - // Setters: - void positive_noise( const int& ); - void negative_noise( const int& ); - void quality( const double& ); - void energy( const double& ); - - private: - int m_positive_noise; - int m_negative_noise; - - double m_quality; - double m_energy; - - }; - - - class QualitySelector { - - public: - - QualitySelector(); - - //! Select a channel based on criteria given by _pSelectionContext - /*! - Selects a LArRawChannel based on q-factor. - @See SelectionContext - */ - inline bool Select( const LArRawChannel& a ) { - return m_pSelectionContext && - a.energy() > 0.1 * CLHEP::MeV && - a.quality() > m_pSelectionContext->quality(); - } - - - - //! Getter function for context selection is based upon - const SelectionContext * selectionContext() const; - - //! Setter function for context selection is based upon - void selectionContext( const SelectionContext * pSelectionContext ); - - // should be protected, but thanks to a compiler bug can't be... - ~QualitySelector(); - - - private: - - //! Context holds information to select channels. Must be set properly for each channel - const SelectionContext * m_pSelectionContext; - - }; - - - class MeanCalculator { - - public: - MeanCalculator(); - ~MeanCalculator(); - - double& Add( const double & x, const double & w = 1. ); - - double result() const; - void result( const double & ); - - private: - double m_moment0; - double m_moment1; - double m_mean; - }; - - - class ResolutionCalculator { - - public: - ResolutionCalculator(); - ResolutionCalculator( const double &, const double & ); - ~ResolutionCalculator(); - - double operator() ( const double& ) const; - - private: - - double m_a; - double m_b; - - }; - -} - - -#endif // LAR_RAW_CHANNEL_MON_TOOLS_H diff --git a/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.cxx b/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.cxx deleted file mode 100644 index 619708d62a64b67c4233bd9c51a08fced4fcb283..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.cxx +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArTrigStreamMatching.h" - -std::vector<unsigned> trigStreamMatching(const std::vector<std::string>& streamsFromJobO, const std::vector<xAOD::EventInfo::StreamTag>& streamInEvent) { - - //The return value. Relying on RVO not to copy it when returning to caller - std::vector<unsigned> foundStreams; - const unsigned nStreamsInJobO=streamsFromJobO.size(); - for (unsigned i=0;i<nStreamsInJobO;++i) { - bool found=false; - for (const xAOD::EventInfo::StreamTag& streamTag : streamInEvent) { - if (streamsFromJobO[i]==streamTag.name()) { - foundStreams.push_back(i); - found=true; - break; //inner loop - }//end-if - }//end inner loop (over streamInEvent) - //Not-found case: - if (!found) foundStreams.push_back(nStreamsInJobO); - }//end outer loop (over streamInJobO) - - return foundStreams; -} - diff --git a/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.h b/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.h deleted file mode 100644 index c7b1efbabce739ce711148b8936151c197d06732..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LArTrigStreamMatching.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARMONTOOLS_LARTRIGSTREAMMACHING -#define LARMONTOOLS_LARTRIGSTREAMMACHING - -#include <vector> -#include <string> - -#include "xAODEventInfo/EventInfo.h" - -//Returns a vector with the indices of the streamsFromJobO that match an entry in streamsInEvent. For streams that are not part of streamsFromJobO -//streamsFromJobO.size() is added to the return vector -std::vector<unsigned> trigStreamMatching(const std::vector<std::string>& streamsFromJobO, const std::vector<xAOD::EventInfo::StreamTag>& streamInEvent); - -#endif diff --git a/LArCalorimeter/LArMonTools/src/LWHistFactory.h b/LArCalorimeter/LArMonTools/src/LWHistFactory.h deleted file mode 100644 index 9ee9baffad034bd2ab34537560f5a4c1e79d923b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/LWHistFactory.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARMONTOOLS_LWHISTFACTORY_H -#define LARMONTOOLS_LWHISTFACTORY_H - -#include <string> -#include "LWHists/LWHist.h" -#include "LWHists/TProfile_LW.h" -#include "LWHists/TProfile2D_LW.h" - - -class LWHistFactoryBase { -public: - //FIXME: Take std::strings as name/title if that is how they are provided anyway... - LWHistFactoryBase(const char*title):m_title(title), m_laronlineidstrhelper(0) {} - virtual ~LWHistFactoryBase(){}; - void SetXTitle(const char* t) { m_xtitle=t; } - void SetYTitle(const char* t) { m_ytitle=t; } - void SetZTitle(const char* t) { m_ztitle=t; } - void setXAxisBinLabelsAllFebs(LArOnlineIDStrHelper*l,const std::string& detector_str) - { - m_laronlineidstrhelper=l; - m_xaxislabels_detstr=detector_str; - } - virtual LWHist * create(const char*name) = 0; - LWHist * create(const std::string&name) { return create(name.c_str()); } - LWHist * create(const char*name,const char*title) { - LWHist * h = create(name); - h->SetTitle((std::string(h->GetTitle())+title).c_str()); - return h; - } - LWHist * create(const std::string&name,const std::string&title) { - LWHist * h = create(name.c_str()); - h->SetTitle((std::string(h->GetTitle())+title).c_str()); - return h; - } -protected: - void apply(LWHist*h) { - h->SetTitle(m_title.c_str()); - if (!m_xtitle.empty()) h->SetXTitle(m_xtitle.c_str()); - if (!m_ytitle.empty()) h->SetYTitle(m_ytitle.c_str()); - if (!m_ztitle.empty()) h->SetZTitle(m_ztitle.c_str()); - if (!m_xaxislabels_detstr.empty()&&m_laronlineidstrhelper) { - m_laronlineidstrhelper->setAxisBinLabelsAllFebs( h->GetXaxis(), m_xaxislabels_detstr ); - } - } -private: - LWHistFactoryBase( const LWHistFactoryBase & ); - LWHistFactoryBase & operator= ( const LWHistFactoryBase & ); - std::string m_title; - std::string m_xtitle; - std::string m_ytitle; - std::string m_ztitle; - std::string m_xaxislabels_detstr; - LArOnlineIDStrHelper* m_laronlineidstrhelper; -}; - -template<class TH1x_LW> -class LWHist1DFactory : public LWHistFactoryBase { -public: - - LWHist1DFactory(const char*title, unsigned nbins, double xmin, double xmax) - : LWHistFactoryBase(title), m_nbins(nbins), m_xmin(xmin), m_xmax(xmax) {} - ~LWHist1DFactory(){} - LWHist * create(const char*name) - { - TH1x_LW * h=TH1x_LW::create(name,"",m_nbins,m_xmin,m_xmax); - apply(h); - return h; - } -private: - unsigned m_nbins; - double m_xmin; - double m_xmax; -}; - -template<class TH2x_LW> -class LWHist2DFactory : public LWHistFactoryBase { -public: - - LWHist2DFactory(const char*title, unsigned nbinsx, double xmin, double xmax,unsigned nbinsy, double ymin, double ymax) - : LWHistFactoryBase(title), m_nbinsx(nbinsx), m_xmin(xmin), m_xmax(xmax), - m_nbinsy(nbinsy), m_ymin(ymin), m_ymax(ymax),m_varbinsx(0) {} - LWHist2DFactory(const char*title, unsigned nbinsx, double* xvarbins,unsigned nbinsy, double ymin, double ymax) - : LWHistFactoryBase(title), m_nbinsx(nbinsx), m_xmin(xvarbins[0]), m_xmax(xvarbins[nbinsx]), - m_nbinsy(nbinsy), m_ymin(ymin), m_ymax(ymax),m_varbinsx(new double[nbinsx+1]) - { - for (unsigned i=0;i<=nbinsx;++i) - m_varbinsx[i]=xvarbins[i]; - } - LWHist2DFactory(const LWHist2DFactory& other) : LWHistFactoryBase(other.m_title) - { - m_nbinsx = other.m_nbinsx; - m_xmin = other.m_xmin; - m_xmax = other.m_xmax; - m_nbinsy = other.m_nbinsy; - m_ymin = other.m_ymin; - m_ymax = other.m_ymax; - if( other.m_varbinsx != 0x0 ) - { - m_varbinsx = new double[m_nbinsx+1]; - for( unsigned int i=0; i < m_nbinsx+1; ++i ) - { - m_varbinsx[i] = other.m_varbinsx[i]; - } - } - } - ~LWHist2DFactory(){if( m_varbinsx != 0x0 ) delete[] m_varbinsx;} - LWHist * create(const char*name) - { - TH2x_LW * h(0); - if (m_varbinsx) - h=TH2x_LW::create(name,"",m_nbinsx,m_varbinsx,m_nbinsy,m_ymin,m_ymax); - else - h=TH2x_LW::create(name,"",m_nbinsx,m_xmin,m_xmax,m_nbinsy,m_ymin,m_ymax); - apply(h); - return h; - } -private: - unsigned m_nbinsx; - double m_xmin; - double m_xmax; - unsigned m_nbinsy; - double m_ymin; - double m_ymax; - double * m_varbinsx; - - LWHist2DFactory& operator= (const LWHist2DFactory&); -}; - -class LWHistProfileFactory : public LWHistFactoryBase { -public: - - LWHistProfileFactory(const char*title, unsigned nbinsx, double xmin, double xmax, double ymin=0.0, double ymax=0.0) - : LWHistFactoryBase(title), m_nbinsx(nbinsx), m_xmin(xmin), m_xmax(xmax), m_ymin(ymin), m_ymax(ymax) {} - ~LWHistProfileFactory(){} - LWHist * create(const char*name) - { - TProfile_LW * h=TProfile_LW::create(name,"",m_nbinsx,m_xmin,m_xmax,m_ymin,m_ymax); - apply((LWHist*)h); - return h; - } -private: - unsigned m_nbinsx; - double m_xmin; - double m_xmax; - double m_ymin; - double m_ymax; -}; - -class LWHistProfile2DFactory : public LWHistFactoryBase { -public: - - LWHistProfile2DFactory(const char*title, unsigned nbinsx, double xmin, double xmax, - unsigned nbinsy, double ymin, double ymax,double zmin=0.0,double zmax=0.0) - : LWHistFactoryBase(title), m_nbinsx(nbinsx), m_xmin(xmin), m_xmax(xmax), - m_nbinsy(nbinsy), m_ymin(ymin), m_ymax(ymax), m_zmin(zmin), m_zmax(zmax),m_varbinsx(0) {} - LWHistProfile2DFactory(const char*title, unsigned nbinsx, double* xvarbins, - unsigned nbinsy, double ymin, double ymax) - : LWHistFactoryBase(title), m_nbinsx(nbinsx), m_xmin(xvarbins[0]), m_xmax(xvarbins[nbinsx]), - m_nbinsy(nbinsy), m_ymin(ymin), m_ymax(ymax), m_zmin(0.0), m_zmax(0.0),m_varbinsx(new double[nbinsx+1]) - { - for (unsigned i=0;i<=nbinsx;++i) - m_varbinsx[i]=xvarbins[i]; - } - ~LWHistProfile2DFactory(){ delete [] m_varbinsx; } - LWHist * create(const char*name) - { - TProfile2D_LW * h(0); - if (m_varbinsx) - h=TProfile2D_LW::create(name,"",m_nbinsx,m_varbinsx,m_nbinsy,m_ymin,m_ymax/*,m_zmin,m_zmax*/); - else - h=TProfile2D_LW::create(name,"",m_nbinsx,m_xmin,m_xmax,m_nbinsy,m_ymin,m_ymax,m_zmin,m_zmax); - apply((LWHist*)h); - return h; - } -private: - unsigned m_nbinsx; - double m_xmin; - double m_xmax; - unsigned m_nbinsy; - double m_ymin; - double m_ymax; - double m_zmin; - double m_zmax; - double * m_varbinsx; - - LWHistProfile2DFactory (const LWHistProfile2DFactory&); - LWHistProfile2DFactory& operator= (const LWHistProfile2DFactory&); -}; - -#endif diff --git a/LArCalorimeter/LArMonTools/src/SelectAllLArRawChannels.h b/LArCalorimeter/LArMonTools/src/SelectAllLArRawChannels.h deleted file mode 100644 index 0a04abe8040f87e29222b242358ddce8cd0e8347..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/SelectAllLArRawChannels.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -//Dear emacs, this is -*-c++-*- - - -//This construct is a TEMORARY solution to allow the clients of LArRawChannel to compile -//in 13.X.Y as well as in 14.0.0 despite of the schema evolution of LArRawChannelContainer -//This file should go away as soon as the migration towards Rel 14 is finsihed. - -#ifndef LARMONTOOLS_SELECTALLLARRAWCHANNELS_H -#define LARMONTOOLS_SELECTALLLARRAWCHANNELS_H - -#include "LArRawEvent/LArRawChannelContainer.h" - -#ifdef LARRAWCHANNELCONTAINER_IS_NOT_IDENTIFIABLE - -class SelectAllLArRawChannels { - public: - SelectAllLArRawChannels(const LArRawChannelContainer* rc) : m_container(rc) {} - - class const_iterator : public LArRawChannelContainer::const_iterator { - public: - const_iterator() : LArRawChannelContainer::const_iterator() {} - const_iterator(LArRawChannelContainer::const_iterator it) : LArRawChannelContainer::const_iterator(it) {} - const LArRawChannel* operator*() {return &(LArRawChannelContainer::const_iterator::operator*());} - const LArRawChannel operator->() {return (LArRawChannelContainer::const_iterator::operator*());} - }; - - const_iterator begin() - { return const_iterator(m_container->begin()); } - - const_iterator end() - { return const_iterator(m_container->end()); } - - private: - const LArRawChannelContainer* m_container; - -}; -#else - -#include "EventContainers/SelectAllObject.h" -typedef SelectAllObject<LArRawChannelContainer> SelectAllLArRawChannels; - -#endif //LARRAWCHANNELCONTAINER_IS_NOT_IDENTIFIABLE -#endif //LARMONTOOLS_SELECTALLLARRAWCHANNELS_H diff --git a/LArCalorimeter/LArMonTools/src/components/LArMonTools_entries.cxx b/LArCalorimeter/LArMonTools/src/components/LArMonTools_entries.cxx deleted file mode 100644 index f68965f44335c64906b96eef827c72801fe43ace..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArMonTools/src/components/LArMonTools_entries.cxx +++ /dev/null @@ -1,25 +0,0 @@ -#include "../LArFEBMon.h" -#include "../LArRawChannelMonTool.h" -#include "../LArCollisionTimeMonTool.h" -#include "../LArCosmicsMonTool.h" -#include "../LArCoverage.h" -#include "../LArDigitMon.h" -#include "../LArRODMonTool.h" -#include "../LArAffectedRegions.h" -#include "../LArHVCorrectionMonTool.h" -#include "../LArNoisyROMon.h" -#include "../LArNoiseCorrelationMon.h" -#include "../LArCoherentNoisefractionMon.h" - -DECLARE_COMPONENT( LArFEBMon ) -DECLARE_COMPONENT( LArRawChannelMonTool ) -DECLARE_COMPONENT( LArCollisionTimeMonTool ) -DECLARE_COMPONENT( LArCosmicsMonTool ) -DECLARE_COMPONENT( LArCoverage ) -DECLARE_COMPONENT( LArDigitMon ) -DECLARE_COMPONENT( LArRODMonTool ) -DECLARE_COMPONENT( LArAffectedRegions ) -DECLARE_COMPONENT( LArHVCorrectionMonTool ) -DECLARE_COMPONENT( LArNoisyROMon ) -DECLARE_COMPONENT( LArNoiseCorrelationMon ) -DECLARE_COMPONENT( LArCoherentNoisefractionMon ) diff --git a/Reconstruction/RecExample/RecExCond/CMakeLists.txt b/Reconstruction/RecExample/RecExCond/CMakeLists.txt deleted file mode 100644 index bd638a964e76d9d8c9be5de1ef3171ad6f118c41..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExCond/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -# Declare the package name: -atlas_subdir( RecExCond ) - -# Install files from the package: -atlas_install_joboptions( share/*.py ) diff --git a/Reconstruction/RecExample/RecExCond/share/AllDet_detDescr.py b/Reconstruction/RecExample/RecExCond/share/AllDet_detDescr.py deleted file mode 100755 index 1844b9edf56a547eaf834073423f2705c3eefeb8..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExCond/share/AllDet_detDescr.py +++ /dev/null @@ -1,70 +0,0 @@ -# include so that alldet_detdescr can be used directly from somewhere else -# (there is an include.block so that it is only loaded once) -include.block("RecExCond/AllDet_detDescr.py") - -include ("RecExCond/RecExCommon_DetFlags.py") - -from AthenaCommon.Logging import logging -from AthenaCommon.Resilience import treatException,protectedInclude -from RecExConfig.RecFlags import rec - -logAllDet_detDescr = logging.getLogger( 'AllDet_detDescr' ) - - -if DetFlags.detdescr.any_on(): - # if an detdescr flag is on, then configure appropriately the - # StoreGateSvc/DetectorStore and the DetDescrCnvSvc - import DetDescrCnvSvc.DetStoreConfig - - # guess geometry version from globalflags - # see AtlasGeomodel/SetGeometryVersion.py for the possibilities - # e.g. DetDescrVersion="Rome-Initial" - - from AtlasGeoModel import SetGeometryVersion - from AtlasGeoModel import GeoModelInit - from AtlasGeoModel import SetupRecoGeometry - - if DetFlags.detdescr.Tile_on() and not rec.doAODMerging(): - - protectedInclude( "TileConditions/TileConditions_jobOptions.py" ) - - - - if DetFlags.detdescr.Calo_on() and not rec.doAODMerging(): - protectedInclude( "CaloIdCnv/CaloIdCnv_joboptions.py" ) - #FIXME tile and lar not independent - protectedInclude( "TileIdCnv/TileIdCnv_jobOptions.py" ) - - - if DetFlags.detdescr.LAr_on() and not rec.doAODMerging(): - try: - include( "LArDetDescr/LArDetDescr_joboptions.py" ) - except Exception: - DetFlags.Calo_setOff() - treatException("could not load LArDetDescr_jobOptions. Calo switched off") - - - - from AthenaCommon.AppMgr import ServiceMgr - import DetDescrCnvSvc.DetStoreConfig - ServiceMgr.DetDescrCnvSvc.DecodeIdDict = TRUE - - - -# Beam Spot service (only if ID requested) - from AthenaCommon.GlobalFlags import globalflags - # use even if commisisoning and not globalflags.DetGeo=='commis' : - if DetFlags.detdescr.ID_on() and not rec.doAODMerging(): - protectedInclude("BeamSpotConditions/BeamCondAlgSetup.py" ) - - - if DetFlags.detdescr.Muon_on() and not rec.doAODMerging(): - protectedInclude ("AmdcAth/AmdcAth_jobOptions.py") - - - # MagneticField Service - if DetFlags.detdescr.BField_on() and not rec.doAODMerging(): - #protectedInclude( "BFieldAth/BFieldAth_jobOptions.py" ) - import MagFieldServices.SetupField - - diff --git a/Reconstruction/RecExample/RecExCond/share/RecExCommon_DetFlags.py b/Reconstruction/RecExample/RecExCond/share/RecExCommon_DetFlags.py deleted file mode 100644 index e3e18fa7bcbc8d826f39456829f0dbf7c526bdda..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExCond/share/RecExCommon_DetFlags.py +++ /dev/null @@ -1,81 +0,0 @@ -include.block("RecExCond/RecExCommon_DetFlags.py") -from AthenaCommon.Logging import logging -logRecExCommon_DetFlags = logging.getLogger( 'RecExCommon_DetFlags' ) - -from AthenaCommon.Resilience import treatException -if 'DetFlags' in dir(): - logRecExCommon_DetFlags.info("DetFlags already defined.by user : user should have fully configured it already! ") -else: - - from AthenaCommon.GlobalFlags import globalflags - - # include DetFlags - # by default everything is off - from AthenaCommon.DetFlags import DetFlags - # switch on tasks for all detectors - DetFlags.detdescr.all_setOn() - # switch on dcs for all detectors - try: - # need AthenaCommon - DetFlags.dcs.all_setOn() - except Exception: - logRecExCommon_DetFlags.warning("could not set DetFlags.dcs") - pass - - from RecExConfig.RecFlags import rec - if not rec.readESD() and not rec.readAOD() and not rec.doWriteRDO() : - DetFlags.makeRIO.all_setOn() - else: - DetFlags.makeRIO.all_setOff() - #calo cells are there on ESD - if rec.readESD() : - DetFlags.readRIOPool.Calo_setOn() - # savannah 73686 - from RecExConfig.AutoConfiguration import IsInInputFile - from InDetRecExample.InDetKeys import InDetKeys - if IsInInputFile('InDet::PixelClusterContainer',InDetKeys.PixelClusters()): - DetFlags.readRIOPool.pixel_setOn() - if IsInInputFile('InDet::SCT_ClusterContainer',InDetKeys.SCT_Clusters()): - DetFlags.readRIOPool.SCT_setOn() - if IsInInputFile('InDet::TRT_DriftCircleContainer',InDetKeys.TRT_DriftCircles()): - DetFlags.readRIOPool.TRT_setOn() - if rec.doESD(): - if IsInInputFile('PixelRDO_Container',InDetKeys.PixelRDOs()): - DetFlags.makeRIO.pixel_setOn() - if IsInInputFile('SCT_RDO_Container',InDetKeys.SCT_RDOs()): - DetFlags.makeRIO.SCT_setOn() - if IsInInputFile('TRT_RDO_Container',InDetKeys.TRT_RDOs()): - DetFlags.makeRIO.TRT_setOn() - - DetFlags.readRIOPool.Muon_setOn() - - if rec.readRDO: - if globalflags.InputFormat=='pool': - DetFlags.readRDOPool.all_setOn() - DetFlags.readRDOBS.all_setOff() - DetFlags.readRIOBS.all_setOff() - from RecExConfig.AutoConfiguration import IsInInputFile - from InDetRecExample.InDetKeys import InDetKeys - if IsInInputFile('InDet::PixelClusterContainer',InDetKeys.PixelClusters()): - DetFlags.readRIOPool.pixel_setOn() - DetFlags.makeRIO.pixel_setOff() - if IsInInputFile('InDet::SCT_ClusterContainer',InDetKeys.SCT_Clusters()): - DetFlags.readRIOPool.SCT_setOn() - DetFlags.makeRIO.SCT_setOff() - if IsInInputFile('InDet::TRT_DriftCircleContainer',InDetKeys.TRT_DriftCircles()): - DetFlags.readRIOPool.TRT_setOn() - DetFlags.makeRIO.TRT_setOff() - elif globalflags.InputFormat=='bytestream': - DetFlags.readRDOPool.all_setOff() - DetFlags.readRDOBS.all_setOn() - else: - DetFlags.readRDOPool.all_setOff() - DetFlags.readRDOBS.all_setOff() - - -#synch muon flags to detflags -try: - from MuonRecExample.MuonRecFlags import muonRecFlags - muonRecFlags.sync_DetFlags() -except Exception: - treatException ("Could not synch DetFlags to muonRecFlags") diff --git a/Reconstruction/RecExample/RecExOnline/CMakeLists.txt b/Reconstruction/RecExample/RecExOnline/CMakeLists.txt index b77e0edbf06f8d4ecaf858d8de9aab8e2a4b1c06..a04097e0dcc1f5dae4bfaf495256dceb9f432a95 100644 --- a/Reconstruction/RecExample/RecExOnline/CMakeLists.txt +++ b/Reconstruction/RecExample/RecExOnline/CMakeLists.txt @@ -8,4 +8,3 @@ atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) atlas_install_runtime( share/RecExOnline_Test*.C ) atlas_install_scripts( scripts/*.sh ) - diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Phase1.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Phase1.py deleted file mode 100644 index b19fcab18a473a4c257c17b9235464a5b574da51..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_Partition_Online_L1Calo_Phase1.py +++ /dev/null @@ -1,244 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -## Job options for Running the L1Calo Athena Online Monitoring for Phase1 -## run through athena -## offline: athena --CA RecExOnline/RecExOnline_Partition_Online_L1Calo_Phase1.py --filesInput path/to/raw.data --evtMax 10 -## online: athena --CA RecExOnline/RecExOnline_Partition_Online_L1Calo_Phase1.py -## Author: Will Buttinger - -from AthenaCommon.Configurable import Configurable,ConfigurableCABehavior -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator,appendCAtoAthena -from AthenaConfiguration.ComponentFactory import CompFactory,isComponentAccumulatorCfg -from AthenaConfiguration.AllConfigFlags import initConfigFlags -from AthenaConfiguration.Enums import LHCPeriod -from AthenaCommon import Constants -import os -import ispy -partition = ispy.IPCPartition(os.getenv("TDAQ_PARTITION","ATLAS")) - -if partition.isValid(): - print("Running Online with Partition:",partition.name()) -else: - print("Partition",partition.name()," not found. Running Offline - must provide input files!") - -ConfigFlags = initConfigFlags() -ConfigFlags.Input.Files = [] # so that when no files given we can detect that - -# Note: The order in which all these flag defaults get set is very fragile -# so don't reorder the setup of this ConfigFlags stuff - -if not isComponentAccumulatorCfg(): - # running as a jobo - # from AthenaCommon.DetFlags import DetFlags - # DetFlags.detdescr.all_setOff() - # DetFlags.detdescr.Calo_setOn() - decodeInputs = True - # next three lines so that conddb set up ok - if len(jps.AthenaCommonFlags.FilesInput())>0: - from RecExConfig import AutoConfiguration - AutoConfiguration.ConfigureSimulationOrRealData() #sets globalflags.DataSource - AutoConfiguration.ConfigureFromListOfKeys(['ProjectName']) #sets rec.projectName, necessary to infer DatabaseInstance if that is left to 'auto' (default value) - from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags - ConfigFlags = getNewConfigFlags() # replace flags with old flags - ConfigFlags.Exec.MaxEvents = jps.AthenaCommonFlags.EvtMax() # didn't get copied so do it manually now - elif partition.isValid(): - # running online, need to set some flags for conddb to be setup correctly at this point - jps.Global.DataSource = 'data' - jps.AthenaCommonFlags.isOnline = True - -ConfigFlags.Trigger.triggerConfig='DB' #for L1menu if running offline -## Modify default flags -ConfigFlags.GeoModel.Run = LHCPeriod.Run3 # needed for LArGMConfig - or can infer from above -ConfigFlags.Common.useOnlineLumi = True # needed for lumi-scaled monitoring, only have lumi in online DB at this time -ConfigFlags.DQ.enableLumiAccess = False # in fact, we don't need lumi access for now ... this terms it all off -ConfigFlags.DQ.FileKey = "" if partition.isValid() else "EXPERT" # histsvc file "name" to record to - Rafal asked it to be blank @ P1 ... means monitoring.root will be empty -ConfigFlags.Output.HISTFileName = "monitoring.root" # control names of monitoring root file -ConfigFlags.DQ.useTrigger = False # don't do TrigDecisionTool in MonitorCfg helper methods -# flags for rerunning simulation -ConfigFlags.Trigger.L1.doeFex = True -ConfigFlags.Trigger.L1.dojFex = False -ConfigFlags.Trigger.L1.dogFex = False -# if running online, override these with autoconfig values -# will set things like the GlobalTag automatically -if partition.isValid(): - from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags - autoConfigOnlineRecoFlags(ConfigFlags, partition.name()) # sets things like projectName etc which would otherwise be inferred from input file -ConfigFlags.IOVDb.GlobalTag = "CONDBR2-ES1PA-2022-07" #"CONDBR2-HLTP-2022-02" -# now parse -if isComponentAccumulatorCfg(): - parser = ConfigFlags.getArgumentParser() - parser.add_argument('--runNumber',default=None,help="specify to select a run number") - parser.add_argument('--lumiBlock',default=None,help="specify to select a lumiBlock") - parser.add_argument('--stream',default="physics_L1Calo",help="stream to lookup files in") - parser.add_argument('--decodeInputs',default=True,help="enable/disable input decoding+monitoring") - parser.add_argument('--fexReadoutFilter',action='store_true',help="If specified, will skip events without fexReadout") - args = ConfigFlags.fillFromArgs(parser=parser) - decodeInputs = args.decodeInputs - if args.runNumber is not None: - from glob import glob - if args.lumiBlock is None: args.lumiBlock="*" - print("Looking up files in atlastier0 for run",args.runNumber,"lb =",args.lumiBlock) - ConfigFlags.Input.Files = [] - for lb in args.lumiBlock.split(","): - print("Trying",f"/eos/atlas/atlastier0/rucio/data*/{args.stream}/*{args.runNumber}/*/*lb{int(lb):04}.*") - ConfigFlags.Input.Files += glob(f"/eos/atlas/atlastier0/rucio/data*/{args.stream}/*{args.runNumber}/*/*lb{int(lb):04}.*") - print("Found",len(ConfigFlags.Input.Files),"files") - -# require at least 1 input file if running offline -if not partition.isValid() and len(ConfigFlags.Input.Files)==0: - print("FATAL: Running in offline mode but no input files provided") - import sys - sys.exit(1) - -# add detector conditions flags required for rerunning simulation -# needs input files declared if offline, hence doing after parsing -from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList -setupDetectorsFromList(ConfigFlags,['LAr','Tile','MBTS'],True) - - -if isComponentAccumulatorCfg(): - from AthenaConfiguration.MainServicesConfig import MainServicesCfg - acc = MainServicesCfg(ConfigFlags) -else: - # for an unknown reason it seems like its necessary to create - # setup the IOVDbSvc now otherwise conditions aren't done properly - its like CA config isn't getting applied properly? - # and the CALIBRATIONS folder isnt found - from IOVDbSvc.CondDB import conddb - with ConfigurableCABehavior(): - from AthenaConfiguration.MainServicesConfig import MessageSvcCfg - acc = MessageSvcCfg(ConfigFlags) # start with just messageSvc ComponentAccumulator() # use empty accumulator - -with ConfigurableCABehavior(): # need to temporarily activate run3 behaviour to use this configuration method - - ConfigFlags.lock() - if ConfigFlags.Exec.MaxEvents == 0: ConfigFlags.dump(evaluate=True) - - if partition.isValid(): - from ByteStreamEmonSvc.EmonByteStreamConfig import EmonByteStreamCfg - acc.merge(EmonByteStreamCfg(ConfigFlags)) # setup EmonSvc - bsSvc = acc.getService("ByteStreamInputSvc") - bsSvc.Partition = partition.name() - bsSvc.Key = os.environ.get("L1CALO_PTIO_KEY", "REB" if partition.name()=="L1CaloStandalone" else "dcm") # set the Sampler Key Type name (default is SFI) - if partition.name()=="L1CaloSTF": bsSvc.Key = "SWROD" - bsSvc.KeyCount = int(os.environ.get("L1CALO_PTIO_KEY_COUNT","25")) - bsSvc.ISServer = "Histogramming" # IS server on which to create this provider - bsSvc.BufferSize = 10 # event buffer size for each sampler - bsSvc.UpdatePeriod = 30 # time in seconds between updating plots - bsSvc.Timeout = 240000 # timeout (not sure what this does) - bsSvc.PublishName = os.getenv("L1CALO_ATHENA_JOB_NAME","testing") # set name of this publisher as it will appear in IS (default is "l1calo-athenaHLT"; change to something sensible for testing) - bsSvc.StreamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics") # name of the stream type (physics,express, etc.) - bsSvc.ExitOnPartitionShutdown = False - bsSvc.ClearHistograms = True # clear hists at start of new run - bsSvc.GroupName = "RecExOnline" - # name of the stream (Egamma,JetTauEtmiss,MinBias,Standby, etc.), this can be a colon(:) separated list of streams that use the 'streamLogic' to combine stream for 2016 HI run - bsSvc.StreamNames = os.getenv("L1CALO_PTIO_STREAM_NAME","L1Calo:Main:MinBias:MinBiasOverlay:UPC:EnhancedBias:ZeroBias:HardProbes:Standby:ALFACalib").split(":") - bsSvc.StreamLogic = os.getenv("L1CALO_PTIO_STREAM_LOGIC","Or") if partition.name() != "L1CaloStandalone" else "Ignore" - bsSvc.LVL1Names = [] # name of L1 items to select - bsSvc.LVL1Logic = "Ignore" # one of: Ignore, Or, And - else: - print("Running Offline on", len(ConfigFlags.Input.Files),"files") - from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg - acc.merge(ByteStreamReadCfg(ConfigFlags)) # configure reading bytestream - - # ensure histsvc is set up - from AthenaMonitoring.AthMonitorCfgHelper import getDQTHistSvc - acc.merge(getDQTHistSvc(ConfigFlags)) - - # Create run3 L1 menu (needed for L1Calo EDMs) - from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg - acc.merge(L1ConfigSvcCfg(ConfigFlags)) - - # -------- CHANGES GO BELOW ------------ - # setup the L1Calo software we want to monitor - - decoderTools = [] - - from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg, jFexRoiByteStreamToolCfg, jFexInputByteStreamToolCfg, gFexByteStreamToolCfg, gFexInputByteStreamToolCfg - from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoring import L1TriggerByteStreamDecoderMonitoring - decoderTools += [acc.popToolsAndMerge(eFexByteStreamToolCfg(flags=ConfigFlags,name='eFexBSDecoder',TOBs=True,xTOBs=True,decodeInputs=decodeInputs))] - decoderTools += [acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags=ConfigFlags,name="jFexBSDecoderTool",writeBS=False))] - decoderTools += [acc.popToolsAndMerge(gFexByteStreamToolCfg(flags=ConfigFlags,name="gFexBSDecoderTool",writeBS=False))] - - if decodeInputs: - decoderTools += [acc.popToolsAndMerge(jFexInputByteStreamToolCfg(flags=ConfigFlags,name='jFexInputBSDecoderTool',writeBS=False))] - decoderTools += [acc.popToolsAndMerge(gFexInputByteStreamToolCfg(flags=ConfigFlags,name='gFexInputBSDecoderTool',writeBS=False))] - - - acc.addEventAlgo(CompFactory.L1TriggerByteStreamDecoderAlg( - name="L1TriggerByteStreamDecoder", - OutputLevel=Constants.ERROR, # hides warnings about non-zero status codes in fragments ... will show up in hists - DecoderTools=decoderTools, - MaybeMissingROBs= [id for tool in decoderTools for id in tool.ROBIDs ] if partition.name()!="ATLAS" or not partition.isValid() else [], # allow missing ROBs away from online ATLAS partition - MonTool=L1TriggerByteStreamDecoderMonitoring("L1TriggerByteStreamDecoder", ConfigFlags, decoderTools) - ),sequenceName='AthAlgSeq' - ) - - # rerun sim if required - if ConfigFlags.Trigger.L1.doeFex or ConfigFlags.Trigger.L1.dojFex or ConfigFlags.Trigger.L1.dogFex: - from L1CaloFEXSim.L1CaloFEXSimCfg import L1CaloFEXSimCfg - acc.merge(L1CaloFEXSimCfg(ConfigFlags, eFexTowerInputs = ['L1_eFexDataTowers','L1_eFexEmulatedTowers'], deadMaterialCorrections=True)) # configures dual-input mode - - - from TrigT1CaloMonitoring.EfexMonitorAlgorithm import EfexMonitoringConfig - acc.merge(EfexMonitoringConfig(ConfigFlags)) - EfexMonAlg = acc.getEventAlgo('EfexMonAlg') - # do we need next lines?? - EfexMonAlg.eFexEMTobKeyList = ['L1_eEMRoI', 'L1_eEMxRoI'] # default is just L1_eEMRoI - EfexMonAlg.eFexTauTobKeyList = ['L1_eTauRoI', 'L1_eTauxRoI'] - - if ConfigFlags.Trigger.L1.doeFex or ConfigFlags.Trigger.L1.dojFex or ConfigFlags.Trigger.L1.dogFex: - # Adjust eFEX containers to be monitored to also monitor the sim RoI - for list in [EfexMonAlg.eFexEMTobKeyList,EfexMonAlg.eFexTauTobKeyList]: list += [x + "Sim" for x in list ] - # monitoring of simulation vs hardware - from TrigT1CaloMonitoring.EfexSimMonitorAlgorithm import EfexSimMonitoringConfig - acc.merge(EfexSimMonitoringConfig(ConfigFlags)) - # EfexSimMonitorAlgorithm = acc.getEventAlgo('EfexSimMonAlg') - - # and now book the histograms that depend on the containers - from TrigT1CaloMonitoring.EfexMonitorAlgorithm import EfexMonitoringHistConfig - acc.merge(EfexMonitoringHistConfig(ConfigFlags,EfexMonAlg)) - from TrigT1CaloMonitoring.JfexMonitorAlgorithm import JfexMonitoringConfig - acc.merge(JfexMonitoringConfig(ConfigFlags)) - from TrigT1CaloMonitoring.GfexMonitorAlgorithm import GfexMonitoringConfig - acc.merge(GfexMonitoringConfig(ConfigFlags)) - - # input data monitoring - if decodeInputs: - from TrigT1CaloMonitoring.EfexInputMonitorAlgorithm import EfexInputMonitoringConfig - acc.merge(EfexInputMonitoringConfig(ConfigFlags)) - from TrigT1CaloMonitoring.JfexInputMonitorAlgorithm import JfexInputMonitoringConfig - acc.merge(JfexInputMonitoringConfig(ConfigFlags)) - from TrigT1CaloMonitoring.GfexInputMonitorAlgorithm import GfexInputMonitoringConfig - acc.merge(GfexInputMonitoringConfig(ConfigFlags)) - - if args.fexReadoutFilter: - # want to take existing AthAllSeqSeq and move it inside a new sequence - topSeq = acc.getSequence("AthAlgEvtSeq") - algSeq = acc.getSequence("AthAllAlgSeq") - # topSeq has three sub-sequencers ... preserve first and last - topSeq.Members = [topSeq.Members[0],CompFactory.AthSequencer("NewAthAllAlgSeq"),topSeq.Members[-1]] - acc.addEventAlgo(CompFactory.L1IDFilterAlgorithm(),sequenceName="NewAthAllAlgSeq") - acc.getSequence("NewAthAllAlgSeq").Members += [algSeq] - acc.printConfig() - - from AthenaConfiguration.Utils import setupLoggingLevels - setupLoggingLevels(ConfigFlags,acc) - - if acc.getService("AthenaEventLoopMgr"): acc.getService("AthenaEventLoopMgr").IntervalInSeconds = 30 - - # -------- CHANGES GO ABOVE ------------ - -if ConfigFlags.Exec.MaxEvents==0: acc.printConfig() -print("Configured Services:",*[svc.name for svc in acc.getServices()]) -print("Configured EventAlgos:",*[alg.name for alg in acc.getEventAlgos()]) -print("Configured CondAlgos:",*[alg.name for alg in acc.getCondAlgos()]) - - -if not isComponentAccumulatorCfg(): - appendCAtoAthena(acc) - #svcMgr.StoreGateSvc.Dump=True;svcMgr.DetectorStore.Dump=True - #svcMgr.IOVDbSvc.OutputLevel=DEBUG; print(svcMgr.IOVDbSvc) -else: - if acc.run().isFailure(): - import sys - sys.exit(1) diff --git a/TileCalorimeter/TileMonitoring/python/TileJetMonitorAlgorithm.py b/TileCalorimeter/TileMonitoring/python/TileJetMonitorAlgorithm.py index c67666103cf0c5ac55d3099c3e1c18d7ed064d5f..9f9acb3e19d655724533723a8974a72309305f13 100644 --- a/TileCalorimeter/TileMonitoring/python/TileJetMonitorAlgorithm.py +++ b/TileCalorimeter/TileMonitoring/python/TileJetMonitorAlgorithm.py @@ -47,11 +47,14 @@ def TileJetMonitoringConfig(flags, **kwargs): # Low Gain kwargs.setdefault('ChannelEnergyMin', 15000) kwargs.setdefault('ChannelEnergyMax', 50000) + kwargs.setdefault('ChannelGain', 0) + else: # High Gain kwargs.setdefault('ChannelEnergyMin', 2000) kwargs.setdefault('ChannelEnergyMax', 4000) - + kwargs.setdefault('ChannelGain', 1) + for k, v in kwargs.items(): setattr(tileJetMonAlg, k, v) @@ -153,7 +156,8 @@ def TileJetMonitoringConfig(flags, **kwargs): tileJetMonAlg.CellEnergyUpperLimitsHG = energiesHG tileJetMonAlg.CellEnergyUpperLimitsLG = energiesLG - samples = ['A', 'BC', 'D', 'E'] + samples_LB = ['A', 'BC', 'D', 'B9'] + samples_EB = ['A', 'B', 'C10', 'D4', 'E1', 'E2', 'E3', 'E4'] # 4) Configure histograms with Tile cell time in energy slices per partition and gain cellTimeGroup = helper.addGroup(tileJetMonAlg, 'TileJetCellTime', 'Tile/Jet/CellTime/') @@ -164,21 +168,28 @@ def TileJetMonitoringConfig(flags, **kwargs): for index in range(0, len(energies) + 1): toEnergy = energies[index] if index < len(energies) else None fromEnergy = energies[index - 1] if index > 0 else None + if not toEnergy: + title_suffix = ' > ' + str(fromEnergy) + ' MeV; time [ns]' + elif not fromEnergy: + title_suffix = ' < ' + str(toEnergy) + ' MeV; time [ns]' + else: + title_suffix = ' [' + str(fromEnergy) + ' .. ' + str(toEnergy) + ') MeV; time [ns]' # TD: add histograms per partition and per radial sampling - for samp in range(0,3): - name = 'Cell_time_' + partition + '_' + samples[samp] + '_' + gain + '_slice_' + str(index) - title = 'Partition ' + partition + ', sampling ' + samples[samp] + ': ' + gain + ' Tile Cell time in energy range' - if not toEnergy: - title += ' > ' + str(fromEnergy) + ' MeV; time [ns]' - elif not fromEnergy: - title += ' < ' + str(toEnergy) + ' MeV; time [ns]' - else: - title += ' [' + str(fromEnergy) + ' .. ' + str(toEnergy) + ') MeV; time [ns]' - cellTimeGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', - xbins = 600, xmin = -30.0, xmax = 30.0) + if (partition == 'LBA') or (partition == 'LBC'): + for samp in range(0,len(samples_LB)): + name = 'Cell_time_' + partition + '_' + samples_LB[samp] + '_' + gain + '_slice_' + str(index) + title = 'Partition ' + partition + ', sampling ' + samples_LB[samp] + ': ' + gain + ' Tile Cell time in energy range' + title_suffix + cellTimeGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', + xbins = 600, xmin = -30.0, xmax = 30.0) + else: + for samp in range(0,len(samples_EB)): + name = 'Cell_time_' + partition + '_' + samples_EB[samp] + '_' + gain + '_slice_' + str(index) + title = 'Partition ' + partition + ', sampling ' + samples_EB[samp] + ': ' + gain + ' Tile Cell time in energy range' + title_suffix + cellTimeGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', + xbins = 600, xmin = -30.0, xmax = 30.0) + - if DoEnergyProfiles: # 5) Configure 1D histograms (profiles) with Tile cell energy profile in energy slices per partition and gain @@ -186,15 +197,26 @@ def TileJetMonitoringConfig(flags, **kwargs): for partition in partitions: for gain in gains: # TD: add profiles per partition and per sampling - for samp in range(0,3): - name = 'index_' + partition + '_' + samples[samp] + '_' + gain - name += ',energy_' + partition + '_' + samples[samp] + '_' + gain - name += ';Cell_ene_' + partition + '_' + samples[samp] + '_' + gain + '_prof' - title = 'Partition ' + partition + ', sampling ' + samples[samp] + ': ' + gain + ' Tile Cell energy profile;Slice;Energy [MeV]' - xmax = len(energiesALL[gain]) + 0.5 - nbins = len(energiesALL[gain]) + 1 - cellEnergyProfileGroup.defineHistogram(name, title = title, path = partition, type = 'TProfile', - xbins = nbins, xmin = -0.5, xmax = xmax) + if (partition == 'LBA') or (partition == 'LBC'): + for samp in range(0,len(samples_LB)): + name = 'index_' + partition + '_' + samples_LB[samp] + '_' + gain + name += ',energy_' + partition + '_' + samples_LB[samp] + '_' + gain + name += ';Cell_ene_' + partition + '_' + samples_LB[samp] + '_' + gain + '_prof' + title = 'Partition ' + partition + ', sampling ' + samples_LB[samp] + ': ' + gain + ' Tile Cell energy profile;Slice;Energy [MeV]' + xmax = len(energiesALL[gain]) + 0.5 + nbins = len(energiesALL[gain]) + 1 + cellEnergyProfileGroup.defineHistogram(name, title = title, path = partition, type = 'TProfile', + xbins = nbins, xmin = -0.5, xmax = xmax) + else: + for samp in range(0,len(samples_EB)): + name = 'index_' + partition + '_' + samples_EB[samp] + '_' + gain + name += ',energy_' + partition + '_' + samples_EB[samp] + '_' + gain + name += ';Cell_ene_' + partition + '_' + samples_EB[samp] + '_' + gain + '_prof' + title = 'Partition ' + partition + ', sampling ' + samples_EB[samp] + ': ' + gain + ' Tile Cell energy profile;Slice;Energy [MeV]' + xmax = len(energiesALL[gain]) + 0.5 + nbins = len(energiesALL[gain]) + 1 + cellEnergyProfileGroup.defineHistogram(name, title = title, path = partition, type = 'TProfile', + xbins = nbins, xmin = -0.5, xmax = xmax) else: @@ -213,12 +235,21 @@ def TileJetMonitoringConfig(flags, **kwargs): cellEnergyGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', xbins = 100, xmin = fromEnergy, xmax = toEnergy) # TD: add histograms per partition - for samp in range(0,3): - name = 'Cell_ene_' + partition + '_' + samples[samp] + '_' + gain + '_slice_' + str(index) - title = 'Partition ' + partition + ', sampling ' + samples[samp] + ': ' + gain + ' Tile Cell Energy' - title += ' in energy range [' + str(fromEnergy) + ' .. ' + str(toEnergy) + ') MeV;Energy [MeV]' - cellEnergyGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', - xbins = 100, xmin = fromEnergy, xmax = toEnergy) + if (partition == 'LBA') or (partition == 'LBC'): + for samp in range(0,len(samples_LB)): + name = 'Cell_ene_' + partition + '_' + samples_LB[samp] + '_' + gain + '_slice_' + str(index) + title = 'Partition ' + partition + ', sampling ' + samples_LB[samp] + ': ' + gain + ' Tile Cell Energy' + title += ' in energy range [' + str(fromEnergy) + ' .. ' + str(toEnergy) + ') MeV;Energy [MeV]' + cellEnergyGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', + xbins = 100, xmin = fromEnergy, xmax = toEnergy) + else: + for samp in range(0,len(samples_EB)): + name = 'Cell_ene_' + partition + '_' + samples_EB[samp] + '_' + gain + '_slice_' + str(index) + title = 'Partition ' + partition + ', sampling ' + samples_EB[samp] + ': ' + gain + ' Tile Cell Energy' + title += ' in energy range [' + str(fromEnergy) + ' .. ' + str(toEnergy) + ') MeV;Energy [MeV]' + cellEnergyGroup.defineHistogram(name, title = title, path = partition, type = 'TH1F', + xbins = 100, xmin = fromEnergy, xmax = toEnergy) + diff --git a/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.cxx index 14c2a145f38e7c3e52dfea32ce3453fb937fcbee..4c29b3f7c931efb7ada17d99385609e70c15d57d 100644 --- a/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.cxx @@ -76,6 +76,22 @@ StatusCode TileJetMonitorAlgorithm::initialize() { ATH_CHECK( m_jetContainerKey.initialize() ); ATH_CHECK( m_caloCellContainerKey.initialize() ); + /* Initialize Gain and Min/Max cell energies for E-cells: + if they are not explicitly given, set them as for the ordinary cells + */ + if (m_energyE1Min < 0) m_energyE1Min = m_energyChanMin; + if (m_energyE1Max < 0) m_energyE1Max = m_energyChanMax; + if (m_gainE1 < 0) m_gainE1 = m_gain; + if (m_energyE2Min < 0) m_energyE2Min = m_energyE1Min; + if (m_energyE2Max < 0) m_energyE2Max = m_energyE1Max; + if (m_gainE2 < 0) m_gainE2 = m_gainE1; + if (m_energyE3Min < 0) m_energyE3Min = m_energyE2Min; + if (m_energyE3Max < 0) m_energyE3Max = m_energyE2Max; + if (m_gainE3 < 0) m_gainE3 = m_gainE2; + if (m_energyE4Min < 0) m_energyE4Min = m_energyE3Min; + if (m_energyE4Max < 0) m_energyE4Max = m_energyE3Max; + if (m_gainE4 < 0) m_gainE4 = m_gainE3; + return StatusCode::SUCCESS; } @@ -144,7 +160,6 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin ToolHandle<GenericMonitoringTool> tileJetChannTimeDQTool = getGroup("TileJetChanTimeDQ"); - std::array<std::string, 4> sampleName{"A", "BC", "D", "E"}; std::array<std::string, 2> gainName{"LG", "HG"}; std::array<std::string, 5> partitionName{"AUX", "LBA", "LBC", "EBA", "EBC"}; @@ -167,6 +182,7 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin // int module = m_tileID->module(id); // ranges 0..63 auto module = Monitored::Scalar<int>("module", m_tileID->module(id)); int sample = m_tileID->sample(id); // ranges 0..3 (A, BC, D, E) + int tower = m_tileID->tower(id); int ros1 = 0; int ros2 = 0; int chan1 = -1; @@ -215,7 +231,7 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin */ // first channel - if (is_good1 && (ene1 > m_energyChanMin) && (ene1 < m_energyChanMax)) { + if (is_good1 && matchesEnergyRange(sample, tower, ene1, gain1)) { if (m_do1DHistograms) { std::string name = TileCalibUtils::getDrawerString(ros1, module) + "_ch_" + std::to_string(chan1) + "_1d"; auto channelTime = Monitored::Scalar<float>(name, tilecell->time1()); @@ -244,7 +260,7 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin auto channelTime = Monitored::Scalar<float>(name, tilecell->time1()); fill("TileJetChanTime", channelTime); - if ((ros1 >= 3) && (sample < TileID::SAMP_E)) { + if ((ros1 > 2) && (sample < TileID::SAMP_E)) { std::string nameNoScint("channelTime" + partitionName[ros1] + "_NoScint"); auto channelTimeNoScint = Monitored::Scalar<float>(nameNoScint, tilecell->time1()); fill("TileJetChanTime", channelTimeNoScint); @@ -253,7 +269,7 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin } // second channel - if (is_good2 && (ene2 > m_energyChanMin) && (ene2 < m_energyChanMax)) { + if (is_good2 && matchesEnergyRange(sample, tower, ene2, gain2)) { if (m_do1DHistograms) { std::string name = TileCalibUtils::getDrawerString(ros2, module) + "_ch_" + std::to_string(chan2) + "_1d"; auto channelTime = Monitored::Scalar<float>(name, tilecell->time2()); @@ -293,9 +309,11 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin /* Now filling the cell-based histograms, - HG-HG and LG-LG combinations only + HG-HG and LG-LG combinations only for normal cells, + also include E-cells */ - if ((is_good1) && (is_good2) && (gain1 == gain2)) { + if ((is_good1) && (((is_good2) && (gain1 == gain2)) || (sample == TileID::SAMP_E))) { + // E-cells are read-out by one channel only, so is_good2 = false for E-cells if (m_doEnergyDiffHistograms && (tilecell->energy() > m_energyDiffThreshold)) { // EneDiff histograms @@ -310,39 +328,35 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin if ((bad1 < 2) && (bad2 < 2)) { // cell-time histograms, only overall, require not affected channels - if ((ros1 < 3) || (sample != TileID::SAMP_E)) { - int index = findIndex(gain1, tilecell->energy()); - ATH_MSG_DEBUG( "Filling in cell-time for " << TileCalibUtils::getDrawerString(ros1, module) - << ", ch1 " << chan1 - << ", ch2 " << chan2 - << ", ene " << tilecell->energy() - << ", index " << index - << ", time: " << tilecell->time()); + int index = findIndex(gain1, tilecell->energy()); + ATH_MSG_DEBUG( "Filling in cell-time for " << TileCalibUtils::getDrawerString(ros1, module) + << ", ch1 " << chan1 + << ", ch2 " << chan2 + << ", ene " << tilecell->energy() + << ", index " << index + << ", time: " << tilecell->time()); - // TD adding histograms per partition and per radial sampling - std::string name1("Cell_time_" + partitionName[ros1] + "_" + sampleName[sample] + "_" + gainName[gain1] + "_slice_" + std::to_string(index)); - auto cellTime1 = Monitored::Scalar<float>(name1, tilecell->time()); - fill("TileJetCellTime", cellTime1); - + // TD adding histograms per partition and per radial sampling + std::string name1("Cell_time_" + partitionName[ros1] + "_" + sampleName(ros1, sample, tower) + "_" + gainName[gain1] + "_slice_" + std::to_string(index)); + auto cellTime1 = Monitored::Scalar<float>(name1, tilecell->time()); + fill("TileJetCellTime", cellTime1); - if (m_doEnergyProfiles) { - // TD adding energy profiles per partition and per radial sampling - std::string indexName1("index_" + partitionName[ros1] + "_" + sampleName[sample] + "_" + gainName[gain1]); - auto energyIndex1 = Monitored::Scalar<float>(indexName1, index); - - std::string energyName1("energy_" + partitionName[ros1] + "_" + sampleName[sample] + "_" + gainName[gain1]); - auto cellEnergy1 = Monitored::Scalar<float>(energyName1, tilecell->energy()); - - fill("TileJetCellEnergyProfile", energyIndex1, cellEnergy1); - } else { - // TD adding energy histograms per partition and per radial sampling - std::string name1("Cell_ene_" + partitionName[ros1] + "_" + sampleName[sample] + "_" + gainName[gain1] + "_slice_" + std::to_string(index)); - auto cellEnergy1 = Monitored::Scalar<float>(name1, tilecell->energy()); - fill("TileJetCellEnergy", cellEnergy1); - } - - } - } + if (m_doEnergyProfiles) { + // TD adding energy profiles per partition and per radial sampling + std::string indexName1("index_" + partitionName[ros1] + "_" + sampleName(ros1, sample, tower) + "_" + gainName[gain1]); + auto energyIndex1 = Monitored::Scalar<float>(indexName1, index); + + std::string energyName1("energy_" + partitionName[ros1] + "_" + sampleName(ros1, sample, tower) + "_" + gainName[gain1]); + auto cellEnergy1 = Monitored::Scalar<float>(energyName1, tilecell->energy()); + + fill("TileJetCellEnergyProfile", energyIndex1, cellEnergy1); + } else { + // TD adding energy histograms per partition and per radial sampling + std::string name1("Cell_ene_" + partitionName[ros1] + "_" + sampleName(ros1, sample, tower) + "_" + gainName[gain1] + "_slice_" + std::to_string(index)); + auto cellEnergy1 = Monitored::Scalar<float>(name1, tilecell->energy()); + fill("TileJetCellEnergy", cellEnergy1); + } + } } } else { ATH_MSG_DEBUG("Cell " << cellIndex << " is NOT Tilecal"); @@ -355,7 +369,71 @@ StatusCode TileJetMonitorAlgorithm::fillTimeHistograms(const xAOD::Jet& jet, uin return StatusCode::SUCCESS; } +/*---------------------------------------------------------*/ +std::string TileJetMonitorAlgorithm::sampleName(const int ros, const int sample, const int tower) const { +/*---------------------------------------------------------*/ + std::array<std::string, 3> sample_Name_LB{"A", "BC", "D"}; + std::array<std::string, 4> sample_Name_EB{"A", "B", "D", "E"}; + std::string s_name; + if (ros < 3) { // LBA, LBC + s_name = sample_Name_LB[sample]; // default, standard cells + if ((sample == TileID::SAMP_BC) && (tower == 8)) { // cell B9 + s_name = "B9"; + } + } else { // EBA, EBC + s_name = sample_Name_EB[sample]; //default, standard cells + if ((sample == TileID::SAMP_C) && (tower == 9)) { // cell C10 + s_name = "C10"; + } + if ((sample == TileID::SAMP_D) && (tower == 8)) { // cell D4 + s_name = "D4"; + } + if ((sample == TileID::SAMP_E) && (tower == 10)) { // cell E1 + s_name = "E1"; + } + if ((sample == TileID::SAMP_E) && (tower == 11)) { // cell E2 + s_name = "E2"; + } + if ((sample == TileID::SAMP_E) && (tower == 13)) { // cell E3 + s_name = "E3"; + } + if ((sample == TileID::SAMP_E) && (tower == 15)) { // cell E4 + s_name = "E4"; + } + } + return s_name; +} +/*---------------------------------------------------------*/ +bool TileJetMonitorAlgorithm::matchesEnergyRange(const int sample, const int tower, const float energy, const int gain) const { +/*---------------------------------------------------------*/ + /* Want to separate E-cells, D4 and C10 from the rest: + ros: 1-2 LBA/LBC, 3-4 EBA/EBC + sample: 0 = A, 1 = B/BC/C, D = 2, E = 3 + tower: 10 = E1, 11 = E2, 13 = E3, 14 = E4, 8 = D4, 9 = C10 + Nevertheless, C10 and D4 have the same limits, since these are ordinary cells + */ + if (sample != TileID::SAMP_E) { + return((energy > m_energyChanMin) && (energy < m_energyChanMax) && (gain == m_gain)); + } else { + switch (tower) { + case 10: + return((energy > m_energyE1Min) && (energy < m_energyE1Max) && (gain == m_gainE1)); + break; + case 11: + return((energy > m_energyE2Min) && (energy < m_energyE2Max) && (gain == m_gainE2)); + break; + case 13: + return((energy > m_energyE3Min) && (energy < m_energyE3Max) && (gain == m_gainE3)); + break; + case 15: + return((energy > m_energyE4Min) && (energy < m_energyE4Max) && (gain == m_gainE4)); + break; + default: + return false; + } + } +} bool TileJetMonitorAlgorithm::isGoodChannel(int ros, int module, int channel, uint32_t bad, unsigned int qbit, Identifier id) const { diff --git a/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.h index 13a25a8d1eae9c9cd4893e0922e29b7123636cea..064e52018d52ff5b1e43c6492cceba6c88f4299b 100644 --- a/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.h +++ b/TileCalorimeter/TileMonitoring/src/TileJetMonitorAlgorithm.h @@ -47,12 +47,28 @@ class TileJetMonitorAlgorithm : public AthMonitorAlgorithm { bool passesJvt(const xAOD::Jet& jet) const; bool isGoodJet(const xAOD::Jet& jet) const; bool isGoodEvent(const EventContext& ctx) const; - + std::string sampleName(const int ros, const int sample, const int tower) const; + bool matchesEnergyRange(const int sample, const int tower, const float energy, const int gain) const; + Gaudi::Property<float> m_jetPtMin{this, "JetPtMin", 20000., "Threshold in MeV"}; Gaudi::Property<float> m_jetPtMax{this, "JetPtMax", 120000, ""}; Gaudi::Property<float> m_jetEtaMax{this, "JetEtaMax", 1.6, ""}; Gaudi::Property<float> m_energyChanMin{this, "ChannelEnergyMin", 2000, ""}; Gaudi::Property<float> m_energyChanMax{this, "ChannelEnergyMax", 4000, ""}; + Gaudi::Property<float> m_gain{this, "Gain", 1, ""}; + Gaudi::Property<float> m_energyE1Min{this, "E1EnergyMin", -1, ""}; + Gaudi::Property<float> m_energyE1Max{this, "E1EnergyMax", -1, ""}; + Gaudi::Property<float> m_gainE1{this, "GainE1", -1, ""}; + Gaudi::Property<float> m_energyE2Min{this, "E2EnergyMin", -1, ""}; + Gaudi::Property<float> m_energyE2Max{this, "E2EnergyMax", -1, ""}; + Gaudi::Property<float> m_gainE2{this, "GainE2", -1, ""}; + Gaudi::Property<float> m_energyE3Min{this, "E3EnergyMin", -1, ""}; + Gaudi::Property<float> m_energyE3Max{this, "E3EnergyMax", -1, ""}; + Gaudi::Property<float> m_gainE3{this, "GainE3", -1, ""}; + Gaudi::Property<float> m_energyE4Min{this, "E4EnergyMin", -1, ""}; + Gaudi::Property<float> m_energyE4Max{this, "E4EnergyMax", -1, ""}; + Gaudi::Property<float> m_gainE4{this, "GainE4", -1, ""}; + // Gaudi::Property<bool> m_do1DHistograms{this, "Do1DHistograms", false, ""}; Gaudi::Property<bool> m_do2DHistograms{this, "Do2DHistograms", false, ""}; Gaudi::Property<bool> m_doEnergyDiffHistograms{this, "DoEnergyDiffHistograms", false, ""}; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx index 0de48704d722441c2d8f9a2d3add8dc86bf52c55..ee701b27c869e6b7c098e4710552a90956a3d82d 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx @@ -2263,6 +2263,16 @@ int main(int argc, char** argv) { if ( collection.find("_HLT_")!=std::string::npos ) collection.replace( collection.find("_HLT_"), 5, " " ); if ( collection.find("HLT_")!=std::string::npos ) collection.erase( collection.find("HLT_"), 4 ); + + if ( actual_chain.size()>30 ) { + size_t pos = actual_chain.find_last_of("_"); + while ( pos!=std::string::npos && actual_chain.size()>30 ) { + actual_chain.erase( pos, actual_chain.size()-pos ); + actual_chain+="..."; + pos = actual_chain.find_last_of("_"); + } + } + std::string c = actual_chain + " : " + collection; std::cout << "track collection: " << collection << " <-" << std::endl; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata_cuts-offline.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata_cuts-offline.dat index 5b654ccd519912d0a35732832358355a8e6f5b64..4dc51283e63e132bbc0b7b4c5b72d32b7fd7b38a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata_cuts-offline.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata_cuts-offline.dat @@ -34,9 +34,14 @@ pT = 1000; npix=-1; nsct= 2; #else +#ifdef ITk + npix = 4; + nsct = -1; +#else npix = 1; nsct = 2; #endif +#endif expectIBL = 1; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel.dat index eaefda83554e0f9d5d7c4997eedd6a9169bb4a06..d922a53abc581168a6a6137ea2628698acb05237 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhisto-panel.dat @@ -4,44 +4,45 @@ panels = { eff_panel, res_panel, diff_panel, spoff_panel, sp_panel, dist_panel, panel_columns = { eff_panel, 3 }; + eff_panel = { - "eta_eff", "Efficiency #eta", "xaxis:lin", "Reference track #eta", "yaxis:lin:auto:90:102", "Efficiency [%]", - "pT_eff", "Efficiency p_{T}", "xaxis:log:auto:1:100", "Reference track p_{T} [GeV]", "yaxis:lin:auto:90:102", "Efficiency [%]", - "phi_eff", "Efficiency #phi", "xaxis:lin", "Reference track #phi", "yaxis:lin:auto:90:102", "Efficiency [%]", - "a0_eff", "Efficiency a0", "xaxis:lin:autosym", "Reference track d_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]", - "z0_eff", "Efficiency z0", "xaxis:lin:autosym", "Reference track z_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]", - "eff_vs_mu", "Efficiency mu", "xaxis:lin:auto", "Pile-up<#mu>", "yaxis:lin:auto:90:102", "Efficiency [%]" + "eta_eff", "Efficiency #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference track #eta", "yaxis:lin:auto:90:102", "Efficiency [%]", + "pT_eff", "Efficiency p_{T}", "xaxis:log:auto:1:100", "Reference track p_{T} [GeV]", "yaxis:lin:auto:90:102", "Efficiency [%]", + "phi_eff", "Efficiency #phi", "xaxis:lin", "Reference track #phi", "yaxis:lin:auto:90:102", "Efficiency [%]", + "a0_eff", "Efficiency a0", "xaxis:lin:autosym", "Reference track d_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]", + "z0_eff", "Efficiency z0", "xaxis:lin:autosym", "Reference track z_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]", + "eff_vs_mu", "Efficiency mu", "xaxis:lin:auto", "Pile-up<#mu>", "yaxis:lin:auto:90:102", "Efficiency [%]" }; res_panel = { - "eta_res", "Residual #eta", "xaxis:lin:-0.05:0.05", "#Delta#eta", "yaxis:log:auto", "Normalised entries", - "ipT_res", "Residual 1/p_{T}", "xaxis:lin:-0.3:0.4", "#Delta 1/p_{T} [GeV^{-1}]", "yaxis:log:auto", "Normalised entries", - "phi_res", "Residual #phi", "xaxis:lin:-0.05:0.05", "#Delta#phi", "yaxis:log:auto", "Normalised entries", - "z0_res", "Residual z0", "xaxis:lin:-10:10", "#Delta z_{0} [mm]", "yaxis:log:auto", "Normalised entries", - "d0_res", "Residual d0", "xaxis:lin:-10:10", "#Delta d_{0} [mm]", "yaxis:log:auto", "Normalised entries", - "rzedtheta_vs_eta/1d+rebin5", "Residual z0sintheta", "xaxis:lin:-10:10", "#Delta z_{0}sin#theta [mm]", "yaxis:log:auto", "Normalised entries" + "eta_res", "Residual #eta", "xaxis:lin:-0.05:0.05", "#Delta#eta", "yaxis:log:auto", "Normalised entries", + "ipT_res", "Residual 1/p_{T}", "xaxis:lin:-0.3:0.4", "#Delta 1/p_{T} [GeV^{-1}]", "yaxis:log:auto", "Normalised entries", + "phi_res", "Residual #phi", "xaxis:lin:-0.05:0.05", "#Delta#phi", "yaxis:log:auto", "Normalised entries", + "z0_res", "Residual z0", "xaxis:lin:-10:10", "#Delta z_{0} [mm]", "yaxis:log:auto", "Normalised entries", + "d0_res", "Residual d0", "xaxis:lin:-10:10", "#Delta d_{0} [mm]", "yaxis:log:auto", "Normalised entries", + "rzedtheta_vs_eta/1d+rebin5", "Residual z0sintheta", "xaxis:lin:-10:10", "#Delta z_{0}sin#theta [mm]", "yaxis:log:auto", "Normalised entries" }; diff_panel = { - "reta_vs_eta/sigma", "Residual #eta vs #eta", "xaxis:lin", "Reference #eta", "yaxis:lin:auto", "#eta resolution", - "reta_vs_pt/sigma", "Residual #eta p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto", "#eta resolution", + "reta_vs_eta/sigma", "Residual #eta vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto", "#eta resolution", + "reta_vs_pt/sigma", "Residual #eta p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto", "#eta resolution", - "ript_vs_eta/sigma", "Residual 1/p_{T} vs #eta", "xaxis:lin:auto", "Reference #eta", "yaxis:log:auto", "1/p_{T} resolution [GeV^{-1}]", - "ript_vs_pt/sigma", "Residual 1/p_{T} vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]", + "ript_vs_eta/sigma", "Residual 1/p_{T} vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:log:auto", "1/p_{T} resolution [GeV^{-1}]", + "ript_vs_pt/sigma", "Residual 1/p_{T} vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]", - "rzed_vs_eta/sigma", "Residual z vs #eta", "xaxis:lin", "Reference #eta", "yaxis:lin:0:0.9", "z_{0} resolution [mm]", - "rzed_vs_pt/sigma", "Residual z vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:0:0.9", "z_{0} resolution [mm]", + "rzed_vs_eta/sigma", "Residual z vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:0:0.9", "z_{0} resolution [mm]", + "rzed_vs_pt/sigma", "Residual z vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:0:0.9", "z_{0} resolution [mm]", - "rd0_vs_eta/sigma", "Residual d vs #eta", "xaxis:lin", "Reference #eta", "yaxis:lin:0:0.12", "d_{0} resolution [mm]", - "rd0_vs_pt/sigma", "Residual d vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:0:0.12", "d_{0} resolution [mm]", + "rd0_vs_eta/sigma", "Residual d vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:0:0.12", "d_{0} resolution [mm]", + "rd0_vs_pt/sigma", "Residual d vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:0:0.12", "d_{0} resolution [mm]", - "rzedtheta_vs_eta/sigma", "Residual ztheta vs #eta", "xaxis:lin", "Reference #eta", "yaxis:lin:0:0.2", "z_{0}sin#theta resolution [mm]", - "rzedtheta_vs_pt/sigma", "Residual ztheta vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:0:0.2", "z_{0}sin#theta resolution [mm]", + "rzedtheta_vs_eta/sigma", "Residual ztheta vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:0:0.2", "z_{0}sin#theta resolution [mm]", + "rzedtheta_vs_pt/sigma", "Residual ztheta vs p_{T}", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:0:0.2", "z_{0}sin#theta resolution [mm]", }; @@ -55,41 +56,41 @@ dist_panel = { // "pT_rec", "p_{T} rec", "xaxis:log:auto:1:100:0ffset0.45", "Trigger p_{T} [GeV]", "yaxis:log:autow:offset0.85", "Normalised entries", "pT", "p_{T}", "xaxis:log:auto:1:100", "Reference p_{T} [GeV]", "yaxis:log:autow", "Normalised entries", - "pT_rec", "p_{T} rec", "xaxis:log:auto:1:100", "Trigger p_{T} [GeV]", "yaxis:log:autow", "Normalised entries", + "pT_rec", "p_{T} rec", "xaxis:log:auto:1:100", "Trigger p_{T} [GeV]", "yaxis:log:autow", "Normalised entries", - "eta", "eta", "xaxis:lin:auto:1:100", "Reference #eta", "yaxis:lin:auton", "Normalised entries", - "eta_rec", "eta rec", "xaxis:lin:auto:1:100", "Trigger #eta", "yaxis:lin:auton", "Normalised entries", + "eta", "eta", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auton", "Normalised entries", + "eta_rec", "eta rec", "xaxis:lin:autosym:-3.0:3.0", "Trigger #eta", "yaxis:lin:auton", "Normalised entries", "a0", "a0", "xaxis:lin:autosym:-3:3", "Reference a_{0} [mm]", "yaxis:log:auton", "Normalised entries", - "a0_rec", "a0 rec", "xaxis:lin:autosym:-3:3", "Trigger a_{0} [mm]", "yaxis:log:auton", "Normalised entries", + "a0_rec", "a0 rec", "xaxis:lin:autosym:-3:3", "Trigger a_{0} [mm]", "yaxis:log:auton", "Normalised entries", "z0", "z0", "xaxis:lin:-200:200", "Reference z_{0} [mm]", "yaxis:log:auton", "Normalised entries", - "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries" + "z0_rec", "z0_rec", "xaxis:lin:-200:200", "Trigger z_{0} [mm]", "yaxis:log:auton", "Normalised entries" }; spoff_panel = { - "npix_eta/mean", "mean number of pixel hits", "xaxis:lin", "Reference #eta", "yaxis:lin:3:6", "Reference Pixel hits", - "nsct_eta/mean", "mean number of SCT hits", "xaxis:lin", "Reference #eta", "yaxis:lin:7:10", "Reference SCT clusters", + "npix_eta/mean", "mean number of pixel hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:3:6", "Reference Pixel hits", + "nsct_eta/mean", "mean number of SCT hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:7:10", "Reference SCT clusters", - "npix_pt/mean", "mean number of pixel hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:3:6", "Reference Pixel hits", - "nsct_pt/mean", "mean number of SCT hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:7:10", "Reference SCT clusters", + "npix_pt/mean", "mean number of pixel hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:3:6", "Reference Pixel hits", + "nsct_pt/mean", "mean number of SCT hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:7:10", "Reference SCT clusters", }; sp_panel = { - "npix_eta_rec/mean", "mean number of pixel hits", "xaxis:lin", "Reference #eta", "yaxis:lin:3:6", "Trigger Pixel hits", - "nsct_eta_rec/mean", "mean number of SCT hits", "xaxis:lin", "Reference #eta", "yaxis:lin:7:10", "Trigger SCT clusters", + "npix_eta_rec/mean", "mean number of pixel hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:3:6", "Trigger Pixel hits", + "nsct_eta_rec/mean", "mean number of SCT hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto:7:10", "Trigger SCT clusters", - "npix_pt_rec/mean", "mean number of pixel hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:3:6", "Trigger Pixel hits", - "nsct_pt_rec/mean", "mean number of SCT hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:7:10", "Trigger SCT clusters", + "npix_pt_rec/mean", "mean number of pixel hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:3:6", "Trigger Pixel hits", + "nsct_pt_rec/mean", "mean number of SCT hits", "xaxis:log:auto", "Reference p_{T} [GeV]", "yaxis:lin:auto:7:10", "Trigger SCT clusters", }; trt_panel = { - "ntrt_eta/mean", "mean number of TRT hits", "xaxis:lin", "Reference #eta", "yaxis:lin:auto", "Reference TRT hits", - "ntrt_eta_rec/mean", "mean number of TRT hits", "xaxis:lin", "Reference #eta", "yaxis:lin:auto", "Trigger TRT hits", + "ntrt_eta/mean", "mean number of TRT hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto", "Reference TRT hits", + "ntrt_eta_rec/mean", "mean number of TRT hits", "xaxis:lin:autosym:-3.0:3.0", "Reference #eta", "yaxis:lin:auto", "Trigger TRT hits", "ntrt_eta/1d", " TRT hits", "xaxis:lin:auto", "Reference TRT multiplcicity", "yaxis:log:auto", "Entries", diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhistos.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhistos.dat index c1ce3c361338a9b29a041aacc36b1d7520ec8eb3..5edf6add5621decf6542436cb944178ffcc45bb2 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhistos.dat +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAhistos.dat @@ -2,18 +2,18 @@ histos = { /// distributions - 4 - // "pT", "p_{T}", "xaxis:lin:0.7:100", "Offline p_{T} [GeV]", "yaxis:log:auto", "" , - "pT", "p_{T}", "xaxis:lin:auto:1:100", "Offline p_{T} [GeV]", "yaxis:log:auto", "" , - "pT_rec", "p_{T} rec", "xaxis:lin:auto:1:100", "Trigger p_{T} [GeV]", "yaxis:log:auto", "" , - "a0", "a0", "xaxis:lin:-2:2", "Offline a_{0} [mm]", "yaxis:log:auto", "" , - "a0_rec", "a0 rec", "xaxis:lin:-2:2", "Trigger a_{0} [mm]", "yaxis:log:auto", "" , - "z0", "z0", "xaxis:lin:-250:250", "z_{0} [mm]", "yaxis:log:auto", "" , + // "pT", "p_{T}", "xaxis:lin:0.7:100", "Offline p_{T} [GeV]", "yaxis:log:auto", "" , + "pT", "p_{T}", "xaxis:lin:auto:1:100", "Offline p_{T} [GeV]", "yaxis:log:auto", "" , + "pT_rec", "p_{T} rec", "xaxis:lin:auto:1:100", "Trigger p_{T} [GeV]", "yaxis:log:auto", "" , + "a0", "a0", "xaxis:lin:-2:2", "Offline a_{0} [mm]", "yaxis:log:auto", "" , + "a0_rec", "a0 rec", "xaxis:lin:-2:2", "Trigger a_{0} [mm]", "yaxis:log:auto", "" , + "z0", "z0", "xaxis:lin:-250:250", "z_{0} [mm]", "yaxis:log:auto", "" , /// efficiencies - 10 - // "pT_eff", "Efficiency p_{T}", "xaxis:log:0.7:100", "Offline p_{T} [GeV]", "yaxis:lin:90:102", "Efficiency [%]" , - "pT_eff", "Efficiency p_{T}", "xaxis:log:auto", "Offline track p_{T} [GeV]", "yaxis:lin:auto:90:102", "Efficiency [%]" , - "eta_eff", "Efficiency #eta", "xaxis:lin", "Offline track #eta", "yaxis:lin:auto:90:102", "Efficiency [%]" , - "phi_eff", "Efficiency #phi", "xaxis:lin", "Offline track #phi", "yaxis:lin:auto:90:102", "Efficiency [%]" , + // "pT_eff", "Efficiency p_{T}", "xaxis:log:0.7:100", "Offline p_{T} [GeV]", "yaxis:lin:90:102", "Efficiency [%]" , + "pT_eff", "Efficiency p_{T}", "xaxis:log:auto", "Offline track p_{T} [GeV]", "yaxis:lin:auto:90:102", "Efficiency [%]" , + "eta_eff", "Efficiency #eta", "xaxis:autosym:-3.0:3.0", "Offline track #eta", "yaxis:lin:auto:90:102", "Efficiency [%]" , + "phi_eff", "Efficiency #phi", "xaxis:lin", "Offline track #phi", "yaxis:lin:auto:90:102", "Efficiency [%]" , "d0_eff", "Efficiency d0", "xaxis:lin:autosym", "Offline track d_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]" , "a0_eff", "Efficiency a0", "xaxis:lin:autosym", "Offline track d_{0} [mm]", "yaxis:lin:auto:90:102", "Efficiency [%]" , @@ -32,44 +32,44 @@ histos = { "a0_res", "Residual a0", "xaxis:lin:-1:1", "#Delta d_{0} [mm]", "yaxis:log:auto", "Normalised entries" , /// residuals vs track parameters - 17 - "rd0_vs_pt/sigma", "Residual d vs p_{T}", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto", "d_{0} resolution [mm]" , - "rd0_vs_signed_pt/sigma", "Residual d vs signed p_{T}", "xaxis:lin:-100:100", "Offline p_{T} [GeV]", "yaxis:lin:auto", "d_{0} resolution [mm]" , - "rd0_vs_eta/sigma", "Residual d vs #eta", "xaxis:lin", "Offline #eta", "yaxis:lin:auto", "d_{0} resolution [mm]" , - "rd0_vs_ipt/sigma", "Residual d vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "d_{0} resolution [mm]" , + "rd0_vs_pt/sigma", "Residual d vs p_{T}", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto", "d_{0} resolution [mm]" , + "rd0_vs_signed_pt/sigma", "Residual d vs signed p_{T}", "xaxis:lin:-100:100", "Offline p_{T} [GeV]", "yaxis:lin:auto", "d_{0} resolution [mm]" , + "rd0_vs_eta/sigma", "Residual d vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto", "d_{0} resolution [mm]" , + "rd0_vs_ipt/sigma", "Residual d vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "d_{0} resolution [mm]" , "rDd0_vs_phi/mean", "mean dd0 residual vs phi", "xaxis:lin", "#phi", "yaxis:lin:auto", "#Delta dd_{0} mean [mm]" , "rDd0_vs_phi/1d", "residual in dd0", "xaxis:lin:-0.07:0.07", "#Delta(dd_{0}) [mm]", "yaxis:log:auto", "entries" , - "rDz0_vs_eta/mean", "mean dz0 residual vs eta", "xaxis:lin", "#eta", "yaxis:lin:auto", "#Delta dz_{0} mean [mm]" , + "rDz0_vs_eta/mean", "mean dz0 residual vs eta", "xaxis:lin:autosym:-3.0:3.0", "#eta", "yaxis:lin:auto", "#Delta dz_{0} mean [mm]" , "rDz0_vs_eta/1d", "residual in dz0", "xaxis:lin:-0.6:0.6", "#Delta(dd_{0}) [mm]", "yaxis:log:auto", "entries" , - "ript_vs_pt/sigma", "Residual 1/p_{T} vs p_{T}", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:log:auto", "1/p_{T} resolution [GeV^{-1}]" , - "ript_vs_eta/sigma", "Residual 1/p_{T} vs #eta", "xaxis:lin", "Offline #eta", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]" , - "ript_vs_ipt/sigma", "Residual 1/p_{T} vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]" , + "ript_vs_pt/sigma", "Residual 1/p_{T} vs p_{T}", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:log:auto", "1/p_{T} resolution [GeV^{-1}]" , + "ript_vs_eta/sigma", "Residual 1/p_{T} vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]" , + "ript_vs_ipt/sigma", "Residual 1/p_{T} vs 1/p_{T}", "xaxis:lin:auto", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "1/p_{T} resolution [GeV^{-1}]" , "reta_vs_pt/sigma", "Residual #eta p_{T}", "xaxis:log:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto", "#eta resolution" , - "reta_vs_eta/sigma", "Residual #eta vs #eta", "xaxis:lin", "Offline #eta", "yaxis:lin:auto", "#eta resolution" , - "reta_vs_ipt/sigma", "Residual #eta vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "#eta resolution" , + "reta_vs_eta/sigma", "Residual #eta vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto", "#eta resolution" , + "reta_vs_ipt/sigma", "Residual #eta vs 1/p_{T}", "xaxis:lin:auto", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "#eta resolution" , "rphi_vs_pt/sigma", "Residual #phi vs p_{T}", "xaxis:lin:1:100", "p_{T} [GeV]", "yaxis:lin:auto", "#phi resolution" , - "rphi_vs_ipt/sigma", "Residual #phi vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "#phi resolution" , + "rphi_vs_ipt/sigma", "Residual #phi vs 1/p_{T}", "xaxis:lin:auto", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "#phi resolution" , - "rzed_vs_eta/sigma", "Residual z vs #eta", "xaxis:lin", "Offline #eta", "yaxis:lin:auto", "z_{0} resolution [mm]" , + "rzed_vs_eta/sigma", "Residual z vs #eta", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto", "z_{0} resolution [mm]" , "rzed_vs_pt/sigma", "Residual z vs p_{T}", "xaxis:log:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto", "z_{0} resolution [mm]" , "rzed_vs_signed_pt/sigma", "Residual z vs signed p_{T}", "xaxis:lin:-100:100", "Offline p_{T} [GeV]", "yaxis:lin:auto", "z_{0} resolution [mm]" , "rzed_vs_zed/sigma", "Residual z vs z", "xaxis:lin:-250:250", "Offline z [mm]", "yaxis:lin:auto", "z_{0} resolution [mm]" , - "rzed_vs_ipt/sigma", "Residual z vs 1/p_{T}", "xaxis:lin", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "z_{0} resolution [mm]" , + "rzed_vs_ipt/sigma", "Residual z vs 1/p_{T}", "xaxis:lin:auto", "1/p_{T} [GeV^{-1}]", "yaxis:lin:auto", "z_{0} resolution [mm]" , /// track multiplicity - 1 "ntracks_rec", "number of reconstructed tracks", "xaxis:lin:auto", "N trigger tracks", "yaxis:log:auto", "Entries" , /// hit multiplicity - 6 - "npix_eta/mean", "mean number of pixel hits", "xaxis:lin", "Offline #eta", "yaxis:lin:3:6", "Pixel hits" , - "nsct_eta/mean", "mean number of SCT hits", "xaxis:lin", "Offline #eta", "yaxis:lin:7:10", "SCT clusters" , - "npix_pt/mean", "mean number of pixel hits", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:3:6", "Pixel hits" , - "nsct_pt/mean", "mean number of SCT hits", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:7:10", "SCT clusters" , - "npixh_pt/mean", "mean number of pixel holes", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:-1:6", "Pixel holes" , - "nscth_pt/mean", "mean number of SCT holes", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:-1:10", "SCT holes" , + "npix_eta/mean", "mean number of pixel hits", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto:3:6", "Pixel hits" , + "nsct_eta/mean", "mean number of SCT hits", "xaxis:lin:autosym:-3.0:3.0", "Offline #eta", "yaxis:lin:auto:7:10", "SCT clusters" , + "npix_pt/mean", "mean number of pixel hits", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto:3:6", "Pixel hits" , + "nsct_pt/mean", "mean number of SCT hits", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto:7:10", "SCT clusters" , + "npixh_pt/mean", "mean number of pixel holes", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto:-1:6", "Pixel holes" , + "nscth_pt/mean", "mean number of SCT holes", "xaxis:lin:auto", "Offline p_{T} [GeV]", "yaxis:lin:auto:-1:10", "SCT holes" , /// chi2 and chi2 probability - 3 "Chi2prob/1d", "Chi2 probability", "xaxis:lin", "track #chi^{2} Probability", "yaxis:lin:auto", "Entries" , diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/CMakeLists.txt b/Trigger/TrigT1/TrigT1CaloMonitoring/CMakeLists.txt index a6cdd1d9d5c33d6a62413619d4dc210a0b556ac9..180794296ccefb55dc195052f44a3e30cb428b33 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/CMakeLists.txt +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/CMakeLists.txt @@ -14,5 +14,11 @@ atlas_add_component( TrigT1CaloMonitoring LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaMonitoringKernelLib AthenaMonitoringLib AthenaPoolUtilities CaloDetDescrLib CaloIdentifier EventInfo GaudiKernel FourMomUtils Identifier LWHists SGTools StoreGateLib TrigAnalysisInterfaces TrigConfData TrigConfInterfaces TrigConfL1Data TrigDecisionToolLib TrigT1CaloCalibConditions TrigT1CaloCalibToolsLib TrigT1CaloCondSvcLib TrigT1CaloEventLib TrigT1CaloMonitoringToolsLib TrigT1CaloToolInterfaces TrigT1CaloUtilsLib TrigT1Interfaces xAODEgamma xAODTrigL1Calo xAODTrigger PathResolver ) # Install files from the package: -atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) +atlas_install_python_modules( python/*.py share/L1CaloPhase1Monitoring.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) atlas_install_joboptions( share/*.py ) + +atlas_add_test( L1CaloPhase1_Data + SCRIPT athena --CA TrigT1CaloMonitoring/L1CaloPhase1Monitoring.py --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data22_13p6TeV.00440499.physics_Main.daq.RAW._lb0461._SFO-13._0004.data --evtMax 10 + PROPERTIES TIMEOUT 300 + PRIVATE_WORKING_DIRECTORY + POST_EXEC_SCRIPT noerror.sh ) \ No newline at end of file diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/share/L1CaloPhase1Monitoring.py b/Trigger/TrigT1/TrigT1CaloMonitoring/share/L1CaloPhase1Monitoring.py new file mode 100644 index 0000000000000000000000000000000000000000..7986e84754c93246c7e378b1bf03827456b95c81 --- /dev/null +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/share/L1CaloPhase1Monitoring.py @@ -0,0 +1,392 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +## Job options for Running the L1Calo Athena Simulation and/or Monitoring for Phase1 +## can be run offline on raw or POOL files (for rerunning simulation) +## run through athena +## offline: athena --CA RecExOnline/L1CaloPhase1Monitoring.py --filesInput path/to/raw.data --evtMax 10 +## online: athena --CA RecExOnline/L1CaloPhase1Monitoring.py +## Author: Will Buttinger + +from AthenaCommon.Configurable import ConfigurableCABehavior +from AthenaConfiguration.ComponentAccumulator import appendCAtoAthena +from AthenaConfiguration.ComponentFactory import CompFactory,isComponentAccumulatorCfg +from AthenaConfiguration.AllConfigFlags import initConfigFlags +from AthenaConfiguration.Enums import LHCPeriod,Format +from AthenaCommon import Constants +import os,sys +import ispy +partition = ispy.IPCPartition(os.getenv("TDAQ_PARTITION","ATLAS")) + +flags = initConfigFlags() +flags.Input.Files = [] # so that when no files given we can detect that + +# Note: The order in which all these flag defaults get set is very fragile +# so don't reorder the setup of this flags stuff + +# if not isComponentAccumulatorCfg(): +# # running as a jobo - commented out as phasing out support +# # from AthenaCommon.DetFlags import DetFlags +# # DetFlags.detdescr.all_setOff() +# # DetFlags.detdescr.Calo_setOn() +# decodeInputs = True +# # next three lines so that conddb set up ok +# if len(jps.AthenaCommonFlags.FilesInput())>0: +# from RecExConfig import AutoConfiguration +# AutoConfiguration.ConfigureSimulationOrRealData() #sets globalflags.DataSource +# AutoConfiguration.ConfigureFromListOfKeys(['ProjectName']) #sets rec.projectName, necessary to infer DatabaseInstance if that is left to 'auto' (default value) +# from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags +# flags = getNewConfigFlags() # replace flags with old flags +# flags.Exec.MaxEvents = jps.AthenaCommonFlags.EvtMax() # didn't get copied so do it manually now +# elif partition.isValid(): +# # running online, need to set some flags for conddb to be setup correctly at this point +# jps.Global.DataSource = 'data' +# jps.AthenaCommonFlags.isOnline = True + +flags.Exec.OutputLevel = Constants.WARNING # by default make everything output at WARNING level +flags.Exec.InfoMessageComponents = ["AthenaEventLoopMgr","THistSvc","PerfMonMTSvc","ApplicationMgr"] # Re-enable some info messaging though +flags.Exec.PrintAlgsSequence = True # print the alg sequence at the start of the job (helpful to see what is scheduled) +# flags.Exec.FPE = -2 # disable FPE auditing ... set to 0 to re-enable + +## Modify default flags +flags.GeoModel.Run = LHCPeriod.Run3 # needed for LArGMConfig - or can infer from above +flags.Common.useOnlineLumi = True # needed for lumi-scaled monitoring, only have lumi in online DB at this time +flags.DQ.doMonitoring = True # use this flag to turn on/off monitoring in this application +flags.DQ.enableLumiAccess = False # in fact, we don't need lumi access for now ... this turns it all off +flags.DQ.FileKey = "" if partition.isValid() else "EXPERT" # histsvc file "name" to record to - Rafal asked it to be blank @ P1 ... means monitoring.root will be empty +flags.Output.HISTFileName = "monitoring.root" # control names of monitoring root file +flags.DQ.useTrigger = False # don't do TrigDecisionTool in MonitorCfg helper methods +# flag for saying if inputs should be decoded or not +flags.Trigger.L1.doCaloInputs = True +# flags for rerunning simulation +flags.Trigger.L1.doeFex = True +flags.Trigger.L1.dojFex = True +flags.Trigger.L1.dogFex = True +# if running online, override these with autoconfig values +# will set things like the GlobalTag automatically +if partition.isValid(): + # must ensure doLVL1 and doHLT are False, otherwise will get ByteStreamCnvSvc conflicts (TrigByteStreamCnvSvc is setup, but EMon setup provides ByteStreamCnvSvc) + # see TriggerByteStreamConfig.py + flags.Trigger.doLVL1 = False + flags.Trigger.doHLT = False + from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags + autoConfigOnlineRecoFlags(flags, partition.name()) # sets things like projectName etc which would otherwise be inferred from input file +else: + flags.Trigger.doLVL1 = True # set this just so that IOBDb.GlobalTag is autoconfigured based on release setup if running on RAW (autoconfig will take it from POOL file if running on that) +#flags.IOVDb.GlobalTag = lambda s: "OFLCOND-MC23-SDR-RUN3-02" if s.Input.isMC else "CONDBR2-ES1PA-2022-07" #"CONDBR2-HLTP-2022-02" + +# now parse +if isComponentAccumulatorCfg(): + parser = flags.getArgumentParser() + parser.add_argument('--runNumber',default=None,help="specify to select a run number") + parser.add_argument('--lumiBlock',default=None,help="specify to select a lumiBlock") + parser.add_argument('--evtNumber',default=None,nargs="+",type=int,help="specify to select an evtNumber") + parser.add_argument('--stream',default="physics_L1Calo",help="stream to lookup files in") + parser.add_argument('--fexReadoutFilter',action='store_true',help="If specified, will skip events without fexReadout") + parser.add_argument('--dbOverrides',default=None,nargs="+",type=str,help="specify overrides of COOL database folders in form <folder>=<dbPath>, example: /TRIGGER/L1Calo/V1/Calibration/EfexEnergyCalib=mytest.db ") + parser.add_argument('--postConfig',default=[],nargs="+",type=str,help="specify component properties to apply at the end of the config") + args = flags.fillFromArgs(parser=parser) + if args.runNumber is not None: + from glob import glob + if args.lumiBlock is None: args.lumiBlock="*" + print("Looking up files in atlastier0 for run",args.runNumber,"lb =",args.lumiBlock) + flags.Input.Files = [] + for lb in args.lumiBlock.split(","): + if lb=="*": + tryStr = f"/eos/atlas/atlastier0/rucio/data*/{args.stream}/*{args.runNumber}/*RAW/*lb*.*" + else: + tryStr = f"/eos/atlas/atlastier0/rucio/data*/{args.stream}/*{args.runNumber}/*RAW/*lb{int(lb):04}.*" + print("Trying",tryStr) + flags.Input.Files += glob(tryStr) + print("Found",len(flags.Input.Files),"files") + +# require at least 1 input file if running offline +if not partition.isValid() and len(flags.Input.Files)==0: + print("FATAL: Running in offline mode but no input files provided") + sys.exit(1) +elif partition.isValid(): + print("Running Online with Partition:",partition.name()) + +# if running on an input file, change the DQ environment, which will allow debug tree creation from monitoring algs +if len(flags.Input.Files)>0: + flags.DQ.Environment = "user" + flags.Trigger.triggerConfig='FILE' if flags.Input.isMC else 'DB' #for L1menu if running offline + +# due to https://gitlab.cern.ch/atlas/athena/-/merge_requests/65253 must now specify geomodel explicitly if cant take from input file, but can autoconfigure it based on LHCPeriod set above +if flags.GeoModel.AtlasVersion is None: + from AthenaConfiguration.TestDefaults import defaultGeometryTags + flags.GeoModel.AtlasVersion = defaultGeometryTags.autoconfigure(flags) + +# add detector conditions flags required for rerunning simulation +# needs input files declared if offline, hence doing after parsing +from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList +setupDetectorsFromList(flags,['LAr','Tile','MBTS'],True) + + +if isComponentAccumulatorCfg(): + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + cfg = MainServicesCfg(flags) +# else: +# # for an unknown reason it seems like its necessary to create +# # setup the IOVDbSvc now otherwise conditions aren't done properly - its like CA config isn't getting applied properly? +# # and the CALIBRATIONS folder isnt found +# from IOVDbSvc.CondDB import conddb +# with ConfigurableCABehavior(): +# from AthenaConfiguration.MainServicesConfig import MessageSvcCfg +# cfg = MessageSvcCfg(flags) # start with just messageSvc ComponentAccumulator() # use empty accumulator + +with ConfigurableCABehavior(): # need to temporarily activate run3 behaviour to use this configuration method + + flags.lock() + if flags.Exec.MaxEvents == 0: flags.dump(evaluate=True) + + if partition.isValid() and len(flags.Input.Files)==0: + from ByteStreamEmonSvc.EmonByteStreamConfig import EmonByteStreamCfg + cfg.merge(EmonByteStreamCfg(flags)) # setup EmonSvc + bsSvc = cfg.getService("ByteStreamInputSvc") + bsSvc.Partition = partition.name() + bsSvc.Key = os.environ.get("L1CALO_PTIO_KEY", "REB" if partition.name()=="L1CaloStandalone" else "dcm") # set the Sampler Key Type name (default is SFI) + if partition.name()=="L1CaloSTF": bsSvc.Key = "SWROD" + bsSvc.KeyCount = int(os.environ.get("L1CALO_PTIO_KEY_COUNT","25")) + bsSvc.ISServer = "Histogramming" # IS server on which to create this provider + bsSvc.BufferSize = 10 # event buffer size for each sampler + bsSvc.UpdatePeriod = 30 # time in seconds between updating plots + bsSvc.Timeout = 240000 # timeout (not sure what this does) + bsSvc.PublishName = os.getenv("L1CALO_ATHENA_JOB_NAME","testing") # set name of this publisher as it will appear in IS (default is "l1calo-athenaHLT"; change to something sensible for testing) + bsSvc.StreamType = os.getenv("L1CALO_PTIO_STREAM_TYPE","physics") # name of the stream type (physics,express, etc.) + bsSvc.ExitOnPartitionShutdown = False + bsSvc.ClearHistograms = True # clear hists at start of new run + bsSvc.GroupName = "RecExOnline" + # name of the stream (Egamma,JetTauEtmiss,MinBias,Standby, etc.), this can be a colon(:) separated list of streams that use the 'streamLogic' to combine stream for 2016 HI run + bsSvc.StreamNames = os.getenv("L1CALO_PTIO_STREAM_NAME","L1Calo:Main:MinBias:MinBiasOverlay:UPC:EnhancedBias:ZeroBias:HardProbes:Standby:ALFACalib").split(":") + bsSvc.StreamLogic = os.getenv("L1CALO_PTIO_STREAM_LOGIC","Or") if partition.name() != "L1CaloStandalone" else "Ignore" + bsSvc.LVL1Names = [] # name of L1 items to select + bsSvc.LVL1Logic = "Ignore" # one of: Ignore, Or, And + elif flags.Input.Format == Format.POOL: + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + cfg.merge(PoolReadCfg(flags)) + else: + print("Running Offline on", len(flags.Input.Files)," bytestream files") + #from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg + #TODO: Figure out why the above line causes CA conflict @ P1 if try to run on a RAW file there + from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg + cfg.merge(ByteStreamReadCfg(flags)) # configure reading bytestream + + # ensure histsvc is set up + from AthenaMonitoring.AthMonitorCfgHelper import getDQTHistSvc + cfg.merge(getDQTHistSvc(flags)) + + # Create run3 L1 menu (needed for L1Calo EDMs) + #try: + from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,generateL1Menu, createL1PrescalesFileFromMenu + if flags.Input.isMC: + # for MC we set the TriggerConfig to "FILE" above, so must generate a menu for it to load (will be the release's menu) + generateL1Menu(flags) + createL1PrescalesFileFromMenu(flags) + cfg.merge(L1ConfigSvcCfg(flags)) + #except: + #print("Failed to load L1 Menu") + + # -------- CHANGES GO BELOW ------------ + # setup the L1Calo software we want to monitor + + decoderTools = [] + + if partition.isValid() or (flags.Input.Format != Format.POOL and not flags.Input.isMC): + from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg, jFexRoiByteStreamToolCfg, jFexInputByteStreamToolCfg, gFexByteStreamToolCfg, gFexInputByteStreamToolCfg + if flags.Trigger.L1.doeFex: decoderTools += [cfg.popToolsAndMerge(eFexByteStreamToolCfg(flags=flags,name='eFexBSDecoderTool',TOBs=flags.Trigger.L1.doeFex,xTOBs=flags.Trigger.L1.doeFex,decodeInputs=flags.Trigger.L1.doCaloInputs,multiSlice=True))] + if flags.Trigger.L1.dojFex: decoderTools += [cfg.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags=flags,name="jFexBSDecoderTool",writeBS=False))] + if flags.Trigger.L1.dogFex: decoderTools += [cfg.popToolsAndMerge(gFexByteStreamToolCfg(flags=flags,name="gFexBSDecoderTool",writeBS=False))] + + + + if flags.Trigger.L1.doCaloInputs: + if flags.Trigger.L1.dojFex: decoderTools += [cfg.popToolsAndMerge(jFexInputByteStreamToolCfg(flags=flags,name='jFexInputBSDecoderTool',writeBS=False))] + if flags.Trigger.L1.dogFex: decoderTools += [cfg.popToolsAndMerge(gFexInputByteStreamToolCfg(flags=flags,name='gFexInputBSDecoderTool',writeBS=False))] + + if len(decoderTools) > 0: + from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig import L1TriggerByteStreamDecoderMonitoringCfg + cfg.addEventAlgo(CompFactory.L1TriggerByteStreamDecoderAlg( + name="L1TriggerByteStreamDecoder", + OutputLevel=Constants.ERROR, # hides warnings about non-zero status codes in fragments ... will show up in hists + DecoderTools=decoderTools, + ByteStreamMetadataRHKey = '', # seems necessary @ P1 if trying to run on a raw file + MaybeMissingROBs= [id for tool in decoderTools for id in tool.ROBIDs ] if partition.name()!="ATLAS" or not partition.isValid() else [], # allow missing ROBs away from online ATLAS partition + MonTool= cfg.popToolsAndMerge(L1TriggerByteStreamDecoderMonitoringCfg(flags,"L1TriggerByteStreamDecoder", decoderTools)) + ),sequenceName='AthAlgSeq' + ) + + #from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg + #cfg.merge( LArOnOffIdMappingSCCfg(flags) ) + # from LArGeoAlgsNV.LArGMConfig import LArGMCfg + # cfg.merge(LArGMCfg(flags)) + + # rerun sim if required + if flags.Trigger.L1.doeFex or flags.Trigger.L1.dojFex or flags.Trigger.L1.dogFex or flags.Trigger.L1.doCaloInputs: + from L1CaloFEXSim.L1CaloFEXSimCfg import L1CaloFEXSimCfg + cfg.merge(L1CaloFEXSimCfg(flags,outputSuffix="DAODSim" if flags.Input.Format == Format.POOL else "")) + + # do otf masking: + # from IOVDbSvc.IOVDbSvcConfig import addFolders,addOverride + # #cfg.merge(addFolders(flags,"<db>sqlite://;schema=/afs/cern.ch/user/w/will/new_maskedSCs_run457976.db;dbname=CONDBR2</db> /LAR/BadChannels/NoisyChannelsSC",className="CondAttrListCollection")) # dmCorr from DB! + # cfg.merge(addFolders(flags,"/LAR/BadChannels/MaskedSC","LAR_ONL",tag="LARBadChannelsMaskedSC-RUN3-UPD1-00",className="CondAttrListCollection",extensible=False)) # when run online, need folder to be extensible to force reload each event + # cfg.addCondAlgo(CompFactory.LArBadChannelCondAlg(name="MaskedSCCondAlg",ReadKey="/LAR/BadChannels/MaskedSC",isSC=True,CablingKey="LArOnOffIdMapSC",WriteKey="LArMaskedSC")) + # # note to self, if need to flag extensible after loaded elsewhere, look at property: cfg.getService("IOVDbSvc").Folders ... extend relevant entry with "<extensible/>" + # print(cfg.getService("MessageSvc")) + # cfg.getService("MessageSvc").errorLimit = 0 + # + # cfg.getEventAlgo("L1_eFexEmulatedTowers").LArBadChannelKey = "LArMaskedSC" + + + + if flags.DQ.doMonitoring: + if flags.Trigger.L1.doeFex: + from TrigT1CaloMonitoring.EfexMonitorAlgorithm import EfexMonitoringConfig + cfg.merge(EfexMonitoringConfig(flags)) + EfexMonAlg = cfg.getEventAlgo('EfexMonAlg') + # do we need next lines?? + EfexMonAlg.eFexEMTobKeyList = ['L1_eEMRoI', 'L1_eEMxRoI'] # default is just L1_eEMRoI + EfexMonAlg.eFexTauTobKeyList = ['L1_eTauRoI', 'L1_eTauxRoI'] + # Adjust eFEX containers to be monitored to also monitor the sim RoI + for l in [EfexMonAlg.eFexEMTobKeyList,EfexMonAlg.eFexTauTobKeyList]: l += [x + "Sim" for x in l ] + # monitoring of simulation vs hardware + if not flags.Input.isMC: + from TrigT1CaloMonitoring.EfexSimMonitorAlgorithm import EfexSimMonitoringConfig + cfg.merge(EfexSimMonitoringConfig(flags)) + # EfexSimMonitorAlgorithm = cfg.getEventAlgo('EfexSimMonAlg') + # and now book the histograms that depend on the containers + from TrigT1CaloMonitoring.EfexMonitorAlgorithm import EfexMonitoringHistConfig + cfg.merge(EfexMonitoringHistConfig(flags,EfexMonAlg)) + + if flags.Trigger.L1.dojFex: + from TrigT1CaloMonitoring.JfexMonitorAlgorithm import JfexMonitoringConfig + cfg.merge(JfexMonitoringConfig(flags)) + from TrigT1CaloMonitoring.JfexSimMonitorAlgorithm import JfexSimMonitoringConfig + cfg.merge(JfexSimMonitoringConfig(flags)) + if flags.Trigger.L1.dogFex: + from TrigT1CaloMonitoring.GfexMonitorAlgorithm import GfexMonitoringConfig + cfg.merge(GfexMonitoringConfig(flags)) + # GfexSimMonitorAlgorithm not yet committed to athena + #from TrigT1CaloMonitoring.GfexSimMonitorAlgorithm import GfexSimMonitoringConfig + #cfg.merge(GfexSimMonitoringConfig(flags)) + # can't include efficiency monitoring because requires too many things we don't have + #from TrigT1CaloMonitoring.JetEfficiencyMonitorAlgoritum import JetEfficiencyMonitoring + #cfg.merge(JetEfficiencyMonitoring(flags)) + + # input data monitoring + if flags.Trigger.L1.doCaloInputs and not flags.Input.isMC: + from TrigT1CaloMonitoring.EfexInputMonitorAlgorithm import EfexInputMonitoringConfig + if flags.Trigger.L1.doeFex: cfg.merge(EfexInputMonitoringConfig(flags)) + from TrigT1CaloMonitoring.JfexInputMonitorAlgorithm import JfexInputMonitoringConfig + if flags.Trigger.L1.dojFex: cfg.merge(JfexInputMonitoringConfig(flags)) + from TrigT1CaloMonitoring.GfexInputMonitorAlgorithm import GfexInputMonitoringConfig + if flags.Trigger.L1.dogFex: cfg.merge(GfexInputMonitoringConfig(flags)) + + mainSeq = "AthAllAlgSeq" + if args.fexReadoutFilter: + # want to take existing AthAllSeqSeq and move it inside a new sequence + topSeq = cfg.getSequence("AthAlgEvtSeq") + algSeq = cfg.getSequence(mainSeq) + mainSeq = "New" + mainSeq + # topSeq has three sub-sequencers ... preserve first and last + topSeq.Members = [topSeq.Members[0],CompFactory.AthSequencer(mainSeq),topSeq.Members[-1]] + cfg.addEventAlgo(CompFactory.L1IDFilterAlgorithm(),sequenceName=mainSeq) + cfg.getSequence(mainSeq).Members += [algSeq] + + if args.evtNumber is not None: + print("filtering events",args.evtNumber) + # similar adjustment with an event filter + topSeq = cfg.getSequence("AthAlgEvtSeq") + algSeq = cfg.getSequence(mainSeq) + mainSeq = "New" + mainSeq + # topSeq has three sub-sequencers ... preserve first and last + topSeq.Members = [topSeq.Members[0],CompFactory.AthSequencer(mainSeq),topSeq.Members[-1]] + cfg.addEventAlgo(CompFactory.EventNumberFilterAlgorithm("EvtNumberFilter",EventNumbers=args.evtNumber),sequenceName=mainSeq) + cfg.getSequence(mainSeq).Members += [algSeq] + # cfg.addEventAlgo(CompFactory.LVL1.eFexEventDumper("Dumper",TowersKey="L1_eFexEmulatedTowers")) + + from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg + cfg.merge( PerfMonMTSvcCfg(flags) ) + + from AthenaConfiguration.Utils import setupLoggingLevels + setupLoggingLevels(flags,cfg) + + if cfg.getService("AthenaEventLoopMgr"): cfg.getService("AthenaEventLoopMgr").IntervalInSeconds = 30 + + if type(args.dbOverrides)==list: + from IOVDbSvc.IOVDbSvcConfig import addOverride + #examples: + #cfg.merge( addOverride(flags, folder="/TRIGGER/L1Calo/V1/Calibration/EfexEnergyCalib", db="sqlite://;schema=mytest.db;dbname=CONDBR2",tag="" ) ) + #cfg.merge( addOverride(flags, folder="/TRIGGER/L1Calo/V1/Calibration/EfexNoiseCuts", db="sqlite://;schema=/afs/cern.ch/user/w/will/calib.sqlite;dbname=L1CALO",tag="" ) ) + for override in args.dbOverrides: + print(override) + folderName,dbPath = override.split("=",1) + if folderName == "": raise ValueError("Cannot parse dbOverride: " + override) + if ";dbname=" not in dbPath: dbPath += ";dbname=CONDBR2" + dbPath,dbInst = dbPath.split(";dbname=") + if not os.path.exists(dbPath): raise ValueError("dbOverride file doesn't exist: " + dbPath) + if folderName[0] != "/": folderName = "/TRIGGER/L1Calo/V1/Calibration/" + folderName + print("Overriding COOL folder:",folderName,dbPath,dbInst) + cfg.merge( addOverride(flags,folder=folderName,db=f"sqlite://;schema={dbPath};dbname={dbInst}",tag="")) + + + # configure output AOD if requested + if flags.Output.AODFileName != "": + def addEDM(edmType, edmName): + auxType = edmType.replace('Container','AuxContainer') + return [f'{edmType}#{edmName}', f'{auxType}#{edmName}Aux.'] + + outputEDM = [] + outputEDM += addEDM('xAOD::jFexTowerContainer' , "L1_jFexDataTowers") + outputEDM += addEDM('xAOD::jFexTowerContainer' , "L1_jFexEmulatedTowers") + outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', 'L1_jFexSRJetRoISim') + outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', 'L1_jFexLRJetRoISim') + outputEDM += addEDM('xAOD::jFexTauRoIContainer' , 'L1_jFexTauRoISim' ) + outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', 'L1_jFexFwdElRoISim') + outputEDM += addEDM('xAOD::jFexSumETRoIContainer', 'L1_jFexSumETRoISim') + outputEDM += addEDM('xAOD::jFexMETRoIContainer' , 'L1_jFexMETRoISim' ) + outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', 'L1_jFexSRJetRoI') + outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', 'L1_jFexLRJetRoI') + outputEDM += addEDM('xAOD::jFexTauRoIContainer' , 'L1_jFexTauRoI' ) + outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', 'L1_jFexFwdElRoI') + outputEDM += addEDM('xAOD::jFexSumETRoIContainer', 'L1_jFexSumETRoI') + outputEDM += addEDM('xAOD::jFexMETRoIContainer' , 'L1_jFexMETRoI' ) + + outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', 'L1_jFexSRJetxRoI') + outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', 'L1_jFexLRJetxRoI') + outputEDM += addEDM('xAOD::jFexTauRoIContainer' , 'L1_jFexTauxRoI' ) + outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', 'L1_jFexFwdElxRoI') + outputEDM += addEDM('xAOD::jFexSumETRoIContainer', 'L1_jFexSumETxRoI') + outputEDM += addEDM('xAOD::jFexMETRoIContainer' , 'L1_jFexMETxRoI' ) + from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + cfg.merge(OutputStreamCfg(flags, 'AOD', ItemList=outputEDM)) + from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg + cfg.merge(SetupMetaDataForStreamCfg(flags, 'AOD')) + + + for conf in args.postConfig: + compName,propNameAndVal=conf.split(".",1) + propName,propVal=propNameAndVal.split("=",1) + applied = False + for comp in cfg._allComponents(): + if comp.name==compName: + applied = True + exec(f"comp.{propNameAndVal}") + if not applied: + raise ValueError(f"postConfig {conf} had no effect ... typo?") + + # -------- CHANGES GO ABOVE ------------ + +if flags.Exec.MaxEvents==0: cfg.printConfig() +print("Configured Services:",*[svc.name for svc in cfg.getServices()]) +#print("Configured EventAlgos:",*[alg.name for alg in cfg.getEventAlgos()]) +#print("Configured CondAlgos:",*[alg.name for alg in cfg.getCondAlgos()]) + + +if not isComponentAccumulatorCfg(): + appendCAtoAthena(cfg) + #svcMgr.StoreGateSvc.Dump=True;svcMgr.DetectorStore.Dump=True + #svcMgr.IOVDbSvc.OutputLevel=DEBUG; print(svcMgr.IOVDbSvc) +else: + if cfg.run().isFailure(): + import sys + sys.exit(1) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py index c7b7d314e2f43219cdc73a156b768d3a88c1e14d..af0e49fead2879892211f71e7f4450f50a6b9931 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py @@ -2,7 +2,6 @@ __author__ = "Mark Sutton, Matous Vozak" __doc__ = "ConfigSettings" -__all__ = [ "getInDetTrigConfig" ] import math from TrigInDetConfig.ConfigSettingsBase import _ConfigSettingsBase @@ -10,21 +9,6 @@ from TrigEDMConfig.TriggerEDM import recordable from AthenaCommon.SystemOfUnits import GeV -# Function that returns specific signature setting/configuration -# Rename to InDetTrigSignatureConfig ? -def getInDetTrigConfig( name ): - if name in ConfigSettingsInstances: - config = ConfigSettingsInstances[name] - # keep a record of the configuration that is input - # will use this to uniquely identify the algorithms - config._input_name = name - return config - else : - # don't just return None, and do nothing as this - # will just hide the error until people try to use - # the bad slice configuration - raise Exception( "getInDetTrigConfig() called with non existent slice: "+name ) - class ConfigSettings_electron( _ConfigSettingsBase ): def __init__( self ): _ConfigSettingsBase.__init__(self) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py index 7c3283a182dbcb1fda2298ddc2650ed8eb8f8866..58b65d01d55bc8b1fe74e167a86a7ab3fef80d6f 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigTrackingPassFlags.py @@ -164,12 +164,18 @@ def createTrigTrackingPassFlags(mode="InDet"): from AthenaConfiguration.AthConfigFlags import AthConfigFlags flags = AthConfigFlags() - from TrigInDetConfig.ConfigSettings import ConfigSettingsInstances,getInDetTrigConfig + + from TrigInDetConfig.ConfigSettings import ConfigSettingsInstances + def __getInDetTrigConfig(name : str): + config = ConfigSettingsInstances[name] + config._input_name = name + return config + category = 'Trigger.InDetTracking' if mode=="InDet" else 'Trigger.ITkTracking' for i in ConfigSettingsInstances.keys(): signatureCategory = "{}.{}".format(category,i) - factory = flagsFactory(getInDetTrigConfig(i),mode) + factory = flagsFactory(__getInDetTrigConfig(i),mode) flags.addFlagsCategory(signatureCategory,factory,prefix=True) #TBD make a function for global settings too diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/CalibChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/CalibChainConfiguration.py index bc1e7f3b810bba33f9584421bb0206e49fdfccb1..eb3072da8a2d698bd38a8a955d1e7e511466cf79 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/CalibChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CalibCosmicMon/CalibChainConfiguration.py @@ -180,7 +180,7 @@ def IDCalibTriggerCfg(flags): @AccumulatorCache def IDCalibFTFCfg(flags): - reco = InEventRecoCA('IDCalibTrkrecoSeq_reco',inputMaker=getTrackingInputMaker("ftf")) + reco = InEventRecoCA('IDCalibTrkrecoSeq_reco',inputMaker=getTrackingInputMaker(flags, "ftf")) reco.mergeReco(commonInDetFullScanCfg(flags)) selAcc = SelectionCA('IDCalibTrkrecoSeq') diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanInDetConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanInDetConfig.py index 9fd77bcc71d4b308c63764014e14f8aaa6bcc3e6..6e80fb2c03a42cc0704d2a116d3a75b69cd7953d 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanInDetConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/CommonSequences/FullScanInDetConfig.py @@ -2,6 +2,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.AccumulatorCache import AccumulatorCache +from AthenaConfiguration.AthConfigFlags import AthConfigFlags from TrigInDetConfig.utils import getFlagsForActiveConfig from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg, trigInDetLRTCfg @@ -16,7 +17,7 @@ log = logging.getLogger(__name__) from .FullScanDefs import trkFSRoI @AccumulatorCache -def commonInDetFullScanCfg(flags): +def commonInDetFullScanCfg(flags: AthConfigFlags) -> ComponentAccumulator: acc = ComponentAccumulator() seqname='TrigInDetFullScan' acc.addSequence(parOR(seqname),primary=True) @@ -44,17 +45,18 @@ def commonInDetFullScanCfg(flags): return acc -@AccumulatorCache -def commonInDetLRTCfg(flags, std_cfg, lrt_cfg, rois=trkFSRoI): +def commonInDetLRTCfg(flags : AthConfigFlags, + flagsLRT : AthConfigFlags, + rois : str = trkFSRoI) -> ComponentAccumulator: + acc = ComponentAccumulator() - seqname = 'TrigInDetLRT_'+lrt_cfg.name + seqname = 'TrigInDetLRT_'+flagsLRT.Tracking.ActiveConfig.name acc.addSequence(parOR(seqname),primary=True) - flagsWithTrk = getFlagsForActiveConfig(flags, lrt_cfg.name, log) acc.merge( trigInDetLRTCfg( - flagsWithTrk, - std_cfg.trkTracks_FTF(), + flagsLRT, + flags.Tracking.ActiveConfig.trkTracks_FTF, rois, in_view=False ), diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFTools.py index f38570c898980d7accc53278efbf44b1b5344012..788898eb95ed584fb227ca8fa83e2939daebfd2b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFTools.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFTools.py @@ -1,5 +1,4 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging log = logging.getLogger( __name__ ) @@ -12,17 +11,6 @@ PassFilter = CompFactory.PassFilter class NoHypoToolCreated(Exception): """Exception thrown by HypoTool generators if no HypoTool is needed""" # see ATR-23920 -class NoCAmigration(Exception): - """Exception thrown if issues are found during CA migration""" - def __init__(self,message=''): - self.message=message - - def __str__(self): - if self.message: - return 'CA migration: {0} '.format(self.message) - else: - return 'CA migration' - def algColor(alg): """ Set given color to Alg type""" diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py index dc4a44438db10656f5da972881782bd7718fab2b..4c46cf3f84ff88147de77f8eee0b5bbbd0b51cc7 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py @@ -3,16 +3,11 @@ import importlib import string -from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFTools import NoCAmigration from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig from AthenaCommon.Logging import logging log = logging.getLogger(__name__) -_isCAMenu = True -def isCAMenu(): - return _isCAMenu - def calibCosmicMonSignatures(): return ['Streaming','Monitor','Beamspot','Cosmic', 'Calib', 'EnhancedBias'] @@ -191,15 +186,8 @@ class GenerateMenuMT(object, metaclass=Singleton): for chainDict in self.chainDicts: log.debug("Next: getting chain configuration for chain %s ", chainDict['chainName']) chainConfig,lengthOfChainConfigs = self.__generateChainConfig(flags, chainDict) - if isCAMenu(): - # skip chain generation if no ChainConfig was found - if chainConfig is None: - continue - log.debug("Found CA configuration for Chain %r",chainConfig) - all_chains += [(chainDict,chainConfig,lengthOfChainConfigs)] - - + #update the alignment group length dictionary if we have a longer number of steps #or the signature isn't registered in the dictionary yet for config_length, config_grp in lengthOfChainConfigs: @@ -383,7 +371,6 @@ class GenerateMenuMT(object, metaclass=Singleton): # Loop over all chainDicts and send them off to their respective assembly code listOfChainConfigs = [] perSig_lengthOfChainConfigs = [] - not_migrated=False for chainPartDict in chainDicts: chainPartConfig = None @@ -415,55 +402,32 @@ class GenerateMenuMT(object, metaclass=Singleton): raise Exception('Stopping the execution. Please correct the configuration.') log.debug("Chain %s \n chain config: %s",chainPartDict['chainName'],chainPartConfig) - import itertools - - # check if there are not migrated steps between migrated ones - # if built-up steps are not consecutive, do not build the chain because it's incomplete - leg_not_migrated = ( (chainPartConfig is None ) or \ - len([k for k, g in itertools.groupby(["_MissingCA" in step.name for step in chainPartConfig.steps]) if k==0])!=1) \ - and 'noalg' not in chainPartDict['chainName'] # no alg chains should be excluded as they do not have any configureation - not_migrated |= leg_not_migrated - - if isCAMenu() and leg_not_migrated: - if chainPartConfig is None: - log.debug(str(NoCAmigration("[__generateChainConfigs] Chain {0} chainPartConfig is None, because of failure of merging chains".format(chainPartDict['chainName'])) )) - else: - listOfChainConfigs.append(chainPartConfig) - else: - listOfChainConfigs.append(chainPartConfig) - log.debug("[__generateChainConfigs] adding to the perSig_lengthOfChainConfigs list (%s, %s)",chainPartConfig.nSteps,chainPartConfig.alignmentGroups) - perSig_lengthOfChainConfigs.append((chainPartConfig.nSteps,chainPartConfig.alignmentGroups)) + listOfChainConfigs.append(chainPartConfig) + log.debug("[__generateChainConfigs] adding to the perSig_lengthOfChainConfigs list (%s, %s)",chainPartConfig.nSteps,chainPartConfig.alignmentGroups) + perSig_lengthOfChainConfigs.append((chainPartConfig.nSteps,chainPartConfig.alignmentGroups)) # this will be a list of lists for inter-sig combined chains and a list with one # multi-element list for intra-sig combined chains # here, we flatten it accordingly (works for both cases!) lengthOfChainConfigs = [] - if isCAMenu() and not_migrated: - log.debug(str(NoCAmigration("[__generateChainConfigs] Chain {0} removed because is incomplete".format(chainPartDict['chainName'])) )) - else: - for nSteps, aGrps in perSig_lengthOfChainConfigs: - if len(nSteps) != len(aGrps): - log.error("Chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps) - else: - for a,b in zip(nSteps,aGrps): - lengthOfChainConfigs.append((a,b)) + for nSteps, aGrps in perSig_lengthOfChainConfigs: + if len(nSteps) != len(aGrps): + log.error("Chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps) + else: + for a,b in zip(nSteps,aGrps): + lengthOfChainConfigs.append((a,b)) # This part is to deal with combined chains between different signatures try: - if isCAMenu() and not_migrated: - raise NoCAmigration("[__generateChainConfigs] chain {0} generation missed configuration".format(mainChainDict['chainName'])) - if len(listOfChainConfigs) == 0: raise Exception('[__generateChainConfigs] No Chain Configuration found for {0}'.format(mainChainDict['chainName'])) else: if len(listOfChainConfigs)>1: log.debug("Merging strategy from dictionary: %s", mainChainDict["mergingStrategy"]) theChainConfig, perSig_lengthOfChainConfigs = mergeChainDefs(listOfChainConfigs, mainChainDict, perSig_lengthOfChainConfigs) - if isCAMenu() and perSig_lengthOfChainConfigs is None: - raise NoCAmigration("[__generateChainConfigs] chain {0} generation missed configuration during merging".format(mainChainDict['chainName'])) - lengthOfChainConfigs = [] + lengthOfChainConfigs = [] for nSteps, aGrps in perSig_lengthOfChainConfigs: if len(nSteps) != len(aGrps): log.error("Post-merged chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps) @@ -487,15 +451,7 @@ class GenerateMenuMT(object, metaclass=Singleton): log.exception('[__generateChainConfigs] Full chain dictionary is\n %s ', mainChainDict) raise Exception('[__generateChainConfigs] Stopping menu generation. Please investigate the exception shown above.') except AttributeError: - if isCAMenu(): - log.warning(str(NoCAmigration("[__generateChainConfigs] addTopoInfo failed with CA configurables") ) ) - return None,[] raise Exception('[__generateChainConfigs] Stopping menu generation. Please investigate the exception shown above.') - except NoCAmigration as e: - log.warning(str(e)) - # flag as merged all CAs created , but not used - [seq.ca.wasMerged() for chainPartConfig in listOfChainConfigs for step in chainPartConfig.steps for seq in step.sequences ] - return None,[] # Configure event building strategy eventBuildType = mainChainDict['eventBuildType'] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py index d9d453716280d72370886e86a85e062c4f7cf950..077529893b3b3252785b8cf55179e8d50d2f6ef8 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py @@ -6,10 +6,7 @@ from TriggerMenuMT.HLT.Config.MenuComponents import Chain, ChainStep, EmptyMenuS from AthenaCommon.Logging import logging from DecisionHandling.DecisionHandlingConfig import ComboHypoCfg from TrigCompositeUtils.TrigCompositeUtils import legName -from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFTools import NoCAmigration -from TriggerMenuMT.HLT.Config.GenerateMenuMT import isCAMenu -from collections import OrderedDict from copy import deepcopy import re @@ -19,21 +16,6 @@ def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs = Non #chainDefList is a list of Chain() objects #one for each part in the chain - # protect against serial merging in the signature code (to be fixed) - if isCAMenu(): - try: - for chainPartConfig in listOfChainDefs: - if any ([ "_MissingCA" in step.name for step in chainPartConfig.steps]): - # flag as merged all CAs created , but not used - [seq.ca.wasMerged() for chainPartConfig in listOfChainDefs for step in chainPartConfig.steps for seq in step.sequences ] - raise NoCAmigration (f'[mergeChainDefs] not possible for chain {chainDict["chainName"]} due to missing configurations') - except NoCAmigration as e: - log.debug(str(e)) - if perSig_lengthOfChainConfigs is None: - return None - else: - return None, None - strategy = chainDict["mergingStrategy"] offset = chainDict["mergingOffset"] log.debug("[mergeChainDefs] %s: Combine by using %s merging", chainDict['chainName'], strategy) @@ -50,7 +32,7 @@ def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs = Non elif strategy=="auto": ordering = getAlignmentGroupOrdering() - merging_dict = OrderedDict() + merging_dict = {} for ich,cConfig in enumerate(listOfChainDefs): chain_ag = cConfig.alignmentGroups[0] if chain_ag not in ordering: @@ -154,7 +136,7 @@ def mergeParallel(chainDefList, offset, leg_numbering = [], perSig_lengthOfChain log.error("[mergeParallel] Something is wrong with the combined chain name: cConfig.name = %s while chainName = %s", cConfig.name, chainName) raise Exception("[mergeParallel] Cannot merge this chain, exiting.") - if len(cConfig.alignmentGroups) == 1 or len(set(cConfig.alignmentGroups)) == 1: + if len(set(cConfig.alignmentGroups)) == 1: alignmentGroups.append(cConfig.alignmentGroups[0]) elif len(cConfig.alignmentGroups) > 1: log.debug("[mergeParallel] Parallel merging an already merged chain with different alignment groups? This is odd! %s",cConfig.alignmentGroups) @@ -203,7 +185,7 @@ def mergeParallel(chainDefList, offset, leg_numbering = [], perSig_lengthOfChain # edited the lengths, so need to update the leg length dict the code we did so! perSig_lengthOfChainConfigs[iConfig][0][index_modified_leg] = max_length else: - log.info("[mergeParallel] Alignment groups are empty for this combined chain - if this is not _newJO, this is not ok!") + log.debug("[mergeParallel] Alignment groups are empty for this combined chain") allSteps.append(cConfig.steps) allStepsMult.append(len(cConfig.steps[0].multiplicity)) @@ -214,7 +196,7 @@ def mergeParallel(chainDefList, offset, leg_numbering = [], perSig_lengthOfChain orderedSteps = list(zip_longest_parallel(allSteps, allStepsMult)) if perSig_lengthOfChainConfigs is not None and len(perSig_lengthOfChainConfigs) > 0: - in_chain_ag_lengths = OrderedDict() + in_chain_ag_lengths = {} ag_ordering = getAlignmentGroupOrdering() for ag in ag_ordering: for ag_lengths,sig_ags in perSig_lengthOfChainConfigs: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/ExoticJetSequencesConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/ExoticJetSequencesConfig.py index 9835956c3cf4cc1f008fccc2f6c19ed04d03faae..81642d360a8738031416940b903e6dd4b2cd32dc 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/ExoticJetSequencesConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/ExoticJetSequencesConfig.py @@ -77,7 +77,7 @@ def jetCROldMenuSequence(flags, jetsIn): from .JetTrackingConfig import JetFSTrackingCfg trk_acc = JetFSTrackingCfg(flags, trkopt='ftf', RoIs=trkFSRoI) - reco = InEventRecoCA(f"CalRatioold_{jetsIn}Reco", inputMaker=getTrackingInputMaker('ftf')) + reco = InEventRecoCA(f"CalRatioold_{jetsIn}Reco", inputMaker=getTrackingInputMaker(flags,'ftf')) reco.mergeReco(trk_acc) selAcc = SelectionCA(f"CalRatioOld_{jetsIn}") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py index 01d03e691259aee9cc003769b163abf51d40f7d0..0e572c0c1fa4a14514e000686d6e7df0867ff968 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py @@ -16,7 +16,7 @@ from TrigEDMConfig.TriggerEDM import recordable from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict from .JetPresel import caloPreselJetHypoToolFromDict, roiPreselJetHypoToolFromDict from TrigCaloRec.TrigCaloRecConfig import jetmetTopoClusteringCfg, jetmetTopoClusteringCfg_LC, HICaloTowerCfg -from TrigInDetConfig.ConfigSettings import getInDetTrigConfig +from AthenaConfiguration.AthConfigFlags import AthConfigFlags from TrigGenericAlgs.TrigGenericAlgsConfig import TrigEventInfoRecorderAlgCfg from AthenaCommon.Logging import logging @@ -36,15 +36,12 @@ def getCaloInputMaker(): # For later steps, where calo reco should not be run # The same instance of an algorithm cannot be run in different steps # Used for chains that use tracking -def getTrackingInputMaker(trkopt): +def getTrackingInputMaker(flags : AthConfigFlags, trkopt : str): if trkopt=="ftf": - - IDTrigConfig = getInDetTrigConfig( 'fullScan' ) - - log.debug( "jet FS tracking: useDynamicRoiZWidth: %s", IDTrigConfig.useDynamicRoiZWidth ) + log.debug( "jet FS tracking: useDynamicRoiZWidth: %s", flags.Trigger.InDetTracking.fullScan.useDynamicRoiZWidth ) roiUpdater = None - if IDTrigConfig.useDynamicRoiZWidth: + if flags.Trigger.InDetTracking.fullScan.useDynamicRoiZWidth: roiUpdater = CompFactory.RoiUpdaterTool( useBeamSpot=True ) log.info( roiUpdater ) @@ -53,7 +50,7 @@ def getTrackingInputMaker(trkopt): mergeUsingFeature = False, RoITool = CompFactory.ViewCreatorFSROITool( name="RoiTool_FS", RoiUpdater=roiUpdater, - RoisWriteHandleKey=recordable( IDTrigConfig.roi ) ), + RoisWriteHandleKey=recordable( flags.Trigger.InDetTracking.fullScan.roi ) ), RoIs = trkFSRoI ) else: InputMakerAlg = CompFactory.InputMakerForRoI( "IM_Jet_TrackingStep", @@ -64,16 +61,15 @@ def getTrackingInputMaker(trkopt): elif trkopt=="roiftf": - IDTrigConfig = getInDetTrigConfig( 'jetSuper' ) InputMakerAlg = CompFactory.EventViewCreatorAlgorithm( "IMJetRoIFTF", mergeUsingFeature = False, RoITool = CompFactory.ViewCreatorJetSuperROITool( 'ViewCreatorJetSuperRoI', - RoisWriteHandleKey = recordable( IDTrigConfig.roi ), - RoIEtaWidth = IDTrigConfig.etaHalfWidth, - RoIPhiWidth = IDTrigConfig.phiHalfWidth, - RoIZWidth = IDTrigConfig.zedHalfWidth, + RoisWriteHandleKey = recordable( flags.Trigger.InDetTracking.jetSuper.roi ), + RoIEtaWidth = flags.Trigger.InDetTracking.jetSuper.etaHalfWidth, + RoIPhiWidth = flags.Trigger.InDetTracking.jetSuper.phiHalfWidth, + RoIZWidth = flags.Trigger.InDetTracking.jetSuper.zedHalfWidth, ), Views = "JetSuperRoIViews", InViewRoIs = "InViewRoIs", @@ -265,7 +261,7 @@ def jetHICaloHypoMenuSequence(flags, isPerf, **jetRecoDict): # name needs to be passed in @AccumulatorCache def jetFSTrackingSelCfg(flags, clustersKey, isPerf, **jetRecoDict): - reco = InEventRecoCA(f"jetFSTrackingHypo_{jetRecoDict['jetDefStr']}{'_perf' if isPerf else ''}_RecoSequence", inputMaker=getTrackingInputMaker(jetRecoDict['trkopt'])) + reco = InEventRecoCA(f"jetFSTrackingHypo_{jetRecoDict['jetDefStr']}{'_perf' if isPerf else ''}_RecoSequence", inputMaker=getTrackingInputMaker(flags,jetRecoDict['trkopt'])) assert jetRecoDict["trkopt"] != "notrk" from .JetTrackingConfig import JetFSTrackingCfg @@ -316,7 +312,7 @@ def jetRoITrackJetTagSelCfg(flags, jetsIn, isPresel=True, **jetRecoDict): # where InViewRecoCA will do all in view reco = InEventRecoCA( f"jetRoITrackJetTagHypo_{jetRecoDict['jetDefStr']}_RecoSequence", - inputMaker=getTrackingInputMaker(jetRecoDict['trkopt']) + inputMaker=getTrackingInputMaker(flags,jetRecoDict['trkopt']) ) # Add to top-level serial sequence after IM diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py index 05bb816871f63f9b2f20889ebaca586dd0114df6..57130ffc11689f9e2f103c99d53c97fa8a8a96ed 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetRecoSequencesConfig.py @@ -202,10 +202,17 @@ def StandardJetRecoCfg(flags, dataSource, clustersKey, **jetRecoDict): as a shallow copy. """ - if jetRecoDict["jetCalib"] == "nojcalib": + seqname = "JetRecSeq_"+jetRecoDict['jetDefStr'] + if jetRecoDict["jetCalib"] == "nojcalib": + + reco_acc = ComponentAccumulator() + reco_acc.addSequence(parOR(seqname)) + build_acc, jetsNoCalib, jetDef = StandardJetBuildCfg( flags, dataSource, clustersKey, **jetRecoDict ) + reco_acc.merge(build_acc, seqname) + # This view alg is added here rather than in StandardJetBuildCfg # so that we are able to get the no-calib collection name later @@ -215,8 +222,8 @@ def StandardJetRecoCfg(flags, dataSource, clustersKey, **jetRecoDict): jetPtMin=10, # GeV converted internally **jetRecoDict ) - build_acc.merge(jetViewAcc, 'JetBuildSeq_'+jetRecoDict['jetDefStr']) - return build_acc, jetsOut, jetDef + reco_acc.merge(jetViewAcc, seqname) + return reco_acc, jetsOut, jetDef # Schedule reconstruction w/o calibration jrdNoJCalib = cloneAndUpdateJetRecoDict( @@ -224,13 +231,13 @@ def StandardJetRecoCfg(flags, dataSource, clustersKey, **jetRecoDict): jetCalib="nojcalib" ) - seqname = "JetRecSeq_"+jetRecoDict['jetDefStr'] acc = ComponentAccumulator() acc.addSequence(parOR(seqname)) build_acc, jetsNoCalib, jetDefNoCalib = StandardJetBuildCfg( flags, dataSource, clustersKey, **jrdNoJCalib ) + acc.merge(build_acc,seqname) jetViewAcc, jetsViewNoCalib = JetViewAlgCfg( flags, @@ -238,9 +245,8 @@ def StandardJetRecoCfg(flags, dataSource, clustersKey, **jetRecoDict): jetPtMin=10, # GeV converted internally **jrdNoJCalib ) - build_acc.merge(jetViewAcc, 'JetBuildSeq_'+jrdNoJCalib['jetDefStr']) + acc.merge(jetViewAcc, seqname) - acc.merge(build_acc,seqname) # Get the calibration tool jetDef = jetDefNoCalib.clone() jetDef.suffix = jetDefNoCalib.suffix.replace("nojcalib", jetRecoDict["jetCalib"]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetTrackingConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetTrackingConfig.py index e52a352fbe820decdd340dd34682650551c375f4..2ffbf36a7d35aafbf0014104da2f471ceebd810d 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetTrackingConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetTrackingConfig.py @@ -5,20 +5,21 @@ from JetRecTools import JetRecToolsConfig from AthenaConfiguration.ComponentFactory import CompFactory -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, conf2toConfigurable +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from TrigInDetConfig.utils import getFlagsForActiveConfig from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg, trigInDetPrecisionTrackingCfg from InDetConfig.InDetPriVxFinderConfig import InDetTrigPriVxFinderCfg from InDetUsedInVertexFitTrackDecorator.UsedInVertexFitTrackDecoratorCfg import getUsedInVertexFitTrackDecoratorAlg -from TrigInDetConfig.ConfigSettings import getInDetTrigConfig +from AthenaConfiguration.AthConfigFlags import AthConfigFlags from AthenaConfiguration.AccumulatorCache import AccumulatorCache from ..Config.MenuComponents import parOR from ..CommonSequences.FullScanInDetConfig import commonInDetFullScanCfg -def retrieveJetContext(trkopt): + +def retrieveJetContext(flags : AthConfigFlags, trkopt : str): """Tell the standard jet config about the specific track related options we are using here. This is done by defining a new jet context into jetContextDic. @@ -32,15 +33,13 @@ def retrieveJetContext(trkopt): if trkopt not in jetContextDic: # ***************** # Set the options corresponding to trkopt to a new entry in jetContextDic - trksig = { - 'ftf': 'fullScan', - 'roiftf': 'jetSuper', + (tracksname,verticesname) = { + 'ftf': (flags.Trigger.InDetTracking.fullScan.tracks_FTF, + flags.Trigger.InDetTracking.fullScan.vertex), + 'roiftf': (flags.Trigger.InDetTracking.jetSuper.tracks_FTF, + flags.Trigger.InDetTracking.jetSuper.vertex), }[trkopt] - IDTrigConfig = getInDetTrigConfig( trksig ) - - tracksname = IDTrigConfig.tracks_FTF() - verticesname = IDTrigConfig.vertex - + tvaname = f"JetTrackVtxAssoc_{trkopt}" label = f"GhostTrack_{trkopt}" ghosttracksname = f"PseudoJet{label}" @@ -72,12 +71,10 @@ def JetFSTrackingCfg(flags, trkopt, RoIs): acc = ComponentAccumulator() acc.addSequence(parOR(seqname),primary=True) - IDTrigConfig = getInDetTrigConfig( 'fullScan' ) - acc.merge(commonInDetFullScanCfg(flags),seqname) # get the jetContext for trkopt (and build it if not existing yet) - jetContext, trkKeys = retrieveJetContext(trkopt) + jetContext, trkKeys = retrieveJetContext(flags,trkopt) acc.addEventAlgo( getUsedInVertexFitTrackDecoratorAlg( @@ -96,7 +93,7 @@ def JetFSTrackingCfg(flags, trkopt, RoIs): WorkingPoint = "Custom", d0_cut = 2.0, dzSinTheta_cut = 2.0, - doPVPriority = IDTrigConfig.adaptiveVertex, + doPVPriority = flags.Trigger.InDetTracking.fullScan.adaptiveVertex, ), seqname ) @@ -167,63 +164,10 @@ def JetRoITrackingCfg(flags, jetsIn, trkopt, RoIs): ) # make sure we output only the key,value related to tracks (otherwise, alg duplication issues) - jetContext, trkKeys = retrieveJetContext(trkopt) + jetContext, trkKeys = retrieveJetContext(flagsWithTrk,trkopt) outmap = { k:jetContext[k] for k in trkKeys } if flags.Trigger.Jet.doJetSuperPrecisionTracking: outmap["Tracks"] = vertexInputTracks return acc, outmap -def addJetTTVA( flags, jetseq, trkopt, config, verticesname=None, adaptiveVertex=None, selector=None ): - - tracksname = config.tracks_FTF() - - label = f"GhostTrack_{trkopt}" - - # get the jetContext for trkopt (and build it if not existing yet) - jetContext, trkKeys = retrieveJetContext(trkopt) - - vtxFitDecoAlg = getUsedInVertexFitTrackDecoratorAlg( - trackCont = jetContext["Tracks"], - vtxCont = jetContext["Vertices"] - ) - - # ***************************** - # Track-vtx association. - custom_ttva = {} - if flags.Trigger.Jet.TrackVtxAssocWP=="Custom": - custom_ttva = dict( - d0_cut = 2.0, - dzSinTheta_cut = 2.0, - ) - - jettrkprepalg = JetRecToolsConfig.getJetTrackVtxAlg( - trkopt, algname="jetalg_TrackPrep"+trkopt, - # # parameters for the CP::TrackVertexAssociationTool (or the TrackVertexAssociationTool.getTTVAToolForReco function) : - WorkingPoint = flags.Trigger.Jet.TrackVtxAssocWP, # e.g. "Custom", or "Nonprompt_All_MaxWeight" (new default in offline - see also CHS configuration in StandardJetConstits.py) - doPVPriority = adaptiveVertex, - # schedules track decoration alg with used-in-fit links - add2Seq = jetseq, - # Option to set custom TTVA cuts - **custom_ttva - ) - - # Pseudojets for ghost tracks - pjgalg = CompFactory.PseudoJetAlgorithm( - "pjgalg_"+label, - InputContainer=tracksname, - OutputContainer=jetContext["GhostTracks"], - Label=label, - SkipNegativeEnergy=True - ) - - # Add the 3 algs to the sequence : - jetseq += vtxFitDecoAlg - jetseq += jettrkprepalg - jetseq += pjgalg - - if flags.Trigger.Jet.doVRJets: - pv0_jettvassoc, pv0_ttvatool = JetRecToolsConfig.getPV0TrackVertexAssoAlg(trkopt, jetseq) - pv0trackselalg = JetRecToolsConfig.getPV0TrackSelAlg(pv0_ttvatool, trkopt) - jetseq += conf2toConfigurable( pv0_jettvassoc ) - jetseq += conf2toConfigurable( pv0trackselalg ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/P1_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/P1_run3_v1.py index b4801c72becfba91db559e9bb5bc64fa131dff9b..c448e9e11e5eda7a68b15f0c81f84f17adfb1a47 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/P1_run3_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Menu/P1_run3_v1.py @@ -410,6 +410,11 @@ def addHighMuP1Signatures(chains): ChainProp(name='HLT_noalg_L1UNPAIRED_NONISO_noPS', l1SeedThresholds=['FSNOSEED'], stream=['EnhancedBias'], groups= ["RATE:EnhancedBias", "BW:Detector"]+SupportPhIGroup), ChainProp(name='HLT_noalg_eb_L1All', l1SeedThresholds=['FSNOSEED'], stream=['EnhancedBias'], groups=["RATE:EnhancedBias", "BW:Detector"]+SupportGroup ), + + #Beam splashes + ChainProp(name='HLT_noalg_L1eEM22A', l1SeedThresholds=['FSNOSEED'], stream=['MinBias','express'], groups=['RATE:MinBias', 'BW:MinBias','PS:Online']+SupportPhIGroup ), + ChainProp(name='HLT_noalg_L1eEM22C', l1SeedThresholds=['FSNOSEED'], stream=['MinBias','express'], groups=['RATE:MinBias', 'BW:MinBias','PS:Online']+SupportPhIGroup ), + ] chainsP1['Beamspot'] = [ diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/CommonConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/CommonConfiguration.py index 37f9f4a5223613db6b302a81401a14a4539fe102..838db50754be9ca393309c0842f24f204742e8fc 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/CommonConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/CommonConfiguration.py @@ -21,7 +21,7 @@ def getFullScanRecoOnlySequence(flags): selAcc = SelectionCA("UncTrkrecoSel") from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import getTrackingInputMaker - reco = InEventRecoCA("UncTrkreco",inputMaker=getTrackingInputMaker("ftf")) + reco = InEventRecoCA("UncTrkreco",inputMaker=getTrackingInputMaker(flags, "ftf")) reco.mergeReco( commonInDetFullScanCfg(flags) ) selAcc.mergeReco( reco ) @@ -38,14 +38,10 @@ def getFullScanRecoOnlySequence(flags): # an InEventRecoCA downstream. A plain CA is returned so that it # can be used in independent steps with more complex reco and different # InputMakers etc. -def getCommonInDetFullScanLRTCfg(flags): - from TrigInDetConfig.ConfigSettings import getInDetTrigConfig - std_cfg = getInDetTrigConfig("fullScan" ) - lrt_cfg = getInDetTrigConfig("fullScanLRT") - +def getCommonInDetFullScanLRTCfg(flags, flagsLRT): combined_reco = ComponentAccumulator() combined_reco.merge( commonInDetFullScanCfg(flags) ) - combined_reco.merge( commonInDetLRTCfg(flags, std_cfg, lrt_cfg) ) + combined_reco.merge( commonInDetLRTCfg(flags, flagsLRT) ) return combined_reco diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/FullScanLRTTrackingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/FullScanLRTTrackingConfiguration.py index 4174f10963d30c657bd70d8e4dd0fdc4d9fa78d4..ec5c81af5613d8ed83d649c10a4d41f6b33c6798 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/FullScanLRTTrackingConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/FullScanLRTTrackingConfiguration.py @@ -13,8 +13,12 @@ def FullScanLRTMenuSequence(flags): # Construct the full reco sequence from TriggerMenuMT.HLT.UnconventionalTracking.CommonConfiguration import getCommonInDetFullScanLRTCfg from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import getTrackingInputMaker - reco = InEventRecoCA("UncFSLRTreco",inputMaker=getTrackingInputMaker("ftf")) - reco.mergeReco( getCommonInDetFullScanLRTCfg(flags) ) + reco = InEventRecoCA("UncFSLRTreco",inputMaker=getTrackingInputMaker(flags,"ftf")) + + from TrigInDetConfig.utils import getFlagsForActiveConfig + flagsLRT = getFlagsForActiveConfig(flags, "fullScanLRT", log) + + reco.mergeReco( getCommonInDetFullScanLRTCfg(flags, flagsLRT) ) from ..CommonSequences.FullScanDefs import trkFSRoI from TrigInDetConfig.TrigInDetConfig import trigInDetPrecisionTrackingCfg diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/VrtSecInclusiveConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/VrtSecInclusiveConfiguration.py index 65424d4d7591950189145677f4dddb37dbfc3d0c..eae354ce079f56d57bcae3a6fdfba8ebe65aeb8f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/VrtSecInclusiveConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/UnconventionalTracking/VrtSecInclusiveConfiguration.py @@ -12,9 +12,12 @@ def VrtSecInclusiveMenuSequence(flags): # Construct the full reco sequence from TriggerMenuMT.HLT.UnconventionalTracking.CommonConfiguration import getCommonInDetFullScanLRTCfg from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import getTrackingInputMaker - reco = InEventRecoCA("UncFSVSIreco",inputMaker=getTrackingInputMaker("ftf")) + reco = InEventRecoCA("UncFSVSIreco",inputMaker=getTrackingInputMaker(flags,"ftf")) - reco.mergeReco( getCommonInDetFullScanLRTCfg(flags) ) + from TrigInDetConfig.utils import getFlagsForActiveConfig + flagsLRT = getFlagsForActiveConfig(flags, "fullScanLRT", log) + + reco.mergeReco( getCommonInDetFullScanLRTCfg(flags, flagsLRT) ) from TrigVrtSecInclusive.TrigVrtSecInclusiveConfig import TrigVrtSecInclusiveCfg theVSI = TrigVrtSecInclusiveCfg(flags, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py index 47e955260e58433a6148d660c95c9e3fdccc4c64..cf7bc5350dc22357346eb3f287e1bbc84cc7f148 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py @@ -189,6 +189,9 @@ class ItemDef: MenuItem('L1_eEM9_UNPAIRED_ISO' ).setLogic(d.eEM9 & unpaired_isocond).setTriggerType( TT.calo ) MenuItem('L1_eEM15_EMPTY' ).setLogic(d.eEM15 & cosmiccond ).setTriggerType( TT.calo ) + MenuItem('L1_eEM22A' ).setLogic( d.eEM22A & physcond).setTriggerType( TT.calo ) + MenuItem('L1_eEM22C' ).setLogic( d.eEM22C & physcond).setTriggerType( TT.calo ) + # PhaseI 2xEM and 3xEM MenuItem('L1_2eEM12').setLogic(d.eEM12.x(2) & physcond).setTriggerType(TT.calo) #heavy ions, ATR-26333 MenuItem('L1_2eEM12L').setLogic(d.eEM12L.x(2) & physcond).setTriggerType(TT.calo) #heavy ions, ATR-26333 diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/L1CaloThresholdMapping.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/L1CaloThresholdMapping.py index accfd9a86b6da96508e65080b7d0610923c79262..5dafeea5e9adc7a27a6574192baaae883292ab31 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/L1CaloThresholdMapping.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/L1CaloThresholdMapping.py @@ -24,6 +24,7 @@ threshold_mapping = { 24:22, 26:25, 28:27, + 255:255, }, 'jEM': { 20:15, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/MonitorDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/MonitorDef.py index bfee9f3e4b88bfff0826b12a1df3ef7ce14948e4..27665cf4d61882f8265400b49f1b0bfa19f5f1ca 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/MonitorDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/MonitorDef.py @@ -226,6 +226,9 @@ class MonitorDef: "L1_AFP_A_AND_C_TOF_T0T1_jJ90", "L1_jJ500_LAR", + # Beam splashes + "L1_eEM22A", "L1_eEM22C", + # Other triggers disabled in MC "L1_MU3VF", "L1_MU8F", "L1_MU8FC", "L1_MU8VF", "L1_MU3VC", "L1_MU3EOF", "L1_MU4BO", diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py index a3caa064f020445add402d0dd27d2562a0ec47a5..8083a98a4aedb8e0ba69a3ba05cb235d3bedf8c5 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py @@ -123,8 +123,12 @@ class ThresholdDef: for thrV in eEM_cuts: eEMThreshold('eEM%i' %thrV, 'eEM').addThrValue(max(get_threshold_cut('eEM', thrV), ptMin)) + # eEM beam splashes + eEMVarThreshold('eEM22A', 'eEM').addThrValue(get_threshold_cut('eEM',255),priority=1).addThrValue(get_threshold_cut('eEM',22),16,20,priority=2) + eEMVarThreshold('eEM22C', 'eEM').addThrValue(get_threshold_cut('eEM',255),priority=1).addThrValue(get_threshold_cut('eEM',22),-16,-20,priority=2) + # eEM SPARES - for thrV in range(1,6): + for thrV in range(1,3): eEMThreshold('eEMSPARE%i' % thrV, 'eEM').addThrValue(thrVal_SPARE) # L section (used to be VH in Run2) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py index a53f2b67544ff94eea58b53dc147fc7b60ad8fd5..58814b82521538a68e5804b8db1b00906a8485f1 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py @@ -26,8 +26,9 @@ class TopoAlgoDefMultiplicity(object): ] emVarThresholds_2bits = [ 'eEM24VM', 'eEM26', 'eEM26L', 'eEM26M', 'eEM26T', 'eEM28M', + 'eEM22A', 'eEM22C', # spares - 'eEMSPARE1', 'eEMSPARE2', 'eEMSPARE3', 'eEMSPARE4', + 'eEMSPARE1', 'eEMSPARE2', ] for em in emThresholds_3bits: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1.py index 278c89f5b6d6087777bd0a5d3c50f7d80fa716ad..99bb5ceeb3ae11f176dc4d03b23b6daf50ae94af 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1.py @@ -22,6 +22,9 @@ def defineMenu(): 'L1_eEM15_EMPTY', 'L1_eEM26', 'L1_eEM26L', 'L1_eEM26M', 'L1_eEM26T', 'L1_eEM28M', + #beam splashes + 'L1_eEM22A', 'L1_eEM22C', + ## # MU ## diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1_inputs.py index 0722ddf195788a74f457f09503bf1574ee2c69c5..d7337fe60c6a878fbda342f9e5c515a0170dd557 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1_inputs.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_run3_v1_inputs.py @@ -96,12 +96,13 @@ def defineInputsMenu(): 'eEM1', 'eEM2', #ATR-26333, adding eEM12, potentially more efficient than eEM12L in central HI collisions 'eEM12', - # variable eEM thresholds 'eEM24VM', 'eEM26', 'eEM26L', 'eEM26M', 'eEM26T', 'eEM28M', - + #beam splashes + 'eEM22A', 'eEM22C', + # eEM thresholds for production - 'eEMSPARE1', 'eEMSPARE2', 'eEMSPARE3', 'eEMSPARE4', + 'eEMSPARE1', 'eEMSPARE2', ('ZeroBiasA', 1) ],