rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

BELLE_2019_I1752523

Azimuthal asymmetries in bact-to-back $\pi^\pm$ and $(\pi^0,\eta,\pi^\pm)$ production at $\sqrt{s}=10.58$GeV
Experiment: BELLE (KEKB)
Inspire ID: 1752523
Status: VALIDATED NOHEPDATA
Authors:
  • Peter Richardson
References:
  • Phys.Rev.D 100 (2019) 9, 092008
Beams: e+ e-
Beam energies: (5.3, 5.3) GeV
Run details:
  • e+e- to hadrons

Azimuthal asymmetries in bact-to-back $\pi^\pm$ and $(\pi^0,\eta,\pi^\pm)$ production at $\sqrt{s}=10.58$GeV

Source code: BELLE_2019_I1752523.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/Thrust.hh"
  4#include "Rivet/Projections/UnstableParticles.hh"
  5#include "Rivet/Projections/FinalState.hh"
  6#include "Rivet/Projections/Beam.hh"
  7#include "Rivet/Tools/Random.hh"
  8
  9namespace Rivet {
 10
 11
 12  /// @brief azimuthal asymmetries in pi+/- (pi0, eta, pi+-) production
 13  class BELLE_2019_I1752523 : public Analysis {
 14  public:
 15
 16    /// Constructor
 17    RIVET_DEFAULT_ANALYSIS_CTOR(BELLE_2019_I1752523);
 18
 19
 20    /// @name Analysis methods
 21    /// @{
 22
 23    /// Book histograms and initialise projections before the run
 24    void init() {
 25      // projections
 26      const FinalState fs;
 27      declare(fs,"FS");
 28      declare(UnstableParticles(Cuts::pid==111 || Cuts::pid==221), "UFS");
 29      declare(Thrust(fs),"Thrust");
 30      declare(Beam(), "Beams");
 31      // histograms
 32      unsigned int nbin=20;
 33      // charged
 34      for (unsigned int ix=0; ix<3; ++ix) {
 35      	// charged in pT bins
 36        for (unsigned int iy=0; iy<4; ++iy) {
 37          book(_h_charged_pt[ix][iy],
 38               "TMP/h_charged_pt_"+toString(ix+1)+"_"+toString(iy+1),
 39               nbin, 0., M_PI);
 40          for (unsigned int iz=0; iz<4; ++iz) {
 41            book(_b_charged_pt[ix][iy][iz],
 42                 "TMP/b_charged_pt_"+toString(ix)+"_"+toString(iy+1)+"_"+toString(iz+1),
 43                 nbin, 0., M_PI);
 44          }
 45        }
 46        // charged in z bins
 47        for (unsigned int iy=0; iy<6; ++iy) {
 48          book(_h_charged_z[ix][iy],
 49               "TMP/h_charged_z_"+toString(ix+1)+"_"+toString(iy+1),
 50               nbin, 0., M_PI);
 51          if (iy==5) continue;
 52          for (unsigned int iz=0; iz<5; ++iz) {
 53            book(_b_charged_z[ix][iy][iz],
 54                 "TMP/b_charged_z_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 55                 nbin, 0., M_PI);
 56          }
 57        }
 58      }
 59      for (unsigned int ix=0; ix<2; ++ix) {
 60        // pi0
 61        for (unsigned int iy=0; iy<4; ++iy) {
 62          book(_h_pi0_pt [ix][iy],"TMP/h_pi0_pt_" +toString(ix+1)+"_"+toString(iy+1),nbin,0.,M_PI);
 63          book(_h_eta_pt [ix][iy],"TMP/h_eta_pt_" +toString(ix+1)+"_"+toString(iy+1),nbin,0.,M_PI);
 64          book(_h_pi0B_pt[ix][iy],"TMP/h_pi0B_pt_"+toString(ix+1)+"_"+toString(iy+1),nbin,0.,M_PI);
 65          for (unsigned int iz=0; iz<4; ++iz) {
 66            book(_b_pi0_pt[ix][iy][iz],
 67                 "TMP/b_pi0_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 68                 nbin, 0., M_PI);
 69            book(_b_eta_pt[ix][iy][iz],
 70                 "TMP/b_eta_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 71                 nbin, 0., M_PI);
 72            book(_b_pi0B_pt[ix][iy][iz],
 73                 "TMP/b_pi0B_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 74                 nbin, 0., M_PI);
 75            book(_b_charged_z_pt[ix][iy][iz],
 76                 "TMP/b_charged_z_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 77                 nbin, 0., M_PI);
 78            book(_b_pi0_z_pt[ix][iy][iz],
 79                 "TMP/b_pi0_z_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 80                 nbin, 0., M_PI);
 81            if (iy>2) continue;
 82            book(_b_eta_z_pt[ix][iy][iz],
 83                 "TMP/b_eta_z_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 84                 nbin, 0., M_PI);
 85            book(_b_pi0B_z_pt[ix][iy][iz],
 86                 "TMP/b_pi0B_z_pt_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 87                 nbin, 0., M_PI);
 88          }
 89        }
 90        // pi0 in z bins
 91        for (unsigned int iy=0; iy<6; ++iy) {
 92          book(_h_pi0_z[ix][iy],
 93               "TMP/h_pi0_z_"+toString(ix+1)+"_"+toString(iy+1),
 94               nbin, 0., M_PI);
 95          if (iy==5) continue;
 96          for (unsigned int iz=0; iz<5; ++iz) {
 97            book(_b_pi0_z[ix][iy][iz],
 98                 "TMP/b_pi0_z_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
 99                 nbin, 0., M_PI);
100          }
101        }
102        // eta in z bins
103        for (unsigned int iy=0; iy<5; ++iy) {
104          book(_h_eta_z [ix][iy],
105               "TMP/h_eta_z_" +toString(ix+1)+"_"+toString(iy+1),
106               nbin, 0., M_PI);
107          book(_h_pi0B_z[ix][iy],
108               "TMP/h_pi0B_z_"+toString(ix+1)+"_"+toString(iy+1),
109               nbin, 0., M_PI);
110          if (iy>2) continue;
111          for (unsigned int iz=0; iz<3; ++iz) {
112            book(_b_eta_z [ix][iy][iz],
113                 "TMP/b_eta_z_" +toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
114                 nbin, 0., M_PI);
115            book(_b_pi0B_z[ix][iy][iz],
116                 "TMP/b_pi0B_z_"+toString(ix+1)+"_"+toString(iy+1)+"_"+toString(iz+1),
117                 nbin, 0., M_PI);
118          }
119        }
120      }
121    }
122
123    unsigned int iBin_z0(double z) {
124      if     (z<.3) return 0;
125      else if(z<.4) return 1;
126      else if(z<.5) return 2;
127      else if(z<.6) return 3;
128      else if(z<.7) return 4;
129      else          return 5;
130    }
131
132    unsigned int iBin_z1(double z) {
133      if     (z<.2) return 0;
134      else if(z<.3) return 1;
135      else if(z<.5) return 2;
136      else if(z<.7) return 3;
137      else          return 4;
138    }
139
140    unsigned int iBin_pT1(double pT) {
141      if     (pT<.15) return 0;
142      else if(pT<.3 ) return 1;
143      else if(pT<.5 ) return 2;
144      else            return 3;
145    }
146
147    /// Perform the per-event analysis
148    void analyze(const Event& event) {
149      static const double c03 = cos(0.3);
150      // get the axis, direction of incoming electron
151      const ParticlePair& beams = apply<Beam>(event, "Beams").beams();
152      Vector3 axis1;
153      if (beams.first.pid()>0) {
154        axis1 = beams.second.mom().p3().unit();
155      }
156      else {
157        axis1 = beams.first .mom().p3().unit();
158      }
159      // apply thrust cuts  T > 0.8
160      Thrust thrust = apply<Thrust>(event,"Thrust");
161      if (thrust.thrust()<=0.8) vetoEvent;
162      ThreeVector t_z = thrust.thrustAxis();
163      ThreeVector t_x = (axis1-t_z.dot(axis1)*t_z).unit();
164      ThreeVector t_y = t_z.cross(t_x);
165      double cThetaT = t_z.dot(axis1);
166      static double cTheta[2]={cos(1.34),cos(2.03)};
167      if(cThetaT<cTheta[1] || cThetaT>cTheta[0]) vetoEvent;
168      Vector3 cross = axis1.cross(t_z);
169      Particles charged = apply<FinalState>(event,"FS").particles(Cuts::abspid==PID::PIPLUS);
170      Particles neutral = apply<UnstableParticles>(event,"UFS").particles();
171      // first charged particle
172      for (unsigned int ix=0; ix<charged.size(); ++ix) {
173        // z and angle cut
174        const double x1=2.*charged[ix].mom().t()/sqrtS();
175        double dot1 = t_z.dot(charged[ix].p3().unit());
176        if (abs(dot1)<c03 || x1<0.1) continue;
177        // second charged particle
178        for (unsigned int iy=ix+1; iy<charged.size(); ++iy) {
179          const double x2=2.*charged[iy].mom().t()/sqrtS();
180          double dot2 = t_z.dot(charged[iy].p3().unit());
181          if(abs(dot2)<c03 || x2<0.1 || dot1*dot2>0) continue;
182          // randomly order the particles
183          Particle p1=charged[ix], p2=charged[iy];
184          double z1(x1),z2(x2);
185          if (rand01() < 0.5 ) {
186            swap(p1,p2);
187            swap(z1,z2);
188          }
189          const double pT1 = sqrt(sqr(dot(p1.mom().p3(), thrust.thrustMajorAxis())) +
190                                  sqr(dot(p1.mom().p3(), thrust.thrustMinorAxis())));
191          const double pT2 = sqrt(sqr(dot(p2.mom().p3(), thrust.thrustMajorAxis())) +
192                                  sqr(dot(p2.mom().p3(), thrust.thrustMinorAxis())));
193          if (pT1>3. || pT2>3.) continue;
194          double phi12 = atan2(p1.p3().dot(t_y),p1.p3().dot(t_x))+atan2(p2.p3().dot(t_y),p2.p3().dot(t_x));
195          if (phi12>M_PI)  phi12 -= 2*M_PI;
196          if (phi12<-M_PI) phi12 += 2*M_PI;
197          if (phi12<0.) phi12 = -phi12;
198          if (z1>.2&&z2>.2) {
199            unsigned int ibin = iBin_z0(z1);
200            unsigned int ipT1 = iBin_pT1(pT1);
201            unsigned int ipT2 = iBin_pT1(pT2);
202            unsigned int ibin1 = iBin_z1(z1)-1;
203            if (p1.pid()*p2.pid()>0) {
204              _h_charged_z [0][ibin]->fill(phi12);
205              _h_charged_pt[0][ipT1]->fill(phi12);
206              _b_charged_pt[0][ipT1][ipT2]->fill(phi12);
207              _h_pi0_z[1][ibin]->fill(phi12);
208              _h_pi0_pt[1][ipT1]->fill(phi12);
209              _b_pi0_pt[1][ipT1][ipT2]->fill(phi12);
210              _b_pi0_z_pt[1][ibin1][ipT1]->fill(phi12);
211              if (z1>.3 && z2>.3) {
212                _h_eta_z [1][ibin-1]->fill(phi12);
213                _h_pi0B_z[1][ibin-1]->fill(phi12);
214                _h_eta_pt [1][ipT1]->fill(phi12);
215                _h_pi0B_pt[1][ipT1]->fill(phi12);
216                _b_eta_pt [1][ipT1][ipT2]->fill(phi12);
217                _b_pi0B_pt[1][ipT1][ipT2]->fill(phi12);
218                _b_eta_z_pt [1][ibin1-1][ipT1]->fill(phi12);
219                _b_pi0B_z_pt[1][ibin1-1][ipT1]->fill(phi12);
220              }
221            }
222            else {
223              _h_charged_z [1][ibin]->fill(phi12);
224              _h_charged_pt[1][ipT1]->fill(phi12);
225              _b_charged_pt[1][ipT1][ipT2]->fill(phi12);
226              _b_charged_z_pt[0][ibin1][ipT1]->fill(phi12);
227            }
228            _h_charged_z [2][ibin]->fill(phi12);
229            _h_charged_pt[2][ipT1]->fill(phi12);
230            _b_charged_pt[2][ipT1][ipT2]->fill(phi12);
231            _b_charged_z_pt[1][ibin1][ipT1]->fill(phi12);
232          }
233          unsigned int ibin1 = iBin_z1(z1), ibin2 = iBin_z1(z2);
234          if (p1.pid()*p2.pid()>0) {
235            _b_charged_z[0][ibin1][ibin2]->fill(phi12);
236            _b_pi0_z[1][ibin1][ibin2]->fill(phi12);
237            if (z1>.3 && z2>.3) {
238              _b_eta_z [1][ibin1-2][ibin2-2]->fill(phi12);
239              _b_pi0B_z[1][ibin1-2][ibin2-2]->fill(phi12);
240            }
241          }
242          else {
243            _b_charged_z[1][ibin1][ibin2]->fill(phi12);
244          }
245          _b_charged_z[2][ibin1][ibin2]->fill(phi12);
246        }
247        // pi0 or eta
248        for (unsigned int iy=0;iy<neutral.size();++iy) {
249          const double x2=2.*neutral[iy].mom().t()/sqrtS();
250          double dot2 = t_z.dot(neutral[iy].p3().unit());
251          if (abs(dot2)<c03 || x2<0.2 || dot1*dot2>0) continue;
252          // neutral particle first
253          Particle p2=charged[ix], p1=neutral[iy];
254          double z1(x2),z2(x1);
255          const double pT1 = sqrt(sqr(dot(p1.mom().p3(), thrust.thrustMajorAxis())) +
256                                  sqr(dot(p1.mom().p3(), thrust.thrustMinorAxis())));
257          const double pT2 = sqrt(sqr(dot(p2.mom().p3(), thrust.thrustMajorAxis())) +
258                  sqr(dot(p2.mom().p3(), thrust.thrustMinorAxis())));
259          if (pT1>3. || pT2>3.) continue;
260          double phi12 = atan2(p1.p3().dot(t_y),p1.p3().dot(t_x))+atan2(p2.p3().dot(t_y),p2.p3().dot(t_x));
261          if (phi12>M_PI)  phi12 -= 2*M_PI;
262          if (phi12<-M_PI) phi12 += 2*M_PI;
263          if (phi12<0.) phi12 = -phi12;
264          if (z1>.2) {
265            unsigned int ibin = iBin_z0(z1);
266            unsigned int ipT1 = iBin_pT1(pT1);
267            unsigned int ipT2 = iBin_pT1(pT2);
268            unsigned int ibin1 = iBin_z1(z1)-1;
269            if (p1.pid()==111) {
270              _h_pi0_z[0][ibin]->fill(phi12);
271              _h_pi0_pt[0][ipT1]->fill(phi12);
272              _b_pi0_pt[0][ipT1][ipT2]->fill(phi12);
273              _b_pi0_z_pt[0][ibin1][ipT1]->fill(phi12);
274              if (z1>.3 && z2>.3) {
275                _h_pi0B_z[0][ibin-1]->fill(phi12);
276                _h_pi0B_pt[0][ipT1]->fill(phi12);
277                _b_pi0B_pt[0][ipT1][ipT2]->fill(phi12);
278                _b_pi0B_z_pt[0][ibin1-1][ipT1]->fill(phi12);
279              }
280            }
281            else if (z1>.3 && z2>.3) {
282              _h_eta_z [0][ibin-1]->fill(phi12);
283              _h_eta_pt [0][ipT1]->fill(phi12);
284              _b_eta_pt [0][ipT1][ipT2]->fill(phi12);
285              _b_eta_z_pt [0][ibin1-1][ipT1]->fill(phi12);
286            }
287          }
288          unsigned int ibin1 = iBin_z1(z1), ibin2 = iBin_z1(z2);
289          if (p1.pid()==111) {
290            _b_pi0_z[0][ibin1][ibin2]->fill(phi12);
291            if (z1>.3 && z2>.3) _b_pi0B_z[0][ibin1-2][ibin2-2]->fill(phi12);
292          }
293          else if (z1>.3 && z2>.3) {
294            _b_eta_z [0][ibin1-2][ibin2-2]->fill(phi12);
295          }
296        }
297      }
298    }
299
300    pair<double,double> calcAsymmetry(Estimate1DPtr hist, double fact=1.) {
301      double sum1(0.),sum2(0.);
302      for (const auto& bin : hist->bins() ) {
303        double Oi = bin.val();
304        if (Oi==0. || std::isnan(Oi)) continue;
305        double ai = 1.;
306        double bi = (sin(fact*bin.xMax())-sin(fact*bin.xMin()))/(bin.xMax()-bin.xMin())/fact;
307        double Ei = bin.errAvg();
308        sum1 += sqr(bi/Ei);
309        sum2 += bi/sqr(Ei)*(Oi-ai);
310      }
311      if (sum1==0.) return make_pair(0.,0.);
312      return make_pair(sum2/sum1*1e2,sqrt(1./sum1)*1e2);
313    }
314
315    /// Normalise histograms etc., after the run
316    void finalize() {
317      // charged in pT bins
318      Estimate1DPtr h_charged_UL,h_charged_UC;
319      book(h_charged_UL,1,1,1);
320      book(h_charged_UC,1,1,2);
321      Estimate1DPtr h_pi0_UL,h_eta_UL,h_pi0B_UL;
322      book(h_pi0_UL,6,1,1);
323      book(h_eta_UL,7,1,1);
324      book(h_pi0B_UL,8,1,1);
325      for (unsigned int ix=0;ix<4;++ix) {
326        // first the 1d dists
327        for (unsigned int ii=0; ii<3; ++ii) {
328          normalize(_h_charged_pt[ii][ix]);
329          if (ii==2) continue;
330      	  normalize(_h_pi0_pt [ii][ix]);
331      	  normalize(_h_eta_pt [ii][ix]);
332      	  normalize(_h_pi0B_pt[ii][ix]);
333        }
334        Estimate1DPtr htemp;
335        // UL
336        // charged
337        book(htemp,"TMP/R_charged_pt_UL_"+toString(ix),_h_charged_pt[1][ix]->xEdges());
338        divide(_h_charged_pt[1][ix],_h_charged_pt[0][ix],htemp);
339        pair<double,double> asym = calcAsymmetry(htemp);
340        h_charged_UL->bin(ix+1).setVal(asym.first );
341        h_charged_UL->bin(ix+1).setErr(asym.second);
342        // UC
343        book(htemp,"TMP/R_charged_pt_UC_"+toString(ix),_h_charged_pt[1][ix]->xEdges());
344        divide(_h_charged_pt[1][ix],_h_charged_pt[2][ix],htemp);
345        asym = calcAsymmetry(htemp);
346        h_charged_UC->bin(ix+1).setVal(asym.first );
347        h_charged_UC->bin(ix+1).setErr(asym.second);
348        // pi0
349        book(htemp,"TMP/R_pi0_pt_UL_"+toString(ix),_h_pi0_pt[0][ix]->xEdges());
350        divide(_h_pi0_pt[0][ix],_h_pi0_pt[1][ix],htemp);
351        asym = calcAsymmetry(htemp);
352        h_pi0_UL->bin(ix+1).setVal(asym.first );
353        h_pi0_UL->bin(ix+1).setErr(asym.second);
354        // eta
355        book(htemp,"TMP/R_eta_pt_UL_"+toString(ix),_h_eta_pt[0][ix]->xEdges());
356        divide(_h_eta_pt[0][ix],_h_eta_pt[1][ix],htemp);
357        asym = calcAsymmetry(htemp);
358        h_eta_UL->bin(ix+1).setVal(asym.first );
359        h_eta_UL->bin(ix+1).setErr(asym.second);
360        // pi0 z>.3
361        book(htemp,"TMP/R_pi0B_pt_UL_"+toString(ix),_h_pi0B_pt[0][ix]->xEdges());
362        divide(_h_pi0B_pt[0][ix],_h_pi0B_pt[1][ix],htemp);
363        asym = calcAsymmetry(htemp);
364        h_pi0B_UL->bin(ix+1).setVal(asym.first );
365        h_pi0B_UL->bin(ix+1).setErr(asym.second);
366        // then 2nd dists
367        Estimate1DPtr h_charged_UL2,h_charged_UC2;
368        book(h_charged_UL2,1,2+ix,1);
369        book(h_charged_UC2,1,2+ix,2);
370        Estimate1DPtr h_pi0_UL2,h_eta_UL2,h_pi0B_UL2;
371        book(h_pi0_UL2,6,2+ix,1);
372        book(h_eta_UL2,7,2+ix,1);
373        book(h_pi0B_UL2,8,2+ix,1);
374        for (unsigned int iy=0; iy<4; ++iy) {
375          for (unsigned int ii=0; ii<3; ++ii) {
376            normalize(_b_charged_pt[ii][ix][iy]);
377            if(ii==2) continue;
378            normalize(_b_pi0_pt [ii][ix][iy]);
379            normalize(_b_eta_pt [ii][ix][iy]);
380            normalize(_b_pi0B_pt[ii][ix][iy]);
381          }
382          // UL
383          book(htemp,"TMP/R_charged_pt_UL_"+toString(ix)+"_"+toString(iy),_b_charged_pt[1][ix][iy]->xEdges());
384          divide(_b_charged_pt[1][ix][iy],_b_charged_pt[0][ix][iy],htemp);
385          asym = calcAsymmetry(htemp);
386          h_charged_UL2->bin(iy+1).setVal(asym.first );
387          h_charged_UL2->bin(iy+1).setErr(asym.second);
388          // UC
389          book(htemp,"TMP/R_charged_pt_UC_"+toString(ix)+"_"+toString(iy),_b_charged_pt[1][ix][iy]->xEdges());
390          divide(_b_charged_pt[1][ix][iy],_b_charged_pt[2][ix][iy],htemp);
391          asym = calcAsymmetry(htemp);
392          h_charged_UC2->bin(iy+1).setVal(asym.first );
393          h_charged_UC2->bin(iy+1).setErr(asym.second);
394          // pi0
395          book(htemp,"TMP/R_pi0_pt_UL_"+toString(ix)+"_"+toString(iy),_b_pi0_pt[0][ix][iy]->xEdges());
396          divide(_b_pi0_pt[0][ix][iy],_b_pi0_pt[1][ix][iy],htemp);
397          asym = calcAsymmetry(htemp);
398          h_pi0_UL2->bin(iy+1).setVal(asym.first );
399          h_pi0_UL2->bin(iy+1).setErr(asym.second);
400          // eta
401          book(htemp,"TMP/R_eta_pt_UL_"+toString(ix)+"_"+toString(iy),_b_eta_pt[0][ix][iy]->xEdges());
402          divide(_b_eta_pt[0][ix][iy],_b_eta_pt[1][ix][iy],htemp);
403          asym = calcAsymmetry(htemp);
404          h_eta_UL2->bin(iy+1).setVal(asym.first );
405          h_eta_UL2->bin(iy+1).setErr(asym.second);
406          // pi0 z>0.3
407          book(htemp,"TMP/R_pi0B_pt_UL_"+toString(ix)+"_"+toString(iy),_b_pi0B_pt[0][ix][iy]->xEdges());
408          divide(_b_pi0B_pt[0][ix][iy],_b_pi0B_pt[1][ix][iy],htemp);
409          asym = calcAsymmetry(htemp);
410          h_pi0B_UL2->bin(iy+1).setVal(asym.first );
411          h_pi0B_UL2->bin(iy+1).setErr(asym.second);
412        }
413      }
414      // charged and pi0 in z bins
415      book(h_charged_UL,2,1,1);
416      book(h_charged_UC,2,1,2);
417      book(h_pi0_UL,3,1,1);
418      book(h_eta_UL,4,1,1);
419      book(h_pi0B_UL,5,1,1);
420      for(unsigned int ix=0; ix<6; ++ix) {
421      	// first the 1d dists
422      	for(unsigned int ii=0; ii<3; ++ii) {
423          normalize(_h_charged_z[ii][ix]);
424       	  if (ii==2) continue;
425       	  normalize(_h_pi0_z [ii][ix]);
426          if (ix==5) continue;
427       	  normalize(_h_eta_z [ii][ix]);
428       	  normalize(_h_pi0B_z[ii][ix]);
429        }
430        Estimate1DPtr htemp;
431        // UL
432        // charged
433        book(htemp,"TMP/R_charged_z_UL_"+toString(ix),_h_charged_z[1][ix]->xEdges());
434        divide(_h_charged_z[1][ix],_h_charged_z[0][ix],htemp);
435        pair<double,double> asym = calcAsymmetry(htemp);
436        h_charged_UL->bin(ix+1).setVal(asym.first );
437        h_charged_UL->bin(ix+1).setErr(asym.second);
438        // UC
439        book(htemp,"TMP/R_charged_z_UC_"+toString(ix),_h_charged_z[1][ix]->xEdges());
440        divide(_h_charged_z[1][ix],_h_charged_z[2][ix],htemp);
441        asym = calcAsymmetry(htemp);
442        h_charged_UC->bin(ix+1).setVal(asym.first );
443        h_charged_UC->bin(ix+1).setErr(asym.second);
444        // pi0
445        book(htemp,"TMP/R_pi0_z_UL_"+toString(ix),_h_pi0_z[0][ix]->xEdges());
446        divide(_h_pi0_z[0][ix],_h_pi0_z[1][ix],htemp);
447        asym = calcAsymmetry(htemp);
448        h_pi0_UL->bin(ix+1).setVal(asym.first );
449        h_pi0_UL->bin(ix+1).setErr(asym.second);
450        if (ix==5) continue;
451        // eta
452        book(htemp,"TMP/R_eta_z_UL_"+toString(ix),_h_eta_z[0][ix]->xEdges());
453        divide(_h_eta_z[0][ix],_h_eta_z[1][ix],htemp);
454        asym = calcAsymmetry(htemp);
455        h_eta_UL->bin(ix+1).setVal(asym.first );
456        h_eta_UL->bin(ix+1).setErr(asym.second);
457        // pi0 z>.3
458        book(htemp,"TMP/R_pi0B_z_UL_"+toString(ix),_h_pi0B_z[0][ix]->xEdges());
459        divide(_h_pi0B_z[0][ix],_h_pi0B_z[1][ix],htemp);
460        asym = calcAsymmetry(htemp);
461        h_pi0B_UL->bin(ix+1).setVal(asym.first );
462        h_pi0B_UL->bin(ix+1).setErr(asym.second);
463        // then 2nd dists
464        Estimate1DPtr h_charged_UL2,h_charged_UC2;
465        book(h_charged_UL2,2,2+ix,1);
466        book(h_charged_UC2,2,2+ix,2);
467      	Estimate1DPtr h_pi0_UL2,h_eta_UL2,h_pi0B_UL2;
468      	book(h_pi0_UL2,3,2+ix,1);
469        if (ix<3) {
470          book(h_eta_UL2,4,2+ix,1);
471          book(h_pi0B_UL2,5,2+ix,1);
472        }
473      	for (unsigned int iy=0; iy<5; ++iy) {
474      	  for (unsigned int ii=0; ii<3 ;++ii) {
475      	    normalize(_b_charged_z[ii][ix][iy]);
476       	    if (ii==2) continue;
477            normalize(_b_pi0_z [ii][ix][iy]);
478            if (ix>2||iy>2) continue;
479            normalize(_b_eta_z [ii][ix][iy]);
480            normalize(_b_pi0B_z[ii][ix][iy]);
481       	  }
482          // UL
483          book(htemp,"TMP/R_charged_z_UL_"+toString(ix)+"_"+toString(iy),_b_charged_z[1][ix][iy]->xEdges());
484          divide(_b_charged_z[1][ix][iy],_b_charged_z[0][ix][iy],htemp);
485          asym = calcAsymmetry(htemp);
486          h_charged_UL2->bin(iy+1).setVal(asym.first );
487          h_charged_UL2->bin(iy+1).setErr(asym.second);
488          // UC
489          book(htemp,"TMP/R_charged_z_UC_"+toString(ix)+"_"+toString(iy),_b_charged_z[1][ix][iy]->xEdges());
490          divide(_b_charged_z[1][ix][iy],_b_charged_z[2][ix][iy],htemp);
491          asym = calcAsymmetry(htemp);
492          h_charged_UC2->bin(iy+1).setVal(asym.first );
493          h_charged_UC2->bin(iy+1).setErr(asym.second);
494          // pi0
495          book(htemp,"TMP/R_pi0_z_UL_"+toString(ix)+"_"+toString(iy),_b_pi0_z[0][ix][iy]->xEdges());
496          divide(_b_pi0_z[0][ix][iy],_b_pi0_z[1][ix][iy],htemp);
497          asym = calcAsymmetry(htemp);
498          h_pi0_UL2->bin(iy+1).setVal(asym.first );
499          h_pi0_UL2->bin(iy+1).setErr(asym.second);
500          if(ix>2||iy>2) continue;
501          // eta
502          book(htemp,"TMP/R_eta_z_UL_"+toString(ix)+"_"+toString(iy),_b_eta_z[0][ix][iy]->xEdges());
503          divide(_b_eta_z[0][ix][iy],_b_eta_z[1][ix][iy],htemp);
504          asym = calcAsymmetry(htemp);
505          h_eta_UL2->bin(iy+1).setVal(asym.first );
506          h_eta_UL2->bin(iy+1).setErr(asym.second);
507          // pi0 z>0.3
508          book(htemp,"TMP/R_pi0B_z_UL_"+toString(ix)+"_"+toString(iy),_b_pi0B_z[0][ix][iy]->xEdges());
509          divide(_b_pi0B_z[0][ix][iy],_b_pi0B_z[1][ix][iy],htemp);
510          asym = calcAsymmetry(htemp);
511          h_pi0B_UL2->bin(iy+1).setVal(asym.first );
512          h_pi0B_UL2->bin(iy+1).setErr(asym.second);
513       	}
514      }
515      // finally z and pT
516      // only 2d dists
517      for (unsigned int ix=0;ix<4;++ix) {
518        Estimate1DPtr h_charged_UC2;
519        book(h_charged_UC2,9,1+ix,1);
520        Estimate1DPtr h_pi0_UL2,h_eta_UL2,h_pi0B_UL2;
521        book(h_pi0_UL2,10,1+ix,1);
522        if (ix<3) {
523          book(h_eta_UL2,11,1+ix,1);
524          book(h_pi0B_UL2,12,1+ix,1);
525        }
526      	for (unsigned int iy=0;iy<4;++iy) {
527      	  for (unsigned int ii=0;ii<2;++ii) {
528            normalize(_b_charged_z_pt[ii][ix][iy]);
529            normalize(_b_pi0_z_pt [ii][ix][iy]);
530            if (ix>2) continue;
531      	    normalize(_b_eta_z_pt [ii][ix][iy]);
532      	    normalize(_b_pi0B_z_pt[ii][ix][iy]);
533       	  }
534          pair<double,double> asym;
535          Estimate1DPtr htemp;
536      	  // UC (missing last point for first histo)
537          if (ix!=0 || iy!=3) {
538            book(htemp,"TMP/R_charged_z_pt_UC_"+toString(ix)+"_"+toString(iy),_b_charged_z_pt[0][ix][iy]->xEdges());
539            divide(_b_charged_z_pt[0][ix][iy],_b_charged_z_pt[1][ix][iy],htemp);
540            asym = calcAsymmetry(htemp);
541            h_charged_UC2->bin(iy+1).setVal(asym.first );
542            h_charged_UC2->bin(iy+1).setErr(asym.second);
543            // pi0
544            book(htemp,"TMP/R_pi0_z_pt_UL_"+toString(ix)+"_"+toString(iy),_b_pi0_z_pt[0][ix][iy]->xEdges());
545            divide(_b_pi0_z_pt[0][ix][iy],_b_pi0_z_pt[1][ix][iy],htemp);
546            asym = calcAsymmetry(htemp);
547            h_pi0_UL2->bin(iy+1).setVal(asym.first );
548            h_pi0_UL2->bin(iy+1).setErr(asym.second);
549          }
550          if (ix>2) continue;
551      	  // eta
552      	  book(htemp,"TMP/R_eta_z_pt_UL_"+toString(ix)+"_"+toString(iy),_b_eta_z_pt[0][ix][iy]->xEdges());
553      	  divide(_b_eta_z_pt[0][ix][iy],_b_eta_z_pt[1][ix][iy],htemp);
554      	  asym = calcAsymmetry(htemp);
555      	  h_eta_UL2->bin(iy+1).setVal(asym.first );
556      	  h_eta_UL2->bin(iy+1).setErr(asym.second);
557      	  // pi0 z>0.3
558      	  book(htemp,"TMP/R_pi0B_z_pt_UL_"+toString(ix)+"_"+toString(iy),_b_pi0B_z_pt[0][ix][iy]->xEdges());
559      	  divide(_b_pi0B_z_pt[0][ix][iy],_b_pi0B_z_pt[1][ix][iy],htemp);
560      	  asym = calcAsymmetry(htemp);
561      	  h_pi0B_UL2->bin(iy+1).setVal(asym.first );
562      	  h_pi0B_UL2->bin(iy+1).setErr(asym.second);
563        }
564      }
565    }
566
567    /// @}
568
569
570    /// @name Histograms
571    /// @{
572    Histo1DPtr _h_charged_pt[3][4],_h_charged_z[3][6];
573    Histo1DPtr _b_charged_pt[3][4][4],_b_charged_z[3][5][5],_b_charged_z_pt[2][4][4];
574    Histo1DPtr _h_pi0_z[2][6],_h_eta_z[2][5],_h_pi0B_z[2][5],_h_pi0_pt[2][4],_h_eta_pt[2][4],_h_pi0B_pt[2][4];
575    Histo1DPtr _b_pi0_z[2][5][5],_b_eta_z[2][3][3],_b_pi0B_z[2][3][3],_b_pi0_pt[2][4][4];
576    Histo1DPtr _b_eta_pt[2][4][4],_b_pi0B_pt[2][4][4],_b_pi0_z_pt[2][4][4],_b_pi0B_z_pt[2][3][4],_b_eta_z_pt[2][3][4];
577    /// @}
578  };
579
580
581  RIVET_DECLARE_PLUGIN(BELLE_2019_I1752523);
582
583}