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