rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_CONF_2012_105.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Projections/VisibleFinalState.hh"
00007 #include "Rivet/Projections/IdentifiedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/VetoedFinalState.hh"
00010 
00011 namespace Rivet {
00012 
00013   using namespace Cuts;
00014 
00015 
00016   class ATLAS_2012_CONF_2012_105 : public Analysis {
00017   public:
00018 
00019     /// @name Constructors etc.
00020     //@{
00021 
00022     /// Constructor
00023 
00024     ATLAS_2012_CONF_2012_105()
00025       : Analysis("ATLAS_2012_CONF_2012_105")
00026     {    }
00027 
00028     //@}
00029 
00030 
00031   public:
00032 
00033     /// @name Analysis methods
00034     //@{
00035 
00036     /// Book histograms and initialise projections before the run
00037     void init() {
00038 
00039       // projection to find the electrons
00040       IdentifiedFinalState elecs(etaIn(-2.47, 2.47) 
00041                  & (pT >= 20.0*GeV));
00042       elecs.acceptIdPair(PID::ELECTRON);
00043       addProjection(elecs, "elecs");
00044 
00045       // projection to find the muons
00046       IdentifiedFinalState muons(etaIn(-2.4, 2.4) 
00047                  & (pT >= 20.0*GeV));
00048       muons.acceptIdPair(PID::MUON);
00049       addProjection(muons, "muons");
00050 
00051       // jet finder
00052       VetoedFinalState vfs;
00053       vfs.addVetoPairId(PID::MUON);
00054       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
00055                     "AntiKtJets04");
00056 
00057       // all tracks (to do deltaR with leptons)
00058       addProjection(ChargedFinalState(-3.0,3.0,0.5*GeV),"cfs");
00059 
00060       // for pTmiss
00061       addProjection(VisibleFinalState(-4.5,4.5),"vfs");
00062 
00063       // book histograms
00064 
00065       // counts in signal regions
00066       _count_ee   = bookHisto1D("count_ee"  , 1, 0., 1.);
00067       _count_emu  = bookHisto1D("count_emu" , 1, 0., 1.);
00068       _count_mumu = bookHisto1D("count_mumu", 1, 0., 1.);
00069       _count_ll   = bookHisto1D("count_ll"  , 1, 0., 1.);
00070 
00071       // histograms from paper
00072       _hist_eTmiss_ee   = bookHisto1D("eTmiss_ee"  , 8, 0., 400.);
00073       _hist_eTmiss_emu  = bookHisto1D("eTmiss_emu" , 8, 0., 400.);
00074       _hist_eTmiss_mumu = bookHisto1D("eTmiss_mumu", 8, 0., 400.);
00075       _hist_eTmiss_ll   = bookHisto1D("eTmiss_ll"  , 8, 0., 400.);
00076     }
00077 
00078     /// Perform the event analysis
00079     void analyze(const Event& event) {
00080       // event weight
00081       const double weight = event.weight();
00082 
00083       // get the jet candidates
00084       Jets cand_jets;
00085       foreach (const Jet& jet,
00086                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00087         if ( fabs( jet.eta() ) < 2.8 ) {
00088           cand_jets.push_back(jet);
00089         }
00090       }
00091 
00092       // electron candidates
00093       Particles cand_e =
00094         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00095 
00096       // Discard jets that overlap with electrons
00097       Jets recon_jets;
00098       foreach ( const Jet& jet, cand_jets ) {
00099         bool away_from_e = true;
00100         foreach ( const Particle & e, cand_e ) {
00101           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00102             away_from_e = false;
00103             break;
00104           }
00105         }
00106         if ( away_from_e ) recon_jets.push_back( jet );
00107       }
00108       // get the charged tracks for isolation
00109       Particles chg_tracks =
00110         applyProjection<ChargedFinalState>(event, "cfs").particles();
00111 
00112       // Reconstructed electrons
00113       Particles recon_leptons;
00114       foreach ( const Particle & e, cand_e ) {
00115         // check not near a jet
00116         bool e_near_jet = false;
00117         foreach ( const Jet& jet, recon_jets ) {
00118           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00119             e_near_jet = true;
00120             break;
00121           }
00122         }
00123         if ( e_near_jet ) continue;
00124         // check the isolation
00125         double pTinCone = -e.pT();
00126         foreach ( const Particle & track, chg_tracks ) {
00127           if ( deltaR(e.momentum(),track.momentum()) < 0.2 )
00128             pTinCone += track.pT();
00129         }
00130         if ( pTinCone < 0.1*e.perp() )
00131           recon_leptons.push_back(e);
00132       }
00133 
00134       // Reconstructed Muons
00135       Particles cand_mu =
00136         applyProjection<IdentifiedFinalState>(event,"muons").particlesByPt();
00137       foreach ( const Particle & mu, cand_mu ) {
00138         // check not near a jet
00139         bool mu_near_jet = false;
00140         foreach ( const Jet& jet, recon_jets ) {
00141           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00142             mu_near_jet = true;
00143             break;
00144           }
00145         }
00146         if ( mu_near_jet ) continue;
00147         // isolation
00148         double pTinCone = -mu.pT();
00149         foreach ( const Particle & track, chg_tracks ) {
00150           if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
00151             pTinCone += track.pT();
00152         }
00153         if ( pTinCone < 1.8*GeV )
00154           recon_leptons.push_back(mu);
00155       }
00156 
00157       // pTmiss
00158       Particles vfs_particles
00159         = applyProjection<VisibleFinalState>(event, "vfs").particles();
00160       FourMomentum pTmiss;
00161       foreach ( const Particle & p, vfs_particles ) {
00162         pTmiss -= p.momentum();
00163       }
00164       double eTmiss = pTmiss.pT();
00165 
00166       // Exactly two leptons for each event
00167       if ( recon_leptons.size() != 2) vetoEvent;
00168       // ensure 1st hardest
00169       if(recon_leptons[0].perp()<recon_leptons[1].perp())
00170         std::swap(recon_leptons[0],recon_leptons[1]);
00171       // only keep same sign
00172       if(recon_leptons[0].pid()*recon_leptons[1].pid()<0)
00173         vetoEvent;
00174       // at least 4 jets pt>50
00175       if(recon_jets.size()<4||recon_jets[3].perp()<50.)
00176         vetoEvent;
00177 
00178       if(recon_leptons[0].pid()!=recon_leptons[1].pid())
00179         _hist_eTmiss_emu ->fill(eTmiss,weight);
00180       else if(recon_leptons[0].abspid()==PID::ELECTRON)
00181         _hist_eTmiss_ee ->fill(eTmiss,weight);
00182       else if(recon_leptons[0].abspid()==PID::MUON)
00183         _hist_eTmiss_mumu->fill(eTmiss,weight);
00184       _hist_eTmiss_ll->fill(eTmiss,weight);
00185 
00186       if(eTmiss>150.) {
00187         if(recon_leptons[0].pid()!=recon_leptons[1].pid())
00188           _count_emu ->fill(0.5,weight);
00189         else if(recon_leptons[0].abspid()==PID::ELECTRON)
00190           _count_ee  ->fill(0.5,weight);
00191         else if(recon_leptons[0].abspid()==PID::MUON)
00192           _count_mumu->fill(0.5,weight);
00193         _count_ll->fill(0.5,weight);
00194       }
00195 
00196     }
00197 
00198     //@}
00199 
00200 
00201     void finalize() {
00202 
00203       double norm = crossSection()/femtobarn*5.8/sumOfWeights();
00204       // event counts
00205       scale(_count_ee  ,norm);
00206       scale(_count_emu ,norm);
00207       scale(_count_mumu,norm);
00208       scale(_count_ll  ,norm);
00209       // histograms
00210       scale(_hist_eTmiss_ee  ,norm*50.);
00211       scale(_hist_eTmiss_emu ,norm*50.);
00212       scale(_hist_eTmiss_mumu,norm*50.);
00213       scale(_hist_eTmiss_ll  ,norm*50.);
00214 
00215     }
00216 
00217   private:
00218 
00219     /// @name Histograms
00220     //@{
00221     Histo1DPtr _count_ee  ;
00222     Histo1DPtr _count_emu ;
00223     Histo1DPtr _count_mumu;
00224     Histo1DPtr _count_ll  ;
00225 
00226     Histo1DPtr _hist_eTmiss_ee;
00227     Histo1DPtr _hist_eTmiss_emu;
00228     Histo1DPtr _hist_eTmiss_mumu;
00229     Histo1DPtr _hist_eTmiss_ll;
00230     //@}
00231   };
00232 
00233   // The hook for the plugin system
00234   DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_105);
00235 
00236 }