00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_SpinInfo_H
00010 #define ThePEG_SpinInfo_H
00011
00012
00013 #include "ThePEG/EventRecord/SpinBase.h"
00014 #include "ThePEG/PDT/PDT.h"
00015 #include "ThePEG/Interface/ClassDocumentation.h"
00016 #include "ThePEG/Helicity/HelicityVertex.h"
00017 #include "SpinInfo.fh"
00018
00019
00020 namespace ThePEG {
00021 namespace Helicity {
00022
00062 class SpinInfo: public SpinBase {
00063
00064 public:
00065
00069 enum DevelopedStatus {
00070 Undeveloped=0,
00071 Developed=1,
00072 NeedsUpdate=2
00073 };
00074
00075 public:
00076
00077
00083 SpinInfo()
00084 : _timelike(false), _prodloc(-1), _decayloc(-1),
00085 _decayed(false), _developed(Undeveloped) {}
00086
00093 SpinInfo(PDT::Spin s,
00094 const Lorentz5Momentum & p = Lorentz5Momentum(),
00095 bool time = false)
00096 : _timelike(time), _prodloc(-1), _decayloc(-1),
00097 _decayed(false), _developed(Undeveloped),
00098 _rhomatrix(s), _Dmatrix(s), _spin(s),
00099 _productionmomentum(p), _currentmomentum(p) {}
00100
00104 SpinInfo(const SpinInfo &);
00106
00107 public:
00108
00112 static void Init();
00113
00120 virtual void rebind(const EventTranslationMap & trans);
00121
00125 virtual EIPtr clone() const;
00126
00130 void update() const;
00131
00135 virtual void transform(const LorentzMomentum &, const LorentzRotation & r) {
00136 _currentmomentum.transform(r);
00137 }
00138
00139 public:
00140
00141
00147 void setProductionVertex(VertexPtr in) const {
00148 _production=in;
00149
00150 int temp;
00151 if(_timelike) in->addOutgoing(this,temp);
00152
00153 else in->addIncoming(this,temp);
00154 _prodloc=temp;
00155 }
00156
00160 tcVertexPtr getProductionVertex() const { return _production; }
00161
00165 void setDecayVertex(VertexPtr in) const {
00166 _decay=in;
00167 int temp;
00168 in->addIncoming(this,temp);
00169 _decayloc=temp;
00170 assert(temp==0);
00171
00172 }
00173
00177 tcVertexPtr getDecayVertex() const { return _decay; }
00179
00185 bool decayed() const { return _decayed; }
00186
00190 void decayed(bool b) const { _decayed = b; }
00191
00196 DevelopedStatus developed() const { return _developed; }
00197
00201 void needsUpdate() const { _developed = NeedsUpdate; }
00202
00206 void decay() const;
00207
00208
00212 void develop() const;
00213
00217 PDT::Spin iSpin() const { return _spin; }
00218
00222 const Lorentz5Momentum & productionMomentum() const {
00223 return _productionmomentum;
00224 }
00225
00229 const Lorentz5Momentum & currentMomentum() const {
00230 return _currentmomentum;
00231 }
00232
00236 bool timelike() const { return _timelike; }
00238
00246 int productionLocation() const {return _prodloc;}
00247
00251 int decayLocation() const {return _decayloc;}
00253
00254 public:
00255
00261 RhoDMatrix rhoMatrix() const { return _rhomatrix; }
00262
00266 RhoDMatrix & rhoMatrix() { return _rhomatrix; }
00267
00271 RhoDMatrix DMatrix() const { return _Dmatrix; }
00272
00276 RhoDMatrix & DMatrix() { return _Dmatrix; }
00278
00279 protected:
00280
00284 bool isNear(const Lorentz5Momentum & p) {
00285 return currentMomentum().isNear(p,_eps);
00286 }
00287
00288 private:
00289
00293 static NoPIOClassDescription<SpinInfo> initSpinInfo;
00294
00298 SpinInfo & operator=(const SpinInfo &);
00299
00300 private:
00301
00306 void redevelop() const ;
00307
00308 private:
00309
00313 mutable VertexPtr _production;
00314
00318 mutable VertexPtr _decay;
00319
00325 bool _timelike;
00326
00330 mutable int _prodloc;
00331
00335 mutable int _decayloc;
00336
00341 mutable bool _decayed;
00342
00347 mutable DevelopedStatus _developed;
00348
00352 mutable RhoDMatrix _rhomatrix;
00353
00357 mutable RhoDMatrix _Dmatrix;
00358
00362 PDT::Spin _spin;
00363
00367 Lorentz5Momentum _productionmomentum;
00368
00372 mutable Lorentz5Momentum _decaymomentum;
00373
00377 Lorentz5Momentum _currentmomentum;
00378
00383 static const double _eps;
00384 };
00385
00386 }
00387 }
00388
00389
00390 namespace ThePEG {
00391
00398 template <>
00399 struct BaseClassTrait<ThePEG::Helicity::SpinInfo,1>: public ClassTraitsType {
00401 typedef SpinBase NthBase;
00402 };
00403
00408 template <>
00409 struct ClassTraits<ThePEG::Helicity::SpinInfo>
00410 : public ClassTraitsBase<ThePEG::Helicity::SpinInfo> {
00414 static string className() { return "ThePEG::Helicity::SpinInfo"; }
00415 };
00416
00419 }
00420
00421 #endif