ATLAS_2010_CONF_2010_031.cc
Go to the documentation of this file.00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006
00007 namespace Rivet {
00008
00009
00010
00011 class ATLAS_2010_CONF_2010_031 : public Analysis {
00012 public:
00013
00014 ATLAS_2010_CONF_2010_031()
00015 : Analysis("ATLAS_2010_CONF_2010_031"),
00016 _Nevt_after_cuts(0.0)
00017 {
00018 setNeedsCrossSection(false);
00019 }
00020
00021
00022 void init() {
00023 ChargedFinalState cfs(-2.5, 2.5, 0.5*GeV);
00024 addProjection(cfs, "CFS");
00025
00026 if (sqrtS()/GeV >= 890 && sqrtS()/GeV <= 910) {
00027 _h_dNch_deta = bookHistogram1D(2, 1, 1);
00028 _h_dNevt_dNch = bookHistogram1D(2, 2, 1);
00029 _h_dNch_dpT = bookHistogram1D(2, 3, 1);
00030 _p_meanpT_Nch = bookProfile1D(2, 4, 1);
00031 }
00032 if (sqrtS()/GeV >= 6990 && sqrtS()/GeV <= 7010) {
00033 _h_dNch_deta = bookHistogram1D(3, 1, 1);
00034 _h_dNevt_dNch = bookHistogram1D(3, 2, 1);
00035 _h_dNch_dpT = bookHistogram1D(3, 3, 1);
00036 _p_meanpT_Nch = bookProfile1D(3, 4, 1);
00037 }
00038 }
00039
00040
00041 void analyze(const Event& event) {
00042 const double weight = event.weight();
00043
00044 const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS");
00045 if (charged.size() < 6) {
00046 vetoEvent;
00047 }
00048 _Nevt_after_cuts += weight;
00049
00050 _h_dNevt_dNch->fill(charged.size(), weight);
00051 foreach (const Particle& p, charged.particles()) {
00052 double pT = p.momentum().pT()/GeV;
00053 _h_dNch_deta->fill(p.momentum().eta(), weight);
00054 _h_dNch_dpT->fill(pT, weight/pT);
00055 _p_meanpT_Nch->fill(charged.size(), pT, weight);
00056 }
00057 }
00058
00059
00060 void finalize() {
00061 double deta = 5.0;
00062 scale(_h_dNch_deta, 1.0/_Nevt_after_cuts);
00063 scale(_h_dNch_dpT, 1.0/_Nevt_after_cuts/TWOPI/deta);
00064 scale(_h_dNevt_dNch, 1.0/_Nevt_after_cuts);
00065 }
00066
00067
00068 private:
00069
00070 AIDA::IHistogram1D* _h_dNch_deta;
00071 AIDA::IHistogram1D* _h_dNch_dpT;
00072 AIDA::IHistogram1D* _h_dNevt_dNch;
00073 AIDA::IProfile1D* _p_meanpT_Nch;
00074
00075 double _Nevt_after_cuts;
00076
00077 };
00078
00079
00080
00081
00082 AnalysisBuilder<ATLAS_2010_CONF_2010_031> plugin_ATLAS_2010_CONF_2010_031;
00083
00084 }
00085