Public Member Functions | |
ExternalLHEAsciiDumper (const edm::ParameterSet &) | |
~ExternalLHEAsciiDumper () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | endJob () |
virtual void | endRun (edm::Run const &, edm::EventSetup const &) |
Private Attributes | |
std::string | lheFileName_ |
edm::InputTag | lheProduct_ |
Definition at line 34 of file ExternalLHEAsciiDumper.cc.
ExternalLHEAsciiDumper::ExternalLHEAsciiDumper | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 52 of file ExternalLHEAsciiDumper.cc.
: lheProduct_( ps.getParameter<edm::InputTag>("lheProduct") ), lheFileName_( ps.getParameter<std::string>("lheFileName") ) { return; }
ExternalLHEAsciiDumper::~ExternalLHEAsciiDumper | ( | ) |
Definition at line 61 of file ExternalLHEAsciiDumper.cc.
{ }
void ExternalLHEAsciiDumper::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [private, virtual] |
void ExternalLHEAsciiDumper::endJob | ( | void | ) | [private, virtual] |
void ExternalLHEAsciiDumper::endRun | ( | edm::Run const & | iRun, |
edm::EventSetup const & | |||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 73 of file ExternalLHEAsciiDumper.cc.
References alignmentValidation::fname, edm::Run::getByLabel(), i, lheFileName_, lheProduct_, dbtoconf::out, and EdgesToViz::outfile.
{ edm::Handle< LHEXMLStringProduct > LHEAscii; iRun.getByLabel(lheProduct_,LHEAscii); const std::vector<std::string>& lheOutputs = LHEAscii->getStrings(); size_t lastdot = lheFileName_.find_last_of("."); std::string basename = lheFileName_.substr(0, lastdot); std::string extension = lastdot != std::string::npos ? lheFileName_.substr(lastdot+1, std::string::npos) : ""; for (unsigned int i = 0; i < lheOutputs.size(); ++i){ std::ofstream outfile; if (i == 0) outfile.open (lheFileName_.c_str(), std::ofstream::out | std::ofstream::app); else { std::stringstream fname; fname << basename << "_" << i ; if (extension != "") fname << "." << extension; outfile.open (fname.str().c_str(), std::ofstream::out | std::ofstream::app); } outfile << lheOutputs[i]; outfile.close(); } }
std::string ExternalLHEAsciiDumper::lheFileName_ [private] |
Definition at line 46 of file ExternalLHEAsciiDumper.cc.
Referenced by endRun().
Definition at line 45 of file ExternalLHEAsciiDumper.cc.
Referenced by endRun().