Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
SimG4CMS
Calo
plugins
HGCScintillatorSensitiveDetectorBuilder.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/HGCScintSD.h
"
14
15
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
16
#include "
FWCore/Framework/interface/ESHandle.h
"
17
#include "
FWCore/MessageLogger/interface/MessageLogger.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
HGCScintillatorSensitiveDetectorBuilder
:
public
SensitiveDetectorMakerBase
{
23
public
:
24
explicit
HGCScintillatorSensitiveDetectorBuilder
(
edm::ParameterSet
const
&
p
,
edm::ConsumesCollector
cc)
25
:
hgcToken_
{cc.
esConsumes
<
edm::Transition::BeginRun
>(
edm::ESInputTag
{
""
,
"HGCalHEScintillatorSensitive"
})} {}
26
27
void
beginRun
(
const
edm::EventSetup
& es)
final
{
hgcons_
= es.getHandle(
hgcToken_
); }
28
29
std::unique_ptr<SensitiveDetector>
make
(
const
std::string
& iname,
30
const
SensitiveDetectorCatalog
& clg,
31
const
edm::ParameterSet
& p,
32
const
SimTrackManager
* man,
33
SimActivityRegistry
& reg)
const
final
{
34
auto
hgc = ((iname.find(
"HitsHEback"
) != std::string::npos) &&
hgcons_
.
isValid
()) ?
hgcons_
.
product
() :
nullptr
;
35
auto
sd
= std::make_unique<HGCScintSD>(iname, hgc, clg,
p
, man);
36
SimActivityRegistryEnroller::enroll
(reg,
sd
.get());
37
return
sd
;
38
}
39
40
private
:
41
const
edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>
hgcToken_
;
42
edm::ESHandle<HGCalDDDConstants>
hgcons_
;
43
};
44
45
typedef
HGCScintSD
HGCScintillatorSensitiveDetector
;
46
DEFINE_SENSITIVEDETECTORBUILDER
(
HGCScintillatorSensitiveDetectorBuilder
,
HGCScintillatorSensitiveDetector
);
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition:
ConsumesCollector.h:97
HGCScintSD
Definition:
HGCScintSD.h:19
MessageLogger.h
edm::ESInputTag
Definition:
ESInputTag.h:87
HGCScintillatorSensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:27
HGCScintSD.h
SensitiveDetectorMakerBase
Definition:
SensitiveDetectorMakerBase.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ParameterSet.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition:
SimActivityRegistryEnroller.h:50
HGCScintillatorSensitiveDetectorBuilder::make
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry ®) const final
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:29
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord >
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition:
SensitiveDetectorPluginFactory.h:21
ESGetToken.h
edm::ESHandle< HGCalDDDConstants >
SensitiveDetectorPluginFactory.h
HGCScintillatorSensitiveDetector
HGCScintSD HGCScintillatorSensitiveDetector
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:45
ESHandle.h
HGCScintillatorSensitiveDetectorBuilder::HGCScintillatorSensitiveDetectorBuilder
HGCScintillatorSensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:24
edm::EventSetup
Definition:
EventSetup.h:59
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
HGCScintillatorSensitiveDetectorBuilder::hgcons_
edm::ESHandle< HGCalDDDConstants > hgcons_
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:42
edm::Transition::BeginRun
SimActivityRegistryEnroller.h
sd
double sd
Definition:
CascadeWrapper.h:113
HGCScintillatorSensitiveDetectorBuilder::hgcToken_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcToken_
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:41
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
IdealGeometryRecord.h
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
HGCScintillatorSensitiveDetectorBuilder
Definition:
HGCScintillatorSensitiveDetectorBuilder.cc:22
HGCalDDDConstants.h
edm::ParameterSet
Definition:
ParameterSet.h:47
SimActivityRegistry
Definition:
SimActivityRegistry.h:39
edm::ESHandleBase::isValid
bool isValid() const
Definition:
ESHandle.h:44
ModuleDef.h
ConsumesCollector.h
SensitiveDetectorMakerBase.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
SimTrackManager
Definition:
SimTrackManager.h:35
Generated for CMSSW Reference Manual by
1.8.5