diff --git a/Control/AthViews/AthViews/IViewsMergerTool.h b/Control/AthViews/AthViews/IViewsMergerTool.h new file mode 100644 index 0000000000000000000000000000000000000000..b7dd222f3eb850b7dc89cd8caa7b1b128ec44307 --- /dev/null +++ b/Control/AthViews/AthViews/IViewsMergerTool.h @@ -0,0 +1,24 @@ +#ifndef AthViews_IViewsMergerTool_h +#define AthViews_IViewsMergerTool_h + +#include <vector> +#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/EventContext.h" +#include "AthViews/View.h" + +static const InterfaceID IID_IViewsMergerTool( "IViewsMergerTool", 1, 0 ); + +class IViewsMergerTool : public virtual IAlgTool { +public: + static const InterfaceID& interfaceID() { return IID_IViewsMergerTool; } + + /** + * @brief processes views to create merged collection collection of the content + * + **/ + virtual StatusCode merge( const EventContext& context, const std::vector<SG::View*>& ) const = 0; + + virtual ~IViewsMergerTool() {} +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt index 04a187fa93bbd725811040b8139b45eaab938cf6..933fd0f281478a22bf98d8a1f1e15c0c841428c7 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/CMakeLists.txt @@ -43,7 +43,9 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigAlgorithms/TrigCaloRec Trigger/TrigEvent/TrigMissingEtEvent Trigger/TrigEvent/TrigNavigation - Trigger/TrigSteer/DecisionHandling ) + Trigger/TrigSteer/DecisionHandling + Control/AthViews + Control/AthContainers ) # External dependencies: find_package( AIDA ) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoTool.py index 56cb87789e8ad613797a9beaa462b1bccabb34ed..4097991ba8ec323b15024d50298a516489cdb9dc 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoTool.py @@ -26,8 +26,9 @@ def TrigL2CaloHypoToolFromName( name ): tool = TrigL2CaloHypoTool( name ) tool.AcceptAll = False + tool.MonTool = "" from TriggerJobOpts.TriggerFlags import TriggerFlags -# print "monitoring", TriggerFlags.enableMonitoring() + print "monitoring", TriggerFlags.enableMonitoring() if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): @@ -59,9 +60,9 @@ def TrigL2CaloHypoToolFromName( name ): defineHistogram('Wstot', type='TH1F', title="L2Calo Hypo Wstot; E Width in sampling 1", xbins=48, xmin=-0.1, xmax=11.), defineHistogram('F3', type='TH1F', title="L2Calo Hypo F3; E3/(E0+E1+E2+E3)", xbins=96, xmin=-0.1, xmax=1.1) ] - + monTool.HistPath = 'L2CaloHypo/'+tool.name() tool.MonTool = monTool - tool.MonTool.HistPath = 'L2CaloHypo/'+tool.name() + tool += monTool diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py new file mode 100644 index 0000000000000000000000000000000000000000..106baecc626481f78a1bdf71364034709c3eb7fd --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py @@ -0,0 +1,51 @@ + + + +def TrigL2ElectronHypoToolFromName( 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. + """ + assert name.startswith("HLT_e"), "The chain name does not start from HLT_e" + + bname = name.split('_') + threshold = int(bname[1][1:]) + assert str(threshold) == bname[1][1:], "Threshold definition is not a simple int" + from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypoTool + + from TriggerJobOpts.TriggerFlags import TriggerFlags + if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): + from AthenaMonitoring.AthenaMonitoringConf import GenericMonitoringTool + from AthenaMonitoring.DefineHistogram import defineHistogram + monTool = GenericMonitoringTool("MonTool"+name) + monTool.Histograms = [ + defineHistogram('CutCounter', type='TH1I', title="L2Electron Hypo Cut Counter;Cut Counter", xbins=8, xmin=-1.5, xmax=7.5, opt="kCumulative", labels=labelsDescription), + defineHistogram('CaloTrackdEta', type='TH1F', title="L2Electron Hypo #Delta #eta between cluster and track;#Delta #eta;Nevents", xbins=80, xmin=-0.4, xmax=0.4), + defineHistogram('CaloTrackdPhi', type='TH1F', title="L2Electron Hypo #Delta #phi between cluster and track;#Delta #phi;Nevents", xbins=80, xmin=-0.4, xmax=0.4), + defineHistogram('CaloTrackEoverP', type='TH1F', title="L2Electron Hypo E/p;E/p;Nevents", xbins=120, xmin=0, xmax=12), + defineHistogram('PtTrack', type='TH1F', title="L2Electron Hypo p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=50, xmin=0, xmax=100000), + defineHistogram('PtCalo', type='TH1F', title="L2Electron Hypo p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents", xbins=50, xmin=0, xmax=100000), + defineHistogram('CaloEta', type='TH1F', title="L2Electron Hypo #eta^{calo} ; #eta^{calo};Nevents", xbins=200, xmin=-2.5, xmax=2.5), + defineHistogram('CaloPhi', type='TH1F', title="L2Electron Hypo #phi^{calo} ; #phi^{calo};Nevents", xbins=320, xmin=-3.2, xmax=3.2) ] + + tool = TrigL2ElectronHypoTool(name) + from AthenaCommon.SystemOfUnits import GeV + tool.RespectPreviousDecision = False # this is only for testing purpose, this setting & flag will be gone + tool.TrackPt = [ 1.0 * GeV ] + tool.CaloTrackdETA = [ 0.2 ] + tool.CaloTrackdPHI = [ 999. ] + if float(threshold) < 15: + tool.TrackPt = [ 1.0 * GeV ] + elif float(threshold) >= 15 and float(threshold) < 20: + tool.TrackPt = [ 2.0 * GeV ] + elif float(threshold) >= 20 and float(threshold) < 50: + tool.TrackPt = [ 3.0 * GeV ] + elif float(threshold) >= 50: + tool.TrackPt = [ 5.0 * GeV ] + tool.CaloTrackdETA = [ 999. ] + tool.CaloTrackdPHI = [ 999. ] + else: + raise RuntimeError('No threshold: Default cut configured') + return tool + +if __name__ == "__main__": + tool = TrigL2ElectronHypoToolFromName("HLT_e4") diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.cxx index 2504ae21340f6a14ba49c345a27fd7f490a52648..b382273c70ff11ceda5f4afbcc56c0a6ba9860c1 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.cxx @@ -9,17 +9,7 @@ using namespace TrigCompositeUtils; TrigL2CaloHypoAlg::TrigL2CaloHypoAlg( const std::string& name, ISvcLocator* pSvcLocator ) : - ::AthReentrantAlgorithm( name, pSvcLocator ), - m_hypoTools( this ), - m_clustersKey( "CaloClusters" ), - m_roisKey( "RoIs" ), - m_decisionsKey( "CaloHypoDecisions" ) { - - declareProperty( "HypoTools", m_hypoTools ); - declareProperty( "CaloClusters", m_clustersKey ); - declareProperty( "RoIs", m_roisKey ); - declareProperty( "Decisions", m_decisionsKey ); -} + ::AthReentrantAlgorithm( name, pSvcLocator ) {} TrigL2CaloHypoAlg::~TrigL2CaloHypoAlg() {} @@ -28,8 +18,15 @@ StatusCode TrigL2CaloHypoAlg::initialize() { ATH_MSG_INFO ( "Initializing " << name() << "..." ); CHECK( m_hypoTools.retrieve() ); + + CHECK( m_viewsKey.initialize() ); + + renounce( m_clustersKey ); CHECK( m_clustersKey.initialize() ); + + renounce( m_roisKey ); CHECK( m_roisKey.initialize() ); + CHECK( m_decisionsKey.initialize() ); return StatusCode::SUCCESS; } @@ -44,43 +41,50 @@ StatusCode TrigL2CaloHypoAlg::finalize() StatusCode TrigL2CaloHypoAlg::execute_r( const EventContext& context ) const { ATH_MSG_DEBUG ( "Executing " << name() << "..." ); - auto clustersHandle = SG::makeHandle( m_clustersKey, context ); - auto roisHandle = SG::makeHandle( m_roisKey, context ); + auto viewsHandle = SG::makeHandle( m_viewsKey, context ); auto decisions = std::make_unique<DecisionContainer>(); auto aux = std::make_unique<DecisionAuxContainer>(); decisions->setStore( aux.get() ); - // prepare decision storage ( we could simplify it ) + + std::vector<TrigL2CaloHypoTool::Input> toolInput; + // exploit knowledge that there is one cluster in the view size_t counter = 0; - for ( auto clusterIter = clustersHandle->begin(); clusterIter != clustersHandle->end(); ++clusterIter, ++counter ) { + for ( auto view: *viewsHandle ) { auto d = newDecisionIn( decisions.get() ); - d->setObjectLink( "feature", ElementLink<xAOD::TrigEMClusterContainer>( m_clustersKey.key(), counter ) ); - d->setObjectLink( "roi", ElementLink<TrigRoiDescriptorCollection>( m_roisKey.key(), counter ) ); - } - - - size_t index = 0; - for ( ; index < decisions->size(); ++index ) { + + auto roiHandle = SG::makeHandle( m_roisKey, context ); + CHECK( roiHandle.setProxyDict( view ) ); - auto cluster = clustersHandle->at( index ); - auto roi = roisHandle->at( index ); - auto decision = decisions->at( index ); + auto clusterHandle = SG::makeHandle( m_clustersKey, context ); + CHECK( clusterHandle.setProxyDict( view ) ); + + toolInput.emplace_back( d, roiHandle.cptr()->at(0), clusterHandle.cptr()->at(0) ); - for ( auto tool : m_hypoTools ) { - // interface of the tool needs to be suitable for current system, so no TrigComposite - // also no support for the multi-electrons yet ( will be additional method ) - if ( tool->decide( cluster, roi ) ) { - addDecisionID( tool->decisionId(), decision ); - ATH_MSG_DEBUG( " + " << tool->name() ); - } else { - ATH_MSG_DEBUG( " - " << tool->name() ); - } + { + auto el = ElementLink<xAOD::TrigEMClusterContainer>( view->name()+"_"+clusterHandle.key(), 0 ); // 0 because there is only one obj in per-view collection + CHECK( el.isValid() ); + d->setObjectLink( "feature", el ); } - + { + auto el = ElementLink<TrigRoiDescriptorCollection>( view->name()+"_"+m_roisKey.key(), 0 ); + CHECK( el.isValid() ); + d->setObjectLink( "roi", el ); + } + { + auto el = ElementLink< std::vector<SG::View*> >( m_viewsKey.key(), counter ); + CHECK( el.isValid() ); + d->setObjectLink( "view", el ); + } + } + + for ( auto& tool: m_hypoTools ) { + CHECK( tool->decide( toolInput ) ); } + { auto handle = SG::makeHandle( m_decisionsKey, context ); CHECK( handle.record( std::move( decisions ), std::move( aux ) ) ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.h index a710e5c26714ddcb148d35b8116b6bf6a1be1464..92b6069138059dfaf03bb0628b5a180162e394ad 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlg.h @@ -7,6 +7,7 @@ #include <string> #include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthViews/View.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" #include "xAODTrigCalo/TrigEMClusterContainer.h" #include "DecisionHandling/TrigCompositeUtils.h" @@ -33,10 +34,12 @@ class TrigL2CaloHypoAlg private: TrigL2CaloHypoAlg(); - ToolHandleArray< TrigL2CaloHypoTool > m_hypoTools; - SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_clustersKey; - SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roisKey; - SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_decisionsKey; + ToolHandleArray< TrigL2CaloHypoTool > m_hypoTools { this, "HypoTools", {}, "Hypo tools" }; + + SG::ReadHandleKey< std::vector< SG::View* > > m_viewsKey { this, "Views", "Unspecified", "Input Views" }; + SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_clustersKey { this, "CaloClusters", "CaloClusters", "CaloClusters in view" }; + SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roisKey { this, "RoIs", "RoIs", "RoIs key in the view" }; + SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_decisionsKey { this, "Decisions", "Unspecified", "Decisions" }; }; diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx index 8d994c907ef338642ed66eccce0c59f6658a7c41..753a61a3008eec2b7bf5cee0a0fdba972fb2ed15 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx @@ -13,26 +13,7 @@ TrigL2CaloHypoTool::TrigL2CaloHypoTool( const std::string& type, const std::string& name, const IInterface* parent ) : AthAlgTool( type, name, parent ), - m_id( name ), - m_monTool( "GenericMonitoringTool/MOnTool", this ) -{ - declareProperty( "AcceptAll", m_acceptAll=true ); - declareProperty( "EtaBins", m_etabin ); - declareProperty( "ETthr", m_eTthr ); - declareProperty( "ET2thr", m_eT2thr ); - declareProperty( "HADETthr", m_hadeTthr ); - declareProperty( "HADET2thr", m_hadeT2thr ); - declareProperty( "CARCOREthr", m_carcorethr ); - declareProperty( "CAERATIOthr", m_caeratiothr ); - declareProperty( "dETACLUSTERthr", m_detacluster=0.2 ); - declareProperty( "dPHICLUSTERthr", m_dphicluster=0.2 ); - declareProperty( "F1thr", m_F1thr ); - declareProperty( "WETA2thr", m_WETA2thr ); - declareProperty( "WSTOTthr", m_WSTOTthr ); - declareProperty( "F3thr", m_F3thr ); - - declareProperty( "MonTool", m_monTool=ToolHandle<GenericMonitoringTool>( "", this ) ); -} + m_decisionId( name ) {} StatusCode TrigL2CaloHypoTool::initialize() { ATH_MSG_DEBUG( "Initialization completed successfully" ); @@ -54,52 +35,25 @@ StatusCode TrigL2CaloHypoTool::initialize() { } unsigned int nEtaBin=m_etabin.size(); - if ( m_eTthr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " etThr size is " << m_eTthr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } - - if ( m_eT2thr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " et2Thr size is " << m_eT2thr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } - - if ( m_hadeTthr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " hadetThr size is " << m_hadeTthr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } - - if ( m_hadeT2thr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " hadet2Thr size is " << m_hadeT2thr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } - - if ( m_carcorethr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " carcore size is " << m_carcorethr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } - - if ( m_caeratiothr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " caeratio size is " << m_caeratiothr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } +#define CHECK_SIZE( __n) if ( m_##__n.size() != nEtaBin - 1 ) \ + { ATH_MSG_DEBUG(" __n size is " << m_##__n.size() << " but needs to be " << nEtaBin - 1 ); \ + return StatusCode::FAILURE; } - if ( m_WETA2thr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " Weta2 size is " << m_WETA2thr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } + CHECK_SIZE( eTthr ); + CHECK_SIZE( eT2thr ); + CHECK_SIZE( hadeTthr ); + CHECK_SIZE( hadeT2thr ); + CHECK_SIZE( carcorethr ); + CHECK_SIZE( caeratiothr ); + CHECK_SIZE( WETA2thr ); + CHECK_SIZE( WSTOTthr ); + CHECK_SIZE( F3thr ); - if ( m_WSTOTthr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " Wstot size is " << m_WSTOTthr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } + ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId ); - if ( m_F3thr.size() != nEtaBin-1 ) { - ATH_MSG_ERROR( " Wstot size is " << m_WSTOTthr.size() << " but needs " << nEtaBin-1 ); - return StatusCode::FAILURE; - } + if ( not m_monTool.name().empty() ) + CHECK( m_monTool.retrieve() ); - ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_id ); return StatusCode::SUCCESS; } @@ -111,12 +65,13 @@ TrigL2CaloHypoTool::~TrigL2CaloHypoTool() {} -bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRoiDescriptor* roiDescriptor ) const { +bool TrigL2CaloHypoTool::singleObjectDecision( const Input& input, int selectionIndex ) const { + bool pass = false; using namespace Monitored; // TB Not sure if anything else than the CutCounter should monitored it in every cut tool, - // Should be the quantity filled after the succesful selection? + // Should quantitities be filled only after the succesful selection? auto dEta = MonitoredScalar::declare( "dEta", -1. ); auto dPhi = MonitoredScalar::declare( "dPhi", -1. ); @@ -132,12 +87,13 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo auto Wstot = MonitoredScalar::declare( "Wstot" , -1.0 ); auto F3 = MonitoredScalar::declare( "F3" , -1.0 ); auto PassedCuts = MonitoredScalar::declare<int>( "CutCounter", -1 ); - auto monitorIt = MonitoredScope::declare( m_monTool, - dEta, dPhi, eT_T2Calo, hadET_T2Calo, - rCore, energyRatio, etaBin, monEta, - monPhi, F1, Weta2, Wstot, F3, PassedCuts ); + auto monitorIt = MonitoredScope::declare( m_monTool, + dEta, dPhi, eT_T2Calo, hadET_T2Calo, + rCore, energyRatio, etaBin, monEta, + monPhi, F1, Weta2, Wstot, F3, PassedCuts ); // when leaving scope it will ship data to monTool PassedCuts = PassedCuts + 1; //got called (data in place) + if ( m_acceptAll ) { pass = true; ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" ); @@ -145,7 +101,8 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo pass = false; ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" ); } - + auto roiDescriptor = input.roi; + if ( fabs( roiDescriptor->eta() ) > 2.6 ) { ATH_MSG_DEBUG( "The cluster had eta coordinates beyond the EM fiducial volume : " << roiDescriptor->eta() << "; stop the chain now" ); @@ -153,9 +110,9 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo return pass; } - ATH_MSG_DEBUG( "; RoI ID = " << roiDescriptor->roiId() - << ": Eta = " << roiDescriptor->eta() - << ", Phi = " << roiDescriptor->phi() ); + ATH_MSG_DEBUG( "; RoI ID = " << roiDescriptor->roiId() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() ); // fill local variables for RoI reference position double etaRef = roiDescriptor->eta(); @@ -163,6 +120,8 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo // correct phi the to right range ( probably not needed anymore ) if ( fabs( phiRef ) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range + + auto pClus = input.cluster; float absEta = fabs( pClus->eta() ); etaBin = -1; @@ -171,6 +130,7 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo for ( std::size_t iBin = 0; iBin < m_etabin.size()-1; iBin++ ) if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; + const size_t etaIndex = etaBin + ( m_etabin.size()/m_multiplicity ) * selectionIndex; // find if electron is in calorimeter crack bool inCrack = ( absEta > 2.37 || ( absEta > 1.37 && absEta < 1.52 ) ); @@ -213,16 +173,16 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo // apply cuts: DeltaEta( clus-ROI ) ATH_MSG_DEBUG( "TrigEMCluster: eta=" << pClus->eta() - << " roi eta=" << etaRef << " DeltaEta=" << dEta - << " cut: <" << m_detacluster ); + << " roi eta=" << etaRef << " DeltaEta=" << dEta + << " cut: <" << m_detacluster ); if ( fabs( pClus->eta() - etaRef ) > m_detacluster ) return pass; PassedCuts = PassedCuts + 1; //Deta // DeltaPhi( clus-ROI ) ATH_MSG_DEBUG( ": phi=" << pClus->phi() - << " roi phi="<< phiRef << " DeltaPhi="<< dPhi - << " cut: <" << m_dphicluster ); + << " roi phi="<< phiRef << " DeltaPhi="<< dPhi + << " cut: <" << m_dphicluster ); if( dPhi > m_dphicluster ) return pass; PassedCuts = PassedCuts + 1; //DPhi @@ -232,41 +192,41 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo ATH_MSG_DEBUG( "Cluster eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] ); return pass; } else { - ATH_MSG_DEBUG( "eta bin used for cuts " << etaBin ); + ATH_MSG_DEBUG( "eta bin used for cuts " << etaIndex ); } PassedCuts = PassedCuts + 1; // passed eta cut // Rcore ATH_MSG_DEBUG ( "TrigEMCluster: Rcore=" << rCore - << " cut: >" << m_carcorethr[etaBin] ); - if ( rCore < m_carcorethr[etaBin] ) return pass; + << " cut: >" << m_carcorethr[etaIndex] ); + if ( rCore < m_carcorethr[etaIndex] ) return pass; PassedCuts = PassedCuts + 1; //Rcore // Eratio - ATH_MSG_DEBUG( " cut: >" << m_caeratiothr[etaBin] ); + ATH_MSG_DEBUG( " cut: >" << m_caeratiothr[etaIndex] ); if ( inCrack || F1 < m_F1thr[0] ) { ATH_MSG_DEBUG ( "TrigEMCluster: InCrack= " << inCrack << " F1=" << F1 ); } else { - if ( energyRatio < m_caeratiothr[etaBin] ) return pass; + if ( energyRatio < m_caeratiothr[etaIndex] ) return pass; } PassedCuts = PassedCuts + 1; //Eratio if( inCrack ) energyRatio = -1; //Set default value in crack for monitoring. // ET_em - ATH_MSG_DEBUG( "TrigEMCluster: ET_em=" << eT_T2Calo << " cut: >" << m_eTthr[etaBin] ); - if ( eT_T2Calo < m_eTthr[etaBin] ) return pass; + ATH_MSG_DEBUG( "TrigEMCluster: ET_em=" << eT_T2Calo << " cut: >" << m_eTthr[etaIndex] ); + if ( eT_T2Calo < m_eTthr[etaIndex] ) return pass; PassedCuts = PassedCuts + 1; // ET_em float hadET_cut = 0.0; // find which ET_had to apply : this depends on the ET_em and the eta bin - if ( eT_T2Calo > m_eT2thr[etaBin] ) { - hadET_cut = m_hadeT2thr[etaBin] ; + if ( eT_T2Calo > m_eT2thr[etaIndex] ) { + hadET_cut = m_hadeT2thr[etaIndex] ; - ATH_MSG_DEBUG ( "ET_em>" << m_eT2thr[etaBin] << ": use high ET_had cut: <" << hadET_cut ); + ATH_MSG_DEBUG ( "ET_em>" << m_eT2thr[etaIndex] << ": use high ET_had cut: <" << hadET_cut ); } else { - hadET_cut = m_hadeTthr[etaBin]; + hadET_cut = m_hadeTthr[etaIndex]; - ATH_MSG_DEBUG ( "ET_em<" << m_eT2thr[etaBin] << ": use low ET_had cut: <" << hadET_cut ); + ATH_MSG_DEBUG ( "ET_em<" << m_eT2thr[etaIndex] << ": use low ET_had cut: <" << hadET_cut ); } // ET_had @@ -282,22 +242,21 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo //Weta2 - ATH_MSG_DEBUG ( "TrigEMCluster: Weta2=" << Weta2 << " cut: <" << m_WETA2thr[etaBin] ); - if ( Weta2 > m_WETA2thr[etaBin] ) return pass; + ATH_MSG_DEBUG ( "TrigEMCluster: Weta2=" << Weta2 << " cut: <" << m_WETA2thr[etaIndex] ); + if ( Weta2 > m_WETA2thr[etaIndex] ) return pass; PassedCuts = PassedCuts + 1; //Weta2 //Wstot - ATH_MSG_DEBUG ( "TrigEMCluster: Wstot=" <<Wstot << " cut: <" << m_WSTOTthr[etaBin] ); - if ( Wstot >= m_WSTOTthr[etaBin] ) return pass; + ATH_MSG_DEBUG ( "TrigEMCluster: Wstot=" <<Wstot << " cut: <" << m_WSTOTthr[etaIndex] ); + if ( Wstot >= m_WSTOTthr[etaIndex] ) return pass; PassedCuts = PassedCuts + 1; //Wstot //F3 - ATH_MSG_DEBUG( "TrigEMCluster: F3=" << F3 << " cut: <" << m_F3thr[etaBin] ); - if ( F3 > m_F3thr[etaBin] ) return pass; + ATH_MSG_DEBUG( "TrigEMCluster: F3=" << F3 << " cut: <" << m_F3thr[etaIndex] ); + if ( F3 > m_F3thr[etaIndex] ) return pass; PassedCuts = PassedCuts + 1; //F3 - // got this far => passed! pass = true; @@ -307,3 +266,15 @@ bool TrigL2CaloHypoTool::decide( const xAOD::TrigEMCluster* pClus, const TrigRo return pass; } + +StatusCode TrigL2CaloHypoTool::decide( std::vector<Input>& input ) const { + + if ( m_multiplicity == 1 ) { + for ( auto& i: input ) { + if ( singleObjectDecision( i ) ) { + TrigCompositeUtils::addDecisionID( m_decisionId, i.decision ); + } + } + } + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.h index 84b2ad48fa59ed7dddc536502eb838d7776fcba4..50a84c9dc45ca9ca537e34d11a474d4af0e06986 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.h @@ -27,6 +27,8 @@ class TrigL2CaloHypoTool : virtual public ::AthAlgTool { public: + + TrigL2CaloHypoTool( const std::string& type, const std::string& name, const IInterface* parent ); @@ -37,39 +39,47 @@ class TrigL2CaloHypoTool static const InterfaceID& interfaceID(); - TrigCompositeUtils::DecisionID decisionId() const { - return m_id.numeric(); - } + struct Input { + Input(TrigCompositeUtils::Decision* d, const TrigRoiDescriptor* r, const xAOD::TrigEMCluster* c) + : decision(d), roi(r), cluster(c) {} + TrigCompositeUtils::Decision* decision; + const TrigRoiDescriptor* roi; + const xAOD::TrigEMCluster* cluster; + }; /** - * @brief decides upon a single object + * @brief decides upon all clusters * Note it is for a reason a non-virtual method, it is an interface in gaudi sense and implementation. * There will be many tools called often to perform this quick operation and we do not want to pay for polymorphism which we do not need to use. + * Will actually see when N obj hypos will enter the scene **/ - bool decide( const xAOD::TrigEMCluster* cluster, const TrigRoiDescriptor* roi ) const; + StatusCode decide( std::vector<Input>& input ) const; private: - HLT::Identifier m_id; - + HLT::Identifier m_decisionId; - //Calorimeter electron ID cuts - std::vector<float> m_etabin; //!< selection variable for L2 calo selection:eta bins - std::vector<float> m_eTthr; - std::vector<float> m_eT2thr; - std::vector<float> m_hadeTthr; - std::vector<float> m_hadeT2thr; - std::vector<float> m_carcorethr; - std::vector<float> m_caeratiothr; - std::vector<float> m_F1thr; - std::vector<float> m_WETA2thr; - std::vector<float> m_WSTOTthr; - std::vector<float> m_F3thr; - float m_detacluster; - float m_dphicluster; - bool m_acceptAll; + bool singleObjectDecision( const Input& i, int selectionIndex = 0 ) const; + - ToolHandle<GenericMonitoringTool> m_monTool; + //Calorimeter electron ID cuts + Gaudi::Property< std::vector<float> > m_etabin { this, "EtaBins", {} , "Bins of eta" }; //!< selection variable for L2 calo selection:eta bins + Gaudi::Property< std::vector<float> > m_eTthr { this, "ETthr", {}, "ET Threshold" }; + Gaudi::Property< std::vector<float> > m_eT2thr { this, "ET2thr", {}, "Second layer ET threshold" }; + Gaudi::Property< std::vector<float> > m_hadeTthr { this, "HADETthr", {}, "" }; + Gaudi::Property< std::vector<float> > m_hadeT2thr { this, "HADET2thr", {}, "" }; + Gaudi::Property< std::vector<float> > m_carcorethr { this, "CARCOREthr", {}, "" }; + Gaudi::Property< std::vector<float> > m_caeratiothr { this, "CAERATIOthr", {}, "" }; + Gaudi::Property< std::vector<float> > m_F1thr { this, "F1thr", {}, "" }; + Gaudi::Property< std::vector<float> > m_WETA2thr { this, "WETA2thr", {}, "" }; + Gaudi::Property< std::vector<float> > m_WSTOTthr { this, "WSTOTthr", {}, "" }; + Gaudi::Property< std::vector<float> > m_F3thr { this, "F3thr", {}, "" }; + Gaudi::Property< float > m_detacluster { this, "dETACLUSTERthr", 0. , "" }; + Gaudi::Property< float > m_dphicluster { this, "dPHICLUSTERthr", 0. , "" }; + Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", false , "Ignore selection" }; + Gaudi::Property< int > m_multiplicity { this, "Multiplicity", 1, "Multiplicity, when >1 all the cuts need to be duplicated" }; + + ToolHandle<GenericMonitoringTool> m_monTool { this, "MonTool", "GenericMonitoringTool/MonTool", "Monitoring tool" }; }; inline const InterfaceID& TrigL2CaloHypoTool::interfaceID() diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx index 1d7bd442a9fc4a33c799286289a1e8bd346df2ca..3749267d4d52da9c9ef1f56523c1ea9fa5cedad8 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx @@ -61,7 +61,7 @@ TrigL2ElectronFexMT::TrigL2ElectronFexMT(const std::string & name, ISvcLocator* declareProperty("ElectronsName", m_outputElectronsKey = std::string("Electrons"), "Electron container"); - declareProperty("roiCollectionName", + declareProperty("RoIs", m_roiCollectionKey = std::string("rois"), "RoI Collection"); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx index 45865f3898249729a73d14253ff1a24443fd0dc0..59e4c1e04ae358a7dbabd91fb96b85b6704dbd7d 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx @@ -124,7 +124,9 @@ bool TrigL2ElectronHypoTool::decideOnSingleObject( const xAOD::TrigElectron* ele StatusCode TrigL2ElectronHypoTool::inclusiveSelection( std::vector<Input>& input ) const { for ( auto i: input ) { - if ( i.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) continue; // the decision was negative or not even made in previous stage + if ( m_respectPreviousDecision + and ( i.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) ) continue; // the decision was negative or not even made in previous stage + auto objDecision = decideOnSingleObject( i.electron, 0); if ( objDecision == true ) { addDecisionID( m_decisionId.numeric(), i.decision ); @@ -148,6 +150,9 @@ StatusCode TrigL2ElectronHypoTool::multiplicitySelection( std::vector<Input>& in for ( size_t cutIndex = 0; cutIndex < m_multiplicity; ++ cutIndex ) { size_t elIndex; for ( auto elIter = input.begin(); elIter != input.end(); ++elIter, ++elIndex ) { + if ( m_respectPreviousDecision + and ( elIter->previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) ) continue; + if ( decideOnSingleObject( elIter->electron, cutIndex ) ) passingSelection[cutIndex].push_back( elIndex ); } @@ -163,8 +168,9 @@ StatusCode TrigL2ElectronHypoTool::multiplicitySelection( std::vector<Input>& in if ( m_decisionPerCluster ) { // additional constrain has to be applied for each combination // from each combination we extract set of clustusters associated to it - // if all are distinct then size of the set shoudl be == size of combination, + // if all are distinct then size of the set should be == size of combination, // if size of clusters is smaller then the combination consists of electrons from the same RoI + // and ought to be ignored auto notFromSameRoI = [&](const HLT::Index1DVec& comb ) { std::set<const xAOD::TrigEMCluster*> setOfClusters; for ( auto index: comb ) { @@ -181,10 +187,8 @@ StatusCode TrigL2ElectronHypoTool::multiplicitySelection( std::vector<Input>& in return markPassing( input, passingIndices ); } - StatusCode TrigL2ElectronHypoTool::decide( std::vector<Input>& input ) const{ - - // handle simples and most common case ( multiplicity == 1 ) in easiest possible manner + // handle the simplest and most common case ( multiplicity == 1 ) in easiest possible manner if ( m_trackPt.size() == 1 ) { return inclusiveSelection( input ); @@ -192,7 +196,6 @@ StatusCode TrigL2ElectronHypoTool::decide( std::vector<Input>& input ) const{ return multiplicitySelection( input ); } - return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h index 0418e2cf8dd8c4946f286118bda9f79eb35af649..e40302c93fe2641c58fa7b1c4e9fe98d33a871d3 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h @@ -80,6 +80,7 @@ class TrigL2ElectronHypoTool HLT::Identifier m_decisionId; Gaudi::Property<bool> m_decisionPerCluster{ this, "DecisionPerCluster", true, "Is multiplicity requirement refering to electrons (false) or RoIs/clusters with electrons (false), relevant only in when multiplicity > 1" }; + 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< std::vector<float> > m_trackPt{ this, "TrackPt", 5.0*CLHEP::GeV, "Track pT requirement (separate threshold for each electron)" }; Gaudi::Property< std::vector<float> > m_caloTrackDEta{ this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }; //loose cut @@ -88,9 +89,10 @@ class TrigL2ElectronHypoTool Gaudi::Property< std::vector<float> > m_caloTrackdEoverPHigh{ this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" }; Gaudi::Property< std::vector<float> > m_trtRatio{ this, "TRTRatio", 0, "TRT HT ratio" }; + size_t m_multiplicity = 1; - ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool", "GenericMonitoringTool/MOnTool", "Monitoring tool"}; + ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool", "GenericMonitoringTool/MonTool", "Monitoring tool"}; }; inline const InterfaceID& TrigL2ElectronHypoTool::interfaceID() diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h index 662917a2557c96a4264c43480384a210735822a7..ab14c500080644422497236130b8d1e7da2e1d25 100644 --- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h @@ -42,7 +42,8 @@ public: /** * @brief numeric ID **/ - unsigned numeric() const { return m_id; } + inline unsigned numeric() const { return m_id; } + inline operator unsigned () const { return numeric(); } /** * @brief comparisons, for containers of identifiers **/ diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h index 0f15777328ad6974c5f9866d96bc3067a2a12a0c..7f41320f4980748fb2331a00e43a7e0e6f6dd2df 100644 --- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h @@ -60,9 +60,13 @@ namespace TrigCompositeUtils { /** * @brief Extracts DecisionIDs stored in the Decsion object **/ - void decisionIDs(const Decision* d, DecisionIDContainer& id ); - + void decisionIDs( const Decision* d, DecisionIDContainer& id ); + /** + * @brief return true if thre is no positive decision stored + **/ + bool allFailed( const Decision* d ); + /** * @brief Checks if any of the DecisionIDs passed in arg required is availble in Decision object **/ diff --git a/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx index ef257e0565174a4145c586dcf41a229379c4900a..4d2c911655ca7e4c74acef9d25df65077d1da67d 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/TrigCompositeUtils.cxx @@ -42,6 +42,11 @@ namespace TrigCompositeUtils { destination.insert( decisions.begin(), decisions.end() ); } + bool allFailed( const Decision* d ) { + const std::vector<int>& decisions = readOnlyAccessor( *d ); + return decisions.empty(); + } + bool passingIDs( const Decision* d, const DecisionIDContainer& required ) { for ( auto id : readOnlyAccessor( *d ) ) { if ( required.count( id ) > 0 ) diff --git a/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx index 865348ddf132c796b4f8c8824f57ec5b6bf686e3..06285d05aaf16d5f567f942e5d9eecf592df47dc 100644 --- a/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/CTPUnpackingTool.cxx @@ -22,7 +22,15 @@ CTPUnpackingTool::~CTPUnpackingTool() StatusCode CTPUnpackingTool::initialize() { if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() ); - return decodeCTPToChainMapping(); + CHECK( decodeCTPToChainMapping() ); + if ( m_ctpToChain.empty() ) { + ATH_MSG_WARNING( "Empty CTP to chains mapping " ); + ATH_MSG_WARNING( "Property confoguring it: " << m_ctpToChainProperty ); + } + for ( auto m: m_ctpToChain ) { + ATH_MSG_INFO( "Mapping of CTP bit: " << m.first << " to chains " << m.second ); + } + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx index 8f57fcab903683fea22e15dd36901dd75435b878..bd0ffa3c9ed7b927c271363a9f712800dbb40a1a 100644 --- a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx @@ -45,23 +45,43 @@ StatusCode EMRoIsUnpackingTool::initialize() { ATH_MSG_ERROR( "Failed to decode threshold to chains mapping, is the format th : chain?" ); return StatusCode::FAILURE; } + if ( m_thresholdToChainMapping.empty() ) { + ATH_MSG_WARNING( "None of the chains configured to require EM thresholds" ); + ATH_MSG_WARNING( "The property configuring that is: " << m_thresholdToChainProperty ); + } + for ( auto el: m_thresholdToChainMapping ) { + ATH_MSG_INFO( "Threshold " << el.first << " mapped to chains " << el.second ); + } + + return StatusCode::SUCCESS; } StatusCode EMRoIsUnpackingTool::updateConfiguration() { using namespace TrigConf; + m_emThresholds.clear(); + const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); auto filteredThresholds= thresholdConfig->getThresholdVector( L1DataDef::EM ); ATH_MSG_DEBUG( "Number of filtered thresholds " << filteredThresholds.size() ); for ( auto th : filteredThresholds ) { if ( th != nullptr ) { - ATH_MSG_DEBUG( "Found threshold in the configuration: " << th->name() << " of ID: " << HLT::Identifier( th->name() ).numeric() ); + ATH_MSG_INFO( "Found threshold in the configuration: " << th->name() << " of ID: " << HLT::Identifier( th->name() ).numeric() ); m_emThresholds.push_back( th ); } else { ATH_MSG_DEBUG( "Nullptr to the threshold" ); } } + + if ( m_emThresholds.empty() ) { + ATH_MSG_WARNING( "No EM thresholds configured" ); + } else { + ATH_MSG_INFO( "Configured " << m_emThresholds.size() << " thresholds" ); + } + + + return StatusCode::SUCCESS; } @@ -112,6 +132,7 @@ StatusCode EMRoIsUnpackingTool::unpack( const EventContext& ctx, } } + // TODO would be nice to have this. Requires modifying the TC class: decision->setDetail( "Thresholds", passedThresholds ); // record passing threshold names ( for easy debugging ) decision->setObjectLink( "initialRoI", ElementLink<TrigRoiDescriptorCollection>( m_trigRoIsKey.key(), trigRoIs->size()-1 ) ); decision->setObjectLink( "initialRecRoI", ElementLink<DataVector<LVL1::RecEmTauRoI>>( m_recRoIsKey.key(), recRoIs->size()-1 ) ); @@ -129,7 +150,7 @@ StatusCode EMRoIsUnpackingTool::unpack( const EventContext& ctx, MonitoredScope::declare( m_monTool, RoIsCount, RoIsEta, RoIsPhi ); } - ATH_MSG_DEBUG( "Unpackked " << trigRoIs->size() << " RoIs" ); + ATH_MSG_DEBUG( "Unpacked " << trigRoIs->size() << " RoIs" ); // recording { SG::WriteHandle<TrigRoiDescriptorCollection> handle( m_trigRoIsKey, ctx ); diff --git a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx index 0bb5a9fe74e3a2af6790e7d5a95e5a59948a3a32..35cb6c3d9318d2af0342dd70e126b26df4ceef24 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx @@ -30,14 +30,15 @@ StatusCode L1Decoder::initialize() { CHECK( m_roiUnpackers.retrieve() ); // CHECK( m_prescaler.retrieve() ); + // this code should be in th ebeginRun but the later does not seem to be called + for ( auto t: m_roiUnpackers ) + CHECK( t->updateConfiguration() ); return StatusCode::SUCCESS; } StatusCode L1Decoder::beginRun() { - for ( auto t: m_roiUnpackers ) - CHECK( t->updateConfiguration() ); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt index 8bc50dc12b5839c725857dd131ac9e16a51db270..36220443e49e1f8e260bef13b1f95998efc1657a 100644 --- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt +++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt @@ -11,6 +11,8 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel Control/AthContainers Control/AthLinks + Event/xAOD/xAODTrigCalo + Event/xAOD/xAODTrigEgamma PRIVATE Control/AthViews Control/StoreGate @@ -18,15 +20,15 @@ atlas_depends_on_subdirs( PUBLIC Control/CxxUtils Trigger/TrigConfiguration/TrigConfHLTData Trigger/TrigEvent/TrigSteeringEvent - Trigger/TrigSteer/L1Decoder ) + Trigger/TrigSteer/DecisionHandling ) # Component(s) in the package: atlas_add_library( ViewAlgsLib src/*.cxx PUBLIC_HEADERS ViewAlgs - LINK_LIBRARIES xAODTrigger GaudiKernel AthViews - PRIVATE_LINK_LIBRARIES AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent ) + LINK_LIBRARIES xAODTrigger GaudiKernel AthViews xAODTrigCalo xAODTrigEgamma + PRIVATE_LINK_LIBRARIES AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent DecisionHandlingLib ) atlas_add_component( ViewAlgs src/components/*.cxx - LINK_LIBRARIES xAODTrigger GaudiKernel AthViews AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent ViewAlgsLib ) + LINK_LIBRARIES xAODTrigger GaudiKernel AthViews AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent ViewAlgsLib DecisionHandlingLib ) diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b2f3f80c2c23e68d5fee9d874051828dc72f6f5c --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx @@ -0,0 +1,104 @@ +/* + General-purpose view creation algorithm <bwynne@cern.ch> + + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "./EventViewCreatorAlgorithm.h" + +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "CxxUtils/make_unique.h" +#include "AthContainers/ConstDataVector.h" +#include "AthViews/ViewHelper.h" + + +EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) + : AthAlgorithm( name, pSvcLocator ) { +} + +StatusCode EventViewCreatorAlgorithm::initialize() +{ + CHECK( m_inputDecisionsKey.initialize() ); + CHECK( m_viewsKey.initialize() ); + + renounce( m_inViewRoIs ); + CHECK( m_inViewRoIs.initialize() ); + renounce( m_inViewDecisions ); + CHECK( m_inViewDecisions.initialize() ); + + // CHECK( m_viewAlgorithmsPool.retrieve() ); + + return StatusCode::SUCCESS; +} + +StatusCode EventViewCreatorAlgorithm::execute() +{ +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT + const EventContext& ctx = getContext(); +#else + const EventContext& ctx = *getContext(); +#endif + + auto inputDecisions = SG::makeHandle( m_inputDecisionsKey ); + + auto viewVector = std::make_unique<std::vector<SG::View*>>(); + auto contexts = std::vector<EventContext>( ); + + unsigned int viewCounter = 0; + unsigned int conditionsRun = getContext().getExtension<Atlas::ExtendedEventContext>()->conditionsRun(); + + const TrigRoiDescriptor* previousRoI = 0; + + ATH_MSG_DEBUG( "Preparing " << inputDecisions.cptr()->size() << " views" ); + + + for ( auto decision: *inputDecisions ) { + if ( TrigCompositeUtils::allFailed( decision ) ) { + ATH_MSG_DEBUG( "Skipping, as all decisions are negative" ); + continue; + } + ATH_MSG_DEBUG( "Positive decisions on RoI, peparing view" ); + // pull RoI descriptor + CHECK( decision->hasObjectLink( m_roisLink ) ); + auto roiDescriptorEL = decision->objectLink<TrigRoiDescriptorCollection>( m_roisLink ); + CHECK( roiDescriptorEL.isValid() ); + + auto roiDescriptor = *roiDescriptorEL; + ATH_MSG_DEBUG( "Placing TrigRoiDescriptor " << *roiDescriptor ); + + if ( previousRoI == roiDescriptor ) continue; + // TODO here code supporting the case wnen we haev many decisions associated to a single RoI needs to be added + previousRoI = roiDescriptor; + + auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >(); + oneRoIColl->clear( SG::VIEW_ELEMENTS ); //Don't delete the RoIs + oneRoIColl->push_back( roiDescriptor ); + + // make the view + viewVector->push_back( ViewHelper::makeView( name()+"_view", viewCounter++ ) ); + contexts.emplace_back( ctx ); + + contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun ) ); + + auto handle = SG::makeHandle( m_inViewRoIs, contexts.back() ); + CHECK( handle.setProxyDict( viewVector->back() ) ); + CHECK( handle.record( std::move( oneRoIColl ) ) ); + + // TODO recording decisions related to the current view + + } + ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" ); + // Run the views + CHECK( ViewHelper::runInViews( contexts, // Vector containing views + m_viewAlgorithmNames, // Algorithms to run in each view + serviceLocator()->service( m_algPoolName ) ) ); // Service to retrieve algorithms by name + + // store views + auto viewsHandle = SG::makeHandle( m_viewsKey ); + CHECK( viewsHandle.record( std::move( viewVector ) ) ); + + + return StatusCode::SUCCESS; +} + diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..569b77792a06d68db7e569371c6d2f6f81ada260 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h @@ -0,0 +1,51 @@ +/* + General-purpose view creation algorithm <bwynne@cern.ch> + + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ViewAlgs_EventViewCreatorAlgorithm_h +#define ViewAlgs_EventViewCreatorAlgorithm_h + +#include <vector> +#include <string> + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthContainers/ConstDataVector.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" + +#include "GaudiKernel/IAlgResourcePool.h" +#include "AthViews/View.h" + +class EventViewCreatorAlgorithm : public AthAlgorithm +{ + public: + EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); + StatusCode initialize(); + StatusCode execute(); + + private: + //Input trig composite collection to split into views + SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_inputDecisionsKey{ this, "Decisions", "Unspecified", "The name of decision container to use in making views" }; + + //Output views for merging + SG::WriteHandleKey< std::vector< SG::View* > > m_viewsKey{ this, "Views", "Unspecified", "The key of views collection produced" }; + + // auxiliary handles + SG::WriteHandleKey< ConstDataVector<TrigRoiDescriptorCollection> > m_inViewRoIs{ this, "InViewRoIs", "Unspecified", "Name with which the RoIs shoudl be inserted into the views" }; + SG::WriteHandleKey< ConstDataVector<TrigCompositeUtils::DecisionContainer> > m_inViewDecisions{ this, "InViewDecisions", "Unspecified", "The name of decision container placed in the view" }; + + + Gaudi::Property< std::vector<std::string> > m_viewAlgorithmNames{ this, "AlgorithmNameSequence", std::vector<std::string>(), "Algorithms to run in each view" }; + + + + Gaudi::Property<bool> m_viewPerRoI{ this, "ViewPerRoI", false, "Create one View per RoI as opposed to one View per Decision object, needs to be true when multiple decisions per RoI exists" }; + + Gaudi::Property< std::string > m_algPoolName{ this, "AlgPoolName", "ViewAlgPool", "" }; + Gaudi::Property< std::string > m_roisLink{ this, "RoIsLink", "Unspecified", "Name of EL to RoI object lined to the decision" }; +}; + +#endif + diff --git a/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.cxx b/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.cxx deleted file mode 100644 index 5e9eb6fa3fc4ebd18dbe539403b3932d2995de20..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.cxx +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include <sstream> -#include "CxxUtils/make_unique.h" -#include "L1Decoder/TrigIdentifiers.h" - -#include "MenuAlgView.h" - -using namespace TrigConf; - -namespace AthViews { - -MenuAlgView::MenuAlgView(const std::string& name, ISvcLocator* pSvcLocator) - : AthViewAlgorithm(name, pSvcLocator), -// : AthAlgorithm(name, pSvcLocator), - m_inputChainDecisions("MenuInput"), - m_outputChainDecisions("MenuOutput"), - m_outputChainDecisionsAux("MenuOutputAux."), - - m_inputProxyDecisions("ProxyInput"), - m_outputProxyDecisions("ProxyOutput"), - m_outputProxyDecisionsAux("ProxyOutputAux.") -{ - declareProperty("InputChainDecisions", m_inputChainDecisions, "Name of the decisions object of previous stages of the chains"); - declareProperty("OutputChainDecisions", m_outputChainDecisions, "Name of the decisions object which contains decisions for chains"); - declareProperty("OutputChainDecisionsAux", m_outputChainDecisionsAux, "Aux"); - - declareProperty("HypoDecisions", m_inputProxyDecisions, "Name of the decisions object which contains decisions of hypo algorithms"); - declareProperty("OutputDecisions", m_outputProxyDecisions, "Name of the decisions object which are to be produced"); - declareProperty("OutputDecisionsAux", m_outputProxyDecisionsAux, "Aux"); - declareProperty("Required", m_requiredConf, "List of required signatures, each specified by: chain_name = hypo_name x multiplicity ... (nonuniform chains not supported yet)" ); -} - -StatusCode MenuAlgView::initialize() { - //decode property - std::istringstream input; - // decode format HLT_em25 = L2_em20_calo x 1 - for ( auto requirement : m_requiredConf ) { - input.clear(); - input.str(requirement); - std::string chain; - std::string eqSign; - std::string hypo; - std::string xChar; - size_t multiplicity; - input >> chain >> eqSign >> hypo >> xChar >> multiplicity; - if ( xChar != "x" or eqSign != "=" ) { - ATH_MSG_WARNING("Ubable to decode " << requirement << " it shoudl be of form 'chain = hypo x N'" ); - return StatusCode::FAILURE; - } - m_required.push_back({HLTUtils::string2hash(chain, "chain"), HLTUtils::string2hash(hypo), multiplicity}); - ATH_MSG_DEBUG( "Will require " << hypo << " x " << multiplicity << " for the chain: " << chain); - } - return StatusCode::SUCCESS; -} - - - - - -StatusCode MenuAlgView::execute() { - // harvest all the hypo decisions - if ( not m_inputProxyDecisions.isValid() ) { - ATH_MSG_ERROR("No Proxy " <<m_inputProxyDecisions.name()<<" from previous hypos"); - return StatusCode::FAILURE; - } - - std::map<HLTHash, size_t> hypoPassedObjectsMultiplicity; - { - for ( const auto roiComposite: *m_inputProxyDecisions.cptr() ) { - std::vector<TriggerElementID> passedHypoIDs; - roiComposite->getDetail("Passed", passedHypoIDs); - for ( auto id: passedHypoIDs ) { - hypoPassedObjectsMultiplicity[HLTHash(id)] += 1; - } - } - } - - - if ( not m_inputChainDecisions.isValid() ) { - ATH_MSG_ERROR("No chain decisions object prom previous stage, with name "<< m_inputChainDecisions.name()); - return StatusCode::FAILURE; - } - std::set<HLTHash> chainsSurvivingPreviousStage; - { - //neeed to filter out chains not requiring this stepAlgo (stored in m_required)!! - std::vector<int> passedChainIDs; - for ( const auto chainComposite : *m_inputChainDecisions.cptr() ) { - int id = 0; - chainComposite->getDetail("ID", id); - int decision = 0; - chainComposite->getDetail("Decision", decision); - if ( decision != 0 ) { - chainsSurvivingPreviousStage.insert(HLTHash(id)); - ATH_MSG_DEBUG("Noticied that the chain " << HLTUtils::hash2string(HLTHash(id), "chain") << " passed at the previous stage"); - } else { - ATH_MSG_VERBOSE("Noticied that the chain " << HLTUtils::hash2string(HLTHash(id), "chain") << " rejected at the previous stage "); - } - } - } - - - m_outputChainDecisions = CxxUtils::make_unique< xAOD::TrigCompositeContainer >(); - m_outputChainDecisionsAux = CxxUtils::make_unique< xAOD::TrigCompositeAuxContainer>(); - m_outputChainDecisions->setStore(m_outputChainDecisionsAux.ptr()); - - ATH_MSG_DEBUG("Checking menu, got " << m_required.size() - << " chains to decide on, previous stage passed " << chainsSurvivingPreviousStage.size() - << " chains, hypos passed " << hypoPassedObjectsMultiplicity.size() ); - - std::set<HLTHash> tesOfPassingChains; - size_t passingChainsCount = 0; - - // loop over the requirements - for ( const auto req: m_required ) { - // check if the chain was not already rejected, if so simply ignore it in further consideration - if ( chainsSurvivingPreviousStage.count(req.chain) != 1 ) { - ATH_MSG_DEBUG("Chain rejected at the previous stage "<< HLTUtils::hash2string(req.chain, "chain")); - continue; - } - - // irrespecively of the decision we store the information - xAOD::TrigComposite * chainDecision = new xAOD::TrigComposite(); - m_outputChainDecisions->push_back(chainDecision); - chainDecision->setDetail("ID", ChainID(req.chain)); - - const int satisfied = hypoPassedObjectsMultiplicity[req.hypo] >= req.multiplicity ? 1 : 0; // chain pass condition - ATH_MSG_DEBUG("Chain ID:" << req.chain << " " << HLTUtils::hash2string(req.chain, "chain") << " decision " << satisfied); - chainDecision->setDetail("Decision", satisfied); - tesOfPassingChains.insert(req.hypo); - passingChainsCount += satisfied; - } - - // iterate over hypo decisions and create decision object for those which are interested from the menu standpoint - - m_outputProxyDecisions = CxxUtils::make_unique< xAOD::TrigCompositeContainer >(); - m_outputProxyDecisionsAux = CxxUtils::make_unique< xAOD::TrigCompositeAuxContainer>(); - m_outputProxyDecisions->setStore(m_outputProxyDecisionsAux.ptr()); - - if ( passingChainsCount > 0) { - ATH_MSG_DEBUG("Event passed this step"); - size_t nRoI=0; - for ( const auto roiComposite: *m_inputProxyDecisions.cptr() ) { - if ( hasTE( roiComposite, tesOfPassingChains) ) { - xAOD::TrigComposite * teDecision = new xAOD::TrigComposite(); - m_outputProxyDecisions->push_back(teDecision); - teDecision->setObjectLink("seed", ElementLink<xAOD::TrigCompositeContainer>(m_inputProxyDecisions.name(), nRoI) ); - } - nRoI ++; - } - } else { - ATH_MSG_DEBUG("Event rejected at this step"); - } - - - return StatusCode::SUCCESS; -} - - -bool MenuAlgView::hasTE(const xAOD::TrigComposite* c, const std::set<HLTHash>& passing) const { - std::vector<TriggerElementID> passedHypoIDs; - c->getDetail("Passed", passedHypoIDs); - for ( auto id: passedHypoIDs ) { - if ( passing.count(HLTHash(id)) == 1 ) - return true; - } - return false; -} - - -} diff --git a/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.h b/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.h deleted file mode 100644 index 301720466a5c3441bf9fc33e864ac150df4cd865..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/MenuAlgView.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ViewAlgs_MenuAlgView_h -#define ViewAlgs_MenuAlgView_h -#include <string> -//#include "AthenaBaseComps/AthAlgorithm.h" -#include "AthViews/AthViewAlgorithm.h" - -#include "xAODTrigger/TrigCompositeContainer.h" -#include "xAODTrigger/TrigCompositeAuxContainer.h" - -#include "AthViews/View.h" -#include "TrigConfHLTData/HLTUtils.h" - -namespace AthViews { - -class MenuAlgView : public ::AthViewAlgorithm { - - public: - - MenuAlgView(const std::string& name, ISvcLocator* pSvcLocator); - StatusCode initialize(); - StatusCode execute(); - - struct Requirement { - TrigConf::HLTHash chain; - TrigConf::HLTHash hypo; - size_t multiplicity; - }; - - - private: - std::vector<std::string> m_requiredConf; - std::vector<Requirement> m_required; - SG::ReadHandle< xAOD::TrigCompositeContainer > m_inputChainDecisions; - SG::WriteHandle< xAOD::TrigCompositeContainer > m_outputChainDecisions; - SG::WriteHandle< xAOD::TrigCompositeAuxContainer > m_outputChainDecisionsAux; - - - SG::ReadHandle< xAOD::TrigCompositeContainer > m_inputProxyDecisions; - SG::WriteHandle< xAOD::TrigCompositeContainer > m_outputProxyDecisions; - SG::WriteHandle< xAOD::TrigCompositeAuxContainer > m_outputProxyDecisionsAux; - - - bool hasTE(const xAOD::TrigComposite*, const std::set<TrigConf::HLTHash>&) const; - - - -}; - -} - -#endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/MergeViews.cxx b/Trigger/TrigSteer/ViewAlgs/src/MergeViews.cxx index 2298acdeb1092567af4e6b0e3d194a7184f22b62..c715b5a04c9f5a062261634faa4a30f5f99fe6c6 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/MergeViews.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/MergeViews.cxx @@ -1,4 +1,23 @@ /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +#include "MergeViews.h" +MergeViews::MergeViews(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm( name, pSvcLocator ) {} + +StatusCode MergeViews::initialize() { + CHECK( m_viewsKey.initialize() ); + return StatusCode::SUCCESS; +} + +StatusCode MergeViews::execute_r( const EventContext& context ) const { + auto viewsHandle = SG::makeHandle( m_viewsKey, context ); + const std::vector<SG::View*>& viewsRef = *viewsHandle; + + for ( auto & tool : m_mergingTools ) { + CHECK( tool->merge( context, viewsRef ) ); + } + + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/MergeViews.h b/Trigger/TrigSteer/ViewAlgs/src/MergeViews.h index 2298acdeb1092567af4e6b0e3d194a7184f22b62..1960bbfc3c0e95f2d3dbcb0b0a309a6f7d718b8f 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/MergeViews.h +++ b/Trigger/TrigSteer/ViewAlgs/src/MergeViews.h @@ -2,3 +2,15 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +#include "AthViews/IViewsMergerTool.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" + +class MergeViews : virtual public AthReentrantAlgorithm { +public: + MergeViews(const std::string& name, ISvcLocator* pSvcLocator); + StatusCode initialize() override; + StatusCode execute_r( const EventContext& context ) const override; +private: + SG::ReadHandleKey<std::vector<SG::View*> > m_viewsKey { this, "Views", "Views", "Collection of views to read from" }; + ToolHandleArray<IViewsMergerTool> m_mergingTools {this, "MergingTools", {}, "Merging tools used to perform the merging action" }; +}; diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e962750f0dea35267d2aa1043d792105a9bd07b1 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.cxx @@ -0,0 +1,37 @@ +#include "TrigL2CaloViewsMergerTool.h" + + +TrigL2CaloViewsMergerTool::TrigL2CaloViewsMergerTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : AthAlgTool( type, name, parent ) {} + +StatusCode TrigL2CaloViewsMergerTool::initialize() { + CHECK( m_mergedClustersKey.initialize() ); + renounce( m_inViewClustersKey ); // this is an input no to be seen by scheduler + CHECK( m_inViewClustersKey.initialize() ); + return StatusCode::SUCCESS; +} + +StatusCode TrigL2CaloViewsMergerTool::merge( const EventContext& context, const std::vector<SG::View*>& views ) const { + + auto output = std::make_unique< ConstDataVector< xAOD::TrigEMClusterContainer > >(); + output->clear( SG::VIEW_ELEMENTS ); + + for ( auto view : views ) { + // make input electrons + EventContext viewContext( context ); + viewContext.setExtension( Atlas::ExtendedEventContext( view ) ); + auto clustersInViewHandle = SG::makeHandle( m_inViewClustersKey, viewContext ); + CHECK ( clustersInViewHandle.isValid() ); + ATH_MSG_DEBUG( "Found: "<< clustersInViewHandle->size() << "clusters in view" ); + for ( auto electron: *clustersInViewHandle ) { + output->push_back( electron ); + } + } + ATH_MSG_DEBUG( "Output clusters container size: " << output->size() ); + + auto outputHandle = SG::makeHandle( m_mergedClustersKey, context ); + CHECK( outputHandle.record( std::move( output ) ) ); + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h new file mode 100644 index 0000000000000000000000000000000000000000..f036160716dda2e14638aa55f8d0cbe725227f29 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/TrigL2CaloViewsMergerTool.h @@ -0,0 +1,26 @@ +#ifndef TrigEgammaHypo_TrigL2CaloViewsMergeTool_h +#define TrigEgammaHypo_TrigL2CaloViewsMergeTool_h + + +#include "AthViews/IViewsMergerTool.h" +#include "AthenaBaseComps/AthAlgTool.h" + +#include "AthViews/View.h" +#include "AthContainers/ConstDataVector.h" +#include "xAODTrigCalo/TrigEMClusterContainer.h" + +class TrigL2CaloViewsMergerTool : virtual public IViewsMergerTool, virtual public AthAlgTool { +public: + TrigL2CaloViewsMergerTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + StatusCode initialize() override; + StatusCode merge( const EventContext& context, const std::vector<SG::View*>& ) const override; + +private: + SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_inViewClustersKey {this, "InViewClusters", "L2CaloClustersInView", "Input"}; + SG::WriteHandleKey< ConstDataVector<xAOD::TrigEMClusterContainer> > m_mergedClustersKey {this, "MergedClusters", "L2CaloClustersMerged", "Output"}; +}; + + +#endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f24444f31d36f8440e8212a89ede52916bf42450 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.cxx @@ -0,0 +1,37 @@ +#include "TrigL2ElectronViewsMergerTool.h" + + +TrigL2ElectronViewsMergerTool::TrigL2ElectronViewsMergerTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : AthAlgTool( type, name, parent ) {} + +StatusCode TrigL2ElectronViewsMergerTool::initialize() { + CHECK( m_mergedElectronsKey.initialize() ); + renounce( m_inViewElectronsKey ); // this is an input no to be seen by scheduler + CHECK( m_inViewElectronsKey.initialize() ); + return StatusCode::SUCCESS; +} + +StatusCode TrigL2ElectronViewsMergerTool::merge( const EventContext& context, const std::vector<SG::View*>& views ) const { + + auto output = std::make_unique< ConstDataVector< xAOD::TrigElectronContainer > >(); + output->clear( SG::VIEW_ELEMENTS ); + + for ( auto view : views ) { + // make input electrons + EventContext viewContext( context ); + viewContext.setExtension( Atlas::ExtendedEventContext( view ) ); + auto electronsInViewHandle = SG::makeHandle( m_inViewElectronsKey, viewContext ); + CHECK ( electronsInViewHandle.isValid() ); + ATH_MSG_DEBUG( "Found: "<< electronsInViewHandle->size() << "electrons in view" ); + for ( auto electron: *electronsInViewHandle ) { + output->push_back( electron ); + } + } + ATH_MSG_DEBUG( "Output electrons container size: " << output->size() ); + + auto outputHandle = SG::makeHandle( m_mergedElectronsKey, context ); + CHECK( outputHandle.record( std::move( output ) ) ); + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h new file mode 100644 index 0000000000000000000000000000000000000000..fc22dfadcb322eaccc88020edd5b6aef23f69b14 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/TrigL2ElectronViewsMergerTool.h @@ -0,0 +1,27 @@ +#ifndef TrigEgammaHypo_TrigL2ElectronViewsMergeTool_h +#define TrigEgammaHypo_TrigL2ElectronViewsMergeTool_h + + +#include "AthViews/IViewsMergerTool.h" +#include "AthenaBaseComps/AthAlgTool.h" + +#include "AthViews/View.h" +#include "AthContainers/ConstDataVector.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" + + +class TrigL2ElectronViewsMergerTool : virtual public IViewsMergerTool, virtual public AthAlgTool { +public: + TrigL2ElectronViewsMergerTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + StatusCode initialize() override; + StatusCode merge( const EventContext& context, const std::vector<SG::View*>& ) const override; + +private: + SG::ReadHandleKey< xAOD::TrigElectronContainer > m_inViewElectronsKey {this, "InViewElectrons", "L2ElectronContainerInView", "Input"}; + SG::WriteHandleKey< ConstDataVector<xAOD::TrigElectronContainer> > m_mergedElectronsKey {this, "MergedElectrons", "L2ElectronContainerMerged", "Output"}; +}; + + +#endif diff --git a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx index 5cb2b25addbbb82bd38dbda75f2cfca924160699..9d1627a13bdac609680ad1f8bcbd1d6eeb9deaa3 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx @@ -1,14 +1,23 @@ #include "GaudiKernel/DeclareFactoryEntries.h" -#include "../MenuAlgView.h" +#include "../EventViewCreatorAlgorithm.h" +#include "../MergeViews.h" +#include "../TrigL2ElectronViewsMergerTool.h" +#include "../TrigL2CaloViewsMergerTool.h" -DECLARE_NAMESPACE_ALGORITHM_FACTORY( AthViews,MenuAlgView ) +DECLARE_ALGORITHM_FACTORY( EventViewCreatorAlgorithm ) +DECLARE_ALGORITHM_FACTORY( MergeViews ) +DECLARE_TOOL_FACTORY( TrigL2ElectronViewsMergerTool ) +DECLARE_TOOL_FACTORY( TrigL2CaloViewsMergerTool ) + DECLARE_FACTORY_ENTRIES( ViewAlgs ) { - - DECLARE_NAMESPACE_ALGORITHM( AthViews, MenuAlgView ) + DECLARE_ALGORITHM( EventViewCreatorAlgorithm ) + DECLARE_ALGORITHM( MergeViews ) + DECLARE_TOOL( TrigL2ElectronViewsMerger ) + DECLARE_TOOL( TrigL2CaloViewsMerger ) } diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx deleted file mode 100644 index 5ea15e158eb32b025764051420109a3e78716860..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/* - General-purpose view creation algorithm <bwynne@cern.ch> - - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "./EventViewCreatorAlgorithm.h" - -#include "StoreGate/ReadHandle.h" -#include "StoreGate/WriteHandle.h" -#include "CxxUtils/make_unique.h" -#include "AthContainers/ConstDataVector.h" -#include "AthViews/ViewHelper.h" - - -EventViewCreatorAlgorithm::EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) - : AthAlgorithm( name, pSvcLocator ), - m_viewsKey( "EventViews" ), - m_inputKey( "InputCollection" ), - m_inputAuxKey( "InputCollectionAux" ), - m_outputKey( "OutputCollection" ), - m_viewAlgorithmPool( "ViewAlgPool" ) -{ - //VarHandleKeys - declareProperty( "OutputViewCollection", m_viewsKey, "Name of output event view collection" ); - declareProperty( "WithinViewCollection", m_outputKey, "Name of the collection to make inside views" ); - declareProperty( "InputCollection", m_inputKey, "Name of the collection to split into views" ); - declareProperty( "InputAuxCollection", m_inputAuxKey, "Name of the aux collection to split into views" ); - - //Other properties - declareProperty( "ViewAlgorithmNames", m_viewAlgorithmNames, "Names of algorithms to run in the views" ); - declareProperty( "ViewAlgorithmPool", m_viewAlgorithmPool, "Name of algorithm pool for views" ); -} - -StatusCode EventViewCreatorAlgorithm::initialize() -{ - //Initialize VarHandleKeys - CHECK( m_viewsKey.initialize() ); - CHECK( m_outputKey.initialize() ); - CHECK( m_inputKey.initialize() ); - CHECK( m_inputAuxKey.initialize() ); - - return StatusCode::SUCCESS; -} - -StatusCode EventViewCreatorAlgorithm::execute() -{ -#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT - const EventContext& ctx = getContext(); -#else - const EventContext& ctx = *getContext(); -#endif - - //Load input data - SG::ReadHandle< xAOD::TrigCompositeContainer > inputHandle( m_inputKey, ctx ); - SG::ReadHandle< xAOD::TrigCompositeAuxContainer > inputAuxHandle( m_inputAuxKey, ctx ); - if ( !inputHandle.isValid() || !inputAuxHandle.isValid() ) - { - ATH_MSG_ERROR( "Unable to load input data for view creation" ); - return StatusCode::FAILURE; - } - //CHECK( inputHandle->setStore( inputAuxHandle.ptr() ) ); - - //Split into views - std::vector< SG::View* > viewVector; - std::vector< ConstDataVector<xAOD::TrigCompositeContainer> > viewCollections; - for ( const auto input: *inputHandle.cptr() ) - { - ConstDataVector<xAOD::TrigCompositeContainer> oneInput; - oneInput.clear( SG::VIEW_ELEMENTS ); - oneInput.push_back( input ); - viewCollections.push_back( oneInput ); - } - - //Make the views - SG::WriteHandle< ConstDataVector<xAOD::TrigCompositeContainer> > viewHandle( m_outputKey, ctx ); - CHECK( ViewHelper::MakeAndPopulate( name() + "_view", // Base name for all views to use - viewVector, // Vector to store views - viewHandle, // A writehandle to use to access the views (the handle itself, not the contents) - viewCollections ) ); // Data to initialise each view - one view will be made per entry - - // Run the views - CHECK( ViewHelper::RunViews( viewVector, // Vector containing views - m_viewAlgorithmNames, // Algorithms to run in each view - ctx, // Context to attach the views to - serviceLocator()->service( m_viewAlgorithmPool ) ) ); // Service to retrieve algorithms by name - - // Store the views for re-use/book-keeping - SG::WriteHandle< std::vector< SG::View* > > viewsHandle( m_viewsKey, ctx ); - viewsHandle = CxxUtils::make_unique< std::vector< SG::View* > >( viewVector ); - - return StatusCode::SUCCESS; -} - diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h deleted file mode 100644 index 243ee60d40745b8ebd5ee1128f598bdd8984a91c..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgsTest/src/EventViewCreatorAlgorithm.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - General-purpose view creation algorithm <bwynne@cern.ch> - - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ViewAlgs_EventViewCreatorAlgorithm_h -#define ViewAlgs_EventViewCreatorAlgorithm_h - -#include <vector> -#include <string> - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" -#include "xAODTrigger/TrigCompositeContainer.h" -#include "xAODTrigger/TrigCompositeAuxContainer.h" -#include "AthViews/View.h" -#include "AthContainers/ConstDataVector.h" - -class EventViewCreatorAlgorithm : public AthAlgorithm -{ - public: - EventViewCreatorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); - StatusCode initialize(); - StatusCode execute(); - - private: - //Output views for merging - SG::WriteHandleKey< std::vector< SG::View* > > m_viewsKey; - - //Input trig composite collection to split into views - SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_inputKey; - SG::ReadHandleKey< xAOD::TrigCompositeAuxContainer > m_inputAuxKey; - - //Output the split composite collection into views - SG::WriteHandleKey< ConstDataVector<xAOD::TrigCompositeContainer> > m_outputKey; - - //Algorithms to run in views - std::vector< std::string > m_viewAlgorithmNames; - - //Name of view algorithm pool - std::string m_viewAlgorithmPool; -}; - -#endif - diff --git a/Trigger/TrigSteer/ViewAlgsTest/src/components/ViewAlgsTest_entries.cxx b/Trigger/TrigSteer/ViewAlgsTest/src/components/ViewAlgsTest_entries.cxx index 1678c2c866f60bac9454ad24fdb31dde699cf1cb..c19a112fb8157b0171d2efd994a99331ac8fe877 100644 --- a/Trigger/TrigSteer/ViewAlgsTest/src/components/ViewAlgsTest_entries.cxx +++ b/Trigger/TrigSteer/ViewAlgsTest/src/components/ViewAlgsTest_entries.cxx @@ -9,7 +9,6 @@ #include "../MergeRoIsAlg.h" #include "../TestViewDriver.h" #include "../TestViewMerger.h" -#include "../EventViewCreatorAlgorithm.h" #include "../SchedulerProxyAlg.h" #include "../TestCombiner.h" @@ -21,7 +20,6 @@ DECLARE_ALGORITHM_FACTORY( TestSplitAlg ) DECLARE_ALGORITHM_FACTORY( MergeRoIsAlg ) DECLARE_ALGORITHM_FACTORY( TestViewDriver ) DECLARE_ALGORITHM_FACTORY( TestViewMerger ) -DECLARE_ALGORITHM_FACTORY( EventViewCreatorAlgorithm ) DECLARE_ALGORITHM_FACTORY( SchedulerProxyAlg ) DECLARE_ALGORITHM_FACTORY( TestCombiner ) @@ -34,7 +32,6 @@ DECLARE_FACTORY_ENTRIES( ViewAlgsTest ) DECLARE_ALGORITHM( MergeRoIsAlg ) DECLARE_ALGORITHM( TestViewDriver ) DECLARE_ALGORITHM( TestViewMerger ) - DECLARE_ALGORITHM( EventViewCreatorAlgorithm ) DECLARE_ALGORITHM( SchedulerProxyAlg ) DECLARE_ALGORITHM( TestCombiner ) } diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt index f4f306df1aeba19131964098ee6f5ec2180565bb..ac60037b85223f6333d04c3d9e22d25452dd65ee 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt @@ -54,10 +54,16 @@ atlas_add_test( IDRunData SCRIPT test/test_id_run_data.sh PROPERTIES TIMEOUT 500 ) -atlas_add_test( caloRunData SCRIPT test/test_calo_run_data.sh +#atlas_add_test( caloRunData SCRIPT test/test_calo_run_data.sh +# PROPERTIES TIMEOUT 500 +# ) +# replaced by complete egamma test + +atlas_add_test( egammaRunData SCRIPT test/test_egamma_run_data.sh PROPERTIES TIMEOUT 500 ) + atlas_add_test( idCaloRunData SCRIPT test/test_id_calo_run_data.sh PROPERTIES TIMEOUT 500 ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py index 07b8c88a09aa53b9daea70debb1d85d8d2d38c8b..6f038629000b6aed836ea6075067a53d4fd4fca2 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py @@ -12,19 +12,19 @@ def writeEmulationFiles(data): # Testing menu used in the L1 decoders class MenuTest: - CTPToChainMapping = ["0:HLT_e3", - "0:HLT_g5", - "1:HLT_e7", - "23:HLT_2e3", + CTPToChainMapping = ["0:HLT_e3_etcut", + "0:HLT_g5_etcut", + "1:HLT_e7_etcut", + "23:HLT_2e3_etcut", "15:HLT_mu6", "33:HLT_2mu6", "15:HLT_mu6idperf", "42:HLT_e15mu4"] - EMThresholdToChainMapping = ["EM3 : HLT_e3", - "EM3 : HLT_g5", - "EM7 : HLT_e7", - "EM15 : HLT_e15mu4"] + EMThresholdToChainMapping = ["EM3 : HLT_e3_etcut", + "EM3 : HLT_g5_etcut", + "EM7 : HLT_e7_etcut", + "EM15 : HLT_e15mu4_etcut"] MUThresholdToChainMapping = ["MU6 : HLT_mu6", "MU6 : HLT_mu6idperf", @@ -42,11 +42,13 @@ class L1DecoderTest(L1Decoder) : from L1Decoder.L1DecoderConf import CTPUnpackingTool, EMRoIsUnpackingTool, MURoIsUnpackingTool # CTP unpacker - self.ctpUnpacker = CTPUnpackingTool(OutputLevel = self.OutputLevel, - ForceEnableAllChains = True) - self.ctpUnpacker.MonTool = CTPUnpackingMonitoring(512, 200) + + ctpUnpacker = CTPUnpackingTool(OutputLevel = self.OutputLevel, + ForceEnableAllChains = True) + ctpUnpacker.MonTool = CTPUnpackingMonitoring(512, 200) # Hard-coded CTP IDs from v7 menu - self.ctpUnpacker.CTPToChainMapping = MenuTest.CTPToChainMapping + ctpUnpacker.CTPToChainMapping = MenuTest.CTPToChainMapping + self.ctpUnpacker = ctpUnpacker # EM unpacker if TriggerFlags.doID() or TriggerFlags.doCalo(): @@ -55,6 +57,7 @@ class L1DecoderTest(L1Decoder) : emUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="EM", maxCount=30 ) self.roiUnpackers += [emUnpacker] + # MU unpacker if TriggerFlags.doMuon(): muUnpacker = MURoIsUnpackingTool(OutputLevel = self.OutputLevel) @@ -87,10 +90,10 @@ class L1EmulationTest(L1Decoder) : from TrigUpgradeTest.TestUtils import writeEmulationFiles writeEmulationFiles(data) - - self.ctpUnpacker = CTPUnpackingEmulationTool(OutputLevel = self.OutputLevel, - ForceEnableAllChains = True) - + ctpUnpacker = CTPUnpackingEmulationTool(OutputLevel = self.OutputLevel, + ForceEnableAllChains = True) + self.ctpUnpacker = ctpUnpacker + self += ctpUnpacker # Hard-coded CTP IDs from v7 menu self.ctpUnpacker.CTPToChainMapping = MenuTest.CTPToChainMapping @@ -104,6 +107,7 @@ class L1EmulationTest(L1Decoder) : self.roiUnpackers += [emUnpacker] print emUnpacker + # MU unpacker if TriggerFlags.doMuon(): muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", @@ -111,7 +115,6 @@ class L1EmulationTest(L1Decoder) : OutputTrigRoIs = "MURoIs", OutputLevel=self.OutputLevel, ThresholdToChainMapping = MenuTest.MUThresholdToChainMapping) - self.roiUnpackers += [muUnpacker] self.Chains="HLTChainsResult" diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py b/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py index 4b596bc591cb6adb4fe1b5ccfc8ac31e973bd30e..7c1b84aadfd1cf42037e6f8ea06554e05c41dfe0 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/IDCalo.py @@ -7,6 +7,106 @@ include("TrigUpgradeTest/testHLT_MT.py") viewTest = opt.enableViews # from testHLT_MT.py from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() + +allViewAlgorithms = topSequence.allViewAlgorithms + +if viewTest: + viewMaker = CfgMgr.AthViews__RoiCollectionToViews( "viewMaker" ) + viewMaker.ViewBaseName = "testView" + viewMaker.AlgPoolName = svcMgr.ViewAlgPool.name() + viewMaker.InputRoICollection = "EMRoIs" + viewMaker.OutputRoICollection = "EMViewRoIs" + topSequence += viewMaker + + +from InDetRecExample.InDetKeys import InDetKeys + +#Pixel + +from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder +InDetPixelRodDecoder = PixelRodDecoder(name = "InDetPixelRodDecoder") +ToolSvc += InDetPixelRodDecoder + +from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool +InDetPixelRawDataProviderTool = PixelRawDataProviderTool(name = "InDetPixelRawDataProviderTool", + Decoder = InDetPixelRodDecoder) +ToolSvc += InDetPixelRawDataProviderTool +if (InDetFlags.doPrintConfigurables()): + print InDetPixelRawDataProviderTool + +# load the PixelRawDataProvider +from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider +InDetPixelRawDataProvider = PixelRawDataProvider(name = "InDetPixelRawDataProvider", + RDOKey = InDetKeys.PixelRDOs(), + ProviderTool = InDetPixelRawDataProviderTool) + +# if ( viewTest ): +# allViewAlgorithms += InDetPixelRawDataProvider +# allViewAlgorithms.InDetPixelRawDataProvider.isRoI_Seeded = True +# allViewAlgorithms.InDetPixelRawDataProvider.RoIs = "EMViewRoIs" +# svcMgr.ViewAlgPool.TopAlg += [ "InDetPixelRawDataProvider" ] +# topSequence.viewMaker.AlgorithmNameSequence += [ "InDetPixelRawDataProvider" ] +# else: +# topSequence += InDetPixelRawDataProvider +# topSequence.InDetPixelRawDataProvider.isRoI_Seeded = True +# topSequence.InDetPixelRawDataProvider.RoIs = "EMRoIs" + + +if (InDetFlags.doPrintConfigurables()): + print InDetPixelRawDataProvider + + +#SCT +from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder +InDetSCTRodDecoder = SCT_RodDecoder(name = "InDetSCTRodDecoder", + TriggerMode = False) +ToolSvc += InDetSCTRodDecoder + +from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool +InDetSCTRawDataProviderTool = SCTRawDataProviderTool(name = "InDetSCTRawDataProviderTool", + Decoder = InDetSCTRodDecoder) +ToolSvc += InDetSCTRawDataProviderTool +if (InDetFlags.doPrintConfigurables()): + print InDetSCTRawDataProviderTool + +# load the SCTRawDataProvider +from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider +InDetSCTRawDataProvider = SCTRawDataProvider(name = "InDetSCTRawDataProvider", + RDOKey = InDetKeys.SCT_RDOs(), + ProviderTool = InDetSCTRawDataProviderTool) + +if ( viewTest ): + allViewAlgorithms += InDetSCTRawDataProvider + allViewAlgorithms.InDetSCTRawDataProvider.isRoI_Seeded = True + allViewAlgorithms.InDetSCTRawDataProvider.RoIs = "EMViewRoIs" + svcMgr.ViewAlgPool.TopAlg += [ "InDetSCTRawDataProvider" ] + topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSCTRawDataProvider" ] +else: + topSequence += InDetSCTRawDataProvider + topSequence.InDetSCTRawDataProvider.isRoI_Seeded = True + topSequence.InDetSCTRawDataProvider.RoIs = "EMRoIs" + + +#TRT +from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc +InDetTRTCalDbSvc = TRT_CalDbSvc() +ServiceMgr += InDetTRTCalDbSvc + +from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc +InDetTRTStrawStatusSummarySvc = TRT_StrawStatusSummarySvc(name = "InDetTRTStrawStatusSummarySvc") +ServiceMgr += InDetTRTStrawStatusSummarySvc + +from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRT_RodDecoder +InDetTRTRodDecoder = TRT_RodDecoder(name = "InDetTRTRodDecoder", + LoadCompressTableDB = True)#(globalflags.DataSource() != 'geant4')) +ToolSvc += InDetTRTRodDecoder + +from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProviderTool +InDetTRTRawDataProviderTool = TRTRawDataProviderTool(name = "InDetTRTRawDataProviderTool", + Decoder = InDetTRTRodDecoder) +ToolSvc += InDetTRTRawDataProviderTool + + allViewAlgorithms = None if viewTest: allViewAlgorithms = topSequence.allViewAlgorithms @@ -15,6 +115,7 @@ if TriggerFlags.doID: #workaround to prevent online trigger folders to be enabled from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags InDetTrigFlags.useConditionsClasses.set_Value_and_Lock(False) + from InDetRecExample.InDetJobProperties import InDetFlags diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index 0099a066cf7149a58fc0143abc54bcb62c1d790c..40b8122cd20c07787a2ed05e5409ea1fbab10eeb 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -35,6 +35,57 @@ if viewTest: from InDetRecExample.InDetKeys import InDetKeys + +# provide a minimal menu information +#topSequence.L1DecoderTest.ctpUnpacker.CTPToChainMapping = ['0:HLT_e3', '0:HLT_e5', '1:HLT_e7', '1:HLT_e10'] +topSequence.L1DecoderTest.ctpUnpacker.OutputLevel=DEBUG + +#topSequence.L1DecoderTest.roiUnpackers[0].ThresholdToChainMapping = ['EM3 : HLT_e3', 'EM3 : HLT_e5', 'EM7 : HLT_e7', 'EM7 : HLT_e10'] +topSequence.L1DecoderTest.roiUnpackers[0].OutputLevel=DEBUG +#topSequence.L1DecoderTest.roi[].ThresholdToChainMapping = ['EM3 : HLT_e3', 'EM3 : HLT_e5', 'EM7 : HLT_e7', 'EM7 : HLT_e10'] + + +from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_FastAlgo +theFastCaloAlgo=T2CaloEgamma_FastAlgo("FastCaloAlgo" ) +theFastCaloAlgo.OutputLevel=VERBOSE +theFastCaloAlgo.ClustersName="L2CaloClusters" +svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False + +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +if viewTest: + allViewAlgorithms += theFastCaloAlgo + svcMgr.ViewAlgPool.TopAlg += [ theFastCaloAlgo.getName() ] + l2CaloViewsMaker = EventViewCreatorAlgorithm("l2CaloViewsMaker", OutputLevel=DEBUG) + topSequence += l2CaloViewsMaker + l2CaloViewsMaker.Decisions = "EMRoIDecisions" # from EMRoIsUnpackingTool + l2CaloViewsMaker.RoIsLink = "initialRoI" # -||- + l2CaloViewsMaker.InViewRoIs = "EMCaloRoIs" # contract with the fastCalo + l2CaloViewsMaker.Views = "EMCaloViews" + l2CaloViewsMaker.AlgorithmNameSequence = [ theFastCaloAlgo.getName() ] + theFastCaloAlgo.RoIs = l2CaloViewsMaker.InViewRoIs + + + from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlg + from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName + theFastCaloHypo = TrigL2CaloHypoAlg("L2CaloHypo") + theFastCaloHypo.OutputLevel = DEBUG + theFastCaloHypo.Views = l2CaloViewsMaker.Views + theFastCaloHypo.CaloClusters = theFastCaloAlgo.ClustersName + theFastCaloHypo.RoIs = l2CaloViewsMaker.InViewRoIs + theFastCaloHypo.Decisions = "EgammaCaloDecisions" + tools = [ TrigL2CaloHypoToolFromName("HLT_e5_etcut"), TrigL2CaloHypoToolFromName("HLT_e7_etcut") ] + for t in tools: + t.OutputLevel = DEBUG + + theFastCaloHypo.HypoTools = tools + topSequence += theFastCaloHypo + +else: + topSequence += theFastCaloAlgo + + + + #Pixel from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder @@ -52,23 +103,8 @@ if (InDetFlags.doPrintConfigurables()): from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider InDetPixelRawDataProvider = PixelRawDataProvider(name = "InDetPixelRawDataProvider", RDOKey = InDetKeys.PixelRDOs(), - ProviderTool = InDetPixelRawDataProviderTool) - -if ( viewTest ): - allViewAlgorithms += InDetPixelRawDataProvider - allViewAlgorithms.InDetPixelRawDataProvider.isRoI_Seeded = True - allViewAlgorithms.InDetPixelRawDataProvider.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetPixelRawDataProvider" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetPixelRawDataProvider" ] -else: - topSequence += InDetPixelRawDataProvider - topSequence.InDetPixelRawDataProvider.isRoI_Seeded = True - topSequence.InDetPixelRawDataProvider.RoIs = "EMRoIs" - - -if (InDetFlags.doPrintConfigurables()): - print InDetPixelRawDataProvider - + ProviderTool = InDetPixelRawDataProviderTool, + isRoI_Seeded = True ) #SCT from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder @@ -86,19 +122,10 @@ if (InDetFlags.doPrintConfigurables()): # load the SCTRawDataProvider from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider InDetSCTRawDataProvider = SCTRawDataProvider(name = "InDetSCTRawDataProvider", - RDOKey = InDetKeys.SCT_RDOs(), - ProviderTool = InDetSCTRawDataProviderTool) - -if ( viewTest ): - allViewAlgorithms += InDetSCTRawDataProvider - allViewAlgorithms.InDetSCTRawDataProvider.isRoI_Seeded = True - allViewAlgorithms.InDetSCTRawDataProvider.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetSCTRawDataProvider" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSCTRawDataProvider" ] -else: - topSequence += InDetSCTRawDataProvider - topSequence.InDetSCTRawDataProvider.isRoI_Seeded = True - topSequence.InDetSCTRawDataProvider.RoIs = "EMRoIs" + RDOKey = InDetKeys.SCT_RDOs(), + ProviderTool = InDetSCTRawDataProviderTool, + isRoI_Seeded = True ) + #TRT @@ -125,18 +152,10 @@ ToolSvc += InDetTRTRawDataProviderTool from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProvider InDetTRTRawDataProvider = TRTRawDataProvider(name = "InDetTRTRawDataProvider", RDOKey = "TRT_RDOs", - ProviderTool = InDetTRTRawDataProviderTool) - -if ( viewTest ): - allViewAlgorithms += InDetTRTRawDataProvider - allViewAlgorithms.InDetTRTRawDataProvider.isRoI_Seeded = True - allViewAlgorithms.InDetTRTRawDataProvider.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetTRTRawDataProvider" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetTRTRawDataProvider" ] -else: - topSequence += InDetTRTRawDataProvider - topSequence.InDetTRTRawDataProvider.isRoI_Seeded = True - topSequence.InDetTRTRawDataProvider.RoIs = "EMRoIs" + ProviderTool = InDetTRTRawDataProviderTool, + isRoI_Seeded = True + ) + #Pixel clusterisation @@ -170,19 +189,8 @@ InDetPixelClusterization = InDet__PixelClusterization(name = gangedAmbiguitiesFinder = InDetPixelGangedAmbiguitiesFinder, DetectorManagerName = InDetKeys.PixelManager(), DataObjectName = InDetKeys.PixelRDOs(), - ClustersName = "PixelTrigClusters") -if ( viewTest ): - allViewAlgorithms += InDetPixelClusterization - allViewAlgorithms.InDetPixelClusterization.isRoI_Seeded = True - allViewAlgorithms.InDetPixelClusterization.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetPixelClusterization" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetPixelClusterization" ] -else: - topSequence += InDetPixelClusterization - topSequence.InDetPixelClusterization.isRoI_Seeded = True - topSequence.InDetPixelClusterization.RoIs = "EMRoIs" - - + ClustersName = "PixelTrigClusters", + isRoI_Seeded = True) # # --- SCT_ClusteringTool (public) @@ -202,18 +210,9 @@ InDetSCT_Clusterization = InDet__SCT_Clusterization(name = "I DataObjectName = InDetKeys.SCT_RDOs(), ClustersName = "SCT_TrigClusters", conditionsService = InDetSCT_ConditionsSummarySvc, - FlaggedConditionService = InDetSCT_FlaggedConditionSvc) - -if ( viewTest ): - allViewAlgorithms += InDetSCT_Clusterization - allViewAlgorithms.InDetSCT_Clusterization.isRoI_Seeded = True - allViewAlgorithms.InDetSCT_Clusterization.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetSCT_Clusterization" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSCT_Clusterization" ] -else: - topSequence += InDetSCT_Clusterization - topSequence.InDetSCT_Clusterization.isRoI_Seeded = True - topSequence.InDetSCT_Clusterization.RoIs = "EMRoIs" + FlaggedConditionService = InDetSCT_FlaggedConditionSvc, + isRoI_Seeded = True ) + #Space points and FTF @@ -239,82 +238,20 @@ from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_e theFTF = TrigFastTrackFinder_eGamma() theFTF.OutputLevel = DEBUG -if ( viewTest ): - allViewAlgorithms += InDetSiTrackerSpacePointFinder - allViewAlgorithms += theFTF - allViewAlgorithms.TrigFastTrackFinder_eGamma.isRoI_Seeded = True - allViewAlgorithms.TrigFastTrackFinder_eGamma.RoIs = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetSiTrackerSpacePointFinder", "TrigFastTrackFinder_eGamma" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "InDetSiTrackerSpacePointFinder", "TrigFastTrackFinder_eGamma" ] -else: - topSequence += InDetSiTrackerSpacePointFinder - theFTF.RoIs = "EMRoIs" - topSequence += theFTF - -svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False - - - -from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_FastAlgo -theFastCaloAlgo=T2CaloEgamma_FastAlgo("FastCaloAlgo") -theFastCaloAlgo.OutputLevel=VERBOSE - -if ( viewTest ): - theFastCaloAlgo.RoIs="EMViewRoIs" - allViewAlgorithms += theFastCaloAlgo - svcMgr.ViewAlgPool.TopAlg += [ "FastCaloAlgo" ] - topSequence.viewMaker.AlgorithmNameSequence += [ "FastCaloAlgo" ] -else: - theFastCaloAlgo.RoIs="EMRoIs" - topSequence += theFastCaloAlgo - from TrigInDetConf.TrigInDetRecCommonTools import InDetTrigFastTrackSummaryTool from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF -#print "ToolSvc:" -#print ToolSvc - - -#from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg -#xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(name = "InDetxAODParticleCreatorAlg", -# ConvertTracks = True, -# ConvertTrackParticles = False, -# TrackContainerName = "TrigFastTrackFinder_Tracks", -# xAODContainerName = "xAODTracks", -# xAODTrackParticlesFromTracksContainerName = "xAODTracks2", -# TrackParticleCreator = InDetTrigParticleCreatorToolFTF, -# PrintIDSummaryInfo = True) -# -# -#if ( viewTest ): -# allViewAlgorithms += xAODTrackParticleCnvAlg -# svcMgr.ViewAlgPool.TopAlg += [ "InDetxAODParticleCreatorAlg"] -# topSequence.viewMaker.AlgorithmNameSequence += ["InDetxAODParticleCreatorAlg"] -#else: -# topSequence += xAODTrackParticleCnvAlg - - - from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg", doIBLresidual = False, - roiCollectionName="EMRoIs", TrackName = "TrigFastTrackFinder_Tracks", TrackParticlesName = "xAODTracks", ParticleCreatorTool = InDetTrigParticleCreatorToolFTF) - -theTrackParticleCreatorAlg.OutputLevel=VERBOSE -print"theTrackParticleCreatorAlg" -print theTrackParticleCreatorAlg -if ( viewTest ): - allViewAlgorithms += theTrackParticleCreatorAlg - allViewAlgorithms.InDetTrigTrackParticleCreatorAlg.TrackName = "TrigFastTrackFinder_Tracks" - allViewAlgorithms.InDetTrigTrackParticleCreatorAlg.TrackParticlesName = "xAODTracks" - allViewAlgorithms.InDetTrigTrackParticleCreatorAlg.roiCollectionName = "EMViewRoIs" - svcMgr.ViewAlgPool.TopAlg += [ "InDetTrigTrackParticleCreatorAlg" ] - topSequence.viewMaker.AlgorithmNameSequence += ["InDetTrigTrackParticleCreatorAlg"] -else: - topSequence += theTrackParticleCreatorAlg + + + +IDSequence = [ InDetPixelRawDataProvider, InDetSCTRawDataProvider, InDetTRTRawDataProvider, InDetPixelClusterization, InDetSCT_Clusterization, InDetSiTrackerSpacePointFinder, theFTF, theTrackParticleCreatorAlg ] + from TrigEgammaHypo.TrigL2ElectronFexMTConfig import L2ElectronFex_1 theElectronFex= L2ElectronFex_1() @@ -323,11 +260,43 @@ theElectronFex.TrackParticlesName="xAODTracks" theElectronFex.ElectronsName="Electrons" theElectronFex.OutputLevel=VERBOSE -if (viewTest): - theElectronFex.roiCollectionName="EMViewRoIs" - allViewAlgorithms+=theElectronFex - svcMgr.ViewAlgPool.TopAlg += ["L2ElectronFex_1"] - topSequence.viewMaker.AlgorithmNameSequence += [ "L2ElectronFex_1" ] + +if viewTest: + l2ElectronViewsMaker = EventViewCreatorAlgorithm("l2ElectronViewsMaker", OutputLevel=DEBUG) + topSequence += l2ElectronViewsMaker + l2ElectronViewsMaker.Decisions = theFastCaloHypo.Decisions # output of L2CaloHypo + l2ElectronViewsMaker.RoIsLink = "roi" # -||- + l2ElectronViewsMaker.InViewRoIs = "EMIDRoIs" # contract with the fastCalo + l2ElectronViewsMaker.Views = "EMElectronViews" + + + theTrackParticleCreatorAlg.roiCollectionName = l2ElectronViewsMaker.InViewRoIs + for idAlg in IDSequence: + if idAlg.properties().has_key("RoIs"): + idAlg.RoIs = l2ElectronViewsMaker.InViewRoIs + + allViewAlgorithms += idAlg + svcMgr.ViewAlgPool.TopAlg += [ idAlg.getName() ] + l2ElectronViewsMaker.AlgorithmNameSequence += [ idAlg.getName() ] + + # this is only partially working + # theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs + # allViewAlgorithms += theElectronFex + # svcMgr.ViewAlgPool.TopAlg += [ theElectronFex.getName() ] + # l2ElectronViewsMaker.AlgorithmNameSequence += [ theElectronFex.getName() ] + else: - theElectronFex.roiCollectionName="EMRoIs" - topSequence += theElectronFex + # ID algs can't run w/o views yet + pass + + +# from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypoAlg +# from TrigEgammaHypo.TrigL2ElectronHypoTool import TrigL2ElectronHypoToolFromName +# theElectronHypo = TrigL2ElectronHypoAlg() +# theElectronHypo.Electrons = theElectronFex.ElectronsName +# theElectronHypo.ClusterDecisions = "EgammaFastCaloDecisions" +# theElectronHypo.ElectronDecisions = "ElectronL2Decisions" +# theElectronHypo.OutputLevel = VERBOSE +# theElectronHypo.HypoTools = [ TrigL2ElectronHypoToolFromName("HLT_e5_etcut"), TrigL2ElectronHypoToolFromName("HLT_e7_etcut") ] + +# topSequence += theElectronHypo diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py index fe05ec8d9dc8c97743bc020c81c1820c9be71de2..2bdaf4c95058047cc439e7b6c3b78c6aafe2b57b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py @@ -330,7 +330,8 @@ svcMgr.LVL1ConfigSvc.XMLMenuFile = findFileInXMLPATH(TriggerFlags.inputLVL1confi if globalflags.InputFormat.is_bytestream(): from TrigUpgradeTest.TestUtils import L1DecoderTest - topSequence += L1DecoderTest(OutputLevel = opt.HLTOutputLevel) + #topSequence += L1DecoderTest(OutputLevel = opt.HLTOutputLevel) + topSequence += L1DecoderTest(OutputLevel = DEBUG) else: from TrigUpgradeTest.TestUtils import L1EmulationTest topSequence += L1EmulationTest(OutputLevel = opt.HLTOutputLevel) @@ -344,14 +345,7 @@ if opt.enableViews: from GaudiHive.GaudiHiveConf import AlgResourcePool svcMgr += AlgResourcePool('ViewAlgPool') - # view maker - viewMaker = CfgMgr.AthViews__RoiCollectionToViews( "viewMaker" ) - viewMaker.ViewBaseName = "testView" - viewMaker.AlgPoolName = svcMgr.ViewAlgPool.name() - viewMaker.InputRoICollection = "EMRoIs" - viewMaker.OutputRoICollection = "EMViewRoIs" - topSequence += viewMaker - + # Set of view algs allViewAlgs = AthSequencer( "allViewAlgorithms" ) allViewAlgs.ModeOR = False @@ -364,9 +358,9 @@ if opt.enableViews: allViewAlgs.alwaysFail.PercentPass = 0.0 # dummy alg that just says you're running in a view - allViewAlgs += CfgMgr.AthViews__ViewTestAlg( "viewTest" ) - svcMgr.ViewAlgPool.TopAlg += [ "viewTest" ] - viewMaker.AlgorithmNameSequence = [ "viewTest" ] #Eventually scheduler will do this + # allViewAlgs += CfgMgr.AthViews__ViewTestAlg( "viewTest" ) + # svcMgr.ViewAlgPool.TopAlg += [ "viewTest" ] + # viewMaker.AlgorithmNameSequence = [ "viewTest" ] #Eventually scheduler will do this # --------------------------------------------------------------- # Monitoring diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh new file mode 100755 index 0000000000000000000000000000000000000000..766442b53c5a29bdb8b66bc9b2bfc54e3bd3f0da --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# art-type: build +# art-ci: master + +athena --threads=1 -c 'EvtMax=10;enableViews=True;FilesInput="root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW/data16_13TeV.00309640.physics_EnhancedBias.merge.RAW._lb0628._SFO-1._0001.1"' TrigUpgradeTest/egamma.withViews.py