herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.2.1
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
74
FxFxEventHandler
()
75
:
theWeightOption
(
unitweight
),
theUnitTolerance
(1.0e-6),
warnPNum
(true),
theNormWeight
(0)
76
{
77
selector
().
tolerance
(
unitTolerance
());
78
}
79
83
virtual
~FxFxEventHandler
();
85
86
public
:
87
94
virtual
void
initialize
();
95
100
virtual
void
statistics
(ostream &)
const
;
101
107
virtual
CrossSection
histogramScale
()
const
;
108
114
virtual
CrossSection
integratedXSec
()
const
;
115
116
virtual
int
ntriesinternal()
const
;
117
123
virtual
CrossSection
integratedXSecErr
()
const
;
124
125
virtual
map<string,CrossSection> optintegratedXSecMap()
const
;
126
128
134
virtual
EventPtr
generateEvent
();
135
140
virtual
tCollPtr
performCollision
();
141
146
virtual
EventPtr
continueEvent
();
148
157
void
select
(
double
weight);
158
163
void
accept
();
164
169
void
reject
(
double
weight);
170
174
void
increaseMaxXSec
(CrossSection maxxsec);
175
180
void
skipEvents
();
181
183
189
WeightOpt
weightOption
()
const
{
return
theWeightOption
; }
190
195
double
unitTolerance
()
const
{
return
theUnitTolerance
; }
196
200
const
ReaderVector &
readers
()
const
{
return
theReaders
; }
201
206
const
ReaderSelector &
selector
()
const
{
return
theSelector
; }
207
211
tFxFxReaderPtr
currentReader
()
const
{
return
theCurrentReader
; }
212
213
217
void
currentReader
(tFxFxReaderPtr x) {
theCurrentReader
= x; }
218
220
221
public
:
222
229
void
persistentOutput
(
PersistentOStream
& os)
const
;
230
236
void
persistentInput
(
PersistentIStream
& is,
int
version);
238
245
static
void
Init
();
246
250
tFxFxReaderPtr
theCurrentReader
;
251
252
253
254
protected
:
255
262
virtual
IBPtr
clone
()
const
;
263
268
virtual
IBPtr
fullclone
()
const
;
270
271
protected
:
272
280
virtual
void
doinit
();
281
286
virtual
void
doinitrun
();
287
292
virtual
void
dofinish
();
294
295
protected
:
296
300
ReaderVector &
readers
() {
return
theReaders
; }
301
306
ReaderSelector &
selector
() {
return
theSelector
; }
307
311
void
setUnitTolerance
(
double
);
312
316
XSecStat
stats
;
317
318
map<string,XSecStat> optstats;
319
320
map<string,CrossSection> optxs;
321
322
int
ntries;
323
324
map<string,XSecStat> OptStatsFunc() {
return
optstats; }
325
326
map<string,CrossSection> OptXsFunc() {
return
optxs; }
327
328
333
XSecStat
histStats
;
334
335
map<string,XSecStat> opthistStats;
336
337
338
/*
339
* The weight identifiers for the events
340
*/
341
342
vector<string> weightnames;
343
344
private
:
345
349
ReaderVector
theReaders
;
350
355
ReaderSelector
theSelector
;
356
360
WeightOpt
theWeightOption
;
361
366
double
theUnitTolerance
;
367
368
373
bool
warnPNum
;
374
378
unsigned
int
theNormWeight
;
379
380
381
public
:
382
387
class
FxFxInitError:
public
InitException {};
388
393
class
FxFxPNumException:
public
InitException {};
396
private
:
397
402
static
ClassDescription<FxFxEventHandler>
initFxFxEventHandler
;
403
408
FxFxEventHandler
&
operator=
(
const
FxFxEventHandler
&) =
delete
;
409
410
};
411
412
}
413
414
// CLASSDOC OFF
415
416
#include "ThePEG/Utilities/ClassTraits.h"
417
418
namespace
ThePEG
{
419
424
template
<>
425
struct
BaseClassTrait
<FxFxEventHandler,1> {
427
typedef
EventHandler
NthBase;
428
};
429
432
template
<>
433
struct
ClassTraits
<FxFxEventHandler>
434
:
public
ClassTraitsBase
<FxFxEventHandler> {
436
static
string
className() {
return
"Herwig::FxFxEventHandler"
; }
440
static
string
library() {
return
"HwFxFx.so"
; }
441
};
442
445
}
446
447
#endif
/* THEPEG_FxFxEventHandler_H */
ThePEG::PersistentIStream
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:195
ThePEG::FxFxEventHandler::accept
void accept()
Accept the current event, taking care of the statistics collection of the corresponding reader object...
ThePEG::FxFxEventHandler::readers
ReaderVector & readers()
Access the list of readers.
Definition:
FxFxEventHandler.h:300
ThePEG::EventHandler
ThePEG::FxFxEventHandler::initialize
virtual void initialize()
Initialize this event handler and all related objects needed to generate events.
ThePEG::FxFxEventHandler::~FxFxEventHandler
virtual ~FxFxEventHandler()
The destructor.
ThePEG::FxFxEventHandler::varnegweight
Varying positive or negative weights.
Definition:
FxFxEventHandler.h:61
ThePEG::FxFxEventHandler
The FxFxEventHandler inherits from the general EventHandler class and administers the reading of even...
Definition:
FxFxEventHandler.h:40
ThePEG::FxFxEventHandler::doinitrun
virtual void doinitrun()
Initialize this object.
ThePEG::FxFxEventHandler::integratedXSec
virtual CrossSection integratedXSec() const
The estimated total integrated cross section of the processes generated in this run.
ThePEG::ClassDescription
ThePEG::FxFxEventHandler::operator=
FxFxEventHandler & operator=(const FxFxEventHandler &)=delete
The assignment operator is private and must never be called.
ThePEG::FxFxEventHandler::warnPNum
bool warnPNum
Warn if the same process number is used in more than one FxFxReader.
Definition:
FxFxEventHandler.h:373
ThePEG::PersistentOStream
ThePEG::FxFxEventHandler::continueEvent
virtual EventPtr continueEvent()
Continue generating an event if the generation has been stopped before finishing. ...
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::FxFxEventHandler::statistics
virtual void statistics(ostream &) const
Write out accumulated statistics about intergrated cross sections and stuff.
ThePEG::CompSelector::tolerance
void tolerance(double t)
ThePEG::FxFxEventHandler::WeightOpt
WeightOpt
Enumerate the weighting options.
Definition:
FxFxEventHandler.h:57
ThePEG::FxFxEventHandler::theCurrentReader
tFxFxReaderPtr theCurrentReader
The currently selected reader object.
Definition:
FxFxEventHandler.h:250
ThePEG
ThePEG::FxFxEventHandler::varweight
Varying positive weights.
Definition:
FxFxEventHandler.h:60
ThePEG::FxFxEventHandler::FxFxEventHandler
FxFxEventHandler()
The default constructor.
Definition:
FxFxEventHandler.h:74
ThePEG::FxFxEventHandler::weightOption
WeightOpt weightOption() const
The way weights are to be treated.
Definition:
FxFxEventHandler.h:189
ThePEG::EventPtr
ThePEG::Ptr< Event >::pointer EventPtr
ThePEG::FxFxEventHandler::Init
static void Init()
The standard Init function used to initialize the interfaces.
ThePEG::FxFxEventHandler::ReaderSelector
CompSelector< int, CrossSection > ReaderSelector
A selector of readers.
Definition:
FxFxEventHandler.h:52
ThePEG::FxFxEventHandler::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
ThePEG::FxFxEventHandler::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
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:366
ThePEG::FxFxEventHandler::histStats
XSecStat histStats
Collect statistics for this event handler.
Definition:
FxFxEventHandler.h:333
ThePEG::FxFxEventHandler::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
ThePEG::FxFxEventHandler::reject
void reject(double weight)
Reject the current event, taking care of the statistics collection of the corresponding reader object...
ThePEG::FxFxEventHandler::skipEvents
void skipEvents()
Skip some events.
ThePEG::FxFxEventHandler::theWeightOption
WeightOpt theWeightOption
The way weights are to be treated.
Definition:
FxFxEventHandler.h:360
ThePEG::FxFxEventHandler::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::CompSelector< int, CrossSection >
ThePEG::FxFxEventHandler::initFxFxEventHandler
static ClassDescription< FxFxEventHandler > initFxFxEventHandler
The static object used to initialize the description of this class.
Definition:
FxFxEventHandler.h:402
ThePEG::FxFxEventHandler::theReaders
ReaderVector theReaders
The list of readers.
Definition:
FxFxEventHandler.h:349
ThePEG::FxFxEventHandler::setUnitTolerance
void setUnitTolerance(double)
Helper function for the interface;.
ThePEG::FxFxEventHandler::select
void select(double weight)
An event has been selected.
ThePEG::FxFxEventHandler::ReaderVector
vector< FxFxReaderPtr > ReaderVector
A vector of FxFxReader objects.
Definition:
FxFxEventHandler.h:47
ThePEG::tCollPtr
ThePEG::Ptr< Collision >::transient_pointer tCollPtr
ThePEG::FxFxEventHandler::theNormWeight
unsigned int theNormWeight
How to normalize the weights.
Definition:
FxFxEventHandler.h:378
ThePEG::FxFxEventHandler::performCollision
virtual tCollPtr performCollision()
Create the Event and Collision objects.
ThePEG::FxFxEventHandler::selector
const ReaderSelector & selector() const
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:206
ThePEG::FxFxEventHandler::currentReader
void currentReader(tFxFxReaderPtr x)
Set the currently selected reader object.
Definition:
FxFxEventHandler.h:217
ThePEG::FxFxEventHandler::dofinish
virtual void dofinish()
Finalize this object.
ThePEG::ClassTraits
ThePEG::FxFxEventHandler::selector
ReaderSelector & selector()
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:306
ThePEG::FxFxEventHandler::unitnegweight
All events have wight +/- 1.
Definition:
FxFxEventHandler.h:59
ThePEG::FxFxEventHandler::generateEvent
virtual EventPtr generateEvent()
Generate an event.
ThePEG::FxFxEventHandler::increaseMaxXSec
void increaseMaxXSec(CrossSection maxxsec)
Increase the overestimated cross section for the selected reader.
ThePEG::BaseClassTrait
ThePEG::XSecStat
ThePEG::FxFxEventHandler::clone
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::FxFxEventHandler::readers
const ReaderVector & readers() const
Access the list of readers.
Definition:
FxFxEventHandler.h:200
ThePEG::FxFxEventHandler::currentReader
tFxFxReaderPtr currentReader() const
The currently selected reader object.
Definition:
FxFxEventHandler.h:211
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::theSelector
ReaderSelector theSelector
The selector to choose readers according to their overestimated cross section.
Definition:
FxFxEventHandler.h:355
ThePEG::FxFxEventHandler::histogramScale
virtual CrossSection histogramScale() const
Histogram scale.
ThePEG::FxFxEventHandler::unitweight
All events have unit weight.
Definition:
FxFxEventHandler.h:58
ThePEG::FxFxEventHandler::stats
XSecStat stats
Collect statistics for this event handler.
Definition:
FxFxEventHandler.h:316
ThePEG::ClassTraitsBase
Generated on Sat Apr 11 2020 14:50:29 for Herwig by
1.8.13