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