#include <RHStopDump.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
RHStopDump (const edm::ParameterSet &) | |
virtual | ~RHStopDump () |
Private Attributes | |
std::string | mProducer |
std::ofstream | mStream |
Definition at line 13 of file RHStopDump.h.
RHStopDump::RHStopDump | ( | const edm::ParameterSet & | parameters | ) | [explicit] |
Definition at line 7 of file RHStopDump.cc.
: mStream (parameters.getParameter<std::string>("stoppedFile").c_str()), mProducer (parameters.getUntrackedParameter<std::string>("producer", "g4SimHits")) {}
virtual RHStopDump::~RHStopDump | ( | ) | [inline, virtual] |
Definition at line 16 of file RHStopDump.h.
{};
void RHStopDump::analyze | ( | const edm::Event & | fEvent, |
const edm::EventSetup & | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 12 of file RHStopDump.cc.
References edm::Event::getByLabel(), i, mProducer, mStream, and h::names.
{ edm::Handle<std::vector<std::string> > names; fEvent.getByLabel (mProducer, "StoppedParticlesName", names); edm::Handle<std::vector<float> > xs; fEvent.getByLabel (mProducer, "StoppedParticlesX", xs); edm::Handle<std::vector<float> > ys; fEvent.getByLabel (mProducer, "StoppedParticlesY", ys); edm::Handle<std::vector<float> > zs; fEvent.getByLabel (mProducer, "StoppedParticlesZ", zs); if (names->size() != xs->size() || xs->size() != ys->size() || ys->size() != zs->size()) { edm::LogError ("RHStopDump") << "mismatch array sizes name/x/y/z:" << names->size() << '/' << xs->size() << '/' << ys->size() << '/' << zs->size() << std::endl; } else { for (size_t i = 0; i < names->size(); ++i) { mStream << (*names)[i] << ' ' << (*xs)[i] << ' ' << (*ys)[i] << ' ' << (*zs)[i] << std::endl; } } }
std::string RHStopDump::mProducer [private] |
Definition at line 20 of file RHStopDump.h.
Referenced by analyze().
std::ofstream RHStopDump::mStream [private] |
Definition at line 19 of file RHStopDump.h.
Referenced by analyze().