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, UPGRADE }

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 
UPGRADE 

Definition at line 11 of file HcalCoderFactory.h.


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 11 of file HcalCoderFactory.cc.

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

Referenced by HcalElectronicsSim::convert().

                                                                     {
  HcalCoder * result = 0;
  if (theCoderType == DB || theCoderType == UPGRADE) {
    assert(theDbService != 0);
    HcalGenericDetId hcalGenDetId(id);
    const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
    const HcalQIEShape * qieShape = theDbService->getHcalShape(hcalGenDetId);
    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 HcalTBDigiProducer::initializeEvent(), and HcalDigitizer::initializeEvent().

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