rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_CONF_2012_103.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/VetoedFinalState.hh"
00008 #include "Rivet/Projections/IdentifiedFinalState.hh"
00009 #include "Rivet/Projections/FastJets.hh"
00010 #include "Rivet/Tools/RivetMT2.hh"
00011 
00012 namespace Rivet {
00013 
00014 
00015   class ATLAS_2012_CONF_2012_103 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     ATLAS_2012_CONF_2012_103()
00020       : Analysis("ATLAS_2012_CONF_2012_103")
00021     {    }
00022 
00023 
00024     /// @name Analysis methods
00025     //@{
00026 
00027     /// Book histograms and initialise projections before the run
00028     void init() {
00029 
00030       // projection to find the electrons
00031       IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV);
00032       elecs.acceptIdPair(PID::ELECTRON);
00033       addProjection(elecs, "elecs");
00034 
00035       // projection to find the muons
00036       IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV);
00037       muons.acceptIdPair(PID::MUON);
00038       addProjection(muons, "muons");
00039 
00040       // for pTmiss
00041       addProjection(VisibleFinalState(Cuts::abseta < 4.9), "vfs");
00042 
00043       VetoedFinalState vfs;
00044       vfs.addVetoPairId(PID::MUON);
00045 
00046       /// Jet finder
00047       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04");
00048 
00049       /// Book histograms
00050       _etmiss_HT_7j55 = bookHisto1D("etmiss_HT_7j55", 8, 0., 16.);
00051       _etmiss_HT_8j55 = bookHisto1D("etmiss_HT_8j55", 8, 0., 16.);
00052       _etmiss_HT_9j55 = bookHisto1D("etmiss_HT_9j55", 8, 0., 16.);
00053       _etmiss_HT_6j80 = bookHisto1D("etmiss_HT_6j80", 8, 0., 16.);
00054       _etmiss_HT_7j80 = bookHisto1D("etmiss_HT_7j80", 8, 0., 16.);
00055       _etmiss_HT_8j80 = bookHisto1D("etmiss_HT_8j80", 8, 0., 16.);
00056 
00057       _hist_njet55 = bookHisto1D("hist_njet55", 4, 5.5, 9.5);
00058       _hist_njet80 = bookHisto1D("hist_njet80", 4, 4.5, 8.5);
00059 
00060       _count_7j55 = bookHisto1D("count_7j55", 1, 0., 1.);
00061       _count_8j55 = bookHisto1D("count_8j55", 1, 0., 1.);
00062       _count_9j55 = bookHisto1D("count_9j55", 1, 0., 1.);
00063       _count_6j80 = bookHisto1D("count_6j80", 1, 0., 1.);
00064       _count_7j80 = bookHisto1D("count_7j80", 1, 0., 1.);
00065       _count_8j80 = bookHisto1D("count_8j80", 1, 0., 1.);
00066 
00067     }
00068 
00069 
00070     /// Perform the per-event analysis
00071     void analyze(const Event& event) {
00072       const double weight = event.weight();
00073 
00074       // get the jet candidates
00075       Jets cand_jets;
00076       foreach (const Jet& jet,
00077                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00078         if ( fabs( jet.eta() ) < 2.8 ) {
00079           cand_jets.push_back(jet);
00080         }
00081       }
00082 
00083       // candidate muons
00084       Particles cand_mu =
00085         applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt();
00086 
00087       // candidate electrons
00088       Particles cand_e  =
00089         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00090 
00091       // resolve jet/lepton ambiguity
00092       Jets recon_jets;
00093       foreach ( const Jet& jet, cand_jets ) {
00094         // candidates after |eta| < 2.8
00095         if ( fabs( jet.eta() ) >= 2.8 ) continue;
00096         bool away_from_e = true;
00097         foreach ( const Particle & e, cand_e ) {
00098           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00099             away_from_e = false;
00100             break;
00101           }
00102         }
00103         if ( away_from_e ) recon_jets.push_back( jet );
00104       }
00105 
00106       // only keep electrons more than R=0.4 from jets
00107       Particles recon_e;
00108       foreach ( const Particle & e, cand_e ) {
00109         bool away = true;
00110         foreach ( const Jet& jet, recon_jets ) {
00111           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00112             away = false;
00113             break;
00114           }
00115         }
00116         if ( away )
00117           recon_e.push_back( e );
00118       }
00119 
00120       // only keep muons more than R=0.4 from jets
00121       Particles recon_mu;
00122       foreach ( const Particle & mu, cand_mu ) {
00123         bool away = true;
00124         foreach ( const Jet& jet, recon_jets ) {
00125           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00126             away = false;
00127             break;
00128           }
00129         }
00130         if ( away )
00131           recon_mu.push_back( mu );
00132       }
00133 
00134       // pTmiss
00135       Particles vfs_particles =
00136         applyProjection<VisibleFinalState>(event, "vfs").particles();
00137       FourMomentum pTmiss;
00138       foreach ( const Particle & p, vfs_particles ) {
00139         pTmiss -= p.momentum();
00140       }
00141       double eTmiss = pTmiss.pT();
00142 
00143       // now only use recon_jets, recon_mu, recon_e
00144 
00145       // reject events with electrons and muons
00146       if ( ! ( recon_mu.empty() && recon_e.empty() ) ) {
00147         MSG_DEBUG("Charged leptons left after selection");
00148         vetoEvent;
00149       }
00150 
00151       // calculate H_T
00152       double HT=0;
00153       foreach ( const Jet& jet, recon_jets ) {
00154         if ( jet.pT() > 40 * GeV )
00155           HT += jet.pT() ;
00156       }
00157 
00158       // number of jets
00159       unsigned int njet55=0, njet80=0;
00160       for (unsigned int ix=0;ix<recon_jets.size();++ix) {
00161         if(recon_jets[ix].pT()>80.*GeV) ++njet80;
00162         if(recon_jets[ix].pT()>55.*GeV) ++njet55;
00163       }
00164 
00165       double ratio = eTmiss/sqrt(HT);
00166 
00167       if(ratio>4.) {
00168         if(njet55>9) njet55 = 9;
00169         if(njet80>8) njet80 = 8;
00170         _hist_njet55->fill(njet55,weight);
00171         _hist_njet80->fill(njet80,weight);
00172         // 7j55
00173         if(njet55>=7)
00174           _count_7j55->fill( 0.5, weight);
00175         // 8j55
00176         if(njet55>=8)
00177           _count_8j55->fill( 0.5, weight) ;
00178         // 8j55
00179         if(njet55==9)
00180           _count_9j55->fill( 0.5, weight) ;
00181         // 6j80
00182         if(njet80>=6)
00183           _count_6j80->fill( 0.5, weight) ;
00184         // 7j80
00185         if(njet80>=7)
00186           _count_7j80->fill( 0.5, weight) ;
00187         // 8j80
00188         if(njet80==8)
00189           _count_8j80->fill( 0.5, weight) ;
00190       }
00191 
00192       if(njet55>=7)
00193         _etmiss_HT_7j55->fill( ratio, weight);
00194       // 8j55
00195       if(njet55>=8)
00196         _etmiss_HT_8j55->fill( ratio, weight) ;
00197       // 8j55
00198       if(njet55>=9)
00199         _etmiss_HT_9j55->fill( ratio, weight) ;
00200       // 6j80
00201       if(njet80>=6)
00202         _etmiss_HT_6j80->fill( ratio, weight) ;
00203       // 7j80
00204       if(njet80>=7)
00205         _etmiss_HT_7j80->fill( ratio, weight) ;
00206       // 8j80
00207       if(njet80>=8)
00208         _etmiss_HT_8j80->fill( ratio, weight) ;
00209 
00210     }
00211 
00212     //@}
00213 
00214     void finalize() {
00215       double norm = crossSection()/femtobarn*5.8/sumOfWeights();
00216 
00217       scale(_etmiss_HT_7j55,2.*norm);
00218       scale(_etmiss_HT_8j55,2.*norm);
00219       scale(_etmiss_HT_9j55,2.*norm);
00220       scale(_etmiss_HT_6j80,2.*norm);
00221       scale(_etmiss_HT_7j80,2.*norm);
00222       scale(_etmiss_HT_8j80,2.*norm);
00223 
00224       scale(_hist_njet55,norm);
00225       scale(_hist_njet80,norm);
00226 
00227       scale(_count_7j55,norm);
00228       scale(_count_8j55,norm);
00229       scale(_count_9j55,norm);
00230       scale(_count_6j80,norm);
00231       scale(_count_7j80,norm);
00232       scale(_count_8j80,norm);
00233     }
00234 
00235   private:
00236 
00237     /// @name Histograms
00238     //@{
00239     Histo1DPtr _etmiss_HT_7j55;
00240     Histo1DPtr _etmiss_HT_8j55;
00241     Histo1DPtr _etmiss_HT_9j55;
00242     Histo1DPtr _etmiss_HT_6j80;
00243     Histo1DPtr _etmiss_HT_7j80;
00244     Histo1DPtr _etmiss_HT_8j80;
00245 
00246     Histo1DPtr _hist_njet55;
00247     Histo1DPtr _hist_njet80;
00248 
00249     Histo1DPtr _count_7j55;
00250     Histo1DPtr _count_8j55;
00251     Histo1DPtr _count_9j55;
00252     Histo1DPtr _count_6j80;
00253     Histo1DPtr _count_7j80;
00254     Histo1DPtr _count_8j80;
00255     //@}
00256 
00257   };
00258 
00259   // The hook for the plugin system
00260   DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_103);
00261 
00262 }