Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Pawian
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PWA
Pawian
Commits
f7c2e86f
Commit
f7c2e86f
authored
10 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
fixed memory leak in event generator
parent
baac1a93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Event/EventList.cc
+17
-0
17 additions, 0 deletions
Event/EventList.cc
Event/EventList.hh
+1
-0
1 addition, 0 deletions
Event/EventList.hh
PwaUtils/PwaGen.cc
+1
-4
1 addition, 4 deletions
PwaUtils/PwaGen.cc
with
19 additions
and
4 deletions
Event/EventList.cc
+
17
−
0
View file @
f7c2e86f
...
...
@@ -64,6 +64,23 @@ void EventList::removeEvents(unsigned int nBegin, unsigned int nEnd)
eventList
.
erase
(
eventList
.
begin
()
+
nBegin
,
eventList
.
begin
()
+
nEnd
);
}
void
EventList
::
removeAndDeleteEvents
(
unsigned
int
nBegin
,
unsigned
int
nEnd
)
{
if
(
nBegin
>
nEnd
||
eventList
.
size
()
<
nEnd
)
{
Alert
<<
"can not remove event no "
<<
nBegin
<<
" - "
<<
nEnd
<<
" from list"
<<
endmsg
;
exit
(
1
);
}
std
::
vector
<
Event
*>::
iterator
currentNonConstEvent
;
for
(
currentNonConstEvent
=
eventList
.
begin
();
currentNonConstEvent
!=
eventList
.
end
();
++
currentNonConstEvent
){
delete
*
currentNonConstEvent
;
(
*
currentNonConstEvent
)
=
0
;
}
eventList
.
erase
(
eventList
.
begin
()
+
nBegin
,
eventList
.
begin
()
+
nEnd
);
}
Event
*
EventList
::
nextEvent
()
{
...
...
This diff is collapsed.
Click to expand it.
Event/EventList.hh
+
1
−
0
View file @
f7c2e86f
...
...
@@ -37,6 +37,7 @@ public:
void
add
(
Event
*
);
void
removeEvents
(
unsigned
int
nBegin
,
unsigned
int
nEnd
);
void
removeAndDeleteEvents
(
unsigned
int
nBegin
,
unsigned
int
nEnd
);
Event
*
nextEvent
();
void
rewind
();
...
...
This diff is collapsed.
Click to expand it.
PwaUtils/PwaGen.cc
+
1
−
4
View file @
f7c2e86f
...
...
@@ -116,9 +116,6 @@ PwaGen::~PwaGen()
std
::
shared_ptr
<
EventList
>
PwaGen
::
GeneratePspEventList
(
unsigned
int
numEvents
){
bool
useMassRange
=
GlobalEnv
::
instance
()
->
Channel
()
->
useMassRange
();
// double massMin = GlobalEnv::instance()->Channel()->massRangeMin();
// double massMax = GlobalEnv::instance()->Channel()->massRangeMax();
// std::vector<unsigned int> particleIndices = GlobalEnv::instance()->Channel()->particleIndicesMassRange();
std
::
vector
<
std
::
shared_ptr
<
MassRangeCut
>
>
massRangeCuts
=
GlobalEnv
::
instance
()
->
Channel
()
->
massRangeCuts
();
std
::
vector
<
std
::
shared_ptr
<
MassRangeCut
>
>::
iterator
itMassRangeCut
;
...
...
@@ -235,7 +232,7 @@ void PwaGen::generate(std::shared_ptr<AbsLh> theLh, fitParams& theFitParams){
Info
<<
"Iteration "
<<
noOfIterations
<<
" finished. Accepted events:
\t
"
<<
noOfAcceptedEvts
<<
endmsg
;
currentEvtList
->
rewind
();
currentEvtList
->
removeEvents
(
0
,
currentEvtList
->
size
());
currentEvtList
->
remove
AndDelete
Events
(
0
,
currentEvtList
->
size
());
}
}
...
...
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