ROOTPWA
isobarDecayTopology.h
Go to the documentation of this file.
1 
2 //
3 // Copyright 2010
4 //
5 // This file is part of rootpwa
6 //
7 // rootpwa is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // rootpwa is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with rootpwa. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //-------------------------------------------------------------------------
22 // File and Version Information:
23 // $Rev:: $: revision of last commit
24 // $Author:: $: author of last commit
25 // $Date:: $: date of last commit
26 //
27 // Description:
28 // container class that holds all external information for
29 // amplitude calculation of isobar decay
30 //
31 //
32 // Author List:
33 // Boris Grube TUM (original author)
34 //
35 //
36 //-------------------------------------------------------------------------
37 
38 
39 #ifndef ISOBARDECAYTOPOLOGY_H
40 #define ISOBARDECAYTOPOLOGY_H
41 
42 #include <boost/tuple/tuple.hpp>
43 
44 #include "isobarDecayVertex.h"
45 #include "decayTopology.h"
46 
47 
48 namespace rpwa {
49 
50  // amplitude symmetrization info
51  struct symTermMap {
52  symTermMap(const std::complex<double>& f,
53  const std::vector<unsigned int>& m)
54  : factor (f),
55  fsPartPermMap(m)
56  { }
57  std::complex<double> factor;
58  std::vector<unsigned int> fsPartPermMap;
59  };
60 
61 
63  typedef boost::shared_ptr<isobarDecayTopology> isobarDecayTopologyPtr;
64 
65 
67 
68  public:
69 
72  const std::vector<isobarDecayVertexPtr>& isobarDecayVertices,
73  const std::vector<particlePtr>& fsParticles,
74  const bool performTopologyCheck = true);
75  isobarDecayTopology(const productionVertexPtr& productionVertex,
76  const std::vector<interactionVertexPtr>& isobarDecayVertices,
77  const std::vector<particlePtr>& fsParticles,
78  const bool performTopologyCheck = true);
81  virtual ~isobarDecayTopology();
82 
85  isobarDecayTopologyPtr clone(const bool cloneFsParticles = false,
86  const bool cloneProdKinematics = false) const
87  { return isobarDecayTopologyPtr(doClone(cloneFsParticles, cloneProdKinematics)); }
88  virtual void clear();
89 
90  const std::vector<isobarDecayVertexPtr>& isobarDecayVertices() const { return _isobarVertices; }
92 
93  bool checkTopology () const;
94  bool checkConsistency() const;
95 
96  isobarDecayTopology subDecay(const nodeDesc& startNd,
97  const bool linkToParentTopo = false);
99  const bool linkToParentTopo = false)
100  { return subDecay(node(startVert), linkToParentTopo); }
101 
102  void addDecay(const isobarDecayTopology& topo);
103 
105  (const isobarDecayVertexPtr& parentVertex,
106  const std::vector<isobarDecayTopology>& daughterDecays);
108  (const isobarDecayVertexPtr& parentVertex,
109  const isobarDecayTopology& daughter1Decay,
110  const isobarDecayTopology& daughter2Decay);
111 
112  const TLorentzVector& calcIsobarLzVec();
113 
114  void calcIsobarCharges (bool quiet = false);
115  void calcIsobarBaryonNmbs();
116 
117  virtual std::ostream& print(std::ostream& out) const;
118 
119  virtual std::ostream& writeGraphViz(std::ostream& out);
120  virtual bool writeGraphViz(const std::string& outFileName);
121 
122  static bool debug() { return _debug; }
123  static void setDebug(const bool debug = true) { _debug = debug; }
124 
126 
127  std::vector<symTermMap> getIsospinSymmetrization();
128  std::vector<symTermMap> getBoseSymmetrization() const;
129 
130  bool isobarIsAffectedByPermutation(const isobarDecayVertexPtr& vertex, const std::vector<unsigned int>& permutation) const;
131  bool daughtersAreAffectedByPermutation(const isobarDecayVertexPtr& vertex, const std::vector<unsigned int>& permutation) const;
132  std::vector<unsigned int> getFsPartIndicesConnectedToVertex(const isobarDecayVertexPtr& vertex) const;
133 
134  std::vector<unsigned int> findIsobarBoseSymVertices() const;
135 
136 
137  protected:
138 
139  isobarDecayTopology& constructDecay(const productionVertexPtr& productionVertex,
140  const std::vector<isobarDecayVertexPtr>& isobarDecayVertices,
141  const std::vector<particlePtr>& fsParticles,
142  const bool performTopologyCheck = true);
143  isobarDecayTopology& constructDecay(const productionVertexPtr& productionVertex,
144  const std::vector<interactionVertexPtr>& isobarDecayVertices,
145  const std::vector<particlePtr>& fsParticles,
146  const bool performTopologyCheck = true);
147 
148 
149  private:
150 
151  virtual isobarDecayTopology* doClone(const bool cloneFsParticles,
152  const bool cloneProdKinematics) const;
153 
154  void buildIsobarVertexArray();
155 
156  virtual void genBoseSymTermMaps
157  (const std::map<std::string, std::vector<unsigned int> >& origFsPartIndices,
158  const std::map<std::string, std::vector<unsigned int> >& newFsPartIndices,
159  std::map<std::string, std::vector<unsigned int> >::iterator& newFsPartIndicesEntry,
160  std::vector<symTermMap>& symTermMaps) const;
161 
162  std::vector<isobarDecayVertexPtr> _isobarVertices;
163 
164  static bool _debug;
165 
166  };
167 
168 
169  inline
172  const std::vector<isobarDecayVertexPtr>& isobarDecayVertices,
173  const std::vector<particlePtr>& fsParticles,
174  const bool performTopologyCheck = true)
175  {
176  isobarDecayTopologyPtr topo(new isobarDecayTopology(productionVertex, isobarDecayVertices,
177  fsParticles, performTopologyCheck));
178  return topo;
179  }
180 
181 
182  inline
185  const std::vector<interactionVertexPtr>& isobarDecayVertices,
186  const std::vector<particlePtr>& fsParticles,
187  const bool performTopologyCheck = true)
188  {
189  isobarDecayTopologyPtr topo(new isobarDecayTopology(productionVertex, isobarDecayVertices,
190  fsParticles, performTopologyCheck));
191  return topo;
192  }
193 
194 
195  inline
198  {
199  isobarDecayTopologyPtr topoCopy(new isobarDecayTopology(topo));
200  return topoCopy;
201  }
202 
203 
204  inline
207  {
208  isobarDecayTopologyPtr topoCopy(new isobarDecayTopology(topo));
209  return topoCopy;
210  }
211 
212 
213  inline
214  std::ostream&
215  operator <<(std::ostream& out,
216  const isobarDecayTopology& topo)
217  {
218  return topo.print(out);
219  }
220 
221 
222 } // namespace rpwa
223 
224 
225 #endif // ISOBARDECAYTOPOLOGY_H