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