CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HcalCoderFactory Class Reference

#include <HcalCoderFactory.h>

Public Types

enum  CoderType { DB, NOMINAL }
 

Public Member Functions

std::unique_ptr< HcalCodercoder (const DetId &detId) const
 user gets control of the pointer More...
 
 HcalCoderFactory (CoderType coderType)
 
void setDbService (const HcalDbService *service)
 

Private Attributes

CoderType theCoderType
 
const HcalDbServicetheDbService
 

Detailed Description

Definition at line 8 of file HcalCoderFactory.h.

Member Enumeration Documentation

◆ CoderType

Enumerator
DB 
NOMINAL 

Definition at line 10 of file HcalCoderFactory.h.

10 { DB, NOMINAL };

Constructor & Destructor Documentation

◆ HcalCoderFactory()

HcalCoderFactory::HcalCoderFactory ( CoderType  coderType)

Definition at line 5 of file HcalCoderFactory.cc.

5 : theCoderType(coderType), theDbService(nullptr) {}

Member Function Documentation

◆ coder()

std::unique_ptr< HcalCoder > HcalCoderFactory::coder ( const DetId detId) const

user gets control of the pointer

Definition at line 7 of file HcalCoderFactory.cc.

7  {
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 }

References cms::cuda::assert(), DB, HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), mps_fire::result, theCoderType, and theDbService.

Referenced by HcalElectronicsSim::convert().

◆ setDbService()

void HcalCoderFactory::setDbService ( const HcalDbService service)
inline

Definition at line 14 of file HcalCoderFactory.h.

14 { theDbService = service; }

References theDbService.

Referenced by HcalTBDigiProducer::initializeEvent().

Member Data Documentation

◆ theCoderType

CoderType HcalCoderFactory::theCoderType
private

Definition at line 20 of file HcalCoderFactory.h.

Referenced by coder().

◆ theDbService

const HcalDbService* HcalCoderFactory::theDbService
private

Definition at line 21 of file HcalCoderFactory.h.

Referenced by coder(), and setDbService().

service
Definition: service.py:1
HcalGenericDetId
Definition: HcalGenericDetId.h:15
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
HcalDbService::getHcalCoder
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:319
HcalCoderFactory::theDbService
const HcalDbService * theDbService
Definition: HcalCoderFactory.h:21
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalCoderFactory::NOMINAL
Definition: HcalCoderFactory.h:10
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