17 #include <HepMC/GenEvent.h>
19 #include <CLHEP/Random/RandomEngine.h>
20 #include <CLHEP/Random/MTwistEngine.h>
21 #include <CLHEP/Random/RandFlat.h>
22 #include <CLHEP/Vector/LorentzVector.h>
23 #include <CLHEP/Geometry/Point3D.h>
25 #include <boost/property_tree/ptree.hpp>
26 #include <boost/property_tree/xml_parser.hpp>
27 #include <boost/foreach.hpp>
28 #include <boost/lexical_cast.hpp>
30 #include <flowAfterburner.h>
38 config_filename(
"flowAfterburner.xml"),
39 algorithmName(
"JJNEW"),
58 using boost::property_tree::ptree;
61 std::ifstream config_file(config_filename.c_str());
66 read_xml (config_file, pt);
79 if (isfinite(mineta_macro))
81 mineta = mineta_macro;
85 mineta = pt.get(
"FLOWAFTERBURNER.CUTS.MINETA", mineta);
87 if (isfinite(maxeta_macro))
89 maxeta = maxeta_macro;
93 maxeta = pt.get(
"FLOWAFTERBURNER.CUTS.MAXETA", maxeta);
95 if (isfinite(minpt_macro))
101 minpt = pt.get(
"FLOWAFTERBURNER.CUTS.MINPT", minpt);
104 if (isfinite(maxpt_macro))
110 maxpt = pt.get(
"FLOWAFTERBURNER.CUTS.MAXPT", maxpt);
113 if (algorithmName_macro.size() > 0)
115 algorithmName = algorithmName_macro;
119 algorithmName = pt.get(
"FLOWAFTERBURNER.ALGORITHM", algorithmName);
128 PHHepMCGenEvent *genevt = findNode::getClass<PHHepMCGenEvent>(topNode,
"PHHepMCGenEvent");
129 HepMC::GenEvent *evt = genevt->
getEvent();
132 cout <<
PHWHERE <<
" no evt pointer under HEPMC Node found" << endl;
137 cout <<
"calling flowAfterburner with algorithm "
138 << algorithmName <<
", mineta " << mineta
139 <<
", maxeta: " << maxeta <<
", minpt: " << minpt
140 <<
", maxpt: " << maxpt << endl;
142 flowAfterburner(evt,
engine, algorithmName, mineta, maxeta, minpt, maxpt);
147 HepMCFlowAfterBurner::setSeed(
const long il)
163 HepMCFlowAfterBurner::SaveRandomState(
const string &savefile)
167 engine->saveStatus(savefile.c_str());
170 cout <<
PHWHERE <<
" Radom engine not started yet" << endl;
174 HepMCFlowAfterBurner::RestoreRandomState(
const string &savefile)
178 engine->restoreStatus(savefile.c_str());
181 cout <<
PHWHERE <<
" Radom engine not started yet" << endl;
virtual int process_event(PHCompositeNode *)
virtual int Init(PHCompositeNode *)
int verbosity
The verbosity level. 0 means not verbose at all.
CLHEP::HepRandomEngine * engine
virtual HepMC::GenEvent * getEvent()
HepMCFlowAfterBurner(const std::string &name="HEPMCFLOW")