EpIC 1.1.0
Monte Carlo generator for exclusive processes
Loading...
Searching...
No Matches
KinematicModule.h
1/*
2 * KinematicModule.h
3 *
4 * Created on: Feb 12, 2021
5 * Author: Pawel Sznajder (NCBJ)
6 */
7
8#ifndef MODULES_KINEMATIC_KINEMATICMODULE_H_
9#define MODULES_KINEMATIC_KINEMATICMODULE_H_
10
11#include <partons/beans/channel/ChannelType.h>
12#include <ElementaryUtils/string_utils/Formatter.h>
13#include <string>
14#include <vector>
15
16#include "../EpicModuleObject.h"
17#include "../../beans/containers/KinematicRange.h"
18
19namespace EPIC {
20class Event;
21} /* namespace EPIC */
22
23namespace EPIC {
24class ExperimentalConditions;
25} /* namespace EPIC */
26
27namespace EPIC {
28
36template <typename KinematicRangeType, typename KinematicType>
38
39public:
43 virtual ~KinematicModule() {}
44
48 virtual std::vector<KinematicRange> getKinematicRanges(const ExperimentalConditions &conditions, const KinematicRangeType& ranges) = 0;
49
53 virtual bool checkIfValid(const ExperimentalConditions &conditions,
54 const KinematicType &kin) = 0;
55
60 virtual Event evaluate(const ExperimentalConditions &conditions,
61 const KinematicType &kin) = 0;
62
63protected:
71 KinematicModule(const std::string &className,
72 PARTONS::ChannelType::Type channelType)
73 : EpicModuleObject(className, channelType) {}
74
80
81 void changeKinematicRange(KinematicRange& range, bool isMin, double value, const std::string& name, double divisionFactor = 10) const {
82
83 KinematicRange old = range;
84
85 if(isMin){
86 range.setMinMax(value/divisionFactor, range.getMax());
87 }else{
88 range.setMinMax(range.getMin(), value/divisionFactor);
89 }
90
91 warn(__func__, ElemUtils::Formatter() << "Range for variable " << name << " changed from " << old.toString() << " to " << range.toString());
92 }
93
94};
95}
96
97#endif /* MODULES_KINEMATIC_KINEMATICMODULE_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 kinematic module.
Definition: KinematicModule.h:37
KinematicModule(const KinematicModule &other)
Definition: KinematicModule.h:79
virtual Event evaluate(const ExperimentalConditions &conditions, const KinematicType &kin)=0
virtual bool checkIfValid(const ExperimentalConditions &conditions, const KinematicType &kin)=0
virtual ~KinematicModule()
Definition: KinematicModule.h:43
virtual std::vector< KinematicRange > getKinematicRanges(const ExperimentalConditions &conditions, const KinematicRangeType &ranges)=0
KinematicModule(const std::string &className, PARTONS::ChannelType::Type channelType)
Definition: KinematicModule.h:71
Container to store a single kinematic range.
Definition: KinematicRange.h:29
double getMin() const
void setMinMax(double min, double max)
double getMax() const