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

Enumerator
DB 
NOMINAL 

Definition at line 11 of file HcalCoderFactory.h.

Constructor & Destructor Documentation

HcalCoderFactory::HcalCoderFactory ( CoderType  coderType)

Definition at line 7 of file HcalCoderFactory.cc.

8  : theCoderType(coderType), theDbService(nullptr) { }
const HcalDbService * theDbService
CoderType theCoderType

Member Function Documentation

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

user gets control of the pointer

Definition at line 11 of file HcalCoderFactory.cc.

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

Referenced by HcalElectronicsSim::convert(), and setDbService().

11  {
12  HcalCoder * result = nullptr;
13  if (theCoderType == DB) {
14  assert(theDbService != nullptr);
15  HcalGenericDetId hcalGenDetId(id);
16  const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
17  const HcalQIEShape * qieShape = theDbService->getHcalShape(hcalGenDetId);
18  result = new HcalCoderDb(*qieCoder, *qieShape);
19  } else {
20  result = new HcalNominalCoder();
21  }
22  return std::unique_ptr<HcalCoder>(result);
23 }
const HcalDbService * theDbService
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
CoderType theCoderType
void HcalCoderFactory::setDbService ( const HcalDbService service)
inline

Definition at line 15 of file HcalCoderFactory.h.

References coder(), and theDbService.

Referenced by HcalTBDigiProducer::initializeEvent(), and HcalDigitizer::initializeEvent().

15 {theDbService = service;}
const HcalDbService * theDbService

Member Data Documentation

CoderType HcalCoderFactory::theCoderType
private

Definition at line 22 of file HcalCoderFactory.h.

Referenced by coder().

const HcalDbService* HcalCoderFactory::theDbService
private

Definition at line 23 of file HcalCoderFactory.h.

Referenced by coder(), and setDbService().