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
CastorCoderFactory Class Reference

#include <CastorCoderFactory.h>

Public Types

enum  CoderType { DB, NOMINAL }
 

Public Member Functions

 CastorCoderFactory (CoderType coderType)
 
std::auto_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 11 of file CastorCoderFactory.h.

Constructor & Destructor Documentation

CastorCoderFactory::CastorCoderFactory ( CoderType  coderType)

Definition at line 7 of file CastorCoderFactory.cc.

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

Member Function Documentation

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

user gets control of the pointer

Definition at line 14 of file CastorCoderFactory.cc.

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

Referenced by CastorElectronicsSim::convert().

14  {
15  CastorCoder * result = 0;
16  if(theCoderType == DB) {
17  assert(theDbService != 0);
18  HcalGenericDetId hcalGenDetId(id);
19  const CastorQIECoder * qieCoder = theDbService->getCastorCoder(hcalGenDetId );
20  const CastorQIEShape * qieShape = theDbService->getCastorShape();
21  result = new CastorCoderDb(*qieCoder, *qieShape);
22  }
23 
24  else {
25  result = new CastorNominalCoder();
26  }
27  return std::auto_ptr<CastorCoder>(result);
28 }
const CastorDbService * theDbService
assert(m_qm.get())
tuple result
Definition: mps_fire.py:95
const CastorQIEShape * getCastorShape() const
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const
void CastorCoderFactory::setDbService ( const CastorDbService service)
inline

Definition at line 15 of file CastorCoderFactory.h.

References theDbService.

Referenced by CastorDigiProducer::initializeEvent().

15 {theDbService = service;}
const CastorDbService * theDbService

Member Data Documentation

CoderType CastorCoderFactory::theCoderType
private

Definition at line 22 of file CastorCoderFactory.h.

Referenced by coder().

const CastorDbService* CastorCoderFactory::theDbService
private

Definition at line 23 of file CastorCoderFactory.h.

Referenced by coder(), and setDbService().