From 3de15cb3f7112a9a388acfa809314b951fea79df Mon Sep 17 00:00:00 2001 From: Adrien Matta <matta@lpccaen.in2p3.fr> Date: Thu, 7 Feb 2019 16:01:00 +0100 Subject: [PATCH] *Adding option to set the tree circular --- NPLib/Core/NPOptionManager.cxx | 4 ++++ NPLib/Core/NPOptionManager.h | 2 ++ NPLib/Core/RootOutput.cxx | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/NPLib/Core/NPOptionManager.cxx b/NPLib/Core/NPOptionManager.cxx index 7c797e36a..914984518 100644 --- a/NPLib/Core/NPOptionManager.cxx +++ b/NPLib/Core/NPOptionManager.cxx @@ -76,6 +76,7 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ fInputPhysicalTreeOption = false; fGenerateHistoOption = false ; fPROOFMode = false; + fCircularTree = false; fOnline = false; fG4BatchMode = false; #ifdef __linux__ @@ -159,6 +160,8 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ else if (argument == "--online") {fOnline = true ;fGenerateHistoOption=true;} + else if (argument == "--circular") {fCircularTree = true;} + //else ; } @@ -408,6 +411,7 @@ void NPOptionManager::DisplayHelp(){ std::cout << "\t--last-res\t\t\tIgnore the list of Run to treat if any and analysed the last Result file" << std::endl ; std::cout << "\t--last-any\t\t\tIgnore the list of Run to treat if any and analysed the last generated root file" << std::endl ; std::cout << "\t--online \t\t\tStart the spectra server" << std::endl ; + std::cout << "\t--circular \t\t\tSet the output tree a circular one" << std::endl ; std::cout << std::endl << "NPSimulation only:"<<std::endl; std::cout << "\t-M <arg>\t\t\tExecute Geant4 macro <arg> at startup" << std::endl ; std::cout << "\t-B <arg>\t\t\tExecute in batch mode (no ui) with Geant4 macro <arg> at startup" << std::endl ; diff --git a/NPLib/Core/NPOptionManager.h b/NPLib/Core/NPOptionManager.h index 88fe77f63..937cc7c51 100644 --- a/NPLib/Core/NPOptionManager.h +++ b/NPLib/Core/NPOptionManager.h @@ -102,6 +102,7 @@ class NPOptionManager{ bool GetOnline() {return fOnline;} bool GetPROOF() {return fPROOFMode;} bool GetG4BatchMode() {return fG4BatchMode;} + bool GetCircularTree() {return fCircularTree;} int GetVerboseLevel() {return fVerboseLevel;} int GetNumberOfEntryToAnalyse() {return fNumberOfEntryToAnalyse;} int GetFirstEntryToAnalyse() {return fFirstEntryToAnalyse;} @@ -141,6 +142,7 @@ class NPOptionManager{ bool fLastPhyFile; bool fLastResFile; bool fLastAnyFile; + bool fCircularTree; int fVerboseLevel; // 0 for not talk, 1 for talking int fNumberOfEntryToAnalyse; // use to limit the number of analysed in NPA int fFirstEntryToAnalyse; // use to set the first event analysed in NPA (total: fFirstEntryToAnalyse -> fFirstEntryToAnalyse + fNumberOfEntryToAnalyse) diff --git a/NPLib/Core/RootOutput.cxx b/NPLib/Core/RootOutput.cxx index e267880a2..76d05c17b 100644 --- a/NPLib/Core/RootOutput.cxx +++ b/NPLib/Core/RootOutput.cxx @@ -125,6 +125,10 @@ RootOutput::RootOutput(std::string fileNameBase, std::string treeNameBase){ // Init TAsciiFile objects InitAsciiFiles(); gDirectory->cd(currentPath->GetPath()); + + if(!NPOptionManager::getInstance()->GetCircularTree()){ + pRootTree->SetCircular(10000); + } } -- GitLab