CMS 3D CMS Logo

EMTFContext.cc
Go to the documentation of this file.
5 
7 
10 
11 using namespace emtf::phase2;
12 
14  : // Helpers
15  geometry_translator_(i_consumes_collector),
16 
17  // EMTF
18  config_(pset),
19  model_(*this),
20 
21  // Prompt Neural Network
22  prompt_graph_ptr_(nullptr),
23  prompt_session_ptr_(nullptr),
24 
25  // Displaced Neural Network
26  disp_graph_ptr_(nullptr),
27  disp_session_ptr_(nullptr),
28 
29  // Data
30  site_lut_(),
31  host_lut_(),
32  zone_lut_(),
33  timezone_lut_(),
34  activation_lut_(),
35 
36  // Layers
37  hitmap_building_layer_(*this),
38  pattern_matching_layer_(*this),
39  road_sorting_layer_(*this),
40  track_building_layer_(*this),
41  duplicate_removal_layer_(*this),
42  parameter_assignment_layer_(*this),
43  output_layer_(*this) {
44  // Do Nothing
45 }
46 
48  // Delete Prompt Neural Network
49  if (prompt_session_ptr_ != nullptr) {
51  delete prompt_session_ptr_;
52  }
53 
54  if (prompt_graph_ptr_ != nullptr) {
55  delete prompt_graph_ptr_;
56  }
57 
58  // Delete Displaced Neural Network
59  if (disp_session_ptr_ != nullptr) {
61  delete disp_session_ptr_;
62  }
63 
64  if (disp_graph_ptr_ != nullptr) {
65  delete disp_graph_ptr_;
66  }
67 }
68 
69 void EMTFContext::update(const edm::Event& i_event, const edm::EventSetup& i_event_setup) {
70  // Update Helpers
72 
73  // Update Config
74  config_.update(i_event, i_event_setup);
75 
76  // Update Prompt Neural Network
77  if (prompt_session_ptr_ != nullptr) {
78  delete prompt_session_ptr_;
79  }
80 
81  if (prompt_graph_ptr_ != nullptr) {
82  delete prompt_graph_ptr_;
83  }
84 
86 
88 
89  // Update Displaced Neural Network
90  if (disp_session_ptr_ != nullptr) {
91  delete disp_session_ptr_;
92  }
93 
94  if (disp_graph_ptr_ != nullptr) {
95  delete disp_graph_ptr_;
96  }
97 
99 
101 
102  // Update Data
103  site_lut_.update(i_event, i_event_setup);
104  host_lut_.update(i_event, i_event_setup);
105  zone_lut_.update(i_event, i_event_setup);
106  timezone_lut_.update(i_event, i_event_setup);
107  activation_lut_.update(i_event, i_event_setup);
108 }
void update(const edm::Event &, const edm::EventSetup &)
Definition: EMTFContext.cc:69
tensorflow::Session * disp_session_ptr_
Definition: EMTFContext.h:48
void update(const edm::Event &, const edm::EventSetup &)
Definition: SiteLut.cc:41
tensorflow::GraphDef * prompt_graph_ptr_
Definition: EMTFContext.h:43
void update(const edm::Event &, const edm::EventSetup &)
Definition: TimeZoneLut.cc:39
void update(const edm::Event &, const edm::EventSetup &)
GraphDef * loadGraphDef(const std::string &pbFile)
Definition: TensorFlow.cc:119
void update(const edm::Event &, const edm::EventSetup &)
data::ActivationLut activation_lut_
Definition: EMTFContext.h:55
void update(const edm::Event &, const edm::EventSetup &)
Definition: ZoneLut.cc:51
tensorflow::Session * prompt_session_ptr_
Definition: EMTFContext.h:44
void checkAndUpdateGeometry(const edm::EventSetup &)
data::HostLut host_lut_
Definition: EMTFContext.h:52
bool closeSession(Session *&session)
Definition: TensorFlow.cc:233
void update(const edm::Event &, const edm::EventSetup &)
Definition: HostLut.cc:41
Session * createSession()
Definition: TensorFlow.cc:136
data::ZoneLut zone_lut_
Definition: EMTFContext.h:53
data::SiteLut site_lut_
Definition: EMTFContext.h:51
EMTFContext(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: EMTFContext.cc:13
const std::string & fullPath() const
Definition: FileInPath.cc:144
GeometryTranslator geometry_translator_
Definition: EMTFContext.h:36
data::TimeZoneLut timezone_lut_
Definition: EMTFContext.h:54
tensorflow::GraphDef * disp_graph_ptr_
Definition: EMTFContext.h:47
EMTFConfiguration config_
Definition: EMTFContext.h:39