diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py index 85f7ba4a6664b698d8f011436e25cedc2d22db83..a4c408f9f65ba4043ab898ca0811179df317d5db 100644 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py @@ -34,6 +34,13 @@ def _algoHLTTopoCluster(inputEDM="CellsClusters", OutputLevel=ERROR) : algo.OutputLevel=OutputLevel return algo +def _algoHLTTopoClusterLC(inputEDM="CellsClusters", OutputLevel=ERROR) : + from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo + algo = TrigCaloClusterMakerMT_topo(doMoments=True, doLC=True, cells=inputEDM) + algo.CaloClusters="caloclusters" + algo.OutputLevel=OutputLevel + return algo + def _algoL2Egamma(inputEDM="EMRoIs",OutputLevel=ERROR): setMinimalCaloSetup(); from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo @@ -113,3 +120,12 @@ def HLTFSTopoRecoSequence(RoIs='FSJETRoI'): print tool return (RecoSequence, topoClusterMaker.CaloClusters) + +def HLTLCTopoRecoSequence(RoIs='InViewRoIs'): + cellMake = HLTCellMaker(RoIs) + topoClusterMaker = _algoHLTTopoClusterLC(inputEDM = cellMake.CellsName) + RecoSequence = parOR("LCTopoClusterRecoSequence",[cellMake,topoClusterMaker]) + print topoClusterMaker + for tool in topoClusterMaker.ClusterMakerTools: + print tool + return (RecoSequence, topoClusterMaker.CaloClusters) diff --git a/Trigger/TrigHypothesis/TrigTauHypo/python/TrigTrackPreSelHypoTool.py b/Trigger/TrigHypothesis/TrigTauHypo/python/TrigTrackPreSelHypoTool.py index 4e77dd1652f9cc964a250d53b7f138c92102915c..f66a2e24c4f9e83d7f6efc7e8df24458f077e07e 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/python/TrigTrackPreSelHypoTool.py +++ b/Trigger/TrigHypothesis/TrigTauHypo/python/TrigTrackPreSelHypoTool.py @@ -1,5 +1,5 @@ -def TrigTauTrackHypoProvider( chainDict ): +def TrigTauTrackHypoToolFromDict( chainDict ): name = chainDict['chainName'] chainPart = chainDict['chainParts'][0] diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/ITrigTrackPreSelHypoTool.h b/Trigger/TrigHypothesis/TrigTauHypo/src/ITrigTrackPreSelHypoTool.h index 822562322b88cefe1cf87f2e054be42c89895d50..4f7aedf4facc8be670e4eb28b1b4cfa8791cf7b8 100755 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/ITrigTrackPreSelHypoTool.h +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/ITrigTrackPreSelHypoTool.h @@ -23,8 +23,8 @@ class ITrigTrackPreSelHypoTool DeclareInterfaceID(ITrigTrackPreSelHypoTool, 1, 0); virtual ~ITrigTrackPreSelHypoTool(){} - struct ClusterInfo { - ClusterInfo( TrigCompositeUtils::Decision* d, const TrigRoiDescriptor* r, const TrackCollection *c, + struct TrackingInfo { + TrackingInfo( TrigCompositeUtils::Decision* d, const TrigRoiDescriptor* r, const TrackCollection *c, const TrigCompositeUtils::Decision* previousDecision ) : decision( d ), roi( r ), @@ -41,18 +41,18 @@ class ITrigTrackPreSelHypoTool /** - * @brief decides upon all clusters + * @brief decides upon all tracks * Note it is for a reason a non-virtual method, it is an interface in gaudi sense and implementation. * There will be many tools called often to perform this quick operation and we do not want to pay for polymorphism which we do not need to use. * Will actually see when N obj hypos will enter the scene **/ - virtual StatusCode decide( std::vector<ClusterInfo>& input ) const = 0; + virtual StatusCode decide( std::vector<TrackingInfo>& input ) const = 0; /** * @brief Makes a decision for a single object * The decision needs to be returned **/ - virtual bool decide( const ClusterInfo& i ) const = 0; + virtual bool decide( const TrackingInfo& i ) const = 0; protected: diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloRoiUpdaterMT.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloRoiUpdaterMT.cxx index f8c939aa5f07df7ab542f8094a7112bd6f1b2974..11094caa6cc0e4238396a737b1fa80767e262ec7 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloRoiUpdaterMT.cxx +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauCaloRoiUpdaterMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TrigTauCaloRoiUpdaterMT.h" @@ -14,9 +14,6 @@ #include "TLorentzVector.h" - -#include "TrigSteeringEvent/PhiHelper.h" - TrigTauCaloRoiUpdaterMT::TrigTauCaloRoiUpdaterMT(const std::string & name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) {} diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx index 011175e13e654edfa5c392c4ad020989d41e4878..58e876e3d0f2dc66a975dfb92415af6ea85d1873 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -13,6 +13,7 @@ #include "StoreGate/StoreGateSvc.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "TrigSteeringEvent/PhiHelper.h" #include "TrkTrack/Track.h" #include "TrkTrack/TrackCollection.h" @@ -21,7 +22,7 @@ TrigTauTrackRoiUpdaterMT::TrigTauTrackRoiUpdaterMT(const std::string & name, ISvcLocator* pSvcLocator) : - AthAlgorithm(name, pSvcLocator) + AthReentrantAlgorithm(name, pSvcLocator) { } @@ -32,7 +33,7 @@ TrigTauTrackRoiUpdaterMT::~TrigTauTrackRoiUpdaterMT() StatusCode TrigTauTrackRoiUpdaterMT::initialize() { - ATH_MSG_INFO( "Initializing " << name() << " ... " ); + ATH_MSG_DEBUG( "Initializing " << name() << " ... " ); ATH_MSG_DEBUG( "declareProperty review:" ); ATH_MSG_DEBUG( " TrigTauTrackRoiUpdaterMT parameters " ); @@ -52,21 +53,11 @@ StatusCode TrigTauTrackRoiUpdaterMT::initialize() } -StatusCode TrigTauTrackRoiUpdaterMT::finalize() -{ - - ATH_MSG_DEBUG("in finalize()" ); - - return StatusCode::SUCCESS; - -} - -StatusCode TrigTauTrackRoiUpdaterMT::execute() +StatusCode TrigTauTrackRoiUpdaterMT::execute(const EventContext& ctx) const { ATH_MSG_DEBUG( "Running "<< name() <<" ... " ); - const EventContext& ctx = getContext(); // Prepare Outputs std::unique_ptr< TrigRoiDescriptorCollection > roICollection( new TrigRoiDescriptorCollection() ); @@ -104,29 +95,26 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute() if(foundTracks!=0) ATH_MSG_DEBUG(" Input track collection has size " << foundTracks->size() ); else ATH_MSG_DEBUG(" Input track collection not found " ); - const Trk::Track *leadTrack = 0; - const Trk::Perigee *trackPer = 0; - const Trk::TrackSummary* summary = 0; + const Trk::Track *leadTrack = nullptr; + const Trk::Perigee *trackPer = nullptr; + const Trk::TrackSummary* summary = nullptr; double trkPtMax = 0; if(foundTracks!=0){ - TrackCollection::const_iterator it = foundTracks->begin(); - TrackCollection::const_iterator itEnd = foundTracks->end(); - // Find leading track - for (;it!=itEnd;it++){ - const Trk::Track* track = *it; + for (const Trk::Track* track : *foundTracks){ trackPer = track->perigeeParameters(); summary = track->trackSummary(); - if(summary==0) ATH_MSG_DEBUG(" track summary not available in RoI updater " << trkPtMax ); + 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) { - ATH_MSG_DEBUG("Track rejected because of nHitPix " << 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); @@ -134,10 +122,11 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute() int nSCTHole = summary->get(Trk::numberOfSCTHoles); if (nSCTHole < 0) nSCTHole = 0; if((nPixHole + nSCTHole) > m_nSiHoles) { - ATH_MSG_DEBUG("Track rejected because of nSiHoles " << 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 = (*it); + leadTrack = track; trkPtMax = trackPt; } } @@ -177,15 +166,10 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute() if ( leadTrack && m_updatePhi ) { phi = leadTrkPhi; - /// FIXME: This attempts to handle the phi wrapping correctly across the phi = pi boundary - /// but the values themselves would still need to be wrapped - the RoiDescriptor - /// should do it in the constructor, but even so, this calculation should still - /// be checked before use - if ( roiDescriptor->phi()>=roiDescriptor->phiMinus() ) phiMinus = leadTrkPhi - (roiDescriptor->phi() - roiDescriptor->phiMinus() ); - else phiMinus = leadTrkPhi - (roiDescriptor->phi() - roiDescriptor->phiMinus() + 2*M_PI ); - - if ( roiDescriptor->phiPlus()>=roiDescriptor->phi() ) phiPlus = leadTrkPhi + (roiDescriptor->phiPlus() - roiDescriptor->phi() ); - else phiPlus = leadTrkPhi + (roiDescriptor->phiPlus() - roiDescriptor->phi() + 2*M_PI ); + double deltaPhiMinus = roiDescriptor->phi() - roiDescriptor->phiMinus(); + double deltaPhiPlus = roiDescriptor->phiPlus()-roiDescriptor->phiMinus(); + phiMinus = leadTrkPhi - HLT::wrapPhi(deltaPhiMinus); + phiPlus = leadTrkPhi + HLT::wrapPhi(deltaPhiPlus); } // Prepare the new RoI @@ -204,25 +188,6 @@ StatusCode TrigTauTrackRoiUpdaterMT::execute() SG::WriteHandle< TrigRoiDescriptorCollection > outputRoiHandle = SG::makeHandle( m_roIOutputKey,ctx ); CHECK( outputRoiHandle.record( std::move( roICollection ) ) ); - - - /*std::string roiName = "forID2"; - - if ( StatusCode::SUCCESS != attachFeature(outputTE, outRoi, roiName) ) { - ATH_MSG_ERROR("Could not attach feature to the TE"); - return StatusCode::FAILURE; - } - else { - ATH_MSG_DEBUG("REGTEST: attached RoI " << roiName << *outRoi); - } - - if(attachFeature(outputTE, xBits.release(), "passbits") != StatusCode::SUCCESS) { - ATH_MSG_ERROR("Could not attach feature to the TE"); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG("REGTEST: attached bits " << xBits.release()); - }*/ - return StatusCode::SUCCESS; - + } diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h index 00c5d021bc4ccb8007a6f616ec0412ccebbfd3bd..6182b331b136274ca8f7b341cb38ea81e3debe1e 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTauTrackRoiUpdaterMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGTAUHYPO_TrigTauTrackRoiUpdaterMT_H @@ -7,22 +7,22 @@ #include <iostream> -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "TrkTrack/TrackCollection.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -class TrigTauTrackRoiUpdaterMT : public AthAlgorithm { +class TrigTauTrackRoiUpdaterMT : public AthReentrantAlgorithm { public: TrigTauTrackRoiUpdaterMT(const std::string&, ISvcLocator*); ~TrigTauTrackRoiUpdaterMT(); - StatusCode initialize(); - StatusCode finalize(); - StatusCode execute(); + virtual StatusCode initialize() override; + //StatusCode finalize(); + StatusCode execute(const EventContext&) const; private: diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.cxx index cd5d7ef0eadb08b6f50f00621d2d6fe611c73ca3..e35ee8a50f841a0e687631e6ece9e511b5852f63 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.cxx +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/Property.h" @@ -18,11 +18,8 @@ TrigTrackPreSelHypoAlgMT::~TrigTrackPreSelHypoAlgMT() {} StatusCode TrigTrackPreSelHypoAlgMT::initialize() { ATH_MSG_INFO ( "Initializing " << name() << "..." ); - ATH_CHECK( m_hypoTools.retrieve() ); - std::cout << "After m_hypoTools.retrieve() " << std::endl; ATH_CHECK( m_fastTracksKey.initialize() ); - std::cout << "After m_clusterKey.initialize() " << std::endl; renounce( m_fastTracksKey );// tau candidates are made in views, so they are not in the EvtStore: hide them return StatusCode::SUCCESS; @@ -32,24 +29,6 @@ StatusCode TrigTrackPreSelHypoAlgMT::finalize() { return StatusCode::SUCCESS; } - /* -OLD - ITC -> get 1 RoI/TC - loop over views - make one TC per view - get RoIs of view - from RoI input - get clusters of view -from View input - map the roi to a decision - from input decisions - create new decision with one cluster, one roi, one view - -NEW - loop over ITC - get RoI and view of TC - get cluster of that view - create new decision with one cluster, one roi, one view - - */ - StatusCode TrigTrackPreSelHypoAlgMT::execute( const EventContext& context ) const { ATH_MSG_DEBUG ( "Executing " << name() << "..." ); auto previousDecisionsHandle = SG::makeHandle( decisionInput(), context ); @@ -67,7 +46,7 @@ StatusCode TrigTrackPreSelHypoAlgMT::execute( const EventContext& context ) cons auto decisions = outputHandle.ptr(); // input for decision - std::vector<ITrigTrackPreSelHypoTool::ClusterInfo> toolInput; + std::vector<ITrigTrackPreSelHypoTool::TrackingInfo> toolInput; // loop over previous decisions size_t counter=0; @@ -80,47 +59,34 @@ StatusCode TrigTrackPreSelHypoAlgMT::execute( const EventContext& context ) cons // get View auto viewELInfo = TrigCompositeUtils::findLink< ViewContainer >( previousDecision, "view" ); ATH_CHECK( viewELInfo.isValid() ); - auto clusterHandle = ViewHelper::makeHandle( *(viewELInfo.link), m_fastTracksKey, context); - ATH_CHECK( clusterHandle.isValid() ); - ATH_MSG_DEBUG ( "Cluster handle size: " << clusterHandle->size() << "..." ); + auto tracksHandle = ViewHelper::makeHandle( *(viewELInfo.link), m_fastTracksKey, context); + ATH_CHECK( tracksHandle.isValid() ); + ATH_MSG_DEBUG ( "tracks handle size: " << tracksHandle->size() << "..." ); // create new decision auto d = newDecisionIn( decisions, name() ); - toolInput.emplace_back( d, roi, clusterHandle.cptr(), previousDecision ); + toolInput.emplace_back( d, roi, tracksHandle.cptr(), previousDecision ); { - auto el = ViewHelper::makeLink( *(viewELInfo.link), clusterHandle, 0 ); + auto el = ViewHelper::makeLink( *(viewELInfo.link), tracksHandle, 0 ); ATH_CHECK( el.isValid() ); d->setObjectLink( "feature", el ); } d->setObjectLink( "roi", roiELInfo.link ); TrigCompositeUtils::linkToPrevious( d, decisionInput().key(), counter ); - ATH_MSG_DEBUG( "Added view, roi, cluster, previous decision to new decision " << counter << " for view " << (*viewELInfo.link)->name() ); + ATH_MSG_DEBUG( "Added view, roi, tracks, previous decision to new decision " << counter << " for view " << (*viewELInfo.link)->name() ); counter++; } ATH_MSG_DEBUG( "Found "<<toolInput.size()<<" inputs to tools"); - for ( auto& tool: m_hypoTools ) { ATH_CHECK( tool->decide( toolInput ) ); } - - {// make output handle and debug - ATH_MSG_DEBUG ( "Exit with "<<outputHandle->size() <<" decisions"); - TrigCompositeUtils::DecisionIDContainer allPassingIDs; - if ( outputHandle.isValid() ) { - for ( auto decisionObject: *outputHandle ) { - TrigCompositeUtils::decisionIDs( decisionObject, allPassingIDs ); - } - for ( TrigCompositeUtils::DecisionID id : allPassingIDs ) { - ATH_MSG_DEBUG( " +++ " << HLT::Identifier( id ) ); - } - } - } return StatusCode::SUCCESS; } + diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.h b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.h index f566e77a1aebbd124d03fd5937fdcd8f7b7e7982..7d9f40216b61c258b97fd6573cd787403e257300 100644 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.h +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoAlgMT.h @@ -1,27 +1,20 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRIGTAUHYPO_TrigTrackPreSelHypoAlgMT_H -#define TRIGTAUHYPO_TrigTrackPreSelHypoAlgMT_H +#ifndef TRIGTAUHYPO_TRIGTRACKPRESELHYPOALG_H +#define TRIGTAUHYPO_TRIGTRACKPRESELHYPOALG_H #include <string> #include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "AthViews/View.h" #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" -//#include "xAODTrigCalo/TrigEMClusterContainer.h" -//#include "xAODTrigCalo/TrigCaloClusterContainer.h" -//#include "xAODCaloEvent/CaloClusterContainer.h" #include "TrkTrack/TrackCollection.h" #include "DecisionHandling/TrigCompositeUtils.h" #include "DecisionHandling/HypoBase.h" #include "ITrigTrackPreSelHypoTool.h" -/** - * @class TrigL2CaloHypoAlgMT - * @brief Implements egamma calo selection for the new HLT framework - **/ class TrigTrackPreSelHypoAlgMT : public ::HypoBase { public: @@ -42,4 +35,4 @@ class TrigTrackPreSelHypoAlgMT : public ::HypoBase { }; -#endif //> !TRIGEGAMMAHYPO_TESTTRIGL2TAUCALOHYPOALG_H +#endif //> !TRIGTAUHYPO_TRIGTRACKPRESELHYPOALG_H diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.cxx b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.cxx index 7dc92900c6646c6ed5834f2e2271036ff03f26f2..d8bda79cffc27e3afdc38146613de94d21064e70 100755 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.cxx @@ -1,4 +1,5 @@ /* +<<<<<<< HEAD Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ @@ -19,6 +20,11 @@ * *********************************************************************/ +======= + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +>>>>>>> origin/tauTrackSequenceDevFirst #include <iterator> #include <sstream> @@ -59,6 +65,7 @@ TrigTrackPreSelHypoTool::TrigTrackPreSelHypoTool( const std::string& type, m_decisionId( HLT::Identifier::fromToolName( name ) ) { } +<<<<<<< HEAD /*HLTTrackPreSelHypo::HLTTrackPreSelHypo(const std::string& name, ISvcLocator* pSvcLocator): HLT::HypoAlgo(name, pSvcLocator), @@ -84,6 +91,8 @@ TrigTrackPreSelHypoTool::TrigTrackPreSelHypoTool( const std::string& type, declareMonitoredVariable("nTracksInCore" , m_nTracksInCore); declareMonitoredVariable("nTracksInIso" , m_nTracksInIso); }*/ +======= +>>>>>>> origin/tauTrackSequenceDevFirst TrigTrackPreSelHypoTool::~TrigTrackPreSelHypoTool() { @@ -96,9 +105,12 @@ StatusCode TrigTrackPreSelHypoTool::initialize() if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() ); +<<<<<<< HEAD ATH_MSG_DEBUG( "AcceptAll = " << ( m_acceptAll==true ? "True" : "False" ) ); +======= +>>>>>>> origin/tauTrackSequenceDevFirst ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId ); ATH_MSG_INFO( " REGTEST: TrigTrackPreSelHypoTool will cut on " ); @@ -114,7 +126,11 @@ StatusCode TrigTrackPreSelHypoTool::initialize() return StatusCode::SUCCESS; } +<<<<<<< HEAD bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInfo& input ) const { +======= +bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::TrackingInfo& input ) const { +>>>>>>> origin/tauTrackSequenceDevFirst // Get the messaging service, print where you are ATH_MSG_DEBUG( "REGTEST:"<< name() << ": in execute()" ); @@ -126,13 +142,17 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf auto nTracksInCore = Monitored::Scalar<int>( "nTracksInCore", -1); auto nTracksInIso = Monitored::Scalar<int>( "nTracksInIso", -1); auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 ); +<<<<<<< HEAD //auto monitorIt = MonitoredScope::declare( m_monTool, PassedCuts, nTracksInCore, nTracksInIso ); +======= +>>>>>>> origin/tauTrackSequenceDevFirst // general reset PassedCuts = 0; //get RoI descriptor auto roiDescriptor = input.roi; +<<<<<<< HEAD /*const TrigRoiDescriptor* roiDescriptor = 0; StatusCode status = getFeature(inputTE, roiDescriptor); if ( status != StatusCode::SUCCESS || roiDescriptor == 0 ) { @@ -140,10 +160,14 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf return pass; }*/ +======= + +>>>>>>> origin/tauTrackSequenceDevFirst float roIEta = roiDescriptor->eta(); float roIPhi = roiDescriptor->phi(); ATH_MSG_DEBUG( "Input RoI eta: " << roIEta << " Input RoI phi: " << roIPhi ); +<<<<<<< HEAD //look at fast-tracks //std::vector<const TrackCollection*> vectorFoundTracks; @@ -165,11 +189,14 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf } }*/ +======= +>>>>>>> origin/tauTrackSequenceDevFirst // get the tracks collection // Retrieve Input TrackCollection auto foundTracks = input.trackcollection; +<<<<<<< HEAD if(foundTracks) { ATH_MSG_DEBUG( " Input track collection has size " << foundTracks->size() ); } @@ -260,6 +287,19 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf //first, identify highest pT leading track, we may need to add here some track quality requirements... for (;it!=itEnd;it++){ const Trk::Track* track = *it; +======= + if(foundTracks->size()!=0) { + ATH_MSG_DEBUG( " Input track collection has size " << foundTracks->size() ); + } + + if(foundTracks){ + const Trk::Track *Ltrack = nullptr; + const Trk::Perigee *tp = nullptr; + float trk_pt_max = 0; + + //first, identify highest pT leading track, we may need to add here some track quality requirements... + for (const Trk::Track* track : *foundTracks){ +>>>>>>> origin/tauTrackSequenceDevFirst tp = track->perigeeParameters(); if(tp){ float trk_pt = tp->pT(); @@ -268,7 +308,11 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf float trk_phi = tp->parameters()[Trk::phi]; double dR_trk_tau = sqrt((roIEta-trk_eta)*(roIEta-trk_eta) + HLT::wrapPhi(roIPhi-trk_phi)*HLT::wrapPhi(roIPhi-trk_phi)); if ((trk_pt > trk_pt_max) && dR_trk_tau < m_deltaRLeadTrkRoI) { +<<<<<<< HEAD Ltrack = (*it); +======= + Ltrack = track; +>>>>>>> origin/tauTrackSequenceDevFirst trk_pt_max = trk_pt; } } @@ -300,10 +344,15 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf ltrk_z0 = 0.; usePileupSuppCut = false; } +<<<<<<< HEAD TrackCollection::const_iterator trackIt; for (trackIt=foundTracks->begin(); trackIt != foundTracks->end(); ++trackIt){ const Trk::Track* track = *trackIt; +======= + + for (const Trk::Track* track : *foundTracks){ +>>>>>>> origin/tauTrackSequenceDevFirst tp = track->perigeeParameters(); if(tp){ float trk_eta = tp->eta(); @@ -349,7 +398,11 @@ bool TrigTrackPreSelHypoTool::decide( const ITrigTrackPreSelHypoTool::ClusterInf } +<<<<<<< HEAD StatusCode TrigTrackPreSelHypoTool::decide( std::vector<ClusterInfo>& input ) const { +======= +StatusCode TrigTrackPreSelHypoTool::decide( std::vector<TrackingInfo>& input ) const { +>>>>>>> origin/tauTrackSequenceDevFirst for ( auto& i: input ) { if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) { diff --git a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.h b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.h index 3e6dd598fcbb45cb85d808b7fbd9045c6217f230..ed081dc0815d48c1f51d6c266e63e6acacf0b484 100755 --- a/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.h +++ b/Trigger/TrigHypothesis/TrigTauHypo/src/TrigTrackPreSelHypoTool.h @@ -1,27 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TrigTrackPreSelHypoTool_H #define TrigTrackPreSelHypoTool_H -/******************************************************************** - * - * NAME: HLTTrackPreSelHypo.h - * PACKAGE: Trigger/TrigHypothesis/TrigTauHypo - * - * AUTHORS: Marcelo Vogel (mavogel@cern.ch) - * Soshi Tsuno - * P.O. DeViveiros - * CREATED: May 26, 2014 - * - * DESCRIPTION: - * - * Implementation of fast-tracking based pre-selection on - * tau candidates starting from L1 seeds - * - *********************************************************************/ - #include "GaudiKernel/Property.h" #include "CLHEP/Units/SystemOfUnits.h" #include "xAODTau/TauJet.h" @@ -50,19 +33,14 @@ class TrigTrackPreSelHypoTool : public extends<AthAlgTool, ITrigTrackPreSelHypoT virtual StatusCode initialize() override; - virtual StatusCode decide( std::vector<ITrigTrackPreSelHypoTool::ClusterInfo>& input ) const override; + virtual StatusCode decide( std::vector<ITrigTrackPreSelHypoTool::TrackingInfo>& input ) const override; - virtual bool decide( const ITrigTrackPreSelHypoTool::ClusterInfo& i ) const override; + virtual bool decide( const ITrigTrackPreSelHypoTool::TrackingInfo& i ) const override; private: HLT::Identifier m_decisionId; - Gaudi::Property<bool> m_decisionPerCluster{ this, "DecisionPerCluster", true, "Is multiplicity requirement refering to taus ( false ) or RoIs/clusters with taus ( false ), relevant only in when multiplicity > 1" }; - - Gaudi::Property<bool> m_respectPreviousDecision{ this, "RespectPreviousDecision", false, "If false, ( do not even check ), the decision made for the cluster" }; - Gaudi::Property<bool> m_acceptAll{ this, "AcceptAll", false, "Ignore selection" }; - Gaudi::Property<float> m_lowerPtCut{ this, "lowerPtCut", 20000.0, "" }; Gaudi::Property<float> m_lowerTrackPtCut{ this, "lowerTrackPtCut", 0.0, "" }; Gaudi::Property<float> m_clusterCone{ this, "clusterCone", 0.2, "" }; diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/tauDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/tauDefs.py new file mode 100644 index 0000000000000000000000000000000000000000..813b499190e0693ee01de32ac8acb130c0607be7 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/tauDefs.py @@ -0,0 +1,49 @@ +from AthenaCommon.AppMgr import ServiceMgr as svcMgr +from AthenaCommon.Constants import VERBOSE,DEBUG,INFO, ERROR +from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RecoFragmentsPool, MenuSequence +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +from TrigT2CaloCommon.CaloDef import HLTCellMaker, HLTLCTopoRecoSequence + +def _algoTauRoiUpdater(inputEDM="EMRoIs"): + from TrigTauHypo.TrigTauHypoConf import TrigTauCaloRoiUpdaterMT + algo = TrigTauCaloRoiUpdaterMT("CaloRoiUpdater") + algo.RoIInputKey = "TAUCaloRoIs" + algo.RoIOutputKey = "RoiForTau" + return algo + +def _algoTauCaloOnly(inputEDM="EMRoIs"): + from TrigTauRec.TrigTauRecConfigMT import TrigTauRecMerged_TauCaloOnly + roiUpdateAlgo = _algoTauRoiUpdater(inputEDM) + algo = TrigTauRecMerged_TauCaloOnly() + algo.RoIInputKey = inputEDM + algo.L1RoIKey = roiUpdateAlgo.RoIInputKey + algo.clustersKey = "caloclusters" + algo.TrigTauRecOutputKey = "taujets" + return algo + +def tauCaloRecoSequence(InViewRoIs): + # lc sequence + (lcTopoInViewSequence, sequenceOut) = HLTLCTopoRecoSequence(InViewRoIs) + tauCaloRoiUpdaterAlg = _algoTauRoiUpdater(inputEDM=InViewRoIs) + tauCaloOnlyAlg = _algoTauCaloOnly(inputEDM=InViewRoIs) + RecoSequence = parOR( 'tauCaloInViewSequence', [lcTopoInViewSequence,tauCaloRoiUpdaterAlg,tauCaloOnlyAlg] ) + sequenceOut = tauCaloOnlyAlg.TrigTauRecOutputKey + return (RecoSequence, sequenceOut) + +def tauCaloSequence(ConfigFlags): + """ Creates L2 Fast Calo sequence for Taus""" + # EV creator + InViewRoIs="TAUCaloRoIs" + tauCaloViewsMaker = EventViewCreatorAlgorithm( "tauCaloViewsMaker") + tauCaloViewsMaker.ViewFallThrough = True + tauCaloViewsMaker.RoIsLink = "initialRoI" + tauCaloViewsMaker.InViewRoIs = InViewRoIs + tauCaloViewsMaker.Views = "TAUCaloViews" + tauCaloViewsMaker.ViewNodeName = "tauCaloInViewSequence" + + (tauCaloInViewSequence, sequenceOut) = tauCaloRecoSequence(InViewRoIs) + + tauCaloSequence = seqAND("tauCaloSequence", [tauCaloViewsMaker, tauCaloInViewSequence ]) + return (tauCaloSequence, tauCaloViewsMaker, sequenceOut) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py index ef2ddd14691e7ae8a08966c92ca1d9e5b7ae3a53..875582a44855123075095646916e2c87e6e38b83 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py @@ -6,26 +6,30 @@ from AthenaCommon.Include import include from AthenaCommon.Constants import VERBOSE,DEBUG from AthenaCommon.AppMgr import ServiceMgr as svcMgr import AthenaCommon.CfgMgr as CfgMgr - - -from InDetRecExample.InDetJobProperties import InDetFlags -InDetFlags.doCaloSeededBrem = False -InDetFlags.InDet25nsec = True -InDetFlags.doPrimaryVertex3DFinding = False -InDetFlags.doPrintConfigurables = False -InDetFlags.doResolveBackTracks = True -InDetFlags.doSiSPSeededTrackFinder = True -InDetFlags.doTRTPhaseCalculation = True -InDetFlags.doTRTSeededTrackFinder = True -InDetFlags.doTruth = False -InDetFlags.init() - -# PixelLorentzAngleSvc and SCTLorentzAngleSvc -from InDetRecExample.InDetKeys import InDetKeys -include("InDetRecExample/InDetRecConditionsAccess.py") - -# menu components -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence +from AthenaConfiguration.AllConfigFlags import ConfigFlags + +# menu components +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool +from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +from TrigUpgradeTest.tauDefs import tauCaloSequence + +def inDetSetup(): + from InDetRecExample.InDetJobProperties import InDetFlags + InDetFlags.doCaloSeededBrem = False + InDetFlags.InDet25nsec = True + InDetFlags.doPrimaryVertex3DFinding = False + InDetFlags.doPrintConfigurables = False + InDetFlags.doResolveBackTracks = True + InDetFlags.doSiSPSeededTrackFinder = True + InDetFlags.doTRTPhaseCalculation = True + InDetFlags.doTRTSeededTrackFinder = True + InDetFlags.doTruth = False + InDetFlags.init() + + # PixelLorentzAngleSvc and SCTLorentzAngleSvc + from InDetRecExample.InDetKeys import InDetKeys + include("InDetRecExample/InDetRecConditionsAccess.py") # ==================================================================================================== # Get MenuSequences @@ -33,81 +37,50 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence def getTauSequence( step ): if step == "calo": - return tauCaloSequence() + return tauCaloMenuSequence("Tau") if step == "track_core": return tauCoreTrackSequence() - if step == "track_iso": - return tauIsoTrackSequence() return None # =============================================================================================== -# First step - Calo Roi Updater +# Fist step - tau calo # =============================================================================================== +def tauCaloMenuSequence(name): + (sequence, tauCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(tauCaloSequence,ConfigFlags) -def tauCaloSequence(): - - from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMakerMT_tau - cellMaker = TrigCaloCellMakerMT_tau("CaloCellMakerTau") - cellMaker.OutputLevel=DEBUG - - from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo - clusMaker = TrigCaloClusterMakerMT_topo("CaloClusMakerTopo") - clusMaker.OutputLevel=VERBOSE - - from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm - - fastCaloViewsMaker = EventViewCreatorAlgorithm("fastCaloViewsMakerTau", OutputLevel=VERBOSE) - fastCaloViewsMaker.ViewFallThrough = True - fastCaloViewsMaker.RoIsLink = "initialRoI" - fastCaloViewsMaker.InViewRoIs = "TAUCaloRoIs" - fastCaloViewsMaker.Views = "TAUCaloViews" - fastCaloViewsMaker.ViewNodeName = "fastCaloInViewAlgsTau" - cellMaker.RoIs = fastCaloViewsMaker.InViewRoIs - - CaloViewVerify = CfgMgr.AthViews__ViewDataVerifier("FastCaloViewDataVerifier") - CaloViewVerify.DataObjects = [('TrigRoiDescriptorCollection' , 'StoreGateSvc+fastCaloViewsMaker_InViewRoIs_out')] - - from TrigTauHypo.TrigTauHypoConf import TrigTauCaloRoiUpdaterMT - CaloRoiUpdater = TrigTauCaloRoiUpdaterMT("CaloRoiUpdater") - CaloRoiUpdater.OutputLevel = DEBUG - CaloRoiUpdater.RoIInputKey = "TAUCaloRoIs" - CaloRoiUpdater.RoIOutputKey = "RoiForTau" - - from TrigTauRec.TrigTauRecConfigMT import TrigTauRecMerged_TauCaloOnly - caloRec = TrigTauRecMerged_TauCaloOnly() - caloRec.OutputLevel = DEBUG - caloRec.RoIInputKey = "RoiForTau" - caloRec.L1RoIKey = "TAUCaloRoIs" - caloRec.clustersKey = "caloclusters" - caloRec.TrigTauRecOutputKey = "taujets" - - fastCaloInViewAlgs = seqAND("fastCaloInViewAlgsTau", [cellMaker,clusMaker,CaloRoiUpdater,caloRec]) - fastCaloAthSequence = seqAND("fastCaloAthSequenceTau",[fastCaloViewsMaker, fastCaloInViewAlgs]) - + # hypo from TrigTauHypo.TrigTauHypoConf import TrigTauCaloHypoAlgMT - fastCaloHypo = TrigTauCaloHypoAlgMT("TauGenericHypoMT") - fastCaloHypo.OutputLevel = DEBUG + theTauCaloHypo = TrigTauCaloHypoAlgMT(name+"L2CaloHypo") + theTauCaloHypo.taujets = sequenceOut from TrigTauHypo.TrigL2TauHypoTool import TrigL2TauHypoToolFromDict - return MenuSequence( Sequence = fastCaloAthSequence, - Maker = fastCaloViewsMaker, - Hypo = fastCaloHypo, + return MenuSequence( Sequence = sequence, + Maker = tauCaloViewsMaker, + Hypo = theTauCaloHypo, HypoToolGen = TrigL2TauHypoToolFromDict ) +# ==================================================================================================== +# Get MenuSequences +# ==================================================================================================== + +def getTauSequence( step ): + if step == "calo": + return tauCaloSequence() + if step == "track_core": + return tauCoreTrackSequence() + if step == "track_iso": + return tauIsoTrackSequence() + return None + # =============================================================================================== -# Second step - fast Tracking +# Second step - fast tracking # =============================================================================================== def tauCoreTrackSequence(): - from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm - - from TrigUpgradeTest.InDetSetup import makeInDetAlgs - #makeInDetAlgsTauCore = makeInDetAlgs("TauCore") + from TriggerMenuMT.HLTMenuConfig.CommonSequences.InDetSetup import makeInDetAlgs (viewAlgs, eventAlgs) = makeInDetAlgs("TauCore") from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_TauCore @@ -119,21 +92,21 @@ def tauCoreTrackSequence(): # A simple algorithm to confirm that data has been inherited from parent view # Required to satisfy data dependencies - ViewVerifyCore = CfgMgr.AthViews__ViewDataVerifier("tauCoreViewDataVerifier") - ViewVerifyCore.DataObjects = [('xAOD::TauJetContainer','StoreGateSvc+taujets')] - ViewVerifyCore.OutputLevel = DEBUG - viewAlgs.append(ViewVerifyCore) + ViewVerify = CfgMgr.AthViews__ViewDataVerifier("tauViewDataVerifier") + ViewVerify.DataObjects = [('xAOD::TauJetContainer','StoreGateSvc+taujets')] + ViewVerify.OutputLevel = DEBUG + viewAlgs.append(ViewVerify) - TrackParticlesName = "" - for viewAlg in viewAlgs: - if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg": - TrackParticlesName = viewAlg.TrackParticlesName + #TrackParticlesName = "" + #for viewAlg in viewAlgs: + # if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg": + # TrackParticlesName = viewAlg.TrackParticlesName from TrigTauHypo.TrigTauHypoConf import TrigTauTrackRoiUpdaterMT TrackRoiUpdater = TrigTauTrackRoiUpdaterMT("TrackRoiUpdater") TrackRoiUpdater.OutputLevel = DEBUG - #TrackRoiUpdater.RoIInputKey = "TAUCaloRoIs" + TrackRoiUpdater.RoIInputKey = "TAUCaloRoIs" TrackRoiUpdater.RoIOutputKey = "RoiForID2" TrackRoiUpdater.fastTracksKey = "TrigFastTrackFinder_Tracks" @@ -160,14 +133,14 @@ def tauCoreTrackSequence(): from TrigTauHypo.TrigTauHypoConf import TrigTrackPreSelHypoAlgMT fastTrkHypo = TrigTrackPreSelHypoAlgMT("TrackPreSelHypoAlg") fastTrkHypo.OutputLevel = DEBUG - fastTrkHypo.trackcollection="TrigFastTrackFinder_Tracks" + fastTrkHypo.trackcollection = TrackRoiUpdater.fastTracksKey - from TrigTauHypo.TrigTrackPreSelHypoTool import TrigTauTrackHypoProvider + from TrigTauHypo.TrigTrackPreSelHypoTool import TrigTauTrackHypoToolFromDict return MenuSequence( Sequence = tauCoreTrkAthSequence, Maker = l2TauViewsMaker, Hypo = fastTrkHypo, - HypoToolGen = TrigTauTrackHypoProvider ) + HypoToolGen = TrigTauTrackHypoToolFromDict ) # =============================================================================================== # Third step - fast Tracking iso @@ -178,8 +151,7 @@ def tauIsoTrackSequence(): from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm - from TrigUpgradeTest.InDetSetup import makeInDetAlgs - #makeInDetAlgsTauIso = makeInDetAlgs("TauIso") + from TriggerMenuMT.HLTMenuConfig.CommonSequences.InDetSetup import makeInDetAlgs (viewAlgs2, eventAlgs2) = makeInDetAlgs("TauIso") from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_TauIso diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py.bkup b/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py.bkup deleted file mode 100644 index 27710e80e1c7b010a8adf300c47a7f570717bf23..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/tauMenuDefs.py.bkup +++ /dev/null @@ -1,250 +0,0 @@ -# -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -# - -from AthenaCommon.Include import include -from AthenaCommon.Constants import VERBOSE,DEBUG -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -import AthenaCommon.CfgMgr as CfgMgr - - -from InDetRecExample.InDetJobProperties import InDetFlags -InDetFlags.doCaloSeededBrem = False -InDetFlags.InDet25nsec = True -InDetFlags.doPrimaryVertex3DFinding = False -InDetFlags.doPrintConfigurables = False -InDetFlags.doResolveBackTracks = True -InDetFlags.doSiSPSeededTrackFinder = True -InDetFlags.doTRTPhaseCalculation = True -InDetFlags.doTRTSeededTrackFinder = True -InDetFlags.doTruth = False -InDetFlags.init() - -# PixelLorentzAngleSvc and SCTLorentzAngleSvc -include("InDetRecExample/InDetRecConditionsAccess.py") -from InDetRecExample.InDetKeys import InDetKeys - -# menu components -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence - -# =============================================================================================== -# L2 Calo -# =============================================================================================== - -# from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo -# theFastCaloAlgo=T2CaloEgamma_ReFastAlgo("FastCaloAlgo" ) -# theFastCaloAlgo.OutputLevel=VERBOSE -# theFastCaloAlgo.ClustersName="L2CaloClusters" -# svcMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection=False - -# ================ -# CellMaker -# ================ - -from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMakerMT_tau -cellMaker = TrigCaloCellMakerMT_tau("CaloCellMakerTau") -cellMaker.OutputLevel=DEBUG - -from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo -clusMaker = TrigCaloClusterMakerMT_topo("CaloClusMakerTopo") -clusMaker.OutputLevel=VERBOSE - -from TrigTauRec.TrigTauRecConfig import (TrigTauRecMerged_Tau2012, - TrigTauRecMerged_TauCaloOnly, - TrigTauRecMerged_TauCaloOnlyMVA, - TrigTauRecMerged_TauFTK, - TrigTauRecMerged_TauPrecision, - TrigTauRecMerged_TauPreselection, - TrigTauRecMerged_TauPrecisionMVA) - - -from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq -from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm - -fastCaloViewsMaker = EventViewCreatorAlgorithm("fastCaloViewsMakerTau", OutputLevel=VERBOSE) -fastCaloViewsMaker.ViewFallThrough = True -fastCaloViewsMaker.RoIsLink = "initialRoI" # -||- -fastCaloViewsMaker.InViewRoIs = "TAUCaloRoIs" # contract with the fastCalo -fastCaloViewsMaker.Views = "TAUCaloViews" -fastCaloViewsMaker.ViewNodeName = "fastCaloInViewAlgsTau" -cellMaker.RoIs = fastCaloViewsMaker.InViewRoIs - - -#fastCaloAthSequence = seqAND("fastCaloAthSequenceTau",[fastCaloViewsMaker, fastCaloInViewAlgs]) - -# are these needed? -CaloViewVerify = CfgMgr.AthViews__ViewDataVerifier("FastCaloViewDataVerifier") -CaloViewVerify.DataObjects = [('TrigRoiDescriptorCollection' , 'StoreGateSvc+fastCaloViewsMaker_InViewRoIs_out')] - -from TrigTauHypo.TrigTauHypoConf import TrigTauCaloRoiUpdaterMT -CaloRoiUpdater = TrigTauCaloRoiUpdaterMT("CaloRoiUpdater") -CaloRoiUpdater.OutputLevel = DEBUG -CaloRoiUpdater.RoIInputKey = "TAUCaloRoIs" -CaloRoiUpdater.RoIOutputKey = "RoiForTau" # Default for Fast Tracking Algs - -l2TauViewsMaker = EventViewCreatorAlgorithm("l2TauViewsMaker", OutputLevel=DEBUG) -l2TauViewsMaker.RoIsLink = "roi" # -||- -l2TauViewsMaker.InViewRoIs = "RoiForCalo" # contract with the fastCalo -l2TauViewsMaker.Views = "TAUCaloViews" -l2TauViewsMaker.ViewFallThrough = True - -fastCaloInViewAlgs = seqAND("fastCaloInViewAlgsTau", [cellMaker,clusMaker,CaloRoiUpdater]) - -#for viewAlg in ViewAlgs: -# if viewAlg.properties().has_key("RoIs"): -# viewAlg.RoIs = l2TauViewsMaker.InViewRoIs -# if viewAlg.properties().has_key("roiCollectionName"): -# viewAlg.roiCollectionName = TauElectronViewsMaker.InViewRoIs -#CaloRoiUpdater.caloclusters = l2TauViewsMaker.InViewRoIs - -#fastCaloAthSequence = seqAND("fastCaloAthSequenceRoIUpdater", [ CaloRoiUpdater ]) -fastCaloAthSequence = seqAND("fastCaloAthSequenceTau",[fastCaloViewsMaker, fastCaloInViewAlgs]) - -#l2TauViewsMaker.ViewNodeName = "tauInViewAlgs" - -#Copying code from here -#from TrigEgammaHypo.TrigL2ElectronFexMTConfig import L2ElectronFex_1 -#theElectronFex= L2ElectronFex_1() -#theElectronFex.TrigEMClusterName = theFastCaloAlgo.ClustersName -#theElectronFex.TrackParticlesName = TrackParticlesName -#theElectronFex.ElectronsName="Electrons" -#theElectronFex.OutputLevel=VERBOSE - - -#l2ElectronViewsMaker = EventViewCreatorAlgorithm("l2ElectronViewsMaker", OutputLevel=DEBUG) -#l2ElectronViewsMaker.RoIsLink = "roi" # -||- -#l2ElectronViewsMaker.InViewRoIs = "EMIDRoIs" # contract with the fastCalo -#l2ElectronViewsMaker.Views = "EMElectronViews" -#l2ElectronViewsMaker.ViewFallThrough = True - - -#for viewAlg in viewAlgs: -# if viewAlg.properties().has_key("RoIs"): -# viewAlg.RoIs = l2ElectronViewsMaker.InViewRoIs -# if viewAlg.properties().has_key("roiCollectionName"): -# viewAlg.roiCollectionName = l2ElectronViewsMaker.InViewRoIs -#theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs - -#electronInViewAlgs = parOR("electronInViewAlgs", viewAlgs + [ theElectronFex ]) - -#l2ElectronViewsMaker.ViewNodeName = "electronInViewAlgs" -#to here - - - - - - -#from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoAlg -#from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoTool - - -#def genCaloHypoToolTau( name, conf ): -# return HLTTest__TestHypoTool("name") - -#def tauCaloSequence(): -# return MenuSequence( Sequence = fastCaloAthSequence, -# Maker = fastCaloViewsMaker, -# Hypo = HLTTest__TestHypoAlg("L2TauCaloHypoAlg", Input=""), -# HypoToolGen = genCaloHypoToolTau ) - -#Keep these lines for the future -from TrigTauHypo.TrigTauHypoConf import TrigL2TauCaloHypoAlgMT -fastCaloHypo = TrigL2TauCaloHypoAlgMT("L2TauCaloHypo") -fastCaloHypo.OutputLevel = DEBUG - - -from TrigTauHypo.TrigL2TauHypoTool import TrigL2TauHypoToolFromName -#from TrigTauHypo.TrigTauHypoBase import -#from TrigTauHypo.L2TauHypoTool import TrigL2TauHypoTool -#from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoTool - -#def genCaloHypoToolTau( name, conf ): -# return HLTTest__TestHypoTool("name") - -#from TrigTauHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName - -#Will use this later -def tauCaloSequence(): - return MenuSequence( Sequence = fastCaloAthSequence, - Maker = fastCaloViewsMaker, - Hypo = fastCaloHypo, - HypoToolGen = TrigL2TauHypoToolFromName ) - - -# ######################################### -# # second step: tracking..... -# ######################################### -# # - - -# from TriggerMenuMT.HLTMenuConfig.CommonSequences.InDetSetup import makeInDetAlgs - - -# (viewAlgs, eventAlgs) = makeInDetAlgs() -# from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_eGamma - -# theFTF = TrigFastTrackFinder_eGamma() -# theFTF.isRoI_Seeded = True -# viewAlgs.append(theFTF) - - -# # A simple algorithm to confirm that data has been inherited from parent view -# # Required to satisfy data dependencies -# ViewVerify = CfgMgr.AthViews__ViewDataVerifier("electronViewDataVerifier") -# ViewVerify.DataObjects = [('xAOD::TrigEMClusterContainer','StoreGateSvc+L2CaloClusters')] -# ViewVerify.OutputLevel = DEBUG -# viewAlgs.append(ViewVerify) - -# TrackParticlesName = "" -# for viewAlg in viewAlgs: -# if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg": -# TrackParticlesName = viewAlg.TrackParticlesName - - -# from TrigEgammaHypo.TrigL2ElectronFexMTConfig import L2ElectronFex_1 -# theElectronFex= L2ElectronFex_1() -# theElectronFex.TrigEMClusterName = theFastCaloAlgo.ClustersName -# theElectronFex.TrackParticlesName = TrackParticlesName -# theElectronFex.ElectronsName="Electrons" -# theElectronFex.OutputLevel=VERBOSE - - -# l2ElectronViewsMaker = EventViewCreatorAlgorithm("l2ElectronViewsMaker", OutputLevel=DEBUG) -# l2ElectronViewsMaker.RoIsLink = "roi" # -||- -# l2ElectronViewsMaker.InViewRoIs = "EMIDRoIs" # contract with the fastCalo -# l2ElectronViewsMaker.Views = "EMElectronViews" -# l2ElectronViewsMaker.ViewFallThrough = True - - -# for viewAlg in viewAlgs: -# if viewAlg.properties().has_key("RoIs"): -# viewAlg.RoIs = l2ElectronViewsMaker.InViewRoIs -# if viewAlg.properties().has_key("roiCollectionName"): -# viewAlg.roiCollectionName = l2ElectronViewsMaker.InViewRoIs -# theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs - -# electronInViewAlgs = parOR("electronInViewAlgs", viewAlgs + [ theElectronFex ]) - -# l2ElectronViewsMaker.ViewNodeName = "electronInViewAlgs" - - -# from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypoAlgMT -# theElectronHypo = TrigL2ElectronHypoAlgMT() -# theElectronHypo.Electrons = theElectronFex.ElectronsName -# theElectronHypo.RunInView=True -# theElectronHypo.OutputLevel = VERBOSE - -# # this needs to be added: -# #electronDecisionsDumper = DumpDecisions("electronDecisionsDumper", OutputLevel=DEBUG, Decisions = theElectronHypo.Output ) - -# electronAthSequence = seqAND("electronAthSequence", eventAlgs + [l2ElectronViewsMaker, electronInViewAlgs ] ) - -# from TrigEgammaHypo.TrigL2ElectronHypoTool import TrigL2ElectronHypoToolFromName - -# def electronSequence(): -# return MenuSequence( Maker = l2ElectronViewsMaker, -# Sequence = electronAthSequence, -# Hypo = theElectronHypo, -# HypoToolGen = TrigL2ElectronHypoToolFromName ) - diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/tau.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/tau.menu.py index 62dab096a4ae4e3575cc8e4501f0abe8d78603aa..96d32911a58e34379f5ab397187c6f6c1e8011e1 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/tau.menu.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/tau.menu.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # import flags @@ -9,33 +9,19 @@ include("TrigUpgradeTest/testHLT_MT.py") # menu ########################################## from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep -# from TrigUpgradeTest.egammaMenuDefs import fastCaloSequence, electronSequence +from TrigUpgradeTest.tauMenuDefs import inDetSetup -# fastCaloStep= fastCaloSequence() -# electronStep= electronSequence() - -# step1=ChainStep("Step1_etcut", [fastCaloStep]) -# step2=ChainStep("Step2_etcut", [electronStep]) -# testChains = [ -# Chain(name='HLT_e3_etcut1step', Seed="L1_EM3", ChainSteps=[step1] ), -# Chain(name='HLT_e3_etcut', Seed="L1_EM3", ChainSteps=[step1, step2] ), -# Chain(name='HLT_e5_etcut', Seed="L1_EM3", ChainSteps=[step1, step2] ), -# Chain(name='HLT_e7_etcut', Seed="L1_EM3", ChainSteps=[step1, step2] ) -# ] +inDetSetup() from TrigUpgradeTest.tauMenuDefs import getTauSequence step1=ChainStep("Step1_tau", [getTauSequence('calo')]) step2=ChainStep("Step2_tau", [getTauSequence('track_core')]) step3=ChainStep("Step3_tau", [getTauSequence('track_iso')]) - - testChains = [ Chain(name='HLT_tau0_perf_ptonly_L1TAU12', Seed="L1_TAU12", ChainSteps=[step1,step2,step3] ), Chain(name='HLT_tau25_medium1_tracktwo', Seed="L1_TAU12IM", ChainSteps=[step1,step2,step3] ), ] - - # ########################################## diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/tauMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/tauMenu.ref index f8df9068568c19bff725b0c68ba0d01d26bf3150..be896733409a68eae8b66b4bff71f573e4b1e098 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/tauMenu.ref +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/tauMenu.ref @@ -1,10 +1,28 @@ +TriggerSummaryStep1 0 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep1 0 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep2 0 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 0 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 TriggerSummaryStep1 1 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 TriggerSummaryStep1 1 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep2 1 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 1 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 TriggerSummaryStep1 3 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 TriggerSummaryStep1 3 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep2 3 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 3 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep1 10 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep1 10 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep2 10 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 10 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep1 12 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep1 12 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TriggerSummaryStep2 12 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 12 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 TriggerSummaryStep1 19 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 TriggerSummaryStep1 19 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 -TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 20 20 3 3 -TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 decisions 3 -TrigSignatureMoniMT INFO HLT_tau25_medium1_tracktwo 20 20 3 3 -TrigSignatureMoniMT INFO HLT_tau25_medium1_tracktwo decisions 3 +TriggerSummaryStep2 19 0 DEBUG +++ HLT_tau0_perf_ptonly_L1TAU12 ID#372992233 +TriggerSummaryStep2 19 0 DEBUG +++ HLT_tau25_medium1_tracktwo ID#3693875985 +TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 20 20 6 6 6 +TrigSignatureMoniMT INFO HLT_tau0_perf_ptonly_L1TAU12 decisions 6 6 +TrigSignatureMoniMT INFO HLT_tau25_medium1_tracktwo 20 20 6 6 6 +TrigSignatureMoniMT INFO HLT_tau25_medium1_tracktwo decisions 6 6