CMS 3D CMS Logo

HcalCoderFactory.cc
Go to the documentation of this file.
4 
5 HcalCoderFactory::HcalCoderFactory(CoderType coderType) : theCoderType(coderType), theDbService(nullptr) {}
6 
7 std::unique_ptr<HcalCoder> HcalCoderFactory::coder(const DetId& id) const {
8  HcalCoder* result = nullptr;
9  if (theCoderType == DB) {
10  assert(theDbService != nullptr);
11  HcalGenericDetId hcalGenDetId(id);
12  const HcalQIECoder* qieCoder = theDbService->getHcalCoder(hcalGenDetId);
13  const HcalQIEShape* qieShape = theDbService->getHcalShape(hcalGenDetId);
14  result = new HcalCoderDb(*qieCoder, *qieShape);
15  } else {
16  result = new HcalNominalCoder();
17  }
18  return std::unique_ptr<HcalCoder>(result);
19 }
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalCoderFactory::HcalCoderFactory
HcalCoderFactory(CoderType coderType)
Definition: HcalCoderFactory.cc:5
HcalNominalCoder
Definition: HcalNominalCoder.h:11
cms::cuda::assert
assert(be >=bs)
HcalCoderFactory::theCoderType
CoderType theCoderType
Definition: HcalCoderFactory.h:20
HcalDbService::getHcalShape
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:326
HcalCoderDb.h
HcalDbService::getHcalCoder
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:319
DetId
Definition: DetId.h:17
HcalNominalCoder.h
HcalCoderFactory.h
HcalCoderFactory::coder
std::unique_ptr< HcalCoder > coder(const DetId &detId) const
user gets control of the pointer
Definition: HcalCoderFactory.cc:7
HcalCoderFactory::theDbService
const HcalDbService * theDbService
Definition: HcalCoderFactory.h:21
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalCoder
Definition: HcalCoder.h:19
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
mps_fire.result
result
Definition: mps_fire.py:303
HcalCoderFactory::DB
Definition: HcalCoderFactory.h:10
HcalCoderFactory::CoderType
CoderType
Definition: HcalCoderFactory.h:10