00001
00002 #ifndef PYTHIA7_LundFragHandler_H
00003 #define PYTHIA7_LundFragHandler_H
00004
00005
00006 #include "FragConfig.h"
00007 #include "ThePEG/Handlers/HadronizationHandler.h"
00008 #include "LundFragHandler.xh"
00009 #include "LundFlavourGenerator.h"
00010 #include "Oriented.h"
00011 #include "OrientedIndex.h"
00012 #include "ThePEG/Handlers/PtGenerator.h"
00013 #include "ThePEG/Handlers/ZGenerator.h"
00014 #include "ThePEG/Handlers/FlavourGenerator.h"
00015 #include "ThePEG/Handlers/ClusterCollapser.h"
00016 #include "EndPoint.h"
00017 #include "Hadron.h"
00018
00019
00020 namespace Pythia7 {
00021
00054 class LundFragHandler:public HadronizationHandler, public Oriented {
00055
00056 public:
00057
00059 typedef OrientedIndex OIndex;
00060
00062 typedef pair<double, double> Xhat;
00064 typedef vector<Xhat> XhatVector;
00066 typedef list<Hadron> Buffer;
00068 typedef Buffer::iterator BufferIt;
00069
00070
00071 public:
00072
00078 LundFragHandler();
00079
00083 LundFragHandler(const LundFragHandler &);
00084
00088 ~LundFragHandler();
00090
00111 virtual void handle(EventHandler & eh, const tPVector & tagged,
00112 const Hint & hint);
00114
00125 ParticleList Hadronize(const tcPVector& );
00126
00127
00131 static void Init();
00132
00133
00140 void persistentOutput(PersistentOStream & os) const;
00141
00147 void persistentInput(PersistentIStream & is, int version);
00149
00150 public:
00151
00157 inline void PtGen(PtGeneratorPtr);
00158
00162 inline PtGeneratorPtr PtGen() const;
00163
00167 inline void FlavourGen(FlavourGeneratorPtr);
00168
00172 inline FlavourGeneratorPtr FlavourGen() const;
00173
00177 inline void ZGen(ZGeneratorPtr);
00178
00182 inline ZGeneratorPtr ZGen() const;
00184
00190 inline long maxLoop() const;
00191
00195 inline void maxLoop(long n);
00196
00201 inline Energy Wmin0() const;
00202
00207 inline double k() const;
00208
00213 inline double Delta() const;
00214
00219 inline Energy m0() const;
00220
00225 inline InvEnergy4 d0() const;
00226
00231 inline double SqRatio() const;
00233
00234
00240 void showEP() const;
00241
00245 void echoXhat(cStringRegionPtr );
00247
00248 protected:
00249
00250
00251 protected:
00252
00259 inline virtual IBPtr clone() const;
00260
00265 inline virtual IBPtr fullclone() const;
00267
00268
00269 protected:
00270
00276 inline virtual void doupdate() throw(UpdateException);
00277
00283 inline virtual void doinit() throw(InitException);
00284
00289 inline virtual void dofinish();
00290
00292
00293 protected:
00294
00300 void resetHandler();
00301
00306 void initHadronization(const tcPVector& );
00307
00312 PVector copyRecombine(tcPPtr first, const tcPVector & inPVec);
00313
00319 void initOpenString(const tcPVector& );
00320
00326 void initClosedString(const tcPVector& );
00327
00328
00334 void getHadron();
00335
00341 void loopBack();
00342
00349 void finalTwoHadrons();
00350
00355 void Stepping();
00356
00361 void solveGammaM2System();
00362
00366 void Step();
00370 void stepDown();
00371
00375 LorentzMomentum p0(cStringRegionPtr first, cStringRegionPtr last);
00376
00377
00383 cPPtr selectBreakup(const tcPVector&);
00384
00390 void pickFirstEPts();
00391
00393
00400 void setupCommonFinalRegion();
00401
00406 void solveKinematics();
00407
00411 inline cStringRegionPtr finalSR() const;
00412
00416 inline const EndPoint& firstEP() const;
00417
00421 inline EndPoint& secondEP();
00422
00426 inline Hadron& secondH();
00428
00429
00430
00438 Energy2 Wmin2() const;
00439
00444 inline bool enoughE() const;
00445
00450 inline bool AqqbarSystem() const;
00451
00457 inline bool inconsistentBreakupRegions() const;
00458
00462 inline int nSR() const;
00463
00467 inline const EndPoint& lastEP() const;
00468
00472 inline const EndPoint& lastOppEP() const;
00473
00477 inline EndPoint& getLastEP();
00478
00482 inline EndPoint& getLastOppEP();
00483
00487 inline cStringRegionPtr CurrentSR() const;
00488
00493 inline double CurrentXremf() const;
00494
00499 inline double CurrentXremb() const;
00500
00505 inline double& Xhatfwd(int );
00506
00511 inline double& Xhatbwd(int );
00512
00517 inline void setXhat(double, double);
00518
00523 inline bool aSolution() const;
00525
00531 void store(Hadron& , int Dir=Oriented::Dir());
00532
00536 inline void clearBuffer();
00537
00541 ParticleList createParticleList();
00542
00546 virtual tcPDPtr generateHadron(tcPDPtr inPDPtr, cPDPtr& newPDPtr,
00547 long curtainQid=0);
00548
00552 virtual tcPDPtr getHadron(tcPDPtr inPD1, tcPDPtr inPD2);
00554
00555
00556 private :
00557
00561 PtGeneratorPtr thePtGen;
00562
00566 FlavourGeneratorPtr theFlGen;
00567
00571 ZGeneratorPtr theZGen;
00572
00576 ClusterCollapserPtr theCollapser;
00577
00582 Energy pWmin0;
00583
00588 double pK;
00589
00594 double pDelta;
00595
00600 Energy pM0;
00601
00602
00609 Energy2 m2min;
00610
00619 Energy2 m2mini;
00620
00625 double angmin;
00626
00633 double angmini;
00634
00639 InvEnergy4 pd0;
00640
00644 long MaxLoop;
00645
00646
00650 StringPtr theCurrentString;
00651
00655 EndPoint theRightEP;
00656
00660 EndPoint theLeftEP;
00661
00665 EndPoint CurrentEP;
00666
00670 cStringRegionPtr thefinalSR;
00671
00675 cPDPtr newCreatedPD;
00676
00680 Hadron newHadron;
00681
00685 Hadron lastHadron;
00686
00687
00691 XhatVector XhatFwdVector;
00692
00696 XhatVector XhatBwdVector;
00697
00701 LorentzMomentum Pzero;
00702
00706 bool Estatus;
00707
00711 bool GammaM2Solution;
00712
00716 long ntry;
00717
00721 cPPtr breakup;
00722
00726 Buffer theBuffer;
00727
00731 BufferIt currentBufferIt;
00732
00736 LorentzRotation cmr;
00737
00741 static ClassDescription<LundFragHandler> initLundFragHandler;
00742
00743 };
00744
00745 }
00746
00747 namespace ThePEG {
00748
00755 template <>
00756 struct BaseClassTrait<Pythia7::LundFragHandler,1>: public ClassTraitsType {
00758 typedef HadronizationHandler NthBase;
00759 };
00760
00766 template <>
00767 struct ClassTraits<Pythia7::LundFragHandler>
00768 : public ClassTraitsBase<Pythia7::LundFragHandler> {
00770 static string className() { return "Pythia7::LundFragHandler"; }
00776 static string library() { return "libP7String.so"; }
00777 };
00778
00781 }
00782
00783 #include "LundFragHandler.icc"
00784 #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE
00785
00786 #endif
00787
00788 #endif
00789
00790
00791
00792
00793