diff --git a/NPLib/Core/NPDetectorManager.cxx b/NPLib/Core/NPDetectorManager.cxx index 722894c8a9e69d3d7b96f144fb4ecf7b751decf7..05bb7754b512e664e7f7f4a0ce00f4eecddb9d41 100644 --- a/NPLib/Core/NPDetectorManager.cxx +++ b/NPLib/Core/NPDetectorManager.cxx @@ -289,7 +289,7 @@ void NPA::DetectorManager::InitThreadPool(){ cout << "\033[1;33m**** Detector Manager : Started " << i << " Threads ****\033[0m" << endl ; // Sleep to let the time to the thread to start - this_thread::sleep_for (std::chrono::milliseconds(1)); + this_thread::sleep_for (std::chrono::milliseconds(100)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/NPLib/Core/RootInput.cxx b/NPLib/Core/RootInput.cxx index 495d552260fc1873701082e2f79299350dd1873d..94706bc3bdfe648e62008e73a78377b504bbc446 100644 --- a/NPLib/Core/RootInput.cxx +++ b/NPLib/Core/RootInput.cxx @@ -131,15 +131,18 @@ RootInput::RootInput(string configFileName){ exit(1); } else{ - cout << "\033[1;32mROOTInput: " << pRootChain->GetEntries() << " entries loaded in the input chain\033[0m" << endl ; + cout << "\033[1;32mROOTInput: " << pRootChain->GetEntries() << " entries loaded in the input chain\033[0m" << endl ; } - - } + + } if (!CheckRootFileName || !CheckTreeName) cout << "\033[1;33mWARNING: Token not found for InputTree Declaration : Input Tree may not be instantiate properly\033[0m" << endl; + int cachesize = 10000000; //100 MBytes + pRootChain->SetCacheSize(cachesize); pRootChain->SetCacheLearnEntries(100); + gEnv->SetValue("TFile.AsyncPrefetching", 1); } @@ -285,6 +288,9 @@ RootInput::~RootInput(){ if (res == 0) { // if does exist, delete it if (system("rm -rf ./.tmp") != 0) cout << "RootInput::~RootInput() problem deleting ./.tmp directory" << endl; } + cout << endl << "Root Input summary" << endl; + cout << " - Number of bites read: " << pRootFile->GetBytesRead() << endl; + cout << " - Number of transactions: " << pRootFile->GetReadCalls() << endl; } //////////////////////////////////////////////////////////////////////////////// diff --git a/NPLib/Core/RootOutput.cxx b/NPLib/Core/RootOutput.cxx index f8191733f3ea05e3eacad16ec606e30da1464a60..408d90eccb5de048f8363fd27f4d7c6dde8aaaa6 100644 --- a/NPLib/Core/RootOutput.cxx +++ b/NPLib/Core/RootOutput.cxx @@ -132,7 +132,7 @@ RootOutput::~RootOutput() TDirectory* currentPath= gDirectory; gDirectory->cd(pRootFile->GetPath()); cout << endl; - cout << "Got histograms and Tree !" << endl; + cout << endl << "Root Output summary" << endl; cout << " - Number of entries in the Tree: " << pRootTree->GetEntries() << endl; cout << " - Number of bites written to file: " << pRootTree->Write("", TObject::kOverwrite) << endl; diff --git a/NPLib/Utility/npanalysis.cxx b/NPLib/Utility/npanalysis.cxx index 328dd5cf2b42e3e85b4d65b68225901e76657dd0..b82318d232f5cd9d9bf38b2660783a66a4499542 100644 --- a/NPLib/Utility/npanalysis.cxx +++ b/NPLib/Utility/npanalysis.cxx @@ -114,6 +114,7 @@ int main(int argc , char** argv){ #endif ProgressDisplay(begin,end,treated,inter,nentries); RootOutput::getInstance()->Destroy(); + RootInput::getInstance()->Destroy(); return 0; } @@ -135,9 +136,10 @@ void ProgressDisplay(clock_t& begin, clock_t& end, unsigned int& treated,unsigne if(treated!=total) printf("\r \033[1;31m ******* Progress: %.1f%% | Rate: %.1fk evt/s | Remain: %s *******\033[0m", percent,event_rate/1000.,timer); - else + else{ + printf("\r "); printf("\r \033[1;32m ******* Progress: %.1f%% | Rate: %.1fk evt/s | Remain: %s *******\033[0m", percent,event_rate/1000.,timer); - + } fflush(stdout); inter=0; begin = clock() ;