CMS_2012_I1193338.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/FinalState.hh" 00005 00006 namespace Rivet { 00007 00008 00009 class CMS_2012_I1193338 : public Analysis { 00010 public: 00011 00012 CMS_2012_I1193338() 00013 : Analysis("CMS_2012_I1193338") 00014 { } 00015 00016 public: 00017 00018 void init() { 00019 addProjection(ChargedFinalState(-2.4, 2.4, 0.2*GeV), "CFS"); 00020 addProjection(FinalState(), "FS"); 00021 00022 _h_sigma = bookHisto1D(1, 1, 1); 00023 } 00024 00025 00026 void analyze(const Event& event) { 00027 const double weight = event.weight(); 00028 00029 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); 00030 if (cfs.size() > 1) {_h_sigma->fill(1.5, weight);} 00031 if (cfs.size() > 2) {_h_sigma->fill(2.5, weight);} 00032 if (cfs.size() > 3) {_h_sigma->fill(3.5, weight);} 00033 00034 const FinalState& fs = applyProjection<FinalState>(event, "FS"); 00035 if (fs.size() < 2) vetoEvent; // need at least two particles to calculate gaps 00036 00037 double gapcenter = 0.; 00038 double LRG = 0.; 00039 double etapre = 0.; 00040 bool first = true; 00041 00042 foreach(const Particle& p, fs.particlesByEta()) { // sorted from minus to plus 00043 if (first) { // First particle 00044 first = false; 00045 etapre = p.eta(); 00046 } else { 00047 double gap = fabs(p.eta()-etapre); 00048 if (gap > LRG) { 00049 LRG = gap; // largest gap 00050 gapcenter = (p.eta()+etapre)/2.; // find the center of the gap to separate the X and Y systems. 00051 } 00052 etapre = p.eta(); 00053 } 00054 } 00055 00056 00057 FourMomentum mxFourVector, myFourVector; 00058 foreach(const Particle& p, fs.particlesByEta()) { 00059 if (p.eta() > gapcenter) { 00060 mxFourVector += p.momentum(); 00061 } else { 00062 myFourVector += p.momentum(); 00063 } 00064 } 00065 const double M2 = max(mxFourVector.mass2(), myFourVector.mass2()); 00066 const double xi = M2/sqr(sqrtS()); // sqrt(s)=7000 GeV, note that units cancel 00067 if (xi < 5e-6) vetoEvent; 00068 00069 _h_sigma->fill(0.5, weight); 00070 } 00071 00072 00073 void finalize() { 00074 scale(_h_sigma, crossSection()/millibarn/sumOfWeights()); 00075 } 00076 00077 private: 00078 00079 Histo1DPtr _h_sigma; 00080 00081 }; 00082 00083 00084 // The hook for the plugin system 00085 DECLARE_RIVET_PLUGIN(CMS_2012_I1193338); 00086 00087 } Generated on Thu Feb 6 2014 17:38:43 for The Rivet MC analysis system by ![]() |