herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Cluster.h
1// -*- C++ -*-
2//
3// Cluster.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 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
19namespace Herwig {
20using namespace ThePEG;
21
60class Cluster : public Particle {
61
62protected:
63
70
75 friend struct ClassTraits<Cluster>;
76
77public:
82
86 Cluster(tPPtr part1, tPPtr part2, tPPtr part3 = tPPtr());
87
91 Cluster(const Particle &);
93
97 unsigned int numComponents() const
98 { return _numComp; }
99
103 Energy sumConstituentMasses() const;
104
108 tPPtr particle(int i) const;
109
113 tPPtr particleB(int i) const;
114
118 tPPtr colParticle(bool anti = false) const;
119
124
128 bool isPerturbative(int) const;
129
133 bool isBeamRemnant(int) const;
134
138 void setBeamRemnant(int,bool);
139
143 int clusterId() const { return _id; }
144
145public:
146
150 bool isBeamCluster() const;
151
156 { _hasReshuffled = true; }
157
162
166 bool isAvailable() const
167 { return _isAvailable; }
168
172 void isAvailable(bool inputAvailable)
173 { _isAvailable = inputAvailable; }
174
178 bool isStatusInitial() const
179 { return parents().empty(); }
180
186 bool isReadyToDecay() const
187 { return children().empty(); }
188
201 bool isRedefined() const {
202 return ( children().size() == 1
203 && children()[0]->id() == ParticleID::Cluster );
204 }
205
212 bool hasBeenReshuffled() const
213 { return _hasReshuffled; }
214
218 bool isStatusFinal() const;
219
220public:
221
239 static LorentzPoint calculateX(tPPtr q1, tPPtr q2);
240
241protected:
242
249 virtual PPtr clone() const;
250
255 virtual PPtr fullclone() const;
257
258public:
259
266
271
272private:
276 Cluster & operator=(const Cluster &) = delete;
277
285
290
295
296
297
302 vector<bool> _isBeamRemnant;
303 vector<bool> _isPerturbative;
304 unsigned int _numComp;
305 long _id;
306};
307
308} // end namespace Herwig
309
310#include "ThePEG/Utilities/ClassTraits.h"
311
312namespace ThePEG {
313
320template <>
321struct BaseClassTrait<Herwig::Cluster,1> {
323 typedef Particle NthBase;
324};
325
330template <>
331struct ClassTraits<Herwig::Cluster>:
332 public ClassTraitsBase<Herwig::Cluster> {
334 static string className() { return "Herwig::Cluster"; }
336 static TPtr create() { return TPtr::Create(Herwig::Cluster()); }
337};
338
341}
342
343
344
345
346#endif // HERWIG_Cluster_H
This class describes a cluster object.
Definition: Cluster.h:60
bool isBeamRemnant(int) const
Indicates whether the ith constituent is a beam remnant.
bool isBeamCluster() const
Returns true when a constituent is a beam remnant.
bool isPerturbative(int) const
Returns whether the ith constituent is from a perturbative process.
bool _hasReshuffled
Whether the cluster has been reshuffled.
Definition: Cluster.h:299
bool initPerturbative(tPPtr p)
Determines whether constituent p is perturbative or not.
static ClassDescription< Cluster > initCluster
Describe an abstract base class with persistent data.
Definition: Cluster.h:294
tPPtr antiColParticle() const
Returns the original constituent carrying anticolour.
unsigned int _numComp
The number of constituents.
Definition: Cluster.h:304
tParticleVector _original
The original components.
Definition: Cluster.h:301
bool isAvailable() const
Returns true if this cluster is to be handled by the hadronization.
Definition: Cluster.h:166
vector< bool > _isBeamRemnant
Whether a parton is a beam remnant.
Definition: Cluster.h:302
Cluster(const Particle &)
Also a constructor where a particle is given not a cluster.
bool isStatusInitial() const
Return true if the cluster does not have cluster parent.
Definition: Cluster.h:178
bool isStatusFinal() const
Return true if the cluster has hadron children.
unsigned int numComponents() const
Number of quark (diquark) constituents (normally two).
Definition: Cluster.h:97
bool isReadyToDecay() const
Return true if the cluster does not have cluster children and it is not already decayed (i....
Definition: Cluster.h:186
Energy sumConstituentMasses() const
Sum of the constituent masses of the components of the cluster.
bool hasBeenReshuffled() const
Return true when it has a reshuffling partner.
Definition: Cluster.h:212
virtual PPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void isBeamCluster(tPPtr part)
Sets the component (if any) that points to "part" as a beam remnant.
tPPtr particleB(int i) const
Returns the ith original constituent.
ParticleVector _component
The constituent partons.
Definition: Cluster.h:300
tPPtr particle(int i) const
Returns the ith constituent.
Cluster & operator=(const Cluster &)=delete
Private and non-existent assignment operator.
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:201
vector< bool > _isPerturbative
Whether a parton is perturbative.
Definition: Cluster.h:303
void isAvailable(bool inputAvailable)
Sets the value of availability.
Definition: Cluster.h:172
long _id
The id of this cluster.
Definition: Cluster.h:305
Cluster(tPPtr part1, tPPtr part2, tPPtr part3=tPPtr())
This creates a cluster from 2 (or 3) partons.
bool _isAvailable
Whether the cluster is hadronizing.
Definition: Cluster.h:298
static LorentzPoint calculateX(tPPtr q1, tPPtr q2)
Calculate the 4-position vector of the cluster Method made static so can be used in other places Disp...
void calculateP()
Calculate the 5-momentum vector of the cluster The 5-momentum of the cluster is given by.
virtual PPtr clone() const
Make a simple clone of this object.
void setBeamRemnant(int, bool)
Sets whether the ith constituent is a beam remnant.
void flagAsReshuffled()
Set the pointer to the reshuffling partner cluster.
Definition: Cluster.h:155
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
int clusterId() const
Returns the clusters id, not the same as the PDG id.
Definition: Cluster.h:143
Cluster()
Default constructor.
Cluster(tcEventPDPtr)
Constructor with a particleData pointer.
void persistentInput(PersistentIStream &, int)
Standard function for reading from a persistent stream.
tPPtr colParticle(bool anti=false) const
Returns the original constituent carrying colour.
const tParticleVector & parents() const
const ParticleVector & children() const
@ Cluster
Herwig Cluster for Hadronization.
Definition: EnumParticles.h:17
-*- C++ -*-
ThePEG::Ptr< Particle >::transient_pointer tPPtr
vector< tPPtr > tParticleVector
ThePEG::Ptr< Particle >::pointer PPtr
vector< PPtr > ParticleVector
Ptr< ParticleDataClass >::transient_const_pointer tcEventPDPtr
static string className()
ThePEG::Ptr< T >::pointer TPtr