diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py index b7e549ade384751a8b16c7ddb19a816fc295aa30..beea6f83585735f032c2a786391a1cc954dfb50f 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py @@ -76,33 +76,20 @@ def decodeThreshold( threshold_btag ): #################################################################################################### def getBjetBtagHypoConfiguration( name,conf_dict ): - # Common for both split and non-split configurations + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetBtagHypoTool tool = TrigBjetBtagHypoTool( name ) -# tool.OutputLevel = DEBUG tool.AcceptAll = True # TMP # b-tagging [tagger,tb] = decodeThreshold( conf_dict['bTag'] ) if conf_dict['bTag'] == "offperf" : - tool.AcceptAll = True + tool.AcceptAll = True tool.MethodTag = tagger tool.BTaggingCut = tb - # Monitoring -# tool.MonTool = "" -# from TriggerJobOpts.TriggerFlags import TriggerFlags -# if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): -# from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram -# monTool = GenericMonitoringTool("MonTool"+name) -# monTool.Histograms = [] - -# monTool.HistPath = 'BjetHypo/'+tool.name() -# tool.MonTool = monTool -# tool += monTool - return tool #################################################################################################### @@ -111,7 +98,17 @@ if __name__ == "__main__": from TriggerJobOpts.TriggerFlags import TriggerFlags TriggerFlags.enableMonitoring=['Validation'] - t = TrigBjetBtagHypoToolFromName( "HLT_j35_ftf_subjesgscIS_boffperf_split_L1J15","HLT_j35_ftf_subjesgscIS_boffperf_split_L1J15" ) - assert t, "can't configure boffperf split" + t = TrigBjetBtagHypoToolFromName( "HLT_j45_ftf_subjesgscIS_boffperf_split_L1J15","HLT_j45_ftf_subjesgscIS_boffperf_split_L1J15" ) + assert t, "can't configure boffperf chain" + + t = TrigBjetBtagHypoToolFromName( "HLT_j45_ftf_subjesgscIS_bmv2c2070_split_L1J15","HLT_j45_ftf_subjesgscIS_bmv2c2070_split_L1J15" ) + assert t, "can't configure bmv2c20 chain" + + t = TrigBjetBtagHypoToolFromName( "HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J15","HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J15" ) + assert t, "can't configure bmv2c10 chain" + + t = TrigBjetBtagHypoToolFromName( "HLT_j45_ftf_subjesgscIS_bhmv2c1070_split_L1J15","HLT_j45_ftf_subjesgscIS_bhmv2c1070_split_L1J15" ) + assert t, "can't configure bhmv2c10 chain" + log.info( "\n\n TrigBjetBtagHypoToolFromName ALL OK\n\n" ) diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py deleted file mode 100644 index 15c21ea2ee12e1fd86d4eada5be1a7e6e2c3f06e..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetEtHypoTool.py +++ /dev/null @@ -1,55 +0,0 @@ - -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Logging import logging -from AthenaCommon.SystemOfUnits import GeV - -log = logging.getLogger('TrigBjetEtHypoTool') - -#################################################################################################### - -def TrigBjetEtHypoToolFromDict( chainDict ): - - """ set the name of the EtHypoTool (name=chain) and figure out the threshold and selection from conf """ - name = chainDict['chainName'] - chainPart = chainDict['chainParts'][0] - - conf_dict = { 'threshold' : chainPart['threshold'], - 'multiplicity' : '1', - 'bTag' : 'offperf', - 'bConfig' : 'EF', - 'minEta' : chainPart['etaRange'].split('eta')[0], - 'maxEta' : chainPart['etaRange'].split('eta')[1], - 'L1' : None } - - - from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoTool - tool = TrigBjetEtHypoTool( name ) - tool.AcceptAll = False - tool.EtThreshold = float(conf_dict['threshold']) * GeV - tool.MinEtaThreshold = float(conf_dict['minEta']) / 100 - tool.MaxEtaThreshold = float(conf_dict['maxEta']) / 100 - - log.debug("name = %s, cut_j = %s ", name, tool.EtThreshold) - return tool - -def TrigBjetEtHypoToolFromName( name, conf ): - from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName - - decodedDict = dictFromChainName(conf) - decodedDict['chainName'] = name # override - - return TrigBjetEtHypoToolFromDict( decodedDict ) - -#################################################################################################### - - -if __name__ == "__main__": - from TriggerJobOpts.TriggerFlags import TriggerFlags - TriggerFlags.enableMonitoring=['Validation'] - - t = TrigBjetEtHypoToolFromName( "HLT_j35_ftf_subjesgscIS_boffperf_split_L1J15","HLT_j35_ftf_subjesgscIS_boffperf_split_L1J15" ) - assert t, "can't configure boffperf split" - - log.info( "\n\n TrigBjetEtHypoToolFromName ALL OK\n\n" ) - diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py index aaf07016c0eb9a00c03b9a438edc453f40e99a16..d5a95be024df5819901771b2a6d6227ac96274b2 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py +++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetOnlineMonitoringMTConfig.py @@ -29,3 +29,4 @@ class TrigBjetOnlineMonitoring(GenericMonitoringTool): # Jet Histograms self.defineHistogram('jet_pt', path='EXPERT', type='TH1F', title="Jet PT", xbins = default_bin_count, xmin=0, xmax=800000) self.defineHistogram('jet_eta', path='EXPERT', type='TH1F', title="Jet Eta", xbins = default_bin_count, xmin=-5, xmax=5) + self.defineHistogram('jet_phi', path='EXPERT', type='TH1F', title="Jet Phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5) diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py deleted file mode 100644 index c8a8cffb253c781fc16a50e97285af4519ead1b0..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigGSCFexMTConfig.py +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -from TrigBjetHypo.TrigBjetHypoConf import TrigGSCFexMT - -from AthenaCommon.Logging import logging - -from JetRec.JetRecCalibrationFinder import jrcf -JetConfigSetupStatus = True - -from JetCalibTools.JetCalibToolsConf import JetCalibrationTool - -def getGSCFexInstance( theName ): - return GSCFex( name=theName, instance="EF" ) - -def getGSCFexSplitInstance( theName ): - return GSCFexSplit( name=theName, instance="EF" ) - - -############################################################# -### EF Configuration -############################################################# - -class GSCFex (TrigGSCFexMT): - __slots__ = [] - - def __init__(self, instance, name): - super( GSCFex, self ).__init__( name ) - - mlog = logging.getLogger('BtagHypoConfig.py') - - AllowedInstances = ["EF"] - - if instance not in AllowedInstances : - mlog.error("Instance "+instance+" is not supported!") - return None - - self.JetKey = "EFJet" - self.PriVtxKey = "EFHistoPrmVtx" - self.TrackKey = "InDetTrigTrackingxAODCnv_Bjet_EFID" - - # IMPORT OFFLINE TOOLS - self.setupOfflineTools = True - if self.setupOfflineTools : - if JetConfigSetupStatus is None : - self.setupOfflineTools = False - else : - self.JetGSCCalibrationTool = jrcf.find("AntiKt", 0.4, "EMTopo", "ajg", "reco", "Kt4") - - -############################################################# -# For split configuration -############################################################# - -class GSCFexSplit (TrigGSCFexMT): - __slots__ = [] - - def __init__(self, instance, name, PriVtxKey="xPrimVx", TrackKey="InDetTrigTrackingxAODCnv_Bjet_IDTrig"): - super( GSCFexSplit, self ).__init__( name ) - - mlog = logging.getLogger('BtagHypoConfig.py') - - AllowedInstances = ["EF", "MuJetChain"] - - if instance not in AllowedInstances : - mlog.error("Instance "+instance+" is not supported!") - return None - - self.JetKey = "SplitJet" - if instance=="MuJetChain" : - self.JetKey = "FarawayJet" - - self.PriVtxKey = PriVtxKey - self.TrackKey = TrackKey - - # IMPORT OFFLINE TOOLS - self.setupOfflineTools = True - if self.setupOfflineTools : - if JetConfigSetupStatus is None : - self.setupOfflineTools = False - else : - #self.GSCCalibrationTool = jrcf.find("AntiKt", 0.4, "EMTopo", "ajg", "reco", "Kt4") - #print self.GSCCalibrationTool - myGSCTool = JetCalibrationTool("myJCTool_trigger", - JetCollection="AntiKt4EMTopo", - ConfigFile="JES_data2016_data2015_Recommendation_Dec2016_rel21.config", - CalibSequence="JetArea_EtaJES_GSC_Insitu", - RhoKey="HLT_Kt4EMTopoEventShape", - IsData=True, - #DoTrigger = True - ) - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += myGSCTool - self.JetGSCCalibrationTool = myGSCTool - #JetCalibrationTool("myJCTool_trigger", - # IsData=True, - # ConfigFile="JES_2015dataset_recommendation_Feb2016.config", - # CalibSequence="JetArea_EtaJES_GSC", - # JetCollection="AntiKt4EMTopo") - - diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx index b73302c992b6aff013eac87d9a33e163402919b1..442816043076f4c1bd311514a5d0dd6871398bc2 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.cxx @@ -12,27 +12,19 @@ TrigBjetBtagHypoAlgMT::TrigBjetBtagHypoAlgMT( const std::string& name, StatusCode TrigBjetBtagHypoAlgMT::initialize() { - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " " << m_bTagKey ); - ATH_MSG_DEBUG( " " << m_trackKey ); - ATH_MSG_DEBUG( " " << m_inputPrmVtx ); - ATH_MSG_DEBUG( " " << m_prmVtxLink ); - - ATH_CHECK( m_hypoTools.retrieve() ); + if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() ); - CHECK( m_bTagKey.initialize() ); - CHECK( m_trackKey.initialize() ); - CHECK( m_inputPrmVtx.initialize() ); + ATH_CHECK( m_bTaggedJetKey.initialize() ); + ATH_CHECK( m_bTagKey.initialize() ); + ATH_CHECK( m_trackKey.initialize() ); + ATH_CHECK( m_inputPrmVtx.initialize() ); + renounce( m_bTaggedJetKey ); renounce( m_bTagKey ); renounce( m_trackKey ); renounce( m_inputPrmVtx ); - renounce( m_bTagKey ); - - if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); - return StatusCode::SUCCESS; } @@ -49,16 +41,14 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { CHECK( retrievePreviousDecisionContainer( context,prevDecisionContainer ) ); ATH_MSG_DEBUG( "Running with "<< prevDecisionContainer->size() <<" previous decisions"); - // Retrieve b-tagging - ElementLinkVector< xAOD::BTaggingContainer > btaggingELs; - // Retrieve b-tagging here - // Retrive Precision tracks from Event Views. We get them all in this way! ElementLinkVector< xAOD::TrackParticleContainer > trackELs; CHECK( retrieveObjectFromEventView( context,trackELs,m_trackKey,prevDecisionContainer ) ); ATH_MSG_DEBUG( "Retrieved " << trackELs.size() << " precision tracks..." ); + + // online monitoring for tracks auto monitor_for_track_count = Monitored::Scalar( "track_count", trackELs.size() ); - CHECK( monitor_tracks(trackELs) ); + CHECK( monitor_tracks( trackELs ) ); for ( const ElementLink< xAOD::TrackParticleContainer >& trackLink : trackELs ) ATH_MSG_DEBUG( " * pt=" << (*trackLink)->p4().Et() << @@ -68,30 +58,23 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { // Retrieve Jets ElementLinkVector< xAOD::JetContainer > jetELs; - for ( const TrigCompositeUtils::Decision* previousDecision: *prevDecisionContainer ) { - const std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > jetLinks = - TrigCompositeUtils::findLinks< xAOD::JetContainer >( previousDecision, TrigCompositeUtils::featureString(), TrigDefs::lastFeatureOfType); - - for ( size_t linkIndex = 0; linkIndex < jetLinks.size(); linkIndex++ ) { - ATH_CHECK( jetLinks.at(linkIndex).isValid() ); - jetELs.push_back( jetLinks.at(linkIndex).link ); - } - } + CHECK( retrieveCollectionFromNavigation( TrigCompositeUtils::featureString(), jetELs, prevDecisionContainer ) ); ATH_MSG_DEBUG( "Retrieved " << jetELs.size() << " Jets of key " << TrigCompositeUtils::featureString() ); - auto monitor_for_jet_pt = Monitored::Collection( "jet_pt", jetELs, - [](const ElementLink< xAOD::JetContainer >& jetLink) { return (*jetLink)->pt(); } ); - auto monitor_for_jet_eta = Monitored::Collection( "jet_eta", jetELs, - [](const ElementLink< xAOD::JetContainer >& jetLink) { return (*jetLink)->eta(); } ); + + // online monitoring for jets auto monitor_for_jet_count = Monitored::Scalar( "jet_count", jetELs.size() ); - auto monitor_group_for_jets = Monitored::Group( m_monTool, monitor_for_jet_pt, monitor_for_jet_eta ); + CHECK( monitor_jets( jetELs ) ); // Retrieve Vertices ElementLinkVector< xAOD::VertexContainer > vertexELs; CHECK( retrieveObjectFromStoreGate( context,vertexELs,m_inputPrmVtx ) ); ATH_MSG_DEBUG( "Retrieved " << vertexELs.size() <<" vertices..." ); + + // opnline monitoring for vertex auto monitor_for_vertex_count = Monitored::Scalar( "vertex_count", vertexELs.size() ); + auto monitor_group_for_events = Monitored::Group( m_monTool, monitor_for_track_count, monitor_for_jet_count, monitor_for_vertex_count ); @@ -104,7 +87,7 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { TrigCompositeUtils::DecisionContainer *outputDecisions = handle.ptr(); // ========================================================================================================================== - // ** Compute Decisions + // ** Prepare Decisions // ========================================================================================================================== const unsigned int nDecisions = prevDecisionContainer->size(); @@ -116,19 +99,45 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { TrigCompositeUtils::Decision *toAdd = TrigCompositeUtils::newDecisionIn( outputDecisions, prevDecisionContainer->at(index), "", context ); - newDecisions.push_back( toAdd ); - } - // Adding Links - // CHECK( attachLinkToDecisions( context,newDecisions ) ); + // Attaching links to the output decisions + // Retrieved jets from view on which we have run flavour tagging + ElementLinkVector< xAOD::JetContainer > bTaggedJetEL; + CHECK( retrieveCollectionFromView( context, + bTaggedJetEL, + m_bTaggedJetKey, + prevDecisionContainer->at(index) ) ); + + if ( bTaggedJetEL.size() != 1 ) { + ATH_MSG_ERROR( "Did not find only 1 b-tagged jet object from View!" ); + return StatusCode::FAILURE; + } - for ( unsigned int index(0); index<nDecisions; index++ ) { - // Adding b-tagging links to output decisions // TMP - // Adding a dummy-link (a link to self) for now to satisfy validation. - ElementLink<TrigCompositeUtils::DecisionContainer> dummyFeatureLink(*outputDecisions, index, context); - newDecisions.at( index )->setObjectLink<TrigCompositeUtils::DecisionContainer>(TrigCompositeUtils::featureString(), dummyFeatureLink); + toAdd->setObjectLink< xAOD::JetContainer >( TrigCompositeUtils::featureString(),bTaggedJetEL.front() ); + + + + // Retrieve Flavour Tagging object from view + ElementLinkVector< xAOD::BTaggingContainer > bTaggingEL; + CHECK( retrieveCollectionFromView( context, + bTaggingEL, + m_bTagKey, + prevDecisionContainer->at(index) ) ); + + if ( bTaggingEL.size() != 1 ) { + ATH_MSG_ERROR( "Did not find only 1 b-tagging object from View!" ); + return StatusCode::FAILURE; + } + + toAdd->setObjectLink< xAOD::BTaggingContainer >( m_bTaggingLink.value(),bTaggingEL.front() ); + + + + // Add to Decision collection + newDecisions.push_back( toAdd ); } + // ========================================================================================================================== // ** Prepare input to Hypo Tools // ========================================================================================================================== @@ -146,9 +155,24 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { TrigCompositeUtils::decisionIDs( previousDecision ).begin(), TrigCompositeUtils::decisionIDs( previousDecision ).end() }; + + // Retrieve PV from navigation + ElementLink< xAOD::VertexContainer > vertexEL; + CHECK( retrieveObjectFromNavigation( m_prmVtxLink.value(), vertexEL, previousDecision ) ); + + // Retrieve b-tagging code + ElementLinkVector< xAOD::BTaggingContainer > bTaggingELs; + CHECK( retrieveCollectionFromView< xAOD::BTaggingContainer >( context, + bTaggingELs, + m_bTagKey, + previousDecision ) ); + CHECK( bTaggingELs.size() == 1 ); + + // Put everything in place TrigBjetBtagHypoTool::TrigBjetBtagHypoToolInfo infoToAdd; infoToAdd.previousDecisionIDs = previousDecisionIDs; - // infoToAdd.btaggingEL = btaggingELs.at( index ); // TMP + infoToAdd.btaggingEL = bTaggingELs.front(); + infoToAdd.vertexEL = vertexEL; infoToAdd.decision = newDecisions.at( index ); bTagHypoInputs.push_back( infoToAdd ); } @@ -168,17 +192,23 @@ StatusCode TrigBjetBtagHypoAlgMT::execute( const EventContext& context ) const { return StatusCode::SUCCESS; } +StatusCode TrigBjetBtagHypoAlgMT::monitor_jets( const ElementLinkVector<xAOD::JetContainer >& jetELs ) const { + + auto monitor_for_jet_pt = Monitored::Collection( "jet_pt", jetELs, + [](const ElementLink< xAOD::JetContainer >& jetLink) { return (*jetLink)->pt(); } ); + auto monitor_for_jet_eta = Monitored::Collection( "jet_eta", jetELs, + [](const ElementLink< xAOD::JetContainer >& jetLink) { return (*jetLink)->eta(); } ); + auto monitor_for_jet_phi = Monitored::Collection( "jet_phi", jetELs, + [](const ElementLink< xAOD::JetContainer >& jetLink) { return (*jetLink)->phi(); } ); + + auto monitor_group_for_jets = Monitored::Group( m_monTool, + monitor_for_jet_pt, monitor_for_jet_eta, monitor_for_jet_phi + ); -StatusCode TrigBjetBtagHypoAlgMT::attachLinksToDecision( const EventContext&, - TrigCompositeUtils::Decision&, - int, int ) const { - return StatusCode::SUCCESS; } - -StatusCode TrigBjetBtagHypoAlgMT::monitor_tracks( - const ElementLinkVector< xAOD::TrackParticleContainer >& trackELs ) const { +StatusCode TrigBjetBtagHypoAlgMT::monitor_tracks( const ElementLinkVector< xAOD::TrackParticleContainer >& trackELs ) const { auto monitor_for_track_Et = Monitored::Collection( "track_Et", trackELs, [](const ElementLink< xAOD::TrackParticleContainer >& trackLink) { return (*trackLink)->p4().Et(); } ); @@ -224,4 +254,3 @@ StatusCode TrigBjetBtagHypoAlgMT::monitor_tracks( } - diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h index ff3b90a179dab717a005aa54139a6e16d5726785..60ae9a91fb2ea9a202de19f1f06574a7a2b50269 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoAlgMT.h @@ -1,3 +1,4 @@ + /* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -33,23 +34,22 @@ class TrigBjetBtagHypoAlgMT : public TrigBjetHypoAlgBaseMT { private: TrigBjetBtagHypoAlgMT(); - virtual StatusCode attachLinksToDecision( const EventContext&, - TrigCompositeUtils::Decision&, - int index, - int indexPrmVertex = 0 ) const; + // online monitoring + virtual StatusCode monitor_jets( const ElementLinkVector<xAOD::JetContainer >& jetELs ) const ; virtual StatusCode monitor_tracks( const ElementLinkVector< xAOD::TrackParticleContainer >& trackELs ) const; - - ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; private: ToolHandleArray< TrigBjetBtagHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; + ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; - // Gaudi::Property< std::string > m_trackLink {this,"TrackLink","Undefined","Precision Track's link to attach to the output decision"}; + SG::ReadHandleKey< xAOD::JetContainer > m_bTaggedJetKey {this,"BTaggedJetKey","","Key for b-tagged jets"}; + SG::ReadHandleKey< xAOD::BTaggingContainer> m_bTagKey {this,"BTaggingKey","","Key for BTagging"}; + SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackKey {this,"TracksKey","","Key for precision tracks"}; + SG::ReadHandleKey< xAOD::VertexContainer > m_inputPrmVtx {this,"PrmVtxKey","","Key for Primary vertex collection for monitoring"}; + + Gaudi::Property< std::string > m_bTaggingLink {this,"BTaggingLink","Unspecified","b-Tagging Link name in navigation (output)"}; + Gaudi::Property< std::string > m_prmVtxLink {this,"PrmVtxLink","Unspecified","Vertex Link name in navigation (input)"}; - SG::ReadHandleKey< xAOD::BTaggingContainer> m_bTagKey {this,"BTagging","Undefined","Key for BTagging"}; - SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackKey {this,"Tracks","Undefined","Key for precision tracks, to be linked to output decision"}; - Gaudi::Property< std::string > m_prmVtxLink {this,"PrmVtxLink","Undefined","PrmVtx link to attach to the output decision"}; - SG::ReadHandleKey< xAOD::VertexContainer > m_inputPrmVtx {this,"PrmVtx","Undefined","Primary vertex to be linked to the output decision"}; }; #endif diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.cxx index 9a7086df46f9c2e6a8416423cc40a0bde9ea2e38..d8ff94e73a6b095a69141b29dfe187326c719461 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.cxx @@ -4,7 +4,7 @@ // ************************************************ // -// NAME: TrigBjetHypoTool.cxx +// NAME: TrigBjetBtagHypoTool.cxx // PACKAGE: Trigger/TrigHypothesis/TrigBjetHypoTool // // AUTHOR: Carlo Varni @@ -13,74 +13,97 @@ // ************************************************ #include "TrigCompositeUtils/HLTIdentifier.h" - -#include "TrigBjetBtagHypoTool.h" #include "AthenaMonitoringKernel/Monitored.h" +#include "TrigBjetBtagHypoTool.h" TrigBjetBtagHypoTool::TrigBjetBtagHypoTool( const std::string& type, - const std::string& name, - const IInterface* parent ) : + const std::string& name, + const IInterface* parent ) : AthAlgTool( type, name, parent ), m_decisionId( HLT::Identifier::fromToolName( name ) ) {} - + // ----------------------------------------------------------------------------------------------------------------- - + StatusCode TrigBjetBtagHypoTool::initialize() { ATH_MSG_DEBUG( "declareProperty review:" ); ATH_MSG_DEBUG( " " << m_acceptAll ); ATH_MSG_DEBUG( " " << m_methodTag ); ATH_MSG_DEBUG( " " << m_bTaggingCut ); - + + ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId ); return StatusCode::SUCCESS; } +// ----------------------------------------------------------------------------------------------------------------- + StatusCode TrigBjetBtagHypoTool::decide( std::vector< TrigBjetBtagHypoToolInfo >& bTagInfos ) const { ATH_MSG_DEBUG( "Executing "<< name() ); for ( TrigBjetBtagHypoToolInfo& bTagInfo : bTagInfos ) { + // ------------------------------------- // Check the HypoTool's chain is active if ( not TrigCompositeUtils::passed( getId().numeric(),bTagInfo.previousDecisionIDs ) ) continue; - // This will disappear! - if ( m_acceptAll == true ) { - ATH_MSG_DEBUG( "Running with 'Accept All' option enabled. Passing cut." ); - TrigCompositeUtils::addDecisionID( getId().numeric(),bTagInfo.decision ); + // ------------------------------------- + // Check Primary Vertex + const xAOD::Vertex *vertex = *(bTagInfo.vertexEL); - ATH_MSG_DEBUG("PRINTING DECISION"); - ATH_MSG_DEBUG( *bTagInfo.decision ); - continue; - } + ATH_MSG_DEBUG( "Event Vertex [x,y,z]=[" + << vertex->x() + << ","<< vertex->y() + << ","<< vertex->z() << "]" ); + + ATH_MSG_DEBUG( " ** Vertex Type = " << vertex->vertexType() ); + + // ------------------------------------- + // Compute trigger decision + bool pass = true; + + if ( vertex->vertexType() != xAOD::VxType::VertexType::PriVtx ) { + ATH_MSG_DEBUG( "Vertex is not a valid primary vertex!" ); + ATH_MSG_DEBUG( "Trigger decision is FALSE" ); + pass = false; + } else if ( m_acceptAll == true ) { + ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" ); + ATH_MSG_DEBUG( "Trigger decision is TRUE" ); + } else { - const xAOD::BTagging *btagging = *(bTagInfo.btaggingEL); - - double btaggingWeight = -1000; - if ( m_methodTag == "MV2c00" ) - btaggingWeight = btagging->auxdata< double >("MV2c00_discriminant"); - else if ( m_methodTag == "MV2c10" ) - btaggingWeight = btagging->auxdata< double >("MV2c10_discriminant"); - else if ( m_methodTag == "MV2c20" ) - btaggingWeight = btagging->auxdata< double >("MV2c20_discriminant"); - else { - ATH_MSG_ERROR( "b-Tagging method has not been recognised: " << m_methodTag.value() ); - return StatusCode::FAILURE; + const xAOD::BTagging *btagging = *(bTagInfo.btaggingEL); + double btaggingWeight = -1000; + + if ( m_methodTag == "MV2c00" ) + btaggingWeight = btagging->auxdata< double >("MV2c00_discriminant"); + else if ( m_methodTag == "MV2c10" ) + btaggingWeight = btagging->auxdata< double >("MV2c10_discriminant"); + else if ( m_methodTag == "MV2c20" ) + btaggingWeight = btagging->auxdata< double >("MV2c20_discriminant"); + else { + ATH_MSG_ERROR( "b-Tagging method has not been recognised: " << m_methodTag.value() ); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG( m_methodTag.value() << " = " << btaggingWeight ); + ATH_MSG_DEBUG( "Cutting b-tagging weight at " << m_bTaggingCut.value() ); + + if ( btaggingWeight < m_bTaggingCut ) + pass = false; } - ATH_MSG_DEBUG( m_methodTag.value() << " = " << btaggingWeight ); - ATH_MSG_DEBUG( "Cutting b-tagging eight at " << m_bTaggingCut.value() ); - - if ( btaggingWeight > m_bTaggingCut ) { - ATH_MSG_DEBUG( " --> Passed" ); - TrigCompositeUtils::addDecisionID( getId().numeric(),bTagInfo.decision ); + // ------------------------------------- + if ( pass == true ) { + ATH_MSG_DEBUG( "Selection cut satisfied, accepting the event" ); + TrigCompositeUtils::addDecisionID( getId().numeric(),bTagInfo.decision ); } else { - ATH_MSG_DEBUG( " --> Failed" ); + ATH_MSG_DEBUG( "Selection cut not satisfied, rejecting the event" ); } - ATH_MSG_DEBUG("PRINTING DECISION"); + ATH_MSG_DEBUG( "b-Tagging decision is " << (pass?"TRUE":"FALSE") ); + ATH_MSG_DEBUG( "PRINTING DECISION" ); ATH_MSG_DEBUG( *bTagInfo.decision ); } @@ -88,25 +111,6 @@ StatusCode TrigBjetBtagHypoTool::decide( std::vector< TrigBjetBtagHypoToolInfo > } -// ----------------------------------------------------------------------------------------------------------------- - -template<typename T> -StatusCode TrigBjetBtagHypoTool::retrieveTool( const std::string& toolName,PublicToolHandle< T >& tool) { - ATH_MSG_DEBUG( "Retrieving " << toolName ); - if ( tool.name().empty() ) { - ATH_MSG_WARNING( "No " << toolName << " to initialize." ); - return StatusCode::SUCCESS; - } - - if ( tool.retrieve().isFailure() ) { - ATH_MSG_ERROR( "Failed to Retrieve " << toolName ); - return StatusCode::FAILURE; - } else - ATH_MSG_DEBUG( "Retrieved "<< toolName ); - - return StatusCode::SUCCESS; -} - // ----------------------------------------------------------------------------------------------------------------- TrigCompositeUtils::DecisionID TrigBjetBtagHypoTool::decisionId() const { return m_decisionId.numeric(); } diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.h index f14cb996e49f32b59213c046023d25f2d4c39f20..cd133d1ade6e06db8280a40fc3e19051ed1f4186 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetBtagHypoTool.h @@ -16,14 +16,15 @@ #define TRIGBJETHYPO_TRIGBJETHYPOTOOL_H 1 // This is in current hypo, not sure if needed -//#include "TrigInterfaces/HypoAlgo.h" - #include "CLHEP/Units/SystemOfUnits.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" #include "AthenaMonitoringKernel/GenericMonitoringTool.h" -#include "xAODBTagging/BTaggingAuxContainer.h" + +#include "xAODTracking/VertexContainer.h" +#include "xAODTracking/VertexAuxContainer.h" + #include "xAODBTagging/BTaggingContainer.h" -#include "xAODBTagging/BTagging.h" +#include "xAODBTagging/BTaggingAuxContainer.h" // Are these new? #include "TrigCompositeUtils/HLTIdentifier.h" @@ -37,6 +38,7 @@ class TrigBjetBtagHypoTool : virtual public ::AthAlgTool { struct TrigBjetBtagHypoToolInfo { TrigCompositeUtils::DecisionIDContainer previousDecisionIDs; ElementLink< xAOD::BTaggingContainer > btaggingEL; + ElementLink< xAOD::VertexContainer > vertexEL; TrigCompositeUtils::Decision* decision; }; @@ -55,20 +57,15 @@ class TrigBjetBtagHypoTool : virtual public ::AthAlgTool { StatusCode decide( std::vector< TrigBjetBtagHypoToolInfo >& ) const; - private: - template<typename T> - StatusCode retrieveTool( const std::string&,PublicToolHandle< T >& ); - - private: HLT::Identifier m_decisionId; /** @brief DeclareProperty: if acceptAll flag is set to true, every event is taken. */ Gaudi::Property< bool > m_acceptAll {this,"AcceptAll",false,"if acceptAll flag is set to true, every event is taken"}; - /** @brief DeclareProperty: list of likelihood methods to be effectively used to perform the selection. */ - Gaudi::Property< std::string > m_methodTag {this,"MethodTag","","list of likelihood methods to be effectively used to perform the selection"}; + /** @brief DeclareProperty: Tagger used to perform the selection. */ + Gaudi::Property< std::string > m_methodTag {this,"MethodTag","","Tagger used to perform the selection"}; /** @brief DeclareProperty: lower bound of the discriminant variable to be selected (if flag acceptAll is set to false) for MV2 tagger. */ - Gaudi::Property< double > m_bTaggingCut {this,"BTaggingCut",-20,"lower bound of the discriminant variable to be selected for b-tagging"}; + Gaudi::Property< double > m_bTaggingCut {this,"BTaggingCut",-20.,"lower bound of the discriminant variable to be selected for b-tagging"}; /** @brief DeclareProperty: to monitor method used to perform the cut. */ // float m_monitorMethod; diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx deleted file mode 100644 index 5a7d42251cc9f1403cc146dd296f5d560fcd2a7b..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.cxx +++ /dev/null @@ -1,272 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "GaudiKernel/Property.h" -#include "TrigBjetEtHypoAlgMT.h" -#include "AthViews/ViewHelper.h" -#include "CxxUtils/phihelper.h" - -TrigBjetEtHypoAlgMT::TrigBjetEtHypoAlgMT( const std::string& name, - ISvcLocator* pSvcLocator ) : - TrigBjetHypoAlgBaseMT( name, pSvcLocator ) {} - - -StatusCode TrigBjetEtHypoAlgMT::initialize() { - - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " " << m_roiLink ); - ATH_MSG_DEBUG( " " << m_prmVtxLink ); - - ATH_CHECK( m_hypoTools.retrieve() ); - - CHECK( m_inputJetsKey.initialize() ); - CHECK( m_inputRoIKey.initialize() ); - CHECK( m_inputPrmVtx.initialize() ); - - renounce( m_inputJetsKey ); - renounce( m_inputRoIKey ); - if ( m_retrieveVertexFromEventView == true ) renounce( m_inputPrmVtx ); - - return StatusCode::SUCCESS; -} - -StatusCode TrigBjetEtHypoAlgMT::execute( const EventContext& context ) const { - ATH_MSG_DEBUG ( "Executing " << name() << "..." ); - - // ========================================================================================================================== - // ** Retrieve Ingredients - // ========================================================================================================================== - - // Read in previous Decisions made before running this Hypo Alg. - // The decisions come from the Jet group - const TrigCompositeUtils::DecisionContainer *prevDecisionContainer = nullptr; - CHECK( retrievePreviousDecisionContainer( context,prevDecisionContainer ) ); - ATH_MSG_DEBUG( "Found a total of " << prevDecisionContainer->size() << " previous decisions!" ); - - // Retrieve Jets - // These are the jets coming from the Jet selector in which RoIs have been constructed - // with PV constraint - ElementLinkVector< xAOD::JetContainer > jetELs; - CHECK( retrieveObjectFromEventView( context,jetELs,m_inputJetsKey,prevDecisionContainer ) ); - - ATH_MSG_DEBUG( "Found " << jetELs.size()<< " jets." ); - for ( const ElementLink< xAOD::JetContainer >& jetLink : jetELs ) - ATH_MSG_DEBUG( " -- Jet pt=" << (*jetLink)->p4().Et() - <<" eta="<< (*jetLink)->eta() - << " phi="<< (*jetLink)->phi() ); - - // The following is just for debugging. - // Retrieve RoI (to be linked to the output decision) - ElementLinkVector< TrigRoiDescriptorCollection > roiELs; - CHECK( retrieveObjectFromEventView( context,roiELs,m_inputRoIKey,prevDecisionContainer ) ); - - ATH_MSG_DEBUG( "Found " << roiELs.size() << " rois." ); - for ( const ElementLink< TrigRoiDescriptorCollection >& roiLink : roiELs ) - ATH_MSG_DEBUG( " -- RoI eta=" << (*roiLink)->eta() << - " phi=" << (*roiLink)->phi() ); - - // The following is just for debugging. - // Retrieve PVs - ElementLinkVector< xAOD::VertexContainer > vertexELs; - if ( m_retrieveVertexFromEventView == true ) - CHECK( retrieveObjectFromEventView( context,vertexELs,m_inputPrmVtx,prevDecisionContainer ) ); - else - CHECK( retrieveObjectFromStoreGate( context,vertexELs,m_inputPrmVtx ) ); - - ATH_MSG_DEBUG( "Found " << vertexELs.size() <<" vertexes." ); - for ( const ElementLink< xAOD::VertexContainer >& vertexLink : vertexELs ) - ATH_MSG_DEBUG( " -- PV x="<< (*vertexLink)->x() << - " y=" << (*vertexLink)->y() << - " z=" << (*vertexLink)->z() ); - - // ========================================================================================================================== - // ** Prepare Outputs - // ========================================================================================================================== - - // Decisions - SG::WriteHandle< TrigCompositeUtils::DecisionContainer > handle = TrigCompositeUtils::createAndStore( decisionOutput(), context ); - TrigCompositeUtils::DecisionContainer *outputDecisions = handle.ptr(); - - // ========================================================================================================================== - // ** Compute Decisions - // ========================================================================================================================== - - ATH_MSG_DEBUG("Creating Output Decisions and Linking Stuff to it"); - std::vector< TrigCompositeUtils::Decision* > newDecisions; - - for ( const TrigCompositeUtils::Decision* inputDecision : *prevDecisionContainer ) { - - // Retrieve jet link stored in the navigation upstream and check if the b-jet code is selecting it - // If so, create an output decision and attach the new jet to the output decision - // If not, do not create the output decision and go to the next input decision - ATH_MSG_DEBUG( "Retrieving input jet from the upstream code!" ); - std::vector< TrigCompositeUtils::LinkInfo< xAOD::JetContainer > > inputJetELInfo = TrigCompositeUtils::findLinks< xAOD::JetContainer >( inputDecision, TrigCompositeUtils::featureString(), TrigDefs::lastFeatureOfType ); - ATH_MSG_DEBUG( "Found a jet Link vector of size: " << inputJetELInfo.size() ); - ATH_CHECK( inputJetELInfo.size() == 1 ); - ATH_CHECK( inputJetELInfo.at(0).isValid() ); - - const xAOD::Jet *inputJet = *(inputJetELInfo.at(0).link); - ATH_MSG_DEBUG( " -- pt=" << inputJet->p4().Et() << - " eta=" << inputJet->eta() << - " phi=" << inputJet->phi() ); - - // Do geometrical matching to check if the jet is amidst the selected ones (b-jet applies ID acceptance requirements) - int Jetindex = -1; - double minDr = 9999.; - - for ( unsigned int jeti(0); jeti < jetELs.size(); jeti++ ) { - const ElementLink< xAOD::JetContainer >& jetLink = jetELs.at( jeti ); - - double deltaEta = std::abs( inputJet->eta() - (*jetLink)->eta() ); - double deltaPhi = CxxUtils::wrapToPi( inputJet->phi() - (*jetLink)->phi() ); - double dR = sqrt( pow(deltaEta,2) + pow(deltaPhi,2) ); - - if ( dR < minDr && dR < 0.1 ) { - minDr = dR; - Jetindex = jeti; - } - } - - if ( Jetindex < 0 ) { - ATH_MSG_DEBUG( "No jet matching! The jet was not selected by the b-jet code due to ID acceptance cut." ); - continue; - } else { - ATH_MSG_DEBUG( "The jet has been selected by the b-jet code (ID acceptance)!" ); - ATH_MSG_DEBUG( "Output decision will be created." ); - } - // ========================== - - TrigCompositeUtils::Decision *toAdd = TrigCompositeUtils::newDecisionIn( outputDecisions, - inputDecision, - "", context ); - - // Retrieve now the primary vertex to be attached to the decision. - // This is only one, but the container has size > 1! - int PVindex = -1; - - for ( unsigned int pvi(0); pvi < vertexELs.size(); pvi++ ) { - const ElementLink< xAOD::VertexContainer >& vertexLink = vertexELs.at( pvi ); - if ( (*vertexLink)->vertexType() != xAOD::VxType::VertexType::PriVtx ) continue; - PVindex = pvi; - break; - } - - if ( PVindex == -1 ) { - ATH_MSG_DEBUG( "Primary Vertex could not be found! Using dummy vertex!" ); - PVindex = 0; - } - // ========================== - - // Adding Links - CHECK( attachLinksToDecision( context,*toAdd,Jetindex,PVindex ) ); - newDecisions.push_back( toAdd ); - } - - ATH_MSG_DEBUG( "Received " << prevDecisionContainer->size() << " input decisions from upstream!" ); - ATH_MSG_DEBUG( "Created " << newDecisions.size() << " output decisions!" ); - - // ========================================================================================================================== - // ** Prepare input to Hypo Tools - // ========================================================================================================================== - - std::vector< TrigBjetEtHypoTool::TrigBjetEtHypoToolInfo > bJetHypoInputs; - - for ( TrigCompositeUtils::Decision* newDecision : newDecisions ) { - // Check navigation is set properly - if ( not newDecision->hasObjectCollectionLinks( TrigCompositeUtils::seedString() ) ) { - ATH_MSG_ERROR( "Trying to extract the IDs of the b-jet chains which are active." ); - ATH_MSG_ERROR( "But output decision has no link to seed collection." ); - return StatusCode::FAILURE; - } - // Check jets are attached properly - if ( not newDecision->hasObjectLink( TrigCompositeUtils::featureString() ) ) { - ATH_MSG_ERROR( "Trying to extract the associated jet from the output decisions." ); - ATH_MSG_ERROR( "But output decision has no link to jet." ); - return StatusCode::FAILURE; - } - // Check vertex is attached properly - if ( not newDecision->hasObjectLink( m_prmVtxLink.value() ) ) { - ATH_MSG_ERROR( "Trying to extract the associated primary vertex from the output decisions." ); - ATH_MSG_ERROR( "But output decision has no link to primary vertex" ); - return StatusCode::FAILURE; - } - - // Get Parent Decision - const ElementLinkVector< TrigCompositeUtils::DecisionContainer > mySeeds = newDecision->objectCollectionLinks< TrigCompositeUtils::DecisionContainer >( TrigCompositeUtils::seedString() ); - // Get Associated Jet - const ElementLink< xAOD::JetContainer > myJet = newDecision->objectLink< xAOD::JetContainer >( TrigCompositeUtils::featureString() ); - CHECK( myJet.isValid() ); - // Get primary vertex - const ElementLink< xAOD::VertexContainer > myVertex = newDecision->objectLink< xAOD::VertexContainer >( m_prmVtxLink.value() ); - CHECK( myVertex.isValid() ); - - // Extract the IDs of the b-jet chains which are active. - // Previous decision IDs. - const TrigCompositeUtils::Decision *previousDecision = *mySeeds.back(); - - TrigCompositeUtils::DecisionIDContainer previousDecisionIDs { - TrigCompositeUtils::decisionIDs( previousDecision ).begin(), - TrigCompositeUtils::decisionIDs( previousDecision ).end() - }; - - TrigBjetEtHypoTool::TrigBjetEtHypoToolInfo infoToAdd; - infoToAdd.previousDecisionIDs = previousDecisionIDs; - infoToAdd.jetEL = myJet; - infoToAdd.vertexEL = myVertex; - infoToAdd.decision = newDecision; - bJetHypoInputs.push_back( infoToAdd ); - } - - // ========================================================================================================================== - - // Run on Trigger Chains - for ( const ToolHandle< TrigBjetEtHypoTool >& tool : m_hypoTools ) - CHECK( tool->decide( bJetHypoInputs ) ); - - ATH_MSG_DEBUG( "Exiting with " << handle->size() << " decisions" ); - ATH_MSG_DEBUG( "CHECKING OUTPUT DECISION HANDLE" ); - CHECK( hypoBaseOutputProcessing(handle) ); - - // ========================================================================================================================== - - return StatusCode::SUCCESS; -} - -StatusCode TrigBjetEtHypoAlgMT::attachLinksToDecision( const EventContext& context, - TrigCompositeUtils::Decision& toAdd, - int index, - int indexPrmVertex ) const { - - // Do the linking... - // Link Jet - CHECK( attachObjectLinkToDecisionFromEventView( context, - toAdd, - m_inputJetsKey, - TrigCompositeUtils::featureString(), - index ) ); - - // Link RoI - CHECK( attachObjectLinkToDecisionFromEventView( context, - toAdd, - m_inputRoIKey, - m_roiLink.value(), - index ) ); - - // Link Vertex - if ( m_retrieveVertexFromEventView ) - CHECK( attachObjectLinkToDecisionFromEventView( context, - toAdd, - m_inputPrmVtx, - m_prmVtxLink.value(), - indexPrmVertex ) ); - else - CHECK( attachObjectLinkToDecisionFromStoreGate( toAdd, - m_inputPrmVtx, - m_prmVtxLink.value(), - indexPrmVertex ) ); - - ATH_MSG_DEBUG(" ** Added object links to output decision"); - return StatusCode::SUCCESS; -} - diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h deleted file mode 100644 index 466c38bded7db804ba23832410ab257fab8a45dd..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetEtHypoAlgMT.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGBJETHYPO_TRIGBJETETHYPOALGMT_H -#define TRIGBJETHYPO_TRIGBJETETHYPOALGMT_H 1 - -#include "TrigBjetHypoAlgBaseMT.h" - -/** - * @class Implements b-jet selection for the new HLT framework - * @brief - **/ - -class TrigBjetEtHypoAlgMT : public TrigBjetHypoAlgBaseMT { - public: - - TrigBjetEtHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ); - - virtual StatusCode initialize(); - virtual StatusCode execute( const EventContext& context ) const; - - protected: - TrigBjetEtHypoAlgMT(); - - virtual StatusCode attachLinksToDecision( const EventContext&, - TrigCompositeUtils::Decision&, - int index, - int indexPrmVertex = 0 ) const; - - protected: - ToolHandleArray< TrigBjetEtHypoTool > m_hypoTools {this,"HypoTools",{},"Hypo Tools"}; - - Gaudi::Property< std::string > m_roiLink {this,"RoILink","Undefined","RoI link to attach to the output decision"}; - Gaudi::Property< std::string > m_prmVtxLink {this,"PrmVtxLink","Undefined","PrmVtx link to attach to the output decision"}; - - Gaudi::Property< bool > m_retrieveVertexFromEventView {this,"RetrieveVertexFromEventView",false,"State where the prim vertex has to be retrieved from the Event or from the View context"}; - - SG::ReadHandleKey< xAOD::JetContainer > m_inputJetsKey {this,"Jets","Undefined","Input Jet Container Key"}; - SG::ReadHandleKey< TrigRoiDescriptorCollection > m_inputRoIKey {this,"RoIs","Undefined","Input RoIs that will be linked to the output decision"}; - SG::ReadHandleKey< xAOD::VertexContainer > m_inputPrmVtx {this,"PrmVtx","Undefined","Primary vertex to be linked to the output decision"}; -}; - - -#endif diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.h index fa889e04c369d66fcb812e8f1509c5f16274eb2e..a1cfed70c7182c0521eaaaf361d608527f86bcd3 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.h +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.h @@ -38,10 +38,25 @@ class TrigBjetHypoAlgBaseMT : public ::HypoBase { StatusCode retrievePreviousDecisionContainer( const EventContext&, const TrigCompositeUtils::DecisionContainer*& ) const; - virtual StatusCode attachLinksToDecision( const EventContext&, - TrigCompositeUtils::Decision&, - int index, - int indexPrmVertex = 0 ) const = 0; + + template < class CONTAINER > + StatusCode retrieveCollectionFromView( const EventContext&, + ElementLinkVector< CONTAINER >&, + const SG::ReadHandleKey< CONTAINER >&, + const TrigCompositeUtils::Decision* ) const; + + template < class CONTAINER > + StatusCode retrieveObjectFromNavigation( const std::string&, + ElementLink< CONTAINER >&, + const TrigCompositeUtils::Decision* ) const; + + template < class CONTAINER > + StatusCode retrieveCollectionFromNavigation( const std::string& linkName, + ElementLinkVector< CONTAINER >& objELs, + const TrigCompositeUtils::DecisionContainer* ) const; + + + template < class CONTAINER > diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.icc b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.icc index 6a8e02c0149dce7a0916024c885d380bb83e642c..a3e024b39a9661fa2b3caf0b0398b82e7666a852 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.icc +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBjetHypoAlgBaseMT.icc @@ -2,6 +2,71 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ + + +template < class CONTAINER > +StatusCode TrigBjetHypoAlgBaseMT::retrieveCollectionFromView( const EventContext& context, + ElementLinkVector< CONTAINER >& EL, + const SG::ReadHandleKey< CONTAINER >& inputKey, + const TrigCompositeUtils::Decision* prevDecision ) const { + + ElementLink< ViewContainer > viewEL = prevDecision->objectLink< ViewContainer >( TrigCompositeUtils::viewString() ); + ATH_CHECK( viewEL.isValid() ); + ATH_MSG_DEBUG( "Retrieved View" ); + + SG::ReadHandle< CONTAINER > Handle = ViewHelper::makeHandle( *viewEL, inputKey, context ); + ATH_CHECK( Handle.isValid() ); + ATH_MSG_DEBUG ( "EventView " << (*viewEL)->name() << " has object's container of size: " << Handle->size() ); + + for ( unsigned int index(0); index < Handle->size(); index++ ) { + ElementLink< CONTAINER > toAdd = ViewHelper::makeLink< CONTAINER >( *viewEL, Handle, index ); + ATH_CHECK( toAdd.isValid() ); + EL.push_back( toAdd ); + } + + return StatusCode::SUCCESS; +} + +template < class CONTAINER > +StatusCode TrigBjetHypoAlgBaseMT::retrieveObjectFromNavigation( const std::string& linkName, + ElementLink< CONTAINER >& EL, + const TrigCompositeUtils::Decision* prevDecision ) const { + + const std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > myObj = + TrigCompositeUtils::findLinks< CONTAINER >( prevDecision, linkName.c_str(), TrigDefs::lastFeatureOfType); + + if ( myObj.size() != 1 ) { + ATH_MSG_ERROR( "Did not find only 1 object for link `" << linkName << "` stored in navigation!" ); + return StatusCode::FAILURE; + } + + ATH_CHECK( myObj.at(0).isValid() ); + EL = myObj.at(0).link; + + return StatusCode::SUCCESS; +} + +template < class CONTAINER > +StatusCode TrigBjetHypoAlgBaseMT::retrieveCollectionFromNavigation( const std::string& linkName, + ElementLinkVector< CONTAINER >& objELs, + const TrigCompositeUtils::DecisionContainer* prevDecisionContainer ) const { + + for ( const TrigCompositeUtils::Decision *prevDecision : *prevDecisionContainer ) { + ElementLink< CONTAINER > objEL; + CHECK( retrieveObjectFromNavigation( linkName.c_str(), objEL, prevDecision ) ); + objELs.push_back( objEL ) ; + } + + return StatusCode::SUCCESS; +} + + + + + + + + template < class CONTAINER > StatusCode TrigBjetHypoAlgBaseMT::retrieveObjectFromStoreGate( const EventContext& context, ElementLinkVector< CONTAINER >& ELs, diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx index 4f7d5ff16bc9e2fa8ad0d651846cb1c1debae73f..ca2fa96e72d4b89a867c1ff1d3445d10d55c9c64 100755 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigBtagFexMT.cxx @@ -130,6 +130,9 @@ StatusCode TrigBtagFexMT::execute() { std::unique_ptr< xAOD::BTaggingAuxContainer > outputBtaggingAux = std::make_unique< xAOD::BTaggingAuxContainer >(); outputBtagging->setStore( outputBtaggingAux.get() ); + xAOD::BTagging *toAdd = new xAOD::BTagging(); + outputBtagging->push_back( toAdd ); + SG::WriteHandle< xAOD::BTaggingContainer > btaggingHandle = SG::makeHandle( m_outputBTaggingContainerKey,ctx ); CHECK( btaggingHandle.record( std::move( outputBtagging ),std::move( outputBtaggingAux ) ) ); ATH_MSG_DEBUG( "Exiting with " << btaggingHandle->size() << " btagging objects" ); diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.cxx deleted file mode 100644 index 883471e849810d1fa6c8b83e0dc953974f3dc6e0..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.cxx +++ /dev/null @@ -1,171 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// ************************************************ -// -// NAME: TrigJetSplitterMT.cxx -// PACKAGE: Trigger/TrigHypothesis/TrigBjetHypo -// -// ************************************************ - -#include "TrigJetSelectorMT.h" -#include "CxxUtils/phihelper.h" - -// ----------------------------------------------------------------------------------------------------------------- - -TrigJetSelectorMT::TrigJetSelectorMT(const std::string& name, ISvcLocator* pSvcLocator) : - AthAlgorithm(name, pSvcLocator) {} - -// ----------------------------------------------------------------------------------------------------------------- - -StatusCode TrigJetSelectorMT::initialize() { - - ATH_MSG_DEBUG( "Initializing " << name() << "... " ); - - ATH_MSG_DEBUG( "declareProperty review:" ); - ATH_MSG_DEBUG( " ** " << m_minJetEt ); - ATH_MSG_DEBUG( " ** " << m_maxJetEta ); - ATH_MSG_DEBUG( " ** " << m_etaHalfWidth ); - ATH_MSG_DEBUG( " ** " << m_phiHalfWidth ); - ATH_MSG_DEBUG( " ** " << m_zHalfWidth ); - - ATH_MSG_DEBUG( "Initializing HandleKeys" ); - CHECK( m_inputJetsKey.initialize() ); - CHECK( m_inputVertexKey.initialize() ); - CHECK( m_outputJetKey.initialize() ); - CHECK( m_outputRoiKey.initialize() ); - - return StatusCode::SUCCESS; -} - - -// ----------------------------------------------------------------------------------------------------------------- - - -StatusCode TrigJetSelectorMT::execute() { - - ATH_MSG_DEBUG( "Executing " << name() ); - const EventContext& context = getContext(); - - // ============================================================================================================================== - // ** Retrieve Ingredients - // ============================================================================================================================== - - // Jets - SG::ReadHandle< xAOD::JetContainer > inputJetContainerHandle = SG::makeHandle( m_inputJetsKey,context ); - ATH_MSG_DEBUG( "Retrieved jets from : " << m_inputJetsKey.key() ); - CHECK( inputJetContainerHandle.isValid() ); - - const xAOD::JetContainer *inputJetCollection = inputJetContainerHandle.get(); - ATH_MSG_DEBUG( "Found " << inputJetCollection->size() << " jets." ); - for ( const xAOD::Jet *jet : * inputJetCollection ) - ATH_MSG_DEBUG(" -- Jet pt=" << jet->p4().Et() <<" eta="<< jet->eta() << " phi="<< jet->phi() ); - - // Primary Vertex - SG::ReadHandle< xAOD::VertexContainer > inputVertexContainer = SG::makeHandle( m_inputVertexKey,context ); - ATH_MSG_DEBUG( "Retrieving primary vertex from : " << m_inputVertexKey.key() ); - CHECK( inputVertexContainer.isValid() ); - - const xAOD::VertexContainer *vertexContainer = inputVertexContainer.get(); - ATH_MSG_DEBUG( "Found Vertex container with " << vertexContainer->size() << " elements" ); - for ( const xAOD::Vertex *vertex : *vertexContainer ) - ATH_MSG_DEBUG( " ** Vertex = (" << vertex->x() << - "," << vertex->y() << - "," << vertex->z() << ")" ); - - const xAOD::Vertex *primaryVertex = getPrimaryVertex( vertexContainer ); - if ( primaryVertex == nullptr ) { - ATH_MSG_ERROR( "No primary vertex has been found for this event!" ); - return StatusCode::FAILURE; - } - - ATH_MSG_DEBUG( " ** PV = (" << primaryVertex->x() << - "," << primaryVertex->y() << - "," << primaryVertex->z() << ")" ); - - // ============================================================================================================================== - // ** Prepare the output collections - // ============================================================================================================================== - - std::unique_ptr< xAOD::JetContainer > outputJetContainer = std::make_unique< xAOD::JetContainer >(); - std::unique_ptr< xAOD::JetAuxContainer > outputJetAuxContainer = std::make_unique< xAOD::JetAuxContainer >(); - outputJetContainer->setStore( outputJetAuxContainer.get() ); - - std::unique_ptr< TrigRoiDescriptorCollection > outputRoiContainer = std::make_unique< TrigRoiDescriptorCollection >(); - - // ============================================================================================================================== - // ** Do the computation - // ============================================================================================================================== - - for ( const xAOD::Jet *jet : *inputJetCollection ) { - double jetPt = jet->p4().Et() * 1e-3; - double jetEta = jet->eta(); - double jetPhi = jet->phi(); - - ATH_MSG_DEBUG( "** Jet :: Et " << jetPt <<"; Eta " << jetEta << "; Phi " << jetPhi ); - - if ( jetPt < m_minJetEt ) { - ATH_MSG_DEBUG( "** Jet below the " << m_minJetEt.value() << " GeV threshold; Et " << jetPt <<"; Skipping this Jet." ); - continue; - } - - if ( fabs( jetEta ) > m_maxJetEta ) { - ATH_MSG_DEBUG( "** Jet outside the |eta| < " << m_maxJetEta.value() << " requirement (ID acceptance); Eta = " << jetEta << "; Skipping this Jet." ); - continue; - } - - // Copy Jet - xAOD::Jet *toBeAdded = new xAOD::Jet(); - outputJetContainer->push_back( toBeAdded ); - *toBeAdded = *jet; - - // Create RoI - ATH_MSG_DEBUG( " ** Imposing Z constraint while building RoI" ); - double phiMinus = CxxUtils::wrapToPi( jetPhi - m_phiHalfWidth ); - double phiPlus = CxxUtils::wrapToPi( jetPhi + m_phiHalfWidth ); - - double etaMinus = jetEta - m_etaHalfWidth; - double etaPlus = jetEta + m_etaHalfWidth; - - double zMinus = primaryVertex->z() - m_zHalfWidth; - double zPlus = primaryVertex->z() + m_zHalfWidth; - - TrigRoiDescriptor *newRoI = new TrigRoiDescriptor( jet->eta(),etaMinus, etaPlus, - jet->phi(), phiMinus, phiPlus, - primaryVertex->z(),zMinus,zPlus ); - outputRoiContainer->push_back( newRoI ); - } - - - // ============================================================================================================================== - // ** Store object collections - // ============================================================================================================================== - - SG::WriteHandle< xAOD::JetContainer > outputJetContainerHandle = SG::makeHandle( m_outputJetKey, context ); - CHECK( outputJetContainerHandle.record( std::move( outputJetContainer ), std::move( outputJetAuxContainer ) ) ); - ATH_MSG_DEBUG( "Exiting with " << outputJetContainerHandle->size() << " shortlisted jets" ); - - SG::WriteHandle< TrigRoiDescriptorCollection > outputRoIContainerHandle = SG::makeHandle( m_outputRoiKey,context ); - CHECK( outputRoIContainerHandle.record( std::move( outputRoiContainer ) ) ); - ATH_MSG_DEBUG( "Exiting with " << outputRoIContainerHandle->size() << " RoIs" ); - - return StatusCode::SUCCESS; -} - -const xAOD::Vertex* TrigJetSelectorMT::getPrimaryVertex( const xAOD::VertexContainer* vertexContainer ) const { - // In case we need more complex selection - if ( vertexContainer->size() == 0 ) { - ATH_MSG_WARNING( "Vertex Container has size 0! This can't be right!" ); - return nullptr; - } - - for ( const xAOD::Vertex *vertex : *vertexContainer ) { - if ( vertex->vertexType() != xAOD::VxType::VertexType::PriVtx ) continue; - return vertex; - } - - ATH_MSG_DEBUG( "None of the vertexes in the vertex container is a primary vertex!" ); - ATH_MSG_DEBUG( "Using dummy vertex!" ); - return vertexContainer->front(); -} diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.h b/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.h deleted file mode 100644 index 9c86e463fa4d425f5aee58eb69811a83fd9d3bb6..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/TrigJetSelectorMT.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// ************************************************ -// -// NAME: TrigJetSplitterMT.h -// PACKAGE: Trigger/TrigHypothesis/TrigBjetHypo -// -// AUTHOR: Carlo Varni -// EMAIL: carlo.varni@ge.infn.it -// -// ************************************************ - -#ifndef TRIGJETSELECTOR_MT_H -#define TRIGJETSELECTOR_MT_H - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" - -#include "xAODJet/JetContainer.h" -#include "xAODJet/JetAuxContainer.h" - -#include "xAODTracking/VertexContainer.h" -#include "xAODTracking/VertexAuxContainer.h" - -#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" - -class TrigJetSelectorMT : public AthAlgorithm { - public: - TrigJetSelectorMT(const std::string&, ISvcLocator*); - - StatusCode initialize(); - StatusCode execute(); - - private: - const xAOD::Vertex* getPrimaryVertex( const xAOD::VertexContainer* ) const; - - private: - Gaudi::Property< double > m_minJetEt {this,"JetMinEt",15,"Minimum of Output Jet Et in GeV"}; - Gaudi::Property< double > m_maxJetEta {this,"JetMaxEta",3.2,"Maximum eta acceptance of output Jet (ID acceptance)"}; - - Gaudi::Property< double > m_etaHalfWidth {this,"EtaHalfWidth",0.4,"Eta Half Width"}; - Gaudi::Property< double > m_phiHalfWidth {this,"PhiHalfWidth",0.4,"Phi Half Width"}; - Gaudi::Property< double > m_zHalfWidth {this,"ZHalfWidth",10.0,"Z Half Width in mm"}; - - //=========== Handles - SG::ReadHandleKey< xAOD::JetContainer > m_inputJetsKey {this,"InputJets","Undefined","Input Jet Container Key"}; - SG::ReadHandleKey< xAOD::VertexContainer > m_inputVertexKey {this,"InputVertex","Undefined","Input Vertex Key"}; - - SG::WriteHandleKey< xAOD::JetContainer > m_outputJetKey {this,"OutputJets","Undefined","Output Jet Container Key"}; - SG::WriteHandleKey< TrigRoiDescriptorCollection > m_outputRoiKey {this,"OutputRoi","Undefined","Output RoI Container Key"}; -}; - -#endif diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx index 49375f24ac946b90e9d4fdab970031130a81c0e1..c8322b1074ef98de5ab9656c4c06e6a7bd3568e7 100644 --- a/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigBjetHypo/src/components/TrigBjetHypo_entries.cxx @@ -12,14 +12,12 @@ #include "TrigBjetHypo/TrigBjetEtHypo.h" #include "TrigBjetHypo/TrigFarawayJetFinderAllTE.h" -#include "../TrigBjetEtHypoAlgMT.h" #include "../TrigBjetBtagHypoAlgMT.h" #include "../TrigBjetEtHypoTool.h" #include "../TrigBjetBtagHypoTool.h" #include "../TrigBtagFexMT.h" #include "../TrigSuperRoIBuilderMT.h" -#include "../TrigJetSelectorMT.h" DECLARE_COMPONENT( TrigBjetHypoAllTE ) DECLARE_COMPONENT( TrigBjetHypo ) @@ -35,7 +33,6 @@ DECLARE_COMPONENT( TrigBjetEtHypo ) DECLARE_COMPONENT( TrigFarawayJetFinderAllTE ) -DECLARE_COMPONENT( TrigBjetEtHypoAlgMT ) DECLARE_COMPONENT( TrigBjetBtagHypoAlgMT ) DECLARE_COMPONENT( TrigBjetEtHypoTool ) @@ -43,4 +40,3 @@ DECLARE_COMPONENT( TrigBjetBtagHypoTool ) DECLARE_COMPONENT( TrigBtagFexMT ) DECLARE_COMPONENT( TrigSuperRoIBuilderMT ) -DECLARE_COMPONENT( TrigJetSelectorMT ) diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt index ef16871f27d794a72433dd4c3e61332f21ef5716..f7d4b1273235167de6b71ea54f13b1fbe736aa12 100644 --- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt +++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt @@ -8,6 +8,7 @@ atlas_subdir( ViewAlgs ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Event/xAOD/xAODTrigger + Event/xAOD/xAODTracking GaudiKernel Control/AthContainers Control/AthLinks @@ -30,7 +31,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( ViewAlgsLib src/*.cxx PUBLIC_HEADERS ViewAlgs - LINK_LIBRARIES xAODTrigger GaudiKernel AthViews xAODTrigCalo xAODTrigEgamma xAODJet xAODMuon + LINK_LIBRARIES xAODTrigger xAODTracking GaudiKernel AthViews xAODTrigCalo xAODTrigEgamma xAODJet xAODMuon PRIVATE_LINK_LIBRARIES AthenaBaseComps CxxUtils MuonCombinedEvent TrigConfHLTData TrigSteeringEvent DecisionHandlingLib TrigCompositeUtilsLib ) atlas_add_component( ViewAlgs diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx index 48276eac59c5a8e1ec43c334f94bef8e81040317..84292ade21be048a66fba0de3995efae33a6f9d1 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx @@ -246,15 +246,21 @@ StatusCode EventViewCreatorAlgorithm::placeMuonInView( const xAOD::Muon* theObje // TODO - Template this? StatusCode EventViewCreatorAlgorithm::placeJetInView( const xAOD::Jet* theObject, SG::View* view, const EventContext& context ) const { + // fill the Jet output collection ATH_MSG_DEBUG( "Adding Jet To View : " << m_inViewJets.key() ); - auto oneObjectCollection = std::make_unique< ConstDataVector< xAOD::JetContainer > >(); - oneObjectCollection->clear( SG::VIEW_ELEMENTS ); - oneObjectCollection->push_back( theObject ); - //store in the view - auto handle = SG::makeHandle( m_inViewJets,context ); - ATH_CHECK( handle.setProxyDict( view ) ); - ATH_CHECK( handle.record( std::move( oneObjectCollection ) ) ); + auto oneObjectCollection = std::make_unique< xAOD::JetContainer >(); + auto oneObjectAuxCollection = std::make_unique< xAOD::JetAuxContainer >(); + oneObjectCollection->setStore( oneObjectAuxCollection.get() ); + + xAOD::Jet* copiedJet = new xAOD::Jet(); + oneObjectCollection->push_back( copiedJet ); + *copiedJet = *theObject; + + auto handle = SG::makeHandle( m_inViewJets,context ); + ATH_CHECK( handle.setProxyDict( view ) ); + ATH_CHECK( handle.record( std::move(oneObjectCollection),std::move(oneObjectAuxCollection) ) ); + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h index b90bc61c846d6c6dbf22e4f6437b88cb3a81f27c..4e54f68397460153c4cd021ce9ec814aa1517b27 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h +++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h @@ -105,7 +105,7 @@ class EventViewCreatorAlgorithm : public ::InputMakerBase "Jet slice specific option. Place Jet inside newly spawned View instance. See also InViewJets" }; // TODO. In the next iteration, start to use this. Remove "_PROPERTY" which is there to catch against algs with identical properties - SG::WriteHandleKey< ConstDataVector<xAOD::JetContainer> > m_inViewJets {this,"InViewJets_PROPERTY","", + SG::WriteHandleKey< xAOD::JetContainer > m_inViewJets {this,"InViewJets","", "Name with which the Jet should be inserted into the views"}; /** diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.cxx deleted file mode 100644 index e043757b8e13b43ef807e5c9ef2f430600a84642..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.cxx +++ /dev/null @@ -1,139 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -/// -/// General-purpose view creation algorithm <bwynne@cern.ch> -/// - -#include "EventViewCreatorAlgorithmWithJets.h" -#include "AthLinks/ElementLink.h" -#include "AthViews/ViewHelper.h" -#include "AthViews/View.h" -#include "TrigCompositeUtils/TrigCompositeUtils.h" -#include "TrigCompositeUtils/HLTIdentifier.h" - -using namespace TrigCompositeUtils; - -EventViewCreatorAlgorithmWithJets::EventViewCreatorAlgorithmWithJets( const std::string& name, ISvcLocator* pSvcLocator ) - : EventViewCreatorAlgorithm( name, pSvcLocator ) {} - -EventViewCreatorAlgorithmWithJets::~EventViewCreatorAlgorithmWithJets() {} - -StatusCode EventViewCreatorAlgorithmWithJets::initialize() { - - ATH_CHECK( EventViewCreatorAlgorithm::initialize() ); - ATH_CHECK( m_inViewJets.initialize() ); - - return StatusCode::SUCCESS; -} - -StatusCode EventViewCreatorAlgorithmWithJets::execute( const EventContext& context ) const { - // create the output decisions from the input collections - SG::WriteHandle<DecisionContainer> outputHandle = createAndStore( decisionOutputs(), context ); - ATH_CHECK (decisionInputToOutput(context, outputHandle)); - - // make the views - auto viewsHandle = SG::makeHandle( m_viewsKey, context ); - auto viewVector1 = std::make_unique< ViewContainer >(); - ATH_CHECK( viewsHandle.record( std::move( viewVector1 ) ) ); - auto viewVector = viewsHandle.ptr(); - unsigned int viewCounter = 0; - - //map all RoIs that are stored - std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision; - - if( not outputHandle.isValid() ) { - ATH_MSG_ERROR( "Got no decisions from output "<< outputHandle.key() << " because handle not valid"); - return StatusCode::FAILURE; - } - if( outputHandle->size() == 0){ // input filtered out - ATH_MSG_ERROR( "Got no decisions from output "<< outputHandle.key()<<": handle is valid but container is empty. Is this expected?"); - return StatusCode::FAILURE; - } - - ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" ); - // loop over output decisions in container of outputHandle, follow link to inputDecision - for ( auto outputDecision : *outputHandle){ - ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision); - // loop over input links as predecessors - for (auto input: inputLinks){ - const Decision* inputDecision = *input; - - // Retrieve jets ... - ATH_MSG_DEBUG( "Checking there are jets linked to decision object" ); - TrigCompositeUtils::LinkInfo< xAOD::JetContainer > jetELInfo = TrigCompositeUtils::findLink< xAOD::JetContainer >( inputDecision,TrigCompositeUtils::featureString() ); - ATH_CHECK( jetELInfo.isValid() ); - const xAOD::Jet *jet = *jetELInfo.link; - ATH_MSG_DEBUG( "Placing xAOD::JetContainer " ); - ATH_MSG_DEBUG( " -- pt="<< jet->p4().Et() <<" eta="<< jet->eta() << " phi="<< jet->phi() ); - - // find the RoI - auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision, m_roisLink.value() ); - auto roiEL = roiELInfo.link; - ATH_CHECK( roiEL.isValid() ); - // check if already found - auto roiIt=find(RoIsFromDecision.begin(), RoIsFromDecision.end(), roiEL); - if ( roiIt == RoIsFromDecision.end() ){ - RoIsFromDecision.push_back(roiEL); // just to keep track of which we have used - const TrigRoiDescriptor* roi = *roiEL; - ATH_MSG_DEBUG("Found RoI:" <<*roi<<" FS="<<roi->isFullscan()); - ATH_MSG_DEBUG( "Positive decisions on RoI, preparing view" ); - - // make the view - ATH_MSG_DEBUG( "Making the View" ); - auto newView = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view - - // Use a fall-through filter if one is provided - if ( m_viewFallFilter.size() ) { - newView->setFilter( m_viewFallFilter ); - } - - viewVector->push_back( newView ); - ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) ); - - // link decision to this view - - outputDecision->setObjectLink( TrigCompositeUtils::viewString(), ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC - ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 ); - ATH_CHECK( placeRoIInView( roiEL, viewVector->back(), context ) ); - ATH_CHECK( placeJetInView( jet, viewVector->back(), context ) ); - } - else { - int iview = roiIt-RoIsFromDecision.begin(); - outputDecision->setObjectLink( TrigCompositeUtils::viewString(), ElementLink< ViewContainer >(m_viewsKey.key(), iview ) ); //adding view to TC - ATH_MSG_DEBUG( "Adding already mapped view " << iview << " in ViewVector , to new decision"); - } - }// loop over previous inputs - } // loop over decisions - - ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" ); - ATH_CHECK( ViewHelper::scheduleViews( viewVector, // Vector containing views - m_viewNodeName, // CF node to attach views to - context, // Source context - getScheduler(), - m_reverseViews ) ); - - // store views - // auto viewsHandle = SG::makeHandle( m_viewsKey ); - // ATH_CHECK( viewsHandle.record( std::move( viewVector ) ) ); - ATH_MSG_DEBUG( "Store "<< viewsHandle->size() <<" Views"); - if (msgLvl(MSG::DEBUG)) debugPrintOut(context, outputHandle); - - return StatusCode::SUCCESS; -} - -StatusCode EventViewCreatorAlgorithmWithJets::placeJetInView( const xAOD::Jet* theObject, SG::View* view, const EventContext& context ) const { - // fill the Jet output collection - ATH_MSG_DEBUG( "Adding Jet To View : " << m_inViewJets.key() ); - auto oneObjectCollection = std::make_unique< ConstDataVector< xAOD::JetContainer > >(); - oneObjectCollection->clear( SG::VIEW_ELEMENTS ); - oneObjectCollection->push_back( theObject ); - - //store in the view - auto handle = SG::makeHandle( m_inViewJets,context ); - ATH_CHECK( handle.setProxyDict( view ) ); - ATH_CHECK( handle.record( std::move( oneObjectCollection ) ) ); - return StatusCode::SUCCESS; -} - diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.h deleted file mode 100644 index cbe6f565b0a40ad390f45f8fc82139162b9768d5..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithJets.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ViewAlgs_EventViewCreatorAlgorithmWithJets_h -#define ViewAlgs_EventViewCreatorAlgorithmWithJets_h - -#include "EventViewCreatorAlgorithm.h" - -#include "xAODJet/JetContainer.h" -#include "xAODJet/JetAuxContainer.h" - - /** - * @class EventViewCreatorAlgorithmWithJets - * @brief Used at the start of a sequence to create the EventViews: retrieves filtered collection via menu decision from previous step and writes it out directly so it can be used as input by the reco alg that follows in sequence. - **/ - -class EventViewCreatorAlgorithmWithJets : public EventViewCreatorAlgorithm { - public: - EventViewCreatorAlgorithmWithJets( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~EventViewCreatorAlgorithmWithJets(); - - virtual StatusCode initialize() override; - virtual StatusCode execute(const EventContext&) const override; - - private: - - StatusCode placeJetInView( const xAOD::Jet* theObject, - SG::View* view, - const EventContext& context ) const; - - EventViewCreatorAlgorithmWithJets(); - - SG::WriteHandleKey< ConstDataVector<xAOD::JetContainer> > m_inViewJets {this,"InViewJets","Unspecified","Name with which the Jets should be inserted into the views"}; -}; - -#endif - diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx b/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..07b3a65ffe3f77e622f80ef0b75cd43281a2cb2f --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.cxx @@ -0,0 +1,125 @@ +/* +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" +#include "AthViews/ViewHelper.h" +#include "CxxUtils/phihelper.h" +#include "ViewCreatorCentredOnJetWithPVConstraintROITool.h" + +#include "xAODJet/JetContainer.h" +#include "xAODJet/JetAuxContainer.h" + +ViewCreatorCentredOnJetWithPVConstraintROITool::ViewCreatorCentredOnJetWithPVConstraintROITool( const std::string& type, + const std::string& name, + const IInterface* parent) + : base_class(type, name, parent) +{} + + +StatusCode ViewCreatorCentredOnJetWithPVConstraintROITool::initialize() { + ATH_CHECK( m_roisWriteHandleKey.initialize() ); + ATH_CHECK( m_vertexReadHandleKey.initialize() ); + + // FIXME: We have to renounce to the Vertex RedHandleKey due to problems in the scheduler's sanity checks + // 'Strongly connected components found in DF realm' (see ATR-21298) + // Short term way of avoiding the issue + renounce( m_vertexReadHandleKey ); + + return StatusCode::SUCCESS; +} + + +StatusCode ViewCreatorCentredOnJetWithPVConstraintROITool::attachROILinks( TrigCompositeUtils::DecisionContainer& decisions, + const EventContext& ctx ) const { + + // ===================================================================================== // + // Retrieve Primary Vertex... only 1 in the event + SG::ReadHandle< xAOD::VertexContainer > vertexContainerHandle = SG::makeHandle( m_vertexReadHandleKey,ctx ); + ATH_CHECK( vertexContainerHandle.isValid() ); + + const xAOD::VertexContainer *vertexContainer = vertexContainerHandle.get(); + ATH_MSG_DEBUG( "I'm working with " << vertexContainer->size() << " vertices" ); + + const xAOD::Vertex* primaryVertex = getPrimaryVertex( vertexContainer ); + if ( primaryVertex == nullptr ) { + ATH_MSG_ERROR( "No primary vertex has been found for this event!" ); + return StatusCode::FAILURE; + } + ATH_MSG_DEBUG( " ** PV = (" << primaryVertex->x() << + "," << primaryVertex->y() << + "," << primaryVertex->z() << ")" ); + + // ===================================================================================== // + // ===================================================================================== // + // Create output RoI collection + + SG::WriteHandle<TrigRoiDescriptorCollection> roisWriteHandle = TrigCompositeUtils::createAndStoreNoAux(m_roisWriteHandleKey, ctx); + // ===================================================================================== // + + for ( TrigCompositeUtils::Decision* outputDecision : decisions ) { + const std::vector< TrigCompositeUtils::LinkInfo< xAOD::JetContainer >> myFeature = TrigCompositeUtils::findLinks< xAOD::JetContainer >(outputDecision, TrigCompositeUtils::featureString(), TrigDefs::lastFeatureOfType); + + if (myFeature.size() != 1) { + ATH_MSG_ERROR("Did not find exactly one most-recent xAOD::Jet '" << TrigCompositeUtils::featureString() << "' for Decision object index " << outputDecision->index() + << ", found " << myFeature.size()); + return StatusCode::FAILURE; + } + ATH_CHECK(myFeature.at(0).isValid()); + + const xAOD::Jet *myJet = *(myFeature.at(0).link); + double jetPt = myJet->p4().Et(); + double jetEta = myJet->eta(); + double jetPhi = myJet->phi(); + + ATH_MSG_DEBUG("JET -- pt=" << jetPt << + " eta=" << jetEta << + " phi=" << jetPhi ); + + // create ROIs + ATH_MSG_DEBUG("Creating RoI"); + ATH_MSG_DEBUG( " ** Imposing Z constraint while building RoI" ); + double etaMinus = jetEta - m_roiEtaWidth; + double etaPlus = jetEta + m_roiEtaWidth; + + double phiMinus = CxxUtils::wrapToPi( jetPhi - m_roiPhiWidth ); + double phiPlus = CxxUtils::wrapToPi( jetPhi + m_roiPhiWidth ); + + double zMinus = primaryVertex->z() - m_roiZWidth; + double zPlus = primaryVertex->z() + m_roiZWidth; + + TrigRoiDescriptor *newROI = new TrigRoiDescriptor( jetEta,etaMinus, etaPlus, + jetPhi, phiMinus, phiPlus, + primaryVertex->z(),zMinus,zPlus ); + + roisWriteHandle->push_back( newROI ); + const ElementLink< TrigRoiDescriptorCollection > roiEL = ElementLink< TrigRoiDescriptorCollection >( *roisWriteHandle, roisWriteHandle->size() - 1, ctx ); + + outputDecision->setObjectLink( TrigCompositeUtils::roiString(), roiEL ); + outputDecision->setObjectLink( m_prmVtxLink.value(), + ElementLink< xAOD::VertexContainer >( m_vertexReadHandleKey.key(),primaryVertex->index() ) ); + + ATH_MSG_DEBUG("PRINTING DECISION"); + ATH_MSG_DEBUG( *outputDecision ); + } + + return StatusCode::SUCCESS; +} + +const xAOD::Vertex* ViewCreatorCentredOnJetWithPVConstraintROITool::getPrimaryVertex( const xAOD::VertexContainer* vertexContainer ) const { + // In case we need more complex selection + if ( vertexContainer->size() == 0 ) { + ATH_MSG_WARNING( "Vertex Container has size 0! This can't be right!" ); + return nullptr; + } + + for ( unsigned int i(0); i<vertexContainer->size(); i++ ) { + const xAOD::Vertex *vertex = vertexContainer->at(i); + if ( vertex->vertexType() != xAOD::VxType::VertexType::PriVtx ) continue; + return vertex; + } + + ATH_MSG_DEBUG( "None of the vertexes in the vertex container is a primary vertex!" ); + ATH_MSG_DEBUG( "Using dummy vertex!" ); + return vertexContainer->at(0); +} diff --git a/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h b/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h new file mode 100644 index 0000000000000000000000000000000000000000..cc65588dab5ae44b1c70f421fe6e77973338b700 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/ViewCreatorCentredOnJetWithPVConstraintROITool.h @@ -0,0 +1,65 @@ +/* +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H +#define VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/WriteHandleKey.h" +#include "ViewAlgs/IViewCreatorROITool.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" + +#include "xAODTracking/VertexContainer.h" +#include "xAODTracking/VertexAuxContainer.h" + +/** + * @class ViewCreatorCentredOnJetWithPVConstraintROITool + * Creates a new ROI centred on an object deriving from xAOD::Jet adding a PV constraint. + * + * Stores this new ROI in the output container, and links it to the Decision Object + * + * The new EventView spawned by the parent EventViewCreatorAlgorithm of this tool will process in this new ROI. + * + * In the majority of cases, this tool will be used to create the new ROI centred on the "feature" from the previous Step. + **/ + class ViewCreatorCentredOnJetWithPVConstraintROITool : public extends<AthAlgTool, IViewCreatorROITool> +{ +public: + ViewCreatorCentredOnJetWithPVConstraintROITool(const std::string& type, const std::string& name, const IInterface* parent); + + virtual ~ViewCreatorCentredOnJetWithPVConstraintROITool() = default; + + virtual StatusCode initialize() override; + + /** + * @brief Tool interface method. + **/ + virtual StatusCode attachROILinks(TrigCompositeUtils::DecisionContainer& decisions, const EventContext& ctx) const override; + + + protected: + const xAOD::Vertex* getPrimaryVertex( const xAOD::VertexContainer* ) const; + + public: + SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey {this,"RoisWriteHandleKey","", + "Name of the ROI collection produced by this tool."}; + + Gaudi::Property< double > m_roiEtaWidth{this,"RoIEtaWidth",0.4, + "Extent of the ROI in eta from its centre"}; + + Gaudi::Property< double > m_roiPhiWidth{this,"RoIPhiWidth",0.4, + "Extent of the ROI in phi from its centre"}; + + Gaudi::Property< double > m_roiZWidth {this,"RoIZWidth",10.0, + "Z Half Width in mm"}; + + SG::ReadHandleKey< xAOD::VertexContainer > m_vertexReadHandleKey {this,"VertexReadHandleKey","", + "Name of the Vertex collection required as input for constructing the ROI"}; + + Gaudi::Property< std::string > m_prmVtxLink {this,"PrmVtxLink","", + "PrmVtx link to attach to the output decision"}; + +}; + +#endif //> !VIEWALGS_VIEWCREATORCENTREDONJETWITHPVCONSTRAINTROITOOL_H diff --git a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx index 364d36350ad49b9080d17e98f29bf729e4788020..ba3ed577af455e179ff54d630f9b915e5805b74e 100644 --- a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx +++ b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx @@ -1,7 +1,6 @@ #include "../EventViewCreatorAlgorithm.h" -#include "../EventViewCreatorAlgorithmWithJets.h" #include "../MergeViews.h" #include "../ViewCreatorInitialROITool.h" #include "../ViewCreatorPreviousROITool.h" @@ -10,9 +9,9 @@ #include "../ViewCreatorFetchFromViewROITool.h" #include "../ViewCreatorCentredOnIParticleROITool.h" #include "../ViewCreatorCentredOnClusterROITool.h" +#include "../ViewCreatorCentredOnJetWithPVConstraintROITool.h" DECLARE_COMPONENT( EventViewCreatorAlgorithm ) -DECLARE_COMPONENT( EventViewCreatorAlgorithmWithJets ) DECLARE_COMPONENT( MergeViews ) DECLARE_COMPONENT( ViewCreatorInitialROITool ) DECLARE_COMPONENT( ViewCreatorPreviousROITool ) @@ -21,3 +20,5 @@ DECLARE_COMPONENT( ViewCreatorFSROITool ) DECLARE_COMPONENT( ViewCreatorFetchFromViewROITool ) DECLARE_COMPONENT( ViewCreatorCentredOnIParticleROITool ) DECLARE_COMPONENT( ViewCreatorCentredOnClusterROITool ) +DECLARE_COMPONENT( ViewCreatorCentredOnJetWithPVConstraintROITool ) + diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref index bbd57d2282fac1a72679fdef0ff4a7df9114e975..69ff28150d87c1d98b48b6a6fcfa2e86ae882fc2 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref @@ -170,8 +170,8 @@ TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP34 TrigSignatureMoniMT INFO -- #4034799151 Events 19 19 15 - - - - - 15 TrigSignatureMoniMT INFO -- #4034799151 Features 425 - - - - - TrigSignatureMoniMT INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557 -TrigSignatureMoniMT INFO -- #3992507557 Events 3 3 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3992507557 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3992507557 Events 3 3 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #3992507557 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J20 #3084792704 TrigSignatureMoniMT INFO -- #3084792704 Events 19 19 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3084792704 Features 0 - - - - - @@ -179,14 +179,14 @@ TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J75 TrigSignatureMoniMT INFO -- #3769257182 Events 2 2 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3769257182 Features 0 - - - - - TrigSignatureMoniMT INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599 -TrigSignatureMoniMT INFO -- #1211559599 Events 3 3 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #1211559599 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #1211559599 Events 3 3 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #1211559599 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666 -TrigSignatureMoniMT INFO -- #3706723666 Events 3 3 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3706723666 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3706723666 Events 3 3 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #3706723666 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816 -TrigSignatureMoniMT INFO -- #1837565816 Events 3 3 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #1837565816 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #1837565816 Events 3 3 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #1837565816 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j420_L1J100 #2659902019 TrigSignatureMoniMT INFO -- #2659902019 Events 3 3 0 - - - - - 0 TrigSignatureMoniMT INFO -- #2659902019 Features 0 - - - - - @@ -227,11 +227,11 @@ TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_ TrigSignatureMoniMT INFO -- #3341539267 Events 20 20 19 - - - - - 19 TrigSignatureMoniMT INFO -- #3341539267 Features 51 - - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339 -TrigSignatureMoniMT INFO -- #991419339 Events 19 19 19 19 19 - - - 19 -TrigSignatureMoniMT INFO -- #991419339 Features 50 50 50 - - - +TrigSignatureMoniMT INFO -- #991419339 Events 19 19 19 19 - - - - 19 +TrigSignatureMoniMT INFO -- #991419339 Features 50 50 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049 -TrigSignatureMoniMT INFO -- #1961149049 Events 19 19 19 19 19 - - - 19 -TrigSignatureMoniMT INFO -- #1961149049 Features 50 50 50 - - - +TrigSignatureMoniMT INFO -- #1961149049 Events 19 19 19 19 - - - - 19 +TrigSignatureMoniMT INFO -- #1961149049 Features 50 50 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030 TrigSignatureMoniMT INFO -- #761060030 Events 19 19 16 - - - - - 16 TrigSignatureMoniMT INFO -- #761060030 Features 31 - - - - - diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index c6a29a8963312cca013f3bb65a669cf7f398c411..85493bff8a5813788db92847e6ba23364667873d 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -176,8 +176,8 @@ TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP3 TrigSignatureMoniMT INFO -- #4034799151 Events 20 20 2 - - - - - 2 TrigSignatureMoniMT INFO -- #4034799151 Features 34 - - - - - TrigSignatureMoniMT INFO HLT_j225_ftf_subjesgscIS_bmv2c1040_split_L1J100 #3992507557 -TrigSignatureMoniMT INFO -- #3992507557 Events 20 20 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3992507557 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3992507557 Events 20 20 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #3992507557 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J20 #3084792704 TrigSignatureMoniMT INFO -- #3084792704 Events 20 20 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3084792704 Features 0 - - - - - @@ -185,14 +185,14 @@ TrigSignatureMoniMT INFO HLT_j260_320eta490_L1J7 TrigSignatureMoniMT INFO -- #3769257182 Events 20 20 0 - - - - - 0 TrigSignatureMoniMT INFO -- #3769257182 Features 0 - - - - - TrigSignatureMoniMT INFO HLT_j275_ftf_subjesgscIS_bmv2c1060_split_L1J100 #1211559599 -TrigSignatureMoniMT INFO -- #1211559599 Events 20 20 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #1211559599 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #1211559599 Events 20 20 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #1211559599 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j300_ftf_subjesgscIS_bmv2c1070_split_L1J100 #3706723666 -TrigSignatureMoniMT INFO -- #3706723666 Events 20 20 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #3706723666 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #3706723666 Events 20 20 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #3706723666 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j360_ftf_subjesgscIS_bmv2c1077_split_L1J100 #1837565816 -TrigSignatureMoniMT INFO -- #1837565816 Events 20 20 0 0 0 - - - 0 -TrigSignatureMoniMT INFO -- #1837565816 Features 0 0 0 - - - +TrigSignatureMoniMT INFO -- #1837565816 Events 20 20 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #1837565816 Features 0 0 - - - - TrigSignatureMoniMT INFO HLT_j420_L1J100 #2659902019 TrigSignatureMoniMT INFO -- #2659902019 Events 20 20 0 - - - - - 0 TrigSignatureMoniMT INFO -- #2659902019 Features 0 - - - - - @@ -233,11 +233,11 @@ TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS TrigSignatureMoniMT INFO -- #3341539267 Events 20 20 6 - - - - - 6 TrigSignatureMoniMT INFO -- #3341539267 Features 6 - - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339 -TrigSignatureMoniMT INFO -- #991419339 Events 20 20 5 5 5 - - - 5 -TrigSignatureMoniMT INFO -- #991419339 Features 5 5 5 - - - +TrigSignatureMoniMT INFO -- #991419339 Events 20 20 5 5 - - - - 5 +TrigSignatureMoniMT INFO -- #991419339 Features 5 5 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049 -TrigSignatureMoniMT INFO -- #1961149049 Events 20 20 5 5 5 - - - 5 -TrigSignatureMoniMT INFO -- #1961149049 Features 5 5 5 - - - +TrigSignatureMoniMT INFO -- #1961149049 Events 20 20 5 5 - - - - 5 +TrigSignatureMoniMT INFO -- #1961149049 Features 5 5 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030 TrigSignatureMoniMT INFO -- #761060030 Events 20 20 5 - - - - - 5 TrigSignatureMoniMT INFO -- #761060030 Features 5 - - - - - diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index 37474cdddcef8d6e45a69ace7df8ceb247a005ff..e86f0e15ca31a2623af66d0c98a278505f556c6a 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -356,7 +356,7 @@ TriggerHLTListRun3 = [ # FIXME: add vertex tracks # bjet jets - ('xAOD::JetContainer#HLT_GSCJet', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Bjet', 'inViews:FullScanBjetView'), + ('xAOD::JetContainer#HLT_GSCJet', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Bjet', 'inViews:BTagViews'), ('xAOD::JetAuxContainer#HLT_GSCJetAux.', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Bjet'), # vertex for b-jets diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py index e3725ef5ea9a37f9454afed1a556f2a281b7648b..552deeec80fa6ce6d28128fbb1af337914567b78 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetDef.py @@ -13,11 +13,9 @@ from TriggerMenuMT.HLTMenuConfig.Bjet.BjetSequenceSetup import getBJetSequence # fragments generating configuration will be functions in New JO, # so let's make them functions already now #---------------------------------------------------------------- -def bjetSequenceCfg_j( flags ): - return getBJetSequence('j') +def bjetSequenceCfg( flags ): + return getBJetSequence() -def bjetSequenceCfg_btag( flag ): - return getBJetSequence('btag') #---------------------------------------------------------------- # Class to configure chain @@ -56,7 +54,7 @@ class BjetChainConfiguration(ChainConfigurationBase): # define here the names of the steps and obtain the chainStep configuration # -------------------- stepDictionary = { - "": ["getBjetSequence_j","getBjetSequence_btag"] + "": ["getBjetSequence"] } return stepDictionary @@ -64,17 +62,13 @@ class BjetChainConfiguration(ChainConfigurationBase): # -------------------- # Configuration of steps # -------------------- - def getBjetSequence_j(self): + def getBjetSequence(self): stepName = "Step2_bjet" log.debug("Configuring step " + stepName) - return self.getStep(2, stepName, [bjetSequenceCfg_j]) + return self.getStep(2, stepName, [bjetSequenceCfg]) - def getBjetSequence_btag(self): - stepName = "Step3_bjet" - log.debug("Configuring step " + stepName) - return self.getStep(3, stepName, [bjetSequenceCfg_btag]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetFlavourTaggingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetFlavourTaggingConfiguration.py index 49a5da3ddbfd230cc508b47a0ebdc370ec481ef5..f3b65cff314bf25f4efe98a1a9d7bb611ed6a367 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetFlavourTaggingConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetFlavourTaggingConfiguration.py @@ -13,4 +13,6 @@ def getFlavourTagging( inputJets, inputVertex, inputTracks ): bTagFex.TracksKey = inputTracks bTagFex.OutputBTagging = recordable( "HLT_BTagging" ) algSequence.append( bTagFex ) - return algSequence + + return [algSequence,bTagFex.OutputBTagging] + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetSequenceSetup.py index 5f95133875a16c747f18b697bb2628ee4f829784..7a1f8b6ac0e4cdf4ff25f07e35a477a038eaf06e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetSequenceSetup.py @@ -12,113 +12,73 @@ from TrigEDMConfig.TriggerEDMRun3 import recordable # Get MenuSequences # ==================================================================================================== -def getBJetSequence( step ): - if step == "j": - return bJetStep1Sequence() - if step == "btag": - return bJetStep2Sequence() - return None -# ==================================================================================================== -# step 1: This is Jet code. Not here! -# ==================================================================================================== +def getBJetSequence(): + return bJetStep2Sequence() # ==================================================================================================== -# step 2: retrieving jets from jet-trigger code and optional first stage of fast tracking with primary vertex +# step 1: This is Jet code. Not here! # ==================================================================================================== -def bJetStep1Sequence(): - jetsKey = "HLT_AntiKt4EMTopoJets_subjesgscIS_ftf" - prmVtxKey = "HLT_EFHistoPrmVtx" - - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm, ViewCreatorInitialROITool - InputMakerAlg = EventViewCreatorAlgorithm( "IMBJet_step2", RoIsLink="initialRoI" ) - InputMakerAlg.RoITool = ViewCreatorInitialROITool() - InputMakerAlg.Views = "FullScanBjetView" - InputMakerAlg.InViewRoIs = "FullScanRoI" - InputMakerAlg.ViewFallThrough = True - InputMakerAlg.mergeUsingFeature = True - - outputJetName = "HLT_GSCJet" - outputRoIName = "HLT_GSCJet_RoIs" - - # Jet Selector - from TrigBjetHypo.TrigBjetHypoConf import TrigJetSelectorMT - jetSelector = TrigJetSelectorMT( "BJetSelector" ) - jetSelector.JetMaxEta = 2.9 - jetSelector.InputJets = jetsKey - jetSelector.InputVertex = prmVtxKey - jetSelector.OutputJets = recordable( outputJetName ) - jetSelector.OutputRoi = outputRoIName - - #BEN - import AthenaCommon.CfgMgr as CfgMgr - bJetEtVDV = CfgMgr.AthViews__ViewDataVerifier( "bJetEtVDV" ) - bJetEtVDV.DataObjects = [( 'xAOD::VertexContainer' , 'StoreGateSvc+HLT_EFHistoPrmVtx' ), - ( 'xAOD::JetContainer' , 'StoreGateSvc+HLT_AntiKt4EMTopoJets_subjesgscIS_ftf' )] - #END BEN - - bJetEtSequence = seqAND( "bJetEtSequence", [bJetEtVDV, jetSelector] ) - InputMakerAlg.ViewNodeName = "bJetEtSequence" - - # Sequence - BjetAthSequence = seqAND("BjetAthSequence_step1",[InputMakerAlg,bJetEtSequence]) - - # hypo - from TrigBjetHypo.TrigBjetHypoConf import TrigBjetEtHypoAlgMT - hypo = TrigBjetEtHypoAlgMT( "TrigBjetEtHypoAlgMT" ) - hypo.RoILink = "step1RoI" - hypo.PrmVtxLink = prmVtxKey.replace( "HLT_","" ) - hypo.Jets = outputJetName - hypo.RoIs = outputRoIName - hypo.PrmVtx = prmVtxKey - hypo.RetrieveVertexFromEventView = False - - from TrigBjetHypo.TrigBjetEtHypoTool import TrigBjetEtHypoToolFromDict - return MenuSequence( Sequence = BjetAthSequence, - Maker = InputMakerAlg, - Hypo = hypo, - HypoToolGen = TrigBjetEtHypoToolFromDict ) - -# ==================================================================================================== -# step 3: Second stage of fast tracking, Precision tracking, and flavour tagging # ==================================================================================================== +# step 2: Second stage of fast tracking, Precision tracking, and flavour tagging +# ==================================================================================================== def bJetStep2Sequence(): - roisLink = "step1RoI" prmVtxKey = "HLT_EFHistoPrmVtx" - - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithmWithJets, ViewCreatorInitialROITool - InputMakerAlg = EventViewCreatorAlgorithmWithJets( "IMBJet_step3",RoIsLink=roisLink ) - InputMakerAlg.ViewFallThrough = True - InputMakerAlg.RequireParentView = True - InputMakerAlg.RoITool = ViewCreatorInitialROITool() # NOT USED! TO BE REPLACED WITH NEW TOOL ON CONVERTING EventViewCreatorAlgorithmWithJets -> EventViewCreatorAlgorithm + outputRoIName = "HLT_bTagging_ROIs" + + from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm + from ViewAlgs.ViewAlgsConf import ViewCreatorCentredOnJetWithPVConstraintROITool + InputMakerAlg = EventViewCreatorAlgorithm( "IMBJet_step2" ) + # + newRoITool = ViewCreatorCentredOnJetWithPVConstraintROITool() + newRoITool.RoisWriteHandleKey = outputRoIName + newRoITool.VertexReadHandleKey = prmVtxKey + newRoITool.PrmVtxLink = prmVtxKey.replace( "HLT_","" ) + # + InputMakerAlg.mergeUsingFeature = True + InputMakerAlg.RoITool = newRoITool + # InputMakerAlg.Views = "BTagViews" InputMakerAlg.InViewRoIs = "InViewRoIs" - InputMakerAlg.InViewJets = "InViewJets" - + # + InputMakerAlg.RequireParentView = False + InputMakerAlg.ViewFallThrough = True + # BJet specific + InputMakerAlg.PlaceJetInView = True + InputMakerAlg.InViewJets = recordable( "HLT_GSCJet" ) # Temporary name, To converge on this in the next future + + + # Prepare data objects for view verifier + viewDataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+' + InputMakerAlg.InViewRoIs ), + ( 'xAOD::VertexContainer' , 'StoreGateSvc+' + prmVtxKey ), + ( 'xAOD::JetContainer' , 'StoreGateSvc+' + InputMakerAlg.InViewJets )] # Second stage of Fast Tracking and Precision Tracking from TriggerMenuMT.HLTMenuConfig.Bjet.BjetTrackingConfiguration import getSecondStageBjetTracking - secondStageAlgs, PTTracks, PTTrackParticles = getSecondStageBjetTracking( inputRoI=InputMakerAlg.InViewRoIs ) + secondStageAlgs, PTTrackParticles = getSecondStageBjetTracking( inputRoI=InputMakerAlg.InViewRoIs, dataObjects=viewDataObjects ) # Flavour Tagging from TriggerMenuMT.HLTMenuConfig.Bjet.BjetFlavourTaggingConfiguration import getFlavourTagging - flavourTaggingAlgs = getFlavourTagging( inputJets=InputMakerAlg.InViewJets, inputVertex=prmVtxKey, inputTracks=PTTrackParticles[0] ) - - preAlgs = [] + flavourTaggingAlgs,bTaggingContainerName = getFlavourTagging( inputJets=InputMakerAlg.InViewJets, inputVertex=prmVtxKey, inputTracks=PTTrackParticles[0] ) - bJetBtagSequence = seqAND( "bJetBtagSequence", preAlgs + secondStageAlgs + flavourTaggingAlgs ) + bJetBtagSequence = seqAND( "bJetBtagSequence", secondStageAlgs + flavourTaggingAlgs ) InputMakerAlg.ViewNodeName = "bJetBtagSequence" # Sequence BjetAthSequence = seqAND( "BjetAthSequence_step2",[InputMakerAlg,bJetBtagSequence] ) - + from TrigBjetHypo.TrigBjetHypoConf import TrigBjetBtagHypoAlgMT hypo = TrigBjetBtagHypoAlgMT( "TrigBjetBtagHypoAlg" ) - hypo.Tracks = PTTrackParticles[0] - hypo.PrmVtx = prmVtxKey - hypo.PrmVtxLink = prmVtxKey.replace( "HLT_","" ) + # keys + hypo.BTaggedJetKey = InputMakerAlg.InViewJets + hypo.BTaggingKey = bTaggingContainerName + hypo.TracksKey = PTTrackParticles[0] + hypo.PrmVtxKey = newRoITool.VertexReadHandleKey + # links for navigation + hypo.BTaggingLink = bTaggingContainerName.replace( "HLT_","" ) + hypo.PrmVtxLink = newRoITool.PrmVtxLink from TrigBjetHypo.TrigBjetOnlineMonitoringMTConfig import TrigBjetOnlineMonitoring hypo.MonTool = TrigBjetOnlineMonitoring() @@ -129,5 +89,3 @@ def bJetStep2Sequence(): Hypo = hypo, HypoToolGen = TrigBjetBtagHypoToolFromDict ) - - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py index 3ceaf27a19f2ffae3570febee74e783db3af3870..f8947fd1370c5214cab4c499edb05f2ee73b8829 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py @@ -3,16 +3,14 @@ from AthenaCommon.CFElements import seqAND #from AthenaCommon.Constants import DEBUG -def getSecondStageBjetTracking( inputRoI ): +def getSecondStageBjetTracking( inputRoI, dataObjects ): algSequence = [] # Second stage of Fast tracking (for precision tracking preparation) from TrigInDetConfig.InDetSetup import makeInDetAlgs viewAlgs, viewVerify = makeInDetAlgs( whichSignature='Jet',separateTrackParticleCreator="_Bjet", rois=inputRoI ) - viewVerify.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+' + inputRoI ), - ( 'xAOD::VertexContainer' , 'StoreGateSvc+HLT_EFHistoPrmVtx' ), - ( 'xAOD::JetContainer' , 'StoreGateSvc+InViewJets' )] + viewVerify.DataObjects += dataObjects # Make sure the required objects are still available at whole-event level from IOVDbSvc.CondDB import conddb @@ -28,11 +26,10 @@ def getSecondStageBjetTracking( inputRoI ): # Precision Tracking from TrigInDetConfig.InDetPT import makeInDetPrecisionTracking - PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "bjet", rois=inputRoI, inputFTFtracks="TrigFastTrackFinder_Tracks_Bjet" ) - algSequence += PTAlgs + algSequence.append( seqAND("PrecisionTrackingSequence",PTAlgs) ) - return [ algSequence, PTTracks, PTTrackParticles ] + return [ algSequence, PTTrackParticles ]