Rivet analyses referenceMARKII_1979_I143939Measurement of $R$ and $D\bar{D}$ cross section between 3.67 and 3.872 GeVExperiment: MARKII (SPEAR) Inspire ID: 143939 Status: VALIDATED Authors:
Beam energies: (1.8, 1.8); (1.8, 1.8); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9) GeV Run details:
Measurement of $R$ and the $D\bar{D}$ cross section in $e^+e^-$ collisions between 3.67 and 3.872 GeV The individual hadronic and muonic cross sections are also outputted to the yoda file so that ratio $R$ can be recalcuated if runs are combined. Source code: MARKII_1979_I143939.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 Add a short analysis description here
10 class MARKII_1979_I143939 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(MARKII_1979_I143939);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 declare(FinalState(), "FS");
23 declare(UnstableParticles(), "UFS");
24 book(_c_hadrons, "/TMP/sigma_hadrons", refData<YODA::BinnedEstimate<string>>(2,1,1));
25 book(_c_muons, "/TMP/sigma_muons" , refData<YODA::BinnedEstimate<string>>(2,1,1));
26 book(_c_DD, 3, 1, 1);
27 for (const string& en : _c_hadrons.binning().edges<0>()) {
28 double end = std::stod(en)*GeV;
29 if(isCompatibleWithSqrtS(end)) {
30 _ecms = en;
31 break;
32 }
33 }
34 if(_ecms.empty()) MSG_ERROR("Beam energy incompatible with analysis.");
35 }
36
37 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
38 for (const Particle &child : p.children()) {
39 if(child.children().empty()) {
40 nRes[child.pid()]-=1;
41 --ncount;
42 }
43 else
44 findChildren(child,nRes,ncount);
45 }
46 }
47
48 /// Perform the per-event analysis
49 void analyze(const Event& event) {
50 const FinalState& fs = apply<FinalState>(event, "FS");
51 // total hadronic and muonic cross sections
52 map<long,int> nCount;
53 int ntotal(0);
54 for (const Particle& p : fs.particles()) {
55 nCount[p.pid()] += 1;
56 ++ntotal;
57 }
58 // mu+mu- + photons
59 if(nCount[-13]==1 and nCount[13]==1 &&
60 ntotal==2+nCount[22])
61 _c_muons->fill(_ecms);
62 // everything else
63 else
64 _c_hadrons->fill(_ecms);
65 // identified final state with D mesons
66 const FinalState& ufs = apply<UnstableParticles>(event, "UFS");
67 for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
68 bool matched = false;
69 const Particle& p1 = ufs.particles()[ix];
70 int id1 = abs(p1.pid());
71 if(id1 != 411 && id1 != 421) continue;
72 // check fs
73 bool fs = true;
74 for (const Particle & child : p1.children()) {
75 if(child.pid()==p1.pid()) {
76 fs = false;
77 break;
78 }
79 }
80 if(!fs) continue;
81 // find the children
82 map<long,int> nRes = nCount;
83 int ncount = ntotal;
84 findChildren(p1,nRes,ncount);
85 // loop over the other fs particles
86 for(unsigned int iy=ix+1;iy<ufs.particles().size();++iy) {
87 const Particle& p2 = ufs.particles()[iy];
88 fs = true;
89 for (const Particle & child : p2.children()) {
90 if(child.pid()==p2.pid()) {
91 fs = false;
92 break;
93 }
94 }
95 if(!fs) continue;
96 if(p2.pid()/abs(p2.pid())==p1.pid()/abs(p1.pid())) continue;
97 int id2 = abs(p2.pid());
98 if(id2 != 411 && id2 != 421) continue;
99 if(!p2.parents().empty() && p2.parents()[0].pid()==p1.pid())
100 continue;
101 map<long,int> nRes2 = nRes;
102 int ncount2 = ncount;
103 findChildren(p2,nRes2,ncount2);
104 if(ncount2!=0) continue;
105 matched=true;
106 for(auto const & val : nRes2) {
107 if(val.second!=0) {
108 matched = false;
109 break;
110 }
111 }
112 if(matched) {
113 _c_DD ->fill(_ecms);
114 break;
115 }
116 }
117 if(matched) break;
118 }
119 }
120
121
122 /// Normalise histograms etc., after the run
123 void finalize() {
124 double fact = crossSection()/ sumOfWeights() /nanobarn;
125 BinnedEstimatePtr<string> mult;
126 book(mult, 2, 1, 1);
127 divide(_c_hadrons,_c_muons,mult);
128 scale(_c_DD,fact);
129 }
130
131 /// @}
132
133
134 /// @name Histograms
135 /// @{
136 BinnedHistoPtr<string> _c_hadrons, _c_muons, _c_DD;
137 string _ecms;
138 /// @}
139
140
141 };
142
143
144 RIVET_DECLARE_PLUGIN(MARKII_1979_I143939);
145
146
147}
|