rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S9019561.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/IdentifiedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/VetoedFinalState.hh"
00010 
00011 namespace Rivet {
00012 
00013 
00014   class ATLAS_2011_S9019561 : public Analysis {
00015   public:
00016 
00017     /// @name Constructors etc.
00018     //@{
00019 
00020     /// Constructor
00021 
00022     ATLAS_2011_S9019561()
00023       : Analysis("ATLAS_2011_S9019561")
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       std::vector<std::pair<double, double> > eta_e;
00039       eta_e.push_back(make_pair(-2.47,2.47));
00040       IdentifiedFinalState elecs(eta_e, 20.0*GeV);
00041       elecs.acceptIdPair(PID::ELECTRON);
00042       addProjection(elecs, "elecs");
00043 
00044 
00045       // veto region electrons
00046       std::vector<std::pair<double, double> > eta_v_e;
00047       eta_v_e.push_back(make_pair(-1.52,-1.37));
00048       eta_v_e.push_back(make_pair( 1.37, 1.52));
00049       IdentifiedFinalState veto_elecs(eta_v_e, 10.0*GeV);
00050       veto_elecs.acceptIdPair(PID::ELECTRON);
00051       addProjection(veto_elecs, "veto_elecs");
00052 
00053 
00054       // projection to find the muons
00055       std::vector<std::pair<double, double> > eta_m;
00056       eta_m.push_back(make_pair(-2.4,2.4));
00057       IdentifiedFinalState muons(eta_m, 20.0*GeV);
00058       muons.acceptIdPair(PID::MUON);
00059       addProjection(muons, "muons");
00060 
00061 
00062       // jet finder
00063       VetoedFinalState vfs;
00064       vfs.addVetoPairId(PID::MUON);
00065       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
00066                    "AntiKtJets04");
00067 
00068 
00069       // all tracks (to do deltaR with leptons)
00070       addProjection(ChargedFinalState(-3.0,3.0,0.5*GeV),"cfs");
00071 
00072 
00073       // for pTmiss
00074       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00075 
00076 
00077       /// book histograms
00078       _count_OS_e_mu = bookHisto1D("count_OS_e+-mu-+", 1, 0., 1.);
00079       _count_OS_e_e = bookHisto1D("count_OS_e+e-", 1, 0., 1.);
00080       _count_OS_mu_mu = bookHisto1D("count_OS_mu+mu-", 1, 0., 1.);
00081       _count_SS_e_mu = bookHisto1D("count_SS_e+-mu+-", 1, 0., 1.);
00082       _count_SS_e_e = bookHisto1D("count_SS_e+-e+-", 1, 0., 1.);
00083       _count_SS_mu_mu = bookHisto1D("count_SS_mu+-mu+-", 1, 0., 1.);
00084 
00085       _hist_eTmiss_OS  = bookHisto1D("Et_miss_OS", 20, 0., 400.);
00086       _hist_eTmiss_SS  = bookHisto1D("Et_miss_SS", 20, 0., 400.);
00087 
00088     }
00089 
00090 
00091 
00092 
00093     /// Perform the per-event analysis
00094     void analyze(const Event& event) {
00095 
00096       const double weight = event.weight();
00097 
00098       Particles veto_e
00099         = applyProjection<IdentifiedFinalState>(event, "veto_elecs").particles();
00100       if ( ! veto_e.empty() ) {
00101         MSG_DEBUG("electrons in veto region");
00102         vetoEvent;
00103       }
00104 
00105       Jets cand_jets;
00106       foreach (const Jet& jet,
00107         applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00108         if ( fabs( jet.eta() ) < 2.5 ) {
00109           cand_jets.push_back(jet);
00110         }
00111       }
00112 
00113       Particles cand_e =
00114         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00115 
00116       // charged particle for isolation
00117       Particles chg_tracks =
00118         applyProjection<ChargedFinalState>(event, "cfs").particles();
00119 
00120       // apply muon isolation
00121       Particles cand_mu;
00122       // pTcone around muon track
00123       foreach ( const Particle & mu,
00124                 applyProjection<IdentifiedFinalState>(event,"muons").particlesByPt() ) {
00125         double pTinCone = -mu.pT();
00126         foreach ( const Particle & track, chg_tracks ) {
00127           if ( deltaR(mu.momentum(),track.momentum()) < 0.2 )
00128             pTinCone += track.pT();
00129         }
00130         if ( pTinCone < 1.8*GeV )
00131           cand_mu.push_back(mu);
00132       }
00133 
00134       // Discard jets that overlap with electrons
00135       Jets recon_jets;
00136       foreach ( const Jet& jet, cand_jets ) {
00137         bool away_from_e = true;
00138         foreach ( const Particle & e, cand_e ) {
00139           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00140             away_from_e = false;
00141             break;
00142           }
00143         }
00144         if ( away_from_e )
00145          recon_jets.push_back( jet );
00146       }
00147 
00148       // Leptons far from jet
00149       Particles recon_e;
00150       foreach ( const Particle & e, cand_e ) {
00151         bool e_near_jet = false;
00152         foreach ( const Jet& jet, recon_jets ) {
00153           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00154             e_near_jet = true;
00155             break;
00156           }
00157         }
00158         // Electron isolation criterion
00159         if ( ! e_near_jet ) {
00160           double EtinCone = -e.momentum().Et();
00161           foreach ( const Particle & track, chg_tracks) {
00162             if ( deltaR(e.momentum(),track.momentum()) <= 0.2 )
00163               EtinCone += track.momentum().Et();
00164           }
00165           if ( EtinCone/e.pT() <= 0.15 )
00166             recon_e.push_back( e );
00167         }
00168       }
00169 
00170       Particles recon_mu;
00171       foreach ( const Particle & mu, cand_mu ) {
00172          bool mu_near_jet = false;
00173          foreach ( const Jet& jet, recon_jets ) {
00174            if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00175              mu_near_jet = true;
00176              break;
00177            }
00178          }
00179          if ( ! mu_near_jet )
00180           recon_mu.push_back( mu );
00181        }
00182 
00183 
00184       // pTmiss
00185       Particles vfs_particles
00186         = applyProjection<VisibleFinalState>(event, "vfs").particles();
00187       FourMomentum pTmiss;
00188       foreach ( const Particle & p, vfs_particles ) {
00189         pTmiss -= p.momentum();
00190       }
00191       double eTmiss = pTmiss.pT();
00192 
00193       // Exactly two leptons for each event
00194       if ( recon_mu.size() + recon_e.size() != 2)
00195         vetoEvent;
00196 
00197       // Lepton pair mass
00198       FourMomentum p_leptons;
00199       foreach ( Particle e, recon_e ) {
00200         p_leptons +=  e.momentum();
00201       }
00202       foreach ( Particle mu, recon_mu) {
00203         p_leptons += mu.momentum();
00204       }
00205 
00206       if ( p_leptons.mass() <= 5.0 * GeV)
00207         vetoEvent;
00208 
00209       // ==================== FILL ====================
00210 
00211 
00212       // electron, electron
00213       if (recon_e.size() == 2 ) {
00214 
00215         // SS ee
00216         if ( recon_e[0].pdgId() * recon_e[1].pdgId() > 0 ) {
00217           _hist_eTmiss_SS->fill(eTmiss, weight);
00218           if ( eTmiss > 100 ) {
00219             MSG_DEBUG("Hits SS e+/-e+/-");
00220             _count_SS_e_e->fill(0.5, weight);
00221           }
00222         }
00223 
00224         // OS ee
00225         else if ( recon_e[0].pdgId() * recon_e[1].pdgId() < 0) {
00226           _hist_eTmiss_OS->fill(eTmiss, weight);
00227           if ( eTmiss > 150 ) {
00228             MSG_DEBUG("Hits OS e+e-");
00229             _count_OS_e_e->fill(0.5, weight);
00230           }
00231         }
00232       }
00233 
00234 
00235       // muon, electron
00236       else if ( recon_e.size() == 1 ) {
00237 
00238         // SS mu_e
00239         if ( recon_e[0].pdgId() * recon_mu[0].pdgId() > 0 ) {
00240           _hist_eTmiss_SS->fill(eTmiss, weight);
00241           if ( eTmiss > 100 ) {
00242             MSG_DEBUG("Hits SS e+/-mu+/-");
00243             _count_SS_e_mu->fill(0.5, weight);
00244           }
00245         }
00246 
00247         // OS mu_e
00248         else if ( recon_e[0].pdgId() * recon_mu[0].pdgId() < 0) {
00249           _hist_eTmiss_OS->fill(eTmiss, weight);
00250           if ( eTmiss > 150 ) {
00251             MSG_DEBUG("Hits OS e+mu-");
00252             _count_OS_e_mu->fill(0.5, weight);
00253           }
00254         }
00255       }
00256 
00257 
00258       // muon, muon
00259       else if ( recon_mu.size() == 2 ) {
00260 
00261         // SS mu_mu
00262         if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() > 0 ) {
00263           _hist_eTmiss_SS->fill(eTmiss, weight);
00264           if ( eTmiss > 100 ) {
00265             MSG_DEBUG("Hits SS mu+/-mu+/-");
00266             _count_SS_mu_mu->fill(0.5, weight);
00267           }
00268         }
00269 
00270         // OS mu_mu
00271         else if ( recon_mu[0].pdgId() * recon_mu[1].pdgId() < 0) {
00272           _hist_eTmiss_OS->fill(eTmiss, weight);
00273           if ( eTmiss > 150 ) {
00274             MSG_DEBUG("Hits OS mu+mu-");
00275             _count_OS_mu_mu->fill(0.5, weight);
00276           }
00277         }
00278       }
00279 
00280 
00281     }
00282 
00283     //@}
00284 
00285 
00286     void finalize() {
00287       double norm = crossSection()/picobarn*35./sumOfWeights();
00288       // event counts
00289       scale(_count_OS_e_mu ,norm);
00290       scale(_count_OS_e_e  ,norm);
00291       scale(_count_OS_mu_mu,norm);
00292       scale(_count_SS_e_mu ,norm);
00293       scale(_count_SS_e_e  ,norm);
00294       scale(_count_SS_mu_mu,norm);
00295       scale(_hist_eTmiss_OS,10.*norm);
00296       scale(_hist_eTmiss_SS,10.*norm);
00297     }
00298 
00299 
00300   private:
00301 
00302     /// @name Histograms
00303     //@{
00304     Histo1DPtr _count_OS_e_mu;
00305     Histo1DPtr _count_OS_e_e;
00306     Histo1DPtr _count_OS_mu_mu;
00307     Histo1DPtr _count_SS_e_mu;
00308     Histo1DPtr _count_SS_e_e;
00309     Histo1DPtr _count_SS_mu_mu;
00310     Histo1DPtr _hist_eTmiss_OS;
00311     Histo1DPtr _hist_eTmiss_SS;
00312 
00313     //@}
00314 
00315 
00316   };
00317 
00318 
00319 
00320   // The hook for the plugin system
00321   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9019561);
00322 
00323 }