diff --git a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py index f96e60bbaff012d510cefc3e54b8f04c98db5e09..3ce5d05613e1cd01729f36671ceac8fe7da8de03 100644 --- a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py +++ b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator @@ -53,6 +53,11 @@ def AthenaMonitoringCfg(flags): from JetTagMonitoring.JetTagMonitorAlgorithm import JetTagMonitorConfig result.merge(JetTagMonitorConfig(flags)) + if flags.DQ.Steering.doEgammaMon: + info('Set up Egamma monitoring') + from egammaPerformance.egammaMonitoringConfig import egammaMonitoringConfig + result.merge(egammaMonitoringConfig(flags)) + if flags.DQ.Steering.doJetMon: info('Set up Jet monitoring') from JetMonitoring.JetMonitoringStandard import standardJetMonitoring diff --git a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py index 80b7a8ef8957ca8df0d1f0b7cf81e0b3c3173845..550ac0388e16821ec9871e28dd9319f7f7ed7f71 100755 --- a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py +++ b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py @@ -43,7 +43,7 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""): groupe.defineHistogram('lb', title='Luminosity Block;lb;Events', path='Shifter',xbins=1000,xmin=-0.5,xmax=999.5) groupe.defineHistogram('run',title='Run Number;run;Events', path='Shifter',xbins=1000000,xmin=-0.5,xmax=999999.5) - groupe.defineHistogram('pt',title='Electron Transerve momentum Distribution ; Events ; Electron Transerve momentum [GeV]', path='Shifter',xbins=40,xmin=0.0,xmax=80.0) + groupe.defineHistogram('pt',title='%(p)s Transverse momentum Distribution ; %(p)s Transverse momentum [GeV] ; Events' % {'p': particletype}, path='Shifter',xbins=40,xmin=0.0,xmax=80.0) # SHIFTER PANEL @@ -190,14 +190,14 @@ def MonitorElectronConfig(inputFlags): # Add a generic monitoring tool (a "group" in old language). The returned # object here is the standard GenericMonitoringTool. - GroupElectronLHTight = helper.addGroup(elLHTightMonAlg, 'MonitorElectron', 'LHTightElectrons/') - GroupElectronLHTightTriggered = helper.addGroup(elLHTightTrigMonAlg, 'MonitorElectron', 'LHTightElectronsWithTrigger/') - GroupElectronLHLoose = helper.addGroup(elLHLooseMonAlg, 'MonitorElectron', 'LHLooseElectrons/') - GroupElectronLHLooseTriggered = helper.addGroup(elLHLooseTrigMonAlg, 'MonitorElectron', 'LHLooseElectronsWithTrigger/') - GroupElectronCBTight = helper.addGroup(elCBTightMonAlg, 'MonitorElectron', 'CBTightElectrons/') - GroupElectronCBTightTriggered = helper.addGroup(elCBTightTrigMonAlg, 'MonitorElectron', 'CBTightTriggeredElectrons/') - GroupElectronCBLoose = helper.addGroup(elCBLooseMonAlg, 'MonitorElectron', 'CBLooseElectrons/') - GroupElectronCBLooseTriggered = helper.addGroup(elCBLooseTrigMonAlg, 'MonitorElectron', 'CBLooseTriggeredElectrons/') + GroupElectronLHTight = helper.addGroup(elLHTightMonAlg, 'MonitorElectron', 'egamma/LHTightElectrons/') + GroupElectronLHTightTriggered = helper.addGroup(elLHTightTrigMonAlg, 'MonitorElectron', 'egamma/LHTightElectronsWithTrigger/') + GroupElectronLHLoose = helper.addGroup(elLHLooseMonAlg, 'MonitorElectron', 'egamma/LHLooseElectrons/') + GroupElectronLHLooseTriggered = helper.addGroup(elLHLooseTrigMonAlg, 'MonitorElectron', 'egamma/LHLooseElectronsWithTrigger/') + GroupElectronCBTight = helper.addGroup(elCBTightMonAlg, 'MonitorElectron', 'egamma/CBTightElectrons/') + GroupElectronCBTightTriggered = helper.addGroup(elCBTightTrigMonAlg, 'MonitorElectron', 'egamma/CBTightTriggeredElectrons/') + GroupElectronCBLoose = helper.addGroup(elCBLooseMonAlg, 'MonitorElectron', 'egamma/CBLooseElectrons/') + GroupElectronCBLooseTriggered = helper.addGroup(elCBLooseTrigMonAlg, 'MonitorElectron', 'egamma/CBLooseTriggeredElectrons/') ### STEP 5 ### # Configure histograms @@ -241,7 +241,7 @@ def MonitorPhotonConfig(inputFlags): # The following class will make a sequence, configure algorithms, and link # them to GenericMonitoringTools from AthenaMonitoring import AthMonitorCfgHelper - helper = AthMonitorCfgHelper(inputFlags,'PhotonnAthMonitorCfg') + helper = AthMonitorCfgHelper(inputFlags,'PhotonAthMonitorCfg') ### STEP 2 ### @@ -312,10 +312,10 @@ def MonitorPhotonConfig(inputFlags): # Add a generic monitoring tool (a "group" in old language). The returned # object here is the standard GenericMonitoringTool. - GroupPhotonCBTight = helper.addGroup(phCBTightMonAlg, 'MonitorPhoton', 'CBTightPhotons/') - GroupPhotonCBTightTriggered = helper.addGroup(phCBTightTrigMonAlg, 'MonitorPhoton', 'CBTightTriggeredPhotons/') - GroupPhotonCBLoose = helper.addGroup(phCBLooseMonAlg, 'MonitorPhoton', 'CBLoosePhotons/') - GroupPhotonCBLooseTriggered = helper.addGroup(phCBLooseTrigMonAlg, 'MonitorPhoton', 'CBLooseTriggeredPhotons/') + GroupPhotonCBTight = helper.addGroup(phCBTightMonAlg, 'MonitorPhoton', 'egamma/CBTightPhotons/') + GroupPhotonCBTightTriggered = helper.addGroup(phCBTightTrigMonAlg, 'MonitorPhoton', 'egamma/CBTightTriggeredPhotons/') + GroupPhotonCBLoose = helper.addGroup(phCBLooseMonAlg, 'MonitorPhoton', 'egamma/CBLoosePhotons/') + GroupPhotonCBLooseTriggered = helper.addGroup(phCBLooseTrigMonAlg, 'MonitorPhoton', 'egamma/CBLooseTriggeredPhotons/') ### STEP 5 ### # Configure histograms diff --git a/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py b/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..bdbd7bfa7f743844dd19d67c23218bc9813147eb --- /dev/null +++ b/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py @@ -0,0 +1,16 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +def egammaMonitoringConfig(flags): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + result = ComponentAccumulator() + + # don't run in RAW -> ESD + if flags.DQ.Environment in ('tier0', 'tier0ESD',' online', 'AOD'): + from egammaPerformance.SetupEgammaMonitoring import MonitorElectronConfig, MonitorPhotonConfig + + result.merge(MonitorElectronConfig(flags)) + result.merge(MonitorPhotonConfig(flags)) + + return result diff --git a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoringConfig.py b/Reconstruction/egamma/egammaPerformance/share/egammaMonitoringConfig.py deleted file mode 100755 index 48495a6bb4037622dff954a1b0ec6956a597da7e..0000000000000000000000000000000000000000 --- a/Reconstruction/egamma/egammaPerformance/share/egammaMonitoringConfig.py +++ /dev/null @@ -1,289 +0,0 @@ -# -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager -from AthenaMonitoring.DQMonFlags import DQMonFlags - -if DQMonFlags.monManEnvironment() in ('tier0','tier0ESD','online', 'AOD'): - -# dual use of Run2 and Run3 monitoring - - from AthenaCommon.Configurable import Configurable - - if Configurable.configurableRun3Behavior == 1 : # Configure Run3 monitoring - - try: - from egammaPerformance.egammaPerformanceConf import MonitorElectronConfig - from egammaPerformance.egammaPerformanceConf import MonitorPhotonConfig - # Set the Athena configuration flags - from AthenaConfiguration.AllConfigFlags import ConfigFlags - ConfigFlags.lock() - # Initialize configuration object, add accumulator, merge, and run. - from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg - from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg - cfg = MainServicesSerialCfg() - cfg.merge(PoolReadCfg(ConfigFlags)) - - MonitorElectronAcc = MonitorElectronConfig(ConfigFlags) - cfg.merge(MonitorElectronAcc) - - MonitorPhotonAcc = MonitorPhotonConfig(ConfigFlags) - cfg.merge(MonitorPhotonAcc) - - except Exception: - from AthenaCommon.Resilience import treatException - treatException("egammaMonitoring_jobOptions.py: exception when setting up Egamma monitoring for Run III") - - else : # Configure Run2 monitoring - - import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf - try: - - # Set the Athena configuration flags - from AthenaCommon.AthenaCommonFlags import jobproperties - from AthenaCommon.Constants import INFO - - - monManEgamma = AthenaMonManager(name="EgammaMonManager", - FileKey = DQMonFlags.monManFileKey(), - Environment = DQMonFlags.monManEnvironment(), - ManualDataTypeSetup = DQMonFlags.monManManualDataTypeSetup(), - DataType = DQMonFlags.monManDataType()) - topSequence += monManEgamma - - from AthenaMonitoring.BadLBFilterTool import GetLArBadLBFilterTool - from AthenaMonitoring.FilledBunchFilterTool import GetFilledBunchFilterTool - - ### Setup which objects will be monitored - - ## Commenting in/out Mon tools for now - egammaMonitorUpsilon1S = False - egammaMonitorUpsilon2S = False - # egammaMonitorJPsi = False - # egammaMonitorZee = False - # egammaMonitorFwdEg = False - # egammaMonitorPhotons = False - # egammaMonitorElectrons = False - - if not ('egammaMonitorPhotons' in dir()): - egammaMonitorPhotons = True - if not ('egammaMonitorElectrons' in dir()): - egammaMonitorElectrons = True - if not ('egammaMonitorFwdEg' in dir()): - egammaMonitorFwdEg = True - if not ('egammaMonitorZee' in dir()): - egammaMonitorZee = True - if not ('egammaMonitorJPsi' in dir()): - egammaMonitorJPsi = True - if not ('egammaMonitorUpsilon1S' in dir()): - egammaMonitorUpsilon1S = True - if not ('egammaMonitorUpsilon2S' in dir()): - egammaMonitorUpsilon2S = True - - photonTrigItems = [] - electronTrigItems = [] - mySingleElectronTrigger = [] - myDiElectronTrigger = [] - ZeeTrigItems = [] - JPsiTrigItems = [] - UpsilonTrigItems = [] - FrwdETrigItems = [] - MyTrigDecisionTool = "" - - # do trigger by default for at least one electron and photon monitor - - BypassphotonTrigItems = [] - BypassmySingleElectronTrigItems = [] - # Force the trigger with a trigger found in the test file for test purpose - # BypassphotonTrigItems = ['L1_EM20VH'] - # BypassmySingleElectronTrigItems = ['L1_EM20VH'] - - BypassphotonTrigItems += egammaConf.primary_double_pho - BypassmySingleElectronTrigItems += egammaConf.primary_single_ele - print("egamma electron trigger = %s" % BypassmySingleElectronTrigItems) - - BypassMyTrigDecisionTool = monTrigDecTool if DQMonFlags.useTrigger() else None - - ## Commenting in/out Trigger for now - MyDoTrigger = False - #MyDoTrigger = DQMonFlags.useTrigger() - - if (MyDoTrigger): - photonTrigItems += egammaConf.primary_double_pho - mySingleElectronTrigger += egammaConf.primary_single_ele - myDiElectronTrigger += egammaConf.primary_double_ele - JPsiTrigItems += egammaConf.monitoring_Jpsiee - FrwdETrigItems += egammaConf.primary_single_ele - ZeeTrigItems += egammaConf.monitoring_Zee - MyTrigDecisionTool = monTrigDecTool - - egammaMonOutputLevel = INFO - #egammaMonOutputLevel = VERBOSE - #egammaMonOutputLevel = DEBUG - - if(egammaMonitorPhotons): - from egammaPerformance.egammaPerformanceConf import photonMonTool - phMonTool = photonMonTool(name= "phMonTool", - EgTrigDecisionTool = MyTrigDecisionTool, - EgUseTrigger = MyDoTrigger, - EgTrigger = photonTrigItems, - EgGroupExtension = "", - PhotonContainer = "Photons", - OutputLevel = egammaMonOutputLevel) - if jobproperties.Beam.beamType()=='collisions': - phMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - phMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ phMonTool ] - print(phMonTool) - - if DQMonFlags.useTrigger(): - phMonToolWithTrigger = photonMonTool(name= "phMonToolWithTrigger", - EgTrigDecisionTool = BypassMyTrigDecisionTool, - EgUseTrigger = True, - EgTrigger = BypassphotonTrigItems, - EgGroupExtension = "WithTrigger", - PhotonContainer = "Photons", - OutputLevel = egammaMonOutputLevel) - if jobproperties.Beam.beamType()=='collisions': - phMonToolWithTrigger.FilterTools += [ GetLArBadLBFilterTool() ] - phMonToolWithTrigger.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ phMonToolWithTrigger ] - print(phMonToolWithTrigger) - - - if(egammaMonitorElectrons): - from egammaPerformance.egammaPerformanceConf import electronMonTool - elMonTool = electronMonTool(name= "elMonTool", - EgTrigDecisionTool = MyTrigDecisionTool, - EgUseTrigger = MyDoTrigger, - EgTrigger = mySingleElectronTrigger, - EgGroupExtension = "", - ElectronContainer = "Electrons", - OutputLevel = egammaMonOutputLevel) - if jobproperties.Beam.beamType()=='collisions': - elMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - elMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ elMonTool ] - print(elMonTool) - - if DQMonFlags.useTrigger(): - elMonToolWithTrigger = electronMonTool(name= "elMonToolWithTrigger", - EgTrigDecisionTool = BypassMyTrigDecisionTool, - EgUseTrigger = True, - EgTrigger = BypassmySingleElectronTrigItems, - EgGroupExtension = "WithTrigger", - ElectronContainer = "Electrons", - OutputLevel = egammaMonOutputLevel) - if jobproperties.Beam.beamType()=='collisions': - elMonToolWithTrigger.FilterTools += [ GetLArBadLBFilterTool() ] - elMonToolWithTrigger.FilterTools += [GetFilledBunchFilterTool()] - monManEgamma.AthenaMonTools += [ elMonToolWithTrigger ] - print(elMonToolWithTrigger) - - if(egammaMonitorFwdEg): - from egammaPerformance.egammaPerformanceConf import forwardElectronMonTool - fwdMonTool = forwardElectronMonTool(name= "fwdMonTool", - EgTrigDecisionTool = MyTrigDecisionTool, - EgUseTrigger = MyDoTrigger, - EgTrigger = FrwdETrigItems, - ForwardElectronContainer ="ForwardElectrons", - OutputLevel = egammaMonOutputLevel) - if jobproperties.Beam.beamType()=='collisions': - fwdMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - fwdMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ fwdMonTool ] - print(fwdMonTool) - - if(egammaMonitorZee): - from egammaPerformance.egammaPerformanceConf import ZeeTaPMonTool - ZeeMonTool = ZeeTaPMonTool(name= "ZeeMonTool", - EgTrigDecisionTool = MyTrigDecisionTool, - EgUseTrigger = MyDoTrigger, - EgTrigger = ZeeTrigItems, - EgGroupExtension="Z", - ElectronContainer ="Electrons", - massPeak = 91188, - electronEtCut = 20000, - massLowerCut = 60000, - massUpperCut = 120000, - #PhiBinning = 64, - OutputLevel = egammaMonOutputLevel, - TrigDecisionTool = MyTrigDecisionTool, - UseTrigger = MyDoTrigger) - if jobproperties.Beam.beamType()=='collisions': - ZeeMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - ZeeMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ ZeeMonTool ] - print(ZeeMonTool) - - if(egammaMonitorJPsi): - from egammaPerformance.egammaPerformanceConf import ZeeTaPMonTool - JPsiMonTool = ZeeTaPMonTool(name= "JPsiMonTool", - EgTrigDecisionTool = MyTrigDecisionTool, - EgUseTrigger = MyDoTrigger, - EgTrigger = JPsiTrigItems, - EgGroupExtension="JPsi", - ElectronContainer="Electrons", - massPeak = 3097, - electronEtCut = 3000, - massLowerCut = 2000, - massUpperCut = 5000, - #PhiBinning = 40, - OutputLevel = egammaMonOutputLevel, - TrigDecisionTool = MyTrigDecisionTool, - UseTrigger = MyDoTrigger) - if jobproperties.Beam.beamType()=='collisions': - JPsiMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - JPsiMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ JPsiMonTool ] - print(JPsiMonTool) - - if(egammaMonitorUpsilon1S): - from egammaPerformance.egammaPerformanceConf import physicsMonTool - Upsilon1SMonTool = physicsMonTool(name= "Upsilon1SMonTool", - ElectronContainer="Electrons", - Trigger_Items = UpsilonTrigItems, - ProcessName = "Upsilon1See", - Selection_Items = ["all"], - massShift = 9460, - massElectronClusterEtCut = 1000 , - massLowerCut = 5000, - massUpperCut = 15000, - #PhiBinning = 64, - OutputLevel = egammaMonOutputLevel, - TrigDecisionTool = MyTrigDecisionTool, - UseTrigger = MyDoTrigger) - if jobproperties.Beam.beamType()=='collisions': - Upsilon1SMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - Upsilon1SMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ Upsilon1SMonTool ] - print(Upsilon1SMonTool) - - if(egammaMonitorUpsilon2S): - from egammaPerformance.egammaPerformanceConf import physicsMonTool - Upsilon2SMonTool = physicsMonTool(name= "Upsilon2SMonTool", - ElectronContainer="Electrons", - Trigger_Items = UpsilonTrigItems, - ProcessName = "Upsilon2See", - Selection_Items = ["all"], - massShift = 10023, - massElectronClusterEtCut = 1000 , - massLowerCut = 5000, - massUpperCut = 15000, - #PhiBinning = 64, - OutputLevel = egammaMonOutputLevel, - TrigDecisionTool = MyTrigDecisionTool, - UseTrigger = MyDoTrigger) - if jobproperties.Beam.beamType()=='collisions': - Upsilon2SMonTool.FilterTools += [ GetLArBadLBFilterTool() ] - Upsilon2SMonTool.FilterTools += [ GetFilledBunchFilterTool() ] - monManEgamma.AthenaMonTools += [ Upsilon2SMonTool ] - print(Upsilon2SMonTool) - - except Exception: - from AthenaCommon.Resilience import treatException - treatException("egammaMonitoring_jobOptions.py: exception when setting up Egamma monitoring for Run II") diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx index 8ff35d3239ae20145e242fd5bae7cd9976227d61..0eac04520b744b801428fe37e5a557e7ef7775ee 100755 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx @@ -71,7 +71,7 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c else continue; // do stuff with electrons - pt = e_iter->pt(); // in GeV + pt = e_iter->pt()/Gaudi::Units::GeV; // in GeV fill("MonitorElectron",pt); } diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx index 5f1e226f68a3205844e5fff5a0543b0aeecb6c97..e3558221cba63c6ce8caebbb8e4ff7e7616bbdfb 100755 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx @@ -34,8 +34,8 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con // get the Photon container - SG::ReadHandle<xAOD::PhotonContainer> electrons(m_ParticleContainerKey, ctx); - if (! electrons.isValid() ) { + SG::ReadHandle<xAOD::PhotonContainer> photons(m_ParticleContainerKey, ctx); + if (! photons.isValid() ) { ATH_MSG_ERROR("evtStore() does not contain electron Collection with name "<< m_ParticleContainerKey); return StatusCode::FAILURE; } @@ -63,7 +63,7 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con np = 0; - for (const auto& e_iter : *electrons) { + for (const auto& e_iter : *photons) { // Check that the electron meets our requirements bool isGood; @@ -71,8 +71,8 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con if(isGood) {np++;} else continue; - // do stuff with electrons - pt = e_iter->pt(); // in GeV + // do stuff with photons + pt = e_iter->pt()/Gaudi::Units::GeV; // in GeV fill("MonitorPhoton",pt); }