rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S8983313.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_S8983313 : public Analysis {
00016   public:
00017 
00018     /// @name Constructors etc.
00019     //@{
00020 
00021     /// Constructor
00022     ATLAS_2011_S8983313()
00023       : Analysis("ATLAS_2011_S8983313")
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       Cut pt10 = Cuts::pT > 10.0*GeV;
00039 
00040       IdentifiedFinalState elecs( EtaIn(-2.47, 2.47) & pt10 );
00041       elecs.acceptIdPair(PID::ELECTRON);
00042       addProjection(elecs, "elecs");
00043 
00044 
00045 
00046       // veto region electrons
00047       Cut vetocut = EtaIn(-1.52, -1.37) | EtaIn( 1.37,  1.52);
00048       IdentifiedFinalState veto_elecs(vetocut & pt10);
00049       veto_elecs.acceptIdPair(PID::ELECTRON);
00050       addProjection(veto_elecs, "veto_elecs");
00051 
00052 
00053 
00054       // projection to find the muons
00055       IdentifiedFinalState muons( EtaIn(-2.4, 2.4) & pt10 );
00056       muons.acceptIdPair(PID::MUON);
00057       addProjection(muons, "muons");
00058 
00059 
00060       VetoedFinalState vfs;
00061       vfs.addVetoPairId(PID::MUON);
00062 
00063 
00064       /// Jet finder
00065       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
00066                     "AntiKtJets04");
00067 
00068       // all tracks (to do deltaR with leptons)
00069       addProjection(ChargedFinalState(-3.0,3.0),"cfs");
00070 
00071       // for pTmiss
00072       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00073 
00074 
00075       /// Book histograms
00076       _count_A = bookHisto1D("count_A", 1, 0., 1.);
00077       _count_B = bookHisto1D("count_B", 1, 0., 1.);
00078       _count_C = bookHisto1D("count_C", 1, 0., 1.);
00079       _count_D = bookHisto1D("count_D", 1, 0., 1.);
00080 
00081       _hist_meff_A  = bookHisto1D("m_eff_A", 30, 0., 3000.);
00082       _hist_mT2_B   = bookHisto1D("m_T2", 25, 0., 1000.);
00083       _hist_meff_CD = bookHisto1D("m_eff_C_D", 30, 0., 3000.);
00084       _hist_eTmiss  = bookHisto1D("Et_miss", 20, 0., 1000.);
00085     }
00086 
00087 
00088     /// Perform the per-event analysis
00089     void analyze(const Event& event) {
00090       const double weight = event.weight();
00091 
00092       Particles veto_e
00093         = applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
00094       if ( ! veto_e.empty() ) {
00095         MSG_DEBUG("electrons in veto region");
00096         vetoEvent;
00097       }
00098 
00099 
00100       Jets cand_jets;
00101       foreach (const Jet& jet,
00102                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00103         if ( fabs( jet.eta() ) < 4.9 ) {
00104           cand_jets.push_back(jet);
00105         }
00106       }
00107 
00108       Particles cand_e  = applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00109 
00110 
00111       Particles cand_mu;
00112       Particles chg_tracks = applyProjection<ChargedFinalState>(event, "cfs").particles();
00113       foreach ( const Particle & mu,
00114                 applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt() ) {
00115         double pTinCone = -mu.pT();
00116         foreach ( const Particle & track, chg_tracks ) {
00117           if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 )
00118             pTinCone += track.pT();
00119         }
00120         if ( pTinCone < 1.8*GeV )
00121           cand_mu.push_back(mu);
00122       }
00123 
00124       Jets cand_jets_2;
00125       foreach ( const Jet& jet, cand_jets ) {
00126         if ( fabs( jet.eta() ) >= 2.5 )
00127           cand_jets_2.push_back( jet );
00128         else {
00129           bool away_from_e = true;
00130           foreach ( const Particle & e, cand_e ) {
00131             if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00132               away_from_e = false;
00133               break;
00134             }
00135           }
00136           if ( away_from_e )
00137             cand_jets_2.push_back( jet );
00138         }
00139       }
00140 
00141       Particles recon_e, recon_mu;
00142 
00143       foreach ( const Particle & e, cand_e ) {
00144         bool away = true;
00145         foreach ( const Jet& jet, cand_jets_2 ) {
00146           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00147             away = false;
00148             break;
00149           }
00150         }
00151         if ( away )
00152           recon_e.push_back( e );
00153       }
00154 
00155       foreach ( const Particle & mu, cand_mu ) {
00156         bool away = true;
00157         foreach ( const Jet& jet, cand_jets_2 ) {
00158           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00159             away = false;
00160             break;
00161           }
00162         }
00163         if ( away )
00164           recon_mu.push_back( mu );
00165       }
00166 
00167 
00168       // pTmiss
00169       Particles vfs_particles = applyProjection<VisibleFinalState>(event, "vfs").particles();
00170       FourMomentum pTmiss;
00171       foreach ( const Particle & p, vfs_particles ) {
00172         pTmiss -= p.momentum();
00173       }
00174       double eTmiss = pTmiss.pT();
00175 
00176 
00177       // final jet filter
00178       Jets recon_jets;
00179       foreach ( const Jet& jet, cand_jets_2 ) {
00180         if ( fabs( jet.eta() ) <= 2.5 )
00181           recon_jets.push_back( jet );
00182       }
00183 
00184 
00185       // now only use recon_jets, recon_mu, recon_e
00186 
00187       if ( ! ( recon_mu.empty() && recon_e.empty() ) ) {
00188         MSG_DEBUG("Charged leptons left after selection");
00189         vetoEvent;
00190       }
00191 
00192       if ( eTmiss <= 100 * GeV ) {
00193         MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 100");
00194         vetoEvent;
00195       }
00196 
00197 
00198       if ( recon_jets.empty() || recon_jets[0].pT() <= 120.0 * GeV ) {
00199         MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets");
00200         vetoEvent;
00201       }
00202 
00203       // ==================== observables ====================
00204 
00205       // Njets, min_dPhi
00206 
00207       int Njets = 0;
00208       double min_dPhi = 999.999;
00209       double pTmiss_phi = pTmiss.phi();
00210       foreach ( const Jet& jet, recon_jets ) {
00211         if ( jet.pT() > 40 * GeV ) {
00212           if ( Njets < 3 )
00213             min_dPhi = min( min_dPhi,
00214                             deltaPhi( pTmiss_phi, jet.momentum().phi() ) );
00215           ++Njets;
00216         }
00217       }
00218 
00219       if ( Njets < 2 ) {
00220         MSG_DEBUG("Only " << Njets << " >40 GeV jets left");
00221         vetoEvent;
00222       }
00223 
00224       if ( min_dPhi <= 0.4 ) {
00225         MSG_DEBUG("dPhi too small");
00226         vetoEvent;
00227       }
00228 
00229       // m_eff
00230 
00231       double m_eff_2j = eTmiss
00232         + recon_jets[0].pT()
00233         + recon_jets[1].pT();
00234 
00235       double m_eff_3j = recon_jets.size() < 3 ? -999.0 : m_eff_2j + recon_jets[2].pT();
00236 
00237       // etmiss / m_eff
00238 
00239       double et_meff_2j = eTmiss / m_eff_2j;
00240       double et_meff_3j = eTmiss / m_eff_3j;
00241 
00242       FourMomentum a = recon_jets[0].momentum();
00243       FourMomentum b = recon_jets[1].momentum();
00244 
00245       double m_T2 = mT2::mT2( a,
00246                               b,
00247                               pTmiss,
00248                               0.0 ); // zero mass invisibles
00249 
00250 
00251     // ==================== FILL ====================
00252 
00253       MSG_DEBUG( "Trying to fill "
00254                  << Njets << ' '
00255                  << m_eff_2j << ' '
00256                  << et_meff_2j << ' '
00257                  << m_eff_3j << ' '
00258                  << et_meff_3j << ' '
00259                  << m_T2 );
00260 
00261       _hist_eTmiss->fill(eTmiss, weight);
00262 
00263       // AAAAAAAAAA
00264       if ( et_meff_2j > 0.3 ) {
00265         _hist_meff_A->fill(m_eff_2j, weight);
00266         if ( m_eff_2j > 500 * GeV ) {
00267           MSG_DEBUG("Hits A");
00268           _count_A->fill(0.5, weight);
00269         }
00270       }
00271 
00272       // BBBBBBBBBB
00273       _hist_mT2_B->fill(m_T2, weight);
00274       if ( m_T2 > 300 * GeV ) {
00275         MSG_DEBUG("Hits B");
00276         _count_B->fill(0.5, weight);
00277       }
00278 
00279       // need 3 jets for C and D
00280       if ( Njets >= 3 && et_meff_3j > 0.25 ) {
00281 
00282         _hist_meff_CD->fill(m_eff_3j, weight);
00283 
00284         // CCCCCCCCCC
00285         if ( m_eff_3j > 500 * GeV ) {
00286           MSG_DEBUG("Hits C");
00287           _count_C->fill(0.5, weight);
00288         }
00289 
00290         // DDDDDDDDDD
00291         if ( m_eff_3j > 1000 * GeV ) {
00292           MSG_DEBUG("Hits D");
00293           _count_D->fill(0.5, weight);
00294         }
00295       }
00296 
00297     }
00298 
00299     //@}
00300 
00301     void finalize() {
00302 
00303       double norm = crossSection()/picobarn*35.0/sumOfWeights();
00304       scale(_hist_meff_A ,100.*norm);
00305       scale(_hist_mT2_B  ,100.*norm);
00306       scale(_hist_meff_CD, 40.*norm);
00307       scale(_hist_eTmiss , 50.*norm);
00308     }
00309 
00310 
00311   private:
00312 
00313     /// @name Histograms
00314     //@{
00315     Histo1DPtr _count_A;
00316     Histo1DPtr _count_B;
00317     Histo1DPtr _count_C;
00318     Histo1DPtr _count_D;
00319     Histo1DPtr _hist_meff_A;
00320     Histo1DPtr _hist_mT2_B;
00321     Histo1DPtr _hist_meff_CD;
00322     Histo1DPtr _hist_eTmiss;
00323     //@}
00324 
00325   };
00326 
00327 
00328 
00329   // The hook for the plugin system
00330   DECLARE_RIVET_PLUGIN(ATLAS_2011_S8983313);
00331 
00332 }