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