You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Common/Core/aodMerger.cxx
+33-20Lines changed: 33 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -243,8 +243,10 @@ int main(int argc, char* argv[])
243
243
foundTrees.push_back(treeName);
244
244
245
245
auto inputTree = (TTree*)inputFile->Get(Form("%s/%s", dfName, treeName));
246
-
printf(" Tree %s has %lld entries\n", treeName, inputTree->GetEntries());
246
+
bool fastCopy = (inputTree->GetTotBytes() > 10000000); // Only do this for large enough trees to avoid that baskets are too small
247
+
printf(" Tree %s has %lld entries with total size %lld (fast copy: %d)\n", treeName, inputTree->GetEntries(), inputTree->GetTotBytes(), fastCopy);
247
248
249
+
bool alreadyCopied = false;
248
250
if (trees.count(treeName) == 0) {
249
251
if (mergedDFs > 1) {
250
252
printf(" *** FATAL ***: The tree %s was not in the previous dataframe(s)\n", treeName);
@@ -259,7 +261,9 @@ int main(int argc, char* argv[])
259
261
printf("Writing to output folder %s\n", dfName);
260
262
}
261
263
outputDir->cd();
262
-
auto outputTree = inputTree->CloneTree(0);
264
+
auto outputTree = inputTree->CloneTree(-1, (fastCopy) ? "fast" : "");
265
+
currentDirSize += outputTree->GetTotBytes();
266
+
alreadyCopied = true;
263
267
outputTree->SetAutoFlush(0);
264
268
trees[treeName] = outputTree;
265
269
} else {
@@ -321,30 +325,39 @@ int main(int argc, char* argv[])
321
325
}
322
326
}
323
327
324
-
auto entries = inputTree->GetEntries();
325
-
int minIndexOffset = unassignedIndexOffset[treeName];
326
-
auto newMinIndexOffset = minIndexOffset;
327
-
for (int i = 0; i < entries; i++) {
328
-
for (auto& index : indexList) {
329
-
*(index.first) = 0; // Any positive number will do, in any case it will not be filled in the output. Otherwise the previous entry is used and manipulated in the following.
330
-
}
331
-
inputTree->GetEntry(i);
332
-
// shift index columns by offset
333
-
for (constauto& idx : indexList) {
334
-
// if negative, the index is unassigned. In this case, the different unassigned blocks have to get unique negative IDs
int minIndexOffset = unassignedIndexOffset[treeName];
331
+
auto newMinIndexOffset = minIndexOffset;
332
+
for (int i = 0; i < entries; i++) {
333
+
for (auto& index : indexList) {
334
+
*(index.first) = 0; // Any positive number will do, in any case it will not be filled in the output. Otherwise the previous entry is used and manipulated in the following.
335
+
}
336
+
inputTree->GetEntry(i);
337
+
// shift index columns by offset
338
+
for (constauto& idx : indexList) {
339
+
// if negative, the index is unassigned. In this case, the different unassigned blocks have to get unique negative IDs
0 commit comments