CMS 3D CMS Logo

BJetId.h
Go to the documentation of this file.
1 #ifndef L1TRIGGER_PHASE2L1PARTICLEFLOWS_BJETID_H
2 #define L1TRIGGER_PHASE2L1PARTICLEFLOWS_BJETID_H
3 
4 #include <string>
8 
9 struct BJetTFCache {
12  }
14  std::unique_ptr<tensorflow::GraphDef> graphDef;
15  tensorflow::Session *session;
16 };
17 
18 class BJetId {
19 public:
20  BJetId(const std::string &iInput, const std::string &iOutput, const BJetTFCache *cache, int iNParticles);
21  ~BJetId();
22 
23  void setNNVectorVar();
24  float EvaluateNN();
25  float compute(const l1t::PFJet &iJet, float vz, bool useRawPt);
26 
27 private:
28  std::vector<float> NNvectorVar_;
32  unique_ptr<float[]> fPt_;
33  unique_ptr<float[]> fEta_;
34  unique_ptr<float[]> fPhi_;
35  unique_ptr<float[]> fId_;
36  unique_ptr<int[]> fCharge_;
37  unique_ptr<float[]> fDZ_;
38  unique_ptr<float[]> fDX_;
39  unique_ptr<float[]> fDY_;
40  tensorflow::Session *sessionRef_;
41 };
42 #endif
void setNNVectorVar()
Definition: BJetId.cc:23
float compute(const l1t::PFJet &iJet, float vz, bool useRawPt)
Definition: BJetId.cc:56
int fNParticles_
Definition: BJetId.h:31
float EvaluateNN()
Definition: BJetId.cc:46
tensorflow::Session * sessionRef_
Definition: BJetId.h:40
GraphDef * loadGraphDef(const std::string &pbFile)
Definition: TensorFlow.cc:129
unique_ptr< float[]> fPhi_
Definition: BJetId.h:34
~BJetId()
Definition: BJetId.cc:22
std::unique_ptr< tensorflow::GraphDef > graphDef
Definition: BJetId.h:14
std::string fOutput_
Definition: BJetId.h:30
std::string fInput_
Definition: BJetId.h:29
unique_ptr< int[]> fCharge_
Definition: BJetId.h:36
unique_ptr< float[]> fId_
Definition: BJetId.h:35
unique_ptr< float[]> fDX_
Definition: BJetId.h:38
bool closeSession(Session *&session)
Definition: TensorFlow.cc:243
unique_ptr< float[]> fDZ_
Definition: BJetId.h:37
Session * createSession()
Definition: TensorFlow.cc:146
BJetId(const std::string &iInput, const std::string &iOutput, const BJetTFCache *cache, int iNParticles)
Definition: BJetId.cc:5
BJetTFCache(const std::string &graphPath)
Definition: BJetId.h:10
unique_ptr< float[]> fDY_
Definition: BJetId.h:39
tensorflow::Session * session
Definition: BJetId.h:15
unique_ptr< float[]> fEta_
Definition: BJetId.h:33
def cache(function)
Definition: utilities.py:3
unique_ptr< float[]> fPt_
Definition: BJetId.h:32
Definition: BJetId.h:18
std::vector< float > NNvectorVar_
Definition: BJetId.h:28
~BJetTFCache()
Definition: BJetId.h:13