ThePEG  1.8.0
SpinInfo.h
1 // -*- C++ -*-
2 //
3 // SpinInfo.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_SpinInfo_H
10 #define ThePEG_SpinInfo_H
11 // This is the declaration of the SpinInfo class.
12 
13 #include "ThePEG/EventRecord/EventInfoBase.h"
14 #include "ThePEG/PDT/PDT.h"
15 #include "ThePEG/Interface/ClassDocumentation.h"
16 #include "HelicityVertex.h"
17 
18 namespace ThePEG {
19 
58 class SpinInfo: public EventInfoBase {
59 
60 public:
61 
69  };
70 
71 public:
72 
79  : _timelike(false), _prodloc(-1), _decayloc(-1),
80  _decayed(false), _developed(Undeveloped) {}
81 
89  const Lorentz5Momentum & p = Lorentz5Momentum(),
90  bool time = false)
91  : _timelike(time), _prodloc(-1), _decayloc(-1),
93  _rhomatrix(s), _Dmatrix(s), _spin(s),
95 
99  SpinInfo(const SpinInfo &);
101 
102 public:
103 
108  virtual bool hasPolarization() const { return false; }
109 
118  virtual DPair polarization() const { return DPair(); }
119 
120 public:
121 
125  static void Init();
126 
133  virtual void rebind(const EventTranslationMap & trans);
134 
138  virtual EIPtr clone() const;
139 
143  void update() const;
144 
148  virtual void transform(const LorentzMomentum & m, const LorentzRotation & r) {
149  _currentmomentum = m;
151  }
152 
153 public:
154 
155 
161  void productionVertex(VertexPtr in) const {
162  _production=in;
163  // add to the list of outgoing if timelike
164  int temp;
165  if(_timelike) in->addOutgoing(this,temp);
166  // or incoming if spacelike
167  else in->addIncoming(this,temp);
168  _prodloc=temp;
169  }
170 
175 
179  void decayVertex(VertexPtr in) const {
180  _decay=in;
181  int temp;
182  in->addIncoming(this,temp);
183  _decayloc=temp;
184  assert(temp==0);
185  //if(temp!=0){cout << "something dodgy here can only decay once" << endl;}
186  }
187 
191  tcVertexPtr decayVertex() const { return _decay; }
193 
199  bool decayed() const { return _decayed; }
200 
204  void decayed(bool b) const { _decayed = b; }
205 
211 
215  void decay() const ;
216 
220  void develop() const ;
221 
226 
230  PDT::Spin iSpin() const { return _spin; }
231 
236  return _productionmomentum;
237  }
238 
243  return _currentmomentum;
244  }
245 
249  bool timelike() const { return _timelike; }
251 
259  int productionLocation() const {return _prodloc;}
260 
264  int decayLocation() const {return _decayloc;}
266 
267 public:
268 
274  RhoDMatrix rhoMatrix() const { return _rhomatrix; }
275 
280 
284  RhoDMatrix DMatrix() const { return _Dmatrix; }
285 
289  RhoDMatrix & DMatrix() { return _Dmatrix; }
291 
292 protected:
293 
297  bool isNear(const Lorentz5Momentum & p) {
298  return currentMomentum().isNear(p,_eps);
299  }
300 
301 private:
302 
307 
311  SpinInfo & operator=(const SpinInfo &);
312 
313 private:
314 
319  void redevelop() const ;
320 
321 private:
322 
327 
331  mutable VertexPtr _decay;
332 
338  bool _timelike;
339 
343  mutable int _prodloc;
344 
348  mutable int _decayloc;
349 
354  mutable bool _decayed;
355 
361 
366 
371 
376 
381 
386 
391 
396  static const double _eps;
397 };
398 
399 }
400 
401 
402 namespace ThePEG {
403 
410 template <>
411 struct BaseClassTrait<ThePEG::SpinInfo,1>: public ClassTraitsType {
413  typedef EventInfoBase NthBase;
414 };
415 
420 template <>
421 struct ClassTraits<ThePEG::SpinInfo>
422  : public ClassTraitsBase<ThePEG::SpinInfo> {
426  static string className() { return "ThePEG::SpinInfo"; }
427 };
428 
431 }
432 
433 #endif /* ThePEG_SpinInfo_H */