CMS 3D CMS Logo

CastorCoderFactory.cc
Go to the documentation of this file.
4 
5 
6 
8 : theCoderType(coderType),
9  theDbService(nullptr)
10 {
11 }
12 
13 
14 std::unique_ptr<CastorCoder> CastorCoderFactory::coder(const DetId & id) const {
15  CastorCoder * result = nullptr;
16  if(theCoderType == DB) {
17  assert(theDbService != nullptr);
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
#define nullptr
const CastorQIEShape * getCastorShape() const
Definition: DetId.h:18
CastorCoderFactory(CoderType coderType)
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const