diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py index 2d84219e60d20faacc6ba619c0c3e5e3707844e2..f86c85768005b60f9c606bc7cd951b341498cc92 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategory.py @@ -1,22 +1,6 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -################################ -###### Run-3 develpments ####### -################################ -# Should be removed for future -monitoring_electron_Run3 = ['HLT_e3_etcut_L1EM3','HLT_e5_etcut_L1EM3','HLT_e7_etcut_L1EM3','HLT_e300_etcut_L1EM24VHI'] -monitoring_photon_Run3 = ['HLT_g5_etcut_L1EM3','HLT_g5_loose_L1EM3','HLT_g5_medium_L1EM3','HLT_g5_tight_L1EM3','HLT_g140_loose_L1EM24VH'] -monitoring_tags_Run3 = ['HLT_e26_lhtight_L1EM24VHI'] -monitoringTP_electron_Run3 = ['HLT_e26_lhtight_L1EM24VHI','HLT_e60_lhmedium_L1EM24VHI','HLT_e140_lhloose_L1EM24VHI'] -monitoringTP_Jpsiee_Run3 = [] - - - - -################################################ -# Official triggers -################################################ #Categories currently used by offline Egamma TO monitoring tool diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py index c6aab7946e905ed0dc6cd5aa0ec26bf869e90069..0964efc7e06d3851e9aee52c4150b13495f5591e 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py @@ -25,41 +25,11 @@ def TrigEgammaMonConfig(inputFlags): # configure alg and ana tools from TrigEgammaMonitoring.TrigEgammaMonitoringMTConfig import TrigEgammaMonAlgBuilder monAlgCfg = TrigEgammaMonAlgBuilder( helper, '2018', detailedHistogram=True ) # Using 2018 e/g tunings - - # Force monitor builder - monAlgCfg.activate_zee=False - monAlgCfg.activate_jpsiee=False - monAlgCfg.activate_electron=True - monAlgCfg.activate_photon=False # build monitor and book histograms monAlgCfg.configure() - - # Test matching tool - # The following class will make a sequence, configure algorithms, and link - #from AthenaMonitoring import AthMonitorCfgHelper - #helper = AthMonitorCfgHelper(inputFlags,'TrigEgammaAthMonitorCfg') - #from TrigEgammaMatchingTool.TrigEgammaMatchingToolConf import TrigEgammaMatchingToolMTTest, Trig__TrigEgammaMatchingToolMT - #mon = helper.addAlgorithm( TrigEgammaMatchingToolMTTest, "TrigEgammaMatchingToolMTTest" ) - #triggers = [ - # "HLT_e26_etcut_L1EM22VHI", - # "HLT_e26_lhtight_L1EM24VHI", - # "HLT_e300_etcut_L1EM24VHI", - # "HLT_e3_etcut_L1EM3", - # "HLT_e5_etcut_L1EM3", - # "HLT_e7_etcut_L1EM3", - # ] - #tool = Trig__TrigEgammaMatchingToolMT("MatchingTool") - #mon.TrigEgammaMatchingToolMT = tool - #mon.TriggerList = triggers - #helper.resobj.addPublicTool(tool) - - - - - # Finalize. The return value should be a tuple of the ComponentAccumulator # and the sequence containing the created algorithms. If we haven't called # any configuration other than the AthMonitorCfgHelper here, then we can diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py index a6a211ecef2b6f99ff42472d1a1a9e4d6e1c3bf5..5287ee988a7f50b101cf46204f6249680aab171c 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py @@ -6,7 +6,7 @@ @brief Run 3 configuration builder. Histograms definitions taken from TrigEgammaPlotTool ''' -from TrigEgammaMonitoring.TrigEgammaMonitCategory import monitoring_tags_Run3, monitoring_electron_Run3, monitoring_photon_Run3, monitoringTP_electron_Run3, monitoringTP_Jpsiee_Run3 + #from TrigEgammaAnalysisTools.TrigEgammaProbelist import monitoring_electron, monitoring_photon, monitoringTP_electronJpsiee, monitoringTP_electron from TrigEgammaHypo.TrigEgammaPidTools import ElectronPidTools from TrigEgammaHypo.TrigEgammaPidTools import PhotonPidTools @@ -38,7 +38,7 @@ class TrigEgammaMonAlgBuilder: activate_zee = False activate_jpsiee = False tagItems = [] - JpsitagItems = [] + jpsitagItems = [] electronList = [] photonList = [] tpList = [] @@ -106,7 +106,7 @@ class TrigEgammaMonAlgBuilder: self.activate_electron=True self.activate_photon=True - + def configure(self): self.setProperties() self.configureMonitor() @@ -115,9 +115,10 @@ class TrigEgammaMonAlgBuilder: - # Implementation of https://its.cern.ch/jira/browse/ATR-13200 + def get_monitoring_mode(self): + # Implementation of https://its.cern.ch/jira/browse/ATR-13200 self.__logger.info("TrigEgammaMonToolBuilder.get_monitoring_mode()") self.data_type = dqflags.monManDataType() if self.data_type == 'monteCarlo': @@ -141,9 +142,7 @@ class TrigEgammaMonAlgBuilder: self.__logger.info("TrigEgammaMonToolBuilder.setProperties()") self.basePath = 'HLT/EgammaMon' - self.tagItems = monitoring_tags_Run3 - self.JpsitagItems = [] - + if self.pp_mode is True: self.setDefaultProperties() elif self.cosmic_mode is True: @@ -168,10 +167,23 @@ class TrigEgammaMonAlgBuilder: def setDefaultProperties(self): - self.electronList = monitoring_electron_Run3 - self.photonList = monitoring_photon_Run3 - self.tpList = monitoringTP_electron_Run3 - self.jpsiList = monitoringTP_Jpsiee_Run3 + + # This will be removed for future. + monitoring_electron = ['HLT_e3_etcut_L1EM3','HLT_e5_etcut_L1EM3','HLT_e7_etcut_L1EM3','HLT_e300_etcut_L1EM24VHI'] + monitoring_photon = ['HLT_g5_etcut_L1EM3','HLT_g5_loose_L1EM3','HLT_g5_medium_L1EM3','HLT_g5_tight_L1EM3','HLT_g140_loose_L1EM24VH'] + monitoringTP_electron = ['HLT_e26_lhtight_L1EM24VHI','HLT_e60_lhmedium_L1EM24VHI','HLT_e140_lhloose_L1EM24VHI'] + + + + self.electronList = monitoring_electron + self.photonList = monitoring_photon + self.tpList = monitoringTP_electron + self.jpsiList = [] + self.tagItems = [] #monitoring_tags + self.jpsitagItems = [] #monitoring_jpsitags + + + # @@ -253,7 +265,7 @@ class TrigEgammaMonAlgBuilder: self.zeeMonAlg.RemoveCrack=False self.zeeMonAlg.TagTriggerList=self.tagItems self.zeeMonAlg.TriggerList=self.tpList - self.zeeMonAlg.DetailedHistograms=self.detailHistograms + self.zeeMonAlg.DetailedHistograms=self.detailedHistograms if self.activate_jpsiee: @@ -276,8 +288,8 @@ class TrigEgammaMonAlgBuilder: self.jpsieeMonAlg.OfflineProbeSelector='LHLoose' self.jpsieeMonAlg.OppositeCharge=True self.jpsieeMonAlg.RemoveCrack=False - self.jpsieeMonAlg.TagTriggerList=self.tagItems - self.jpsieeMonAlg.TriggerList=self.tpList + self.jpsieeMonAlg.TagTriggerList=self.jpsitagItems + self.jpsieeMonAlg.TriggerList=self.jpsiList self.jpsieeMonAlg.DetailedHistograms=self.detailedHistograms @@ -307,7 +319,7 @@ class TrigEgammaMonAlgBuilder: self.phMonAlg.LHResultNames=self.lhnames self.phMonAlg.ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector] self.phMonAlg.ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector] - self.phMonAlg.TriggerList=self.tpList + self.phMonAlg.TriggerList=self.photonList self.phMonAlg.DetailedHistograms=self.detailedHistograms diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.h index c5863b2835b408ac5a30e46317be921b1f0bd9ea..39aa807c484d4545e87a07c090ab4c398a721c7b 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.h @@ -36,7 +36,6 @@ class TrigEgammaMonitorElectronAlgorithm: public TrigEgammaMonitorAnalysisAlgori /*! List of triggers to study */ std::vector<std::string> m_trigList; - /*! List of triggers from menu */ Gaudi::Property<std::vector<std::string>> m_trigInputList{this, "TriggerList", {}}; /*! Directory name for each algorithm */ @@ -53,8 +52,6 @@ class TrigEgammaMonitorElectronAlgorithm: public TrigEgammaMonitorAnalysisAlgori Gaudi::Property<bool> m_forceVetoVeryLoose{ this, "ForceVetoVeryLoose", false}; /*! Remove crack region for Probe default True */ Gaudi::Property<bool> m_rmCrack{ this, "RemoveCrack", true}; - - // Containers /*! Event Wise offline ElectronContainer Access and end iterator */ SG::ReadHandleKey<xAOD::ElectronContainer> m_offElectronKey{ this, "ElectronKey", "Electrons", ""}; diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx index 4092832d1fcefc159470799bc945c13a4849952f..cee8d2319df122c632b21dd772bf11ca4dfb916c 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx @@ -22,6 +22,19 @@ StatusCode TrigEgammaMonitorPhotonAlgorithm::initialize() ATH_CHECK(TrigEgammaMonitorAnalysisAlgorithm::initialize()); ATH_CHECK(m_offPhotonKey.initialize()); + + + for(const auto trigName:m_trigInputList) + { + if(getTrigInfoMap().count(trigName) != 0){ + ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); + }else { + m_trigList.push_back(trigName); + setTrigInfo(trigName); + } + } + + return StatusCode::SUCCESS; } @@ -29,7 +42,6 @@ StatusCode TrigEgammaMonitorPhotonAlgorithm::initialize() StatusCode TrigEgammaMonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) const { - ATH_MSG_DEBUG("Executing TrigEgammaMonitorPhotonAlgorithm"); if(tdt()->ExperimentalAndExpertMethods()->isHLTTruncated()){ @@ -55,6 +67,10 @@ StatusCode TrigEgammaMonitorPhotonAlgorithm::fillHistograms( const EventContext& } + fillDistributions( pairObjs, info ); + fillEfficiencies( pairObjs, info ); + + ATH_MSG_DEBUG("End Chain Analysis ============================= " << trigger); } // End loop over trigger list diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx index d53c41229f3e668a85d4a76e6af089e5d3705884..165c25862711f6f28ce435e3d11ddf4f4912b5d7 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx @@ -52,19 +52,16 @@ StatusCode TrigEgammaMonitorTagAndProbeAlgorithm::initialize() { ATH_MSG_INFO("Now configuring chains for analysis: " << name() ); std::vector<std::string> chains = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*"); - for(const auto trigName:m_trigInputList) { - if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ - if(getTrigInfoMap().count(trigName) != 0){ - ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); - }else { - m_trigList.push_back(trigName); - setTrigInfo(trigName); - } + if(getTrigInfoMap().count(trigName) != 0){ + ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName); + }else { + m_trigList.push_back(trigName); + setTrigInfo(trigName); } } - + return StatusCode::SUCCESS; } @@ -115,6 +112,10 @@ StatusCode TrigEgammaMonitorTagAndProbeAlgorithm::fillHistograms( const EventCon // Include fill here + fillDistributions( pairObjs, info ); + fillEfficiencies( pairObjs, info ); + + } // End loop over trigger list @@ -131,7 +132,8 @@ StatusCode TrigEgammaMonitorTagAndProbeAlgorithm::fillHistograms( const EventCon bool TrigEgammaMonitorTagAndProbeAlgorithm::executeTandP( const EventContext& ctx, std::vector<const xAOD::Electron*> &probeElectrons) const { - + + auto monGroup = getGroup( "Event" ); fillLabel(monGroup, m_anatype+"_CutCounter", "Events"); @@ -281,10 +283,12 @@ bool TrigEgammaMonitorTagAndProbeAlgorithm::minimalTriggerRequirement() const { ATH_MSG_DEBUG("Apply Minimal trigger requirements"); for(unsigned int ilist = 0; ilist != m_tagTrigList.size(); ilist++) { - std::string tag = m_tagTrigList.at(ilist); + std::string tag = m_tagTrigList[ilist]; if ( tdt()->isPassed(tag) ) return true; } + + return false; } @@ -390,7 +394,7 @@ bool TrigEgammaMonitorTagAndProbeAlgorithm::isTagElectron( ToolHandle<GenericMon // The statement below is more general bool tagPassed=false; for(unsigned int ilist = 0; ilist != m_tagTrigList.size(); ilist++) { - std::string tag = m_tagTrigList.at(ilist); + std::string tag = m_tagTrigList[ilist]; if(tdt()->isPassed(tag)){ if(m_tp){ std::string p1trigger; @@ -418,7 +422,7 @@ bool TrigEgammaMonitorTagAndProbeAlgorithm::isTagElectron( ToolHandle<GenericMon ATH_MSG_DEBUG("Matching Tag Electron FC"); bool tagMatched=false; for(unsigned int ilist = 0; ilist != m_tagTrigList.size(); ilist++) { - std::string tag = m_tagTrigList.at(ilist); + std::string tag = m_tagTrigList[ilist]; if( match()->match(el,tag) ) tagMatched=true; } diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.h index 955ddfa08cf6cd8f21678c91fa7096f43e57fd54..db940d8a82422acf445e892789b1b34d94a6ea7d 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.h @@ -34,10 +34,7 @@ class TrigEgammaMonitorTagAndProbeAlgorithm: public TrigEgammaMonitorAnalysisAlg - /*! Trigger for tag and event wise selection */ - std::vector<std::string> m_tagTrigList; - /*! List of triggers from menu */ - std::vector<std::string> m_trigInputList; + /*! List of triggers from menu after filter*/ std::vector<std::string> m_trigList; @@ -61,8 +58,10 @@ class TrigEgammaMonitorTagAndProbeAlgorithm: public TrigEgammaMonitorAnalysisAlg /** Properties **/ - - + /*! List of triggers from menu */ + Gaudi::Property<std::vector<std::string>> m_trigInputList{this, "TriggerList", {}}; + /*! Tag trigger list */ + Gaudi::Property<std::vector<std::string>> m_tagTrigList{ this, "TagTriggerList", {}}; /*! Zee lower mass cut */ Gaudi::Property<float> m_ZeeMassMin{ this, "ZeeLowerMass", 80}; /*! Zee upper mass cut */ @@ -89,8 +88,6 @@ class TrigEgammaMonitorTagAndProbeAlgorithm: public TrigEgammaMonitorAnalysisAlg Gaudi::Property<bool> m_doJpsiee{this,"DoJpsiee", false}; /*! analysis name */ Gaudi::Property<std::string> m_anatype{ this, "Analysis","Zee"}; - - // Containers /*! Event Wise offline ElectronContainer Access and end iterator */ SG::ReadHandleKey<xAOD::ElectronContainer> m_offElectronKey{ this, "ElectronKey", "Electrons", ""}; /*! Jet container for probe selection */