diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py index 106baecc626481f78a1bdf71364034709c3eb7fd..9e88963e784879401d86ed0c7fbc489a2872bc7d 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoTool.py @@ -12,6 +12,8 @@ def TrigL2ElectronHypoToolFromName( name ): assert str(threshold) == bname[1][1:], "Threshold definition is not a simple int" from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypoTool + tool = TrigL2ElectronHypoTool(name) + tool.MonTool = "" from TriggerJobOpts.TriggerFlags import TriggerFlags if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): from AthenaMonitoring.AthenaMonitoringConf import GenericMonitoringTool @@ -27,12 +29,18 @@ def TrigL2ElectronHypoToolFromName( name ): 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 + monTool.HistPath = 'L2ElectronHypo/'+tool.name() + tool.MonTool = monTool + tool += monTool + + from AthenaCommon.SystemOfUnits import GeV tool.TrackPt = [ 1.0 * GeV ] tool.CaloTrackdETA = [ 0.2 ] tool.CaloTrackdPHI = [ 999. ] + tool.CaloTrackdEoverPLow = [ 0.0 ] + tool.CaloTrackdEoverPHigh = [ 999.0 ] + tool.TRTRatio = [ -999. ] + if float(threshold) < 15: tool.TrackPt = [ 1.0 * GeV ] elif float(threshold) >= 15 and float(threshold) < 20: diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx index 753a61a3008eec2b7bf5cee0a0fdba972fb2ed15..3cab44a27d6af299611c39923eac92dea228d381 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoTool.cxx @@ -13,7 +13,7 @@ TrigL2CaloHypoTool::TrigL2CaloHypoTool( const std::string& type, const std::string& name, const IInterface* parent ) : AthAlgTool( type, name, parent ), - m_decisionId( name ) {} + m_decisionId( HLT::Identifier::fromToolName( name ) ) {} StatusCode TrigL2CaloHypoTool::initialize() { ATH_MSG_DEBUG( "Initialization completed successfully" ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.cxx index c6fc3edba8e7babd03a38290415fae3688562b1b..db88035a298cf694da63a48d06c0d945efbf864a 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.cxx @@ -22,9 +22,15 @@ StatusCode TrigL2ElectronHypoAlg::initialize() { ATH_MSG_INFO ( "Initializing " << name() << "..." ); ATH_CHECK( m_hypoTools.retrieve() ); - ATH_CHECK( m_electronsKey.initialize() ); - ATH_CHECK( m_clusterDecisionsKey.initialize() ); + + ATH_CHECK( m_views.initialize() ); ATH_CHECK( m_decisionsKey.initialize() ); + ATH_CHECK( m_clusterDecisionsKey.initialize() ); + + renounce( m_electronsKey ); + ATH_CHECK( m_electronsKey.initialize() ); + + return StatusCode::SUCCESS; } @@ -40,21 +46,21 @@ StatusCode TrigL2ElectronHypoAlg::execute_r( const EventContext& context ) const { ATH_MSG_DEBUG ( "Executing " << name() << "..." ); // obtain electrons - auto electronsHandle = SG::makeHandle( m_electronsKey, context ); - auto clusterDecisions = SG::makeHandle( m_clusterDecisionsKey, context ); - + + // prepare decisions container and link back to the clusters, and decision on clusters auto decisions = std::make_unique<DecisionContainer>(); auto aux = std::make_unique<DecisionAuxContainer>(); decisions->setStore( aux.get() ); - // extract mapping + // // extract mapping of cluster pointer to an index in the cluster decision collection + auto clusterDecisions = SG::makeHandle( m_clusterDecisionsKey, context ); std::map<const xAOD::TrigEMCluster*, size_t> clusterToIndexMap; size_t clusterCounter = 0; for ( auto clusterDecisionIter = clusterDecisions->begin(); - clusterDecisionIter != clusterDecisionIter; - ++clusterDecisionIter, ++clusterCounter ) { + clusterDecisionIter != clusterDecisions->end(); + ++clusterDecisionIter, ++clusterCounter ) { ATH_CHECK( ( *clusterDecisionIter )->hasObjectLink( "feature" ) ); const xAOD::TrigEMCluster* cluster = ( *clusterDecisionIter )->object<xAOD::TrigEMCluster>( "feature" ); @@ -62,33 +68,40 @@ StatusCode TrigL2ElectronHypoAlg::execute_r( const EventContext& context ) const // auto cluster = clusterLink.getDataPtr(); clusterToIndexMap.insert( std::make_pair( cluster, clusterCounter ) ); } - + ATH_MSG_DEBUG( "Cluster ptr to decision map has size " << clusterToIndexMap.size() ); + + // prepare imput for tools std::vector<TrigL2ElectronHypoTool::Input> hypoToolInput; - size_t electronCounter = 0; - for ( auto electronIter = electronsHandle->begin(); electronIter != electronsHandle->end(); ++electronIter, electronCounter++ ) { - auto d = newDecisionIn( decisions.get() ); - d->setObjectLink( "feature", ElementLink<xAOD::TrigElectronContainer>( m_electronsKey.key(), electronCounter ) ); - - auto clusterPtr = (*electronIter)->emCluster(); - // now find matching cluster - // could use geometric matching but in fact the cluster owned by the decision object and the cluster owned by the electron should be the same - // since we have a map made in advance we can make use of the index lookup w/o the need for additional loop - auto origCluster = clusterToIndexMap.find( clusterPtr ); - ATH_CHECK( origCluster != clusterToIndexMap.end() ); - linkToPrevious( d, m_clusterDecisionsKey.key(), origCluster->second ); - - // now we have DecisionObject ready to be passed to hypo tool. it has link to electron, - // and decisions on clusters - // we shall avoid calling the tools for chains which were already rejected on certain cluster, but this is left to hypo tools - DecisionIDContainer clusterDecisionIDs; - decisionIDs( clusterDecisions->at( origCluster->second ), clusterDecisionIDs ); - - - hypoToolInput.emplace_back( TrigL2ElectronHypoTool::Input{ d, - *electronIter, - origCluster->first, - clusterDecisionIDs } ); + auto viewsHandle = SG::makeHandle( m_views, context ); + for ( auto view: *viewsHandle ) { + size_t electronCounter = 0; + auto electronsHandle = SG::makeHandle( m_electronsKey, context ); + CHECK( electronsHandle.setProxyDict( view ) ); + CHECK( electronsHandle.isValid() ); + + for ( auto electronIter = electronsHandle->begin(); electronIter != electronsHandle->end(); ++electronIter, electronCounter++ ) { + auto d = newDecisionIn( decisions.get() ); + d->setObjectLink( "feature", ElementLink<xAOD::TrigElectronContainer>( view->name()+"_"+m_electronsKey.key(), electronCounter ) ); + + auto clusterPtr = (*electronIter)->emCluster(); + CHECK( clusterPtr != nullptr ); + + // now find matching cluster + // could use geometric matching but in fact the cluster owned by the decision object and the cluster owned by the electron should be the same + // since we have a map made in advance we can make use of the index lookup w/o the need for additional loop + auto origCluster = clusterToIndexMap.find( clusterPtr ); + ATH_CHECK( origCluster != clusterToIndexMap.end() ); + linkToPrevious( d, m_clusterDecisionsKey.key(), origCluster->second ); + + // now we have DecisionObject ready to be passed to hypo tool. it has link to electron, + // and decisions on clusters + // we shall avoid calling the tools for chains which were already rejected on certain cluster, but this is left to hypo tools + DecisionIDContainer clusterDecisionIDs; + decisionIDs( clusterDecisions->at( origCluster->second ), clusterDecisionIDs ); + + hypoToolInput.emplace_back( TrigL2ElectronHypoTool::Input{ d, *electronIter, origCluster->first, clusterDecisionIDs } ); + } } diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.h index f464b752396d3098a04a7b9198e8661cdc6afdbf..4ad9b8e33cc3d3a467919a9ef96b33f6de65e174 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoAlg.h @@ -9,6 +9,7 @@ #include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "xAODTrigEgamma/TrigElectronContainer.h" #include "DecisionHandling/TrigCompositeUtils.h" +#include "AthViews/View.h" #include "TrigL2ElectronHypoTool.h" @@ -38,10 +39,15 @@ class TrigL2ElectronHypoAlg TrigL2ElectronHypoAlg(); ToolHandleArray< TrigL2ElectronHypoTool > m_hypoTools {this, "HypoTools", {}, "Tools to perfrom selection"}; - SG::ReadHandleKey< xAOD::TrigElectronContainer > m_electronsKey {this, "Electrons", "L2ElectronContainer", "Input"}; - SG::ReadHandleKey< DecisionContainer > m_clusterDecisionsKey {this, "ClusterDecisions", "L2ClusterContainer", "Decisions for clusters"}; + SG::ReadHandleKey< std::vector<SG::View*> > m_views {this, "Views", "Unspecified", "Views to read electrons from" }; SG::WriteHandleKey< DecisionContainer > m_decisionsKey {this, "ElectronDecisions", "ElectronDecisions", "Output decisions"}; + SG::ReadHandleKey< DecisionContainer > m_clusterDecisionsKey {this, "ClusterDecisions", "L2ClusterContainer", "Decisions for clusters"}; + + // internally used to getch from views + SG::ReadHandleKey< xAOD::TrigElectronContainer > m_electronsKey {this, "Electrons", "L2ElectronContainer", "Input"}; + + }; diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx index 1d03fee660ec8943f733685cc65b6cdfec79f9e7..9ab60cf8eae1acff4308fd6cd4062eafad8b4700 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.cxx @@ -14,12 +14,12 @@ TrigL2ElectronHypoTool::TrigL2ElectronHypoTool( const std::string& type, const std::string& name, const IInterface* parent ) : AthAlgTool( type, name, parent ), - m_decisionId( name ) + m_decisionId( HLT::Identifier::fromToolName( name ) ) {} StatusCode TrigL2ElectronHypoTool::initialize() { - if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); + if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() ); ATH_MSG_DEBUG( "Initialization completed successfully:" ); ATH_MSG_DEBUG( "AcceptAll = " @@ -31,13 +31,17 @@ StatusCode TrigL2ElectronHypoTool::initialize() { ATH_MSG_DEBUG( "CaloTrackdEoverPHigh = " << m_caloTrackdEoverPHigh ); ATH_MSG_DEBUG( "TRTRatio = " << m_trtRatio ); - std::vector<size_t> sizes( {m_trackPt.size(), m_caloTrackDEta.size(), m_caloTrackDPhi.size(), m_caloTrackdEoverPLow.size(), m_caloTrackdEoverPHigh.size(), m_trtRatio.size() }); + std::vector<size_t> sizes( {m_trackPt.size(), m_caloTrackDEta.size(), m_caloTrackDPhi.size(), m_caloTrackdEoverPLow.size(), m_caloTrackdEoverPHigh.size(), m_trtRatio.size() } ); - if ( min( sizes.begin(), sizes.end() ) != std::max( sizes.begin(), sizes.end() ) ) { - ATH_MSG_ERROR( "Missconfiguration, cut properties listed above (when DEBUG) have different dimensions" ); + + + if ( *std::min_element( sizes.begin(), sizes.end() ) != *std::max_element( sizes.begin(), sizes.end() ) ) { + ATH_MSG_ERROR( "Missconfiguration, cut properties listed above ( when DEBUG ) have different dimensions shortest: " << *std::min_element( sizes.begin(), sizes.end() ) << " longest " << *std::max_element( sizes.begin(), sizes.end() ) ); + return StatusCode::FAILURE; } m_multiplicity = m_trackPt.size(); + ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId ); return StatusCode::SUCCESS; } @@ -86,39 +90,40 @@ bool TrigL2ElectronHypoTool::decideOnSingleObject( const xAOD::TrigElectron* ele float NStrawHits = ( float )( electron->nTRTHiThresholdHits() ); float TRTHitRatio = NStrawHits == 0 ? 1e10 : NTRHits/NStrawHits; - + ATH_MSG_VERBOSE("Cut index " << cutIndex ); if ( ptCalo < m_trackPt[cutIndex] ){ - ATH_MSG_VERBOSE( "Fails pt cut" ); + ATH_MSG_VERBOSE( "Fails pt cut" << ptCalo << " < " << m_trackPt[cutIndex] ); return false; } cutCounter++; if ( dEtaCalo > m_caloTrackDEta[cutIndex] ) { - ATH_MSG_VERBOSE( "Fails dEta cut" ); + ATH_MSG_VERBOSE( "Fails dEta cut " << dEtaCalo << " < " << m_caloTrackDEta[cutIndex] ); return false; } cutCounter++; if ( dPhiCalo > m_caloTrackDPhi[cutIndex] ) { - ATH_MSG_VERBOSE( "Fails dPhi cut" ); + ATH_MSG_VERBOSE( "Fails dPhi cut " << dPhiCalo << " < " << m_caloTrackDPhi[cutIndex] ); return false; } cutCounter++; if( eToverPt < m_caloTrackdEoverPLow[cutIndex] ) { - ATH_MSG_VERBOSE( "Fails eoverp low cut" ); + ATH_MSG_VERBOSE( "Fails eoverp low cut " << eToverPt << " < " << m_caloTrackdEoverPLow[cutIndex] ); return false; } cutCounter++; if ( eToverPt > m_caloTrackdEoverPHigh[cutIndex] ) { - ATH_MSG_VERBOSE( "Fails eoverp high cut" ); + ATH_MSG_VERBOSE( "Fails eoverp high cut " << eToverPt << " < " << m_caloTrackdEoverPHigh[cutIndex] ); return false; } cutCounter++; if ( TRTHitRatio < m_trtRatio[cutIndex] ){ - ATH_MSG_VERBOSE( "Fails TRT cut" ); + ATH_MSG_VERBOSE( "Fails TRT cut " << TRTHitRatio << " < " << m_trtRatio[cutIndex] ); return false; } cutCounter++; + ATH_MSG_DEBUG("Passed selection"); return true; } @@ -128,7 +133,7 @@ StatusCode TrigL2ElectronHypoTool::inclusiveSelection( std::vector<Input>& input 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); + auto objDecision = decideOnSingleObject( i.electron, 0 ); if ( objDecision == true ) { addDecisionID( m_decisionId.numeric(), i.decision ); } @@ -172,7 +177,7 @@ StatusCode TrigL2ElectronHypoTool::multiplicitySelection( std::vector<Input>& in // 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 ) { + auto notFromSameRoI = [&]( const HLT::Index1DVec& comb ) { std::set<const xAOD::TrigEMCluster*> setOfClusters; for ( auto index: comb ) { setOfClusters.insert( input[index].cluster ); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h index 88494233641b403d1f266ca68c3d35fe1d66f406..f7b728ba0682c97410d0af7842aafd5080d1c8d4 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoTool.h @@ -82,12 +82,12 @@ class TrigL2ElectronHypoTool 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 - Gaudi::Property< std::vector<float> > m_caloTrackDPhi{ this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }; //loose cut - Gaudi::Property< std::vector<float> > m_caloTrackdEoverPLow{ this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "}; - 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" }; + Gaudi::Property< std::vector<float> > m_trackPt{ this, "TrackPt", { float(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 + Gaudi::Property< std::vector<float> > m_caloTrackDPhi{ this, "CaloTrackdPHI", {0}, "Delta Phi between track and cluster" }; //loose cut + Gaudi::Property< std::vector<float> > m_caloTrackdEoverPLow{ this, "CaloTrackdEoverPLow", {0}, "Min E over Pt cut "}; + 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; diff --git a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h index ab14c500080644422497236130b8d1e7da2e1d25..e56c2d27a44d8e2fba0471654802db7a901e8887 100644 --- a/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h +++ b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/HLTIdentifier.h @@ -24,6 +24,8 @@ public: **/ static void reportStringIDs( bool report ) { s_reportStringIDs = report; } static bool reportStringIDs() { return s_reportStringIDs; } + + static HLT::Identifier fromToolName( const std::string& tname ); /** * @brief constructs identifier from human redable name **/ diff --git a/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx b/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx index 032e482604343c994384309045e5f7659ef09b59..4bf0a683281447fa45d998bb56a8f9b932627cfd 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/HLTIdentifier.cxx @@ -25,3 +25,8 @@ MsgStream& operator<< ( MsgStream& m, const HLT::Identifier& id ) { } return m; } + + +Identifier Identifier::fromToolName( const std::string& tname ) { + return Identifier( tname.substr( tname.find('.') + 1 ) ); +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx index b2f3f80c2c23e68d5fee9d874051828dc72f6f5c..41560e597b06ab61c0a9c2fa65af20054c13d2b4 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx @@ -68,7 +68,7 @@ StatusCode EventViewCreatorAlgorithm::execute() 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 + // TODO here code supporting the case wnen we have many decisions associated to a single RoI previousRoI = roiDescriptor; auto oneRoIColl = std::make_unique< ConstDataVector<TrigRoiDescriptorCollection> >(); @@ -78,9 +78,17 @@ StatusCode EventViewCreatorAlgorithm::execute() // make the view viewVector->push_back( ViewHelper::makeView( name()+"_view", viewCounter++ ) ); contexts.emplace_back( ctx ); - contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun ) ); + // see if there is a view linked to the decision object, if so link it to the view that is just made + if ( decision->hasObjectLink( "view" ) ) { + auto viewEL = decision->objectLink< std::vector<SG::View*> >( "view" ); + CHECK( viewEL.isValid() ); + auto parentView = *viewEL; + viewVector->back()->linkParent( parentView ); + ATH_MSG_DEBUG( "Parent view linked" ); + } + auto handle = SG::makeHandle( m_inViewRoIs, contexts.back() ); CHECK( handle.setProxyDict( viewVector->back() ) ); CHECK( handle.record( std::move( oneRoIColl ) ) ); diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py index 40b8122cd20c07787a2ed05e5409ea1fbab10eeb..658ebdf6670f71ae12ec6188bf23ea1e969bff8b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py @@ -73,11 +73,10 @@ if viewTest: theFastCaloHypo.CaloClusters = theFastCaloAlgo.ClustersName theFastCaloHypo.RoIs = l2CaloViewsMaker.InViewRoIs theFastCaloHypo.Decisions = "EgammaCaloDecisions" - tools = [ TrigL2CaloHypoToolFromName("HLT_e5_etcut"), TrigL2CaloHypoToolFromName("HLT_e7_etcut") ] - for t in tools: + theFastCaloHypo.HypoTools = [ TrigL2CaloHypoToolFromName("HLT_e5_etcut"), TrigL2CaloHypoToolFromName("HLT_e7_etcut") ] + for t in theFastCaloHypo.HypoTools: t.OutputLevel = DEBUG - theFastCaloHypo.HypoTools = tools topSequence += theFastCaloHypo else: @@ -248,15 +247,13 @@ theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrack TrackParticlesName = "xAODTracks", ParticleCreatorTool = InDetTrigParticleCreatorToolFTF) - - IDSequence = [ InDetPixelRawDataProvider, InDetSCTRawDataProvider, InDetTRTRawDataProvider, InDetPixelClusterization, InDetSCT_Clusterization, InDetSiTrackerSpacePointFinder, theFTF, theTrackParticleCreatorAlg ] from TrigEgammaHypo.TrigL2ElectronFexMTConfig import L2ElectronFex_1 theElectronFex= L2ElectronFex_1() -theElectronFex.TrigEMClusterName="CaloClusters" -theElectronFex.TrackParticlesName="xAODTracks" +theElectronFex.TrigEMClusterName = theFastCaloAlgo.ClustersName +theElectronFex.TrackParticlesName = theTrackParticleCreatorAlg.TrackParticlesName theElectronFex.ElectronsName="Electrons" theElectronFex.OutputLevel=VERBOSE @@ -279,24 +276,27 @@ if viewTest: 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: - # ID algs can't run w/o views yet - pass + theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs + allViewAlgorithms += theElectronFex + svcMgr.ViewAlgPool.TopAlg += [ theElectronFex.getName() ] + l2ElectronViewsMaker.AlgorithmNameSequence += [ theElectronFex.getName() ] -# 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") ] + from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypoAlg + from TrigEgammaHypo.TrigL2ElectronHypoTool import TrigL2ElectronHypoToolFromName + theElectronHypo = TrigL2ElectronHypoAlg() + theElectronHypo.Views = l2ElectronViewsMaker.Views + theElectronHypo.Electrons = theElectronFex.ElectronsName + theElectronHypo.ClusterDecisions = theFastCaloHypo.Decisions + theElectronHypo.ElectronDecisions = "ElectronL2Decisions" + theElectronHypo.OutputLevel = VERBOSE + theElectronHypo.HypoTools = [ TrigL2ElectronHypoToolFromName("HLT_e5_etcut"), TrigL2ElectronHypoToolFromName("HLT_e7_etcut") ] + for t in theElectronHypo.HypoTools: + t.OutputLevel = VERBOSE + topSequence += theElectronHypo -# topSequence += theElectronHypo + +else: + # ID algs can't run w/o views yet + pass