00001 // -*- C++ -*- 00002 // 00003 // DecayHandler.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG 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 ThePEG_DecayHandler_H 00010 #define ThePEG_DecayHandler_H 00011 // This is the declaration of the DecayHandler class. 00012 00013 #include "StepHandler.h" 00014 00015 namespace ThePEG { 00016 00031 class DecayHandler: public StepHandler { 00032 00033 public: 00034 00040 DecayHandler() : theMaxLoop(100000), theMaxLifeTime(-1.0*mm), theLifeTimeOption(false) {} 00041 00045 virtual ~DecayHandler(); 00047 00048 public: 00049 00059 virtual void handle(EventHandler & eh, const tPVector & tagged, 00060 const Hint & hint); 00062 00068 void performDecay(tPPtr parent, Step & s) const; 00069 00070 public: 00071 00078 void persistentOutput(PersistentOStream & os) const; 00079 00085 void persistentInput(PersistentIStream & is, int version); 00087 00091 static void Init(); 00092 00097 long maxLoop() const { return theMaxLoop; } 00098 00102 Length maxLifeTime() const { return theMaxLifeTime; } 00103 00109 bool lifeTimeOption() const { return theLifeTimeOption; } 00110 00111 protected: 00112 00119 virtual IBPtr clone() const; 00120 00125 virtual IBPtr fullclone() const; 00127 00128 private: 00129 00134 long theMaxLoop; 00135 00139 Length theMaxLifeTime; 00140 00144 bool theLifeTimeOption; 00145 00146 private: 00147 00151 static ClassDescription<DecayHandler> initDecayHandler; 00152 00156 DecayHandler & operator=(const DecayHandler &); 00157 00158 }; 00159 00166 template <> 00167 struct BaseClassTrait<DecayHandler,1>: public ClassTraitsType { 00169 typedef StepHandler NthBase; 00170 }; 00171 00176 template <> 00177 struct ClassTraits<DecayHandler>: public ClassTraitsBase<DecayHandler> { 00179 static string className() { return "ThePEG::DecayHandler"; } 00180 }; 00181 00184 } 00185 00186 #endif /* ThePEG_DecayHandler_H */