CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMS_2010_S8656010.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_S8656010 : public Analysis {
11  public:
12 
13  CMS_2010_S8656010() : Analysis("CMS_2010_S8656010") {
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(), 7000*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(4, 1, 1);
43 
44  _h_dNch_dEta = bookHistogram1D(5, 1, 1);
45  }
46  return;
47  }
48 
49 //AK =====================================================ANALYZE
50  void analyze(const Event& event) {
51 
52  if (!fuzzyEquals(sqrtS(), 7000*GeV, 1E-3) ) {
53  return;
54  }
55 
56  const double weight = event.weight();
57 
58  //charge particles
59  const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
60 
62 
63  foreach (const Particle& p, charged.particles()) {
64  const double pT = p.momentum().pT();
65  const double eta = p.momentum().eta();
66 
67  // The data is actually a duplicated folded distribution. This should mimic it.
68  _h_dNch_dEta->fill(eta, 0.5*weight);
69  _h_dNch_dEta->fill(-eta, 0.5*weight);
70  if (fabs(eta)<2.4 && pT>0.1) {
71  if (pT<6.0) {
72  _h_dNch_dpT_all->fill(pT, weight/pT);
73  if (pT<2.0) {
74  int ietabin = fabs(eta)/0.2;
75  _h_dNch_dpT[ietabin]->fill(pT, weight);
76  }
77  }
78  }
79  }
80  return;
81  }
82 
83 //AK =====================================================FINALIZE
84  void finalize() {
85 
86  if (!fuzzyEquals(sqrtS(), 7000*GeV, 1E-3) ) {
87  return;
88  }
89 
90  const double normfac = 1.0/_Nevt_after_cuts; // Normalizing to unit eta is automatic
91  // The pT distributions in bins of eta must be normalized to unit eta. This is a factor of 2
92  // for the |eta| times 0.2 (eta range).
93  // The pT distributions over all eta are normalized to unit eta (2.0*2.4) and by 1/2*pi*pT.
94  // The 1/pT part is taken care of in the filling. The 1/2pi is taken care of here.
95  const double normpT = normfac/(2.0*0.2);
96  const double normpTall = normfac/(2.0*3.141592654*2.0*2.4);
97 
98  for (int ietabin=0; ietabin < 12; ietabin++){
99  scale(_h_dNch_dpT[ietabin], normpT);
100  }
101  scale(_h_dNch_dpT_all, normpTall);
102  scale(_h_dNch_dEta, normfac);
103  return;
104  }
105 
106 //AK =====================================================DECLARATIONS
107  private:
108 
109  AIDA::IHistogram1D* _h_dNch_dpT[12];
110  AIDA::IHistogram1D* _h_dNch_dpT_all;
111 
112  AIDA::IHistogram1D* _h_dNch_dEta;
113 
115 
116  };
117 
118 
119  // This global object acts as a hook for the plugin system
120  AnalysisBuilder<CMS_2010_S8656010> plugin_CMS_2010_S8656010;
121 
122 }
123 
void analyze(const Event &event)
T eta() const
AIDA::IHistogram1D * _h_dNch_dEta
AnalysisBuilder< CMS_2010_S8656010 > plugin_CMS_2010_S8656010
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_dNch_dpT[12]
AIDA::IHistogram1D * _h_dNch_dpT_all