rivet is hosted by Hepforge, IPPP Durham
CMS_2011_S9215166.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 #include "Rivet/Projections/VetoedFinalState.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   class CMS_2011_S9215166 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     CMS_2011_S9215166() : Analysis("CMS_2011_S9215166"), _weightMB(0.), _weightDiJet(0.) {  }
00016 
00017 
00018     void init() {
00019       const FinalState fs(-6.0, 6.0, 0.0*GeV);
00020       addProjection(fs, "FS");
00021       addProjection(FastJets(fs, FastJets::ANTIKT, 0.5), "Jets");
00022 
00023       VetoedFinalState fsv(fs);
00024       fsv.vetoNeutrinos();
00025       fsv.addVetoPairDetail(PID::MUON, 0.0*GeV, 99999.9*GeV);
00026       addProjection(fsv, "fsv");
00027 
00028       // For the MB ND selection
00029       const ChargedFinalState fschrgd(-6.0,6.0,0.0*GeV);
00030       addProjection(fschrgd, "fschrgd");
00031       VetoedFinalState fschrgdv(fschrgd);
00032       fschrgdv.vetoNeutrinos();
00033       addProjection(fschrgdv, "fschrgdv");
00034 
00035       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00036         _hist_mb      = bookHisto1D(1, 1, 1); // energy flow in MB, 0.9 TeV
00037         _hist_dijet = bookHisto1D(2, 1, 1); // energy flow in dijet events, 0.9 TeV
00038       } else if (fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)) {
00039         _hist_mb      = bookHisto1D(3, 1, 1); // energy flow in MB, 7 TeV
00040         _hist_dijet = bookHisto1D(4, 1, 1); // energy flow in dijet events, 7 TeV
00041       }
00042     }
00043 
00044 
00045     void analyze(const Event& event) {
00046       const double weight = event.weight();
00047 
00048       // Skip if the event is empty
00049       const FinalState& fsv = applyProjection<FinalState>(event, "fsv");
00050       if (fsv.empty()) vetoEvent;
00051 
00052       // Veto diffractive topologies according to defined hadron level
00053       double count_chrg_forward = 0;
00054       double count_chrg_backward = 0;
00055       const FinalState& fschrgdv = applyProjection<FinalState>(event, "fschrgdv");
00056       foreach (const Particle& p, fschrgdv.particles()) {
00057         if (3.9 < p.eta() && p.eta() < 4.4) count_chrg_forward++;
00058         if (-4.4 < p.eta() && p.eta() < -3.9) count_chrg_backward++;
00059       }
00060       if (count_chrg_forward == 0 || count_chrg_backward == 0) vetoEvent;
00061       /// @todo "Diffractive" veto should really also veto dijet events?
00062 
00063 
00064       // MINIMUM BIAS EVENTS
00065       _weightMB += weight;
00066       foreach (const Particle& p, fsv.particles()) {
00067         _hist_mb->fill(fabs(p.eta()), weight*p.momentum().E()/GeV);
00068       }
00069 
00070 
00071       // DIJET EVENTS
00072       double PTCUT = -1.0;
00073       if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) PTCUT = 8.0*GeV;
00074       else if (fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)) PTCUT = 20.0*GeV;
00075       const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");
00076       const Jets jets = jetpro.jetsByPt(PTCUT);
00077       if (jets.size() >= 2) {
00078         // eta cut for the central jets
00079         if (fabs(jets[0].eta()) < 2.5 && fabs(jets[1].eta()) < 2.5) {
00080           // Back to back condition of the jets
00081           const double diffphi = deltaPhi(jets[1].momentum().phi(), jets[0].momentum().phi());
00082           if (diffphi-PI < 1.0) {
00083         _weightDiJet += weight;
00084             foreach (const Particle& p, fsv.particles()) {
00085               _hist_dijet->fill(fabs(p.eta()), weight*p.momentum().E()/GeV);
00086             }
00087           }
00088         }
00089       }
00090 
00091     }
00092 
00093 
00094     void finalize() {
00095       scale(_hist_mb   , 0.5/_weightMB   );
00096       scale(_hist_dijet, 0.5/_weightDiJet);
00097     }
00098 
00099 
00100   private:
00101 
00102     Histo1DPtr _hist_mb, _hist_dijet;
00103     double _weightMB,_weightDiJet;
00104 
00105   };
00106 
00107 
00108   // Hook for the plugin system
00109   DECLARE_RIVET_PLUGIN(CMS_2011_S9215166);
00110 
00111 }