herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ColourReconnector.h
1// -*- C++ -*-
2//
3// ColourReconnector.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_ColourReconnector_H
10#define HERWIG_ColourReconnector_H
11
12#include <ThePEG/Interface/Interfaced.h>
13#include "CluHadConfig.h"
14#include "ColourReconnector.fh"
15
16namespace Herwig {
17
18
19using namespace ThePEG;
20
37
38public:
39
46 void rearrange(ClusterVector & clusters);
47
48 using CluVecIt = ClusterVector::iterator;
49
50private:
51
59 Energy2 _clusterMassSum(const PVector & q, const PVector & aq) const;
60
61
62
70 double _displacement(tcPPtr p, tcPPtr q) const;
71
72
96 double _displacementBaryonic(tcPPtr p1, tcPPtr p2, tcPPtr p3) const;
97
98
106 bool _containsColour8(const ClusterVector & cv, const vector<size_t> & P) const;
107
114
119 void _doRecoPlain(ClusterVector & cv) const;
120
121
126
127
136
137
138
139
140 void _makeBaryonicClusters(ClusterPtr &c1, ClusterPtr &c2, ClusterPtr &c3,
141 ClusterPtr &newcluster1, ClusterPtr &newcluster2) const;
142
143
156 CluVecIt _findRecoPartner(CluVecIt cl, ClusterVector & cv) const;
157
158 CluVecIt _findPartnerRapidity(CluVecIt cl, ClusterVector & cv) const;
159
160 CluVecIt _findPartnerBaryonic(CluVecIt cl, ClusterVector & cv,
161 bool & tetraCand,
162 const ClusterVector& a,
163 CluVecIt &baryonic1,
164 CluVecIt &baryonic2 ) const;
165
176 void _findbestreconnectionoption(std::vector<CluVecIt> &cls,
177 const unsigned &baryonic,
178 string &kind_of_reco,
179 int (&reco_info)[3]) const;
180
187 pair <ClusterPtr,ClusterPtr> _reconnect(ClusterPtr &c1, ClusterPtr &c2) const;
188
199 pair <ClusterPtr,ClusterPtr> _reconnect2Bto2B(ClusterPtr &c1, ClusterPtr &c2, const int s1, const int s2) const;
200
212 std::tuple <ClusterPtr, ClusterPtr, ClusterPtr> _reconnectBbarBto3M(ClusterPtr &c1, ClusterPtr &c2, const int s0, const int s1, const int s2 ) const;
213
225 std::tuple <ClusterPtr, ClusterPtr, ClusterPtr> _reconnect3Mto3M(ClusterPtr &c1, ClusterPtr &c2, ClusterPtr &c3, const int infos[3] ) const;
226
227
243 pair <ClusterPtr, ClusterPtr> _reconnectMBtoMB(ClusterPtr &c1, ClusterPtr &c2, const int s0) const;
244
245
246
247
261 bool _clustersFarApart( const std::vector<CluVecIt> & clu ) const;
262
269
270
277 void _2Bto2BreconnectionFinder(ClusterPtr &c1, ClusterPtr &c2, int &bswap1, int &bswap2, double mindisplsum, string &kind_of_reco ) const;
278
285 void _BbarBto3MreconnectionFinder(ClusterPtr &c1, ClusterPtr &c2, int &mswap0, int &mswap1, int &mswap2,
286 double min_displ_sum, string & kind_of_reco) const;
287
294 void _BMtoBMreconnectionfinder(ClusterPtr &c1, ClusterPtr &c2, int &swap,
295 double min_displ_sum, string &kind_of_reco) const;
296
303 void _3MtoXreconnectionfinder(std::vector<CluVecIt> &cv, int &swap0, int &swap1,
304 int &swap2, double min_displ_sum, string &kind_of_reco) const;
305
316 pair <int,int>
317 _shuffle(const PVector & q, const PVector & aq, unsigned maxtries = 10) const;
318
319
325 int _algorithm = 0;
326
330 int _clreco = 0;
331
335 int _debug = 0;
336
351
358 double _initTemp = 0.01;
359
365 double _annealingFactor = 0.21;
366
371 unsigned int _annealingSteps = 10;
372
378 double _triesPerStepFactor = 0.66;
379
384 double _preco = 0.5;
385
390 double _precoBaryonic = 0.5;
391
398 double _preco3M_3M = 0.5;
399
405 double _preco3M_BBbar = 0.5;
406
412 double _precoBbarB_3M = 0.5;
413
420 double _preco2B_2B = 0.5;
421
428 double _precoMB_MB = 0.5;
429
435 double _stepFactor = 5.0;
436
441
446 Length _maxDistance = femtometer;
447
452 bool _isColour8(tcPPtr p, tcPPtr q) const;
453
457 unsigned int _octetOption = 0;
458
463
468 int _prePlainCR = 0;
469
474 int _localCR = 0;
475
480 int _causalCR = 0;
481
482public:
483
491
497 void persistentInput(PersistentIStream & is, int version);
499
503 static void Init();
504
505protected:
506
513 virtual IBPtr clone() const;
514
519 virtual IBPtr fullclone() const;
521
522
523private:
524
529
530
531};
532
533
534}
535
536#endif /* HERWIG_ColourReconnector_H */
537
Class for changing colour reconnections of partons.
double _preco
Probability that a found reconnection possibility is actually accepted.
void _doRecoStatistical(ClusterVector &cv) const
A Metropolis-type algorithm which finds a local minimum in the total sum of cluster masses @arguments...
void _doRecoPlain(ClusterVector &cv) const
Plain colour reconnection as used in Herwig 2.5.0 @arguments cv cluster vector.
int _debug
Do we want debug informations?
int _causalCR
Option for colour reconnecting Clusters only if their spacetime difference is bigger than 0.
unsigned int _annealingSteps
Statistical Reco: Number of temperature steps in the statistical annealing algorithm.
bool _isColour8(tcPPtr p, tcPPtr q) const
pair< ClusterPtr, ClusterPtr > _reconnect(ClusterPtr &c1, ClusterPtr &c2) const
Reconnects the constituents of the given clusters to the (only) other possible cluster combination.
unsigned int _octetOption
Option for handling octets.
std::tuple< ClusterPtr, ClusterPtr, ClusterPtr > _reconnectBbarBto3M(ClusterPtr &c1, ClusterPtr &c2, const int s0, const int s1, const int s2) const
Reconnects (B,Bbar->3M) the constituents of the given clusters to another possible cluster combinatio...
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
bool _clustersFarApart(const std::vector< CluVecIt > &clu) const
Methods for the BaryonicMesonic CR algorithm Find the best reconnection option for the respective clu...
void _3MtoXreconnectionfinder(std::vector< CluVecIt > &cv, int &swap0, int &swap1, int &swap2, double min_displ_sum, string &kind_of_reco) const
finds the best reconnection option and stores it in swap0, swap1 and swap2 (3M->{3M,...
ColourReconnector & operator=(const ColourReconnector &)=delete
Private and non-existent assignment operator.
double _precoMB_MB
Probability that a found reconnection possibility is actually accepted.
void rearrange(ClusterVector &clusters)
Does the colour rearrangement, starting out from the list of particles in the event record and the co...
bool _containsColour8(const ClusterVector &cv, const vector< size_t > &P) const
Examines whether the cluster vector (under the given permutation of the antiquarks) contains colour-o...
double _displacementBaryonic(tcPPtr p1, tcPPtr p2, tcPPtr p3) const
calculates the "euclidean" distance of a the 3 (anti)quarks (anti)baryonic cluster in the rapdidity-p...
double _displacement(tcPPtr p, tcPPtr q) const
calculates the "euclidean" distance of two quarks in the rapdidity-phi plane @arguments p,...
CluVecIt _findRecoPartner(CluVecIt cl, ClusterVector &cv) const
Finds the cluster in cv which, if reconnected with the given cluster cl, would result in the smallest...
void _BbarBto3MreconnectionFinder(ClusterPtr &c1, ClusterPtr &c2, int &mswap0, int &mswap1, int &mswap2, double min_displ_sum, string &kind_of_reco) const
finds the best reconnection option and stores it in mswap0 mswap1 and mswap2 (BbarB->3M colour reconn...
void _doReco2BeamClusters(ClusterVector &cv) const
Does reconnect 2 beam clusters for BaryonicMesonic CR model if option CR2BeamClusters is enabled @arg...
double _initTemp
Statistical Reco: Factor used to determine the initial temperature according to InitialTemperature = ...
virtual IBPtr clone() const
Make a simple clone of this object.
pair< int, int > _shuffle(const PVector &q, const PVector &aq, unsigned maxtries=10) const
At random, swap two antiquarks, if not excluded by the constraint that there must not be any colour-o...
void _doRecoBaryonic(ClusterVector &cv) const
Baryonic Colour Reconnection model.
double _stepFactor
For the BaryonicMesonic algorithm How many times do suggest cluster for reconnection?...
Length _maxDistance
Maximium distance for reconnections TODO: remove if issues with anticausality are discussed and resol...
pair< ClusterPtr, ClusterPtr > _reconnect2Bto2B(ClusterPtr &c1, ClusterPtr &c2, const int s1, const int s2) const
Reconnects (2B->2B) the constituents of the given clusters to another possible cluster combination wh...
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
pair< ClusterPtr, ClusterPtr > _reconnectMBtoMB(ClusterPtr &c1, ClusterPtr &c2, const int s0) const
Reconnection method for a Baryonic and a Mesonic Cluster to a Baryonic and a Mesonic Cluster s0 is th...
std::tuple< ClusterPtr, ClusterPtr, ClusterPtr > _reconnect3Mto3M(ClusterPtr &c1, ClusterPtr &c2, ClusterPtr &c3, const int infos[3]) const
Reconnects (3M->3M) the constituents of the given clusters to another possible cluster combination wh...
int _cr2BeamClusters
Option for colour reconnecting 2 Beam Clusters if no others are present.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
double _preco2B_2B
Probability that a found reconnection possibility is actually accepted.
double _precoBbarB_3M
Probability that a found reconnection possibility is actually accepted.
void _doRecoBaryonicMesonic(ClusterVector &cv) const
BaryonicMesonic colour reconnection model @arguments cv cluster vector BaryonicMesonic Colour Reconne...
Energy2 _clusterMassSum(const PVector &q, const PVector &aq) const
PRIVATE MEMBER FUNCTIONS.
int _junctionMBCR
Junction-like model for BaryonicMesonic model Do we want to use the junction-like model for computing...
double _precoBaryonic
Probability that a found reconnection possibility is actually accepted.
double _preco3M_3M
Probability that a found reconnection possibility is actually accepted.
static void Init()
Standard Init function used to initialize the interfaces.
void _BMtoBMreconnectionfinder(ClusterPtr &c1, ClusterPtr &c2, int &swap, double min_displ_sum, string &kind_of_reco) const
finds the best reconnection option and stores it in swap (BM->BM colour reconnection) @arguments c1 a...
double _triesPerStepFactor
Statistical Reco: The number of tries per temperature steps is the number of clusters times this fact...
int _localCR
Option for colour reconnecting Clusters only if their vertex 3-distance is less than _maxDistance.
int _clreco
Do we do colour reconnections?
void _findbestreconnectionoption(std::vector< CluVecIt > &cls, const unsigned &baryonic, string &kind_of_reco, int(&reco_info)[3]) const
Finds best CR option for the BaryonicMesonic CR model @arguments cls vector of selected clusters,...
double _mesonToBaryonFactor
Factor for comparing mesonic clusters to baryonic clusters.
double _annealingFactor
Statistical Reco: The annealing factor is the ratio of two successive temperature steps: T_n = anneal...
double _preco3M_BBbar
Probability that a found reconnection possibility is actually accepted.
void _2Bto2BreconnectionFinder(ClusterPtr &c1, ClusterPtr &c2, int &bswap1, int &bswap2, double mindisplsum, string &kind_of_reco) const
finds the best reconnection option and stores it in bswap1 and bswap2 (2B->2B colour reconnection) @a...
int _prePlainCR
Option for performing Plain colour reconnection before the Statistical, Baryonic or BaryonicMesonic a...
vector< ClusterPtr > ClusterVector
This file contains the typedef declarations used in Hadronization.
Definition: CluHadConfig.h:38
-*- C++ -*-
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::Ptr< Particle >::transient_const_pointer tcPPtr
vector< PPtr > PVector