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