herwig is hosted by Hepforge, IPPP Durham
Herwig  7.1.5
Cluster.h
1 // -*- C++ -*-
2 //
3 // Cluster.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2017 The Herwig Collaboration
5 //
6 // Herwig 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 HERWIG_Cluster_H
10 #define HERWIG_Cluster_H
11 
12 #include <ThePEG/EventRecord/Particle.h>
13 #include "Herwig/Utilities/EnumParticles.h"
14 #include "CluHadConfig.h"
15 #include "ClusterHadronizationHandler.fh"
16 #include "Cluster.fh"
17 #include "ThePEG/Utilities/ClassDescription.h"
18 
19 namespace Herwig {
20 using namespace ThePEG;
21 
60 class Cluster : public Particle {
61 
62 protected:
63 
69  Cluster();
70 
75  friend struct ClassTraits<Cluster>;
76 
77 public:
82 
86  Cluster(tPPtr part1, tPPtr part2, tPPtr part3 = tPPtr());
87 
91  Cluster(const Particle &);
93 
97  int numComponents() const
98  { return _numComp; }
99 
103  Energy sumConstituentMasses() const;
104 
108  tPPtr particle(int i) const;
109 
113  tPPtr colParticle(bool anti = false) const;
114 
118  tPPtr antiColParticle() const;
119 
123  bool isPerturbative(int) const;
124 
128  bool isBeamRemnant(int) const;
129 
133  void setBeamRemnant(int,bool);
134 
138  int clusterId() const { return _id; }
139 
140 public:
141 
145  bool isBeamCluster() const;
146 
151  { _hasReshuffled = true; }
152 
156  void isBeamCluster(tPPtr part);
157 
161  bool isAvailable() const
162  { return _isAvailable; }
163 
167  void isAvailable(bool inputAvailable)
168  { _isAvailable = inputAvailable; }
169 
173  bool isStatusInitial() const
174  { return parents().empty(); }
175 
181  bool isReadyToDecay() const
182  { return children().empty(); }
183 
196  bool isRedefined() const {
197  return ( children().size() == 1
198  && children()[0]->id() == ParticleID::Cluster );
199  }
200 
207  bool hasBeenReshuffled() const
208  { return _hasReshuffled; }
209 
213  bool isStatusFinal() const;
214 
215 public:
216 
234  static LorentzPoint calculateX(tPPtr q1, tPPtr q2);
235 
236 protected:
237 
244  virtual PPtr clone() const;
245 
250  virtual PPtr fullclone() const;
252 
253 public:
254 
260  void persistentOutput(PersistentOStream &) const;
261 
265  void persistentInput(PersistentIStream &, int);
266 
267 private:
271  Cluster & operator=(const Cluster &) = delete;
272 
279  void calculateP();
280 
284  bool initPerturbative(tPPtr p);
285 
290 
291 
292 
297  vector<bool> _isBeamRemnant;
298  vector<bool> _isPerturbative;
299  int _numComp;
300  long _id;
301 };
302 
303 } // end namespace Herwig
304 
305 #include "ThePEG/Utilities/ClassTraits.h"
306 
307 namespace ThePEG {
308 
315 template <>
316 struct BaseClassTrait<Herwig::Cluster,1> {
318  typedef Particle NthBase;
319 };
320 
325 template <>
326 struct ClassTraits<Herwig::Cluster>:
327  public ClassTraitsBase<Herwig::Cluster> {
329  static string className() { return "Herwig::Cluster"; }
331  static TPtr create() { return TPtr::Create(Herwig::Cluster()); }
332 };
333 
336 }
337 
338 
339 
340 
341 #endif // HERWIG_Cluster_H
ThePEG::Ptr< Particle >::pointer PPtr
int _numComp
The number of constituents.
Definition: Cluster.h:299
bool _hasReshuffled
Whether the cluster has been reshuffled.
Definition: Cluster.h:294
bool isAvailable() const
Returns true if this cluster is to be handled by the hadronization.
Definition: Cluster.h:161
Herwig Cluster for Hadronization.
Definition: EnumParticles.h:17
This class describes a cluster object.
Definition: Cluster.h:60
ParticleVector _component
The constituent partons.
Definition: Cluster.h:295
vector< tPPtr > tParticleVector
bool hasBeenReshuffled() const
Return true when it has a reshuffling partner.
Definition: Cluster.h:207
int numComponents() const
Number of quark (diquark) constituents (normally two).
Definition: Cluster.h:97
tParticleVector _original
The original components.
Definition: Cluster.h:296
bool _isAvailable
Whether the cluster is hadronizing.
Definition: Cluster.h:293
ThePEG::Ptr< Particle >::transient_pointer tPPtr
static ClassDescription< Cluster > initCluster
Describe an abstract base class with persistent data.
Definition: Cluster.h:289
vector< bool > _isPerturbative
Whether a parton is perturbative.
Definition: Cluster.h:298
-*- C++ -*-
vector< bool > _isBeamRemnant
Whether a parton is a beam remnant.
Definition: Cluster.h:297
bool isStatusInitial() const
Return true if the cluster does not have cluster parent.
Definition: Cluster.h:173
void flagAsReshuffled()
Set the pointer to the reshuffling partner cluster.
Definition: Cluster.h:150
void isAvailable(bool inputAvailable)
Sets the value of availability.
Definition: Cluster.h:167
vector< PPtr > ParticleVector
long _id
The id of this cluster.
Definition: Cluster.h:300
bool isReadyToDecay() const
Return true if the cluster does not have cluster children and it is not already decayed (i...
Definition: Cluster.h:181
Ptr< ParticleDataClass >::transient_const_pointer tcEventPDPtr
int clusterId() const
Returns the clusters id, not the same as the PDG id.
Definition: Cluster.h:138
bool isRedefined() const
Return true if the cluster has one and only one cluster children and no hadron children: that means e...
Definition: Cluster.h:196