ThePEG  1.8.0
VectorSpinInfo.h
1 // -*- C++ -*-
2 //
3 // VectorSpinInfo.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_VectorSpinInfo_H
10 #define THEPEG_VectorSpinInfo_H
11 // This is the declaration of the VectorSpinInfo class.
12 
13 #include "ThePEG/EventRecord/SpinInfo.h"
14 #include "ThePEG/Helicity/LorentzPolarizationVector.h"
15 #include "VectorSpinInfo.fh"
16 
17 namespace ThePEG {
18 namespace Helicity {
19 
39 class VectorSpinInfo: public SpinInfo {
40 
41 public:
42 
50  _decaycalc(false) {}
51 
57  VectorSpinInfo(const Lorentz5Momentum & p, bool time)
58  : SpinInfo(PDT::Spin1, p, time),
60  _decaycalc(false) {}
62 
63 public:
64 
72  void setBasisState(unsigned int hel,
73  const LorentzPolarizationVector & in) const {
74  assert(hel<3);
75  _productionstates[hel] = in;
76  _currentstates [hel] = in;
77  }
78 
84  void setDecayState(unsigned int hel,
85  const LorentzPolarizationVector & in) const {
86  assert(hel<3);
87  _decaycalc = true;
88  _decaystates[hel] = in;;
89  }
90 
95  const LorentzPolarizationVector & getProductionBasisState(unsigned int hel) const {
96  assert(hel<3);
97  return _productionstates[hel];
98  }
99 
104  const LorentzPolarizationVector & getDecayBasisState(unsigned int hel) const {
105  assert(hel<3);
106  if(!_decaycalc) {
107  for(unsigned int ix=0;ix<3;++ix)
108  _decaystates[ix]=_currentstates[ix].conjugate();
109  _decaycalc=true;
110  }
111  // return the basis function
112  return _decaystates[hel];
113  }
115 
119  virtual void transform(const LorentzMomentum &,const LorentzRotation & );
120 
121 public:
122 
126  static void Init();
127 
131  virtual EIPtr clone() const;
132 
133 private:
134 
139 
144 
145 private:
146 
150  mutable vector<LorentzPolarizationVector> _productionstates;
151 
155  mutable vector<LorentzPolarizationVector> _decaystates;
156 
160  mutable vector<LorentzPolarizationVector> _currentstates;
161 
165  mutable bool _decaycalc;
166 
167 };
168 
169 }
170 }
171 
172 
173 namespace ThePEG {
174 
181 template <>
182 struct BaseClassTrait<ThePEG::Helicity::VectorSpinInfo,1>
183  : public ClassTraitsType {
185  typedef ThePEG::SpinInfo NthBase;
186 };
187 
192 template <>
193 struct ClassTraits<ThePEG::Helicity::VectorSpinInfo>
194  : public ClassTraitsBase<ThePEG::Helicity::VectorSpinInfo> {
198  static string className() { return "ThePEG::Helicity::VectorSpinInfo"; }
199 };
200 
203 }
204 
205 #endif /* THEPEG_VectorSpinInfo_H */