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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
| // -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/UnstableParticles.hh"
namespace Rivet {
/// @brief MC Semi-leptonic decay analysis
class MC_Semi_Leptonic_Decay : public Analysis {
public:
/// Constructor
RIVET_DEFAULT_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");
// B decays
bookHistos( 511, -413,-11,5.3);
bookHistos(-511, 413, 11,5.3);
bookHistos( 511, -413,-13,5.3);
bookHistos(-511, 413, 13,5.3);
bookHistos( 521, -423,-11,5.3);
bookHistos(-521, 423, 11,5.3);
bookHistos( 521, -423,-13,5.3);
bookHistos(-521, 423, 13,5.3);
bookHistos( 511, -411,-11,5.3);
bookHistos(-511, 411, 11,5.3);
bookHistos( 511, -411,-13,5.3);
bookHistos(-511, 411, 13,5.3);
bookHistos( 521, -421,-11,5.3);
bookHistos(-521, 421, 11,5.3);
bookHistos( 521, -421,-13,5.3);
bookHistos(-521, 421, 13,5.3);
bookHistos( 511, -415,-11,5.3);
bookHistos(-511, 415, 11,5.3);
bookHistos( 511, -415,-13,5.3);
bookHistos(-511, 415, 13,5.3);
bookHistos( 521, -425,-11,5.3);
bookHistos(-521, 425, 11,5.3);
bookHistos( 521, -425,-13,5.3);
bookHistos(-521, 425, 13,5.3);
bookHistos( 511,-10411,-11,5.3);
bookHistos(-511, 10411, 11,5.3);
bookHistos( 511,-10411,-13,5.3);
bookHistos(-511, 10411, 13,5.3);
bookHistos( 521,-10421,-11,5.3);
bookHistos(-521, 10421, 11,5.3);
bookHistos( 521,-10421,-13,5.3);
bookHistos(-521, 10421, 13,5.3);
bookHistos( 511,-10413,-11,5.3);
bookHistos(-511, 10413, 11,5.3);
bookHistos( 511,-10413,-13,5.3);
bookHistos(-511, 10413, 13,5.3);
bookHistos( 521,-10423,-11,5.3);
bookHistos(-521, 10423, 11,5.3);
bookHistos( 521,-10423,-13,5.3);
bookHistos(-521, 10423, 13,5.3);
bookHistos( 511,-20413,-11,5.3);
bookHistos(-511, 20413, 11,5.3);
bookHistos( 511,-20413,-13,5.3);
bookHistos(-511, 20413, 13,5.3);
bookHistos( 521,-20423,-11,5.3);
bookHistos(-521, 20423, 11,5.3);
bookHistos( 521,-20423,-13,5.3);
bookHistos(-521, 20423, 13,5.3);
bookHistos( 511, -213,-11,5.3);
bookHistos(-511, 213, 11,5.3);
bookHistos( 511, -213,-13,5.3);
bookHistos(-511, 213, 13,5.3);
bookHistos( 521, 113,-11,5.3);
bookHistos(-521, 113, 11,5.3);
bookHistos( 521, 113,-13,5.3);
bookHistos(-521, 113, 13,5.3);
bookHistos( 521, 223,-11,5.3);
bookHistos(-521, 223, 11,5.3);
bookHistos( 521, 223,-13,5.3);
bookHistos(-521, 223, 13,5.3);
bookHistos( 511, -211,-11,5.3);
bookHistos(-511, 211, 11,5.3);
bookHistos( 511, -211,-13,5.3);
bookHistos(-511, 211, 13,5.3);
bookHistos( 521, 111,-11,5.3);
bookHistos(-521, 111, 11,5.3);
bookHistos( 521, 111,-13,5.3);
bookHistos(-521, 111, 13,5.3);
bookHistos( 521, 221,-11,5.3);
bookHistos(-521, 221, 11,5.3);
bookHistos( 521, 221,-13,5.3);
bookHistos(-521, 221, 13,5.3);
bookHistos( 521, 331,-11,5.3);
bookHistos(-521, 331, 11,5.3);
bookHistos( 521, 331,-13,5.3);
bookHistos(-521, 331, 13,5.3);
// D decays
bookHistos( 411,-311,-11,1.9);
bookHistos(-411, 311, 11,1.9);
bookHistos( 411,-311,-13,1.9);
bookHistos(-411, 311, 13,1.9);
bookHistos( 421,-321,-11,1.9);
bookHistos(-421, 321, 11,1.9);
bookHistos( 421,-321,-13,1.9);
bookHistos(-421, 321, 13,1.9);
bookHistos( 411,-313,-11,1.9);
bookHistos(-411, 313, 11,1.9);
bookHistos( 411,-313,-13,1.9);
bookHistos(-411, 313, 13,1.9);
bookHistos( 421,-323,-11,1.9);
bookHistos(-421, 323, 11,1.9);
bookHistos( 421,-323,-13,1.9);
bookHistos(-421, 323, 13,1.9);
bookHistos( 411,-10313,-11,1.9);
bookHistos(-411, 10313, 11,1.9);
bookHistos( 411,-10313,-13,1.9);
bookHistos(-411, 10313, 13,1.9);
bookHistos( 421,-10323,-11,1.9);
bookHistos(-421, 10323, 11,1.9);
bookHistos( 421,-10323,-13,1.9);
bookHistos(-421, 10323, 13,1.9);
bookHistos( 411,-315,-11,1.9);
bookHistos(-411, 315, 11,1.9);
bookHistos( 411,-315,-13,1.9);
bookHistos(-411, 315, 13,1.9);
bookHistos( 421,-325,-11,1.9);
bookHistos(-421, 325, 11,1.9);
bookHistos( 421,-325,-13,1.9);
bookHistos(-421, 325, 13,1.9);
bookHistos( 411, 111,-11,1.9);
bookHistos(-411, 111, 11,1.9);
bookHistos( 411, 111,-13,1.9);
bookHistos(-411, 111, 13,1.9);
bookHistos( 411, 221,-11,1.9);
bookHistos(-411, 221, 11,1.9);
bookHistos( 411, 221,-13,1.9);
bookHistos(-411, 221, 13,1.9);
bookHistos( 411, 331,-11,1.9);
bookHistos(-411, 331, 11,1.9);
bookHistos( 411, 331,-13,1.9);
bookHistos(-411, 331, 13,1.9);
bookHistos( 421,-211,-11,1.9);
bookHistos(-421, 211, 11,1.9);
bookHistos( 421,-211,-13,1.9);
bookHistos(-421, 211, 13,1.9);
bookHistos( 411, 113,-11,1.9);
bookHistos(-411, 113, 11,1.9);
bookHistos( 411, 113,-13,1.9);
bookHistos(-411, 113, 13,1.9);
bookHistos( 411, 223,-11,1.9);
bookHistos(-411, 223, 11,1.9);
bookHistos( 411, 223,-13,1.9);
bookHistos(-411, 223, 13,1.9);
bookHistos( 421,-213,-11,1.9);
bookHistos(-421, 213, 11,1.9);
bookHistos( 421,-213,-13,1.9);
bookHistos(-421, 213, 13,1.9);
// D_s decays
bookHistos( 431, 221,-11,1.9);
bookHistos(-431, 221, 11,1.9);
bookHistos( 431, 221,-13,1.9);
bookHistos(-431, 221, 13,1.9);
bookHistos( 431, 331,-11,1.9);
bookHistos(-431, 331, 11,1.9);
bookHistos( 431, 331,-13,1.9);
bookHistos(-431, 331, 13,1.9);
bookHistos( 431, 333,-11,1.9);
bookHistos(-431, 333, 11,1.9);
bookHistos( 431, 333,-13,1.9);
bookHistos(-431, 333, 13,1.9);
bookHistos( 431, 311,-11,1.9);
bookHistos(-431,-311, 11,1.9);
bookHistos( 431, 311,-13,1.9);
bookHistos(-431,-311, 13,1.9);
bookHistos( 431, 313,-11,1.9);
bookHistos(-431,-313, 11,1.9);
bookHistos( 431, 313,-13,1.9);
bookHistos(-431,-313, 13,1.9);
}
void bookHistos(int id1, int id2, int ilep, double mass) {
_incoming.push_back(id1);
_outgoing.push_back(id2);
_outgoingL.push_back(ilep);
std::ostringstream title;
title << "h_" << abs(id1);
if(id1>0) title << "p";
else title << "m";
title << "_" << abs(id2);
if(id2>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*mass/MeV);
_scale .push_back(Histo1DPtr());
book(_scale.back(), title.str()+"scale" ,200,0.0,mass/MeV);
}
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) {
MSG_WARNING("MC_Semi_Leptonic_Decay" << id << " " << out[0].pid() << " " << " " << ilep << " "
<< meson.mass() << "\n");
continue;
}
// 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
RIVET_DECLARE_PLUGIN(MC_Semi_Leptonic_Decay);
}
|