ThePEG  1.8.0
HelicityVertex.h
1 // -*- C++ -*-
2 //
3 // HelicityVertex.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2011 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_HelicityVertex_H
10 #define ThePEG_HelicityVertex_H
11 // This is the declaration of the HelicityVertex class.
12 
13 #include "HelicityVertex.fh"
14 #include "ThePEG/EventRecord/EventConfig.h"
15 #include "ThePEG/Utilities/ClassDescription.h"
16 #include "RhoDMatrix.h"
17 #include "ThePEG/Utilities/Rebinder.h"
18 #include "ThePEG/Helicity/HelicityDefinitions.h"
19 
20 namespace ThePEG {
21 
42 
43 public:
44 
48  friend ostream & operator<<(ostream & os, const HelicityVertex & vert);
49 
50 public:
51 
53  typedef vector<tcSpinPtr> SpinVector;
54 
55 public:
56 
60  static void Init();
61 
68  virtual void rebind(const EventTranslationMap & trans);
69 
70 public:
71 
77  const SpinVector & incoming() const {return _incoming;}
78 
82  const SpinVector & outgoing() const {return _outgoing;}
83 
89  void addIncoming(tcSpinPtr spin, int & loc) {
90  _incoming.push_back(spin);
91  loc=_incoming.size()-1;
92  }
93 
99  void addOutgoing(tcSpinPtr spin, int & loc) {
100  _outgoing.push_back(spin);
101  loc=_outgoing.size()-1;
102  }
103 
107  void resetIncoming(tcSpinPtr spin, int loc) {
108  assert( loc < int(_incoming.size()) && loc >= 0 );
109  _incoming[loc]=spin;
110  }
111 
115  void resetOutgoing(tcSpinPtr spin, int loc) {
116  assert( loc < int(_outgoing.size()) && loc >= 0 );
117  _outgoing[loc]=spin;
118  }
120 
121 public:
122 
128  virtual RhoDMatrix getRhoMatrix(int loc,bool recursive) const = 0;
129 
133  virtual RhoDMatrix getDMatrix(int loc) const = 0;
135 
136 private:
137 
142 
147 
148 private:
149 
153  SpinVector _incoming;
154 
158  SpinVector _outgoing;
159 
160 };
161 
165 inline ostream & operator<<(ostream & os, const HelicityVertex & vert) {
166  os << "the incoming particles at the vertex are" << endl;
167  for(unsigned int ix=0;ix<vert._incoming.size();++ix) {
168  os << "the " << ix << " th incoming particle " << vert._incoming[ix] << "\n";
169  }
170  os << "the outgoing particles at the vertex are" << endl;
171  for(unsigned int ix=0;ix<vert._outgoing.size();++ix) {
172  os << "the " << ix << " th outgoing particle " << vert._outgoing[ix] << "\n";
173  }
174  return os;
175 }
176 
177 }
178 
179 
180 namespace ThePEG {
181 
188  template <>
189  struct BaseClassTrait<ThePEG::HelicityVertex,1>
190  : public ClassTraitsType {
192  typedef EventInfoBase NthBase;
193  };
194 
199 template <>
200 struct ClassTraits<ThePEG::HelicityVertex>
201  : public ClassTraitsBase<ThePEG::HelicityVertex> {
205  static string className() { return "ThePEG::HelicityVertex"; }
206 };
207 
210 }
211 
212 #endif /* ThePEG_HelicityVertex_H */
SpinVector _outgoing
Pointers to the outgoing particle spins at the vertex.
void resetOutgoing(tcSpinPtr spin, int loc)
Reset the spin of the outgoing particle at position loc.
static AbstractNoPIOClassDescription< HelicityVertex > initHelicityVertex
Describe an abstract base class without persistent data.
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
void addOutgoing(tcSpinPtr spin, int &loc)
Add the spin of an outgoing particle.
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
HelicityVertex & operator=(const HelicityVertex &)
Private and non-existent assignment operator.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:681
virtual RhoDMatrix getDMatrix(int loc) const =0
Get the D matrix for the incoming particle at position loc.
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
virtual RhoDMatrix getRhoMatrix(int loc, bool recursive) const =0
Get the rho matrix for the outgoing particle at position loc.
SpinVector _incoming
Pointers to the incoming particle spins at the vertex.
vector< tcSpinPtr > SpinVector
A vector of SpinInfo objects.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
const SpinVector & outgoing() const
Access the spin of the outgoing particles.
The HelicityVertex class is designed to store the helicity amplitude expression for the matrix elemen...
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
void addIncoming(tcSpinPtr spin, int &loc)
Add the spin of an incoming particle.
static void Init()
Standard Init function.
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:27
void resetIncoming(tcSpinPtr spin, int loc)
Reset the spin of the incoming particle at position loc.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
const SpinVector & incoming() const
Access the spin of the incoming particles.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
friend ostream & operator<<(ostream &os, const HelicityVertex &vert)
Output the spin density matrix for debugging purposes.