Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
729e4baa
Commit
729e4baa
authored
8 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Include changes from Frank
parent
89c144a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DDG4/lcio/LCIOEventReader.cpp
+12
-12
12 additions, 12 deletions
DDG4/lcio/LCIOEventReader.cpp
DDG4/plugins/Geant4EventReaderHepEvt.cpp
+25
-17
25 additions, 17 deletions
DDG4/plugins/Geant4EventReaderHepEvt.cpp
DDRec/include/DDRec/API/IDDecoder.h
+0
-1
0 additions, 1 deletion
DDRec/include/DDRec/API/IDDecoder.h
with
37 additions
and
30 deletions
DDG4/lcio/LCIOEventReader.cpp
+
12
−
12
View file @
729e4baa
...
@@ -75,14 +75,13 @@ LCIOEventReader::readParticles(int event_number,
...
@@ -75,14 +75,13 @@ LCIOEventReader::readParticles(int event_number,
if
(
NHEP
==
0
)
return
EVENT_READER_NO_PRIMARIES
;
if
(
NHEP
==
0
)
return
EVENT_READER_NO_PRIMARIES
;
//fg: for now we create exactly one event vertex here ( as before )
//fg: for now we create exactly one event vertex here ( as before )
// and fill it below from the first final state particle
Geant4Vertex
*
vtx
=
new
Geant4Vertex
;
Geant4Vertex
*
vtx
=
new
Geant4Vertex
;
vertices
.
push_back
(
vtx
);
vertices
.
push_back
(
vtx
);
vtx
->
x
=
0
;
vtx
->
x
=
0
;
vtx
->
y
=
0
;
vtx
->
y
=
0
;
vtx
->
z
=
0
;
vtx
->
z
=
0
;
vtx
->
time
=
0
;
vtx
->
time
=
0
;
bool
haveVertex
=
tru
e
;
//
bool haveVertex =
fals
e ;
mcpcoll
.
resize
(
NHEP
,
0
);
mcpcoll
.
resize
(
NHEP
,
0
);
...
@@ -139,19 +138,20 @@ LCIOEventReader::readParticles(int event_number,
...
@@ -139,19 +138,20 @@ LCIOEventReader::readParticles(int event_number,
<<
genStatus
<<
" -> ignored ! "
<<
endl
;
<<
genStatus
<<
" -> ignored ! "
<<
endl
;
}
}
//fixme: need to define the correct logic for selecting the particle to use
// for the _one_ event vertex
// fill vertex information from first stable particle
// fill vertex information from first stable particle
if
(
!
haveVertex
&&
genStatus
==
1
){
//
if( !haveVertex && genStatus == 1 ){
vtx
->
x
=
p
->
vsx
;
//
vtx->x = p->vsx ;
vtx
->
y
=
p
->
vsy
;
//
vtx->y = p->vsy ;
vtx
->
z
=
p
->
vsz
;
//
vtx->z = p->vsz ;
vtx
->
time
=
p
->
time
;
//
vtx->time = p->time ;
haveVertex
=
fals
e
;
//
haveVertex =
tru
e ;
}
//
}
if
(
p
->
parents
.
size
()
==
0
)
{
if
(
p
->
parents
.
size
()
==
0
)
{
PropertyMask
st
(
p
->
status
);
if
(
status
.
isSet
(
G4PARTICLE_GEN_EMPTY
)
||
status
.
isSet
(
G4PARTICLE_GEN_DOCUMENTATION
)
)
if
(
st
.
isSet
(
G4PARTICLE_GEN_EMPTY
)
||
st
.
isSet
(
G4PARTICLE_GEN_DOCUMENTATION
)
)
vtx
->
in
.
insert
(
p
->
id
);
// Beam particles and primary quarks etc
vtx
->
in
.
insert
(
p
->
id
);
// Beam particles and primary quarks etc.
else
else
vtx
->
out
.
insert
(
p
->
id
);
// Stuff, to be given to Geant4 together with daughters
vtx
->
out
.
insert
(
p
->
id
);
// Stuff, to be given to Geant4 together with daughters
}
}
...
...
This diff is collapsed.
Click to expand it.
DDG4/plugins/Geant4EventReaderHepEvt.cpp
+
25
−
17
View file @
729e4baa
...
@@ -159,24 +159,30 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
...
@@ -159,24 +159,30 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
//
//
// Read the event, check for errors
// Read the event, check for errors
//
//
int
NHEP
;
// number of entries
unsigned
NHEP
(
0
)
;
// number of entries
m_input
>>
NHEP
;
m_input
>>
NHEP
;
if
(
m_input
.
eof
()
)
{
//
if
(
m_input
.
eof
()
){
return
EVENT_READER_IO_ERROR
;
}
// End of File :: ??? Exception ???
// -> FG: EOF is not an exception as it happens for every file at the end !
return
EVENT_READER_IO_ERROR
;
//check loop variable read from input file and chack that is reasonable
// should fix coverity issue: "Using tainted variable NHEP as a loop boundary."
if
(
NHEP
>
1e6
){
printout
(
ERROR
,
"EventReaderHepEvt::readParticles"
,
"Cannot read in more than million particles, but %d requested"
,
NHEP
);
return
EVENT_READER_IO_ERROR
;
}
}
//fg: for now we create exactly one event vertex here ( as before )
//fg: for now we create exactly one event vertex here ( as before )
// and fill it below from the first final state particle
Geant4Vertex
*
vtx
=
new
Geant4Vertex
;
Geant4Vertex
*
vtx
=
new
Geant4Vertex
;
vertices
.
push_back
(
vtx
);
vertices
.
push_back
(
vtx
);
vtx
->
x
=
0
;
vtx
->
x
=
0
;
vtx
->
y
=
0
;
vtx
->
y
=
0
;
vtx
->
z
=
0
;
vtx
->
z
=
0
;
vtx
->
time
=
0
;
vtx
->
time
=
0
;
bool
haveVertex
=
false
;
// bool haveVertex = false ;
//
//
// Loop over particles
// Loop over particles
int
ISTHEP
(
0
);
// status code
int
ISTHEP
(
0
);
// status code
...
@@ -198,7 +204,7 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
...
@@ -198,7 +204,7 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
vector
<
int
>
daughter1
;
vector
<
int
>
daughter1
;
vector
<
int
>
daughter2
;
vector
<
int
>
daughter2
;
for
(
int
IHEP
=
0
;
IHEP
<
NHEP
;
IHEP
++
)
{
for
(
unsigned
IHEP
=
0
;
IHEP
<
NHEP
;
IHEP
++
)
{
if
(
m_format
==
HEPEvtShort
)
if
(
m_format
==
HEPEvtShort
)
m_input
>>
ISTHEP
>>
IDHEP
>>
JDAHEP1
>>
JDAHEP2
m_input
>>
ISTHEP
>>
IDHEP
>>
JDAHEP1
>>
JDAHEP2
>>
PHEP1
>>
PHEP2
>>
PHEP3
>>
PHEP5
;
>>
PHEP1
>>
PHEP2
>>
PHEP3
>>
PHEP5
;
...
@@ -252,14 +258,16 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
...
@@ -252,14 +258,16 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
else
if
(
ISTHEP
==
3
)
status
.
set
(
G4PARTICLE_GEN_DOCUMENTATION
);
else
if
(
ISTHEP
==
3
)
status
.
set
(
G4PARTICLE_GEN_DOCUMENTATION
);
else
status
.
set
(
G4PARTICLE_GEN_DOCUMENTATION
);
else
status
.
set
(
G4PARTICLE_GEN_DOCUMENTATION
);
//fixme: need to define the correct logic for selecting the particle to use
// for the _one_ event vertex
// fill vertex information from first stable particle
// fill vertex information from first stable particle
if
(
!
haveVertex
&&
ISTHEP
==
1
){
//
if( !haveVertex && ISTHEP == 1 ){
vtx
->
x
=
p
->
vsx
;
//
vtx->x = p->vsx ;
vtx
->
y
=
p
->
vsy
;
//
vtx->y = p->vsy ;
vtx
->
z
=
p
->
vsz
;
//
vtx->z = p->vsz ;
vtx
->
time
=
p
->
time
;
//
vtx->time = p->time ;
haveVertex
=
true
;
//
haveVertex = true ;
}
//
}
//
//
// Keep daughters information for later
// Keep daughters information for later
...
@@ -277,7 +285,7 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
...
@@ -277,7 +285,7 @@ Geant4EventReaderHepEvt::readParticles(int /* event_number */,
// information, and this utility assumes all parents listed are
// information, and this utility assumes all parents listed are
// parents and all daughters listed are daughters
// parents and all daughters listed are daughters
//
//
for
(
int
IHEP
=
0
;
IHEP
<
NHEP
;
IHEP
++
)
{
for
(
unsigned
IHEP
=
0
;
IHEP
<
NHEP
;
IHEP
++
)
{
struct
ParticleHandler
{
struct
ParticleHandler
{
Particle
*
m_part
;
Particle
*
m_part
;
ParticleHandler
(
Particle
*
p
)
:
m_part
(
p
)
{}
ParticleHandler
(
Particle
*
p
)
:
m_part
(
p
)
{}
...
...
This diff is collapsed.
Click to expand it.
DDRec/include/DDRec/API/IDDecoder.h
+
0
−
1
View file @
729e4baa
...
@@ -150,7 +150,6 @@ public:
...
@@ -150,7 +150,6 @@ public:
protected
:
protected
:
Geometry
::
VolumeManager
_volumeManager
;
Geometry
::
VolumeManager
_volumeManager
;
TGeoManager
*
_tgeoMgr
;
/// Helper method to find the corresponding Readout object to a DetElement
/// Helper method to find the corresponding Readout object to a DetElement
Geometry
::
Readout
findReadout
(
const
Geometry
::
DetElement
&
det
)
const
;
Geometry
::
Readout
findReadout
(
const
Geometry
::
DetElement
&
det
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment