00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_DecayMode_H
00010 #define ThePEG_DecayMode_H
00011
00012
00013 #include "ThePEG/Config/ThePEG.h"
00014 #include "ThePEG/Interface/Interfaced.h"
00015 #include "DecayMode.fh"
00016 #include "MatcherBase.h"
00017 #include "Decayer.h"
00018
00019 namespace ThePEG {
00020
00021 ThePEG_DECLARE_MULTISET(tPDPtr,ParticleMSet);
00022 ThePEG_DECLARE_MULTISET(tPMPtr,MatcherMSet);
00023 ThePEG_DECLARE_MULTISET(tDMPtr,ModeMSet);
00024
00087 class DecayMode: public Interfaced {
00088
00089 public:
00090
00092 friend class ParticleData;
00093
00095 friend class RemnantData;
00096
00098 friend class EventGenerator;
00099
00100 public:
00101
00103 typedef vector<tcDMPtr> ModeVector;
00105 typedef vector<tPDPair> LinkVector;
00106
00107 public:
00108
00116 static DMPtr constructDecayMode(string & tag, vector<DMPtr> * save = 0);
00117
00123 DecayMode();
00124
00128 DecayMode(const DecayMode &);
00129
00133 ~DecayMode();
00135
00140 virtual DMPtr clone(tPDPtr pd) const;
00141
00142 public:
00143
00148 const string & tag() const {
00149 return theTag.size() ? theTag : ( theTag = makeTag() );
00150 }
00151
00156 tcPDPtr parent() const { return theParent; }
00157
00161 const ParticleMSet & products() const { return theProducts; }
00162
00166 const tPDVector & orderedProducts() const { return theOrderedProducts; }
00167
00173 PVector produceProducts() const;
00174
00179 const ModeMSet & cascadeProducts() const { return theCascadeProducts; }
00180
00184 const MatcherMSet & productMatchers() const { return theMatchers; }
00185
00190 tPMPtr wildProductMatcher() const { return theWildMatcher; }
00191
00196 const ParticleMSet & excluded() const { return theExcluded; }
00197
00201 double brat() const;
00202
00206 double brat(const Particle &) const;
00207
00211 tDecayerPtr decayer() const { return theDecayer; }
00212
00216 bool includes(const DecayMode &) const;
00217
00222 tDMPtr CC() const { return theAntiPartner; }
00223
00228 bool operator == (const DecayMode & d) const {
00229 return tag() == d.tag() ;
00230 }
00231
00236 const LinkVector & links() const { return theLinks; }
00237
00241 const ModeVector & overlap() const { return theOverlap; }
00242
00246 void synchronize();
00247
00251 bool on() const { return isOn; }
00252
00253 public:
00254
00261 void persistentOutput(PersistentOStream & os) const;
00262
00268 void persistentInput(PersistentIStream & is, int version);
00270
00274 static void Init();
00275
00276 protected:
00277
00283 virtual void doupdate();
00284
00294 virtual void rebind(const TranslationMap & trans)
00295 ;
00296
00302 virtual IVector getReferences();
00304
00305 protected:
00306
00311 void parent(tPDPtr pd) { theParent = pd; }
00312
00316 void brat(double);
00317
00321 void switchOn();
00322
00326 void switchOff();
00327
00332 void decayer(tDecayerPtr);
00333
00337 void addProduct(tPDPtr);
00338
00343 void addLink(tPDPtr a, tPDPtr b);
00344
00348 void addCascadeProduct(tDMPtr);
00349
00353 void addProductMatcher(tPMPtr);
00354
00358 void setWildMatcher(tPMPtr);
00359
00364 void addExcluded(tPDPtr);
00365
00369 static DMPtr Create(tPDPtr newParent, double newBrat = 0.0,
00370 bool newOn = false);
00374 DecayMode(tPDPtr newParticle, double newBrat, bool newOn);
00375
00382 virtual IBPtr clone() const;
00383
00388 virtual IBPtr fullclone() const;
00390
00394 DMPtr dmclone() const;
00395
00402 virtual void readSetup(istream & is);
00403
00407 ParticleMSet & products() { return theProducts; }
00408
00413 ModeMSet & cascadeProducts() { return theCascadeProducts; }
00414
00418 MatcherMSet & productMatchers() { return theMatchers; }
00419
00424 tPMPtr & wildProductMatcher() { return theWildMatcher; }
00425
00430 ParticleMSet & excluded() { return theExcluded; }
00431
00432 private:
00433
00437 bool addOverlap(tcDMPtr);
00438
00442 void resetOverlap();
00443
00447 bool compareId(const ParticleMSet &, const ParticleMSet &) const;
00448
00452 ParticleMSet::const_iterator findId(const ParticleMSet &,
00453 const ParticleData &) const;
00454
00459 string makeTag() const;
00460
00464 void resetTag() {
00465 theTag = "";
00466 if ( CC() ) CC()->theTag = "";
00467 }
00468
00469
00470 private:
00471
00475 void setOn(long);
00476
00480 long getOn() const;
00481
00485 void setDecayer(DecayerPtr);
00486
00487 private:
00488
00492 mutable string theTag;
00493
00497 double theBrat;
00498
00502 bool isOn;
00503
00508 tPDPtr theParent;
00509
00513 ParticleMSet theProducts;
00514
00518 tPDVector theOrderedProducts;
00519
00524 ModeMSet theCascadeProducts;
00525
00530 MatcherMSet theMatchers;
00531
00535 tPMPtr theWildMatcher;
00536
00541 ParticleMSet theExcluded;
00542
00546 ModeVector theOverlap;
00547
00551 DecayerPtr theDecayer;
00552
00556 tDMPtr theAntiPartner;
00557
00562 LinkVector theLinks;
00563
00564 private:
00565
00569 static ClassDescription<DecayMode> initDecayMode;
00570
00574 DecayMode & operator=(const DecayMode &);
00575
00576 };
00577
00582 template <>
00583 struct BaseClassTrait<DecayMode,1>: public ClassTraitsType {
00585 typedef Interfaced NthBase;
00586 };
00587
00590 template <>
00591 struct ClassTraits<DecayMode>:
00592 public ClassTraitsBase<DecayMode> {
00594 static string className() { return "ThePEG::DecayMode"; }
00595 };
00596
00599 }
00600
00601 #endif