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