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