Rivet analyses referenceBESIII_2017_I1644905Cross section for $e^+e^-\to\phi\chi_{c(1,2)}$ at $\sqrt{s}=4.600$ GeVExperiment: BESIII () Inspire ID: 1644905 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (2.3, 2.3) GeV Run details:
Measurement of the cross section for $e^+e^-\to\phi\chi_{c(1,2)}$ at $\sqrt{s}=4.600$ GeV. Source code: BESIII_2017_I1644905.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/UnstableParticles.hh"
5
6namespace Rivet {
7
8
9 /// @brief e+ e- -> phi chi_c(1,2)
10 class BESIII_2017_I1644905 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2017_I1644905);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 // projections
23 declare(FinalState(), "FS");
24 declare(UnstableParticles(), "UFS");
25 for (unsigned int ix=0; ix<2; ++ix) {
26 book(_h[ix], 1, 1, 1+ix);
27 }
28 }
29
30 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
31 for (const Particle &child : p.children()) {
32 if (child.children().empty()) {
33 --nRes[child.pid()];
34 --ncount;
35 }
36 else {
37 findChildren(child,nRes,ncount);
38 }
39 }
40 }
41
42 /// Perform the per-event analysis
43 void analyze(const Event& event) {
44 const FinalState& fs = apply<FinalState>(event, "FS");
45 map<long,int> nCount;
46 int ntotal(0);
47 for (const Particle& p: fs.particles()) {
48 nCount[p.pid()] += 1;
49 ++ntotal;
50 }
51 const FinalState& ufs = apply<FinalState>(event, "UFS");
52 // loop over any phi mesons
53 for (const Particle & phi : ufs.particles(Cuts::pid==333)) {
54 bool matched = false;
55 if (phi.children().empty()) continue;
56 map<long,int> nRes = nCount;
57 int ncount = ntotal;
58 findChildren(phi,nRes,ncount);
59 for (const Particle & chi : ufs.particles(Cuts::pid==20443 || Cuts::pid==445)) {
60 if (chi.children().empty()) continue;
61 map<long,int> nRes2 = nRes;
62 int ncount2 = ncount;
63 findChildren(chi,nRes2,ncount2);
64 matched = true;
65 for (const auto& val : nRes2) {
66 if (val.second!=0) {
67 matched = false;
68 break;
69 }
70 }
71 if(!matched) continue;
72 if (chi.pid()==20443) _h[0]->fill("4.6"s);
73 else if(chi.pid()== 445) _h[1]->fill("4.6"s);
74 break;
75 }
76 if(matched) break;
77 }
78 }
79
80
81 /// Normalise histograms etc., after the run
82 void finalize() {
83 scale(_h, crossSection()/sumOfWeights()/picobarn);
84 }
85
86 /// @}
87
88
89 /// @name Histograms
90 /// @{
91 BinnedHistoPtr<string> _h[2];
92 /// @}
93
94
95 };
96
97
98 RIVET_DECLARE_PLUGIN(BESIII_2017_I1644905);
99
100}
|