Rivet analyses referenceBABAR_2012_I1122031Measurement of the hadronic mass spectrum for $\bar{B}\to X_s \gamma$Experiment: BABAR (PEP-II) Inspire ID: 1122031 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Hadropnic mass spectrum in $B\to s\gamma$ decays measured by BELLE. Useful for testing the implementation of these decays Source code: BABAR_2012_I1122031.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief B -> Xs gamma
9 class BABAR_2012_I1122031 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2012_I1122031);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // Initialise and register projections
22 declare(UnstableParticles(), "UFS");
23 // Book histograms
24 book(_h, 1, 1, 1);
25 book(_nBottom, "TMP/BottomCounter");
26 }
27
28 void findDecayProducts(const Particle& mother,
29 unsigned int& nK0, unsigned int& nKp, unsigned int& nKm,
30 FourMomentum& ptot) {
31 for (const Particle & p : mother.children()) {
32 int id = p.pid();
33 if ( id == PID::KPLUS ) {
34 ++nKp;
35 ptot += p.momentum();
36 }
37 else if (id == PID::KMINUS ) {
38 ++nKm;
39 ptot += p.momentum();
40 }
41 else if (id == PID::K0S) {
42 ++nK0;
43 ptot += p.momentum();
44 }
45 else if (id == PID::PI0 || id == PID::PIPLUS || id == PID::PIMINUS) {
46 ptot += p.momentum();
47 }
48 else if ( !p.children().empty() ) {
49 findDecayProducts(p, nK0, nKp, nKm, ptot);
50 }
51 else
52 ptot += p.momentum();
53 }
54 }
55
56 /// Perform the per-event analysis
57 void analyze(const Event& event) {
58 // Loop over bottoms
59 for (const Particle& bottom : apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==521 ||
60 Cuts::abspid==511)) {
61 // remove mixing entries etc
62 for (const Particle & child : bottom.children())
63 if (child.abspid() == 511 || child.pid()==bottom.pid() ) continue;
64 _nBottom->fill();
65 FourMomentum pgamma(0.,0.,0.,0.);
66 unsigned int ngamma = 0;
67 for (const Particle & child : bottom.children()) {
68 if (child.pid() == PID::PHOTON) {
69 ngamma += 1;
70 pgamma += child.momentum();
71 }
72 }
73 if (ngamma != 1) continue;
74 unsigned int nK0(0),nKp(0),nKm(0);
75 FourMomentum p_tot(0,0,0,0);
76 findDecayProducts(bottom, nK0, nKp, nKm, p_tot);
77 unsigned int nk = nKp-nKm+nK0;
78 if (nk % 2 == 1) {
79 p_tot -= pgamma;
80 _h->fill(p_tot.mass()/GeV);
81 }
82 }
83 }
84
85
86 /// Normalise histograms etc., after the run
87 void finalize() {
88 scale(_h, 1e6/_nBottom->sumW());
89 }
90
91 /// @}
92
93
94 /// @name Histograms
95 /// @{
96 Histo1DPtr _h;
97 CounterPtr _nBottom;
98 /// @}
99
100
101 };
102
103
104 RIVET_DECLARE_PLUGIN(BABAR_2012_I1122031);
105
106}
|