test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCoderFactory.cc
Go to the documentation of this file.
4 
5 
6 
8  : theCoderType(coderType), theDbService(0) { }
9 
10 
11 std::auto_ptr<HcalCoder> HcalCoderFactory::coder(const DetId & id) const {
12  HcalCoder * result = 0;
13  if (theCoderType == DB || theCoderType == UPGRADE) {
14  assert(theDbService != 0);
15  HcalGenericDetId hcalGenDetId(id);
16  const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
17  const HcalQIEShape * qieShape = theDbService->getHcalShape(hcalGenDetId);
18  result = new HcalCoderDb(*qieCoder, *qieShape);
19  } else {
20  result = new HcalNominalCoder();
21  }
22  return std::auto_ptr<HcalCoder>(result);
23 }
24 
const HcalDbService * theDbService
HcalCoderFactory(CoderType coderType)
tuple result
Definition: query.py:137
Definition: DetId.h:18
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
CoderType theCoderType
std::auto_ptr< HcalCoder > coder(const DetId &detId) const
user gets control of the pointer