thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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
20namespace ThePEG {
21
42
43public:
44
48 friend ostream & operator<<(ostream & os, const HelicityVertex & vert);
49
50public:
51
53 typedef vector<tcSpinPtr> SpinVector;
54
55public:
56
60 static void Init();
61
68 virtual void rebind(const EventTranslationMap & trans);
69
70public:
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
131public:
132
138 virtual RhoDMatrix getRhoMatrix(int loc,bool recursive) const = 0;
139
143 virtual RhoDMatrix getDMatrix(int loc) const = 0;
145
146private:
147
152
157
158private:
159
164
169
170};
171
175inline 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
190namespace ThePEG {
191
198 template <>
199 struct BaseClassTrait<ThePEG::HelicityVertex,1>
200 : public ClassTraitsType {
202 typedef EventInfoBase NthBase;
203 };
204
209template <>
210struct ClassTraits<ThePEG::HelicityVertex>
211 : public ClassTraitsBase<ThePEG::HelicityVertex> {
215 static string className() { return "ThePEG::HelicityVertex"; }
216};
217
220}
221
222#endif /* ThePEG_HelicityVertex_H */
This is the main config header file for the Event classes.
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
The HelicityVertex class is designed to store the helicity amplitude expression for the matrix elemen...
HelicityVertex & operator=(const HelicityVertex &)=delete
Private and non-existent assignment operator.
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
SpinVector _incoming
Pointers to the incoming particle spins at the vertex.
virtual RhoDMatrix getDMatrix(int loc) const =0
Get the D matrix for the incoming particle at position loc.
vector< tcSpinPtr > SpinVector
A vector of SpinInfo objects.
friend ostream & operator<<(ostream &os, const HelicityVertex &vert)
Output the spin density matrix for debugging purposes.
const SpinVector & incoming() const
Access the spin of the incoming particles.
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.
void resetIncoming(tcSpinPtr spin, int loc)
Reset the spin of the incoming particle at position loc.
void addOutgoing(tcSpinPtr spin, int &loc)
Add the spin of an outgoing particle.
void addIncoming(tcSpinPtr spin, int &loc)
Add the spin of an incoming particle.
virtual RhoDMatrix getRhoMatrix(int loc, bool recursive) const =0
Get the rho matrix for the outgoing particle at position loc.
static AbstractNoPIOClassDescription< HelicityVertex > initHelicityVertex
Describe an abstract base class without persistent data.
const SpinVector & outgoing() const
Access the spin of the outgoing particles.
static void Init()
Standard Init function.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:28
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
vector< T > & operator<<(vector< T > &tv, const U &u)
Overload the left shift operator for vector to push_back objects to a vector.
Definition: Containers.h:179
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66