CMSTOTEM_2014_I1294140.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/ChargedFinalState.hh" 00004 #include "Rivet/Projections/Beam.hh" 00005 00006 namespace Rivet { 00007 00008 00009 class CMSTOTEM_2014_I1294140 : public Analysis { 00010 public: 00011 00012 CMSTOTEM_2014_I1294140() 00013 : Analysis("CMSTOTEM_2014_I1294140") 00014 { } 00015 00016 00017 void init() { 00018 ChargedFinalState cfs(-7.0, 7.0, 0.0*GeV); 00019 addProjection(cfs, "CFS"); 00020 00021 _Nevt_after_cuts_or = 0; 00022 _Nevt_after_cuts_and = 0; 00023 _Nevt_after_cuts_xor = 0; 00024 00025 if (fuzzyEquals(sqrtS(), 8000*GeV, 1E-3)) { 00026 _h_dNch_dEta_OR = bookHisto1D(1, 1, 1); 00027 _h_dNch_dEta_AND = bookHisto1D(2, 1, 1); 00028 _h_dNch_dEta_XOR = bookHisto1D(3, 1, 1); 00029 } 00030 } 00031 00032 00033 void analyze(const Event& event) { 00034 // Count forward and backward charged particles 00035 const ChargedFinalState& charged = applyProjection<ChargedFinalState>(event, "CFS"); 00036 int count_plus = 0, count_minus = 0; 00037 foreach (const Particle& p, charged.particles()) { 00038 if (inRange(p.eta(), 5.3, 6.5)) count_plus++; 00039 if (inRange(p.eta(), -6.5, -5.3)) count_minus++; 00040 } 00041 00042 // Cut combinations 00043 const bool cutsor = (count_plus > 0 || count_minus > 0); 00044 const bool cutsand = (count_plus > 0 && count_minus > 0); 00045 const bool cutsxor = ( (count_plus > 0 && count_minus == 0) || (count_plus == 0 && count_minus > 0) ); 00046 00047 // Increment counters and fill histos 00048 const double weight = event.weight(); 00049 if (cutsor) _Nevt_after_cuts_or += weight; 00050 if (cutsand) _Nevt_after_cuts_and += weight; 00051 if (cutsxor) _Nevt_after_cuts_xor += weight; 00052 foreach (const Particle& p, charged.particles()) { 00053 if (cutsor) _h_dNch_dEta_OR ->fill(p.abseta(), weight); 00054 if (cutsand) _h_dNch_dEta_AND->fill(p.abseta(), weight); 00055 if (cutsxor) _h_dNch_dEta_XOR->fill(p.abseta(), weight); 00056 } 00057 00058 } 00059 00060 00061 void finalize() { 00062 scale(_h_dNch_dEta_OR, 0.5/_Nevt_after_cuts_or); 00063 scale(_h_dNch_dEta_AND, 0.5/_Nevt_after_cuts_and); 00064 scale(_h_dNch_dEta_XOR, 0.5/_Nevt_after_cuts_xor); 00065 } 00066 00067 00068 private: 00069 00070 Histo1DPtr _h_dNch_dEta_OR, _h_dNch_dEta_AND, _h_dNch_dEta_XOR; 00071 double _Nevt_after_cuts_or, _Nevt_after_cuts_and, _Nevt_after_cuts_xor; 00072 00073 }; 00074 00075 00076 // Hook for the plugin system 00077 DECLARE_RIVET_PLUGIN(CMSTOTEM_2014_I1294140); 00078 00079 } Generated on Wed Oct 7 2015 12:09:12 for The Rivet MC analysis system by ![]() |