Changeset 19798 for trunk/FACT++
- Timestamp:
- 10/26/19 16:32:49 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/csv2root.cc
r19796 r19798 398 398 } 399 399 400 ttree[index]->Fill(); 400 // Fill only branches for which an adress was set 401 // If we fill the tree, we get empty entries at the 402 // end of the already written branches 403 TIter NextBranch(ttree[index]->GetListOfBranches()); 404 TBranch *b=0; 405 while ((b=static_cast<TBranch*>(NextBranch()))) 406 if (b->GetAddress()) 407 b->Fill(); 408 } 409 410 for (auto it=ttree.begin(); it!=ttree.end(); it++) 411 { 412 if (update) 413 { 414 TIter NextBranch((*it)->GetListOfBranches()); 415 TBranch *b=0; 416 while ((b=static_cast<TBranch*>(NextBranch()))) 417 if (b->GetAddress() && b->GetEntries()>0) 418 { 419 (*it)->SetEntries(b->GetEntries()); 420 break; 421 } 422 } 423 424 (*it)->Write("", TObject::kOverwrite); 401 425 } 402 426 … … 404 428 { 405 429 cout << valid << " data rows found in " << line << " lines (excl. title)." << endl; 406 if (!update || !entries) 407 { 408 for (size_t i=0; i<ttree.size(); i++) 409 cout << ttree[i]->GetEntries() << " rows filled into tree #" << i << "." << endl; 410 } 430 for (size_t i=0; i<ttree.size(); i++) 431 cout << ttree[i]->GetEntries() << " rows filled into tree #" << i << "." << endl; 411 432 } 412 433 … … 414 435 cerr << "\nWARNING - Number of updated entries does not match number of entries in tree!\n" << endl; 415 436 416 for (auto it=ttree.begin(); it!=ttree.end(); it++)417 (*it)->Write("", TObject::kOverwrite);418 437 tfile.Close(); 419 438
Note:
See TracChangeset
for help on using the changeset viewer.