00001 // -*- C++ -*- 00002 // 00003 // PartonBinInstance.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_PartonBinInstance_H 00010 #define THEPEG_PartonBinInstance_H 00011 // This is the declaration of the PartonBinInstance class. 00012 00013 #include "ThePEG/Config/ThePEG.h" 00014 #include "ThePEG/PDF/PartonBin.h" 00015 00016 namespace ThePEG { 00017 00018 ThePEG_DECLARE_CLASS_POINTERS(PartonBinInstance,PBIPtr); 00020 typedef pair<PBIPtr,PBIPtr> PBIPair; 00021 00022 ThePEG_DECLARE_CLASS_POINTERS(RemInfoBase,RemIPtr); 00023 00028 class PartonBinInstance: public PersistentBase { 00029 00030 public: 00031 00037 PartonBinInstance(); 00038 00042 PartonBinInstance(const PartonBinInstance &); 00043 00047 virtual ~PartonBinInstance(); 00048 00053 PartonBinInstance(tcPBPtr, tPBIPtr = tPBIPtr()); 00054 00072 PartonBinInstance(tPPtr parton, tcPBPtr pb, Energy2 scale = ZERO); 00073 00075 00076 public: 00077 00083 tcPBPtr bin() const { return theBin; } 00084 00089 const PartonVector & bins() const { return theBins; } 00090 00094 tcPDPtr particleData() const { return bin()->particle(); } 00095 00099 tcPDPtr partonData() const { return bin()->parton(); } 00100 00106 tPBIPtr incoming() const { return theIncoming; } 00107 00112 tPBIPtr getFirst(); 00113 00118 tcPDFPtr pdf() const { return bin()->pdf(); } 00119 00123 tcRemHPtr remnantHandler() const { return bin()->remnantHandler(); } 00124 00129 bool hasPoleIn1() const; 00131 00137 void reset(double lx = 0, Energy2 Q2 = ZERO); 00138 00142 void prepare(); 00143 00147 void generate(const double * r); 00148 00153 double fullFn(Energy2 newScale = -GeV2); 00154 00158 double jacobian() const { return theJacobian; } 00159 00163 void jacobian(double j) { theJacobian = j; } 00165 00171 tPPtr particle() const { return theParticle; } 00172 00176 void particle(tPPtr p) { theParticle = p; } 00177 00181 tPPtr parton() const { return theParton; } 00182 00186 void parton(tPPtr p) { theParton = p; } 00187 00192 const PVector & partons() const { return thePartons; } 00193 00198 double xi() const { 00199 if ( theXi < 0.0 ) theXi = exp(-li()); 00200 return theXi; 00201 } 00202 00203 00208 double eps() const { 00209 if ( theEps < 0.0 ) theEps = Math::exp1m(-li()); 00210 return theEps; 00211 } 00212 00217 double li() const { return theLi; } 00218 00223 void li(double lx) { 00224 theLi = lx; 00225 theXi = theEps = -1.0; 00226 } 00227 00228 00233 double x() const { 00234 if ( theX < 0.0 ) theX = exp(-l()); 00235 return theX; 00236 } 00237 00238 00243 double l() const { return theL; } 00244 00249 void l(double lx) { 00250 theL = lx; 00251 theX = -1.0; 00252 } 00253 00254 00258 Energy2 scale() const { return theScale; } 00259 00260 00264 void scale(Energy2 s) { theScale = s; } 00265 00269 const TransverseMomentum & kT() const { return theKT; } 00270 00274 double remnantWeight() const { return theRemnantWeight; } 00275 00279 void remnantWeight(double w) { theRemnantWeight = w; } 00280 00284 const PVector & remnants() const { return theRemnants; } 00285 00289 void remnants(const PVector & rems) { theRemnants = rems; } 00290 00296 tRemIPtr remnantInfo() const { return theRemInfo; } 00297 00303 void remnantInfo(tRemIPtr ri) { theRemInfo = ri; } 00305 00306 public: 00307 00314 void persistentOutput(PersistentOStream & os) const; 00315 00321 void persistentInput(PersistentIStream & is, int version); 00323 00327 static void Init(); 00328 00329 private: 00330 00334 cPBPtr theBin; 00335 00340 PartonVector theBins; 00341 00347 PBIPtr theIncoming; 00348 00352 double theJacobian; 00353 00357 PPtr theParticle; 00358 00362 PPtr theParton; 00363 00368 PVector thePartons; 00369 00375 mutable double theXi; 00381 mutable double theEps; 00387 double theLi; 00388 00393 mutable double theX; 00398 double theL; 00399 00403 Energy2 theScale; 00404 00408 TransverseMomentum theKT; 00409 00413 double theRemnantWeight; 00414 00418 PVector theRemnants; 00419 00425 RemIPtr theRemInfo; 00426 00427 private: 00428 00432 static ClassDescription<PartonBinInstance> initPartonBinInstance; 00433 00437 PartonBinInstance & operator=(const PartonBinInstance &); 00438 00439 }; 00440 00443 struct RemInfoBase: public Base { 00445 virtual ~RemInfoBase() {} 00446 }; 00447 00448 } 00449 00450 00451 namespace ThePEG { 00452 00457 template <> 00458 struct BaseClassTrait<PartonBinInstance,1>: public ClassTraitsType { 00460 typedef Base NthBase; 00461 }; 00462 00465 template <> 00466 struct ClassTraits<PartonBinInstance>: 00467 public ClassTraitsBase<PartonBinInstance> { 00469 static string className() { return "ThePEG::PartonBinInstance"; } 00470 }; 00471 00474 } 00475 00476 #endif /* THEPEG_PartonBinInstance_H */