rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_CONF_2012_104.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/VetoedFinalState.hh"
00009 #include "Rivet/Projections/FastJets.hh"
00010 
00011 namespace Rivet {
00012 
00013   using namespace Cuts;
00014 
00015 
00016   class ATLAS_2012_CONF_2012_104 : public Analysis {
00017   public:
00018 
00019     /// @name Constructors etc.
00020     //@{
00021 
00022     /// Constructor
00023 
00024     ATLAS_2012_CONF_2012_104()
00025       : Analysis("ATLAS_2012_CONF_2012_104")
00026     {    }
00027 
00028     //@}
00029 
00030 
00031   public:
00032 
00033     /// @name Analysis methods
00034     //@{
00035 
00036     /// Book histograms and initialize projections before the run
00037     void init() {
00038 
00039       // projection to find the electrons
00040       IdentifiedFinalState elecs(etaIn(-2.47, 2.47) 
00041                  & (pT >= 10.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 >= 10.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), "AntiKtJets04");
00055 
00056       // all tracks (to do deltaR with leptons)
00057       addProjection(ChargedFinalState(-3.0,3.0,0.5*GeV),"cfs");
00058 
00059       // for pTmiss
00060       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00061 
00062       // Book histograms
00063       _count_e  = bookHisto1D("count_e" , 1, 0., 1.);
00064       _count_mu = bookHisto1D("count_mu", 1, 0., 1.);
00065 
00066       _hist_eTmiss_e  = bookHisto1D("hist_eTmiss_e"  , 25, 0., 1000.);
00067       _hist_eTmiss_mu = bookHisto1D("hist_eTmiss_mu" , 25, 0., 1000.);
00068 
00069     }
00070 
00071     /// Perform the per-event analysis
00072     void analyze(const Event& event) {
00073       const double weight = event.weight();
00074 
00075       // get the candiate jets
00076       Jets cand_jets;
00077       foreach ( const Jet& jet,
00078                 applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00079         if ( fabs( jet.eta() ) < 2.8 ) {
00080           cand_jets.push_back(jet);
00081         }
00082       }
00083 
00084       // get the candidate "medium" leptons without isolation
00085       Particles cand_e;
00086       foreach( const Particle & e,
00087                applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt()) {
00088         // remove any leptons within 0.4 of any candidate jets
00089         bool e_near_jet = false;
00090         foreach ( const Jet& jet, cand_jets ) {
00091           double dR = deltaR(e.momentum(),jet.momentum());
00092           if ( dR < 0.4 && dR > 0.2 ) {
00093             e_near_jet = true;
00094             break;
00095           }
00096         }
00097         if ( ! e_near_jet ) cand_e.push_back(e);
00098       }
00099       Particles cand_mu;
00100       foreach( const Particle & mu,
00101                applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt()) {
00102         // remove any leptons within 0.4 of any candidate jets
00103         bool mu_near_jet = false;
00104         foreach ( const Jet& jet, cand_jets ) {
00105           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00106             mu_near_jet = true;
00107             break;
00108           }
00109         }
00110         if ( ! mu_near_jet ) cand_mu.push_back(mu);
00111       }
00112       // apply the isolation
00113       Particles chg_tracks =
00114         applyProjection<ChargedFinalState>(event, "cfs").particles();
00115       // pTcone around muon track (hard)
00116       Particles recon_mu;
00117       foreach ( const Particle & mu, cand_mu ) {
00118         double pTinCone = -mu.pT();
00119         if(-pTinCone<25.) continue;
00120         foreach ( const Particle & track, chg_tracks ) {
00121           if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
00122             pTinCone += track.pT();
00123         }
00124         if ( pTinCone < 1.8*GeV ) recon_mu.push_back(mu);
00125       }
00126       // pTcone around electron track (hard)
00127       Particles recon_e;
00128       foreach ( const Particle & e, cand_e ) {
00129         double pTinCone = -e.pT();
00130         if(-pTinCone<25.) continue;
00131         foreach ( const Particle & track, chg_tracks ) {
00132           if ( deltaR(e.momentum(),track.momentum()) < 0.2 )
00133             pTinCone += track.pT();
00134         }
00135         if ( pTinCone < 0.1 * e.pT() ) recon_e.push_back(e);
00136       }
00137 
00138       // discard jets that overlap with electrons
00139       Jets recon_jets;
00140       foreach ( const Jet& jet, cand_jets ) {
00141         if(jet.abseta()>2.5||
00142            jet.perp()<25.) continue;
00143         bool away_from_e = true;
00144         foreach ( const Particle & e, cand_e ) {
00145           if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) {
00146             away_from_e = false;
00147             break;
00148           }
00149         }
00150         if ( away_from_e ) recon_jets.push_back( jet );
00151       }
00152 
00153       // pTmiss
00154       FourMomentum pTmiss;
00155       foreach ( const Particle & p,
00156                 applyProjection<VisibleFinalState>(event, "vfs").particles() ) {
00157         pTmiss -= p.momentum();
00158       }
00159       double eTmiss = pTmiss.pT();
00160 
00161       // at least 4 jets with pT>80.
00162       if(recon_jets.size()<4 || recon_jets[3].perp()<80.) vetoEvent;
00163 
00164       // only 1 signal lepton
00165       if( recon_e.size() + recon_mu.size() != 1 )
00166         vetoEvent;
00167       if( cand_e .size() + cand_mu .size() != 1 )
00168         vetoEvent;
00169 
00170       // start of meff calculation
00171       double HT=0.;
00172       foreach( const Jet & jet, recon_jets) {
00173         double pT = jet.perp();
00174         if(pT>40.) HT += pT;
00175       }
00176 
00177       // get the lepton
00178       Particle lepton = recon_e.empty() ? recon_mu[0] : recon_e[0];
00179 
00180       // lepton variables
00181       double pT = lepton.perp();
00182 
00183       double mT  = 2.*(pT*eTmiss -
00184                        lepton.px()*pTmiss.px() -
00185                        lepton.py()*pTmiss.py());
00186       mT = sqrt(mT);
00187       HT += pT;
00188       double m_eff_inc  = HT + eTmiss + pT;
00189       double m_eff_4 = eTmiss + pT;
00190       for(unsigned int ix=0;ix<4;++ix)
00191         m_eff_4 +=  recon_jets[ix].perp();
00192 
00193       // four jet selecton
00194       if(mT>100.&& eTmiss/m_eff_4>0.2 &&
00195          m_eff_inc > 800.) {
00196         if( eTmiss > 250. ) {
00197           if(lepton.abspid()==PID::ELECTRON)
00198             _count_e->fill(0.5,weight);
00199           else if(lepton.abspid()==PID::MUON)
00200             _count_mu->fill(0.5,weight);
00201         }
00202         if(lepton.abspid()==PID::ELECTRON)
00203           _hist_eTmiss_e ->fill(eTmiss,weight);
00204         else if(lepton.abspid()==PID::MUON)
00205           _hist_eTmiss_mu->fill(eTmiss,weight);
00206       }
00207     }
00208     //@}
00209 
00210 
00211     void finalize() {
00212 
00213       double norm = 5.8* crossSection()/sumOfWeights()/femtobarn;
00214       scale(_count_e ,norm);
00215       scale(_count_mu,norm);
00216       scale(_hist_eTmiss_e  ,40.*norm);
00217       scale(_hist_eTmiss_mu ,40.*norm);
00218 
00219     }
00220 
00221   private:
00222 
00223     /// @name Histograms
00224     //@{
00225     Histo1DPtr _count_e ;
00226     Histo1DPtr _count_mu;
00227 
00228     Histo1DPtr _hist_eTmiss_e ;
00229     Histo1DPtr _hist_eTmiss_mu;
00230     //@}
00231 
00232   };
00233 
00234   // The hook for the plugin system
00235   DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_104);
00236 
00237 }