SimG4CMS
HcalTestBeam
plugins
HcalTB02SensitiveDetectorBuilder.cc
Go to the documentation of this file.
1
// system include files
2
3
// user include files
4
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h
"
5
#include "
SimG4Core/Notification/interface/SimActivityRegistryEnroller.h
"
6
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h
"
7
8
#include "
Geometry/HcalTestBeamData/interface/HcalTB02Parameters.h
"
9
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
10
#include "
HcalTB02SD.h
"
11
12
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
13
#include "
FWCore/Utilities/interface/ESGetToken.h
"
14
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
15
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
16
17
class
HcalTB02SensitiveDetectorBuilder
:
public
SensitiveDetectorMakerBase
{
18
public
:
19
explicit
HcalTB02SensitiveDetectorBuilder
(
edm::ParameterSet
const
&
p
,
edm::ConsumesCollector
cc
)
20
:
ebParToken_
{
cc
.esConsumes<
HcalTB02Parameters
,
IdealGeometryRecord
,
edm::Transition::BeginRun
>(
21
edm::ESInputTag
{
""
,
"EcalHitsEB"
})},
22
hcParToken_
{
cc
.esConsumes<
HcalTB02Parameters
,
IdealGeometryRecord
,
edm::Transition::BeginRun
>(
23
edm::ESInputTag
{
""
,
"HcalHits"
})},
24
ebPar_
{
nullptr
},
25
hcPar_
{
nullptr
} {}
26
27
void
beginRun
(
const
edm::EventSetup
& es)
final
{
28
ebPar_
= &es.getData(
ebParToken_
);
29
hcPar_
= &es.getData(
hcParToken_
);
30
}
31
32
std::unique_ptr<SensitiveDetector>
make
(
const
std::string
& iname,
33
const
SensitiveDetectorCatalog
& clg,
34
const
edm::ParameterSet
&
p
,
35
const
SimTrackManager
* man,
36
SimActivityRegistry
& reg)
const
final
{
37
auto
par = ((iname ==
"EcalHitsEB"
) ?
ebPar_
: ((iname ==
"HcalHits"
) ?
hcPar_
:
nullptr
));
38
auto
sd
= std::make_unique<HcalTB02SD>(iname, par, clg,
p
, man);
39
SimActivityRegistryEnroller::enroll
(reg,
sd
.get());
40
return
sd
;
41
}
42
43
private
:
44
const
edm::ESGetToken<HcalTB02Parameters, IdealGeometryRecord>
ebParToken_
;
45
const
edm::ESGetToken<HcalTB02Parameters, IdealGeometryRecord>
hcParToken_
;
46
const
HcalTB02Parameters
*
ebPar_
;
47
const
HcalTB02Parameters
*
hcPar_
;
48
};
49
50
typedef
HcalTB02SD
HcalTB02SensitiveDetector
;
51
DEFINE_SENSITIVEDETECTORBUILDER
(
HcalTB02SensitiveDetectorBuilder
,
HcalTB02SensitiveDetector
);
SimTrackManager
Definition:
SimTrackManager.h:35
edm::ESInputTag
Definition:
ESInputTag.h:87
HcalTB02SensitiveDetectorBuilder::ebPar_
const HcalTB02Parameters * ebPar_
Definition:
HcalTB02SensitiveDetectorBuilder.cc:46
HcalTB02SensitiveDetectorBuilder::HcalTB02SensitiveDetectorBuilder
HcalTB02SensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
Definition:
HcalTB02SensitiveDetectorBuilder.cc:19
ESGetToken.h
HcalTB02SensitiveDetectorBuilder::hcParToken_
const edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > hcParToken_
Definition:
HcalTB02SensitiveDetectorBuilder.cc:45
HcalTB02SensitiveDetectorBuilder::ebParToken_
const edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord > ebParToken_
Definition:
HcalTB02SensitiveDetectorBuilder.cc:44
HcalTB02Parameters
Definition:
HcalTB02Parameters.h:9
HcalTB02SensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition:
HcalTB02SensitiveDetectorBuilder.cc:27
HcalTB02SensitiveDetectorBuilder::make
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry ®) const final
Definition:
HcalTB02SensitiveDetectorBuilder.cc:32
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
HcalTB02SensitiveDetectorBuilder
Definition:
HcalTB02SensitiveDetectorBuilder.cc:17
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
SensitiveDetectorMakerBase
Definition:
SensitiveDetectorMakerBase.h:28
ModuleDef.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition:
SimActivityRegistryEnroller.h:50
HcalTB02SD.h
HcalTB02SensitiveDetector
HcalTB02SD HcalTB02SensitiveDetector
Definition:
HcalTB02SensitiveDetectorBuilder.cc:50
IdealGeometryRecord.h
edm::EventSetup
Definition:
EventSetup.h:58
cc
edm::ESGetToken< HcalTB02Parameters, IdealGeometryRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTB02SensitiveDetectorBuilder::hcPar_
const HcalTB02Parameters * hcPar_
Definition:
HcalTB02SensitiveDetectorBuilder.cc:47
HcalTB02SD
Definition:
HcalTB02SD.h:31
SimActivityRegistryEnroller.h
HcalTB02Parameters.h
SimActivityRegistry
Definition:
SimActivityRegistry.h:39
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition:
SensitiveDetectorPluginFactory.h:21
edm::Transition::BeginRun
sd
double sd
Definition:
CascadeWrapper.h:113
ConsumesCollector.h
SensitiveDetectorPluginFactory.h
ParameterSet.h
SensitiveDetectorMakerBase.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:25
Generated for CMSSW Reference Manual by
1.8.16