From 51ca041b87811428c87f584212470b7e6b296138 Mon Sep 17 00:00:00 2001 From: lintao <lintao51@gmail.com> Date: Tue, 12 Oct 2021 17:11:28 +0800 Subject: [PATCH] WIP: add an implementation. --- Generator/CMakeLists.txt | 2 ++ Generator/src/BeamBackgroundFileParserV0.cpp | 10 ++++++++++ Generator/src/BeamBackgroundFileParserV0.h | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 Generator/src/BeamBackgroundFileParserV0.cpp create mode 100644 Generator/src/BeamBackgroundFileParserV0.h diff --git a/Generator/CMakeLists.txt b/Generator/CMakeLists.txt index 9264abd8..6169e415 100644 --- a/Generator/CMakeLists.txt +++ b/Generator/CMakeLists.txt @@ -15,7 +15,9 @@ gaudi_add_module(GenAlgo src/SLCIORdr.cpp src/HepMCRdr.cpp src/GtGunTool.cpp + # ------- Beam Background ------- src/GtBeamBackgroundTool.cpp + src/BeamBackgroundFileParserV0.cpp LINK ${ROOT_LIBRARIES} k4FWCore::k4FWCore Gaudi::GaudiAlgLib diff --git a/Generator/src/BeamBackgroundFileParserV0.cpp b/Generator/src/BeamBackgroundFileParserV0.cpp new file mode 100644 index 00000000..9a5447dc --- /dev/null +++ b/Generator/src/BeamBackgroundFileParserV0.cpp @@ -0,0 +1,10 @@ + +#include "BeamBackgroundFileParserV0.h" + +BeamBackgroundFileParserV0::BeamBackgroundFileParserV0(const std::string& filename) { + m_input.open(filename.c_str()); +} + +bool BeamBackgroundFileParserV0::load(IBeamBackgroundFileParser::BeamBackgroundData& result) { + return true; +} diff --git a/Generator/src/BeamBackgroundFileParserV0.h b/Generator/src/BeamBackgroundFileParserV0.h new file mode 100644 index 00000000..906d5814 --- /dev/null +++ b/Generator/src/BeamBackgroundFileParserV0.h @@ -0,0 +1,17 @@ +#ifndef BeamBackgroundFileParserV0_h +#define BeamBackgroundFileParserV0_h + +#include "IBeamBackgroundFileParser.h" + +#include <fstream> + +class BeamBackgroundFileParserV0: public IBeamBackgroundFileParser { +public: + BeamBackgroundFileParserV0(const std::string& filename); + + bool load(IBeamBackgroundFileParser::BeamBackgroundData&); +private: + std::ifstream m_input; +}; + +#endif -- GitLab