Skip to content

Commit ed3cb95

Browse files
committed
[NFC] Apply clang-tidy member initializer fixes to TEntryList.
1 parent d38659e commit ed3cb95

2 files changed

Lines changed: 38 additions & 109 deletions

File tree

tree/tree/inc/TEntryList.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ class TEntryList: public TNamed
2828
TEntryList& operator=(const TEntryList&); // Not implemented
2929

3030
protected:
31-
TList *fLists; ///< a list of underlying entry lists for each tree of a chain
32-
TEntryList *fCurrent; ///<! currently filled entry list
33-
34-
Int_t fNBlocks; ///< number of TEntryListBlocks
35-
TObjArray *fBlocks; ///< blocks with indices of passing events (TEntryListBlocks)
36-
Long64_t fN; ///< number of entries in the list
37-
Long64_t fEntriesToProcess; ///< used on proof to set the number of entries to process in a packet
38-
TString fTreeName; ///< name of the tree
39-
TString fFileName; ///< name of the file, where the tree is
40-
ULong_t fStringHash; ///<! Hash value of a string of treename and filename
41-
Int_t fTreeNumber; ///<! the index of the tree in the chain (used when the entry
42-
///< list is used as input (TTree::SetEntryList())
43-
44-
Long64_t fLastIndexQueried; ///<! used to optimize GetEntry() function from a loop
45-
Long64_t fLastIndexReturned; ///<! used to optimize GetEntry() function from a loop
46-
bool fShift; ///<! true when some sub-lists don't correspond to trees
47-
///< (when the entry list is used as input in TChain)
48-
TDirectory *fDirectory; ///<! Pointer to directory holding this tree
49-
bool fReapply; ///< If true, TTree::Draw will 'reapply' the original cut
50-
51-
void GetFileName(const char *filename, TString &fn, bool * = nullptr);
31+
TList *fLists = nullptr; ///< a list of underlying entry lists for each tree of a chain
32+
TEntryList *fCurrent = nullptr; ///<! currently filled entry list
33+
34+
Int_t fNBlocks = 0; ///< number of TEntryListBlocks
35+
TObjArray *fBlocks = nullptr; ///< blocks with indices of passing events (TEntryListBlocks)
36+
Long64_t fN = 0; ///< number of entries in the list
37+
Long64_t fEntriesToProcess = 0; ///< used on proof to set the number of entries to process in a packet
38+
TString fTreeName; ///< name of the tree
39+
TString fFileName; ///< name of the file, where the tree is
40+
ULong_t fStringHash = 0; ///<! Hash value of a string of treename and filename
41+
Int_t fTreeNumber = -1; ///<! the index of the tree in the chain (used when the entry
42+
///< list is used as input (TTree::SetEntryList())
43+
44+
Long64_t fLastIndexQueried = -1; ///<! used to optimize GetEntry() function from a loop
45+
Long64_t fLastIndexReturned = 0; ///<! used to optimize GetEntry() function from a loop
46+
bool fShift = false; ///<! true when some sub-lists don't correspond to trees
47+
///< (when the entry list is used as input in TChain)
48+
TDirectory *fDirectory = nullptr; ///<! Pointer to directory holding this tree
49+
bool fReapply = false; ///< If true, TTree::Draw will 'reapply' the original cut
50+
51+
void GetFileName(const char *filename, TString &fn, bool * = nullptr);
5252

5353
public:
5454
enum {kBlockSize = 64000}; //number of entries in each block (not the physical size).

tree/tree/src/TEntryList.cxx

Lines changed: 17 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -165,136 +165,67 @@ End_Macro
165165
////////////////////////////////////////////////////////////////////////////////
166166
/// default c-tor
167167

168-
TEntryList::TEntryList() : fEntriesToProcess(0)
169-
{
170-
fLists = nullptr;
171-
fCurrent = nullptr;
172-
fBlocks = nullptr;
173-
fN = 0;
174-
fNBlocks = 0;
175-
fTreeName = "";
176-
fFileName = "";
177-
fStringHash = 0;
178-
fTreeNumber = -1;
179-
fDirectory = nullptr;
180-
fReapply = false;
181-
fLastIndexQueried = -1;
182-
fLastIndexReturned = 0;
183-
fShift = false;
184-
}
168+
TEntryList::TEntryList() = default;
185169

186170
////////////////////////////////////////////////////////////////////////////////
187171
/// c-tor with name and title
188172

