ROOTPWA
fsVertex.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 // class that describes final state vertex decay topology
29 // class is just used for internal book keeping
30 //
31 //
32 // Author List:
33 // Boris Grube TUM (original author)
34 //
35 //
36 //-------------------------------------------------------------------------
37 
38 
39 #ifndef FSVERTEX_H
40 #define FSVERTEX_H
41 
42 
43 #include <boost/shared_ptr.hpp>
44 
45 #include "interactionVertex.h"
46 
47 
48 namespace rpwa {
49 
50 
51  class fsVertex;
52  typedef boost::shared_ptr<fsVertex> fsVertexPtr;
53 
54 
55  class fsVertex : public interactionVertex {
56 
57  public:
58 
60  fsVertex(const fsVertex& vert);
61  virtual ~fsVertex();
62 
63  fsVertexPtr clone(const bool cloneInParticles = false,
64  const bool = false) const
65  { return fsVertexPtr(doClone(cloneInParticles, false)); }
66 
67  virtual bool addInParticle (const particlePtr&);
68  virtual bool addOutParticle(const particlePtr&);
69 
70  // final-state specific accessors
71  inline particlePtr& fsParticle() { return inParticles()[0]; }
72  inline const particlePtr& fsParticle() const { return inParticles()[0]; }
73 
74  virtual std::ostream& print (std::ostream& out) const;
75  virtual std::ostream& dump (std::ostream& out) const;
76  virtual std::ostream& printPointers(std::ostream& out) const;
77 
78  virtual std::string name() const { return "fsVertex"; }
79 
80  static bool debug() { return _debug; }
81  static void setDebug(const bool debug = true) { _debug = debug; }
82 
83 
84  protected:
85 
86  virtual fsVertex* doClone(const bool cloneInParticles,
87  const bool cloneOutParticles) const;
88 
89 
90  private:
91 
92  static bool _debug;
93 
94  };
95 
96 
97  inline
99  createFsVertex(const particlePtr& fsParticle)
100  {
101  fsVertexPtr vert(new fsVertex(fsParticle));
102  return vert;
103  }
104 
105 
106  inline
107  std::ostream&
108  operator <<(std::ostream& out,
109  const fsVertex& vert)
110  {
111  return vert.print(out);
112  }
113 
114 
115 } // namespace rpwa
116 
117 
118 #endif // FSVERTEX_H