rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_CONF_2012_109.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/RivetYODA.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/ChargedFinalState.hh"
00008 #include "Rivet/Projections/VisibleFinalState.hh"
00009 #include "Rivet/Projections/IdentifiedFinalState.hh"
00010 #include "Rivet/Projections/FastJets.hh"
00011 #include "Rivet/Projections/VetoedFinalState.hh"
00012 #include "Rivet/Tools/ParticleIdUtils.hh"
00013 
00014 namespace Rivet {
00015 
00016   /// @author Peter Richardson
00017   class ATLAS_2012_CONF_2012_109 : public Analysis {
00018   public:
00019 
00020     /// @name Constructors etc.
00021     //@{
00022 
00023     /// Constructor
00024     ATLAS_2012_CONF_2012_109()
00025       : Analysis("ATLAS_2012_CONF_2012_109")
00026     {    }
00027 
00028     //@}
00029 
00030 
00031   public:
00032 
00033     /// @name Analysis methods
00034     //@{
00035 
00036     /// Book histograms and initialise projections before the run
00037     void init() {
00038 
00039       // Projection to find the electrons
00040       std::vector<std::pair<double, double> > eta_e;
00041       eta_e.push_back(make_pair(-2.47,2.47));
00042       IdentifiedFinalState elecs(eta_e, 20.0*GeV);
00043       elecs.acceptIdPair(ELECTRON);
00044       addProjection(elecs, "elecs");
00045 
00046       // Projection to find the muons
00047       std::vector<std::pair<double, double> > eta_m;
00048       eta_m.push_back(make_pair(-2.4,2.4));
00049       IdentifiedFinalState muons(eta_m, 10.0*GeV);
00050       muons.acceptIdPair(MUON);
00051       addProjection(muons, "muons");
00052 
00053       // Jet finder
00054       VetoedFinalState vfs;
00055       vfs.addVetoPairId(MUON);
00056       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04");
00057 
00058       // All tracks (to do deltaR with leptons)
00059       addProjection(ChargedFinalState(-3.0,3.0),"cfs");
00060 
00061       // Used for pTmiss (N.B. the real 'vfs' extends beyond 4.5 to |eta| = 4.9)
00062       addProjection(VisibleFinalState(-4.5,4.5),"vfs");
00063 
00064       // Book histograms
00065       _count_A_tight   = bookHisto1D("count_A_tight"   , 1, 0., 1.);
00066       _count_A_medium  = bookHisto1D("count_A_medium"  , 1, 0., 1.);
00067       _count_A_loose   = bookHisto1D("count_A_loose"   , 1, 0., 1.);
00068       _count_B_tight   = bookHisto1D("count_B_tight"   , 1, 0., 1.);
00069       _count_B_medium  = bookHisto1D("count_B_medium"  , 1, 0., 1.);
00070       _count_C_tight   = bookHisto1D("count_C_tight"   , 1, 0., 1.);
00071       _count_C_medium  = bookHisto1D("count_C_medium"  , 1, 0., 1.);
00072       _count_C_loose   = bookHisto1D("count_C_loose"   , 1, 0., 1.);
00073       _count_D_tight   = bookHisto1D("count_D_tight"   , 1, 0., 1.);
00074       _count_E_tight   = bookHisto1D("count_E_tight"   , 1, 0., 1.);
00075       _count_E_medium  = bookHisto1D("count_E_medium"  , 1, 0., 1.);
00076       _count_E_loose   = bookHisto1D("count_E_loose"   , 1, 0., 1.);
00077 
00078       _hist_meff_A_medium = bookHisto1D("meff_A_medium" , 40, 0., 4000.);
00079       _hist_meff_A_tight  = bookHisto1D("meff_A_tight"  , 40, 0., 4000.);
00080       _hist_meff_B_medium = bookHisto1D("meff_B_medium" , 40, 0., 4000.);
00081       _hist_meff_B_tight  = bookHisto1D("meff_B_tight"  , 40, 0., 4000.);
00082       _hist_meff_C_medium = bookHisto1D("meff_C_medium" , 40, 0., 4000.);
00083       _hist_meff_C_tight  = bookHisto1D("meff_C_tight"  , 40, 0., 4000.);
00084       _hist_meff_D        = bookHisto1D("meff_D"        , 40, 0., 4000.);
00085       _hist_meff_E_loose  = bookHisto1D("meff_E_loose"  , 40, 0., 4000.);
00086       _hist_meff_E_medium = bookHisto1D("meff_E_medium" , 40, 0., 4000.);
00087       _hist_meff_E_tight  = bookHisto1D("meff_E_tight"  , 40, 0., 4000.);
00088 
00089     }
00090 
00091 
00092     /// Perform the per-event analysis
00093     void analyze(const Event& event) {
00094       const double weight = event.weight();
00095 
00096       Jets cand_jets;
00097       const Jets jets = applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV);
00098       foreach (const Jet& jet, jets) {
00099         if ( fabs( jet.momentum().eta() ) < 4.9 ) {
00100           cand_jets.push_back(jet);
00101         }
00102       }
00103 
00104       const ParticleVector cand_e  = applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00105 
00106       // Muon isolation not mentioned in hep-exp 1109.6572 but assumed to still be applicable
00107       ParticleVector cand_mu;
00108       const ParticleVector chg_tracks = applyProjection<ChargedFinalState>(event, "cfs").particles();
00109       const ParticleVector muons = applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt();
00110       foreach (const Particle& mu, muons) {
00111         double pTinCone = -mu.momentum().pT();
00112         foreach (const Particle& track, chg_tracks) {
00113           if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) {
00114             pTinCone += track.momentum().pT();
00115           }
00116         }
00117         if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu);
00118       }
00119 
00120       // Resolve jet-lepton overlap for jets with |eta| < 2.8
00121       Jets recon_jets;
00122       foreach ( const Jet& jet, cand_jets ) {
00123         if ( fabs( jet.momentum().eta() ) >= 2.8 ) continue;
00124         bool away_from_e = true;
00125         foreach ( const Particle & e, cand_e ) {
00126           if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00127             away_from_e = false;
00128             break;
00129           }
00130         }
00131         if ( away_from_e ) recon_jets.push_back( jet );
00132       }
00133 
00134       ParticleVector recon_e, recon_mu;
00135 
00136       foreach ( const Particle & e, cand_e ) {
00137         bool away = true;
00138         foreach ( const Jet& jet, recon_jets ) {
00139           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) {
00140             away = false;
00141             break;
00142           }
00143         }
00144         if ( away ) recon_e.push_back( e );
00145       }
00146 
00147       foreach ( const Particle & mu, cand_mu ) {
00148         bool away = true;
00149         foreach ( const Jet& jet, recon_jets ) {
00150           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) {
00151             away = false;
00152             break;
00153           }
00154         }
00155         if ( away ) recon_mu.push_back( mu );
00156       }
00157 
00158       // pTmiss
00159       // Based on all candidate electrons, muons and jets, plus everything else with |eta| < 4.5
00160       // i.e. everything in our projection "vfs" plus the jets with |eta| > 4.5
00161       ParticleVector vfs_particles = applyProjection<VisibleFinalState>(event, "vfs").particles();
00162       FourMomentum pTmiss;
00163       foreach ( const Particle & p, vfs_particles ) {
00164         pTmiss -= p.momentum();
00165       }
00166       foreach ( const Jet& jet, cand_jets ) {
00167         if ( fabs( jet.momentum().eta() ) > 4.5 ) pTmiss -= jet.momentum();
00168       }
00169       double eTmiss = pTmiss.pT();
00170 
00171       // no electron pT> 20 or muons pT>10
00172       if ( !recon_mu.empty() || !recon_e.empty() ) {
00173         MSG_DEBUG("Charged leptons left after selection");
00174         vetoEvent;
00175       }
00176 
00177       if ( eTmiss <= 160 * GeV ) {
00178         MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 130");
00179         vetoEvent;
00180       }
00181 
00182       // check the hardest two jets
00183       if ( recon_jets.size()<2 ||
00184            recon_jets[0].momentum().pT() <= 130.0 * GeV ||
00185            recon_jets[0].momentum().pT() <=  60.0 * GeV ) {
00186         MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets");
00187         vetoEvent;
00188       }
00189 
00190       // check the charged and EM fractions of the hard jets to avoid
00191       // photons
00192       for(unsigned int ix=0;ix<2;++ix) {
00193         // jets over 100 GeV
00194         if(recon_jets[ix].momentum().pT()<100. ||
00195            recon_jets[ix].momentum().eta()>2.) continue;
00196         double fch(0.), fem(0.), eTotal(0.);
00197         foreach(const Particle & part, recon_jets[ix].particles()) {
00198           long id = abs(part.pdgId());
00199           if(PID::threeCharge(id)!=0)
00200             fch += part.momentum().E();
00201           if(id==PHOTON||id==EMINUS||id==PI0)
00202             fem += part.momentum().E();
00203         }
00204         fch /= eTotal;
00205         fem /= eTotal;
00206         // reomve events with hard photon
00207         if(fch<0.02|| (fch<0.05&&fem>0.09))
00208           vetoEvent;
00209       }
00210       // ==================== observables ====================
00211 
00212       int Njets = 0;
00213       double min_dPhi_All = 999.999;
00214       double min_dPhi_2   = 999.999;
00215       double min_dPhi_3   = 999.999;
00216       double pTmiss_phi = pTmiss.phi();
00217 
00218       foreach ( const Jet& jet, recon_jets ) {
00219         if ( jet.momentum().pT() < 40 * GeV ) continue;
00220         double dPhi = deltaPhi( pTmiss_phi, jet.momentum().phi());
00221         if ( Njets < 2 ) min_dPhi_2 = min( min_dPhi_2, dPhi );
00222         if ( Njets < 3 ) min_dPhi_3 = min( min_dPhi_3, dPhi );
00223         min_dPhi_All = min( min_dPhi_All, dPhi );
00224         ++Njets;
00225       }
00226 
00227       // inclusive meff
00228       double m_eff_inc =  eTmiss;
00229       foreach ( const Jet& jet, recon_jets ) {
00230         double perp =  jet.momentum().pT();
00231         if(perp>40.) m_eff_inc += perp;
00232       }
00233 
00234       // region A
00235       double m_eff_Nj = eTmiss + recon_jets[0].momentum().pT() + recon_jets[1].momentum().pT();
00236       if( min_dPhi_2 > 0.4 && eTmiss/m_eff_Nj > 0.3 ) {
00237         _hist_meff_A_tight ->fill(m_eff_inc,weight);
00238         if(eTmiss/m_eff_Nj > 0.4)
00239           _hist_meff_A_medium->fill(m_eff_inc,weight);
00240         if(m_eff_inc>1900.)
00241           _count_A_tight ->fill(0.5,weight);
00242         if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.4)
00243           _count_A_medium->fill(0.5,weight);
00244         if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.4)
00245           _count_A_loose ->fill(0.5,weight);
00246       }
00247 
00248       // for rest of regions 3 jets pT> 60 needed
00249       if(recon_jets.size()<3 || recon_jets[2].momentum().perp()<60.)
00250         vetoEvent;
00251 
00252       // region B
00253       m_eff_Nj +=  recon_jets[2].momentum().perp();
00254       if( min_dPhi_3 > 0.4 && eTmiss/m_eff_Nj > 0.25 ) {
00255         _hist_meff_B_tight->fill(m_eff_inc,weight);
00256         if(eTmiss/m_eff_Nj > 0.3)
00257           _hist_meff_B_medium->fill(m_eff_inc,weight);
00258         if(m_eff_inc>1900.)
00259           _count_B_tight ->fill(0.5,weight);
00260         if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.3)
00261           _count_B_medium->fill(0.5,weight);
00262       }
00263 
00264       // for rest of regions 4 jets pT> 60 needed
00265       if(recon_jets.size()<4 || recon_jets[3].momentum().perp()<60.)
00266         vetoEvent;
00267 
00268       // region C
00269       m_eff_Nj +=  recon_jets[3].momentum().perp();
00270       if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.25 ) {
00271         _hist_meff_C_tight->fill(m_eff_inc,weight);
00272         if( eTmiss/m_eff_Nj > 0.3 )
00273           _hist_meff_C_medium->fill(m_eff_inc,weight);
00274         if(m_eff_inc>1900.)
00275           _count_C_tight ->fill(0.5,weight);
00276         if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.3)
00277           _count_C_medium->fill(0.5,weight);
00278         if(m_eff_inc>1000. && eTmiss/m_eff_Nj > 0.3)
00279           _count_C_loose ->fill(0.5,weight);
00280       }
00281 
00282       // for rest of regions 5 jets pT> 40 needed
00283       if(recon_jets.size()<5 || recon_jets[4].momentum().perp()<40.)
00284         vetoEvent;
00285 
00286       // region D
00287       m_eff_Nj +=  recon_jets[4].momentum().perp();
00288       if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.15 ) {
00289         _hist_meff_D->fill(m_eff_inc,weight);
00290         if(m_eff_inc>1700.) _count_D_tight ->fill(0.5,weight);
00291       }
00292 
00293       // for rest of regions 6 jets pT> 40 needed
00294       if(recon_jets.size()<6 || recon_jets[5].momentum().perp()<40.)
00295         vetoEvent;
00296 
00297       // region E
00298       m_eff_Nj +=  recon_jets[5].momentum().perp();
00299       if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.15 ) {
00300         _hist_meff_E_tight->fill(m_eff_inc,weight);
00301         if( eTmiss/m_eff_Nj > 0.25 )
00302           _hist_meff_E_medium->fill(m_eff_inc,weight);
00303         if( eTmiss/m_eff_Nj > 0.3 )
00304           _hist_meff_E_loose->fill(m_eff_inc,weight);
00305         if(m_eff_inc>1400.) _count_E_tight ->fill(0.5,weight);
00306         if(m_eff_inc>1300.&& eTmiss/m_eff_Nj > 0.25 )
00307           _count_E_medium->fill(0.5,weight);
00308         if(m_eff_inc>1000.&& eTmiss/m_eff_Nj > 0.3  )
00309           _count_E_loose ->fill(0.5,weight);
00310       }
00311     }
00312 
00313 
00314     void finalize() {
00315 
00316       double norm = crossSection()/femtobarn*5.8/sumOfWeights();
00317       // these are number of events at 5.8fb^-1 per 100 GeV
00318       scale( _hist_meff_A_medium , 100. * norm );
00319       scale( _hist_meff_A_tight  , 100. * norm );
00320       scale( _hist_meff_B_medium , 100. * norm );
00321       scale( _hist_meff_B_tight  , 100. * norm );
00322       scale( _hist_meff_C_medium , 100. * norm );
00323       scale( _hist_meff_C_tight  , 100. * norm );
00324       scale( _hist_meff_D    , 100. * norm );
00325       scale( _hist_meff_E_loose  , 100. * norm );
00326       scale( _hist_meff_E_medium , 100. * norm );
00327       scale( _hist_meff_E_tight  , 100. * norm );
00328       // these are number of events at 5.8fb^-1
00329       scale(_count_A_tight  ,norm);
00330       scale(_count_A_medium ,norm);
00331       scale(_count_A_loose  ,norm);
00332       scale(_count_B_tight  ,norm);
00333       scale(_count_B_medium ,norm);
00334       scale(_count_C_tight  ,norm);
00335       scale(_count_C_medium ,norm);
00336       scale(_count_C_loose  ,norm);
00337       scale(_count_D_tight  ,norm);
00338       scale(_count_E_tight  ,norm);
00339       scale(_count_E_medium ,norm);
00340       scale(_count_E_loose  ,norm);
00341     }
00342 
00343     //@}
00344 
00345   private:
00346 
00347     Histo1DPtr _count_A_tight;
00348     Histo1DPtr _count_A_medium;
00349     Histo1DPtr _count_A_loose;
00350     Histo1DPtr _count_B_tight;
00351     Histo1DPtr _count_B_medium;
00352     Histo1DPtr _count_C_tight;
00353     Histo1DPtr _count_C_medium;
00354     Histo1DPtr _count_C_loose;
00355     Histo1DPtr _count_D_tight;
00356     Histo1DPtr _count_E_tight;
00357     Histo1DPtr _count_E_medium;
00358     Histo1DPtr _count_E_loose;
00359 
00360     Histo1DPtr _hist_meff_A_medium;
00361     Histo1DPtr _hist_meff_A_tight;
00362     Histo1DPtr _hist_meff_B_medium;
00363     Histo1DPtr _hist_meff_B_tight;
00364     Histo1DPtr _hist_meff_C_medium;
00365     Histo1DPtr _hist_meff_C_tight;
00366     Histo1DPtr _hist_meff_D;
00367     Histo1DPtr _hist_meff_E_loose;
00368     Histo1DPtr _hist_meff_E_medium;
00369     Histo1DPtr _hist_meff_E_tight;
00370 
00371   };
00372 
00373 
00374   // This global object acts as a hook for the plugin system
00375   DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_109);
00376 
00377 }