diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4a68998ccb99eadf8156a342f97a23244f63e3bc --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.cxx @@ -0,0 +1,74 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.h + ** + ** Description: - Hypothesis Tool: search for photon pairs with + ** deltaPhi more than a threshold value; intended for H->gg + ** + ** Author: D. BakshiGupta <debottam.bakshigupta@cern.ch> + ** + **************************************************************************/ + + +#include "TrigEgammaDiphotonDPhiHypoTool.h" + +#include <cmath> + +using namespace TrigCompositeUtils; + +TrigEgammaDiphotonDPhiHypoTool::TrigEgammaDiphotonDPhiHypoTool(const std::string& type, const std::string& name, const IInterface* parent) + : ComboHypoToolBase(type, name, parent) {} + + +StatusCode TrigEgammaDiphotonDPhiHypoTool::initialize() +{ + ATH_MSG_DEBUG("AcceptAll = " << m_acceptAll ); + ATH_MSG_DEBUG("ThresholdDPhiCut = " << m_thresholdDPhiCut ); + + if ( not m_monTool.name().empty() ) { + ATH_CHECK( m_monTool.retrieve() ); + ATH_MSG_DEBUG("m_monTool name: " << m_monTool); + } + + ATH_MSG_DEBUG("Initialization completed successfully"); + + return StatusCode::SUCCESS; +} + +bool TrigEgammaDiphotonDPhiHypoTool::executeAlg(std::vector<LegDecision> &combination) const { + +//retrieve the electrons + std::vector<ElementLink<xAOD::PhotonContainer>> selected_photons; + for (auto el: combination){ + auto EL= el.second; + auto photonLink = TrigCompositeUtils::findLink<xAOD::PhotonContainer>( *EL, featureString() ).link; + selected_photons.push_back(photonLink); + } + auto photonLink1=selected_photons[0]; + auto photonLink2=selected_photons[1]; + TLorentzVector hlv1 = (*photonLink1)->p4(); + TLorentzVector hlv2 = (*photonLink2)->p4(); + double dPhi = hlv1.DeltaPhi(hlv2); + ATH_MSG_DEBUG("Found two Photons with deltaPhi " <<dPhi); + + // apply the cut + bool pass=true; + if (dPhi<m_thresholdDPhiCut){ + ATH_MSG_DEBUG("Combination failed deltaPhi cut: " << dPhi << " not in " << m_thresholdDPhiCut); + pass=false; + } + + if (pass) + ATH_MSG_DEBUG( " deltaPhi " << dPhi << " is above the threshold "<<m_thresholdDPhiCut<<" This seleciton passed! "); + +return pass; + +} + + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.h new file mode 100644 index 0000000000000000000000000000000000000000..08a5b52e75c7d416c6ab0b1c02d684403ae0f01d --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.h @@ -0,0 +1,74 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRIGEGAMMAHYPO_TRIGEGAMMADIPHOTONDPHIHYPOTOOL_H +#define TRIGEGAMMAHYPO_TRIGEGAMMADIPHOTONDPHIHYPOTOOL_H + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaDiphotonDPhiHypoTool.h + ** + ** Description: - Hypothesis Tool: search for photon pairs with + ** deltaPhi more than a threshold value; intended for H->gg + ** + ** Author: D. BakshiGupta <debottam.bakshigupta@cern.ch> + ** + **************************************************************************/ + +#include <string> +#include <vector> + +#include "DecisionHandling/ComboHypoToolBase.h" + +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTrigEgamma/TrigPhoton.h" +#include "xAODEgamma/PhotonContainer.h" + +#include "TrigCompositeUtils/HLTIdentifier.h" +#include "TrigCompositeUtils/TrigCompositeUtils.h" + +#include "AthenaMonitoringKernel/Monitored.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" + + +/** + * \class TrigEgammaDiphotonDPhiHypoTool + * \brief TrigEgammaDiphotonDPhiHypoTool is a ComboHypoTool that calculates the deltaPhi distance + * Apply the threshold cut and accepts the event if condition is + * satisfied + * + */ + + +class TrigEgammaDiphotonDPhiHypoTool: public ComboHypoToolBase { + + public: + + TrigEgammaDiphotonDPhiHypoTool(const std::string& type, + const std::string& name, + const IInterface* parent); + + virtual ~TrigEgammaDiphotonDPhiHypoTool() {}; + virtual StatusCode initialize() override; + + + private: + + virtual bool executeAlg(std::vector<LegDecision>& thecomb) const override; + + // flags + Gaudi::Property< bool > m_acceptAll {this, "AcceptAll", false, "Ignore selection" }; + + // cuts + Gaudi::Property<float> m_thresholdDPhiCut {this,"ThresholdDPhiCut", 1.5, "minimum deltaPhi required between two photons"}; + + // monitoring + ToolHandle<GenericMonitoringTool> m_monTool { this, "MonTool", "", "Monitoring tool" }; + + +}; // TRIGEGAMMAHYPO_TRIGEGAMMADIPHOTONDPHIHYPOTOOL_H +#endif + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx index 0c58c9a66ebc930b5d9974c06abfc92085330f59..840aa82ce70cf25ff0a9d208c60ab33bbe57e2ab 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx @@ -31,6 +31,7 @@ #include "../TrigEgammaPrecisionPhotonHypoToolMult.h" #include "../TrigEgammaPrecisionElectronHypoToolMult.h" #include "../TrigEgammaDielectronMassHypoTool.h" +#include "../TrigEgammaDiphotonDPhiHypoTool.h" DECLARE_COMPONENT( TrigL2CaloHypo ) DECLARE_COMPONENT( TrigL2ElectronFex ) @@ -65,4 +66,4 @@ DECLARE_COMPONENT( TrigEgammaPrecisionElectronHypoAlgMT ) DECLARE_COMPONENT( TrigEgammaPrecisionPhotonHypoToolMult ) DECLARE_COMPONENT( TrigEgammaPrecisionElectronHypoToolMult ) DECLARE_COMPONENT( TrigEgammaDielectronMassHypoTool ) - +DECLARE_COMPONENT( TrigEgammaDiphotonDPhiHypoTool ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py index c52532fcbf3e6304f85024758f16e6459bdcfbb2..1f9709a6e941d25a7a6ec84793c2e35e138f2a50 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py @@ -2,6 +2,8 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # +from AthenaCommon.Constants import DEBUG + from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Egamma.PhotonDef") @@ -30,6 +32,14 @@ def precisionPhotonCaloSequenceCfg( flags ): def precisionPhotonSequenceCfg( flags ): return precisionPhotonMenuSequence('Photon') +def diphotonDPhiHypoToolFromDict(chainDict): + from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaDiphotonDPhiHypoTool + name = chainDict['chainName'] + tool= TrigEgammaDiphotonDPhiHypoTool(name) + tool.ThresholdDPhiCut = 1.5 + tool.OutputLevel = DEBUG + return tool + #---------------------------------------------------------------- # Class to configure chain #---------------------------------------------------------------- @@ -95,5 +105,9 @@ class PhotonChainConfiguration(ChainConfigurationBase): return self.getStep(3,stepName,[ precisionPhotonCaloSequenceCfg]) def getPrecisionPhoton(self): - stepName = "PhotonPrecision" - return self.getStep(4,stepName,[ precisionPhotonSequenceCfg]) + if "dPhi15" in self.chainName: + stepName = "precision_topophoton" + return self.getStep(4,stepName,sequenceCfgArray=[precisionPhotonSequenceCfg], comboTools=[diphotonDPhiHypoToolFromDict]) + else: + stepName = "precision_photon" + return self.getStep(4,stepName,[ precisionPhotonSequenceCfg]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonSequenceSetup.py index b26abbfc3d37ce4949721b304a3908a259a25bdb..aabeba28db84db25dd39a6a1d3e71a76bb37720c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonSequenceSetup.py @@ -1,5 +1,7 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +from AthenaCommon.Constants import DEBUG + # menu components from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool from AthenaCommon.CFElements import parOR, seqAND @@ -101,6 +103,7 @@ def precisionPhotonMenuSequence(name): thePrecisionPhotonHypo = TrigEgammaPrecisionPhotonHypoAlgMT(name+"precisionPhotonHypo") thePrecisionPhotonHypo.Photons = sequenceOut + thePrecisionPhotonHypo.OutputLevel = DEBUG return MenuSequence( Sequence = sequence, Maker = precisionPhotonViewsMaker, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index b55f21c991ee6d3ce3ec68cb1d9e3905b2a2a91a..191f72248a09868211e120b91373b15d4e795370 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -155,6 +155,9 @@ def setupMenu(): # for moving to PhysicsP1, ATR-21242 ChainProp(name='HLT_g140_etcut_L1EM22VHI', groups=SinglePhotonGroup), + + #ATR-21882 + ChainProp(name='HLT_2g15_tight_dPhi15_L12EM3', groups=MultiPhotonGroup), ] TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [