Rivet analyses referenceMARKII_1986_I220003$\gamma\gamma\to\pi^+\pi^-/K^+K^-$ for centre-of-mass energies between 1.7 and 3.5 GeVExperiment: MARKII (PEP) Inspire ID: 220003 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the differential cross section for $\gamma\gamma\to\pi^+\pi^-/K^+K^-$ for $1.7 \text{GeV} < W < 3.5 \text{GeV}$. Source code: MARKII_1986_I220003.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief gamma gamma -> pi+pi-/K+ K-
9 class MARKII_1986_I220003 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKII_1986_I220003);
14
15
16 /// @name Analysis methods
17 ///@{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 declare(FinalState(),"FS");
22 // check CMS energy in range
23 if(sqrtS()<1.5*GeV || sqrtS()>5*GeV)
24 throw Error("Invalid CMS energy for MARKII_1986_I220003");
25 book(_cPiK[0], "/TMP/nPiK_0");
26 book(_cPiK[1], "/TMP/nPiK_1");
27 }
28
29 /// Perform the per-event analysis
30 void analyze(const Event& event) {
31 Particles part = applyProjection<FinalState>(event,"FS").particles();
32 if(part.size()!=2) vetoEvent;
33 if(part[0].pid()!=-part[1].pid()) vetoEvent;
34 double cTheta(0.);
35 bool foundPi(false),foundK(false);
36 for(const Particle & p : part) {
37 if(p.pid()==PID::PIPLUS) {
38 foundPi=true;
39 cTheta = abs(p.momentum().z()/p.momentum().p3().mod());
40 }
41 else if(p.pid()==PID::KPLUS) {
42 foundK=true;
43 cTheta = abs(p.momentum().z()/p.momentum().p3().mod());
44 }
45 }
46 if(!foundPi && !foundK) vetoEvent;
47 if(cTheta>0.5) vetoEvent;
48 if(cTheta>0.3)
49 _cPiK[1]->fill();
50 else
51 _cPiK[0]->fill();
52 }
53
54 /// Normalise histograms etc., after the run
55 void finalize() {
56 double fact = crossSection()/nanobarn/sumOfWeights();
57 for(unsigned int ix=0;ix<2;++ix) {
58 double sigma = _cPiK[ix]->val()*fact;
59 double error = _cPiK[ix]->err()*fact;
60 Scatter2D temphisto(refData(1, 1, 1+ix));
61 Scatter2DPtr cross;
62 book(cross, 1, 1, 1+ix);
63 for (size_t b = 0; b < temphisto.numPoints(); b++) {
64 const double x = temphisto.point(b).x();
65 pair<double,double> ex = temphisto.point(b).xErrs();
66 pair<double,double> ex2 = ex;
67 if(ex2.first ==0.) ex2. first=0.0001;
68 if(ex2.second==0.) ex2.second=0.0001;
69 if (inRange(sqrtS(), x-ex2.first, x+ex2.second)) {
70 cross->addPoint(x, sigma, ex, make_pair(error,error));
71 }
72 else {
73 cross->addPoint(x, 0., ex, make_pair(0.,.0));
74 }
75 }
76 }
77 }
78
79 ///@}
80
81
82 /// @name Histograms
83 ///@{
84 CounterPtr _cPiK[2];
85 ///@}
86
87
88 };
89
90
91 RIVET_DECLARE_PLUGIN(MARKII_1986_I220003);
92
93}
|