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

Enumerator
DB 
NOMINAL 

Definition at line 10 of file CastorCoderFactory.h.

Constructor & Destructor Documentation

CastorCoderFactory::CastorCoderFactory ( CoderType  coderType)

Definition at line 5 of file CastorCoderFactory.cc.

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

Member Function Documentation

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

user gets control of the pointer

Definition at line 7 of file CastorCoderFactory.cc.

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

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

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 }
const CastorDbService * theDbService
const CastorQIEShape * getCastorShape() const
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const
void CastorCoderFactory::setDbService ( const CastorDbService service)
inline

Definition at line 14 of file CastorCoderFactory.h.

References coder(), and theDbService.

Referenced by CastorDigiProducer::initializeEvent().

14 { theDbService = service; }
const CastorDbService * theDbService

Member Data Documentation

CoderType CastorCoderFactory::theCoderType
private

Definition at line 20 of file CastorCoderFactory.h.

Referenced by coder().

const CastorDbService* CastorCoderFactory::theDbService
private

Definition at line 21 of file CastorCoderFactory.h.

Referenced by coder(), and setDbService().