CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMS_2010_S8547297.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include "Rivet/Analysis.hh"
3 #include "Rivet/RivetAIDA.hh"
4 #include "Rivet/Projections/ChargedFinalState.hh"
5 #include "Rivet/Projections/Beam.hh"
6 
7 namespace Rivet {
8 
9 
10  class CMS_2010_S8547297 : public Analysis {
11  public:
12 
13  CMS_2010_S8547297() : Analysis("CMS_2010_S8547297") {
14  setBeams(PROTON, PROTON);
15  setNeedsCrossSection(false);
16  }
17 
18 //AK =====================================================INIT
19  void init() {
20  ChargedFinalState cfs(-2.5, 2.5, 0.0*GeV);
21  addProjection(cfs, "CFS");
22  addProjection(Beam(), "Beam");
23 
24  _Nevt_after_cuts = 0;
25 
26  if(fuzzyEquals(sqrtS(), 900*GeV, 1E-3)){
27  _h_dNch_dpT[0] = bookHistogram1D(1, 1, 1);
28  _h_dNch_dpT[1] = bookHistogram1D(1, 1, 2);
29  _h_dNch_dpT[2] = bookHistogram1D(1, 1, 3);
30  _h_dNch_dpT[3] = bookHistogram1D(1, 1, 4);
31 
32  _h_dNch_dpT[4] = bookHistogram1D(2, 1, 1);
33  _h_dNch_dpT[5] = bookHistogram1D(2, 1, 2);
34  _h_dNch_dpT[6] = bookHistogram1D(2, 1, 3);
35  _h_dNch_dpT[7] = bookHistogram1D(2, 1, 4);
36 
37  _h_dNch_dpT[8] = bookHistogram1D(3, 1, 1);
38  _h_dNch_dpT[9] = bookHistogram1D(3, 1, 2);
39  _h_dNch_dpT[10] = bookHistogram1D(3, 1, 3);
40  _h_dNch_dpT[11] = bookHistogram1D(3, 1, 4);
41 
42  _h_dNch_dpT_all = bookHistogram1D(7, 1, 1);
43 
44  _h_dNch_dEta = bookHistogram1D(8, 1, 1);
45  } else if (fuzzyEquals(sqrtS(), 2360*GeV, 1E-3)){
46  _h_dNch_dpT[0] = bookHistogram1D(4, 1, 1);
47  _h_dNch_dpT[1] = bookHistogram1D(4, 1, 2);
48  _h_dNch_dpT[2] = bookHistogram1D(4, 1, 3);
49  _h_dNch_dpT[3] = bookHistogram1D(4, 1, 4);
50 
51  _h_dNch_dpT[4] = bookHistogram1D(5, 1, 1);
52  _h_dNch_dpT[5] = bookHistogram1D(5, 1, 2);
53  _h_dNch_dpT[6] = bookHistogram1D(5, 1, 3);
54  _h_dNch_dpT[7] = bookHistogram1D(5, 1, 4);
55 
56  _h_dNch_dpT[8] = bookHistogram1D(6, 1, 1);
57  _h_dNch_dpT[9] = bookHistogram1D(6, 1, 2);
58  _h_dNch_dpT[10] = bookHistogram1D(6, 1, 3);
59  _h_dNch_dpT[11] = bookHistogram1D(6, 1, 4);
60 
61  _h_dNch_dpT_all = bookHistogram1D(7, 1, 2);
62 
63  _h_dNch_dEta = bookHistogram1D(8, 1, 2);
64  }
65  return;
66  }
67 
68 //AK =====================================================ANALYZE
69  void analyze(const Event& event) {
70 
71  if (!fuzzyEquals(sqrtS(), 900*GeV, 1E-3) && !fuzzyEquals(sqrtS(), 2360*GeV, 1E-3) ){
72  return;
73  }
74 
75  const double weight = event.weight();
76 
77  //charge particles
78  const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
79 
81 
82  foreach (const Particle& p, charged.particles()) {
83  const double pT = p.momentum().pT();
84  const double eta = p.momentum().eta();
85 
86  // The data is actually a duplicated folded distribution. This should mimic it.
87  _h_dNch_dEta->fill(eta, 0.5*weight);
88  _h_dNch_dEta->fill(-eta, 0.5*weight);
89  if (fabs(eta)<2.4 && pT>0.1) {
90  if (pT<4.0) {
91  _h_dNch_dpT_all->fill(pT, weight/pT);
92  if (pT<2.0) {
93  int ietabin = fabs(eta)/0.2;
94  _h_dNch_dpT[ietabin]->fill(pT, weight);
95  }
96  }
97  }
98  }
99  return;
100  }
101 
102 //AK =====================================================FINALIZE
103  void finalize() {
104 
105  if (!fuzzyEquals(sqrtS(), 900*GeV, 1E-3) && !fuzzyEquals(sqrtS(), 2360*GeV, 1E-3) ){
106  return;
107  }
108 
109  const double normfac = 1.0/_Nevt_after_cuts; // Normalizing to unit eta is automatic
110  // The pT distributions in bins of eta must be normalized to unit eta. This is a factor of 2
111  // for the |eta| times 0.2 (eta range).
112  // The pT distributions over all eta are normalized to unit eta (2.0*2.4) and by 1/2*pi*pT.
113  // The 1/pT part is taken care of in the filling. The 1/2pi is taken care of here.
114  const double normpT = normfac/(2.0*0.2);
115  const double normpTall = normfac/(2.0*3.141592654*2.0*2.4);
116 
117  for (int ietabin=0; ietabin < 12; ietabin++){
118  scale(_h_dNch_dpT[ietabin], normpT);
119  }
120  scale(_h_dNch_dpT_all, normpTall);
121  scale(_h_dNch_dEta, normfac);
122  return;
123  }
124 
125 
126 //AK =====================================================DECLARATIONS
127  private:
128 
129  AIDA::IHistogram1D* _h_dNch_dpT[12];
130  AIDA::IHistogram1D* _h_dNch_dpT_all;
131 
132  AIDA::IHistogram1D* _h_dNch_dEta;
133 
135 
136 
137  };
138 
139 
140  // This global object acts as a hook for the plugin system
141  AnalysisBuilder<CMS_2010_S8547297> plugin_CMS_2010_S8547297;
142 
143 }
144 
AIDA::IHistogram1D * _h_dNch_dpT_all
AIDA::IHistogram1D * _h_dNch_dEta
T eta() const
void analyze(const Event &event)
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
AnalysisBuilder< CMS_2010_S8547297 > plugin_CMS_2010_S8547297
AIDA::IHistogram1D * _h_dNch_dpT[12]