GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » How to remove a candidate
Re: How to remove a candidate [message #14551 is a reply to message #14550] Wed, 27 March 2013 18:02 Go to previous messageGo to previous message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *
Hi Stefano,

your concern ist correct. The removal process will be bugged. Let me point you to a forum message I wrote some time ago exactly concerning that topic

To do it correctly you can either store the length of the list beforehand like

  Int_t n=l.GetLength();
  for (l=0; l<n; ++l)  
    i = l-n_removed;
    if( ... Some criterion ...)
      list.Remove( list[i] );

or (suggested by Radek) loop reversely through the list with

  for (ii=l.GetLength()-1 ; ii>=0; --ii)

Or, as you mention, fill a new empty list with the non-removed candidates.

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: analysis performance and PID criteria
Next Topic: Problem with 4C-fit
Goto Forum:

Current Time: Thu Jul 07 10:22:57 CEST 2022

Total time taken to generate the page: 0.00991 seconds