/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
//
// BEGIN_HTML
// RooLinkedList is an collection class for internal use, storing
// a collection of RooAbsArg pointers in a doubly linked list.
// It can optionally add a hash table to speed up random access
// in large collections
// Use RooAbsCollection derived objects for public use
// (e.g. RooArgSet or RooArgList) 
// END_HTML
//

#include <algorithm>

#include "RooFit.h"
#include "Riostream.h"

#include "RooLinkedList.h"
#include "RooLinkedListIter.h"
#include "RooHashTable.h"
#include "RooAbsArg.h"
#include "RooMsgService.h"

using namespace std;

ClassImp(RooLinkedList)
;
namespace RooLinkedListImplDetails {
  /// a chunk of memory in a pool for quick allocation of RooLinkedListElems
  class Chunk {
    public:
      /// constructor
      Chunk(Int_t sz) :
	_sz(sz), _free(capacity()),
	_chunk(new RooLinkedListElem[_free]), _freelist(_chunk)
      {
	//cout << "RLLID::Chunk ctor(" << this << ") of size " << _free << " list elements" << endl ;
	// initialise free list
	for (Int_t i = 0; i < _free; ++i)
	  _chunk[i]._next = (i + 1 < _free) ? &_chunk[i + 1] : 0;
      }
      /// destructor
      ~Chunk() { delete[] _chunk; }
      /// chunk capacity
      Int_t capacity() const
      { return (1 << _sz) / sizeof(RooLinkedListElem); }
      /// chunk free elements
      Int_t free() const { return _free; }
      /// chunk occupied elements
      Int_t size() const { return capacity() - free(); }
      /// return size class
      int szclass() const { return _sz; }
      /// chunk full?
      bool full() const { return !free(); }
      /// chunk empty?
      bool empty() const { return capacity() == free(); }
      /// return address of chunk
      const void* chunkaddr() const { return _chunk; }
      /// check if el is in this chunk
      bool contains(RooLinkedListElem* el) const
      { return _chunk <= el && el < &_chunk[capacity()]; }
      /// pop a free element off the free list
      RooLinkedListElem* pop_free_elem()
      {
	if (!_freelist) return 0;
	RooLinkedListElem* retVal = _freelist;
	_freelist = retVal->_next;
	retVal->_arg = 0; retVal->_refCount = 0;
	retVal->_prev = retVal->_next = 0;
	--_free;
	return retVal;
      }
      /// push a free element back onto the freelist
      void push_free_elem(RooLinkedListElem* el)
      {
	el->_next = _freelist;
	_freelist = el;
	++_free;
      }
    private:
      Int_t _sz;				///< chunk capacity
      Int_t _free;			///< length of free list
      RooLinkedListElem* _chunk;		///< chunk from which elements come
      RooLinkedListElem* _freelist;	///< list of free elements

      /// forbid copying
      Chunk(const Chunk&);
      // forbid assignment
      Chunk& operator=(const Chunk&);
  };

  class Pool {
    private:
      enum {
	minsz = 7, ///< minimum chunk size (just below 1 << minsz bytes)
	maxsz = 18, ///< maximum chunk size (just below 1 << maxsz bytes)
	szincr = 1 ///< size class increment (sz = 1 << (minsz + k * szincr))
      };
      /// a chunk of memory in the pool
      typedef RooLinkedListImplDetails::Chunk Chunk;
      typedef std::list<Chunk*> ChunkList;
      typedef std::map<const void*, Chunk*> AddrMap;
    public:
      /// constructor
      Pool();
      /// destructor
      ~Pool();
      /// acquire the pool
      inline void acquire() { ++_refCount; }
      /// release the pool, return true if the pool is unused
      inline bool release() { return 0 == --_refCount; }
      /// pop a free element out of the pool
      RooLinkedListElem* pop_free_elem();
      /// push a free element back into the pool
      void push_free_elem(RooLinkedListElem* el);
    private:
      AddrMap _addrmap;
      ChunkList _freelist;
      UInt_t _szmap[(maxsz - minsz) / szincr];
      Int_t _cursz;
      UInt_t _refCount;

      /// adjust _cursz to current largest block
      void updateCurSz(Int_t sz, Int_t incr);
      /// find size of next chunk to allocate (in a hopefully smart way)
      Int_t nextChunkSz() const;
  };
  
  Pool::Pool() : _cursz(minsz), _refCount(0)
  {
    std::fill(_szmap, _szmap + ((maxsz - minsz) / szincr), 0);
  }

  Pool::~Pool()
  {
    _freelist.clear();
    for (AddrMap::iterator it = _addrmap.begin(); _addrmap.end() != it; ++it)
      delete it->second;
    _addrmap.clear();
  }

  RooLinkedListElem* Pool::pop_free_elem()
  {
    if (_freelist.empty()) {
      // allocate and register new chunk and put it on the freelist
      const Int_t sz = nextChunkSz();
      Chunk *c = new Chunk(sz);
      _addrmap[c->chunkaddr()] = c;
      _freelist.push_back(c);
      updateCurSz(sz, +1);
    }
    // get free element from first chunk on _freelist
    Chunk* c = _freelist.front();
    RooLinkedListElem* retVal = c->pop_free_elem();
    // full chunks are removed from _freelist
    if (c->full()) _freelist.pop_front();
    return retVal;
  }

  void Pool::push_free_elem(RooLinkedListElem* el)
  {
    // find from which chunk el came
    AddrMap::iterator ci = _addrmap.end();
    if (!_addrmap.empty()) {
      ci = _addrmap.lower_bound(el);
      if (ci == _addrmap.end()) {
	// point beyond last element, so get last one
	ci = (++_addrmap.rbegin()).base();
      } else {
	// valid ci, check if we need to decrement ci because el isn't the
	// first element in the chunk
	if (_addrmap.begin() != ci && ci->first != el) --ci;
      }
    }
    // either empty addressmap, or ci should now point to the chunk which might
    // contain el
    if (_addrmap.empty() || !ci->second->contains(el)) {
      // el is not in any chunk we know about, so just delete it
      delete el;
      return;
    }
    Chunk *c = ci->second;
    const bool moveToFreelist = c->full();
    c->push_free_elem(el);
    if (c->empty()) {
      // delete chunk if all empty
      ChunkList::iterator it = std::find( _freelist.begin(), _freelist.end(), c);
      if (_freelist.end() != it) _freelist.erase(it);
      _addrmap.erase(ci->first);
      updateCurSz(c->szclass(), -1);
      delete c;
    } else if (moveToFreelist) {
      _freelist.push_back(c);
    }
  }

  void Pool::updateCurSz(Int_t sz, Int_t incr)
  {
    _szmap[(sz - minsz) / szincr] += incr;
    _cursz = minsz;
    for (int i = (maxsz - minsz) / szincr; i--; ) {
      if (_szmap[i]) {
	_cursz += i * szincr;
	break;
      }
    }
  }

  Int_t Pool::nextChunkSz() const
  {
    // no chunks with space available, figure out chunk size
    Int_t sz = _cursz;
    if (_addrmap.empty()) {
      // if we start allocating chunks, we start from minsz
      sz = minsz;
    } else {
      if (minsz >= sz) {
	// minimal sized chunks are always grown
	sz = minsz + szincr;
      } else {
	if (1 != _addrmap.size()) {
	  // if we have more than one completely filled chunk, grow
	  sz += szincr;
	} else {
	  // just one chunk left, try shrinking chunk size
	  sz -= szincr;
	}
      }
    }
    // clamp size to allowed range
    if (sz > maxsz) sz = maxsz;
    if (sz < minsz) sz = minsz;
    return sz;
  }
}

