thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
SpinInfo.h
1 // -*- C++ -*-
2 //
3 // SpinInfo.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_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 
70  };
71 
72 public:
73 
80  : _timelike(false), _prodloc(-1), _decayloc(-1),
83 
91  const Lorentz5Momentum & p = Lorentz5Momentum(),
92  bool time = false)
93  : _timelike(time), _prodloc(-1), _decayloc(-1),
94  _decayed(false),
96  _rhomatrix(s), _Dmatrix(s), _spin(s),
98 
102  SpinInfo(const SpinInfo &);
104 
105 public:
106 
111  virtual bool hasPolarization() const { return false; }
112 
121  virtual DPair polarization() const { return DPair(); }
122 
123 public:
124 
128  static void Init();
129 
136  virtual void rebind(const EventTranslationMap & trans);
137 
141  virtual EIPtr clone() const;
142 
146  void update() const;
147 
151  virtual void transform(const LorentzMomentum & m, const LorentzRotation & r) {
152  _currentmomentum = m;
154  }
155 
159  virtual void reset() {
161  }
162 
163 public:
164 
165 
171  void productionVertex(VertexPtr in) const {
172  _production=in;
173  // add to the list of outgoing if timelike
174  int temp(-1);
175  if(_timelike) in->addOutgoing(this,temp);
176  // or incoming if spacelike
177  else in->addIncoming(this,temp);
178  _prodloc=temp;
179  }
180 
184  tcVertexPtr productionVertex() const { return _production; }
185 
189  void decayVertex(VertexPtr in) const {
190  if(in) {
191  _decay=in;
192  if(_timelike) {
193  int temp(-1);
194  in->addIncoming(this,temp);
195  _decayloc=temp;
196  assert(temp==0);
197  }
198  else {
199  int temp(-1);
200  in->addOutgoing(this,temp);
201  _decayloc=temp;
202  }
203  }
204  else {
205  _decay=VertexPtr();
206  _decayloc=-1;
207  }
208  }
209 
213  tcVertexPtr decayVertex() const { return _decay; }
215 
221  bool decayed() const { return _decayed; }
222 
226  void decayed(bool b) const { _decayed = b; }
227 
233 
237  void decay(bool recursive=false) const ;
238 
242  virtual void undecay() const ;
243 
247  void develop() const ;
248 
252  void needsUpdate() const {
255  }
256 
262 
266  PDT::Spin iSpin() const { return _spin; }
267 
272  return _productionmomentum;
273  }
274 
279  return _currentmomentum;
280  }
281 
285  bool timelike() const { return _timelike; }
287 
295  int productionLocation() const {return _prodloc;}
296 
300  int decayLocation() const {return _decayloc;}
302 
303 public:
304 
310  RhoDMatrix rhoMatrix() const { return _rhomatrix; }
311 
316 
320  RhoDMatrix DMatrix() const { return _Dmatrix; }
321 
325  RhoDMatrix & DMatrix() { return _Dmatrix; }
327 
328 public:
329 
333  bool isNear(const Lorentz5Momentum & p) {
334  return currentMomentum().isNear(p,_eps);
335  }
336 
337 private:
338 
343 
347  SpinInfo & operator=(const SpinInfo &) = delete;
348 
349 private:
350 
355  void redevelop() const ;
356 
360  void redecay() const ;
361 
362 private:
363 
367  mutable VertexPtr _production;
368 
372  mutable VertexPtr _decay;
373 
379  bool _timelike;
380 
384  mutable int _prodloc;
385 
389  mutable int _decayloc;
390 
395  mutable bool _decayed;
396 
402 
408 
413 
418 
423 
428 
433 
438 
443  static const double _eps;
444 };
445 
446 }
447 
448 
449 namespace ThePEG {
450 
457 template <>
458 struct BaseClassTrait<ThePEG::SpinInfo,1>: public ClassTraitsType {
460  typedef EventInfoBase NthBase;
461 };
462 
467 template <>
468 struct ClassTraits<ThePEG::SpinInfo>
469  : public ClassTraitsBase<ThePEG::SpinInfo> {
473  static string className() { return "ThePEG::SpinInfo"; }
474 };
475 
478 }
479 
480 #endif /* ThePEG_SpinInfo_H */
int _prodloc
Location in the hard vertex array at production.
Definition: SpinInfo.h:384
bool decayed() const
Has the particle decayed?
Definition: SpinInfo.h:221
bool _timelike
Is this is timelike (true) or spacelike (false ) particle? This is used to decide if the particle is ...
Definition: SpinInfo.h:379
const Lorentz5Momentum & productionMomentum() const
Return the momentum of the particle when it was produced.
Definition: SpinInfo.h:271
virtual EIPtr clone() const
Standard clone method.
DevelopedStatus developed() const
Return true if the decay matrix required to perform the decays of the siblings of a particle has been...
Definition: SpinInfo.h:232
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
void decayVertex(VertexPtr in) const
Set the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:189
void stopUpdate() const
Used for an unstable particle to temporarily stop redevelop and redecay at that particle.
Definition: SpinInfo.h:261
SpinInfo(PDT::Spin s, const Lorentz5Momentum &p=Lorentz5Momentum(), bool time=false)
Standard Constructor.
Definition: SpinInfo.h:90
void decay(bool recursive=false) const
Calculate the rho matrix for the decay if not already done.
void develop() const
Set the developed flag and calculate the D matrix for the decay.
virtual bool hasPolarization() const
Returns true if the polarization() has been implemented in a subclass.
Definition: SpinInfo.h:111
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
DevelopedStatus _developed
Has the particle been developed? (I.e.
Definition: SpinInfo.h:401
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
PDT::Spin _spin
The spin of the particle.
Definition: SpinInfo.h:422
const Lorentz5Momentum & currentMomentum() const
The current momentum of the particle.
Definition: SpinInfo.h:278
int decayLocation() const
Decay Location.
Definition: SpinInfo.h:300
RhoDMatrix & DMatrix()
Access the D matrix.
Definition: SpinInfo.h:325
Developed but needs recalculating due to some change.
Definition: SpinInfo.h:68
void productionVertex(VertexPtr in) const
Set the vertex at which the particle was produced.
Definition: SpinInfo.h:171
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
RhoDMatrix _rhomatrix
Storage of the rho matrix.
Definition: SpinInfo.h:412
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
PDT::Spin iSpin() const
Return 2s+1 for the particle.
Definition: SpinInfo.h:266
static const double _eps
A small energy for comparing momenta to check if Lorentz Transformations should be performed...
Definition: SpinInfo.h:443
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
virtual void transform(const LorentzMomentum &m, const LorentzRotation &r)
Perform a lorentz rotation of the spin information.
Definition: SpinInfo.h:151
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
Lorentz5Momentum _currentmomentum
Current momentum of the particle.
Definition: SpinInfo.h:437
void redevelop() const
Set the developed flag and calculate the D matrix for the decay, and all decays further up the chain...
VertexPtr _production
Pointer to the production vertex for the particle.
Definition: SpinInfo.h:367
virtual void reset()
Reset - Undoes any transformations and calls undecay.
Definition: SpinInfo.h:159
bool _decayed
Has the particle been decayed? (I.e.
Definition: SpinInfo.h:395
VertexPtr _decay
Pointers to the decay vertex for the particle.
Definition: SpinInfo.h:372
static void Init()
Standard Init function.
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
Stop recalculating at this spin info.
Definition: SpinInfo.h:69
The SpinInfo is the base class for the spin information for the spin correlation algorithm.
Definition: SpinInfo.h:58
void decayed(bool b) const
Set if the particle has decayed.
Definition: SpinInfo.h:226
SpinInfo()
Default constructor.
Definition: SpinInfo.h:79
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
void update() const
Method to handle the delelation.
pair< double, double > DPair
A pair of doubles.
Definition: Containers.h:166
virtual DPair polarization() const
Return the angles of the polarization vector as a pair of doubles.
Definition: SpinInfo.h:121
tcVertexPtr productionVertex() const
Get the vertex at which the particle was produced.
Definition: SpinInfo.h:184
bool isNear(const Lorentz5Momentum &p)
Check if momentum is near to the current momentum.
Definition: SpinInfo.h:333
Lorentz5Momentum _decaymomentum
Momentum of the particle when it decayed.
Definition: SpinInfo.h:432
bool isNear(const LorentzVector< Value > &w, double epsilon) const
Are two vectors nearby, using Euclidean measure ?
Lorentz5Vector & transform(const LorentzRotation &r)
Perform a Lorentz transformation.
Lorentz5Momentum _productionmomentum
Momentum of the particle when it was produced.
Definition: SpinInfo.h:427
tcVertexPtr decayVertex() const
Get the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:213
int _decayloc
Location in the hard vertex array at decay.
Definition: SpinInfo.h:389
void redecay() const
Recursively recalulate all the rho matrices from the top of the chain.
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
DevelopedStatus _oldDeveloped
Has the particle been developed? (I.e.
Definition: SpinInfo.h:407
DevelopedStatus
Status for the implementation of spin correlations.
Definition: SpinInfo.h:65
void needsUpdate() const
Needs update.
Definition: SpinInfo.h:252
SpinInfo & operator=(const SpinInfo &)=delete
Private and non-existent assignment operator.
RhoDMatrix DMatrix() const
Access the D matrix.
Definition: SpinInfo.h:320
RhoDMatrix & rhoMatrix()
Access the rho matrix.
Definition: SpinInfo.h:315
bool timelike() const
Return true if particle is timelike (rather than spacelike).
Definition: SpinInfo.h:285
static NoPIOClassDescription< SpinInfo > initSpinInfo
Describe a concrete class without persistent data.
Definition: SpinInfo.h:342
virtual void undecay() const
Calculate the rho matrix for the decay if not already done.
RhoDMatrix _Dmatrix
Storage of the decay matrix.
Definition: SpinInfo.h:417
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:28
int productionLocation() const
Access to the locations.
Definition: SpinInfo.h:295
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
RhoDMatrix rhoMatrix() const
Access the rho matrix.
Definition: SpinInfo.h:310
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52