ROOTPWA
interactionVertex.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 // base class that desbribes general interaction vertex between particles
29 //
30 //
31 // Author List:
32 // Boris Grube TUM (original author)
33 //
34 //
35 //-------------------------------------------------------------------------
36 
37 
38 #ifndef INTERACTIONVERTEX_H
39 #define INTERACTIONVERTEX_H
40 
41 
42 #include <iostream>
43 #include <vector>
44 #include <complex>
45 
46 #include "TLorentzRotation.h"
47 
48 #include "particle.h"
49 
50 
51 class TClonesArray;
52 
53 
54 namespace rpwa {
55 
56 
58  typedef boost::shared_ptr<interactionVertex> interactionVertexPtr;
59 
60 
62 
63  public:
64 
67  virtual ~interactionVertex();
68 
71  const bool cloneOutParticles = false) const
73  virtual void clear();
74 
75  // comparison operators that check equality of all member variables
76  bool operator ==(const interactionVertex& rhsVert) { return this->isEqualTo(rhsVert); }
77  bool operator !=(const interactionVertex& rhsVert) { return not (*this == rhsVert); }
78 
79  virtual bool addInParticle (const particlePtr& part);
80  virtual bool addOutParticle(const particlePtr& part);
81 
82  void transformOutParticles(const TLorentzRotation& L);
83 
84  inline unsigned int nmbInParticles () const { return _inParticles.size(); }
85  inline unsigned int nmbOutParticles() const { return _outParticles.size(); }
86 
87  inline std::vector<particlePtr>& inParticles () { return _inParticles; }
88  inline std::vector<particlePtr>& outParticles() { return _outParticles; }
89  inline const std::vector<particlePtr>& inParticles () const { return _inParticles; }
90  inline const std::vector<particlePtr>& outParticles() const { return _outParticles; }
91 
92  virtual std::ostream& print (std::ostream& out) const;
93  virtual std::ostream& dump (std::ostream& out) const;
94  virtual std::ostream& printPointers(std::ostream& out) const;
95 
96  virtual std::string name() const { return "interactionVertex"; }
97 
98  static bool debug() { return _debug; }
99  static void setDebug(const bool debug = true) { _debug = debug; }
100 
101 
102  protected:
103 
104  virtual interactionVertex* doClone(const bool cloneInParticles,
105  const bool cloneOutParticles) const;
106 
107  virtual bool isEqualTo(const interactionVertex& vert) const;
108 
109  void cloneInParticles ();
110  void cloneOutParticles();
111 
112  std::vector<particlePtr> _inParticles;
113  std::vector<particlePtr> _outParticles;
114 
115 
116  private:
117 
118  static bool _debug;
119 
120  };
121 
122 
123  inline
126  {
128  return vert;
129  }
130 
131 
132  inline
133  std::ostream&
134  operator <<(std::ostream& out,
135  const interactionVertex& vert)
136  {
137  return vert.print(out);
138  }
139 
140 
141 } // namespace rpwa
142 
143 
144 #endif // INTERACTIONVERTEX_H