CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RHStopDump.cc
Go to the documentation of this file.
1 #include "RHStopDump.h"
2 
6 
8  : mStream (parameters.getParameter<std::string>("stoppedFile").c_str()),
9  mProducer (parameters.getUntrackedParameter<std::string>("producer", "g4SimHits"))
10 {}
11 
12  void RHStopDump::analyze(const edm::Event& fEvent, const edm::EventSetup&) {
14  fEvent.getByLabel (mProducer, "StoppedParticlesName", names);
16  fEvent.getByLabel (mProducer, "StoppedParticlesX", xs);
18  fEvent.getByLabel (mProducer, "StoppedParticlesY", ys);
20  fEvent.getByLabel (mProducer, "StoppedParticlesZ", zs);
21  if (names->size() != xs->size() || xs->size() != ys->size() || ys->size() != zs->size()) {
22  edm::LogError ("RHStopDump") << "mismatch array sizes name/x/y/z:"
23  << names->size() << '/' << xs->size() << '/' << ys->size() << '/' << zs->size()
24  << std::endl;
25  }
26  else {
27  for (size_t i = 0; i < names->size(); ++i) {
28  mStream << (*names)[i] << ' ' << (*xs)[i] << ' ' << (*ys)[i] << ' ' << (*zs)[i] << std::endl;
29  }
30  }
31  }
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
static const HistoName names[]
std::ofstream mStream
Definition: RHStopDump.h:18
RHStopDump(const edm::ParameterSet &)
Definition: RHStopDump.cc:7
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: RHStopDump.cc:12
std::string mProducer
Definition: RHStopDump.h:19