RooLinkedList::Pool* RooLinkedList::_pool = 0;

//_____________________________________________________________________________
RooLinkedList::RooLinkedList(Int_t htsize) : 
  _hashThresh(htsize), _size(0), _first(0), _last(0), _htableName(0), _htableLink(0), _useNptr(kTRUE)
{
  if (!_pool) _pool = new Pool;
  _pool->acquire();
}

//_____________________________________________________________________________
RooLinkedList::RooLinkedList(const RooLinkedList& other) :
  TObject(other), _hashThresh(other._hashThresh), _size(0), _first(0), _last(0), _htableName(0), _htableLink(0), 
  _name(other._name), 
  _useNptr(other._useNptr)
{
  // Copy constructor
  if (!_pool) _pool = new Pool;
  _pool->acquire();
  if (other._htableName) _htableName = new RooHashTable(other._htableName->size()) ;
  if (other._htableLink) _htableLink = new RooHashTable(other._htableLink->size(),RooHashTable::Pointer) ;
  for (RooLinkedListElem* elem = other._first; elem; elem = elem->_next) {
    Add(elem->_arg, elem->_refCount) ;
  }
}

//_____________________________________________________________________________
RooLinkedListElem* RooLinkedList::createElement(TObject* obj, RooLinkedListElem* elem) 
{
//   cout << "RooLinkedList::createElem(" << this << ") obj = " << obj << " elem = " << elem << endl ;
  RooLinkedListElem* ret = _pool->pop_free_elem();
  ret->init(obj, elem);
  return ret ;
}

//_____________________________________________________________________________
void RooLinkedList::deleteElement(RooLinkedListElem* elem) 
{  
  elem->release() ;
  _pool->push_free_elem(elem);
  //delete elem ;
}

//_____________________________________________________________________________
RooLinkedList& RooLinkedList::operator=(const RooLinkedList& other) 
{
  // Assignment operator, copy contents from 'other'
  
  // Prevent self-assignment
  if (&other==this) return *this ;
  
  // remove old elements
  Clear();
  // Copy elements
  for (RooLinkedListElem* elem = other._first; elem; elem = elem->_next) {
    Add(elem->_arg) ;
  }    
  
  return *this ;
}

//_____________________________________________________________________________
void RooLinkedList::setHashTableSize(Int_t size) 
{        
  // Change the threshold for hash-table use to given size.
  // If a hash table exists when this method is called, it is regenerated.

  if (size<0) {
    coutE(InputArguments) << "RooLinkedList::setHashTable() ERROR size must be positive" << endl ;
    return ;
  }
  if (size==0) {
    if (!_htableName) {
      // No hash table present
      return ;
    } else {
      // Remove existing hash table
      delete _htableName ;
      delete _htableLink ;
      _htableName = 0 ;
      _htableLink = 0 ;
    }
  } else {
    
    // (Re)create hash tables
    if (_htableName) delete _htableName ;
    _htableName = new RooHashTable(size) ;

     if (_htableLink) delete _htableLink ;
     _htableLink = new RooHashTable(size,RooHashTable::Pointer) ;
    
    // Fill hash table with existing entries
    RooLinkedListElem* ptr = _first ;
    while(ptr) {
      _htableName->add(ptr->_arg) ;
      _htableLink->add((TObject*)ptr,ptr->_arg) ;
      ptr = ptr->_next ;
    }      
  }
}

//_____________________________________________________________________________
RooLinkedList::~RooLinkedList() 
{
  // Destructor

  if (_htableName) {
    delete _htableName ;
    _htableName=0 ;
  }
  if (_htableLink) {
    delete _htableLink ;
    _htableLink=0 ;
  }
  
  Clear() ;
  if (_pool->release()) {
    delete _pool;
    _pool = 0;
  }
}

//_____________________________________________________________________________
RooLinkedListElem* RooLinkedList::findLink(const TObject* arg) const 
{    
  // Find the element link containing the given object

  if (_htableLink) {
    return _htableLink->findLinkTo(arg) ;  
  }
  
  RooLinkedListElem* ptr = _first;
  while(ptr) {
    if (ptr->_arg == arg) {
      return ptr ;
    }
    ptr = ptr->_next ;
  }
  return 0 ;
  
}

//_____________________________________________________________________________
void RooLinkedList::Add(TObject* arg, Int_t refCount)
{
  // Insert object into collection with given reference count value

  if (!arg) return ;

  // Only use RooAbsArg::namePtr() in lookup-by-name if all elements have it
  if (!dynamic_cast<RooAbsArg*>(arg)) _useNptr = kFALSE;
  
  // Add to hash table 
  if (_htableName) {

    // Expand capacity of hash table if #entries>#slots
    if (_size > _htableName->size()) {
      setHashTableSize(_size*2) ;
    }

  } else if (_hashThresh>0 && _size>_hashThresh) {

    setHashTableSize(_hashThresh) ;
  }  

  if (_last) {
    // Append element at end of list
    _last = createElement(arg,_last) ;
  } else {
    // Append first element, set first,last 
    _last = createElement(arg) ;
    _first=_last ;
  }

  if (_htableName){
    //cout << "storing link " << _last << " with hash arg " << arg << endl ;
    _htableName->add(arg) ;
    _htableLink->add((TObject*)_last,arg) ;
  }

  _size++ ;
  _last->_refCount = refCount ;
  
}

//_____________________________________________________________________________
Bool_t RooLinkedList::Remove(TObject* arg) 
{
  // Remove object from collection

  // Find link element
  RooLinkedListElem* elem = findLink(arg) ;
  if (!elem) return kFALSE ;
  
  // Remove from hash table
  if (_htableName) {
    _htableName->remove(arg) ;
  }
  if (_htableLink) {
    _htableLink->remove((TObject*)elem,arg) ;
  }
  
  // Update first,last if necessary
  if (elem==_first) _first=elem->_next ;
  if (elem==_last) _last=elem->_prev ;
  
  // Delete and shrink
  _size-- ;
  deleteElement(elem) ;	
  return kTRUE ;
}

//_____________________________________________________________________________
TObject* RooLinkedList::At(Int_t index) const 
{
  // Return object stored in sequential position given by index.
  // If index is out of range, a null pointer is returned.

  // Check range
  if (index<0 || index>=_size) return 0 ;

  
  // Walk list
  RooLinkedListElem* ptr = _first;
  while(index--) ptr = ptr->_next ;
  
  // Return arg
  return ptr->_arg ;
}

//_____________________________________________________________________________
Bool_t RooLinkedList::Replace(const TObject* oldArg, const TObject* newArg) 
{
  // Replace object 'oldArg' in collection with new object 'newArg'.
  // If 'oldArg' is not found in collection kFALSE is returned

  // Find existing element and replace arg
  RooLinkedListElem* elem = findLink(oldArg) ;
  if (!elem) return kFALSE ;
  
  if (_htableName) {
    _htableName->replace(oldArg,newArg) ;
  }
  if (_htableLink) {
    // Link is hashed by contents and may change slot in hash table
    _htableLink->remove((TObject*)elem,(TObject*)oldArg) ;
    _htableLink->add((TObject*)elem,(TObject*)newArg) ;
  }

  elem->_arg = (TObject*)newArg ;
  return kTRUE ;
}

//_____________________________________________________________________________
TObject* RooLinkedList::FindObject(const char* name) const 
{
  // Return pointer to obejct with given name. If no such object
  // is found return a null pointer

  return find(name) ;
}