189-
TEntryList::TEntryList(const char *name, const char *title) :
190-
TNamed(name, title),
191-
fEntriesToProcess(0)
173+
TEntryList::TEntryList(const char *name, const char *title) : TNamed(name, title)
192174
{
193-
fLists = nullptr;
194-
fCurrent = nullptr;
195-
fBlocks = nullptr;
196-
fN = 0;
197-
fNBlocks = 0;
198-
fTreeName = "";
199-
fFileName = "";
200-
fStringHash = 0;
201-
fTreeNumber = -1;
202-
fReapply = false;
203175

204176
fDirectory = gDirectory;
205177
if (fDirectory) fDirectory->Append(this);
206-
207-
fLastIndexQueried = -1;
208-
fLastIndexReturned = 0;
209-
fShift = false;
210178
}
211179

212180
////////////////////////////////////////////////////////////////////////////////
213181
/// constructor with name and title, which also sets the tree
214182

215-
TEntryList::TEntryList(const char *name, const char *title, const TTree *tree):TNamed(name, title)
183+
TEntryList::TEntryList(const char *name, const char *title, const TTree *tree) : TNamed(name, title)
216184
{
217-
fLists = nullptr;
218-
fCurrent = nullptr;
219-
fBlocks = nullptr;
220-
fN = 0;
221-
fNBlocks = 0;
222-
fTreeNumber = -1;
223185
TEntryList::SetTree(tree);
224-
fReapply = false;
225186

226187
fDirectory = gDirectory;
227188
if (fDirectory) fDirectory->Append(this);
228-
229-
fLastIndexQueried = -1;
230-
fLastIndexReturned = 0;
231-
fShift = false;
232189
}
233190

234191
////////////////////////////////////////////////////////////////////////////////
235192
/// c-tor with name and title, which also sets the treename and the filename
236193

237-
TEntryList::TEntryList(const char *name, const char *title, const char *treename, const char *filename) : TNamed(name, title),fEntriesToProcess(0)
194+
TEntryList::TEntryList(const char *name, const char *title, const char *treename, const char *filename)
195+
: TNamed(name, title)
238196
{
239-
fLists = nullptr;
240-
fCurrent = nullptr;
241-
fBlocks = nullptr;
242-
fNBlocks = 0;
243-
fN = 0;
244197
SetTree(treename, filename);
245-
fTreeNumber = -1;
246-
fReapply = false;
247198

248199
fDirectory = gDirectory;
249200
if (fDirectory) fDirectory->Append(this);
250-
251-
fLastIndexQueried = -1;
252-
fLastIndexReturned = 0;
253-
fShift = false;
254201
}
255202

256203
////////////////////////////////////////////////////////////////////////////////
257204
/// c-tor, which sets the tree
258205

259-
TEntryList::TEntryList(const TTree *tree) : fEntriesToProcess(0)
206+
TEntryList::TEntryList(const TTree *tree)
260207
{
261-
fLists = nullptr;
262-
fCurrent = nullptr;
263-
fBlocks = nullptr;
264-
fNBlocks = 0;
265-
fN = 0;
266-
267208
SetTree(tree);
268-
fTreeNumber = -1;
269209

270-
fReapply = false;
271210
fDirectory = gDirectory;
272211
if (fDirectory) fDirectory->Append(this);
273-
274-
fLastIndexQueried = -1;
275-
fLastIndexReturned = 0;
276-
fShift = false;
277212
}
278213

279214
////////////////////////////////////////////////////////////////////////////////
280215
/// copy c-tor
281216

282-
TEntryList::TEntryList(const TEntryList &elist) : TNamed(elist)
217+
TEntryList::TEntryList(const TEntryList &elist)
218+
: TNamed(elist),
219+
fNBlocks(elist.fNBlocks),
220+
fN(elist.fN),
221+
fEntriesToProcess(elist.fEntriesToProcess),
222+
fTreeName(elist.fTreeName),
223+
fFileName(elist.fFileName),
224+
fStringHash(elist.fStringHash),
225+
fTreeNumber(elist.fTreeNumber),
226+
fShift(elist.fShift),
227+
fReapply(elist.fReapply)
283228
{
284-
fNBlocks = elist.fNBlocks;
285-
fTreeName = elist.fTreeName;
286-
fFileName = elist.fFileName;
287-
fStringHash = elist.fStringHash;
288-
fTreeNumber = elist.fTreeNumber;
289-
fLastIndexQueried = -1;
290-
fLastIndexReturned = 0;
291-
fN = elist.fN;
292-
fShift = elist.fShift;
293-
fLists = nullptr;
294-
fBlocks = nullptr;
295-
fReapply = elist.fReapply;
296-
fCurrent = nullptr;
297-
fEntriesToProcess = elist.fEntriesToProcess;
298229
if (elist.fLists){
299230
fLists = new TList();
300231
TEntryList *el1 = nullptr;
@@ -320,8 +251,6 @@ TEntryList::TEntryList(const TEntryList &elist) : TNamed(elist)
320251
}
321252
fCurrent = this;
322253
}
323-
fDirectory = nullptr;
324-
325254
}
326255

327256
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)