rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S9225137.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_2011_S9225137 : public Analysis {
00016   public:
00017 
00018     /// @name Constructors etc.
00019     //@{
00020 
00021     /// Constructor
00022     ATLAS_2011_S9225137()
00023       : Analysis("ATLAS_2011_S9225137")
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       // veto region electrons
00038       Cut vetocut = Cuts::absetaIn(1.37, 1.52);
00039       IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV);
00040       veto_elecs.acceptIdPair(PID::ELECTRON);
00041       addProjection(veto_elecs, "veto_elecs");
00042 
00043       // projection to find the electrons
00044       IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV);
00045       elecs.acceptIdPair(PID::ELECTRON);
00046       addProjection(elecs, "elecs");
00047 
00048       // projection to find the muons
00049       IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV);
00050       muons.acceptIdPair(PID::MUON);
00051       addProjection(muons, "muons");
00052 
00053       // for pTmiss
00054       addProjection(VisibleFinalState(Cuts::abseta < 4.9), "vfs");
00055 
00056       VetoedFinalState vfs;
00057       vfs.addVetoPairId(PID::MUON);
00058 
00059       /// Jet finder
00060       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04");
00061 
00062       // all tracks (to do deltaR with leptons)
00063       addProjection(ChargedFinalState(Cuts::abseta < 3), "cfs");
00064 
00065       /// Book histograms
00066       _etmisspT_55_NJ_6_obs = bookHisto1D( 1,1,1);
00067       _etmisspT_55_NJ_6_bac = bookHisto1D( 1,1,2);
00068       _etmisspT_55_NJ_6_sig = bookHisto1D( 1,1,3);
00069       _etmisspT_55_NJ_7_obs = bookHisto1D(13,1,1);
00070       _etmisspT_55_NJ_7_bac = bookHisto1D(13,1,2);
00071       _etmisspT_55_NJ_7_sig = bookHisto1D(13,1,3);
00072       _etmisspT_55_NJ_8_obs = bookHisto1D(15,1,1);
00073       _etmisspT_55_NJ_8_bac = bookHisto1D(15,1,2);
00074       _etmisspT_55_NJ_8_sig = bookHisto1D(15,1,3);
00075       _etmisspT_80_NJ_5_obs = bookHisto1D( 2,1,1);
00076       _etmisspT_80_NJ_5_bac = bookHisto1D( 2,1,2);
00077       _etmisspT_80_NJ_5_sig = bookHisto1D( 2,1,3);
00078       _etmisspT_80_NJ_6_obs = bookHisto1D(14,1,1);
00079       _etmisspT_80_NJ_6_bac = bookHisto1D(14,1,2);
00080       _etmisspT_80_NJ_6_sig = bookHisto1D(14,1,3);
00081       _etmisspT_80_NJ_7_obs = bookHisto1D(16,1,1);
00082       _etmisspT_80_NJ_7_bac = bookHisto1D(16,1,2);
00083       _etmisspT_80_NJ_7_sig = bookHisto1D(16,1,3);
00084 
00085       _njet55A_obs = bookHisto1D( 3,1,1);
00086       _njet55A_bac = bookHisto1D( 3,1,2);
00087       _njet55A_sig = bookHisto1D( 3,1,3);
00088       _njet55B_obs = bookHisto1D( 4,1,1);
00089       _njet55B_bac = bookHisto1D( 4,1,2);
00090       _njet55B_sig = bookHisto1D( 4,1,3);
00091       _njet55C_obs = bookHisto1D(17,1,1);
00092       _njet55C_bac = bookHisto1D(17,1,2);
00093       _njet55C_sig = bookHisto1D(17,1,3);
00094       _njet80A_obs = bookHisto1D( 5,1,1);
00095       _njet80A_bac = bookHisto1D( 5,1,2);
00096       _njet80A_sig = bookHisto1D( 5,1,3);
00097       _njet80B_obs = bookHisto1D( 6,1,1);
00098       _njet80B_bac = bookHisto1D( 6,1,2);
00099       _njet80B_sig = bookHisto1D( 6,1,3);
00100       _njet80C_obs = bookHisto1D(18,1,1);
00101       _njet80C_bac = bookHisto1D(18,1,2);
00102       _njet80C_sig = bookHisto1D(18,1,3);
00103 
00104       _count_7j55 = bookHisto1D("count_7j55", 1, 0., 1.);
00105       _count_8j55 = bookHisto1D("count_8j55", 1, 0., 1.);
00106       _count_6j80 = bookHisto1D("count_6j80", 1, 0., 1.);
00107       _count_7j80 = bookHisto1D("count_7j80", 1, 0., 1.);
00108 
00109     }
00110 
00111 
00112     /// Perform the per-event analysis
00113     void analyze(const Event& event) {
00114       const double weight = event.weight();
00115       // apply electron veto region
00116       Particles veto_e
00117         = applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
00118       if ( ! veto_e.empty() ) {
00119         MSG_DEBUG("electrons in veto region");
00120         vetoEvent;
00121       }
00122 
00123       // get the jet candidates
00124       Jets cand_jets;
00125       foreach (const Jet& jet,
00126                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00127         if ( fabs( jet.eta() ) < 4.9 ) {
00128           cand_jets.push_back(jet);
00129         }
00130       }
00131 
00132       // candidate muons
00133       Particles cand_mu;
00134       Particles chg_tracks =
00135         applyProjection<ChargedFinalState>(event, "cfs").particles();
00136       foreach ( const Particle & mu,
00137                 applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt() ) {
00138         double pTinCone = -mu.pT();
00139         foreach ( const Particle & track, chg_tracks ) {
00140           if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 )
00141             pTinCone += track.pT();
00142         }
00143         if ( pTinCone < 1.8*GeV )
00144           cand_mu.push_back(mu);
00145       }
00146 
00147       // candidate electrons
00148 
00149       Particles cand_e  =
00150         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00151 
00152       // resolve jet/lepton ambiguity
00153       Jets cand_jets_2;
00154       foreach ( const Jet& jet, cand_jets ) {
00155         // candidates above eta=2.8 are jets
00156         if ( fabs( jet.eta() ) >= 2.8 )
00157           cand_jets_2.push_back( jet );
00158         // otherwise more the R=0.2 from an electrons
00159         else {
00160           bool away_from_e = true;
00161           foreach ( const Particle & e, cand_e ) {
00162             if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00163               away_from_e = false;
00164               break;
00165             }
00166           }
00167           if ( away_from_e )
00168             cand_jets_2.push_back( jet );
00169         }
00170       }
00171 
00172       // only keep electrons more than R=0.4 from jets
00173       Particles recon_e;
00174       foreach ( const Particle & e, cand_e ) {
00175         bool away = true;
00176         foreach ( const Jet& jet, cand_jets_2 ) {
00177           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00178             away = false;
00179             break;
00180           }
00181         }
00182         if ( away )
00183           recon_e.push_back( e );
00184       }
00185 
00186       // only keep muons more than R=0.4 from jets
00187       Particles recon_mu;
00188       foreach ( const Particle & mu, cand_mu ) {
00189         bool away = true;
00190         foreach ( const Jet& jet, cand_jets_2 ) {
00191           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00192             away = false;
00193             break;
00194           }
00195         }
00196         if ( away ) recon_mu.push_back( mu );
00197       }
00198 
00199       // pTmiss
00200       Particles vfs_particles =
00201         applyProjection<VisibleFinalState>(event, "vfs").particles();
00202       FourMomentum pTmiss;
00203       foreach ( const Particle & p, vfs_particles ) {
00204         pTmiss -= p.momentum();
00205       }
00206       double eTmiss = pTmiss.pT();
00207 
00208       // final jet filter
00209       Jets recon_jets;
00210       foreach (const Jet& jet, cand_jets_2) {
00211         if (jet.abseta() <= 2.8 ) recon_jets.push_back( jet );
00212       }
00213 
00214       // now only use recon_jets, recon_mu, recon_e
00215 
00216       // reject events with electrons and muons
00217       if ( ! ( recon_mu.empty() && recon_e.empty() ) ) {
00218         MSG_DEBUG("Charged leptons left after selection");
00219         vetoEvent;
00220       }
00221 
00222       // calculate H_T
00223       double HT = 0;
00224       foreach (const Jet& jet, recon_jets) {
00225         if (jet.pT() > 40*GeV) HT += jet.pT() ;
00226       }
00227 
00228       // number of jets and deltaR
00229       bool pass55DeltaR=true, pass80DeltaR=true;
00230       size_t njet55=0, njet80=0;
00231       for (size_t ix=0; ix < recon_jets.size(); ++ix) {
00232         if (recon_jets[ix].pT() > 80*GeV) ++njet80;
00233         if (recon_jets[ix].pT() > 55*GeV) ++njet55;
00234         for (size_t iy = ix + 1; iy < recon_jets.size(); ++iy) {
00235           if (recon_jets[ix].pT() > 55*GeV &&
00236               recon_jets[iy].pT() > 55*GeV &&
00237               deltaR(recon_jets[ix], recon_jets[iy]) < 0.6)
00238             pass55DeltaR = false;
00239           // if (recon_jets[ix].pT() > 80*GeV &&
00240           //     recon_jets[iy].pT() > 80*GeV &&
00241           //     deltaR(recon_jets[ix], recon_jets[iy]) < 0.6)
00242           //   pass80DeltaR = false;
00243         }
00244       }
00245 
00246       // require at least four jets with et > 55
00247       if (njet55 <= 3) vetoEvent;
00248 
00249       // plots of etmiss/ht
00250       double etht = eTmiss/sqrt(HT);
00251       if (njet55 == 6) {
00252         _etmisspT_55_NJ_6_obs->fill(etht,weight);
00253         _etmisspT_55_NJ_6_bac->fill(etht,weight);
00254         _etmisspT_55_NJ_6_sig->fill(etht,weight);
00255       } else if (njet55 == 7) {
00256         _etmisspT_55_NJ_7_obs->fill(etht,weight);
00257         _etmisspT_55_NJ_7_bac->fill(etht,weight);
00258         _etmisspT_55_NJ_7_sig->fill(etht,weight);
00259       } else if (njet55 == 8) {
00260         _etmisspT_55_NJ_8_obs->fill(etht,weight);
00261         _etmisspT_55_NJ_8_bac->fill(etht,weight);
00262         _etmisspT_55_NJ_8_sig->fill(etht,weight);
00263       }
00264       if (njet80 == 5) {
00265         _etmisspT_80_NJ_5_obs->fill(etht,weight);
00266         _etmisspT_80_NJ_5_bac->fill(etht,weight);
00267         _etmisspT_80_NJ_5_sig->fill(etht,weight);
00268       } else if (njet80 == 6) {
00269         _etmisspT_80_NJ_6_obs->fill(etht,weight);
00270         _etmisspT_80_NJ_6_bac->fill(etht,weight);
00271         _etmisspT_80_NJ_6_sig->fill(etht,weight);
00272       } else if (njet80 == 7) {
00273         _etmisspT_80_NJ_7_obs->fill(etht,weight);
00274         _etmisspT_80_NJ_7_bac->fill(etht,weight);
00275         _etmisspT_80_NJ_7_sig->fill(etht,weight);
00276       }
00277 
00278       if (etht > 1.5 && etht < 2.) {
00279         if (njet55 > 3) {
00280           _njet55A_obs->fill(njet55,weight);
00281           _njet55A_bac->fill(njet55,weight);
00282           _njet55A_sig->fill(njet55,weight);
00283         }
00284         if (njet80 > 3) {
00285           _njet80A_obs->fill(njet80,weight);
00286           _njet80A_bac->fill(njet80,weight);
00287           _njet80A_sig->fill(njet80,weight);
00288         }
00289       } else if (etht > 2. && etht < 3.) {
00290         if (njet55 > 3) {
00291           _njet55B_obs->fill(njet55,weight);
00292           _njet55B_bac->fill(njet55,weight);
00293           _njet55B_sig->fill(njet55,weight);
00294         }
00295         if (njet80 > 3) {
00296           _njet80B_obs->fill(njet80,weight);
00297           _njet80B_bac->fill(njet80,weight);
00298           _njet80B_sig->fill(njet80,weight);
00299         }
00300       } else {
00301         if (njet55 > 3) {
00302           _njet55C_obs->fill(njet55,weight);
00303           _njet55C_bac->fill(njet55,weight);
00304           _njet55C_sig->fill(njet55,weight);
00305         }
00306         if (njet80 > 3) {
00307           _njet80C_obs->fill(njet80,weight);
00308           _njet80C_bac->fill(njet80,weight);
00309           _njet80C_sig->fill(njet80,weight);
00310         }
00311       }
00312 
00313       // apply E_T/sqrt(H_T) cut
00314       if (etht <= 3.5*GeV) {
00315         MSG_DEBUG("Fails ET/sqrt(HT) cut ");
00316         vetoEvent;
00317       }
00318 
00319       // check passes at least one delta5/ njet number cut
00320       if (!(pass55DeltaR && njet55 >= 7) && !(pass80DeltaR && njet80 >= 6) ) {
00321         MSG_DEBUG("Fails DeltaR cut or jet number cuts");
00322         vetoEvent;
00323       }
00324 
00325       // 7j55
00326       if (njet55 >= 7 && pass55DeltaR) _count_7j55->fill( 0.5, weight);
00327       // 8j55
00328       if (njet55 >= 8 && pass55DeltaR) _count_8j55->fill( 0.5, weight);
00329       // 6j80
00330       if (njet80 >= 6 && pass80DeltaR) _count_6j80->fill( 0.5, weight);
00331       // 7j80
00332       if (njet80 >= 7 && pass80DeltaR) _count_7j80->fill( 0.5, weight);
00333     }
00334 
00335     //@}
00336 
00337     void finalize() {
00338       const double norm = crossSection()/femtobarn*1.34/sumOfWeights();
00339       scale(_etmisspT_55_NJ_6_obs,norm);
00340       scale(_etmisspT_55_NJ_6_bac,norm);
00341       scale(_etmisspT_55_NJ_6_sig,norm);
00342       scale(_etmisspT_55_NJ_7_obs,norm);
00343       scale(_etmisspT_55_NJ_7_bac,norm);
00344       scale(_etmisspT_55_NJ_7_sig,norm);
00345       scale(_etmisspT_55_NJ_8_obs,norm);
00346       scale(_etmisspT_55_NJ_8_bac,norm);
00347       scale(_etmisspT_55_NJ_8_sig,norm);
00348       scale(_etmisspT_80_NJ_5_obs,norm);
00349       scale(_etmisspT_80_NJ_5_bac,norm);
00350       scale(_etmisspT_80_NJ_5_sig,norm);
00351       scale(_etmisspT_80_NJ_6_obs,norm);
00352       scale(_etmisspT_80_NJ_6_bac,norm);
00353       scale(_etmisspT_80_NJ_6_sig,norm);
00354       scale(_etmisspT_80_NJ_7_obs,norm);
00355       scale(_etmisspT_80_NJ_7_bac,norm);
00356       scale(_etmisspT_80_NJ_7_sig,norm);
00357       scale(_njet55A_obs,norm);
00358       scale(_njet55A_bac,norm);
00359       scale(_njet55A_sig,norm);
00360       scale(_njet55B_obs,norm);
00361       scale(_njet55B_bac,norm);
00362       scale(_njet55B_sig,norm);
00363       scale(_njet55C_obs,norm);
00364       scale(_njet55C_bac,norm);
00365       scale(_njet55C_sig,norm);
00366       scale(_njet80A_obs,norm);
00367       scale(_njet80A_bac,norm);
00368       scale(_njet80A_sig,norm);
00369       scale(_njet80B_obs,norm);
00370       scale(_njet80B_bac,norm);
00371       scale(_njet80B_sig,norm);
00372       scale(_njet80C_obs,norm);
00373       scale(_njet80C_bac,norm);
00374       scale(_njet80C_sig,norm);
00375       scale(_count_7j55,norm);
00376       scale(_count_8j55,norm);
00377       scale(_count_6j80,norm);
00378       scale(_count_7j80,norm);
00379     }
00380 
00381   private:
00382 
00383     /// @name Histograms
00384     //@{
00385     Histo1DPtr _etmisspT_55_NJ_6_obs;
00386     Histo1DPtr _etmisspT_55_NJ_6_bac;
00387     Histo1DPtr _etmisspT_55_NJ_6_sig;
00388     Histo1DPtr _etmisspT_55_NJ_7_obs;
00389     Histo1DPtr _etmisspT_55_NJ_7_bac;
00390     Histo1DPtr _etmisspT_55_NJ_7_sig;
00391     Histo1DPtr _etmisspT_55_NJ_8_obs;
00392     Histo1DPtr _etmisspT_55_NJ_8_bac;
00393     Histo1DPtr _etmisspT_55_NJ_8_sig;
00394     Histo1DPtr _etmisspT_80_NJ_5_obs;
00395     Histo1DPtr _etmisspT_80_NJ_5_bac;
00396     Histo1DPtr _etmisspT_80_NJ_5_sig;
00397     Histo1DPtr _etmisspT_80_NJ_6_obs;
00398     Histo1DPtr _etmisspT_80_NJ_6_bac;
00399     Histo1DPtr _etmisspT_80_NJ_6_sig;
00400     Histo1DPtr _etmisspT_80_NJ_7_obs;
00401     Histo1DPtr _etmisspT_80_NJ_7_bac;
00402     Histo1DPtr _etmisspT_80_NJ_7_sig;
00403     Histo1DPtr _njet55A_obs;
00404     Histo1DPtr _njet55A_bac;
00405     Histo1DPtr _njet55A_sig;
00406     Histo1DPtr _njet55B_obs;
00407     Histo1DPtr _njet55B_bac;
00408     Histo1DPtr _njet55B_sig;
00409     Histo1DPtr _njet55C_obs;
00410     Histo1DPtr _njet55C_bac;
00411     Histo1DPtr _njet55C_sig;
00412     Histo1DPtr _njet80A_obs;
00413     Histo1DPtr _njet80A_bac;
00414     Histo1DPtr _njet80A_sig;
00415     Histo1DPtr _njet80B_obs;
00416     Histo1DPtr _njet80B_bac;
00417     Histo1DPtr _njet80B_sig;
00418     Histo1DPtr _njet80C_obs;
00419     Histo1DPtr _njet80C_bac;
00420     Histo1DPtr _njet80C_sig;
00421     Histo1DPtr _count_7j55;
00422     Histo1DPtr _count_8j55;
00423     Histo1DPtr _count_6j80;
00424     Histo1DPtr _count_7j80;
00425     //@}
00426 
00427   };
00428 
00429   // The hook for the plugin system
00430   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9225137);
00431 
00432 }