ThePEG  1.8.0
ClusterCollapser.h
1 // -*- C++ -*-
2 //
3 // ClusterCollapser.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_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 
192 public:
193 
200  void persistentOutput(PersistentOStream & os) const;
201 
207  void persistentInput(PersistentIStream & is, int version);
209 
213  static void Init();
214 
215 protected:
216 
223  virtual IBPtr clone() const;
224 
229  virtual IBPtr fullclone() const;
231 
234  class ClusterException: public Exception {
235  public:
237  ClusterException(const ClusterCollapser & cc) {
238  theMessage << "In ClusterCollapser '" << cc.name() << "': ";
239  }
240  };
243 private:
244 
251 
256  int theNTry2;
257 
263 
264 protected:
265 
273 
278  double pStrange;
279 
280 private:
281 
286 
291 
292 };
293 
294 }
295 
296 
297 namespace ThePEG {
298 
305 template <>
306 struct BaseClassTrait<ClusterCollapser,1>: public ClassTraitsType {
308  typedef StepHandler NthBase;
309 };
310 
316 template <>
317 struct ClassTraits<ClusterCollapser>:
318  public ClassTraitsBase<ClusterCollapser> {
322  static string className() { return "ThePEG::ClusterCollapser"; }
323 
324 };
325 
328 }
329 
330 #endif /* ThePEG_ClusterCollapser_H */