Go to the documentation of this file. 1 #ifndef RecoTauTag_RecoTau_DeepTauBase_h
2 #define RecoTauTag_RecoTau_DeepTauBase_h
13 #include <Math/VectorUtil.h>
17 #include "tensorflow/core/util/memmapped_file_system.h"
36 std::unique_ptr<TF1>
fn_;
42 using GraphPtr = std::shared_ptr<tensorflow::GraphDef>;
44 DeepTauCache(
const std::map<std::string, std::string>& graph_names,
bool mem_mapped);
54 std::map<std::string, tensorflow::Session*>
sessions_;
55 std::map<std::string, std::unique_ptr<tensorflow::MemmappedEnv>>
memmappedEnv_;
70 using WPList = std::vector<CutterPtr>;
78 const tensorflow::Tensor& pred,
const DeepTauCache * cache_
std::map< std::string, tensorflow::Session * > sessions_
tensorflow::Session & getSession(const std::string &name="") const
std::vector< Electron > ElectronCollection
std::vector< CutterPtr > WPList
void produce(edm::Event &event, const edm::EventSetup &es) override
edm::EDGetTokenT< pat::PackedCandidateCollection > pfcandToken_
Analysis-level tau class.
std::map< std::string, Output > OutputCollection
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > LorentzVectorXYZ
TauWPThreshold(const std::string &cut_str)
DeepTauBase(const edm::ParameterSet &cfg, const OutputCollection &outputs, const DeepTauCache *cache)
static void globalEndJob(const DeepTauCache *cache)
std::map< std::string, WPList > workingPoints_
std::vector< Muon > MuonCollection
pat::MuonCollection MuonCollection
OutputCollection outputs_
static std::unique_ptr< DeepTauCache > initializeGlobalCache(const edm::ParameterSet &cfg)
Output(const std::vector< size_t > &num, const std::vector< size_t > &den)
std::unique_ptr< TauDiscriminator > get_value(const edm::Handle< TauCollection > &taus, const tensorflow::Tensor &pred, const WPList &working_points) const
std::unique_ptr< Cutter > CutterPtr
std::vector< TauType > TauCollection
std::map< std::string, GraphPtr > graphs_
pat::ElectronCollection ElectronCollection
virtual tensorflow::Tensor getPredictions(edm::Event &event, const edm::EventSetup &es, edm::Handle< TauCollection > taus)=0
std::vector< size_t > num_
virtual void createOutputs(edm::Event &event, const tensorflow::Tensor &pred, edm::Handle< TauCollection > taus)
double operator()(const pat::Tau &tau) const
DeepTauCache(const std::map< std::string, std::string > &graph_names, bool mem_mapped)
std::unique_ptr< TF1 > fn_
std::shared_ptr< tensorflow::GraphDef > GraphPtr
edm::ValueMap< SingleTauDiscriminatorContainer > TauDiscriminatorContainer
edm::EDGetTokenT< TauCollection > tausToken_
std::vector< size_t > den_
const tensorflow::GraphDef & getGraph(const std::string &name="") const
std::map< std::string, std::unique_ptr< tensorflow::MemmappedEnv > > memmappedEnv_