src
SimG4Core
Notification
src
GenParticleInfoExtractor.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Notification/interface/GenParticleInfoExtractor.h
"
2
#include "G4PrimaryParticle.hh"
3
4
const
GenParticleInfo
&
GenParticleInfoExtractor::operator()
(
const
G4PrimaryParticle *
p
)
const
{
5
G4VUserPrimaryParticleInformation *
up
=
p
->GetUserInformation();
6
GenParticleInfo
*gpi =
dynamic_cast<
GenParticleInfo
*
>
(
up
);
7
if
(
up
==
nullptr
) {
8
G4Exception(
"SimG4Core/Notification"
,
9
"mc001"
,
10
FatalException,
11
"GenParticleInfoExtractor: G4PrimaryParticle has no user information"
);
12
}
else
if
(gpi ==
nullptr
) {
13
G4Exception(
"SimG4Core/Notification"
,
14
"mc001"
,
15
FatalException,
16
"GenParticleInfoExtractor: user information in G4PrimaryParticle is not of GenParticleInfo type"
);
17
}
18
// Silence Clang analyzer warning: G4Exception will be thrown if gpi is null
19
[[
clang::suppress
]]
return
*gpi;
20
}
up
Definition:
BitonicSort.h:7
GenParticleInfoExtractor::operator()
const GenParticleInfo & operator()(const G4PrimaryParticle *p) const
Definition:
GenParticleInfoExtractor.cc:4
GenParticleInfoExtractor.h
suppress
Definition:
GenABIO.cc:168
GenParticleInfo
Definition:
GenParticleInfo.h:6
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
Generated for CMSSW Reference Manual by
1.8.14