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

WIP: clean GenAlgo.

parent f5124078
No related branches found
No related tags found
No related merge requests found
...@@ -13,14 +13,7 @@ ...@@ -13,14 +13,7 @@
#include "IGenTool.h" #include "IGenTool.h"
#include "GenEvent.h" #include "GenEvent.h"
// #include "StdHepRdr.h"
// #include "HepevtRdr.h"// not correct still
// #include "SLCIORdr.h"
// #include "HepMCRdr.h"
// #include "GenPrinter.h"
// #include "GenWriter.h"
using namespace std;
DECLARE_COMPONENT(GenAlgo) DECLARE_COMPONENT(GenAlgo)
...@@ -42,25 +35,6 @@ GenAlgo::initialize() { ...@@ -42,25 +35,6 @@ GenAlgo::initialize() {
m_genTools.push_back(gtname); m_genTools.push_back(gtname);
} }
// cout << "initialize start" << endl;
// string generatorName = m_input_file.value();
// string outputName = m_output_file.value();
// string format = m_input_format.value();
// IGenTool* gen_reader;
// if(format=="stdhep") gen_reader = new StdHepRdr(generatorName);
// else if(format=="slcio") gen_reader = new SLCIORdr(generatorName);
// else if(format=="hepmc") gen_reader = new HepMCRdr(generatorName);
// else{cout << "Error : unsupport format for generator input file" << endl; return StatusCode::FAILURE; }
// //IGenTool* gen_reader = new HepevtRdr(generatorName);
// m_genTools.push_back(gen_reader);
// if(m_print.value()) {
// IGenTool* gen_printer = new GenPrinter(generatorName);
// m_genTools.push_back(gen_printer);
// }
//IGenTool* gen_writer = new GenWriter (outputName);
//m_genTools.push_back(gen_writer);
// cout << "initialize done" << endl;
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -74,16 +48,16 @@ GenAlgo::execute() { ...@@ -74,16 +48,16 @@ GenAlgo::execute() {
for(auto gentool: m_genTools) { for(auto gentool: m_genTools) {
if (gentool->mutate(m_event)) {} if (gentool->mutate(m_event)) {}
else { else {
cout << "Have read all events, stop now." << endl; warning() << "Have read all events, stop now." << endmsg;
auto ep = serviceLocator()->as<IEventProcessor>(); auto ep = serviceLocator()->as<IEventProcessor>();
if ( !ep ) { if ( !ep ) {
error() << "Cannot get IEventProcessor" << endmsg; error() << "Cannot get IEventProcessor" << endmsg;
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
ep->stopRun(); ep->stopRun();
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -92,10 +66,5 @@ GenAlgo::execute() { ...@@ -92,10 +66,5 @@ GenAlgo::execute() {
StatusCode StatusCode
GenAlgo::finalize() { GenAlgo::finalize() {
// cout << "finalize" << endl;
// for(auto gentool: m_genTools) {
// if (gentool->finish()) {}
// else {cout << "finish Failed" << endl; return StatusCode::FAILURE; }
// }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -12,12 +12,6 @@ ...@@ -12,12 +12,6 @@
#include "GenEvent.h" #include "GenEvent.h"
class IGenTool; class IGenTool;
namespace plcio {
class MCParticleCollection;
}
using namespace std;
class GenAlgo: public GaudiAlgorithm { class GenAlgo: public GaudiAlgorithm {
......
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