test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UnpackerFactory.cc
Go to the documentation of this file.
1 #include "UnpackerFactory.h"
2 
4 
6 
7 namespace l1t {
8  const UnpackerFactory UnpackerFactory::instance_;
9 
10  void
11  getBXRange(int nbx, int& first, int& last)
12  {
13  last = std::floor(nbx / 2.);
14  first = std::min(0, -last + (1 - nbx % 2));
15  }
16 
17  std::shared_ptr<Unpacker>
19  {
20  auto unpacker = std::shared_ptr<Unpacker>(UnpackerFactoryT::get()->create("l1t::" + name));
21 
22  if (unpacker.get() == 0) {
23  throw edm::Exception(edm::errors::Configuration, "NoSourceModule")
24  << "Cannot find an unpacker named " << name;
25  }
26 
27  return unpacker;
28  }
29 }
void getBXRange(int nbx, int &first, int &last)
std::shared_ptr< Unpacker > make(const std::string &) const
T min(T a, T b)
Definition: MathUtil.h:58
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:90
static const UnpackerFactory instance_
T get(const Candidate &c)
Definition: component.h:55