ComPWA
Common Partial-Wave-Analysis Framework
BuilderXML.hpp
Go to the documentation of this file.
1 // Copyright (c) 2013, 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #ifndef COMPWA_PHYSICS_BUILDERXML_HPP_
6 #define COMPWA_PHYSICS_BUILDERXML_HPP_
7 
8 #include "Core/Function.hpp"
11 #include "Data/DataSet.hpp"
13 #include "Physics/SubSystem.hpp"
14 #include "Tools/FitFractions.hpp"
15 
16 #include <boost/property_tree/ptree_fwd.hpp>
17 
18 #include <map>
19 #include <memory>
20 #include <set>
21 #include <tuple>
22 #include <vector>
23 
24 namespace ComPWA {
25 class Kinematics;
26 
27 namespace Tools {
28 class IntegrationStrategy;
29 }
30 
31 namespace Physics {
32 namespace HelicityFormalism {
33 class HelicityKinematics;
34 }
35 
37 public:
39  const boost::property_tree::ptree &ModelTree,
40  const EventCollection &TruePhspSample = {},
41  const EventCollection &RecoPhspSample = {});
42 
44 
45  std::vector<ComPWA::Tools::IntensityComponent> createIntensityComponents(
46  std::vector<std::vector<std::string>> ComponentList = {});
47 
48  std::map<std::string, std::string> getAllComponentNames() const;
49 
50 private:
51  struct DataContainer {
53  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>> Weights;
54  double WeightSum = 0.0;
55  };
56 
57  std::shared_ptr<ComPWA::FunctionTree::TreeNode>
58  createIntensityFT(const boost::property_tree::ptree &pt,
59  const ComPWA::FunctionTree::ParameterList &DataSample);
60 
61  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createIncoherentIntensityFT(
62  const boost::property_tree::ptree &pt,
63  const ComPWA::FunctionTree::ParameterList &DataSample);
64 
65  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createIncoherentIntensityFT(
66  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> Intensities);
67 
68  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createCoherentIntensityFT(
69  const boost::property_tree::ptree &pt,
70  const ComPWA::FunctionTree::ParameterList &DataSample);
71 
72  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createCoherentIntensityFT(
73  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> Amplitudes);
74 
75  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createStrengthIntensityFT(
76  const boost::property_tree::ptree &pt,
77  const ComPWA::FunctionTree::ParameterList &DataSample);
78 
79  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createNormalizedIntensityFT(
80  const boost::property_tree::ptree &pt,
81  const ComPWA::FunctionTree::ParameterList &DataSample);
82 
83  std::shared_ptr<ComPWA::FunctionTree::TreeNode>
84  normalizeIntensityFT(const boost::property_tree::ptree &UnnormalizedPT,
85  const ComPWA::FunctionTree::ParameterList &DataSample,
86  std::string IntegratorClassNa);
87 
88  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createIntegrationStrategyFT(
89  std::shared_ptr<ComPWA::FunctionTree::TreeNode> UnnormalizedIntensity,
90  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>
91  PhspWeights,
92  double PhspWeightSum, std::string IntegratorClassName);
93 
94  std::shared_ptr<ComPWA::FunctionTree::TreeNode>
95  createAmplitudeFT(const boost::property_tree::ptree &pt,
96  const ComPWA::FunctionTree::ParameterList &DataSample);
97 
98  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createNormalizedAmplitudeFT(
99  const boost::property_tree::ptree &pt,
100  const ComPWA::FunctionTree::ParameterList &DataSample);
101 
102  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createCoefficientAmplitudeFT(
103  const boost::property_tree::ptree &pt,
104  const ComPWA::FunctionTree::ParameterList &DataSample);
105 
106  std::shared_ptr<ComPWA::FunctionTree::TreeNode> createSequentialAmplitudeFT(
107  const boost::property_tree::ptree &pt,
108  const ComPWA::FunctionTree::ParameterList &DataSample);
109 
110  std::shared_ptr<ComPWA::FunctionTree::TreeNode>
111  createHelicityDecayFT(const boost::property_tree::ptree &pt,
112  const ComPWA::FunctionTree::ParameterList &DataSample);
113 
114  void updateDataContainerWeights(DataContainer &DataCon,
115  const EventCollection &DataSample);
118 
119  void
120  addFunctionTreeComponent(std::string Name, std::string Type,
121  std::shared_ptr<ComPWA::FunctionTree::TreeNode> FT);
122 
123  bool ComponentRegisteringEnabled = true;
124 
125  std::map<
126  std::string,
127  std::pair<std::string, std::shared_ptr<ComPWA::FunctionTree::TreeNode>>>
129 
130  ParticleList PartList;
131  Kinematics &Kinematic;
132  boost::property_tree::ptree ModelTree;
135 
140 };
141 
145 createHelicityKinematics(const std::string XmlFile);
146 
151  const std::string XmlFile);
152 
155  const boost::property_tree::ptree &pt);
156 
159  std::pair<std::string, std::string> Names;
160  std::pair<double, double> Helicities;
161 };
162 
163 TwoBodyDecayInfo extractDecayInfo(const boost::property_tree::ptree &pt);
164 
165 } // namespace Physics
166 } // namespace ComPWA
167 
168 #endif
const EventCollection & TruePhspSample
Definition: BuilderXML.hpp:133
boost::property_tree::ptree ModelTree
Definition: BuilderXML.hpp:132
Template implementation of Parameter for simple values.
void updateDataContainerContent(ComPWA::FunctionTree::ParameterList &DataList, const EventCollection &DataSample, const Kinematics &Kinematics)
Definition: BuilderXML.cpp:898
ComPWA::FunctionTree::ParameterList Data
Definition: BuilderXML.hpp:52
Implementation of the ComPWA::Kinematics interface for amplitude models using the helicity formalism...
std::set< ParticleProperties > ParticleList
Definition: Properties.hpp:84
ComPWA::FunctionTree::ParameterList Parameters
Definition: BuilderXML.hpp:136
const EventCollection & RecoPhspSample
Definition: BuilderXML.hpp:134
std::pair< std::string, std::string > Names
Definition: BuilderXML.hpp:159
The Kinematics interface defines the conversion of Events to a DataSet.
Definition: Kinematics.hpp:19
HelicityKinematics createHelicityKinematics(const std::string XmlFile)
Create HelicityKinematics object from an XML file that contains both a kinematics section and a parti...
void updateDataContainerState(ComPWA::FunctionTree::ParameterList &DataSample, const Kinematics &Kinematics)
Definition: BuilderXML.cpp:869
TwoBodyDecayInfo extractDecayInfo(const boost::property_tree::ptree &pt)
Definition: BuilderXML.cpp:609
std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double > > > Weights
Definition: BuilderXML.hpp:53
std::map< std::string, std::pair< std::string, std::shared_ptr< ComPWA::FunctionTree::TreeNode > > > UniqueComponentFTMapping
Definition: BuilderXML.hpp:128
std::pair< double, double > Helicities
Definition: BuilderXML.hpp:160
This class provides a list of parameters and values of different types.
Definition of a two-body decay node within a sequential decay tree.
Definition: SubSystem.hpp:31
Contains SubSystem class.