CMS 3D CMS Logo

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

#include <CastorCoderFactory.h>

Public Types

enum  CoderType { DB, NOMINAL }
 

Public Member Functions

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

Private Attributes

CoderType theCoderType
 
const CastorDbServicetheDbService
 

Detailed Description

Definition at line 8 of file CastorCoderFactory.h.

Member Enumeration Documentation

◆ CoderType

Enumerator
DB 
NOMINAL 

Definition at line 10 of file CastorCoderFactory.h.

10 { DB, NOMINAL };

Constructor & Destructor Documentation

◆ CastorCoderFactory()

CastorCoderFactory::CastorCoderFactory ( CoderType  coderType)

Definition at line 5 of file CastorCoderFactory.cc.

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

Member Function Documentation

◆ coder()

std::unique_ptr< CastorCoder > CastorCoderFactory::coder ( const DetId detId) const

user gets control of the pointer

Definition at line 7 of file CastorCoderFactory.cc.

7  {
8  CastorCoder *result = nullptr;
9  if (theCoderType == DB) {
10  assert(theDbService != nullptr);
11  HcalGenericDetId hcalGenDetId(id);
12  const CastorQIECoder *qieCoder = theDbService->getCastorCoder(hcalGenDetId);
13  const CastorQIEShape *qieShape = theDbService->getCastorShape();
14  result = new CastorCoderDb(*qieCoder, *qieShape);
15  }
16 
17  else {
18  result = new CastorNominalCoder();
19  }
20  return std::unique_ptr<CastorCoder>(result);
21 }

References cms::cuda::assert(), DB, CastorDbService::getCastorCoder(), CastorDbService::getCastorShape(), mps_fire::result, theCoderType, and theDbService.

Referenced by CastorElectronicsSim::convert().

◆ setDbService()

void CastorCoderFactory::setDbService ( const CastorDbService service)
inline

Definition at line 14 of file CastorCoderFactory.h.

14 { theDbService = service; }

References theDbService.

Referenced by CastorDigiProducer::initializeEvent().

Member Data Documentation

◆ theCoderType

CoderType CastorCoderFactory::theCoderType
private

Definition at line 20 of file CastorCoderFactory.h.

Referenced by coder().

◆ theDbService

const CastorDbService* CastorCoderFactory::theDbService
private

Definition at line 21 of file CastorCoderFactory.h.

Referenced by coder(), and setDbService().

service
Definition: service.py:1
CastorCoderFactory::theCoderType
CoderType theCoderType
Definition: CastorCoderFactory.h:20
HcalGenericDetId
Definition: HcalGenericDetId.h:15
CastorNominalCoder
Definition: CastorNominalCoder.h:11
CastorCoderFactory::theDbService
const CastorDbService * theDbService
Definition: CastorCoderFactory.h:21
cms::cuda::assert
assert(be >=bs)
CastorDbService::getCastorCoder
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const
Definition: CastorDbService.cc:169
CastorCoderDb
Definition: CastorCoderDb.h:16
CastorCoderFactory::NOMINAL
Definition: CastorCoderFactory.h:10
CastorDbService::getCastorShape
const CastorQIEShape * getCastorShape() const
Definition: CastorDbService.cc:176
CastorQIECoder
Definition: CastorQIECoder.h:21
mps_fire.result
result
Definition: mps_fire.py:303
CastorCoderFactory::DB
Definition: CastorCoderFactory.h:10
CastorCoder
Definition: CastorCoder.h:13
CastorQIEShape
Definition: CastorQIEShape.h:14