Changeset 251 in svn
- Timestamp:
- Feb 7, 2009, 4:44:02 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r249 r251 35 35 #include <vector> 36 36 #include <iostream> 37 38 #include "Utilities/ExRootAnalysis/interface/ExRootProgressBar.h" 37 39 38 40 using namespace std; … … 317 319 << right << setw(2) <<"**"<<endl; 318 320 321 ExRootProgressBar *Progress = new ExRootProgressBar(allEntries); 322 319 323 loopwatch.Start(); 320 324 … … 322 326 for(entry = 0; entry < allEntries; ++entry) 323 327 { 328 Progress->Update(entry); 324 329 TLorentzVector PTmis(0,0,0,0); 325 330 treeReader->ReadEntry(entry); … … 628 633 delete treeReader; 629 634 delete DET; 630 delete TRIGT;635 // delete TRIGT; 631 636 delete TRACP; 632 637 delete JETRUN; -
trunk/Utilities/ExRootAnalysis/src/ExRootProgressBar.cc
r220 r251 4 4 * Class showing progress bar 5 5 * 6 * $Date: 2009-02-0 2 11:32:01$7 * $Revision: 1. 2$6 * $Date: 2009-02-07 15:44:02 $ 7 * $Revision: 1.3 $ 8 8 * 9 9 * … … 15 15 #include "TSystem.h" 16 16 #include <cstdio> 17 #include <iostream> 17 18 18 19 using namespace std; … … 31 32 ExRootProgressBar::~ExRootProgressBar() 32 33 { 33 if(fBar) delete[] fBar;34 if(fBar) delete[] fBar; 34 35 } 35 36 … … 40 41 ULong_t time = gSystem->Now(); 41 42 42 if(time < fTime + 1000 && entry < fEntries - 1) return;43 if(time < fTime + 500 && entry < fEntries - 1) return; 43 44 44 45 fTime = time; … … 48 49 if(hashes > fHashes) 49 50 { 50 memset(fBar + fHashes, ' #', hashes - fHashes);51 memset(fBar + fHashes, '$', hashes - fHashes); 51 52 fHashes = hashes; 52 53 } 54 float frac=(entry + 1.0)/fEntries*100.0; 55 if(frac<10) fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 56 if(frac==100) fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 57 else fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 58 fflush(stdout); 53 59 54 /* 55 cerr << "[" << fBar << "] ("; 56 cerr.setf(ios::fixed); 57 cerr.precision(2); 58 cerr << (entry + 1.0)/fEntries*100.0 << "%) : "; 59 cerr << entry + 1 << "/" << fEntries; 60 cerr << " events processed\r" << flush; 61 */ 62 63 fprintf(stderr, "[%s] (%.2f%%) : %lli/%lli entries processed\r", fBar, 64 (entry + 1.0)/fEntries*100.0, entry + 1, fEntries); 65 fflush(stderr); 60 if(entry+1==fEntries) 61 { 62 char temp[500]; 63 sprintf(temp, "** [%s] %.2f%% processed ", fBar,(entry + 1.0)/fEntries*100.0); 64 string mystringName(temp); 65 cout << mystringName <<endl; 66 } 66 67 } 67 68
Note:
See TracChangeset
for help on using the changeset viewer.