CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
emtf::phase2::EMTFContext Class Reference

#include <EMTFContext.h>

Public Member Functions

 EMTFContext (const edm::ParameterSet &, edm::ConsumesCollector)
 
void update (const edm::Event &, const edm::EventSetup &)
 
 ~EMTFContext ()
 

Public Attributes

data::ActivationLut activation_lut_
 
EMTFConfiguration config_
 
tensorflow::GraphDef * disp_graph_ptr_
 
tensorflow::Session * disp_session_ptr_
 
algo::DuplicateRemovalLayer duplicate_removal_layer_
 
GeometryTranslator geometry_translator_
 
algo::HitmapLayer hitmap_building_layer_
 
data::HostLut host_lut_
 
EMTFModel model_
 
algo::OutputLayer output_layer_
 
algo::ParameterAssignmentLayer parameter_assignment_layer_
 
algo::PatternMatchingLayer pattern_matching_layer_
 
tensorflow::GraphDef * prompt_graph_ptr_
 
tensorflow::Session * prompt_session_ptr_
 
algo::RoadSortingLayer road_sorting_layer_
 
data::SiteLut site_lut_
 
data::TimeZoneLut timezone_lut_
 
algo::TrackBuildingLayer track_building_layer_
 
data::ZoneLut zone_lut_
 

Detailed Description

Definition at line 26 of file EMTFContext.h.

Constructor & Destructor Documentation

◆ EMTFContext()

EMTFContext::EMTFContext ( const edm::ParameterSet pset,
edm::ConsumesCollector  i_consumes_collector 
)

Definition at line 13 of file EMTFContext.cc.

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_(),
35 
36  // Layers
39  road_sorting_layer_(*this),
40  track_building_layer_(*this),
43  output_layer_(*this) {
44  // Do Nothing
45 }
tensorflow::Session * disp_session_ptr_
Definition: EMTFContext.h:48
tensorflow::GraphDef * prompt_graph_ptr_
Definition: EMTFContext.h:43
algo::DuplicateRemovalLayer duplicate_removal_layer_
Definition: EMTFContext.h:62
data::ActivationLut activation_lut_
Definition: EMTFContext.h:55
tensorflow::Session * prompt_session_ptr_
Definition: EMTFContext.h:44
algo::TrackBuildingLayer track_building_layer_
Definition: EMTFContext.h:61
data::HostLut host_lut_
Definition: EMTFContext.h:52
algo::RoadSortingLayer road_sorting_layer_
Definition: EMTFContext.h:60
algo::OutputLayer output_layer_
Definition: EMTFContext.h:64
algo::ParameterAssignmentLayer parameter_assignment_layer_
Definition: EMTFContext.h:63
algo::HitmapLayer hitmap_building_layer_
Definition: EMTFContext.h:58
data::ZoneLut zone_lut_
Definition: EMTFContext.h:53
data::SiteLut site_lut_
Definition: EMTFContext.h:51
algo::PatternMatchingLayer pattern_matching_layer_
Definition: EMTFContext.h:59
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

◆ ~EMTFContext()

EMTFContext::~EMTFContext ( )

Definition at line 47 of file EMTFContext.cc.

References tensorflow::closeSession(), disp_graph_ptr_, disp_session_ptr_, prompt_graph_ptr_, and prompt_session_ptr_.

47  {
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 }
tensorflow::Session * disp_session_ptr_
Definition: EMTFContext.h:48
tensorflow::GraphDef * prompt_graph_ptr_
Definition: EMTFContext.h:43
tensorflow::Session * prompt_session_ptr_
Definition: EMTFContext.h:44
bool closeSession(Session *&session)
Definition: TensorFlow.cc:233
tensorflow::GraphDef * disp_graph_ptr_
Definition: EMTFContext.h:47

Member Function Documentation

◆ update()

void EMTFContext::update ( const edm::Event i_event,
const edm::EventSetup i_event_setup 
)

