#include <CastorCoderFactory.h>
Public Types | |
enum | CoderType { DB, NOMINAL } |
Public Member Functions | |
CastorCoderFactory (CoderType coderType) | |
std::auto_ptr< CastorCoder > | coder (const DetId &detId) const |
user gets control of the pointer | |
void | setDbService (const CastorDbService *service) |
Private Attributes | |
CoderType | theCoderType |
const CastorDbService * | theDbService |
Definition at line 8 of file CastorCoderFactory.h.
CastorCoderFactory::CastorCoderFactory | ( | CoderType | coderType | ) |
Definition at line 7 of file CastorCoderFactory.cc.
: theCoderType(coderType), theDbService(0) { }
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;}
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().