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
02470657
Commit
02470657
authored
10 years ago
by
Frank Gaede
Browse files
Options
Downloads
Patches
Plain Diff
- added debug define debug_memory_handling for Markus
parent
6d6ead26
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/lcio/Geant4Output2LCIO.cpp
+12
-6
12 additions, 6 deletions
DDG4/lcio/Geant4Output2LCIO.cpp
with
12 additions
and
6 deletions
DDG4/lcio/Geant4Output2LCIO.cpp
+
12
−
6
View file @
02470657
...
...
@@ -16,6 +16,7 @@
// lcio include files
#include
"lcio.h"
#include
"IO/LCWriter.h"
#include
"IMPL/LCEventImpl.h"
/*
* DD4hep namespace declaration
...
...
@@ -158,9 +159,12 @@ void Geant4Output2LCIO::begin(const G4Event* event){
//fg: fixme: should be this call taking ownership of the LCEvent
// deleting it at the end - however does not seem to work
// see fixme in Geant4Output2LCIO::saveCollection() below
//context()->event().addExtension<lcio::LCEventImpl>( e , 1 );
context
()
->
event
().
addExtension
<
lcio
::
LCEventImpl
>
(
e
,
0
);
//#define debug_memory_handling
#ifdef debug_memory_handling
context
()
->
event
().
addExtension
<
lcio
::
LCEventImpl
>
(
e
,
1
);
#else
context
()
->
event
().
addExtension
<
lcio
::
LCEventImpl
>
(
e
,
0
);
#endif
}
...
...
@@ -187,9 +191,11 @@ void Geant4Output2LCIO::saveCollection(OutputContext<G4Event>& ctxt, G4VHitsColl
lcio
::
LCCollectionVec
*
col
=
cnv
(
_A
(
m_volMgr
,
collection
));
evt
->
addCollection
(
col
,
hc_nam
);
}
#ifdef debug_memory_handling
//fg: fixme: for the memory handling with LCIO we need to take away the ownership from
// the Geant4HitCollection - however this creates a seg fault at the end of event...
// Geant4HitCollection* g4hcol = (Geant4HitCollection* ) collection ;
// std::vector<void*> v ;
// g4hcol->releaseHitsUnchecked(v) ;
Geant4HitCollection
*
g4hcol
=
(
Geant4HitCollection
*
)
collection
;
std
::
vector
<
void
*>
v
;
g4hcol
->
releaseHitsUnchecked
(
v
)
;
#endif
}
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