Main Page
Namespaces
Classes
Package Documentation
SimCalorimetry
CastorSim
src
CastorCoderFactory.cc
Go to the documentation of this file.
1
#include "
SimCalorimetry/CastorSim/src/CastorCoderFactory.h
"
2
#include "
CalibFormats/CastorObjects/interface/CastorCoderDb.h
"
3
#include "
CalibFormats/CastorObjects/interface/CastorNominalCoder.h
"
4
5
6
7
CastorCoderFactory::CastorCoderFactory
(
CoderType
coderType)
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
CastorCoderFactory::coder
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
Definition:
CastorCoderFactory.cc:14
CastorNominalCoder.h
mps_fire.result
result
Definition:
mps_fire.py:234
CastorCoderFactory::theDbService
const CastorDbService * theDbService
Definition:
CastorCoderFactory.h:23
CastorCoderFactory::CoderType
CoderType
Definition:
CastorCoderFactory.h:11
CastorNominalCoder
Definition:
CastorNominalCoder.h:11
nullptr
#define nullptr
CastorCoderDb.h
CastorQIECoder
Definition:
CastorQIECoder.h:22
CastorCoderFactory.h
CastorCoderDb
Definition:
CastorCoderDb.h:16
CastorQIEShape
Definition:
CastorQIEShape.h:14
CastorCoder
Definition:
CastorCoder.h:13
CastorDbService::getCastorShape
const CastorQIEShape * getCastorShape() const
Definition:
CastorDbService.cc:171
HcalGenericDetId
Definition:
HcalGenericDetId.h:15
DetId
Definition:
DetId.h:18
CastorCoderFactory::CastorCoderFactory
CastorCoderFactory(CoderType coderType)
Definition:
CastorCoderFactory.cc:7
CastorCoderFactory::DB
Definition:
CastorCoderFactory.h:11
CastorCoderFactory::theCoderType
CoderType theCoderType
Definition:
CastorCoderFactory.h:22
CastorDbService::getCastorCoder
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const
Definition:
CastorDbService.cc:164
Generated for CMSSW Reference Manual by
1.8.11