ThePEG
1.8.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
LesHouches
LesHouchesEventHandler.h
1
// -*- C++ -*-
2
//
3
// LesHouchesEventHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2011 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef THEPEG_LesHouchesEventHandler_H
10
#define THEPEG_LesHouchesEventHandler_H
11
//
12
// This is the declaration of the LesHouchesEventHandler class.
13
//
14
15
#include "ThePEG/Handlers/EventHandler.h"
16
#include "LesHouchesEventHandler.fh"
17
#include "LesHouchesReader.fh"
18
#include "ThePEG/Utilities/CompSelector.h"
19
#include "ThePEG/Utilities/XSecStat.h"
20
21
namespace
ThePEG {
22
40
class
LesHouchesEventHandler
:
public
EventHandler
{
41
42
public
:
43
47
typedef
vector<LesHouchesReaderPtr>
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
public
:
65
71
LesHouchesEventHandler
()
72
:
theWeightOption
(
unitweight
),
theUnitTolerance
(1.0e-6),
warnPNum
(true)
73
{
74
selector
().
tolerance
(
unitTolerance
());
75
}
76
80
virtual
~LesHouchesEventHandler
();
82
83
public
:
84
91
virtual
void
initialize
();
92
97
virtual
void
statistics
(ostream &)
const
;
98
104
virtual
CrossSection
histogramScale
()
const
;
105
111
virtual
CrossSection
integratedXSec
()
const
;
112
118
virtual
CrossSection
integratedXSecErr
()
const
;
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
tLesHouchesReaderPtr
currentReader
()
const
{
return
theCurrentReader
; }
204
208
void
currentReader
(
tLesHouchesReaderPtr
x) {
theCurrentReader
= x; }
209
211
212
public
:
213
220
void
persistentOutput
(
PersistentOStream
& os)
const
;
221
227
void
persistentInput
(
PersistentIStream
& is,
int
version);
229
236
static
void
Init
();
237
238
protected
:
239
246
virtual
IBPtr
clone
()
const
;
247
252
virtual
IBPtr
fullclone
()
const
;
254
255
protected
:
256
264
virtual
void
doinit
();
265
270
virtual
void
doinitrun
();
271
276
virtual
void
dofinish
();
278
279
protected
:
280
284
ReaderVector
&
readers
() {
return
theReaders
; }
285
290
ReaderSelector
&
selector
() {
return
theSelector
; }
291
295
void
setUnitTolerance
(
double
);
296
300
XSecStat
stats
;
301
306
XSecStat
histStats
;
307
308
private
:
309
313
ReaderVector
theReaders
;
314
319
ReaderSelector
theSelector
;
320
324
WeightOpt
theWeightOption
;
325
330
double
theUnitTolerance
;
331
335
tLesHouchesReaderPtr
theCurrentReader
;
336
341
bool
warnPNum
;
342
343
public
:
344
349
class
LesHouchesInitError:
public
InitException {};
350
355
class
LesHouchesPNumException:
public
InitException {};
358
private
:
359
364
static
ClassDescription<LesHouchesEventHandler>
initLesHouchesEventHandler
;
365
370
LesHouchesEventHandler
&
operator=
(
const
LesHouchesEventHandler
&);
371
372
};
373
374
}
375
376
// CLASSDOC OFF
377
378
#include "ThePEG/Utilities/ClassTraits.h"
379
380
namespace
ThePEG {
381
386
template
<>
387
struct
BaseClassTrait<LesHouchesEventHandler,1> {
389
typedef
EventHandler
NthBase
;
390
};
391
394
template
<>
395
struct
ClassTraits<LesHouchesEventHandler>
396
:
public
ClassTraitsBase<LesHouchesEventHandler> {
398
static
string
className
() {
return
"ThePEG::LesHouchesEventHandler"
; }
402
static
string
library
() {
return
"LesHouches.so"
; }
403
};
404
407
}
408
409
#endif
/* THEPEG_LesHouchesEventHandler_H */
Generated on Sat Jun 16 2012 16:51:04 for ThePEG by
1.8.1.1