ATLAS_2012_CONF_2012_104.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 00011 namespace Rivet { 00012 00013 00014 class ATLAS_2012_CONF_2012_104 : public Analysis { 00015 public: 00016 00017 /// Constructor 00018 ATLAS_2012_CONF_2012_104() 00019 : Analysis("ATLAS_2012_CONF_2012_104") 00020 { } 00021 00022 00023 /// @name Analysis methods 00024 //@{ 00025 00026 /// Book histograms and initialize projections before the run 00027 void init() { 00028 00029 // projection to find the electrons 00030 IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); 00031 elecs.acceptIdPair(PID::ELECTRON); 00032 addProjection(elecs, "elecs"); 00033 00034 // projection to find the muons 00035 IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); 00036 muons.acceptIdPair(PID::MUON); 00037 addProjection(muons, "muons"); 00038 00039 // Jet finder 00040 VetoedFinalState vfs; 00041 vfs.addVetoPairId(PID::MUON); 00042 addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); 00043 00044 // all tracks (to do deltaR with leptons) 00045 addProjection(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); 00046 00047 // for pTmiss 00048 addProjection(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); 00049 00050 // Book histograms 00051 _count_e = bookHisto1D("count_e" , 1, 0., 1.); 00052 _count_mu = bookHisto1D("count_mu", 1, 0., 1.); 00053 00054 _hist_eTmiss_e = bookHisto1D("hist_eTmiss_e" , 25, 0., 1000.); 00055 _hist_eTmiss_mu = bookHisto1D("hist_eTmiss_mu" , 25, 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 // get the candiate jets 00064 Jets cand_jets; 00065 foreach ( const Jet& jet, 00066 applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { 00067 if ( fabs( jet.eta() ) < 2.8 ) { 00068 cand_jets.push_back(jet); 00069 } 00070 } 00071 00072 // get the candidate "medium" leptons without isolation 00073 Particles cand_e; 00074 foreach( const Particle & e, 00075 applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt()) { 00076 // remove any leptons within 0.4 of any candidate jets 00077 bool e_near_jet = false; 00078 foreach ( const Jet& jet, cand_jets ) { 00079 double dR = deltaR(e.momentum(),jet.momentum()); 00080 if ( dR < 0.4 && dR > 0.2 ) { 00081 e_near_jet = true; 00082 break; 00083 } 00084 } 00085 if ( ! e_near_jet ) cand_e.push_back(e); 00086 } 00087 Particles cand_mu; 00088 foreach( const Particle & mu, 00089 applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt()) { 00090 // remove any leptons within 0.4 of any candidate jets 00091 bool mu_near_jet = false; 00092 foreach ( const Jet& jet, cand_jets ) { 00093 if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { 00094 mu_near_jet = true; 00095 break; 00096 } 00097 } 00098 if ( ! mu_near_jet ) cand_mu.push_back(mu); 00099 } 00100 // apply the isolation 00101 Particles chg_tracks = 00102 applyProjection<ChargedFinalState>(event, "cfs").particles(); 00103 // pTcone around muon track (hard) 00104 Particles recon_mu; 00105 foreach ( const Particle & mu, cand_mu ) { 00106 double pTinCone = -mu.pT(); 00107 if(-pTinCone<25.) continue; 00108 foreach ( const Particle & track, chg_tracks ) { 00109 if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) 00110 pTinCone += track.pT(); 00111 } 00112 if ( pTinCone < 1.8*GeV ) recon_mu.push_back(mu); 00113 } 00114 // pTcone around electron track (hard) 00115 Particles recon_e; 00116 foreach ( const Particle & e, cand_e ) { 00117 double pTinCone = -e.pT(); 00118 if(-pTinCone<25.) continue; 00119 foreach ( const Particle & track, chg_tracks ) { 00120 if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) 00121 pTinCone += track.pT(); 00122 } 00123 if ( pTinCone < 0.1 * e.pT() ) recon_e.push_back(e); 00124 } 00125 00126 // discard jets that overlap with electrons 00127 Jets recon_jets; 00128 foreach ( const Jet& jet, cand_jets ) { 00129 if(jet.abseta()>2.5|| 00130 jet.perp()<25.) continue; 00131 bool away_from_e = true; 00132 foreach ( const Particle & e, cand_e ) { 00133 if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) { 00134 away_from_e = false; 00135 break; 00136 } 00137 } 00138 if ( away_from_e ) recon_jets.push_back( jet ); 00139 } 00140 00141 // pTmiss 00142 FourMomentum pTmiss; 00143 foreach ( const Particle & p, 00144 applyProjection<VisibleFinalState>(event, "vfs").particles() ) { 00145 pTmiss -= p.momentum(); 00146 } 00147 double eTmiss = pTmiss.pT(); 00148 00149 // at least 4 jets with pT>80. 00150 if(recon_jets.size()<4 || recon_jets[3].perp()<80.) vetoEvent; 00151 00152 // only 1 signal lepton 00153 if( recon_e.size() + recon_mu.size() != 1 ) 00154 vetoEvent; 00155 if( cand_e .size() + cand_mu .size() != 1 ) 00156 vetoEvent; 00157 00158 // start of meff calculation 00159 double HT=0.; 00160 foreach( const Jet & jet, recon_jets) { 00161 double pT = jet.perp(); 00162 if(pT>40.) HT += pT; 00163 } 00164 00165 // get the lepton 00166 Particle lepton = recon_e.empty() ? recon_mu[0] : recon_e[0]; 00167 00168 // lepton variables 00169 double pT = lepton.perp(); 00170 00171 double mT = 2.*(pT*eTmiss - 00172 lepton.px()*pTmiss.px() - 00173 lepton.py()*pTmiss.py()); 00174 mT = sqrt(mT); 00175 HT += pT; 00176 double m_eff_inc = HT + eTmiss + pT; 00177 double m_eff_4 = eTmiss + pT; 00178 for(unsigned int ix=0;ix<4;++ix) 00179 m_eff_4 += recon_jets[ix].perp(); 00180 00181 // four jet selecton 00182 if(mT>100.&& eTmiss/m_eff_4>0.2 && 00183 m_eff_inc > 800.) { 00184 if( eTmiss > 250. ) { 00185 if(lepton.abspid()==PID::ELECTRON) 00186 _count_e->fill(0.5,weight); 00187 else if(lepton.abspid()==PID::MUON) 00188 _count_mu->fill(0.5,weight); 00189 } 00190 if(lepton.abspid()==PID::ELECTRON) 00191 _hist_eTmiss_e ->fill(eTmiss,weight); 00192 else if(lepton.abspid()==PID::MUON) 00193 _hist_eTmiss_mu->fill(eTmiss,weight); 00194 } 00195 } 00196 //@} 00197 00198 00199 void finalize() { 00200 00201 double norm = 5.8* crossSection()/sumOfWeights()/femtobarn; 00202 scale(_count_e ,norm); 00203 scale(_count_mu,norm); 00204 scale(_hist_eTmiss_e ,40.*norm); 00205 scale(_hist_eTmiss_mu ,40.*norm); 00206 00207 } 00208 00209 private: 00210 00211 /// @name Histograms 00212 //@{ 00213 Histo1DPtr _count_e ; 00214 Histo1DPtr _count_mu; 00215 00216 Histo1DPtr _hist_eTmiss_e ; 00217 Histo1DPtr _hist_eTmiss_mu; 00218 //@} 00219 00220 }; 00221 00222 // The hook for the plugin system 00223 DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_104); 00224 00225 } Generated on Tue Mar 24 2015 17:35:24 for The Rivet MC analysis system by ![]() |