thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
ClusterCollapser.h
1 // -*- C++ -*-
2 //
3 // ClusterCollapser.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_ClusterCollapser_H
10 #define ThePEG_ClusterCollapser_H
11 // This is the declaration of the ClusterCollapser class.
12 
13 #include "ThePEG/Handlers/StepHandler.h"
14 #include "ThePEG/Handlers/FlavourGenerator.h"
15 #include "ThePEG/EventRecord/ColourSinglet.h"
16 #include "ClusterCollapser.fh"
17 // #include "ClusterCollapser.xh"
18 
19 
20 namespace ThePEG {
21 
36 
37 public:
38 
41 
43  typedef multimap<Energy,ColourSinglet> SingletMap;
44 
45 public:
46 
53  : theEnergyCut(1.0*GeV), theNTry2(2), errorlevel(Exception::eventerror),
54  pStrange(1.0/3.0) {}
55 
59  virtual ~ClusterCollapser();
61 
62 public:
63 
79  virtual void handle(EventHandler & eh, const tPVector & tagged,
80  const Hint & hint);
82 
86  virtual vector<ColourSinglet> collapse(tPVector tagged,
87  tStepPtr newstep);
88 
94  virtual SingletMap getSinglets(const tPVector & tagged) const;
95 
101  tStepPtr newStep) const;
102 
108  tStepPtr newStep) const;
109 
114  static bool diQuarkJunction(const ColourSinglet & cs);
115 
120  static bool diDiQuark(const ColourSinglet & cs);
121 
127  Energy cut() const { return theEnergyCut; }
128 
133  int nTry2() const { return theNTry2; }
134 
139  static Energy mass(const ColourSinglet & cl);
140 
144  static void insert(SingletMap & mmap, const ColourSinglet & cl);
145 
150  virtual tcPDPtr pickFlavour() const;
151 
152 protected:
153 
160  virtual void collapse(tStepPtr newStep, const ColourSinglet & cs,
161  const tPVector & tagged) const;
169  virtual bool collapse2(tStepPtr newStep, const ColourSinglet & cs) const;
170 
178  virtual tPVector getCompensators(Energy mh, const ColourSinglet & cs,
179  const tPVector & tagged,
180  tStepPtr newStep) const;
181 
185  virtual tcPDPtr getHadron(const ColourSinglet & cs) const;
186 
190  virtual tcPDPair getHadrons(const ColourSinglet & cs) const;
191 
196  void updateTagged(tPVector & tagged) const;
197 
198 public:
199 
206  void persistentOutput(PersistentOStream & os) const;
207 
213  void persistentInput(PersistentIStream & is, int version);
215 
219  static void Init();
220 
221 protected:
222 
229  virtual IBPtr clone() const;
230 
235  virtual IBPtr fullclone() const;
237 
240  class ClusterException: public Exception {
241  public:
243  ClusterException(const ClusterCollapser & cc) {
244  theMessage << "In ClusterCollapser '" << cc.name() << "': ";
245  }
246  };
249 private:
250 
257 
262  int theNTry2;
263 
268  FlavGenPtr flavGen;
269 
270 protected:
271 
279 
284  double pStrange;
285 
286 private:
287 
292 
296  ClusterCollapser & operator=(const ClusterCollapser &) = delete;
297 
298 };
299 
300 }
301 
302 
303 namespace ThePEG {
304 
311 template <>
312 struct BaseClassTrait<ClusterCollapser,1>: public ClassTraitsType {
314  typedef StepHandler NthBase;
315 };
316 
322 template <>
323 struct ClassTraits<ClusterCollapser>:
324  public ClassTraitsBase<ClusterCollapser> {
328  static string className() { return "ThePEG::ClusterCollapser"; }
329 
330 };
331 
334 }
335 
336 #endif /* ThePEG_ClusterCollapser_H */
pair< tcPDPtr, tcPDPtr > tcPDPair
A pair of transient pointers to const ParticleData objects.
Definition: Containers.h:124
virtual SingletMap getSinglets(const tPVector &tagged) const
Go through the tagged partons and extract all colour singlet combination of partons.
virtual IBPtr clone() const
Make a simple clone of this object.
PersistentIStream is used to read persistent objects from a stream where they were previously written...
tStepPtr newStep()
Return a pointer to a new step.
Definition: StepHandler.h:93
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
double pStrange
The relative probability to produce a s-sbar pair in a split as compared to a u-ubar or d-dbar pair...
int theNTry2
The number of attempts to collapse a cluster into two particles, before it is collapsed into one part...
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
multimap< Energy, ColourSinglet > SingletMap
Declare a multimap of singlets indexed by their mass.
Exception::Severity errorlevel
How should we respond to errors? 0 means do nothing, ie.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
virtual ColourSinglet splitDiQuarkJunction(ColourSinglet &cs, tStepPtr newStep) const
If a singlet contains at least one diquark and a junction, split the diquark and split off a new colo...
virtual ~ClusterCollapser()
The destructor.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Ptr< FlavourGenerator >::pointer FlavGenPtr
Declare a pointer to a FlavourGenerator object.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
static bool diDiQuark(const ColourSinglet &cs)
Returns true iff the given singlet contains one string piece with diquarks in both ends...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
virtual bool collapse2(tStepPtr newStep, const ColourSinglet &cs) const
Perform the actual collapse of a cluster into two hadrons.
Energy cut() const
If the invariant mass of a cluster, minus the constituent masses of its partons is below this cut...
virtual tcPDPtr pickFlavour() const
Pick a random flavour.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
virtual void handle(EventHandler &eh, const tPVector &tagged, const Hint &hint)
The main function called by the EventHandler class to perform a step.
static void insert(SingletMap &mmap, const ColourSinglet &cl)
Insert a ColourSinglet object in a SingletMap.
FlavGenPtr flavGen
The flavour generator object to use to combine quarks and diqurks into hadrons.
StepHandler is the base class for implementing any model for a step in the event generation chain...
Definition: StepHandler.h:41
static void Init()
Standard Init function used to initialize the interfaces.
ClusterCollapser is a general StepHandler which can be called anywhere in the event generation (typic...
Energy theEnergyCut
Energy cut.
ClusterCollapser & operator=(const ClusterCollapser &)=delete
Private and non-existent assignment operator.
Hint is a base class to be used to pass information between StepHandler s, which cannot be convayed t...
Definition: Hint.h:48
A ColourSinglet object represents a set of colour-connected partons in a total colour-singlet state...
Definition: ColourSinglet.h:31
Severity
The levels of severity.
Definition: Exception.h:51
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
static ClassDescription< ClusterCollapser > initClusterCollapser
Describe a concrete class with persistent data.
static Energy mass(const ColourSinglet &cl)
Return the invariant mass of a cluster minus the constituent masses of its partons.
virtual tcPDPtr getHadron(const ColourSinglet &cs) const
Return a hadron into which the given cluster may collapse.
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
virtual tPVector getCompensators(Energy mh, const ColourSinglet &cs, const tPVector &tagged, tStepPtr newStep) const
Get particles for compensation.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
static bool diQuarkJunction(const ColourSinglet &cs)
Returns true iff the given singlet contains a junction and at least one diquark.
Ptr is a templated class to provide typedefs for pointers types ThePEG should use for a given type...
Definition: Ptr.h:35
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
ClusterCollapser()
The default constructor.
virtual vector< ColourSinglet > collapse(tPVector tagged, tStepPtr newstep)
Perform all necessary collapses.
string name() const
Returns the name of this object, without the path.
virtual tcPDPair getHadrons(const ColourSinglet &cs) const
Return a pair of hadrons into which the given cluster may collapse.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
int nTry2() const
The number of attempts to collapse a cluster into two particles, before it is collapsed into one part...
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
virtual ColourSinglet splitDiDiQuark(ColourSinglet &cs, tStepPtr newStep) const
If a singlet contains a simple string with diquarks in both ends, split them into quarks and split of...
void updateTagged(tPVector &tagged) const
Uptate the vector of particles and remove partons which have already collapsed and insert their child...
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52