Definition at line 69 of file EMTFContext.cc.

References activation_lut_, L1TMuon::GeometryTranslator::checkAndUpdateGeometry(), config_, tensorflow::createSession(), disp_graph_ptr_, disp_session_ptr_, emtf::phase2::EMTFConfiguration::displ_graph_path_, edm::FileInPath::fullPath(), geometry_translator_, host_lut_, tensorflow::loadGraphDef(), emtf::phase2::EMTFConfiguration::prompt_graph_path_, prompt_graph_ptr_, prompt_session_ptr_, site_lut_, timezone_lut_, emtf::phase2::EMTFConfiguration::update(), emtf::phase2::data::ActivationLut::update(), emtf::phase2::data::ZoneLut::update(), emtf::phase2::data::TimeZoneLut::update(), emtf::phase2::data::HostLut::update(), emtf::phase2::data::SiteLut::update(), and zone_lut_.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), MatrixUtil.Steps::overwrite(), and emtf::phase2::TrackFinder::process().

69  {
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 }
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
std::string fullPath() const
Definition: FileInPath.cc:161
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
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
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

Member Data Documentation

◆ activation_lut_

data::ActivationLut emtf::phase2::EMTFContext::activation_lut_

Definition at line 55 of file EMTFContext.h.

Referenced by emtf::phase2::algo::ParameterAssignmentLayer::apply(), and update().

◆ config_

EMTFConfiguration emtf::phase2::EMTFContext::config_

◆ disp_graph_ptr_

tensorflow::GraphDef* emtf::phase2::EMTFContext::disp_graph_ptr_

Definition at line 47 of file EMTFContext.h.

Referenced by update(), and ~EMTFContext().

◆ disp_session_ptr_

tensorflow::Session* emtf::phase2::EMTFContext::disp_session_ptr_

◆ duplicate_removal_layer_

algo::DuplicateRemovalLayer emtf::phase2::EMTFContext::duplicate_removal_layer_

Definition at line 62 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ geometry_translator_

GeometryTranslator emtf::phase2::EMTFContext::geometry_translator_

◆ hitmap_building_layer_

algo::HitmapLayer emtf::phase2::EMTFContext::hitmap_building_layer_

Definition at line 58 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ host_lut_

data::HostLut emtf::phase2::EMTFContext::host_lut_

◆ model_

EMTFModel emtf::phase2::EMTFContext::model_

◆ output_layer_

algo::OutputLayer emtf::phase2::EMTFContext::output_layer_

Definition at line 64 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ parameter_assignment_layer_

algo::ParameterAssignmentLayer emtf::phase2::EMTFContext::parameter_assignment_layer_

Definition at line 63 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ pattern_matching_layer_

algo::PatternMatchingLayer emtf::phase2::EMTFContext::pattern_matching_layer_

Definition at line 59 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ prompt_graph_ptr_

tensorflow::GraphDef* emtf::phase2::EMTFContext::prompt_graph_ptr_

Definition at line 43 of file EMTFContext.h.

Referenced by update(), and ~EMTFContext().

◆ prompt_session_ptr_

tensorflow::Session* emtf::phase2::EMTFContext::prompt_session_ptr_

◆ road_sorting_layer_

algo::RoadSortingLayer emtf::phase2::EMTFContext::road_sorting_layer_

Definition at line 60 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ site_lut_

data::SiteLut emtf::phase2::EMTFContext::site_lut_

◆ timezone_lut_

data::TimeZoneLut emtf::phase2::EMTFContext::timezone_lut_

Definition at line 54 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::populateSegments(), and update().

◆ track_building_layer_

algo::TrackBuildingLayer emtf::phase2::EMTFContext::track_building_layer_

Definition at line 61 of file EMTFContext.h.

Referenced by emtf::phase2::SectorProcessor::buildTracks().

◆ zone_lut_

data::ZoneLut emtf::phase2::EMTFContext::zone_lut_