ThePEG  1.8.0
SimplePhaseSpace.h
1 // -*- C++ -*-
2 //
3 // SimplePhaseSpace.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 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_SimplePhaseSpace_H
10 #define ThePEG_SimplePhaseSpace_H
11 
12 #include "ThePEG/Config/ThePEG.h"
13 
14 #include "ThePEG/Vectors/LorentzRotation.h"
15 #include "ThePEG/Vectors/LorentzRotation.h"
16 #include "ThePEG/EventRecord/Particle.h"
17 #include "ThePEG/EventRecord/ParticleTraits.h"
18 #include "ThePEG/Repository/UseRandom.h"
19 #include "SimplePhaseSpace.xh"
20 #include <numeric>
21 
22 namespace ThePEG {
23 
33 
46  template <typename PType>
47  static void CMS(Energy2 s, PType & p1, PType & p2);
48 
64  template <typename PType>
65  static void CMS(PType & p1, PType & p2, Energy2 s,
66  double cosTheta, double phi);
67 
84  template <typename PType>
85  static void CMS(PType & p1, PType & p2, Energy2 s, Energy2 t, double phi,
86  const PType & p0);
87 
99  template <typename PType>
100  static void CMS(PType & p1, PType & p2, Energy2 s);
101 
112  template <typename PPairType>
113  static void CMS(const PPairType & p, Energy2 s)
114  {
115  CMS(*p.first, *p.second, s);
116  }
117 
135  template <typename PType>
136  static void CMS(PType & p1, PType & p2, PType & p3, Energy2 s,
137  double x1, double x3);
138 
161  template <typename PType>
162  static void CMS(PType & p1, PType & p2, PType & p3, Energy2 s,
163  double x1, double x3, double phii = 0.0,
164  double theta = 0.0, double phi = 0.0);
165 
176  static Energy getMagnitude(Energy2 s, Energy m1, Energy m2);
177 
185  static Momentum3 polar3Vector(Energy p, double costheta, double phi)
186  {
187  return Momentum3(p*sqrt(1.0 - sqr(costheta))*sin(phi),
188  p*sqrt(1.0 - sqr(costheta))*cos(phi),
189  p*costheta);
190  }
191 
206  static vector<LorentzMomentum>
207  CMSn(Energy m0, const vector<Energy> & m);
208 
221  template <typename Container>
222  static void CMSn(Container & particles, Energy m0);
223 
224 };
225 
226 }
227 
228 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
229 #include "SimplePhaseSpace.tcc"
230 #endif
231 
232 #endif /* ThePEG_SimplePhaseSpace_H */