00001
00002 #ifndef PYTHIA7_ShowerHandler_H
00003 #define PYTHIA7_ShowerHandler_H
00004
00005
00006 #include "Pythia7/Config/Pythia7.h"
00007 #include "ThePEG/Handlers/CascadeHandler.h"
00008 #include "ThePEG/Utilities/ObjectIndexer.h"
00009
00010
00011
00012 #include "Pythia7/Shower/SpaceShowerHandler.h"
00013 #include "Pythia7/Shower/TimeShowerHandler.h"
00014 #include "Pythia7/Shower/Basics.h"
00015 #include "Pythia7/Shower/Shower.h"
00016 #include "ThePEG/PDF/PartonBinInstance.h"
00017
00018 namespace Pythia7 {
00019
00039 class ShowerHandler: public CascadeHandler {
00040
00041 public:
00042
00048 inline ShowerHandler();
00049
00053 inline ShowerHandler(const ShowerHandler &);
00054
00058 virtual ~ShowerHandler();
00060
00061 public:
00062
00080 virtual void handle(EventHandler & eh, const tPVector & tagged,
00081 const Hint & hint);
00082
00086 virtual void cascade();
00088
00092 virtual void cascade(const tPVector & final);
00093
00098 virtual void cascade(tSubProPtr sub);
00099
00104 virtual bool canShower(tcPPtr p, bool inc = false) const;
00105
00110 inline bool history() const;
00111
00112 public:
00113
00114
00121 void persistentOutput(PersistentOStream & os) const;
00122
00128 void persistentInput(PersistentIStream & is, int version);
00130
00134 static void Init();
00135
00136 protected:
00137
00144 long addParticle(tPPtr p, long status);
00151 long addParticle(tPPtr p, long status, long mother1, long mother2);
00152
00158 void addFinalParticles(tPPtr p, long mother1, long mother2);
00159
00164 Shower::Shower * getModel();
00165
00170 bool isResonance(tcPPtr r) const;
00171
00172 protected:
00173
00178 void findChain(pair<long,long> & chain, long init) const;
00179
00184 tPPair findParent(long i) const;
00185
00191 tPPtr createParticle(long i, bool inc = false);
00192
00197 tPPtr copyParticle(long i, tPPtr p);
00198
00203 tPPtr getParticle(long i) const;
00204
00209 Lorentz5Momentum momentum(long i) const;
00210
00211 protected:
00212
00219 inline virtual IBPtr clone() const;
00220
00225 inline virtual IBPtr fullclone() const;
00227
00228 public:
00229
00234 inline tTimeShowerPtr timeShower() const;
00239 inline tSpaceShowerPtr spaceShower() const;
00240
00241 protected:
00242
00243
00244 protected:
00245
00251 inline virtual void doupdate() throw(UpdateException);
00252
00258 inline virtual void doinit() throw(InitException);
00259
00264 inline virtual void doinitrun();
00265
00270 inline virtual void dofinish();
00271
00281 inline virtual void rebind(const TranslationMap & trans)
00282 throw(RebindException);
00283
00289 inline virtual IVector getReferences();
00291
00292 private:
00293
00298 Shower::Shower * theShowerModel;
00299
00303 TimeShowerPtr theTimeShower;
00304
00308 SpaceShowerPtr theSpaceShower;
00309
00313 bool addFSROnISR;
00314
00319 bool theFullHistory;
00320
00325 long maxTries;
00326
00327 protected:
00328
00332 Shower::Event event;
00333
00337 ObjectIndexer<long,ColourLine> colourIndex;
00338
00342 ObjectIndexer<long,Particle> particleIndex;
00343
00344 private:
00345
00350 struct InfiniteLoopException: public Exception {};
00351 private:
00352
00356 static ClassDescription<ShowerHandler> initShowerHandler;
00357
00361 ShowerHandler & operator=(const ShowerHandler &);
00362
00363 };
00364
00365 }
00366
00367
00368 namespace ThePEG {
00369
00376 template <>
00377 struct BaseClassTrait<Pythia7::ShowerHandler,1>: public ClassTraitsType {
00379 typedef CascadeHandler NthBase;
00380 };
00381
00387 template <>
00388 struct ClassTraits<Pythia7::ShowerHandler>
00389 : public ClassTraitsBase<Pythia7::ShowerHandler> {
00391 static string className() { return "Pythia7::ShowerHandler"; }
00395 static string library() { return "libP7Shower.so"; }
00396
00397 };
00398
00401 }
00402
00403 #include "ShowerHandler.icc"
00404 #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE
00405
00406 #endif
00407
00408 #endif