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"
44 std::unique_ptr<TF1>
fn_;
50 using GraphPtr = std::shared_ptr<tensorflow::GraphDef>;
52 DeepTauCache(
const std::map<std::string, std::string>& graph_names,
bool mem_mapped);
62 std::map<std::string, tensorflow::Session*>
sessions_;
63 std::map<std::string, std::unique_ptr<tensorflow::MemmappedEnv>>
memmappedEnv_;
78 using WPList = std::vector<CutterPtr>;
86 const tensorflow::Tensor& pred,
88 bool is_online)
const;
101 template <
typename ConsumeType>
void fill(const edm::Event &evt)
const DeepTauCache * cache_
std::map< std::string, tensorflow::Session * > sessions_
std::vector< TauDiscInfo< pat::PATTauDiscriminator > > patPrediscriminants_
std::unique_ptr< TauDiscriminator > get_value(const edm::Handle< TauCollection > &taus, const tensorflow::Tensor &pred, const WPList *working_points, bool is_online) const
tensorflow::Session & getSession(const std::string &name="") const
edm::EDGetTokenT< CandidateCollection > pfcandToken_
std::vector< Electron > ElectronCollection
std::vector< CutterPtr > WPList
void produce(edm::Event &event, const edm::EventSetup &es) override
std::map< std::string, Output > OutputCollection
static const std::vector< BasicDiscriminator > requiredBasicDiscriminatorsdR03_
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > LorentzVectorXYZ
TauWPThreshold(const std::string &cut_str)
double operator()(const reco::BaseTau &tau, bool isPFTau) const
DeepTauBase(const edm::ParameterSet &cfg, const OutputCollection &outputs, const DeepTauCache *cache)
static void globalEndJob(const DeepTauCache *cache)
static const std::vector< BasicDiscriminator > requiredBasicDiscriminators_
std::map< std::string, WPList > workingPoints_
virtual tensorflow::Tensor getPredictions(edm::Event &event, edm::Handle< TauCollection > taus)=0
std::vector< Muon > MuonCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
edm::EDGetTokenT< ConsumeType > disc_token
std::unique_ptr< Cutter > CutterPtr
static const std::map< BasicDiscriminator, std::string > stringFromDiscriminator_
std::map< std::string, GraphPtr > graphs_
pat::ElectronCollection ElectronCollection
std::vector< TauDiscInfo< reco::PFTauDiscriminator > > recoPrediscriminants_
std::vector< size_t > num_
virtual void createOutputs(edm::Event &event, const tensorflow::Tensor &pred, edm::Handle< TauCollection > taus)
DeepTauCache(const std::map< std::string, std::string > &graph_names, bool mem_mapped)
std::unique_ptr< TF1 > fn_
uint8_t andPrediscriminants_
edm::Handle< ConsumeType > handle
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_