herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
Matchbox
Base
DipoleRepository.h
1
// -*- C++ -*-
2
//
3
// DipoleRepository.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_DipoleRepository_H
10
#define HERWIG_DipoleRepository_H
11
12
#include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.h"
13
#include "Herwig/MatrixElement/Matchbox/InsertionOperators/MatchboxInsertionOperator.h"
14
#include "ThePEG/Repository/BaseRepository.h"
15
#include "ThePEG/Pointer/Ptr.h"
16
17
namespace
Herwig
{
18
19
using namespace
ThePEG
;
20
21
#define HERWIG_MatchboxDipoles "/Herwig/MatrixElements/Matchbox/Dipoles/"
22
#define HERWIG_MatchboxTildes "/Herwig/MatrixElements/Matchbox/TildeKinematics/"
23
#define HERWIG_MatchboxInsertionIOperators "/Herwig/MatrixElements/Matchbox/InsertionIOperators/"
24
#define HERWIG_MatchboxInsertionPKOperators "/Herwig/MatrixElements/Matchbox/InsertionPKOperators/"
25
32
class
DipoleRepository
{
33
34
public
:
35
39
static
const
vector<Ptr<SubtractionDipole>::ptr>&
dipoles
(
int
id
) {
40
return
theDipoles
(
id
);
41
}
42
46
static
const
vector<Ptr<MatchboxInsertionOperator>::ptr>&
insertionIOperators
(
int
id
) {
47
return
theInsertionIOperators
(
id
);
48
}
49
53
static
const
vector<Ptr<MatchboxInsertionOperator>::ptr>&
insertionPKOperators
(
int
id
) {
54
return
theInsertionPKOperators
(
id
);
55
}
56
57
public
:
58
62
template
<
int
id
,
class
DipoleT,
class
TildeKinematicsT,
class
InvertedTildeKinematicsT>
63
static
void
registerDipole
(
string
name,
string
tildeName,
string
invertedTildeName) {
64
65
setup
();
66
67
BaseRepository::PushDirectory
(HERWIG_MatchboxTildes);
68
69
typename
Ptr<TildeKinematicsT>::ptr tilde;
70
if
( !
BaseRepository::GetPointer
(HERWIG_MatchboxTildes + tildeName) ) {
71
tilde = new_ptr(TildeKinematicsT());
72
BaseRepository::Register
(tilde,tildeName);
73
}
else
{
74
tilde =
75
dynamic_ptr_cast<typename Ptr<TildeKinematicsT>::ptr>
76
(
BaseRepository::GetPointer
(HERWIG_MatchboxTildes + tildeName));
77
}
78
79
typename
Ptr<InvertedTildeKinematicsT>::ptr itilde;
80
if
( !
BaseRepository::GetPointer
(HERWIG_MatchboxTildes + invertedTildeName) ) {
81
itilde = new_ptr(InvertedTildeKinematicsT());
82
BaseRepository::Register
(itilde,invertedTildeName);
83
}
else
{
84
itilde =
85
dynamic_ptr_cast<typename Ptr<InvertedTildeKinematicsT>::ptr>
86
(
BaseRepository::GetPointer
(HERWIG_MatchboxTildes + invertedTildeName));
87
}
88
89
BaseRepository::PopDirectory
();
90
BaseRepository::PushDirectory
(HERWIG_MatchboxDipoles);
91
92
typename
Ptr<DipoleT>::ptr dip = new_ptr(DipoleT());
93
dip->tildeKinematics(tilde);
94
dip->invertedTildeKinematics(itilde);
95
BaseRepository::Register
(dip,name);
96
97
theDipoles
(
id
).push_back(dip);
98
99
BaseRepository::PopDirectory
();
100
101
}
102
106
template
<
int
id
,
class
InsertionOperatorT>
107
static
void
registerInsertionIOperator
(
string
name) {
108
109
setup
();
110
111
BaseRepository::PushDirectory
(HERWIG_MatchboxInsertionIOperators);
112
typename
Ptr<InsertionOperatorT>::ptr iop = new_ptr(InsertionOperatorT());
113
BaseRepository::Register
(iop,name);
114
115
theInsertionIOperators
(
id
).push_back(iop);
116
117
BaseRepository::PopDirectory
();
118
119
}
120
124
template
<
int
id
,
class
InsertionOperatorT>
125
static
void
registerInsertionPKOperator
(
string
name) {
126
127
setup
();
128
129
BaseRepository::PushDirectory
(HERWIG_MatchboxInsertionPKOperators);
130
typename
Ptr<InsertionOperatorT>::ptr iop = new_ptr(InsertionOperatorT());
131
BaseRepository::Register
(iop,name);
132
133
theInsertionPKOperators
(
id
).push_back(iop);
134
135
BaseRepository::PopDirectory
();
136
137
}
138
139
private
:
140
144
static
vector<Ptr<SubtractionDipole>::ptr>&
theDipoles
(
int
id
);
145
149
static
vector<Ptr<MatchboxInsertionOperator>::ptr>&
theInsertionIOperators
(
int
id
);
150
154
static
vector<Ptr<MatchboxInsertionOperator>::ptr>&
theInsertionPKOperators
(
int
id
);
155
159
static
bool
&
initialized
();
160
164
static
void
setup
();
165
166
};
167
168
}
169
170
#endif
// HERWIG_DipoleRepository_H
Herwig::DipoleRepository
Repository of known subtraction dipoles.
Definition:
DipoleRepository.h:32
Herwig::DipoleRepository::insertionPKOperators
static const vector< Ptr< MatchboxInsertionOperator >::ptr > & insertionPKOperators(int id)
Return the known PK insertion operators.
Definition:
DipoleRepository.h:53
Herwig::DipoleRepository::registerDipole
static void registerDipole(string name, string tildeName, string invertedTildeName)
Register a dipole with associated tilde kinematics.
Definition:
DipoleRepository.h:63
Herwig::DipoleRepository::theInsertionIOperators
static vector< Ptr< MatchboxInsertionOperator >::ptr > & theInsertionIOperators(int id)
The known I insertion operators.
Herwig::DipoleRepository::dipoles
static const vector< Ptr< SubtractionDipole >::ptr > & dipoles(int id)
Return the known dipoles.
Definition:
DipoleRepository.h:39
Herwig::DipoleRepository::initialized
static bool & initialized()
True, if initialized.
Herwig::DipoleRepository::insertionIOperators
static const vector< Ptr< MatchboxInsertionOperator >::ptr > & insertionIOperators(int id)
Return the known I insertion operators.
Definition:
DipoleRepository.h:46
Herwig::DipoleRepository::theDipoles
static vector< Ptr< SubtractionDipole >::ptr > & theDipoles(int id)
The known dipoles.
Herwig::DipoleRepository::registerInsertionIOperator
static void registerInsertionIOperator(string name)
Register an I insertion operator.
Definition:
DipoleRepository.h:107
Herwig::DipoleRepository::theInsertionPKOperators
static vector< Ptr< MatchboxInsertionOperator >::ptr > & theInsertionPKOperators(int id)
The known PK insertion operators.
Herwig::DipoleRepository::registerInsertionPKOperator
static void registerInsertionPKOperator(string name)
Register an PK insertion operator.
Definition:
DipoleRepository.h:125
Herwig::DipoleRepository::setup
static void setup()
Setup directories in the repository.
ThePEG::BaseRepository::PopDirectory
static void PopDirectory()
ThePEG::BaseRepository::PushDirectory
static void PushDirectory(string name)
ThePEG::BaseRepository::GetPointer
static IBPtr GetPointer(string)
ThePEG::BaseRepository::Register
static void Register(const InterfaceBase &, const type_info &)
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6