herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Hadronization
HadronSelector.h
1
// -*- C++ -*-
2
//
3
// HadronSelector.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_HadronSelector_H
10
#define HERWIG_HadronSelector_H
11
//
12
// This is the declaration of the HadronSelector class.
13
//
14
15
#include "ThePEG/Interface/Interfaced.h"
16
#include <ThePEG/Persistency/PersistentOStream.h>
17
#include <ThePEG/Persistency/PersistentIStream.h>
18
#include <ThePEG/PDT/ParticleData.h>
19
#include <
ThePEG/PDT/StandardMatchers.h
>
20
#include <ThePEG/Repository/EventGenerator.h>
21
#include "HadronSelector.fh"
22
#include "HadronInfo.h"
23
#include "Kupco.h"
24
#include <tuple>
25
26
namespace
Herwig
{
27
28
using namespace
ThePEG
;
29
51
class
HadronSelector
:
public
Interfaced
{
52
53
public
:
54
58
HadronSelector
(
unsigned
int
);
59
68
virtual
tcPDPair
chooseHadronPair
(
const
Energy cluMass,
69
tcPDPtr
par1,
tcPDPtr
par2)
const
;
70
78
tcPDPtr
chooseSingleHadron
(
tcPDPtr
par1,
tcPDPtr
par2, Energy mass)
const
;
79
109
tcPDPair
lightestHadronPair
(
tcPDPtr
ptr1,
tcPDPtr
ptr2)
const
;
110
116
Energy
massLightestHadronPair
(
tcPDPtr
ptr1,
tcPDPtr
ptr2)
const
{
117
map<pair<long,long>,
tcPDPair
>::const_iterator lightest =
118
lightestHadrons_
.find(make_pair(abs(ptr1->id()),abs(ptr2->id())));
119
if
(lightest!=
lightestHadrons_
.end())
120
return
lightest->second.first->mass()+lightest->second.second->mass();
121
else
122
return
ZERO
;
123
}
124
133
tcPDPtr
lightestHadron
(
tcPDPtr
ptr1,
tcPDPtr
ptr2)
const
;
134
145
vector<pair<tcPDPtr,double> >
146
hadronsBelowThreshold
(Energy threshold,
147
tcPDPtr
ptr1,
tcPDPtr
ptr2)
const
;
148
154
Energy
massLightestHadron
(
tcPDPtr
ptr1,
tcPDPtr
ptr2)
const
{
155
// find entry in the table
156
pair<long,long> ids(abs(ptr1->id()),abs(ptr2->id()));
157
HadronTable::const_iterator tit=
_table
.find(ids);
158
// throw exception if flavours wrong
159
if
(tit==
_table
.end()||tit->second.empty())
160
throw
Exception
() <<
"HadronSelector::massLightestHadron "
161
<<
"failed for particle"
<< ptr1->id() <<
" "
162
<< ptr2->id()
163
<<
Exception::eventerror
;
164
// return the mass
165
return
tit->second.begin()->mass;
166
}
167
171
double
pwt
(
long
pid)
const
{
172
map<long,double>::const_iterator it =
_pwt
.find(abs(pid));
173
assert( it !=
_pwt
.end() );
174
return
it->second;
175
}
176
180
virtual
std::tuple<bool,bool,bool>
selectBaryon
(
const
Energy cluMass,
tcPDPtr
par1,
tcPDPtr
par2)
const
;
181
185
virtual
double
strangeWeight
(
const
Energy cluMass,
tcPDPtr
par1,
tcPDPtr
par2)
const
;
186
193
virtual
PDPtr
makeDiquark
(
tcPDPtr
par1,
tcPDPtr
par2);
194
195
public
:
196
203
void
persistentOutput
(
PersistentOStream
& os)
const
;
204
210
void
persistentInput
(
PersistentIStream
& is,
int
version);
212
219
static
void
Init
();
220
221
protected
:
222
235
virtual
void
doinit
();
237
238
protected
:
239
248
void
insertToHadronTable
(
tPDPtr
&particle,
int
flav1,
int
flav2);
249
288
virtual
void
constructHadronTable
();
289
293
const
HadronTable
&
table
()
const
{
294
return
_table
;
295
}
296
300
HadronTable
&
table
() {
301
return
_table
;
302
}
303
307
const
vector<PDPtr> &
partons
()
const
{
308
return
_partons
;
309
}
310
314
vector<PDPtr> &
partons
() {
315
return
_partons
;
316
}
317
321
map<long,double> &
pwt
() {
322
return
_pwt
;
323
}
324
351
double
probabilityMixing
(
const
double
angleMix,
352
const
int
order)
const
{
353
static
double
convert=
Constants::pi
/180.0;
354
if
(order == 1)
355
return
sqr
( cos( angleMix*convert + atan(
sqrt
(2.0) ) ) );
356
else
if
(order == 2)
357
return
sqr
( sin( angleMix*convert + atan(
sqrt
(2.0) ) ) );
358
else
359
return
1.;
360
}
361
366
virtual
double
mixingStateWeight
(
long
id
)
const
;
368
373
double
specialWeight
(
long
id
)
const
{
374
const
int
pspin =
id
% 10;
375
// Only K0L and K0S have pspin == 0, should
376
// not get them until Decay step
377
assert( pspin != 0 );
378
// Baryon : J = 1/2 or 3/2
379
if
(pspin%2==0)
380
return
baryonWeight
(
id
);
381
// Meson
382
else
383
return
mesonWeight
(
id
);
384
}
385
389
virtual
double
mesonWeight
(
long
id
)
const
;
390
394
virtual
double
baryonWeight
(
long
id
)
const
= 0;
395
401
int
signHadron
(
tcPDPtr
ptr1,
tcPDPtr
ptr2,
tcPDPtr
hadron)
const
;
402
406
virtual
void
insertMeson
(
HadronInfo
a,
int
flav1,
int
flav2);
407
411
virtual
void
insertOneHalf
(
HadronInfo
a,
int
flav1,
int
flav2);
412
416
virtual
void
insertThreeHalf
(
HadronInfo
a,
int
flav1,
int
flav2);
417
418
private
:
419
424
HadronSelector
&
operator=
(
const
HadronSelector
&) =
delete
;
425
426
private
:
427
431
vector<PDPtr>
_partons
;
432
436
vector<PDPtr>
_forbidden
;
437
441
map<long,double>
_pwt
;
442
450
double
_etamix
;
451
455
double
_phimix
;
456
460
double
_h1mix
;
461
465
double
_f0mix
;
466
470
double
_f1mix
;
471
475
double
_f2mix
;
476
480
double
_eta2mix
;
481
485
double
_omhmix
;
486
490
double
_ph3mix
;
491
495
double
_eta2Smix
;
496
500
double
_phi2Smix
;
502
511
vector<double>
_weight1S0
;
512
516
vector<double>
_weight3S1
;
517
521
vector<double>
_weight1P1
;
522
526
vector<double>
_weight3P0
;
527
531
vector<double>
_weight3P1
;
532
536
vector<double>
_weight3P2
;
537
541
vector<double>
_weight1D2
;
542
546
vector<double>
_weight3D1
;
547
551
vector<double>
_weight3D2
;
552
556
vector<double>
_weight3D3
;
558
562
vector<vector<vector<double> > >
_repwt
;
563
567
HadronTable
_table
;
568
576
enum
MesonMultiplets
{ Lmax = 3, Jmax = 4, Nmax = 4};
578
582
unsigned
int
_topt
;
583
587
unsigned
int
_trial
;
588
597
double
_limBottom;
598
double
_limCharm;
599
double
_limExotic;
601
605
unsigned
int
belowThreshold_
;
606
614
map<pair<long,long>,
tcPDPair
>
lightestHadrons_
;
616
};
617
618
619
}
620
621
#endif
/* HERWIG_HadronSelector_H */
StandardMatchers.h
Herwig::HadronInfo
Class used to store all the hadron information for easy access.
Definition:
HadronInfo.h:25
Herwig::HadronSelector
This class selects the hadron flavours of a cluster decay.
Definition:
HadronSelector.h:51
Herwig::HadronSelector::chooseHadronPair
virtual tcPDPair chooseHadronPair(const Energy cluMass, tcPDPtr par1, tcPDPtr par2) const
Method to return a pair of hadrons given the PDG codes of two or three constituents.
Herwig::HadronSelector::_weight3P1
vector< double > _weight3P1
The weights for the multiplets.
Definition:
HadronSelector.h:531
Herwig::HadronSelector::_partons
vector< PDPtr > _partons
The PDG codes of the constituent particles allowed.
Definition:
HadronSelector.h:431
Herwig::HadronSelector::strangeWeight
virtual double strangeWeight(const Energy cluMass, tcPDPtr par1, tcPDPtr par2) const
Strange quark weight.
Herwig::HadronSelector::baryonWeight
virtual double baryonWeight(long id) const =0
Weights for baryons.
Herwig::HadronSelector::belowThreshold_
unsigned int belowThreshold_
Option for the selection of hadrons below the pair threshold.
Definition:
HadronSelector.h:605
Herwig::HadronSelector::table
const HadronTable & table() const
Access to the table of hadrons.
Definition:
HadronSelector.h:293
Herwig::HadronSelector::pwt
map< long, double > & pwt()
Access the parton weights.
Definition:
HadronSelector.h:321
Herwig::HadronSelector::mixingStateWeight
virtual double mixingStateWeight(long id) const
Returns the weight of given mixing state.
Herwig::HadronSelector::_etamix
double _etamix
The mixing angles for the mesons containing light quarks.
Definition:
HadronSelector.h:450
Herwig::HadronSelector::_eta2mix
double _eta2mix
The mixing angle.
Definition:
HadronSelector.h:480
Herwig::HadronSelector::MesonMultiplets
MesonMultiplets
Enums so arrays can be statically allocated.
Definition:
HadronSelector.h:576
Herwig::HadronSelector::lightestHadronPair
tcPDPair lightestHadronPair(tcPDPtr ptr1, tcPDPtr ptr2) const
This returns the lightest pair of hadrons given by the flavours.
Herwig::HadronSelector::_weight1S0
vector< double > _weight1S0
The weights for the various meson multiplets to be used to supress the production of particular state...
Definition:
HadronSelector.h:511
Herwig::HadronSelector::insertThreeHalf
virtual void insertThreeHalf(HadronInfo a, int flav1, int flav2)
Insert a spin baryon in the table.
Herwig::HadronSelector::_f0mix
double _f0mix
The mixing angle.
Definition:
HadronSelector.h:465
Herwig::HadronSelector::_f1mix
double _f1mix
The mixing angle.
Definition:
HadronSelector.h:470
Herwig::HadronSelector::_trial
unsigned int _trial
Which particles to produce for debugging purposes.
Definition:
HadronSelector.h:587
Herwig::HadronSelector::HadronSelector
HadronSelector(unsigned int)
The default constructor.
Herwig::HadronSelector::_weight3D2
vector< double > _weight3D2
The weights for the multiplets.
Definition:
HadronSelector.h:551
Herwig::HadronSelector::specialWeight
double specialWeight(long id) const
Calculates a special weight specific to a given hadron.
Definition:
HadronSelector.h:373
Herwig::HadronSelector::chooseSingleHadron
tcPDPtr chooseSingleHadron(tcPDPtr par1, tcPDPtr par2, Energy mass) const
Select the single hadron for a cluster decay return null pointer if not a single hadron decay.
Herwig::HadronSelector::insertMeson
virtual void insertMeson(HadronInfo a, int flav1, int flav2)
Insert a meson in the table.
Herwig::HadronSelector::massLightestHadronPair
Energy massLightestHadronPair(tcPDPtr ptr1, tcPDPtr ptr2) const
Returns the mass of the lightest pair of hadrons with the given particles.
Definition:
HadronSelector.h:116
Herwig::HadronSelector::lightestHadron
tcPDPtr lightestHadron(tcPDPtr ptr1, tcPDPtr ptr2) const
Returns the lightest hadron formed by the given particles.
Herwig::HadronSelector::operator=
HadronSelector & operator=(const HadronSelector &)=delete
The assignment operator is private and must never be called.
Herwig::HadronSelector::insertToHadronTable
void insertToHadronTable(tPDPtr &particle, int flav1, int flav2)
A sub-function of HadronSelector::constructHadronTable().
Herwig::HadronSelector::_repwt
vector< vector< vector< double > > > _repwt
The weights for the excited meson multiplets.
Definition:
HadronSelector.h:562
Herwig::HadronSelector::_omhmix
double _omhmix
The mixing angle.
Definition:
HadronSelector.h:485
Herwig::HadronSelector::_weight3S1
vector< double > _weight3S1
The weights for the multiplets.
Definition:
HadronSelector.h:516
Herwig::HadronSelector::_weight3D1
vector< double > _weight3D1
The weights for the multiplets.
Definition:
HadronSelector.h:546
Herwig::HadronSelector::_weight3P2
vector< double > _weight3P2
The weights for the multiplets.
Definition:
HadronSelector.h:536
Herwig::HadronSelector::_eta2Smix
double _eta2Smix
The mixing angle.
Definition:
HadronSelector.h:495
Herwig::HadronSelector::_phimix
double _phimix
The mixing angle.
Definition:
HadronSelector.h:455
Herwig::HadronSelector::mesonWeight
virtual double mesonWeight(long id) const
Weights for mesons.
Herwig::HadronSelector::partons
vector< PDPtr > & partons()
Access to the list of partons.
Definition:
HadronSelector.h:314
Herwig::HadronSelector::_weight1D2
vector< double > _weight1D2
The weights for the multiplets.
Definition:
HadronSelector.h:541
Herwig::HadronSelector::_weight1P1
vector< double > _weight1P1
The weights for the multiplets.
Definition:
HadronSelector.h:521
Herwig::HadronSelector::table
HadronTable & table()
Access to the table of hadrons.
Definition:
HadronSelector.h:300
Herwig::HadronSelector::_topt
unsigned int _topt
Option for the construction of the tables.
Definition:
HadronSelector.h:582
Herwig::HadronSelector::lightestHadrons_
map< pair< long, long >, tcPDPair > lightestHadrons_
Caches of lightest pairs for speed.
Definition:
HadronSelector.h:614
Herwig::HadronSelector::constructHadronTable
virtual void constructHadronTable()
Construct the table of hadron data This is the main method to initialize the hadron data (mainly the ...
Herwig::HadronSelector::_ph3mix
double _ph3mix
The mixing angle.
Definition:
HadronSelector.h:490
Herwig::HadronSelector::probabilityMixing
double probabilityMixing(const double angleMix, const int order) const
Methods for the mixing of mesons.
Definition:
HadronSelector.h:351
Herwig::HadronSelector::hadronsBelowThreshold
vector< pair< tcPDPtr, double > > hadronsBelowThreshold(Energy threshold, tcPDPtr ptr1, tcPDPtr ptr2) const
Returns the hadrons below the constituent mass threshold formed by the given particles,...
Herwig::HadronSelector::signHadron
int signHadron(tcPDPtr ptr1, tcPDPtr ptr2, tcPDPtr hadron) const
This method returns the proper sign ( > 0 hadron; < 0 anti-hadron ) for the input PDG id idHad > 0,...
Herwig::HadronSelector::pwt
double pwt(long pid) const
Access the parton weights.
Definition:
HadronSelector.h:171
Herwig::HadronSelector::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::HadronSelector::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::HadronSelector::_weight3D3
vector< double > _weight3D3
The weights for the multiplets.
Definition:
HadronSelector.h:556
Herwig::HadronSelector::partons
const vector< PDPtr > & partons() const
Access to the list of partons.
Definition:
HadronSelector.h:307
Herwig::HadronSelector::_weight3P0
vector< double > _weight3P0
The weights for the multiplets.
Definition:
HadronSelector.h:526
Herwig::HadronSelector::_table
HadronTable _table
The table of hadron data.
Definition:
HadronSelector.h:567
Herwig::HadronSelector::makeDiquark
virtual PDPtr makeDiquark(tcPDPtr par1, tcPDPtr par2)
Return the particle data of the diquark (anti-diquark) made by the two quarks (antiquarks) par1,...
Herwig::HadronSelector::_pwt
map< long, double > _pwt
Weights for quarks and diquarks.
Definition:
HadronSelector.h:441
Herwig::HadronSelector::selectBaryon
virtual std::tuple< bool, bool, bool > selectBaryon(const Energy cluMass, tcPDPtr par1, tcPDPtr par2) const
Force baryon/meson selection.
Herwig::HadronSelector::insertOneHalf
virtual void insertOneHalf(HadronInfo a, int flav1, int flav2)
Insert a spin baryon in the table.
Herwig::HadronSelector::_forbidden
vector< PDPtr > _forbidden
The PDG codes of the hadrons which cannot be produced in the hadronization.
Definition:
HadronSelector.h:436
Herwig::HadronSelector::_phi2Smix
double _phi2Smix
The mixing angle.
Definition:
HadronSelector.h:500
Herwig::HadronSelector::_h1mix
double _h1mix
The mixing angle.
Definition:
HadronSelector.h:460
Herwig::HadronSelector::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::HadronSelector::_f2mix
double _f2mix
The mixing angle.
Definition:
HadronSelector.h:475
Herwig::HadronSelector::massLightestHadron
Energy massLightestHadron(tcPDPtr ptr1, tcPDPtr ptr2) const
Return the nominal mass of the hadron returned by lightestHadron()
Definition:
HadronSelector.h:154
Herwig::HadronSelector::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
ThePEG::Exception
ThePEG::Exception::eventerror
eventerror
ThePEG::Interfaced
ThePEG::PersistentIStream
ThePEG::PersistentOStream
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
Herwig::HadronTable
map< pair< long, long >, KupcoData > HadronTable
The hadron table type.
Definition:
HadronInfo.h:136
ThePEG::Constants::pi
constexpr double pi
ThePEG
ThePEG::tPDPtr
ThePEG::Ptr< ParticleData >::transient_pointer tPDPtr
ThePEG::sqrt
double sqrt(int x)
ThePEG::tcPDPair
pair< tcPDPtr, tcPDPtr > tcPDPair
ThePEG::ZERO
constexpr ZeroUnit ZERO
ThePEG::tcPDPtr
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
ThePEG::PDPtr
ThePEG::Ptr< ParticleData >::pointer PDPtr
ThePEG::sqr
constexpr auto sqr(const T &x) -> decltype(x *x)
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6