CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMS_2011_S8978280.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include "Rivet/Analysis.hh"
3 #include "Rivet/RivetAIDA.hh"
4 #include "Rivet/Tools/Logging.hh"
5 #include "Rivet/Projections/UnstableFinalState.hh"
6 #include "Rivet/Projections/Beam.hh"
7 
8 namespace Rivet {
9 
12  class CMS_2011_S8978280 : public Analysis {
13  public:
14 
17  : Analysis("CMS_2011_S8978280"),
18  _Nevt_after_cuts(0.0)
19  {
20  setBeams(PROTON, PROTON);
21  setNeedsCrossSection(false);
22  }
23 
24 
25  void init() {
26 
27  addProjection(Beam(), "Beam");
28 
29  // Need wide range of eta because cut on rapidity not pseudorapidity
30  UnstableFinalState ufs(-8.0, 8.0, 0.0*GeV);
31  addProjection(ufs, "UFS");
32 
33  // Particle distributions versus rapidity and transverse momentum
34  // Only make histograms if the correct energy is used.
35  if (fuzzyEquals(sqrtS(), 900*GeV, 1E-3)){
36  _h_dNKshort_dy = bookHistogram1D(1, 1, 1);
37  _h_dNKshort_dpT = bookHistogram1D(2, 1, 1);
38  _h_dNLambda_dy = bookHistogram1D(3, 1, 1);
39  _h_dNLambda_dpT = bookHistogram1D(4, 1, 1);
40  _h_dNXi_dy = bookHistogram1D(5, 1, 1);
41  _h_dNXi_dpT = bookHistogram1D(6, 1, 1);
42  } else if (fuzzyEquals(sqrtS(), 7000*GeV, 1E-3)){
43  _h_dNKshort_dy = bookHistogram1D(1, 1, 2);
44  _h_dNKshort_dpT = bookHistogram1D(2, 1, 2);
45  _h_dNLambda_dy = bookHistogram1D(3, 1, 2);
46  _h_dNLambda_dpT = bookHistogram1D(4, 1, 2);
47  _h_dNXi_dy = bookHistogram1D(5, 1, 2);
48  _h_dNXi_dpT = bookHistogram1D(6, 1, 2);
49  }
50  return;
51  }
52 
53 
55  void analyze(const Event& event) {
56  if (!fuzzyEquals(sqrtS(), 900*GeV, 1E-3) && !fuzzyEquals(sqrtS(), 7000*GeV, 1E-3) ){
57  return;
58  }
59  const double weight = event.weight();
60 
62 
63  // This works as long as the KShort, Lambda, and Cascade are not decayed in the generator.
64  const UnstableFinalState& parts = applyProjection<UnstableFinalState>(event, "UFS");
65 
66  foreach (const Particle& p, parts.particles()) {
67  const double pT = p.momentum().pT();
68  const double y = fabs(p.momentum().rapidity());
69  const PdgId pid = abs(p.pdgId());
70 
71  if (y < 2.0) {
72 
73  switch (pid) {
74  case K0S:
75  _h_dNKshort_dy->fill(y, weight);
76  _h_dNKshort_dpT->fill(pT, weight);
77  break;
78  case LAMBDA:
79  // Lambda should not have Cascade or Omega ancestors since they should not decay. But just in case...
80  if ( !( p.hasAncestor(3322) || p.hasAncestor(-3322) || p.hasAncestor(3312) || p.hasAncestor(-3312) || p.hasAncestor(3334) || p.hasAncestor(-3334) ) ) {
81  _h_dNLambda_dy->fill(y, weight);
82  _h_dNLambda_dpT->fill(pT, weight);
83  }
84  break;
85  case XIMINUS:
86  // Cascade should not have Omega ancestors since it should not decay. But just in case...
87  if ( !( p.hasAncestor(3334) || p.hasAncestor(-3334) ) ) {
88  _h_dNXi_dy->fill(y, weight);
89  _h_dNXi_dpT->fill(pT, weight);
90  }
91  break;
92  }
93  }
94  }
95  return;
96  }
97 
98 
99  void finalize() {
100  if (!fuzzyEquals(sqrtS(), 900*GeV, 1E-3) && !fuzzyEquals(sqrtS(), 7000*GeV, 1E-3) ){
101  return;
102  }
103  AIDA::IHistogramFactory& hf = histogramFactory();
104  const string dir = histoDir();
105 
106  // Making the Lambda/Kshort and Xi/Lambda ratios vs pT and y
107  if (fuzzyEquals(sqrtS(), 900*GeV, 1E-3)){
108  hf.divide(dir + "/d07-x01-y01",*_h_dNLambda_dpT, *_h_dNKshort_dpT);
109  hf.divide(dir + "/d08-x01-y01",*_h_dNXi_dpT, *_h_dNLambda_dpT);
110  hf.divide(dir + "/d09-x01-y01",*_h_dNLambda_dy, *_h_dNKshort_dy);
111  hf.divide(dir + "/d10-x01-y01",*_h_dNXi_dy, *_h_dNLambda_dy);
112  } else if (fuzzyEquals(sqrtS(), 7000*GeV, 1E-3)){
113  hf.divide(dir + "/d07-x01-y02",*_h_dNLambda_dpT, *_h_dNKshort_dpT);
114  hf.divide(dir + "/d08-x01-y02",*_h_dNXi_dpT, *_h_dNLambda_dpT);
115  hf.divide(dir + "/d09-x01-y02",*_h_dNLambda_dy, *_h_dNKshort_dy);
116  hf.divide(dir + "/d10-x01-y02",*_h_dNXi_dy, *_h_dNLambda_dy);
117  }
118 
119  double normpT = 1.0/_Nevt_after_cuts;
120  double normy = 0.5*normpT; // Accounts for using |y| instead of y
121  scale(_h_dNKshort_dy, normy);
122  scale(_h_dNKshort_dpT, normpT);
123  scale(_h_dNLambda_dy, normy);
124  scale(_h_dNLambda_dpT, normpT);
125  scale(_h_dNXi_dy, normy);
126  scale(_h_dNXi_dpT, normpT);
127 
128  return;
129  }
130 
131 
132  private:
133 
135 
136  // Particle distributions versus rapidity and transverse momentum
137  AIDA::IHistogram1D *_h_dNKshort_dy;
138  AIDA::IHistogram1D *_h_dNKshort_dpT;
139  AIDA::IHistogram1D *_h_dNLambda_dy;
140  AIDA::IHistogram1D *_h_dNLambda_dpT;
141  AIDA::IHistogram1D *_h_dNXi_dy;
142  AIDA::IHistogram1D *_h_dNXi_dpT;
143 
144  };
145 
146 
147  // This global object acts as a hook for the plugin system
148  AnalysisBuilder<CMS_2011_S8978280> plugin_CMS_2011_S8978280;
149 
150 
151 }
AnalysisBuilder< CMS_2011_S8978280 > plugin_CMS_2011_S8978280
CMS strange particle spectra (Ks, Lambda, Cascade) in pp at 900 and 7000 GeV.
#define abs(x)
Definition: mlp_lapack.h:159
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
AIDA::IHistogram1D * _h_dNLambda_dy
AIDA::IHistogram1D * _h_dNKshort_dpT
AIDA::IHistogram1D * _h_dNLambda_dpT
CMS_2011_S8978280()
Constructor.
AIDA::IHistogram1D * _h_dNXi_dy
AIDA::IHistogram1D * _h_dNKshort_dy
AIDA::IHistogram1D * _h_dNXi_dpT
dbl *** dir
Definition: mlp_gen.cc:35
void analyze(const Event &event)
Perform the per-event analysis.