rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1095236.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 
00011 namespace Rivet {
00012 
00013 
00014   /// @author Peter Richardson
00015   class ATLAS_2012_I1095236 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     ATLAS_2012_I1095236()
00020       : Analysis("ATLAS_2012_I1095236")
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       IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV);
00032       elecs.acceptIdPair(PID::ELECTRON);
00033       addProjection(elecs, "elecs");
00034 
00035       // Projection to find the muons
00036       IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV);
00037       muons.acceptIdPair(PID::MUON);
00038       addProjection(muons, "muons");
00039 
00040       // Jet finder
00041       VetoedFinalState vfs;
00042       vfs.addVetoPairId(PID::MUON);
00043       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04");
00044 
00045       // All tracks (to do deltaR with leptons)
00046       addProjection(ChargedFinalState(Cuts::abseta < 3.0),"cfs");
00047 
00048       // Used for pTmiss
00049       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00050 
00051       // Book histograms
00052       _count_SR0_A1 = bookHisto1D("count_SR0_A1", 1, 0., 1.);
00053       _count_SR0_B1 = bookHisto1D("count_SR0_B1", 1, 0., 1.);
00054       _count_SR0_C1 = bookHisto1D("count_SR0_C1", 1, 0., 1.);
00055       _count_SR0_A2 = bookHisto1D("count_SR0_A2", 1, 0., 1.);
00056       _count_SR0_B2 = bookHisto1D("count_SR0_B2", 1, 0., 1.);
00057       _count_SR0_C2 = bookHisto1D("count_SR0_C2", 1, 0., 1.);
00058       _count_SR1_D  = bookHisto1D("count_SR1_D" , 1, 0., 1.);
00059       _count_SR1_E  = bookHisto1D("count_SR1_E" , 1, 0., 1.);
00060 
00061       _hist_meff_SR0_A1   = bookHisto1D("hist_m_eff_SR0_A1", 14, 400., 1800.);
00062       _hist_meff_SR0_A2   = bookHisto1D("hist_m_eff_SR0_A2", 14, 400., 1800.);
00063       _hist_meff_SR1_D_e  = bookHisto1D("hist_meff_SR1_D_e" , 16, 600., 2200.);
00064       _hist_meff_SR1_D_mu = bookHisto1D("hist_meff_SR1_D_mu", 16, 600., 2200.);
00065 
00066       _hist_met_SR0_A1    = bookHisto1D("hist_met_SR0_A1", 14, 0., 700.);
00067       _hist_met_SR0_A2    = bookHisto1D("hist_met_SR0_A2", 14, 0., 700.);
00068       _hist_met_SR0_D_e   = bookHisto1D("hist_met_SR1_D_e" , 15, 0., 600.);
00069       _hist_met_SR0_D_mu  = bookHisto1D("hist_met_SR1_D_mu", 15, 0., 600.);
00070 
00071     }
00072 
00073 
00074     /// Perform the per-event analysis
00075     void analyze(const Event& event) {
00076       const double weight = event.weight();
00077 
00078       Jets cand_jets;
00079       const Jets jets = applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV);
00080       foreach (const Jet& jet, jets) {
00081         if ( fabs( jet.eta() ) < 2.8 ) {
00082           cand_jets.push_back(jet);
00083         }
00084       }
00085 
00086       const Particles cand_e  = applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00087 
00088       const Particles cand_mu = applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt();
00089       // Resolve jet-lepton overlap for jets with |eta| < 2.8
00090       Jets recon_jets;
00091       foreach ( const Jet& jet, cand_jets ) {
00092         if ( fabs( jet.eta() ) >= 2.8 ) continue;
00093         bool away_from_e = true;
00094         foreach ( const Particle & e, cand_e ) {
00095           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00096             away_from_e = false;
00097             break;
00098           }
00099         }
00100         if ( away_from_e ) recon_jets.push_back( jet );
00101       }
00102 
00103       // get the loose leptons used to define the 0 lepton channel
00104       Particles loose_e, loose_mu;
00105       foreach ( const Particle & e, cand_e ) {
00106         bool away = true;
00107         foreach ( const Jet& jet, recon_jets ) {
00108           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00109             away = false;
00110             break;
00111           }
00112         }
00113         if ( away ) loose_e.push_back( e );
00114       }
00115       foreach ( const Particle & mu, cand_mu ) {
00116         bool away = true;
00117         foreach ( const Jet& jet, recon_jets ) {
00118           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00119             away = false;
00120             break;
00121           }
00122         }
00123         if ( away ) loose_mu.push_back( mu );
00124       }
00125       // tight leptons for the 1-lepton channel
00126       Particles tight_mu;
00127       Particles chg_tracks =
00128         applyProjection<ChargedFinalState>(event, "cfs").particles();
00129       foreach ( const Particle & mu, loose_mu) {
00130         if(mu.perp()<20.) continue;
00131         double pTinCone = -mu.pT();
00132         foreach ( const Particle & track, chg_tracks ) {
00133           if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 )
00134             pTinCone += track.pT();
00135         }
00136         if ( pTinCone < 1.8*GeV )
00137           tight_mu.push_back(mu);
00138       }
00139       Particles tight_e;
00140       foreach ( const Particle & e, loose_e ) {
00141         if(e.perp()<25.) continue;
00142         double pTinCone = -e.perp();
00143         foreach ( const Particle & track, chg_tracks ) {
00144           if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
00145             pTinCone += track.pT();
00146         }
00147         if (pTinCone/e.perp()<0.1) {
00148           tight_e.push_back(e);
00149         }
00150       }
00151 
00152       // pTmiss
00153       Particles vfs_particles =
00154         applyProjection<VisibleFinalState>(event, "vfs").particles();
00155       FourMomentum pTmiss;
00156       foreach ( const Particle & p, vfs_particles ) {
00157         pTmiss -= p.momentum();
00158       }
00159       double eTmiss = pTmiss.pT();
00160 
00161       // get the number of b-tagged jets
00162       unsigned int ntagged=0;
00163       foreach (const Jet & jet, recon_jets ) {
00164         if(jet.perp()>50. && abs(jet.eta())<2.5 &&
00165            jet.bTagged() && rand()/static_cast<double>(RAND_MAX)<=0.60)
00166           ++ntagged;
00167       }
00168 
00169       // ATLAS calo problem
00170       if(rand()/static_cast<double>(RAND_MAX)<=0.42) {
00171         foreach ( const Jet & jet, recon_jets ) {
00172           double eta = jet.rapidity();
00173           double phi = jet.azimuthalAngle(MINUSPI_PLUSPI);
00174           if(jet.perp()>50 && eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5)
00175             vetoEvent;
00176         }
00177       }
00178 
00179       // at least 1 b tag
00180       if(ntagged==0) vetoEvent;
00181 
00182       // minumum Et miss
00183       if(eTmiss<80.) vetoEvent;
00184 
00185       // at least 3 jets pT > 50
00186       if(recon_jets.size()<3 || recon_jets[2].perp()<50.)
00187         vetoEvent;
00188 
00189       // m_eff
00190       double m_eff =  eTmiss;
00191       for(unsigned int ix=0;ix<3;++ix)
00192         m_eff += recon_jets[ix].perp();
00193 
00194       // delta Phi
00195       double min_dPhi = 999.999;
00196       double pTmiss_phi = pTmiss.phi();
00197       for(unsigned int ix=0;ix<3;++ix) {
00198         min_dPhi = min( min_dPhi, deltaPhi( pTmiss_phi, recon_jets[ix].phi() ) );
00199       }
00200 
00201       // 0-lepton channels
00202       if(loose_e.empty() && loose_mu.empty() &&
00203          recon_jets[0].perp()>130.  && eTmiss>130. &&
00204          eTmiss/m_eff>0.25 && min_dPhi>0.4) {
00205         // jet charge cut
00206         bool jetCharge = true;
00207         for(unsigned int ix=0;ix<3;++ix) {
00208           if(fabs(recon_jets[ix].eta())>2.) continue;
00209           double trackpT=0;
00210           foreach(const Particle & p, recon_jets[ix].particles()) {
00211             if(PID::threeCharge(p.pid())==0) continue;
00212             trackpT += p.perp();
00213           }
00214           if(trackpT/recon_jets[ix].perp()<0.05)
00215             jetCharge = false;
00216         }
00217         if(jetCharge) {
00218           // SR0-A region
00219           if(m_eff>500.) {
00220             _count_SR0_A1->fill(0.5,weight);
00221             _hist_meff_SR0_A1->fill(m_eff,weight);
00222             _hist_met_SR0_A1 ->fill(eTmiss,weight);
00223             if(ntagged>=2) {
00224               _count_SR0_A2->fill(0.5,weight);
00225               _hist_meff_SR0_A2->fill(m_eff,weight);
00226               _hist_met_SR0_A2 ->fill(eTmiss,weight);
00227             }
00228           }
00229           // SR0-B
00230           if(m_eff>700.) {
00231             _count_SR0_B1->fill(0.5,weight);
00232             if(ntagged>=2) _count_SR0_B2->fill(0.5,weight);
00233           }
00234           // SR0-C
00235           if(m_eff>900.) {
00236             _count_SR0_C1->fill(0.5,weight);
00237             if(ntagged>=2) _count_SR0_C2->fill(0.5,weight);
00238           }
00239         }
00240       }
00241 
00242       // 1-lepton channels
00243       if(tight_e.size() + tight_mu.size() == 1 &&
00244          recon_jets.size()>=4 && recon_jets[3].perp()>50.&&
00245          recon_jets[0].perp()>60.) {
00246         Particle lepton = tight_e.empty() ? tight_mu[0] : tight_e[0];
00247         m_eff += lepton.perp() + recon_jets[3].perp();
00248         // transverse mass cut
00249         double mT = 2.*(lepton.perp()*eTmiss-
00250                         lepton.px()*pTmiss.px()-
00251                         lepton.py()*pTmiss.py());
00252         mT = sqrt(mT);
00253         if(mT>100.&&m_eff>700.) {
00254           // D region
00255           _count_SR1_D->fill(0.5,weight);
00256           if(lepton.abspid()==PID::ELECTRON) {
00257             _hist_meff_SR1_D_e->fill(m_eff,weight);
00258             _hist_met_SR0_D_e->fill(eTmiss,weight);
00259           }
00260           else {
00261             _hist_meff_SR1_D_mu->fill(m_eff,weight);
00262             _hist_met_SR0_D_mu->fill(eTmiss,weight);
00263           }
00264           // E region
00265           if(eTmiss>200.) {
00266             _count_SR1_E->fill(0.5,weight);
00267           }
00268         }
00269       }
00270     }
00271 
00272 
00273     void finalize() {
00274 
00275       double norm = crossSection()/femtobarn*2.05/sumOfWeights();
00276       // these are number of events at 2.05fb^-1 per 100 GeV
00277       scale( _hist_meff_SR0_A1   , 100. * norm );
00278       scale( _hist_meff_SR0_A2   , 100. * norm );
00279       scale( _hist_meff_SR1_D_e  , 100. * norm );
00280       scale( _hist_meff_SR1_D_mu , 100. * norm );
00281       // these are number of events at 2.05fb^-1 per 50 GeV
00282       scale( _hist_met_SR0_A1, 50. * norm );
00283       scale( _hist_met_SR0_A2, 40. * norm );
00284       // these are number of events at 2.05fb^-1 per 40 GeV
00285       scale( _hist_met_SR0_D_e , 40. * norm );
00286       scale( _hist_met_SR0_D_mu, 40. * norm );
00287       // these are number of events at 2.05fb^-1
00288       scale(_count_SR0_A1,norm);
00289       scale(_count_SR0_B1,norm);
00290       scale(_count_SR0_C1,norm);
00291       scale(_count_SR0_A2,norm);
00292       scale(_count_SR0_B2,norm);
00293       scale(_count_SR0_C2,norm);
00294       scale(_count_SR1_D ,norm);
00295       scale(_count_SR1_E ,norm);
00296     }
00297 
00298     //@}
00299 
00300 
00301   private:
00302 
00303     Histo1DPtr _count_SR0_A1;
00304     Histo1DPtr _count_SR0_B1;
00305     Histo1DPtr _count_SR0_C1;
00306     Histo1DPtr _count_SR0_A2;
00307     Histo1DPtr _count_SR0_B2;
00308     Histo1DPtr _count_SR0_C2;
00309     Histo1DPtr _count_SR1_D;
00310     Histo1DPtr _count_SR1_E;
00311 
00312     Histo1DPtr _hist_meff_SR0_A1;
00313     Histo1DPtr _hist_meff_SR0_A2;
00314     Histo1DPtr _hist_meff_SR1_D_e;
00315     Histo1DPtr _hist_meff_SR1_D_mu;
00316     Histo1DPtr _hist_met_SR0_A1;
00317     Histo1DPtr _hist_met_SR0_A2;
00318     Histo1DPtr _hist_met_SR0_D_e;
00319     Histo1DPtr _hist_met_SR0_D_mu;
00320 
00321   };
00322 
00323 
00324   // This global object acts as a hook for the plugin system
00325   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1095236);
00326 
00327 }