2#include "TrigScint/TruthHitProducer.h"
8 : Producer(name, process) {}
14 sim_particles_passname_ =
15 parameters.
get<std::string>(
"sim_particles_passname");
16 input_collection_events_passname_ =
17 parameters.
get<std::string>(
"input_collection_events_passname");
22 ldmx_log(info) <<
"In TruthHitProducer: configure done!";
23 ldmx_log(info) <<
"Got parameters: " <<
"\nInput collection: "
35 <<
" found; skipping!";
42 "SimParticles", sim_particles_passname_)};
44 std::vector<ldmx::SimCalorimeterHit> truth_beam_electrons;
47 for (
const auto &sim_hit : sim_hits) {
50 for (
int i = 0; i < sim_hit.getNumberOfContribs(); i++) {
51 auto contrib = sim_hit.getContrib(i);
53 ldmx_log(debug) <<
"contrib " << i <<
" trackID: " << contrib.track_id_
54 <<
" pdgID: " << contrib.pdg_code_
55 <<
" edep: " << contrib.edep_;
56 ldmx_log(debug) <<
"\t particle id: "
57 << particle_map[contrib.track_id_].getPdgID()
58 <<
" particle status: "
59 << particle_map[contrib.track_id_].getGenStatus();
62 if (particle_map.find(contrib.track_id_) != particle_map.end()) {
64 if (particle_map[contrib.track_id_].getPdgID() == 11 &&
65 particle_map[contrib.track_id_].getGenStatus() == 1) {
69 if (keep) truth_beam_electrons.push_back(sim_hit);
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Implements an event buffer system for storing event data.
bool exists(const std::string &name, const std::string &passName, bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Stores simulated calorimeter hit information.
Class representing a simulated particle.
Producer making a collection based on some truth info cuts.
TruthHitProducer(const std::string &name, framework::Process &process)
Constructor.
std::string input_collection_
Name of the input collection containing the sim hits.
void produce(framework::Event &event) override
Process the event and put new data products into it.
void configure(framework::config::Parameters ¶meters) override
Configure the processor using the given user specified parameters.
std::string input_pass_name_
Name of the pass that the input collection is on (empty string means take any pass)
bool verbose_
Class to set the verbosity level.
std::string output_collection_
Name of the output collection that will be used to store the selected sim hits.