rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1126136.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/VetoedFinalState.hh"
00009 #include "Rivet/Projections/FastJets.hh"
00010 #include "Rivet/Tools/RivetMT2.hh"
00011 
00012 namespace Rivet {
00013 
00014 
00015   class ATLAS_2012_I1126136 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     ATLAS_2012_I1126136()
00020       : Analysis("ATLAS_2012_I1126136")
00021     {    }
00022 
00023 
00024     /// @name Analysis methods
00025     //@{
00026 
00027     /// Book histograms and initialize 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       // for pTmiss
00046       addProjection(VisibleFinalState(Cuts::abseta < 4.9),"vfs");
00047 
00048       // Book histograms
00049       _count_SR_A     = bookHisto1D("count_SR_A"    , 1, 0., 1.);
00050       _count_SR_B     = bookHisto1D("count_SR_B"    , 1, 0., 1.);
00051 
00052       _hist_mjjj1  = bookHisto1D("hist_mjjj1" , 30 , 0.   , 600.  );
00053       _hist_mjjj2  = bookHisto1D("hist_mjjj2" , 30 , 0.   , 600.  );
00054       _hist_ETmiss = bookHisto1D("hist_ETmiss", 20 , 100. , 600.  );
00055       _hist_mT2    = bookHisto1D("hist_mT2"   , 200, 0.   , 1000. );
00056 
00057     }
00058 
00059     /// Perform the per-event analysis
00060     void analyze(const Event& event) {
00061       const double weight = event.weight();
00062 
00063       // pTmiss
00064       FourMomentum pTmiss;
00065       foreach (const Particle& p, applyProjection<VisibleFinalState>(event, "vfs").particles() ) {
00066         pTmiss -= p.momentum();
00067       }
00068       double ETmiss = pTmiss.pT();
00069 
00070       // require eTmiss > 150
00071       if (ETmiss < 150*GeV) vetoEvent;
00072 
00073       // get the candiate jets
00074       Jets cand_jets;
00075       foreach ( const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00076         if (jet.abseta() < 4.5) cand_jets.push_back(jet);
00077       }
00078 
00079       // find the electrons
00080       Particles cand_e;
00081       foreach( const Particle& e, applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt()) {
00082         // remove any leptons within 0.4 of any candidate jets
00083         bool e_near_jet = false;
00084         foreach ( const Jet& jet, cand_jets ) {
00085           double dR = deltaR(e, jet);
00086           if (inRange(dR, 0.2, 0.4)) {
00087             e_near_jet = true;
00088             break;
00089           }
00090         }
00091         if ( e_near_jet ) continue;
00092         cand_e.push_back(e);
00093       }
00094 
00095       // find the muons
00096       Particles cand_mu;
00097       foreach( const Particle& mu, applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt()) {
00098         // remove any leptons within 0.4 of any candidate jets
00099         bool mu_near_jet = false;
00100         foreach ( const Jet& jet, cand_jets ) {
00101           if ( deltaR(mu, jet) < 0.4 ) {
00102             mu_near_jet = true;
00103             break;
00104           }
00105         }
00106         if ( mu_near_jet ) continue;
00107         cand_mu.push_back(mu);
00108       }
00109 
00110       // veto events with leptons
00111       if( ! cand_e.empty() || ! cand_mu.empty() )
00112         vetoEvent;
00113 
00114       // discard jets that overlap with electrons
00115       Jets recon_jets;
00116       foreach ( const Jet& jet, cand_jets ) {
00117         if (jet.abseta() > 2.8 || jet.pT() < 30*GeV) continue;
00118         bool away_from_e = true;
00119         foreach (const Particle& e, cand_e ) {
00120           if ( deltaR(e, jet) < 0.2 ) {
00121             away_from_e = false;
00122             break;
00123           }
00124         }
00125         if ( away_from_e ) recon_jets.push_back( jet );
00126       }
00127 
00128       // find b jets
00129       Jets tight_bjets,loose_bjets;
00130       foreach(const Jet& jet, recon_jets) {
00131         /// @todo Should be abseta?
00132         if (!jet.bTagged() && jet.eta()>2.5) continue;
00133         double prob = rand()/static_cast<double>(RAND_MAX);
00134         if (prob <= 0.60) tight_bjets.push_back(jet);
00135         if (prob <= 0.75) loose_bjets.push_back(jet);
00136       }
00137 
00138       // require >=1 tight or >=2 loose b-jets
00139       if (! ( !tight_bjets.empty() || loose_bjets.size()>=2) )
00140         vetoEvent;
00141 
00142       // must be at least 6 jets with pT>30
00143       if (recon_jets.size()<6 ) vetoEvent;
00144 
00145       // hardest > 130
00146       if (recon_jets[0].perp() < 130. ) vetoEvent;
00147 
00148       // three hardest jets must be separated from etmiss
00149       for (unsigned int ix=0;ix<3;++ix) {
00150         if (deltaPhi(recon_jets[ix].momentum(),pTmiss)<0.2*PI)
00151           vetoEvent;
00152       }
00153 
00154       // remove events with tau like jets
00155       for (unsigned int ix=3;ix<recon_jets.size();++ix) {
00156         // skip jets seperated from eTmiss
00157         if (deltaPhi(recon_jets[ix].momentum(),pTmiss)>=0.2*PI)
00158           continue;
00159         // check the number of tracks between 1 and 4
00160         unsigned int ncharged=0;
00161         foreach ( const Particle & particle, recon_jets[ix].particles()) {
00162           if (PID::threeCharge(particle.pid())!=0) ++ncharged;
00163         }
00164         if (ncharged==0 || ncharged>4) continue;
00165         // calculate transverse mass and reject if < 100
00166         double mT = 2.*recon_jets[ix].perp()*ETmiss
00167           -recon_jets[ix].px()*pTmiss.px()
00168           -recon_jets[ix].py()*pTmiss.py();
00169         if (mT<100.) vetoEvent;
00170       }
00171 
00172       // if 2 loose b-jets apply mT cut
00173       if (loose_bjets.size()>=2) {
00174         // find b-jet closest to eTmiss
00175         double minR(1e30);
00176         unsigned int ijet(0);
00177         for(unsigned int ix=0;ix<loose_bjets.size();++ix) {
00178           double dR = deltaR(loose_bjets[ix].momentum(),pTmiss);
00179           if(dR<minR) {
00180             minR=dR;
00181             ijet = ix;
00182           }
00183         }
00184         double  mT = 2.*loose_bjets[ijet].perp()*ETmiss
00185           -loose_bjets[ijet].px()*pTmiss.px()
00186           -loose_bjets[ijet].py()*pTmiss.py();
00187         if(mT<170.) vetoEvent;
00188       }
00189 
00190       // 1 tight b-jet apply mT cut
00191       if(tight_bjets.size()==1) {
00192         for(unsigned int ix=0;ix<4;++ix) {
00193           double mT = 2.*recon_jets[ix].perp()*ETmiss
00194             -recon_jets[ix].px()*pTmiss.px()
00195             -recon_jets[ix].py()*pTmiss.py();
00196           if(mT<175.) vetoEvent;
00197         }
00198       }
00199 
00200       // find the closest triplet of jets in (eta,phi)
00201       unsigned int j1(0),j2(0),j3(0);
00202       double minR2(1e30);
00203       for(unsigned int i1=0;i1<recon_jets.size();++i1) {
00204         for(unsigned int i2=i1+1;i2<recon_jets.size();++i2) {
00205           for(unsigned int i3=i2+1;i3<recon_jets.size();++i3) {
00206             double delR2 =
00207               sqr(deltaR(recon_jets[i1].momentum(),recon_jets[i2].momentum())) +
00208               sqr(deltaR(recon_jets[i1].momentum(),recon_jets[i3].momentum())) +
00209               sqr(deltaR(recon_jets[i2].momentum(),recon_jets[i3].momentum()));
00210             if(delR2<minR2) {
00211               minR2=delR2;
00212               j1=i1;
00213               j2=i2;
00214               j3=i3;
00215             }
00216           }
00217         }
00218       }
00219       // 4-momentum and mass of first triplet
00220       FourMomentum pjjj1 = recon_jets[j1].momentum() +
00221         recon_jets[j2].momentum()+ recon_jets[j3].momentum();
00222       double mjjj1 = pjjj1.mass();
00223 
00224       // find the second triplet
00225       unsigned int j4(0),j5(0),j6(0);
00226       minR2=0.;
00227       for(unsigned int i1=0;i1<recon_jets.size();++i1) {
00228         if(i1==j1||i1==j2||i1==j3) continue;
00229         for(unsigned int i2=i1+1;i2<recon_jets.size();++i2) {
00230           if(i2==j1||i2==j2||i2==j3) continue;
00231           for(unsigned int i3=i2+1;i3<recon_jets.size();++i3) {
00232             if(i3==j1||i3==j2||i3==j3) continue;
00233             double delR2 =
00234               sqr(deltaR(recon_jets[i1].momentum(),recon_jets[i2].momentum())) +
00235               sqr(deltaR(recon_jets[i1].momentum(),recon_jets[i3].momentum())) +
00236               sqr(deltaR(recon_jets[i2].momentum(),recon_jets[i3].momentum()));
00237             if(delR2<minR2) {
00238               minR2=delR2;
00239               j4=i1;
00240               j5=i2;
00241               j6=i3;
00242             }
00243           }
00244         }
00245       }
00246 
00247       // 4-momentum and mass of first triplet
00248       FourMomentum pjjj2 = recon_jets[j4].momentum() +
00249         recon_jets[j5].momentum()+ recon_jets[j6].momentum();
00250       double mjjj2 = pjjj2.mass();
00251 
00252       _hist_mjjj1->fill(mjjj1,weight);
00253       _hist_mjjj2->fill(mjjj2,weight);
00254       // require triplets in 80<mjjj<270
00255       if(mjjj1<80.||mjjj1>270.||mjjj2<80.||mjjj2>270.)
00256         vetoEvent;
00257 
00258       // counts in signal regions
00259       _count_SR_A->fill(0.5,weight);
00260       if(ETmiss>260.) _count_SR_B->fill(0.5,weight);
00261 
00262       _hist_ETmiss->fill(ETmiss,weight);
00263       double m_T2 = mT2::mT2( pjjj1,pjjj2,
00264                               pTmiss,0.0 ); // zero mass invisibles
00265       _hist_mT2->fill(m_T2,weight);
00266     }
00267     //@}
00268 
00269 
00270     void finalize() {
00271 
00272       double norm = 4.7* crossSection()/sumOfWeights()/femtobarn;
00273       scale(_count_SR_A ,     norm );
00274       scale(_count_SR_B ,     norm );
00275       scale(_hist_mjjj1 , 20.*norm );
00276       scale(_hist_ETmiss, 50.*norm );
00277       scale(_hist_mjjj2 , 20.*norm );
00278       scale(_hist_mT2   ,     norm );
00279 
00280     }
00281 
00282   private:
00283 
00284     /// @name Histograms
00285     //@{
00286     Histo1DPtr _count_SR_A;
00287     Histo1DPtr _count_SR_B;
00288 
00289     Histo1DPtr _hist_mjjj1;
00290     Histo1DPtr _hist_mjjj2;
00291     Histo1DPtr _hist_ETmiss;
00292     Histo1DPtr _hist_mT2;
00293     //@}
00294 
00295   };
00296 
00297   // The hook for the plugin system
00298   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1126136);
00299 
00300 }