CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

CastorCoderFactory Class Reference

#include <CastorCoderFactory.h>

List of all members.

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

{DB, NOMINAL};

Constructor & Destructor Documentation

CastorCoderFactory::CastorCoderFactory ( CoderType  coderType)

Definition at line 7 of file CastorCoderFactory.cc.

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

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 DB, CastorDbService::getCastorCoder(), CastorDbService::getCastorShape(), query::result, theCoderType, and theDbService.

Referenced by CastorElectronicsSim::convert().

                                                                         {
  CastorCoder * result = 0;
  if(theCoderType == DB) {
    assert(theDbService != 0);
    HcalGenericDetId hcalGenDetId(id);
    const CastorQIECoder * qieCoder = theDbService->getCastorCoder(hcalGenDetId );
    const CastorQIEShape * qieShape = theDbService->getCastorShape();
    result = new CastorCoderDb(*qieCoder, *qieShape);
  }

  else {
    result = new CastorNominalCoder();
  }
  return std::auto_ptr<CastorCoder>(result);
}
void CastorCoderFactory::setDbService ( const CastorDbService service) [inline]

Definition at line 15 of file CastorCoderFactory.h.

References theDbService.

Referenced by CastorDigiProducer::initializeEvent().

{theDbService = service;}

Member Data Documentation

Definition at line 22 of file CastorCoderFactory.h.

Referenced by coder().

Definition at line 23 of file CastorCoderFactory.h.

Referenced by coder(), and setDbService().