00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Projections/Beam.hh"
00006
00007 namespace Rivet {
00008
00009
00010 class CMS_2010_S8656010 : public Analysis {
00011 public:
00012
00013 CMS_2010_S8656010() : Analysis("CMS_2010_S8656010") {
00014 setBeams(PROTON, PROTON);
00015 setNeedsCrossSection(false);
00016 }
00017
00018
00019 void init() {
00020 ChargedFinalState cfs(-2.5, 2.5, 0.1*GeV);
00021 addProjection(cfs, "CFS");
00022 addProjection(Beam(), "Beam");
00023
00024 FinalState hfs(-5.5, 5.5, 0.1*GeV);
00025 addProjection(hfs, "HFS");
00026
00027 _Nevt_after_cuts = 0;
00028
00029
00030 _netabins=12;
00031 for (int ietabin=0; ietabin <= _netabins; ietabin++){
00032 _etabins[ietabin]=0.2*ietabin;
00033 }
00034
00035
00036
00037 _h_dNch_dpT_7[0] = bookHistogram1D(1, 1, 1);
00038 _h_dNch_dpT_7[1] = bookHistogram1D(1, 1, 2);
00039 _h_dNch_dpT_7[2] = bookHistogram1D(1, 1, 3);
00040 _h_dNch_dpT_7[3] = bookHistogram1D(1, 1, 4);
00041
00042 _h_dNch_dpT_7[4] = bookHistogram1D(2, 1, 1);
00043 _h_dNch_dpT_7[5] = bookHistogram1D(2, 1, 2);
00044 _h_dNch_dpT_7[6] = bookHistogram1D(2, 1, 3);
00045 _h_dNch_dpT_7[7] = bookHistogram1D(2, 1, 4);
00046
00047 _h_dNch_dpT_7[8] = bookHistogram1D(3, 1, 1);
00048 _h_dNch_dpT_7[9] = bookHistogram1D(3, 1, 2);
00049 _h_dNch_dpT_7[10] = bookHistogram1D(3, 1, 3);
00050 _h_dNch_dpT_7[11] = bookHistogram1D(3, 1, 4);
00051
00052 _h_dNch_dEta_7 = bookHistogram1D(5, 1, 1);
00053
00054 }
00055
00056
00057 void analyze(const Event& event) {
00058 const double weight = event.weight();
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
00080 if (charged.particles().size()<1) {
00081 vetoEvent;
00082
00083 }
00084
00085
00086 _Nevt_after_cuts += weight;
00087
00088 foreach (const Particle& p, charged.particles()) {
00089 double pT = p.momentum().pT();
00090 double eta = p.momentum().eta();
00091
00092 if(fuzzyEquals(sqrtS(), 7000, 1E-3)){
00093 _h_dNch_dEta_7->fill(eta, weight);
00094 for (int ietabin=0; ietabin <= (_netabins-1); ietabin++){
00095 if (fabs(eta) < _etabins[ietabin+1] && fabs(eta) > _etabins[ietabin]){
00096 _h_dNch_dpT_7[ietabin]->fill(pT, weight);
00097 }
00098 }
00099 }
00100
00101 }
00102 }
00103
00104
00105 void finalize() {
00106 double normfac=1.0/_Nevt_after_cuts;
00107 getLog() << Log::INFO << "Number of events after event selection: " << _Nevt_after_cuts << endl;
00108
00109 if(fuzzyEquals(sqrtS(), 7000, 1E-3)){
00110 for (int ietabin=0; ietabin < _netabins; ietabin++){
00111 scale(_h_dNch_dpT_7[ietabin], normfac/(0.2*2.0));
00112 }
00113 scale(_h_dNch_dEta_7, normfac);
00114 }
00115
00116 }
00117
00118
00119
00120 private:
00121
00122
00123 AIDA::IHistogram1D* _h_dNch_dpT_7[12];
00124 AIDA::IHistogram1D* _h_dNch_dEta_7;
00125
00126 int _netabins;
00127 double _Nevt_after_cuts;
00128 double _etabins[13];
00129
00130
00131 };
00132
00133
00134
00135 AnalysisBuilder<CMS_2010_S8656010> plugin_CMS_2010_S8656010;
00136
00137 }
00138