CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
HcalCoderFactory Class Reference

#include <HcalCoderFactory.h>

Public Types

enum  CoderType { DB, NOMINAL }
 

Public Member Functions

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

Constructor & Destructor Documentation

HcalCoderFactory::HcalCoderFactory ( CoderType  coderType)

Definition at line 7 of file HcalCoderFactory.cc.

8 : theCoderType(coderType),
9  theDbService(0)
10 {
11 }
const HcalDbService * theDbService
CoderType theCoderType

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

14  {
15  HcalCoder * result = 0;
16  if(theCoderType == DB) {
17  assert(theDbService != 0);
18  HcalGenericDetId hcalGenDetId(id);
19  const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
20  const HcalQIEShape * qieShape = theDbService->getHcalShape();
21  result = new HcalCoderDb(*qieCoder, *qieShape);
22  }
23 
24  else {
25  result = new HcalNominalCoder();
26  }
27  return std::auto_ptr<HcalCoder>(result);
28 }
const HcalDbService * theDbService
tuple result
Definition: query.py:137
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
CoderType theCoderType
const HcalQIEShape * getHcalShape() const
void HcalCoderFactory::setDbService ( const HcalDbService service)
inline

Definition at line 15 of file HcalCoderFactory.h.

References theDbService.

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

15 {theDbService = service;}
const HcalDbService * theDbService

Member Data Documentation

CoderType HcalCoderFactory::theCoderType
private

Definition at line 22 of file HcalCoderFactory.h.

Referenced by coder().

const HcalDbService* HcalCoderFactory::theDbService
private

Definition at line 23 of file HcalCoderFactory.h.

Referenced by coder(), and setDbService().