herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
WeakDecayCurrent.h
00001 // -*- C++ -*-
00002 //
00003 // WeakDecayCurrent.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_WeakDecayCurrent_H
00010 #define HERWIG_WeakDecayCurrent_H
00011 //
00012 // This is the declaration of the WeakDecayCurrent class.
00013 //
00014 #include "ThePEG/Interface/Interfaced.h"
00015 #include "WeakDecayCurrent.fh"
00016 #include "Herwig++/Decay/DecayPhaseSpaceMode.h"
00017 #include "Herwig++/Decay/DecayPhaseSpaceChannel.h"
00018 #include "ThePEG/Helicity/LorentzPolarizationVector.h"
00019 
00020 namespace Herwig {
00021 using namespace ThePEG;
00022 using ThePEG::Helicity::LorentzPolarizationVector;
00023 using ThePEG::Helicity::LorentzPolarizationVectorE;
00024 
00057 class WeakDecayCurrent: public Interfaced {
00058 
00059 public:
00060 
00064   WeakDecayCurrent() : _numbermodes(0) {}
00065 
00066 public:
00067 
00086   virtual bool createMode(int icharge,unsigned int imode,DecayPhaseSpaceModePtr mode,
00087                           unsigned int iloc,unsigned int ires,
00088                           DecayPhaseSpaceChannelPtr phase,Energy upp)=0;
00089 
00099   virtual tPDVector particles(int icharge, unsigned int imode, int iq, int ia)=0;
00101 
00105   unsigned int numberOfModes() const {return _quark.size();}
00106 
00117   virtual vector<LorentzPolarizationVectorE> 
00118   current(const int imode, const int ichan,Energy & scale, 
00119           const ParticleVector & decay, DecayIntegrator::MEOption meopt) const=0;
00120 
00127   virtual bool accept(vector<int> id)=0;
00128 
00136   virtual unsigned int decayMode(vector<int> id)=0;
00137 
00144   void decayModeInfo(unsigned int imode, int& iq, int& ia) const {
00145     if(imode<_quark.size()) {
00146       iq=_quark[imode];
00147       ia=_antiquark[imode];
00148     }
00149     else {
00150       iq=0;
00151       ia=0;
00152     }
00153   }
00154 
00161   virtual void dataBaseOutput(ofstream & os,bool header,bool create) const;
00162 
00163 public:
00164 
00171   void persistentOutput(PersistentOStream & os) const;
00172 
00178   void persistentInput(PersistentIStream & is, int version);
00180 
00184   static void Init();
00185 
00186 protected:
00187 
00193   void addDecayMode(int iq,int ia) {
00194     _quark.push_back(iq);
00195     _antiquark.push_back(ia);
00196   }
00197 
00202   void setInitialModes(unsigned int nmodes) {_numbermodes=nmodes;}
00203 
00204 private:
00205 
00209   static AbstractClassDescription<WeakDecayCurrent> initWeakDecayCurrent;
00210 
00214   WeakDecayCurrent & operator=(const WeakDecayCurrent &);
00215 
00216 private:
00217 
00221   vector<int> _quark;
00222 
00226   vector<int> _antiquark;
00227 
00231   unsigned int _numbermodes;
00232 
00233 };
00234 
00235 }
00236 
00237 
00238 #include "ThePEG/Utilities/ClassTraits.h"
00239 
00240 namespace ThePEG {
00241 
00248 template <>
00249 struct BaseClassTrait<Herwig::WeakDecayCurrent,1> {
00251   typedef Interfaced NthBase;
00252 };
00253 
00258 template <>
00259 struct ClassTraits<Herwig::WeakDecayCurrent>
00260   : public ClassTraitsBase<Herwig::WeakDecayCurrent> {
00262   static string className() { return "Herwig::WeakDecayCurrent"; }
00263 };
00264 
00267 }
00268 
00269 #endif /* HERWIG_WeakDecayCurrent_H */