Rivet analyses referenceATLAS_2016_I1408878$D^{*\pm}$, $D^\pm$ and $D^\pm_s$ production at 7 TeVExperiment: ATLAS (LHC) Inspire ID: 1408878 Status: VALIDATED Authors:
Beam energies: (3500.0, 3500.0) GeV Run details:
Measurement of the production of $D^{*\pm}$, $D^\pm$ and $D^\pm_s$ production at 7 TeV by the ATLAS collaboration. Source code: ATLAS_2016_I1408878.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief D meson production at 7 TeV
9 class ATLAS_2016_I1408878 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(ATLAS_2016_I1408878);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // projections
22 declare(UnstableParticles(Cuts::abspid==411 or Cuts::abspid==413 or Cuts::abspid==431), "UFS");
23 // histograms
24 for (unsigned int ix=0; ix<3; ++ix) {
25 book(_h_tot[ix], "TMP/_total_"+toString(ix+1), refData(1, 1, 1+ix));
26 book(_e_tot[ix], 1, 1, 1+ix);
27 }
28 for (unsigned int ix=0; ix<2; ++ix) {
29 book(_h_pT[ix], 2, 1, 1+ix);
30 for (unsigned int iy=0; iy<2; ++iy) {
31 book(_h_y[iy][ix], 3+ix, 1, 1+iy);
32 }
33 }
34 }
35
36
37 /// Perform the per-event analysis
38 void analyze(const Event& event) {
39 // Final state of unstable particles to get particle spectra
40 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
41 for (const Particle& p : ufs.particles()) {
42 if (p.children().size()==1) continue;
43 const double abseta = p.abseta();
44 if (abseta>2.1) continue;
45 const double pT = p.perp();
46 if (pT<3.5 || pT>100.) continue;
47
48 unsigned int itype=0;
49 if (p.abspid()==411) itype=1;
50 else if(p.abspid()==431) itype=2;
51 _h_tot[itype]->fill(pT);
52 if (itype<2) {
53 _h_pT[itype]->fill(pT);
54 if (pT<20.) _h_y[itype][0]->fill(abseta);
55 else _h_y[itype][1]->fill(abseta);
56 }
57 }
58 }
59
60
61 /// Normalise histograms etc., after the run
62 void finalize() {
63 const double factor = crossSection()/microbarn/sumOfWeights();
64 for (unsigned int ix=0;ix<2;++ix) {
65 scale(_h_tot[ix],factor);
66 scale(_h_pT[ix],factor);
67 scale(_h_y[ix][0],factor);
68 scale(_h_y[ix][1],1000.*factor);
69 }
70 scale(_h_tot[2],factor);
71 for (unsigned int ix=0;ix<3;++ix) {
72 barchart(_h_tot[ix], _e_tot[ix]);
73 }
74 }
75
76 /// @}
77
78
79 /// @name Histograms
80 /// @{
81 Histo1DPtr _h_pT[2],_h_y[2][2],_h_tot[3];
82 Estimate1DPtr _e_tot[3];
83 /// @}
84
85
86 };
87
88
89 RIVET_DECLARE_PLUGIN(ATLAS_2016_I1408878);
90
91}
|