CMS 3D CMS Logo

HGCalConcentratorAutoEncoderImpl.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_L1THGCal_HGCalConcentratorAutoEncoderImpl_h__
2 #define __L1Trigger_L1THGCal_HGCalConcentratorAutoEncoderImpl_h__
3 
8 #include <vector>
9 
11 
13 
15 public:
17 
18  void select(unsigned nLinks,
19  const std::vector<l1t::HGCalTriggerCell>& trigCellVecInput,
20  std::vector<l1t::HGCalTriggerCell>& trigCellVecOutput,
21  std::vector<l1t::HGCalConcentratorData>& ae_EncodedOutput);
22 
24 
25 private:
26  static constexpr int nTriggerCells_ = 48;
27 
28  static constexpr int maxAEInputSize_ = 192;
29 
30  static constexpr int nEncodedLayerNodes_ = 16;
31 
32  static constexpr unsigned int maxNumberOfLinks_ = 13;
33 
34  static constexpr int cellUVSize_ = 8;
35 
36  static constexpr int encoderTensorDims_ = 4;
37 
38  static constexpr int decoderTensorDims_ = 2;
39 
40  static constexpr int cellUVremap_[cellUVSize_][cellUVSize_] = {{47, 46, 45, 44, -1, -1, -1, -1},
41  {16, 43, 42, 41, 40, -1, -1, -1},
42  {20, 17, 39, 38, 37, 36, -1, -1},
43  {24, 21, 18, 35, 34, 33, 32, -1},
44  {28, 25, 22, 19, 3, 7, 11, 15},
45  {-1, 29, 26, 23, 2, 6, 10, 14},
46  {-1, -1, 30, 27, 1, 5, 9, 13},
47  {-1, -1, -1, 31, 0, 4, 8, 12}};
48  static constexpr int ae_outputCellU_[nTriggerCells_] = {7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4,
49  1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7,
50  3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0};
51  static constexpr int ae_outputCellV_[nTriggerCells_] = {4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
52  0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3,
53  6, 5, 4, 3, 5, 4, 3, 2, 4, 3, 2, 1, 3, 2, 1, 0};
54 
55  unsigned int nInputs_;
56  std::vector<int> cellRemap_;
57  std::vector<int> cellRemapNoDuplicates_;
58  std::vector<uint> encoderShape_;
59  std::vector<uint> decoderShape_;
62  std::vector<int> outputBitsPerLink_;
63 
64  std::vector<edm::ParameterSet> modelFilePaths_;
65 
68  std::unique_ptr<tensorflow::GraphDef> graphDef_encoder_;
69  std::vector<std::unique_ptr<tensorflow::Session>> session_encoder_;
70 
73  std::unique_ptr<tensorflow::GraphDef> graphDef_decoder_;
74  std::vector<std::unique_ptr<tensorflow::Session>> session_decoder_;
75 
76  std::vector<unsigned int> linkToGraphMap_;
77 
82 
83  std::array<double, nEncodedLayerNodes_> ae_encodedLayer_;
84 
86 };
87 
88 #endif
HGCalTriggerTools.h
HGCalConcentratorAutoEncoderImpl::decoderShape_
std::vector< uint > decoderShape_
Definition: HGCalConcentratorAutoEncoderImpl.h:59
HGCalConcentratorAutoEncoderImpl::outputBitsPerLink_
std::vector< int > outputBitsPerLink_
Definition: HGCalConcentratorAutoEncoderImpl.h:62
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalConcentratorAutoEncoderImpl::ae_encodedLayer_
std::array< double, nEncodedLayerNodes_ > ae_encodedLayer_
Definition: HGCalConcentratorAutoEncoderImpl.h:83
TensorFlow.h
HGCalConcentratorAutoEncoderImpl::select
void select(unsigned nLinks, const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput, std::vector< l1t::HGCalConcentratorData > &ae_EncodedOutput)
Definition: HGCalConcentratorAutoEncoderImpl.cc:122
HGCalConcentratorAutoEncoderImpl::graphDef_decoder_
std::unique_ptr< tensorflow::GraphDef > graphDef_decoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:73
HGCalConcentratorAutoEncoderImpl::cellRemapNoDuplicates_
std::vector< int > cellRemapNoDuplicates_
Definition: HGCalConcentratorAutoEncoderImpl.h:57
HGCalConcentratorAutoEncoderImpl::decoderTensorDims_
static constexpr int decoderTensorDims_
Definition: HGCalConcentratorAutoEncoderImpl.h:38
HGCalConcentratorAutoEncoderImpl::zeroSuppresionThreshold_
double zeroSuppresionThreshold_
Definition: HGCalConcentratorAutoEncoderImpl.h:78
HGCalConcentratorAutoEncoderImpl::modelFilePaths_
std::vector< edm::ParameterSet > modelFilePaths_
Definition: HGCalConcentratorAutoEncoderImpl.h:64
HGCalConcentratorAutoEncoderImpl::inputTensorName_decoder_
std::string inputTensorName_decoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:71
HGCalConcentratorAutoEncoderImpl::nInputs_
unsigned int nInputs_
Definition: HGCalConcentratorAutoEncoderImpl.h:55
HGCalConcentratorAutoEncoderImpl::nEncodedLayerNodes_
static constexpr int nEncodedLayerNodes_
Definition: HGCalConcentratorAutoEncoderImpl.h:30
HGCalConcentratorAutoEncoderImpl::HGCalConcentratorAutoEncoderImpl
HGCalConcentratorAutoEncoderImpl(const edm::ParameterSet &conf)
Definition: HGCalConcentratorAutoEncoderImpl.cc:9
HGCalConcentratorAutoEncoderImpl::encoderShape_
std::vector< uint > encoderShape_
Definition: HGCalConcentratorAutoEncoderImpl.h:58
HGCalConcentratorAutoEncoderImpl::ae_outputCellV_
static constexpr int ae_outputCellV_[nTriggerCells_]
Definition: HGCalConcentratorAutoEncoderImpl.h:51
HGCalConcentratorAutoEncoderImpl::linkToGraphMap_
std::vector< unsigned int > linkToGraphMap_
Definition: HGCalConcentratorAutoEncoderImpl.h:76
HGCalConcentratorAutoEncoderImpl::session_decoder_
std::vector< std::unique_ptr< tensorflow::Session > > session_decoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:74
HGCalTriggerGeometryBase.h
HGCalConcentratorAutoEncoderImpl::maxBitsPerOutput_
int maxBitsPerOutput_
Definition: HGCalConcentratorAutoEncoderImpl.h:61
HGCalConcentratorAutoEncoderImpl::saveEncodedValues_
bool saveEncodedValues_
Definition: HGCalConcentratorAutoEncoderImpl.h:80
HGCalConcentratorAutoEncoderImpl::bitShiftNormalization_
bool bitShiftNormalization_
Definition: HGCalConcentratorAutoEncoderImpl.h:79
HGCalConcentratorAutoEncoderImpl::outputTensorName_encoder_
std::string outputTensorName_encoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:67
HGCalConcentratorAutoEncoderImpl::ae_outputCellU_
static constexpr int ae_outputCellU_[nTriggerCells_]
Definition: HGCalConcentratorAutoEncoderImpl.h:48
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalConcentratorAutoEncoderImpl::maxNumberOfLinks_
static constexpr unsigned int maxNumberOfLinks_
Definition: HGCalConcentratorAutoEncoderImpl.h:32
HGCalConcentratorAutoEncoderImpl::preserveModuleSum_
bool preserveModuleSum_
Definition: HGCalConcentratorAutoEncoderImpl.h:81
HGCalConcentratorAutoEncoderImpl::cellRemap_
std::vector< int > cellRemap_
Definition: HGCalConcentratorAutoEncoderImpl.h:56
HGCalConcentratorAutoEncoderImpl::session_encoder_
std::vector< std::unique_ptr< tensorflow::Session > > session_encoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:69
edm::EventSetup
Definition: EventSetup.h:58
HGCalConcentratorAutoEncoderImpl::bitsPerInput_
int bitsPerInput_
Definition: HGCalConcentratorAutoEncoderImpl.h:60
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalConcentratorAutoEncoderImpl::encoderTensorDims_
static constexpr int encoderTensorDims_
Definition: HGCalConcentratorAutoEncoderImpl.h:36
HGCalConcentratorAutoEncoderImpl::maxAEInputSize_
static constexpr int maxAEInputSize_
Definition: HGCalConcentratorAutoEncoderImpl.h:28
HGCalConcentratorAutoEncoderImpl::cellUVSize_
static constexpr int cellUVSize_
Definition: HGCalConcentratorAutoEncoderImpl.h:34
HGCalConcentratorAutoEncoderImpl::cellUVremap_
static constexpr int cellUVremap_[cellUVSize_][cellUVSize_]
Definition: HGCalConcentratorAutoEncoderImpl.h:40
HGCalConcentratorData.h
HGCalConcentratorAutoEncoderImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorAutoEncoderImpl.h:85
HGCalConcentratorAutoEncoderImpl::outputTensorName_decoder_
std::string outputTensorName_decoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:72
HGCalConcentratorAutoEncoderImpl::graphDef_encoder_
std::unique_ptr< tensorflow::GraphDef > graphDef_encoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:68
HGCalConcentratorAutoEncoderImpl::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalConcentratorAutoEncoderImpl.h:23
HGCalTriggerTools
Definition: HGCalTriggerTools.h:32
HGCalTriggerCell.h
ParameterSet.h
HGCalConcentratorAutoEncoderImpl::nTriggerCells_
static constexpr int nTriggerCells_
Definition: HGCalConcentratorAutoEncoderImpl.h:26
HGCalConcentratorAutoEncoderImpl::inputTensorName_encoder_
std::string inputTensorName_encoder_
Definition: HGCalConcentratorAutoEncoderImpl.h:66
HGCalConcentratorAutoEncoderImpl
Definition: HGCalConcentratorAutoEncoderImpl.h:14