rivet is hosted by Hepforge, IPPP Durham
ATLAS_2016_I1444991.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/DressedLeptons.hh"
00005 #include "Rivet/Projections/IdentifiedFinalState.hh"
00006 #include "Rivet/Projections/PromptFinalState.hh"
00007 #include "Rivet/Projections/VetoedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/VisibleFinalState.hh"
00010 
00011 namespace Rivet {
00012 
00013 
00014   class ATLAS_2016_I1444991 : public Analysis {
00015   public:
00016 
00017     /// Constructor
00018     DEFAULT_RIVET_ANALYSIS_CTOR(ATLAS_2016_I1444991);
00019 
00020 
00021   public:
00022 
00023     /// Book histograms and initialise projections before the run
00024     void init() {
00025 
00026       // All particles within |eta| < 5.0
00027       const FinalState FS(Cuts::abseta < 5.0);
00028 
00029       // Project photons for dressing
00030       IdentifiedFinalState photon_id(FS);
00031       photon_id.acceptIdPair(PID::PHOTON);
00032 
00033       // Project dressed electrons with pT > 15 GeV and |eta| < 2.47
00034       IdentifiedFinalState el_id(FS);
00035       el_id.acceptIdPair(PID::ELECTRON);
00036       PromptFinalState el_bare(el_id);
00037       Cut cuts = (Cuts::abseta < 2.47) && ( (Cuts::abseta <= 1.37) || (Cuts::abseta >= 1.52) ) && (Cuts::pT > 15*GeV);
00038       DressedLeptons el_dressed_FS(photon_id, el_bare, 0.1, cuts, true, true);
00039       declare(el_dressed_FS,"EL_DRESSED_FS");
00040 
00041       // Project dressed muons with pT > 15 GeV and |eta| < 2.5
00042       IdentifiedFinalState mu_id(FS);
00043       mu_id.acceptIdPair(PID::MUON);
00044       PromptFinalState mu_bare(mu_id);
00045       DressedLeptons mu_dressed_FS(photon_id, mu_bare, 0.1, Cuts::abseta < 2.5 && Cuts::pT > 15*GeV, true, true);
00046       declare(mu_dressed_FS,"MU_DRESSED_FS");
00047 
00048       // get MET from generic invisibles
00049       VetoedFinalState inv_fs(FS);
00050       inv_fs.addVetoOnThisFinalState(VisibleFinalState(FS));
00051       declare(inv_fs, "InvisibleFS");
00052 
00053       // Project jets
00054       FastJets jets(FS, FastJets::ANTIKT, 0.4);
00055       jets.useInvisibles(JetAlg::NO_INVISIBLES);
00056       jets.useMuons(JetAlg::NO_MUONS);
00057       declare(jets, "jets");
00058 
00059       // Book histograms
00060       _h_Njets        = bookHisto1D( 2,1,1);
00061       _h_PtllMET      = bookHisto1D( 3,1,1);
00062       _h_Yll          = bookHisto1D( 4,1,1);
00063       _h_PtLead       = bookHisto1D( 5,1,1);
00064       _h_Njets_norm   = bookHisto1D( 6,1,1);
00065       _h_PtllMET_norm = bookHisto1D( 7,1,1);
00066       _h_Yll_norm     = bookHisto1D( 8,1,1);
00067       _h_PtLead_norm  = bookHisto1D( 9,1,1);
00068       _h_JetVeto      = bookScatter2D(10, 1, 1, true);
00069       
00070       //histos for jetveto
00071       std::vector<double> ptlead25_bins = { 0., 25., 300. };
00072       std::vector<double> ptlead40_bins = { 0., 40., 300. };
00073       _h_pTj1_sel25 = bookHisto1D( "pTj1_sel25", ptlead25_bins, "", "", "" );
00074       _h_pTj1_sel40 = bookHisto1D( "pTj1_sel40", ptlead40_bins, "", "", "" );
00075     }
00076 
00077 
00078     /// Perform the per-event analysis
00079     void analyze(const Event& event) {
00080   
00081       const double weight = event.weight();
00082 
00083       // Get final state particles 
00084       const FinalState& ifs = applyProjection<FinalState>(event, "InvisibleFS");
00085       const vector<DressedLepton>& good_mu = applyProjection<DressedLeptons>(event, "MU_DRESSED_FS").dressedLeptons();
00086       const vector<DressedLepton>& el_dressed = applyProjection<DressedLeptons>(event, "EL_DRESSED_FS").dressedLeptons();
00087       const Jets& jets = applyProjection<FastJets>(event, "jets").jetsByPt(Cuts::pT>25*GeV && Cuts::abseta < 4.5);
00088 
00089       //find good electrons
00090       vector<DressedLepton> good_el;
00091       foreach(const DressedLepton& el, el_dressed){
00092         bool keep = true;
00093         foreach(const DressedLepton &mu, good_mu) {
00094           keep &= deltaR(el, mu) >= 0.1;
00095         }
00096         if (keep)  good_el += el;
00097       }
00098 
00099       // select only emu events
00100       if ((good_el.size() != 1) || good_mu.size() != 1)  vetoEvent;
00101 
00102       //built dilepton
00103       FourMomentum dilep = good_el[0].momentum() + good_mu[0].momentum();
00104       double Mll = dilep.mass();
00105       double Yll = dilep.rapidity();
00106       double DPhill = fabs(deltaPhi(good_el[0], good_mu[0]));
00107       double pTl1 = (good_el[0].pT() > good_mu[0].pT())? good_el[0].pT() : good_mu[0].pT();
00108 
00109       //get MET
00110       FourMomentum met;
00111       foreach (const Particle& p, ifs.particles())  met += p.momentum();
00112       
00113       // do a few cuts before looking at jets
00114       if (pTl1 <= 22. || DPhill >= 1.8 || met.pT() <= 20.)  vetoEvent;
00115       if (Mll <= 10. || Mll >= 55.)  vetoEvent;
00116  
00117       Jets jets_selected;
00118       foreach (const Jet &j, jets) {
00119         if( j.abseta() > 2.4 && j.pT()<=30*GeV ) continue;
00120         bool keep = true;
00121         foreach(DressedLepton el, good_el) {
00122           keep &= deltaR(j, el) >= 0.3;
00123         }
00124         if (keep)  jets_selected += j;
00125       }
00126 
00127       double PtllMET = (met + good_el[0].momentum() + good_mu[0].momentum()).pT(); 
00128 
00129       double Njets = jets_selected.size() > 2 ? 2 : jets_selected.size();
00130       double pTj1 = jets_selected.size()? jets_selected[0].pT() : 0.1;
00131 
00132       // Fill histograms
00133       _h_Njets->fill(Njets, weight);
00134       _h_PtllMET->fill(PtllMET, weight);
00135       _h_Yll->fill(fabs(Yll), weight);
00136       _h_PtLead->fill(pTj1, weight);
00137       _h_Njets_norm->fill(Njets, weight);
00138       _h_PtllMET_norm->fill(PtllMET, weight);
00139       _h_Yll_norm->fill(fabs(Yll), weight);
00140       _h_PtLead_norm->fill(pTj1, weight);
00141       _h_pTj1_sel25->fill(pTj1, weight);
00142       _h_pTj1_sel40->fill(pTj1, weight);
00143     }
00144 
00145 
00146     /// Normalise histograms etc., after the run
00147     void finalize() {
00148 
00149       const double xs = crossSectionPerEvent()/femtobarn;
00150 
00151       /// @todo Normalise, scale and otherwise manipulate histograms here
00152       scale(_h_Njets, xs);
00153       scale(_h_PtllMET, xs);
00154       scale(_h_Yll, xs);
00155       scale(_h_PtLead, xs);
00156       normalize(_h_Njets_norm);
00157       normalize(_h_PtllMET_norm);
00158       normalize(_h_Yll_norm);
00159       normalize(_h_PtLead_norm);
00160       scale(_h_pTj1_sel25, xs);
00161       scale(_h_pTj1_sel40, xs);
00162       normalize(_h_pTj1_sel25);
00163       normalize(_h_pTj1_sel40);
00164       // fill jet veto efficiency histogram
00165       _h_JetVeto->point(0).setY(_h_pTj1_sel25->bin(0).sumW(), sqrt(_h_pTj1_sel25->bin(0).sumW2()));
00166       _h_JetVeto->point(1).setY(_h_PtLead_norm->bin(0).sumW(), sqrt(_h_PtLead_norm->bin(0).sumW2()));
00167       _h_JetVeto->point(2).setY(_h_pTj1_sel40->bin(0).sumW(), sqrt(_h_pTj1_sel25->bin(0).sumW2()));
00168 
00169     }
00170 
00171   private:
00172 
00173     /// @name Histograms
00174     //@{
00175     Histo1DPtr _h_Njets;
00176     Histo1DPtr _h_PtllMET;
00177     Histo1DPtr _h_Yll;
00178     Histo1DPtr _h_PtLead;
00179     Histo1DPtr _h_Njets_norm;
00180     Histo1DPtr _h_PtllMET_norm;
00181     Histo1DPtr _h_Yll_norm;
00182     Histo1DPtr _h_PtLead_norm;
00183 
00184     Scatter2DPtr _h_JetVeto;
00185 
00186     Histo1DPtr _h_pTj1_sel25;
00187     Histo1DPtr _h_pTj1_sel40;
00188 
00189   };
00190 
00191 
00192   // The hook for the plugin system
00193   DECLARE_RIVET_PLUGIN(ATLAS_2016_I1444991);
00194 
00195 }