1#include "DQM/SampleValidation.h"
7#include "Framework/NtupleManager.h"
8#include "SimCore/Event/SimParticle.h"
21 std::vector<int> primary_daughters;
23 double hard_thresh{9999.0};
26 for (
auto const& it : particle_map) {
29 std::vector<double> vertex = p.
getVertex();
31 std::vector<int> parents_track_ids = p.
getParents();
34 for (
auto const& parent_track_id : parents_track_ids) {
35 if (parent_track_id == 0) {
38 hard_thresh = (2500. / 4000.) * energy;
39 primary_daughters = daughters;
41 if (sphit.getTrackID() == it.first && sphit.getPosition()[2] < 0) {
49 std::vector<std::vector<int>> hardbrem_daughters;
51 for (
auto const& it : particle_map) {
52 int trackid = it.first;
54 for (
auto const& primary_daughter : primary_daughters) {
55 if (trackid == primary_daughter) {
71 for (
auto const& it : particle_map) {
72 int trackid = it.first;
74 for (
const std::vector<int>& daughter_track_id : hardbrem_daughters) {
75 for (
const int& daughter_id : daughter_track_id) {
76 if (trackid == daughter_id) {
88int SampleValidation::pdgid_label(
const int pdgid) {
92 if (pdgid == -11) label = 1;
93 if (pdgid == 11) label = 2;
94 if (pdgid == -13) label = 3;
95 if (pdgid == 13) label = 4;
96 if (pdgid == 22) label = 5;
97 if (pdgid == 2212) label = 6;
98 if (pdgid == 2112) label = 7;
99 if (pdgid == 211) label = 8;
100 if (pdgid == -211) label = 9;
101 if (pdgid == 111) label = 10;
102 if (pdgid == 321) label = 11;
103 if (pdgid == -321) label = 12;
104 if (pdgid == 130) label = 13;
105 if (pdgid == 310) label = 14;
106 if (pdgid == 3122 || pdgid == 3222 || pdgid == 3212 || pdgid == 3112 ||
107 pdgid == 3322 || pdgid == 3312)
114 if (pdgid > 1000000000) {
115 if (((pdgid / 10) % 1000) <= 4) {
129 std::vector<std::string> labels = {
"",
146 "#Lambda / #Sigma / #Xi",
151 std::vector<TH1*> hists = {
159 for (
int ilabel{1}; ilabel < labels.size(); ++ilabel) {
160 for (
auto& hist : hists) {
161 hist->GetXaxis()->SetBinLabel(ilabel, labels[ilabel - 1].c_str());
#define DECLARE_ANALYZER_NS(NS, 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.
virtual void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
void onProcessStart() override
Method executed before processing of events begins.
virtual void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
const std::vector< ContentType > & getCollection(const std::string &collectionName, const std::string &passName="") const
Get a collection (std::vector) of objects from the event bus.
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.
Class encapsulating parameters for configuring a processor.
Class representing a simulated particle.
double getEnergy() const
Get the energy of this particle [MeV].
std::vector< int > getParents() const
Get a vector containing the track IDs of the parent particles.
std::vector< double > getVertex() const
Get a vector containing the vertex of this particle in mm.
std::vector< int > getDaughters() const
Get a vector containing the track IDs of all daughter particles.
int getPdgID() const
Get the PDG ID of this particle.
std::vector< double > getEndPoint() const
Get the endpoint of this particle where it was destroyed or left the world volume [mm].
Represents a simulated tracker hit in the simulation.