diff --git a/NPAnalysis/10He_Riken/Analysis b/NPAnalysis/10He_Riken/Analysis index cf79ecf074b7abdf28d3a2bb5b17cac87ad2e359..a183cdf33d9798cb81ea8c62a0a7ba06212add83 100755 Binary files a/NPAnalysis/10He_Riken/Analysis and b/NPAnalysis/10He_Riken/Analysis differ diff --git a/NPAnalysis/10He_Riken/RunToTreat.txt b/NPAnalysis/10He_Riken/RunToTreat.txt index 008354fd1b9fa2d1c15477a463be1e2bf76a6b7e..20112b7d8b8825fad03d1ba1198c1c975c379dc5 100644 --- a/NPAnalysis/10He_Riken/RunToTreat.txt +++ b/NPAnalysis/10He_Riken/RunToTreat.txt @@ -1,4 +1,6 @@ TTreeName SimulatedTree RootFileName - ../../Outputs/Simulation/mySimul.root + ../../Outputs/Simulation/mySimul_0.root + ../../Outputs/Simulation/mySimul_1.root + ../../Outputs/Simulation/mySimul_0.root diff --git a/NPLib/IORoot/RootInput.cxx b/NPLib/IORoot/RootInput.cxx index f6c60f5c0e234a1513134af1f1f076d542d40506..d48d101bded2fe2d7e6a6bfa73a24f3f4cbae17b 100644 --- a/NPLib/IORoot/RootInput.cxx +++ b/NPLib/IORoot/RootInput.cxx @@ -51,55 +51,57 @@ void RootInput::Destroy() // fileNameBase doit etre le nom du TChain. RootInput::RootInput(string configFileName) { - bool CheckTreeName = false ; - bool CheckRootFileName = false ; + bool CheckTreeName = false; + bool CheckRootFileName = false; - // Read configuration file Buffer + // Read configuration file Buffer string lineBuffer, dataBuffer; // Open file ifstream inputConfigFile; inputConfigFile.open(configFileName.c_str()); - pRootChain = new TChain() ; + pRootChain = new TChain(); - if(!inputConfigFile) { cout << "Run to Read file :" << configFileName << " not found " << endl ; return ;} - - else - { - while (!inputConfigFile.eof()) - { - getline(inputConfigFile, lineBuffer); - - // search for token giving the TTree name - if (lineBuffer.compare(0, 9, "TTreeName") == 0) - { - inputConfigFile >> dataBuffer; - // initialize pRootChain - pRootChain->SetName(dataBuffer.c_str()); - CheckTreeName = true ; - } - - // search for token giving the list of Root files to treat - else if (lineBuffer.compare(0, 12, "RootFileName") == 0 && pRootChain) - { - inputConfigFile >> dataBuffer; - while (!inputConfigFile.eof()) - { - inputConfigFile >> dataBuffer; - pRootChain->Add(dataBuffer.c_str()); - CheckRootFileName = true ; - } - - } - } - - } + cout << "/////////////////////////////////" << endl; + cout << "Initializing input TChain" << endl; + + if (!inputConfigFile) { + cout << "Run to Read file :" << configFileName << " not found " << endl; + return; + } + else { + while (!inputConfigFile.eof()) { + getline(inputConfigFile, lineBuffer); + + // search for token giving the TTree name + if (lineBuffer.compare(0, 9, "TTreeName") == 0) { + inputConfigFile >> dataBuffer; + // initialize pRootChain + pRootChain->SetName(dataBuffer.c_str()); + CheckTreeName = true ; + } + + // search for token giving the list of Root files to treat + else if (lineBuffer.compare(0, 12, "RootFileName") == 0 && pRootChain) { + CheckRootFileName = true ; + + while (!inputConfigFile.eof()) { + inputConfigFile >> dataBuffer; + + if (!inputConfigFile.eof()) { + pRootChain->Add(dataBuffer.c_str()); + cout << "Adding file " << dataBuffer << " to TChain" << endl; + } + } + } + } + } - - if(!CheckRootFileName || !CheckTreeName) cout << "WARNING: Token not found for InputTree Declaration : Input Tree may not be instantiate properly" << endl ; - - + if (!CheckRootFileName || !CheckTreeName) + cout << "WARNING: Token not found for InputTree Declaration : Input Tree may not be instantiate properly" << endl; + + cout << "/////////////////////////////////" << endl; }