YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeasuredBreakupMomenta.h
Go to the documentation of this file.
1 /* YAP - Yet another PWA toolkit
2  Copyright 2015, Technische Universitaet Muenchen,
3  Authors: Daniel Greenwald, Johannes Rauch
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
20 
21 #ifndef yap_MeasuredBreakupMomenta_h
22 #define yap_MeasuredBreakupMomenta_h
23 
24 #include "fwd/CachedValue.h"
25 #include "fwd/Model.h"
26 #include "fwd/ParticleCombination.h"
27 #include "fwd/StatusManager.h"
28 
29 #include "StaticDataAccessor.h"
30 
31 #include <cmath>
32 #include <memory>
33 #include <string>
34 
35 namespace yap {
36 
42 {
43 public:
44 
48 
52  virtual void calculate(DataPoint& d, StatusManager& sm) const override;
53 
57  double q2(const DataPoint& d, const std::shared_ptr<ParticleCombination>& pc) const;
58 
62  double q(const DataPoint& d, const std::shared_ptr<ParticleCombination>& pc) const
63  { return sqrt(q2(d, pc)); }
64 
68  double rho(const DataPoint& d, const std::shared_ptr<ParticleCombination>& pc) const;
69 
71  std::shared_ptr<RealCachedValue> breakupMomenta()
72  { return Q2_; }
73 
75  std::shared_ptr<RealCachedValue> breakupMomenta() const
76  { return Q2_; }
77 
79  friend class Model;
80 
82  friend class DataAccessor;
83 
84 protected:
85 
87  void virtual addToStaticDataAccessors() override;
88 
90  void addParticleCombination(std::shared_ptr<ParticleCombination> pc) override;
91 
93  std::shared_ptr<RealCachedValue> Q2_;
94 
95 };
96 
101 inline constexpr double squared_breakup_momentum(double m2_R, double m_a, double m_b)
102 {
103  return (m_a == m_b)
104  ?
105  m2_R / 4. - m_a * m_a
106  :
107  (m2_R - pow(m_a + m_b, 2)) * (m2_R - pow(m_a - m_b, 2)) / m2_R / 4.;
108 }
109 
110 
111 }
112 
113 #endif
Calculates, stores and gives access to breakup momenta (using measured masses)
Definition: MeasuredBreakupMomenta.h:41
std::shared_ptr< RealCachedValue > breakupMomenta()
Definition: MeasuredBreakupMomenta.h:71
constexpr double squared_breakup_momentum(double m2_R, double m_a, double m_b)
Definition: MeasuredBreakupMomenta.h:101
MeasuredBreakupMomenta(Model &m)
Definition: MeasuredBreakupMomenta.cxx:14
Class for holding data and cached values per data point for fast calculation.
Definition: DataPoint.h:35
Base class for all data accessors that will only write to DataPoint once at initial data loading...
Definition: StaticDataAccessor.h:36
double rho(const DataPoint &d, const std::shared_ptr< ParticleCombination > &pc) const
Definition: MeasuredBreakupMomenta.cxx:39
Definition: StatusManager.h:32
Class implementing a PWA model.
Definition: Model.h:56
virtual void addToStaticDataAccessors() override
add to model's StaticDataAccessors_
Definition: MeasuredBreakupMomenta.cxx:22
double q2(const DataPoint &d, const std::shared_ptr< ParticleCombination > &pc) const
Definition: MeasuredBreakupMomenta.cxx:33
virtual void calculate(DataPoint &d, StatusManager &sm) const override
Definition: MeasuredBreakupMomenta.cxx:45
Abstract base class for all objects accessing DataPoint's.
Definition: DataAccessor.h:38
std::shared_ptr< RealCachedValue > breakupMomenta() const
Definition: MeasuredBreakupMomenta.h:75
void addParticleCombination(std::shared_ptr< ParticleCombination > pc) override
override to throw on adding final-state PC or more-than-two-body PC
Definition: MeasuredBreakupMomenta.cxx:70
std::shared_ptr< RealCachedValue > Q2_
squared breakup momentum [GeV^2]
Definition: MeasuredBreakupMomenta.h:93
double q(const DataPoint &d, const std::shared_ptr< ParticleCombination > &pc) const
Definition: MeasuredBreakupMomenta.h:62