Skip to content
Snippets Groups Projects
Commit d5f021b5 authored by matta's avatar matta
Browse files

* Adding option to DetectorManager

 - User can no desable all branch except the one concerning the NPA detector in order to improve execution speed
parent 5be61cce
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,8 @@ NPOptionManager::NPOptionManager(int argc,char** argv) ...@@ -43,7 +43,8 @@ NPOptionManager::NPOptionManager(int argc,char** argv)
fDetectorFileName = "myDetector.detector" ; fDetectorFileName = "myDetector.detector" ;
fOutputFileName = "myResult" ; fOutputFileName = "myResult" ;
fRunToReadFileName = "RunToRead.txt" ; fRunToReadFileName = "RunToRead.txt" ;
fCalibrationFileName = "Calibration.txt" ; fCalibrationFileName = "Calibration.txt" ;
fDisableAllBranchOption = false;
for (int i = 0 ; i < argc ; i++) for (int i = 0 ; i < argc ; i++)
{ {
...@@ -72,6 +73,8 @@ NPOptionManager::NPOptionManager(int argc,char** argv) ...@@ -72,6 +73,8 @@ NPOptionManager::NPOptionManager(int argc,char** argv)
else if(argument == "-C" && argc>=i+1 ) fCalibrationFileName = argv[i+1] ; else if(argument == "-C" && argc>=i+1 ) fCalibrationFileName = argv[i+1] ;
else if(argument == "--disable-branch" ) fDisableAllBranchOption = true ;
else ; else ;
} }
...@@ -88,6 +91,7 @@ void NPOptionManager::DisplayHelp() ...@@ -88,6 +91,7 @@ void NPOptionManager::DisplayHelp()
cout << "\t --help -H -h\t \t \t \t \t \t \t Display this help message" << endl ; cout << "\t --help -H -h\t \t \t \t \t \t \t Display this help message" << endl ;
cout << "\t --output -O <arg>\t \t \t \t \t \t Set arg as the Output File Name (output tree)" << endl ; cout << "\t --output -O <arg>\t \t \t \t \t \t Set arg as the Output File Name (output tree)" << endl ;
cout << "\t --run -R <arg>\t \t \t \t \t \t \t Set arg as the run to read file list" << endl ; cout << "\t --run -R <arg>\t \t \t \t \t \t \t Set arg as the run to read file list" << endl ;
cout << "\t --disable-branch\t \t \t \t \t \t Disable of branch of Input tree except the one of the detector (faster)" << endl ;
cout << endl << endl ; cout << endl << endl ;
// exit current program // exit current program
......
...@@ -62,18 +62,20 @@ class NPOptionManager ...@@ -62,18 +62,20 @@ class NPOptionManager
void DisplayHelp(); void DisplayHelp();
public: public:
string GetReactionFilePath() { return fReactionFileName ; } ; string GetReactionFilePath() { return fReactionFileName ; } ;
string GetDetectorFilePath() { return fDetectorFileName ; } ; string GetDetectorFilePath() { return fDetectorFileName ; } ;
string GetRunToReadFilePath() { return fRunToReadFileName ; } ; string GetRunToReadFilePath() { return fRunToReadFileName ; } ;
string GetCalibrationFilePath() { return fCalibrationFileName ; } ; string GetCalibrationFilePath() { return fCalibrationFileName ; } ;
string GetOutputFilePath() { return fOutputFileName ; } ; string GetOutputFilePath() { return fOutputFileName ; } ;
bool GetDisableAllBranchOption() { return fDisableAllBranchOption ; } ;
private: private:
string fReactionFileName ; string fReactionFileName ;
string fDetectorFileName ; string fDetectorFileName ;
string fRunToReadFileName ; string fRunToReadFileName ;
string fCalibrationFileName ; string fCalibrationFileName ;
string fOutputFileName ; string fOutputFileName ;
bool fDisableAllBranchOption ;
}; };
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include "../GASPARD/GaspardTracker.h" #include "../GASPARD/GaspardTracker.h"
#include "../Paris/Paris.h" #include "../Paris/Paris.h"
#include "../Shield/Shield.h" #include "../Shield/Shield.h"
#include "../Tools/NPOptionManager.h"
#include "../IORoot/RootInput.h"
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
// Default Constructor // Default Constructor
DetectorManager::DetectorManager() DetectorManager::DetectorManager()
...@@ -325,6 +325,10 @@ void DetectorManager::BuildSimplePhysicalEvent() ...@@ -325,6 +325,10 @@ void DetectorManager::BuildSimplePhysicalEvent()
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
void DetectorManager::InitializeRootInput() void DetectorManager::InitializeRootInput()
{ {
if( NPOptionManager::getInstance()->GetDisableAllBranchOption() )
RootInput::getInstance()->GetChain()->SetBranchStatus ( "*" , false ) ;
map<string,VDetector*>::iterator it; map<string,VDetector*>::iterator it;
for (it = m_Detector.begin(); it != m_Detector.end(); ++it) { for (it = m_Detector.begin(); it != m_Detector.end(); ++it) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment