src
SimG4CMS
Calo
plugins
HFNoseSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1
2
// system include files
3
#include <string>
4
#include <vector>
5
6
// user include files
7
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h
"
8
#include "
SimG4Core/Notification/interface/SimActivityRegistryEnroller.h
"
9
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h
"
10
11
#include "
Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
"
12
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
13
#include "
SimG4CMS/Calo/interface/HFNoseSD.h
"
14
15
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
16
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
17
#include "
FWCore/Framework/interface/ESHandle.h
"
18
#include "
FWCore/Utilities/interface/ESGetToken.h
"
19
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
20
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
21
22
class
HFNoseSensitiveDetectorBuilder
:
public
SensitiveDetectorMakerBase
{
23
public
:
24
explicit
HFNoseSensitiveDetectorBuilder
(
edm::ParameterSet
const
&
p
,
edm::ConsumesCollector
cc)
25
:
hgcToken_
{cc.
esConsumes
<
edm::Transition::BeginRun
>(
edm::ESInputTag
{
""
,
"HGCalHFNoseSensitive"
})},
26
hgcons_
{
nullptr
} {}
27
28
void
beginRun
(
const
edm::EventSetup
& es)
final
{
hgcons_
= es.getHandle(
hgcToken_
); }
29
30
std::unique_ptr<SensitiveDetector>
make
(
const
std::string
& iname,
31
const
SensitiveDetectorCatalog
& clg,
32
const
edm::ParameterSet
&
p
,
33
const
SimTrackManager
* man,
34
SimActivityRegistry
& reg)
const
final
{
35
auto
hgc
= ((iname.find(
"HFNoseHits"
) != std::string::npos) &&
hgcons_
.
isValid
()) ?
hgcons_
.
product
() :
nullptr
;
36
auto
sd = std::make_unique<HFNoseSD>(iname,
hgc
, clg,
p
, man);
37
SimActivityRegistryEnroller::enroll
(reg, sd.get());
38
return
sd;
39
}
40
41
private
:
42
const
edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>
hgcToken_
;
43
edm::ESHandle<HGCalDDDConstants>
hgcons_
;
44
};
45
46
typedef
HFNoseSD
HFNoseSensitiveDetector
;
47
DEFINE_SENSITIVEDETECTORBUILDER
(
HFNoseSensitiveDetectorBuilder
,
HFNoseSensitiveDetector
);
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition:
ConsumesCollector.h:97
MessageLogger.h
edm::ESInputTag
Definition:
ESInputTag.h:87
SensitiveDetectorMakerBase
Definition:
SensitiveDetectorMakerBase.h:28
HFNoseSD.h
caloTruthProducer_cfi.hgc
hgc
Definition:
caloTruthProducer_cfi.py:16
hgc_digi
Definition:
HGCDigitizerTypes.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HFNoseSensitiveDetectorBuilder::hgcToken_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcToken_
Definition:
HFNoseSensitiveDetectorBuilder.cc:42
ParameterSet.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition:
SimActivityRegistryEnroller.h:50
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord >
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition:
SensitiveDetectorPluginFactory.h:21
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
HFNoseSensitiveDetectorBuilder
Definition:
HFNoseSensitiveDetectorBuilder.cc:22
ESGetToken.h
HFNoseSensitiveDetectorBuilder::hgcons_
edm::ESHandle< HGCalDDDConstants > hgcons_
Definition:
HFNoseSensitiveDetectorBuilder.cc:43
edm::ESHandle< HGCalDDDConstants >
SensitiveDetectorPluginFactory.h
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:59
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
edm::ESHandleBase::isValid
bool isValid() const
Definition:
ESHandle.h:44
edm::Transition::BeginRun
SimActivityRegistryEnroller.h
HFNoseSensitiveDetectorBuilder::HFNoseSensitiveDetectorBuilder
HFNoseSensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
Definition:
HFNoseSensitiveDetectorBuilder.cc:24
HFNoseSensitiveDetectorBuilder::make
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry ®) const final
Definition:
HFNoseSensitiveDetectorBuilder.cc:30
IdealGeometryRecord.h
HFNoseSensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition:
HFNoseSensitiveDetectorBuilder.cc:28
HGCalDDDConstants.h
HFNoseSensitiveDetector
HFNoseSD HFNoseSensitiveDetector
Definition:
HFNoseSensitiveDetectorBuilder.cc:46
edm::ParameterSet
Definition:
ParameterSet.h:47
SimActivityRegistry
Definition:
SimActivityRegistry.h:39
ModuleDef.h
ConsumesCollector.h
SensitiveDetectorMakerBase.h
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
HFNoseSD
Definition:
HFNoseSD.h:20
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
SimTrackManager
Definition:
SimTrackManager.h:35
Generated for CMSSW Reference Manual by
1.8.14