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
);
FiberSensitiveDetector
FiberSD FiberSensitiveDetector
Definition:
FiberSensitiveDetectorBuilder.cc:62
SimTrackManager
Definition:
SimTrackManager.h:35
FiberSD
Definition:
FiberSD.h:29
HcalSimNumberingRecord.h
FiberSensitiveDetectorBuilder
Definition:
FiberSensitiveDetectorBuilder.cc:32
ESGetToken.h
FiberSensitiveDetectorBuilder::cdcToken_
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > cdcToken_
Definition:
FiberSensitiveDetectorBuilder.cc:57
HcalDDDSimConstants
Definition:
HcalDDDSimConstants.h:24
FiberSensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition:
FiberSensitiveDetectorBuilder.cc:40
HcalSimulationConstants
Definition:
HcalSimulationConstants.h:15
FiberSensitiveDetectorBuilder::hcalSimCons_
const HcalSimulationConstants * hcalSimCons_
Definition:
FiberSensitiveDetectorBuilder.cc:58
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
FiberSensitiveDetectorBuilder::hcalDDCons_
const HcalDDDSimConstants * hcalDDCons_
Definition:
FiberSensitiveDetectorBuilder.cc:59
SensitiveDetectorMakerBase
Definition:
SensitiveDetectorMakerBase.h:28
ModuleDef.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition:
SimActivityRegistryEnroller.h:50
FiberSensitiveDetectorBuilder::cspsToken_
const edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord > cspsToken_
Definition:
FiberSensitiveDetectorBuilder.cc:56
edm::EventSetup
Definition:
EventSetup.h:58
cc
edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
SimActivityRegistryEnroller.h
FiberSD.h
SimActivityRegistry
Definition:
SimActivityRegistry.h:39
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
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition:
SensitiveDetectorPluginFactory.h:21
edm::Transition::BeginRun
FiberSensitiveDetectorBuilder::FiberSensitiveDetectorBuilder
FiberSensitiveDetectorBuilder(const edm::ParameterSet &p, edm::ConsumesCollector cc)
Definition:
FiberSensitiveDetectorBuilder.cc:34
HcalSimulationConstants.h
EventSetup.h
sd
double sd
Definition:
CascadeWrapper.h:113
ConsumesCollector.h
SensitiveDetectorPluginFactory.h
ParameterSet.h
SensitiveDetectorMakerBase.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
HcalDDDSimConstants.h
Generated for CMSSW Reference Manual by
1.8.16