-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSTAR_2006_I709170.cc
More file actions
80 lines (53 loc) · 1.85 KB
/
STAR_2006_I709170.cc
File metadata and controls
80 lines (53 loc) · 1.85 KB
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
78
79
80
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Projections/FastJets.hh"
#include "Rivet/Projections/DressedLeptons.hh"
#include "Rivet/Projections/MissingMomentum.hh"
#include "Rivet/Projections/DirectFinalState.hh"
namespace Rivet {
/// @brief Add a short analysis description here
class STAR_2006_I709170 : public Analysis {
public:
/// Constructor
RIVET_DEFAULT_ANALYSIS_CTOR(STAR_2006_I709170);
/// @name Analysis methods
/// @{
/// Book histograms and initialise projections before the run
void init() {
IdentifiedFinalState pionfs(Cuts::abseta < 2.5 && Cuts::pT > 0.3*GeV);
pionfs.acceptIdPair(PID::PIPLUS);
declare(pionfs, "PionFS");
book(hPionPt["piplus"], 2, 1, 1);
book(hPionPt["piminus"], 7, 1, 1);
book(Ratio["piminus_piplus"], 23, 1, 2);
book(sow["sow_pp"],"sow_pp");
}
/// Perform the per-event analysis
void analyze(const Event& event) {
const IdentifiedFinalState& pionfs = apply<IdentifiedFinalState>(event, "PionFS");
for (const Particle& p : pionfs.particles()) {
if (p.absrap() < 0.5) {
const double pT = p.pT() / GeV;
((p.pid() > 0) ? hPionPt["piplus"] : hPionPt["piminus"])->fill(pT, 1.0/pT);
}
}
sow["sow_pp"]->fill();
}
/// Normalise histograms etc., after the run
void finalize() {
divide(hPionPt["piminus"], hPionPt["piplus"], Ratio["piminus_piplus"]);
const YODA::Scatter1D factor = (1./(2.*M_PI)) / *sow["sow_pp"];
scale(hPionPt["piplus"], factor);
scale(hPionPt["piminus"], factor);
}
/// @}
/// @name Histograms
/// @{
map<string, Histo1DPtr> hPionPt;
map<string, Scatter2DPtr> Ratio;
map<string, CounterPtr> sow;
/// @}
};
RIVET_DECLARE_PLUGIN(STAR_2006_I709170);
}