2#include "DQM/SimObjects.h"
6#include "SimCore/Event/SimParticle.h"
18 std::vector<std::string> creator_process_labels = {
26 "Multiple scattering",
87 for (
int i{0}; i < creator_process_labels.size(); ++i) {
88 const auto& label{creator_process_labels[i]};
89 hist->GetXaxis()->SetBinLabel(i + 1, label.c_str());
134 static std::vector<framework::ProductTag> sp_maps, calo_colls, track_colls;
135 if (sp_maps.empty()) {
136 sp_maps =
event.searchProducts(
"SimParticles",
"",
"");
137 if (sp_maps.size() != 1) {
138 ldmx_log(warn) << sp_maps.size() <<
" SimParticle maps which is not one!";
141 if (calo_colls.empty()) {
142 calo_colls =
event.searchProducts(
"",
sim_pass_,
".*SimCalorimeterHit.*");
145 if (track_colls.empty()) {
146 track_colls =
event.searchProducts(
"",
sim_pass_,
".*SimTrackerHit.*");
150 auto const& particle_map{
152 for (
auto const& [track_id, particle] : particle_map) {
154 auto const& vertex{particle.getVertex()};
166 for (
auto const& parent : particle.getParents())
168 for (
auto const& child : particle.getDaughters())
172 if (particle.getProcessType() ==
173 ldmx::SimParticle::ProcessType::photonNuclear) {
184 for (
auto const& parent : particle.getParents())
186 for (
auto const& child : particle.getDaughters())
191 for (
auto const& pt : calo_colls) {
194 for (
auto const& hit : coll) {
197 for (
unsigned int i_contrib{0}; i_contrib < n_contribs; i_contrib++) {
205 auto pos{hit.getPosition()};
213 for (
auto const& pt : track_colls) {
216 for (
auto const& hit : coll) {
218 auto momentum{hit.getMomentum()};
224 auto pos{hit.getPosition()};
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class defining the identity of a data product in the event.
Class which stores simulated calorimeter hit information.
Class which encapsulates information from a hit in a simulated tracking detector.
void createCalorimeterHists(const std::string &coll_name)
new calorimeter histograms
virtual void analyze(const framework::Event &event)
Fills histograms.
std::string sim_pass_
Pass Name for sim objects.
virtual void configure(framework::config::Parameters &ps)
Input python configuration parameters.
virtual void onProcessStart()
Construct histograms depending on which objects are requested.
void createTrackerHists(const std::string &coll_name)
new tracker histograms
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
TH1 * get(const std::string &name)
Get a pointer to a histogram by name.
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
void create(const std::string &name, const std::string &xLabel, const double &bins, const double &xmin, const double &xmax)
Create a ROOT 1D histogram of type TH1F and pool it for later use.
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.
unsigned getNumberOfContribs() const
Get the number of hit contributions.
Class representing a simulated particle.
std::vector< double > getMomentum() const
Get a vector containing the momentum of this particle [MeV].
Represents a simulated tracker hit in the simulation.
Information about a contribution to the hit in the associated cell.