herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
UA5Handler.h
00001 // -*- C++ -*-
00002 //
00003 // UA5Handler.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
00004 // Copyright (C) 2002-2011 The Herwig Collaboration
00005 //
00006 // Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
00008 //
00009 #ifndef HERWIG_UA5_H_
00010 #define HERWIG_UA5_H_
00011 
00012 #include <ThePEG/Handlers/HadronizationHandler.h>
00013 #include "Herwig++/Hadronization/CluHadConfig.h"
00014 #include <ThePEG/Vectors/LorentzRotation.h>
00015 
00016 namespace Herwig {
00017 
00018 using namespace ThePEG;
00019 
00109 class UA5Handler : public HadronizationHandler {
00110 
00111 public:
00112 
00118    UA5Handler();
00120 
00127   static void Init();
00128 
00129 public:
00130 
00137   void persistentOutput(PersistentOStream & os) const;
00138 
00144   void persistentInput(PersistentIStream & is, int version);
00146 
00147 public:
00148 
00156   virtual void handle(EventHandler &eh, const tPVector &tagged,
00157                       const Hint &hint) 
00158    ;
00159 
00160 protected:
00161 
00168   virtual IBPtr clone() const;
00169 
00174   virtual IBPtr fullclone() const;
00176 
00177 private:
00178 
00190   void performDecay(PPtr parent,int & totalcharge,int & numbercharge) const;
00191 
00198   void decayCluster(ClusterPtr cluster, bool single) const;
00199 
00206   void insertParticle(PPtr particle,StepPtr step,bool all) const;
00208 
00222   inline double negativeBinomial(int N, double mean, double ek) const;
00223   
00231   inline double meanMultiplicity(Energy E) const;
00232   
00239   unsigned int multiplicity(Energy E) const;
00241   
00256   void generateMomentum(tClusterPtr clu1,tClusterPtr clu2,
00257                         const ClusterVector &clusters, Energy CME,
00258                         const Lorentz5Momentum & cm) const;
00259   
00265   void generateCylindricalPS(const ClusterVector &clusters, Energy CME) const;
00267   
00271   LorentzRotation rotate(const LorentzMomentum &p) const;
00272   
00283   template <typename T>
00284   inline T gaussDistribution(T mean, T stdev) const;
00285   
00294   inline double randUng(double A, double B) const;
00295   
00303   template <typename T>
00304   inline void randAzm(T pt, T &px, T &py) const;
00305   
00313   inline Energy randExt(Energy AM0,InvEnergy B) const;
00315   
00316 private:
00317   
00322   static ClassDescription<UA5Handler> initUA5Handler;
00323   
00329   UA5Handler& operator=(const UA5Handler &);
00330   
00331 private:
00332 
00336   ClusterFissionerPtr clusterFissioner;
00337   
00341   ClusterDecayerPtr   clusterDecayer;
00342   
00350   double _n1;
00351   
00355   double _n2;
00356   
00360   double _n3;
00362   
00371   double _k1;
00372   
00376   double _k2;
00378   
00387   Energy _m1;
00388   
00392   InvEnergy _m2;
00394   
00403   InvEnergy _p1;
00404   
00408   InvEnergy _p2;
00409   
00413   InvEnergy _p3;
00415   
00419   double _probSoft;
00420   
00425   double _enhanceCM; 
00426   
00430   unsigned int _maxtries;
00431   
00432 
00436   bool _needWarning;
00437 };
00438 
00439 }
00440 
00441 namespace ThePEG {
00442 
00447 template<>
00448 struct BaseClassTrait<Herwig::UA5Handler,1> { 
00450   typedef HadronizationHandler NthBase;
00451 };
00452 
00455 template<>
00456 struct ClassTraits<Herwig::UA5Handler> :
00457   public ClassTraitsBase<Herwig::UA5Handler> {
00459     static string className() { return "Herwig::UA5Handler"; }
00463     static string library() { return "HwUA5.so"; }
00464 };
00465 
00468 }
00469 
00470 #include "UA5Handler.icc"
00471 
00472 #endif