thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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
18namespace ThePEG {
19
58class SpinInfo: public EventInfoBase {
59
60public:
61
69 StopUpdate=3
70 };
71
72public:
73
80 : _timelike(false), _prodloc(-1), _decayloc(-1),
83
92 bool time = false)
93 : _timelike(time), _prodloc(-1), _decayloc(-1),
94 _decayed(false),
96 _rhomatrix(s), _Dmatrix(s), _spin(s),
98
104
105public:
106
111 virtual bool hasPolarization() const { return false; }
112
121 virtual DPair polarization() const { return DPair(); }
122
123public:
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) {
154 }
155
159 virtual void reset() {
161 }
162
163public:
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
303public:
304
310 RhoDMatrix rhoMatrix() const { return _rhomatrix; }
311
316
320 RhoDMatrix DMatrix() const { return _Dmatrix; }
321
327
328public:
329
333 bool isNear(const Lorentz5Momentum & p) {
334 return currentMomentum().isNear(p,_eps);
335 }
336
337private:
338
343
347 SpinInfo & operator=(const SpinInfo &) = delete;
348
349private:
350
355 void redevelop() const ;
356
360 void redecay() const ;
361
362private:
363
367 mutable VertexPtr _production;
368
372 mutable VertexPtr _decay;
373
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
449namespace ThePEG {
450
457template <>
458struct BaseClassTrait<ThePEG::SpinInfo,1>: public ClassTraitsType {
460 typedef EventInfoBase NthBase;
461};
462
467template <>
468struct ClassTraits<ThePEG::SpinInfo>
469 : public ClassTraitsBase<ThePEG::SpinInfo> {
473 static string className() { return "ThePEG::SpinInfo"; }
474};
475
478}
479
480#endif /* ThePEG_SpinInfo_H */
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
Lorentz5Vector & transform(const LorentzRotation &r)
Perform a Lorentz transformation.
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
bool isNear(const LorentzVector< Value > &w, double epsilon) const
Are two vectors nearby, using Euclidean measure ?
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:28
The SpinInfo is the base class for the spin information for the spin correlation algorithm.
Definition: SpinInfo.h:58
DevelopedStatus _oldDeveloped
Has the particle been developed? (I.e.
Definition: SpinInfo.h:407
void productionVertex(VertexPtr in) const
Set the vertex at which the particle was produced.
Definition: SpinInfo.h:171
void decay(bool recursive=false) const
Calculate the rho matrix for the decay if not already done.
int productionLocation() const
Access to the locations.
Definition: SpinInfo.h:295
virtual void transform(const LorentzMomentum &m, const LorentzRotation &r)
Perform a lorentz rotation of the spin information.
Definition: SpinInfo.h:151
Lorentz5Momentum _productionmomentum
Momentum of the particle when it was produced.
Definition: SpinInfo.h:427
Lorentz5Momentum _currentmomentum
Current momentum of the particle.
Definition: SpinInfo.h:437
VertexPtr _decay
Pointers to the decay vertex for the particle.
Definition: SpinInfo.h:372
void needsUpdate() const
Needs update.
Definition: SpinInfo.h:252
SpinInfo()
Default constructor.
Definition: SpinInfo.h:79
RhoDMatrix _Dmatrix
Storage of the decay matrix.
Definition: SpinInfo.h:417
RhoDMatrix DMatrix() const
Access the D matrix.
Definition: SpinInfo.h:320
virtual bool hasPolarization() const
Returns true if the polarization() has been implemented in a subclass.
Definition: SpinInfo.h:111
virtual void reset()
Reset - Undoes any transformations and calls undecay.
Definition: SpinInfo.h:159
static const double _eps
A small energy for comparing momenta to check if Lorentz Transformations should be performed.
Definition: SpinInfo.h:443
const Lorentz5Momentum & productionMomentum() const
Return the momentum of the particle when it was produced.
Definition: SpinInfo.h:271
int _prodloc
Location in the hard vertex array at production.
Definition: SpinInfo.h:384
RhoDMatrix rhoMatrix() const
Access the rho matrix.
Definition: SpinInfo.h:310
RhoDMatrix _rhomatrix
Storage of the rho matrix.
Definition: SpinInfo.h:412
static NoPIOClassDescription< SpinInfo > initSpinInfo
Describe a concrete class without persistent data.
Definition: SpinInfo.h:342
bool _timelike
Is this is timelike (true) or spacelike (false ) particle? This is used to decide if the particle is ...
Definition: SpinInfo.h:379
void redecay() const
Recursively recalulate all the rho matrices from the top of the chain.
SpinInfo(PDT::Spin s, const Lorentz5Momentum &p=Lorentz5Momentum(), bool time=false)
Standard Constructor.
Definition: SpinInfo.h:90
virtual void undecay() const
Calculate the rho matrix for the decay if not already done.
RhoDMatrix & DMatrix()
Access the D matrix.
Definition: SpinInfo.h:325
tcVertexPtr productionVertex() const
Get the vertex at which the particle was produced.
Definition: SpinInfo.h:184
PDT::Spin _spin
The spin of the particle.
Definition: SpinInfo.h:422
RhoDMatrix & rhoMatrix()
Access the rho matrix.
Definition: SpinInfo.h:315
void develop() const
Set the developed flag and calculate the D matrix for the decay.
DevelopedStatus
Status for the implementation of spin correlations.
Definition: SpinInfo.h:65
@ Developed
Developed.
Definition: SpinInfo.h:67
@ StopUpdate
Stop recalculating at this spin info.
Definition: SpinInfo.h:69
@ NeedsUpdate
Developed but needs recalculating due to some change.
Definition: SpinInfo.h:68
@ Undeveloped
Not developed.
Definition: SpinInfo.h:66
int decayLocation() const
Decay Location.
Definition: SpinInfo.h:300
PDT::Spin iSpin() const
Return 2s+1 for the particle.
Definition: SpinInfo.h:266
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 redevelop() const
Set the developed flag and calculate the D matrix for the decay, and all decays further up the chain.
tcVertexPtr decayVertex() const
Get the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:213
virtual DPair polarization() const
Return the angles of the polarization vector as a pair of doubles.
Definition: SpinInfo.h:121
const Lorentz5Momentum & currentMomentum() const
The current momentum of the particle.
Definition: SpinInfo.h:278
SpinInfo & operator=(const SpinInfo &)=delete
Private and non-existent assignment operator.
void decayed(bool b) const
Set if the particle has decayed.
Definition: SpinInfo.h:226
void stopUpdate() const
Used for an unstable particle to temporarily stop redevelop and redecay at that particle.
Definition: SpinInfo.h:261
bool timelike() const
Return true if particle is timelike (rather than spacelike).
Definition: SpinInfo.h:285
static void Init()
Standard Init function.
VertexPtr _production
Pointer to the production vertex for the particle.
Definition: SpinInfo.h:367
DevelopedStatus _developed
Has the particle been developed? (I.e.
Definition: SpinInfo.h:401
int _decayloc
Location in the hard vertex array at decay.
Definition: SpinInfo.h:389
SpinInfo(const SpinInfo &)
Copy-constructor.
bool _decayed
Has the particle been decayed? (I.e.
Definition: SpinInfo.h:395
bool decayed() const
Has the particle decayed?
Definition: SpinInfo.h:221
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 EIPtr clone() const
Standard clone method.
bool isNear(const Lorentz5Momentum &p)
Check if momentum is near to the current momentum.
Definition: SpinInfo.h:333
void update() const
Method to handle the delelation.
Lorentz5Momentum _decaymomentum
Momentum of the particle when it decayed.
Definition: SpinInfo.h:432
Lorentz5Vector< Energy > Lorentz5Momentum
A momentum in four-dimensional space-time with an explicit invariant mass component.
Definition: Unitsystem.h:156
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
pair< double, double > DPair
A pair of doubles.
Definition: Containers.h:166
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66