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 
174  tcVertexPtr productionVertex() const { return _production; }
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 
326  mutable VertexPtr _production;
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 */
int _prodloc
Location in the hard vertex array at production.
Definition: SpinInfo.h:343
bool _timelike
Is this is timelike (true) or spacelike (false ) particle? This is used to decide if the particle is ...
Definition: SpinInfo.h:338
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
SpinInfo(PDT::Spin s, const Lorentz5Momentum &p=Lorentz5Momentum(), bool time=false)
Standard Constructor.
Definition: SpinInfo.h:88
DevelopedStatus _developed
Has the particle been developed? (I.e.
Definition: SpinInfo.h:360
EventInfoBase is a base class for information objects.
Definition: EventInfoBase.h:27
bool isNear(const LorentzVector< Value > &w, double epsilon) const
Are two vectors nearby, using Euclidean measure ?
RhoDMatrix DMatrix() const
Access the D matrix.
Definition: SpinInfo.h:284
PDT::Spin _spin
The spin of the particle.
Definition: SpinInfo.h:375
RhoDMatrix & DMatrix()
Access the D matrix.
Definition: SpinInfo.h:289
Developed but needs recalculating due to some change.
Definition: SpinInfo.h:68
bool timelike() const
Return true if particle is timelike (rather than spacelike).
Definition: SpinInfo.h:249
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
RhoDMatrix _rhomatrix
Storage of the rho matrix.
Definition: SpinInfo.h:365
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
static const double _eps
A small energy for comparing momenta to check if Lorentz Transformations should be performed...
Definition: SpinInfo.h:396
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
void update() const
Method to handle the delelation.
virtual bool hasPolarization() const
Returns true if the polarization() has been implemented in a subclass.
Definition: SpinInfo.h:108
void needsUpdate() const
Needs update.
Definition: SpinInfo.h:225
const Lorentz5Momentum & currentMomentum() const
The current momentum of the particle.
Definition: SpinInfo.h:242
void decay() const
Calculate the rho matrix for the decay if not already done.
virtual void transform(const LorentzMomentum &m, const LorentzRotation &r)
Perform a lorentz rotation of the spin information.
Definition: SpinInfo.h:148
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
Lorentz5Momentum _currentmomentum
Current momentum of the particle.
Definition: SpinInfo.h:390
virtual EIPtr clone() const
Standard clone method.
VertexPtr _production
Pointer to the production vertex for the particle.
Definition: SpinInfo.h:326
PDT::Spin iSpin() const
Return 2s+1 for the particle.
Definition: SpinInfo.h:230
bool _decayed
Has the particle been decayed? (I.e.
Definition: SpinInfo.h:354
VertexPtr _decay
Pointers to the decay vertex for the particle.
Definition: SpinInfo.h:331
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
virtual DPair polarization() const
Return the angles of the polarization vector as a pair of doubles.
Definition: SpinInfo.h:118
tcVertexPtr decayVertex() const
Get the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:191
SpinInfo()
Default constructor.
Definition: SpinInfo.h:78
tcVertexPtr productionVertex() const
Get the vertex at which the particle was produced.
Definition: SpinInfo.h:174
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
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:210
pair< double, double > DPair
A pair of doubles.
Definition: Containers.h:166
int decayLocation() const
Decay Location.
Definition: SpinInfo.h:264
bool isNear(const Lorentz5Momentum &p)
Check if momentum is near to the current momentum.
Definition: SpinInfo.h:297
Lorentz5Momentum _decaymomentum
Momentum of the particle when it decayed.
Definition: SpinInfo.h:385
Lorentz5Vector & transform(const LorentzRotation &r)
Perform a Lorentz transformation.
Lorentz5Momentum _productionmomentum
Momentum of the particle when it was produced.
Definition: SpinInfo.h:380
RhoDMatrix rhoMatrix() const
Access the rho matrix.
Definition: SpinInfo.h:274
int productionLocation() const
Access to the locations.
Definition: SpinInfo.h:259
int _decayloc
Location in the hard vertex array at decay.
Definition: SpinInfo.h:348
bool decayed() const
Has the particle decayed?
Definition: SpinInfo.h:199
void productionVertex(VertexPtr in) const
Set the vertex at which the particle was produced.
Definition: SpinInfo.h:161
const Lorentz5Momentum & productionMomentum() const
Return the momentum of the particle when it was produced.
Definition: SpinInfo.h:235
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
DevelopedStatus
Status for the implementation of spin correlations.
Definition: SpinInfo.h:65
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
void decayVertex(VertexPtr in) const
Set the vertex at which the particle decayed or branched.
Definition: SpinInfo.h:179
void develop() const
Set the developed flag and calculate the D matrix for the decay.
SpinInfo & operator=(const SpinInfo &)
Private and non-existent assignment operator.
void redevelop() const
Set the developed flag and calculate the D matrix for the decay, and all decays further up the chain...
RhoDMatrix & rhoMatrix()
Access the rho matrix.
Definition: SpinInfo.h:279
static NoPIOClassDescription< SpinInfo > initSpinInfo
Describe a concrete class without persistent data.
Definition: SpinInfo.h:306
void decayed(bool b) const
Set if the particle has decayed.
Definition: SpinInfo.h:204
RhoDMatrix _Dmatrix
Storage of the decay matrix.
Definition: SpinInfo.h:370
The RhoDMatrix class is designed to implement the storage of the rho and D matrices which are require...
Definition: RhoDMatrix.h:27