1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
| // -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/ChargedFinalState.hh"
namespace Rivet {
/// @brief Add a short analysis description here
class TASSO_1989_I277658 : public Analysis {
public:
/// Constructor
RIVET_DEFAULT_ANALYSIS_CTOR(TASSO_1989_I277658);
/// @name Analysis methods
//@{
/// Book histograms and initialise projections before the run
void init() {
const ChargedFinalState cfs;
declare(cfs, "CFS");
int offset = 0;
if(isCompatibleWithSqrtS(14.0)) {
offset = 1;
}
else if(isCompatibleWithSqrtS(22.0)) {
offset = 2;
}
else if(isCompatibleWithSqrtS(34.8)) {
offset = 3;
}
else if(isCompatibleWithSqrtS(43.6)) {
offset = 4;
}
else {
MSG_WARNING("CoM energy of events sqrt(s) = " << sqrtS()/GeV
<< " doesn't match any available analysis energy .");
}
book(_histCh, 5, 1, offset);
book(_histTotal, 2, 1, 1);
}
/// Perform the per-event analysis
void analyze(const Event& event) {
const FinalState& cfs = apply<FinalState>(event, "CFS");
MSG_DEBUG("Total charged multiplicity = " << cfs.size());
_histCh->fill(cfs.size());
_histTotal->fill(sqrtS(),cfs.size());
}
/// Normalise histograms etc., after the run
void finalize() {
scale(_histCh, 2.0/sumOfWeights()); // bin width (2)
}
//@}
private:
/// @name Histograms
//@{
Histo1DPtr _histCh;
Profile1DPtr _histTotal;
//@}
};
// The hook for the plugin system
RIVET_DECLARE_PLUGIN(TASSO_1989_I277658);
}
|