//_____________________________________________________________________________
TObject* RooLinkedList::FindObject(const TObject* obj) const 
{
  // Find object in list. If list contains object return 
  // (same) pointer to object, otherwise return null pointer

  RooLinkedListElem *elem = findLink((TObject*)obj) ;
  return elem ? elem->_arg : 0 ;
}

//_____________________________________________________________________________
void RooLinkedList::Clear(Option_t *) 
{
  // Remove all elements from collection

  for (RooLinkedListElem *elem = _first, *next; elem; elem = next) {
    next = elem->_next ;
    deleteElement(elem) ;
  }
  _first = 0 ;
  _last = 0 ;
  _size = 0 ;
  
  if (_htableName) {
    Int_t hsize = _htableName->size() ;
    delete _htableName ;
    _htableName = new RooHashTable(hsize) ;   
  }
  if (_htableLink) {
    Int_t hsize = _htableLink->size() ;
    delete _htableLink ;
    _htableLink = new RooHashTable(hsize,RooHashTable::Pointer) ;       
  }
}

//_____________________________________________________________________________
void RooLinkedList::Delete(Option_t *) 
{
  // Remove all elements in collection and delete all elements
  // NB: Collection does not own elements, this function should
  // be used judiciously by caller. 

  RooLinkedListElem* elem = _first;
  while(elem) {
    RooLinkedListElem* next = elem->_next ;
    delete elem->_arg ;
    deleteElement(elem) ;
    elem = next ;
  }
  _first = 0 ;
  _last = 0 ;
  _size = 0 ;

  if (_htableName) {
    Int_t hsize = _htableName->size() ;
    delete _htableName ;
    _htableName = new RooHashTable(hsize) ;   
  }
  if (_htableLink) {
    Int_t hsize = _htableLink->size() ;
    delete _htableLink ;
    _htableLink = new RooHashTable(hsize,RooHashTable::Pointer) ;       
  }
}

//_____________________________________________________________________________
TObject* RooLinkedList::find(const char* name) const 
{
  // Return pointer to object with given name in collection.
  // If no such object is found, return null pointer.

  
  if (_htableName) {
    RooAbsArg* a = (RooAbsArg*) _htableName->find(name) ;
    // RooHashTable::find could return false negative if element was renamed to 'name'.
    // The list search means it won't return false positive, so can return here.
    if (a) return a;
    if (_useNptr) {
      // See if it might have been renamed
      const TNamed* nptr= RooNameReg::known(name);
      //cout << "RooLinkedList::find: possibly renamed '" << name << "', kRenamedArg=" << (nptr&&nptr->TestBit(RooNameReg::kRenamedArg)) << endl;
      if (nptr && nptr->TestBit(RooNameReg::kRenamedArg)) {
        RooLinkedListElem* ptr = _first ;
        while(ptr) {
          if ((((RooAbsArg*)ptr->_arg)->namePtr() == nptr)) {
            return ptr->_arg ;
          }
          ptr = ptr->_next ;
        }
      }
      return 0 ;
    }
    //cout << "RooLinkedList::find: possibly renamed '" << name << "'" << endl;
  }

  RooLinkedListElem* ptr = _first ;

  // The penalty for RooNameReg lookup seems to be outweighted by the faster search
  // when the size list is longer than ~7, but let's be a bit conservative.
  if (_useNptr && _size>9) {
    const TNamed* nptr= RooNameReg::known(name);
    if (!nptr) return 0;
    
    while(ptr) {
      if ((((RooAbsArg*)ptr->_arg)->namePtr() == nptr)) {
	return ptr->_arg ;
      }
      ptr = ptr->_next ;
    }
    return 0 ;
  }
  
  while(ptr) {
    if (!strcmp(ptr->_arg->GetName(),name)) {      
      return ptr->_arg ;
    }
    ptr = ptr->_next ;
  }
  return 0 ;
}

//_____________________________________________________________________________
RooAbsArg* RooLinkedList::findArg(const RooAbsArg* arg) const 
{
  // Return pointer to object with given name in collection.
  // If no such object is found, return null pointer.

  if (_htableName) {
    RooAbsArg* a = (RooAbsArg*) _htableName->findArg(arg) ;
    if (a) return a;
    //cout << "RooLinkedList::findArg: possibly renamed '" << arg->GetName() << "', kRenamedArg=" << arg->namePtr()->TestBit(RooNameReg::kRenamedArg) << endl;
    // See if it might have been renamed
    if (!arg->namePtr()->TestBit(RooNameReg::kRenamedArg)) return 0;
  }
  
  RooLinkedListElem* ptr = _first ;
  const TNamed* nptr = arg->namePtr();
  while(ptr) {
    if (((RooAbsArg*)(ptr->_arg))->namePtr() == nptr) {
      return (RooAbsArg*) ptr->_arg ;
    }
    ptr = ptr->_next ;
  }
  return 0 ;
}

//_____________________________________________________________________________
Int_t RooLinkedList::IndexOf(const TObject* arg) const 
{
  // Return position of given object in list. If object
  // is not contained in list, return -1

  RooLinkedListElem* ptr = _first;
  Int_t idx(0) ;
  while(ptr) {
    if (ptr->_arg==arg) return idx ;
    ptr = ptr->_next ;
    idx++ ;
  }
  return -1 ;
}

//_____________________________________________________________________________
Int_t RooLinkedList::IndexOf(const char* name) const 
{
  // Return position of given object in list. If object
  // is not contained in list, return -1

  RooLinkedListElem* ptr = _first;
  Int_t idx(0) ;
  while(ptr) {
    if (strcmp(ptr->_arg->GetName(),name)==0) return idx ;
    ptr = ptr->_next ;
    idx++ ;
  }
  return -1 ;
}

//_____________________________________________________________________________
void RooLinkedList::Print(const char* opt) const 
{
  // Print contents of list, defers to Print() function
  // of contained objects
  RooLinkedListElem* elem = _first ;
  while(elem) {
    cout << elem->_arg << " : " ; 
    elem->_arg->Print(opt) ;
    elem = elem->_next ;
  }    
}

//_____________________________________________________________________________
RooLinkedListIter RooLinkedList::iterator(Bool_t dir) const 
{
  return RooLinkedListIter(this,dir) ;
}

//_____________________________________________________________________________
RooFIter RooLinkedList::fwdIterator() const 
{ 
  return RooFIter(this) ; 
}

//_____________________________________________________________________________
TIterator* RooLinkedList::MakeIterator(Bool_t dir) const 
{
  // Return an iterator over this list
  return new RooLinkedListIter(this,dir) ;
}

//_____________________________________________________________________________
void RooLinkedList::Sort(Bool_t ascend) 
{
  if (ascend) _first = mergesort_impl<true>(_first, _size, &_last);
  else _first = mergesort_impl<false>(_first, _size, &_last);
}

