ThePEG  1.8.0
TensorSpinInfo.h
1 // -*- C++ -*-
2 //
3 // TensorSpinInfo.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_TensorSpinInfo_H
10 #define THEPEG_TensorSpinInfo_H
11 // This is the declaration of the TensorSpinInfo class.
12 
13 #include "ThePEG/EventRecord/SpinInfo.h"
14 #include "ThePEG/Helicity/LorentzTensor.h"
15 #include "TensorSpinInfo.fh"
16 // #include "TensorSpinInfo.xh"
17 
18 namespace ThePEG {
19 namespace Helicity {
20 
42 class TensorSpinInfo: public SpinInfo {
43 
44 public:
45 
53  _decaycalc(false) {}
54 
60  TensorSpinInfo(const Lorentz5Momentum & p,bool time)
61  : SpinInfo(PDT::Spin2, p, time),
63  _decaycalc(false) {}
65 
66 public:
67 
75  void setBasisState(unsigned int hel, LorentzTensor<double> in) const {
76  assert(hel<5);
77  _productionstates[hel]=in;
78  _currentstates [hel]=in;
79  }
80 
86  void setDecayState(unsigned int hel, LorentzTensor<double> in) const {
87  assert(hel<5);
88  _decaycalc = true;
89  _decaystates[hel] = in;
90  }
91 
96  const LorentzTensor<double> & getProductionBasisState(unsigned int hel) const {
97  assert(hel<5);
98  return _productionstates[hel];
99  }
100 
105  const LorentzTensor<double> & getDecayBasisState(unsigned int hel) const {
106  assert(hel<5);
107  if(!_decaycalc) {
108  for(unsigned int ix=0;ix<5;++ix)
109  _decaystates[ix]=_currentstates[ix].conjugate();
110  _decaycalc=true;
111  }
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<LorentzTensor<double> > _productionstates;
151 
155  mutable vector<LorentzTensor<double> > _decaystates;
156 
160  mutable vector<LorentzTensor<double> > _currentstates;
161 
165  mutable bool _decaycalc;
166 
167 };
168 
169 }
170 }
171 
172 
173 namespace ThePEG {
174 
181 template <>
182 struct BaseClassTrait<ThePEG::Helicity::TensorSpinInfo,1>
183  : public ClassTraitsType {
185  typedef ThePEG::SpinInfo NthBase;
186 };
187 
192 template <>
193 struct ClassTraits<ThePEG::Helicity::TensorSpinInfo>
194  : public ClassTraitsBase<ThePEG::Helicity::TensorSpinInfo> {
198  static string className() { return "ThePEG::Helicity::TensorSpinInfo"; }
199 };
200 
203 }
204 
205 #endif /* THEPEG_TensorSpinInfo_H */