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