diff --git a/Reconstruction/tauRecTools/Root/lwtnn/Graph.cxx b/Reconstruction/tauRecTools/Root/lwtnn/Graph.cxx index 4a0077192e101604ed853b60c1e16a33afce59a5..8d8e5707f7479977f936a28a516150e214379cc4 100644 --- a/Reconstruction/tauRecTools/Root/lwtnn/Graph.cxx +++ b/Reconstruction/tauRecTools/Root/lwtnn/Graph.cxx @@ -205,7 +205,7 @@ namespace lwtDev { namespace { using namespace lwtDev; - void throw_cfg(std::string msg, size_t index) { + void throw_cfg(const std::string & msg, size_t index) { throw NNConfigurationException(msg + " " + std::to_string(index)); } void check_compute_node(const NodeConfig& node) { diff --git a/Reconstruction/tauRecTools/Root/lwtnn/Stack.cxx b/Reconstruction/tauRecTools/Root/lwtnn/Stack.cxx index 6a033d39e41b6b4e3fccc63cc57c397e34406f64..fc5a6cc58b5b8e49fca77493ecd671f08c209caa 100644 --- a/Reconstruction/tauRecTools/Root/lwtnn/Stack.cxx +++ b/Reconstruction/tauRecTools/Root/lwtnn/Stack.cxx @@ -359,7 +359,7 @@ namespace lwtDev { else throw NNConfigurationException("Bidirectional forward layer type not supported"); - IRecurrentLayer* forward_layer = m_layers.back(); + std::unique_ptr<IRecurrentLayer> forward_layer(m_layers.back()); m_layers.pop_back(); if(backward_layer_conf.architecture == Architecture::LSTM) @@ -369,12 +369,12 @@ namespace lwtDev { else throw NNConfigurationException("Bidirectional backward layer type not supported"); - IRecurrentLayer* backward_layer = m_layers.back(); + std::unique_ptr<IRecurrentLayer> backward_layer(m_layers.back()); backward_layer->m_go_backwards = (!forward_layer->m_go_backwards); m_layers.pop_back(); - m_layers.push_back(new BidirectionalLayer(forward_layer, - backward_layer, + m_layers.push_back(new BidirectionalLayer(std::move(forward_layer), + std::move(backward_layer), layer.merge_mode, layer.return_sequence)); return n_backward; @@ -608,15 +608,16 @@ namespace lwtDev { /// bidirectional layer /// - BidirectionalLayer::BidirectionalLayer(IRecurrentLayer* forward_layer, - IRecurrentLayer* backward_layer, + BidirectionalLayer::BidirectionalLayer(std::unique_ptr<IRecurrentLayer> forward_layer, + std::unique_ptr<IRecurrentLayer> backward_layer, std::string merge_mode, bool return_sequence): - m_merge_mode(merge_mode) + m_forward_layer(std::move(forward_layer)), + m_backward_layer(std::move(backward_layer)) { - m_forward_layer = forward_layer; - m_backward_layer = backward_layer; - m_return_sequence = return_sequence; + m_merge_mode=merge_mode; + //baseclass variable + m_return_sequence=return_sequence; } MatrixXd BidirectionalLayer::scan( const MatrixXd& x) const{ diff --git a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx index c3a91f7c64b5cefe4359ad986e02c6e8490a0cd8..4e85ccbfcf966749059bb8d12776d721f527ec89 100644 --- a/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx +++ b/Reconstruction/tauRecTools/src/TauElectronVetoVariables.cxx @@ -116,10 +116,14 @@ StatusCode TauElectronVetoVariables::execute(xAOD::TauJet& pTau) const { caloExtension = uniqueExtension.get(); } } + if( not caloExtension){ + ATH_MSG_WARNING("extrapolation of leading track to calo surfaces failed : caloExtension is nullptr" ); + return StatusCode::RECOVERABLE; + } const std::vector<Trk::CurvilinearParameters>& clParametersVector = caloExtension->caloLayerIntersections(); - if( not caloExtension || clParametersVector.empty() ){ + if(clParametersVector.empty() ){ ATH_MSG_WARNING("extrapolation of leading track to calo surfaces failed : caloLayerIntersection is empty" ); - return StatusCode::SUCCESS; + return StatusCode::RECOVERABLE; } // loop over calo layers for( const Trk::CurvilinearParameters& cur : clParametersVector ){ diff --git a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx index 5bde36ba64f99344ec4a310cc8178e524b977e75..9ea96cb63ca9bb4d6e318459be7dc63775d599ee 100644 --- a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx +++ b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx @@ -431,9 +431,10 @@ StatusCode TauTrackFinder::extrapolateToCaloSurface(xAOD::TauJet& pTau) const { std::unique_ptr<Trk::CaloExtension> uniqueExtension; for( xAOD::TauTrack* tauTrack : pTau.allTracks() ) { const xAOD::TrackParticle *orgTrack = tauTrack->track(); + if( !orgTrack ) continue; trackIndex = orgTrack->index(); - if( !orgTrack ) continue; + // set default values float etaEM = -10.0; diff --git a/Reconstruction/tauRecTools/tauRecTools/lwtnn/Stack.h b/Reconstruction/tauRecTools/tauRecTools/lwtnn/Stack.h index e41522f043d3f3f7b0dfc1e059621e817698aa1b..6487a67fcc82f1e7f7213c1a02abf8ac5af4cb13 100644 --- a/Reconstruction/tauRecTools/tauRecTools/lwtnn/Stack.h +++ b/Reconstruction/tauRecTools/tauRecTools/lwtnn/Stack.h @@ -30,7 +30,7 @@ #include <vector> #include <functional> -#include <iostream> +#include <memory> //for unique_ptr namespace lwtDev { @@ -310,8 +310,8 @@ namespace lwtDev { class BidirectionalLayer : public IRecurrentLayer { public: - BidirectionalLayer(IRecurrentLayer* forward_layer, - IRecurrentLayer* backward_layer, + BidirectionalLayer(std::unique_ptr<IRecurrentLayer> forward_layer, + std::unique_ptr<IRecurrentLayer> backward_layer, std::string merge_mode, bool return_sequence); @@ -319,8 +319,8 @@ namespace lwtDev { virtual MatrixXd scan( const MatrixXd&) const override; private: - IRecurrentLayer* m_forward_layer; - IRecurrentLayer* m_backward_layer; + std::unique_ptr<const IRecurrentLayer> m_forward_layer; + std::unique_ptr<const IRecurrentLayer> m_backward_layer; std::string m_merge_mode; };