From 47d84e8dca6d41fb6964a3ec5a827e1647fa7f49 Mon Sep 17 00:00:00 2001 From: gwm17 Date: Fri, 26 May 2023 14:45:30 -0400 Subject: [PATCH] Update gitignore. Cleanup DetectorApp --- .gitignore | 1 + src/Detectors/DetectorApp.cpp | 75 ++--------------------------------- src/Detectors/DetectorApp.h | 1 - src/Detectors/main.cpp | 2 +- 4 files changed, 6 insertions(+), 73 deletions(-) diff --git a/.gitignore b/.gitignore index a049541..4e94ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ build/ lib/ bin/ scripts/ +*.yaml ###Keep this file### diff --git a/src/Detectors/DetectorApp.cpp b/src/Detectors/DetectorApp.cpp index b2d3be0..351a8e7 100644 --- a/src/Detectors/DetectorApp.cpp +++ b/src/Detectors/DetectorApp.cpp @@ -15,7 +15,7 @@ DetectorApp::~DetectorApp() delete m_detectorList[i]; } -bool DetectorApp::ParseConfig(const std::string& filename) +bool DetectorApp::LoadConfig(const std::string& filename) { std::cout<<"----------Detector Efficiency Calculation----------"<(); ArrayType type = StringToArrayType(data["ArrayType"].as()); - std::cout << "Creating " << m_nthreads << " detector arrays..." << std::endl; for(uint64_t i=0; iSetDeadChannelMap(m_deadChannelFileName); } - - std::cout << "Allocating " << m_nthreads << " threads..." << std::endl; m_resources = std::make_unique>(m_nthreads); - std::cout << "Opening input data file " << m_inputFileName << "..." << std::endl; m_fileReader.Open(m_inputFileName, "SimTree"); if(!m_fileReader.IsOpen() || !m_fileReader.IsTree()) { @@ -54,7 +50,6 @@ bool DetectorApp::ParseConfig(const std::string& filename) return false; } m_nentries = m_fileReader.GetSize(); - std::cout << "Detected " << m_nentries << " events in the file..." << std::endl; //Little bit of integer division mangling to make sure we read every event in file uint64_t quotient = m_nentries / m_nthreads; @@ -63,7 +58,6 @@ bool DetectorApp::ParseConfig(const std::string& filename) for(uint64_t i=1; i> junk >> m_inputFileName; - input >> junk >> m_outputFileName; - input >> junk >> m_deadChannelFileName; - - input >> junk >> m_nthreads; - input >> junk >> typeName; - - std::cout << "Creating " << m_nthreads << " detector arrays..." << std::endl; - ArrayType type = StringToArrayType(typeName); - for(uint64_t i=0; iSetDeadChannelMap(m_deadChannelFileName); - } - std::cout << "Done" << std::endl; - std::cout << "Allocating " << m_nthreads << " threads..." << std::endl; - m_resources = std::make_unique>(m_nthreads); - std::cout << "Done" << std::endl; - - std::cout << "Opening input data file " << m_inputFileName << "..." << std::endl; - m_fileReader.Open(m_inputFileName, "SimTree"); - if(!m_fileReader.IsOpen() || !m_fileReader.IsTree()) - { - std::cerr << "Unable to open input data file " << m_inputFileName << std::endl; - return false; - } - m_nentries = m_fileReader.GetSize(); - std::cout << "Done. Detected " << m_nentries << " events in the file." << std::endl; - - //Little bit of integer division mangling to make sure we read every event in file - uint64_t quotient = m_nentries / m_nthreads; - uint64_t remainder = m_nentries % m_nthreads; - m_chunkSamples.push_back(quotient + remainder); - for(uint64_t i=1; i