rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

OPAL_1997_I440103

Polarization of $\phi$, $D^{*+}$ and $B^*$ mesons at LEP1
Experiment: OPAL (LEP)
Inspire ID: 440103
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Z.Phys. C74 (1997) 437-449
Beams: e- e+
Beam energies: ANY
Run details:
  • e+e- to hadrons

Mewasurement of the polarization of $\phi$, $D^{*+}$ and $B^*$ mesons at LEP1

Source code: OPAL_1997_I440103.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/Beam.hh"
  4#include "Rivet/Projections/FinalState.hh"
  5#include "Rivet/Projections/ChargedFinalState.hh"
  6#include "Rivet/Projections/UnstableParticles.hh"
  7#include "Rivet/Projections/Thrust.hh"
  8
  9#define I_KNOW_THE_INITIAL_QUARKS_PROJECTION_IS_DODGY_BUT_NEED_TO_USE_IT
 10#include "Rivet/Projections/InitialQuarks.hh"
 11
 12namespace Rivet {
 13
 14
 15  /// @brief Add a short analysis description here
 16  class OPAL_1997_I440103 : public Analysis {
 17  public:
 18
 19    /// Constructor
 20    RIVET_DEFAULT_ANALYSIS_CTOR(OPAL_1997_I440103);
 21
 22
 23    /// @name Analysis methods
 24    //@{
 25
 26    /// Book histograms and initialise projections before the run
 27    void init() {
 28      // Initialise and register projections
 29      declare(Beam(), "Beams");
 30      declare(Thrust(FinalState()), "Thrust");
 31      declare(ChargedFinalState(), "FS");
 32      declare(InitialQuarks(), "IQF");
 33      declare(UnstableParticles(), "UFS" );
 34
 35      // Book histograms
 36      // B*
 37      book(_h_B , 8,1,1);
 38      book(_h_B2, "/TMP/c_theta_B", 20, -1.,1.);
 39      // phi
 40      book(_h_phi_ctheta , 5,1,1);
 41      book(_h_phi_ctheta2, "/TMP/c_theta_phi2", 20, -1.,1.   );
 42      book(_h_phi_ctheta3, "/TMP/c_theta_phi3", 20, -1.,1.   );
 43      book(_h_phi_ctheta4, "/TMP/c_theta_phi4", 20, -1.,1.   );
 44      book(_h_phi_alpha  , 5,1,2);
 45      book(_h_phi_alpha2 , "/TMP/alpha_phi2", 20, 0.,0.5*M_PI);
 46      book(_h_phi_alpha3 , "/TMP/alpha_phi3", 20, 0.,0.5*M_PI);
 47      book(_h_phi_alpha4 , "/TMP/alpha_phi4", 20, 0.,0.5*M_PI);
 48      book(_h_phi_beta   , 5,1,3);
 49      book(_h_phi_beta2  , "/TMP/beta_phi2", 20, 0.,0.5*M_PI );
 50      book(_h_phi_beta3  , "/TMP/beta_phi3", 20, 0.,0.5*M_PI );
 51      book(_h_phi_beta4  , "/TMP/beta_phi4", 20, 0.,0.5*M_PI );
 52      book(_c_phi_cos_plus , "/TMP/c_phi_cos_plus1");
 53      book(_c_phi_cos_neg  , "/TMP/c_phi_cos_neg1" );
 54      book(_c_phi_sin_plus , "/TMP/c_phi_sin_plus1");
 55      book(_c_phi_sin_neg  , "/TMP/c_phi_sin_neg1" );
 56      book(_c_phi_cos_plus2, "/TMP/c_phi_cos_plus2");
 57      book(_c_phi_cos_neg2 , "/TMP/c_phi_cos_neg2" );
 58      book(_c_phi_sin_plus2, "/TMP/c_phi_sin_plus2");
 59      book(_c_phi_sin_neg2 , "/TMP/c_phi_sin_neg2" );
 60      book(_c_phi_cos_plus3, "/TMP/c_phi_cos_plus3");
 61      book(_c_phi_cos_neg3 , "/TMP/c_phi_cos_neg3" );
 62      book(_c_phi_sin_plus3, "/TMP/c_phi_sin_plus3");
 63      book(_c_phi_sin_neg3 , "/TMP/c_phi_sin_neg3" );
 64      // D*
 65      book(_h_DS_ctheta , 6,1,1);
 66      book(_h_DS_ctheta2, "/TMP/c_theta_DS2", 20, -1.,1.   );
 67      book(_h_DS_alpha  , 7,1,1);
 68      book(_h_DS_alpha2 , "/TMP/alpha_DS2", 20, 0.,0.5*M_PI);
 69    }
 70
 71
 72    /// Perform the per-event analysis
 73    void analyze(const Event& event) {
 74      // First, veto on leptonic events by requiring at least 4 charged FS particles
 75      const FinalState& fs = apply<FinalState>(event, "FS");
 76      const size_t numParticles = fs.particles().size();
 77
 78      // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
 79      if (numParticles < 2) {
 80        MSG_DEBUG("Failed leptonic event cut");
 81        vetoEvent;
 82      }
 83      MSG_DEBUG("Passed leptonic event cut");
 84
 85      // Get beams and average beam momentum
 86      const ParticlePair& beams = apply<Beam>(event, "Beams").beams();
 87      const double meanBeamMom = ( beams.first.p3().mod() +
 88                                   beams.second.p3().mod() ) / 2.0;
 89      MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
 90      Vector3 axis;
 91      if(beams.first.pid()>0)
 92	axis = beams.first .momentum().p3().unit();
 93      else
 94	axis = beams.second.momentum().p3().unit();
 95      // thrust, to define an axis
 96      const Thrust& thrust = apply<Thrust>(event, "Thrust");
 97      
 98      int flavour = 0;
 99      const InitialQuarks& iqf = apply<InitialQuarks>(event, "IQF");
100
101      // If we only have two quarks (qqbar), just take the flavour.
102      // If we have more than two quarks, look for the highest energetic q-qbar pair.
103      /// @todo Yuck... does this *really* have to be quark-based?!?
104      if (iqf.particles().size() == 2) {
105        flavour = iqf.particles().front().abspid();
106      } else {
107        map<int, double> quarkmap;
108        for (const Particle& p : iqf.particles()) {
109          if (quarkmap[p.pid()] < p.E()) {
110            quarkmap[p.pid()] = p.E();
111          }
112        }
113        double maxenergy = 0.;
114        for (int i = 1; i <= 5; ++i) {
115          if (quarkmap[i]+quarkmap[-i] > maxenergy) {
116            flavour = i;
117          }
118        }
119      }
120
121      // loop over the particles
122      for (const Particle& p : apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==513 or Cuts::abspid==523 or
123										Cuts::pid==333    or Cuts::abspid==413)) {
124	int sign = p.pid()/p.abspid();
125	Particle decay;
126	if(p.children().size()!=2) continue;
127	// B*
128	if(p.abspid()==513 or p.abspid()==523) {
129	  int mid = p.abspid()-2;
130	  if(p.children()[0].pid()==sign*mid && 
131	     p.children()[1].pid()==22) {
132	    decay = p.children()[1];
133	  }
134	  else if(p.children()[1].pid()==sign*mid && 
135		  p.children()[0].pid()==22) {
136	    decay = p.children()[0];
137	  }
138	  else
139	    continue;
140	}
141	// phi
142	else if(p.pid()==333) {
143	  // cut x_E > 0.7
144	  double xE = p.momentum().E()/meanBeamMom;
145	  if(xE<0.7) continue;
146	  if(p.children()[0].pid()== 321 && 
147	     p.children()[1].pid()==-321) {
148	    decay = p.children()[0];
149	  }
150	  else if(p.children()[1].pid()== 321 && 
151		  p.children()[0].pid()==-321) {
152	    decay = p.children()[1];
153	  }
154	  else
155	    continue;
156	}
157	// D*
158	else if(p.abspid()==413) {
159	  double xE = p.momentum().E()/meanBeamMom;
160	  if(xE<0.5 || flavour!=4) continue;
161	  if(p.children()[0].pid()==sign*421 && 
162	     p.children()[1].pid()==sign*211) {
163	    decay = p.children()[1];
164	  }
165	  else if(p.children()[1].pid()==sign*421 && 
166		  p.children()[0].pid()==sign*211) {
167	    decay = p.children()[0];
168	  }
169	  else
170	    continue;
171	  
172	}
173	LorentzTransform boost = LorentzTransform::mkFrameTransformFromBeta(p.momentum().betaVec());
174	Vector3 e1z = p.p3().unit();	
175	FourMomentum pp = boost.transform(decay.momentum());
176	Vector3 axis1 = boost.transform(decay.momentum()).p3().unit();
177	double ctheta = e1z.dot(axis1);
178	if(p.abspid()==513 or p.abspid()==523) {
179	  _h_B ->fill(ctheta);
180	  _h_B2->fill(ctheta);
181	}
182	// D*
183	else if(p.abspid()==413) {
184	  // y and z axis
185	  Vector3 e1y = e1z.cross(axis).unit();
186	  Vector3 e1x = e1y.cross(e1z).unit();
187	  // helicity beam axis, all phis
188	  // cos theta_H
189	  _h_DS_ctheta ->fill(ctheta);
190	  _h_DS_ctheta2->fill(ctheta);
191	  // alpha
192	  double phi = atan2(e1y.dot(axis1),e1x.dot(axis1));
193	  double alpha = abs(abs(phi)-0.5*M_PI);
194	  _h_DS_alpha   ->fill(alpha);
195	  _h_DS_alpha2  ->fill(alpha);
196	}
197	else if(p.pid()==333) {
198	  // y and z axis
199	  Vector3 e1y = e1z.cross(axis).unit();
200	  Vector3 e1x = e1y.cross(e1z).unit();
201	  // helicity beam axis, all phis
202	  // cos theta_H
203	  _h_phi_ctheta->fill(abs(ctheta));
204	  _h_phi_ctheta2->fill(ctheta);
205	  // alpha and beta
206	  double phi = atan2(e1y.dot(axis1),e1x.dot(axis1));
207	  double alpha = abs(abs(phi)-0.5*M_PI);
208	  double beta =  abs(abs(phi+0.25*M_PI)-0.5*M_PI);
209	  _h_phi_alpha   ->fill(alpha);
210	  _h_phi_alpha2  ->fill(alpha);
211	  _h_phi_beta    ->fill( beta);
212	  _h_phi_beta2   ->fill( beta);
213	  /// counters for asymmetries
214	  double sin2H = 2.*ctheta*sqrt(1.-sqr(ctheta));
215	  if(sin2H*cos(phi)>0.) 
216	    _c_phi_cos_plus->fill();
217	  else
218	    _c_phi_cos_neg->fill();
219	  if(sin2H*sin(phi)>0.) 
220	    _c_phi_sin_plus->fill();
221	  else
222	    _c_phi_sin_neg->fill();
223	  // whether or not is a primary hadron
224	  Particle parent = p.parents()[0];
225	  if(parent.children().size()==1 && parent.abspid()==p.abspid())
226	    parent = parent.parents()[0];
227	  bool primary = !PID::isHadron(parent.pid());
228	  if(primary) {
229	    // cos theta_H
230	    _h_phi_ctheta3->fill(ctheta);
231	    // alpha and beta
232	    _h_phi_alpha3  ->fill(alpha);
233	    _h_phi_beta3   ->fill( beta);
234	    /// counters for asymmetries
235	    if(sin2H*cos(phi)>0.) 
236	      _c_phi_cos_plus2->fill();
237	    else
238	      _c_phi_cos_neg2->fill();
239	    if(sin2H*sin(phi)>0.) 
240	      _c_phi_sin_plus2->fill();
241	    else
242	      _c_phi_sin_neg2->fill();
243	  }
244	  // pT w.r.t thrust axis
245	  double pT = sqrt(sqr(thrust.thrustMajorAxis().dot(p.momentum().p3()))+
246			   sqr(thrust.thrustMinorAxis().dot(p.momentum().p3())));
247	  // helicity-quark frame
248	  if(pT>1.2) {
249	    // cos theta H
250	    _h_phi_ctheta4->fill(ctheta);
251	    Vector3 axis2;
252	    if(p.momentum().p3().dot(thrust.thrustAxis())>=0.) {
253	      axis2 = thrust.thrustAxis();
254	    }
255	    else {
256	      axis2 =-thrust.thrustAxis();
257	    }
258	    Vector3 e2y = e1z.cross(axis2).unit();
259	    Vector3 e2x = e2y.cross(e1z).unit();
260	    // alpha and beta
261	    double phi = atan2(e2y.dot(axis1),e2x.dot(axis1));
262	    double alpha = abs(abs(phi)-0.5*M_PI);
263	    double beta =  abs(abs(phi+0.25*M_PI)-0.5*M_PI);
264	    _h_phi_alpha4  ->fill(alpha);
265	    _h_phi_beta4   ->fill( beta);
266	    /// counters for asymmetries
267	    double sin2H = 2.*ctheta*sqrt(1.-sqr(ctheta));
268	    if(sin2H*cos(phi)>0.) 
269	      _c_phi_cos_plus3->fill();
270	    else
271	      _c_phi_cos_neg3->fill();
272	    if(sin2H*sin(phi)>0.) 
273	      _c_phi_sin_plus3->fill();
274	    else
275	      _c_phi_sin_neg3->fill();
276	    
277	  }
278	}
279      }
280    }
281    
282    pair<double,double> calcRho(Histo1DPtr hist,unsigned int mode) {
283      if(hist->numEntries()==0.) return make_pair(0.,0.);
284      double sum1(0.),sum2(0.);
285      for (auto bin : hist->bins() ) {
286	double Oi = bin.area();
287	if(Oi==0.) continue;
288	double ai(0.),bi(0.);
289	if(mode==0) {
290	  ai = 0.25*( -bin.xMin()*(3.-sqr(bin.xMin())) + bin.xMax()*(3.-sqr(bin.xMax())));
291	  bi =-0.75*( -bin.xMin()*(1.-sqr(bin.xMin())) + bin.xMax()*(1.-sqr(bin.xMax())));
292	}
293	else if(mode==1) {
294	  ai = 0.125*( -bin.xMin()*(3.+sqr(bin.xMin())) + bin.xMax()*(3.+sqr(bin.xMax())));
295	  bi = 0.375*( -bin.xMin()*(1.-sqr(bin.xMin())) + bin.xMax()*(1.-sqr(bin.xMax())));
296	}
297	else if(mode==2) {
298	  ai = -2.*(bin.xMin()-bin.xMax())/M_PI;
299	  bi = -2.*(sin(2.*bin.xMin())-sin(2.*bin.xMax()))/M_PI;
300	}
301	double Ei = bin.areaErr();
302	sum1 += sqr(bi/Ei);
303	sum2 += bi/sqr(Ei)*(Oi-ai);
304      }
305      return make_pair(sum2/sum1,sqrt(1./sum1));
306    }
307
308    /// Normalise histograms etc., after the run
309    void finalize() {
310      // B*
311      normalize(_h_B,1.,false);
312      normalize(_h_B2);
313      pair<double,double> rho = calcRho(_h_B2,1);
314      Scatter2DPtr h_rhoB;
315      book(h_rhoB,4,1,1);
316      h_rhoB->addPoint(91.2, rho.first, make_pair(0.5,0.5),
317		       make_pair(rho.second,rho.second) );
318      // D*
319      normalize(_h_DS_ctheta );
320      normalize(_h_DS_ctheta2);
321      rho = calcRho(_h_DS_ctheta2,1);
322      Scatter2DPtr h_rhoD;
323      book(h_rhoD,3,1,1);
324      h_rhoD->addPoint(1., rho.first, make_pair(0.5,0.5),
325			make_pair(rho.second,rho.second) );
326      normalize(_h_DS_alpha );
327      normalize(_h_DS_alpha2);
328      Scatter2DPtr h_reRho_D;
329      book(h_reRho_D,3,1,2);
330      rho = calcRho(_h_DS_alpha2,2);
331      h_reRho_D->addPoint(1., rho.first, make_pair(0.5,0.5),
332			  make_pair(rho.second,rho.second) );
333      // phi
334      // rho00
335      normalize(_h_phi_ctheta );
336      normalize(_h_phi_ctheta2);
337      normalize(_h_phi_ctheta3);
338      normalize(_h_phi_ctheta4);
339      Scatter2DPtr hrho_phi;
340      book(hrho_phi,1,1,1);
341      rho = calcRho(_h_phi_ctheta2,0);
342      hrho_phi->addPoint(1., rho.first, make_pair(0.5,0.5),
343			 make_pair(rho.second,rho.second) );
344      rho = calcRho(_h_phi_ctheta3,0);
345      hrho_phi->addPoint(2., rho.first, make_pair(0.5,0.5),
346			 make_pair(rho.second,rho.second) );
347      rho = calcRho(_h_phi_ctheta4,0);
348      hrho_phi->addPoint(3., rho.first, make_pair(0.5,0.5),
349			 make_pair(rho.second,rho.second) );
350      // Re rho
351      normalize(_h_phi_alpha );
352      normalize(_h_phi_alpha2);
353      normalize(_h_phi_alpha3);
354      normalize(_h_phi_alpha4);
355      Scatter2DPtr  hreRho_phi;
356      book(hreRho_phi,1,1,2);
357      rho = calcRho(_h_phi_alpha2,2);
358      hreRho_phi->addPoint(1., rho.first, make_pair(0.5,0.5),
359			   make_pair(rho.second,rho.second) );
360      rho = calcRho(_h_phi_alpha3,2);
361      hreRho_phi->addPoint(2., rho.first, make_pair(0.5,0.5),
362			   make_pair(rho.second,rho.second) );
363      rho = calcRho(_h_phi_alpha4,2);
364      hreRho_phi->addPoint(3., rho.first, make_pair(0.5,0.5),
365			   make_pair(rho.second,rho.second) );
366      // Im rho
367      normalize(_h_phi_beta );
368      normalize(_h_phi_beta2);
369      normalize(_h_phi_beta3);
370      normalize(_h_phi_beta4);
371      Scatter2DPtr himRho_phi;
372      book(himRho_phi,1,1,3);
373      rho = calcRho(_h_phi_beta2,2);
374      himRho_phi->addPoint(1., rho.first, make_pair(0.5,0.5),
375			   make_pair(rho.second,rho.second) );
376      rho = calcRho(_h_phi_beta3,2);
377      himRho_phi->addPoint(2., rho.first, make_pair(0.5,0.5),
378			   make_pair(rho.second,rho.second) );
379      rho = calcRho(_h_phi_beta4,2);
380      himRho_phi->addPoint(3., rho.first, make_pair(0.5,0.5),
381			   make_pair(rho.second,rho.second) );
382      // real diff
383      Scatter1D temp = (*_c_phi_cos_plus-*_c_phi_cos_neg)/(*_c_phi_cos_plus+*_c_phi_cos_neg);
384      Scatter1D temp2 = (*_c_phi_cos_plus2-*_c_phi_cos_neg2)/(*_c_phi_cos_plus2+*_c_phi_cos_neg2);
385      Scatter1D temp3 = (*_c_phi_cos_plus3-*_c_phi_cos_neg3)/(*_c_phi_cos_plus3+*_c_phi_cos_neg3);
386      Scatter2DPtr hreDiff_phi;
387      book(hreDiff_phi,1,1,4);
388      hreDiff_phi->addPoint(1., temp.points()[0].x(), make_pair(0.5,0.5),
389			    make_pair(temp.points()[0].xErrMinus(),temp.points()[0].xErrPlus()) );
390      hreDiff_phi->addPoint(2., temp2.points()[0].x(), make_pair(0.5,0.5),
391			    make_pair(temp2.points()[0].xErrMinus(),temp2.points()[0].xErrPlus()) );
392      hreDiff_phi->addPoint(3., temp3.points()[0].x(), make_pair(0.5,0.5),
393			    make_pair(temp3.points()[0].xErrMinus(),temp3.points()[0].xErrPlus()) );
394      // im diff
395      temp  = (*_c_phi_sin_plus-*_c_phi_sin_neg)/(*_c_phi_sin_plus+*_c_phi_sin_neg);
396      temp2 = (*_c_phi_sin_plus2-*_c_phi_sin_neg2)/(*_c_phi_sin_plus2+*_c_phi_sin_neg2);
397      temp3 = (*_c_phi_sin_plus3-*_c_phi_sin_neg3)/(*_c_phi_sin_plus3+*_c_phi_sin_neg3);
398      Scatter2DPtr himDiff_phi;
399      book(himDiff_phi,1,1,5);
400      himDiff_phi->addPoint(1., temp.points()[0].x(), make_pair(0.5,0.5),
401			    make_pair(temp.points()[0].xErrMinus(),temp.points()[0].xErrPlus()) );
402      himDiff_phi->addPoint(2., temp2.points()[0].x(), make_pair(0.5,0.5),
403			    make_pair(temp2.points()[0].xErrMinus(),temp2.points()[0].xErrPlus()) );
404      himDiff_phi->addPoint(3., temp3.points()[0].x(), make_pair(0.5,0.5),
405			    make_pair(temp3.points()[0].xErrMinus(),temp3.points()[0].xErrPlus()) );
406    }
407
408    //@}
409
410
411    /// @name Histograms
412    //@{
413    Histo1DPtr _h_B,_h_B2;
414    Histo1DPtr _h_phi_ctheta, _h_phi_ctheta2, _h_phi_ctheta3, _h_phi_ctheta4;
415    Histo1DPtr _h_phi_alpha , _h_phi_alpha2 , _h_phi_alpha3 , _h_phi_alpha4 ;
416    Histo1DPtr _h_phi_beta  , _h_phi_beta2  , _h_phi_beta3  , _h_phi_beta4  ;
417    CounterPtr _c_phi_cos_plus, _c_phi_cos_neg, _c_phi_cos_plus2, _c_phi_cos_neg2, _c_phi_cos_plus3, _c_phi_cos_neg3;
418    CounterPtr _c_phi_sin_plus, _c_phi_sin_neg, _c_phi_sin_plus2, _c_phi_sin_neg2, _c_phi_sin_plus3, _c_phi_sin_neg3;
419    Histo1DPtr _h_DS_ctheta, _h_DS_ctheta2;
420    Histo1DPtr _h_DS_alpha , _h_DS_alpha2 ;
421    //@}
422
423
424  };
425
426
427  // The hook for the plugin system
428  RIVET_DECLARE_PLUGIN(OPAL_1997_I440103);
429
430
431}