YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DecayingParticle.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_DecayingParticle_h
22 #define yap_DecayingParticle_h
23 
24 #include "fwd/AmplitudeComponent.h"
25 #include "fwd/BlattWeisskopf.h"
26 #include "fwd/DataAccessor.h"
27 #include "fwd/DecayChannel.h"
28 #include "fwd/DecayTree.h"
29 #include "fwd/FreeAmplitude.h"
30 #include "fwd/Model.h"
31 #include "fwd/ParticleCombination.h"
32 #include "fwd/PhaseSpaceFactor.h"
33 #include "fwd/QuantumNumbers.h"
34 #include "fwd/SpinAmplitude.h"
35 
36 #include "Particle.h"
37 
38 #include <memory>
39 
40 namespace yap {
41 
51 class DecayingParticle : public Particle
52 {
53 protected:
54 
57  DecayingParticle(std::string name, const QuantumNumbers& q, double radialSize, std::shared_ptr<PhaseSpaceFactorFactory> phsp_factory);
58 
59 public:
60 
65  static std::shared_ptr<DecayingParticle> create(std::string name, const QuantumNumbers& q, double radialSize, std::shared_ptr<PhaseSpaceFactorFactory> phsp_factory = DefaultPHSPFactory)
66  { return std::shared_ptr<DecayingParticle>(new DecayingParticle(name, q, radialSize, phsp_factory)); }
67 
70  const DecayTreeVectorMap& decayTrees() const
71  { return DecayTrees_; }
72 
74  virtual bool consistent() const override;
75 
78  virtual void checkDecayChannel(const DecayChannel& c) const;
79 
83  virtual std::shared_ptr<DecayChannel> addChannel(std::shared_ptr<DecayChannel> c);
84 
88  std::shared_ptr<DecayChannel> addChannel(const ParticleVector& daughters);
89 
95  template <typename ... Types>
96  std::shared_ptr<DecayChannel> addChannel(std::shared_ptr<Particle> A, std::shared_ptr<Particle> B, Types ... other_daughters)
97  { ParticleVector V{A, B, other_daughters...}; return addChannel(V); }
98 
101 
103  const DecayChannelVector& channels() const
104  { return Channels_;}
105 
107  std::shared_ptr<RealParameter> radialSize()
108  { return RadialSize_; }
109 
111  const BlattWeisskopfMap& blattWeisskopfs() const
112  { return BlattWeisskopfs_; }
113 
115 
117  void printDecayChain() const
118  { printDecayChainLevel(0); }
119 
121  const Model* model() const override;
122 
124  friend Model;
125 
127  friend DecayChannel;
128 
129 protected:
130 
132  virtual void addParticleCombination(const std::shared_ptr<ParticleCombination>& c) override;
133 
135  virtual void pruneParticleCombinations() override;
136 
138  virtual void registerWithModel() override;
139 
142 
143  void printDecayChainLevel(int level) const;
144 
147  virtual void modifyDecayTree(DecayTree& dt);
148 
150  virtual std::shared_ptr<PhaseSpaceFactor> phaseSpaceFactor(const DecayChannel& dc, const SpinAmplitude& sa);
151 
153  std::shared_ptr<PhaseSpaceFactorFactory> phaseSpaceFactorFactory()
154  { return PhaseSpaceFactorFactory_; }
155 
156 private:
157 
159  DecayChannelVector Channels_;
160 
162  BlattWeisskopfMap BlattWeisskopfs_;
163 
165  std::shared_ptr<RealParameter> RadialSize_;
166 
168  DecayTreeVectorMap DecayTrees_;
169 
171  std::shared_ptr<PhaseSpaceFactorFactory> PhaseSpaceFactorFactory_;
172 
173 };
174 
176 std::string to_string(const DecayTreeVectorMap& m_dtv_map);
177 
180 DecayTreeSet decay_trees(const DecayingParticle& dp);
181 
185 template <typename Last, typename ... Predicates>
186 DecayTreeSet decay_trees(const DecayingParticle& dp, Last p, Predicates ... P)
187 { return filter(decay_trees(dp), p, P...); }
188 
193 template <typename Last, typename ... Predicates>
194 DecayTreeSet::value_type decay_tree(const DecayingParticle& dp, Last p, Predicates ... P)
195 { return lone_elt(filter(decay_trees(dp), p, P...)); }
196 
198 FreeAmplitudeSet free_amplitudes(const DecayingParticle& dp);
199 
201 template <typename Last, typename ... UnaryPredicates>
202 FreeAmplitudeSet free_amplitudes(const DecayingParticle& dp, Last p, UnaryPredicates ... P)
203 { return filter(free_amplitudes(dp), p, P...); }
204 
207 template <typename Last, typename ... UnaryPredicates>
208 FreeAmplitudeSet::value_type free_amplitude(const DecayingParticle& dp, Last p, UnaryPredicates ... P)
209 { return lone_elt(free_amplitudes(dp, p, P...)); }
210 
212 ParticleSet particles(DecayingParticle& dp);
213 
215 template <typename Last, typename ... UnaryPredicates>
216 DecayChannelSet decay_channels(const DecayingParticle& dp, Last p, UnaryPredicates ... P)
217 { return filter(DecayChannelSet(dp.channels().begin(), dp.channels().end()), p, P...); }
218 
221 template <typename Last, typename ... UnaryPredicates>
222 DecayChannelSet::value_type decay_channel(const DecayingParticle& dp, Last p, UnaryPredicates ... P)
223 { return lone_elt(decay_channels(dp, p, P...)); }
224 
225 }
226 
227 #endif
BlattWeisskopfMap BlattWeisskopfs_
map of Blatt-Weisskopf barrier factors, key = angular momentum
Definition: DecayingParticle.h:162
DecayTreeSet::value_type decay_tree(const DecayingParticle &dp, Last p, Predicates...P)
Definition: DecayingParticle.h:194
DecayChannelSet::value_type decay_channel(const DecayingParticle &dp, Last p, UnaryPredicates...P)
Definition: DecayingParticle.h:222
container::value_type lone_elt(container &C)
Definition: Filter.h:39
virtual std::shared_ptr< PhaseSpaceFactor > phaseSpaceFactor(const DecayChannel &dc, const SpinAmplitude &sa)
Definition: DecayingParticle.cxx:57
DecayTreeSet decay_trees(const DecayingParticle &dp)
Definition: DecayingParticle.cxx:368
DecayingParticle(std::string name, const QuantumNumbers &q, double radialSize, std::shared_ptr< PhaseSpaceFactorFactory > phsp_factory)
Definition: DecayingParticle.cxx:22
virtual std::shared_ptr< DecayChannel > addChannel(std::shared_ptr< DecayChannel > c)
Definition: DecayingParticle.cxx:74
const DecayChannelVector & channels() const
Definition: DecayingParticle.h:103
std::shared_ptr< RealParameter > RadialSize_
Radial size parameter [GeV^-1].
Definition: DecayingParticle.h:165
Class holding vectors of fixed and free amplitudes that define a decay tree.
Definition: DecayTree.h:49
friend Model
grant friend status to Model to call fixSolitaryFreeAmplitudes()
Definition: DecayingParticle.h:124
DecayChannelVector Channels_
vector of decay channel objects
Definition: DecayingParticle.h:159
const Model * model() const override
Definition: DecayingParticle.cxx:219
virtual void modifyDecayTree(DecayTree &dt)
Definition: DecayingParticle.cxx:318
ParticleSet particles(DecayingParticle &dp)
Definition: DecayingParticle.cxx:357
std::shared_ptr< DecayChannel > addChannel(std::shared_ptr< Particle > A, std::shared_ptr< Particle > B, Types...other_daughters)
Definition: DecayingParticle.h:96
friend DecayChannel
grant friend status to DecayChannel to call registerWithModel()
Definition: DecayingParticle.h:127
void printDecayChain() const
Print complete decay chain.
Definition: DecayingParticle.h:117
virtual void registerWithModel() override
register any necessary DataAccessor's with model
Definition: DecayingParticle.cxx:225
std::shared_ptr< PhaseSpaceFactorFactory > PhaseSpaceFactorFactory_
PhaseSpaceFactorFactory.
Definition: DecayingParticle.h:171
DecayChannelSet decay_channels(const DecayingParticle &dp, Last p, UnaryPredicates...P)
Definition: DecayingParticle.h:216
virtual void checkDecayChannel(const DecayChannel &c) const
Definition: DecayingParticle.cxx:65
const DecayTreeVectorMap & decayTrees() const
Definition: DecayingParticle.h:70
DecayTreeVectorMap DecayTrees_
Map of spin projection to DecayTreeVector.
Definition: DecayingParticle.h:168
Class implementing a PWA model.
Definition: Model.h:56
std::shared_ptr< RealParameter > radialSize()
Definition: DecayingParticle.h:107
const std::string & name() const
Get name (const)
Definition: Particle.h:72
FreeAmplitudeSet free_amplitudes(const DecayingParticle &dp)
Definition: DecayingParticle.cxx:377
static std::shared_ptr< DecayingParticle > create(std::string name, const QuantumNumbers &q, double radialSize, std::shared_ptr< PhaseSpaceFactorFactory > phsp_factory=DefaultPHSPFactory)
Definition: DecayingParticle.h:65
virtual bool consistent() const override
Check consistency of object.
Definition: DecayingParticle.cxx:30
FreeAmplitudeSet::value_type free_amplitude(const DecayingParticle &dp, Last p, UnaryPredicates...P)
Definition: DecayingParticle.h:208
void fixSolitaryFreeAmplitudes()
if only one decay channel is available, fix its free amplitude to the current value ...
Definition: DecayingParticle.cxx:263
std::set< std::shared_ptr< T > > filter(const std::set< std::shared_ptr< T > > &S, Last p, UnaryPredicates...P)
Definition: Filter.h:60
std::string to_string(const CachedValue::Status &S)
streaming operator for CachedValue::Status
Definition: CachedValue.cxx:27
Definition: DecayingParticle.h:51
Abstract Particle base class.
Definition: Particle.h:47
Quantum numbers of a Particle.
Definition: QuantumNumbers.h:35
virtual void pruneParticleCombinations() override
prune ParticleCombinations_ to only contain ParticleCombination's tracing back up the ISP ...
Definition: DecayingParticle.cxx:254
virtual void addParticleCombination(const std::shared_ptr< ParticleCombination > &c) override
add ParticleCombination to SymmetrizationIndices_ and BlattWeisskopfs_
Definition: DecayingParticle.cxx:235
const BlattWeisskopfMap & blattWeisskopfs() const
Definition: DecayingParticle.h:111
Class implementing a decay channel.
Definition: DecayChannel.h:40
Abstract base class implementing a spin amplitude.
Definition: SpinAmplitude.h:46
std::shared_ptr< PhaseSpaceFactorFactory > phaseSpaceFactorFactory()
Definition: DecayingParticle.h:153