00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_PartonExtractor_H
00010 #define ThePEG_PartonExtractor_H
00011
00012
00013 #include "ThePEG/Handlers/HandlerBase.h"
00014 #include "ThePEG/Handlers/LastXCombInfo.h"
00015 #include "ThePEG/PDF/PartonBin.h"
00016 #include "ThePEG/PDF/PartonBinInstance.h"
00017 #include "ThePEG/PDF/PDFBase.h"
00018 #include "ThePEG/PDT/ParticleData.h"
00019 #include "PartonExtractor.xh"
00020
00021 namespace ThePEG {
00022
00044 class PartonExtractor: public HandlerBase, public LastXCombInfo<> {
00045
00047 friend class XComb;
00048
00049 public:
00050
00052 typedef map<cPPtr,PBIPtr> PartonBinInstanceMap;
00053
00054 public:
00055
00061 PartonExtractor();
00062
00066 virtual ~PartonExtractor();
00068
00069 public:
00070
00077 virtual bool canHandle(const cPDPair &) { return true; }
00078
00084 virtual PartonPairVec getPartons(Energy maxEnergy, const cPDPair &,
00085 const Cuts &) const;
00086
00092 virtual Energy2 newScale();
00093
00098 virtual void colourConnect(tPPtr particle, tPPtr parton,
00099 const tPVector & remnants) const;
00100
00108 virtual PBIPair newRemnants(tPPair oldp, tPPair newp, tStepPtr step);
00109
00114 virtual pair<int,int> nDims(const PBPair & pbins);
00115
00120 virtual void prepare(const PBIPair & pbins);
00121
00125 virtual bool generateL(const PBIPair & pbins,
00126 const double * r1, const double * r2);
00127
00132 virtual Energy2 generateSHat(Energy2 s, const PBIPair & pbins,
00133 const double * r1, const double * r2);
00134
00138 virtual double fullFn(const PBIPair & pbins, Energy2 scale);
00139
00143 virtual void construct(const PBIPair & pbins, tStepPtr step) const;
00144
00152 virtual void constructRemnants(const PBIPair & pbins, tSubProPtr sub,
00153 tStepPtr step) const;
00154
00167 virtual LorentzRotation
00168 boostRemnants(PBIPair & bins, LorentzMomentum k1, LorentzMomentum k2,
00169 bool side1, bool side2) const;
00171
00178 tPBIPtr partonBinInstance(tcPPtr) const;
00179
00183 void select(tXCombPtr newXComb);
00184
00186
00191 int maxTries() const { return theMaxTries; }
00192
00200 tcPDFPtr getPDF(tcPDPtr particle) const;
00201
00202 protected:
00203
00212 virtual void generateL(PartonBinInstance & pb, const double * r);
00213
00227 virtual bool generate(PartonBinInstance & pb, const double * r,
00228 Energy2 shat, const Lorentz5Momentum & first);
00229
00233 virtual double fullFn(const PartonBinInstance & pb);
00234
00240 virtual void construct(PartonBinInstance & pb,
00241 tStepPtr step, bool boost = true) const;
00242
00247 PBIPtr newRemnants(tPBIPtr oldpb, tPPtr newp, const LorentzMomentum & k);
00248
00252 void addNewRemnants(tPBIPtr oldpb, tPBIPtr newpb, tStepPtr step);
00253
00265 virtual void transformRemnants(LorentzMomentum & Ph, LorentzMomentum & Pr,
00266 const LorentzMomentum & k,
00267 const LorentzMomentum & P) const;
00268
00280 virtual void
00281 constructRemnants(PartonBinInstance & pb, LorentzMomentum & Ph,
00282 const LorentzMomentum & k) const;
00284
00285 public:
00286
00293 void persistentOutput(PersistentOStream & os) const;
00294
00300 void persistentInput(PersistentIStream & is, int version);
00302
00306 static void Init();
00307
00308 protected:
00309
00314 virtual void addPartons(tPBPtr incoming ,const PDFCuts & cuts,
00315 PartonVector & pbins) const;
00316
00320 tcPDFPtr noPDF() const { return theNoPDF; }
00321
00326 template <typename Iterator>
00327 void findConnect(tColinePtr line, tPPtr parton, bool anti,
00328 Iterator first, Iterator last) const {
00329 for ( ; first != last; ++first ) {
00330 if ( *first != parton && (**first).hasColour(anti) &&
00331 !(**first).colourLine(anti) ) {
00332 line->addColoured(*first, anti);
00333 return;
00334 }
00335 }
00336 throw RemColException(*this);
00337 }
00338
00339 protected:
00340
00347 virtual IBPtr clone() const;
00348
00353 virtual IBPtr fullclone() const;
00355
00358
00363 virtual void dofinish();
00365
00366 private:
00367
00371 mutable PartonBinInstanceMap partonBinInstances;
00372
00376 vector<PDFPtr> theSpecialDensities;
00377
00381 PDFPtr theNoPDF;
00382
00387 int theMaxTries;
00388
00394 bool flatSHatY;
00395
00396 private:
00397
00401 static ClassDescription<PartonExtractor> initPartonExtractor;
00402
00406 PartonExtractor & operator=(const PartonExtractor &);
00407
00408 };
00409
00414 template <>
00415 struct BaseClassTrait<PartonExtractor,1>: public ClassTraitsType {
00417 typedef HandlerBase NthBase;
00418 };
00419
00422 template <>
00424 struct ClassTraits<PartonExtractor>: public ClassTraitsBase<PartonExtractor> {
00425 static string className() { return "ThePEG::PartonExtractor"; }
00426 };
00427
00430 }
00431
00432 #endif