CMS 3D CMS Logo

CastorCoderFactory.cc
Go to the documentation of this file.
4 
5 
6 
8 : theCoderType(coderType),
9  theDbService(0)
10 {
11 }
12 
13 
14 std::unique_ptr<CastorCoder> CastorCoderFactory::coder(const DetId & id) const {
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::unique_ptr<CastorCoder>(result);
28 }
29 
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
const CastorDbService * theDbService
const CastorQIEShape * getCastorShape() const
Definition: DetId.h:18
CastorCoderFactory(CoderType coderType)
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const