19 std::cout <<
"Configuring MCParticleProcessor" << std::endl;
26 catch (std::runtime_error& error)
28 std::cout << error.what() << std::endl;
45 EVENT::LCCollection* lc_particles{
nullptr};
50 catch (EVENT::DataNotAvailableException e)
52 std::cout << e.what() << std::endl;
68 for (
int iparticle = 0; iparticle < lc_particles->getNumberOfElements(); ++iparticle) {
71 IMPL::MCParticleImpl* lc_particle
72 =
static_cast<IMPL::MCParticleImpl*
>(lc_particles->getElementAt(iparticle));
78 particle->
setCharge(lc_particle->getCharge());
81 particle->
setTime(lc_particle->getTime());
84 particle->
setEnergy(lc_particle->getEnergy());
93 particle->
setMass(lc_particle->getMass());
96 particle->
setPDG(lc_particle->getPDG());
99 particle->
setID(lc_particle->id());
102 std::vector<EVENT::MCParticle*> parentVec = lc_particle->getParents();
103 if(parentVec.size() > 0) particle->
setMomPDG(parentVec.at(parentVec.size()-1)->getPDG());
106 particle->
setGenStatus(lc_particle->getGeneratorStatus());
109 particle->
setSimStatus(lc_particle->getSimulatorStatus());
Processor used to translate LCIO MCParticles to DST MCParticle objects.
#define DECLARE_PROCESSOR(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
EVENT::LCCollection * getLCCollection(std::string name)
Processor used to translate LCIO MCParticles to DST MCParticle objects. more details.
virtual void configure(const ParameterSet ¶meters)
Callback for the Processor to configure itself from the given set of parameters.
virtual void finalize()
Callback for the Processor to take any necessary action when the processing of events finishes.
virtual void initialize(TTree *tree)
Callback for the Processor to take any necessary action when the processing of events starts.
std::vector< MCParticle * > mc_particles_
std::string mcPartCollLcio_
description
MCParticleProcessor(const std::string &name, Process &process)
Class constructor.
std::string mcPartCollRoot_
description
void setVertexPosition(const double *vtx_pos)
void setEndpointMomentum(const double *momentum_ep)
void setPDG(const int pdg)
void setMass(const double mass)
void setGenStatus(const int gen)
void setMomPDG(const int momPDG)
void setCharge(const int charge)
void setMomentum(const double *momentum)
void setEnergy(const double energy)
void setTime(const double time)
void setEndPoint(const double *ep_pos)
void setSimStatus(const int sim)
Base class for all event processing components.
virtual bool process()
Process the histograms and generate analysis output.