diff --git a/Trigger/TrigHypothesis/TrigTauHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigTauHypo/CMakeLists.txt index 1f70c5acf6882e11d272a4c471eaa41dbf398038..670ac60d751a6d8f2fd6ba5145d59834df4eca31 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/CMakeLists.txt +++ b/Trigger/TrigHypothesis/TrigTauHypo/CMakeLists.txt @@ -10,7 +10,7 @@ find_package( ROOT COMPONENTS Core MathCore Hist ) atlas_add_component( TrigTauHypo src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthViews AthenaBaseComps AthenaMonitoringKernelLib CaloEvent CxxUtils DecisionHandlingLib EventInfo GaudiKernel ITrackToVertex MuidEvent Particle PathResolver StoreGateLib TrigCaloEvent TrigCompositeUtilsLib TrigInDetEvent TrigInterfacesLib TrigMuonEvent TrigNavStructure TrigParticle TrigSteeringEvent TrigTopoEvent TrkTrack TrkTrackSummary VxVertex egammaEvent tauEvent xAODBase xAODCaloEvent xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigger ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthViews AthenaBaseComps AthenaMonitoringKernelLib CaloEvent CxxUtils DecisionHandlingLib EventInfo GaudiKernel ITrackToVertex MuidEvent Particle PathResolver StoreGateLib TrigCaloEvent TrigCompositeUtilsLib TrigInDetEvent TrigInterfacesLib TrigMuonEvent TrigNavStructure TrigParticle TrigSteeringEvent TrigTopoEvent TrkTrack TrkTrackSummary VxVertex egammaEvent tauEvent xAODBase xAODCaloEvent xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigger MVAUtils tauRecToolsLib) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 ) diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx index 47abcaaaef0c1116a7e7f1144f48082764f664af..8881a4e261c6f8b00ea0c1aa1c33a674910928d2 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx @@ -19,6 +19,8 @@ #include "TrkTrackSummary/TrackSummary.h" #include "xAODTrigger/TrigPassBits.h" +#include "PathResolver/PathResolver.h" +#include "tauRecTools/HelperFunctions.h" TrigTauTrackRoiUpdaterMT::TrigTauTrackRoiUpdaterMT(const std::string & name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) @@ -41,13 +43,22 @@ StatusCode TrigTauTrackRoiUpdaterMT::initialize() ATH_MSG_DEBUG( " nSiHoles " << m_nSiHoles ); ATH_MSG_DEBUG( " UpdateEta " << m_updateEta ); ATH_MSG_DEBUG( " UpdatePhi " << m_updatePhi ); + ATH_MSG_DEBUG( " useBDT " << m_useBDT ); + if(m_useBDT) { + ATH_MSG_DEBUG( " BDTweights " << m_BDTweights ); + + std::string inputWeightsPath = PathResolverFindCalibFile(m_BDTweights); + ATH_MSG_INFO(" InputWeightsPath: " << inputWeightsPath); + m_reader = std::make_unique<tauRecTools::BDTHelper>(); + ATH_CHECK(m_reader->initialize(inputWeightsPath)); + } ATH_MSG_DEBUG( "Initialising HandleKeys" ); CHECK( m_roIInputKey.initialize() ); - CHECK( m_tracksKey.initialize() ); - CHECK( m_roIOutputKey.initialize() ); - + CHECK( m_tracksKey.initialize() ); + CHECK( m_roIOutputKey.initialize() ); + CHECK( m_tauJetKey.initialize(!m_tauJetKey.key().empty())); return StatusCode::SUCCESS; } @@ -100,38 +111,67 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute(const EventContext& ctx) const double trkPtMax = 0; if(foundTracks!=0){ - + + //Find the track with the highest BDT score + if(m_useBDT) { + + // retrieve TauJet from TrigTauRecCaloOnlyMVASequence + SG::ReadHandle< xAOD::TauJetContainer > tauJetHandle = SG::makeHandle( m_tauJetKey,ctx ); + const xAOD::TauJetContainer *foundTaus = tauJetHandle.get(); + + if (foundTaus->size()==0) { + ATH_MSG_ERROR( "No TauJetContainer feature was found." ); + } + + const Trk::Track *leadTrackBDT = nullptr; + for(const Trk::Track* trk_it : *foundTracks) + if(trk_it->perigeeParameters()->pT() > trkPtMax) { + trkPtMax = trk_it->perigeeParameters()->pT(); + leadTrackBDT = trk_it; + } + double trkBDTMax = 0.; + + for(const Trk::Track* trk_it : *foundTracks) { + double BDTscore = getBDTscore( foundTaus->at(0), trk_it, leadTrackBDT ); + + if(BDTscore > trkBDTMax) { + trkBDTMax = BDTscore; + leadTrack = trk_it; + } + } + } // Find leading track - for (const Trk::Track* track : *foundTracks){ - trackPer = track->perigeeParameters(); - summary = track->trackSummary(); - if(summary==nullptr) ATH_MSG_ERROR(" track summary not available in RoI updater " << trkPtMax << " " << name() ); - if(trackPer && summary){ - float trackPt = trackPer->pT(); - if ( trackPt > trkPtMax ) { - int nPix = summary->get(Trk::numberOfPixelHits); - if(nPix<0) nPix=0; - if(nPix < m_nHitPix) { - if(msgLvl(MSG::DEBUG)) msg() << MSG::DEBUG <<" Track rejected because of nHitPix " << nPix << " < " << m_nHitPix - << " " << name() << ": in execute()" << endmsg; - continue; - } - int nPixHole = summary->get(Trk::numberOfPixelHoles); - if (nPixHole < 0) nPixHole = 0; - int nSCTHole = summary->get(Trk::numberOfSCTHoles); - if (nSCTHole < 0) nSCTHole = 0; - if((nPixHole + nSCTHole) > m_nSiHoles) { - if(msgLvl(MSG::DEBUG) ) msg() << MSG::DEBUG <<" Track rejected because of nSiHoles " << nPixHole+nSCTHole << " > " << m_nSiHoles - << " " << name() << ": in execute()" << endmsg; - continue; - } - leadTrack = track; - trkPtMax = trackPt; - } + else{ + for (const Trk::Track* track : *foundTracks){ + trackPer = track->perigeeParameters(); + summary = track->trackSummary(); + if(summary==nullptr) ATH_MSG_ERROR(" track summary not available in RoI updater " << trkPtMax << " " << name() ); + if(trackPer && summary){ + float trackPt = trackPer->pT(); + if ( trackPt > trkPtMax ) { + int nPix = summary->get(Trk::numberOfPixelHits); + if(nPix<0) nPix=0; + if(nPix < m_nHitPix) { + if(msgLvl(MSG::DEBUG)) msg() << MSG::DEBUG <<" Track rejected because of nHitPix " << nPix << " < " << m_nHitPix + << " " << name() << ": in execute()" << endmsg; + continue; + } + int nPixHole = summary->get(Trk::numberOfPixelHoles); + if (nPixHole < 0) nPixHole = 0; + int nSCTHole = summary->get(Trk::numberOfSCTHoles); + if (nSCTHole < 0) nSCTHole = 0; + if((nPixHole + nSCTHole) > m_nSiHoles) { + if(msgLvl(MSG::DEBUG) ) msg() << MSG::DEBUG <<" Track rejected because of nSiHoles " << nPixHole+nSCTHole << " > " << m_nSiHoles + << " " << name() << ": in execute()" << endmsg; + continue; + } + leadTrack = track; + trkPtMax = trackPt; + } + } } } - - + if(leadTrack) { ATH_MSG_DEBUG(" leading track pT " << trkPtMax ); leadTrkZ0 = leadTrack->perigeeParameters()->parameters()[Trk::z0]; @@ -191,3 +231,67 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute(const EventContext& ctx) const return StatusCode::SUCCESS; } + +double TrigTauTrackRoiUpdaterMT::getBDTscore(const xAOD::TauJet* tau, const Trk::Track* track, const Trk::Track* leadtrack ) const +{ + + std::map<TString, float*> BDTvars; + BDTInputVariables vars; + + BDTvars = { + {"log(Coretrack_pt)", &vars.logtrk_pt}, + {"fabs(Coretrack_z0)", &vars.abstrck_z0}, + {"fabs(Coretrack_d0)", &vars.abstrk_d0}, + {"Coretrack_nPiHits", &vars.trk_nPiHits}, + {"Coretrack_nSiHoles", &vars.trk_nSiHoles}, + {"log(Coretrack_ratioptCalo)", &vars.logtrk_ratiopt}, + {"Coretrack_dR", &vars.trk_dR}, + {"Coretrack_dRleadtrk", &vars.trk_dRtoleadtrk}, + {"Coretrack_CaloHadpt", &vars.CaloHad_pt}, + {"Coretrack_CaloEMpt", &vars.CaloEM_pt} + }; + + const Trk::Perigee* trkPerigee = track->perigeeParameters(); + const Trk::TrackSummary* trkSummary = track->trackSummary(); + + int nPixHit = trkSummary->get(Trk::numberOfPixelHits); + int nPixDead = trkSummary->get(Trk::numberOfPixelDeadSensors); + + int nPixHole = trkSummary->get(Trk::numberOfPixelHoles); + int nSCTHole = trkSummary->get(Trk::numberOfSCTHoles); + + float ratio_pt = tau->ptTrigCaloOnly() ? trkPerigee->pT()/tau->ptTrigCaloOnly() : 0.; + + float dEta = tau->eta() - trkPerigee->eta(); + float dPhi = CxxUtils::wrapToPi(tau->phi() - trkPerigee->parameters()[Trk::phi0]); + float dR = sqrt(dEta*dEta + dPhi*dPhi); + + const Trk::Perigee* leadtrkPerigee = leadtrack->perigeeParameters(); + float dEta_leadtrk = trkPerigee->eta() - leadtrkPerigee->eta(); + float dPhi_leadtrk = CxxUtils::wrapToPi(trkPerigee->parameters()[Trk::phi0] - leadtrkPerigee->parameters()[Trk::phi0]); + float dR_leadtrk = sqrt(dEta_leadtrk*dEta_leadtrk + dPhi_leadtrk*dPhi_leadtrk); + + float tau_emscale_ptEM = 0; + float tau_emscale_ptHad = 0; + if ( !tau->detail( xAOD::TauJetParameters::etEMAtEMScale, tau_emscale_ptEM ) ) { + ATH_MSG_WARNING("Retrieval of tau etEMAtEMScale detail failed."); + } + if ( !tau->detail( xAOD::TauJetParameters::etHadAtEMScale, tau_emscale_ptHad ) ) { + ATH_MSG_WARNING("Retrieval of tau etHadAtEMScale detail failed."); + } + + vars.logtrk_pt = log( trkPerigee->pT() ); + vars.abstrck_z0 = std::abs( trkPerigee->parameters()[Trk::z0] ); + vars.abstrk_d0 = std::abs( trkPerigee->parameters()[Trk::d0] ); + vars.trk_nPiHits = nPixHit + nPixDead; + vars.trk_nSiHoles = nPixHole + nSCTHole; + vars.logtrk_ratiopt = log( ratio_pt ); + vars.trk_dR = dR; + vars.trk_dRtoleadtrk = dR_leadtrk; + vars.CaloHad_pt = tau_emscale_ptHad; + vars.CaloEM_pt = tau_emscale_ptEM; + + double BDTval = m_reader->getResponse(BDTvars); + + return BDTval; +} diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h index 548677aa721df2e1232a8fb11ba4962d97ed46e9..90ba646fdce9cd00b52ea7c707af99fc4d6b75d1 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h @@ -14,6 +14,10 @@ #include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "MVAUtils/BDT.h" +#include "xAODTau/TauJetContainer.h" +#include "tauRecTools/BDTHelper.h" + class TrigTauTrackRoiUpdaterMT : public AthReentrantAlgorithm { public: @@ -30,10 +34,33 @@ class TrigTauTrackRoiUpdaterMT : public AthReentrantAlgorithm { Gaudi::Property< int > m_nSiHoles {this,"nSiHoles",2,"maximum number of Si holes on lead track"}; Gaudi::Property< bool > m_updateEta {this,"updateEta",true,"flag to determine whether Roi eta should be updated using the track direction (true by default)"}; Gaudi::Property< bool > m_updatePhi {this,"updatePhi",false,"flag to determine whether Roi phi should be updated using the track direction (false by default)"}; + Gaudi::Property< bool > m_useBDT {this,"useBDT",false,"flag to determine whether the 1st stage of the FTF chooses the track with the highest BDT score"}; + Gaudi::Property< std::string > m_BDTweights {this,"BDTweights","TrigTauRec/00-11-02/FTF_tauCore_BDT_v0.root","String with the path to the BDT file"}; + + //std::unique_ptr<MVAUtils::BDT> m_reader; //! + std::unique_ptr<tauRecTools::BDTHelper> m_reader; + + struct BDTInputVariables + { + float logtrk_pt{0.0}; //! + float abstrck_z0{0.0}; //! + float abstrk_d0{0.0}; //! + float trk_nPiHits{0.0}; //! + float trk_nSiHoles{0.0}; //! + float logtrk_ratiopt{0.0}; //! + float trk_dR{0.0}; //! + float trk_dRtoleadtrk{0.0}; //! + float CaloHad_pt{0.0}; //! + float CaloEM_pt{0.0}; //! + + }; SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roIInputKey {this,"RoIInputKey","InputRoI","Input RoI key name"}; SG::ReadHandleKey< TrackCollection > m_tracksKey { this, "fastTracksKey", "fasttracks", "fast tracks in view" }; SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roIOutputKey {this,"RoIOutputKey","InViewRoI","Output RoI Collection Key"}; + SG::ReadHandleKey< xAOD::TauJetContainer> m_tauJetKey { this, "Key_trigTauJetInputContainer", "HLT_taujet", "input taujet container" }; + double getBDTscore(const xAOD::TauJet* tau, const Trk::Track* track, const Trk::Track* leadtrack ) const; + }; #endif diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py index ef1f9a654fdd0a720157098f94076d28bf1d6910..cebb1da4659de60905707e4e95e8cd22dee4a5ab 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py @@ -481,6 +481,16 @@ class _Settings_tauIso( _GlobalSettings ): self._configPT = _PrecisionTracking( signatureType = 'tauIso', nameSuffix = 'Tau' ) #Final collection is being renamed to just tau apparently... self._doRecord = True #Allow recording of track collections +#This might be redundant but lets keep them for the time being... +class _Settings_tauIsoBDT( _GlobalSettings ): + def __init__( self ): + _GlobalSettings.__init__(self) + self._name = "tauIsoBDT" #To be appended to alg names + self._roi = "HLT_Roi_TauIsoBDT" #FIXME: possibly different! + self._configFT = _FastTracking( signatureType = 'tauIso', nameSuffix = 'TauIso' ) # + self._configPT = _PrecisionTracking( signatureType = 'tauIso', nameSuffix = 'Tau' ) #Final collection is being renamed to just tau apparently... + self._doRecord = False #FIXME: Do I need to record these? + class _Settings_bjet( _GlobalSettings ): def __init__( self ): _GlobalSettings.__init__(self) @@ -548,6 +558,7 @@ _ConfigSettings = { "tauTau" : _Settings_tauTau(), "tauCore" : _Settings_tauCore(), "tauIso" : _Settings_tauIso(), + "tauIsoBDT" : _Settings_tauIsoBDT(), "bjet" : _Settings_bjet(), "jet" : _Settings_jet(), diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index f1300dfd45bf850ba32dc91932d6fc0878d29d01..3568719d4a0c05e998b288c0efcce13247c50856 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -2478,6 +2478,20 @@ HLT_tau25_idperf_track_L1TAU12IM: 2: 15 3: 15 4: 15 +HLT_tau25_idperf_tracktwoMVABDT_L1TAU12IM: + eventCount: 12 + stepCounts: + 0: 14 + 1: 12 + 2: 12 + 3: 12 + 4: 12 + stepFeatures: + 0: 24 + 1: 16 + 2: 15 + 3: 15 + 4: 15 HLT_tau25_idperf_tracktwoMVA_L1TAU12IM: eventCount: 12 stepCounts: @@ -2508,6 +2522,34 @@ HLT_tau25_idperf_tracktwo_L1TAU12IM: 3: 14 4: 14 5: 14 +HLT_tau25_looseRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 9 + stepCounts: + 0: 12 + 1: 10 + 2: 10 + 3: 10 + 4: 9 + stepFeatures: + 0: 22 + 1: 14 + 2: 13 + 3: 13 + 4: 12 +HLT_tau25_looseRNN_tracktwoMVA_L1TAU12IM: + eventCount: 8 + stepCounts: + 0: 12 + 1: 11 + 2: 10 + 3: 9 + 4: 8 + stepFeatures: + 0: 22 + 1: 15 + 2: 13 + 3: 12 + 4: 9 HLT_tau25_looseRNN_tracktwoMVA_L1TAU12IM: eventCount: 9 stepCounts: @@ -2544,6 +2586,18 @@ HLT_tau25_medium1_tracktwoEF_L1TAU12IM: 1: 14 2: 12 3: 12 +HLT_tau25_medium1_tracktwoMVABDT_L1TAU12IM: + eventCount: 0 + stepCounts: + 0: 12 + 1: 10 + 2: 10 + 3: 10 + stepFeatures: + 0: 22 + 1: 14 + 2: 13 + 3: 13 HLT_tau25_medium1_tracktwoMVA_L1TAU12IM: eventCount: 0 stepCounts: @@ -2566,6 +2620,34 @@ HLT_tau25_medium1_tracktwo_L1TAU12IM: 0: 22 1: 14 2: 12 +HLT_tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 8 + stepCounts: + 0: 12 + 1: 10 + 2: 10 + 3: 10 + 4: 8 + stepFeatures: + 0: 22 + 1: 14 + 2: 13 + 3: 13 + 4: 9 +HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM: + eventCount: 5 + stepCounts: + 0: 12 + 1: 11 + 2: 10 + 3: 9 + 4: 5 + stepFeatures: + 0: 22 + 1: 15 + 2: 13 + 3: 12 + 4: 5 HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM: eventCount: 8 stepCounts: @@ -2590,6 +2672,20 @@ HLT_tau25_mediumRNN_tracktwo_L1TAU12IM: 0: 22 1: 14 2: 12 +HLT_tau25_perf_tracktwoMVABDT_L1TAU12IM: + eventCount: 12 + stepCounts: + 0: 14 + 1: 12 + 2: 12 + 3: 12 + 4: 12 + stepFeatures: + 0: 24 + 1: 16 + 2: 15 + 3: 15 + 4: 15 HLT_tau25_perf_tracktwoMVA_L1TAU12IM: eventCount: 12 stepCounts: @@ -2620,6 +2716,34 @@ HLT_tau25_perf_tracktwo_L1TAU12IM: 3: 14 4: 14 5: 14 +HLT_tau25_tightRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 7 + stepCounts: + 0: 12 + 1: 10 + 2: 10 + 3: 10 + 4: 7 + stepFeatures: + 0: 22 + 1: 14 + 2: 13 + 3: 13 + 4: 7 +HLT_tau25_tightRNN_tracktwoMVA_L1TAU12IM: + eventCount: 4 + stepCounts: + 0: 12 + 1: 11 + 2: 10 + 3: 9 + 4: 4 + stepFeatures: + 0: 22 + 1: 15 + 2: 13 + 3: 12 + 4: 4 HLT_tau25_tightRNN_tracktwoMVA_L1TAU12IM: eventCount: 7 stepCounts: @@ -2644,6 +2768,20 @@ HLT_tau25_tightRNN_tracktwo_L1TAU12IM: 0: 22 1: 14 2: 12 +HLT_tau25_verylooseRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 9 + stepCounts: + 0: 12 + 1: 10 + 2: 10 + 3: 10 + 4: 9 + stepFeatures: + 0: 22 + 1: 14 + 2: 13 + 3: 13 + 4: 12 HLT_tau25_verylooseRNN_tracktwoMVA_L1TAU12IM: eventCount: 9 stepCounts: diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 96e60e9bb18223058f7c3223666d9e933fd2ce23..803d96f73e9689ef357a6277af2f1d931edb3cf1 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -1408,6 +1408,20 @@ HLT_tau25_idperf_track_L1TAU12IM: 2: 3 3: 3 4: 3 +HLT_tau25_idperf_tracktwoMVABDT_L1TAU12IM: + eventCount: 3 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 3 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 3 HLT_tau25_idperf_tracktwoMVA_L1TAU12IM: eventCount: 3 stepCounts: @@ -1438,6 +1452,20 @@ HLT_tau25_idperf_tracktwo_L1TAU12IM: 3: 3 4: 3 5: 3 +HLT_tau25_looseRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 2 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 2 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 2 HLT_tau25_looseRNN_tracktwoMVA_L1TAU12IM: eventCount: 2 stepCounts: @@ -1474,6 +1502,18 @@ HLT_tau25_medium1_tracktwoEF_L1TAU12IM: 1: 3 2: 3 3: 3 +HLT_tau25_medium1_tracktwoMVABDT_L1TAU12IM: + eventCount: 0 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 HLT_tau25_medium1_tracktwoMVA_L1TAU12IM: eventCount: 0 stepCounts: @@ -1496,6 +1536,20 @@ HLT_tau25_medium1_tracktwo_L1TAU12IM: 0: 4 1: 3 2: 3 +HLT_tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 1 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 1 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 1 HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM: eventCount: 1 stepCounts: @@ -1520,6 +1574,20 @@ HLT_tau25_mediumRNN_tracktwo_L1TAU12IM: 0: 4 1: 3 2: 3 +HLT_tau25_perf_tracktwoMVABDT_L1TAU12IM: + eventCount: 3 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 3 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 3 HLT_tau25_perf_tracktwoMVA_L1TAU12IM: eventCount: 3 stepCounts: @@ -1550,6 +1618,20 @@ HLT_tau25_perf_tracktwo_L1TAU12IM: 3: 3 4: 3 5: 3 +HLT_tau25_tightRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 1 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 1 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 1 HLT_tau25_tightRNN_tracktwoMVA_L1TAU12IM: eventCount: 1 stepCounts: @@ -1574,6 +1656,20 @@ HLT_tau25_tightRNN_tracktwo_L1TAU12IM: 0: 4 1: 3 2: 3 +HLT_tau25_verylooseRNN_tracktwoMVABDT_L1TAU12IM: + eventCount: 2 + stepCounts: + 0: 3 + 1: 3 + 2: 3 + 3: 3 + 4: 2 + stepFeatures: + 0: 4 + 1: 3 + 2: 3 + 3: 3 + 4: 2 HLT_tau25_verylooseRNN_tracktwoMVA_L1TAU12IM: eventCount: 2 stepCounts: diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index eea35e3b5fe82d5ae5f84c98d44a9b978b43097d..2cbcf35c614df96f53ee308a551c17aa872aecd4 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -280,6 +280,7 @@ TriggerHLTListRun3 = [ ('TrigRoiDescriptorCollection#HLT_Roi_TauCore_MVA', 'BS ESD AODFULL AODSLIM', 'Steer'), ('TrigRoiDescriptorCollection#HLT_Roi_TauCore', 'BS ESD AODFULL AODSLIM', 'Steer'), ('TrigRoiDescriptorCollection#HLT_Roi_TauIso', 'BS ESD AODFULL AODSLIM', 'Steer'), + ('TrigRoiDescriptorCollection#HLT_Roi_TauIsoBDT', 'BS ESD AODFULL AODSLIM', 'Steer'), ('TrigRoiDescriptorCollection#HLT_Roi_TauID', 'BS ESD AODFULL AODSLIM', 'Steer'), ('xAOD::JetContainer#HLT_jet_seed', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Tau', 'inViews:TAUCaloViews,TAUCaloMVAViews'), diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index 0ff9e92cc19ffc895d5209b35b566b08209f0ff9..a6a5471988c19fa02ac5568cba6cf39845f1d690 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -367,6 +367,13 @@ def setupMenu(): ChainProp(name="HLT_tau160_medium1_tracktwoEF_L1TAU100",groups=SingleTauGroup), ChainProp(name="HLT_tau200_medium1_tracktwoEF_L1TAU100",groups=SingleTauGroup), ChainProp(name="HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_idperf_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_perf_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_medium1_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_verylooseRNN_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_looseRNN_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), + ChainProp(name="HLT_tau25_tightRNN_tracktwoMVABDT_L1TAU12IM",groups=SingleTauGroup), # ATR-21797 # the following 3 chains were in serial mode in Run-2 ChainProp(name="HLT_tau80_mediumRNN_tracktwoMVA_tau60_mediumRNN_tracktwoMVA_L1TAU60_2TAU40", l1SeedThresholds=['TAU60','TAU40'], groups=MultiTauGroup), diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py index 8567c63455710134a2b0a16912eaa6838863f6b0..4dd33ecbc12b47e3a169f82ef9963276f0c3eb70 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py @@ -261,7 +261,7 @@ TauChainParts = { 'L1threshold' : '', 'chainPartName' : '', 'threshold' : '', - 'preselection' : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoEFmvaTES', 'ptonly', ], + 'preselection' : ['track', 'tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoMVABDT' , 'tracktwoEFmvaTES', 'ptonly', ], 'selection' : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf'], 'multiplicity' : '', 'trigType' : ['tau'], diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py index 7091e3fe471461c9eb8f0e09b8bbb32fcb594660..3f2d0d2230ca73d3115bd4e80bf07f1456b71d7e 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py @@ -11,7 +11,7 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Tau.TauChainConfiguration") from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase -from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import tauCaloMenuSeq, tauCaloMVAMenuSeq, tauFTFTauSeq, tauFTFTauCoreSeq, tauFTFTauIsoSeq, tauIDPrecSeq, tauTrackPrecSeq, tauTrackTwoPrecSeq, tauTrackTwoEFSeq, tauTrackTwoMVASeq, tauPreSelSeq, tauPreSelTTSeq, tauPrecTrackSeq, tauPrecTrackIsoSeq +from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import tauCaloMenuSeq, tauCaloMVAMenuSeq, tauFTFTauSeq, tauFTFTauCoreSeq, tauFTFTauIsoSeq, tauFTFTauIsoBDTSeq, tauIDPrecSeq, tauTrackPrecSeq, tauTrackTwoPrecSeq, tauTrackTwoEFSeq, tauTrackTwoMVASeq, tauPreSelSeq, tauPreSelTTSeq, tauPrecTrackSeq, tauPrecTrackIsoSeq #-------------------------------------------------------- # fragments generating config will be functions in new JO @@ -31,6 +31,9 @@ def getFTFCoreCfg(flags): def getFTFIsoCfg(flags): return tauFTFTauIsoSeq() +def getFTFIsoBDTCfg(flags): + return tauFTFTauIsoBDTSeq() + def getIDPrecCfg(flags): return tauIDPrecSeq() @@ -78,11 +81,12 @@ class TauChainConfiguration(ChainConfigurationBase): # define here the names of the steps and obtain the chainStep configuration # -------------------- stepDictionary = { - "ptonly" :['getCaloSeq' , 'getFTFTau' , 'getTrkEmpty' , 'getTauEmpty' , 'getPrecTrack' , 'getIDPrec' ], - "track" :['getCaloSeq' , 'getFTFTau' , 'getTrkEmpty' , 'getPreSel' , 'getPrecTrack' , 'getTrackPrec' ], - "tracktwo" :['getCaloSeq' , 'getFTFCore' , 'getFTFIso' , 'getPreSelTT' , 'getPrecTrackIso' , 'getTrackTwoPrec'], - "tracktwoEF" :['getCaloSeq' , 'getFTFCore' , 'getFTFIso' , 'getTauEmpty' , 'getPrecTrackIso' , 'getTrackTwoEF' ], - "tracktwoMVA":['getCaloMVASeq', 'getFTFCore' , 'getFTFIso' , 'getTauEmpty' , 'getPrecTrackIso' , 'getTrackTwoMVA' ], + "ptonly" :['getCaloSeq' , 'getFTFTau' , 'getTrkEmpty' , 'getTauEmpty' , 'getPrecTrack' , 'getIDPrec' ], + "track" :['getCaloSeq' , 'getFTFTau' , 'getTrkEmpty' , 'getPreSel' , 'getPrecTrack' , 'getTrackPrec' ], + "tracktwo" :['getCaloSeq' , 'getFTFCore' , 'getFTFIso' , 'getPreSelTT' , 'getPrecTrackIso' , 'getTrackTwoPrec'], + "tracktwoEF" :['getCaloSeq' , 'getFTFCore' , 'getFTFIso' , 'getTauEmpty' , 'getPrecTrackIso' , 'getTrackTwoEF' ], + "tracktwoMVA" :['getCaloMVASeq', 'getFTFCore' , 'getFTFIso' , 'getTauEmpty' , 'getPrecTrackIso' , 'getTrackTwoMVA' ], + "tracktwoMVABDT":['getCaloMVASeq', 'getFTFCore' , 'getFTFIsoBDT', 'getTauEmpty' , 'getPrecTrackIso' , 'getTrackTwoMVA' ], } # this should be extended by the signature expert to make full use of the dictionary! @@ -121,6 +125,11 @@ class TauChainConfiguration(ChainConfigurationBase): stepName = 'FTFIso_tau' return self.getStep(3,stepName, [getFTFIsoCfg]) + # -------------------- + def getFTFIsoBDT(self): + stepName = 'FTFIsoBDT_tau' + return self.getStep(3,stepName, [getFTFIsoBDTCfg]) + # -------------------- def getTrkEmpty(self): stepName = 'TrkEmpty_tau' diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauMenuSequences.py index a9034d9331acf7cd12d9a0a0ac7c79339d616dfa..c53fce12f2418359f0965696dfff15d1ba9541be 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauMenuSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauMenuSequences.py @@ -7,7 +7,7 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags # menu components from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool -from TriggerMenuMT.HLTMenuConfig.Tau.TauRecoSequences import tauCaloSequence, tauCaloMVASequence, tauFTFCoreSequence, tauFTFTauSequence, tauFTFIsoSequence, tauIDSequence, tauTrackSequence, tauTrackTwoSequence, tauEFSequence, tauMVASequence, tauPreSelSequence, tauPreSelTTSequence, tauPrecTrackSequence, tauPrecIsoTrackSequence +from TriggerMenuMT.HLTMenuConfig.Tau.TauRecoSequences import tauCaloSequence, tauCaloMVASequence, tauFTFCoreSequence, tauFTFTauSequence, tauFTFIsoSequence, tauFTFIsoBDTSequence, tauIDSequence, tauTrackSequence, tauTrackTwoSequence, tauEFSequence, tauMVASequence, tauPreSelSequence, tauPreSelTTSequence, tauPrecTrackSequence, tauPrecIsoTrackSequence # ==================================================================================================== # Get MenuSequences @@ -120,6 +120,25 @@ def tauFTFTauIsoSeq(): Hypo = fastTrkHypo, HypoToolGen = TrigTauTrackHypoToolFromDict ) +# =============================================================================================== +# Fast track finder (iso bdt) + Dummy Hypo step (tracktwoMVABDT) +# =============================================================================================== + +def tauFTFTauIsoBDTSeq(): + (sequence, ftfIsoBDTViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauFTFIsoBDTSequence,ConfigFlags ) + + from TrigTauHypo.TrigTauHypoConf import TrigTrackPreSelHypoAlgMT + fastTrkHypo = TrigTrackPreSelHypoAlgMT("TrackPreSelHypoAlg_PassByIsoBDT") + fastTrkHypo.trackcollection = sequenceOut + fastTrkHypo.RoIForIDReadHandleKey = "UpdatedTrackBDTRoI" + + from TrigTauHypo.TrigTauHypoTool import TrigTauTrackHypoToolFromDict + + return MenuSequence( Sequence = sequence, + Maker = ftfIsoBDTViewsMaker, + Hypo = fastTrkHypo, + HypoToolGen = TrigTauTrackHypoToolFromDict ) + # =============================================================================================== # Precision tracking + Tau Precision Alg + EFMVHypo step (pTonly) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py index 8593e99dc6892021fc3225ddfa3238caece0dc3b..f69fbc8370abff462a298f9f036ddfeec8f3d644 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauRecoSequences.py @@ -23,9 +23,12 @@ def _getTauSignatureShort( name ): elif "FTFCore" in name: signature = 'tauCore' signatureID = 'tauCore' - elif "FTFIso" in name: + elif "IsoInView" in name: signature = 'tauIso' signatureID = 'tauIso' + elif "IsoBDT" in name: + signature = 'tauIsoBDT' + signatureID = 'tauIsoBDT' elif "TrackInView" in name: signature = 'tauTrk' signatureID = 'tauTau' @@ -89,6 +92,17 @@ def _algoTauTrackRoiUpdater(inputRoIs, tracks): algo.RoIInputKey = inputRoIs algo.RoIOutputKey = "UpdatedTrackRoI" algo.fastTracksKey = tracks + algo.Key_trigTauJetInputContainer = "" + return algo + +def _algoTauTrackBDTRoiUpdater(inputRoIs, tracks): + from TrigTauHypo.TrigTauHypoConf import TrigTauTrackRoiUpdaterMT + algo = TrigTauTrackRoiUpdaterMT("TrackRoiUpdaterBDT") + algo.RoIInputKey = inputRoIs + algo.RoIOutputKey = "UpdatedTrackBDTRoI" + algo.fastTracksKey = tracks + algo.useBDT = True + algo.Key_trigTauJetInputContainer = "HLT_TrigTauRecMerged_CaloOnly" return algo def _algoTauPreselection(inputRoIs, tracks, step): @@ -357,6 +371,8 @@ def tauFTFSequence( RoIs, name ): if 'Core' in signatureName: tauTrackRoiUpdaterAlg = _algoTauTrackRoiUpdater(inputRoIs = RoIs, tracks = TrackCollection) + tauTrackRoiUpdaterAlgBDT = _algoTauTrackBDTRoiUpdater(inputRoIs = RoIs, tracks = TrackCollection) + viewAlgs.append(tauTrackRoiUpdaterAlgBDT) viewAlgs.append(tauTrackRoiUpdaterAlg) tauFTFSequence += viewAlgs @@ -444,6 +460,32 @@ def tauFTFIsoSequence(ConfigFlags): tauFastTrackIsoSequence = seqAND("tauFastTrackIsoSequence", [ftfIsoViewsMaker, tauFTFIsoInViewSequence ]) return (tauFastTrackIsoSequence, ftfIsoViewsMaker, sequenceOut) +# =============================================================================================== +# Reco sequence for FTFTauIsoBDT (tracktwoMVABDT) +# =============================================================================================== + +def tauFTFIsoBDTSequence(ConfigFlags): + + RecoSequenceName = "tauFTFIsoBDTInViewSequence" + + newRoITool = ViewCreatorFetchFromViewROITool() + newRoITool.RoisWriteHandleKey = recordable("HLT_Roi_TauIsoBDT") #RoI collection recorded to EDM + newRoITool.InViewRoIs = "UpdatedTrackBDTRoI" #input RoIs from calo only step + + ftfIsoViewsMaker = EventViewCreatorAlgorithm("IMFTFIsoBDT") + ftfIsoViewsMaker.RoIsLink = "roi" + ftfIsoViewsMaker.RoITool = newRoITool + ftfIsoViewsMaker.InViewRoIs = "RoiForTauIsoBDT" + ftfIsoViewsMaker.Views = "TAUFTFIsoBDTViews" + ftfIsoViewsMaker.ViewFallThrough = True + ftfIsoViewsMaker.RequireParentView = True + ftfIsoViewsMaker.ViewNodeName = RecoSequenceName + + (tauFTFIsoBDTInViewSequence, sequenceOut) = tauFTFSequence( ftfIsoViewsMaker.InViewRoIs, RecoSequenceName) + + tauFastTrackIsoBDTSequence = seqAND("tauFastTrackIsoBDTSequence", [ftfIsoViewsMaker, tauFTFIsoBDTInViewSequence ]) + return (tauFastTrackIsoBDTSequence, ftfIsoViewsMaker, sequenceOut) + # =============================================================================================== # Reco sequence for PreSelection algorithm (track)