21 EvtCyclic3::Pair pairAng;
22 EvtCyclic3::Pair pairRes;
23 LOG(DEBUG) <<
"EvtGenIF::addResonance num finalstate00: " 25 LOG(DEBUG) <<
"EvtGenIF::addResonance num finalstate01: " 30 pairAng = EvtCyclic3::Pair::AB;
31 pairRes = EvtCyclic3::Pair::BC;
34 pairAng = EvtCyclic3::Pair::AC;
35 pairRes = EvtCyclic3::Pair::AB;
38 pairAng = EvtCyclic3::Pair::BC;
39 pairRes = EvtCyclic3::Pair::AC;
41 auto evtspin = EvtSpinType::spintype::SCALAR;
43 evtspin = EvtSpinType::spintype::VECTOR;
45 evtspin = EvtSpinType::spintype::TENSOR;
47 throw std::runtime_error(
48 "EvtGenIF::addResonance() | Spins higher than two are not supported.");
50 LOG(DEBUG) <<
"EvtGenIF::addResonance: " << name;
51 LOG(DEBUG) <<
"EvtGenIF::addResonance mass: " << m0;
52 LOG(DEBUG) <<
"EvtGenIF::addResonance width: " << g0;
53 LOG(DEBUG) <<
"EvtGenIF::addResonance spin: " << spin;
54 EvtDalitzReso reso(name,
DalitzPlot, pairAng, pairRes, evtspin, m0, g0,
55 EvtDalitzReso::NumType::RBW_ZEMACH);
56 Resos.push_back(reso);
58 evtPars[std::string(name +
"_mass")] =
59 std::shared_ptr<ComPWA::FunctionTree::FitParameter>(
61 evtPars.at(std::string(name +
"_mass"))->fixParameter(
false);
62 evtPars[std::string(name +
"_width")] =
63 std::shared_ptr<ComPWA::FunctionTree::FitParameter>(
65 evtPars.at(std::string(name +
"_width"))->fixParameter(
true);
72 std::string resoName = pt.get<std::string>(
"<xmlattr>.Name",
"empty");
73 std::string name = pt.get<std::string>(
"DecayParticle.<xmlattr>.Name");
76 double J = parti.getQuantumNumber<
double>(
"Spin");
82 if (DecayInfo.SubSys.getFinalStates().size() == 2) {
88 std::string decayType = partProp.getDecayType();
90 if (decayType ==
"stable") {
91 throw std::runtime_error(
92 "EvtGenIF::addHeliResonance() | Stable particle is " 93 "given as mother particle of a decay. Makes no " 95 }
else if (decayType ==
"relativisticBreitWigner") {
96 LOG(DEBUG) <<
"EvtGenIF::addHeliResonance add resonance";
98 for (
const auto &v : partProp.getDecayInfo().get_child(
"")) {
99 if (v.first !=
"Parameter")
101 std::string type = v.second.get<std::string>(
"<xmlattr>.Type");
102 if (type ==
"Width") {
104 width = v.second.get<
double>(
"Value");
105 }
else if (type ==
"MesonRadius") {
109 addResonance(name, parti.getMass().Value, width, J, DecayInfo.SubSys);
112 }
else if (decayType ==
"flatte") {
117 throw std::runtime_error(
118 "EvtGenIF::addHeliResonance() | Unknown decay type " + decayType +
121 LOG(DEBUG) <<
"EvtGenIF::addHeliResonance finished";
127 std::shared_ptr<DalitzKinematics> kin,
129 if (pt.get<std::string>(
"<xmlattr>.Class") !=
"Incoherent")
130 throw BadConfig(
"IncoherentIntensity::Factory() | Property tree seems to " 131 "not containt a configuration for an " 132 "IncoherentIntensity!");
136 LOG(DEBUG) <<
"EvtGenIF::addResoances starts";
138 for (
const auto &v : pt.get_child(
"")) {
139 if (v.first ==
"Intensity" &&
140 v.second.get<std::string>(
"<xmlattr>.Class") ==
"Coherent") {
142 for (
const auto &
w : v.second.get_child(
"")) {
143 if (
w.first ==
"Amplitude" &&
144 w.second.get<std::string>(
"<xmlattr>.Class") ==
145 "SequentialPartialAmplitude") {
148 std::string name = pt.get<std::string>(
"<xmlattr>.Name",
"empty");
150 std::complex<double> preFactor = std::complex<double>(1, 0);
151 for (
const auto &x :
w.second.get_child(
"")) {
152 if (x.first ==
"Parameter") {
154 }
else if (x.first ==
"PartialAmplitude" &&
155 x.second.get<std::string>(
"<xmlattr>.Class") ==
157 LOG(DEBUG) <<
"EvtGenIF::addResoances add Heli-Resonance";
160 }
else if (x.first ==
"PreFactor") {
161 LOG(DEBUG) <<
"EvtGenIF::addResoances add factor";
162 double r = x.second.get<
double>(
"<xmlattr>.Magnitude");
163 double p = x.second.get<
double>(
"<xmlattr>.Phase");
164 preFactor = std::polar(r, p);
172 LOG(DEBUG) <<
"EvtGenIF::addResoances finished";
176 std::vector<double> Results;
177 for (
size_t EventIndex = 0; EventIndex < data.at(
"mA").size(); ++EventIndex) {
178 EvtDalitzPoint pnt(data.at(
"mA")[EventIndex], data.at(
"mB")[EventIndex],
179 data.at(
"mC")[EventIndex], data.at(
"qAB")[EventIndex],
180 data.at(
"qBC")[EventIndex], data.at(
"qCA")[EventIndex]);
183 for (
unsigned int i = 0; i <
Resos.size(); ++i) {
184 EvtDalitzReso tmp =
Resos.at(i);
185 std::string name = tmp.get_Name();
187 tmp.set_Mass(
evtPars.at(std::string(name +
"_mass"))->value());
188 tmp.set_Gamma(
evtPars.at(std::string(name +
"_width"))->value());
190 result += abs2(tmp.evaluate(pnt));
193 assert(!std::isnan(result) &&
194 "IncoherentIntensity::Intensity() | Result is NaN!");
195 assert(!std::isinf(result) &&
196 "IncoherentIntensity::Intensity() | Result is inf!");
198 Results.push_back(result);
206 if (!i.second->isFixed())
207 i.second->setValue(Parameters[counter]);
213 std::vector<ComPWA::Parameter> pars;
void addHeliResonance(const boost::property_tree::ptree &pt, const ComPWA::ParticleList &partL)
Add EvtGen Dalitz Resonance.
cmplx FADDEEVA() w(cmplx z, double relerr)
void addResonances(const boost::property_tree::ptree &pt, std::shared_ptr< DalitzKinematics > kin, const ComPWA::ParticleList &partL)
Add EvtGen Dalitz Resonances from XML model.
std::vector< double > evaluate(const ComPWA::DataMap &data) noexcept
void updateParametersFrom(const std::vector< double > &Parameters) final
It is important to input the vector in the same length and order as defined in the getParameters() me...
const ParticleProperties & findParticle(const ParticleList &list, pid Pid)
void addResonance(const std::string &name, double m0, double g0, double spin, const ComPWA::Physics::SubSystem &subsys)
Add EvtGen Dalitz Resonance.
std::set< ParticleProperties > ParticleList
virtual const std::vector< std::vector< unsigned int > > & getFinalStates() const
std::vector< EvtDalitzReso > Resos
std::map< std::string, std::shared_ptr< ComPWA::FunctionTree::FitParameter > > evtPars
Temporary storage of the para.
std::vector< ComPWA::Parameter > getParameters() const final
std::unordered_map< std::string, std::vector< double > > DataMap
virtual void setPhspVolume(double vol)
TwoBodyDecayInfo extractDecayInfo(const boost::property_tree::ptree &pt)
Definition of a two-body decay node within a sequential decay tree.