diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoTool.py index db4f2d7e90fdc124682332fdd988552c0122088b..c74fb84f6984d54408ffeb2949d6dfc007c65e45 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoTool.py @@ -1,4 +1,5 @@ + def TrigL2PhotonHypoToolFromName( name ): """ provides configuration of the hypo tool giben the chain name The argument will be replaced by "parsed" chain dict. For now it only serves simplest chain HLT_eXYZ. @@ -26,6 +27,23 @@ def TrigL2PhotonHypoToolFromName( name ): tool.MonTool = monTool tool += monTool + from AthenaCommon.SystemOfUnits import GeV + nt = len( thresholds ) + tool.ETthr = [ [0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV] ] *nt + tool.CARCOREthr = [ [0., 0., 0., 0., 0., 0., 0., 0., 0.] ] *nt + tool.CAERATIOthr = [ [0., 0., 0., 0., 0., 0., 0., 0., 0.] ] *nt + tool.EtaBins = [0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] *nt + tool.dETACLUSTERthr = [0.1] * nt + tool.dPHICLUSTERthr = [0.1] *nt + tool.F1thr = [0.005] *nt + tool.ET2thr = [ [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] ] *nt + tool.HADET2thr = [ [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] ] *nt + tool.HADETthr = [ [0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035] ] *nt + +# for th, thvalue in enumerate(thresholds): +# print th, thvalue +# tool.ETthr [ th ] = [(float(thvalue)-1.)*GeV]*9 + return tool diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx index f2a6cda62371ba5316da994b8ee1594cd8b46052..cced6a9addf433eb96ae65402adf0dfdaf355a6b 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFexMT.cxx @@ -7,24 +7,14 @@ /************************************************************************** ** - ** Original Author: R.Goncalo - ** - ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2PhotonHypo.cxx - ** - ** Description: Fex algo for TrigPhotons - ** - ** Modified by: R.Goncalo - ** V. Perez-Reale - ** A.Hamilton - ** V. Dao (new TrigPhoton constructor used) - ** - ** Created: Thu Jun 06 16:01:12 BST 2006 + ** Original Author: B.Safarzadeh + **************************************************************************/ #include "TrigL2PhotonFexMT.h" #include "xAODTrigCalo/TrigEMClusterContainer.h" #include "xAODTrigCalo/TrigEMClusterAuxContainer.h" -#include "xAODTrigEgamma/TrigPhotonAuxContainer.h" +#include "xAODTrigEgamma/TrigPhotonContainer.h" class ISvcLocator; @@ -33,7 +23,6 @@ class ISvcLocator; TrigL2PhotonFexMT::TrigL2PhotonFexMT(const std::string & name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) { - m_trigPhotonContainer =0; } @@ -44,46 +33,37 @@ TrigL2PhotonFexMT::~TrigL2PhotonFexMT() StatusCode TrigL2PhotonFexMT::initialize() { -ATH_CHECK( m_roiCollectionKey.initialize() ); -ATH_CHECK( m_TrigEMClusterContainerKey.initialize() ); + ATH_CHECK( m_roiCollectionKey.initialize() ); + ATH_CHECK( m_TrigEMClusterContainerKey.initialize() ); + ATH_CHECK(m_outputPhotonsKey.initialize()); ATH_MSG_DEBUG("Initialization:"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } StatusCode TrigL2PhotonFexMT::finalize() { - ATH_MSG_INFO("in finalize()"); - return StatusCode::SUCCESS; + ATH_MSG_INFO("in finalize()"); + return StatusCode::SUCCESS; } StatusCode TrigL2PhotonFexMT::execute() { - using namespace xAOD; - auto ctx = getContext(); - - // xAOD::TrigPhotonAuxContainer trigPhotonAuxContainer; + using namespace xAOD; + auto ctx = getContext(); + // xAOD::TrigPhotonAuxContainer trigPhotonAuxContainer; auto trigPhotoColl = SG::makeHandle (m_outputPhotonsKey, ctx); ATH_CHECK( trigPhotoColl.record (std::make_unique<xAOD::TrigPhotonContainer>(), - std::make_unique<xAOD::TrigEMClusterAuxContainer>()) ); + std::make_unique<xAOD::TrigEMClusterAuxContainer>()) ); ATH_MSG_DEBUG( "Made WriteHandle " << m_outputPhotonsKey ); ATH_MSG_INFO( name() << " running with store " << getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() ); - // always create a TrigPhotonContainer, even if it will be empty - // if(!m_trigPhotonContainer) { - // m_trigPhotonContainer = new xAOD::TrigPhotonContainer(); - // m_trigPhotonContainer->setStore(&trigPhotonAuxContainer); - // } - // else { - // m_trigPhotonContainer->clear(); - //} - - auto roiCollection = SG::makeHandle(m_roiCollectionKey, ctx); + auto roiCollection = SG::makeHandle(m_roiCollectionKey, ctx); if (roiCollection->size()==0) { ATH_MSG_DEBUG(" RoI collection size = 0"); return StatusCode::SUCCESS; @@ -114,45 +94,39 @@ StatusCode TrigL2PhotonFexMT::execute() // retrieve the TrigEMCluster from the ElementLink - const xAOD::TrigEMCluster* pClus = elink_cluster; + const xAOD::TrigEMCluster* pClus = elink_cluster; if(pClus == 0){ - ATH_MSG_ERROR("Failed to retieve TrigEMCluster from the ElementLink"); - return StatusCode::SUCCESS; //HLT::MISSING_FEATURE; + ATH_MSG_ERROR("Failed to retieve TrigEMCluster from the ElementLink"); + return StatusCode::SUCCESS; //HLT::MISSING_FEATURE; } float dEta = pClus->eta() - etaRef; // Deal with angle diferences greater than Pi float dPhi = fabs(pClus->phi() - phiRef); dPhi = (dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); - ATH_MSG_DEBUG("TrigPhoton will be built with: dEta=" << dEta - << " and dPhi= " << dPhi); - - + ATH_MSG_DEBUG("TrigPhoton will be built with: dEta=" << dEta + << " and dPhi= " << dPhi); // create TrigPhoton from TrigEMCluster xAOD::TrigPhoton* p_trigPhoton = new xAOD::TrigPhoton(); // push TrigPhoton into TrigPhotonContainer - m_trigPhotonContainer->push_back(p_trigPhoton); - p_trigPhoton->init( roiDescriptor->roiId(), dPhi, dEta, EClus); -// elink_cluster.getStorableObjectPointer(), -// elink_cluster.index() ); + trigPhotoColl->push_back(p_trigPhoton); + p_trigPhoton->init( roiDescriptor->roiId(), dPhi, dEta, EClus); - -ATH_MSG_DEBUG("REGTEST: TrigPhotonContainer has " << m_trigPhotonContainer->size() - << " element"); - if (!m_trigPhotonContainer->empty()) { - xAOD::TrigPhoton* p_tp = m_trigPhotonContainer->front(); - ATH_MSG_DEBUG("REGTEST: TrigPhoton: RoI=" << p_tp->roiWord() - << "; eta=" << p_tp->eta() - << "; phi=" << p_tp->phi() - << "; Et=" << p_tp->emCluster()->et() - << "; Had Et=" << p_tp->etHad() - << "; EnergyRatio=" << p_tp->eratio() - << "; rCore=" << p_tp->rcore()); - } - return StatusCode::SUCCESS; + ATH_MSG_DEBUG("REGTEST: TrigPhotonContainer has " << trigPhotoColl->size()<< " element"); + if (!trigPhotoColl->empty()) { + xAOD::TrigPhoton* p_tp = trigPhotoColl->front(); + ATH_MSG_DEBUG("REGTEST: TrigPhoton: RoI=" << p_tp->roiWord() + << "; eta=" << p_tp->eta() + << "; phi=" << p_tp->phi() + << "; Et=" << p_tp->emCluster()->et() + << "; Had Et=" << p_tp->etHad() + << "; EnergyRatio=" << p_tp->eratio() + << "; rCore=" << p_tp->rcore()); + } + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx index ad8d0ec7975849be649e877ac4ad896a3a2949b4..d93f1a8166abf827ead8952e1155d1362e36815a 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx @@ -1,5 +1,4 @@ // -*- C++ -*- - /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ @@ -319,10 +318,7 @@ HLT::ErrorCode TrigL2PhotonHypo::hltExecute(const HLT::TriggerElement* outputTE, msg() << MSG::DEBUG << "TrigPhoton: ET_em=" << EmET << " cut in etaBin " << etaBin << " is ET_em >= " << m_eTthr[etaBin] << endmsg; } - if ( EmET < m_eTthr[etaBin]) return HLT::OK; - m_PassedCuts++; - - + if ( EmET < m_eTthr[etaBin]) return HLT::OK; m_PassedCuts++; // ET_had // find which ET_had to apply : this depends on the ET_em and the eta bin float hadET_cut=-1; diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.cxx index e56367e97506db69284becc73b4d6a7d63357003..de3982fb644bc30d9aeee32f77644fce76f6f4e8 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.cxx @@ -1,3 +1,4 @@ + /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ @@ -48,8 +49,7 @@ if ( *std::min_element( sizes.begin(), sizes.end() ) != *std::max_element( sizes TrigL2PhotonHypoTool::~TrigL2PhotonHypoTool() {} -bool TrigL2PhotonHypoTool::decideOnSingleObject( const xAOD::TrigPhoton* photon, - size_t cutIndex ) const { +bool TrigL2PhotonHypoTool::decideOnSingleObject( const xAOD::TrigPhoton* photon,size_t cutIndex ) const { using namespace Monitored; auto cutCounter = MonitoredScalar::declare<int>( "CutCounter", -1 ); @@ -79,16 +79,18 @@ bool TrigL2PhotonHypoTool::decideOnSingleObject( const xAOD::TrigPhoton* photon, double f1 = -99.0; double HadET = -99.0; - if ( photon == 0 ) - return false; - cutCounter++; + if(photon == 0) return false; + cutCounter++; + // Determine which eta bin to apply the cuts double absEta = fabs( photon->eta() ); + + int etaBin = -1; for (std::size_t iBin = 0; iBin < m_etabin.size()-1; iBin++) if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; - + // getting photon variable dEta = photon->dEta(); dPhi = photon->dPhi(); @@ -97,40 +99,46 @@ bool TrigL2PhotonHypoTool::decideOnSingleObject( const xAOD::TrigPhoton* photon, EmET = photon->pt(); HadET = photon->etHad(); f1 = photon->f1(); + + + if(m_etCutOnly) { ATH_MSG_DEBUG ( "EtCutOnly property is set: TrigPhoton: ET_em=" << EmET << " cut in etaBin " << etaBin << " is ET_em >= " << m_eTthr[0] ); - } - //now use the ratio, not the absolute HadEt (this is not yet persistified in the TrigPhoton) + + return true; + } HadEmRatio = (EmET!=0) ? HadET/EmET : -1.0; ATH_MSG_VERBOSE( "Cut index " << cutIndex ); + + if ( fabs(dEta) < m_detacluster[cutIndex] ){ ATH_MSG_VERBOSE( "Fails dEta cut " << fabs(dEta) << " < " << m_detacluster[cutIndex] ); return false; } cutCounter++; - + if ( fabs(dPhi) < m_dphicluster[cutIndex] ){ ATH_MSG_VERBOSE( "Fails dphi cut " << fabs(dPhi) << " < " << m_dphicluster[cutIndex] ); return false; } cutCounter++; - + // eta range if ( etaBin==-1 ) { ATH_MSG_VERBOSE( "Photon eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] ); - return false; + return true; } else { ATH_MSG_VERBOSE( "eta bin used for cuts " << etaBin ); } cutCounter++; // passed eta cut // Reta (was previously called Rcore) - if ( Reta > m_carcorethr[etaBin][cutIndex] ){ + if ( Reta > m_carcorethr[cutIndex][etaBin] ){ ATH_MSG_VERBOSE( "TrigPhoton Reta=" << Reta - << " cut in etaBin " << etaBin << " is Reta >= " << m_carcorethr[etaBin][cutIndex] ); + << " cut in etaBin " << etaBin << " is Reta >= " << m_carcorethr[cutIndex][etaBin] ); return false; } cutCounter++; @@ -140,43 +148,41 @@ bool TrigL2PhotonHypoTool::decideOnSingleObject( const xAOD::TrigPhoton* photon, ATH_MSG_VERBOSE( "TrigPhoton: InCrack= " << inCrack << " F1=" << f1 << " Eratio cut not being applied" ); } else { - if ( Eratio > m_caeratiothr[etaBin][cutIndex] ) return false; + if ( Eratio > m_caeratiothr[cutIndex][etaBin] ) return false; } cutCounter++; if(inCrack) Eratio = -1; //Set default value in crack for monitoring. // ET_em - if ( EmET > m_eTthr[etaBin][cutIndex]) { + if ( EmET < m_eTthr[cutIndex][etaBin]) { ATH_MSG_VERBOSE( "TrigPhoton: ET_em=" << EmET - << " not in etaBin " << etaBin << " is ET_em < " << m_eTthr[etaBin][cutIndex] ); + << " not in etaBin " << etaBin << " is ET_em < " << m_eTthr[cutIndex][etaBin] ); return false; } cutCounter++; - // ET_had // find which ET_had to apply : this depends on the ET_em and the eta bin std::vector<double> hadET_cut={-1}; - if ( EmET > m_eT2thr[etaBin][cutIndex] ) { - hadET_cut[etaBin] = m_hadeT2thr[etaBin][cutIndex] ; - ATH_MSG_VERBOSE( "ET_em>" << m_eT2thr[etaBin][cutIndex] - << ": use high ET_had cut: <" << hadET_cut[etaBin] ); + if ( EmET > m_eT2thr[cutIndex][etaBin] ) { + hadET_cut[etaBin] = m_hadeT2thr[cutIndex][etaBin] ; + ATH_MSG_VERBOSE( "ET_em>" << m_eT2thr[cutIndex][etaBin] ); } else { - hadET_cut[etaBin] = m_hadeTthr[etaBin][cutIndex]; - ATH_MSG_VERBOSE( "ET_em<" << m_eT2thr[etaBin][cutIndex] - << ": use low ET_had cut: <" << hadET_cut[etaBin] ); + hadET_cut[etaBin] = m_hadeTthr[cutIndex][etaBin]; + ATH_MSG_VERBOSE( "ET_em<" << m_eT2thr[cutIndex][etaBin] ); } if ( HadEmRatio < hadET_cut[etaBin] ){ ATH_MSG_VERBOSE( "TrigPhoton: ET_had=" << HadEmRatio - << " not in etaBin " << etaBin << " is ET_had <=" << hadET_cut[etaBin] ); + << " not in etaBin " << etaBin ); return false; } cutCounter++; + return true; - + } StatusCode TrigL2PhotonHypoTool::inclusiveSelection( std::vector<PhotonInfo>& input ) const { @@ -200,6 +206,7 @@ StatusCode TrigL2PhotonHypoTool::markPassing( std::vector<PhotonInfo>& input, co return StatusCode::SUCCESS; } + StatusCode TrigL2PhotonHypoTool::decide( std::vector<PhotonInfo>& input ) const { if ( m_multiplicity == 1 ) { return inclusiveSelection( input ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.h index ea24e7187812835f2b0d56aaf6edf382a27964ca..93e3d6c0f4b63fa8a98edc04811b95f391059d8b 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypoTool.h @@ -60,18 +60,18 @@ class TrigL2PhotonHypoTool : virtual public ::AthAlgTool Gaudi::Property<bool> m_respectPreviousDecision{ this, "RespectPreviousDecision", false, "If false, ( do not even check ), the decision made for the cluster" }; Gaudi::Property<bool> m_acceptAll{ this, "AcceptAll", false, "Ignore selection" }; - Gaudi::Property<bool> m_etCutOnly{ this, "EtCutOnly", false, "" }; - Gaudi::Property< std::vector<double> > m_etabin{ this, "EtaBins", {}, "Eta bins" }; - - Gaudi::Property< std::vector<double> > m_detacluster{ this, "dETACLUSTERthr", {0.2}, "Delta Eta to Cluster" }; - Gaudi::Property< std::vector<double> > m_dphicluster{ this, "dPHICLUSTERthr", {0.2}, "Delta Phi to Cluster" }; - Gaudi::Property< std::vector<double> > m_F1thr{ this, "F1thr", {}, "F1 Threshold" }; - Gaudi::Property< std::vector<std::vector<double>> > m_eTthr{this, "m_eTthr", {{}}, "et threshold"}; - Gaudi::Property< std::vector<std::vector<double>> > m_eT2thr{this, "m_eT2thr", {{}}, "eT2 threshold"}; - Gaudi::Property< std::vector<std::vector<double>> > m_hadeTthr{this, "m_hadeTthr", {{}}, "hadet threshold"}; - Gaudi::Property< std::vector<std::vector<double>> > m_hadeT2thr{this, "m_hadeT2thr", {{}}, "hadet2 threshold"}; - Gaudi::Property< std::vector<std::vector<double>> > m_carcorethr{this, "m_carcorethr", {{}}, "car core threshold"}; - Gaudi::Property< std::vector<std::vector<double>> > m_caeratiothr{this, "m_caeratiothr", {{}}, " cera ratio threshold"}; + Gaudi::Property<bool> m_etCutOnly{ this, "EtCutOnly", true, "" }; + Gaudi::Property< std::vector<double> > m_etabin{ this, "EtaBins", {0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47}, "Eta bins" }; + + Gaudi::Property< std::vector<double> > m_detacluster{ this, "dETACLUSTERthr", {0.1}, "Delta Eta to Cluster" }; + Gaudi::Property< std::vector<double> > m_dphicluster{ this, "dPHICLUSTERthr", {0.1}, "Delta Phi to Cluster" }; + Gaudi::Property< std::vector<double> > m_F1thr{ this, "F1thr", {0.005}, "F1 Threshold" }; + Gaudi::Property< std::vector<std::vector<double>> > m_eTthr{this, "ETthr", {{0.*CLHEP::GeV}}, "et threshold"}; + Gaudi::Property< std::vector<std::vector<double>> > m_eT2thr{this, "ET2thr", {{90.0*CLHEP::GeV}}, "eT2 threshold"}; + Gaudi::Property< std::vector<std::vector<double>> > m_hadeTthr{this, "HADETthr", {{0.}}, "hadet threshold"}; + Gaudi::Property< std::vector<std::vector<double>> > m_hadeT2thr{this, "HADET2thr", {{0.}}, "hadet2 threshold"}; + Gaudi::Property< std::vector<std::vector<double>> > m_carcorethr{this, "CARCOREthr", {{0.}}, "car core threshold"}; + Gaudi::Property< std::vector<std::vector<double>> > m_caeratiothr{this, "CAERATIOthr", {{0.}}, " cera ratio threshold"}; size_t m_multiplicity = 1; diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py index 2481a465d5cf9f5cee6d207ccf367047d3ce3c59..2e5752709e263f38c851c8443e8c611b254a8374 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MenuHypoTools.py @@ -1,8 +1,9 @@ from TrigUpgradeTest.HLTSignatureConfig import TestHypoTool, MuTestHypoTool, ElTestHypoTool -from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoToolInc, TrigL2CaloHypoToolMult, TrigL2ElectronHypoTool +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoToolInc, TrigL2CaloHypoToolMult, TrigL2ElectronHypoTool, TrigL2PhotonHypoTool #from TrigEgammaHypo.TrigL2CaloHypoTool import * from TrigMuonHypo.TrigMuonHypoConf import TrigMufastHypoTool +from AthenaCommon.Constants import VERBOSE,INFO,DEBUG def createHypoTool(hypoToolClassName, hypoToolName): try: @@ -27,6 +28,15 @@ def TrigL2ElectronHypoToolConf(name): hypotool.OutputLevel = DEBUG return hypotool +def TrigL2PhotonHypoToolConf(name): + from AthenaCommon.Constants import DEBUG + from TrigEgammaHypo.TrigL2PhotonHypoTool import TrigL2PhotonHypoToolFromName + hypotool= TrigL2PhotonHypoToolFromName(name) + hypotool.OutputLevel = VERBOSE + return hypotool + + + def TrigMufastHypoToolConf(name): from AthenaCommon.Constants import DEBUG diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py new file mode 100644 index 0000000000000000000000000000000000000000..218c357f6eb0803e5e0eab59f5baf950a63c85c6 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/photonMenuDefs.py @@ -0,0 +1,120 @@ +# +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# + +from AthenaCommon.Include import include +from AthenaCommon.Constants import VERBOSE,DEBUG +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +import AthenaCommon.CfgMgr as CfgMgr + +# menu components +from TrigUpgradeTest.MenuComponents import HLTRecoSequence, MenuSequence + +# =============================================================================================== +# L2 Calo +# =============================================================================================== + +from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_FastAlgo +theFastCaloAlgo=T2CaloEgamma_FastAlgo("FastCaloAlgo" ) +theFastCaloAlgo.OutputLevel=VERBOSE +theFastCaloAlgo.ClustersName="L2CaloClusters" +svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False + + +from TrigMultiVarHypo.TrigL2CaloRingerFexMTInit import init_ringer +trigL2CaloRingerFexMT = init_ringer() +trigL2CaloRingerFexMT.OutputLevel = DEBUG + + + +from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm + +fastCaloInViewAlgs = seqAND("fastCaloInViewAlgs", [theFastCaloAlgo, trigL2CaloRingerFexMT]) + + + +fastCaloViewsMaker = EventViewCreatorAlgorithm("fastCaloViewsMaker", OutputLevel=DEBUG) +fastCaloViewsMaker.ViewFallThrough = True +fastCaloViewsMaker.RoIsLink = "initialRoI" # -||- +fastCaloViewsMaker.InViewRoIs = "EMCaloRoIs" # contract with the fastCalo +fastCaloViewsMaker.Views = "EMCaloViews" +fastCaloViewsMaker.ViewNodeName = "fastCaloInViewAlgs" +theFastCaloAlgo.RoIs = fastCaloViewsMaker.InViewRoIs + +# are these needed? +CaloViewVerify = CfgMgr.AthViews__ViewDataVerifier("FastCaloViewDataVerifier") +CaloViewVerify.DataObjects = [('TrigRoiDescriptorCollection' , 'StoreGateSvc+fastCaloViewsMaker_InViewRoIs_out')] + + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT +theFastCaloHypo = TrigL2CaloHypoAlgMT("L2CaloHypo") +theFastCaloHypo.OutputLevel = DEBUG +theFastCaloHypo.CaloClusters = theFastCaloAlgo.ClustersName + + +fastCaloSequence = seqAND("fastCaloSequence",[fastCaloViewsMaker, fastCaloInViewAlgs ]) + +fastCalo_HLTSequence = HLTRecoSequence("fastCalo_HLTSequence", + Sequence=fastCaloSequence, + Maker=fastCaloViewsMaker, + Seed="L1EM") + +fastCaloSequence = MenuSequence("egammaCaloStep", + recoSeqList=[fastCalo_HLTSequence], + Hypo=theFastCaloHypo, + HypoToolClassName="TrigL2CaloHypoToolConf") + + + +ViewVerify = CfgMgr.AthViews__ViewDataVerifier("photonViewDataVerifier") +ViewVerify.DataObjects = [('xAOD::TrigEMClusterContainer','StoreGateSvc+L2CaloClusters')] +ViewVerify.OutputLevel = DEBUG + +from TrigEgammaHypo.TrigL2PhotonFexMTConfig import L2PhotonFex_1 +thePhotonFex= L2PhotonFex_1() +thePhotonFex.TrigEMClusterName = theFastCaloAlgo.ClustersName +thePhotonFex.PhotonsName="Photons" +thePhotonFex.OutputLevel=VERBOSE +#thePhotonFex.RoIs="EMIDRoIs" + + + +l2PhotonViewsMaker = EventViewCreatorAlgorithm("l2PhotonViewsMaker", OutputLevel=DEBUG) +l2PhotonViewsMaker.RoIsLink = "roi" +l2PhotonViewsMaker.InViewRoIs = "EMIDRoIs" +#l2PhotonViewsMaker.InViewRoIs = "EMCaloRoIs" +l2PhotonViewsMaker.Views = "EMPhotonViews" +l2PhotonViewsMaker.ViewFallThrough = True +thePhotonFex.RoIs = l2PhotonViewsMaker.InViewRoIs + + +photonInViewAlgs = parOR("photonInViewAlgs", [ViewVerify, thePhotonFex ]) + +l2PhotonViewsMaker.ViewNodeName = "photonInViewAlgs" + + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2PhotonHypoAlgMT +thePhotonHypo = TrigL2PhotonHypoAlgMT() +thePhotonHypo.Photons = thePhotonFex.PhotonsName +thePhotonHypo.RunInView=True +thePhotonHypo.OutputLevel = VERBOSE + +# this needs to be added: +#electronDecisionsDumper = DumpDecisions("electronDecisionsDumper", OutputLevel=DEBUG, Decisions = theElectronHypo.Output ) + + + +photonSequence = seqAND("photonSequence", [l2PhotonViewsMaker, photonInViewAlgs] ) + + +photon_HLTSequence = HLTRecoSequence("photon_HLTSequence", + Maker=l2PhotonViewsMaker, + Sequence=photonSequence, + Seed="L1EM") + +photonSequence = MenuSequence("photonStep", + recoSeqList=[photon_HLTSequence], + Hypo=thePhotonHypo, + HypoToolClassName="TrigL2PhotonHypoToolConf") + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py new file mode 100644 index 0000000000000000000000000000000000000000..cc02501e4d5e82e5b2e07259499b01f03b9ca353 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/photon.menu.py @@ -0,0 +1,64 @@ +# +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# + +include("TrigUpgradeTest/testHLT_MT.py") +# provide a minimal menu information +if globalflags.InputFormat.is_bytestream(): + topSequence.L1DecoderTest.ctpUnpacker.OutputLevel=DEBUG + topSequence.L1DecoderTest.roiUnpackers[0].OutputLevel=DEBUG + +# map L1 decisions for menu +for unpack in topSequence.L1DecoderTest.roiUnpackers: + if unpack.name() is "EMRoIsUnpackingTool": + unpack.Decisions="L1EM" + if unpack.name() is "MURoIsUnpackingTool": + unpack.Decisions="L1MU" + +for unpack in topSequence.L1DecoderTest.rerunRoiUnpackers: + if unpack.name() is "EMRerunRoIsUnpackingTool": + unpack.Decisions="RerunL1EM" + unpack.SourceDecisions="L1EM" + +for unpack in topSequence.L1DecoderTest.rerunRoiUnpackers: + if unpack.name() is "EMRerunRoIsUnpackingTool": + unpack.SourceDecisions="L1EM" + if unpack.name() is "MURerunRoIsUnpackingTool": + unpack.SourceDecisions="L1MU" + + + +########################################## +# menu +########################################## +from TrigUpgradeTest.MenuComponents import Chain, ChainStep +from TrigUpgradeTest.photonMenuDefs import fastCaloSequence, photonSequence + + +photonChains = [ + Chain(name='HLT_g5_etcut', Seed="L1_EM3", \ + ChainSteps=[ ChainStep("Step1_g5_etcut", [fastCaloSequence]), + ChainStep("Step2_g5_etcut", [photonSequence])] ) + ] + +testChains = photonChains +#topSequence.L1DecoderTest.prescaler.Prescales = ["HLT_g5_etcut:2"] + +########################################## +# CF construction +########################################## + +##### Make all HLT ####### +from TrigUpgradeTest.HLTCFConfig import makeHLTTree +makeHLTTree(testChains) + + + +########################################## +# Some debug +########################################## +from AthenaCommon.AlgSequence import dumpSequence +dumpSequence(topSequence) + + + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_photon_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_photon_run_data.sh index a66201f9e6ac9e63446198b99fc8a469efd0ff65..e78fdccb34cb51d37347a4df10c1748e2689e074 100755 --- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_photon_run_data.sh +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_photon_run_data.sh @@ -2,4 +2,4 @@ # art-type: build # art-ci: master -athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/photon.withViews.py +athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/photon.menu.py