//_____________________________________________________________________________
template <bool ascending>
RooLinkedListElem* RooLinkedList::mergesort_impl(
    RooLinkedListElem* l1, const unsigned sz, RooLinkedListElem** tail)
{
  // length 0, 1 lists are sorted
  if (!l1 || sz < 2) {
    // if desired, update the tail of the (newly merged sorted) list
    if (tail) *tail = l1;
    return l1;
  }
  if (sz <= 16) {
    // for short lists, we sort in an array
#if !defined(_WIN32) && !defined(R__SOLARIS_CC50)
    RooLinkedListElem *arr[sz];
#else // _WIN32 && Solaris
    // apparently, MSVC is not clever enough to figure out that sz cannot be
    // zero and is at most sixteen, so we allocate a fixed size array on the
    // stack instead
    RooLinkedListElem *arr[16];
#endif // _WIN32
    for (int i = 0; l1; l1 = l1->_next, ++i) arr[i] = l1;
    // straight insertion sort
    {
	int i = 1;
	do {
	    int j = i - 1;
	    RooLinkedListElem *tmp = arr[i];
	    while (0 <= j) {
		const bool inOrder = ascending ?
		    (tmp->_arg->Compare(arr[j]->_arg) <= 0) :
		    (arr[j]->_arg->Compare(tmp->_arg) <= 0);
		if (!inOrder) break;
		arr[j + 1] = arr[j];
		--j;
	    }
	    arr[j + 1] = tmp;
	    ++i;
	} while (int(sz) != i);
    }
    // link elements in array
    arr[0]->_prev = arr[sz - 1]->_next = 0;
    for (int i = 0; i < int(sz - 1); ++i) {
      arr[i]->_next = arr[i + 1];
      arr[i + 1]->_prev = arr[i];
    }
    if (tail) *tail = arr[sz - 1];
    return arr[0];
  }
  // find middle of l1, and let a second list l2 start there
  RooLinkedListElem *l2 = l1;
  for (RooLinkedListElem *end = l2; end->_next; end = end->_next) {
    end = end->_next;
    l2 = l2->_next;
    if (!end->_next) break;
  }
  // disconnect the two sublists
  l2->_prev->_next = 0;
  l2->_prev = 0;
  // sort the two sublists (only recurse if we have to)
  if (l1->_next) l1 = mergesort_impl<ascending>(l1, sz / 2);
  if (l2->_next) l2 = mergesort_impl<ascending>(l2, sz - sz / 2);
  // merge the two (sorted) sublists
  // l: list head, t: list tail of merged list
  RooLinkedListElem *l = (ascending ? (l1->_arg->Compare(l2->_arg) <= 0) :
	  (l2->_arg->Compare(l1->_arg) <= 0)) ? l1 : l2;
  RooLinkedListElem *t = l;
  if (l == l2) {
    RooLinkedListElem* tmp = l1;
    l1 = l2;
    l2 = tmp;
  }
  l1 = l1->_next;
  while (l1 && l2) {
    const bool inOrder = ascending ? (l1->_arg->Compare(l2->_arg) <= 0) :
	(l2->_arg->Compare(l1->_arg) <= 0);
    if (!inOrder) {
      // insert l2 just before l1
      if (l1->_prev) {
	l1->_prev->_next = l2;
	l2->_prev = l1->_prev;
      }
      // swap l2 and l1
      RooLinkedListElem *tmp = l1;
      l1 = l2;
      l2 = tmp;
    }
    // move forward in l1
    t = l1;
    l1 = l1->_next;
  }
  // attach l2 at t
  if (l2) {
    l2->_prev = t;
    if (t) t->_next = l2;
  }
  // if desired, update the tail of the (newly merged sorted) list
  if (tail) {
    for (l1 = t; l1; l1 = l1->_next) t = l1;
    *tail = t;
  }
  // return the head of the sorted list
  return l;
}
// void Roo1DTable::Streamer(TBuffer &R__b)
// {
//    // Stream an object of class Roo1DTable.

//    if (R__b.IsReading()) {
//       R__b.ReadClassBuffer(Roo1DTable::Class(),this);
//    } else {
//       R__b.WriteClassBuffer(Roo1DTable::Class(),this);
//    }
// }

