ATLAS_2011_CONF_2011_098.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/RivetAIDA.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/Tools/RivetMT2.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   class ATLAS_2011_CONF_2011_098 : public Analysis {
00017   public:
00018 
00019     /// @name Constructors etc.
00020     //@{
00021 
00022     /// Constructor
00023     ATLAS_2011_CONF_2011_098()
00024       : Analysis("ATLAS_2011_CONF_2011_098"),
00025 //debug variables
00026 threeJA(0), threeJB(0), threeJC(0), threeJD(0), bj(0), jets(0), zerolept(0), eTmisscut(0)
00027     {    }
00028 
00029     //@}
00030 
00031 
00032   public:
00033 
00034     /// @name Analysis methods
00035     //@{
00036 
00037     /// Book histograms and initialise projections before the run
00038     void init() {
00039 
00040       // projection to find the electrons
00041       std::vector<std::pair<double, double> > eta_e;
00042       eta_e.push_back(make_pair(-2.47,2.47));
00043       IdentifiedFinalState elecs(eta_e, 20.0*GeV);
00044       elecs.acceptIdPair(ELECTRON);
00045       addProjection(elecs, "elecs");
00046 
00047 
00048       // projection to find the muons
00049       std::vector<std::pair<double, double> > eta_m;
00050       eta_m.push_back(make_pair(-2.4,2.4));
00051       IdentifiedFinalState muons(eta_m, 10.0*GeV);
00052       muons.acceptIdPair(MUON);
00053       addProjection(muons, "muons");
00054 
00055 
00056 
00057       /// Jet finder
00058       addProjection(FastJets(FinalState(), FastJets::ANTIKT, 0.4),
00059                     "AntiKtJets04");
00060 
00061 
00062       // all tracks (to do deltaR with leptons)
00063       addProjection(ChargedFinalState(-3.0,3.0),"cfs");
00064 
00065       // for pTmiss
00066       addProjection(VisibleFinalState(-4.9,4.9),"vfs");
00067 
00068 
00069       /// Book histograms
00070       _count_threeJA     = bookHistogram1D("count_threeJA", 1, 0., 1.);
00071       _count_threeJB     = bookHistogram1D("count_threeJB", 1, 0., 1.);
00072       _count_threeJC     = bookHistogram1D("count_threeJC", 1, 0., 1.);
00073       _count_threeJD     = bookHistogram1D("count_threeJD", 1, 0., 1.);
00074       _hist_meff_1bjet   = bookHistogram1D("meff_1bjet", 32, 0., 1600.);
00075       _hist_eTmiss_1bjet = bookHistogram1D("eTmiss_1bjet", 6, 0., 600.);
00076       _hist_pTj_1bjet    = bookHistogram1D("pTjet_1bjet", 20, 0., 800.);
00077       _hist_meff_2bjet   = bookHistogram1D("meff_2bjet", 32, 0., 1600.);
00078       _hist_eTmiss_2bjet = bookHistogram1D("eTmiss_2bjet", 6, 0., 600.);
00079       _hist_pTj_2bjet    = bookHistogram1D("pTjet_2bjet", 20, 0., 800.);
00080 
00081 
00082     }
00083 
00084 
00085     /// Perform the per-event analysis
00086     void analyze(const Event& event) {
00087 
00088       const double weight = event.weight();
00089 
00090       // Temp: calorimeter module failure with 10% acceptance loss;
00091       // region unknown ==> randomly choose 10% of events to be vetoed
00092       if ( rand()/RAND_MAX < 0.1 )
00093         vetoEvent;
00094 
00095       Jets tmp_cand_jets;
00096       foreach (const Jet& jet,
00097                applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) {
00098         if ( fabs( jet.momentum().eta() ) < 2.8 ) {
00099           tmp_cand_jets.push_back(jet);
00100         }
00101       }
00102 
00103       ParticleVector cand_e =
00104         applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt();
00105       ParticleVector cand_mu =
00106         applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt();
00107       ParticleVector chg_tracks =
00108         applyProjection<ChargedFinalState>(event, "cfs").particles();
00109 
00110 //cerr << "cand_e.size(): " << cand_e.size() << "   cand_mu.size(): " << cand_mu.size() << '\n';
00111 
00112 
00113       Jets cand_jets;
00114       foreach ( const Jet& jet, tmp_cand_jets ) {
00115         if ( fabs( jet.momentum().eta() ) >= 2.8 )
00116           cand_jets.push_back( jet );
00117         else {
00118           bool away_from_e = true;
00119           foreach ( const Particle & e, cand_e ) {
00120             if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) {
00121               away_from_e = false;
00122               break;
00123             }
00124           }
00125           if ( away_from_e )
00126             cand_jets.push_back( jet );
00127         }
00128       }
00129 
00130       ParticleVector cand_lept;
00131 
00132       bool isolated_e;
00133       foreach ( const Particle & e, cand_e ) {
00134         isolated_e = true;
00135         foreach ( const Jet& jet, cand_jets ) {
00136           if ( deltaR(e.momentum(),jet.momentum()) < 0.4 )
00137             isolated_e = false;
00138         }
00139         if ( isolated_e == true )
00140           cand_lept.push_back( e );
00141        }
00142 
00143 
00144        bool isolated_mu;
00145        foreach ( const Particle & mu, cand_mu ) {
00146          isolated_mu = true;
00147          foreach ( const Jet& jet, cand_jets ) {
00148            if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 )
00149              isolated_mu = false;
00150         }
00151         if ( isolated_mu == true)
00152           cand_lept.push_back( mu );
00153       }
00154 
00155 
00156       // pTmiss
00157       ParticleVector vfs_particles
00158         = applyProjection<VisibleFinalState>(event, "vfs").particles();
00159       FourMomentum pTmiss;
00160       foreach ( const Particle & p, vfs_particles ) {
00161         pTmiss -= p.momentum();
00162       }
00163       double eTmiss = pTmiss.pT();
00164 
00165 
00166       // bjets
00167       Jets bjets;
00168       foreach (const Jet& j, cand_jets) {
00169         if ( j.momentum().pT() > 20*GeV ) {
00170           if (j.containsBottom()) bjets += j;
00171         }
00172       }
00173 
00174       if (bjets.empty())  {
00175         MSG_DEBUG("No b-jet axes in acceptance");
00176         vetoEvent;
00177       }
00178 
00179 ++bj;
00180 
00181 
00182 
00183       // Jets event selection
00184       if ( cand_jets.size() < 3 )
00185         vetoEvent;
00186       if ( cand_jets[0].momentum().pT() <= 130*GeV )
00187         vetoEvent;
00188       if ( cand_jets[1].momentum().pT() <= 50*GeV ||
00189                 cand_jets[2].momentum().pT() <= 50*GeV )
00190         vetoEvent;
00191 ++jets;
00192 
00193       // eTmiss cut
00194       if ( eTmiss <= 130*GeV )
00195         vetoEvent;
00196 
00197 ++eTmisscut;
00198 
00199       // 0-lepton requirement
00200       if ( !cand_lept.empty() )
00201         vetoEvent;
00202 ++zerolept;
00203 
00204       // m_eff cut
00205       double m_eff = eTmiss
00206         + cand_jets[0].momentum().pT()
00207         + cand_jets[1].momentum().pT()
00208         + cand_jets[2].momentum().pT();
00209 
00210       if ( eTmiss / m_eff <= 0.25 )
00211         vetoEvent;
00212 
00213 
00214       // min_dPhi
00215       double min_dPhi = 999.999;
00216       for ( int i = 0; i < 3; ++i ) {
00217         double dPhi = deltaPhi( pTmiss.phi(), cand_jets[i].momentum().phi() );
00218         min_dPhi = min( min_dPhi, dPhi );
00219       }
00220 
00221       if ( min_dPhi <= 0.4 )
00222         vetoEvent;
00223 
00224 
00225 
00226     // ==================== FILL ====================
00227 
00228 
00229       // 1 bjet
00230       if ( bjets.size() >= 1 ) {
00231 
00232         _hist_meff_1bjet->fill(m_eff, weight);
00233         _hist_eTmiss_1bjet->fill(eTmiss, weight);
00234         _hist_pTj_1bjet->fill(cand_jets[0].momentum().pT(), weight);
00235 
00236         // 3JA region
00237         if ( m_eff > 200*GeV ) {
00238 ++threeJA;
00239         _count_threeJA->fill(0.5, weight);
00240         }
00241 
00242         // 3JB region
00243         if ( m_eff > 700*GeV ) {
00244 ++threeJB;
00245         _count_threeJB->fill(0.5, weight);
00246         }
00247       }
00248 
00249       // 2 bjets
00250       if ( bjets.size() >= 2 ) {
00251 
00252         _hist_meff_2bjet->fill(m_eff, weight);
00253         _hist_eTmiss_2bjet->fill(eTmiss, weight);
00254         _hist_pTj_2bjet->fill(cand_jets[0].momentum().pT(), weight);
00255 
00256         // 3JC region
00257         if ( m_eff > 500*GeV ) {
00258 ++threeJC;
00259           _count_threeJC->fill(0.5, weight);
00260         }
00261 
00262         // 3JD region
00263         if ( m_eff > 700*GeV ) {
00264 ++threeJD;
00265           _count_threeJD->fill(0.5, weight);
00266         }
00267       }
00268 
00269 
00270 
00271 
00272     }
00273 
00274     //@}
00275 
00276 
00277     void finalize() {
00278       scale( _hist_meff_1bjet, 50. * 830. * crossSection()/sumOfWeights() );
00279       scale( _hist_eTmiss_1bjet, 100. * 830. * crossSection()/sumOfWeights() );
00280       scale( _hist_pTj_1bjet, 40. * 830. * crossSection()/sumOfWeights() );
00281       scale( _hist_meff_2bjet, 50. * 830. * crossSection()/sumOfWeights() );
00282       scale( _hist_eTmiss_2bjet, 100. * 830. * crossSection()/sumOfWeights() );
00283       scale( _hist_pTj_2bjet, 40. * 830. * crossSection()/sumOfWeights() );
00284 
00285 // cerr<< '\n'<<'\n'
00286 // << "Saw "
00287 // << bj << " events aft bjets cut, "
00288 // << jets << " events aft jet cuts, "
00289 // << eTmisscut << " events aft eTmiss cut, "
00290 // << zerolept << " events after 0-lept cut. "
00291 // << '\n'
00292 // << threeJA << " 3JA events, "
00293 // << threeJB << " 3JB events, "
00294 // << threeJC << " 3JC events, "
00295 // << threeJD << " 3JD events. "
00296 // << '\n'
00297 // ;
00298 
00299     }
00300 
00301 
00302   private:
00303 
00304     /// @name Histograms
00305     //@{
00306     AIDA::IHistogram1D* _count_threeJA;
00307     AIDA::IHistogram1D* _count_threeJB;
00308     AIDA::IHistogram1D* _count_threeJC;
00309     AIDA::IHistogram1D* _count_threeJD;
00310     AIDA::IHistogram1D* _hist_meff_1bjet;
00311     AIDA::IHistogram1D* _hist_eTmiss_1bjet;
00312     AIDA::IHistogram1D* _hist_pTj_1bjet;
00313     AIDA::IHistogram1D* _hist_meff_2bjet;
00314     AIDA::IHistogram1D* _hist_eTmiss_2bjet;
00315     AIDA::IHistogram1D* _hist_pTj_2bjet;
00316 
00317     //@}
00318 
00319 
00320 // debug variables
00321 int threeJA;
00322 int threeJB;
00323 int threeJC;
00324 int threeJD;
00325 int bj;
00326 int jets;
00327 int zerolept;
00328 int eTmisscut;
00329 
00330   };
00331 
00332 
00333 
00334   // The hook for the plugin system
00335   DECLARE_RIVET_PLUGIN(ATLAS_2011_CONF_2011_098);
00336 
00337 }