SimCalorimetry
CastorSim
src
CastorCoderFactory.cc
Go to the documentation of this file.
1
#include "
CalibFormats/CastorObjects/interface/CastorCoderDb.h
"
2
#include "
CalibFormats/CastorObjects/interface/CastorNominalCoder.h
"
3
#include "
SimCalorimetry/CastorSim/src/CastorCoderFactory.h
"
4
5
CastorCoderFactory::CastorCoderFactory
(
CoderType
coderType) : theCoderType(coderType), theDbService(nullptr) {}
6
7
std::unique_ptr<CastorCoder>
CastorCoderFactory::coder
(
const
DetId
&
id
)
const
{
8
CastorCoder
*
result
=
nullptr
;
9
if
(
theCoderType
==
DB
) {
10
assert
(
theDbService
!=
nullptr
);
11
HcalGenericDetId
hcalGenDetId(
id
);
12
const
CastorQIECoder
*qieCoder =
theDbService
->
getCastorCoder
(hcalGenDetId);
13
const
CastorQIEShape
*qieShape =
theDbService
->
getCastorShape
();
14
result
=
new
CastorCoderDb
(*qieCoder, *qieShape);
15
}
16
17
else
{
18
result
=
new
CastorNominalCoder
();
19
}
20
return
std::unique_ptr<CastorCoder>(
result
);
21
}
CastorCoderFactory::theCoderType
CoderType theCoderType
Definition:
CastorCoderFactory.h:20
HcalGenericDetId
Definition:
HcalGenericDetId.h:15
CastorNominalCoder
Definition:
CastorNominalCoder.h:11
CastorCoderFactory::theDbService
const CastorDbService * theDbService
Definition:
CastorCoderFactory.h:21
cms::cuda::assert
assert(be >=bs)
CastorDbService::getCastorCoder
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const
Definition:
CastorDbService.cc:169
CastorCoderDb
Definition:
CastorCoderDb.h:16
CastorCoderFactory::coder
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
Definition:
CastorCoderFactory.cc:7
DetId
Definition:
DetId.h:17
CastorDbService::getCastorShape
const CastorQIEShape * getCastorShape() const
Definition:
CastorDbService.cc:176
CastorCoderFactory::CoderType
CoderType
Definition:
CastorCoderFactory.h:10
CastorNominalCoder.h
CastorCoderDb.h
CastorQIECoder
Definition:
CastorQIECoder.h:21
CastorCoderFactory.h
mps_fire.result
result
Definition:
mps_fire.py:311
CastorCoderFactory::DB
Definition:
CastorCoderFactory.h:10
CastorCoderFactory::CastorCoderFactory
CastorCoderFactory(CoderType coderType)
Definition:
CastorCoderFactory.cc:5
CastorCoder
Definition:
CastorCoder.h:13
CastorQIEShape
Definition:
CastorQIEShape.h:14
Generated for CMSSW Reference Manual by
1.8.16