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.

Constructor & Destructor Documentation

◆ CastorCoderFactory()

CastorCoderFactory::CastorCoderFactory ( CoderType  coderType)

Definition at line 6 of file CastorCoderFactory.cc.

6 : theCoderType(coderType), theDbService(nullptr) {}
const CastorDbService * theDbService

Member Function Documentation

◆ coder()

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

user gets control of the pointer

Definition at line 8 of file CastorCoderFactory.cc.

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

Referenced by CastorElectronicsSim::convert().

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

◆ setDbService()

void CastorCoderFactory::setDbService ( const CastorDbService service)
inline

Definition at line 14 of file CastorCoderFactory.h.

References theDbService.

Referenced by CastorDigiProducer::initializeEvent().

14 { theDbService = service; }
const CastorDbService * theDbService

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().