//_____________________________________________________________________________
void RooLinkedList::Streamer(TBuffer &R__b)
{
  // Custom streaming handling schema evolution w.r.t past implementations

  if (R__b.IsReading()) {

    Version_t v = R__b.ReadVersion();
    //R__b.ReadVersion();
    TObject::Streamer(R__b);

    Int_t size ;
    TObject* arg ;

    R__b >> size ;
    while(size--) {
      R__b >> arg ;
      Add(arg) ;      
    }

    if (v>1 ) {
      R__b >> _name ;
    }
    
  } else {
    R__b.WriteVersion(RooLinkedList::IsA());
    TObject::Streamer(R__b);
    R__b << _size ;

    RooLinkedListElem* ptr = _first;
    while(ptr) {
      R__b << ptr->_arg ;
      ptr = ptr->_next ;
    } 
    
    R__b << _name ;
  }
}

 RooLinkedList.cxx:1
 RooLinkedList.cxx:2
 RooLinkedList.cxx:3
 RooLinkedList.cxx:4
 RooLinkedList.cxx:5
 RooLinkedList.cxx:6
 RooLinkedList.cxx:7
 RooLinkedList.cxx:8
 RooLinkedList.cxx:9
 RooLinkedList.cxx:10
 RooLinkedList.cxx:11
 RooLinkedList.cxx:12
 RooLinkedList.cxx:13
 RooLinkedList.cxx:14
 RooLinkedList.cxx:15
 RooLinkedList.cxx:16
 RooLinkedList.cxx:17
 RooLinkedList.cxx:18
 RooLinkedList.cxx:19
 RooLinkedList.cxx:20
 RooLinkedList.cxx:21
 RooLinkedList.cxx:22
 RooLinkedList.cxx:23
 RooLinkedList.cxx:24
 RooLinkedList.cxx:25
 RooLinkedList.cxx:26
 RooLinkedList.cxx:27
 RooLinkedList.cxx:28
 RooLinkedList.cxx:29
 RooLinkedList.cxx:30
 RooLinkedList.cxx:31
 RooLinkedList.cxx:32
 RooLinkedList.cxx:33
 RooLinkedList.cxx:34
 RooLinkedList.cxx:35
 RooLinkedList.cxx:36
 RooLinkedList.cxx:37
 RooLinkedList.cxx:38
 RooLinkedList.cxx:39
 RooLinkedList.cxx:40
 RooLinkedList.cxx:41
 RooLinkedList.cxx:42
 RooLinkedList.cxx:43
 RooLinkedList.cxx:44
 RooLinkedList.cxx:45
 RooLinkedList.cxx:46
 RooLinkedList.cxx:47
 RooLinkedList.cxx:48
 RooLinkedList.cxx:49
 RooLinkedList.cxx:50
 RooLinkedList.cxx:51
 RooLinkedList.cxx:52
 RooLinkedList.cxx:53
 RooLinkedList.cxx:54
 RooLinkedList.cxx:55
 RooLinkedList.cxx:56
 RooLinkedList.cxx:57
 RooLinkedList.cxx:58
 RooLinkedList.cxx:59
 RooLinkedList.cxx:60
 RooLinkedList.cxx:61
 RooLinkedList.cxx:62
 RooLinkedList.cxx:63
 RooLinkedList.cxx:64
 RooLinkedList.cxx:65
 RooLinkedList.cxx:66
 RooLinkedList.cxx:67
 RooLinkedList.cxx:68
 RooLinkedList.cxx:69
 RooLinkedList.cxx:70
 RooLinkedList.cxx:71
 RooLinkedList.cxx:72
 RooLinkedList.cxx:73
 RooLinkedList.cxx:74
 RooLinkedList.cxx:75
 RooLinkedList.cxx:76
 RooLinkedList.cxx:77
 RooLinkedList.cxx:78
 RooLinkedList.cxx:79
 RooLinkedList.cxx:80
 RooLinkedList.cxx:81
 RooLinkedList.cxx:82
 RooLinkedList.cxx:83
 RooLinkedList.cxx:84
 RooLinkedList.cxx:85
 RooLinkedList.cxx:86
 RooLinkedList.cxx:87
 RooLinkedList.cxx:88
 RooLinkedList.cxx:89
 RooLinkedList.cxx:90
 RooLinkedList.cxx:91
 RooLinkedList.cxx:92
 RooLinkedList.cxx:93
 RooLinkedList.cxx:94
 RooLinkedList.cxx:95
 RooLinkedList.cxx:96
 RooLinkedList.cxx:97
 RooLinkedList.cxx:98
 RooLinkedList.cxx:99
 RooLinkedList.cxx:100
 RooLinkedList.cxx:101
 RooLinkedList.cxx:102
 RooLinkedList.cxx:103
 RooLinkedList.cxx:104
 RooLinkedList.cxx:105
 RooLinkedList.cxx:106
 RooLinkedList.cxx:107
 RooLinkedList.cxx:108
 RooLinkedList.cxx:109
 RooLinkedList.cxx:110
 RooLinkedList.cxx:111
 RooLinkedList.cxx:112
 RooLinkedList.cxx:113
 RooLinkedList.cxx:114
 RooLinkedList.cxx:115
 RooLinkedList.cxx:116
 RooLinkedList.cxx:117
 RooLinkedList.cxx:118
 RooLinkedList.cxx:119
 RooLinkedList.cxx:120
 RooLinkedList.cxx:121
 RooLinkedList.cxx:122
 RooLinkedList.cxx:123
 RooLinkedList.cxx:124
 RooLinkedList.cxx:125
 RooLinkedList.cxx:126
 RooLinkedList.cxx:127
 RooLinkedList.cxx:128
 RooLinkedList.cxx:129
 RooLinkedList.cxx:130
 RooLinkedList.cxx:131
 RooLinkedList.cxx:132
 RooLinkedList.cxx:133
 RooLinkedList.cxx:134
 RooLinkedList.cxx:135
 RooLinkedList.cxx:136
 RooLinkedList.cxx:137
 RooLinkedList.cxx:138
 RooLinkedList.cxx:139
 RooLinkedList.cxx:140
 RooLinkedList.cxx:141
 RooLinkedList.cxx:142
 RooLinkedList.cxx:143
 RooLinkedList.cxx:144
 RooLinkedList.cxx:145
 RooLinkedList.cxx:146
 RooLinkedList.cxx:147
 RooLinkedList.cxx:148
 RooLinkedList.cxx:149
 RooLinkedList.cxx:150
 RooLinkedList.cxx:151
 RooLinkedList.cxx:152
 RooLinkedList.cxx:153
 RooLinkedList.cxx:154
 RooLinkedList.cxx:155
 RooLinkedList.cxx:156
 RooLinkedList.cxx:157
 RooLinkedList.cxx:158
 RooLinkedList.cxx:159
 RooLinkedList.cxx:160
 RooLinkedList.cxx:161
 RooLinkedList.cxx:162
 RooLinkedList.cxx:163
 RooLinkedList.cxx:164
 RooLinkedList.cxx:165
 RooLinkedList.cxx:166
 RooLinkedList.cxx:167
 RooLinkedList.cxx:168
 RooLinkedList.cxx:169
 RooLinkedList.cxx:170
 RooLinkedList.cxx:171
 RooLinkedList.cxx:172
 RooLinkedList.cxx:173
 RooLinkedList.cxx:174
 RooLinkedList.cxx:175
 RooLinkedList.cxx:176
 RooLinkedList.cxx:177
 RooLinkedList.cxx:178
 RooLinkedList.cxx:179
 RooLinkedList.cxx:180
 RooLinkedList.cxx:181
 RooLinkedList.cxx:182
 RooLinkedList.cxx:183
 RooLinkedList.cxx:184
 RooLinkedList.cxx:185
 RooLinkedList.cxx:186
 RooLinkedList.cxx:187
 RooLinkedList.cxx:188
 RooLinkedList.cxx:189
 RooLinkedList.cxx:190
 RooLinkedList.cxx:191
 RooLinkedList.cxx:192
 RooLinkedList.cxx:193
 RooLinkedList.cxx:194
 RooLinkedList.cxx:195
 RooLinkedList.cxx:196
 RooLinkedList.cxx:197
 RooLinkedList.cxx:198
 RooLinkedList.cxx:199
 RooLinkedList.cxx:200
 RooLinkedList.cxx:201
 RooLinkedList.cxx:202
 RooLinkedList.cxx:203
 RooLinkedList.cxx:204
 RooLinkedList.cxx:205
 RooLinkedList.cxx:206
 RooLinkedList.cxx:207
 RooLinkedList.cxx:208
 RooLinkedList.cxx:209
 RooLinkedList.cxx:210
 RooLinkedList.cxx:211
 RooLinkedList.cxx:212
 RooLinkedList.cxx:213
 RooLinkedList.cxx:214
 RooLinkedList.cxx:215
 RooLinkedList.cxx:216
 RooLinkedList.cxx:217
 RooLinkedList.cxx:218
 RooLinkedList.cxx:219
 RooLinkedList.cxx:220
 RooLinkedList.cxx:221
 RooLinkedList.cxx:222
 RooLinkedList.cxx:223
 RooLinkedList.cxx:224
 RooLinkedList.cxx:225
 RooLinkedList.cxx:226
 RooLinkedList.cxx:227
 RooLinkedList.cxx:228
 RooLinkedList.cxx:229
 RooLinkedList.cxx:230
 RooLinkedList.cxx:231
 RooLinkedList.cxx:232
 RooLinkedList.cxx:233
 RooLinkedList.cxx:234
 RooLinkedList.cxx:235
 RooLinkedList.cxx:236
 RooLinkedList.cxx:237
 RooLinkedList.cxx:238
 RooLinkedList.cxx:239
 RooLinkedList.cxx:240
 RooLinkedList.cxx:241
 RooLinkedList.cxx:242
 RooLinkedList.cxx:243
 RooLinkedList.cxx:244
 RooLinkedList.cxx:245
 RooLinkedList.cxx:246
 RooLinkedList.cxx:247
 RooLinkedList.cxx:248
 RooLinkedList.cxx:249
 RooLinkedList.cxx:250
 RooLinkedList.cxx:251
 RooLinkedList.cxx:252
 RooLinkedList.cxx:253
 RooLinkedList.cxx:254
 RooLinkedList.cxx:255
 RooLinkedList.cxx:256
 RooLinkedList.cxx:257
 RooLinkedList.cxx:258
 RooLinkedList.cxx:259
 RooLinkedList.cxx:260
 RooLinkedList.cxx:261
 RooLinkedList.cxx:262
 RooLinkedList.cxx:263
 RooLinkedList.cxx:264
 RooLinkedList.cxx:265
 RooLinkedList.cxx:266
 RooLinkedList.cxx:267
 RooLinkedList.cxx:268
 RooLinkedList.cxx:269
 RooLinkedList.cxx:270
 RooLinkedList.cxx:271
 RooLinkedList.cxx:272
 RooLinkedList.cxx:273
 RooLinkedList.cxx:274
 RooLinkedList.cxx:275
 RooLinkedList.cxx:276
 RooLinkedList.cxx:277
 RooLinkedList.cxx:278
 RooLinkedList.cxx:279
 RooLinkedList.cxx:280
 RooLinkedList.cxx:281
 RooLinkedList.cxx:282
 RooLinkedList.cxx:283
 RooLinkedList.cxx:284
 RooLinkedList.cxx:285
 RooLinkedList.cxx:286
 RooLinkedList.cxx:287
 RooLinkedList.cxx:288
 RooLinkedList.cxx:289
 RooLinkedList.cxx:290
 RooLinkedList.cxx:291
 RooLinkedList.cxx:292
 RooLinkedList.cxx:293
 RooLinkedList.cxx:294
 RooLinkedList.cxx:295
 RooLinkedList.cxx:296
 RooLinkedList.cxx:297
 RooLinkedList.cxx:298
 RooLinkedList.cxx:299
 RooLinkedList.cxx:300
 RooLinkedList.cxx:301
 RooLinkedList.cxx:302
 RooLinkedList.cxx:303
 RooLinkedList.cxx:304
 RooLinkedList.cxx:305
 RooLinkedList.cxx:306
 RooLinkedList.cxx:307
 RooLinkedList.cxx:308
 RooLinkedList.cxx:309
 RooLinkedList.cxx:310
 RooLinkedList.cxx:311
 RooLinkedList.cxx:312
 RooLinkedList.cxx:313
 RooLinkedList.cxx:314
 RooLinkedList.cxx:315
 RooLinkedList.cxx:316
 RooLinkedList.cxx:317
 RooLinkedList.cxx:318
 RooLinkedList.cxx:319
 RooLinkedList.cxx:320
 RooLinkedList.cxx:321
 RooLinkedList.cxx:322
 RooLinkedList.cxx:323
 RooLinkedList.cxx:324
 RooLinkedList.cxx:325
 RooLinkedList.cxx:326
 RooLinkedList.cxx:327
 RooLinkedList.cxx:328
 RooLinkedList.cxx:329
 RooLinkedList.cxx:330
 RooLinkedList.cxx:331
 RooLinkedList.cxx:332
 RooLinkedList.cxx:333
 RooLinkedList.cxx:334
 RooLinkedList.cxx:335
 RooLinkedList.cxx:336
 RooLinkedList.cxx:337
 RooLinkedList.cxx:338
 RooLinkedList.cxx:339
 RooLinkedList.cxx:340
 RooLinkedList.cxx:341
 RooLinkedList.cxx:342
 RooLinkedList.cxx:343
 RooLinkedList.cxx:344
 RooLinkedList.cxx:345
 RooLinkedList.cxx:346
 RooLinkedList.cxx:347
 RooLinkedList.cxx:348
 RooLinkedList.cxx:349
 RooLinkedList.cxx:350
 RooLinkedList.cxx:351
 RooLinkedList.cxx:352
 RooLinkedList.cxx:353
 RooLinkedList.cxx:354
 RooLinkedList.cxx:355
 RooLinkedList.cxx:356
 RooLinkedList.cxx:357
 RooLinkedList.cxx:358
 RooLinkedList.cxx:359
 RooLinkedList.cxx:360
 RooLinkedList.cxx:361
 RooLinkedList.cxx:362
 RooLinkedList.cxx:363
 RooLinkedList.cxx:364
 RooLinkedList.cxx:365
 RooLinkedList.cxx:366
 RooLinkedList.cxx:367
 RooLinkedList.cxx:368
 RooLinkedList.cxx:369
 RooLinkedList.cxx:370
 RooLinkedList.cxx:371
 RooLinkedList.cxx:372
 RooLinkedList.cxx:373
 RooLinkedList.cxx:374
 RooLinkedList.cxx:375
 RooLinkedList.cxx:376
 RooLinkedList.cxx:377
 RooLinkedList.cxx:378
 RooLinkedList.cxx:379
 RooLinkedList.cxx:380
 RooLinkedList.cxx:381
 RooLinkedList.cxx:382
 RooLinkedList.cxx:383
 RooLinkedList.cxx:384
 RooLinkedList.cxx:385
 RooLinkedList.cxx:386
 RooLinkedList.cxx:387
 RooLinkedList.cxx:388
 RooLinkedList.cxx:389
 RooLinkedList.cxx:390
 RooLinkedList.cxx:391
 RooLinkedList.cxx:392
 RooLinkedList.cxx:393
 RooLinkedList.cxx:394
 RooLinkedList.cxx:395
 RooLinkedList.cxx:396
 RooLinkedList.cxx:397
 RooLinkedList.cxx:398
 RooLinkedList.cxx:399
 RooLinkedList.cxx:400
 RooLinkedList.cxx:401
 RooLinkedList.cxx:402
 RooLinkedList.cxx:403
 RooLinkedList.cxx:404
 RooLinkedList.cxx:405
 RooLinkedList.cxx:406
 RooLinkedList.cxx:407
 RooLinkedList.cxx:408
 RooLinkedList.cxx:409
 RooLinkedList.cxx:410
 RooLinkedList.cxx:411
 RooLinkedList.cxx:412
 RooLinkedList.cxx:413
 RooLinkedList.cxx:414
 RooLinkedList.cxx:415
 RooLinkedList.cxx:416
 RooLinkedList.cxx:417
 RooLinkedList.cxx:418
 RooLinkedList.cxx:419
 RooLinkedList.cxx:420
 RooLinkedList.cxx:421
 RooLinkedList.cxx:422
 RooLinkedList.cxx:423
 RooLinkedList.cxx:424
 RooLinkedList.cxx:425
 RooLinkedList.cxx:426
 RooLinkedList.cxx:427
 RooLinkedList.cxx:428
 RooLinkedList.cxx:429
 RooLinkedList.cxx:430
 RooLinkedList.cxx:431
 RooLinkedList.cxx:432
 RooLinkedList.cxx:433
 RooLinkedList.cxx:434
 RooLinkedList.cxx:435
 RooLinkedList.cxx:436
 RooLinkedList.cxx:437
 RooLinkedList.cxx:438
 RooLinkedList.cxx:439
 RooLinkedList.cxx:440
 RooLinkedList.cxx:441
 RooLinkedList.cxx:442
 RooLinkedList.cxx:443
 RooLinkedList.cxx:444
 RooLinkedList.cxx:445
 RooLinkedList.cxx:446
 RooLinkedList.cxx:447
 RooLinkedList.cxx:448
 RooLinkedList.cxx:449
 RooLinkedList.cxx:450
 RooLinkedList.cxx:451
 RooLinkedList.cxx:452
 RooLinkedList.cxx:453
 RooLinkedList.cxx:454
 RooLinkedList.cxx:455
 RooLinkedList.cxx:456
 RooLinkedList.cxx:457
 RooLinkedList.cxx:458
 RooLinkedList.cxx:459
 RooLinkedList.cxx:460
 RooLinkedList.cxx:461
 RooLinkedList.cxx:462
 RooLinkedList.cxx:463
 RooLinkedList.cxx:464
 RooLinkedList.cxx:465
 RooLinkedList.cxx:466
 RooLinkedList.cxx:467
 RooLinkedList.cxx:468
 RooLinkedList.cxx:469
 RooLinkedList.cxx:470
 RooLinkedList.cxx:471
 RooLinkedList.cxx:472
 RooLinkedList.cxx:473
 RooLinkedList.cxx:474
 RooLinkedList.cxx:475
 RooLinkedList.cxx:476
 RooLinkedList.cxx:477
 RooLinkedList.cxx:478
 RooLinkedList.cxx:479
 RooLinkedList.cxx:480
 RooLinkedList.cxx:481
 RooLinkedList.cxx:482
 RooLinkedList.cxx:483
 RooLinkedList.cxx:484
 RooLinkedList.cxx:485
 RooLinkedList.cxx:486
 RooLinkedList.cxx:487
 RooLinkedList.cxx:488
 RooLinkedList.cxx:489
 RooLinkedList.cxx:490
 RooLinkedList.cxx:491
 RooLinkedList.cxx:492
 RooLinkedList.cxx:493
 RooLinkedList.cxx:494
 RooLinkedList.cxx:495
 RooLinkedList.cxx:496
 RooLinkedList.cxx:497
 RooLinkedList.cxx:498
 RooLinkedList.cxx:499
 RooLinkedList.cxx:500
 RooLinkedList.cxx:501
 RooLinkedList.cxx:502
 RooLinkedList.cxx:503
 RooLinkedList.cxx:504
 RooLinkedList.cxx:505
 RooLinkedList.cxx:506
 RooLinkedList.cxx:507
 RooLinkedList.cxx:508
 RooLinkedList.cxx:509
 RooLinkedList.cxx:510
 RooLinkedList.cxx:511
 RooLinkedList.cxx:512
 RooLinkedList.cxx:513
 RooLinkedList.cxx:514
 RooLinkedList.cxx:515
 RooLinkedList.cxx:516
 RooLinkedList.cxx:517
 RooLinkedList.cxx:518
 RooLinkedList.cxx:519
 RooLinkedList.cxx:520
 RooLinkedList.cxx:521
 RooLinkedList.cxx:522
 RooLinkedList.cxx:523
 RooLinkedList.cxx:524
 RooLinkedList.cxx:525
 RooLinkedList.cxx:526
 RooLinkedList.cxx:527
 RooLinkedList.cxx:528
 RooLinkedList.cxx:529
 RooLinkedList.cxx:530
 RooLinkedList.cxx:531
 RooLinkedList.cxx:532
 RooLinkedList.cxx:533
 RooLinkedList.cxx:534
 RooLinkedList.cxx:535
 RooLinkedList.cxx:536
 RooLinkedList.cxx:537
 RooLinkedList.cxx:538
 RooLinkedList.cxx:539
 RooLinkedList.cxx:540
 RooLinkedList.cxx:541
 RooLinkedList.cxx:542
 RooLinkedList.cxx:543
 RooLinkedList.cxx:544
 RooLinkedList.cxx:545
 RooLinkedList.cxx:546
 RooLinkedList.cxx:547
 RooLinkedList.cxx:548
 RooLinkedList.cxx:549
 RooLinkedList.cxx:550
 RooLinkedList.cxx:551
 RooLinkedList.cxx:552
 RooLinkedList.cxx:553
 RooLinkedList.cxx:554
 RooLinkedList.cxx:555
 RooLinkedList.cxx:556
 RooLinkedList.cxx:557
 RooLinkedList.cxx:558
 RooLinkedList.cxx:559
 RooLinkedList.cxx:560
 RooLinkedList.cxx:561
 RooLinkedList.cxx:562
 RooLinkedList.cxx:563
 RooLinkedList.cxx:564
 RooLinkedList.cxx:565
 RooLinkedList.cxx:566
 RooLinkedList.cxx:567
 RooLinkedList.cxx:568
 RooLinkedList.cxx:569
 RooLinkedList.cxx:570
 RooLinkedList.cxx:571
 RooLinkedList.cxx:572
 RooLinkedList.cxx:573
 RooLinkedList.cxx:574
 RooLinkedList.cxx:575
 RooLinkedList.cxx:576
 RooLinkedList.cxx:577
 RooLinkedList.cxx:578
 RooLinkedList.cxx:579
 RooLinkedList.cxx:580
 RooLinkedList.cxx:581
 RooLinkedList.cxx:582
 RooLinkedList.cxx:583
 RooLinkedList.cxx:584
 RooLinkedList.cxx:585
 RooLinkedList.cxx:586
 RooLinkedList.cxx:587
 RooLinkedList.cxx:588
 RooLinkedList.cxx:589
 RooLinkedList.cxx:590
 RooLinkedList.cxx:591
 RooLinkedList.cxx:592
 RooLinkedList.cxx:593
 RooLinkedList.cxx:594
 RooLinkedList.cxx:595
 RooLinkedList.cxx:596
 RooLinkedList.cxx:597
 RooLinkedList.cxx:598
 RooLinkedList.cxx:599
 RooLinkedList.cxx:600
 RooLinkedList.cxx:601
 RooLinkedList.cxx:602
 RooLinkedList.cxx:603
 RooLinkedList.cxx:604
 RooLinkedList.cxx:605
 RooLinkedList.cxx:606
 RooLinkedList.cxx:607
 RooLinkedList.cxx:608
 RooLinkedList.cxx:609
 RooLinkedList.cxx:610
 RooLinkedList.cxx:611
 RooLinkedList.cxx:612
 RooLinkedList.cxx:613
 RooLinkedList.cxx:614
 RooLinkedList.cxx:615
 RooLinkedList.cxx:616
 RooLinkedList.cxx:617
 RooLinkedList.cxx:618
 RooLinkedList.cxx:619
 RooLinkedList.cxx:620
 RooLinkedList.cxx:621
 RooLinkedList.cxx:622
 RooLinkedList.cxx:623
 RooLinkedList.cxx:624
 RooLinkedList.cxx:625
 RooLinkedList.cxx:626
 RooLinkedList.cxx:627
 RooLinkedList.cxx:628
 RooLinkedList.cxx:629
 RooLinkedList.cxx:630
 RooLinkedList.cxx:631
 RooLinkedList.cxx:632
 RooLinkedList.cxx:633
 RooLinkedList.cxx:634
 RooLinkedList.cxx:635
 RooLinkedList.cxx:636
 RooLinkedList.cxx:637
 RooLinkedList.cxx:638
 RooLinkedList.cxx:639
 RooLinkedList.cxx:640
 RooLinkedList.cxx:641
 RooLinkedList.cxx:642
 RooLinkedList.cxx:643
 RooLinkedList.cxx:644
 RooLinkedList.cxx:645
 RooLinkedList.cxx:646
 RooLinkedList.cxx:647
 RooLinkedList.cxx:648
 RooLinkedList.cxx:649
 RooLinkedList.cxx:650
 RooLinkedList.cxx:651
 RooLinkedList.cxx:652
 RooLinkedList.cxx:653
 RooLinkedList.cxx:654
 RooLinkedList.cxx:655
 RooLinkedList.cxx:656
 RooLinkedList.cxx:657
 RooLinkedList.cxx:658
 RooLinkedList.cxx:659
 RooLinkedList.cxx:660
 RooLinkedList.cxx:661
 RooLinkedList.cxx:662
 RooLinkedList.cxx:663
 RooLinkedList.cxx:664
 RooLinkedList.cxx:665
 RooLinkedList.cxx:666
 RooLinkedList.cxx:667
 RooLinkedList.cxx:668
 RooLinkedList.cxx:669
 RooLinkedList.cxx:670
 RooLinkedList.cxx:671
 RooLinkedList.cxx:672
 RooLinkedList.cxx:673
 RooLinkedList.cxx:674
 RooLinkedList.cxx:675
 RooLinkedList.cxx:676
 RooLinkedList.cxx:677
 RooLinkedList.cxx:678
 RooLinkedList.cxx:679
 RooLinkedList.cxx:680
 RooLinkedList.cxx:681
 RooLinkedList.cxx:682
 RooLinkedList.cxx:683
 RooLinkedList.cxx:684
 RooLinkedList.cxx:685
 RooLinkedList.cxx:686
 RooLinkedList.cxx:687
 RooLinkedList.cxx:688
 RooLinkedList.cxx:689
 RooLinkedList.cxx:690
 RooLinkedList.cxx:691
 RooLinkedList.cxx:692
 RooLinkedList.cxx:693
 RooLinkedList.cxx:694
 RooLinkedList.cxx:695
 RooLinkedList.cxx:696
 RooLinkedList.cxx:697
 RooLinkedList.cxx:698
 RooLinkedList.cxx:699
 RooLinkedList.cxx:700
 RooLinkedList.cxx:701
 RooLinkedList.cxx:702
 RooLinkedList.cxx:703
 RooLinkedList.cxx:704
 RooLinkedList.cxx:705
 RooLinkedList.cxx:706
 RooLinkedList.cxx:707
 RooLinkedList.cxx:708
 RooLinkedList.cxx:709
 RooLinkedList.cxx:710
 RooLinkedList.cxx:711
 RooLinkedList.cxx:712
 RooLinkedList.cxx:713
 RooLinkedList.cxx:714
 RooLinkedList.cxx:715
 RooLinkedList.cxx:716
 RooLinkedList.cxx:717
 RooLinkedList.cxx:718
 RooLinkedList.cxx:719
 RooLinkedList.cxx:720
 RooLinkedList.cxx:721
 RooLinkedList.cxx:722
 RooLinkedList.cxx:723
 RooLinkedList.cxx:724
 RooLinkedList.cxx:725
 RooLinkedList.cxx:726
 RooLinkedList.cxx:727
 RooLinkedList.cxx:728
 RooLinkedList.cxx:729
 RooLinkedList.cxx:730
 RooLinkedList.cxx:731
 RooLinkedList.cxx:732
 RooLinkedList.cxx:733
 RooLinkedList.cxx:734
 RooLinkedList.cxx:735
 RooLinkedList.cxx:736
 RooLinkedList.cxx:737
 RooLinkedList.cxx:738
 RooLinkedList.cxx:739
 RooLinkedList.cxx:740
 RooLinkedList.cxx:741
 RooLinkedList.cxx:742
 RooLinkedList.cxx:743
 RooLinkedList.cxx:744
 RooLinkedList.cxx:745
 RooLinkedList.cxx:746
 RooLinkedList.cxx:747
 RooLinkedList.cxx:748
 RooLinkedList.cxx:749
 RooLinkedList.cxx:750
 RooLinkedList.cxx:751
 RooLinkedList.cxx:752
 RooLinkedList.cxx:753
 RooLinkedList.cxx:754
 RooLinkedList.cxx:755
 RooLinkedList.cxx:756
 RooLinkedList.cxx:757
 RooLinkedList.cxx:758
 RooLinkedList.cxx:759
 RooLinkedList.cxx:760
 RooLinkedList.cxx:761
 RooLinkedList.cxx:762
 RooLinkedList.cxx:763
 RooLinkedList.cxx:764
 RooLinkedList.cxx:765
 RooLinkedList.cxx:766
 RooLinkedList.cxx:767
 RooLinkedList.cxx:768
 RooLinkedList.cxx:769
 RooLinkedList.cxx:770
 RooLinkedList.cxx:771
 RooLinkedList.cxx:772
 RooLinkedList.cxx:773
 RooLinkedList.cxx:774
 RooLinkedList.cxx:775
 RooLinkedList.cxx:776
 RooLinkedList.cxx:777
 RooLinkedList.cxx:778
 RooLinkedList.cxx:779
 RooLinkedList.cxx:780
 RooLinkedList.cxx:781
 RooLinkedList.cxx:782
 RooLinkedList.cxx:783
 RooLinkedList.cxx:784
 RooLinkedList.cxx:785
 RooLinkedList.cxx:786
 RooLinkedList.cxx:787
 RooLinkedList.cxx:788
 RooLinkedList.cxx:789
 RooLinkedList.cxx:790
 RooLinkedList.cxx:791
 RooLinkedList.cxx:792
 RooLinkedList.cxx:793
 RooLinkedList.cxx:794
 RooLinkedList.cxx:795
 RooLinkedList.cxx:796
 RooLinkedList.cxx:797
 RooLinkedList.cxx:798
 RooLinkedList.cxx:799
 RooLinkedList.cxx:800
 RooLinkedList.cxx:801
 RooLinkedList.cxx:802
 RooLinkedList.cxx:803
 RooLinkedList.cxx:804
 RooLinkedList.cxx:805
 RooLinkedList.cxx:806
 RooLinkedList.cxx:807
 RooLinkedList.cxx:808
 RooLinkedList.cxx:809
 RooLinkedList.cxx:810
 RooLinkedList.cxx:811
 RooLinkedList.cxx:812
 RooLinkedList.cxx:813
 RooLinkedList.cxx:814
 RooLinkedList.cxx:815
 RooLinkedList.cxx:816
 RooLinkedList.cxx:817
 RooLinkedList.cxx:818
 RooLinkedList.cxx:819
 RooLinkedList.cxx:820
 RooLinkedList.cxx:821
 RooLinkedList.cxx:822
 RooLinkedList.cxx:823
 RooLinkedList.cxx:824
 RooLinkedList.cxx:825
 RooLinkedList.cxx:826
 RooLinkedList.cxx:827
 RooLinkedList.cxx:828
 RooLinkedList.cxx:829
 RooLinkedList.cxx:830
 RooLinkedList.cxx:831
 RooLinkedList.cxx:832
 RooLinkedList.cxx:833
 RooLinkedList.cxx:834
 RooLinkedList.cxx:835
 RooLinkedList.cxx:836
 RooLinkedList.cxx:837
 RooLinkedList.cxx:838
 RooLinkedList.cxx:839
 RooLinkedList.cxx:840
 RooLinkedList.cxx:841
 RooLinkedList.cxx:842
 RooLinkedList.cxx:843
 RooLinkedList.cxx:844
 RooLinkedList.cxx:845
 RooLinkedList.cxx:846
 RooLinkedList.cxx:847
 RooLinkedList.cxx:848
 RooLinkedList.cxx:849
 RooLinkedList.cxx:850
 RooLinkedList.cxx:851
 RooLinkedList.cxx:852
 RooLinkedList.cxx:853
 RooLinkedList.cxx:854
 RooLinkedList.cxx:855
 RooLinkedList.cxx:856
 RooLinkedList.cxx:857
 RooLinkedList.cxx:858
 RooLinkedList.cxx:859
 RooLinkedList.cxx:860
 RooLinkedList.cxx:861
 RooLinkedList.cxx:862
 RooLinkedList.cxx:863
 RooLinkedList.cxx:864
 RooLinkedList.cxx:865
 RooLinkedList.cxx:866
 RooLinkedList.cxx:867
 RooLinkedList.cxx:868
 RooLinkedList.cxx:869
 RooLinkedList.cxx:870
 RooLinkedList.cxx:871
 RooLinkedList.cxx:872
 RooLinkedList.cxx:873
 RooLinkedList.cxx:874
 RooLinkedList.cxx:875
 RooLinkedList.cxx:876
 RooLinkedList.cxx:877
 RooLinkedList.cxx:878
 RooLinkedList.cxx:879
 RooLinkedList.cxx:880
 RooLinkedList.cxx:881
 RooLinkedList.cxx:882
 RooLinkedList.cxx:883
 RooLinkedList.cxx:884
 RooLinkedList.cxx:885