20 #include <momemta/Logging.h> 21 #include <momemta/Module.h> 22 #include <momemta/ParameterSet.h> 23 #include <momemta/Types.h> 26 #include <Math/DistFunc.h> 39 m_reco_input = get<LorentzVector>(parameters.get<
InputTag>(
"reco_particle"));
41 m_sigma = parameters.get<
double>(
"sigma", 0.10);
42 m_sigma_range = parameters.get<
double>(
"sigma_range", 5);
43 m_min_Pt = parameters.get<
double>(
"min_Pt", 0.);
98 m_ps_point = get<double>(parameters.get<
InputTag>(
"ps_point"));
101 virtual Status
work()
override {
103 const double sigma_Pt_rec = m_reco_input->Pt() * m_sigma;
105 const double cosh_eta = std::cosh(m_reco_input->Eta());
106 double range_min = std::max(m_min_Pt, m_reco_input->Pt() - (m_sigma_range * sigma_Pt_rec));
107 double range_max = m_reco_input->Pt() + (m_sigma_range * sigma_Pt_rec);
108 double range = (range_max - range_min);
110 double gen_Pt = range_min + range * (*m_ps_point);
113 const double gen_E = std::sqrt(
SQ(m_reco_input->M()) +
SQ(cosh_eta * gen_Pt));
115 output->SetCoordinates(
116 gen_Pt * std::cos(m_reco_input->Phi()),
117 gen_Pt * std::sin(m_reco_input->Phi()),
118 gen_Pt * std::sinh(m_reco_input->Eta()),
122 const double sigma_Pt_gen = gen_Pt * m_sigma;
125 *TF_times_jacobian = ROOT::Math::normal_pdf(gen_Pt, sigma_Pt_gen, m_reco_input->Pt()) * range * cosh_eta;
135 std::shared_ptr<LorentzVector> output = produce<LorentzVector>(
"output");
136 std::shared_ptr<double> TF_times_jacobian = produce<double>(
"TF_times_jacobian");
176 m_gen_input = get<LorentzVector>(parameters.get<
InputTag>(
"gen_particle"));
179 virtual Status
work()
override {
181 *TF_value = ROOT::Math::normal_pdf(m_gen_input->Pt(), m_gen_input->Pt() * m_sigma, m_reco_input->Pt());
191 std::shared_ptr<double> TF_value = produce<double>(
"TF");
197 .Input(
"reco_particle")
199 .Output(
"TF_times_jacobian")
200 .Attr(
"sigma:double=0.10")
201 .Attr(
"sigma_range:double=5")
202 .Attr(
"min_Pt:double=0");
205 .Input(
"gen_particle")
206 .Input(
"reco_particle")
208 .Attr(
"sigma:double=0.10")
209 .Attr(
"sigma_range:double=5")
210 .Attr(
"min_Pt:double=0");
Helper class for Gaussian transfer function modules.
Integrate over a transfer function on Pt described by a Gaussian distribution.
virtual Status work() override
Main function.
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.
Evaluate a transfer function on Pt described by a Gaussian distribution.