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),
9  theDbService(0)
10 {
11 }
12 
13 
14 std::auto_ptr<HcalCoder> HcalCoderFactory::coder(const DetId & id) const {
15  HcalCoder * result = 0;
16  if(theCoderType == DB) {
17  assert(theDbService != 0);
18  HcalGenericDetId hcalGenDetId(id);
19  const HcalQIECoder * qieCoder = theDbService->getHcalCoder(hcalGenDetId );
20  const HcalQIEShape * qieShape = theDbService->getHcalShape();
21  result = new HcalCoderDb(*qieCoder, *qieShape);
22  }
23 
24  else {
25  result = new HcalNominalCoder();
26  }
27  return std::auto_ptr<HcalCoder>(result);
28 }
29 
const HcalDbService * theDbService
HcalCoderFactory(CoderType coderType)
tuple result
Definition: query.py:137
Definition: DetId.h:20
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
CoderType theCoderType
const HcalQIEShape * getHcalShape() const
std::auto_ptr< HcalCoder > coder(const DetId &detId) const
user gets control of the pointer