From 0eaddea8d6c0e2729c72836e40d1057d78daecfe Mon Sep 17 00:00:00 2001 From: deserevi <deserevi@nptool> Date: Wed, 23 Sep 2009 21:04:42 +0000 Subject: [PATCH] * Add comment symbol (%) support when reading input file in NPA - changes made in RootInput.cxx file --- NPAnalysis/Gaspard/RunToTreat.txt | 2 ++ NPLib/IORoot/RootInput.cxx | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NPAnalysis/Gaspard/RunToTreat.txt b/NPAnalysis/Gaspard/RunToTreat.txt index 008354fd1..e62f63776 100644 --- a/NPAnalysis/Gaspard/RunToTreat.txt +++ b/NPAnalysis/Gaspard/RunToTreat.txt @@ -1,4 +1,6 @@ TTreeName SimulatedTree RootFileName + ../../Outputs/Simulation/mySimul_test.root +% ../../Outputs/Simulation/mySimul.root ../../Outputs/Simulation/mySimul.root diff --git a/NPLib/IORoot/RootInput.cxx b/NPLib/IORoot/RootInput.cxx index d48d101bd..816fb3dc0 100644 --- a/NPLib/IORoot/RootInput.cxx +++ b/NPLib/IORoot/RootInput.cxx @@ -89,7 +89,12 @@ RootInput::RootInput(string configFileName) while (!inputConfigFile.eof()) { inputConfigFile >> dataBuffer; - if (!inputConfigFile.eof()) { + // ignore comment Line + if (dataBuffer.compare(0, 1, "%") == 0) { + inputConfigFile.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); + } + + else if (!inputConfigFile.eof()) { pRootChain->Add(dataBuffer.c_str()); cout << "Adding file " << dataBuffer << " to TChain" << endl; } -- GitLab