2
#include "Rivet/Analysis.hh"
3
#include "Rivet/RivetAIDA.hh"
4
#include "Rivet/Tools/Logging.hh"
5
#include "Rivet/Projections/ChargedFinalState.hh"
12
class CDF_2012_NOTE10874 : public Analysis {
16
: Analysis("CDF_2012_NOTE10874")
23
const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
24
addProjection(cfs, "CFS");
27
if (fuzzyEquals(sqrtS(), 300*GeV)) isqrts = 1;
28
else if (fuzzyEquals(sqrtS(), 900*GeV)) isqrts = 2;
29
else if (fuzzyEquals(sqrtS(), 1960*GeV)) isqrts = 3;
32
_h_nch_transverse = bookProfile1D(1,1,isqrts);
33
_h_ptSumDen = bookProfile1D(2,1,isqrts);
34
_h_avePt = bookProfile1D(3,1,isqrts);
37
// Little helper function to identify Delta(phi) regions
38
inline int region_index(double dphi) {
39
assert(inRange(dphi, 0.0, PI, CLOSED, CLOSED));
40
if (dphi < PI/3.0) return 0;
41
if (dphi < 2*PI/3.0) return 1;
46
void analyze(const Event& event) {
47
const double weight = event.weight();
49
const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
54
ParticleVector particles = cfs.particlesByPt();
55
Particle p_lead = particles[0];
56
const double philead = p_lead.momentum().phi();
57
const double pTlead = p_lead.momentum().pT();
61
foreach (const Particle& p, particles) {
62
const double pT = p.momentum().pT();
63
const double dPhi = deltaPhi(philead, p.momentum().phi());
64
const int ir = region_index(dPhi);
71
const double dEtadPhi = 4.0*PI/3.0;
73
_h_nch_transverse->fill(pTlead/GeV, tNch/dEtadPhi, weight);
74
_h_ptSumDen->fill(pTlead/GeV, ptSum/dEtadPhi, weight);
77
_h_avePt->fill(pTlead/GeV, ptSum/tNch, weight);
88
AIDA::IProfile1D *_h_nch_transverse, *_h_ptSumDen, *_h_avePt;
93
// The hook for the plugin system
94
DECLARE_RIVET_PLUGIN(CDF_2012_NOTE10874);