2#include "TrigScint/TruthHitProducer.h"
8 : Producer(name, process) {}
17 ldmx_log(info) <<
"In TruthHitProducer: configure done!";
18 ldmx_log(info) <<
"Got parameters: "
30 <<
" found; skipping!";
38 std::vector<ldmx::SimCalorimeterHit> truthBeamElectrons;
41 for (
const auto &simHit : simHits) {
44 for (
int i = 0; i < simHit.getNumberOfContribs(); i++) {
45 auto contrib = simHit.getContrib(i);
47 ldmx_log(debug) <<
"contrib " << i <<
" trackID: " << contrib.trackID
48 <<
" pdgID: " << contrib.pdgCode
49 <<
" edep: " << contrib.edep;
50 ldmx_log(debug) <<
"\t particle id: "
51 << particleMap[contrib.trackID].getPdgID()
52 <<
" particle status: "
53 << particleMap[contrib.trackID].getGenStatus();
56 if (particleMap.find(contrib.trackID) != particleMap.end()) {
58 if (particleMap[contrib.trackID].getPdgID() == 11 &&
59 particleMap[contrib.trackID].getGenStatus() == 1) {
63 if (keep) truthBeamElectrons.push_back(simHit);
#define DECLARE_PRODUCER_NS(NS, 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.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Stores simulated calorimeter hit information.
Class representing a simulated particle.
TruthHitProducer(const std::string &name, framework::Process &process)
Constructor.
std::string inputCollection_
Name of the input collection containing the sim hits.
std::string inputPassName_
Name of the pass that the input collection is on (empty string means take any pass)
std::string outputCollection_
Name of the output collection that will be used to store the selected 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.
bool verbose_
Class to set the verbosity level.