AmpGen 2.1
Loading...
Searching...
No Matches
PolarisedSum.h
Go to the documentation of this file.
1#ifndef AMPGEN_POLARISEDAMPLITUDE_H
2#define AMPGEN_POLARISEDAMPLITUDE_H
3
4#include <stddef.h>
5#include <complex>
6#include <map>
7#include <memory>
8#include <string>
9#include <utility>
10#include <vector>
11#include <array>
12
13#include "AmpGen/Types.h"
16#include "AmpGen/EventList.h"
17#include "AmpGen/EventType.h"
18#include "AmpGen/Integrator.h"
19#include "AmpGen/CoherentSum.h"
20#include "AmpGen/Expression.h"
21#include "AmpGen/Tensor.h"
23#include "AmpGen/enum.h"
24#include "AmpGen/Configurable.h"
25
26namespace AmpGen {
29 class FitFraction;
30 class MinuitProxy;
31 make_enum(spaceType, spin, flavour);
32
33 class PolarisedSum : public Configurable<PolarisedSum> {
34 public:
35#if ENABLE_AVX
37#else
39#endif
40
41 PolarisedSum() = default;
42 virtual ~PolarisedSum();
43 PolarisedSum(const EventType &, MinuitParameterSet &, const std::vector<MinuitProxy> & = {});
44 void prepare();
47#if ENABLE_AVX
48 void setEvents(EventList &evts) {
49 m_ownEvents = true;
50 setEvents(*new EventList_type(evts));
51 };
52 void setMC(EventList &evts) { setMC(*new EventList_type(evts)); };
53 double operator()(const double *, const unsigned) const;
54#endif
55 real_v operator()(const real_v *, const unsigned) const;
56 real_t operator()(const Event &evt) const;
57 void reset(const bool & = false);
58 void debug(const Event &);
59 void debug_norm();
61 double getWeight() const;
63 void generateSourceCode(const std::string &, const double & = 1, bool = false);
64 Expression probExpression(const Tensor &, const std::vector<Expression> &, const std::vector<Expression> &, DebugSymbols * = nullptr) const;
65 size_t size() const;
66 real_t norm() const;
67 complex_t norm(const size_t &, const size_t &, Integrator * = nullptr);
68 real_t getValNoCache(const Event &) const;
69 std::vector<FitFraction> fitFractions(const LinearErrorPropagator &, bool = false, bool = false);
70 std::vector<MatrixElement> matrixElements() const;
73 const MatrixElement &operator[](const size_t &i) const { return m_matrixElements[i]; }
74 std::function<real_t(const Event &)> evaluator(const EventList_type * = nullptr) const;
75 KeyedFunctors<double(Event)> componentEvaluator(const EventList_type * = nullptr) const;
76 EventType eventType() const { return m_eventType; }
77 auto cache() { return m_cache; }
78
79 private:
80 size_t m_nCalls = {0};
81 real_t m_norm = {1};
82 EventList_type *m_events = {nullptr};
83 FunctionCache<EventList_type, complex_v, Alignment::AoS> m_cache = {};
84 FunctionCache<FunctionCache<EventList_type, complex_v, Alignment::AoS>, real_v, Alignment::AoS> m_pdfCache = {};
85 bool m_ownEvents = {false};
86 MinuitParameterSet *m_mps = {nullptr};
87 MinuitProxy m_weight = {nullptr, 1};
88 MinuitProxy m_polParam = {nullptr};
89 std::vector<MinuitProxy> m_pVector = {};
90 std::vector<MinuitProxy> m_pfVector = {};
91 Integrator m_integrator;
92 std::vector<Bilinears> m_norms;
93 EventType m_eventType;
94 std::string m_prefix = "";
95 std::vector<complex_t> m_rho;
96 std::vector<size_t> m_integIndex;
97 std::pair<unsigned, unsigned> m_dim;
98 std::vector<MatrixElement> m_matrixElements;
99 CompiledExpression<real_v(const real_t *, const complex_v *)> m_probExpression;
100
101 Property<spaceType> m_spaceType{this, "PolarisedSum::SpaceType", spaceType::spin};
102 };
103} // namespace AmpGen
104
105#endif
Encapsulates the final state particles of a single event.
Definition Event.h:19
Deals with final state configuration of events, specifically dealing with the ordering of particles i...
Definition EventType.h:22
Wrapper class for shared_ptrs to virtual expressions for use in conjunction with operators to build e...
Definition Expression.h:135
Propagates uncertainties on functors using either a MinuitParameterSet (thus assuming a diagonal cova...
EventType eventType() const
void reset(const bool &=false)
real_t norm() const
Tensor transitionMatrix() const
void setMC(EventList_type &)
double getWeight() const
real_t getValNoCache(const Event &) const
KeyedFunctors< double(Event)> componentEvaluator(const EventList_type *=nullptr) const
complex_t norm(const size_t &, const size_t &, Integrator *=nullptr)
std::vector< FitFraction > fitFractions(const LinearErrorPropagator &, bool=false, bool=false)
PolarisedSum(const EventType &, MinuitParameterSet &, const std::vector< MinuitProxy > &={})
std::function< real_t(const Event &)> evaluator(const EventList_type *=nullptr) const
void generateSourceCode(const std::string &, const double &=1, bool=false)
std::vector< MatrixElement > matrixElements() const
size_t size() const
real_t operator()(const Event &evt) const
real_v operator()(const real_v *, const unsigned) const
void debug(const Event &)
void setWeight(MinuitProxy)
void setEvents(EventList_type &)
Expression probExpression(const Tensor &, const std::vector< Expression > &, const std::vector< Expression > &, DebugSymbols *=nullptr) const
const MatrixElement & operator[](const size_t &i) const
#define make_enum(name,...)
Definition enum.h:25
double real_t
Definition Types.h:6
std::complex< real_t > complex_t
Definition Types.h:7
AVX::real_v real_v
Definition utils.h:47
AVX::complex_v complex_v
Definition utils.h:48
@ AoS
Definition Store.h:12
std::vector< DebugSymbol > DebugSymbols
Definition Expression.h:111