@@ -50,66 +50,49 @@ the TEventList object created in the above commands:
5050#include " TBuffer.h"
5151#include " TCut.h"
5252#include " TDirectory.h"
53- #include " TList.h"
54- #include " TMath.h"
55- #include " strlcpy.h"
56- #include " snprintf.h"
53+ #include " TCollection.h"
54+ #include " TMathBase.h"
55+ #include " TROOT.h"
5756
58-
59- // //////////////////////////////////////////////////////////////////////////////
60- // / Default constructor for a EventList.
61-
62- TEventList::TEventList (): TNamed()
63- {
64- fN = 0 ;
65- fSize = 100 ;
66- fDelta = 100 ;
67- fList = nullptr ;
68- fDirectory = nullptr ;
69- fReapply = false ;
70- }
57+ #include < algorithm>
7158
7259// //////////////////////////////////////////////////////////////////////////////
7360// / Create a EventList.
7461// /
7562// / This Eventlist is added to the list of objects in current directory.
7663
7764TEventList::TEventList (const char *name, const char *title, Int_t initsize, Int_t delta)
78- : TNamed(name,title), fReapply( false )
65+ : TNamed(name, title), fSize(std::max( 100 , initsize)), fDelta(std::max( 100 , delta) )
7966{
80- fN = 0 ;
81- if (initsize > 100 ) fSize = initsize;
82- else fSize = 100 ;
83- if (delta > 100 ) fDelta = delta;
84- else fDelta = 100 ;
85- fList = nullptr ;
86- fDirectory = gDirectory ;
87- if (fDirectory ) fDirectory ->Append (this );
67+ if (ROOT::Experimental::ObjectAutoRegistrationEnabled ()) {
68+ fDirectory = gDirectory ;
69+ if (fDirectory )
70+ fDirectory ->Append (this );
71+ }
8872}
8973
9074// //////////////////////////////////////////////////////////////////////////////
9175// / Copy constructor.
9276
93- TEventList::TEventList (const TEventList &list) : TNamed(list)
77+ TEventList::TEventList (const TEventList &list)
78+ : TNamed(list),
79+ fN(list.fN ),
80+ fSize(list.fSize ),
81+ fDelta(list.fDelta ),
82+ fReapply(list.fReapply ),
83+ fList(new Long64_t[fSize ])
9484{
95- fN = list.fN ;
96- fSize = list.fSize ;
97- fDelta = list.fDelta ;
98- fList = new Long64_t[fSize ];
99- for (Int_t i=0 ; i<fN ; i++)
100- fList [i] = list.fList [i];
101- fReapply = list.fReapply ;
102- fDirectory = nullptr ;
85+ std::copy (list.fList , list.fList + list.fN , fList );
10386}
10487
10588// //////////////////////////////////////////////////////////////////////////////
10689// / Default destructor for a EventList.
10790
10891TEventList::~TEventList ()
10992{
110- delete [] fList ; fList = nullptr ;
111- if (fDirectory ) fDirectory -> Remove ( this );
112- fDirectory = nullptr ;
93+ delete[] fList ;
94+ if (fDirectory )
95+ fDirectory -> Remove ( this ) ;
11396}
11497
11598// //////////////////////////////////////////////////////////////////////////////
0 commit comments