CMS 3D CMS Logo

RHStopDump.cc
Go to the documentation of this file.
2 
6 
8  : mStream(parameters.getParameter<std::string>("stoppedFile").c_str()),
9  mProducer(parameters.getUntrackedParameter<std::string>("producer", "g4SimHits")) {}
10 
13  fEvent.getByLabel(mProducer, "StoppedParticlesName", names);
15  fEvent.getByLabel(mProducer, "StoppedParticlesX", xs);
17  fEvent.getByLabel(mProducer, "StoppedParticlesY", ys);
19  fEvent.getByLabel(mProducer, "StoppedParticlesZ", zs);
21  fEvent.getByLabel(mProducer, "StoppedParticlesTime", ts);
23  fEvent.getByLabel(mProducer, "StoppedParticlesPdgId", ids);
25  fEvent.getByLabel(mProducer, "StoppedParticlesMass", masses);
27  fEvent.getByLabel(mProducer, "StoppedParticlesCharge", charges);
28 
29  if (names->size() != xs->size() || xs->size() != ys->size() || ys->size() != zs->size()) {
30  edm::LogError("RHStopDump") << "mismatch array sizes name/x/y/z:" << names->size() << '/' << xs->size() << '/'
31  << ys->size() << '/' << zs->size() << std::endl;
32  } else {
33  for (size_t i = 0; i < names->size(); ++i) {
34  mStream << (*names)[i] << ' ' << (*xs)[i] << ' ' << (*ys)[i] << ' ' << (*zs)[i] << ' ' << (*ts)[i] << std::endl;
35  mStream << (*ids)[i] << ' ' << (*masses)[i] << ' ' << (*charges)[i] << std::endl;
36  }
37  }
38 }
RHStopDump.h
RHStopDump::mProducer
std::string mProducer
Definition: RHStopDump.h:20
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
CosmicGenFilterHelix_cfi.charges
charges
only generated particles of these IDs are considered
Definition: CosmicGenFilterHelix_cfi.py:6
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
RHStopDump::RHStopDump
RHStopDump(const edm::ParameterSet &)
Definition: RHStopDump.cc:7
edm::Handle
Definition: AssociativeIterator.h:50
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
RHStopDump::mStream
std::ofstream mStream
Definition: RHStopDump.h:19
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
particleFlowDisplacedVertex_cfi.masses
masses
Definition: particleFlowDisplacedVertex_cfi.py:80
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcaldqm::fEvent
Definition: DQTask.h:32
std
Definition: JetResolutionObject.h:76
RHStopDump::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: RHStopDump.cc:11
ParameterSet.h
edm::Event
Definition: Event.h:73