SimG4CMS
ShowerLibraryProducer
plugins
FiberSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: SimG4CMS/ShowerLibraryProducer
4
// Class : FiberSensitiveDetectorBuilder
5
//
6
// Implementation:
7
// [Notes on implementation]
8
//
9
// Original Author: Sunanda Banerjee
10
// Created: Tue, 13 Jun 2021 15:18:17 GMT
11
//
12
13
// system include files
14
#include <string>
15
16
// user include files
17
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h
"
18
#include "
SimG4Core/Notification/interface/SimActivityRegistryEnroller.h
"
19
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h
"
20
21
#include "
Geometry/HcalCommonData/interface/HcalDDDSimConstants.h
"
22
#include "
Geometry/HcalCommonData/interface/HcalSimulationConstants.h
"
23
#include "
Geometry/Records/interface/HcalSimNumberingRecord.h
"
24
#include "
SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h
"
25
26
#include "
FWCore/Framework/interface/EventSetup.h
"
27
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
28
#include "
FWCore/Utilities/interface/ESGetToken.h
"
29
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
30
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
31
32
class
FiberSensitiveDetectorBuilder
:
public
SensitiveDetectorMakerBase
{
33
public
:
34
explicit
FiberSensitiveDetectorBuilder
(
const
edm::ParameterSet
&
p
,
edm::ConsumesCollector
cc)
35
:
cspsToken_
{cc.
esConsumes
<
edm::Transition::BeginRun
>()},
36
cdcToken_
{cc.esConsumes<
edm::Transition::BeginRun
>()},
37
hcalSimCons_
{
nullptr
},
38
hcalDDCons_
{
nullptr
} {}
39
40
void
beginRun
(
const
edm::EventSetup
& es)
final
{
41
hcalSimCons_
= &es.getData(
cspsToken_
);
42
hcalDDCons_
= &es.getData(
cdcToken_
);
43
}
44
45
std::unique_ptr<SensitiveDetector>
make
(
const
std::string
& iname,
46
const
SensitiveDetectorCatalog
& clg,
47
const
edm::ParameterSet
&
p
,
48
const
SimTrackManager
* man,
49
SimActivityRegistry
& reg)
const
final
{
50
auto
sd = std::make_unique<FiberSD>(iname,
hcalSimCons_
,
hcalDDCons_
, clg,
p
, man);
51
SimActivityRegistryEnroller::enroll
(reg, sd.get());
52
return
sd;
53
}
54
55
private
:
56
const
edm::ESGetToken<HcalSimulationConstants, HcalSimNumberingRecord>
cspsToken_
;
57
const
edm::ESGetToken<HcalDDDSimConstants, HcalSimNumberingRecord>
cdcToken_
;
58
const
HcalSimulationConstants
*
hcalSimCons_
;
59
const
HcalDDDSimConstants
*
hcalDDCons_
;
60
};
61
62
typedef
FiberSD
FiberSensitiveDetector
;
63
DEFINE_SENSITIVEDETECTORBUILDER
(
FiberSensitiveDetectorBuilder
,
FiberSensitiveDetector
);
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition:
ConsumesCollector.h:97
HcalDDDSimConstants.h
EventSetup.h
FiberSD.h
SensitiveDetectorMakerBase
Definition:
SensitiveDetectorMakerBase.h:28
HcalDDDSimConstants
Definition:
HcalDDDSimConstants.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalSimulationConstants
Definition:
HcalSimulationConstants.h:15
ParameterSet.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition:
SimActivityRegistryEnroller.h:50
FiberSensitiveDetectorBuilder::cdcToken_
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > cdcToken_
Definition:
FiberSensitiveDetectorBuilder.cc:57
edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord >
FiberSensitiveDetectorBuilder::hcalDDCons_
const HcalDDDSimConstants * hcalDDCons_
Definition:
FiberSensitiveDetectorBuilder.cc:59
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition:
SensitiveDetectorPluginFactory.h:21
ESGetToken.h
FiberSensitiveDetectorBuilder::hcalSimCons_
const HcalSimulationConstants * hcalSimCons_
Definition:
FiberSensitiveDetectorBuilder.cc:58
FiberSensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition:
FiberSensitiveDetectorBuilder.cc:40
FiberSensitiveDetectorBuilder::cspsToken_
const edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord > cspsToken_
Definition:
FiberSensitiveDetectorBuilder.cc:56
SensitiveDetectorPluginFactory.h
HcalSimNumberingRecord.h
edm::EventSetup
Definition:
EventSetup.h:59
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
FiberSensitiveDetector
FiberSD FiberSensitiveDetector
Definition:
FiberSensitiveDetectorBuilder.cc:62
FiberSD
Definition:
FiberSD.h:29
edm::Transition::BeginRun
SimActivityRegistryEnroller.h
FiberSensitiveDetectorBuilder::make
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry ®) const final
Definition:
FiberSensitiveDetectorBuilder.cc:45
edm::ParameterSet
Definition:
ParameterSet.h:47
SimActivityRegistry
Definition:
SimActivityRegistry.h:39
HcalSimulationConstants.h
FiberSensitiveDetectorBuilder
Definition:
FiberSensitiveDetectorBuilder.cc:32
ModuleDef.h
ConsumesCollector.h
SensitiveDetectorMakerBase.h
FiberSensitiveDetectorBuilder::FiberSensitiveDetectorBuilder
FiberSensitiveDetectorBuilder(const edm::ParameterSet &p, edm::ConsumesCollector cc)
Definition:
FiberSensitiveDetectorBuilder.cc:34
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
SimTrackManager
Definition:
SimTrackManager.h:35
Generated for CMSSW Reference Manual by
1.8.14