ComPWA
Common Partial-Wave-Analysis Framework
BOSSAdapter.cpp
Go to the documentation of this file.
1 // Copyright (c) 2013, 2015, 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 <string>
6 
7 #include "BOSSAdapter.hpp"
8 #include "Core/Kinematics.hpp"
9 #include "Physics/BuilderXML.hpp"
10 
11 #include "boost/property_tree/xml_parser.hpp"
12 
13 namespace ComPWA {
14 namespace Tools {
15 namespace Adapter {
16 
19 BOSS::createHelicityModel(const char *modelXMLFile, int seed,
20  const std::vector<pid> &initialState,
21  const std::vector<pid> &finalState,
22  const char *particleXMLFile) {
23  std::string modelStr;
24  if (modelXMLFile == nullptr) {
25  modelStr = std::string(modelXMLFile);
26  } else {
27  // TODO: error
28  }
29 
30  ComPWA::ParticleList Particles;
31 
32  if (particleXMLFile) {
33  std::string particleStr(particleXMLFile);
34  boost::property_tree::ptree ParticlesPT;
35  boost::property_tree::xml_parser::read_xml(particleXMLFile, ParticlesPT);
36  ComPWA::insertParticles(Particles, ParticlesPT);
37  }
38 
39  boost::property_tree::ptree model;
40  boost::property_tree::xml_parser::read_xml(modelXMLFile, model);
41 
42  auto kin(ComPWA::Physics::createHelicityKinematics(Particles, model));
43 
44  ComPWA::Physics::IntensityBuilderXML Builder(Particles, kin, model);
45 
46  return std::make_pair(Builder.createIntensity(), std::move(kin));
47 }
48 
49 } // namespace Adapter
50 } // namespace Tools
51 } // namespace ComPWA
ComPWA::FunctionTree::FunctionTreeIntensity createIntensity()
Definition: BuilderXML.cpp:49
Implementation of the ComPWA::Kinematics interface for amplitude models using the helicity formalism...
std::set< ParticleProperties > ParticleList
Definition: Properties.hpp:84
void insertParticles(ParticleList &list, const boost::property_tree::ptree &pt)
Read list of particles from a boost::property_tree.
Definition: Properties.cpp:95
HelicityKinematics createHelicityKinematics(const std::string XmlFile)
Create HelicityKinematics object from an XML file that contains both a kinematics section and a parti...
std::pair< FunctionTree::FunctionTreeIntensity, Physics::HelicityFormalism::HelicityKinematics > createHelicityModel(const char *modelXMLFile, int seed, const std::vector< pid > &initialState, const std::vector< pid > &finalState, const char *particleXMLFile)
Definition: BOSSAdapter.cpp:19