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