CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

HcalCoderFactory Class Reference

#include <HcalCoderFactory.h>

List of all members.

Public Types

enum  CoderType { DB, NOMINAL }

Public Member Functions

std::auto_ptr< HcalCodercoder (const DetId &detId) const
 user gets control of the pointer
 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.

{DB, NOMINAL};

Constructor & Destructor Documentation

HcalCoderFactory::HcalCoderFactory ( CoderType  coderType)

Definition at line 7 of file HcalCoderFactory.cc.

: theCoderType(coderType),
  theDbService(0)
{
}

Member Function Documentation

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

user gets control of the pointer

Definition at line 14 of file HcalCoderFactory.cc.

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

Referenced by HcalElectronicsSim::convert().

                                                                     {
  HcalCoder * result = 0;
  if(theCoderType == DB) {
    assert(theDbService != 0);
    HcalGenericDetId hcalGenDetId(id);
    const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
    const HcalQIEShape * qieShape = theDbService->getHcalShape();
    result = new HcalCoderDb(*qieCoder, *qieShape);
  }

  else {
    result = new HcalNominalCoder();
  }
  return std::auto_ptr<HcalCoder>(result);
}
void HcalCoderFactory::setDbService ( const HcalDbService service) [inline]

Definition at line 15 of file HcalCoderFactory.h.

References theDbService.

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

{theDbService = service;}

Member Data Documentation

Definition at line 22 of file HcalCoderFactory.h.

Referenced by coder().

Definition at line 23 of file HcalCoderFactory.h.

Referenced by coder(), and setDbService().