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