Rivet analyses referenceTPC_1986_I228072$\gamma\gamma\to\pi^+\pi^-$ ($0.5<\sqrt{s}<3.25$ GeV) and $K^+K^-$ ($1.25<\sqrt{s}<3.5$ GeV)Experiment: TPC (PEP) Inspire ID: 228072 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the differential cross section for $\gamma\gamma\to\pi^+\pi^-$ ($0.5<\sqrt{s}<3.25$ GeV) and $K^+K^-$ ($1.25<\sqrt{s}<3.5$ GeV). The cross section as a function of the centre-of-mass energy of the photonic collision is measured Source code: TPC_1986_I228072.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/FastJets.hh"
5#include "Rivet/Projections/DressedLeptons.hh"
6#include "Rivet/Projections/MissingMomentum.hh"
7#include "Rivet/Projections/PromptFinalState.hh"
8
9namespace Rivet {
10
11
12 /// @brief gamma gamma -> pi+pi-/K+ K-
13 class TPC_1986_I228072 : public Analysis {
14 public:
15
16 /// Constructor
17 RIVET_DEFAULT_ANALYSIS_CTOR(TPC_1986_I228072);
18
19
20 /// @name Analysis methods
21 ///@{
22
23 /// Book histograms and initialise projections before the run
24 void init() {
25 // Final state
26 declare(FinalState(),"FS");
27 // check CMS energy in range
28 if(sqrtS()<0.5*GeV || sqrtS()>3.5*GeV)
29 throw Error("Invalid CMS energy for TPC_1986_I228072");
30 book(_cPi[0],"/TMP/nPi_06");
31 book(_cPi[1],"/TMP/nPi_03");
32 book(_cK ,"/TMP/nK" );
33 }
34
35
36 /// Perform the per-event analysis
37 void analyze(const Event& event) {
38 Particles part = applyProjection<FinalState>(event,"FS").particles();
39 if(part.size()!=2) vetoEvent;
40 if(part[0].pid()!=-part[1].pid()) vetoEvent;
41 double cTheta(0.);
42 bool foundPi(false),foundK(false);
43 for(const Particle & p : part) {
44 if(p.pid()==PID::PIPLUS) {
45 foundPi=true;
46 cTheta = abs(p.momentum().z()/p.momentum().p3().mod());
47 }
48 else if(p.pid()==PID::KPLUS) {
49 foundK=true;
50 cTheta = abs(p.momentum().z()/p.momentum().p3().mod());
51 }
52 }
53 if(!foundPi && !foundK) vetoEvent;
54 if(cTheta>0.6) vetoEvent;
55 if(foundPi) {
56 _cPi[0]->fill();
57 if(cTheta<0.3)
58 _cPi[1]->fill();
59 }
60 else if(foundK)
61 _cK->fill();
62 }
63
64
65 /// Normalise histograms etc., after the run
66 void finalize() {
67 double fact = crossSection()/nanobarn/sumOfWeights();
68 for (unsigned int ih=1;ih<6;++ih) {
69 if(ih==2||ih==3) continue;
70 double sigma(0.),error(0.);
71 CounterPtr count;
72 if(ih==1) {
73 count = _cPi[0];
74 }
75 else if(ih==4) {
76 count = _cPi[1];
77 }
78 else if(ih==5) {
79 count = _cK;
80 }
81 else
82 assert(false);
83 if(count->numEntries()==0) continue;
84 sigma = count->val()*fact;
85 error = count->err()*fact;
86 Scatter2DPtr cross;
87 Scatter2D temphisto(refData(ih, 1, 1));
88 book(cross, ih, 1, 1);
89 for (size_t b = 0; b < temphisto.numPoints(); b++) {
90 const double x = temphisto.point(b).x();
91 pair<double,double> ex = temphisto.point(b).xErrs();
92 pair<double,double> ex2 = ex;
93 if(ex2.first ==0.) ex2. first=0.0001;
94 if(ex2.second==0.) ex2.second=0.0001;
95 if (inRange(sqrtS(), x-ex2.first, x+ex2.second)) {
96 cross->addPoint(x, sigma, ex, make_pair(error,error));
97 }
98 else {
99 cross->addPoint(x, 0., ex, make_pair(0.,.0));
100 }
101 }
102 }
103 }
104
105 ///@}
106
107
108 /// @name Histograms
109 ///@{
110 CounterPtr _cPi[2],_cK;
111 ///@}
112
113
114 };
115
116
117 RIVET_DECLARE_PLUGIN(TPC_1986_I228072);
118
119}
|