Skip to content
Snippets Groups Projects
Commit 5b696022 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

Start to develop the Beam Background generator.

parent c4926c86
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ gaudi_add_module(GenAlgo
src/SLCIORdr.cpp
src/HepMCRdr.cpp
src/GtGunTool.cpp
src/GtBeamBackgroundTool.cpp
LINK ${ROOT_LIBRARIES}
k4FWCore::k4FWCore
Gaudi::GaudiAlgLib
......
#include "GtBeamBackgroundTool.h"
DECLARE_COMPONENT(GtBeamBackgroundTool)
StatusCode GtBeamBackgroundTool::initialize() {
// check the consistency of the properties
// create the instances of the background parsers
return StatusCode::SUCCESS;
}
StatusCode GtBeamBackgroundTool::finalize() {
return StatusCode::SUCCESS;
}
bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) {
return true;
}
bool GtBeamBackgroundTool::finish() {
return true;
}
bool GtBeamBackgroundTool::configure_gentool() {
return true;
}
#ifndef GtBeamBackgroundTool_h
#define GtBeamBackgroundTool_h
/*
* Description:
* This tool is used to simulation the non-collision beam backgrounds.
*
* The properties:
* - InputFileMap
* this is a map to store the label and the input filename
* - InputFormatMap
* this is a map to store the label and the input format
* - InputRateMap
* this is a map to store the label and the rate
*
* Note: the label (key) should be consistent
*
* About the design:
* IBeamBackgroundFileParser is the interface to load the next event.
* Different file formats should be implemented in the corresponding parsers.
* The format will be used to create the corresponding instance.
*
* Author:
* Tao Lin <lintao AT ihep.ac.cn>
*/
#include <GaudiKernel/AlgTool.h>
#include <Gaudi/Property.h>
#include "IGenTool.h"
#include <vector>
#include <map>
class IBeamBackgroundFileParser;
class GtBeamBackgroundTool: public extends<AlgTool, IGenTool> {
public:
using extends::extends;
// Overriding initialize and finalize
StatusCode initialize() override;
StatusCode finalize() override;
// IGenTool
bool mutate(MyHepMC::GenEvent& event) override;
bool finish() override;
bool configure_gentool() override;
private:
Gaudi::Property<std::map<std::string, std::string>> m_inputmaps{this, "InputFileMap"};
Gaudi::Property<std::map<std::string, std::string>> m_fomatmaps{this, "InputFormatMap"};
Gaudi::Property<std::map<std::string, double>> m_ratemaps {this, "InputRateMap"};
private:
std::map<std::string, std::shared_ptr<IBeamBackgroundFileParser>> m_beaminputs;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment