21 #include <momemta/ParameterSet.h> 22 #include <momemta/Module.h> 23 #include <momemta/Types.h> 35 x_start = parameters.get<
double>(
"x_start");
36 x_end = parameters.get<
double>(
"x_end");
37 n_bins = parameters.get<int64_t>(
"n_bins");
39 m_hist = produce<TH1D>(
"hist", (name() +
"_DMEM").c_str(), (name() +
"_DMEM").c_str(), n_bins, x_start, x_end);
40 m_hist->SetDirectory(0);
42 auto particle_tags = parameters.get<std::vector<InputTag>>(
"particles");
43 for (
auto& t: particle_tags)
44 m_particles.push_back(get<LorentzVector>(t));
46 psWeight = get<double>(parameters.get<
InputTag>(
"ps_weight"));
47 meOutput = get<double>(parameters.get<
InputTag>(
"me_output"));
54 virtual Status
work()
override {
57 for (
const auto& v: m_particles)
61 m_hist->Fill(tot.M(), *meOutput * (*psWeight));
68 double x_start, x_end;
72 std::vector<Value<LorentzVector>> m_particles;
77 std::shared_ptr<TH1D> m_hist;
85 .Attr(
"x_start:double")
virtual void beginIntegration() override
Called once at the beginning of the integration.
virtual Status work() override
Main function.
Parent class for all the modules.
A class encapsulating a lua table.
Module(PoolPtr pool, const std::string &name)
Constructor.