2
#include "Rivet/Analysis.hh"
3
#include "Rivet/RivetAIDA.hh"
4
#include "Rivet/Tools/Logging.hh"
5
#include "Rivet/Particle.hh"
6
#include "Rivet/Tools/ParticleIdUtils.hh"
11
class LHCB_2010_I867355 : public Analysis {
14
LHCB_2010_I867355() : Analysis("LHCB_2010_I867355")
19
//@ Results are presented for two different fragmentation functions, LEP and Tevatron. Therefore, we have two sets of histograms.
20
_h_sigma_vs_eta_lep = bookHistogram1D(1, 1, 1);
21
_h_sigma_vs_eta_tvt = bookHistogram1D(1, 1, 2);
22
_h_sigma_total_lep = bookHistogram1D(2, 1, 1);
23
_h_sigma_total_tvt = bookHistogram1D(2, 1, 2);
27
/// Perform the per-event analysis
28
void analyze(const Event& event) {
29
double weight = event.weight();
31
ParticleVector bhadrons;
32
foreach (const GenParticle* p, particles(event.genEvent())) {
33
if (!( PID::isHadron( p->pdg_id() ) && PID::hasBottom( p->pdg_id() )) ) continue;
35
const GenVertex* dv = p->end_vertex();
37
bool hasBdaughter = false;
38
if ( PID::isHadron( p->pdg_id() ) && PID::hasBottom( p->pdg_id() )) { // selecting b-hadrons
40
for (GenVertex::particles_out_const_iterator pp = dv->particles_out_const_begin() ; pp != dv->particles_out_const_end() ; ++pp) {
41
if (PID::isHadron( (*pp)->pdg_id() ) && PID::hasBottom( (*pp)->pdg_id() )) {
47
if (hasBdaughter) continue; // continue if the daughter is another b-hadron
49
bhadrons += Particle(*p);
52
foreach (const Particle& particle, bhadrons) {
54
// take fabs() to use full statistics and then multiply weight by 0.5 because LHCb is single-sided
55
double eta = fabs(particle.momentum().eta());
57
_h_sigma_vs_eta_lep->fill( eta, 0.5*weight );
58
_h_sigma_vs_eta_tvt->fill( eta, 0.5*weight );
60
_h_sigma_total_lep->fill( eta, 0.5*weight ); // histogram for full kinematic range
61
_h_sigma_total_tvt->fill( eta, 0.5*weight ); // histogram for full kinematic range
69
double norm = crossSection()/microbarn/sumOfWeights();
70
double binwidth = 4.; // integrated over full rapidity space from 2 to 6.
72
// to get the avergae of b and bbar, we scale with 0.5
73
scale(_h_sigma_vs_eta_lep, 0.5*norm);
74
scale(_h_sigma_vs_eta_tvt, 0.5*norm);
75
scale(_h_sigma_total_lep, 0.5*norm*binwidth);
76
scale(_h_sigma_total_tvt, 0.5*norm*binwidth);
82
AIDA::IHistogram1D *_h_sigma_total_lep;
83
AIDA::IHistogram1D *_h_sigma_total_tvt;
84
AIDA::IHistogram1D *_h_sigma_vs_eta_lep;
85
AIDA::IHistogram1D *_h_sigma_vs_eta_tvt;
90
// Hook for the plugin system
91
DECLARE_RIVET_PLUGIN(LHCB_2010_I867355);