CMS 3D CMS Logo

Public Member Functions | Private Attributes

RHStopDump Class Reference

#include <RHStopDump.h>

Inheritance diagram for RHStopDump:
edm::EDAnalyzer

List of all members.

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

Detailed Description

Definition at line 13 of file RHStopDump.h.


Constructor & Destructor Documentation

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.

{};

Member Function Documentation

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;
     }
   }
 }

Member Data Documentation

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().