rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S9019561.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_2011_S9019561 : public Analysis {
00017   public:
00018 
00019     /// @name Constructors etc.
00020     //@{
00021 
00022     /// Constructor
00023 
00024     ATLAS_2011_S9019561()
00025       : Analysis("ATLAS_2011_S9019561")
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 
00046       // veto region electrons
00047       Cut vetocut = etaIn(-1.52, -1.37) | etaIn( 1.37,  1.52);
00048       IdentifiedFinalState veto_elecs(vetocut & (pT >= 10.0*GeV));
00049       veto_elecs.acceptIdPair(PID::ELECTRON);
00050       addProjection(veto_elecs, "veto_elecs");
00051 
00052 
00053       // projection to find the muons
00054       IdentifiedFinalState muons(etaIn(-2.4, 2.4) 
00055                   & (pT >= 20.0*GeV) );
00056       muons.acceptIdPair(PID::MUON);
00057       addProjection(muons, "muons");
00058 
00059 
00060       // jet finder
00061       VetoedFinalState vfs;
00062       vfs.addVetoPairId(PID::MUON);
00063       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
00064                    "AntiKtJets04");
00065 
00066 
00067       // all tracks (to do deltaR with leptons)
00068       addProjection(ChargedFinalState(-3.0,3.0,0.5*GeV),"cfs");
00069 
00070 
00071       // for pTmiss
00072       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00073 
00074 
00075       /// book histograms
00076       _count_OS_e_mu = bookHisto1D("count_OS_e+-mu-+", 1, 0., 1.);
00077       _count_OS_e_e = bookHisto1D("count_OS_e+e-", 1, 0., 1.);
00078       _count_OS_mu_mu = bookHisto1D("count_OS_mu+mu-", 1, 0., 1.);
00079       _count_SS_e_mu = bookHisto1D("count_SS_e+-mu+-", 1, 0., 1.);
00080       _count_SS_e_e = bookHisto1D("count_SS_e+-e+-", 1, 0., 1.);
00081       _count_SS_mu_mu = bookHisto1D("count_SS_mu+-mu+-", 1, 0., 1.);
00082 
00083       _hist_eTmiss_OS  = bookHisto1D("Et_miss_OS", 20, 0., 400.);
00084       _hist_eTmiss_SS  = bookHisto1D("Et_miss_SS", 20, 0., 400.);
00085 
00086     }
00087 
00088 
00089 
00090 
00091     /// Perform the per-event analysis
00092     void analyze(const Event& event) {
00093 
00094       const double weight = event.weight();
00095 
00096       Particles veto_e
00097         = applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
00098       if ( ! veto_e.empty() ) {
00099         MSG_DEBUG("electrons in veto region");
00100         vetoEvent;
00101       }
00102 
00103       Jets cand_jets;
00104       foreach (const Jet& jet,
00105         applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00106         if ( fabs( jet.eta() ) < 2.5 ) {
00107           cand_jets.push_back(jet);
00108         }
00109       }
00110 
00111       Particles cand_e =
00112         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00113 
00114       // charged particle for isolation
00115       Particles chg_tracks =
00116         applyProjection<ChargedFinalState>(event, "cfs").particles();
00117 
00118       // apply muon isolation
00119       Particles cand_mu;
00120       // pTcone around muon track
00121       foreach ( const Particle & mu,
00122                 applyProjection<IdentifiedFinalState>(event,"muons").particlesByPt() ) {
00123         double pTinCone = -mu.pT();
00124         foreach ( const Particle & track, chg_tracks ) {
00125           if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
00126             pTinCone += track.pT();
00127         }
00128         if ( pTinCone < 1.8*GeV )
00129           cand_mu.push_back(mu);
00130       }
00131 
00132       // Discard jets that overlap with electrons
00133       Jets recon_jets;
00134       foreach ( const Jet& jet, cand_jets ) {
00135         bool away_from_e = true;
00136         foreach ( const Particle & e, cand_e ) {
00137           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00138             away_from_e = false;
00139             break;
00140           }
00141         }
00142         if ( away_from_e )
00143          recon_jets.push_back( jet );
00144       }
00145 
00146       // Leptons far from jet
00147       Particles recon_e;
00148       foreach ( const Particle & e, cand_e ) {
00149         bool e_near_jet = false;
00150         foreach ( const Jet& jet, recon_jets ) {
00151           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00152             e_near_jet = true;
00153             break;
00154           }
00155         }
00156         // Electron isolation criterion
00157         if ( ! e_near_jet ) {
00158           double EtinCone = -e.Et();
00159           foreach ( const Particle & track, chg_tracks) {
00160             if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
00161               EtinCone += track.Et();
00162           }
00163           if ( EtinCone/e.pT() <= 0.15 )
00164             recon_e.push_back( e );
00165         }
00166       }
00167 
00168       Particles recon_mu;
00169       foreach ( const Particle & mu, cand_mu ) {
00170          bool mu_near_jet = false;
00171          foreach ( const Jet& jet, recon_jets ) {
00172            if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00173              mu_near_jet = true;
00174              break;
00175            }
00176          }
00177          if ( ! mu_near_jet )
00178           recon_mu.push_back( mu );
00179        }
00180 
00181 
00182       // pTmiss
00183       Particles vfs_particles
00184         = applyProjection<VisibleFinalState>(event, "vfs").particles();
00185       FourMomentum pTmiss;
00186       foreach ( const Particle & p, vfs_particles ) {
00187         pTmiss -= p.momentum();
00188       }
00189       double eTmiss = pTmiss.pT();
00190 
00191       // Exactly two leptons for each event
00192       if ( recon_mu.size() + recon_e.size() != 2)
00193         vetoEvent;
00194 
00195       // Lepton pair mass
00196       FourMomentum p_leptons;
00197       foreach ( Particle e, recon_e ) {
00198         p_leptons +=  e.momentum();
00199       }
00200       foreach ( Particle mu, recon_mu) {
00201         p_leptons += mu.momentum();
00202       }
00203 
00204       if ( p_leptons.mass() <= 5.0 * GeV)
00205         vetoEvent;
00206 
00207       // ==================== FILL ====================
00208 
00209 
00210       // electron, electron
00211       if (recon_e.size() == 2 ) {
00212 
00213         // SS ee
00214         if ( recon_e[0].pid() * recon_e[1].pid() > 0 ) {
00215           _hist_eTmiss_SS->fill(eTmiss, weight);
00216           if ( eTmiss > 100 ) {
00217             MSG_DEBUG("Hits SS e+/-e+/-");
00218             _count_SS_e_e->fill(0.5, weight);
00219           }
00220         }
00221 
00222         // OS ee
00223         else if ( recon_e[0].pid() * recon_e[1].pid() < 0) {
00224           _hist_eTmiss_OS->fill(eTmiss, weight);
00225           if ( eTmiss > 150 ) {
00226             MSG_DEBUG("Hits OS e+e-");
00227             _count_OS_e_e->fill(0.5, weight);
00228           }
00229         }
00230       }
00231 
00232 
00233       // muon, electron
00234       else if ( recon_e.size() == 1 ) {
00235 
00236         // SS mu_e
00237         if ( recon_e[0].pid() * recon_mu[0].pid() > 0 ) {
00238           _hist_eTmiss_SS->fill(eTmiss, weight);
00239           if ( eTmiss > 100 ) {
00240             MSG_DEBUG("Hits SS e+/-mu+/-");
00241             _count_SS_e_mu->fill(0.5, weight);
00242           }
00243         }
00244 
00245         // OS mu_e
00246         else if ( recon_e[0].pid() * recon_mu[0].pid() < 0) {
00247           _hist_eTmiss_OS->fill(eTmiss, weight);
00248           if ( eTmiss > 150 ) {
00249             MSG_DEBUG("Hits OS e+mu-");
00250             _count_OS_e_mu->fill(0.5, weight);
00251           }
00252         }
00253       }
00254 
00255 
00256       // muon, muon
00257       else if ( recon_mu.size() == 2 ) {
00258 
00259         // SS mu_mu
00260         if ( recon_mu[0].pid() * recon_mu[1].pid() > 0 ) {
00261           _hist_eTmiss_SS->fill(eTmiss, weight);
00262           if ( eTmiss > 100 ) {
00263             MSG_DEBUG("Hits SS mu+/-mu+/-");
00264             _count_SS_mu_mu->fill(0.5, weight);
00265           }
00266         }
00267 
00268         // OS mu_mu
00269         else if ( recon_mu[0].pid() * recon_mu[1].pid() < 0) {
00270           _hist_eTmiss_OS->fill(eTmiss, weight);
00271           if ( eTmiss > 150 ) {
00272             MSG_DEBUG("Hits OS mu+mu-");
00273             _count_OS_mu_mu->fill(0.5, weight);
00274           }
00275         }
00276       }
00277 
00278 
00279     }
00280 
00281     //@}
00282 
00283 
00284     void finalize() {
00285       double norm = crossSection()/picobarn*35./sumOfWeights();
00286       // event counts
00287       scale(_count_OS_e_mu ,norm);
00288       scale(_count_OS_e_e  ,norm);
00289       scale(_count_OS_mu_mu,norm);
00290       scale(_count_SS_e_mu ,norm);
00291       scale(_count_SS_e_e  ,norm);
00292       scale(_count_SS_mu_mu,norm);
00293       scale(_hist_eTmiss_OS,10.*norm);
00294       scale(_hist_eTmiss_SS,10.*norm);
00295     }
00296 
00297 
00298   private:
00299 
00300     /// @name Histograms
00301     //@{
00302     Histo1DPtr _count_OS_e_mu;
00303     Histo1DPtr _count_OS_e_e;
00304     Histo1DPtr _count_OS_mu_mu;
00305     Histo1DPtr _count_SS_e_mu;
00306     Histo1DPtr _count_SS_e_e;
00307     Histo1DPtr _count_SS_mu_mu;
00308     Histo1DPtr _hist_eTmiss_OS;
00309     Histo1DPtr _hist_eTmiss_SS;
00310 
00311     //@}
00312 
00313 
00314   };
00315 
00316 
00317 
00318   // The hook for the plugin system
00319   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9019561);
00320 
00321 }