herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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
17namespace Herwig {
18
19using 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
33
34public:
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
57public:
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
90 BaseRepository::PushDirectory(HERWIG_MatchboxDipoles);
91
92 typename Ptr<DipoleT>::ptr dip = new_ptr(DipoleT());
93 dip->tildeKinematics(tilde);
94 dip->invertedTildeKinematics(itilde);
96
97 theDipoles(id).push_back(dip);
98
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
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
136
137 }
138
139private:
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
Repository of known subtraction dipoles.
static const vector< Ptr< MatchboxInsertionOperator >::ptr > & insertionPKOperators(int id)
Return the known PK insertion operators.
static void registerDipole(string name, string tildeName, string invertedTildeName)
Register a dipole with associated tilde kinematics.
static vector< Ptr< MatchboxInsertionOperator >::ptr > & theInsertionIOperators(int id)
The known I insertion operators.
static const vector< Ptr< SubtractionDipole >::ptr > & dipoles(int id)
Return the known dipoles.
static bool & initialized()
True, if initialized.
static const vector< Ptr< MatchboxInsertionOperator >::ptr > & insertionIOperators(int id)
Return the known I insertion operators.
static vector< Ptr< SubtractionDipole >::ptr > & theDipoles(int id)
The known dipoles.
static void registerInsertionIOperator(string name)
Register an I insertion operator.
static vector< Ptr< MatchboxInsertionOperator >::ptr > & theInsertionPKOperators(int id)
The known PK insertion operators.
static void registerInsertionPKOperator(string name)
Register an PK insertion operator.
static void setup()
Setup directories in the repository.
static void PopDirectory()
static void PushDirectory(string name)
static IBPtr GetPointer(string)
static void Register(const InterfaceBase &, const type_info &)
-*- C++ -*-