ComPWA
Common Partial-Wave-Analysis Framework
BuilderXML.cpp
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 #include "BuilderXML.hpp"
6 
7 #include "Core/Exceptions.hpp"
8 #include "Core/Logging.hpp"
9 #include "Core/Properties.hpp"
10 #include "Data/DataSet.hpp"
12 #include "Tools/Integration.hpp"
13 
19 
20 #include <boost/property_tree/ptree.hpp>
21 #include <boost/property_tree/xml_parser.hpp>
22 
24 
25 namespace ComPWA {
26 namespace Physics {
27 
30 
33  const boost::property_tree::ptree &ModelTree,
34  const EventCollection &TruePhspSample,
35  const EventCollection &RecoPhspSample)
36  : PartList(ParticleList), Kinematic(Kinematics), ModelTree(ModelTree),
37  TruePhspSample(TruePhspSample),
38  RecoPhspSample(
39  [&TruePhspSample, &RecoPhspSample]() -> const EventCollection & {
40  if (TruePhspSample.Events.size() > 0 &&
41  RecoPhspSample.Events.size() == 0)
42  return TruePhspSample;
43  else {
44  return RecoPhspSample;
45  }
46  }()) {}
47 
50  LOG(TRACE) << "loading intensity...";
51  // BlankState
55 
56  std::shared_ptr<ComPWA::FunctionTree::TreeNode> FT =
58 
60 
61  return {FT, Parameters, Data.Data};
62 }
63 
64 std::vector<ComPWA::Tools::IntensityComponent>
66  std::vector<std::vector<std::string>> ComponentList) {
67  LOG(TRACE) << "Creating intensity components...";
68 
69  if (UniqueComponentFTMapping.size() == 0) {
70  LOG(INFO) << "Components map is empty. Creating full Intensity first.";
72  }
73 
74  // then put these FT together according to the string vectors
75  std::vector<ComPWA::Tools::IntensityComponent> IntensityComponents;
76 
77  for (auto const &Component : ComponentList) {
78  std::string ComponentName;
79  std::map<
80  std::string,
81  std::pair<std::string, std::shared_ptr<ComPWA::FunctionTree::TreeNode>>>
82  NewUniqueComponentFTMapping;
83  std::string Type("");
84  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> FTList;
85  for (auto const &x : Component) {
86  auto FindResult = UniqueComponentFTMapping.find(x);
87  if (UniqueComponentFTMapping.end() != FindResult) {
88  ComponentName += "_" + x;
89  if (Type == "") {
90  Type = FindResult->second.first;
91  } else {
92  if (Type != FindResult->second.first) {
93  LOG(ERROR) << "Component " << x
94  << " incompatible with previous type " << Type
95  << " Skipping...";
96  continue;
97  }
98  }
99  NewUniqueComponentFTMapping.insert(*FindResult);
100  FTList.push_back(FindResult->second.second);
101  } else {
102  LOG(ERROR) << "Component " << x << " not found! Skipping...";
103  }
104  }
105  if (FTList.size() == 0)
106  continue;
107 
108  ComponentName.erase(0, 1);
109 
110  LOG(INFO) << "Building component " << ComponentName;
111 
112  // empty component were already removed so [0] is safe
113  if (Type == "Amplitude") {
114  IntensityComponents.push_back(std::make_pair(
115  ComponentName,
116  std::make_shared<ComPWA::FunctionTree::FunctionTreeIntensity>(
118  LOG(INFO) << "as a CoherentIntensity";
119  } else {
120  IntensityComponents.push_back(std::make_pair(
121  ComponentName,
122  std::make_shared<ComPWA::FunctionTree::FunctionTreeIntensity>(
124  LOG(INFO) << "as a IncoherentIntensity";
125  }
126  }
127  return IntensityComponents;
128 }
129 
130 std::map<std::string, std::string>
132  std::map<std::string, std::string> Names;
133  for (auto x : UniqueComponentFTMapping) {
134  Names[x.first] = x.second.first;
135  }
136  return Names;
137 }
138 
139 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
141  const boost::property_tree::ptree &pt,
142  const ComPWA::FunctionTree::ParameterList &DataSample) {
143  LOG(TRACE) << "loading intensity...";
144 
145  std::string IntensityClass(pt.get<std::string>("<xmlattr>.Class"));
146 
147  std::shared_ptr<ComPWA::FunctionTree::TreeNode> FT(nullptr);
148 
149  if (IntensityClass == "IncoherentIntensity") {
150  FT = createIncoherentIntensityFT(pt, DataSample);
151  } else if (IntensityClass == "CoherentIntensity") {
152  FT = createCoherentIntensityFT(pt, DataSample);
153  } else if (IntensityClass == "StrengthIntensity") {
154  FT = createStrengthIntensityFT(pt, DataSample);
155  } else if (IntensityClass == "NormalizedIntensity") {
156  FT = createNormalizedIntensityFT(pt, DataSample);
157  } else {
158  throw BadConfig("IntensityBuilderXML::createIntensityFT() | Found "
159  "unknown intensity " +
160  IntensityClass);
161  }
162 
163  auto Component = pt.get_optional<std::string>("<xmlattr>.Component");
164  if (Component.is_initialized()) {
165  addFunctionTreeComponent(Component.get(), "Intensity", FT);
166  }
167 
168  return FT;
169 }
170 
171 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
173  const boost::property_tree::ptree &pt,
174  const ComPWA::FunctionTree::ParameterList &DataSample) {
175  LOG(TRACE) << "constructing IncoherentIntensity ...";
176 
177  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> intens;
178  for (const auto &x : pt) {
179  if (x.first == "Intensity") {
180  intens.push_back(createIntensityFT(x.second, DataSample));
181  }
182  }
183 
184  return createIncoherentIntensityFT(intens);
185 }
186 
187 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
189  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> Intensities) {
190  LOG(TRACE) << "constructing IncoherentIntensity ...";
191 
192  using namespace ComPWA::FunctionTree;
193 
194  auto tr =
195  std::make_shared<TreeNode>(std::make_shared<AddAll>(ParType::MDOUBLE));
196 
197  for (auto x : Intensities) {
198  tr->addNode(x);
199  }
200 
201  return tr;
202 }
203 
204 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
206  const boost::property_tree::ptree &pt,
207  const ComPWA::FunctionTree::ParameterList &DataSample) {
208  LOG(TRACE) << "constructing CoherentIntensity ...";
209 
210  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> amps;
211  for (const auto &x : pt) {
212  if (x.first == "Amplitude") {
213  amps.push_back(createAmplitudeFT(x.second, DataSample));
214  }
215  }
216 
217  return createCoherentIntensityFT(amps);
218 }
219 
220 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
222  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> Amplitudes) {
223  LOG(TRACE) << "constructing CoherentIntensity ...";
224 
225  using namespace ComPWA::FunctionTree;
226  auto tr = std::make_shared<ComPWA::FunctionTree::TreeNode>(
227  std::make_shared<AbsSquare>(ParType::MDOUBLE));
228 
229  auto SumOfAmps =
230  std::make_shared<TreeNode>(std::make_shared<AddAll>(ParType::MCOMPLEX));
231  tr->addNode(SumOfAmps);
232  for (auto x : Amplitudes) {
233  SumOfAmps->addNode(x);
234  }
235 
236  return tr;
237 }
238 
239 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
241  const boost::property_tree::ptree &pt,
242  const ComPWA::FunctionTree::ParameterList &DataSample) {
243  LOG(TRACE) << "creating StrengthIntensity ...";
244 
245  std::shared_ptr<FitParameter> Strength(nullptr);
246  boost::property_tree::ptree UndecoratedIntensityPT;
247  for (const auto &x : pt) {
248  if (x.first == "<xmlattr>")
249  continue;
250  if (x.first == "Parameter" &&
251  x.second.get<std::string>("<xmlattr>.Type") == "Strength") {
252  Strength = std::make_shared<FitParameter>(x.second);
253  } else if (x.first == "Intensity") {
254  UndecoratedIntensityPT = x.second;
255  } else {
256  LOG(WARNING) << "IntensityBuilderXML::createStrengthIntensity(): found "
257  "unknown tag "
258  << x.first;
259  }
260  }
261 
262  Strength = Parameters.addUniqueParameter(Strength);
263 
264  using namespace ComPWA::FunctionTree;
265  auto tr = std::make_shared<ComPWA::FunctionTree::TreeNode>(
266  MDouble("", 0), std::make_shared<MultAll>(ParType::MDOUBLE));
267 
268  tr->addNode(FunctionTree::createLeaf(Strength));
269  tr->addNode(createIntensityFT(UndecoratedIntensityPT, DataSample));
270 
271  return tr;
272 }
273 
274 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
276  const boost::property_tree::ptree &pt,
277  const ComPWA::FunctionTree::ParameterList &DataSample) {
278  LOG(TRACE) << "creating NormalizedIntensity ...";
279 
280  boost::property_tree::ptree UnnormalizedPT;
281  std::string IntegratorClassName("MCIntegrationStrategy");
282 
283  for (const auto &x : pt) {
284  if (x.first == "<xmlattr>")
285  continue;
286  if (x.first == "Intensity") {
287  UnnormalizedPT = x.second;
288  } else if (x.first == "IntegrationStrategy") {
289  auto OptionalIntegratorName =
290  pt.get_optional<std::string>("<xmlattr>.IntegrationStrategy");
291  if (OptionalIntegratorName.is_initialized()) {
292  IntegratorClassName = OptionalIntegratorName.get();
293  } else {
294  LOG(TRACE)
295  << "IntensityBuilderXML::createNormalizedIntensityFT(): creating "
296  "default IntegrationStrategy *MCIntegrationStrategy*";
297  }
298  } else {
299  LOG(WARNING)
300  << "IntensityBuilderXML::createNormalizedIntensityFT(): found "
301  "unknown tag "
302  << x.first;
303  }
304  }
305 
306  return normalizeIntensityFT(UnnormalizedPT, DataSample, IntegratorClassName);
307 }
308 
309 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
311  const boost::property_tree::ptree &UnnormalizedPT,
312  const ComPWA::FunctionTree::ParameterList &DataSample,
313  std::string IntegratorClassName) {
314  LOG(TRACE) << "creating Normalized FunctionTree ...";
315 
316  if (RecoPhspSample.Events.size() == 0)
317  LOG(FATAL) << "IntensityBuilderXML::normalizeIntensityFT(): "
318  "reco phsp sample is not set!";
320 
321  using namespace ComPWA::FunctionTree;
322 
323  auto NormalizedFT = std::make_shared<ComPWA::FunctionTree::TreeNode>(
324  std::make_shared<MultAll>(ParType::MDOUBLE));
325 
326  auto FTData = createIntensityFT(UnnormalizedPT, DataSample);
327  NormalizedFT->addNode(FTData);
328 
329  bool PreviousSetting = ComponentRegisteringEnabled;
331  auto FTPhspData = createIntensityFT(UnnormalizedPT, PhspRecoData.Data);
332  ComponentRegisteringEnabled = PreviousSetting;
333  auto normtree =
335  PhspRecoData.WeightSum, IntegratorClassName);
336 
337  NormalizedFT->addNode(normtree);
338 
339  return NormalizedFT;
340 }
341 
342 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
344  std::shared_ptr<ComPWA::FunctionTree::TreeNode> UnnormalizedIntensity,
345  std::shared_ptr<ComPWA::FunctionTree::Value<std::vector<double>>>
346  PhspWeights,
347  double PhspWeightSum, std::string IntegratorClassName) {
348  LOG(TRACE) << "creating IntegrationStrategy ...";
349 
350  using namespace ComPWA::FunctionTree;
351  std::shared_ptr<TreeNode> tr;
352 
353  if (IntegratorClassName == "MCIntegrationStrategy") {
354  // update the PhspData container
356 
357  tr = std::make_shared<TreeNode>(
358  std::shared_ptr<Strategy>(new Inverse(ParType::DOUBLE)));
359  auto Integral = std::make_shared<TreeNode>(
360  std::shared_ptr<Strategy>(new MultAll(ParType::DOUBLE)));
361  tr->addNode(Integral);
362  Integral->addNodes(
363  {createLeaf(Kinematic.phspVolume(), "PhspVolume"),
364  createLeaf(1.0 / PhspWeightSum, "Inverse_PhspWeightSum")});
365  auto Sum = std::make_shared<TreeNode>(
366  std::shared_ptr<Strategy>(new AddAll(ParType::DOUBLE)));
367  Integral->addNode(Sum);
368  auto WeightedIntensities = std::make_shared<TreeNode>(
369  std::shared_ptr<Strategy>(new MultAll(ParType::MDOUBLE)));
370  Sum->addNode(WeightedIntensities);
371 
372  if (PhspWeights)
373  WeightedIntensities->addNode(createLeaf(PhspWeights));
374  WeightedIntensities->addNode(UnnormalizedIntensity);
375  } else {
376  LOG(WARNING) << "IntensityBuilderXML::createIntegrationStrategyFT(): "
377  "IntegrationStrategy type "
378  << IntegratorClassName << " unknown!";
379  }
380 
381  return tr;
382 }
383 
384 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
386  const boost::property_tree::ptree &pt,
387  const ComPWA::FunctionTree::ParameterList &DataSample) {
388  auto ampclass = pt.get<std::string>("<xmlattr>.Class");
389 
390  std::shared_ptr<ComPWA::FunctionTree::TreeNode> FT(nullptr);
391 
392  if (ampclass == "HelicityDecay") {
393  FT = createHelicityDecayFT(pt, DataSample);
394  } else if (ampclass == "CoefficientAmplitude") {
395  FT = createCoefficientAmplitudeFT(pt, DataSample);
396  } else if (ampclass == "SequentialAmplitude") {
397  FT = createSequentialAmplitudeFT(pt, DataSample);
398  } else if (ampclass == "NormalizedAmplitude") {
399  FT = createNormalizedAmplitudeFT(pt, DataSample);
400  } else {
401  throw BadConfig(
402  "IntensityBuilderXML::createAmplitude(): Unknown amplitude " +
403  ampclass);
404  }
405 
406  auto Component = pt.get_optional<std::string>("<xmlattr>.Component");
407  if (Component.is_initialized()) {
408  addFunctionTreeComponent(Component.get(), "Amplitude", FT);
409  }
410 
411  return FT;
412 }
413 
414 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
416  const boost::property_tree::ptree &pt,
417  const ComPWA::FunctionTree::ParameterList &DataSample) {
418  LOG(TRACE) << "creating NormalizedAmplitude ...";
419 
420  if (TruePhspSample.Events.size() == 0)
421  LOG(FATAL) << "IntensityBuilderXML::createNormalizedAmplitudeFT(): "
422  "true phsp sample is not set!";
424 
425  boost::property_tree::ptree UnnormalizedPT;
426  std::string IntegratorClassName("MCIntegrationStrategy");
427 
428  for (const auto &x : pt) {
429  if (x.first == "<xmlattr>")
430  continue;
431  if (x.first == "Amplitude") {
432  UnnormalizedPT = x.second;
433  } else if (x.first == "IntegrationStrategy") {
434  auto OptionalIntegratorName =
435  pt.get_optional<std::string>("<xmlattr>.IntegrationStrategy");
436  if (OptionalIntegratorName.is_initialized()) {
437  IntegratorClassName = OptionalIntegratorName.get();
438  } else {
439  LOG(TRACE)
440  << "IntensityBuilderXML::createNormalizedAmplitudeFT(): creating "
441  "default IntegrationStrategy *MCIntegrationStrategy*";
442  }
443  } else {
444  LOG(WARNING)
445  << "IntensityBuilderXML::createNormalizedAmplitudeFT(): found "
446  "unknown tag "
447  << x.first;
448  }
449  }
450 
451  auto FTData = createAmplitudeFT(UnnormalizedPT, DataSample);
452 
453  using namespace ComPWA::FunctionTree;
454 
455  auto NormalizedFT =
456  std::make_shared<TreeNode>(std::make_shared<MultAll>(ParType::MCOMPLEX));
457 
458  NormalizedFT->addNode(FTData);
459 
460  bool PreviousSetting = ComponentRegisteringEnabled;
462  auto FTPhspData = createAmplitudeFT(UnnormalizedPT, PhspData.Data);
463  ComponentRegisteringEnabled = PreviousSetting;
464  // this phspdata function tree has to be made into a double valued function
465  auto FTPhspDataAbsSquared =
466  std::make_shared<TreeNode>(std::make_shared<AbsSquare>(ParType::MDOUBLE));
467  FTPhspDataAbsSquared->addNode(FTPhspData);
468 
469  auto normtreesquared =
470  createIntegrationStrategyFT(FTPhspDataAbsSquared, PhspData.Weights,
471  PhspData.WeightSum, IntegratorClassName);
472 
473  auto normtree =
474  std::make_shared<TreeNode>(std::make_shared<SquareRoot>(ParType::DOUBLE));
475 
476  normtree->addNode(normtreesquared);
477 
478  NormalizedFT->addNode(normtree);
479 
480  return NormalizedFT;
481 }
482 
483 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
485  const boost::property_tree::ptree &pt,
486  const ComPWA::FunctionTree::ParameterList &DataSample) {
487  LOG(TRACE) << "constructing CoefficientAmplitude ...";
488 
489  std::shared_ptr<FitParameter> Magnitude(nullptr);
490  std::shared_ptr<FitParameter> Phase(nullptr);
491  auto PreFactor = std::complex<double>(1, 0);
492  bool IsPreFactorSet(false);
493  boost::property_tree::ptree Amplitude;
494  for (const auto &v : pt) {
495  if (v.first == "Parameter") {
496  if (v.second.get<std::string>("<xmlattr>.Type") == "Magnitude")
497  Magnitude = std::make_shared<FitParameter>(v.second);
498  if (v.second.get<std::string>("<xmlattr>.Type") == "Phase")
499  Phase = std::make_shared<FitParameter>(v.second);
500  } else if (v.first == "PreFactor") {
501  IsPreFactorSet = true;
502  boost::optional<double> optr =
503  v.second.get_optional<double>("<xmlattr>.Magnitude");
504  if (optr.is_initialized()) {
505  double r(optr.value());
506  if (r < 0.0)
507  throw BadConfig(
508  "IntensityBuilderXML::createCoefficientAmplitudeFT() | "
509  "PreFactor Magnitude below zero!");
510  double Phase(0.0);
511  boost::optional<double> OptPhase =
512  v.second.get_optional<double>("<xmlattr>.Phase");
513  if (OptPhase.is_initialized())
514  Phase = OptPhase.value();
515  PreFactor = std::polar(r, Phase);
516  } else {
517  double Real = v.second.get<double>("<xmlattr>.Real");
518  double Imaginary(0.0);
519  boost::optional<double> OptIm =
520  v.second.get_optional<double>("<xmlattr>.Imaginary");
521  if (OptIm.is_initialized())
522  Imaginary = OptIm.value();
523  PreFactor = std::complex<double>(Real, Imaginary);
524  }
525  } else if (v.first == "Amplitude") {
526  Amplitude = v.second;
527  } else if (v.first != "<xmlattr>") {
528  throw BadConfig("IntensityBuilderXML::createCoefficientAmplitudeFT() | "
529  "Unknown tag " +
530  v.first + "!");
531  }
532  }
533 
534  auto amp_ft = createAmplitudeFT(Amplitude, DataSample);
535 
536  auto tr = std::make_shared<ComPWA::FunctionTree::TreeNode>(
538  std::make_shared<ComPWA::FunctionTree::MultAll>(
540 
541  bool AddStrength(true);
542  if (IsPreFactorSet) {
543  tr->addNode(FunctionTree::createLeaf(PreFactor, "PreFactor"));
544  if (!Magnitude && !Phase) {
545  AddStrength = false;
546  } else if (!Magnitude && Phase) {
547  throw BadParameter("IntensityBuilderXML::createCoefficientAmplitude() | "
548  "No magnitude parameter found while phase is set.");
549  } else if (!Phase && Magnitude)
550  throw BadParameter("IntensityBuilderXML::createCoefficientAmplitude() | "
551  "No phase parameter found, while magnitude is set.");
552  } else {
553  if (!Magnitude)
554  throw BadParameter("IntensityBuilderXML::createCoefficientAmplitude() | "
555  "No magnitude parameter found and no prefactor set.");
556  if (!Phase)
557  throw BadParameter("IntensityBuilderXML::createCoefficientAmplitude() | "
558  "No phase parameter found, while magnitude is set.");
559  }
560 
561  if (AddStrength) {
562  Magnitude = Parameters.addUniqueParameter(Magnitude);
563  Phase = Parameters.addUniqueParameter(Phase);
564 
565  auto Strength = std::make_shared<ComPWA::FunctionTree::TreeNode>(
566  std::make_shared<ComPWA::FunctionTree::Value<std::complex<double>>>(),
567  std::make_shared<ComPWA::FunctionTree::Complexify>(
569  Strength->addNodes({createLeaf(Magnitude), createLeaf(Phase)});
570 
571  tr->addNode(Strength);
572  }
573  tr->addNode(amp_ft);
574 
575  return tr;
576 }
577 
578 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
580  const boost::property_tree::ptree &pt,
581  const ComPWA::FunctionTree::ParameterList &DataSample) {
582  LOG(TRACE) << "constructing SequentialAmplitude ...";
583 
584  std::vector<std::shared_ptr<ComPWA::FunctionTree::TreeNode>> Amplitudes;
585  for (const auto &v : pt) {
586  if (v.first == "Amplitude") {
587  std::shared_ptr<ComPWA::FunctionTree::TreeNode> AmpTree =
588  createAmplitudeFT(v.second, DataSample);
589 
590  Amplitudes.push_back(AmpTree);
591  } else if (v.first != "<xmlattr>") {
592  throw BadConfig("SequentialAmplitude::createSequentialAmplitude() | "
593  "Unknown tag " +
594  v.first + "!");
595  }
596  }
597 
598  using namespace ComPWA::FunctionTree;
599  auto tr =
600  std::make_shared<TreeNode>(std::make_shared<MultAll>(ParType::MCOMPLEX));
601 
602  for (auto x : Amplitudes) {
603  tr->addNode(x);
604  }
605 
606  return tr;
607 }
608 
609 TwoBodyDecayInfo extractDecayInfo(const boost::property_tree::ptree &pt) {
610  // Read name and helicities from decay products
611  auto decayProducts = pt.get_child("DecayProducts");
612  if (decayProducts.size() != 2)
613  throw boost::property_tree::ptree_error(
614  "IntensityBuilderXML::createHelicityDecayFT(): Expect exactly two "
615  "decay products (" +
616  std::to_string(decayProducts.size()) + " given)!");
617 
618  auto recoil =
619  pt.get_optional<std::string>("RecoilSystem.<xmlattr>.RecoilFinalState");
620  IndexList RecoilState;
621  if (recoil) {
622  RecoilState = stringToVectInt(recoil.get());
623  }
624  auto parent_recoil = pt.get_optional<std::string>(
625  "RecoilSystem.<xmlattr>.ParentRecoilFinalState");
626  IndexList ParentRecoilState;
627  if (parent_recoil) {
628  ParentRecoilState = stringToVectInt(parent_recoil.get());
629  }
630  std::vector<IndexList> DecayProductStates;
631  std::vector<std::string> Names;
632  std::vector<double> Helicities;
633  for (auto p : decayProducts) {
634  DecayProductStates.push_back(
635  stringToVectInt(p.second.get<std::string>("<xmlattr>.FinalState")));
636  Names.push_back(p.second.get<std::string>("<xmlattr>.Name"));
637  Helicities.push_back(p.second.get<double>("<xmlattr>.Helicity"));
638  }
639  return TwoBodyDecayInfo{
640  SubSystem(DecayProductStates, RecoilState, ParentRecoilState),
641  std::make_pair(Names.at(0), Names.at(1)),
642  std::make_pair(Helicities.at(0), Helicities.at(1))};
643 }
644 
645 std::shared_ptr<ComPWA::FunctionTree::TreeNode>
647  const boost::property_tree::ptree &pt,
648  const ComPWA::FunctionTree::ParameterList &DataSample) {
649  LOG(TRACE) << "IntensityBuilderXML::createHelicityDecayFT(): ";
650  auto &kin = dynamic_cast<HelicityFormalism::HelicityKinematics &>(Kinematic);
651  auto DecayProductInfo = extractDecayInfo(pt);
652  auto KinVarNames = kin.registerSubSystem(DecayProductInfo.SubSys);
653  auto const &FinalStates = DecayProductInfo.SubSys.getFinalStates();
654  std::pair<std::string, std::string> DecayProductInvMassNames;
655  if (FinalStates.at(0).size() > 1) {
656  DecayProductInvMassNames.first =
657  kin.registerInvariantMassSquared(FinalStates.at(0));
658  }
659  if (FinalStates.at(1).size() > 1) {
660  DecayProductInvMassNames.second =
661  kin.registerInvariantMassSquared(FinalStates.at(1));
662  }
663 
665 
666  auto InvMassSq =
667  FunctionTree::findMDoubleValue(std::get<0>(KinVarNames), DataSample);
668  auto Theta =
669  FunctionTree::findMDoubleValue(std::get<1>(KinVarNames), DataSample);
670  auto Phi =
671  FunctionTree::findMDoubleValue(std::get<2>(KinVarNames), DataSample);
672 
673  auto parMass1 = std::make_shared<FitParameter>(
674  ComPWA::findParticle(PartList, DecayProductInfo.Names.first).getMass());
675  auto parMass2 = std::make_shared<FitParameter>(
676  ComPWA::findParticle(PartList, DecayProductInfo.Names.second).getMass());
677  parMass1 = Parameters.addUniqueParameter(parMass1);
678  parMass2 = Parameters.addUniqueParameter(parMass2);
679 
680  auto InvMassDaughter1 = FunctionTree::MDouble(
681  parMass1->name(), std::vector<double>{std::pow(parMass1->value(), 2)});
682  if (DecayProductInvMassNames.first != "") {
683  InvMassDaughter1 = FunctionTree::findMDoubleValue(
684  DecayProductInvMassNames.first, DataSample);
685  }
686  auto InvMassDaughter2 = FunctionTree::MDouble(
687  parMass2->name(), std::vector<double>{std::pow(parMass2->value(), 2)});
688  if (DecayProductInvMassNames.second != "") {
689  InvMassDaughter2 = FunctionTree::findMDoubleValue(
690  DecayProductInvMassNames.second, DataSample);
691  }
692 
693  std::string name = pt.get<std::string>("DecayParticle.<xmlattr>.Name");
694  auto partProp = ComPWA::findParticle(PartList, name);
695 
696  double J = partProp.getQuantumNumber<double>("Spin");
697  double mu(pt.get<double>("DecayParticle.<xmlattr>.Helicity"));
698  // if the node OrbitalAngularMomentum does not exist, set it to spin J as
699  // default value
700  unsigned int L(J);
701 
702  auto Mass = std::make_shared<FunctionTree::FitParameter>(
703  partProp.getMass().Name, partProp.getMass().Value,
704  partProp.getMass().Error.first);
705  Mass->fixParameter(partProp.getMass().IsFixed);
706  Mass = Parameters.addUniqueParameter(Mass);
707 
708  double PreFactor(1.0);
709  const auto &canoSum = pt.get_child_optional("CanonicalSum");
710  if (canoSum) {
711  const auto &sumTree = canoSum.get();
712  L = sumTree.get<unsigned int>("<xmlattr>.L");
713  double Coefficient = std::sqrt((2.0 * L + 1) / (2 * J + 1));
714  for (const auto &cg : sumTree.get_child("")) {
715  if (cg.first != "ClebschGordan")
716  continue;
717  double j1 = cg.second.get<double>("<xmlattr>.j1");
718  double m1 = cg.second.get<double>("<xmlattr>.m1");
719  double j2 = cg.second.get<double>("<xmlattr>.j2");
720  double m2 = cg.second.get<double>("<xmlattr>.m2");
721  double J = cg.second.get<double>("<xmlattr>.J");
722  double M = cg.second.get<double>("<xmlattr>.M");
723  Coefficient *= ComPWA::QFT::Clebsch(j1, m1, j2, m2, J, M);
724  }
725  PreFactor *= Coefficient;
726  }
727 
728  auto decayInfo = partProp.getDecayInfo();
729  std::string FFType("");
730  std::shared_ptr<Dynamics::FormFactor> FormFactor =
731  std::make_shared<Dynamics::NoFormFactor>();
732  std::shared_ptr<FitParameter> parRadius;
733  std::shared_ptr<FitParameter> Width;
734  for (const auto &node : decayInfo.get_child("")) {
735  if (node.first == "FormFactor") {
736  FFType = node.second.get<std::string>("<xmlattr>.Type");
737  if ("BlattWeisskopf" == FFType) {
738  if (L > 4)
739  throw std::runtime_error(
740  "createHelicityDecayFT() | Blatt-Weisskopf form factors are "
741  "implemented for L up to 4!");
742  FormFactor = std::make_shared<Dynamics::BlattWeisskopfFormFactor>();
743  } else if ("CrystalBarrel" == FFType) {
744  if (L != 0)
745  throw std::runtime_error(
746  "createHelicityDecayFT() | Crystal Barrel form factors are "
747  "implemented for L=0 only!");
748  FormFactor = std::make_shared<Dynamics::CrystalBarrelFormFactor>();
749  } else {
750  // if user specifies unknown form factor
751  throw std::runtime_error("createHelicityDecayFT() | Form factor type " +
752  FFType + " not specified!");
753  }
754  } else if (node.first == "Parameter") {
755  std::string parType = node.second.get<std::string>("<xmlattr>.Type");
756  if (parType == "Width") {
757  Width = std::make_shared<FitParameter>(node.second);
758  Width = Parameters.addUniqueParameter(Width);
759  } else if (parType == "MesonRadius") {
760  parRadius = std::make_shared<FitParameter>(node.second);
761  parRadius = Parameters.addUniqueParameter(parRadius);
762  }
763  }
764  }
765 
766  std::string decayType = partProp.getDecayType();
767 
768  std::shared_ptr<ComPWA::FunctionTree::TreeNode> DynamicFunctionFT(nullptr);
769 
770  if (decayType == "stable") {
771  throw std::runtime_error(
772  "IntensityBuilderXML::createHelicityDecayFT(): Stable particle is "
773  "given as mother particle of a decay. Makes no sense!");
774  } else if (decayType.find("BreitWigner") != std::string::npos) {
776  InputInfo RBW;
777  RBW.Type = decayType;
778  RBW.Mass = Mass;
779  RBW.Width = Width;
780  RBW.MesonRadius = parRadius;
782  std::make_pair(InvMassDaughter1, InvMassDaughter2);
783  RBW.FormFactorFunctor = FormFactor;
784  RBW.L = L;
785  DynamicFunctionFT = createFunctionTree(RBW, InvMassSq);
786  } else if (decayType == "flatte") {
788  FlatteInfo.Mass = Mass;
789  FlatteInfo.MesonRadius = parRadius;
790  FlatteInfo.DaughterInvariantMasses =
791  std::make_pair(InvMassDaughter1, InvMassDaughter2);
792  FlatteInfo.FormFactorFunctor = FormFactor;
793  FlatteInfo.L = L;
794  std::vector<Dynamics::Coupling> couplings;
795  // Read parameters
796  for (const auto &v : decayInfo.get_child("")) {
797  if (v.first != "Parameter")
798  continue;
799  std::string type = v.second.get<std::string>("<xmlattr>.Type");
800  if (type == "Coupling") {
801  auto c = Dynamics::Coupling(PartList, v.second);
802  c.G = Parameters.addUniqueParameter(c.G);
803 
804  if ((c.MassA->value() == parMass1->value() &&
805  c.MassB->value() == parMass2->value()) ||
806  (c.MassB->value() == parMass1->value() &&
807  c.MassA->value() == parMass2->value())) {
808  FlatteInfo.G = c.G;
809  } else {
810  c.MassA = Parameters.addUniqueParameter(c.MassA);
811  c.MassB = Parameters.addUniqueParameter(c.MassB);
812  couplings.push_back(c);
813  }
814  }
815  }
816  FlatteInfo.HiddenCouplings = couplings;
817  DynamicFunctionFT = createFunctionTree(FlatteInfo, InvMassSq);
818  } else if (decayType == "voigt") {
819  using namespace ComPWA::Physics::Dynamics::Voigtian;
820  InputInfo VoigtInfo;
821  VoigtInfo.Mass = Mass;
822  VoigtInfo.Width = Width;
823  VoigtInfo.MesonRadius = parRadius;
824  VoigtInfo.DaughterInvariantMasses =
825  std::make_pair(InvMassDaughter1, InvMassDaughter2);
826  VoigtInfo.FormFactorFunctor = FormFactor;
827  VoigtInfo.L = L;
828  VoigtInfo.Sigma = decayInfo.get<double>("Resolution.<xmlattr>.Sigma");
829  DynamicFunctionFT = createFunctionTree(VoigtInfo, InvMassSq);
830  } else if (decayType == "virtual" || decayType == "nonResonant") {
831  DynamicFunctionFT = FunctionTree::createLeaf(1, "Dynamics");
832  } else {
833  throw std::runtime_error("HelicityDecay::Factory() | Unknown decay type " +
834  decayType + "!");
835  }
836 
837  auto AngularFunction =
839  J, mu,
840  DecayProductInfo.Helicities.first -
841  DecayProductInfo.Helicities.second,
842  Theta, Phi);
843 
844  using namespace ComPWA::FunctionTree;
845  auto tr = std::make_shared<ComPWA::FunctionTree::TreeNode>(
846  std::make_shared<MultAll>(ParType::MCOMPLEX));
847  tr->addNodes(
848  {createLeaf(PreFactor, "PreFactor"), AngularFunction, DynamicFunctionFT});
849 
850  // set production formfactor
851  if (FFType != "" && L > 0) {
852  if (parRadius == nullptr) {
853  throw std::runtime_error("IntensityBuilderXML::createHelicityDecayFT(): "
854  "No MesonRadius given for amplitude " +
855  name +
856  "! It is needed to calculate the form factor!");
857  }
858 
859  std::shared_ptr<ComPWA::FunctionTree::TreeNode> ProductionFormFactorFT =
860  Dynamics::createFunctionTree(InvMassDaughter1, InvMassDaughter2,
861  parRadius, L, FormFactor, InvMassSq);
862 
863  tr->addNode(ProductionFormFactorFT);
864  }
865 
866  return tr;
867 }
868 
870  const Kinematics &Kinematics) {
871  auto ExemplaryDataSet = Kinematics.convert({Kinematics.getFinalStatePIDs()});
872 
873  for (auto const &x : ExemplaryDataSet.Data) {
874  std::vector<double> temp;
875  // check if this key already exists than skip otherwise insert
876  bool Exists(false);
877  for (auto MDVal : DataSample.mDoubleValues()) {
878  if (MDVal->name() == x.first) {
879  Exists = true;
880  break;
881  }
882  }
883  if (!Exists) {
884  DataSample.addValue(
885  std::make_shared<ComPWA::FunctionTree::Value<std::vector<double>>>(
886  x.first, temp));
887  }
888  }
889 }
890 
892  LOG(TRACE) << "updating data containers...";
896 }
897 
899  const EventCollection &DataSample,
900  const Kinematics &Kinematics) {
901  LOG(INFO) << "Updating data container content...";
902  if (DataSample.Events.size() == 0)
903  return;
904 
905  auto DataSet = Kinematics.convert(DataSample);
906 
907  // just loop over the vectors and fill in the data
908  if (DataList.mDoubleValues().size() > DataSet.Data.size()) {
909  std::stringstream ss;
910  ss << "IntensityBuilderXML::updateDataContainerContent(): given data "
911  "container does not have enough variables! (required: "
912  << DataList.mDoubleValues().size() << ", given: " << DataSet.Data.size()
913  << ")";
914  throw std::out_of_range(ss.str());
915  }
916  for (size_t i = 0; i < DataList.mDoubleValues().size(); ++i) {
917  if (DataList.mDoubleValue(i)->values().size() == 0) {
918  DataList.mDoubleValue(i)->setValue(
919  DataSet.Data[DataList.mDoubleValue(i)->name()]);
920  }
921  }
922 }
923 
926  Kinematic);
927 }
928 
930  DataContainer &DataCon, const EventCollection &DataSample) {
931  if (!DataCon.Weights && DataCon.WeightSum == 0.0) {
932  LOG(INFO) << "Setting phase space sample weights...";
933  std::vector<double> DataSetWeights;
934  DataSetWeights.reserve(DataSample.Events.size());
935  double WeightSum(0.0);
936  bool UniformWeights(true);
937 
938  for (auto const &Event : DataSample.Events) {
939  DataSetWeights.push_back(Event.Weight);
940  WeightSum += Event.Weight;
941  if (Event.Weight != 1.0)
942  UniformWeights = false;
943  }
944  if (!UniformWeights) {
945  DataCon.Weights = FunctionTree::MDouble("Weight", DataSetWeights);
946  }
947  DataCon.WeightSum = WeightSum;
948  }
949 }
950 
952  std::string Name, std::string Type,
953  std::shared_ptr<ComPWA::FunctionTree::TreeNode> FT) {
954  if (nullptr != FT && ComponentRegisteringEnabled) {
955  auto InsertResult = UniqueComponentFTMapping.insert(
956  std::make_pair(Name, std::make_pair(Type, FT)));
957  if (!InsertResult.second) {
958  LOG(ERROR) << "IntensityBuilderXML::addFunctionTreeComponent(): "
959  "FunctionTree with name "
960  << Name << " already exists!";
961  }
962  }
963 }
964 
965 FourMomentum createFourMomentum(const boost::property_tree::ptree &pt) {
966  double px, py, pz, E;
967 
968  auto tmp = pt.get_optional<double>("<xmlattr>.x");
969  if (tmp) {
970  px = tmp.get();
971  } else {
972  px = pt.get<double>("x");
973  }
974 
975  tmp = pt.get_optional<double>("<xmlattr>.y");
976  if (tmp) {
977  py = tmp.get();
978  } else {
979  py = pt.get<double>("y");
980  }
981 
982  tmp = pt.get_optional<double>("<xmlattr>.z");
983  if (tmp) {
984  pz = tmp.get();
985  } else {
986  pz = pt.get<double>("z");
987  }
988 
989  tmp = pt.get_optional<double>("<xmlattr>.E");
990  if (tmp) {
991  E = tmp.get();
992  } else {
993  E = pt.get<double>("E");
994  }
995 
996  return FourMomentum(px, py, pz, E);
997 }
998 
1001  const boost::property_tree::ptree &pt) {
1002  auto initialS = pt.get_child("InitialState");
1003  auto InitialState = std::vector<pid>(initialS.size());
1004  unsigned int counter(0);
1005  for (auto i : initialS) {
1006  std::string name = i.second.get<std::string>("<xmlattr>.Name");
1007  auto partP = ComPWA::findParticle(PartList, name);
1008  unsigned int pos(counter++);
1009  boost::optional<unsigned int> opt_pos =
1010  i.second.get_optional<unsigned int>("<xmlattr>.PositionIndex");
1011  if (opt_pos)
1012  pos = opt_pos.get();
1013  InitialState.at(pos) = partP.getId();
1014  }
1015 
1016  auto finalS = pt.get_child("FinalState");
1017  auto FinalState = std::vector<pid>(finalS.size());
1018  auto FinalStateEventPositionMapping =
1019  std::vector<unsigned int>(finalS.size());
1020  counter = 0;
1021  for (auto i : finalS) {
1022  std::string name = i.second.get<std::string>("<xmlattr>.Name");
1023  auto partP = ComPWA::findParticle(PartList, name);
1024  unsigned int id = i.second.get<unsigned int>("<xmlattr>.Id");
1025  unsigned int pos(counter++);
1026  boost::optional<unsigned int> opt_pos =
1027  i.second.get_optional<unsigned int>("<xmlattr>.PositionIndex");
1028  if (opt_pos)
1029  pos = opt_pos.get();
1030  FinalState.at(pos) = partP.getId();
1031  FinalStateEventPositionMapping.at(pos) = id;
1032  }
1033 
1034  if (pt.find("InitialFourMomentum") != pt.not_found()) {
1035  auto InitialStateP4 =
1036  createFourMomentum(pt.get_child("InitialFourMomentum"));
1038  InitialState, FinalState, PartList, InitialStateP4,
1039  FinalStateEventPositionMapping);
1040  }
1041 
1043  InitialState, FinalState, PartList, FinalStateEventPositionMapping);
1044 }
1045 
1046 HelicityKinematics createHelicityKinematics(const std::string XmlFile) {
1047  auto ParticleList = readParticles(XmlFile);
1048  return createHelicityKinematics(ParticleList, XmlFile);
1049 }
1050 
1053  const std::string XmlFile) {
1054  boost::property_tree::ptree ptree;
1055  boost::property_tree::xml_parser::read_xml(XmlFile, ptree);
1056  auto it = ptree.find("HelicityKinematics");
1057  if (it != ptree.not_found()) {
1058  return ComPWA::Physics::createHelicityKinematics(ParticleList, it->second);
1059  } else {
1060  throw ComPWA::BadConfig("ComPWA::Physics::createHelicityKinematics(): "
1061  "HelicityKinematics tag not found in xml file!");
1062  }
1063 }
1064 
1067  const boost::property_tree::ptree &ptree) {
1068  auto kininfo = createKinematicsInfo(ParticleList, ptree);
1069 
1070  auto phspVal = ptree.get_optional<double>("PhspVolume");
1071  if (phspVal) {
1072  return HelicityKinematics(kininfo, phspVal.get());
1073  } else {
1074  return HelicityKinematics(kininfo);
1075  }
1076 }
1077 
1078 } // namespace Physics
1079 } // namespace ComPWA
ComPWA four momentum class.
virtual void addValue(std::shared_ptr< Parameter > value)
virtual const std::vector< pid > & getFinalStatePIDs() const =0
Get a vector of PIDs of the final state.
const EventCollection & TruePhspSample
Definition: BuilderXML.hpp:133
Parameter not existing.
Definition: Exceptions.hpp:62
virtual ComPWA::Data::DataSet convert(const EventCollection &Events) const =0
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createIntegrationStrategyFT(std::shared_ptr< ComPWA::FunctionTree::TreeNode > UnnormalizedIntensity, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> PhspWeights, double PhspWeightSum, std::string IntegratorClassName)
Definition: BuilderXML.cpp:343
This file contains the declaration of the Voigtian class, which is used the implementation of voigt f...
boost::property_tree::ptree ModelTree
Definition: BuilderXML.hpp:132
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createCoefficientAmplitudeFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:484
std::shared_ptr< FormFactor > FormFactorFunctor
Form factor function object.
ComPWA::FitParameter< double > getMass() const
Definition: Properties.hpp:35
std::shared_ptr< ComPWA::FunctionTree::TreeNode > normalizeIntensityFT(const boost::property_tree::ptree &UnnormalizedPT, const ComPWA::FunctionTree::ParameterList &DataSample, std::string IntegratorClassNa)
Definition: BuilderXML.cpp:310
std::shared_ptr< Value< std::vector< double > > > findMDoubleValue(const std::string &name, const ParameterList &list)
ParticleStateTransitionKinematicsInfo createKinematicsInfo(const ComPWA::ParticleList &PartList, const boost::property_tree::ptree &pt)
ComPWA exceptions.
ParticleList readParticles(std::stringstream &Stream)
Read list of particles from a stringstream For some reason the boost xml parser needs a non-const ref...
Definition: Properties.cpp:151
std::vector< unsigned int > stringToVectInt(std::string str)
Helper funtions to transfor a string of space-separated numbers to a vector<unsigned int>...
Definition: SubSystem.hpp:54
void addFunctionTreeComponent(std::string Name, std::string Type, std::shared_ptr< ComPWA::FunctionTree::TreeNode > FT)
Definition: BuilderXML.cpp:951
std::shared_ptr< Value< std::vector< double > > > MDouble(std::string name, size_t s, double el=0.)
Definition: Value.hpp:134
std::shared_ptr< FitParameter > addUniqueParameter(std::shared_ptr< FitParameter > par)
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createIncoherentIntensityFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:172
const ParticleProperties & findParticle(const ParticleList &list, pid Pid)
Definition: Properties.hpp:93
FourMomentum createFourMomentum(const boost::property_tree::ptree &pt)
Definition: BuilderXML.cpp:965
void updateDataContainerContent(ComPWA::FunctionTree::ParameterList &DataList, const EventCollection &DataSample, const Kinematics &Kinematics)
Definition: BuilderXML.cpp:898
ComPWA::FunctionTree::ParameterList Data
Definition: BuilderXML.hpp:52
std::map< std::string, std::string > getAllComponentNames() const
Definition: BuilderXML.cpp:131
std::vector< unsigned int > IndexList
Definition: SubSystem.hpp:20
ComPWA::FunctionTree::FunctionTreeIntensity createIntensity()
Definition: BuilderXML.cpp:49
std::vector< ComPWA::Tools::IntensityComponent > createIntensityComponents(std::vector< std::vector< std::string >> ComponentList={})
Definition: BuilderXML.cpp:65
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createHelicityDecayFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:646
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createCoherentIntensityFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:205
std::shared_ptr< ComPWA::FunctionTree::FitParameter > Width
Decay width of resonant state.
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(double J, double MuPrime, double Mu, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> Theta, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> Phi)
Definition: WignerD.cpp:13
std::vector< Event > Events
Definition: Event.hpp:34
Implementation of the ComPWA::Kinematics interface for amplitude models using the helicity formalism...
std::shared_ptr< ComPWA::FunctionTree::FitParameter > MesonRadius
Meson radius of resonant state.
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createIntensityFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:140
std::set< ParticleProperties > ParticleList
Definition: Properties.hpp:84
virtual std::vector< std::shared_ptr< Value< std::vector< double > > > > & mDoubleValues()
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createNormalizedAmplitudeFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:415
void updateDataContainerWeights(DataContainer &DataCon, const EventCollection &DataSample)
Definition: BuilderXML.cpp:929
Calculates the inverse of input double values and double parameters.
Definition: Functions.hpp:63
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createNormalizedIntensityFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:275
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createStrengthIntensityFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:240
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(InputInfo Params, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquared)
Definition: Flatte.cpp:17
Config is not complete.
Definition: Exceptions.hpp:50
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createSequentialAmplitudeFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:579
std::shared_ptr< TreeNode > createLeaf(std::shared_ptr< Parameter > parameter)
Definition: TreeNode.cpp:156
double Weight
Definition: Event.hpp:22
std::vector< Coupling > HiddenCouplings
Coupling parameters and final state masses for multiple hidden channels.
Definition: Flatte.hpp:21
std::shared_ptr< Value< std::vector< std::complex< double > > > > MComplex(std::string name, size_t s, std::complex< double > el=std::complex< double >(0., 0.))
Definition: Value.hpp:120
unsigned int L
Orbital Angular Momentum between two daughters in Resonance decay.
ComPWA::FunctionTree::ParameterList Parameters
Definition: BuilderXML.hpp:136
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createFunctionTree(std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquaredDaughter1, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquaredDaughter2, std::shared_ptr< ComPWA::FunctionTree::FitParameter > MesonRadius, unsigned int L, std::shared_ptr< FormFactor > FormFactorFunctor, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double >>> InvMassSquared)
Definition: FormFactor.cpp:17
const EventCollection & RecoPhspSample
Definition: BuilderXML.hpp:134
virtual double phspVolume() const =0
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...
std::pair< std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double > > >, std::shared_ptr< ComPWA::FunctionTree::Value< std::vector< double > > > > DaughterInvariantMasses
Invariant Masses of daughter particles.
void updateDataContainerState(ComPWA::FunctionTree::ParameterList &DataSample, const Kinematics &Kinematics)
Definition: BuilderXML.cpp:869
Data structure containing all kinematic information of a physics event.
Definition: Event.hpp:20
std::shared_ptr< ComPWA::FunctionTree::FitParameter > Mass
Resonance mass.
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
IntensityBuilderXML(ParticleList ParticleList, Kinematics &Kinematics, const boost::property_tree::ptree &ModelTree, const EventCollection &TruePhspSample={}, const EventCollection &RecoPhspSample={})
Definition: BuilderXML.cpp:31
std::shared_ptr< ComPWA::FunctionTree::TreeNode > createAmplitudeFT(const boost::property_tree::ptree &pt, const ComPWA::FunctionTree::ParameterList &DataSample)
Definition: BuilderXML.cpp:385
std::shared_ptr< ComPWA::FunctionTree::FitParameter > G
Coupling to signal channel.
Definition: Flatte.hpp:19
This class provides a list of parameters and values of different types.
virtual std::shared_ptr< Value< std::vector< double > > > mDoubleValue(size_t i) const
Definition of a two-body decay node within a sequential decay tree.
Definition: SubSystem.hpp:31
Calculates the square root of input double values and double parameters.
Definition: Functions.hpp:91