Rivet analyses referenceBABAR_2006_I714448Pion Mass Spectrum in $\Upsilon(4S)\to\Upsilon(1,2S)\pi^+\pi^-$Experiment: BABAR (PEP-II) Inspire ID: 714448 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the $\pi^+\pi^-$ mass Spectrum in $\Upsilon(4S)\to\Upsilon(1,2S)\pi^+\pi^-$ decays. Source code: BABAR_2006_I714448.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief Add a short analysis description here
9 class BABAR_2006_I714448 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2006_I714448);
14
15
16 /// @name Analysis methods
17 ///@{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(UnstableParticles(),"UFS");
24 book(_h_1S, 1, 1, 1);
25 book(_h_2S, 1, 1, 2);
26 }
27
28
29 void findDecayProducts(const Particle & mother,
30 unsigned int & nstable,
31 Particles& pip, Particles& pim,
32 Particles & onium) {
33 for(const Particle & p : mother.children()) {
34 int id = p.pid();
35 if ( id == PID::PIMINUS) {
36 pim.push_back(p);
37 ++nstable;
38 }
39 else if (id == PID::PIPLUS) {
40 pip.push_back(p);
41 ++nstable;
42 }
43 else if (abs(id)%1000==553) {
44 onium.push_back(p);
45 ++nstable;
46 }
47 else if ( !p.children().empty() ) {
48 findDecayProducts(p,nstable,pip,pim,onium);
49 }
50 else
51 ++nstable;
52 }
53 }
54
55 /// Perform the per-event analysis
56 void analyze(const Event& event) {
57 // loop over unstable particles
58 for(const Particle& ups : apply<UnstableParticles>(event, "UFS").particles(Cuts::pid==300553)) {
59 unsigned int nstable(0);
60 Particles pip, pim, onium;
61 findDecayProducts(ups,nstable,pip,pim,onium);
62 // check for onium
63 if(onium.size() !=1 || nstable !=3) continue;
64 // check for pipi
65 if( ! (pip.size()==1 && pim.size() ==1) ) continue;
66 FourMomentum q = pip[0].momentum()+pim[0].momentum();
67 if(onium[0].pid()==553)
68 _h_1S->fill(q.mass());
69 else if(onium[0].pid()==100553)
70 _h_2S->fill(q.mass());
71 }
72 }
73
74
75 /// Normalise histograms etc., after the run
76 void finalize() {
77 normalize(_h_1S);
78 normalize(_h_2S);
79 }
80
81 ///@}
82
83
84 /// @name Histograms
85 ///@{
86 Histo1DPtr _h_1S,_h_2S;
87 ///@}
88
89
90 };
91
92
93 RIVET_DECLARE_PLUGIN(BABAR_2006_I714448);
94
95}
|