SimG4Core
SensitiveDetector
src
AttachSD.cc
Go to the documentation of this file.
1
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h
"
2
#include "
SimG4Core/SensitiveDetector/interface/SensitiveDetector.h
"
3
#include "
SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h
"
4
#include "
SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h
"
5
#include "
SimG4Core/SensitiveDetector/interface/AttachSD.h
"
6
7
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
8
#include <string>
9
#include <sstream>
10
11
AttachSD::AttachSD
() {}
12
13
AttachSD::~AttachSD
() {}
14
15
std::pair<std::vector<SensitiveTkDetector*>, std::vector<SensitiveCaloDetector*> >
AttachSD::create
(
16
const
edm::EventSetup
& es,
17
const
SensitiveDetectorCatalog
& clg,
18
edm::ParameterSet
const
&
p
,
19
const
SimTrackManager
* man,
20
SimActivityRegistry
& reg)
const
{
21
std::pair<std::vector<SensitiveTkDetector*>, std::vector<SensitiveCaloDetector*> > detList;
22
const
std::vector<std::string_view>& rouNames = clg.
readoutNames
();
23
edm::LogVerbatim
(
"SimG4CoreSensitiveDetector"
) <<
" AttachSD: Initialising "
<< rouNames.size() <<
" SDs"
;
24
for
(
auto
&
rname
: rouNames) {
25
std::string_view
className
= clg.
className
({
rname
.data(),
rname
.size()});
26
std::unique_ptr<SensitiveDetectorMakerBase>
temp
{
27
SensitiveDetectorPluginFactory::get
()->create({
className
.data(),
className
.size()})};
28
29
std::unique_ptr<SensitiveDetector>
sd
{
temp
->make({
rname
.data(),
rname
.size()}, es, clg,
p
, man, reg)};
30
31
std::stringstream
ss
;
32
ss
<<
" AttachSD: created a "
<<
className
<<
" with name "
<<
rname
;
33
34
if
(
sd
->isCaloSD()) {
35
detList.second.push_back(static_cast<SensitiveCaloDetector*>(
sd
.release()));
36
ss
<<
" + calo SD"
;
37
}
else
{
38
detList.first.push_back(static_cast<SensitiveTkDetector*>(
sd
.release()));
39
ss
<<
" + tracking SD"
;
40
}
41
edm::LogVerbatim
(
"SimG4CoreSensitiveDetector"
) <<
ss
.str();
42
}
43
return
detList;
44
}
SimTrackManager
Definition:
SimTrackManager.h:35
MessageLogger.h
SensitiveCaloDetector.h
SensitiveDetectorCatalog::className
std::string_view className(const std::string &readoutName) const
Definition:
SensitiveDetectorCatalog.cc:44
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
AttachSD::AttachSD
AttachSD()
Definition:
AttachSD.cc:11
AttachSD::create
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry ®) const
Definition:
AttachSD.cc:15
groupFilesInBlocks.temp
list temp
Definition:
groupFilesInBlocks.py:142
SensitiveTkDetector.h
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
AttachSD::~AttachSD
~AttachSD()
Definition:
AttachSD.cc:13
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
edm::ParameterSet
Definition:
ParameterSet.h:47
rname
const G4String rname[NREG]
Definition:
ParametrisedEMPhysics.cc:48
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
AttachSD.h
SimActivityRegistry
Definition:
SimActivityRegistry.h:43
SensitiveDetector.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
SensitiveDetectorCatalog::readoutNames
const std::vector< std::string_view > readoutNames(const std::string &className) const
Definition:
SensitiveDetectorCatalog.cc:27
className
std::string className(const T &t)
Definition:
ClassName.h:31
sd
double sd
Definition:
CascadeWrapper.h:113
SensitiveDetectorPluginFactory.h
Generated for CMSSW Reference Manual by
1.8.16