@@ -95,6 +95,7 @@ Control::Control() :
9595 m_procedureType(Control::ORDINARY_REMOTE_REFERENCE ),
9696 m_readAtsBinary(false ),
9797 m_readMTH5(false ),
98+ m_readMTH5Filters(false ),
9899 m_readElogDualBinary(false ),
99100 m_readElogMTBinary(false ),
100101 m_timingEOFBasedDenoising(Control::BEFORE_DECIMATION ),
@@ -210,16 +211,12 @@ Control::~Control(){
210211}
211212
212213// Run analysis
213- void Control::run (const bool outputToConsole){
214+ void Control::run (const bool outputToConsole) {
214215
215216 OutputFiles* ptrOutputFiles = OutputFiles::getInstance ();
216217 ptrOutputFiles->setOutputToConsole (outputToConsole);
217218 readParameterFile ();
218219
219- #ifdef _MTH5
220- (MTH5::getInstance ())->createChannelResponses (m_filterInfoForMTH5);
221- #endif
222-
223220 m_analysis->run (m_dataFileSets);
224221
225222 ptrOutputFiles->writeLogMessage (" End " + Util::toString (CommonParameters::programName) );
@@ -281,6 +278,11 @@ bool Control::doesReadMTH5() const {
281278 return m_readMTH5;
282279}
283280
281+ // Get flag specifing whether MTH5 filters are read or not
282+ bool Control::doesReadMTH5Filters () const {
283+ return m_readMTH5Filters;
284+ }
285+
284286// Get flag specifing whether input file is ELOG-Dual binary file
285287bool Control::doesReadElogDualBinary () const {
286288 return m_readElogDualBinary;
@@ -427,26 +429,11 @@ int Control::getNumCalibrationFilesForMFS() const {
427429 return static_cast <int >(m_calibrationFilesForMFS.size ());
428430}
429431
430- // Get number of filter info (pair of file name and path) for MTH5
431- int Control::getNumFilterInfoMTH5 () const {
432- return static_cast <int >(m_filterInfoForMTH5.size ());
433- }
434-
435432// Get name of calibration file for MFS
436433std::string Control::getCalibrationFileNameForMFS (const int iFile) const {
437434 return m_calibrationFilesForMFS[iFile];
438435}
439436
440- // Get name of MTH5 file storing filter
441- std::string Control::getFileNameForFilterInMTH5 (const int i) const {
442- return m_filterInfoForMTH5[i].first ;
443- }
444-
445- // Get path of the filter in MTH5 file
446- std::string Control::getPathFilterInMTH5 (const int i) const {
447- return m_filterInfoForMTH5[i].second ;
448- }
449-
450437// Get numebur of calibration files
451438int Control::getNumCalibrationFiles () const {
452439 return static_cast <int >( m_calibrationFiles.size () );
@@ -863,18 +850,7 @@ void Control::readParameterFile(){
863850 }
864851#ifdef _MTH5
865852 else if (line.find (" MTH5_FILTERS" ) != std::string::npos) {
866- const int numChannels = getNumberOfChannels ();
867- m_filterInfoForMTH5.clear ();
868- m_filterInfoForMTH5.reserve (numChannels);
869- m_calibrationFiles.clear ();
870- m_calibrationFiles.reserve (numChannels);
871- for (int iChan = 0 ; iChan < numChannels; ++iChan) {
872- std::string fileName;
873- std::string channelPath;
874- ifs >> fileName >> channelPath;
875- m_filterInfoForMTH5.push_back (std::make_pair (fileName, channelPath));
876- m_calibrationFiles.push_back (MTH5::getCalibrationFileName (iChan));
877- }
853+ m_readMTH5Filters = true ;
878854 }
879855 else if (line.find (" MTH5" ) != std::string::npos) {
880856 m_readMTH5 = true ;
@@ -1748,15 +1724,8 @@ void Control::readParameterFile(){
17481724 }
17491725 if ( doesReadMTH5 () ) {
17501726 ptrOutputFiles->writeLogMessage (" Read MTH5 files" , false );
1751- ptrOutputFiles->writeLogMessage (" Filters stored in MTH5 files are used for the calibration" , false );
1752- ptrOutputFiles->writeLogMessage (" File Path" , false );
1753- for (std::vector< std::pair< std::string, std::string> >::const_iterator itr = m_filterInfoForMTH5.begin (); itr != m_filterInfoForMTH5.end (); ++itr) {
1754- std::ostringstream oss;
1755- oss << std::setw (5 ) << " " ;
1756- oss << itr->first ;
1757- oss << std::setw (5 ) << " " ;
1758- oss << itr->second ;
1759- ptrOutputFiles->writeLogMessage (oss.str (), false );
1727+ if (doesReadMTH5Filters ()) {
1728+ ptrOutputFiles->writeLogMessage (" Read MTH5 filters" , false );
17601729 }
17611730 }
17621731 if (doesMakeCalibrationFileForMFS ()) {
0 commit comments