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 */
virtual ParticleVector decay(const DecayMode &dm, const Particle &p, Step &step) const
Perform a decay for a given DecayMode and a given Particle instance.
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Energy margin() const
Return the energy margin to be added to the sum of the parent and parton masses to determine if it is...
bool useSpecialValence
If true an extracted valens quark will always give a di-quark remnant.
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
bool specialValence() const
If true an extracted valens quark will always give a di-quark remnant.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
ZGenerator is the base class for all classes implementing models to generate the momentum fraction...
Definition: ZGenerator.h:32
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
FlavourGenerator & flavourGenerator() const
Return a reference to the object responsible for handling the flavour contents of a baryon...
virtual bool accept(const DecayMode &dm) const
Check if this decayer can perfom the decay specified by the given decay mode.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:681
virtual bool checkExtract(tcPPtr parent, tcPPtr extracted, const LorentzMomentum &pnew) const
Return true if this decayer can handle the extraction of the extracted parton instance from the given...
tcPPtr parent(tcRemPPtr remnant) const
Access the parent of a remnant.
Energy theMargin
The energy margin to be added to the sum of the parent and parton masses to determine if it is possib...
VSelector is a templated class for storing objects associated with probabilities in a way such that...
Definition: VSelector.h:46
virtual IBPtr clone() const
Make a simple clone of this object.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
Warning Exception used when DIS kinematics was not respected.
The RemnantDecayer class is the base class to be used for all decayers capable of decaying a RemnantP...
SimpleBaryonRemnantDecayer & operator=(const SimpleBaryonRemnantDecayer &)
The assignment operator is private and must never be called.
The SimpleBaryonRemnantDecayer class inherits from the RemnantDecayer class and is able to decay Remn...
Ptr< ZGenerator >::pointer ZGPtr
A pointer to a ZGenerator object.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
QTY< 0, 1, 0 >::Type Energy
Energy.
Definition: Unitsystem.h:34
FlavourGenerator is an abstract base class to be used to implement models describing the quark conten...
virtual bool canHandle(tcPDPtr parent, tcPDPtr extracted) const
Return true if this decayer can handle the extraction of the extracted parton from the given particle...
Exception thrown if the decay of a remnant was impossible.
vector< int > flav
The valence flavours of the corresponding baryon.
FlGPtr theFlavourGenerator
The object responsible for handling the flavour contents of a baryon.
SimpleBaryonRemnantDecayer(const SimpleBaryonRemnantDecayer &x)
The copy constructor.
VSelector< pair< int, int > > flavsel
Different divisions into quark-diquark weighted by their respective probabilities.
const BaryonContent & getBaryonInfo(tcPDPtr baryon) const
Return info about baryon quark and di-quark constituents.
int sign
-1 if the particle is an anti-particle.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
Ptr< FlavourGenerator >::pointer FlGPtr
A pointer to a FlavourGenerator object.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
static void Init()
The standard Init function used to initialize the interfaces.
ZGenerator & zGenerator() const
Return a reference to the object responsible for generating momentum fractions in case of more than o...
const PVector & extracted(tcRemPPtr remnant) const
Access the vector of extracted particles of a remnant.
SimpleBaryonRemnantDecayer()
The default constructor.
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
ZGPtr theZGenerator
The object responsible for generating momentum fractions in case of more than one remnant...
static ClassDescription< SimpleBaryonRemnantDecayer > initSimpleBaryonRemnantDecayer
The static object used to initialize the description of this class.
Ptr is a templated class to provide typedefs for pointers types ThePEG should use for a given type...
Definition: Ptr.h:35
The DecayMode class describes a decay channel of a particle.
Definition: DecayMode.h:87
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
virtual ~SimpleBaryonRemnantDecayer()
The destructor.
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
vector< PPtr > ParticleVector
A vector of pointers to Particle objects.
Definition: Containers.h:73
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Simple struct to store info about baryon quark and di-quark constituents.
map< tcPDPtr, BaryonContent > baryonmap
A map of info about baryon quark and di-quark constituents.
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
The Step class contains information of all particles present after certain step in the event generati...
Definition: Step.h:34