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
24namespace AmpGen
25{
28 class FitFraction;
29 class MinuitProxy;
30
32 {
33 public:
34 #if ENABLE_AVX
36 #else
38 #endif
39
40 PolarisedSum() = default;
41 PolarisedSum(const EventType&, MinuitParameterSet&, const std::vector<MinuitProxy>& = {});
42 void prepare();
45 #if ENABLE_AVX
46 void setEvents(EventList& evts){ m_ownEvents = true; setEvents( *new EventList_type(evts)) ; };
47 void setMC(EventList& evts){ setMC( *new EventList_type(evts)) ; };
48 double operator()(const double*, const unsigned) const;
49 #endif
50 real_v operator()(const real_v*, const unsigned) const;
51 real_t operator()(const Event& evt) const;
52 void reset(const bool& = false);
53 void debug(const Event&);
54 void debug_norm();
56 double getWeight() const;
57 void updateNorms();
58 void generateSourceCode(const std::string&, const double& = 1, bool = false);
59 Expression probExpression(const Tensor&, const std::vector<Expression>&, const std::vector<Expression>&, DebugSymbols* = nullptr) const;
60 size_t size() const;
61 real_t norm() const;
62 complex_t norm(const size_t&, const size_t&, Integrator* = nullptr);
63 real_t getValNoCache(const Event&) const;
64 std::vector<FitFraction> fitFractions(const LinearErrorPropagator&);
65 std::vector<MatrixElement> matrixElements() const;
68 const MatrixElement& operator[](const size_t& i) const { return m_matrixElements[i] ; }
69 std::function<real_t(const Event&)> evaluator(const EventList_type* = nullptr) const;
70 KeyedFunctors<double(Event)> componentEvaluator(const EventList_type* = nullptr) const;
71 EventType eventType() const{ return m_eventType; }
73 auto cache(){ return m_cache; }
74 private:
75 size_t m_nCalls = {0};
76 real_t m_norm = {1};
77 EventList_type* m_events = {nullptr};
78 FunctionCache<EventList_type, complex_v, Alignment::AoS> m_cache = {};
79 FunctionCache<FunctionCache<EventList_type, complex_v, Alignment::AoS>, real_v, Alignment::AoS> m_pdfCache = {};
80 bool m_ownEvents = {false};
81 MinuitParameterSet* m_mps = {nullptr};
82 MinuitProxy m_weight = {nullptr,1};
83 MinuitParameter* m_polParam = {nullptr};
84 std::vector<MinuitProxy> m_pVector = {};
85 std::vector<MinuitProxy> m_pfVector = {};
86 bool m_verbosity = {0};
87 bool m_debug = {0};
88 Integrator m_integrator;
89 std::vector<Bilinears> m_norms;
90 EventType m_eventType;
91 std::string m_prefix = "";
92 std::vector<complex_t> m_rho;
93 std::vector<size_t> m_integIndex;
94 std::pair<unsigned, unsigned> m_dim;
95 std::vector<MatrixElement> m_matrixElements;
96// CompiledExpression<void(real_t*, const std::size_t*, const real_t*, const complex_v*)> m_probExpression;
97 CompiledExpression<real_v(const real_t*, const complex_v*)> m_probExpression;
98 };
99} // namespace AmpGen
100
101#endif
Encapsulates the final state particles of a single event.
Definition Event.h:18
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)
PolarisedSum(const EventType &, MinuitParameterSet &, const std::vector< MinuitProxy > &={})
std::vector< FitFraction > fitFractions(const LinearErrorPropagator &)
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
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:46
AVX::complex_v complex_v
Definition utils.h:47
@ AoS
Definition Store.h:14
std::vector< DebugSymbol > DebugSymbols
Definition Expression.h:111