Skip to content

Commit bb6b981

Browse files
committed
[NFC] Apply clang-tidy member initializer fixes to TEntryList.
1 parent 90561ca commit bb6b981

2 files changed

Lines changed: 46 additions & 113 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: 25 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -165,136 +165,71 @@ 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;
205-
if (fDirectory) fDirectory->Append(this);
206-
207-
fLastIndexQueried = -1;
208-
fLastIndexReturned = 0;
209-
fShift = false;
177+
if (fDirectory)
178+
fDirectory->Append(this);
210179
}
211180

212181
////////////////////////////////////////////////////////////////////////////////
213182
/// constructor with name and title, which also sets the tree
214183

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

226188
fDirectory = gDirectory;
227-
if (fDirectory) fDirectory->Append(this);
228-
229-
fLastIndexQueried = -1;
230-
fLastIndexReturned = 0;
231-
fShift = false;
189+
if (fDirectory)
190+
fDirectory->Append(this);
232191
}
233192

234193
////////////////////////////////////////////////////////////////////////////////
235194
/// c-tor with name and title, which also sets the treename and the filename
236195

237-
TEntryList::TEntryList(const char *name, const char *title, const char *treename, const char *filename) : TNamed(name, title),fEntriesToProcess(0)
196+
TEntryList::TEntryList(const char *name, const char *title, const char *treename, const char *filename)
197+
: TNamed(name, title)
238198
{
239-
fLists = nullptr;
240-
fCurrent = nullptr;
241-
fBlocks = nullptr;
242-
fNBlocks = 0;
243-
fN = 0;
244199
SetTree(treename, filename);
245-
fTreeNumber = -1;
246-
fReapply = false;
247200

248201
fDirectory = gDirectory;
249-
if (fDirectory) fDirectory->Append(this);
250-
251-
fLastIndexQueried = -1;
252-
fLastIndexReturned = 0;
253-
fShift = false;
202+
if (fDirectory)
203+
fDirectory->Append(this);
254204
}
255205

256206
////////////////////////////////////////////////////////////////////////////////
257207
/// c-tor, which sets the tree
258208

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

270-
fReapply = false;
271213
fDirectory = gDirectory;
272-
if (fDirectory) fDirectory->Append(this);
273-
274-
fLastIndexQueried = -1;
275-
fLastIndexReturned = 0;
276-
fShift = false;
214+
if (fDirectory)
215+
fDirectory->Append(this);
277216
}
278217

279218
////////////////////////////////////////////////////////////////////////////////
280219
/// copy c-tor
281220

282-
TEntryList::TEntryList(const TEntryList &elist) : TNamed(elist)
221+
TEntryList::TEntryList(const TEntryList &elist)
222+
: TNamed(elist),
223+
fNBlocks(elist.fNBlocks),
224+
fN(elist.fN),
225+
fEntriesToProcess(elist.fEntriesToProcess),
226+
fTreeName(elist.fTreeName),
227+
fFileName(elist.fFileName),
228+
fStringHash(elist.fStringHash),
229+
fTreeNumber(elist.fTreeNumber),
230+
fShift(elist.fShift),
231+
fReapply(elist.fReapply)
283232
{
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;
298233
if (elist.fLists){
299234
fLists = new TList();
300235
TEntryList *el1 = nullptr;
@@ -320,8 +255,6 @@ TEntryList::TEntryList(const TEntryList &elist) : TNamed(elist)
320255
}
321256
fCurrent = this;
322257
}
323-
fDirectory = nullptr;
324-
325258
}
326259

327260
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)