thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
SpinInfo.h
1 // -*- C++ -*-
2 //
3 // SpinInfo.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2017 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 
69  };
70 
71 public:
72 
79  : _timelike(false), _prodloc(-1), _decayloc(-1),
82 
90  const Lorentz5Momentum & p = Lorentz5Momentum(),
91  bool time = false)
92  : _timelike(time), _prodloc(-1), _decayloc(-1),
93  _decayed(false),
95  _rhomatrix(s), _Dmatrix(s), _spin(s),
97 
101  SpinInfo(const SpinInfo &);
103 
104 public:
105 
110  virtual bool hasPolarization() const { return false; }
111 
120  virtual DPair polarization() const { return DPair(); }
121 
122 public:
123 
127  static void Init();
128 
135  virtual void rebind(const EventTranslationMap & trans);
136 
140  virtual EIPtr clone() const;
141 
145  void update() const;
146 
150  virtual void transform(const LorentzMomentum & m, const LorentzRotation & r) {
151  _currentmomentum = m;
153  }
154 
155 public:
156 
157 
163  void productionVertex(VertexPtr in) const {
164  _production=in;
165  // add to the list of outgoing if timelike
166  int temp(-1);
167  if(_timelike) in->addOutgoing(this,temp);
168  // or incoming if spacelike
169  else in->addIncoming(this,temp);
170  _prodloc=temp;
171  }
172 
176  tcVertexPtr productionVertex() const { return _production; }
177 
181  void decayVertex(VertexPtr in) const {
182  if(in) {
183  _decay=in;
184  if(_timelike) {
185  int temp(-1);
186  in->addIncoming(this,temp);
187  _decayloc=temp;
188  assert(temp==0);
189  }
190  else {
191  int temp(-1);
192  in->addOutgoing(this,temp);
193  _decayloc=temp;
194  }
195  }
196  else {
197  _decay=VertexPtr();
198  _decayloc=-1;
199  }
200  }
201 
205  tcVertexPtr decayVertex() const { return _decay; }
207 
213  bool decayed() const { return _decayed; }
214 
218  void decayed(bool b) const { _decayed = b; }
219 
225 
229  void decay(bool recursive=false) const ;
230 
234  virtual void undecay() const ;
235 
239  void develop() const ;
240 
244  void needsUpdate() const {
247  }
248 
252  PDT::Spin iSpin() const { return _spin; }
253 
258  return _productionmomentum;
259  }
260 
265  return _currentmomentum;
266  }
267 
271  bool timelike() const { return _timelike; }
273 
281  int productionLocation() const {return _prodloc;}
282 
286  int decayLocation() const {return _decayloc;}
288 
289 public:
290 
296  RhoDMatrix rhoMatrix() const { return _rhomatrix; }
297 
302 
306  RhoDMatrix DMatrix() const { return _Dmatrix; }
307 
311  RhoDMatrix & DMatrix() { return _Dmatrix; }
313 
314 protected:
315 
319  bool isNear(const Lorentz5Momentum & p) {
320  return currentMomentum().isNear(p,_eps);
321  }
322 
323 private:
324 
329 
333  SpinInfo & operator=(const SpinInfo &) = delete;
334 
335 private:
336 
341  void redevelop() const ;
342 
346  void redecay() const ;
347 
348 private:
349 
353  mutable VertexPtr _production;
354 
358  mutable VertexPtr _decay;
359 
365  bool _timelike;
366 
370  mutable int _prodloc;
371 
375  mutable int _decayloc;
376 
381  mutable bool _decayed;
382 
388 
394 
399 
404 
409 
414 
419 
424 
429  static const double _eps;
430 };
431 
432 }
433 
434 
435 namespace ThePEG {
436 
443 template <>
444 struct BaseClassTrait<ThePEG::SpinInfo,1>: public ClassTraitsType {
446  typedef EventInfoBase NthBase;
447 };
448 
453 template <>
454 struct ClassTraits<ThePEG::SpinInfo>
455  : public ClassTraitsBase<ThePEG::SpinInfo> {
459  static string className() { return "ThePEG::SpinInfo"; }
460 };
461 
464 }
465 
466 #endif /* ThePEG_SpinInfo_H */
int _prodloc
Location in the hard vertex array at production.
Definition: SpinInfo.h:370
bool decayed() const
Has the particle decayed?
Definition: SpinInfo.h:213
bool _timelike
Is this is timelike (true) or spacelike (false ) particle? This is used to decide if the particle is ...
Definition: SpinInfo.h:365
const Lorentz5Momentum & productionMomentum() const
Return the momentum of the particle when it was produced.
Definition: SpinInfo.h:257
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:224
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:181
SpinInfo(PDT::Spin s, const Lorentz5Momentum &p=Lorentz5Momentum(), bool time=false)
Standard Constructor.
Definition: SpinInfo.h:89
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:110
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
DevelopedStatus _developed
Has the particle been developed? (I.e.
Definition: SpinInfo.h:387
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
PDT::Spin _spin
The spin of the particle.
Definition: SpinInfo.h:408
const Lorentz5Momentum & currentMomentum() const
The current momentum of the particle.
Definition: SpinInfo.h:264
int decayLocation() const
Decay Location.
Definition: SpinInfo.h:286
RhoDMatrix & DMatrix()
Access the D matrix.
Definition: SpinInfo.h:311
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:163
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
RhoDMatrix _rhomatrix
Storage of the rho matrix.
Definition: SpinInfo.h:398
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:252
static const double _eps
A small energy for comparing momenta to check if Lorentz Transformations should be performed...
Definition: SpinInfo.h:429
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:150
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
Lorentz5Momentum _currentmomentum
Current momentum of the particle.
Definition: SpinInfo.h:423
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:353
bool _decayed
Has the particle been decayed? (I.e.
Definition: SpinInfo.h:381
VertexPtr _decay
Pointers to the decay vertex for the particle.
Definition: SpinInfo.h:358
static void Init()
Standard Init function.
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
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:218
SpinInfo()
Default constructor.
Definition: SpinInfo.h:78
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:120
tcVertexPtr productionVertex() const
Get the vertex at which the particle was produced.
Definition: SpinInfo.h:176
bool isNear(const Lorentz5Momentum &p)
Check if momentum is near to the current momentum.
Definition: SpinInfo.h:319
Lorentz5Momentum _decaymomentum
Momentum of the particle when it decayed.
Definition: SpinInfo.h:418
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:413
tcVertexPtr decayVertex() const
Get the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:205
int _decayloc
Location in the hard vertex array at decay.
Definition: SpinInfo.h:375
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:393
DevelopedStatus
Status for the implementation of spin correlations.
Definition: SpinInfo.h:65
void needsUpdate() const
Needs update.
Definition: SpinInfo.h:244
SpinInfo & operator=(const SpinInfo &)=delete
Private and non-existent assignment operator.
RhoDMatrix DMatrix() const
Access the D matrix.
Definition: SpinInfo.h:306
RhoDMatrix & rhoMatrix()
Access the rho matrix.
Definition: SpinInfo.h:301
bool timelike() const
Return true if particle is timelike (rather than spacelike).
Definition: SpinInfo.h:271
static NoPIOClassDescription< SpinInfo > initSpinInfo
Describe a concrete class without persistent data.
Definition: SpinInfo.h:328
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:403
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:281
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
RhoDMatrix rhoMatrix() const
Access the rho matrix.
Definition: SpinInfo.h:296
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52