Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
SimG4Core
Notification
src
G4SimEvent.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Notification/interface/G4SimEvent.h
"
2
#include "
SimDataFormats/EncodedEventId/interface/EncodedEventId.h
"
3
4
#include "G4SystemOfUnits.hh"
5
6
class
IdSort
{
7
public
:
8
bool
operator()
(
const
SimTrack
&
a
,
const
SimTrack
&
b
) {
return
a
.trackId() <
b
.trackId(); }
9
};
10
11
G4SimEvent::G4SimEvent
()
12
: hepMCEvent(nullptr),
13
weight_(0),
14
collisionPoint_(
math
::
XYZTLorentzVectorD
(0., 0., 0., 0.)),
15
nparam_(0),
16
param_
(0) {}
17
18
G4SimEvent::~G4SimEvent
() {
19
// per suggestion by Chris Jones, it's faster
20
// that delete back() and pop_back()
21
//
22
unsigned
int
i
= 0;
23
24
for
(
i
= 0;
i
<
g4tracks
.size();
i
++) {
25
delete
g4tracks
[
i
];
26
g4tracks
[
i
] =
nullptr
;
27
}
28
g4tracks
.clear();
29
30
for
(
i
= 0;
i
<
g4vertices
.size();
i
++) {
31
delete
g4vertices
[
i
];
32
g4vertices
[
i
] =
nullptr
;
33
}
34
g4vertices
.clear();
35
}
36
37
void
G4SimEvent::load
(
edm::SimTrackContainer
&
c
)
const
{
38
for
(
unsigned
int
i
= 0;
i
<
g4tracks
.size();
i
++) {
39
G4SimTrack
* trk =
g4tracks
[
i
];
40
int
ip = trk->
part
();
41
math::XYZTLorentzVectorD
p
(
42
trk->
momentum
().x() /
GeV
, trk->
momentum
().y() /
GeV
, trk->
momentum
().z() /
GeV
, trk->
energy
() /
GeV
);
43
int
iv = trk->
ivert
();
44
int
ig = trk->
igenpart
();
45
int
id
= trk->
id
();
46
math::XYZVectorD
tkpos(trk->
trackerSurfacePosition
().x() / cm,
47
trk->
trackerSurfacePosition
().y() / cm,
48
trk->
trackerSurfacePosition
().z() / cm);
49
math::XYZTLorentzVectorD
tkmom(trk->
trackerSurfaceMomentum
().x() /
GeV
,
50
trk->
trackerSurfaceMomentum
().y() /
GeV
,
51
trk->
trackerSurfaceMomentum
().z() /
GeV
,
52
trk->
trackerSurfaceMomentum
().e() /
GeV
);
53
// ip = particle ID as PDG
54
// pp = 4-momentum
55
// iv = corresponding G4SimVertex index
56
// ig = corresponding GenParticle index
57
SimTrack
t
=
SimTrack
(ip,
p
, iv, ig, tkpos, tkmom);
58
t
.setTrackId(
id
);
59
t
.setEventId(
EncodedEventId
(0));
60
c
.push_back(
t
);
61
}
62
std::stable_sort(
c
.begin(),
c
.end(),
IdSort
());
63
}
64
65
void
G4SimEvent::load
(
edm::SimVertexContainer
&
c
)
const
{
66
for
(
unsigned
int
i
= 0;
i
<
g4vertices
.size();
i
++) {
67
G4SimVertex
*
vtx
=
g4vertices
[
i
];
68
//
69
// starting 1_1_0_pre3, SimVertex stores in cm !!!
70
//
71
math::XYZVectorD
v3(
vtx
->vertexPosition().x() / cm,
vtx
->vertexPosition().y() / cm,
vtx
->vertexPosition().z() / cm);
72
float
t
=
vtx
->vertexGlobalTime() /
second
;
73
int
iv =
vtx
->parentIndex();
74
// vv = position
75
// t = global time
76
// iv = index of the parent in the SimEvent SimTrack container (-1 if no parent)
77
SimVertex
v
=
SimVertex
(v3,
t
, iv,
i
);
78
v
.setProcessType(
vtx
->processType());
79
v
.setEventId(
EncodedEventId
(0));
80
c
.push_back(
v
);
81
}
82
}
mcMuonSeeds_cfi.SimTrack
SimTrack
Definition:
mcMuonSeeds_cfi.py:10
G4SimEvent::~G4SimEvent
virtual ~G4SimEvent()
Definition:
G4SimEvent.cc:18
G4SimEvent::g4tracks
std::vector< G4SimTrack * > g4tracks
Definition:
G4SimEvent.h:44
mps_fire.i
i
Definition:
mps_fire.py:355
G4SimVertex
Definition:
G4SimVertex.h:9
SimVertex
Definition:
SimVertex.h:5
G4SimTrack::ivert
int ivert() const
Definition:
G4SimTrack.h:61
G4SimEvent::G4SimEvent
G4SimEvent()
Definition:
G4SimEvent.cc:11
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition:
LorentzVector.h:14
G4SimEvent::load
void load(edm::SimTrackContainer &c) const
Definition:
G4SimEvent.cc:37
mcMuonSeeds_cfi.SimVertex
SimVertex
Definition:
mcMuonSeeds_cfi.py:11
edm::second
U second(std::pair< T, U > const &p)
Definition:
ParameterSet.cc:215
param_
struct @684 param_
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Definition:
SimpleZSPJPTJetCorrector.cc:16
G4SimTrack
Definition:
G4SimTrack.h:9
EncodedEventId
Definition:
EncodedEventId.h:11
G4SimTrack::momentum
const math::XYZVectorD & momentum() const
Definition:
G4SimTrack.h:59
G4SimTrack::energy
double energy() const
Definition:
G4SimTrack.h:60
OrderedSet.t
t
Definition:
OrderedSet.py:90
b
double b
Definition:
hdecay.h:118
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition:
badGlobalMuonTaggersAOD_cff.py:5
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition:
Vector3D.h:8
a
double a
Definition:
hdecay.h:119
G4SimTrack::igenpart
int igenpart() const
Definition:
G4SimTrack.h:62
G4SimEvent.h
GeV
const double GeV
Definition:
MathUtil.h:16
G4SimEvent::g4vertices
std::vector< G4SimVertex * > g4vertices
Definition:
G4SimEvent.h:45
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
IdSort::operator()
bool operator()(const SimTrack &a, const SimTrack &b)
Definition:
G4SimEvent.cc:8
G4SimTrack::part
int part() const
Definition:
G4SimTrack.h:58
G4SimTrack::trackerSurfaceMomentum
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
Definition:
G4SimTrack.h:67
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition:
SimTrackContainer.h:12
math
Definition:
choleskyInversion.h:19
SimTrack
Definition:
SimTrack.h:6
G4SimTrack::trackerSurfacePosition
const math::XYZVectorD & trackerSurfacePosition() const
Definition:
G4SimTrack.h:66
G4SimTrack::id
int id() const
Definition:
G4SimTrack.h:57
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition:
SimVertexContainer.h:12
IdSort
Definition:
G4SimEvent.cc:6
EncodedEventId.h
Generated for CMSSW Reference Manual by
1.8.16