rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1112263.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   /// @author Peter Richardson
00015   class ATLAS_2012_I1112263 : public Analysis {
00016   public:
00017 
00018     /// @name Constructors etc.
00019     //@{
00020 
00021     /// Constructor
00022     ATLAS_2012_I1112263()
00023       : Analysis("ATLAS_2012_I1112263")
00024     {    }
00025 
00026     //@}
00027 
00028 
00029   public:
00030 
00031     /// @name Analysis methods
00032     //@{
00033 
00034     /// Book histograms and initialise projections before the run
00035     void init() {
00036 
00037       // projection to find the electrons
00038       IdentifiedFinalState elecs(EtaIn(-2.47, 2.47) 
00039                  & (Cuts::pT >= 10.0*GeV));
00040       elecs.acceptIdPair(PID::ELECTRON);
00041       addProjection(elecs, "elecs");
00042 
00043       // projection to find the muons
00044       IdentifiedFinalState muons(EtaIn(-2.4, 2.4) 
00045                  & (Cuts::pT >= 10.0*GeV));
00046       muons.acceptIdPair(PID::MUON);
00047       addProjection(muons, "muons");
00048 
00049       // for pTmiss
00050       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00051 
00052       VetoedFinalState vfs;
00053       vfs.addVetoPairId(PID::MUON);
00054 
00055       /// Jet finder
00056       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
00057                     "AntiKtJets04");
00058 
00059       // all tracks (to do deltaR with leptons)
00060       addProjection(ChargedFinalState(-3.0,3.0),"cfs");
00061 
00062       // Book histograms
00063       _hist_leptonpT_SR1.push_back(bookHisto1D("hist_lepton_pT_1_SR1",11,0.,220.));
00064       _hist_leptonpT_SR1.push_back(bookHisto1D("hist_lepton_pT_2_SR1", 7,0.,140.));
00065       _hist_leptonpT_SR1.push_back(bookHisto1D("hist_lepton_pT_3_SR1", 8,0.,160.));
00066       _hist_leptonpT_SR2.push_back(bookHisto1D("hist_lepton_pT_1_SR2",11,0.,220.));
00067       _hist_leptonpT_SR2.push_back(bookHisto1D("hist_lepton_pT_2_SR2", 7,0.,140.));
00068       _hist_leptonpT_SR2.push_back(bookHisto1D("hist_lepton_pT_3_SR2", 8,0.,160.));
00069       _hist_etmiss_SR1_A = bookHisto1D("hist_etmiss_SR1_A",15,10.,310.);
00070       _hist_etmiss_SR1_B = bookHisto1D("hist_etmiss_SR1_B", 9,10.,190.);
00071       _hist_etmiss_SR2_A = bookHisto1D("hist_etmiss_SR2_A",15,10.,310.);
00072       _hist_etmiss_SR2_B = bookHisto1D("hist_etmiss_SR2_B", 9,10.,190.);
00073       _hist_mSFOS= bookHisto1D("hist_mSFOF",9,0.,180.);
00074 
00075       _count_SR1 = bookHisto1D("count_SR1", 1, 0., 1.);
00076       _count_SR2 = bookHisto1D("count_SR2", 1, 0., 1.);
00077     }
00078 
00079 
00080     /// Perform the per-event analysis
00081     void analyze(const Event& event) {
00082       const double weight = event.weight();
00083       // get the jet candidates
00084       Jets cand_jets;
00085       foreach (const Jet& jet,
00086                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00087         if ( fabs( jet.eta() ) < 2.8 ) {
00088           cand_jets.push_back(jet);
00089         }
00090       }
00091 
00092       // candidate muons
00093       Particles cand_mu;
00094       Particles chg_tracks =
00095         applyProjection<ChargedFinalState>(event, "cfs").particles();
00096       foreach ( const Particle & mu,
00097                 applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt() ) {
00098         double pTinCone = -mu.pT();
00099         foreach ( const Particle & track, chg_tracks ) {
00100           if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 )
00101             pTinCone += track.pT();
00102         }
00103         if ( pTinCone < 1.8*GeV )
00104           cand_mu.push_back(mu);
00105       }
00106 
00107       // candidate electrons
00108       Particles cand_e;
00109       foreach ( const Particle & e,
00110                 applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt() ) {
00111         double eta = e.eta();
00112         // remove electrons with pT<15 in old veto region
00113         // (NOT EXPLICIT IN THIS PAPER BUT IN SIMILAR 4 LEPTON PAPER and THIS DESCRPITION
00114         //  IS MUCH WORSE SO ASSUME THIS IS DONE)
00115         if( fabs(eta)>1.37 && fabs(eta) < 1.52 && e.momentum().perp()< 15.*GeV)
00116           continue;
00117         double pTinCone = -e.momentum().perp();
00118         foreach ( const Particle & track, chg_tracks ) {
00119           if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
00120             pTinCone += track.pT();
00121         }
00122         if (pTinCone/e.momentum().perp()<0.1) {
00123           cand_e.push_back(e);
00124         }
00125       }
00126 
00127       // resolve jet/lepton ambiguity
00128       // (NOT EXPLICIT IN THIS PAPER BUT IN SIMILAR 4 LEPTON PAPER and THIS DESCRPITION
00129       //  IS MUCH WORSE SO ASSUME THIS IS DONE)
00130       Jets recon_jets;
00131       foreach ( const Jet& jet, cand_jets ) {
00132         bool away_from_e = true;
00133         foreach ( const Particle & e, cand_e ) {
00134           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00135             away_from_e = false;
00136             break;
00137           }
00138         }
00139         if ( away_from_e )
00140           recon_jets.push_back( jet );
00141       }
00142 
00143       // only keep electrons more than R=0.4 from jets
00144       Particles recon_e;
00145       foreach ( const Particle & e, cand_e ) {
00146         bool away = true;
00147         foreach ( const Jet& jet, recon_jets ) {
00148           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00149             away = false;
00150             break;
00151           }
00152         }
00153         // and 0.1 from any muons
00154         if ( ! away ) {
00155           foreach ( const Particle & mu, cand_e ) {
00156             if ( deltaR(mu.momentum(),e.momentum()) < 0.1 ) {
00157               away = false;
00158               break;
00159             }
00160           }
00161         }
00162         if ( away )
00163           recon_e.push_back( e );
00164       }
00165       // only keep muons more than R=0.4 from jets
00166       Particles recon_mu;
00167       foreach ( const Particle & mu, cand_mu ) {
00168         bool away = true;
00169         foreach ( const Jet& jet, recon_jets ) {
00170           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00171             away = false;
00172             break;
00173           }
00174         }
00175         // and 0.1 from any electrona
00176         if ( ! away ) {
00177           foreach ( const Particle & e, cand_e ) {
00178             if ( deltaR(mu.momentum(),e.momentum()) < 0.1 ) {
00179               away = false;
00180               break;
00181             }
00182           }
00183         }
00184         if ( away )
00185           recon_mu.push_back( mu );
00186       }
00187 
00188       // pTmiss
00189       Particles vfs_particles =
00190         applyProjection<VisibleFinalState>(event, "vfs").particles();
00191       FourMomentum pTmiss;
00192       foreach ( const Particle & p, vfs_particles ) {
00193         pTmiss -= p.momentum();
00194       }
00195       double eTmiss = pTmiss.pT();
00196 
00197       // now only use recon_jets, recon_mu, recon_e
00198 
00199       // reject events with wrong number of leptons
00200       if ( recon_mu.size() + recon_e.size() != 3 ) {
00201         MSG_DEBUG("To few charged leptons left after selection");
00202         vetoEvent;
00203       }
00204 
00205       // ATLAS calo problem
00206       if(rand()/static_cast<double>(RAND_MAX)<=0.42) {
00207         foreach ( const Particle & e, recon_e ) {
00208           double eta = e.eta();
00209           double phi = e.momentum().azimuthalAngle(MINUSPI_PLUSPI);
00210           if(eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5)
00211             vetoEvent;
00212         }
00213         foreach ( const Jet & jet, recon_jets ) {
00214           double eta = jet.rapidity();
00215           double phi = jet.momentum().azimuthalAngle(MINUSPI_PLUSPI);
00216           if(jet.momentum().perp()>40 && eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5)
00217             vetoEvent;
00218         }
00219       }
00220 
00221       // check at least one e/mu passing trigger
00222       if( !( !recon_e .empty() && recon_e[0] .momentum().perp()>25.)  &&
00223           !( !recon_mu.empty() && recon_mu[0].momentum().perp()>20.) ) {
00224         MSG_DEBUG("Hardest lepton fails trigger");
00225         vetoEvent;
00226       }
00227 
00228       // eTmiss cut
00229       if(eTmiss<50.) vetoEvent;
00230 
00231       // check at least 1 SFOS pair
00232       double mSFOS=1e30, mdiff=1e30;
00233       unsigned int nSFOS=0;
00234       for(unsigned int ix=0;ix<recon_e.size();++ix) {
00235         for(unsigned int iy=ix+1;iy<recon_e.size();++iy) {
00236           if(recon_e[ix].pdgId()*recon_e[iy].pdgId()>0) continue;
00237           ++nSFOS;
00238           double mtest = (recon_e[ix].momentum()+recon_e[iy].momentum()).mass();
00239           // veto is mass<20
00240           if(mtest<20.) vetoEvent;
00241           if(fabs(mtest-90.)<mdiff) {
00242             mSFOS = mtest;
00243             mdiff = fabs(mtest-90.);
00244           }
00245         }
00246       }
00247       for(unsigned int ix=0;ix<recon_mu.size();++ix) {
00248         for(unsigned int iy=ix+1;iy<recon_mu.size();++iy) {
00249           if(recon_mu[ix].pdgId()*recon_mu[iy].pdgId()>0) continue;
00250           ++nSFOS;
00251           double mtest = (recon_mu[ix].momentum()+recon_mu[iy].momentum()).mass();
00252           // veto is mass<20
00253           if(mtest<20.) vetoEvent;
00254           if(fabs(mtest-90.)<mdiff) {
00255             mSFOS = mtest;
00256             mdiff = fabs(mtest-90.);
00257           }
00258         }
00259       }
00260       // require at least 1 SFOS pair
00261       if(nSFOS==0) vetoEvent;
00262       // b-jet veto in SR!
00263       if(mdiff>10.) {
00264         foreach (const Jet & jet, recon_jets ) {
00265           if(jet.containsBottom() &&
00266              rand()/static_cast<double>(RAND_MAX)<=0.60)
00267             vetoEvent;
00268         }
00269       }
00270       // region SR1, Z depleted
00271       if(mdiff>10.) {
00272         _count_SR1->fill(0.5,weight);
00273         _hist_etmiss_SR1_A->fill(eTmiss,weight);
00274         _hist_etmiss_SR1_B->fill(eTmiss,weight);
00275         _hist_mSFOS->fill(mSFOS,weight);
00276       }
00277       // region SR2, Z enriched
00278       else {
00279         _count_SR2->fill(0.5,weight);
00280         _hist_etmiss_SR2_A->fill(eTmiss,weight);
00281         _hist_etmiss_SR2_B->fill(eTmiss,weight);
00282       }
00283       // make the control plots
00284       // lepton pT
00285       unsigned int ie=0,imu=0;
00286       for(unsigned int ix=0;ix<3;++ix) {
00287         Histo1DPtr hist = mdiff>10. ?
00288           _hist_leptonpT_SR1[ix] :  _hist_leptonpT_SR2[ix];
00289         double pTe  = ie <recon_e .size() ?
00290           recon_e [ie ].momentum().perp() : -1*GeV;
00291         double pTmu = imu<recon_mu.size() ?
00292           recon_mu[imu].momentum().perp() : -1*GeV;
00293         if(pTe>pTmu) {
00294           hist->fill(pTe ,weight);
00295           ++ie;
00296         }
00297         else {
00298           hist->fill(pTmu,weight);
00299           ++imu;
00300         }
00301       }
00302     }
00303 
00304     //@}
00305 
00306     void finalize() {
00307       double norm = crossSection()/femtobarn*2.06/sumOfWeights();
00308       // these are number of events at 2.06fb^-1 per 20 GeV
00309       for(unsigned int ix=0;ix<3;++ix) {
00310         scale(_hist_leptonpT_SR1[ix],norm*20.);
00311         scale(_hist_leptonpT_SR2[ix],norm*20.);
00312       }
00313       scale(_hist_etmiss_SR1_A,norm*20.);
00314       scale(_hist_etmiss_SR1_B,norm*20.);
00315       scale(_hist_etmiss_SR2_A,norm*20.);
00316       scale(_hist_etmiss_SR2_B,norm*20.);
00317       scale(_hist_mSFOS    ,norm*20.);
00318       // these are number of events at 2.06fb^-1
00319       scale(_count_SR1,norm);
00320       scale(_count_SR2,norm);
00321     }
00322 
00323   private:
00324 
00325   /// @name Histograms
00326   //@{
00327   vector<Histo1DPtr> _hist_leptonpT_SR1;
00328   vector<Histo1DPtr> _hist_leptonpT_SR2;
00329   Histo1DPtr _hist_etmiss_SR1_A;
00330   Histo1DPtr _hist_etmiss_SR1_B;
00331   Histo1DPtr _hist_etmiss_SR2_A;
00332   Histo1DPtr _hist_etmiss_SR2_B;
00333   Histo1DPtr _hist_mSFOS;
00334   Histo1DPtr _count_SR1;
00335   Histo1DPtr _count_SR2;
00336   //@}
00337 
00338   };
00339 
00340   // The hook for the plugin system
00341   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1112263);
00342 
00343 }