EpIC 1.1.0
Monte Carlo generator for exclusive processes
Loading...
Searching...
No Matches
RCModule.h
1/*
2 * RCModule.h
3 *
4 * Created on: Feb 12, 2021
5 * Author: Pawel Sznajder (NCBJ)
6 */
7
8#ifndef MODULES_RADIATIVECORRECTIONS_RCMODULE_H_
9#define MODULES_RADIATIVECORRECTIONS_RCMODULE_H_
10
11#include <ElementaryUtils/logger/CustomException.h>
12#include <ElementaryUtils/string_utils/Formatter.h>
13#include <partons/beans/channel/ChannelType.h>
14#include <stddef.h>
15#include <string>
16#include <tuple>
17#include <vector>
18
19#include "../../beans/containers/ExperimentalConditions.h"
20#include "../../beans/containers/KinematicRange.h"
21#include "../EpicModuleObject.h"
22
23namespace EPIC {
24class Event;
25} /* namespace EPIC */
26
27namespace EPIC {
28class ExperimentalConditions;
29} /* namespace EPIC */
30
31namespace EPIC {
32
40template<typename ObsKinType>
42
43public:
44
48 virtual ~RCModule() {
49 }
50
54 size_t getNVariables() const;
55
59 const std::vector<KinematicRange>& getVariableRanges() const {
60 return m_variableRanges;
61 }
62
66 virtual std::tuple<double, ExperimentalConditions, ObsKinType> evaluate(
67 const ExperimentalConditions& experimentalConditions,
68 const ObsKinType& obsKin, const std::vector<double>& par) const = 0;
69
73 virtual void updateEvent(Event& event, const std::vector<double>& par) const = 0;
74
75protected:
76
84 RCModule(const std::string &className,
85 PARTONS::ChannelType::Type channelType) :
86 EpicModuleObject(className, channelType), m_nVariables(0) {
87 }
88
93 RCModule(const RCModule &other) :
94 EpicModuleObject(other), m_nVariables(other.m_nVariables), m_variableRanges(
95 other.m_variableRanges) {
96 }
97
98protected:
99
103 virtual void checkParameters(const std::vector<double>& par) const {
104
105 if (par.size() != m_nVariables) {
106 throw ElemUtils::CustomException(getClassName(), __func__,
107 ElemUtils::Formatter() << "Wrong number of variables, is: "
108 << par.size() << ", expected: " << m_nVariables);
109 }
110 }
111
116 void setVariableRanges(const std::vector<KinematicRange>& variableRanges) {
117
118 m_nVariables = variableRanges.size();
119 m_variableRanges = variableRanges;
120 }
121
122private:
123
124 size_t m_nVariables;
125 std::vector<KinematicRange> m_variableRanges;
126};
127}
128
129#endif /* MODULES_RADIATIVECORRECTIONS_RCMODULE_H_ */
Testable version of PARTONS::ModuleObject.
Definition: EpicModuleObject.h:26
Single event.
Definition: Event.h:36
Container to store experimental conditions.
Definition: ExperimentalConditions.h:29
Template for radiative correction module.
Definition: RCModule.h:41
virtual std::tuple< double, ExperimentalConditions, ObsKinType > evaluate(const ExperimentalConditions &experimentalConditions, const ObsKinType &obsKin, const std::vector< double > &par) const =0
RCModule(const std::string &className, PARTONS::ChannelType::Type channelType)
Definition: RCModule.h:84
void setVariableRanges(const std::vector< KinematicRange > &variableRanges)
Definition: RCModule.h:116
const std::vector< KinematicRange > & getVariableRanges() const
Definition: RCModule.h:59
RCModule(const RCModule &other)
Definition: RCModule.h:93
virtual void checkParameters(const std::vector< double > &par) const
Definition: RCModule.h:103
virtual ~RCModule()
Definition: RCModule.h:48
size_t getNVariables() const
virtual void updateEvent(Event &event, const std::vector< double > &par) const =0