rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

MC_Semi_Leptonic_Decay

MC analysis of the Kinematics in Semi-Leptonic Meson decays
Experiment: ()
Status: VALIDATED
Authors:
  • Peter Richardson
No references listed
Beams: * *
Beam energies: ANY
Run details:
  • Any type of process producing mesons which decay semi-leptonically

Analysis of the kinematics in semileptonic meson decays.

Source code: MC_Semi_Leptonic_Decay.cc
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/UnstableParticles.hh"

namespace Rivet {


  /// @brief Add a short analysis description here
  class MC_Semi_Leptonic_Decay : public Analysis {
  public:

    /// Constructor
    DEFAULT_RIVET_ANALYSIS_CTOR(MC_Semi_Leptonic_Decay);


    /// @name Analysis methods
    //@{

    /// Book histograms and initialise projections before the run
    void init() {

      // Initialise and register projections
      declare(UnstableParticles(), "UFS");

    }

    void findDecayProducts(const Particle & mother,
			   unsigned int & nstable,
			   Particles& lp, Particles& lm,
			   Particles& nu, Particles& nub,
			   Particles& out) {
      for(const Particle & p : mother.children()) {
	int id = p.pid();
     	if ( id == PID::EMINUS || id == PID::MUON ) {
      	  lm .push_back(p);
      	  ++nstable;
      	}
      	else if (id == PID::EPLUS || id == PID::ANTIMUON) {
      	  lp .push_back(p);
      	  ++nstable;
      	}
	else if ( id == PID::NU_E || id == PID::NU_EBAR ) {
      	  nu .push_back(p);
      	  ++nstable;
      	}
      	else if (id == PID::NU_MU || id == PID::NU_MUBAR ) {
      	  nub.push_back(p);
      	  ++nstable;
      	}
	else if (PID::isMeson(id)) {
	  out.push_back(p);
	  ++nstable;
	}
      	else if ( !p.children().empty() ) {
      	  findDecayProducts(p,nstable,lp,lm,nu,nub,out);
      	}
      	else
      	  ++nstable;
      }
    }

    /// Perform the per-event analysis
    void analyze(const Event& event) {
      // loop over unstable particles
      for(const Particle& meson : apply<UnstableParticles>(event, "UFS").particles()) {
	int id = meson.pid();
	// spin 0 mesons
	if(!PID::isMeson(id)) continue;
	if(abs(id)%10!=1) continue;
	unsigned int nstable(0);
	Particles lp, lm, nu, nub, out;
	findDecayProducts(meson,nstable,lp,lm,nu,nub,out);
	if(nstable!=3 || out.size()!=1) continue;
	int ilep=0;
	FourMomentum plep,pmnu=out[0].momentum();
	double me2(0.);
	if( lp.size()==1 && nu.size()==1 && out.size()==1 ) {
	  if(nu[0].pid()  != -lp[0].pid()+1) continue;
	  ilep =  lp[0].pid();
	  plep = nu[0].momentum()+lp[0].momentum();
	  pmnu += nu[0].momentum();
	  me2 = lp[0].mass2();
	}
	else if( lm.size()==1 && nub.size()==1 && out.size()==1 ) {
	  if(nub[0].pid() != -lm[0].pid()-1) continue;
	  ilep =  lm[0].pid();
	  plep = nub[0].momentum()+lm[0].momentum();
	  pmnu += nub[0].momentum();
	  me2 = lm[0].mass2();
	}
	else
	  continue;
	// check if histos already exist
	unsigned int iloc=0; bool found(false);
	while(!found&&iloc<_incoming.size()) {
	  if(_incoming[iloc] == id  &&
	     _outgoing[iloc] == out[0].pid() &&
	     ilep==_outgoingL[iloc]) found=true; 
	  else ++iloc;
	}
	if(!found) {
	  iloc=_incoming.size();
	  _incoming.push_back(id);
	  _outgoing.push_back(out[0].pid());
	  _outgoingL.push_back(ilep);
	  std::ostringstream title;
	  title << "h_" << abs(id);
	  if(id>0) title << "p";
	  else     title << "m";
	  title << "_" << abs(out[0].pid());
	  if(out[0].pid()>0) title << "p";
	  else                 title << "m";
	  title << "_" << abs(ilep);
	  if(ilep>0) title << "p";
	  else       title << "m";
	  title << "_";
	  _energy.push_back(Histo1DPtr());
          book(_energy.back(), title.str()+"energy",
               200,0.0,0.5*meson.mass()/MeV);
          _scale .push_back(Histo1DPtr());
          book(_scale.back(), title.str()+"scale",
               200,0.0,meson.mass()/MeV);
	}
	// add the results to the histogram
	_scale[iloc]->fill(plep.mass()/MeV);
	double ee = 0.5/meson.mass()*(meson.mass2()-pmnu.mass2()+me2);
	_energy[iloc]->fill(ee/MeV);
      }
    }

    /// Normalise histograms etc., after the run
    void finalize() {
      for(unsigned int ix=0;ix<_energy.size();++ix) {
	normalize(_energy);
	normalize(_scale );
      }
    }

    //@}


    /// @name Histograms
    //@{
    /**
     *  PDG codes of the decaying mesons
     */ 
    vector<long> _incoming;
    
    /**
     *  PDG codes of the decay products
     */
    vector<long> _outgoing;  
    
    /**
     *  Identidies of the leptons
     */
    vector<long> _outgoingL;
    
    /**
     *  Histograms
     */
    //@{
    /**
     *  The lepton energy
     */
    vector<Histo1DPtr> _energy;
    
    /**
     *  The \f$q\f$ value
     */
    vector<Histo1DPtr> _scale;
    //@}

  };


  // The hook for the plugin system
  DECLARE_RIVET_PLUGIN(MC_Semi_Leptonic_Decay);


}