thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
HelicityVertex.h
1 // -*- C++ -*-
2 //
3 // HelicityVertex.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 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"
15 #include "ThePEG/Utilities/ClassDescription.h"
16 #include "RhoDMatrix.h"
17 #include "ThePEG/Utilities/Rebinder.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  if(loc<0) {
91  _incoming.push_back(spin);
92  loc=_incoming.size()-1;
93  }
94  else {
95  _incoming[loc] = spin;
96  }
97  }
98 
104  void addOutgoing(tcSpinPtr spin, int & loc) {
105  if(loc<0) {
106  _outgoing.push_back(spin);
107  loc=_outgoing.size()-1;
108  }
109  else {
110  _outgoing[loc]= spin;
111  }
112  }
113 
117  void resetIncoming(tcSpinPtr spin, int loc) {
118  assert( loc < int(_incoming.size()) && loc >= 0 );
119  _incoming[loc]=spin;
120  }
121 
125  void resetOutgoing(tcSpinPtr spin, int loc) {
126  assert( loc < int(_outgoing.size()) && loc >= 0 );
127  _outgoing[loc]=spin;
128  }
130 
131 public:
132 
138  virtual RhoDMatrix getRhoMatrix(int loc,bool recursive) const = 0;
139 
143  virtual RhoDMatrix getDMatrix(int loc) const = 0;
145 
146 private:
147 
152 
156  HelicityVertex & operator=(const HelicityVertex &) = delete;
157 
158 private:
159 
163  SpinVector _incoming;
164 
168  SpinVector _outgoing;
169 
170 };
171 
175 inline ostream & operator<<(ostream & os, const HelicityVertex & vert) {
176  os << "the incoming particles at the vertex are" << endl;
177  for(unsigned int ix=0;ix<vert._incoming.size();++ix) {
178  os << "the " << ix << " th incoming particle " << vert._incoming[ix] << "\n";
179  }
180  os << "the outgoing particles at the vertex are" << endl;
181  for(unsigned int ix=0;ix<vert._outgoing.size();++ix) {
182  os << "the " << ix << " th outgoing particle " << vert._outgoing[ix] << "\n";
183  }
184  return os;
185 }
186 
187 }
188 
189 
190 namespace ThePEG {
191 
198  template <>
199  struct BaseClassTrait<ThePEG::HelicityVertex,1>
200  : public ClassTraitsType {
202  typedef EventInfoBase NthBase;
203  };
204 
209 template <>
210 struct ClassTraits<ThePEG::HelicityVertex>
211  : public ClassTraitsBase<ThePEG::HelicityVertex> {
215  static string className() { return "ThePEG::HelicityVertex"; }
216 };
217 
220 }
221 
222 #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.
This is the main config header file for the Event classes.
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
HelicityVertex & operator=(const HelicityVertex &)=delete
Private and non-existent assignment operator.
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
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:28
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.