ThePEG  1.8.0
SimpleBaryonRemnantDecayer.h
1 // -*- C++ -*-
2 //
3 // SimpleBaryonRemnantDecayer.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef THEPEG_SimpleBaryonRemnantDecayer_H
10 #define THEPEG_SimpleBaryonRemnantDecayer_H
11 //
12 // This is the declaration of the SimpleBaryonRemnantDecayer class.
13 //
14 
15 #include "ThePEG/PDT/RemnantDecayer.h"
16 #include "ThePEG/Handlers/ZGenerator.h"
17 #include "ThePEG/Handlers/FlavourGenerator.h"
18 #include "ThePEG/Utilities/VSelector.h"
19 
20 namespace ThePEG {
21 
32 
33 public:
34 
39 
40 public:
41 
48  : theMargin(1.0*GeV), useSpecialValence(false) {}
49 
57 
63 
64 public:
65 
74  virtual bool accept(const DecayMode & dm) const;
75 
89  virtual ParticleVector decay(const DecayMode & dm, const Particle & p,
90  Step & step) const;
91 
96  virtual bool canHandle(tcPDPtr parent, tcPDPtr extracted) const;
97 
104  virtual bool checkExtract(tcPPtr parent, tcPPtr extracted,
105  const LorentzMomentum & pnew) const;
107 
108 protected:
109 
117  virtual void doinit();
118 
123  virtual bool preInitialize() const;
125 
126 public:
127 
134  void persistentOutput(PersistentOStream & os) const;
135 
141  void persistentInput(PersistentIStream & is, int version);
143 
150  static void Init();
151 
152 public:
153 
157  struct NoDISRespect: public Exception {};
158 
162  struct DecayFailed: public Exception {};
163 
164 protected:
165 
170  ZGenerator & zGenerator() const { return *theZGenerator; }
171 
177 
184  Energy margin() const { return theMargin; }
185 
189  bool specialValence() const { return useSpecialValence; }
190 
191 protected:
192 
199  virtual IBPtr clone() const;
200 
205  virtual IBPtr fullclone() const;
207 
208 protected:
209 
214  struct BaryonContent {
216  vector<int> flav;
221  int sign;
222  };
223 
227  const BaryonContent & getBaryonInfo(tcPDPtr baryon) const;
228 
229 private:
230 
236 
242 
250 
255 
259  mutable map<tcPDPtr,BaryonContent> baryonmap;
260 
261 private:
262 
269 
275 
276 };
277 
278 }
279 
280 #include "ThePEG/Utilities/ClassTraits.h"
281 
282 namespace ThePEG {
283 
288 template <>
289 struct BaseClassTrait<SimpleBaryonRemnantDecayer,1> {
291  typedef RemnantDecayer NthBase;
292 };
293 
297 template <>
298 struct ClassTraits<SimpleBaryonRemnantDecayer>
299  : public ClassTraitsBase<SimpleBaryonRemnantDecayer> {
301  static string className() { return "ThePEG::SimpleBaryonRemnantDecayer"; }
302 };
303 
306 }
307 
308 #endif /* THEPEG_SimpleBaryonRemnantDecayer_H */