MC_SUSY.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/RivetAIDA.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/ChargedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/IdentifiedFinalState.hh"
00010 #include "Rivet/Projections/TotalVisibleMomentum.hh"
00011 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   /* Basic SUSY type validation analysis for the LHC
00017    * @author Andy Buckley
00018    */
00019   class MC_SUSY : public Analysis {
00020   public:
00021  
00022     /// Constructor
00023     MC_SUSY()
00024       : Analysis("MC_SUSY")
00025     {    }
00026  
00027  
00028     /// @name Analysis methods
00029     //@{
00030  
00031     // Book histograms
00032     void init() {
00033       // Basic final state
00034       const FinalState fs(-4.0, 4.0, 10*GeV);
00035 
00036       // Tracks and jets
00037       addProjection(ChargedFinalState(fs), "Tracks");
00038       addProjection(FastJets(fs, FastJets::ANTIKT, 0.7), "Jets");
00039 
00040       IdentifiedFinalState photonfs(fs);
00041       photonfs.acceptId(PHOTON);
00042       addProjection(photonfs, "AllPhotons");
00043 
00044       IdentifiedFinalState efs(fs);
00045       efs.acceptIdPair(ELECTRON);
00046       addProjection(efs, "Electrons");
00047 
00048       IdentifiedFinalState mufs(fs);
00049       mufs.acceptIdPair(MUON);
00050       addProjection(mufs, "Muons");
00051 
00052       VetoedFinalState missing(fs);
00053       missing.vetoNeutrinos();
00054       missing.addVetoId(1000022); // lightest neutralino = usual LSP
00055       missing.addVetoId(1000039); // gravitino = LSP in GMSB
00056       addProjection(TotalVisibleMomentum(missing), "MET");
00057 
00058       LeadingParticlesFinalState lpfs(fs);
00059       lpfs.addParticleIdPair(ELECTRON);
00060       lpfs.addParticleIdPair(MUON);
00061       addProjection(lpfs, "LeadingParticles");
00062 
00063       _hist_n_trk   = bookHistogram1D("n-trk", 50, 0.5, 300.5);
00064       _hist_phi_trk = bookHistogram1D("phi-trk", 50, -PI, PI);
00065       _hist_eta_trk = bookHistogram1D("eta-trk", 50, -4, 4);
00066       _hist_pt_trk  = bookHistogram1D("pt-trk", 100, 0.0, 1500);
00067 
00068       _hist_n_jet   = bookHistogram1D("n-jet", 21, -0.5, 20.5);
00069       _hist_phi_jet = bookHistogram1D("phi-jet", 50, -PI, PI);
00070       _hist_eta_jet = bookHistogram1D("eta-jet", 50, -4, 4);
00071       _hist_pt_jet  = bookHistogram1D("pt-jet", 100, 0.0, 1500);
00072 
00073       _hist_n_e   = bookHistogram1D("n-e", 11, -0.5, 10.5);
00074       _hist_phi_e = bookHistogram1D("phi-e", 50, -PI, PI);
00075       _hist_eta_e = bookHistogram1D("eta-e", 50, -4, 4);
00076       _hist_pt_e  = bookHistogram1D("pt-e", 100, 0.0, 500);
00077 
00078       _hist_n_mu   = bookHistogram1D("n-mu", 11, -0.5, 10.5);
00079       _hist_phi_mu = bookHistogram1D("phi-mu", 50, -PI, PI);
00080       _hist_eta_mu = bookHistogram1D("eta-mu", 50, -4, 4);
00081       _hist_pt_mu  = bookHistogram1D("pt-mu", 100, 0.0, 500);
00082 
00083       _hist_n_gamma   = bookHistogram1D("n-gamma", 11, -0.5, 10.5);
00084       _hist_phi_gamma = bookHistogram1D("phi-gamma", 50, -PI, PI);
00085       _hist_eta_gamma = bookHistogram1D("eta-gamma", 50, -4, 4);
00086       _hist_pt_gamma  = bookHistogram1D("pt-gamma", 100, 0.0, 500);
00087 
00088       _hist_n_gammaiso   = bookHistogram1D("n-gamma-iso", 11, -0.5, 10.5);
00089       _hist_phi_gammaiso = bookHistogram1D("phi-gamma-iso", 50, -PI, PI);
00090       _hist_eta_gammaiso = bookHistogram1D("eta-gamma-iso", 50, -4, 4);
00091       _hist_pt_gammaiso  = bookHistogram1D("pt-gamma-iso", 100, 0.0, 500);
00092 
00093       _hist_met = bookHistogram1D("Etmiss", 100, 0.0, 1500);
00094 
00095       _hist_mll_ossf_ee   = bookHistogram1D("mll-ossf-ee", 50, 0.0, 500);
00096       _hist_mll_ossf_mumu = bookHistogram1D("mll-ossf-mumu", 50, 0.0, 500);
00097       _hist_mll_osof_emu  = bookHistogram1D("mll-osof-emu", 50, 0.0, 500);
00098 
00099       _hist_mll_all_ossf_ee   = bookHistogram1D("mll-all-ossf-ee", 50, 0.0, 500);
00100       _hist_mll_all_ossf_mumu = bookHistogram1D("mll-all-ossf-mumu", 50, 0.0, 500);
00101       _hist_mll_all_osof_emu  = bookHistogram1D("mll-all-osof-emu", 50, 0.0, 500);
00102 
00103       _hist_mll_2_ossf_ee   = bookHistogram1D("mll-2-ossf-ee", 50, 0.0, 500);
00104       _hist_mll_2_ossf_mumu = bookHistogram1D("mll-2-ossf-mumu", 50, 0.0, 500);
00105       _hist_mll_2_osof_emu  = bookHistogram1D("mll-2-osof-emu", 50, 0.0, 500);
00106 
00107       /// @todo LSP eta, pT, phi, mass: no reliable cross-scenario LSP PID but
00108       /// maybe plot for all of chi^0_1, gravitino, sneutrino, gluino, ... or
00109       /// identify the LSP as any PID::isSUSY (?) particle with status = 1?
00110     }
00111 
00112 
00113     // Do the analysis
00114     void analyze(const Event& evt) {
00115       const FinalState& tracks = applyProjection<FinalState>(evt, "Tracks");
00116       if (tracks.particles().empty()) {
00117         getLog() << Log::DEBUG << "Failed multiplicity cut" << endl;
00118         vetoEvent;
00119       }
00120 
00121       // Get event weight
00122       const double weight = evt.weight();
00123 
00124       // Fill track histos
00125       _hist_n_trk->fill(tracks.size(), weight);
00126       foreach (const Particle& t, tracks.particles()) {
00127         const FourMomentum& p = t.momentum();
00128         _hist_phi_trk->fill(mapAngleMPiToPi(p.phi()), weight);
00129         _hist_eta_trk->fill(p.eta(), weight);
00130         _hist_pt_trk->fill(p.pT()/GeV, weight);
00131       }
00132 
00133       // Get jets and fill jet histos
00134       const FastJets& jetpro = applyProjection<FastJets>(evt, "Jets");
00135       const Jets jets = jetpro.jetsByPt();
00136       getLog() << Log::DEBUG << "Jet multiplicity = " << jets.size() << endl;
00137       _hist_n_jet->fill(jets.size(), weight);
00138       foreach (const Jet& j, jets) {
00139         const FourMomentum& pj = j.momentum();
00140         _hist_phi_jet->fill(mapAngleMPiToPi(pj.phi()), weight);
00141         _hist_eta_jet->fill(pj.eta(), weight);
00142         _hist_pt_jet->fill(pj.pT()/GeV, weight);
00143       }
00144 
00145       /// @todo Resum photons around electrons
00146 
00147       // Fill final state electron/positron histos
00148       const FinalState& efs = applyProjection<FinalState>(evt, "Electrons");
00149       _hist_n_e->fill(efs.size(), weight);
00150       vector<FourMomentum> epluses, eminuses;
00151       foreach (const Particle& e, efs.particles()) {
00152         const FourMomentum& p = e.momentum();
00153         _hist_phi_e->fill(mapAngleMPiToPi(p.phi()), weight);
00154         _hist_eta_e->fill(p.eta(), weight);
00155         _hist_pt_e->fill(p.pT()/GeV, weight);
00156         // Add sufficiently hard leptons to collections for m_ll histo
00157         if (p.pT()/GeV > 20) {
00158           if (PID::threeCharge(e.pdgId()) > 0) epluses += p; else eminuses += p;
00159         }
00160       }
00161 
00162       /// @todo Resum photons around muons
00163 
00164       // Fill final state muon/antimuon histos
00165       const FinalState& mufs = applyProjection<FinalState>(evt, "Muons");
00166       _hist_n_mu->fill(mufs.size(), weight);
00167       vector<FourMomentum> mupluses, muminuses;
00168       foreach (const Particle& mu, mufs.particles()) {
00169         const FourMomentum& p = mu.momentum();
00170         _hist_phi_mu->fill(mapAngleMPiToPi(p.phi()), weight);
00171         _hist_eta_mu->fill(p.eta(), weight);
00172         _hist_pt_mu->fill(p.pT()/GeV, weight);
00173         // Add sufficiently hard leptons to collections for m_ll histo
00174         if (p.pT()/GeV > 20) {
00175           if (PID::threeCharge(mu.pdgId()) > 0) mupluses += p; else muminuses += p;
00176         }
00177       }
00178 
00179       // Fill final state non-isolated photon histos
00180       const FinalState& allphotonfs = applyProjection<FinalState>(evt, "AllPhotons");
00181       _hist_n_gamma->fill(allphotonfs.size(), weight);
00182       ParticleVector isolatedphotons;
00183       foreach (const Particle& ph, allphotonfs.particles()) {
00184         const FourMomentum& p = ph.momentum();
00185         _hist_phi_gamma->fill(mapAngleMPiToPi(p.phi()), weight);
00186         _hist_eta_gamma->fill(p.eta(), weight);
00187         _hist_pt_gamma->fill(p.pT()/GeV, weight);
00188         // Select isolated photons
00189         bool isolated = true;
00190         foreach (const Jet& j, jets) {
00191           if (deltaR(j.momentum(), p) < 0.2) {
00192             isolated = false;
00193             break;
00194           }
00195         }
00196         if (isolated) isolatedphotons += ph;
00197       }
00198 
00199 
00200       // Fill final state isolated photon histos
00201       _hist_n_gammaiso->fill(isolatedphotons.size(), weight);
00202       foreach (const Particle& ph_iso, isolatedphotons) {
00203         const FourMomentum& p = ph_iso.momentum();
00204         _hist_phi_gammaiso->fill(mapAngleMPiToPi(p.phi()), weight);
00205         _hist_eta_gammaiso->fill(p.eta(), weight);
00206         _hist_pt_gammaiso->fill(p.pT()/GeV, weight);
00207       }
00208 
00209       // Calculate and fill missing Et histos
00210       const TotalVisibleMomentum& met = applyProjection<TotalVisibleMomentum>(evt, "MET");
00211       _hist_met->fill(met.scalarET()/GeV);
00212 
00213       // Choose highest-pT leptons of each sign and flavour for dilepton mass edges
00214       const FinalState& lpfs = applyProjection<FinalState>(evt, "LeadingParticles");
00215       bool eplus_ok(false), eminus_ok(false), muplus_ok(false), muminus_ok(false);
00216       FourMomentum peplus, peminus, pmuplus, pmuminus;
00217       foreach (const Particle& p, lpfs.particles()) {
00218         // Only use leptons above 20 GeV
00219         if (p.momentum().pT()/GeV < 20) continue;
00220         // Identify the PID
00221         const PdgId pid = p.pdgId();
00222         if (pid == ELECTRON) {
00223           eminus_ok = true;
00224           peminus = p.momentum();
00225         } else if (pid == POSITRON) {
00226           eplus_ok = true;
00227           peplus = p.momentum();
00228         } else if (pid == MUON) {
00229           muminus_ok = true;
00230           pmuminus = p.momentum();
00231         } else if (pid == ANTIMUON) {
00232           muplus_ok = true;
00233           pmuplus = p.momentum();
00234         } else {
00235           throw Error("Unexpected particle type in leading particles FS!");
00236         }
00237       }
00238       // m_ee
00239       if (eminus_ok && eplus_ok) {
00240         const double m_ee = FourMomentum(peplus + peminus).mass();
00241         _hist_mll_ossf_ee->fill(m_ee/GeV, weight);
00242         if (epluses.size() == 1 && eminuses.size() == 1)
00243           _hist_mll_2_ossf_ee->fill(m_ee/GeV, weight);
00244       }
00245       // m_mumu
00246       if (muminus_ok && muplus_ok) {
00247         const double m_mumu = FourMomentum(pmuplus + pmuminus).mass();
00248         _hist_mll_ossf_mumu->fill(m_mumu/GeV, weight);
00249         if (mupluses.size() == 1 && muminuses.size() == 1)
00250           _hist_mll_2_ossf_mumu->fill(m_mumu/GeV, weight);
00251       }
00252       // m_emu (both configurations)
00253       if (eminus_ok && muplus_ok) {
00254         const double m_emu = FourMomentum(pmuplus + peminus).mass();
00255         _hist_mll_osof_emu->fill(m_emu/GeV, weight);
00256         if (mupluses.size() == 1 && eminuses.size() == 1)
00257           _hist_mll_2_osof_emu->fill(m_emu/GeV, weight);
00258 
00259       }
00260       if (muminus_ok && eplus_ok) {
00261         const double m_mue = FourMomentum(peplus + pmuminus).mass();
00262         _hist_mll_osof_emu->fill(m_mue/GeV, weight);
00263         if (epluses.size() == 1 && muminuses.size() == 1)
00264           _hist_mll_2_osof_emu->fill(m_mue/GeV, weight);
00265       }
00266 
00267 
00268       // m_ll plots using *all* electrons, positrons, muons and antimuons
00269       // m_ee
00270       foreach (const FourMomentum& peplus, epluses) {
00271         foreach (const FourMomentum& peminus, eminuses) {
00272           const double m_ee = FourMomentum(peplus + peminus).mass();
00273           _hist_mll_all_ossf_ee->fill(m_ee/GeV, weight);
00274         }
00275       }
00276       // m_mumu
00277       foreach (const FourMomentum& pmuplus, mupluses) {
00278         foreach (const FourMomentum& pmuminus, muminuses) {
00279           const double m_mumu = FourMomentum(pmuplus + pmuminus).mass();
00280           _hist_mll_all_ossf_mumu->fill(m_mumu/GeV, weight);
00281         }
00282       }
00283       // m_emu (both configurations)
00284       foreach (const FourMomentum& pmuplus, mupluses) {
00285         foreach (const FourMomentum& peminus, eminuses) {
00286           const double m_emu = FourMomentum(pmuplus + peminus).mass();
00287           _hist_mll_all_osof_emu->fill(m_emu/GeV, weight);
00288         }
00289       }
00290       foreach (const FourMomentum& peplus, epluses) {
00291         foreach (const FourMomentum& pmuminus, muminuses) {
00292           const double m_mue = FourMomentum(peplus + pmuminus).mass();
00293           _hist_mll_all_osof_emu->fill(m_mue/GeV, weight);
00294         }
00295       }
00296 
00297     }
00298  
00299  
00300     void finalize() {
00301       /// @todo Normalisations
00302     }
00303 
00304     //@}
00305  
00306 
00307   private:
00308  
00309     AIDA::IHistogram1D *_hist_n_trk, *_hist_phi_trk, *_hist_eta_trk, *_hist_pt_trk;
00310     AIDA::IHistogram1D *_hist_n_jet, *_hist_phi_jet, *_hist_eta_jet, *_hist_pt_jet;
00311     AIDA::IHistogram1D *_hist_n_e, *_hist_phi_e, *_hist_eta_e, *_hist_pt_e;
00312     AIDA::IHistogram1D *_hist_n_mu, *_hist_phi_mu, *_hist_eta_mu, *_hist_pt_mu;
00313     AIDA::IHistogram1D *_hist_n_gamma, *_hist_phi_gamma, *_hist_eta_gamma, *_hist_pt_gamma;
00314     AIDA::IHistogram1D *_hist_n_gammaiso, *_hist_phi_gammaiso, *_hist_eta_gammaiso, *_hist_pt_gammaiso;
00315     AIDA::IHistogram1D *_hist_met;
00316     AIDA::IHistogram1D *_hist_mll_2_ossf_ee, *_hist_mll_2_ossf_mumu, *_hist_mll_2_osof_emu;
00317     AIDA::IHistogram1D *_hist_mll_ossf_ee, *_hist_mll_ossf_mumu, *_hist_mll_osof_emu;
00318     AIDA::IHistogram1D *_hist_mll_all_ossf_ee, *_hist_mll_all_ossf_mumu, *_hist_mll_all_osof_emu;
00319   };
00320 
00321 
00322 
00323   // This global object acts as a hook for the plugin system
00324   AnalysisBuilder<MC_SUSY> plugin_MC_SUSY;
00325 
00326 }