herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
FxFx
FxFxEventHandler.h
1
// -*- C++ -*-
2
//
3
// FxFxEventHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG 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 THEPEG_FxFxEventHandler_H
10
#define THEPEG_FxFxEventHandler_H
11
//
12
// This is the declaration of the FxFxEventHandler class.
13
//
14
15
#include "ThePEG/Handlers/EventHandler.h"
16
#include "FxFxEventHandler.fh"
17
#include "FxFxReader.fh"
18
#include "ThePEG/Utilities/CompSelector.h"
19
#include "ThePEG/Utilities/XSecStat.h"
20
21
namespace
ThePEG
{
22
40
class
FxFxEventHandler
:
public
EventHandler
{
41
42
public
:
43
47
typedef
vector<FxFxReaderPtr>
ReaderVector
;
48
52
typedef
CompSelector<int,CrossSection>
ReaderSelector
;
53
57
enum
WeightOpt
{
58
unitweight
= 1,
59
unitnegweight
= -1,
60
varweight
= 2,
61
varnegweight
= -2
62
};
63
64
friend
class
FxFxHandler;
65
66
67
public
:
68
72
FxFxEventHandler
()
73
:
theWeightOption
(
unitweight
),
theUnitTolerance
(1.0e-6),
warnPNum
(true),
theNormWeight
(0),
UseLHEEvent
(0)
74
{
75
selector
().
tolerance
(
unitTolerance
());
76
}
77
78
public
:
79
86
virtual
void
initialize
();
87
92
virtual
void
statistics
(ostream &)
const
;
93
99
virtual
CrossSection
histogramScale
()
const
;
100
106
virtual
CrossSection
integratedXSec
()
const
;
107
108
virtual
int
ntriesinternal()
const
;
109
115
virtual
CrossSection
integratedXSecErr
()
const
;
116
117
virtual
map<string,CrossSection> optintegratedXSecMap()
const
;
118
120
126
virtual
EventPtr
generateEvent
();
127
132
virtual
tCollPtr
performCollision
();
133
138
virtual
EventPtr
continueEvent
();
140
149
void
select
(
double
weight);
150
155
void
accept
();
156
161
void
reject
(
double
weight);
162
166
void
increaseMaxXSec
(CrossSection maxxsec);
167
172
void
skipEvents
();
173
175
181
WeightOpt
weightOption
()
const
{
return
theWeightOption
; }
182
187
double
unitTolerance
()
const
{
return
theUnitTolerance
; }
188
192
const
ReaderVector
&
readers
()
const
{
return
theReaders
; }
193
198
const
ReaderSelector
&
selector
()
const
{
return
theSelector
; }
199
203
tFxFxReaderPtr
currentReader
()
const
{
return
theCurrentReader
; }
204
205
209
void
currentReader
(tFxFxReaderPtr x) {
theCurrentReader
= x; }
210
212
213
public
:
214
221
void
persistentOutput
(
PersistentOStream
& os)
const
;
222
228
void
persistentInput
(
PersistentIStream
& is,
int
version);
230
237
static
void
Init
();
238
242
tFxFxReaderPtr
theCurrentReader
;
243
244
245
246
protected
:
247
254
virtual
IBPtr
clone
()
const
;
255
260
virtual
IBPtr
fullclone
()
const
;
262
263
protected
:
264
272
virtual
void
doinit
();
273
278
virtual
void
doinitrun
();
279
284
virtual
void
dofinish
();
286
287
protected
:
288
292
ReaderVector
&
readers
() {
return
theReaders
; }
293
298
ReaderSelector
&
selector
() {
return
theSelector
; }
299
303
void
setUnitTolerance
(
double
);
304
308
XSecStat
stats
;
309
310
map<string,XSecStat> optstats;
311
312
map<string,CrossSection> optxs;
313
314
int
ntries;
315
316
map<string,XSecStat> OptStatsFunc() {
return
optstats; }
317
318
map<string,CrossSection> OptXsFunc() {
return
optxs; }
319
320
325
XSecStat
histStats
;
326
327
map<string,XSecStat> opthistStats;
328
329
330
/*
331
* The weight identifiers for the events
332
*/
333
334
vector<string> weightnames;
335
336
private
:
337
341
ReaderVector
theReaders
;
342
347
ReaderSelector
theSelector
;
348
352
WeightOpt
theWeightOption
;
353
358
double
theUnitTolerance
;
359
360
365
bool
warnPNum
;
366
370
unsigned
int
theNormWeight
;
371
375
unsigned
int
UseLHEEvent
;
376
377
378
public
:
379
384
class
FxFxInitError:
public
InitException {};
385
390
class
FxFxPNumException:
public
InitException {};
393
private
:
394
399
static
ClassDescription<FxFxEventHandler>
initFxFxEventHandler
;
400
405
FxFxEventHandler
&
operator=
(
const
FxFxEventHandler
&) =
delete
;
406
407
};
408
409
}
410
411
// CLASSDOC OFF
412
413
#include "ThePEG/Utilities/ClassTraits.h"
414
415
namespace
ThePEG
{
416
421
template
<>
422
struct
BaseClassTrait<FxFxEventHandler,1> {
424
typedef
EventHandler
NthBase
;
425
};
426
429
template
<>
430
struct
ClassTraits<FxFxEventHandler>
431
:
public
ClassTraitsBase<FxFxEventHandler> {
433
static
string
className
() {
return
"Herwig::FxFxEventHandler"
; }
437
static
string
library
() {
return
"HwFxFx.so"
; }
438
};
439
442
}
443
444
#endif
/* THEPEG_FxFxEventHandler_H */
ThePEG::ClassDescription
ThePEG::CompSelector
ThePEG::CompSelector::tolerance
void tolerance(double t)
ThePEG::EventHandler
ThePEG::FxFxEventHandler
The FxFxEventHandler inherits from the general EventHandler class and administers the reading of even...
Definition:
FxFxEventHandler.h:40
ThePEG::FxFxEventHandler::statistics
virtual void statistics(ostream &) const
Write out accumulated statistics about intergrated cross sections and stuff.
ThePEG::FxFxEventHandler::UseLHEEvent
unsigned int UseLHEEvent
How to number the events.
Definition:
FxFxEventHandler.h:375
ThePEG::FxFxEventHandler::unitTolerance
double unitTolerance() const
If the weight option is set to unit weight, do not start compensating unless the weight is this much ...
Definition:
FxFxEventHandler.h:187
ThePEG::FxFxEventHandler::currentReader
void currentReader(tFxFxReaderPtr x)
Set the currently selected reader object.
Definition:
FxFxEventHandler.h:209
ThePEG::FxFxEventHandler::select
void select(double weight)
An event has been selected.
ThePEG::FxFxEventHandler::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::FxFxEventHandler::increaseMaxXSec
void increaseMaxXSec(CrossSection maxxsec)
Increase the overestimated cross section for the selected reader.
ThePEG::FxFxEventHandler::stats
XSecStat stats
Collect statistics for this event handler.
Definition:
FxFxEventHandler.h:308
ThePEG::FxFxEventHandler::histogramScale
virtual CrossSection histogramScale() const
Histogram scale.
ThePEG::FxFxEventHandler::WeightOpt
WeightOpt
Enumerate the weighting options.
Definition:
FxFxEventHandler.h:57
ThePEG::FxFxEventHandler::unitweight
@ unitweight
All events have unit weight.
Definition:
FxFxEventHandler.h:58
ThePEG::FxFxEventHandler::varweight
@ varweight
Varying positive weights.
Definition:
FxFxEventHandler.h:60
ThePEG::FxFxEventHandler::unitnegweight
@ unitnegweight
All events have wight +/- 1.
Definition:
FxFxEventHandler.h:59
ThePEG::FxFxEventHandler::varnegweight
@ varnegweight
Varying positive or negative weights.
Definition:
FxFxEventHandler.h:61
ThePEG::FxFxEventHandler::Init
static void Init()
The standard Init function used to initialize the interfaces.
ThePEG::FxFxEventHandler::integratedXSec
virtual CrossSection integratedXSec() const
The estimated total integrated cross section of the processes generated in this run.
ThePEG::FxFxEventHandler::histStats
XSecStat histStats
Collect statistics for this event handler.
Definition:
FxFxEventHandler.h:325
ThePEG::FxFxEventHandler::reject
void reject(double weight)
Reject the current event, taking care of the statistics collection of the corresponding reader object...
ThePEG::FxFxEventHandler::FxFxEventHandler
FxFxEventHandler()
The default constructor.
Definition:
FxFxEventHandler.h:72
ThePEG::FxFxEventHandler::theUnitTolerance
double theUnitTolerance
If the weight option is set to unit weight, do not start compensating unless the weight is this much ...
Definition:
FxFxEventHandler.h:358
ThePEG::FxFxEventHandler::selector
const ReaderSelector & selector() const
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:198
ThePEG::FxFxEventHandler::warnPNum
bool warnPNum
Warn if the same process number is used in more than one FxFxReader.
Definition:
FxFxEventHandler.h:365
ThePEG::FxFxEventHandler::initFxFxEventHandler
static ClassDescription< FxFxEventHandler > initFxFxEventHandler
The static object used to initialize the description of this class.
Definition:
FxFxEventHandler.h:399
ThePEG::FxFxEventHandler::initialize
virtual void initialize()
Initialize this event handler and all related objects needed to generate events.
ThePEG::FxFxEventHandler::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::FxFxEventHandler::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
ThePEG::FxFxEventHandler::dofinish
virtual void dofinish()
Finalize this object.
ThePEG::FxFxEventHandler::theSelector
ReaderSelector theSelector
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:347
ThePEG::FxFxEventHandler::continueEvent
virtual EventPtr continueEvent()
Continue generating an event if the generation has been stopped before finishing.
ThePEG::FxFxEventHandler::readers
const ReaderVector & readers() const
Access the list of readers.
Definition:
FxFxEventHandler.h:192
ThePEG::FxFxEventHandler::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
ThePEG::FxFxEventHandler::integratedXSecErr
virtual CrossSection integratedXSecErr() const
The estimated error in the total integrated cross section of the processes generated in this run.
ThePEG::FxFxEventHandler::theCurrentReader
tFxFxReaderPtr theCurrentReader
The currently selected reader object.
Definition:
FxFxEventHandler.h:242
ThePEG::FxFxEventHandler::theReaders
ReaderVector theReaders
The list of readers.
Definition:
FxFxEventHandler.h:341
ThePEG::FxFxEventHandler::theNormWeight
unsigned int theNormWeight
How to normalize the weights.
Definition:
FxFxEventHandler.h:370
ThePEG::FxFxEventHandler::readers
ReaderVector & readers()
Access the list of readers.
Definition:
FxFxEventHandler.h:292
ThePEG::FxFxEventHandler::ReaderVector
vector< FxFxReaderPtr > ReaderVector
A vector of FxFxReader objects.
Definition:
FxFxEventHandler.h:47
ThePEG::FxFxEventHandler::accept
void accept()
Accept the current event, taking care of the statistics collection of the corresponding reader object...
ThePEG::FxFxEventHandler::setUnitTolerance
void setUnitTolerance(double)
Helper function for the interface;.
ThePEG::FxFxEventHandler::selector
ReaderSelector & selector()
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:298
ThePEG::FxFxEventHandler::skipEvents
void skipEvents()
Skip some events.
ThePEG::FxFxEventHandler::weightOption
WeightOpt weightOption() const
The way weights are to be treated.
Definition:
FxFxEventHandler.h:181
ThePEG::FxFxEventHandler::clone
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::FxFxEventHandler::performCollision
virtual tCollPtr performCollision()
Create the Event and Collision objects.
ThePEG::FxFxEventHandler::doinitrun
virtual void doinitrun()
Initialize this object.
ThePEG::FxFxEventHandler::currentReader
tFxFxReaderPtr currentReader() const
The currently selected reader object.
Definition:
FxFxEventHandler.h:203
ThePEG::FxFxEventHandler::generateEvent
virtual EventPtr generateEvent()
Generate an event.
ThePEG::FxFxEventHandler::ReaderSelector
CompSelector< int, CrossSection > ReaderSelector
A selector of readers.
Definition:
FxFxEventHandler.h:52
ThePEG::FxFxEventHandler::operator=
FxFxEventHandler & operator=(const FxFxEventHandler &)=delete
The assignment operator is private and must never be called.
ThePEG::FxFxEventHandler::theWeightOption
WeightOpt theWeightOption
The way weights are to be treated.
Definition:
FxFxEventHandler.h:352
ThePEG::PersistentIStream
ThePEG::PersistentOStream
ThePEG::XSecStat
ThePEG
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::tCollPtr
ThePEG::Ptr< Collision >::transient_pointer tCollPtr
ThePEG::EventPtr
ThePEG::Ptr< Event >::pointer EventPtr
ThePEG::BaseClassTrait::NthBase
int NthBase
ThePEG::ClassTraitsBase::className
static string className()
ThePEG::ClassTraitsBase::library
static string library()
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6