CMS 3D CMS Logo

Classes | Functions | Variables
L1GTEvaluationProducer.cc File Reference
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ParameterSet/interface/allowedValues.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "DataFormats/Common/interface/View.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/L1Trigger/interface/P2GTCandidate.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "L1Trigger/DemonstratorTools/interface/BoardDataWriter.h"
#include "L1Trigger/DemonstratorTools/interface/utilities.h"
#include "L1GTEvaluationInterface.h"
#include <vector>
#include <array>
#include <string>
#include <unordered_map>
#include <fstream>
#include <limits>
#include <optional>
#include <random>

Go to the source code of this file.

Classes

class  L1GTEvaluationProducer
 

Functions

template<typename T , std::size_t low, std::size_t high, std::size_t incr = 1>
static constexpr std::array< T, high - low > arange ()
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< L1GTEvaluationProducer > > s_filler_0__LINE__ ("L1GTEvaluationProducer")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1GTEvaluationProducer > > s_maker__LINE__ ("L1GTEvaluationProducer")
 
template<typename... Args>
static std::vector< ap_uint< 64 > > vpack (const Args &...vobjects)
 
template<typename T , std::size_t low, std::size_t high, std::size_t incr = 1>
static std::vector< Tvrange ()
 

Variables

static const l1t::demo::BoardDataWriter::ChannelMap_t CHANNEL_MAP_VU13P
 
static const l1t::demo::BoardDataWriter::ChannelMap_t CHANNEL_MAP_VU9P
 

Function Documentation

◆ arange()

template<typename T , std::size_t low, std::size_t high, std::size_t incr = 1>
static constexpr std::array<T, high - low> arange ( )
static

Definition at line 68 of file L1GTEvaluationProducer.cc.

References mps_check::array, LaserClient_cfi::high, LaserClient_cfi::low, and relativeConstraints::value.

68  {
70  T value = low;
71  for (T &el : array) {
72  el = value;
73  value += incr;
74  }
75  return array;
76 }
Definition: value.py:1
long double T

◆ s_filler_0__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1GTEvaluationProducer > > s_filler_0__LINE__ ( "L1GTEvaluationProducer"  )
static

◆ s_maker__LINE__()

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1GTEvaluationProducer > > s_maker__LINE__ ( "L1GTEvaluationProducer"  )
static

◆ vpack()

template<typename... Args>
static std::vector<ap_uint<64> > vpack ( const Args &...  vobjects)
static

Definition at line 168 of file L1GTEvaluationProducer.cc.

References resolutioncreator_cfi::object, L1TPhase2Offline_cfi::objects, and l1t::L1TGT_Interface< N >::pack().

Referenced by L1GTEvaluationProducer::writeInputPatterns().

168  {
169  std::vector<ap_uint<64>> vpacked;
170 
171  (
172  [&vpacked](const std::vector<std::unique_ptr<l1t::L1TGT_BaseInterface>> &objects) {
173  std::optional<ap_uint<64>> next_packed;
174  for (const auto &object : objects) {
175  if (object->packed_width() == 64) {
176  const l1t::L1TGT_Interface<64> &interface_obj = dynamic_cast<const l1t::L1TGT_Interface<64> &>(*object);
177  vpacked.emplace_back(interface_obj.pack());
178  } else if (object->packed_width() == 96) {
179  const l1t::L1TGT_Interface<96> &interface_obj = dynamic_cast<const l1t::L1TGT_Interface<96> &>(*object);
180  ap_uint<96> packed = interface_obj.pack();
181  if (next_packed.has_value()) {
182  vpacked.emplace_back(packed(95, 64) << 32 | next_packed.value());
183  next_packed.reset();
184  } else {
185  next_packed = packed(95, 64);
186  }
187 
188  vpacked.emplace_back(packed(63, 0));
189 
190  } else if (object->packed_width() == 128) {
191  const l1t::L1TGT_Interface<128> &interface_obj = dynamic_cast<const l1t::L1TGT_Interface<128> &>(*object);
192  ap_uint<128> packed = interface_obj.pack();
193  vpacked.emplace_back(packed(63, 0));
194  vpacked.emplace_back(packed(127, 64));
195  }
196  }
197  }(vobjects),
198  ...);
199 
200  return vpacked;
201 }
virtual ap_uint< N > pack() const =0

◆ vrange()

template<typename T , std::size_t low, std::size_t high, std::size_t incr = 1>
static std::vector<T> vrange ( )
static

Definition at line 79 of file L1GTEvaluationProducer.cc.

References mps_check::array, LaserClient_cfi::high, LaserClient_cfi::low, and trackerHitRTTI::vector.

79  {
80  std::array<T, high - low> arr(arange<T, low, high, incr>());
81  return std::vector(std::begin(arr), std::end(arr));
82 }
long double T

Variable Documentation

◆ CHANNEL_MAP_VU13P

const l1t::demo::BoardDataWriter::ChannelMap_t CHANNEL_MAP_VU13P
static
Initial value:
{
{{"GTT", 0}, {{6, 0}, vrange<std::size_t, 0, 6>()}},
{{"GTT", 1}, {{6, 0}, vrange<std::size_t, 6, 12>()}},
{{"GCT", 0}, {{6, 0}, vrange<std::size_t, 24, 30>()}},
{{"CL2", 0}, {{6, 0}, vrange<std::size_t, 32, 38>()}},
{{"CL2", 1}, {{6, 0}, vrange<std::size_t, 38, 44>()}},
{{"GMT", 0}, {{18, 0}, {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 68, 69, 70, 71, 72, 73}}},
{{"CL2", 2}, {{6, 0}, vrange<std::size_t, 80, 86>()}},
{{"GTT", 2}, {{6, 0}, vrange<std::size_t, 112, 118>()}},
{{"GTT", 3}, {{6, 0}, vrange<std::size_t, 118, 124>()}}}

Definition at line 95 of file L1GTEvaluationProducer.cc.

◆ CHANNEL_MAP_VU9P

const l1t::demo::BoardDataWriter::ChannelMap_t CHANNEL_MAP_VU9P
static
Initial value:
{
{{"GTT", 0}, {{6, 0}, vrange<std::size_t, 0, 6>()}},
{{"GTT", 1}, {{6, 0}, vrange<std::size_t, 6, 12>()}},
{{"CL2", 0}, {{6, 0}, vrange<std::size_t, 28, 34>()}},
{{"CL2", 1}, {{6, 0}, vrange<std::size_t, 34, 40>()}},
{{"GCT", 0}, {{6, 0}, vrange<std::size_t, 54, 60>()}},
{{"GMT", 0}, {{18, 0}, vrange<std::size_t, 60, 78>()}},
{{"CL2", 2}, {{6, 0}, vrange<std::size_t, 80, 86>()}},
{{"GTT", 2}, {{6, 0}, vrange<std::size_t, 104, 110>()}},
{{"GTT", 3}, {{6, 0}, vrange<std::size_t, 110, 116>()}}}

Definition at line 84 of file L1GTEvaluationProducer.cc.