1#include "DQM/EcalSPElectronKinematics.h"
5#include "DetDescr/SimSpecialID.h"
11 ecal_sp_coll_name_ = ps.
get<std::string>(
"ecal_sp_coll_name");
12 ecal_sp_pass_name_ = ps.
get<std::string>(
"ecal_sp_pass_name");
18 if (!event.
exists(ecal_sp_coll_name_, ecal_sp_pass_name_))
return;
21 ecal_sp_coll_name_, ecal_sp_pass_name_)};
23 for (
const auto& hit : sp_hits) {
26 if (hit_id.
plane() != 31)
continue;
27 const auto p = hit.getMomentum();
28 if (p[2] <= 0)
continue;
30 if (hit.getTrackID() != 1 || hit.getPdgID() != 11)
continue;
32 float energy = hit.getEnergy();
33 float px =
static_cast<float>(p[0]);
34 float py =
static_cast<float>(p[1]);
35 float pz =
static_cast<float>(p[2]);
36 const auto pos = hit.getPosition();
37 float x = pos[0], y = pos[1];
38 float pt = std::sqrt(px * px + py * py);
40 event.add(
"EcalSPEnergy", energy);
41 event.add(
"EcalSPPx", px);
42 event.add(
"EcalSPPy", py);
43 event.add(
"EcalSPPz", pz);
44 event.add(
"EcalSPX", x);
45 event.add(
"EcalSPY", y);
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class which encapsulates information from a hit in a simulated tracking detector.
Extracts and histograms the kinematics of the primary electron at the ECal front-face scoring plane.
void produce(framework::Event &event) override
Process the event and put new data products into it.
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
HistogramPool histograms_
helper object for making and filling histograms
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.
ldmx::EventHeader & getEventHeader()
Get the event header.
void setWeight(double w)
Set the weight for filling the histograms.
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Implements detector ids for special simulation-derived hits like scoring planes.
int plane() const
Get the value of the plane field from the ID, if it is a scoring plane.
Represents a simulated tracker hit in the simulation.