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
#include <cassert>
5
6
CastorCoderFactory::CastorCoderFactory
(
CoderType
coderType) : theCoderType(coderType), theDbService(nullptr) {}
7
8
std::unique_ptr<CastorCoder>
CastorCoderFactory::coder
(
const
DetId
&
id
)
const
{
9
CastorCoder
*
result
=
nullptr
;
10
if
(
theCoderType
==
DB
) {
11
assert
(
theDbService
!=
nullptr
);
12
HcalGenericDetId
hcalGenDetId(
id
);
13
const
CastorQIECoder
*qieCoder =
theDbService
->
getCastorCoder
(hcalGenDetId);
14
const
CastorQIEShape
*qieShape =
theDbService
->
getCastorShape
();
15
result
=
new
CastorCoderDb
(*qieCoder, *qieShape);
16
}
17
18
else
{
19
result
=
new
CastorNominalCoder
();
20
}
21
return
std::unique_ptr<CastorCoder>(
result
);
22
}
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:8
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:6
CastorCoder
Definition:
CastorCoder.h:13
CastorQIEShape
Definition:
CastorQIEShape.h:14
Generated for CMSSW Reference Manual by
1.8.16