herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
UnderlyingEvent
stat.h
1
// -*- C++ -*-
2
//
3
// stat.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_Stat_H
10
#define HERWIG_Stat_H
11
12
namespace
Herwig
{
13
18
struct
Stat
{
19
21
Stat
() :
attempted
(0),
accepted
(0),
sumw
(0.0),
maxXSec
(CrossSection()),
22
totsum
(0.0) {}
23
25
Stat
(
long
att,
long
acc,
double
w, CrossSection x,
double
sumw
)
26
:
attempted
(att),
accepted
(acc),
sumw
(w),
maxXSec
(x),
27
totsum
(
sumw
) {}
28
32
inline
CrossSection
xSec
()
const
{
33
return
totsum
>0.0?
maxXSec
*
sumw
/
totsum
:
maxXSec
;
34
}
35
37
long
attempted
;
39
long
accepted
;
41
double
sumw
;
43
CrossSection
maxXSec
;
45
double
totsum
;
46
48
const
Stat
&
operator+=
(
const
Stat
& s) {
49
attempted
+= s.attempted;
50
accepted
+= s.accepted;
51
sumw
+= s.sumw;
52
totsum
= max(
totsum
, s.totsum);
53
if
(
totsum
> 0.0 )
54
maxXSec
= max(
maxXSec
, s.maxXSec);
55
else
56
maxXSec
+= s.maxXSec;
57
return
*
this
;
58
}
59
};
60
}
61
#endif
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
Herwig::Stat
Documentation for the statistics struct.
Definition:
stat.h:18
Herwig::Stat::sumw
double sumw
Sum of weights.
Definition:
stat.h:41
Herwig::Stat::attempted
long attempted
Store the number of attempts.
Definition:
stat.h:37
Herwig::Stat::xSec
CrossSection xSec() const
Calculation of the cross section.
Definition:
stat.h:32
Herwig::Stat::Stat
Stat()
Standard constructor.
Definition:
stat.h:21
Herwig::Stat::operator+=
const Stat & operator+=(const Stat &s)
Overloaded += operator.
Definition:
stat.h:48
Herwig::Stat::maxXSec
CrossSection maxXSec
Maximal cross section.
Definition:
stat.h:43
Herwig::Stat::Stat
Stat(long att, long acc, double w, CrossSection x, double sumw)
Constructor with arguments.
Definition:
stat.h:25
Herwig::Stat::totsum
double totsum
Maximal weights.
Definition:
stat.h:45
Herwig::Stat::accepted
long accepted
Store the number of accepted ones.
Definition:
stat.h:39
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6