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 171 of file L1GTEvaluationProducer.cc.

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

Referenced by L1GTEvaluationProducer::writeInputPatterns().

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