CMS 3D CMS Logo

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