diff --git a/analyses/Makefile.am b/analyses/Makefile.am --- a/analyses/Makefile.am +++ b/analyses/Makefile.am @@ -1,51 +1,51 @@ AUTOMAKE_OPTIONS = -Wno-portability if ENABLE_ANALYSES PLUGIN_DIRS = $(shell ls -d $(srcdir)/plugin*) PLUGIN_NAMES = $(notdir $(subst plugin,,$(PLUGIN_DIRS))) PLUGIN_LIBS = $(patsubst %,Rivet%Analyses.so,$(PLUGIN_NAMES)) PLUGIN_DATAFILES = $(shell ls $(abs_srcdir)/plugin*/*.{info,plot,yoda}) CLEANFILES = $(PLUGIN_LIBS) EXTRA_DIST = $(PLUGIN_DIRS) %.so: @+echo && RIVET_BUILDPLUGIN_BEFORE_INSTALL=1 bash $(top_builddir)/bin/rivet-buildplugin -j2 $@ $^ -I$(top_builddir)/include RivetALICEAnalyses.so: $(shell ls $(srcdir)/pluginALICE/*.cc) RivetATLASAnalyses.so: $(shell ls $(srcdir)/pluginATLAS/*.cc) RivetCDFAnalyses.so : $(shell ls $(srcdir)/pluginCDF/*.cc) RivetCMSAnalyses.so : $(shell ls $(srcdir)/pluginCMS/*.cc) RivetD0Analyses.so : $(shell ls $(srcdir)/pluginD0/*.cc) RivetHERAAnalyses.so : $(shell ls $(srcdir)/pluginHERA/*.cc) RivetLEPAnalyses.so : $(shell ls $(srcdir)/pluginLEP/*.cc) RivetLHCbAnalyses.so : $(shell ls $(srcdir)/pluginLHCb/*.cc) -## RivetLHCfAnalyses.so : $(shell ls $(srcdir)/pluginLHCf/*.cc) +RivetLHCfAnalyses.so : $(shell ls $(srcdir)/pluginLHCf/*.cc) RivetMCAnalyses.so : $(shell ls $(srcdir)/pluginMC/*.cc) RivetMiscAnalyses.so : $(shell ls $(srcdir)/pluginMisc/*.cc) RivetPetraAnalyses.so: $(shell ls $(srcdir)/pluginPetra/*.cc) RivetRHICAnalyses.so : $(shell ls $(srcdir)/pluginRHIC/*.cc) RivetSPSAnalyses.so : $(shell ls $(srcdir)/pluginSPS/*.cc) RivetTOTEMAnalyses.so: $(shell ls $(srcdir)/pluginTOTEM/*.cc) all-local: $(PLUGIN_LIBS) $(PLUGIN_DATAFILES) mkdir -p $(builddir)/data $(LN_S) -f $(abs_srcdir)/plugin*/*.{info,plot,yoda} $(builddir)/data clean-local: rm -rf data install-exec-local: $(PLUGIN_LIBS) $(INSTALL) $^ $(DESTDIR)$(libdir) install-data-local: $(PLUGIN_DATAFILES) @echo "Installing analysis data files..." @$(install_sh_DATA) $^ $(DESTDIR)$(pkgdatadir) uninstall-local: cd $(DESTDIR)$(libdir) && rm -f $(PLUGIN_LIBS) @echo "Uninstalling analysis data files..." rm -f $(DESTDIR)$(pkgdatadir)/*.{info,plot,yoda} endif diff --git a/analyses/pluginATLAS/ATLAS_2010_S8817804.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2010_S8817804.cc rename from analyses/pluginATLAS/ATLAS_2010_S8817804.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2010_S8817804.cc --- a/analyses/pluginATLAS/ATLAS_2010_S8817804.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2010_S8817804.cc @@ -1,128 +1,128 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief ATLAS inclusive jet pT spectrum, di-jet Mass and di-jet chi class ATLAS_2010_S8817804: public Analysis { public: ATLAS_2010_S8817804() : Analysis("ATLAS_2010_S8817804") { } private: enum Alg { AKT4=0, AKT6=1 }; public: void init() { FinalState fs; declare(fs, "FinalState"); declare(FastJets(fs, FastJets::ANTIKT, 0.6), "AntiKT06"); declare(FastJets(fs, FastJets::ANTIKT, 0.4), "AntiKT04"); double ybins[] = { 0.0, 0.3, 0.8, 1.2, 2.1, 2.8 }; double massBinsForChi[] = { 340, 520, 800, 1200 }; size_t ptDsOffset(0), massDsOffset(10), chiDsOffset(20); for (size_t alg = 0; alg < 2; ++alg) { for (size_t i = 0; i < 5; ++i) { Histo1DPtr tmp; book(tmp, i + 1 + ptDsOffset, 1, 1); - _pThistos[alg].addHistogram(ybins[i], ybins[i+1], tmp); + _pThistos[alg].add(ybins[i], ybins[i+1], tmp); } ptDsOffset += 5; for (size_t i = 0; i < 5; ++i) { Histo1DPtr tmp; book(tmp, i + 1 + massDsOffset, 1, 1); - _massVsY[alg].addHistogram(ybins[i], ybins[i+1], tmp); + _massVsY[alg].add(ybins[i], ybins[i+1], tmp); } massDsOffset += 5; for (size_t i = 0; i < 3; ++i) { Histo1DPtr tmp; book(tmp, i + 1 + chiDsOffset, 1, 1); - _chiVsMass[alg].addHistogram(massBinsForChi[i], massBinsForChi[i+1], tmp); + _chiVsMass[alg].add(massBinsForChi[i], massBinsForChi[i+1], tmp); } chiDsOffset += 3; } } void analyze(const Event& evt) { Jets jetAr[2]; jetAr[AKT6] = apply(evt, "AntiKT06").jetsByPt(30*GeV); jetAr[AKT4] = apply(evt, "AntiKT04").jetsByPt(30*GeV); // Identify the dijets for (size_t alg = 0; alg < 2; ++alg) { vector leadjets; foreach (const Jet& jet, jetAr[alg]) { const double pT = jet.pT(); const double absy = jet.absrap(); _pThistos[alg].fill(absy, pT/GeV, 1.0); if (absy < 2.8 && leadjets.size() < 2) { if (leadjets.empty() && pT < 60*GeV) continue; leadjets.push_back(jet.momentum()); } } // Veto if no acceptable dijet found if (leadjets.size() < 2) { MSG_DEBUG("Could not find two suitable leading jets"); continue; } const double rap1 = leadjets[0].rapidity(); const double rap2 = leadjets[1].rapidity(); const double mass = (leadjets[0] + leadjets[1]).mass(); const double ymax = max(fabs(rap1), fabs(rap2)); const double chi = exp(fabs(rap1 - rap2)); if (fabs(rap1 + rap2) < 2.2) { _chiVsMass[alg].fill(mass/GeV, chi, 1.0); } _massVsY[alg].fill(ymax, mass/GeV, 1.0); } } void finalize() { for (size_t alg = 0; alg < 2; ++alg) { // factor 0.5 needed because it is differential in dy and not d|y| _pThistos[alg].scale(0.5*crossSectionPerEvent()/picobarn, this); _massVsY[alg].scale(crossSectionPerEvent()/picobarn, this); _chiVsMass[alg].scale(crossSectionPerEvent()/picobarn, this); } } private: /// The inclusive pT spectrum for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _pThistos[2]; + BinnedHistogram _pThistos[2]; /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _massVsY[2]; + BinnedHistogram _massVsY[2]; /// The di-jet chi distribution binned in mass for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _chiVsMass[2]; + BinnedHistogram _chiVsMass[2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2010_S8817804); } diff --git a/analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc rename from analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc --- a/analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_CONF_2011_090.cc @@ -1,336 +1,335 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2011_CONF_2011_090 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_CONF_2011_090() : Analysis("ATLAS_2011_CONF_2011_090") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT >= 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // veto region electrons (from 2010 arXiv:1102.2357v2) Cut vetocut = Cuts::absetaIn(1.37, 1.52); IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); /// Book histograms book(_count_mu_channel ,"count_muon_channel", 1, 0., 1.); book(_count_e_channel ,"count_electron_channel", 1, 0., 1.); book(_hist_eTmiss_e ,"Et_miss_e", 50, 0., 500.); book(_hist_eTmiss_mu ,"Et_miss_mu", 50, 0., 500.); book(_hist_m_eff_e ,"m_eff_e", 60, 0., 1500.); book(_hist_m_eff_mu ,"m_eff_mu", 60, 0., 1500.); book(_hist_m_eff_e_final ,"m_eff_e_final", 15, 0., 1500.); book(_hist_m_eff_mu_final ,"m_eff_mu_final", 15, 0., 1500.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } Jets cand_jets = apply(event, "AntiKtJets04").jetsByPt(Cuts::pT > 20*GeV && Cuts::abseta < 2.8); Particles candtemp_e = apply(event, "elecs").particlesByPt(); Particles candtemp_mu = apply(event,"muons").particlesByPt(); Particles chg_tracks = apply(event, "cfs").particles(); Particles cand_mu; Particles cand_e; // pTcone around muon track foreach ( const Particle& mu, candtemp_mu ) { double pTinCone = -mu.pT(); foreach ( const Particle& track, chg_tracks ) { if ( deltaR(mu, track) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // pTcone around electron foreach ( const Particle& e, candtemp_e ) { double pTinCone = -e.pT(); foreach ( const Particle& track, chg_tracks ) { if ( deltaR(e, track) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.10 * e.pT() ) cand_e.push_back(e); } // discard jets that overlap with electrons Jets cand_jets_2; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e, jet) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) cand_jets_2.push_back( jet ); } // only consider leptons far from jet Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool e_near_jet = false; foreach ( const Jet& jet, cand_jets_2 ) { if (inRange(deltaR(e, jet), 0.2, 0.4)) e_near_jet = true; } if ( ! e_near_jet ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool mu_near_jet = false; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(mu, jet) < 0.4 ) mu_near_jet = true; } if ( ! mu_near_jet ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // final jet filter Jets recon_jets; foreach ( const Jet& jet, cand_jets_2 ) { recon_jets.push_back( jet ); } // ==================== observables ==================== // Njets int Njets = 0; double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.abseta() < 2.8 ) Njets+=1; } if ( Njets < 3 ) { MSG_DEBUG("Only " << Njets << " jets w/ eta<2.8 left"); vetoEvent; } if ( recon_jets[0].pT() <= 60.0 * GeV ) { MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets"); vetoEvent; } for ( int i = 1; i < 3; ++i ) { if ( recon_jets[i].pT() <= 25*GeV ) { vetoEvent; } } for ( int i = 0; i < 3; ++i ) { double dPhi = deltaPhi( pTmiss_phi, recon_jets[i].phi() ); if ( dPhi <= 0.2 ) { MSG_DEBUG("dPhi too small"); vetoEvent; break; } } Particles lepton; if ( recon_mu.empty() && recon_e.empty() ) { MSG_DEBUG("No leptons"); vetoEvent; } else { foreach ( const Particle & mu, recon_mu ) lepton.push_back(mu); foreach ( const Particle & e, recon_e ) lepton.push_back(e); } std::sort(lepton.begin(), lepton.end(), cmpMomByPt); double e_id = 11; double mu_id = 13; // one hard leading lepton cut if ( lepton[0].abspid() == e_id && lepton[0].pT() <= 25*GeV ) { vetoEvent; } else if ( lepton[0].abspid() == mu_id && lepton[0].pT() <= 20*GeV ) { vetoEvent; } // exactly one hard leading lepton cut if(lepton.size()>1) { if ( lepton[1].abspid() == e_id && lepton[1].pT() > 20*GeV ) { vetoEvent; } else if ( lepton[1].abspid() == mu_id && lepton[1].pT() > 10*GeV ) { vetoEvent; } } // ==================== FILL ==================== FourMomentum pT_l = lepton[0].momentum(); double dPhi = deltaPhi( pT_l.phi(), pTmiss_phi); double mT = sqrt( 2 * pT_l.pT() * eTmiss * (1 - cos(dPhi)) ); // effective mass double m_eff = eTmiss + pT_l.pT() + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT(); // Electron channel signal region if ( lepton[0].abspid() == e_id ) { _hist_eTmiss_e->fill(eTmiss, weight); _hist_m_eff_e->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 125*GeV ) { _hist_m_eff_e_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.25*m_eff ) { _count_e_channel->fill(0.5,weight); } } } // Muon channel signal region else if ( lepton[0].abspid() == mu_id ) { _hist_eTmiss_mu->fill(eTmiss, weight); _hist_m_eff_mu->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 125*GeV ) { _hist_m_eff_mu_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.25*m_eff ) { _count_mu_channel->fill(0.5,weight); } } } } //@} void finalize() { scale( _hist_eTmiss_e , 10. * 165. * crossSection()/picobarn/sumOfWeights() ); scale( _hist_eTmiss_mu , 10. * 165. * crossSection()/picobarn/sumOfWeights() ); scale( _hist_m_eff_e , 25. * 165. * crossSection()/picobarn/sumOfWeights() ); scale( _hist_m_eff_mu , 25. * 165. * crossSection()/picobarn/sumOfWeights() ); scale( _hist_m_eff_e_final , 100. * 165. * crossSection()/picobarn/sumOfWeights() ); scale( _hist_m_eff_mu_final, 100. * 165. * crossSection()/picobarn/sumOfWeights() ); } private: /// @name Histograms //@{ Histo1DPtr _count_e_channel; Histo1DPtr _count_mu_channel; Histo1DPtr _hist_eTmiss_e; Histo1DPtr _hist_eTmiss_mu; Histo1DPtr _hist_m_eff_e; Histo1DPtr _hist_m_eff_mu; Histo1DPtr _hist_m_eff_e_final; Histo1DPtr _hist_m_eff_mu_final; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_CONF_2011_090); } diff --git a/analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc rename from analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc --- a/analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_CONF_2011_098.cc @@ -1,324 +1,323 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2011_CONF_2011_098 : public Analysis { public: /// Constructor ATLAS_2011_CONF_2011_098() : Analysis("ATLAS_2011_CONF_2011_098"), //debug variables threeJA(0), threeJB(0), threeJC(0), threeJD(0), bj(0), jets(0), zerolept(0), eTmisscut(0) { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); /// Jet finder declare(FastJets(FinalState(), FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0),"cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); /// Book histograms book(_count_threeJA ,"count_threeJA", 1, 0., 1.); book(_count_threeJB ,"count_threeJB", 1, 0., 1.); book(_count_threeJC ,"count_threeJC", 1, 0., 1.); book(_count_threeJD ,"count_threeJD", 1, 0., 1.); book(_hist_meff_1bjet ,"meff_1bjet", 32, 0., 1600.); book(_hist_eTmiss_1bjet ,"eTmiss_1bjet", 6, 0., 600.); book(_hist_pTj_1bjet ,"pTjet_1bjet", 20, 0., 800.); book(_hist_meff_2bjet ,"meff_2bjet", 32, 0., 1600.); book(_hist_eTmiss_2bjet ,"eTmiss_2bjet", 6, 0., 600.); book(_hist_pTj_2bjet ,"pTjet_2bjet", 20, 0., 800.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // Temp: calorimeter module failure with 10% acceptance loss; // region unknown ==> randomly choose 10% of events to be vetoed if ( rand()/static_cast(RAND_MAX) < 0.1 ) vetoEvent; Jets tmp_cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { tmp_cand_jets.push_back(jet); } } Particles cand_e = apply(event, "elecs").particlesByPt(); Particles cand_mu = apply(event, "muons").particlesByPt(); Particles chg_tracks = apply(event, "cfs").particles(); //cerr << "cand_e.size(): " << cand_e.size() << " cand_mu.size(): " << cand_mu.size() << '\n'; Jets cand_jets; foreach ( const Jet& jet, tmp_cand_jets ) { if ( fabs( jet.eta() ) >= 2.8 ) cand_jets.push_back( jet ); else { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) cand_jets.push_back( jet ); } } Particles cand_lept; bool isolated_e; foreach ( const Particle & e, cand_e ) { isolated_e = true; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) isolated_e = false; } if ( isolated_e == true ) cand_lept.push_back( e ); } bool isolated_mu; foreach ( const Particle & mu, cand_mu ) { isolated_mu = true; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) isolated_mu = false; } if ( isolated_mu == true) cand_lept.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // bjets Jets bjets,recon_jets; foreach (const Jet& j, cand_jets) { if(fabs( j.eta() ) <= 2.8) { recon_jets.push_back(j); if ( fabs( j.eta() ) <= 2.5 && j.perp()>50. && j.bTagged() && rand()/static_cast(RAND_MAX) < 0.5 ) bjets.push_back(j); } } if (bjets.empty()) { MSG_DEBUG("No b-jet axes in acceptance"); vetoEvent; } ++bj; // Jets event selection if ( recon_jets.size() < 3 ) vetoEvent; if ( recon_jets[0].pT() <= 130*GeV ) vetoEvent; if ( recon_jets[1].pT() <= 50*GeV || recon_jets[2].pT() <= 50*GeV ) vetoEvent; ++jets; // eTmiss cut if ( eTmiss <= 130*GeV ) vetoEvent; ++eTmisscut; // 0-lepton requirement if ( !cand_lept.empty() ) vetoEvent; ++zerolept; // m_eff cut double m_eff = eTmiss + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT(); if ( eTmiss / m_eff <= 0.25 ) vetoEvent; // min_dPhi double min_dPhi = 999.999; for ( int i = 0; i < 3; ++i ) { double dPhi = deltaPhi( pTmiss.phi(), recon_jets[i].phi() ); min_dPhi = min( min_dPhi, dPhi ); } if ( min_dPhi <= 0.4 ) vetoEvent; // ==================== FILL ==================== // 1 bjet if ( bjets.size() >= 1 ) { _hist_meff_1bjet->fill(m_eff, weight); _hist_eTmiss_1bjet->fill(eTmiss, weight); _hist_pTj_1bjet->fill(recon_jets[0].pT(), weight); // 3JA region if ( m_eff > 200*GeV ) { ++threeJA; _count_threeJA->fill(0.5, weight); } // 3JB region if ( m_eff > 700*GeV ) { ++threeJB; _count_threeJB->fill(0.5, weight); } } // 2 bjets if ( bjets.size() >= 2 ) { _hist_meff_2bjet->fill(m_eff, weight); _hist_eTmiss_2bjet->fill(eTmiss, weight); _hist_pTj_2bjet->fill(recon_jets[0].pT(), weight); // 3JC region if ( m_eff > 500*GeV ) { ++threeJC; _count_threeJC->fill(0.5, weight); } // 3JD region if ( m_eff > 700*GeV ) { ++threeJD; _count_threeJD->fill(0.5, weight); } } } //@} void finalize() { scale( _hist_meff_1bjet, 50. * 830. * crossSection()/sumOfWeights() ); scale( _hist_eTmiss_1bjet, 100. * 830. * crossSection()/sumOfWeights() ); scale( _hist_pTj_1bjet, 40. * 830. * crossSection()/sumOfWeights() ); scale( _hist_meff_2bjet, 50. * 830. * crossSection()/sumOfWeights() ); scale( _hist_eTmiss_2bjet, 100. * 830. * crossSection()/sumOfWeights() ); scale( _hist_pTj_2bjet, 40. * 830. * crossSection()/sumOfWeights() ); // cerr<< '\n'<<'\n' // << "Saw " // << bj << " events aft bjets cut, " // << jets << " events aft jet cuts, " // << eTmisscut << " events aft eTmiss cut, " // << zerolept << " events after 0-lept cut. " // << '\n' // << threeJA << " 3JA events, " // << threeJB << " 3JB events, " // << threeJC << " 3JC events, " // << threeJD << " 3JD events. " // << '\n' // ; } private: /// @name Histograms //@{ Histo1DPtr _count_threeJA; Histo1DPtr _count_threeJB; Histo1DPtr _count_threeJC; Histo1DPtr _count_threeJD; Histo1DPtr _hist_meff_1bjet; Histo1DPtr _hist_eTmiss_1bjet; Histo1DPtr _hist_pTj_1bjet; Histo1DPtr _hist_meff_2bjet; Histo1DPtr _hist_eTmiss_2bjet; Histo1DPtr _hist_pTj_2bjet; //@} // debug variables int threeJA; int threeJB; int threeJC; int threeJD; int bj; int jets; int zerolept; int eTmisscut; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_CONF_2011_098); } diff --git a/analyses/pluginATLAS/ATLAS_2011_I930220.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_I930220.cc rename from analyses/pluginATLAS/ATLAS_2011_I930220.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_I930220.cc --- a/analyses/pluginATLAS/ATLAS_2011_I930220.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_I930220.cc @@ -1,142 +1,142 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/HeavyHadrons.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// @brief ATLAS inclusive b-jet pT spectrum, di-jet mass and di-jet chi class ATLAS_2011_I930220: public Analysis { public: ATLAS_2011_I930220() : Analysis("ATLAS_2011_I930220") { } void init() { FinalState fs(-3.5, 3.5); declare(fs, "FinalState"); FastJets fj(fs, FastJets::ANTIKT, 0.4); fj.useInvisibles(); declare(fj, "Jets"); declare(HeavyHadrons(Cuts::abseta < 3.5 && Cuts::pT > 5*GeV), "BHadrons"); double ybins[] = { 0.0, 0.3, 0.8, 1.2, 2.1 }; for (size_t i = 0; i < 4; ++i) { Histo1DPtr tmp; - _bjetpT_SV0.addHistogram(ybins[i], ybins[i+1], book(tmp, i+1, 1, 1)); + _bjetpT_SV0.add(ybins[i], ybins[i+1], book(tmp, i+1, 1, 1)); } book(_bjetpT_SV0_All ,5, 1, 1); book(_bjetpT_pTRel ,6, 1, 1); book(_dijet_mass ,7, 1, 1); book(_dijet_phi ,8, 1, 1); book(_dijet_chi_110_370 ,9, 1, 1); book(_dijet_chi_370_850 ,10, 1, 1); _chiCounter1 = 0.0; _chiCounter2 = 0.0; _phiCounter = 0.0; } void analyze(const Event& evt) { const double weight = 1.0; const Particles& bHadrons = apply(evt, "BHadrons").bHadrons(); const Jets& jets = apply(evt, "Jets").jetsByPt(15*GeV); FourMomentum leadingJet, subleadingJet; int leadJet = 0, subJet = 0; foreach (const Jet& j, jets) { bool hasB = false; foreach (const Particle& b, bHadrons) if (deltaR(j, b) < 0.3) { hasB = true; break; } // Identify and classify the leading and subleading jets if (j.absrap() < 2.1) { ///< Move this into the jets defn if (!leadJet) { leadingJet = j.momentum(); leadJet = (hasB && j.pT() > 40*GeV) ? 2 : 1; } else if (leadJet && !subJet) { subleadingJet = j.momentum(); subJet = (hasB && j.pT() > 40*GeV) ? 2 : 1; } if (hasB) { _bjetpT_SV0.fill(j.absrap(), j.pT()/GeV, weight); _bjetpT_SV0_All->fill(j.pT()/GeV, weight); _bjetpT_pTRel->fill(j.pT()/GeV, weight); } } } // Di-b-jet plots require both the leading and subleading jets to be b-tagged and have pT > 40 GeV if (leadJet == 2 && subJet == 2) { const double mass = FourMomentum( leadingJet + subleadingJet ).mass(); _dijet_mass->fill(mass/GeV, weight); // Plot dphi for high-mass di-b-jets if (mass > 110*GeV) { _phiCounter += weight; const double d_phi = deltaPhi( leadingJet.phi(), subleadingJet.phi() ); _dijet_phi->fill(fabs(d_phi), weight); } // Plot chi for low y_boost di-b-jets (in two high-mass bins) const double y_boost = 0.5 * (leadingJet.rapidity() + subleadingJet.rapidity()); const double chi = exp( fabs( leadingJet.rapidity() - subleadingJet.rapidity() ) ); if ( fabs(y_boost) < 1.1 ) { if (inRange(mass/GeV, 110, 370)) { _chiCounter1 += weight; _dijet_chi_110_370->fill(chi, weight); } else if (inRange(mass/GeV, 370, 850)) { _chiCounter2 += weight; _dijet_chi_370_850->fill(chi, weight); } } } } void finalize() { // Normalizing to cross-section and mass // Additional factors represent the division by rapidity const double xsec = crossSectionPerEvent()/(picobarn); const double chiScale1 = 1 / _chiCounter1 / 260.0; const double chiScale2 = 1 / _chiCounter2 / 480.0; const double phiScale = 1 / _phiCounter; _bjetpT_SV0.scale(xsec/2, this); scale(_bjetpT_SV0_All, xsec); scale(_bjetpT_pTRel, xsec); scale(_dijet_mass, xsec); scale(_dijet_phi, phiScale ); scale(_dijet_chi_110_370, chiScale1); scale(_dijet_chi_370_850, chiScale2); } private: - BinnedHistogram _bjetpT_SV0; + BinnedHistogram _bjetpT_SV0; Histo1DPtr _bjetpT_SV0_All; Histo1DPtr _bjetpT_pTRel; Histo1DPtr _dijet_mass; Histo1DPtr _dijet_phi; Histo1DPtr _dijet_chi_110_370; Histo1DPtr _dijet_chi_370_850; double _chiCounter1; double _chiCounter2; double _phiCounter; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_I930220); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S8971293.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S8971293.cc rename from analyses/pluginATLAS/ATLAS_2011_S8971293.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S8971293.cc --- a/analyses/pluginATLAS/ATLAS_2011_S8971293.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S8971293.cc @@ -1,91 +1,91 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2011_S8971293 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_S8971293() : Analysis("ATLAS_2011_S8971293") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { /// Initialise and register projections declare(FastJets(FinalState(), FastJets::ANTIKT, 0.6), "AntiKtJets06"); /// Book histograms - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(110., 160., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(160., 210., book(tmp, 1, 1, 2));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(210., 260., book(tmp, 1, 1, 3));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(260., 310., book(tmp, 1, 1, 4));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(310., 400., book(tmp, 1, 1, 5));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(400., 500., book(tmp, 1, 1, 6));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(500., 600., book(tmp, 1, 1, 7));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(600., 800., book(tmp, 1, 1, 8));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(800.,10000.,book(tmp, 1, 1, 9));} + {Histo1DPtr tmp; _h_deltaPhi.add(110., 160., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add(160., 210., book(tmp, 1, 1, 2));} + {Histo1DPtr tmp; _h_deltaPhi.add(210., 260., book(tmp, 1, 1, 3));} + {Histo1DPtr tmp; _h_deltaPhi.add(260., 310., book(tmp, 1, 1, 4));} + {Histo1DPtr tmp; _h_deltaPhi.add(310., 400., book(tmp, 1, 1, 5));} + {Histo1DPtr tmp; _h_deltaPhi.add(400., 500., book(tmp, 1, 1, 6));} + {Histo1DPtr tmp; _h_deltaPhi.add(500., 600., book(tmp, 1, 1, 7));} + {Histo1DPtr tmp; _h_deltaPhi.add(600., 800., book(tmp, 1, 1, 8));} + {Histo1DPtr tmp; _h_deltaPhi.add(800.,10000.,book(tmp, 1, 1, 9));} } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets jets06; foreach (const Jet& jet, apply(event, "AntiKtJets06").jetsByPt(100.0*GeV)) { if (jet.absrap() < 2.8) { jets06.push_back(jet); } } if (jets06.size()>1){ if (fabs(jets06[0].rapidity())<0.8 && fabs(jets06[1].rapidity())<0.8) { double observable = mapAngle0ToPi(jets06[0].phi()-jets06[1].phi()) / M_PI; _h_deltaPhi.fill(jets06[0].pT(), observable, weight); } } } /// Normalise histograms etc., after the run void finalize() { foreach (Histo1DPtr hist, _h_deltaPhi.histos()) { normalize(hist, 1/M_PI); } } //@} private: /// @name Histograms //@{ - BinnedHistogram _h_deltaPhi; + BinnedHistogram _h_deltaPhi; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S8971293); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S8983313.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S8983313.cc rename from analyses/pluginATLAS/ATLAS_2011_S8983313.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S8983313.cc --- a/analyses/pluginATLAS/ATLAS_2011_S8983313.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S8983313.cc @@ -1,301 +1,300 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2011_S8983313 : public Analysis { public: /// Constructor ATLAS_2011_S8983313() : Analysis("ATLAS_2011_S8983313") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons Cut pt10 = Cuts::pT > 10.0*GeV; IdentifiedFinalState elecs(Cuts::abseta < 2.47 && pt10); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // veto region electrons Cut vetocut = Cuts::absetaIn(1.37, 1.52); IdentifiedFinalState veto_elecs(vetocut && pt10); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && pt10 ); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0),"cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); /// Book histograms book(_count_A ,"count_A", 1, 0., 1.); book(_count_B ,"count_B", 1, 0., 1.); book(_count_C ,"count_C", 1, 0., 1.); book(_count_D ,"count_D", 1, 0., 1.); book(_hist_meff_A ,"m_eff_A", 30, 0., 3000.); book(_hist_mT2_B ,"m_T2", 25, 0., 1000.); book(_hist_meff_CD ,"m_eff_C_D", 30, 0., 3000.); book(_hist_eTmiss ,"Et_miss", 20, 0., 1000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } Jets cand_jets = apply(event, "AntiKtJets04").jetsByPt(Cuts::pT > 20*GeV && Cuts::abseta < 4.9); Particles cand_e = apply(event, "elecs").particlesByPt(); Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu, track) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } Jets cand_jets_2; foreach (const Jet& jet, cand_jets) { if (jet.abseta() >= 2.5) cand_jets_2.push_back(jet); else { bool away_from_e = true; foreach (const Particle& e, cand_e) { if (deltaR(e, jet) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) cand_jets_2.push_back( jet ); } } Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(e, jet) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(mu, jet) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // final jet filter Jets recon_jets; foreach ( const Jet& jet, cand_jets_2 ) { if ( jet.abseta() <= 2.5 ) recon_jets.push_back( jet ); } // now only use recon_jets, recon_mu, recon_e if ( ! ( recon_mu.empty() && recon_e.empty() ) ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } if ( eTmiss <= 100*GeV ) { MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 100"); vetoEvent; } if ( recon_jets.empty() || recon_jets[0].pT() <= 120.0*GeV ) { MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets"); vetoEvent; } // ==================== observables ==================== // Njets, min_dPhi int Njets = 0; double min_dPhi = 999.999; double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 40 * GeV ) { if ( Njets < 3 ) min_dPhi = min( min_dPhi, deltaPhi( pTmiss_phi, jet.phi() ) ); ++Njets; } } if ( Njets < 2 ) { MSG_DEBUG("Only " << Njets << " >40 GeV jets left"); vetoEvent; } if ( min_dPhi <= 0.4 ) { MSG_DEBUG("dPhi too small"); vetoEvent; } // m_eff double m_eff_2j = eTmiss + recon_jets[0].pT() + recon_jets[1].pT(); double m_eff_3j = recon_jets.size() < 3 ? -999.0 : m_eff_2j + recon_jets[2].pT(); // etmiss / m_eff double et_meff_2j = eTmiss / m_eff_2j; double et_meff_3j = eTmiss / m_eff_3j; FourMomentum a = recon_jets[0].momentum(); FourMomentum b = recon_jets[1].momentum(); double m_T2 = mT2::mT2( a, b, pTmiss, 0.0 ); // zero mass invisibles // ==================== FILL ==================== MSG_DEBUG( "Trying to fill " << Njets << ' ' << m_eff_2j << ' ' << et_meff_2j << ' ' << m_eff_3j << ' ' << et_meff_3j << ' ' << m_T2 ); _hist_eTmiss->fill(eTmiss, weight); // AAAAAAAAAA if ( et_meff_2j > 0.3 ) { _hist_meff_A->fill(m_eff_2j, weight); if ( m_eff_2j > 500 * GeV ) { MSG_DEBUG("Hits A"); _count_A->fill(0.5, weight); } } // BBBBBBBBBB _hist_mT2_B->fill(m_T2, weight); if ( m_T2 > 300 * GeV ) { MSG_DEBUG("Hits B"); _count_B->fill(0.5, weight); } // need 3 jets for C and D if ( Njets >= 3 && et_meff_3j > 0.25 ) { _hist_meff_CD->fill(m_eff_3j, weight); // CCCCCCCCCC if ( m_eff_3j > 500 * GeV ) { MSG_DEBUG("Hits C"); _count_C->fill(0.5, weight); } // DDDDDDDDDD if ( m_eff_3j > 1000 * GeV ) { MSG_DEBUG("Hits D"); _count_D->fill(0.5, weight); } } } //@} void finalize() { double norm = crossSection()/picobarn*35.0/sumOfWeights(); scale(_hist_meff_A ,100.*norm); scale(_hist_mT2_B ,100.*norm); scale(_hist_meff_CD, 40.*norm); scale(_hist_eTmiss , 50.*norm); } private: /// @name Histograms //@{ Histo1DPtr _count_A; Histo1DPtr _count_B; Histo1DPtr _count_C; Histo1DPtr _count_D; Histo1DPtr _hist_meff_A; Histo1DPtr _hist_mT2_B; Histo1DPtr _hist_meff_CD; Histo1DPtr _hist_eTmiss; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S8983313); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9019561.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9019561.cc rename from analyses/pluginATLAS/ATLAS_2011_S9019561.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9019561.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9019561.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9019561.cc @@ -1,316 +1,315 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { class ATLAS_2011_S9019561 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_S9019561() : Analysis("ATLAS_2011_S9019561") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // veto region electrons Cut vetocut = Cuts::absetaIn(1.37, 1.52); IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 20*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); /// book histograms book(_count_OS_e_mu ,"count_OS_e+-mu-+", 1, 0., 1.); book(_count_OS_e_e ,"count_OS_e+e-", 1, 0., 1.); book(_count_OS_mu_mu ,"count_OS_mu+mu-", 1, 0., 1.); book(_count_SS_e_mu ,"count_SS_e+-mu+-", 1, 0., 1.); book(_count_SS_e_e ,"count_SS_e+-e+-", 1, 0., 1.); book(_count_SS_mu_mu ,"count_SS_mu+-mu+-", 1, 0., 1.); book(_hist_eTmiss_OS ,"Et_miss_OS", 20, 0., 400.); book(_hist_eTmiss_SS ,"Et_miss_SS", 20, 0., 400.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.5 ) { cand_jets.push_back(jet); } } Particles cand_e = apply(event, "elecs").particlesByPt(); // charged particle for isolation Particles chg_tracks = apply(event, "cfs").particles(); // apply muon isolation Particles cand_mu; // pTcone around muon track foreach ( const Particle & mu, apply(event,"muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // Discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // Leptons far from jet Particles recon_e; foreach ( const Particle & e, cand_e ) { bool e_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { e_near_jet = true; break; } } // Electron isolation criterion if ( ! e_near_jet ) { double EtinCone = -e.Et(); foreach ( const Particle & track, chg_tracks) { if ( deltaR(e.momentum(),track.momentum()) <= 0.2 ) EtinCone += track.Et(); } if ( EtinCone/e.pT() <= 0.15 ) recon_e.push_back( e ); } } Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { bool mu_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( ! mu_near_jet ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // Exactly two leptons for each event if ( recon_mu.size() + recon_e.size() != 2) vetoEvent; // Lepton pair mass FourMomentum p_leptons; foreach ( Particle e, recon_e ) { p_leptons += e.momentum(); } foreach ( Particle mu, recon_mu) { p_leptons += mu.momentum(); } if ( p_leptons.mass() <= 5.0 * GeV) vetoEvent; // ==================== FILL ==================== // electron, electron if (recon_e.size() == 2 ) { // SS ee if ( recon_e[0].pid() * recon_e[1].pid() > 0 ) { _hist_eTmiss_SS->fill(eTmiss, weight); if ( eTmiss > 100 ) { MSG_DEBUG("Hits SS e+/-e+/-"); _count_SS_e_e->fill(0.5, weight); } } // OS ee else if ( recon_e[0].pid() * recon_e[1].pid() < 0) { _hist_eTmiss_OS->fill(eTmiss, weight); if ( eTmiss > 150 ) { MSG_DEBUG("Hits OS e+e-"); _count_OS_e_e->fill(0.5, weight); } } } // muon, electron else if ( recon_e.size() == 1 ) { // SS mu_e if ( recon_e[0].pid() * recon_mu[0].pid() > 0 ) { _hist_eTmiss_SS->fill(eTmiss, weight); if ( eTmiss > 100 ) { MSG_DEBUG("Hits SS e+/-mu+/-"); _count_SS_e_mu->fill(0.5, weight); } } // OS mu_e else if ( recon_e[0].pid() * recon_mu[0].pid() < 0) { _hist_eTmiss_OS->fill(eTmiss, weight); if ( eTmiss > 150 ) { MSG_DEBUG("Hits OS e+mu-"); _count_OS_e_mu->fill(0.5, weight); } } } // muon, muon else if ( recon_mu.size() == 2 ) { // SS mu_mu if ( recon_mu[0].pid() * recon_mu[1].pid() > 0 ) { _hist_eTmiss_SS->fill(eTmiss, weight); if ( eTmiss > 100 ) { MSG_DEBUG("Hits SS mu+/-mu+/-"); _count_SS_mu_mu->fill(0.5, weight); } } // OS mu_mu else if ( recon_mu[0].pid() * recon_mu[1].pid() < 0) { _hist_eTmiss_OS->fill(eTmiss, weight); if ( eTmiss > 150 ) { MSG_DEBUG("Hits OS mu+mu-"); _count_OS_mu_mu->fill(0.5, weight); } } } } //@} void finalize() { double norm = crossSection()/picobarn*35./sumOfWeights(); // event counts scale(_count_OS_e_mu ,norm); scale(_count_OS_e_e ,norm); scale(_count_OS_mu_mu,norm); scale(_count_SS_e_mu ,norm); scale(_count_SS_e_e ,norm); scale(_count_SS_mu_mu,norm); scale(_hist_eTmiss_OS,10.*norm); scale(_hist_eTmiss_SS,10.*norm); } private: /// @name Histograms //@{ Histo1DPtr _count_OS_e_mu; Histo1DPtr _count_OS_e_e; Histo1DPtr _count_OS_mu_mu; Histo1DPtr _count_SS_e_mu; Histo1DPtr _count_SS_e_e; Histo1DPtr _count_SS_mu_mu; Histo1DPtr _hist_eTmiss_OS; Histo1DPtr _hist_eTmiss_SS; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9019561); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9041966.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9041966.cc rename from analyses/pluginATLAS/ATLAS_2011_S9041966.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9041966.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9041966.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9041966.cc @@ -1,664 +1,663 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// 1-lepton and 2-lepton search for first or second generation leptoquarks /// @todo Clean up the debug stuff class ATLAS_2011_S9041966 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_S9041966() : Analysis("ATLAS_2011_S9041966"), // DEBUG count(0), vetoe(0), Njetscut(0), //dilept(0), candmumujj(0), candeejj(0), //onelept(0), eTmisscut(0), candmvjj(0), candevjj(0), mumujj(0), eejj(0), mTonelept(0), MLQonelept(0), MtLQonelept(0), Stvonelept(0), mTev(0), MLQev(0), MtLQev(0), Stvev(0), muvjj(0), evjj(0), emuvjj(0), cande(0), candmu(0), tmpe(0), tmpmu(0), mumuZCR(0), eeZCR(0), munuW2CR(0), munuttCR(0), enuW2CR(0), enuttCR(0) { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // veto region electrons Cut vetocut = Cuts::absetaIn(1.35, 1.52); IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); ///DEBUG // projection to find all leptons IdentifiedFinalState all_mu_e; all_mu_e.acceptIdPair(PID::MUON); all_mu_e.acceptIdPair(PID::ELECTRON); declare(all_mu_e, "all_mu_e"); //debug // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 20*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairDetail(PID::MUON, 20*GeV, 7000*GeV); vfs.addVetoPairDetail(PID::ELECTRON, 20*GeV, 7000*GeV); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); /// Book histograms book(_count_mumujj ,"count_2muons_dijet", 1, 0., 1.); book(_count_eejj ,"count_2elecs_dijet", 1, 0., 1.); book(_count_muvjj ,"count_muon_neutrino_dijet", 1, 0., 1.); book(_count_evjj ,"count_elec_neutrino_dijet", 1, 0., 1.); book(_hist_St_mumu ,"hist_mumujj_St", 10, 450., 1650.); book(_hist_St_ee ,"hist_eejj_St", 10, 450., 1650.); book(_hist_MLQ_muv ,"hist_munujj_MLQ", 9, 150., 600.); book(_hist_MLQ_ev ,"hist_enujj_MLQ", 9, 150., 600.); book(_hist_St_mumu_ZCR ,"CR_Zjets_St_mumu", 40, 0., 800.); book(_hist_St_ee_ZCR ,"CR_Zjets_Stee", 40, 0., 800.); book(_hist_MLQ_munu_W2CR ,"CR_W2jets_MLQ_munu", 20, 0., 400.); book(_hist_MLQ_enu_W2CR ,"CR_W2jets_MLQ_enu", 20, 0., 400.); book(_hist_MLQ_munu_ttCR ,"CR_tt_MLQ_munu", 35, 0., 700.); book(_hist_MLQ_enu_ttCR ,"CR_tt_MLQ_enu", 35, 0., 700.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; ///DEBUG count +=1; //cerr<< "Event " << count << '\n'; // debug Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } ++vetoe; Jets cand_jets = apply(event, "AntiKtJets04").jetsByPt(Cuts::pT > 20*GeV && Cuts::abseta < 2.8); Particles candtemp_e = apply(event, "elecs").particlesByPt(); Particles candtemp_mu = apply(event,"muons").particlesByPt(); Particles cand_mu; Particles cand_e; Particles vfs_particles = apply(event, "vfs").particles(); // pTcone around muon track foreach ( const Particle & mu, candtemp_mu ) { ++tmpmu; double pTinCone = -mu.pT(); foreach ( const Particle & track, vfs_particles ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone/mu.pT() < 0.25 ) ++candmu; cand_mu.push_back(mu); } // pTcone around electron foreach ( const Particle e, candtemp_e ) { ++tmpe; double pTinCone = -e.pT(); foreach ( const Particle & track, vfs_particles ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone/e.pT() < 0.2 ) ++cande; cand_e.push_back(e); } if ( cand_e.empty() && cand_mu.empty() ) { //cerr<<" ->Event vetoed. No candidate lept"<<'\n'; vetoEvent; } //DEBUG // else{ // foreach (const Particle & mu, cand_mu) { // cerr << "cand mu: " << "Id " << mu.pid() << " eta " << mu.eta() << " pT " << mu.pT() << '\n'; // } // foreach (const Particle & lepton, cand_e) { // cerr << "cand e: " << "Id " << lepton.pid() << " eta " << lepton.eta() << " pT " << lepton.pT() << '\n'; // }} // debug // pTmiss FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // discard jets that overlap with leptons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_lept = true; foreach ( const Particle e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.5 ) { away_from_lept = false; break; } } foreach ( const Particle & mu, cand_mu ) { if ( deltaR(mu.momentum(),jet.momentum()) <= 0.5 ) { away_from_lept = false; break; } } if ( away_from_lept ) recon_jets.push_back( jet ); } //DEBUG // cerr << " Num of recon jets: " << recon_jets.size() << '\n'; // cerr << " Num of cand e: " << cand_e.size() << '\n'; // cerr << " Num of cand mu: " << cand_mu.size() << '\n'; //debug // ================ OBSERVABLES ================ // At least 2 hard jets if ( recon_jets.size() < 2 ) { //cerr << " ->Event vetoed. Not enough hard jets." << '\n'; vetoEvent; } ++Njetscut; // Initialize variables for observables double M_ll=0., M_LQ=0., St_ll=0., Mt_LQ=0., St_v=0., mT=0.; FourMomentum p_l, p_l1, p_l2, p_j[2]; p_j[0] = recon_jets[0].momentum(); p_j[1] = recon_jets[1].momentum(); Particles dilept_pair; bool single_lept = false; if ( cand_mu.size() == 2 && cand_e.empty() ) { ++candmumujj; foreach ( const Particle& mu, cand_mu ) dilept_pair.push_back(mu); } else if ( cand_e.size() == 2 && cand_mu.empty() ) { ++candeejj; foreach ( const Particle& e, cand_e ) dilept_pair.push_back(e); } else if ( cand_mu.size() == 1 && cand_e.empty() ) { ++candmvjj; p_l = cand_mu[0].momentum(); single_lept = true; } else if ( cand_e.size() == 1 && cand_mu.empty() ) { ++candevjj; p_l = cand_e[0].momentum(); single_lept = true; } // Dilepton channel observables if ( ! dilept_pair.empty() ) { double E_l1, E_l2, E_j1, E_j2; double tmpM_LQ1[2], tmpM_LQ2[2], M_LQDiff1, M_LQDiff2; p_l1 = dilept_pair[0].momentum(); p_l2 = dilept_pair[1].momentum(); E_l1 = p_l1.E(); E_l2 = p_l2.E(); E_j1 = p_j[0].E(); E_j2 = p_j[1].E(); // Calculate possible leptoquark mass M_LQ and reconstruct average M_LQ tmpM_LQ1[0] = E_l1 + E_j1; tmpM_LQ1[1] = E_l2 + E_j2; M_LQDiff1 = abs( tmpM_LQ1[0] - tmpM_LQ1[1] ); tmpM_LQ2[0] = E_l1 + E_j2; tmpM_LQ2[1] = E_l2 + E_j1; M_LQDiff2 = abs( tmpM_LQ2[0] - tmpM_LQ2[1] ); if ( M_LQDiff1 > M_LQDiff2 ) M_LQ = ( tmpM_LQ2[0] + tmpM_LQ2[1] ) / 2; else M_LQ = ( tmpM_LQ1[0] + tmpM_LQ1[1] ) / 2; // Calculate event transverse energy St St_ll = p_l1.pT() + p_l2.pT() + p_j[0].pT() + p_j[1].pT(); // Dilept pair invariant mass M_ll M_ll = E_l1 + E_l2; } // 1-lepton channel observables else if ( single_lept ) { double tmpM_LQ[2], tmpMt_LQ[2], dPhi_j[2], M_LQDiff1, M_LQDiff2; // List of possible M_LQ, Mt_LQ pairings for ( int i = 0; i < 2; ++i ) { tmpM_LQ[i] = p_l.E() + p_j[i].E(); dPhi_j[1-i] = deltaPhi( p_j[1-i].phi(), pTmiss.phi() ); tmpMt_LQ[i] = sqrt( 2 * p_j[1-i].pT() * eTmiss * (1 - cos( dPhi_j[1-i] )) ); } // Choose pairing that gives smallest absolute difference M_LQDiff1 = abs( tmpM_LQ[0] - tmpMt_LQ[0] ); M_LQDiff2 = abs( tmpM_LQ[1] - tmpMt_LQ[1] ); if ( M_LQDiff1 > M_LQDiff2 ) { M_LQ = tmpM_LQ[1]; Mt_LQ = tmpMt_LQ[1]; } else { M_LQ = tmpM_LQ[0]; Mt_LQ = tmpMt_LQ[0]; } // Event transverse energy St_v = p_l.pT() + eTmiss + p_j[0].pT() + p_j[1].pT(); // Transverse mass mT double dPhi_l = deltaPhi( p_l.phi(), pTmiss.phi()); mT = sqrt( 2 * p_l.pT() * eTmiss * (1 - cos(dPhi_l)) ); } // ============== CONTROL REGIONS =============== // mumujj, Z control region if ( cand_mu.size() == 2 ) { if ( M_ll >= 81*GeV && M_ll <= 101*GeV ) { ++mumuZCR; _hist_St_mumu_ZCR->fill(St_ll, weight); } } // eejj, Z control region else if ( cand_e.size() == 2 ) { if ( M_ll >= 81*GeV && M_ll <= 101*GeV ) { ++eeZCR; _hist_St_ee_ZCR->fill(St_ll, weight); } } if ( cand_mu.size() == 1 ) { // munujj, W+2jets control region if ( recon_jets.size() == 2 && mT >= 40*GeV && mT <= 150*GeV ) { ++munuW2CR; _hist_MLQ_munu_W2CR->fill(M_LQ, weight); } // munujj, tt control region if ( recon_jets.size() >= 4 && recon_jets[0].pT() > 50*GeV && recon_jets[1].pT() > 40*GeV && recon_jets[2].pT() > 30*GeV ) { ++munuttCR; _hist_MLQ_munu_ttCR->fill(M_LQ, weight); } } if ( cand_e.size() == 1 ) { // enujj, W+2jets control region if ( recon_jets.size() == 2 && mT >= 40*GeV && mT <= 150*GeV ) { ++enuW2CR; _hist_MLQ_enu_W2CR->fill(M_LQ, weight); } // enujj, tt control region if ( recon_jets.size() >= 4 && recon_jets[0].pT() > 50*GeV && recon_jets[1].pT() > 40*GeV && recon_jets[2].pT() > 30*GeV ) { ++enuttCR; _hist_MLQ_enu_ttCR->fill(M_LQ, weight); } } // ========= PRESELECTION ======================= // Single lepton channel cuts if ( single_lept ) { if ( eTmiss <= 25*GeV ) { //cerr << " ->Event vetoed. eTmiss=" << eTmiss << '\n'; vetoEvent; } ++eTmisscut; if ( mT <= 40*GeV ) vetoEvent; //++mTcut; // enujj channel if ( cand_e.size() == 1 && cand_mu.empty() ) { // Triangle cut double dPhi_jet1 = deltaPhi( recon_jets[0].phi(), pTmiss.phi() ); double dPhi_jet2 = deltaPhi( recon_jets[1].phi(), pTmiss.phi() ); if ( dPhi_jet1 <= 1.5 * (1 - eTmiss/45) || dPhi_jet2 <= 1.5 * (1 - eTmiss/45) ) { ++emuvjj; vetoEvent; } } } // ==================== FILL ==================== // mumujj channel if ( cand_mu.size() == 2 ) { if ( M_ll <= 120*GeV || M_LQ <= 150*GeV || p_l1.pT() <= 30*GeV || p_l2.pT() <= 30*GeV || p_j[0].pT() <= 30*GeV || p_j[1].pT() <= 30*GeV || St_ll <= 450*GeV ) { //cerr<<" ->Dilept event vetoed. Table 4 cuts." << '\n'; vetoEvent; } else { ++mumujj; // cerr<< " ->MUMUJJ event selected." << '\n'; _hist_St_mumu->fill(St_ll, weight); _count_mumujj->fill(0.5, weight); } } // eejj channel else if ( cand_e.size() == 2 ) { if ( M_ll <= 120*GeV || M_LQ <= 150*GeV || p_l1.pT() <= 30*GeV || p_l2.pT() <= 30*GeV || p_j[0].pT() <= 30*GeV || p_j[1].pT() <= 30*GeV || St_ll <= 450*GeV ) { //cerr<<" ->Dilept event vetoed. Table 4 cuts." << '\n'; vetoEvent; } else { ++eejj; //cerr<< " ->EEJJ event selected." << '\n'; _hist_St_ee->fill(St_ll, weight); _count_eejj->fill(0.5, weight); } } // muvjj channel else if ( cand_mu.size() == 1 ) { if (M_LQ<=150*GeV) { //cerr<<" ->muvjj event vetoed. Not enough M_LQ: " << M_LQ<< '\n'; vetoEvent; } ++MLQonelept; if (Mt_LQ<=150*GeV) { //cerr<<" ->muvjj event vetoed. Not enough Mt_LQ: " << Mt_LQ<< '\n'; vetoEvent; } ++MtLQonelept; if (St_v<=400*GeV) { //cerr<<" ->muvjj event vetoed. Not enough St_v: " << St_v<< '\n'; vetoEvent; } ++Stvonelept; if (mT<=160*GeV) { //cerr<<" ->muvjj event vetoed. Not enough mT: " << mT<<'\n'; vetoEvent; } ++mTonelept; //else { ++muvjj; //cerr<< " ->MUVJJ event selected." << '\n'; _hist_MLQ_muv->fill(M_LQ, weight); _count_muvjj->fill(0.5, weight); //} } // evjj channel else if ( cand_e.size() == 1 ) { if (M_LQ<=180*GeV) { //cerr<<" ->evjj event vetoed. Not enough M_LQ: " << M_LQ<< '\n'; vetoEvent; } ++MLQev; if (Mt_LQ<=180*GeV) { //cerr<<" ->evjj event vetoed. Not enough Mt_LQ: " << Mt_LQ<< '\n'; vetoEvent; } ++MtLQev; if (St_v<=410*GeV) { //cerr<<" ->evjj event vetoed. Not enough St_v: " << St_v<< '\n'; vetoEvent; } ++Stvev; if (mT<=200*GeV) { //cerr<<" ->evjj event vetoed. Not enough mT: " << mT<<'\n'; vetoEvent; } ++mTev; //else { ++evjj; //cerr<< " ->EVJJ event selected." << '\n'; _hist_MLQ_ev->fill(M_LQ, weight); _count_evjj->fill(0.5, weight); // if ( mT <= 200*GeV || // M_LQ <= 180*GeV || // Mt_LQ <= 180*GeV || // St_v <= 410*GeV ) { // cerr<<" ->evjj event vetoed. Doesn't pass table 4 cuts." << '\n'; // vetoEvent; // } // else { // ++evjj; // cerr<< " ->EVJJ event selected." << '\n'; // _hist_MLQ_ev->fill(M_LQ, weight); // _count_evjj->fill(0.5, weight); // } } } //@} void finalize() { // cerr << '\n' << "Of " << count << " events, saw " // << vetoe << " (after veto region cut), " // << Njetscut << " (after 2jet req). " // << '\n' // << "For " << dilept << " dilept events: " // << candmumujj << " cand mumujj events, " // << candeejj << " cand eejj events." // << '\n' // << "For " << onelept << " onelept events: " // << candmvjj << " preselected mvjj events, " // << candevjj << " preselected evjj events; " // << eTmisscut << " (eTmiss req); " // << emuvjj << " leftover; " // << MLQonelept << " (muvjj M_LQ cut), " // << MtLQonelept << " (muvjj Mt_LQ cut), " // << Stvonelept << " (muvjj St_v cut), " // << mTonelept << " (muvjj mT cut); " // << MLQev << " (evjj M_LQ cut), " // << MtLQev << " (evjj Mt_LQ cut), " // << Stvev << " (evjj St_v cut), " // << mTev << " (evjj mT cut). " // << '\n'<<'\n' // ; // cerr << "CR - " << "mumu Z: " << mumuZCR << " ee Z: " << eeZCR << " munu W+2jets: " << munuW2CR << " munu tt: " << munuttCR << " enu W+2jets: " << enuW2CR << " enu tt: " << enuttCR << '\n'; // cerr << "mumujj: " << mumujj << " eejj: " << eejj << " muvjj: " << muvjj << " evjj: " << evjj << '\n'; scale( _hist_St_ee, 120. * 35. * crossSection()/sumOfWeights() ); scale( _hist_St_mumu, 120. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_muv, 50. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_ev, 50. * 35. * crossSection()/sumOfWeights() ); scale( _hist_St_mumu_ZCR, 20. * 35. * crossSection()/sumOfWeights() ); scale( _hist_St_ee_ZCR, 20. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_munu_W2CR, 20. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_enu_W2CR, 20. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_munu_ttCR, 20. * 35. * crossSection()/sumOfWeights() ); scale( _hist_MLQ_enu_ttCR, 20. * 35. * crossSection()/sumOfWeights() ); /* scale( _hist_eTmiss_mu, binwidth*luminosity* crossSection()/sumOfWeights() ); */ } private: /// @name Histograms //@{ Histo1DPtr _count_mumujj; Histo1DPtr _count_eejj; Histo1DPtr _count_muvjj; Histo1DPtr _count_evjj; Histo1DPtr _hist_St_mumu; Histo1DPtr _hist_St_ee; Histo1DPtr _hist_MLQ_muv; Histo1DPtr _hist_MLQ_ev; Histo1DPtr _hist_St_mumu_ZCR; Histo1DPtr _hist_St_ee_ZCR; Histo1DPtr _hist_MLQ_munu_W2CR; Histo1DPtr _hist_MLQ_enu_W2CR; Histo1DPtr _hist_MLQ_munu_ttCR; Histo1DPtr _hist_MLQ_enu_ttCR; //@} // DEBUG VARIABLES int count; int vetoe; int Njetscut; //int dilept; int candmumujj; int candeejj; //int onelept; int eTmisscut; int candmvjj; int candevjj; int mumujj; int eejj; int mTonelept; int MLQonelept; int MtLQonelept; int Stvonelept; int mTev; int MLQev; int MtLQev; int Stvev; int muvjj; int evjj; int emuvjj; int cande; int candmu; int tmpe; int tmpmu; int mumuZCR; int eeZCR; int munuW2CR; int munuttCR; int enuW2CR; int enuttCR; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9041966); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9108483.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9108483.cc rename from analyses/pluginATLAS/ATLAS_2011_S9108483.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9108483.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9108483.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9108483.cc @@ -1,204 +1,203 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Math/Constants.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/NonHadronicFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { class ATLAS_2011_S9108483 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_S9108483() : Analysis("ATLAS_2011_S9108483") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // get the non-hadronic final-state particles double etaMax = 2.5; const NonHadronicFinalState nhfs(-etaMax,etaMax,13.*GeV); declare(nhfs,"NHFS"); // select the charged ones const ChargedFinalState cfs(nhfs); declare(cfs,"CFS"); // and then veto electrons, and taus to be safe VetoedFinalState vfs(cfs); vfs.addVetoPairId(PID::ELECTRON); declare(vfs,"VFS"); /// Book histograms book(_count_trigger ,"count_trigger" , 1, 0., 1.); book(_count_event ,"count_selection", 1, 0., 1.); book(_count_quality ,"count_quality" , 1, 0., 1.); book(_count_beta ,"count_beta" , 1, 0., 1.); book(_count_90 ,"count_90" , 1, 0., 1.); book(_count_110 ,"count_110", 1, 0., 1.); book(_count_120 ,"count_120", 1, 0., 1.); book(_count_130 ,"count_130", 1, 0., 1.); book(_hist_beta ,"beta",1000, 0., 2.); book(_hist_time ,"time",1000, -50, 50.); book(_hist_mass ,"mass", 60, 5., 305.); } double rndGauss(double sigma, double mean) { double r = sqrt(-2.0*log(rand()/static_cast(RAND_MAX))); double phi = rand()/static_cast(RAND_MAX)*2.0*pi; return mean+sigma*r*sin(phi); } /// Perform the per-event analysis void analyze(const Event& event) { // smearing parameters // time measurement (in ns) // const double tsmear=5.*0.7; const double tsmear=0.7; // sagita error const double csag =1.1E-4; // multiple scattering const double cms =2.0E-2; // muon chamber radius (in metres) const double radius = 10.e3; // convert to ns const double tr = radius/c_light; // event weight const double weight = 1.0; // get the charged final-state particles Particles charged = apply(event,"VFS").particles(); // need at least two candidates if(charged.size()<2) vetoEvent; // number passing trigger _count_trigger->fill(0.5,weight); // Z mass veto foreach ( const Particle & mu1,charged ) { foreach ( const Particle & mu2,charged ) { double mass = (mu1.momentum()+mu2.momentum()).mass(); double diff = abs(mass-91.18); if(diff<10.) vetoEvent; } } // number passing first event selection _count_event->fill(0.5,weight); // now find the candidates // loop over the particles and find muons and heavy charged particles map muonCandidates; foreach (const Particle& mu, charged) { // calculate the smeared momentum double pT = mu.pT2(); double pmag = sqrt(pT+sqr(mu.pz())); double deltap = sqrt( sqr(csag*sqr(pmag)) + sqr(cms*mu.E()/GeV)); double psmear = rndGauss(deltap,pmag); // keep particles with pT>40 if(psmear/pmag*mu.perp()<40.*GeV|| psmear/pmag*mu.perp()>1000.*GeV) continue; muonCandidates.insert(make_pair(psmear,mu)); } // require two candidates if(muonCandidates.size()<2) vetoEvent; // number passing "quality" cut _count_quality->fill(0.5,weight); // now do the time of flight bool filled = false; for(map::const_iterator it=muonCandidates.begin(); it!=muonCandidates.end();++it) { // true magnitude and pT of momentum double pT = it->second.pT2(); double pmag = sqrt(pT+sqr(it->second.pz())); pT = sqrt(pT); // true time difference in ns double deltaT =tr *(it->second.E()-pmag)/pT; // smear it deltaT = rndGauss(tsmear,deltaT); // beta double beta = 1./(1.+deltaT/tr*pT/pmag); _hist_beta->fill(beta, weight); _hist_time->fill(deltaT, weight); // beta cut if(beta<0.95) continue; // mass double mass = 2.*pT*it->first*deltaT/tr*(1.+0.5*deltaT/tr*pT/pmag); if(mass<0.) continue; mass = sqrt(mass); filled = true; _hist_mass->fill(mass,weight); if(mass>90. ) { _count_90 ->fill(0.5,weight); if(mass>110.) { _count_110->fill(0.5,weight); if(mass>120.) { _count_120->fill(0.5,weight); if(mass>130.) { _count_130->fill(0.5,weight); } } } } } if(!filled) vetoEvent; // number passing beta cut _count_beta->fill(0.5,weight); } //@} void finalize() { double fact = crossSection()/sumOfWeights()*37; MSG_WARNING("testing " << crossSection() << " " << sumOfWeights() << " " << fact); scale(_hist_beta,fact); scale(_hist_time,fact); scale(_hist_mass,fact); scale( _count_trigger, fact); scale( _count_event, fact); scale( _count_quality, fact); scale( _count_beta, fact); scale( _count_90, fact); scale( _count_110, fact); scale( _count_120, fact); scale( _count_130, fact); } private: /// @name Histograms //@{ Histo1DPtr _hist_beta; Histo1DPtr _hist_time; Histo1DPtr _hist_mass; Histo1DPtr _count_trigger; Histo1DPtr _count_event; Histo1DPtr _count_quality; Histo1DPtr _count_beta; Histo1DPtr _count_90; Histo1DPtr _count_110; Histo1DPtr _count_120; Histo1DPtr _count_130; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9108483); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9126244.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9126244.cc rename from analyses/pluginATLAS/ATLAS_2011_S9126244.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9126244.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9126244.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9126244.cc @@ -1,346 +1,346 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { struct ATLAS_2011_S9126244_Plots { int selectionType; ///< The HepData y-axis code string intermediateHistName; // Gap fraction vs DeltaY plot setup int _gapFractionDeltaYHistIndex; vector _gapFractionDeltaYSlices; - BinnedHistogram _h_gapVsDeltaYVeto; - BinnedHistogram _h_gapVsDeltaYInc; + BinnedHistogram _h_gapVsDeltaYVeto; + BinnedHistogram _h_gapVsDeltaYInc; // Gap fraction vs ptBar plot setup int _gapFractionPtBarHistIndex; vector _gapFractionPtBarSlices; - BinnedHistogram _h_gapVsPtBarVeto; - BinnedHistogram _h_gapVsPtBarInc; + BinnedHistogram _h_gapVsPtBarVeto; + BinnedHistogram _h_gapVsPtBarInc; // Gap fraction vs Q0 plot setup int _gapFractionQ0HistIndex; vector _gapFractionQ0SlicesPtBar; vector _gapFractionQ0SlicesDeltaY; vector _h_vetoPt; vector _d_vetoPtGapFraction; vector _vetoPtTotalSum; ///< @todo Can this just be replaced with _h_vetoPt.integral()? // Average njet vs DeltaY setup int _avgNJetDeltaYHistIndex; vector _avgNJetDeltaYSlices; vector _p_avgJetVsDeltaY; // Average njet vs PptBar setup int _avgNJetPtBarHistIndex; vector _avgNJetPtBarSlices; vector _p_avgJetVsPtBar; }; /// ATLAS dijet production with central jet veto /// @todo Make sure that temp histos are removed class ATLAS_2011_S9126244 : public Analysis { public: /// Constructor ATLAS_2011_S9126244() : Analysis("ATLAS_2011_S9126244") { } public: /// Book histograms and initialise projections before the run void init() { // Initialize the lone projection required declare(FastJets(FinalState(), FastJets::ANTIKT, 0.6), "AntiKtJets06"); // Initialize plots for each selection type _selectionPlots[0].intermediateHistName = "highestPt"; _selectionPlots[0].selectionType = 1; _selectionPlots[0]._gapFractionDeltaYHistIndex = 6; _selectionPlots[0]._gapFractionPtBarHistIndex = 1; _selectionPlots[0]._gapFractionQ0HistIndex = 13; _selectionPlots[0]._avgNJetDeltaYHistIndex = 37; _selectionPlots[0]._avgNJetPtBarHistIndex = 26; _selectionPlots[0]._gapFractionDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; _selectionPlots[0]._gapFractionPtBarSlices = {{ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 }}; _selectionPlots[0]._gapFractionQ0SlicesPtBar = {{ 70.0, 90.0, 120.0, 150.0, 210.0, 240.0 }}; _selectionPlots[0]._gapFractionQ0SlicesDeltaY = {{ 2.0, 3.0, 4.0, 5.0 }}; _selectionPlots[0]._avgNJetPtBarSlices = {{ 1.0, 2.0, 3.0, 4.0, 5.0 }}; _selectionPlots[0]._avgNJetDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; initializePlots(_selectionPlots[0]); _selectionPlots[1].intermediateHistName = "forwardBackward"; _selectionPlots[1].selectionType = 2; _selectionPlots[1]._gapFractionDeltaYHistIndex = 6; _selectionPlots[1]._gapFractionPtBarHistIndex = 1; _selectionPlots[1]._gapFractionQ0HistIndex = 13; _selectionPlots[1]._avgNJetDeltaYHistIndex = 37; _selectionPlots[1]._avgNJetPtBarHistIndex = 26; _selectionPlots[1]._gapFractionDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; _selectionPlots[1]._gapFractionPtBarSlices = {{ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 }}; _selectionPlots[1]._gapFractionQ0SlicesPtBar = {{ 70.0, 90.0, 120.0, 150.0, 210.0, 240.0 }}; _selectionPlots[1]._gapFractionQ0SlicesDeltaY = {{ 2.0, 3.0, 4.0, 5.0 }}; _selectionPlots[1]._avgNJetPtBarSlices = {{ 1.0, 2.0, 3.0, 4.0, 5.0 }}; _selectionPlots[1]._avgNJetDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; initializePlots(_selectionPlots[1]); _selectionPlots[2].intermediateHistName = "forwardBackward_PtBarVeto"; _selectionPlots[2].selectionType = 1; _selectionPlots[2]._gapFractionDeltaYHistIndex = 19; _selectionPlots[2]._avgNJetDeltaYHistIndex = 30; _selectionPlots[2]._gapFractionDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; _selectionPlots[2]._avgNJetDeltaYSlices = {{ 70.0, 90.0, 120.0, 150.0, 180.0, 210.0, 240.0, 270.0 }}; initializePlots(_selectionPlots[2]); } void initializePlots(ATLAS_2011_S9126244_Plots& plots) { // Gap fraction vs DeltaY if (!plots._gapFractionDeltaYSlices.empty()) { for (size_t x = 0; x < plots._gapFractionDeltaYSlices.size()-1; x++) { const string vetoHistName = "TMP/gapDeltaYVeto_" + plots.intermediateHistName + "_" + to_str(x); const string inclusiveHistName = "TMP/gapDeltaYInclusive_" + plots.intermediateHistName + "_" + to_str(x); Histo1DPtr tmp1, tmp2; - plots._h_gapVsDeltaYVeto.addHistogram(plots._gapFractionDeltaYSlices[x], plots._gapFractionDeltaYSlices[x+1], + plots._h_gapVsDeltaYVeto.add(plots._gapFractionDeltaYSlices[x], plots._gapFractionDeltaYSlices[x+1], book(tmp1,vetoHistName,refData(plots._gapFractionDeltaYHistIndex+x, 1,plots.selectionType))); - plots._h_gapVsDeltaYInc.addHistogram(plots._gapFractionDeltaYSlices[x], plots._gapFractionDeltaYSlices[x+1], + plots._h_gapVsDeltaYInc.add(plots._gapFractionDeltaYSlices[x], plots._gapFractionDeltaYSlices[x+1], book(tmp2,inclusiveHistName,refData(plots._gapFractionDeltaYHistIndex+x, 1, plots.selectionType))); } } // Average njet vs DeltaY if (!plots._avgNJetDeltaYSlices.empty()) { for (size_t x = 0; x < plots._avgNJetDeltaYSlices.size()-1; x++) { Profile1DPtr tmp; plots._p_avgJetVsDeltaY += book(tmp, plots._avgNJetDeltaYHistIndex+x, 1, plots.selectionType); } } // Gap fraction vs PtBar if (!plots._gapFractionPtBarSlices.empty()) { for (size_t x = 0; x < plots._gapFractionPtBarSlices.size()-1; x++) { const string vetoHistName = "TMP/gapPtBarVeto_" + plots.intermediateHistName + "_" + to_str(x); const string inclusiveHistName = "TMP/gapPtBarInclusive_" + plots.intermediateHistName + "_" + to_str(x); Histo1DPtr tmp1, tmp2; - plots._h_gapVsPtBarVeto.addHistogram(plots._gapFractionPtBarSlices[x], plots._gapFractionPtBarSlices[x+1], + plots._h_gapVsPtBarVeto.add(plots._gapFractionPtBarSlices[x], plots._gapFractionPtBarSlices[x+1], book(tmp1,vetoHistName,refData(plots._gapFractionPtBarHistIndex+x, 1, plots.selectionType))); - plots._h_gapVsPtBarInc.addHistogram(plots._gapFractionPtBarSlices[x], plots._gapFractionPtBarSlices[x+1], + plots._h_gapVsPtBarInc.add(plots._gapFractionPtBarSlices[x], plots._gapFractionPtBarSlices[x+1], book(tmp2,inclusiveHistName,refData(plots._gapFractionPtBarHistIndex+x, 1, plots.selectionType))); } } // Average njet vs PtBar if (!plots._avgNJetPtBarSlices.empty()) { for (size_t x=0; x acceptJets; foreach (const Jet& jet, apply(event, "AntiKtJets06").jetsByPt(20.0*GeV)) { if (jet.absrap() < 4.4) { acceptJets.push_back(jet.momentum()); } } // If we can't form an interval, drop out of the analysis early if (acceptJets.size() < 2) vetoEvent; // Analyze leading jet case if (acceptJets[0].pT() + acceptJets[1].pT() > 2*minimumJetPtBar) { analyzeJets(acceptJets, _selectionPlots[0], 1.0, 20.0*GeV); } // Find the most forward-backward jets size_t minRapidityJet = 0, maxRapidityJet = 0; for (size_t j = 1; j < acceptJets.size(); j++) { if (acceptJets[j].rapidity() > acceptJets[maxRapidityJet].rapidity()) maxRapidityJet = j; if (acceptJets[j].rapidity() < acceptJets[minRapidityJet].rapidity()) minRapidityJet = j; } // Make a container of jet momenta with the extreme f/b jets at the front vector fwdBkwdJets; fwdBkwdJets.push_back(acceptJets[maxRapidityJet]); fwdBkwdJets.push_back(acceptJets[minRapidityJet]); for (size_t j = 0; j < acceptJets.size(); j++) { if (j == minRapidityJet || j == maxRapidityJet) continue; fwdBkwdJets.push_back(acceptJets[j]); } if (fwdBkwdJets[0].pT() + fwdBkwdJets[1].pT() > 2*minimumJetPtBar) { // Use most forward/backward jets in rapidity to define the interval analyzeJets(fwdBkwdJets, _selectionPlots[1], 1.0, 20.0*GeV); // As before but now using PtBar of interval to define veto threshold analyzeJets(fwdBkwdJets, _selectionPlots[2], 1.0, (fwdBkwdJets[0].pT()+fwdBkwdJets[1].pT())/2.0); } } /// Fill plots! void analyzeJets(vector& jets, ATLAS_2011_S9126244_Plots& plots, const double weight, double vetoPtThreshold) { // Calculate the interval size, ptBar and veto Pt (if any) const double intervalSize = fabs(jets[0].rapidity()-jets[1].rapidity()); const double ptBar = (jets[0].pT()+jets[1].pT())/2.0; const double minY = min(jets[0].rapidity(), jets[1].rapidity()); const double maxY = max(jets[0].rapidity(), jets[1].rapidity()); double vetoPt = 0.0*GeV; for (size_t j = 2; j < jets.size(); j++) { if (inRange(jets[j].rapidity(), minY, maxY)) vetoPt = max(jets[j].pT(), vetoPt); } // Fill the gap fraction vs delta Y histograms plots._h_gapVsDeltaYInc.fill(ptBar/GeV, intervalSize, weight); if (vetoPt < vetoPtThreshold) { plots._h_gapVsDeltaYVeto.fill(ptBar/GeV, intervalSize, weight); } // Fill the gap fraction vs ptBar histograms plots._h_gapVsPtBarInc.fill(intervalSize, ptBar/GeV, weight); if (vetoPt < vetoPtThreshold) { plots._h_gapVsPtBarVeto.fill(intervalSize, ptBar/GeV, weight); } // Count the number of veto jets present int vetoJetsCount = 0; for (size_t j = 2; j < jets.size(); j++) { if (inRange(jets[j].rapidity(), minY, maxY) && jets[j].pT() > vetoPtThreshold) { vetoJetsCount += 1; } } // Fill the avg NJet, deltaY slices if (!plots._avgNJetPtBarSlices.empty()) { for (size_t i = 0; i < plots._avgNJetPtBarSlices.size()-1; i++) { if (inRange(intervalSize, plots._avgNJetPtBarSlices[i], plots._avgNJetPtBarSlices[i+1])) { plots._p_avgJetVsPtBar[i]->fill(ptBar/GeV, vetoJetsCount, weight); } } } // Fill the avg NJet, ptBar slices if (!plots._avgNJetDeltaYSlices.empty()) { for (size_t i = 0; i < plots._avgNJetDeltaYSlices.size()-1; i++) { if (inRange(ptBar/GeV, plots._avgNJetDeltaYSlices[i], plots._avgNJetDeltaYSlices[i+1])) { plots._p_avgJetVsDeltaY[i]->fill(intervalSize, vetoJetsCount, weight); } } } // Fill the veto pt plots int q0PlotCount = 0; for (size_t x = 0; x < plots._gapFractionQ0SlicesPtBar.size()/2; x++) { for (size_t y = 0; y < plots._gapFractionQ0SlicesDeltaY.size()/2; y++) { // Check if it should be filled if ( ptBar/GeV < plots._gapFractionQ0SlicesPtBar[x*2] || ptBar/GeV >= plots._gapFractionQ0SlicesPtBar[x*2+1] ) { q0PlotCount++; continue; } if ( intervalSize < plots._gapFractionQ0SlicesDeltaY[y*2] || intervalSize >= plots._gapFractionQ0SlicesDeltaY[y*2+1] ) { q0PlotCount++; continue; } plots._h_vetoPt[q0PlotCount]->fill(vetoPt, weight); plots._vetoPtTotalSum[q0PlotCount] += weight; q0PlotCount++; } } } /// Derive final distributions for each selection void finalize() { foreach (const ATLAS_2011_S9126244_Plots& plots, _selectionPlots) { /// @todo Clean up temp histos -- requires restructuring the temp histo struct for (size_t x = 0; x < plots._h_gapVsDeltaYVeto.histos().size(); x++) { Scatter2DPtr tmp; divide(plots._h_gapVsDeltaYVeto.histos()[x], plots._h_gapVsDeltaYInc.histos()[x], book(tmp, plots._gapFractionDeltaYHistIndex+x, 1, plots.selectionType)); } for (size_t x = 0; x < plots._h_gapVsPtBarVeto.histos().size(); x++) { Scatter2DPtr tmp; divide(plots._h_gapVsPtBarVeto.histos()[x], plots._h_gapVsPtBarInc.histos()[x], book(tmp, plots._gapFractionPtBarHistIndex+x, 1, plots.selectionType)); } for (size_t h = 0; h < plots._d_vetoPtGapFraction.size(); h++) { finalizeQ0GapFraction(plots._vetoPtTotalSum[h], plots._d_vetoPtGapFraction[h], plots._h_vetoPt[h]); } } } /// Convert the differential histograms to an integral histo and assign binomial errors as a efficiency /// @todo Should be convertible to a YODA ~one-liner using toIntegralEfficiencyHisto void finalizeQ0GapFraction(double totalWeightSum, Scatter2DPtr gapFractionDP, Histo1DPtr vetoPtHist) { for (size_t i = 0; i < vetoPtHist->numBins(); ++i) { const double vetoPtWeightSum = vetoPtHist->integral(i); ///< Integral (with underflow) up to but not including bin i // Calculate the efficiency & binomial uncertainty const double eff = (totalWeightSum != 0) ? vetoPtWeightSum/totalWeightSum : 0; const double effErr = (totalWeightSum != 0) ? sqrt( eff*(1.0-eff)/totalWeightSum ) : 0; // get the x coord and bin width const double x = vetoPtHist->bin(i).xMid(); const double xerr = 0.5*vetoPtHist->bin(i).xWidth(); gapFractionDP->addPoint(x, eff, xerr, effErr); } } private: // Struct containing the complete set of plots, times 3 for the different selections ATLAS_2011_S9126244_Plots _selectionPlots[3]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9126244); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9212183.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9212183.cc rename from analyses/pluginATLAS/ATLAS_2011_S9212183.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9212183.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9212183.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9212183.cc @@ -1,324 +1,323 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @author Chris Wymant class ATLAS_2011_S9212183 : public Analysis { public: /// Constructor ATLAS_2011_S9212183() : Analysis("ATLAS_2011_S9212183") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // Projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // Projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder declare(FastJets(FinalState(), FastJets::ANTIKT, 0.4), "AntiKtJets04"); // All tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0), "cfs"); // Used for pTmiss (N.B. the real 'vfs' extends beyond 4.5 to |eta| = 4.9) declare(VisibleFinalState(Cuts::abseta < 4.5), "vfs"); // Book histograms book(_count_2j ,"count_2j", 1, 0., 1.); book(_count_3j ,"count_3j", 1, 0., 1.); book(_count_4j5 ,"count_4j5", 1, 0., 1.); book(_count_4j10 ,"count_4j10", 1, 0., 1.); book(_count_HM ,"count_HM", 1, 0., 1.); book(_hist_meff_2j ,1, 1, 1); book(_hist_meff_3j ,2, 1, 1); book(_hist_meff_4j ,3, 1, 1); book(_hist_meff_HM ,4, 1, 1); book(_hist_eTmiss ,"Et_miss", 20, 0., 1000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets cand_jets; const Jets jets = apply(event, "AntiKtJets04").jetsByPt(20.0*GeV); foreach (const Jet& jet, jets) { if ( fabs( jet.eta() ) < 4.9 ) { cand_jets.push_back(jet); } } const Particles cand_e = apply(event, "elecs").particlesByPt(); // Muon isolation not mentioned in hep-exp 1109.6572, unlike in 1102.5290, // but assumed to still be applicable Particles cand_mu; const Particles chg_tracks = apply(event, "cfs").particles(); const Particles muons = apply(event, "muons").particlesByPt(); foreach (const Particle& mu, muons) { double pTinCone = -mu.pT(); foreach (const Particle& track, chg_tracks) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) { pTinCone += track.pT(); } } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // Resolve jet-lepton overlap for jets with |eta| < 2.8 Jets cand_jets_2; foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) >= 2.8 ) { cand_jets_2.push_back( jet ); } else { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) cand_jets_2.push_back( jet ); } } Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss // Based on all candidate electrons, muons and jets, plus everything else with |eta| < 4.5 // i.e. everything in our projection "vfs" plus the jets with |eta| > 4.5 Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } foreach ( const Jet& jet, cand_jets_2 ) { if ( fabs( jet.eta() ) > 4.5 ) pTmiss -= jet.momentum(); } double eTmiss = pTmiss.pT(); // Final jet filter Jets recon_jets; foreach ( const Jet& jet, cand_jets_2 ) { if ( fabs( jet.eta() ) <= 2.8 ) recon_jets.push_back( jet ); } // NB. It seems that jets with |eta| > 2.8 could have been thrown away at // the start; we don't do so, in order to follow both the structure of // the paper and the similar Rivet analysis ATLAS_2011_S8983313 // 'candidate' muons needed only 10 GeV, to cause a veto they need 20 GeV Particles veto_mu; foreach ( const Particle & mu, cand_mu ) { if ( mu.pT() >= 20.0*GeV ) veto_mu.push_back(mu); } if ( ! ( veto_mu.empty() && recon_e.empty() ) ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } if ( eTmiss <= 130 * GeV ) { MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 130"); vetoEvent; } if ( recon_jets.empty() || recon_jets[0].pT() <= 130.0 * GeV ) { MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets"); vetoEvent; } // ==================== observables ==================== int Njets = 0; double min_dPhi = 999.999; double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 40 * GeV ) { if ( Njets < 3 ) { min_dPhi = min( min_dPhi, deltaPhi( pTmiss_phi, jet.phi() ) ); } ++Njets; } } int NjetsHighMass = 0; foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 80.0 * GeV ) { ++NjetsHighMass; } } if ( Njets < 2 ) { MSG_DEBUG("Only " << Njets << " >40 GeV jets left"); vetoEvent; } if ( min_dPhi <= 0.4 ) { MSG_DEBUG("dPhi too small"); vetoEvent; } // m_eff double m_eff_2j = eTmiss + recon_jets[0].pT() + recon_jets[1].pT(); double m_eff_3j = recon_jets.size() < 3 ? -999.0 : m_eff_2j + recon_jets[2].pT(); double m_eff_4j = recon_jets.size() < 4 ? -999.0 : m_eff_3j + recon_jets[3].pT(); double m_eff_HM = eTmiss; foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 40.0 * GeV ) m_eff_HM += jet.pT(); } double et_meff_2j = eTmiss / m_eff_2j; double et_meff_3j = eTmiss / m_eff_3j; double et_meff_4j = eTmiss / m_eff_4j; double et_meff_HM = eTmiss / m_eff_HM; // ==================== FILL ==================== MSG_DEBUG( "Trying to fill " << Njets << ' ' << m_eff_2j << ' ' << et_meff_2j << ' ' << m_eff_3j << ' ' << et_meff_3j << ' ' << m_eff_4j << ' ' << et_meff_4j << ' ' << m_eff_HM << ' ' << et_meff_HM ); _hist_eTmiss->fill(eTmiss, weight); // 2j region if ( et_meff_2j > 0.3 ) { _hist_meff_2j->fill(m_eff_2j, weight); if ( m_eff_2j > 1000 * GeV ) { MSG_DEBUG("Hits 2j"); _count_2j->fill(0.5, weight); } } // 3j region if ( Njets >= 3 && et_meff_3j > 0.25 ) { _hist_meff_3j->fill(m_eff_3j, weight); if ( m_eff_3j > 1000 * GeV ) { MSG_DEBUG("Hits 3j"); _count_3j->fill(0.5, weight); } } // 4j5 & 4j10 regions if ( Njets >= 4 && et_meff_4j > 0.25 ) { _hist_meff_4j->fill(m_eff_4j, weight); if ( m_eff_4j > 500 * GeV ) { MSG_DEBUG("Hits 4j5"); _count_4j5->fill(0.5, weight); } if ( m_eff_4j > 1000 * GeV ) { MSG_DEBUG("Hits 4j10"); _count_4j10->fill(0.5, weight); } } // High mass region if ( NjetsHighMass >= 4 && et_meff_HM > 0.2 ) { _hist_meff_HM->fill(m_eff_HM, weight); if ( m_eff_HM > 1100 * GeV ) { MSG_DEBUG("Hits HM"); _count_HM->fill(0.5, weight); } } } void finalize() { // Two, three and four jet channels have bin width = 100 (GeV) // High mass channel has bin width = 150 (GeV) // Integrated luminosity = 1040 (pb) scale( _hist_meff_2j, 100. * 1040 * crossSection()/sumOfWeights() ); scale( _hist_meff_3j, 100. * 1040 * crossSection()/sumOfWeights() ); scale( _hist_meff_4j, 100. * 1040 * crossSection()/sumOfWeights() ); scale( _hist_meff_HM, 150. * 1040 * crossSection()/sumOfWeights() ); } //@} private: Histo1DPtr _count_2j; Histo1DPtr _count_3j; Histo1DPtr _count_4j5; Histo1DPtr _count_4j10; Histo1DPtr _count_HM; Histo1DPtr _hist_meff_2j; Histo1DPtr _hist_meff_3j; Histo1DPtr _hist_meff_4j; Histo1DPtr _hist_meff_HM; Histo1DPtr _hist_eTmiss; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9212183); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9212353.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9212353.cc rename from analyses/pluginATLAS/ATLAS_2011_S9212353.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9212353.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9212353.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9212353.cc @@ -1,502 +1,501 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2011_S9212353 : public Analysis { public: /// Constructor ATLAS_2011_S9212353() : Analysis("ATLAS_2011_S9212353") { } /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // veto region electrons (from 2010 arXiv:1102.2357v2) Cut vetocut = Cuts::absetaIn(1.37, 1.52); IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.5),"vfs"); /// Book histograms book(_3jl_count_mu_channel ,"3jl_count_muon_channel", 1, 0., 1.); book(_3jl_count_e_channel ,"3jl_count_electron_channel", 1, 0., 1.); book(_3jt_count_mu_channel ,"3jt_count_muon_channel", 1, 0., 1.); book(_3jt_count_e_channel ,"3jt_count_electron_channel", 1, 0., 1.); book(_3j_hist_eTmiss_e ,"3j_Et_miss_e", 65, 0., 650.); book(_3j_hist_eTmiss_mu ,"3j_Et_miss_mu", 65, 0., 650.); book(_3j_hist_mT_e ,"3j_mT_e", 58, 0., 580.); book(_3j_hist_mT_mu ,"3j_mT_mu", 58, 0., 580.); book(_3j_hist_m_eff_e ,"3j_m_eff_e", 46, 0., 2300.); book(_3j_hist_m_eff_mu ,"3j_m_eff_mu", 46, 0., 2300.); book(_3jl_hist_m_eff_e_final ,"3jl_m_eff_e_final", 15, 0., 1500.); book(_3jl_hist_m_eff_mu_final ,"3jl_m_eff_mu_final", 15, 0., 1500.); book(_3jt_hist_m_eff_e_final ,"3jt_m_eff_e_final", 15, 0., 1500.); book(_3jt_hist_m_eff_mu_final ,"3jt_m_eff_mu_final", 15, 0., 1500.); book(_4jl_count_mu_channel ,"4jl_count_muon_channel", 1, 0., 1.); book(_4jl_count_e_channel ,"4jl_count_electron_channel", 1, 0., 1.); book(_4jt_count_mu_channel ,"4jt_count_muon_channel", 1, 0., 1.); book(_4jt_count_e_channel ,"4jt_count_electron_channel", 1, 0., 1.); book(_4j_hist_eTmiss_e ,"4j_Et_miss_e", 65, 0., 650.); book(_4j_hist_eTmiss_mu ,"4j_Et_miss_mu", 65, 0., 650.); book(_4j_hist_mT_e ,"4j_mT_e", 58, 0., 580.); book(_4j_hist_mT_mu ,"4j_mT_mu", 58, 0., 580.); book(_4j_hist_m_eff_e ,"4j_m_eff_e", 46, 0., 2300.); book(_4j_hist_m_eff_mu ,"4j_m_eff_mu", 46, 0., 2300.); book(_4jl_hist_m_eff_e_final ,"4jl_m_eff_e_final", 15, 0., 1500.); book(_4jl_hist_m_eff_mu_final ,"4jl_m_eff_mu_final", 15, 0., 1500.); book(_4jt_hist_m_eff_e_final ,"4jt_m_eff_e_final", 15, 0., 1500.); book(_4jt_hist_m_eff_mu_final ,"4jt_m_eff_mu_final", 15, 0., 1500.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } Jets cand_jets; foreach ( const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } Particles candtemp_e = apply(event, "elecs").particlesByPt(); Particles candtemp_mu = apply(event,"muons").particlesByPt(); Particles chg_tracks = apply(event, "cfs").particles(); Particles cand_mu; Particles cand_e; // pTcone around muon track foreach ( const Particle & mu, candtemp_mu ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // pTcone around electron foreach ( const Particle e, candtemp_e ) { double pTinCone = -e.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1 * e.pT() ) cand_e.push_back(e); } // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // only consider leptons far from jet Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool e_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 && deltaR(e.momentum(),jet.momentum()) > 0.2 ) e_near_jet = true; } if ( ! e_near_jet ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool mu_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) mu_near_jet = true; } if ( ! mu_near_jet ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // ==================== observables ==================== // Njets int Njets = 0; double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.abseta() < 2.8 ) Njets+=1; } if ( Njets < 3 ) { MSG_DEBUG("Only " << Njets << " jets w/ eta<2.8 left"); vetoEvent; } Particles lepton; if ( recon_mu.empty() && recon_e.empty() ) { MSG_DEBUG("No leptons"); vetoEvent; } else { foreach ( const Particle & mu, recon_mu ) lepton.push_back(mu); foreach ( const Particle & e, recon_e ) lepton.push_back(e); } std::sort(lepton.begin(), lepton.end(), cmpMomByPt); double e_id = 11; double mu_id = 13; // one hard leading lepton cut if ( lepton[0].abspid() == e_id && lepton[0].pT() <= 25*GeV ) { vetoEvent; } else if ( lepton[0].abspid() == mu_id && lepton[0].pT() <= 20*GeV ) { vetoEvent; } // exactly one hard leading lepton cut if(lepton.size()>1) { if ( lepton[1].abspid() == e_id && lepton[1].pT() > 20*GeV ) { vetoEvent; } else if ( lepton[1].abspid() == mu_id && lepton[1].pT() > 10*GeV ) { vetoEvent; } } // 3JL if ( recon_jets[0].pT() > 60.0*GeV && recon_jets[1].pT() > 25.0*GeV && recon_jets[2].pT() > 25.0*GeV && deltaPhi( pTmiss_phi, recon_jets[0].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[1].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[2].phi() ) > 0.2 ) { FourMomentum pT_l = lepton[0].momentum(); double dPhi = deltaPhi( pT_l.phi(), pTmiss_phi); double mT = sqrt( 2 * pT_l.pT() * eTmiss * (1 - cos(dPhi)) ); double m_eff = eTmiss + pT_l.pT() + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT(); if ( lepton[0].abspid() == e_id ) { _3j_hist_mT_e->fill(mT, weight); _3j_hist_eTmiss_e->fill(eTmiss, weight); _3j_hist_m_eff_e->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 125*GeV ) { _3jl_hist_m_eff_e_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.25*m_eff ) { _3jl_count_e_channel->fill(0.5,weight); } } } else if ( lepton[0].abspid() == mu_id ) { _3j_hist_mT_mu->fill(mT, weight); _3j_hist_eTmiss_mu->fill(eTmiss, weight); _3j_hist_m_eff_mu->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 125*GeV ) { _3jl_hist_m_eff_mu_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.25*m_eff ) { _3jl_count_mu_channel->fill(0.5,weight); } } } } // 3JT if ( recon_jets[0].pT() > 80.0*GeV && recon_jets[1].pT() > 25.0*GeV && recon_jets[2].pT() > 25.0*GeV && deltaPhi( pTmiss_phi, recon_jets[0].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[1].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[2].phi() ) > 0.2 ) { FourMomentum pT_l = lepton[0].momentum(); double dPhi = deltaPhi( pT_l.phi(), pTmiss_phi); double mT = sqrt( 2 * pT_l.pT() * eTmiss * (1 - cos(dPhi)) ); double m_eff = eTmiss + pT_l.pT() + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT(); if ( lepton[0].abspid() == e_id ) { if ( mT > 100*GeV && eTmiss > 240*GeV ) { _3jt_hist_m_eff_e_final->fill(m_eff, weight); if ( m_eff > 600*GeV && eTmiss > 0.15*m_eff ) { _3jt_count_e_channel->fill(0.5,weight); } } } else if ( lepton[0].abspid() == mu_id ) { if ( mT > 100*GeV && eTmiss > 240*GeV ) { _3jt_hist_m_eff_mu_final->fill(m_eff, weight); if ( m_eff > 600*GeV && eTmiss > 0.15*m_eff ) { _3jt_count_mu_channel->fill(0.5,weight); } } } } if ( Njets < 4 ) { MSG_DEBUG("Only " << Njets << " jets w/ eta<2.8 left"); vetoEvent; } // 4JL if ( recon_jets[0].pT() > 60.0*GeV && recon_jets[1].pT() > 25.0*GeV && recon_jets[2].pT() > 25.0*GeV && recon_jets[3].pT() > 25.0*GeV && deltaPhi( pTmiss_phi, recon_jets[0].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[1].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[2].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[3].phi() ) > 0.2 ) { FourMomentum pT_l = lepton[0].momentum(); double dPhi = deltaPhi( pT_l.phi(), pTmiss_phi); double mT = sqrt( 2 * pT_l.pT() * eTmiss * (1 - cos(dPhi)) ); double m_eff = eTmiss + pT_l.pT() + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT() + recon_jets[3].pT(); if ( lepton[0].abspid() == e_id ) { _4j_hist_mT_e->fill(mT, weight); _4j_hist_eTmiss_e->fill(eTmiss, weight); _4j_hist_m_eff_e->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 140*GeV ) { _4jl_hist_m_eff_e_final->fill(m_eff, weight); if ( m_eff > 300*GeV && eTmiss > 0.3*m_eff ) { _4jl_count_e_channel->fill(0.5,weight); } } } // Muon channel signal region else if ( lepton[0].abspid() == mu_id ) { _4j_hist_mT_mu->fill(mT, weight); _4j_hist_eTmiss_mu->fill(eTmiss, weight); _4j_hist_m_eff_mu->fill(m_eff, weight); if ( mT > 100*GeV && eTmiss > 140*GeV ) { _4jl_hist_m_eff_mu_final->fill(m_eff, weight); if ( m_eff > 300*GeV && eTmiss > 0.3*m_eff ) { _4jl_count_mu_channel->fill(0.5,weight); } } } } // 4JT if ( recon_jets[0].pT() > 60.0*GeV && recon_jets[1].pT() > 40.0*GeV && recon_jets[2].pT() > 40.0*GeV && recon_jets[3].pT() > 40.0*GeV && deltaPhi( pTmiss_phi, recon_jets[0].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[1].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[2].phi() ) > 0.2 && deltaPhi( pTmiss_phi, recon_jets[3].phi() ) > 0.2 ) { FourMomentum pT_l = lepton[0].momentum(); double m_eff = eTmiss + pT_l.pT() + recon_jets[0].pT() + recon_jets[1].pT() + recon_jets[2].pT() + recon_jets[3].pT(); if ( lepton[0].abspid() == e_id ) { if ( eTmiss > 200*GeV ) { _4jt_hist_m_eff_e_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.15*m_eff ) { _4jt_count_e_channel->fill(0.5,weight); } } } // Muon channel signal region else if ( lepton[0].abspid() == mu_id ) { if ( eTmiss > 200*GeV ) { _4jt_hist_m_eff_mu_final->fill(m_eff, weight); if ( m_eff > 500*GeV && eTmiss > 0.15*m_eff ) { _4jt_count_mu_channel->fill(0.5,weight); } } } } } //@} void finalize() { scale( _3j_hist_eTmiss_e, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3j_hist_eTmiss_mu, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3j_hist_m_eff_e, 50. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3j_hist_m_eff_mu, 50. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3j_hist_mT_e, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3j_hist_mT_mu, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3jl_hist_m_eff_e_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3jl_hist_m_eff_mu_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3jt_hist_m_eff_e_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _3jt_hist_m_eff_mu_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_eTmiss_e, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_eTmiss_mu, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_m_eff_e, 50. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_m_eff_mu, 50. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_mT_e, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4j_hist_mT_mu, 10. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4jl_hist_m_eff_e_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4jl_hist_m_eff_mu_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4jt_hist_m_eff_e_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); scale( _4jt_hist_m_eff_mu_final, 100. * 1.04e3 * crossSection()/sumOfWeights() ); } private: /// @name Histograms //@{ Histo1DPtr _3jl_count_e_channel; Histo1DPtr _3jl_count_mu_channel; Histo1DPtr _3jt_count_e_channel; Histo1DPtr _3jt_count_mu_channel; Histo1DPtr _3j_hist_eTmiss_e; Histo1DPtr _3j_hist_eTmiss_mu; Histo1DPtr _3j_hist_m_eff_e; Histo1DPtr _3j_hist_m_eff_mu; Histo1DPtr _3j_hist_mT_e; Histo1DPtr _3j_hist_mT_mu; Histo1DPtr _3jl_hist_m_eff_e_final; Histo1DPtr _3jl_hist_m_eff_mu_final; Histo1DPtr _3jt_hist_m_eff_e_final; Histo1DPtr _3jt_hist_m_eff_mu_final; Histo1DPtr _4jl_count_e_channel; Histo1DPtr _4jl_count_mu_channel; Histo1DPtr _4jt_count_e_channel; Histo1DPtr _4jt_count_mu_channel; Histo1DPtr _4j_hist_eTmiss_e; Histo1DPtr _4j_hist_eTmiss_mu; Histo1DPtr _4j_hist_m_eff_e; Histo1DPtr _4j_hist_m_eff_mu; Histo1DPtr _4j_hist_mT_e; Histo1DPtr _4j_hist_mT_mu; Histo1DPtr _4jl_hist_m_eff_e_final; Histo1DPtr _4jl_hist_m_eff_mu_final; Histo1DPtr _4jt_hist_m_eff_e_final; Histo1DPtr _4jt_hist_m_eff_mu_final; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9212353); } diff --git a/analyses/pluginATLAS/ATLAS_2011_S9225137.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2011_S9225137.cc rename from analyses/pluginATLAS/ATLAS_2011_S9225137.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2011_S9225137.cc --- a/analyses/pluginATLAS/ATLAS_2011_S9225137.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2011_S9225137.cc @@ -1,432 +1,431 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2011_S9225137 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2011_S9225137() : Analysis("ATLAS_2011_S9225137") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // veto region electrons Cut vetocut = Cuts::absetaIn(1.37, 1.52); IdentifiedFinalState veto_elecs(vetocut && Cuts::pT > 10*GeV); veto_elecs.acceptIdPair(PID::ELECTRON); declare(veto_elecs, "veto_elecs"); // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3), "cfs"); /// Book histograms book(_etmisspT_55_NJ_6_obs , 1,1,1); book(_etmisspT_55_NJ_6_bac , 1,1,2); book(_etmisspT_55_NJ_6_sig , 1,1,3); book(_etmisspT_55_NJ_7_obs ,13,1,1); book(_etmisspT_55_NJ_7_bac ,13,1,2); book(_etmisspT_55_NJ_7_sig ,13,1,3); book(_etmisspT_55_NJ_8_obs ,15,1,1); book(_etmisspT_55_NJ_8_bac ,15,1,2); book(_etmisspT_55_NJ_8_sig ,15,1,3); book(_etmisspT_80_NJ_5_obs , 2,1,1); book(_etmisspT_80_NJ_5_bac , 2,1,2); book(_etmisspT_80_NJ_5_sig , 2,1,3); book(_etmisspT_80_NJ_6_obs ,14,1,1); book(_etmisspT_80_NJ_6_bac ,14,1,2); book(_etmisspT_80_NJ_6_sig ,14,1,3); book(_etmisspT_80_NJ_7_obs ,16,1,1); book(_etmisspT_80_NJ_7_bac ,16,1,2); book(_etmisspT_80_NJ_7_sig ,16,1,3); book(_njet55A_obs , 3,1,1); book(_njet55A_bac , 3,1,2); book(_njet55A_sig , 3,1,3); book(_njet55B_obs , 4,1,1); book(_njet55B_bac , 4,1,2); book(_njet55B_sig , 4,1,3); book(_njet55C_obs ,17,1,1); book(_njet55C_bac ,17,1,2); book(_njet55C_sig ,17,1,3); book(_njet80A_obs , 5,1,1); book(_njet80A_bac , 5,1,2); book(_njet80A_sig , 5,1,3); book(_njet80B_obs , 6,1,1); book(_njet80B_bac , 6,1,2); book(_njet80B_sig , 6,1,3); book(_njet80C_obs ,18,1,1); book(_njet80C_bac ,18,1,2); book(_njet80C_sig ,18,1,3); book(_count_7j55 ,"count_7j55", 1, 0., 1.); book(_count_8j55 ,"count_8j55", 1, 0., 1.); book(_count_6j80 ,"count_6j80", 1, 0., 1.); book(_count_7j80 ,"count_7j80", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // apply electron veto region Particles veto_e = apply(event, "veto_elecs").particles(); if ( ! veto_e.empty() ) { MSG_DEBUG("electrons in veto region"); vetoEvent; } // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 4.9 ) { cand_jets.push_back(jet); } } // candidate muons Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // candidate electrons Particles cand_e = apply(event, "elecs").particlesByPt(); // resolve jet/lepton ambiguity Jets cand_jets_2; foreach ( const Jet& jet, cand_jets ) { // candidates above eta=2.8 are jets if ( fabs( jet.eta() ) >= 2.8 ) cand_jets_2.push_back( jet ); // otherwise more the R=0.2 from an electrons else { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) cand_jets_2.push_back( jet ); } } // only keep electrons more than R=0.4 from jets Particles recon_e; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } // only keep muons more than R=0.4 from jets Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, cand_jets_2 ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // final jet filter Jets recon_jets; foreach (const Jet& jet, cand_jets_2) { if (jet.abseta() <= 2.8 ) recon_jets.push_back( jet ); } // now only use recon_jets, recon_mu, recon_e // reject events with electrons and muons if ( ! ( recon_mu.empty() && recon_e.empty() ) ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } // calculate H_T double HT = 0; foreach (const Jet& jet, recon_jets) { if (jet.pT() > 40*GeV) HT += jet.pT() ; } // number of jets and deltaR bool pass55DeltaR=true, pass80DeltaR=true; size_t njet55=0, njet80=0; for (size_t ix=0; ix < recon_jets.size(); ++ix) { if (recon_jets[ix].pT() > 80*GeV) ++njet80; if (recon_jets[ix].pT() > 55*GeV) ++njet55; for (size_t iy = ix + 1; iy < recon_jets.size(); ++iy) { if (recon_jets[ix].pT() > 55*GeV && recon_jets[iy].pT() > 55*GeV && deltaR(recon_jets[ix], recon_jets[iy]) < 0.6) pass55DeltaR = false; // if (recon_jets[ix].pT() > 80*GeV && // recon_jets[iy].pT() > 80*GeV && // deltaR(recon_jets[ix], recon_jets[iy]) < 0.6) // pass80DeltaR = false; } } // require at least four jets with et > 55 if (njet55 <= 3) vetoEvent; // plots of etmiss/ht double etht = eTmiss/sqrt(HT); if (njet55 == 6) { _etmisspT_55_NJ_6_obs->fill(etht,weight); _etmisspT_55_NJ_6_bac->fill(etht,weight); _etmisspT_55_NJ_6_sig->fill(etht,weight); } else if (njet55 == 7) { _etmisspT_55_NJ_7_obs->fill(etht,weight); _etmisspT_55_NJ_7_bac->fill(etht,weight); _etmisspT_55_NJ_7_sig->fill(etht,weight); } else if (njet55 == 8) { _etmisspT_55_NJ_8_obs->fill(etht,weight); _etmisspT_55_NJ_8_bac->fill(etht,weight); _etmisspT_55_NJ_8_sig->fill(etht,weight); } if (njet80 == 5) { _etmisspT_80_NJ_5_obs->fill(etht,weight); _etmisspT_80_NJ_5_bac->fill(etht,weight); _etmisspT_80_NJ_5_sig->fill(etht,weight); } else if (njet80 == 6) { _etmisspT_80_NJ_6_obs->fill(etht,weight); _etmisspT_80_NJ_6_bac->fill(etht,weight); _etmisspT_80_NJ_6_sig->fill(etht,weight); } else if (njet80 == 7) { _etmisspT_80_NJ_7_obs->fill(etht,weight); _etmisspT_80_NJ_7_bac->fill(etht,weight); _etmisspT_80_NJ_7_sig->fill(etht,weight); } if (etht > 1.5 && etht < 2.) { if (njet55 > 3) { _njet55A_obs->fill(njet55,weight); _njet55A_bac->fill(njet55,weight); _njet55A_sig->fill(njet55,weight); } if (njet80 > 3) { _njet80A_obs->fill(njet80,weight); _njet80A_bac->fill(njet80,weight); _njet80A_sig->fill(njet80,weight); } } else if (etht > 2. && etht < 3.) { if (njet55 > 3) { _njet55B_obs->fill(njet55,weight); _njet55B_bac->fill(njet55,weight); _njet55B_sig->fill(njet55,weight); } if (njet80 > 3) { _njet80B_obs->fill(njet80,weight); _njet80B_bac->fill(njet80,weight); _njet80B_sig->fill(njet80,weight); } } else { if (njet55 > 3) { _njet55C_obs->fill(njet55,weight); _njet55C_bac->fill(njet55,weight); _njet55C_sig->fill(njet55,weight); } if (njet80 > 3) { _njet80C_obs->fill(njet80,weight); _njet80C_bac->fill(njet80,weight); _njet80C_sig->fill(njet80,weight); } } // apply E_T/sqrt(H_T) cut if (etht <= 3.5*GeV) { MSG_DEBUG("Fails ET/sqrt(HT) cut "); vetoEvent; } // check passes at least one delta5/ njet number cut if (!(pass55DeltaR && njet55 >= 7) && !(pass80DeltaR && njet80 >= 6) ) { MSG_DEBUG("Fails DeltaR cut or jet number cuts"); vetoEvent; } // 7j55 if (njet55 >= 7 && pass55DeltaR) _count_7j55->fill( 0.5, weight); // 8j55 if (njet55 >= 8 && pass55DeltaR) _count_8j55->fill( 0.5, weight); // 6j80 if (njet80 >= 6 && pass80DeltaR) _count_6j80->fill( 0.5, weight); // 7j80 if (njet80 >= 7 && pass80DeltaR) _count_7j80->fill( 0.5, weight); } //@} void finalize() { const double norm = crossSection()/femtobarn*1.34/sumOfWeights(); scale(_etmisspT_55_NJ_6_obs,norm); scale(_etmisspT_55_NJ_6_bac,norm); scale(_etmisspT_55_NJ_6_sig,norm); scale(_etmisspT_55_NJ_7_obs,norm); scale(_etmisspT_55_NJ_7_bac,norm); scale(_etmisspT_55_NJ_7_sig,norm); scale(_etmisspT_55_NJ_8_obs,norm); scale(_etmisspT_55_NJ_8_bac,norm); scale(_etmisspT_55_NJ_8_sig,norm); scale(_etmisspT_80_NJ_5_obs,norm); scale(_etmisspT_80_NJ_5_bac,norm); scale(_etmisspT_80_NJ_5_sig,norm); scale(_etmisspT_80_NJ_6_obs,norm); scale(_etmisspT_80_NJ_6_bac,norm); scale(_etmisspT_80_NJ_6_sig,norm); scale(_etmisspT_80_NJ_7_obs,norm); scale(_etmisspT_80_NJ_7_bac,norm); scale(_etmisspT_80_NJ_7_sig,norm); scale(_njet55A_obs,norm); scale(_njet55A_bac,norm); scale(_njet55A_sig,norm); scale(_njet55B_obs,norm); scale(_njet55B_bac,norm); scale(_njet55B_sig,norm); scale(_njet55C_obs,norm); scale(_njet55C_bac,norm); scale(_njet55C_sig,norm); scale(_njet80A_obs,norm); scale(_njet80A_bac,norm); scale(_njet80A_sig,norm); scale(_njet80B_obs,norm); scale(_njet80B_bac,norm); scale(_njet80B_sig,norm); scale(_njet80C_obs,norm); scale(_njet80C_bac,norm); scale(_njet80C_sig,norm); scale(_count_7j55,norm); scale(_count_8j55,norm); scale(_count_6j80,norm); scale(_count_7j80,norm); } private: /// @name Histograms //@{ Histo1DPtr _etmisspT_55_NJ_6_obs; Histo1DPtr _etmisspT_55_NJ_6_bac; Histo1DPtr _etmisspT_55_NJ_6_sig; Histo1DPtr _etmisspT_55_NJ_7_obs; Histo1DPtr _etmisspT_55_NJ_7_bac; Histo1DPtr _etmisspT_55_NJ_7_sig; Histo1DPtr _etmisspT_55_NJ_8_obs; Histo1DPtr _etmisspT_55_NJ_8_bac; Histo1DPtr _etmisspT_55_NJ_8_sig; Histo1DPtr _etmisspT_80_NJ_5_obs; Histo1DPtr _etmisspT_80_NJ_5_bac; Histo1DPtr _etmisspT_80_NJ_5_sig; Histo1DPtr _etmisspT_80_NJ_6_obs; Histo1DPtr _etmisspT_80_NJ_6_bac; Histo1DPtr _etmisspT_80_NJ_6_sig; Histo1DPtr _etmisspT_80_NJ_7_obs; Histo1DPtr _etmisspT_80_NJ_7_bac; Histo1DPtr _etmisspT_80_NJ_7_sig; Histo1DPtr _njet55A_obs; Histo1DPtr _njet55A_bac; Histo1DPtr _njet55A_sig; Histo1DPtr _njet55B_obs; Histo1DPtr _njet55B_bac; Histo1DPtr _njet55B_sig; Histo1DPtr _njet55C_obs; Histo1DPtr _njet55C_bac; Histo1DPtr _njet55C_sig; Histo1DPtr _njet80A_obs; Histo1DPtr _njet80A_bac; Histo1DPtr _njet80A_sig; Histo1DPtr _njet80B_obs; Histo1DPtr _njet80B_bac; Histo1DPtr _njet80B_sig; Histo1DPtr _njet80C_obs; Histo1DPtr _njet80C_bac; Histo1DPtr _njet80C_sig; Histo1DPtr _count_7j55; Histo1DPtr _count_8j55; Histo1DPtr _count_6j80; Histo1DPtr _count_7j80; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2011_S9225137); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_001.cc @@ -1,395 +1,394 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_CONF_2012_001 : public Analysis { public: /// Constructor ATLAS_2012_CONF_2012_001() : Analysis("ATLAS_2012_CONF_2012_001") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0),"cfs"); // Book histograms {Histo1DPtr tmp; _hist_leptonpT.push_back(book(tmp,1,1,1));} {Histo1DPtr tmp; _hist_leptonpT.push_back(book(tmp,2,1,1));} {Histo1DPtr tmp; _hist_leptonpT.push_back(book(tmp,3,1,1));} {Histo1DPtr tmp; _hist_leptonpT.push_back(book(tmp,4,1,1));} book(_hist_njet ,5,1,1); book(_hist_etmiss ,6,1,1); book(_hist_mSFOS ,7,1,1); book(_hist_meff ,8,1,1); {Histo1DPtr tmp; _hist_leptonpT_MC.push_back(book(tmp, "hist_lepton_pT_1", 26, 0., 260));} {Histo1DPtr tmp; _hist_leptonpT_MC.push_back(book(tmp, "hist_lepton_pT_2", 15, 0., 150));} {Histo1DPtr tmp; _hist_leptonpT_MC.push_back(book(tmp, "hist_lepton_pT_3", 20, 0., 100));} {Histo1DPtr tmp; _hist_leptonpT_MC.push_back(book(tmp, "hist_lepton_pT_4", 20, 0., 100));} book(_hist_njet_MC ,"hist_njet", 7, -0.5, 6.5); book(_hist_etmiss_MC ,"hist_etmiss",11,0.,220.); book(_hist_mSFOS_MC ,"hist_m_SFOS",13,0.,260.); book(_hist_meff_MC ,"hist_m_eff",19,0.,950.); book(_count_SR1 ,"count_SR1", 1, 0., 1.); book(_count_SR2 ,"count_SR2", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // candidate muons Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // candidate electrons Particles cand_e; foreach ( const Particle & e, apply(event, "elecs").particlesByPt() ) { double eta = e.eta(); // remove electrons with pT<15 in old veto region if( fabs(eta)>1.37 && fabs(eta) < 1.52 && e.perp()< 15.*GeV) continue; double pTinCone = -e.perp(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if (pTinCone/e.perp()<0.1) { cand_e.push_back(e); } } // resolve jet/lepton ambiguity Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // only keep electrons more than R=0.4 from jets Particles cand2_e; for(unsigned int ie=0;ie0) continue; double mtest = (cand2_e[ie].momentum()+cand2_e[ie2].momentum()).mass(); if(mtest<=20.) { pass = false; break; } } if(pass) recon_e.push_back(cand2_e[ie]); } // only keep muons more than R=0.4 from jets Particles cand2_mu; for(unsigned int imu=0;imu0) continue; double mtest = (cand2_mu[imu].momentum()+cand2_mu[imu2].momentum()).mass(); if(mtest<=20.) { pass = false; break; } } if(pass) recon_mu.push_back(cand2_mu[imu]); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // now only use recon_jets, recon_mu, recon_e // reject events with less than 4 electrons and muons if ( recon_mu.size() + recon_e.size() < 4 ) { MSG_DEBUG("To few charged leptons left after selection"); vetoEvent; } // ATLAS calo problem if(rand()/static_cast(RAND_MAX)<=0.42) { foreach ( const Particle & e, recon_e ) { double eta = e.eta(); double phi = e.azimuthalAngle(MINUSPI_PLUSPI); if(eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5) vetoEvent; } foreach ( const Jet & jet, recon_jets ) { double eta = jet.rapidity(); double phi = jet.azimuthalAngle(MINUSPI_PLUSPI); if(jet.perp()>40 && eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5) vetoEvent; } } // check at least one e/mu passing trigger if( !( !recon_e .empty() && recon_e[0] .perp()>25.) && !( !recon_mu.empty() && recon_mu[0].perp()>20.) ) { MSG_DEBUG("Hardest lepton fails trigger"); vetoEvent; } // calculate meff double meff = eTmiss; foreach ( const Particle & e , recon_e ) meff += e.perp(); foreach ( const Particle & mu, recon_mu ) meff += mu.perp(); foreach ( const Jet & jet, recon_jets ) { double pT = jet.perp(); if(pT>40.) meff += pT; } double mSFOS=1e30, mdiff=1e30; // mass of SFOS pairs closest to the Z mass for(unsigned int ix=0;ix0) continue; double mtest = (recon_e[ix].momentum()+recon_e[iy].momentum()).mass(); if(fabs(mtest-90.)0) continue; double mtest = (recon_mu[ix].momentum()+recon_mu[iy].momentum()).mass(); if(fabs(mtest-91.118)pTmu) { _hist_leptonpT [ix]->fill(pTe ,weight); _hist_leptonpT_MC[ix]->fill(pTe ,weight); ++ie; } else { _hist_leptonpT [ix]->fill(pTmu,weight); _hist_leptonpT_MC[ix]->fill(pTmu,weight); ++imu; } } // njet _hist_njet ->fill(recon_jets.size(),weight); _hist_njet_MC->fill(recon_jets.size(),weight); // etmiss _hist_etmiss ->fill(eTmiss,weight); _hist_etmiss_MC->fill(eTmiss,weight); if(mSFOS<1e30) { _hist_mSFOS ->fill(mSFOS,weight); _hist_mSFOS_MC->fill(mSFOS,weight); } _hist_meff ->fill(meff,weight); _hist_meff_MC->fill(meff,weight); // finally the counts if(eTmiss>50.) { _count_SR1->fill(0.5,weight); if(mdiff>10.) _count_SR2->fill(0.5,weight); } } //@} void finalize() { double norm = crossSection()/femtobarn*2.06/sumOfWeights(); // these are number of events at 2.06fb^-1 per 10 GeV scale(_hist_leptonpT [0],norm*10.); scale(_hist_leptonpT [1],norm*10.); scale(_hist_leptonpT_MC[0],norm*10.); scale(_hist_leptonpT_MC[1],norm*10.); // these are number of events at 2.06fb^-1 per 5 GeV scale(_hist_leptonpT [2],norm*5.); scale(_hist_leptonpT [3],norm*5.); scale(_hist_leptonpT_MC[2],norm*5.); scale(_hist_leptonpT_MC[3],norm*5.); // these are number of events at 2.06fb^-1 per 20 GeV scale(_hist_etmiss ,norm*20.); scale(_hist_mSFOS ,norm*20.); scale(_hist_etmiss_MC ,norm*20.); scale(_hist_mSFOS_MC ,norm*20.); // these are number of events at 2.06fb^-1 per 50 GeV scale(_hist_meff ,norm*50.); scale(_hist_meff_MC ,norm*50.); // these are number of events at 2.06fb^-1 scale(_hist_njet ,norm); scale(_hist_njet_MC ,norm); scale(_count_SR1,norm); scale(_count_SR2,norm); } private: /// @name Histograms //@{ vector _hist_leptonpT,_hist_leptonpT_MC; Histo1DPtr _hist_njet; Histo1DPtr _hist_njet_MC; Histo1DPtr _hist_etmiss; Histo1DPtr _hist_etmiss_MC; Histo1DPtr _hist_mSFOS; Histo1DPtr _hist_mSFOS_MC; Histo1DPtr _hist_meff; Histo1DPtr _hist_meff_MC; Histo1DPtr _count_SR1; Histo1DPtr _count_SR2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_001); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_103.cc @@ -1,262 +1,261 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2012_CONF_2012_103 : public Analysis { public: /// Constructor ATLAS_2012_CONF_2012_103() : Analysis("ATLAS_2012_CONF_2012_103") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); /// Book histograms book(_etmiss_HT_7j55 ,"etmiss_HT_7j55", 8, 0., 16.); book(_etmiss_HT_8j55 ,"etmiss_HT_8j55", 8, 0., 16.); book(_etmiss_HT_9j55 ,"etmiss_HT_9j55", 8, 0., 16.); book(_etmiss_HT_6j80 ,"etmiss_HT_6j80", 8, 0., 16.); book(_etmiss_HT_7j80 ,"etmiss_HT_7j80", 8, 0., 16.); book(_etmiss_HT_8j80 ,"etmiss_HT_8j80", 8, 0., 16.); book(_hist_njet55 ,"hist_njet55", 4, 5.5, 9.5); book(_hist_njet80 ,"hist_njet80", 4, 4.5, 8.5); book(_count_7j55 ,"count_7j55", 1, 0., 1.); book(_count_8j55 ,"count_8j55", 1, 0., 1.); book(_count_9j55 ,"count_9j55", 1, 0., 1.); book(_count_6j80 ,"count_6j80", 1, 0., 1.); book(_count_7j80 ,"count_7j80", 1, 0., 1.); book(_count_8j80 ,"count_8j80", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // candidate muons Particles cand_mu = apply(event, "muons").particlesByPt(); // candidate electrons Particles cand_e = apply(event, "elecs").particlesByPt(); // resolve jet/lepton ambiguity Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { // candidates after |eta| < 2.8 if ( fabs( jet.eta() ) >= 2.8 ) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // only keep electrons more than R=0.4 from jets Particles recon_e; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } // only keep muons more than R=0.4 from jets Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // now only use recon_jets, recon_mu, recon_e // reject events with electrons and muons if ( ! ( recon_mu.empty() && recon_e.empty() ) ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } // calculate H_T double HT=0; foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 40 * GeV ) HT += jet.pT() ; } // number of jets unsigned int njet55=0, njet80=0; for (unsigned int ix=0;ix80.*GeV) ++njet80; if(recon_jets[ix].pT()>55.*GeV) ++njet55; } double ratio = eTmiss/sqrt(HT); if(ratio>4.) { if(njet55>9) njet55 = 9; if(njet80>8) njet80 = 8; _hist_njet55->fill(njet55,weight); _hist_njet80->fill(njet80,weight); // 7j55 if(njet55>=7) _count_7j55->fill( 0.5, weight); // 8j55 if(njet55>=8) _count_8j55->fill( 0.5, weight) ; // 8j55 if(njet55==9) _count_9j55->fill( 0.5, weight) ; // 6j80 if(njet80>=6) _count_6j80->fill( 0.5, weight) ; // 7j80 if(njet80>=7) _count_7j80->fill( 0.5, weight) ; // 8j80 if(njet80==8) _count_8j80->fill( 0.5, weight) ; } if(njet55>=7) _etmiss_HT_7j55->fill( ratio, weight); // 8j55 if(njet55>=8) _etmiss_HT_8j55->fill( ratio, weight) ; // 8j55 if(njet55>=9) _etmiss_HT_9j55->fill( ratio, weight) ; // 6j80 if(njet80>=6) _etmiss_HT_6j80->fill( ratio, weight) ; // 7j80 if(njet80>=7) _etmiss_HT_7j80->fill( ratio, weight) ; // 8j80 if(njet80>=8) _etmiss_HT_8j80->fill( ratio, weight) ; } //@} void finalize() { double norm = crossSection()/femtobarn*5.8/sumOfWeights(); scale(_etmiss_HT_7j55,2.*norm); scale(_etmiss_HT_8j55,2.*norm); scale(_etmiss_HT_9j55,2.*norm); scale(_etmiss_HT_6j80,2.*norm); scale(_etmiss_HT_7j80,2.*norm); scale(_etmiss_HT_8j80,2.*norm); scale(_hist_njet55,norm); scale(_hist_njet80,norm); scale(_count_7j55,norm); scale(_count_8j55,norm); scale(_count_9j55,norm); scale(_count_6j80,norm); scale(_count_7j80,norm); scale(_count_8j80,norm); } private: /// @name Histograms //@{ Histo1DPtr _etmiss_HT_7j55; Histo1DPtr _etmiss_HT_8j55; Histo1DPtr _etmiss_HT_9j55; Histo1DPtr _etmiss_HT_6j80; Histo1DPtr _etmiss_HT_7j80; Histo1DPtr _etmiss_HT_8j80; Histo1DPtr _hist_njet55; Histo1DPtr _hist_njet80; Histo1DPtr _count_7j55; Histo1DPtr _count_8j55; Histo1DPtr _count_9j55; Histo1DPtr _count_6j80; Histo1DPtr _count_7j80; Histo1DPtr _count_8j80; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_103); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_104.cc @@ -1,225 +1,224 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2012_CONF_2012_104 : public Analysis { public: /// Constructor ATLAS_2012_CONF_2012_104() : Analysis("ATLAS_2012_CONF_2012_104") { } /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); // Book histograms book(_count_e ,"count_e" , 1, 0., 1.); book(_count_mu ,"count_mu", 1, 0., 1.); book(_hist_eTmiss_e ,"hist_eTmiss_e" , 25, 0., 1000.); book(_hist_eTmiss_mu ,"hist_eTmiss_mu" , 25, 0., 1000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the candiate jets Jets cand_jets; foreach ( const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // get the candidate "medium" leptons without isolation Particles cand_e; foreach( const Particle & e, apply(event, "elecs").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool e_near_jet = false; foreach ( const Jet& jet, cand_jets ) { double dR = deltaR(e.momentum(),jet.momentum()); if ( dR < 0.4 && dR > 0.2 ) { e_near_jet = true; break; } } if ( ! e_near_jet ) cand_e.push_back(e); } Particles cand_mu; foreach( const Particle & mu, apply(event, "muons").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool mu_near_jet = false; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( ! mu_near_jet ) cand_mu.push_back(mu); } // apply the isolation Particles chg_tracks = apply(event, "cfs").particles(); // pTcone around muon track (hard) Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { double pTinCone = -mu.pT(); if(-pTinCone<25.) continue; foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_mu.push_back(mu); } // pTcone around electron track (hard) Particles recon_e; foreach ( const Particle & e, cand_e ) { double pTinCone = -e.pT(); if(-pTinCone<25.) continue; foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1 * e.pT() ) recon_e.push_back(e); } // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if(jet.abseta()>2.5|| jet.perp()<25.) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // pTmiss FourMomentum pTmiss; foreach ( const Particle & p, apply(event, "vfs").particles() ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // at least 4 jets with pT>80. if(recon_jets.size()<4 || recon_jets[3].perp()<80.) vetoEvent; // only 1 signal lepton if( recon_e.size() + recon_mu.size() != 1 ) vetoEvent; if( cand_e .size() + cand_mu .size() != 1 ) vetoEvent; // start of meff calculation double HT=0.; foreach( const Jet & jet, recon_jets) { double pT = jet.perp(); if(pT>40.) HT += pT; } // get the lepton Particle lepton = recon_e.empty() ? recon_mu[0] : recon_e[0]; // lepton variables double pT = lepton.perp(); double mT = 2.*(pT*eTmiss - lepton.px()*pTmiss.px() - lepton.py()*pTmiss.py()); mT = sqrt(mT); HT += pT; double m_eff_inc = HT + eTmiss + pT; double m_eff_4 = eTmiss + pT; for(unsigned int ix=0;ix<4;++ix) m_eff_4 += recon_jets[ix].perp(); // four jet selecton if(mT>100.&& eTmiss/m_eff_4>0.2 && m_eff_inc > 800.) { if( eTmiss > 250. ) { if(lepton.abspid()==PID::ELECTRON) _count_e->fill(0.5,weight); else if(lepton.abspid()==PID::MUON) _count_mu->fill(0.5,weight); } if(lepton.abspid()==PID::ELECTRON) _hist_eTmiss_e ->fill(eTmiss,weight); else if(lepton.abspid()==PID::MUON) _hist_eTmiss_mu->fill(eTmiss,weight); } } //@} void finalize() { double norm = 5.8* crossSection()/sumOfWeights()/femtobarn; scale(_count_e ,norm); scale(_count_mu,norm); scale(_hist_eTmiss_e ,40.*norm); scale(_hist_eTmiss_mu ,40.*norm); } private: /// @name Histograms //@{ Histo1DPtr _count_e ; Histo1DPtr _count_mu; Histo1DPtr _hist_eTmiss_e ; Histo1DPtr _hist_eTmiss_mu; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_104); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_105.cc @@ -1,223 +1,222 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { class ATLAS_2012_CONF_2012_105 : public Analysis { public: /// Constructor ATLAS_2012_CONF_2012_105() : Analysis("ATLAS_2012_CONF_2012_105") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 20*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.5), "vfs"); // book histograms // counts in signal regions book(_count_ee ,"count_ee" , 1, 0., 1.); book(_count_emu ,"count_emu" , 1, 0., 1.); book(_count_mumu ,"count_mumu", 1, 0., 1.); book(_count_ll ,"count_ll" , 1, 0., 1.); // histograms from paper book(_hist_eTmiss_ee ,"eTmiss_ee" , 8, 0., 400.); book(_hist_eTmiss_emu ,"eTmiss_emu" , 8, 0., 400.); book(_hist_eTmiss_mumu ,"eTmiss_mumu", 8, 0., 400.); book(_hist_eTmiss_ll ,"eTmiss_ll" , 8, 0., 400.); } /// Perform the event analysis void analyze(const Event& event) { // event weight const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // electron candidates Particles cand_e = apply(event, "elecs").particlesByPt(); // Discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // get the charged tracks for isolation Particles chg_tracks = apply(event, "cfs").particles(); // Reconstructed electrons Particles recon_leptons; foreach ( const Particle & e, cand_e ) { // check not near a jet bool e_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { e_near_jet = true; break; } } if ( e_near_jet ) continue; // check the isolation double pTinCone = -e.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1*e.perp() ) recon_leptons.push_back(e); } // Reconstructed Muons Particles cand_mu = apply(event,"muons").particlesByPt(); foreach ( const Particle & mu, cand_mu ) { // check not near a jet bool mu_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( mu_near_jet ) continue; // isolation double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_leptons.push_back(mu); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // Exactly two leptons for each event if ( recon_leptons.size() != 2) vetoEvent; // ensure 1st hardest if(recon_leptons[0].perp()50 if(recon_jets.size()<4||recon_jets[3].perp()<50.) vetoEvent; if(recon_leptons[0].pid()!=recon_leptons[1].pid()) _hist_eTmiss_emu ->fill(eTmiss,weight); else if(recon_leptons[0].abspid()==PID::ELECTRON) _hist_eTmiss_ee ->fill(eTmiss,weight); else if(recon_leptons[0].abspid()==PID::MUON) _hist_eTmiss_mumu->fill(eTmiss,weight); _hist_eTmiss_ll->fill(eTmiss,weight); if(eTmiss>150.) { if(recon_leptons[0].pid()!=recon_leptons[1].pid()) _count_emu ->fill(0.5,weight); else if(recon_leptons[0].abspid()==PID::ELECTRON) _count_ee ->fill(0.5,weight); else if(recon_leptons[0].abspid()==PID::MUON) _count_mumu->fill(0.5,weight); _count_ll->fill(0.5,weight); } } //@} void finalize() { double norm = crossSection()/femtobarn*5.8/sumOfWeights(); // event counts scale(_count_ee ,norm); scale(_count_emu ,norm); scale(_count_mumu,norm); scale(_count_ll ,norm); // histograms scale(_hist_eTmiss_ee ,norm*50.); scale(_hist_eTmiss_emu ,norm*50.); scale(_hist_eTmiss_mumu,norm*50.); scale(_hist_eTmiss_ll ,norm*50.); } private: /// @name Histograms //@{ Histo1DPtr _count_ee ; Histo1DPtr _count_emu ; Histo1DPtr _count_mumu; Histo1DPtr _count_ll ; Histo1DPtr _hist_eTmiss_ee; Histo1DPtr _hist_eTmiss_emu; Histo1DPtr _hist_eTmiss_mumu; Histo1DPtr _hist_eTmiss_ll; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_105); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_109.cc @@ -1,363 +1,362 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_CONF_2012_109 : public Analysis { public: /// Constructor ATLAS_2012_CONF_2012_109() : Analysis("ATLAS_2012_CONF_2012_109") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // Projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // Projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // All tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0), "cfs"); // Used for pTmiss (N.B. the real 'vfs' extends beyond 4.5 to |eta| = 4.9) declare(VisibleFinalState(Cuts::abseta < 4.5), "vfs"); // Book histograms book(_count_A_tight ,"count_A_tight" , 1, 0., 1.); book(_count_A_medium ,"count_A_medium" , 1, 0., 1.); book(_count_A_loose ,"count_A_loose" , 1, 0., 1.); book(_count_B_tight ,"count_B_tight" , 1, 0., 1.); book(_count_B_medium ,"count_B_medium" , 1, 0., 1.); book(_count_C_tight ,"count_C_tight" , 1, 0., 1.); book(_count_C_medium ,"count_C_medium" , 1, 0., 1.); book(_count_C_loose ,"count_C_loose" , 1, 0., 1.); book(_count_D_tight ,"count_D_tight" , 1, 0., 1.); book(_count_E_tight ,"count_E_tight" , 1, 0., 1.); book(_count_E_medium ,"count_E_medium" , 1, 0., 1.); book(_count_E_loose ,"count_E_loose" , 1, 0., 1.); book(_hist_meff_A_medium ,"meff_A_medium" , 40, 0., 4000.); book(_hist_meff_A_tight ,"meff_A_tight" , 40, 0., 4000.); book(_hist_meff_B_medium ,"meff_B_medium" , 40, 0., 4000.); book(_hist_meff_B_tight ,"meff_B_tight" , 40, 0., 4000.); book(_hist_meff_C_medium ,"meff_C_medium" , 40, 0., 4000.); book(_hist_meff_C_tight ,"meff_C_tight" , 40, 0., 4000.); book(_hist_meff_D ,"meff_D" , 40, 0., 4000.); book(_hist_meff_E_loose ,"meff_E_loose" , 40, 0., 4000.); book(_hist_meff_E_medium ,"meff_E_medium" , 40, 0., 4000.); book(_hist_meff_E_tight ,"meff_E_tight" , 40, 0., 4000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets cand_jets; const Jets jets = apply(event, "AntiKtJets04").jetsByPt(20.0*GeV); foreach (const Jet& jet, jets) { if ( fabs( jet.eta() ) < 4.9 ) { cand_jets.push_back(jet); } } const Particles cand_e = apply(event, "elecs").particlesByPt(); // Muon isolation not mentioned in hep-exp 1109.6572 but assumed to still be applicable Particles cand_mu; const Particles chg_tracks = apply(event, "cfs").particles(); const Particles muons = apply(event, "muons").particlesByPt(); foreach (const Particle& mu, muons) { double pTinCone = -mu.pT(); foreach (const Particle& track, chg_tracks) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) { pTinCone += track.pT(); } } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // Resolve jet-lepton overlap for jets with |eta| < 2.8 Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) >= 2.8 ) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss // Based on all candidate electrons, muons and jets, plus everything else with |eta| < 4.5 // i.e. everything in our projection "vfs" plus the jets with |eta| > 4.5 Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) > 4.5 ) pTmiss -= jet.momentum(); } double eTmiss = pTmiss.pT(); // no electron pT> 20 or muons pT>10 if ( !recon_mu.empty() || !recon_e.empty() ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } if ( eTmiss <= 160 * GeV ) { MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 130"); vetoEvent; } // check the hardest two jets if ( recon_jets.size()<2 || recon_jets[0].pT() <= 130.0 * GeV || recon_jets[0].pT() <= 60.0 * GeV ) { MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets"); vetoEvent; } // check the charged and EM fractions of the hard jets to avoid photons for (unsigned int ix = 0; ix < 2; ++ix) { // jets over 100 GeV if (recon_jets[ix].pT() < 100*GeV || recon_jets[ix].eta() > 2.) continue; ///< @todo Should be |eta|? double fch(0.), fem(0.), eTotal(0.); foreach(const Particle & part, recon_jets[ix].particles()) { long id = part.abspid(); if(PID::threeCharge(id)!=0) fch += part.E(); if (id == PID::PHOTON || id == PID::ELECTRON || id == PID::PI0) fem += part.E(); } fch /= eTotal; fem /= eTotal; // remove events with hard photon if (fch < 0.02 || (fch < 0.05 && fem > 0.09)) vetoEvent; } // ==================== observables ==================== int Njets = 0; double min_dPhi_All = 999.999; ///< @todo Use std::numeric_limits! double min_dPhi_2 = 999.999; ///< @todo Use std::numeric_limits! double min_dPhi_3 = 999.999; ///< @todo Use std::numeric_limits! double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() < 40*GeV ) continue; double dPhi = deltaPhi( pTmiss_phi, jet.phi()); if ( Njets < 2 ) min_dPhi_2 = min( min_dPhi_2, dPhi ); if ( Njets < 3 ) min_dPhi_3 = min( min_dPhi_3, dPhi ); min_dPhi_All = min( min_dPhi_All, dPhi ); ++Njets; } // inclusive meff double m_eff_inc = eTmiss; foreach ( const Jet& jet, recon_jets ) { double perp = jet.pT(); if(perp>40.) m_eff_inc += perp; } // region A double m_eff_Nj = eTmiss + recon_jets[0].pT() + recon_jets[1].pT(); if( min_dPhi_2 > 0.4 && eTmiss/m_eff_Nj > 0.3 ) { _hist_meff_A_tight ->fill(m_eff_inc,weight); if(eTmiss/m_eff_Nj > 0.4) _hist_meff_A_medium->fill(m_eff_inc,weight); if(m_eff_inc>1900.) _count_A_tight ->fill(0.5,weight); if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.4) _count_A_medium->fill(0.5,weight); if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.4) _count_A_loose ->fill(0.5,weight); } // for rest of regions 3 jets pT> 60 needed if(recon_jets.size()<3 || recon_jets[2].perp()<60.) vetoEvent; // region B m_eff_Nj += recon_jets[2].perp(); if( min_dPhi_3 > 0.4 && eTmiss/m_eff_Nj > 0.25 ) { _hist_meff_B_tight->fill(m_eff_inc,weight); if(eTmiss/m_eff_Nj > 0.3) _hist_meff_B_medium->fill(m_eff_inc,weight); if(m_eff_inc>1900.) _count_B_tight ->fill(0.5,weight); if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.3) _count_B_medium->fill(0.5,weight); } // for rest of regions 4 jets pT> 60 needed if(recon_jets.size()<4 || recon_jets[3].perp()<60.) vetoEvent; // region C m_eff_Nj += recon_jets[3].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.25 ) { _hist_meff_C_tight->fill(m_eff_inc,weight); if( eTmiss/m_eff_Nj > 0.3 ) _hist_meff_C_medium->fill(m_eff_inc,weight); if(m_eff_inc>1900.) _count_C_tight ->fill(0.5,weight); if(m_eff_inc>1300. && eTmiss/m_eff_Nj > 0.3) _count_C_medium->fill(0.5,weight); if(m_eff_inc>1000. && eTmiss/m_eff_Nj > 0.3) _count_C_loose ->fill(0.5,weight); } // for rest of regions 5 jets pT> 40 needed if(recon_jets.size()<5 || recon_jets[4].perp()<40.) vetoEvent; // region D m_eff_Nj += recon_jets[4].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.15 ) { _hist_meff_D->fill(m_eff_inc,weight); if(m_eff_inc>1700.) _count_D_tight ->fill(0.5,weight); } // for rest of regions 6 jets pT> 40 needed if(recon_jets.size()<6 || recon_jets[5].perp()<40.) vetoEvent; // region E m_eff_Nj += recon_jets[5].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.15 ) { _hist_meff_E_tight->fill(m_eff_inc,weight); if( eTmiss/m_eff_Nj > 0.25 ) _hist_meff_E_medium->fill(m_eff_inc,weight); if( eTmiss/m_eff_Nj > 0.3 ) _hist_meff_E_loose->fill(m_eff_inc,weight); if(m_eff_inc>1400.) _count_E_tight ->fill(0.5,weight); if(m_eff_inc>1300.&& eTmiss/m_eff_Nj > 0.25 ) _count_E_medium->fill(0.5,weight); if(m_eff_inc>1000.&& eTmiss/m_eff_Nj > 0.3 ) _count_E_loose ->fill(0.5,weight); } } void finalize() { double norm = crossSection()/femtobarn*5.8/sumOfWeights(); // these are number of events at 5.8fb^-1 per 100 GeV scale( _hist_meff_A_medium , 100. * norm ); scale( _hist_meff_A_tight , 100. * norm ); scale( _hist_meff_B_medium , 100. * norm ); scale( _hist_meff_B_tight , 100. * norm ); scale( _hist_meff_C_medium , 100. * norm ); scale( _hist_meff_C_tight , 100. * norm ); scale( _hist_meff_D , 100. * norm ); scale( _hist_meff_E_loose , 100. * norm ); scale( _hist_meff_E_medium , 100. * norm ); scale( _hist_meff_E_tight , 100. * norm ); // these are number of events at 5.8fb^-1 scale(_count_A_tight ,norm); scale(_count_A_medium ,norm); scale(_count_A_loose ,norm); scale(_count_B_tight ,norm); scale(_count_B_medium ,norm); scale(_count_C_tight ,norm); scale(_count_C_medium ,norm); scale(_count_C_loose ,norm); scale(_count_D_tight ,norm); scale(_count_E_tight ,norm); scale(_count_E_medium ,norm); scale(_count_E_loose ,norm); } //@} private: Histo1DPtr _count_A_tight; Histo1DPtr _count_A_medium; Histo1DPtr _count_A_loose; Histo1DPtr _count_B_tight; Histo1DPtr _count_B_medium; Histo1DPtr _count_C_tight; Histo1DPtr _count_C_medium; Histo1DPtr _count_C_loose; Histo1DPtr _count_D_tight; Histo1DPtr _count_E_tight; Histo1DPtr _count_E_medium; Histo1DPtr _count_E_loose; Histo1DPtr _hist_meff_A_medium; Histo1DPtr _hist_meff_A_tight; Histo1DPtr _hist_meff_B_medium; Histo1DPtr _hist_meff_B_tight; Histo1DPtr _hist_meff_C_medium; Histo1DPtr _hist_meff_C_tight; Histo1DPtr _hist_meff_D; Histo1DPtr _hist_meff_E_loose; Histo1DPtr _hist_meff_E_medium; Histo1DPtr _hist_meff_E_tight; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_109); } diff --git a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc rename from analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc --- a/analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_CONF_2012_153.cc @@ -1,397 +1,396 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2012_CONF_2012_153 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_CONF_2012_153() : Analysis("ATLAS_2012_CONF_2012_153") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0), "cfs"); vector edges_meff; edges_meff.push_back( 0); edges_meff.push_back( 150); edges_meff.push_back( 300); edges_meff.push_back( 500); edges_meff.push_back(1000); edges_meff.push_back(1500); vector edges_eT; edges_eT.push_back(0); edges_eT.push_back(50); edges_eT.push_back(150); edges_eT.push_back(300); edges_eT.push_back(500); // Book histograms book(_hist_electrons ,"hist_electrons_before", 11, -0.5,10.5); book(_hist_muons ,"hist_muons_before" , 11, -0.5,10.5); book(_hist_leptons ,"hist_leptons_before" , 11, -0.5,10.5); book(_hist_4leptons ,"hist_4leptons", 1, 0.,1.); book(_hist_veto ,"hist_veto", 1, 0., 1.); book(_hist_etmiss ,"hist_etmiss",edges_eT); book(_hist_meff ,"hist_m_eff",edges_meff); book(_count_SR1 ,"count_SR1", 1, 0., 1.); book(_count_SR2 ,"count_SR2", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if (jet.abseta() < 2.5) cand_jets.push_back(jet); } // candidate muons Particles cand_mu = apply(event, "muons").particlesByPt(); // candidate electrons // Discard if two electrons are within R=0.1 Particles temp = apply(event, "elecs").particles(cmpMomByE); vector vetoed(temp.size(),false); Particles cand_e; for (size_t ix = 0; ix < temp.size(); ++ix) { if (vetoed[ix]) continue; for (size_t iy = ix+1; iy < temp.size(); ++iy) { if ( deltaR(temp[ix], temp[iy]) < 0.1 ) vetoed[iy] = true; } if (!vetoed[ix]) cand_e.push_back(temp[ix]); } // Sort by transverse momentum sortByPt(cand_e); // resolve jet/lepton ambiguity Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle& e, cand_e ) { if (deltaR(e, jet) <= 0.2) { away_from_e = false; break; } } if (away_from_e) recon_jets.push_back( jet ); } // only keep electrons more than R=0.4 from jets Particles cand2_e; foreach (const Particle& e, cand_e) { // at least 0.4 from any jets bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e, jet) < 0.4 ) { away = false; break; } } // if isolated keep it if ( away ) cand2_e.push_back( e ); } // only keep muons more than R=0.4 from jets Particles cand2_mu; foreach(const Particle & mu, cand_mu ) { bool away = true; // at least 0.4 from any jets foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu, jet) < 0.4 ) { away = false; break; } } if (away) cand2_mu.push_back( mu ); } // electron and muon more than 0.1 apart Particles cand3_e; foreach ( const Particle & e, cand2_e ) { bool away = true; foreach( const Particle & mu, cand2_mu ) { if( deltaR(e, mu) < 0.1) { away = false; break; } } if (away) cand3_e.push_back(e); } Particles cand3_mu; foreach( const Particle & mu, cand2_mu ) { bool away = true; foreach ( const Particle & e, cand2_e ) { if( deltaR(e, mu) < 0.1) { away = false; break; } } if (away) cand3_mu.push_back(mu); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // apply electron isolation Particles chg_tracks = apply(event, "cfs").particles(); Particles cand4_e; foreach (const Particle& e, cand3_e) { // charge isolation double pTinCone = -e.pT(); foreach (const Particle& track, chg_tracks) { if (track.pT() > 0.4*GeV && deltaR(e, track) <= 0.3 ) pTinCone += track.pT(); } if (pTinCone/e.pT() > 0.16) continue; // all particles isolation pTinCone = -e.pT(); foreach (const Particle& p, vfs_particles) { if (p.abspid() != PID::MUON && deltaR(e, p) <= 0.3 ) pTinCone += p.pT(); } if (pTinCone/e.pT() < 0.18) cand4_e.push_back(e); } // apply muon isolation Particles cand4_mu; foreach ( const Particle & mu, cand3_mu ) { double pTinCone = -mu.perp(); foreach ( const Particle & track, chg_tracks ) { if (track.pT() > 1*GeV && deltaR(mu, track) <= 0.3) pTinCone += track.pT(); } if (pTinCone/mu.pT() < 0.12) cand4_mu.push_back(mu); } // same SOSF pairs m>12. Particles recon_e; foreach(const Particle& e, cand4_e) { bool veto = false; foreach(const Particle& e2, cand4_e) { if (e.pid()*e2.pid() < 0 && (e.momentum()+e2.momentum()).mass() < 12*GeV) { veto = true; break; } } if (!veto) recon_e.push_back(e); } Particles recon_mu; foreach(const Particle& mu, cand4_mu) { bool veto = false; foreach(const Particle& mu2, cand4_mu) { if (mu.pid()*mu2.pid() < 0 && (mu.momentum()+mu2.momentum()).mass() < 12*GeV) { veto = true; break; } } if (!veto) recon_mu.push_back(mu); } // now only use recon_jets, recon_mu, recon_e _hist_electrons->fill(recon_e.size(), weight); _hist_muons->fill(recon_mu.size(), weight); _hist_leptons->fill(recon_mu.size() + recon_e.size(), weight); if (recon_mu.size() + recon_e.size() > 3) { _hist_4leptons->fill(0.5, weight); } // reject events with less than 4 electrons and muons if (recon_mu.size() + recon_e.size() < 4) { MSG_DEBUG("To few charged leptons left after selection"); vetoEvent; } // or two lepton trigger bool passDouble = (recon_mu.size()>=2 && ( (recon_mu[1].pT()>14*GeV) || (recon_mu[0].pT()>18*GeV && recon_mu[1].perp() > 10*GeV) )) || (recon_e.size() >=2 && ( (recon_e [1].pT()>14*GeV) || (recon_e [0].pT()>25*GeV && recon_e [1].perp() > 10*GeV) )) || (!recon_e.empty() && !recon_mu.empty() && ( (recon_e[0].pT() > 14*GeV && recon_mu[0].pT() > 10*GeV)|| (recon_e[0].pT() > 10*GeV && recon_mu[0].pT() > 18*GeV) )); // must pass a trigger if (!passDouble ) { MSG_DEBUG("Hardest lepton fails trigger"); _hist_veto->fill(0.5, weight); vetoEvent; } // calculate meff double meff = eTmiss; foreach ( const Particle & e , recon_e ) meff += e.perp(); foreach ( const Particle & mu, recon_mu ) meff += mu.perp(); foreach ( const Jet & jet, recon_jets ) { const double pT = jet.pT(); if (pT > 40*GeV) meff += pT; } // 2/3 leptons --> find 1 SFOS pair in range and veto event // 4+ leptons --> find 2 SFOS pairs and in range veto event for (size_t ix = 0; ix < recon_e.size(); ++ix) { for (size_t iy = ix+1; iy < recon_e.size(); ++iy) { if (recon_e[ix].pid()*recon_e[iy].pid() > 0) continue; const FourMomentum ppair = recon_e[ix].momentum() + recon_e[iy].momentum(); if (inRange(ppair.mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; // check triplets with electron for (size_t iz = 0; iz < recon_e.size(); ++iz) { if (iz == ix || iz == iy) continue; if (inRange((ppair+recon_e[iz].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } // check triplets with muon for (size_t iz = 0; iz < recon_mu.size(); ++iz) { if (inRange((ppair+recon_mu[iz].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } // check quadruplets with electrons for (size_t iz = 0; iz < recon_e.size(); ++iz) { for (size_t iw = iz+1; iw < recon_e.size(); ++iw) { if (iz==ix || iz==iy || iw==ix || iw==iy) continue; if (recon_e[iz].pid()*recon_e[iw].pid() > 0) continue; if (inRange((ppair+recon_e[iz].momentum()+recon_e[iw].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } } // check quadruplets with muons for (size_t iz = 0; iz < recon_mu.size(); ++iz) { for (size_t iw = iz+1; iw < recon_mu.size(); ++iw) { if (recon_mu[iz].pid()*recon_mu[iw].pid() > 0) continue; if (inRange((ppair+recon_mu[iz].momentum()+recon_mu[iw].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } } } } // Muon pairs for (size_t ix = 0; ix < recon_mu.size(); ++ix) { for (size_t iy = ix+1; iy < recon_mu.size(); ++iy) { if (recon_mu[ix].pid()*recon_mu[iy].pid()>0) continue; const FourMomentum ppair = recon_mu[ix].momentum()+recon_mu[iy].momentum(); if (inRange(ppair.mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; // check triplets with muon for (size_t iz = 0; iz < recon_mu.size(); ++iz) { if (iz==ix || iz==iy) continue; if (inRange((ppair+recon_mu[iz].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } // check triplets with electron for (size_t iz = 0; iz < recon_e.size(); ++iz) { if (inRange((ppair+recon_e[iz].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } // check muon quadruplets for (size_t iz = 0; iz < recon_mu.size(); ++iz) { for (size_t iw = iz+1; iy < recon_mu.size(); ++iy) { if (iz==ix || iz==iy || iw==ix || iw==iy) continue; if (recon_mu[iz].pid()*recon_mu[iw].pid() > 0) continue; if (inRange((ppair+recon_mu[iz].momentum()+recon_mu[iw].momentum()).mass(), 81.2*GeV, 101.2*GeV)) vetoEvent; } } } } // Make the control plots _hist_etmiss->fill(eTmiss,weight); _hist_meff ->fill(meff ,weight); // Finally the counts if (eTmiss > 50*GeV) _count_SR1->fill(0.5,weight); if (meff >0*GeV) _count_SR2->fill(0.5,weight); } //@} void finalize() { double norm = crossSection()/femtobarn*13./sumOfWeights(); scale(_hist_etmiss,norm*20.); scale(_hist_meff ,norm*20.); scale(_count_SR1,norm); scale(_count_SR2,norm); } private: /// @name Histograms //@{ Histo1DPtr _hist_electrons; Histo1DPtr _hist_muons; Histo1DPtr _hist_leptons; Histo1DPtr _hist_4leptons; Histo1DPtr _hist_veto; Histo1DPtr _hist_etmiss; Histo1DPtr _hist_meff; Histo1DPtr _count_SR1; Histo1DPtr _count_SR2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_CONF_2012_153); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1082936.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1082936.cc rename from analyses/pluginATLAS/ATLAS_2012_I1082936.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1082936.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1082936.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1082936.cc @@ -1,132 +1,132 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" namespace Rivet { class ATLAS_2012_I1082936 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_I1082936() : Analysis("ATLAS_2012_I1082936") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { const FinalState fs; declare(fs,"FinalState"); FastJets fj04(fs, FastJets::ANTIKT, 0.4); fj04.useInvisibles(); declare(fj04, "AntiKT04"); FastJets fj06(fs, FastJets::ANTIKT, 0.6); fj06.useInvisibles(); declare(fj06, "AntiKT06"); // Histogram booking copied from the previous analysis double ybins[] = { 0.0, 0.3, 0.8, 1.2, 2.1, 2.8, 3.6, 4.4 }; double ystarbins[] = { 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.4}; size_t ptDsOffset(0), massDsOffset(2); for (size_t alg = 0; alg < 2; ++alg) { for (size_t i = 0; i < 7; ++i) { Histo1DPtr tmp; - _pThistos[alg].addHistogram(ybins[i], ybins[i+1], book(tmp, 1 + ptDsOffset, 1, i+1)); + _pThistos[alg].add(ybins[i], ybins[i+1], book(tmp, 1 + ptDsOffset, 1, i+1)); } ptDsOffset += 1; for (size_t i = 0; i < 9; ++i) { Histo1DPtr tmp; - _mass[alg].addHistogram(ystarbins[i], ystarbins[i+1], book(tmp, 1 + massDsOffset, 1, i+1)); + _mass[alg].add(ystarbins[i], ystarbins[i+1], book(tmp, 1 + massDsOffset, 1, i+1)); } massDsOffset += 1; } } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets jetAr[2]; jetAr[AKT6] = apply(event, "AntiKT06").jetsByPt(20*GeV); jetAr[AKT4] = apply(event, "AntiKT04").jetsByPt(20*GeV); // Loop over jet "radii" used in analysis for (size_t alg = 0; alg < 2; ++alg) { // Identify dijets vector leadjets; foreach (const Jet& jet, jetAr[alg]) { const double pT = jet.pT(); const double absy = jet.absrap(); _pThistos[alg].fill(absy, pT/GeV, weight); if (absy < 4.4 && leadjets.size() < 2) { if (leadjets.empty() && pT < 30*GeV) continue; leadjets.push_back(jet.momentum()); } } // Make sure we have a leading jet with pT >30 GeV and a second to leading jet with pT>20 GeV if (leadjets.size() < 2) { MSG_DEBUG("Could not find two suitable leading jets"); continue; } const double y1 = leadjets[0].rapidity(); const double y2 = leadjets[1].rapidity(); const double ystar = fabs(y1-y2)/2.; const double m = (leadjets[0] + leadjets[1]).mass(); // Fill mass histogram _mass[alg].fill(ystar, m/TeV, weight); } } /// Normalise histograms etc., after the run void finalize() { for (size_t alg = 0; alg < 2; ++alg) { // factor 0.5 needed because it is differential in dy and not d|y| _pThistos[alg].scale(0.5*crossSectionPerEvent()/picobarn, this); _mass[alg].scale(crossSectionPerEvent()/picobarn, this); } } //@} private: // Data members like post-cuts event weight counters go here enum Alg { AKT4=0, AKT6=1 }; private: /// The inclusive pT spectrum for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _pThistos[2]; + BinnedHistogram _pThistos[2]; /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _mass[2]; + BinnedHistogram _mass[2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1082936); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1094564.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1094564.cc rename from analyses/pluginATLAS/ATLAS_2012_I1094564.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1094564.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1094564.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1094564.cc @@ -1,342 +1,342 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// ATLAS jet substructure measurement class ATLAS_2012_I1094564 : public Analysis { public: ATLAS_2012_I1094564() : Analysis("ATLAS_2012_I1094564") {} // Returns constituents to make it easier to do the filtering PseudoJets splitjet(fastjet::PseudoJet jet, double& last_R, const FastJets& fj, bool& unclustered) const { // Build a new cluster sequence just using the constituents of this jet. fastjet::ClusterSequence cs(fj.clusterSeq()->constituents(jet), fastjet::JetDefinition(fastjet::cambridge_algorithm, M_PI/2.)); // Get the jet back again vector remadeJets = cs.inclusive_jets(0.); if ( remadeJets.size() != 1 ) return remadeJets; fastjet::PseudoJet remadeJet = remadeJets[0]; fastjet::PseudoJet parent1, parent2; unclustered = false; while ( cs.has_parents(remadeJet, parent1, parent2) ) { if (parent1.squared_distance(parent2) < 0.09) break; if (parent1.m2() < parent2.m2()) { fastjet::PseudoJet tmp; tmp = parent1; parent1 = parent2; parent2 = tmp; } double ktdist = parent1.kt_distance(parent2); double rtycut2 = 0.3*0.3; if (parent1.m() < 0.67*remadeJet.m() && ktdist > rtycut2*remadeJet.m2()) { unclustered = true; break; } else { remadeJet = parent1; } } last_R = 0.5 * sqrt(parent1.squared_distance(parent2)); return cs.constituents(remadeJet); } fastjet::PseudoJet filterjet(PseudoJets jets, double& stingy_R, const double def_R) const { if (stingy_R == 0.0) stingy_R = def_R; stingy_R = def_R < stingy_R ? def_R : stingy_R; fastjet::JetDefinition stingy_jet_def(fastjet::cambridge_algorithm, stingy_R); fastjet::ClusterSequence scs(jets, stingy_jet_def); vector stingy_jets = sorted_by_pt(scs.inclusive_jets(0)); fastjet::PseudoJet reconst_jet(0, 0, 0, 0); for (size_t isj = 0; isj < std::min((size_t) 3, stingy_jets.size()); ++isj) { reconst_jet += stingy_jets[isj]; } return reconst_jet; } // These are custom functions for n-subjettiness. PseudoJets jetGetAxes(int n_jets, const PseudoJets& inputJets, double subR) const { // Sanity check if (inputJets.size() < (size_t) n_jets) { MSG_ERROR("Not enough input particles."); return inputJets; } // Get subjets, return fastjet::ClusterSequence sub_clust_seq(inputJets, fastjet::JetDefinition(fastjet::kt_algorithm, subR, fastjet::E_scheme, fastjet::Best)); return sub_clust_seq.exclusive_jets(n_jets); } double jetTauValue(double beta, double jet_rad, const PseudoJets& particles, const PseudoJets& axes, double Rcut) const { double tauNum = 0.0; double tauDen = 0.0; if (particles.size() == 0) return 0.0; for (size_t i = 0; i < particles.size(); i++) { // find minimum distance (set R large to begin) double minR = 10000.0; for (size_t j = 0; j < axes.size(); j++) { double tempR = sqrt(particles[i].squared_distance(axes[j])); if (tempR < minR) minR = tempR; } if (minR > Rcut) minR = Rcut; // calculate nominator and denominator tauNum += particles[i].perp() * pow(minR,beta); tauDen += particles[i].perp() * pow(jet_rad,beta); } // return N-subjettiness (or 0 if denominator is 0) return safediv(tauNum, tauDen, 0); } void jetUpdateAxes(double beta, const PseudoJets& particles, PseudoJets& axes) const { vector belongsto; for (size_t i = 0; i < particles.size(); i++) { // find minimum distance axis int assign = 0; double minR = 10000.0; for (size_t j = 0; j < axes.size(); j++) { double tempR = sqrt(particles[i].squared_distance(axes[j])); if (tempR < minR) { minR = tempR; assign = j; } } belongsto.push_back(assign); } // iterative step double deltaR2, distphi; vector ynom, phinom, den; ynom.resize(axes.size()); phinom.resize(axes.size()); den.resize(axes.size()); for (size_t i = 0; i < particles.size(); i++) { distphi = particles[i].phi() - axes[belongsto[i]].phi(); deltaR2 = particles[i].squared_distance(axes[belongsto[i]]); if (deltaR2 == 0.) continue; if (abs(distphi) <= M_PI) phinom.at(belongsto[i]) += particles[i].perp() * particles[i].phi() * pow(deltaR2, (beta-2)/2); else if ( distphi > M_PI) phinom.at(belongsto[i]) += particles[i].perp() * (-2 * M_PI + particles[i].phi()) * pow(deltaR2, (beta-2)/2); else if ( distphi < M_PI) phinom.at(belongsto[i]) += particles[i].perp() * (+2 * M_PI + particles[i].phi()) * pow(deltaR2, (beta-2)/2); ynom.at(belongsto[i]) += particles[i].perp() * particles[i].rap() * pow(deltaR2, (beta-2)/2); den.at(belongsto[i]) += particles[i].perp() * pow(deltaR2, (beta-2)/2); } // reset to new axes for (size_t j = 0; j < axes.size(); j++) { if (den[j] == 0.) axes.at(j) = axes[j]; else { double phi_new = fmod( 2*M_PI + (phinom[j] / den[j]), 2*M_PI ); double pt_new = axes[j].perp(); double y_new = ynom[j] / den[j]; double px = pt_new * cos(phi_new); double py = pt_new * sin(phi_new); double pz = pt_new * sinh(y_new); axes.at(j).reset(px, py, pz, axes[j].perp()/2); } } } void init() { /// Projections: FinalState fs(-4.5, 4.5, 0.*GeV); declare(fs, "FS"); declare(FastJets(fs, FastJets::ANTIKT, 1.0), "AKT"); declare(FastJets(fs, FastJets::CAM, 1.2) , "CA" ); /// Histograms: - {Histo1DPtr tmp; _h_camass.addHistogram(200, 300, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_camass.addHistogram(300, 400, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_camass.addHistogram(400, 500, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_camass.addHistogram(500, 600, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_camass.add(200, 300, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_camass.add(300, 400, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_camass.add(400, 500, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_camass.add(500, 600, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_filtmass.addHistogram(200, 300, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_filtmass.addHistogram(300, 400, book(tmp, 6, 1, 1));} - {Histo1DPtr tmp; _h_filtmass.addHistogram(400, 500, book(tmp, 7, 1, 1));} - {Histo1DPtr tmp; _h_filtmass.addHistogram(500, 600, book(tmp, 8, 1, 1));} + {Histo1DPtr tmp; _h_filtmass.add(200, 300, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_filtmass.add(300, 400, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_filtmass.add(400, 500, book(tmp, 7, 1, 1));} + {Histo1DPtr tmp; _h_filtmass.add(500, 600, book(tmp, 8, 1, 1));} - {Histo1DPtr tmp; _h_ktmass.addHistogram(200, 300, book(tmp, 9, 1, 1));} - {Histo1DPtr tmp; _h_ktmass.addHistogram(300, 400, book(tmp, 10, 1, 1));} - {Histo1DPtr tmp; _h_ktmass.addHistogram(400, 500, book(tmp, 11, 1, 1));} - {Histo1DPtr tmp; _h_ktmass.addHistogram(500, 600, book(tmp, 12, 1, 1));} + {Histo1DPtr tmp; _h_ktmass.add(200, 300, book(tmp, 9, 1, 1));} + {Histo1DPtr tmp; _h_ktmass.add(300, 400, book(tmp, 10, 1, 1));} + {Histo1DPtr tmp; _h_ktmass.add(400, 500, book(tmp, 11, 1, 1));} + {Histo1DPtr tmp; _h_ktmass.add(500, 600, book(tmp, 12, 1, 1));} - {Histo1DPtr tmp; _h_ktd12.addHistogram(200, 300, book(tmp, 13, 1, 1));} - {Histo1DPtr tmp; _h_ktd12.addHistogram(300, 400, book(tmp, 14, 1, 1));} - {Histo1DPtr tmp; _h_ktd12.addHistogram(400, 500, book(tmp, 15, 1, 1));} - {Histo1DPtr tmp; _h_ktd12.addHistogram(500, 600, book(tmp, 16, 1, 1));} + {Histo1DPtr tmp; _h_ktd12.add(200, 300, book(tmp, 13, 1, 1));} + {Histo1DPtr tmp; _h_ktd12.add(300, 400, book(tmp, 14, 1, 1));} + {Histo1DPtr tmp; _h_ktd12.add(400, 500, book(tmp, 15, 1, 1));} + {Histo1DPtr tmp; _h_ktd12.add(500, 600, book(tmp, 16, 1, 1));} - {Histo1DPtr tmp; _h_ktd23.addHistogram(200, 300, book(tmp, 17, 1 ,1));} - {Histo1DPtr tmp; _h_ktd23.addHistogram(300, 400, book(tmp, 18, 1 ,1));} - {Histo1DPtr tmp; _h_ktd23.addHistogram(400, 500, book(tmp, 19, 1 ,1));} - {Histo1DPtr tmp; _h_ktd23.addHistogram(500, 600, book(tmp, 20, 1 ,1));} + {Histo1DPtr tmp; _h_ktd23.add(200, 300, book(tmp, 17, 1 ,1));} + {Histo1DPtr tmp; _h_ktd23.add(300, 400, book(tmp, 18, 1 ,1));} + {Histo1DPtr tmp; _h_ktd23.add(400, 500, book(tmp, 19, 1 ,1));} + {Histo1DPtr tmp; _h_ktd23.add(500, 600, book(tmp, 20, 1 ,1));} - {Histo1DPtr tmp; _h_cat21.addHistogram(200, 300, book(tmp, 21, 1, 1));} - {Histo1DPtr tmp; _h_cat21.addHistogram(300, 400, book(tmp, 22, 1, 1));} - {Histo1DPtr tmp; _h_cat21.addHistogram(400, 500, book(tmp, 23, 1, 1));} - {Histo1DPtr tmp; _h_cat21.addHistogram(500, 600, book(tmp, 24, 1, 1));} + {Histo1DPtr tmp; _h_cat21.add(200, 300, book(tmp, 21, 1, 1));} + {Histo1DPtr tmp; _h_cat21.add(300, 400, book(tmp, 22, 1, 1));} + {Histo1DPtr tmp; _h_cat21.add(400, 500, book(tmp, 23, 1, 1));} + {Histo1DPtr tmp; _h_cat21.add(500, 600, book(tmp, 24, 1, 1));} - {Histo1DPtr tmp; _h_cat32.addHistogram(200, 300, book(tmp, 25, 1, 1));} - {Histo1DPtr tmp; _h_cat32.addHistogram(300, 400, book(tmp, 26, 1, 1));} - {Histo1DPtr tmp; _h_cat32.addHistogram(400, 500, book(tmp, 27, 1, 1));} - {Histo1DPtr tmp; _h_cat32.addHistogram(500, 600, book(tmp, 28, 1, 1));} + {Histo1DPtr tmp; _h_cat32.add(200, 300, book(tmp, 25, 1, 1));} + {Histo1DPtr tmp; _h_cat32.add(300, 400, book(tmp, 26, 1, 1));} + {Histo1DPtr tmp; _h_cat32.add(400, 500, book(tmp, 27, 1, 1));} + {Histo1DPtr tmp; _h_cat32.add(500, 600, book(tmp, 28, 1, 1));} - {Histo1DPtr tmp; _h_ktt21.addHistogram(200, 300, book(tmp, 29, 1, 1));} - {Histo1DPtr tmp; _h_ktt21.addHistogram(300, 400, book(tmp, 30, 1, 1));} - {Histo1DPtr tmp; _h_ktt21.addHistogram(400, 500, book(tmp, 31, 1, 1));} - {Histo1DPtr tmp; _h_ktt21.addHistogram(500, 600, book(tmp, 32, 1, 1));} + {Histo1DPtr tmp; _h_ktt21.add(200, 300, book(tmp, 29, 1, 1));} + {Histo1DPtr tmp; _h_ktt21.add(300, 400, book(tmp, 30, 1, 1));} + {Histo1DPtr tmp; _h_ktt21.add(400, 500, book(tmp, 31, 1, 1));} + {Histo1DPtr tmp; _h_ktt21.add(500, 600, book(tmp, 32, 1, 1));} - {Histo1DPtr tmp; _h_ktt32.addHistogram(200, 300, book(tmp, 33, 1, 1));} - {Histo1DPtr tmp; _h_ktt32.addHistogram(300, 400, book(tmp, 34, 1, 1));} - {Histo1DPtr tmp; _h_ktt32.addHistogram(400, 500, book(tmp, 35, 1, 1));} - {Histo1DPtr tmp; _h_ktt32.addHistogram(500, 600, book(tmp, 36, 1, 1));} + {Histo1DPtr tmp; _h_ktt32.add(200, 300, book(tmp, 33, 1, 1));} + {Histo1DPtr tmp; _h_ktt32.add(300, 400, book(tmp, 34, 1, 1));} + {Histo1DPtr tmp; _h_ktt32.add(400, 500, book(tmp, 35, 1, 1));} + {Histo1DPtr tmp; _h_ktt32.add(500, 600, book(tmp, 36, 1, 1));} } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; using namespace fastjet; // Get anti-kt jets with p_T > 200 GeV, check abs(y) < 2, and fill mass histograms const FastJets& ktfj = apply(event, "AKT"); PseudoJets ktjets = ktfj.pseudoJetsByPt(200*GeV); foreach (const PseudoJet ajet, ktjets) { if (abs(ajet.rap()) < 2) { _h_ktmass.fill(ajet.perp(), ajet.m(), weight); } } // Same as above but C/A jets const FastJets& cafj = apply(event, "CA"); PseudoJets cajets = cafj.pseudoJetsByPt(200*GeV); foreach (const PseudoJet ajet, cajets) { if (abs(ajet.rap()) < 2) { _h_camass.fill(ajet.perp(), ajet.m(), weight); } } // Split and filter. // Only do this to C/A jets in this analysis. foreach (const PseudoJet pjet, cajets) { if ( pjet.perp() > 600 || abs(pjet.rap()) > 2) continue; double dR = 0; bool unclustered = false; PseudoJets split_jets = splitjet(pjet, dR, cafj, unclustered); if ( (dR < 0.15) || (unclustered == false) ) continue; PseudoJet filt_jet = filterjet(split_jets, dR, 0.3); _h_filtmass.fill(filt_jet.perp(), filt_jet.m(), weight); } // Use the two last stages of clustering to get sqrt(d_12) and sqrt(d_23). // Only use anti-kt jets in this analysis. foreach (const PseudoJet pjet, ktjets) { if (pjet.perp() > 600 || abs(pjet.rap()) > 2) continue; ClusterSequence subjet_cseq(ktfj.clusterSeq()->constituents(pjet), JetDefinition(kt_algorithm, M_PI/2.)); double d_12 = subjet_cseq.exclusive_dmerge(1) * M_PI*M_PI/4.; double d_23 = subjet_cseq.exclusive_dmerge(2) * M_PI*M_PI/4.; _h_ktd12.fill(pjet.perp(), sqrt(d_12), weight); _h_ktd23.fill(pjet.perp(), sqrt(d_23), weight); } // N-subjettiness, use beta = 1 (no rationale given). // Uses the functions defined above. // C/A jets first, anti-kt after. double beta = 1.; //Rcut is used for particles that are very far from the closest axis. At 10 //is has no impact on the outcome of the calculation double Rcut = 10.; foreach (const PseudoJet pjet, cajets) { if (pjet.perp() > 600*GeV || fabs(pjet.rap()) > 2) continue; const PseudoJets constituents = cafj.clusterSeq()->constituents(pjet); if (constituents.size() < 3) continue; const PseudoJets axis1 = jetGetAxes(1, constituents, M_PI/2.0); const PseudoJets axis2 = jetGetAxes(2, constituents, M_PI/2.0); const PseudoJets axis3 = jetGetAxes(3, constituents, M_PI/2.0); const double radius = 1.2; const double tau1 = jetTauValue(beta, radius, constituents, axis1, Rcut); const double tau2 = jetTauValue(beta, radius, constituents, axis2, Rcut); const double tau3 = jetTauValue(beta, radius, constituents, axis3, Rcut); if (tau1 == 0 || tau2 == 0) continue; _h_cat21.fill(pjet.perp(), tau2/tau1, weight); _h_cat32.fill(pjet.perp(), tau3/tau2, weight); } foreach (const PseudoJet pjet, ktjets) { if (pjet.perp() > 600*GeV || fabs(pjet.rap()) > 2) continue; const PseudoJets constituents = ktfj.clusterSeq()->constituents(pjet); if (constituents.size() < 3) continue; const PseudoJets axis1 = jetGetAxes(1, constituents, M_PI/2.0); const PseudoJets axis2 = jetGetAxes(2, constituents, M_PI/2.0); const PseudoJets axis3 = jetGetAxes(3, constituents, M_PI/2.0); const double radius = 1.0; const double tau1 = jetTauValue(beta, radius, constituents, axis1, Rcut); const double tau2 = jetTauValue(beta, radius, constituents, axis2, Rcut); const double tau3 = jetTauValue(beta, radius, constituents, axis3, Rcut); if (tau1 == 0 || tau2 == 0) continue; _h_ktt21.fill(pjet.perp(), tau2/tau1, weight); _h_ktt32.fill(pjet.perp(), tau3/tau2, weight); } } /// Normalise histograms etc., after the run void finalize() { foreach (Histo1DPtr h, _h_camass.histos()) normalize(h); foreach (Histo1DPtr h, _h_filtmass.histos()) normalize(h); foreach (Histo1DPtr h, _h_ktmass.histos()) normalize(h); foreach (Histo1DPtr h, _h_ktd12.histos()) normalize(h); foreach (Histo1DPtr h, _h_ktd23.histos()) normalize(h); foreach (Histo1DPtr h, _h_cat21.histos()) normalize(h); foreach (Histo1DPtr h, _h_cat32.histos()) normalize(h); foreach (Histo1DPtr h, _h_ktt21.histos()) normalize(h); foreach (Histo1DPtr h, _h_ktt32.histos()) normalize(h); } private: - BinnedHistogram _h_camass; - BinnedHistogram _h_filtmass; - BinnedHistogram _h_ktmass; - BinnedHistogram _h_ktd12; - BinnedHistogram _h_ktd23; - BinnedHistogram _h_cat21; - BinnedHistogram _h_cat32; - BinnedHistogram _h_ktt21; - BinnedHistogram _h_ktt32; + BinnedHistogram _h_camass; + BinnedHistogram _h_filtmass; + BinnedHistogram _h_ktmass; + BinnedHistogram _h_ktd12; + BinnedHistogram _h_ktd23; + BinnedHistogram _h_cat21; + BinnedHistogram _h_cat32; + BinnedHistogram _h_ktt21; + BinnedHistogram _h_ktt32; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1094564); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1095236.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1095236.cc rename from analyses/pluginATLAS/ATLAS_2012_I1095236.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1095236.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1095236.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1095236.cc @@ -1,327 +1,326 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_I1095236 : public Analysis { public: /// Constructor ATLAS_2012_I1095236() : Analysis("ATLAS_2012_I1095236") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // Projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // Projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // All tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0),"cfs"); // Used for pTmiss declare(VisibleFinalState(-4.9,4.9),"vfs"); // Book histograms book(_count_SR0_A1 ,"count_SR0_A1", 1, 0., 1.); book(_count_SR0_B1 ,"count_SR0_B1", 1, 0., 1.); book(_count_SR0_C1 ,"count_SR0_C1", 1, 0., 1.); book(_count_SR0_A2 ,"count_SR0_A2", 1, 0., 1.); book(_count_SR0_B2 ,"count_SR0_B2", 1, 0., 1.); book(_count_SR0_C2 ,"count_SR0_C2", 1, 0., 1.); book(_count_SR1_D ,"count_SR1_D" , 1, 0., 1.); book(_count_SR1_E ,"count_SR1_E" , 1, 0., 1.); book(_hist_meff_SR0_A1 ,"hist_m_eff_SR0_A1", 14, 400., 1800.); book(_hist_meff_SR0_A2 ,"hist_m_eff_SR0_A2", 14, 400., 1800.); book(_hist_meff_SR1_D_e ,"hist_meff_SR1_D_e" , 16, 600., 2200.); book(_hist_meff_SR1_D_mu ,"hist_meff_SR1_D_mu", 16, 600., 2200.); book(_hist_met_SR0_A1 ,"hist_met_SR0_A1", 14, 0., 700.); book(_hist_met_SR0_A2 ,"hist_met_SR0_A2", 14, 0., 700.); book(_hist_met_SR0_D_e ,"hist_met_SR1_D_e" , 15, 0., 600.); book(_hist_met_SR0_D_mu ,"hist_met_SR1_D_mu", 15, 0., 600.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets cand_jets; const Jets jets = apply(event, "AntiKtJets04").jetsByPt(20.0*GeV); foreach (const Jet& jet, jets) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } const Particles cand_e = apply(event, "elecs").particlesByPt(); const Particles cand_mu = apply(event, "muons").particlesByPt(); // Resolve jet-lepton overlap for jets with |eta| < 2.8 Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) >= 2.8 ) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // get the loose leptons used to define the 0 lepton channel Particles loose_e, loose_mu; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) loose_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) loose_mu.push_back( mu ); } // tight leptons for the 1-lepton channel Particles tight_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, loose_mu) { if(mu.perp()<20.) continue; double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) tight_mu.push_back(mu); } Particles tight_e; foreach ( const Particle & e, loose_e ) { if(e.perp()<25.) continue; double pTinCone = -e.perp(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if (pTinCone/e.perp()<0.1) { tight_e.push_back(e); } } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // get the number of b-tagged jets unsigned int ntagged=0; foreach (const Jet & jet, recon_jets ) { if(jet.perp()>50. && abs(jet.eta())<2.5 && jet.bTagged() && rand()/static_cast(RAND_MAX)<=0.60) ++ntagged; } // ATLAS calo problem if(rand()/static_cast(RAND_MAX)<=0.42) { foreach ( const Jet & jet, recon_jets ) { double eta = jet.rapidity(); double phi = jet.azimuthalAngle(MINUSPI_PLUSPI); if(jet.perp()>50 && eta>-0.1&&eta<1.5&&phi>-0.9&&phi<-0.5) vetoEvent; } } // at least 1 b tag if(ntagged==0) vetoEvent; // minumum Et miss if(eTmiss<80.) vetoEvent; // at least 3 jets pT > 50 if(recon_jets.size()<3 || recon_jets[2].perp()<50.) vetoEvent; // m_eff double m_eff = eTmiss; for(unsigned int ix=0;ix<3;++ix) m_eff += recon_jets[ix].perp(); // delta Phi double min_dPhi = 999.999; double pTmiss_phi = pTmiss.phi(); for(unsigned int ix=0;ix<3;++ix) { min_dPhi = min( min_dPhi, deltaPhi( pTmiss_phi, recon_jets[ix].phi() ) ); } // 0-lepton channels if(loose_e.empty() && loose_mu.empty() && recon_jets[0].perp()>130. && eTmiss>130. && eTmiss/m_eff>0.25 && min_dPhi>0.4) { // jet charge cut bool jetCharge = true; for(unsigned int ix=0;ix<3;++ix) { if(fabs(recon_jets[ix].eta())>2.) continue; double trackpT=0; foreach(const Particle & p, recon_jets[ix].particles()) { if(PID::threeCharge(p.pid())==0) continue; trackpT += p.perp(); } if(trackpT/recon_jets[ix].perp()<0.05) jetCharge = false; } if(jetCharge) { // SR0-A region if(m_eff>500.) { _count_SR0_A1->fill(0.5,weight); _hist_meff_SR0_A1->fill(m_eff,weight); _hist_met_SR0_A1 ->fill(eTmiss,weight); if(ntagged>=2) { _count_SR0_A2->fill(0.5,weight); _hist_meff_SR0_A2->fill(m_eff,weight); _hist_met_SR0_A2 ->fill(eTmiss,weight); } } // SR0-B if(m_eff>700.) { _count_SR0_B1->fill(0.5,weight); if(ntagged>=2) _count_SR0_B2->fill(0.5,weight); } // SR0-C if(m_eff>900.) { _count_SR0_C1->fill(0.5,weight); if(ntagged>=2) _count_SR0_C2->fill(0.5,weight); } } } // 1-lepton channels if(tight_e.size() + tight_mu.size() == 1 && recon_jets.size()>=4 && recon_jets[3].perp()>50.&& recon_jets[0].perp()>60.) { Particle lepton = tight_e.empty() ? tight_mu[0] : tight_e[0]; m_eff += lepton.perp() + recon_jets[3].perp(); // transverse mass cut double mT = 2.*(lepton.perp()*eTmiss- lepton.px()*pTmiss.px()- lepton.py()*pTmiss.py()); mT = sqrt(mT); if(mT>100.&&m_eff>700.) { // D region _count_SR1_D->fill(0.5,weight); if(lepton.abspid()==PID::ELECTRON) { _hist_meff_SR1_D_e->fill(m_eff,weight); _hist_met_SR0_D_e->fill(eTmiss,weight); } else { _hist_meff_SR1_D_mu->fill(m_eff,weight); _hist_met_SR0_D_mu->fill(eTmiss,weight); } // E region if(eTmiss>200.) { _count_SR1_E->fill(0.5,weight); } } } } void finalize() { double norm = crossSection()/femtobarn*2.05/sumOfWeights(); // these are number of events at 2.05fb^-1 per 100 GeV scale( _hist_meff_SR0_A1 , 100. * norm ); scale( _hist_meff_SR0_A2 , 100. * norm ); scale( _hist_meff_SR1_D_e , 100. * norm ); scale( _hist_meff_SR1_D_mu , 100. * norm ); // these are number of events at 2.05fb^-1 per 50 GeV scale( _hist_met_SR0_A1, 50. * norm ); scale( _hist_met_SR0_A2, 40. * norm ); // these are number of events at 2.05fb^-1 per 40 GeV scale( _hist_met_SR0_D_e , 40. * norm ); scale( _hist_met_SR0_D_mu, 40. * norm ); // these are number of events at 2.05fb^-1 scale(_count_SR0_A1,norm); scale(_count_SR0_B1,norm); scale(_count_SR0_C1,norm); scale(_count_SR0_A2,norm); scale(_count_SR0_B2,norm); scale(_count_SR0_C2,norm); scale(_count_SR1_D ,norm); scale(_count_SR1_E ,norm); } //@} private: Histo1DPtr _count_SR0_A1; Histo1DPtr _count_SR0_B1; Histo1DPtr _count_SR0_C1; Histo1DPtr _count_SR0_A2; Histo1DPtr _count_SR0_B2; Histo1DPtr _count_SR0_C2; Histo1DPtr _count_SR1_D; Histo1DPtr _count_SR1_E; Histo1DPtr _hist_meff_SR0_A1; Histo1DPtr _hist_meff_SR0_A2; Histo1DPtr _hist_meff_SR1_D_e; Histo1DPtr _hist_meff_SR1_D_mu; Histo1DPtr _hist_met_SR0_A1; Histo1DPtr _hist_met_SR0_A2; Histo1DPtr _hist_met_SR0_D_e; Histo1DPtr _hist_met_SR0_D_mu; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1095236); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1112263.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1112263.cc rename from analyses/pluginATLAS/ATLAS_2012_I1112263.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1112263.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1112263.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1112263.cc @@ -1,323 +1,322 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_I1112263 : public Analysis { public: /// Constructor ATLAS_2012_I1112263() : Analysis("ATLAS_2012_I1112263") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0),"cfs"); // Book histograms {Histo1DPtr tmp; _hist_leptonpT_SR1.push_back(book(tmp,"hist_lepton_pT_1_SR1",11,0.,220.));} {Histo1DPtr tmp; _hist_leptonpT_SR1.push_back(book(tmp,"hist_lepton_pT_2_SR1", 7,0.,140.));} {Histo1DPtr tmp; _hist_leptonpT_SR1.push_back(book(tmp,"hist_lepton_pT_3_SR1", 8,0.,160.));} {Histo1DPtr tmp; _hist_leptonpT_SR2.push_back(book(tmp,"hist_lepton_pT_1_SR2",11,0.,220.));} {Histo1DPtr tmp; _hist_leptonpT_SR2.push_back(book(tmp,"hist_lepton_pT_2_SR2", 7,0.,140.));} {Histo1DPtr tmp; _hist_leptonpT_SR2.push_back(book(tmp,"hist_lepton_pT_3_SR2", 8,0.,160.));} book(_hist_etmiss_SR1_A ,"hist_etmiss_SR1_A",15,10.,310.); book(_hist_etmiss_SR1_B ,"hist_etmiss_SR1_B", 9,10.,190.); book(_hist_etmiss_SR2_A ,"hist_etmiss_SR2_A",15,10.,310.); book(_hist_etmiss_SR2_B ,"hist_etmiss_SR2_B", 9,10.,190.); book(_hist_mSFOS,"hist_mSFOF",9,0.,180.); book(_count_SR1 ,"count_SR1", 1, 0., 1.); book(_count_SR2 ,"count_SR2", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { // Get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // Candidate muons Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // Candidate electrons Particles cand_e; foreach ( const Particle & e, apply(event, "elecs").particlesByPt() ) { double eta = e.eta(); // Remove electrons with pT<15 in old veto region // (NOT EXPLICIT IN THIS PAPER BUT IN SIMILAR 4 LEPTON PAPER and THIS DESCRPITION // IS MUCH WORSE SO ASSUME THIS IS DONE) if ( fabs(eta)>1.37 && fabs(eta) < 1.52 && e.perp()< 15.*GeV) continue; double pTinCone = -e.perp(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if (pTinCone/e.perp()<0.1) { cand_e.push_back(e); } } // Resolve jet/lepton ambiguity // (NOT EXPLICIT IN THIS PAPER BUT IN SIMILAR 4 LEPTON PAPER and THIS DESCRPITION // IS MUCH WORSE SO ASSUME THIS IS DONE) Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // Only keep electrons more than R=0.4 from jets Particles recon_e; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } // ... and 0.1 from any muons if ( ! away ) { foreach ( const Particle & mu, cand_e ) { if ( deltaR(mu.momentum(),e.momentum()) < 0.1 ) { away = false; break; } } } if ( away ) recon_e.push_back( e ); } // Only keep muons more than R=0.4 from jets Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } // ... and 0.1 from any electrona if ( ! away ) { foreach ( const Particle & e, cand_e ) { if ( deltaR(mu.momentum(),e.momentum()) < 0.1 ) { away = false; break; } } } if ( away ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // Now only use recon_jets, recon_mu, recon_e // Reject events with wrong number of leptons if ( recon_mu.size() + recon_e.size() != 3 ) { MSG_DEBUG("To few charged leptons left after selection"); vetoEvent; } // ATLAS calo problem if (rand()/static_cast(RAND_MAX) <= 0.42) { foreach ( const Particle & e, recon_e ) { double eta = e.eta(); double phi = e.azimuthalAngle(MINUSPI_PLUSPI); if (inRange(eta, -0.1, 1.5) && inRange(phi, -0.9, -0.5)) vetoEvent; } foreach ( const Jet & jet, recon_jets ) { const double eta = jet.rapidity(); const double phi = jet.azimuthalAngle(MINUSPI_PLUSPI); if (jet.perp() > 40*GeV && inRange(eta, -0.1, 1.5) && inRange(phi, -0.9, -0.5)) vetoEvent; } } if ( !( !recon_e .empty() && recon_e[0] .perp() > 25*GeV) && !( !recon_mu.empty() && recon_mu[0].perp() > 20*GeV) ) { MSG_DEBUG("Hardest lepton fails trigger"); vetoEvent; } // eTmiss cut if (eTmiss < 50*GeV) vetoEvent; // Check at least 1 SFOS pair double mSFOS=1e30, mdiff=1e30*GeV; size_t nSFOS=0; for (size_t ix = 0; ix < recon_e.size(); ++ix) { for (size_t iy = ix+1; iy < recon_e.size(); ++iy) { if (recon_e[ix].pid()*recon_e[iy].pid() > 0) continue; ++nSFOS; double mtest = (recon_e[ix].momentum() + recon_e[iy].momentum()).mass(); // Veto is mass<20 if (mtest < 20*GeV) vetoEvent; if (fabs(mtest - 90*GeV) < mdiff) { mSFOS = mtest; mdiff = fabs(mtest - 90*GeV); } } } for (size_t ix = 0; ix < recon_mu.size(); ++ix) { for (size_t iy = ix+1; iy < recon_mu.size(); ++iy) { if (recon_mu[ix].pid()*recon_mu[iy].pid() > 0) continue; ++nSFOS; double mtest = (recon_mu[ix].momentum() + recon_mu[iy].momentum()).mass(); // Veto is mass < 20*GeV if (mtest < 20*GeV) vetoEvent; if (fabs(mtest - 90*GeV) < mdiff) { mSFOS = mtest; mdiff = fabs(mtest - 90*GeV); } } } // Require at least 1 SFOS pair if (nSFOS == 0) vetoEvent; // b-jet veto in SR! if (mdiff > 10*GeV) { foreach (const Jet & jet, recon_jets ) { if (jet.bTagged() && rand()/static_cast(RAND_MAX) <= 0.60) vetoEvent; } } // Histogram filling const double weight = 1.0; // Region SR1, Z depleted if (mdiff > 10*GeV) { _count_SR1->fill(0.5, weight); _hist_etmiss_SR1_A->fill(eTmiss, weight); _hist_etmiss_SR1_B->fill(eTmiss, weight); _hist_mSFOS->fill(mSFOS, weight); } // Region SR2, Z enriched else { _count_SR2->fill(0.5, weight); _hist_etmiss_SR2_A->fill(eTmiss, weight); _hist_etmiss_SR2_B->fill(eTmiss, weight); } // Make the control plots // lepton pT size_t ie=0, imu=0; for (size_t ix = 0; ix < 3; ++ix) { Histo1DPtr hist = (mdiff > 10*GeV) ? _hist_leptonpT_SR1[ix] : _hist_leptonpT_SR2[ix]; double pTe = (ie < recon_e .size()) ? recon_e [ie ].perp() : -1*GeV; double pTmu = (imu < recon_mu.size()) ? recon_mu[imu].perp() : -1*GeV; if (pTe > pTmu) { hist->fill(pTe, weight); ++ie; } else { hist->fill(pTmu, weight); ++imu; } } } void finalize() { const double norm = crossSection()/femtobarn*2.06/sumOfWeights(); // These are number of events at 2.06fb^-1 per 20 GeV for (size_t ix = 0; ix < 3; ++ix) { scale(_hist_leptonpT_SR1[ix], norm*20.); scale(_hist_leptonpT_SR2[ix], norm*20.); } scale(_hist_etmiss_SR1_A, norm*20.); scale(_hist_etmiss_SR1_B, norm*20.); scale(_hist_etmiss_SR2_A, norm*20.); scale(_hist_etmiss_SR2_B, norm*20.); scale(_hist_mSFOS, norm*20.); // These are number of events at 2.06fb^-1 scale(_count_SR1, norm); scale(_count_SR2, norm); } //@} private: /// @name Histograms //@{ vector _hist_leptonpT_SR1, _hist_leptonpT_SR2; Histo1DPtr _hist_etmiss_SR1_A, _hist_etmiss_SR1_B, _hist_etmiss_SR2_A, _hist_etmiss_SR2_B; Histo1DPtr _hist_mSFOS, _count_SR1, _count_SR2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1112263); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1117704.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1117704.cc rename from analyses/pluginATLAS/ATLAS_2012_I1117704.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1117704.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1117704.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1117704.cc @@ -1,283 +1,282 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2012_I1117704 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_I1117704() : Analysis("ATLAS_2012_I1117704") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3),"cfs"); /// Book histograms book(_etmiss_HT_7j55 ,"etmiss_HT_7j55", 8, 0., 16.); book(_etmiss_HT_8j55 ,"etmiss_HT_8j55", 8, 0., 16.); book(_etmiss_HT_9j55 ,"etmiss_HT_9j55", 8, 0., 16.); book(_etmiss_HT_6j80 ,"etmiss_HT_6j80", 8, 0., 16.); book(_etmiss_HT_7j80 ,"etmiss_HT_7j80", 8, 0., 16.); book(_etmiss_HT_8j80 ,"etmiss_HT_8j80", 8, 0., 16.); book(_hist_njet55 ,"hist_njet55", 11, 2.5, 13.5); book(_hist_njet80 ,"hist_njet80", 11, 2.5, 13.5); book(_count_7j55 ,"count_7j55", 1, 0., 1.); book(_count_8j55 ,"count_8j55", 1, 0., 1.); book(_count_9j55 ,"count_9j55", 1, 0., 1.); book(_count_6j80 ,"count_6j80", 1, 0., 1.); book(_count_7j80 ,"count_7j80", 1, 0., 1.); book(_count_8j80 ,"count_8j80", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // candidate muons Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle& mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle& track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // candidate electrons Particles cand_e = apply(event, "elecs").particlesByPt(); // resolve jet/lepton ambiguity Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { // candidates after |eta| < 2.8 if ( fabs( jet.eta() ) >= 2.8 ) continue; bool away_from_e = true; foreach ( const Particle& e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // only keep electrons more than R=0.4 from jets Particles recon_e; foreach ( const Particle& e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } // only keep muons more than R=0.4 from jets Particles recon_mu; foreach ( const Particle& mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle& p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // now only use recon_jets, recon_mu, recon_e // reject events with electrons and muons if ( ! ( recon_mu.empty() && recon_e.empty() ) ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } // calculate H_T double HT=0; foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() > 40 * GeV ) HT += jet.pT() ; } // number of jets unsigned int njet55=0, njet80=0; for (unsigned int ix=0;ix80.*GeV) ++njet80; if(recon_jets[ix].pT()>55.*GeV) ++njet55; } if(njet55==0) vetoEvent; double ratio = eTmiss/sqrt(HT); if(ratio>4.) { _hist_njet55->fill(njet55,weight); _hist_njet80->fill(njet80,weight); // 7j55 if(njet55>=7) _count_7j55->fill( 0.5, weight); // 8j55 if(njet55>=8) _count_8j55->fill( 0.5, weight) ; // 8j55 if(njet55>=9) _count_9j55->fill( 0.5, weight) ; // 6j80 if(njet80>=6) _count_6j80->fill( 0.5, weight) ; // 7j80 if(njet80>=7) _count_7j80->fill( 0.5, weight) ; // 8j80 if(njet80>=8) _count_8j80->fill( 0.5, weight) ; } if(njet55>=7) _etmiss_HT_7j55->fill( ratio, weight); // 8j55 if(njet55>=8) _etmiss_HT_8j55->fill( ratio, weight) ; // 8j55 if(njet55>=9) _etmiss_HT_9j55->fill( ratio, weight) ; // 6j80 if(njet80>=6) _etmiss_HT_6j80->fill( ratio, weight) ; // 7j80 if(njet80>=7) _etmiss_HT_7j80->fill( ratio, weight) ; // 8j80 if(njet80>=8) _etmiss_HT_8j80->fill( ratio, weight) ; } //@} void finalize() { double norm = crossSection()/femtobarn*4.7/sumOfWeights(); scale(_etmiss_HT_7j55,2.*norm); scale(_etmiss_HT_8j55,2.*norm); scale(_etmiss_HT_9j55,2.*norm); scale(_etmiss_HT_6j80,2.*norm); scale(_etmiss_HT_7j80,2.*norm); scale(_etmiss_HT_8j80,2.*norm); scale(_hist_njet55,norm); scale(_hist_njet80,norm); scale(_count_7j55,norm); scale(_count_8j55,norm); scale(_count_9j55,norm); scale(_count_6j80,norm); scale(_count_7j80,norm); scale(_count_8j80,norm); } private: /// @name Histograms //@{ Histo1DPtr _etmiss_HT_7j55; Histo1DPtr _etmiss_HT_8j55; Histo1DPtr _etmiss_HT_9j55; Histo1DPtr _etmiss_HT_6j80; Histo1DPtr _etmiss_HT_7j80; Histo1DPtr _etmiss_HT_8j80; Histo1DPtr _hist_njet55; Histo1DPtr _hist_njet80; Histo1DPtr _count_7j55; Histo1DPtr _count_8j55; Histo1DPtr _count_9j55; Histo1DPtr _count_6j80; Histo1DPtr _count_7j80; Histo1DPtr _count_8j80; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1117704); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1125575.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1125575.cc rename from analyses/pluginATLAS/ATLAS_2012_I1125575.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1125575.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1125575.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1125575.cc @@ -1,241 +1,241 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// ATLAS charged particle jet underlying event and jet radius dependence class ATLAS_2012_I1125575 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_I1125575() : Analysis("ATLAS_2012_I1125575") { } //@} /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { const ChargedFinalState jet_input(-2.5, 2.5, 0.5*GeV); declare(jet_input, "JET_INPUT"); const ChargedFinalState track_input(-1.5, 1.5, 0.5*GeV); declare(track_input, "TRACK_INPUT"); const FastJets jets02(jet_input, FastJets::ANTIKT, 0.2); declare(jets02, "JETS_02"); const FastJets jets04(jet_input, FastJets::ANTIKT, 0.4); declare(jets04, "JETS_04"); const FastJets jets06(jet_input, FastJets::ANTIKT, 0.6); declare(jets06, "JETS_06"); const FastJets jets08(jet_input, FastJets::ANTIKT, 0.8); declare(jets08, "JETS_08"); const FastJets jets10(jet_input, FastJets::ANTIKT, 1.0); declare(jets10, "JETS_10"); // Mean number of tracks initializeProfiles(_h_meanNch, 1); // Mean of the average track pT in each region initializeProfiles(_h_meanPtAvg, 2); // Mean of the scalar sum of track pT in each region initializeProfiles(_h_meanPtSum, 3); // Distribution of Nch, in bins of leading track-jet pT initializeHistograms(_h_Nch, 4); // Distribution of average track-jet pT, in bins of leading track-jet pT initializeHistograms(_h_PtAvg, 5); // Distribution of sum of track-jet pT, in bins of leading track-jet pT initializeHistograms(_h_PtSum, 6); for (int i = 0; i < 5; ++i) _nEvents[i] = 0.0; } void initializeProfiles(Profile1DPtr plots[5][2], int distribution) { for (int i = 0; i < 5; ++i) { for (int j = 0; j < 2; ++j) { book(plots[i][j] ,distribution, i+1, j+1); } } } - void initializeHistograms(BinnedHistogram plots[5][2], int distribution) { + void initializeHistograms(BinnedHistogram plots[5][2], int distribution) { Scatter2D refscatter = refData(1, 1, 1); for (int i = 0; i < 5; ++i) { for (int y = 0; y < 2; ++y) { for (size_t j = 0; j < refscatter.numPoints(); ++j) { int histogram_number = ((j+1)*2)-((y+1)%2); double low_edge = refscatter.point(j).xMin(); double high_edge = refscatter.point(j).xMax(); Histo1DPtr tmp; - plots[i][y].addHistogram(low_edge, high_edge, book(tmp, distribution, i+1, histogram_number)); + plots[i][y].add(low_edge, high_edge, book(tmp, distribution, i+1, histogram_number)); } } } } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; vector all_jets; Jets jets_02 = apply(event, "JETS_02").jetsByPt(Cuts::pT > 4*GeV && Cuts::abseta < 1.5); all_jets.push_back(&jets_02); Jets jets_04 = apply(event, "JETS_04").jetsByPt(Cuts::pT > 4*GeV && Cuts::abseta < 1.5); all_jets.push_back(&jets_04); Jets jets_06 = apply(event, "JETS_06").jetsByPt(Cuts::pT > 4*GeV && Cuts::abseta < 1.5); all_jets.push_back(&jets_06); Jets jets_08 = apply(event, "JETS_08").jetsByPt(Cuts::pT > 4*GeV && Cuts::abseta < 1.5); all_jets.push_back(&jets_08); Jets jets_10 = apply(event, "JETS_10").jetsByPt(Cuts::pT > 4*GeV && Cuts::abseta < 1.5); all_jets.push_back(&jets_10); // Count the number of tracks in the away and transverse regions, for each set of jets double n_ch[5][2] = { {0,0}, {0,0}, {0,0}, {0,0}, {0,0} }; // Also add up the sum pT double sumpt[5][2] = { {0,0}, {0,0}, {0,0}, {0,0}, {0,0} }; // ptmean = sumpt / n_ch double ptavg[5][2] = { {0,0}, {0,0}, {0,0}, {0,0}, {0,0} }; // lead jet pT defines which bin we want to fill double lead_jet_pts[5] = {0.0}; // Loop over each of the jet radii: for (int i = 0; i < 5; ++i) { if (all_jets[i]->size() < 1) continue; // Find the lead jet pT lead_jet_pts[i] = all_jets[i]->at(0).pT(); // Loop over each of the charged particles const Particles& tracks = apply(event, "TRACK_INPUT").particlesByPt(); foreach(const Particle& t, tracks) { // Get the delta-phi between the track and the leading jet double dphi = deltaPhi(all_jets[i]->at(0), t); // Find out which region this puts it in. // 0 = away region, 1 = transverse region, 2 = toward region int region = region_index(dphi); // If the track is in the toward region, ignore it. if (region == 2) continue; // Otherwise, increment the relevant counters ++n_ch[i][region]; sumpt[i][region] += t.pT(); } // Calculate the pT_avg for the away and transverse regions. // (And make sure we don't try to divide by zero.) ptavg[i][0] = (n_ch[i][0] == 0 ? 0.0 : sumpt[i][0] / n_ch[i][0]); ptavg[i][1] = (n_ch[i][1] == 0 ? 0.0 : sumpt[i][1] / n_ch[i][1]); _nEvents[i] += weight; } fillProfiles(_h_meanNch, n_ch, lead_jet_pts, weight, 1.0 / (2*PI)); fillProfiles(_h_meanPtAvg, ptavg, lead_jet_pts, weight, 1.0); fillProfiles(_h_meanPtSum, sumpt, lead_jet_pts, weight, 1.0 / (2*PI)); fillHistograms(_h_Nch, n_ch, lead_jet_pts, weight); fillHistograms(_h_PtAvg, ptavg, lead_jet_pts, weight); fillHistograms(_h_PtSum, sumpt, lead_jet_pts, weight); } void fillProfiles(Profile1DPtr plots[5][2], double var[5][2], double lead_pt[5], double weight, double scale) { for (int i=0; i<5; ++i) { double pt = lead_pt[i]; for (int j=0; j<2; ++j) { double v = var[i][j]; plots[i][j]->fill(pt, v*scale, weight); } } } - void fillHistograms(BinnedHistogram plots[5][2], double var[5][2], double lead_pt[5], double weight) { + void fillHistograms(BinnedHistogram plots[5][2], double var[5][2], double lead_pt[5], double weight) { for (int i=0; i<5; ++i) { double pt = lead_pt[i]; for (int j=0; j<2; ++j) { double v = var[i][j]; plots[i][j].fill(pt, v, weight); } } } int region_index(double dphi) { assert(inRange(dphi, 0.0, PI, CLOSED, CLOSED)); if (dphi < PI/3.0) return 2; if (dphi < 2*PI/3.0) return 1; return 0; } /// Normalise histograms etc., after the run void finalize() { finalizeHistograms(_h_Nch); finalizeHistograms(_h_PtAvg); finalizeHistograms(_h_PtSum); } - void finalizeHistograms(BinnedHistogram plots[5][2]) { + void finalizeHistograms(BinnedHistogram plots[5][2]) { for (int i = 0; i < 5; ++i) { for (int j = 0; j < 2; ++j) { vector histos = plots[i][j].histos(); foreach(Histo1DPtr h, histos) { scale(h, 1.0/_nEvents[i]); } } } } //@} private: // Data members like post-cuts event weight counters go here double _nEvents[5]; Profile1DPtr _h_meanNch[5][2]; Profile1DPtr _h_meanPtAvg[5][2]; Profile1DPtr _h_meanPtSum[5][2]; - BinnedHistogram _h_Nch[5][2]; - BinnedHistogram _h_PtAvg[5][2]; - BinnedHistogram _h_PtSum[5][2]; + BinnedHistogram _h_Nch[5][2]; + BinnedHistogram _h_PtAvg[5][2]; + BinnedHistogram _h_PtSum[5][2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1125575); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1125961.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1125961.cc rename from analyses/pluginATLAS/ATLAS_2012_I1125961.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1125961.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1125961.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1125961.cc @@ -1,316 +1,315 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_I1125961 : public Analysis { public: /// Constructor ATLAS_2012_I1125961() : Analysis("ATLAS_2012_I1125961") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // Projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // Projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // All tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0), "cfs"); // Used for pTmiss (N.B. the real 'vfs' extends beyond 4.5 to |eta| = 4.9) declare(VisibleFinalState(Cuts::abseta < 4.5), "vfs"); // Book histograms book(_count_A_tight ,"count_A_tight" , 1, 0., 1.); book(_count_A_medium ,"count_A_medium" , 1, 0., 1.); book(_count_Ap_medium ,"count_Ap_medium" , 1, 0., 1.); book(_count_B_tight ,"count_B_tight" , 1, 0., 1.); book(_count_C_tight ,"count_C_tight" , 1, 0., 1.); book(_count_C_medium ,"count_C_medium" , 1, 0., 1.); book(_count_C_loose ,"count_C_loose" , 1, 0., 1.); book(_count_D_tight ,"count_D_tight" , 1, 0., 1.); book(_count_E_tight ,"count_E_tight" , 1, 0., 1.); book(_count_E_medium ,"count_E_medium" , 1, 0., 1.); book(_count_E_loose ,"count_E_loose" , 1, 0., 1.); book(_hist_meff_A ,"hist_m_eff_A" , 30, 0., 3000.); book(_hist_meff_Ap ,"hist_m_eff_Ap", 30, 0., 3000.); book(_hist_meff_B ,"hist_m_eff_B" , 30, 0., 3000.); book(_hist_meff_C ,"hist_m_eff_C" , 30, 0., 3000.); book(_hist_meff_D ,"hist_m_eff_D" , 30, 0., 3000.); book(_hist_meff_E ,"hist_m_eff_E" , 30, 0., 3000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets cand_jets; const Jets jets = apply(event, "AntiKtJets04").jetsByPt(20.0*GeV); foreach (const Jet& jet, jets) { if ( fabs( jet.eta() ) < 4.9 ) { cand_jets.push_back(jet); } } const Particles cand_e = apply(event, "elecs").particlesByPt(); // Muon isolation not mentioned in hep-exp 1109.6572 but assumed to still be applicable Particles cand_mu; const Particles chg_tracks = apply(event, "cfs").particles(); const Particles muons = apply(event, "muons").particlesByPt(); foreach (const Particle& mu, muons) { double pTinCone = -mu.pT(); foreach (const Particle& track, chg_tracks) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) { pTinCone += track.pT(); } } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // Resolve jet-lepton overlap for jets with |eta| < 2.8 Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) >= 2.8 ) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } Particles recon_e, recon_mu; foreach ( const Particle & e, cand_e ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_e.push_back( e ); } foreach ( const Particle & mu, cand_mu ) { bool away = true; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { away = false; break; } } if ( away ) recon_mu.push_back( mu ); } // pTmiss // Based on all candidate electrons, muons and jets, plus everything else with |eta| < 4.5 // i.e. everything in our projection "vfs" plus the jets with |eta| > 4.5 Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } foreach ( const Jet& jet, cand_jets ) { if ( fabs( jet.eta() ) > 4.5 ) pTmiss -= jet.momentum(); } double eTmiss = pTmiss.pT(); // no electron pT> 20 or muons pT>10 if ( !recon_mu.empty() || !recon_e.empty() ) { MSG_DEBUG("Charged leptons left after selection"); vetoEvent; } if ( eTmiss <= 160 * GeV ) { MSG_DEBUG("Not enough eTmiss: " << eTmiss << " < 130"); vetoEvent; } if ( recon_jets.size()<2 || recon_jets[0].pT() <= 130.0 * GeV || recon_jets[0].pT() <= 60.0 * GeV ) { MSG_DEBUG("No hard leading jet in " << recon_jets.size() << " jets"); vetoEvent; } // ==================== observables ==================== int Njets = 0; double min_dPhi_All = 999.999; double min_dPhi_2 = 999.999; double min_dPhi_3 = 999.999; double pTmiss_phi = pTmiss.phi(); foreach ( const Jet& jet, recon_jets ) { if ( jet.pT() < 40 * GeV ) continue; if ( Njets < 2 ) { min_dPhi_2 = min( min_dPhi_2, deltaPhi( pTmiss_phi, jet.phi() ) ); } if( Njets < 3) { min_dPhi_3 = min( min_dPhi_3, deltaPhi( pTmiss_phi, jet.phi() ) ); } min_dPhi_All = min( min_dPhi_All, deltaPhi( pTmiss_phi, jet.phi() ) ); ++Njets; } // inclusive meff double m_eff_inc = eTmiss; foreach ( const Jet& jet, recon_jets ) { double perp = jet.pT(); if(perp>40.) m_eff_inc += perp; } // region A double m_eff_Nj = eTmiss + recon_jets[0].pT() + recon_jets[1].pT(); if( min_dPhi_2 > 0.4 && eTmiss/m_eff_Nj > 0.3 ) { _hist_meff_A->fill(m_eff_inc,weight); if(m_eff_inc>1900.) _count_A_tight ->fill(0.5,weight); if(m_eff_inc>1400.) _count_A_medium->fill(0.5,weight); } // region A' if( min_dPhi_2 > 0.4 && eTmiss/m_eff_Nj > 0.4 ) { _hist_meff_Ap->fill(m_eff_inc,weight); if(m_eff_inc>1200.) _count_Ap_medium->fill(0.5,weight); } // for rest of regions 3 jets pT> 60 needed if(recon_jets.size()<3 || recon_jets[2].perp()<60.) vetoEvent; // region B m_eff_Nj += recon_jets[2].perp(); if( min_dPhi_3 > 0.4 && eTmiss/m_eff_Nj > 0.25 ) { _hist_meff_B->fill(m_eff_inc,weight); if(m_eff_inc>1900.) _count_B_tight ->fill(0.5,weight); } // for rest of regions 4 jets pT> 60 needed if(recon_jets.size()<4 || recon_jets[3].perp()<60.) vetoEvent; // region C m_eff_Nj += recon_jets[3].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.25 ) { _hist_meff_C->fill(m_eff_inc,weight); if(m_eff_inc>1500.) _count_C_tight ->fill(0.5,weight); if(m_eff_inc>1200.) _count_C_medium->fill(0.5,weight); if(m_eff_inc> 900.) _count_C_loose ->fill(0.5,weight); } // for rest of regions 5 jets pT> 40 needed if(recon_jets.size()<5 || recon_jets[4].perp()<40.) vetoEvent; // region D m_eff_Nj += recon_jets[4].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.2 ) { _hist_meff_D->fill(m_eff_inc,weight); if(m_eff_inc>1500.) _count_D_tight ->fill(0.5,weight); } // for rest of regions 6 jets pT> 40 needed if(recon_jets.size()<6 || recon_jets[5].perp()<40.) vetoEvent; // region E m_eff_Nj += recon_jets[5].perp(); if( min_dPhi_3 > 0.4 && min_dPhi_All > 0.2 && eTmiss/m_eff_Nj > 0.15 ) { _hist_meff_E->fill(m_eff_inc,weight); if(m_eff_inc>1400.) _count_E_tight ->fill(0.5,weight); if(m_eff_inc>1200.) _count_E_medium->fill(0.5,weight); if(m_eff_inc> 900.) _count_E_loose ->fill(0.5,weight); } } void finalize() { double norm = crossSection()/femtobarn*4.7/sumOfWeights(); // these are number of events at 4.7fb^-1 per 100 GeV scale( _hist_meff_A , 100. * norm ); scale( _hist_meff_Ap, 100. * norm ); scale( _hist_meff_B , 100. * norm ); scale( _hist_meff_C , 100. * norm ); scale( _hist_meff_D , 100. * norm ); scale( _hist_meff_E , 100. * norm ); // these are number of events at 4.7fb^-1 scale(_count_A_tight ,norm); scale(_count_A_medium ,norm); scale(_count_Ap_medium,norm); scale(_count_B_tight ,norm); scale(_count_C_tight ,norm); scale(_count_C_medium ,norm); scale(_count_C_loose ,norm); scale(_count_D_tight ,norm); scale(_count_E_tight ,norm); scale(_count_E_medium ,norm); scale(_count_E_loose ,norm); } //@} private: Histo1DPtr _count_A_tight; Histo1DPtr _count_A_medium; Histo1DPtr _count_Ap_medium; Histo1DPtr _count_B_tight; Histo1DPtr _count_C_tight; Histo1DPtr _count_C_medium; Histo1DPtr _count_C_loose; Histo1DPtr _count_D_tight; Histo1DPtr _count_E_tight; Histo1DPtr _count_E_medium; Histo1DPtr _count_E_loose; Histo1DPtr _hist_meff_A ; Histo1DPtr _hist_meff_Ap; Histo1DPtr _hist_meff_B ; Histo1DPtr _hist_meff_C ; Histo1DPtr _hist_meff_D ; Histo1DPtr _hist_meff_E ; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1125961); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1126136.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1126136.cc rename from analyses/pluginATLAS/ATLAS_2012_I1126136.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1126136.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1126136.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1126136.cc @@ -1,300 +1,299 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2012_I1126136 : public Analysis { public: /// Constructor ATLAS_2012_I1126136() : Analysis("ATLAS_2012_I1126136") { } /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); // Book histograms book(_count_SR_A ,"count_SR_A" , 1, 0., 1.); book(_count_SR_B ,"count_SR_B" , 1, 0., 1.); book(_hist_mjjj1 ,"hist_mjjj1" , 30 , 0. , 600. ); book(_hist_mjjj2 ,"hist_mjjj2" , 30 , 0. , 600. ); book(_hist_ETmiss ,"hist_ETmiss", 20 , 100. , 600. ); book(_hist_mT2 ,"hist_mT2" , 200, 0. , 1000. ); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // pTmiss FourMomentum pTmiss; foreach (const Particle& p, apply(event, "vfs").particles() ) { pTmiss -= p.momentum(); } double ETmiss = pTmiss.pT(); // require eTmiss > 150 if (ETmiss < 150*GeV) vetoEvent; // get the candiate jets Jets cand_jets; foreach ( const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if (jet.abseta() < 4.5) cand_jets.push_back(jet); } // find the electrons Particles cand_e; foreach( const Particle& e, apply(event, "elecs").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool e_near_jet = false; foreach ( const Jet& jet, cand_jets ) { double dR = deltaR(e, jet); if (inRange(dR, 0.2, 0.4)) { e_near_jet = true; break; } } if ( e_near_jet ) continue; cand_e.push_back(e); } // find the muons Particles cand_mu; foreach( const Particle& mu, apply(event, "muons").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool mu_near_jet = false; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(mu, jet) < 0.4 ) { mu_near_jet = true; break; } } if ( mu_near_jet ) continue; cand_mu.push_back(mu); } // veto events with leptons if( ! cand_e.empty() || ! cand_mu.empty() ) vetoEvent; // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if (jet.abseta() > 2.8 || jet.pT() < 30*GeV) continue; bool away_from_e = true; foreach (const Particle& e, cand_e ) { if ( deltaR(e, jet) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // find b jets Jets tight_bjets,loose_bjets; foreach(const Jet& jet, recon_jets) { /// @todo Should be abseta? if (!jet.bTagged() && jet.eta()>2.5) continue; double prob = rand()/static_cast(RAND_MAX); if (prob <= 0.60) tight_bjets.push_back(jet); if (prob <= 0.75) loose_bjets.push_back(jet); } // require >=1 tight or >=2 loose b-jets if (! ( !tight_bjets.empty() || loose_bjets.size()>=2) ) vetoEvent; // must be at least 6 jets with pT>30 if (recon_jets.size()<6 ) vetoEvent; // hardest > 130 if (recon_jets[0].perp() < 130. ) vetoEvent; // three hardest jets must be separated from etmiss for (unsigned int ix=0;ix<3;++ix) { if (deltaPhi(recon_jets[ix].momentum(),pTmiss)<0.2*PI) vetoEvent; } // remove events with tau like jets for (unsigned int ix=3;ix=0.2*PI) continue; // check the number of tracks between 1 and 4 unsigned int ncharged=0; foreach ( const Particle & particle, recon_jets[ix].particles()) { if (PID::threeCharge(particle.pid())!=0) ++ncharged; } if (ncharged==0 || ncharged>4) continue; // calculate transverse mass and reject if < 100 double mT = 2.*recon_jets[ix].perp()*ETmiss -recon_jets[ix].px()*pTmiss.px() -recon_jets[ix].py()*pTmiss.py(); if (mT<100.) vetoEvent; } // if 2 loose b-jets apply mT cut if (loose_bjets.size()>=2) { // find b-jet closest to eTmiss double minR(1e30); unsigned int ijet(0); for(unsigned int ix=0;ixfill(mjjj1,weight); _hist_mjjj2->fill(mjjj2,weight); // require triplets in 80270.||mjjj2<80.||mjjj2>270.) vetoEvent; // counts in signal regions _count_SR_A->fill(0.5,weight); if(ETmiss>260.) _count_SR_B->fill(0.5,weight); _hist_ETmiss->fill(ETmiss,weight); double m_T2 = mT2::mT2( pjjj1,pjjj2, pTmiss,0.0 ); // zero mass invisibles _hist_mT2->fill(m_T2,weight); } //@} void finalize() { double norm = 4.7* crossSection()/sumOfWeights()/femtobarn; scale(_count_SR_A , norm ); scale(_count_SR_B , norm ); scale(_hist_mjjj1 , 20.*norm ); scale(_hist_ETmiss, 50.*norm ); scale(_hist_mjjj2 , 20.*norm ); scale(_hist_mT2 , norm ); } private: /// @name Histograms //@{ Histo1DPtr _count_SR_A; Histo1DPtr _count_SR_B; Histo1DPtr _hist_mjjj1; Histo1DPtr _hist_mjjj2; Histo1DPtr _hist_ETmiss; Histo1DPtr _hist_mT2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1126136); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1180197.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1180197.cc rename from analyses/pluginATLAS/ATLAS_2012_I1180197.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1180197.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1180197.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1180197.cc @@ -1,416 +1,415 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class ATLAS_2012_I1180197 : public Analysis { public: /// Constructor ATLAS_2012_I1180197() : Analysis("ATLAS_2012_I1180197") { } /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 7*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 6*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9), "vfs"); // Book histograms book(_count_1l_3jet_all_channel ,"count_1l_3jet_all_channel", 1, 0., 1.); book(_count_1l_3jet_e_channel ,"count_1l_3jet_e_channel" , 1, 0., 1.); book(_count_1l_3jet_mu_channel ,"count_1l_3jet_mu_channel" , 1, 0., 1.); book(_count_1l_4jet_all_channel ,"count_1l_4jet_all_channel", 1, 0., 1.); book(_count_1l_4jet_e_channel ,"count_1l_4jet_e_channel" , 1, 0., 1.); book(_count_1l_4jet_mu_channel ,"count_1l_4jet_mu_channel" , 1, 0., 1.); book(_count_1l_soft_all_channel ,"count_1l_soft_all_channel", 1, 0., 1.); book(_count_1l_soft_e_channel ,"count_1l_soft_e_channel" , 1, 0., 1.); book(_count_1l_soft_mu_channel ,"count_1l_soft_mu_channel" , 1, 0., 1.); book(_count_2l_2jet_all_channel ,"count_2l_2jet_all_channel" , 1, 0., 1.); book(_count_2l_2jet_ee_channel ,"count_2l_2jet_ee_channel" , 1, 0., 1.); book(_count_2l_2jet_emu_channel ,"count_2l_2jet_emu_channel" , 1, 0., 1.); book(_count_2l_2jet_mumu_channel ,"count_2l_2jet_mumu_channel", 1, 0., 1.); book(_count_2l_4jet_all_channel ,"count_2l_4jet_all_channel" , 1, 0., 1.); book(_count_2l_4jet_ee_channel ,"count_2l_4jet_ee_channel" , 1, 0., 1.); book(_count_2l_4jet_emu_channel ,"count_2l_4jet_emu_channel" , 1, 0., 1.); book(_count_2l_4jet_mumu_channel ,"count_2l_4jet_mumu_channel", 1, 0., 1.); book(_hist_1l_m_eff_3jet ,"hist_1l_m_eff_3jet" , 6, 400., 1600.); book(_hist_1l_m_eff_4jet ,"hist_1l_m_eff_4jet" , 4, 800., 1600.); book(_hist_1l_eTmiss_m_eff_soft ,"hist_1l_eTmiss_m_eff_soft", 6, 0.1 , 0.7 ); book(_hist_2l_m_eff_2jet ,"hist_2l_m_eff_2jet" , 5, 700., 1700.); book(_hist_2l_m_eff_4jet ,"hist_2l_m_eff_4jet" , 5, 600., 1600.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the candiate jets Jets cand_jets; foreach ( const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 4.5 ) { cand_jets.push_back(jet); } } // charged tracks for isolation Particles chg_tracks = apply(event, "cfs").particles(); // find the electrons Particles cand_soft_e,cand_hard_e; foreach( const Particle & e, apply(event, "elecs").particlesByPt()) { double pT = e.pT(); double eta = e.eta(); // remove any leptons within 0.4 of any candidate jets bool e_near_jet = false; foreach ( const Jet& jet, cand_jets ) { double dR = deltaR(e.momentum(),jet.momentum()); if ( inRange(dR, 0.2, 0.4) ) { e_near_jet = true; break; } } if ( e_near_jet ) continue; // soft selection if(pT>7.&&!(fabs(eta)>1.37&&fabs(eta) < 1.52)) { cand_soft_e.push_back(e); } // hard selection if(pT>10.) cand_hard_e.push_back(e); } Particles cand_soft_mu,cand_hard_mu; foreach( const Particle & mu, apply(event, "muons").particlesByPt()) { double pT = mu.pT(); double eta = mu.eta(); // remove any leptons within 0.4 of any candidate jets bool mu_near_jet = false; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( mu_near_jet ) continue; // soft selection if (pT > 6*GeV && !inRange(fabs(eta), 1.37, 1.52)) { cand_soft_mu.push_back(mu); } // hard selection if (pT > 10*GeV) cand_hard_mu.push_back(mu); } // pTcone around muon track (hard) Particles recon_hard_mu; foreach ( const Particle & mu, cand_hard_mu ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_hard_mu.push_back(mu); } // pTcone around muon track (soft) Particles recon_soft_mu; foreach ( const Particle & mu, cand_soft_mu ) { double pTinCone = -mu.pT(); if(-pTinCone>20.) continue; foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_soft_mu.push_back(mu); } // pTcone around electron track (hard) Particles recon_hard_e; foreach ( const Particle & e, cand_hard_e ) { double pTinCone = -e.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1 * e.pT() ) recon_hard_e.push_back(e); } // pTcone around electron track (soft) Particles recon_soft_e; foreach ( const Particle & e, cand_soft_e ) { double pTinCone = -e.pT(); if(-pTinCone>25.) continue; foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1 * e.pT() ) recon_soft_e.push_back(e); } // pTmiss FourMomentum pTmiss; foreach ( const Particle & p, apply(event, "vfs").particles() ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // hard lepton selection if( ! recon_hard_e.empty() || !recon_hard_mu.empty() ) { // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if(jet.abseta()>2.5|| jet.pT() < 25*GeV) continue; bool away_from_e = true; foreach ( const Particle & e, cand_hard_e ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // both selections require at least 2 jets // meff calculation double HT=0.; foreach( const Jet & jet, recon_jets) { HT += jet.pT(); } double m_eff_inc = HT+eTmiss; unsigned int njet = recon_jets.size(); // 1 lepton only if( recon_hard_e.size() + recon_hard_mu.size() == 1 && njet >=3 ) { // get the lepton Particle lepton = recon_hard_e.empty() ? recon_hard_mu[0] : recon_hard_e[0]; // lepton variables double pT = lepton.pT(); double mT = 2.*(pT*eTmiss - lepton.px()*pTmiss.px() - lepton.py()*pTmiss.py()); mT = sqrt(mT); HT += pT; m_eff_inc += pT; // apply the cuts on the leptons and min no. of jets if( ( ( lepton.abspid() == PID::ELECTRON && pT > 25. ) || ( lepton.abspid() == PID::MUON && pT > 20. ) ) && mT > 100. && eTmiss > 250. ) { double m_eff = pT+eTmiss; for (size_t ix = 0; ix < 3; ++ix) m_eff += recon_jets[ix].pT(); // 3 jet channel if ( (njet == 3 || recon_jets[3].pT() < 80*GeV ) && recon_jets[0].pT() > 100*GeV ) { if (eTmiss/m_eff > 0.3) { if (m_eff_inc > 1200*GeV) { _count_1l_3jet_all_channel->fill(0.5,weight); if (lepton.abspid() == PID::ELECTRON ) _count_1l_3jet_e_channel->fill(0.5, weight); else _count_1l_3jet_mu_channel->fill(0.5, weight); } _hist_1l_m_eff_3jet->fill(min(1599., m_eff_inc), weight); } } // 4 jet channel else if (njet >=4 && recon_jets[3].pT() > 80*GeV) { m_eff += recon_jets[3].pT(); if (eTmiss/m_eff>0.2) { if (m_eff_inc > 800*GeV) { _count_1l_4jet_all_channel->fill(0.5, weight); if(lepton.abspid() == PID::ELECTRON ) _count_1l_4jet_e_channel->fill(0.5, weight); else _count_1l_4jet_mu_channel->fill(0.5, weight); } _hist_1l_m_eff_4jet->fill(min(1599., m_eff_inc), weight); } } } } // multi lepton else if( recon_hard_e.size() + recon_hard_mu.size() >= 2 && njet >=2 ) { // get all the leptons and sort them by pT Particles leptons(recon_hard_e.begin(),recon_hard_e.end()); leptons.insert(leptons.begin(),recon_hard_mu.begin(),recon_hard_mu.end()); std::sort(leptons.begin(), leptons.end(), cmpMomByPt); double m_eff(0.0); for (size_t ix = 0; ix < leptons.size(); ++ix) m_eff += leptons[ix].pT(); m_eff_inc += m_eff; m_eff += eTmiss; for (size_t ix = 0; ix < (size_t) min(4, int(recon_jets.size())); ++ix) m_eff += recon_jets[ix].pT(); // require opposite sign leptons if (leptons[0].pid()*leptons[1].pid()<0) { // 2 jet if (recon_jets[1].pT()>200 && ( njet<4 || (njet>=4 && recon_jets[3].pT() < 50*GeV)) && eTmiss > 300*GeV) { _count_2l_2jet_all_channel->fill(0.5, weight); if (leptons[0].abspid() == PID::ELECTRON && leptons[1].abspid() == PID::ELECTRON ) _count_2l_2jet_ee_channel->fill(0.5, weight); else if (leptons[0].abspid() == PID::MUON && leptons[1].abspid() == PID::MUON ) _count_2l_2jet_mumu_channel->fill(0.5, weight); else _count_2l_2jet_emu_channel->fill(0.5, weight); _hist_2l_m_eff_2jet->fill(min(1699., m_eff_inc), weight); } // 4 jet else if (njet >= 4 && recon_jets[3].pT() > 50*GeV && eTmiss > 100*GeV && eTmiss/m_eff > 0.2) { if ( m_eff_inc > 650*GeV ) { _count_2l_4jet_all_channel->fill(0.5, weight); if (leptons[0].abspid() == PID::ELECTRON && leptons[1].abspid() == PID::ELECTRON ) _count_2l_4jet_ee_channel->fill(0.5, weight); else if (leptons[0].abspid() == PID::MUON && leptons[1].abspid() == PID::MUON ) _count_2l_4jet_mumu_channel->fill(0.5, weight); else _count_2l_4jet_emu_channel->fill(0.5, weight); } _hist_2l_m_eff_4jet->fill(min(1599., m_eff_inc), weight); } } } } // soft lepton selection if ( recon_soft_e.size() + recon_soft_mu.size() == 1 ) { // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if (jet.abseta() > 2.5 || jet.pT() < 25*GeV) continue; bool away_from_e = true; foreach ( const Particle & e, cand_soft_e ) { if ( deltaR(e.momentum(), jet.momentum()) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // meff calculation double HT=0.; foreach (const Jet & jet, recon_jets) { HT += jet.pT(); } double m_eff_inc = HT+eTmiss; // get the lepton Particle lepton = recon_soft_e.empty() ? recon_soft_mu[0] : recon_soft_e[0]; // lepton variables double pT = lepton.pT(); double mT = 2.*(pT*eTmiss - lepton.px()*pTmiss.px() - lepton.py()*pTmiss.py()); mT = sqrt(mT); m_eff_inc += pT; double m_eff = pT+eTmiss; // apply final cuts if (recon_jets.size() >= 2 && recon_jets[0].pT()>130*GeV && mT > 100*GeV && eTmiss > 250*GeV) { for (size_t ix = 0; ix < 2; ++ix) m_eff += recon_jets[0].pT(); if (eTmiss/m_eff > 0.3) { _count_1l_soft_all_channel->fill(0.5, weight); if (lepton.abspid() == PID::ELECTRON ) _count_1l_soft_e_channel->fill(0.5, weight); else _count_1l_soft_mu_channel->fill(0.5, weight); } _hist_1l_eTmiss_m_eff_soft->fill( eTmiss/m_eff_inc, weight); } } } void finalize() { double norm = 4.7* crossSection()/sumOfWeights()/femtobarn; scale(_count_1l_3jet_all_channel ,norm); scale(_count_1l_3jet_e_channel ,norm); scale(_count_1l_3jet_mu_channel ,norm); scale(_count_1l_4jet_all_channel ,norm); scale(_count_1l_4jet_e_channel ,norm); scale(_count_1l_4jet_mu_channel ,norm); scale(_count_1l_soft_all_channel ,norm); scale(_count_1l_soft_e_channel ,norm); scale(_count_1l_soft_mu_channel ,norm); scale(_count_2l_2jet_all_channel ,norm); scale(_count_2l_2jet_ee_channel ,norm); scale(_count_2l_2jet_emu_channel ,norm); scale(_count_2l_2jet_mumu_channel ,norm); scale(_count_2l_4jet_all_channel ,norm); scale(_count_2l_4jet_ee_channel ,norm); scale(_count_2l_4jet_emu_channel ,norm); scale(_count_2l_4jet_mumu_channel ,norm); scale(_hist_1l_m_eff_3jet ,200.*norm); scale(_hist_1l_m_eff_4jet ,200.*norm); scale(_hist_1l_eTmiss_m_eff_soft ,0.1*norm); scale(_hist_2l_m_eff_2jet ,200.*norm); scale(_hist_2l_m_eff_4jet ,200.*norm); } private: /// @name Histos //@{ Histo1DPtr _count_1l_3jet_all_channel; Histo1DPtr _count_1l_3jet_e_channel; Histo1DPtr _count_1l_3jet_mu_channel; Histo1DPtr _count_1l_4jet_all_channel; Histo1DPtr _count_1l_4jet_e_channel; Histo1DPtr _count_1l_4jet_mu_channel; Histo1DPtr _count_1l_soft_all_channel; Histo1DPtr _count_1l_soft_e_channel; Histo1DPtr _count_1l_soft_mu_channel; Histo1DPtr _count_2l_2jet_all_channel; Histo1DPtr _count_2l_2jet_ee_channel; Histo1DPtr _count_2l_2jet_emu_channel; Histo1DPtr _count_2l_2jet_mumu_channel; Histo1DPtr _count_2l_4jet_all_channel; Histo1DPtr _count_2l_4jet_ee_channel; Histo1DPtr _count_2l_4jet_emu_channel; Histo1DPtr _count_2l_4jet_mumu_channel; Histo1DPtr _hist_1l_m_eff_3jet; Histo1DPtr _hist_1l_m_eff_4jet; Histo1DPtr _hist_1l_eTmiss_m_eff_soft; Histo1DPtr _hist_2l_m_eff_2jet; Histo1DPtr _hist_2l_m_eff_4jet; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1180197); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1186556.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1186556.cc rename from analyses/pluginATLAS/ATLAS_2012_I1186556.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1186556.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1186556.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1186556.cc @@ -1,233 +1,232 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { class ATLAS_2012_I1186556 : public Analysis { public: /// Constructor ATLAS_2012_I1186556() : Analysis("ATLAS_2012_I1186556") { } /// @name Analysis methods //@{ /// Book histograms and initialize projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // Jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3.0 && Cuts::pT > 1*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); // Book histograms book(_count_SR_SF ,"count_SR_SF" , 1, 0., 1.); book(_count_SR_OF ,"count_SR_OF" , 1, 0., 1.); book(_hist_mT2_SF_exp ,"hist_mT2_SF_exp", 40 , 0., 200. ); book(_hist_mT2_OF_exp ,"hist_mT2_OF_exp", 40 , 0., 200. ); book(_hist_mT2_SF_MC ,"hist_mT2_SF_MC" , 500, 0., 1000.); book(_hist_mT2_OF_MC ,"hist_mT2_OF_MC" , 500, 0., 1000.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the candiate jets Jets cand_jets; foreach ( const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 4.5 ) { cand_jets.push_back(jet); } } // charged tracks for isolation Particles chg_tracks = apply(event, "cfs").particles(); // find the electrons Particles cand_e; foreach( const Particle & e, apply(event, "elecs").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool e_near_jet = false; foreach ( const Jet& jet, cand_jets ) { double dR = deltaR(e.momentum(),jet.momentum()); if ( dR < 0.4 && dR > 0.2 ) { e_near_jet = true; break; } } if ( e_near_jet ) continue; cand_e.push_back(e); } Particles cand_mu; foreach( const Particle & mu, apply(event, "muons").particlesByPt()) { // remove any leptons within 0.4 of any candidate jets bool mu_near_jet = false; foreach ( const Jet& jet, cand_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( mu_near_jet ) continue; cand_mu.push_back(mu); } // pTcone around muon track Particles recon_mu; foreach ( const Particle & mu, cand_mu ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_mu.push_back(mu); } // pTcone around electron track Particles recon_e; foreach ( const Particle & e, cand_e ) { double pTinCone = -e.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1 * e.pT() ) recon_e.push_back(e); } // pTmiss FourMomentum pTmiss; foreach ( const Particle & p, apply(event, "vfs").particles() ) { pTmiss -= p.momentum(); } // discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { if(jet.abseta()>2.5|| jet.perp()<20.) continue; bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // put leptons into 1 vector and order by pT Particles leptons(recon_e.begin(),recon_e.end()); leptons.insert(leptons.begin(),recon_mu.begin(),recon_mu.end()); sort(leptons.begin(),leptons.end(),cmpMomByPt); // exactly two leptons if(leptons.size() !=2) vetoEvent; // hardest lepton pT greater the 25 (20) e(mu) if( (leptons[0].abspid()==PID::ELECTRON && leptons[0].perp()<25.) || (leptons[0].abspid()==PID::ELECTRON && leptons[0].perp()<20.)) vetoEvent; // require opposite sign if(leptons[0].pid()*leptons[1].pid()>0) vetoEvent; // and invariant mass > 20 double mll = (leptons[0].momentum()+leptons[1].momentum()).mass(); if(mll<20.) vetoEvent; // two jets 1st pT > 50 and second pT> 25 if(recon_jets.size()<2 || recon_jets[0].perp()<50. || recon_jets[1].perp()<25.) vetoEvent; // calculate mT2 double m_T2 = mT2::mT2( leptons[0].momentum(),leptons[1].momentum(), pTmiss,0.0 ); // zero mass invisibles // same flavour region if(leptons[0].pid()==-leptons[1].pid()) { // remove Z region if(mll>71.&&mll<111.) vetoEvent; // require at least 1 b jet unsigned int n_b=0; for(unsigned int ix=0;ix(RAND_MAX)<=0.60) ++n_b; } if(n_b==0) vetoEvent; _hist_mT2_SF_exp->fill(m_T2,weight); _hist_mT2_SF_MC ->fill(m_T2,weight); if(m_T2>120.) _count_SR_SF->fill(0.5,weight); } // opposite flavour region else { _hist_mT2_OF_exp->fill(m_T2,weight); _hist_mT2_OF_MC ->fill(m_T2,weight); if(m_T2>120.) _count_SR_OF->fill(0.5,weight); } } //@} void finalize() { double norm = 4.7* crossSection()/sumOfWeights()/femtobarn; scale(_count_SR_SF , norm); scale(_count_SR_OF , norm); scale(_hist_mT2_SF_exp,5.*norm); scale(_hist_mT2_OF_exp,5.*norm); scale(_hist_mT2_SF_MC , norm/4.7); scale(_hist_mT2_OF_MC , norm/4.7); } private: /// @name Histograms //@{ Histo1DPtr _count_SR_SF; Histo1DPtr _count_SR_OF; Histo1DPtr _hist_mT2_SF_exp; Histo1DPtr _hist_mT2_OF_exp; Histo1DPtr _hist_mT2_SF_MC; Histo1DPtr _hist_mT2_OF_MC; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1186556); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1188891.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1188891.cc rename from analyses/pluginATLAS/ATLAS_2012_I1188891.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1188891.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1188891.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1188891.cc @@ -1,146 +1,145 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Particle.hh" namespace Rivet { class ATLAS_2012_I1188891 : public Analysis { public: ATLAS_2012_I1188891() : Analysis("ATLAS_2012_I1188891") { } void init() { const FinalState fs; FastJets fj04(fs, FastJets::ANTIKT, 0.4); declare(fj04, "AntiKT04"); string histotitle[7]={"BBfraction","BCfraction","CCfraction","BUfraction","CUfraction","UUfraction","Total"}; for (int i = 0 ; i < 7 ; i++){ book(_h_temp[i] ,"TMP/"+histotitle[i],refData(1,1,1)); if (i < 6) { book(_h_results[i], i+1, 1, 1); } } } void analyze(const Event& event) { double weight = 1.0; double weight100 = 1.0 * 100.; //to get results in % //keeps jets with pt>20 geV and ordered in decreasing pt Jets jetAr = apply(event, "AntiKT04").jetsByPt(20*GeV); int flav[2]={1,1}; vector leadjets; //get b/c-hadrons vector B_hadrons, C_hadrons; vector allParticles = particles(event.genEvent()); for (size_t i = 0; i < allParticles.size(); i++) { const GenParticle* p = allParticles.at(i); if(p->momentum().perp()*GeV < 5) continue; if ( (Rivet::PID::isHadron ( p->pdg_id() ) && Rivet::PID::hasBottom( p->pdg_id() ) ) ) { B_hadrons.push_back(p); } if ( (Rivet::PID::isHadron( p->pdg_id() ) && Rivet::PID::hasCharm( p->pdg_id() ) ) ) { C_hadrons.push_back(p); } } //select dijet foreach (const Jet& jet, jetAr) { const double pT = jet.pT(); const double absy = jet.absrap(); bool isBjet = jet.bTagged(); bool isCjet = jet.cTagged(); int jetflav=1; if (isBjet)jetflav=5; else if (isCjet)jetflav=4; if (absy <= 2.1 && leadjets.size() < 2) { if (pT > 500*GeV) continue; if ((leadjets.empty() && pT < 40*GeV) || pT < 20*GeV) continue; leadjets.push_back(jet.momentum()); if (leadjets.size()==1) flav[0] = jetflav; if (leadjets.size()==2) flav[1] = jetflav; } } if (leadjets.size() < 2) vetoEvent; double pBinsLJ[7] = {40.,60.,80.,120.,160.,250.,500.}; int iPBinLJ = -1; for (int k = 0 ; k < 7 ; k++) { if (leadjets[0].pT() > pBinsLJ[k]*GeV) iPBinLJ=k; else break; } bool c_ljpt = (iPBinLJ != -1); bool c_nljpt = leadjets[1].pT() > 20*GeV; bool c_dphi = fabs( deltaPhi(leadjets[0],leadjets[1]) ) > 2.1; bool isDijet = c_ljpt & c_nljpt & c_dphi; if (!isDijet) vetoEvent; _h_temp[6]->fill(leadjets[0].pT(), weight); if (flav[0]==5 && flav[1]==5) // BB dijet _h_temp[0]->fill(leadjets[0].pT(), weight100); if ((flav[0]==5 && flav[1]==4) || (flav[0]==4 && flav[1]==5)) // BC dijet _h_temp[1]->fill(leadjets[0].pT(), weight100); if (flav[0]==4 && flav[1]==4) // CC dijet _h_temp[2]->fill(leadjets[0].pT(), weight100); if ((flav[0]==5 && flav[1]==1) || (flav[0]==1 && flav[1]==5)) // B-light dijet _h_temp[3]->fill(leadjets[0].pT(), weight100); if ((flav[0]==4 && flav[1]==1) || (flav[0]==1 && flav[1]==4)) // C-light dijet _h_temp[4]->fill(leadjets[0].pT(), weight100); if (flav[0]==1 && flav[1]==1) // light-light dijet _h_temp[5]->fill(leadjets[0].pT(), weight100); } void finalize() { divide(_h_temp[0], _h_temp[6], _h_results[0]); divide(_h_temp[1], _h_temp[6], _h_results[1]); divide(_h_temp[2], _h_temp[6], _h_results[2]); divide(_h_temp[3], _h_temp[6], _h_results[3]); divide(_h_temp[4], _h_temp[6], _h_results[4]); divide(_h_temp[5], _h_temp[6], _h_results[5]); } private: Histo1DPtr _h_temp[7]; Scatter2DPtr _h_results[6]; }; DECLARE_RIVET_PLUGIN(ATLAS_2012_I1188891); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1190891.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1190891.cc rename from analyses/pluginATLAS/ATLAS_2012_I1190891.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1190891.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1190891.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1190891.cc @@ -1,301 +1,300 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/RivetMT2.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_I1190891 : public Analysis { public: /// Constructor ATLAS_2012_I1190891() : Analysis("ATLAS_2012_I1190891") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 10*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); /// Jet finder declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(-3.0,3.0),"cfs"); // Book histograms book(_hist_etmiss ,"hist_etmiss",10,0.,500.); book(_hist_meff ,"hist_m_eff",7,0.,1050.); book(_count_SR1 ,"count_SR1", 1, 0., 1.); book(_count_SR2 ,"count_SR2", 1, 0., 1.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.5 ) { cand_jets.push_back(jet); } } // candidate muons Particles cand_mu; Particles chg_tracks = apply(event, "cfs").particles(); foreach ( const Particle & mu, apply(event, "muons").particlesByPt() ) { double pTinCone = -mu.pT(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) cand_mu.push_back(mu); } // candidate electrons Particles cand_e; foreach ( const Particle & e, apply(event, "elecs").particlesByPt() ) { double pTinCone = -e.perp(); foreach ( const Particle & track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) <= 0.2 ) pTinCone += track.pT(); } if (pTinCone/e.perp()<0.1) { cand_e.push_back(e); } } // resolve jet/lepton ambiguity Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle & e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // only keep electrons more than R=0.4 from jets Particles cand2_e; for(unsigned int ie=0;ie0) continue; double mtest = (cand2_e[ie].momentum()+cand2_e[ie2].momentum()).mass(); if(mtest<=20.) { pass = false; break; } } if(pass) recon_e.push_back(cand2_e[ie]); } // only keep muons more than R=0.4 from jets Particles cand2_mu; for(unsigned int imu=0;imu0) continue; double mtest = (cand2_mu[imu].momentum()+cand2_mu[imu2].momentum()).mass(); if(mtest<=20.) { pass = false; break; } } if(pass) recon_mu.push_back(cand2_mu[imu]); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // now only use recon_jets, recon_mu, recon_e // reject events with less than 4 electrons and muons if ( recon_mu.size() + recon_e.size() < 4 ) { MSG_DEBUG("To few charged leptons left after selection"); vetoEvent; } // check if passes single lepton trigger bool passSingle = ( !recon_e .empty() && recon_e[0] .perp()>25. )|| ( !recon_mu.empty() && recon_mu[0].perp()>20.); // or two lepton trigger bool passDouble = ( recon_mu.size()>=2 && recon_mu[1].perp()>12.) || ( recon_e .size()>=2 && recon_e [1].perp()>17.) || ( !recon_e.empty() && !recon_mu.empty() && recon_e[0].perp()>15. && recon_mu[0].perp()>10.); // must pass a trigger if( !passSingle && !passDouble ) { MSG_DEBUG("Hardest lepton fails trigger"); vetoEvent; } // calculate meff double meff = eTmiss; foreach ( const Particle & e , recon_e ) meff += e.perp(); foreach ( const Particle & mu, recon_mu ) meff += mu.perp(); foreach ( const Jet & jet, recon_jets ) { double pT = jet.perp(); if(pT>40.) meff += pT; } // mass of SFOS pairs closest to the Z mass for(unsigned int ix=0;ix0) continue; double mtest = (recon_e[ix].momentum()+recon_e[iy].momentum()).mass(); if(mtest>81.2 && mtest<101.2) vetoEvent; } } for(unsigned int ix=0;ix0) continue; double mtest = (recon_mu[ix].momentum()+recon_mu[iy].momentum()).mass(); if(mtest>81.2 && mtest<101.2) vetoEvent; } } // make the control plots _hist_etmiss ->fill(eTmiss,weight); _hist_meff ->fill(meff ,weight); // finally the counts if(eTmiss>50.) _count_SR1->fill(0.5,weight); if(meff >300.) _count_SR2->fill(0.5,weight); } //@} void finalize() { double norm = crossSection()/femtobarn*4.7/sumOfWeights(); scale(_hist_etmiss,norm* 50.); scale(_hist_meff ,norm*150.); scale(_count_SR1,norm); scale(_count_SR2,norm); } private: /// @name Histograms //@{ Histo1DPtr _hist_etmiss; Histo1DPtr _hist_meff; Histo1DPtr _count_SR1; Histo1DPtr _count_SR2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1190891); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I1204784.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I1204784.cc rename from analyses/pluginATLAS/ATLAS_2012_I1204784.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I1204784.cc --- a/analyses/pluginATLAS/ATLAS_2012_I1204784.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I1204784.cc @@ -1,146 +1,146 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// ATLAS Z phi* measurement class ATLAS_2012_I1204784 : public Analysis { public: /// Constructor ATLAS_2012_I1204784() : Analysis("ATLAS_2012_I1204784") { } public: /// Book histograms and initialise projections before the run void init() { FinalState fs; Cut cuts = Cuts::abseta < 2.4 && Cuts::pT > 20*GeV; ZFinder zfinder_dressed_el(fs, cuts, PID::ELECTRON, 66*GeV, 116*GeV, 0.1, ZFinder::CLUSTERNODECAY); declare(zfinder_dressed_el, "ZFinder_dressed_el"); ZFinder zfinder_bare_el(fs, cuts, PID::ELECTRON, 66*GeV, 116*GeV, 0.0, ZFinder::NOCLUSTER); declare(zfinder_bare_el, "ZFinder_bare_el"); ZFinder zfinder_dressed_mu(fs, cuts, PID::MUON, 66*GeV, 116*GeV, 0.1, ZFinder::CLUSTERNODECAY); declare(zfinder_dressed_mu, "ZFinder_dressed_mu"); ZFinder zfinder_bare_mu(fs, cuts, PID::MUON, 66*GeV, 116*GeV, 0.0, ZFinder::NOCLUSTER); declare(zfinder_bare_mu, "ZFinder_bare_mu"); // Book histograms // Single-differential plots book(_hist_zphistar_el_bare ,1, 1, 1); book(_hist_zphistar_mu_bare ,1, 1, 2); book(_hist_zphistar_el_dressed ,2, 1, 1); book(_hist_zphistar_mu_dressed ,2, 1, 2); // Double-differential plots - {Histo1DPtr tmp; _h_phistar_el_bare.addHistogram(0.0, 0.8, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_phistar_el_bare.addHistogram(0.8, 1.6, book(tmp, 3, 1, 2));} - {Histo1DPtr tmp; _h_phistar_el_bare.addHistogram(1.6, 10.0, book(tmp, 3, 1, 3));} + {Histo1DPtr tmp; _h_phistar_el_bare.add(0.0, 0.8, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_phistar_el_bare.add(0.8, 1.6, book(tmp, 3, 1, 2));} + {Histo1DPtr tmp; _h_phistar_el_bare.add(1.6, 10.0, book(tmp, 3, 1, 3));} - {Histo1DPtr tmp; _h_phistar_el_dressed.addHistogram(0.0, 0.8, book(tmp, 3, 2, 1));} - {Histo1DPtr tmp; _h_phistar_el_dressed.addHistogram(0.8, 1.6, book(tmp, 3, 2, 2));} - {Histo1DPtr tmp; _h_phistar_el_dressed.addHistogram(1.6, 10.0, book(tmp, 3, 2, 3));} + {Histo1DPtr tmp; _h_phistar_el_dressed.add(0.0, 0.8, book(tmp, 3, 2, 1));} + {Histo1DPtr tmp; _h_phistar_el_dressed.add(0.8, 1.6, book(tmp, 3, 2, 2));} + {Histo1DPtr tmp; _h_phistar_el_dressed.add(1.6, 10.0, book(tmp, 3, 2, 3));} - {Histo1DPtr tmp; _h_phistar_mu_bare.addHistogram(0.0, 0.8, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_phistar_mu_bare.addHistogram(0.8, 1.6, book(tmp, 4, 1, 2));} - {Histo1DPtr tmp; _h_phistar_mu_bare.addHistogram(1.6, 10.0, book(tmp, 4, 1, 3));} + {Histo1DPtr tmp; _h_phistar_mu_bare.add(0.0, 0.8, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_phistar_mu_bare.add(0.8, 1.6, book(tmp, 4, 1, 2));} + {Histo1DPtr tmp; _h_phistar_mu_bare.add(1.6, 10.0, book(tmp, 4, 1, 3));} - {Histo1DPtr tmp; _h_phistar_mu_dressed.addHistogram(0.0, 0.8, book(tmp, 4, 2, 1));} - {Histo1DPtr tmp; _h_phistar_mu_dressed.addHistogram(0.8, 1.6, book(tmp, 4, 2, 2));} - {Histo1DPtr tmp; _h_phistar_mu_dressed.addHistogram(1.6, 10.0, book(tmp, 4, 2, 3));} + {Histo1DPtr tmp; _h_phistar_mu_dressed.add(0.0, 0.8, book(tmp, 4, 2, 1));} + {Histo1DPtr tmp; _h_phistar_mu_dressed.add(0.8, 1.6, book(tmp, 4, 2, 2));} + {Histo1DPtr tmp; _h_phistar_mu_dressed.add(1.6, 10.0, book(tmp, 4, 2, 3));} } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; const ZFinder& zfinder_dressed_el = apply(event, "ZFinder_dressed_el"); const ZFinder& zfinder_bare_el = apply(event, "ZFinder_bare_el"); const ZFinder& zfinder_dressed_mu = apply(event, "ZFinder_dressed_mu"); const ZFinder& zfinder_bare_mu = apply(event, "ZFinder_bare_mu"); fillPlots(zfinder_dressed_el, _hist_zphistar_el_dressed, _h_phistar_el_dressed, weight); fillPlots(zfinder_bare_el, _hist_zphistar_el_bare, _h_phistar_el_bare, weight); fillPlots(zfinder_dressed_mu, _hist_zphistar_mu_dressed, _h_phistar_mu_dressed, weight); fillPlots(zfinder_bare_mu, _hist_zphistar_mu_bare, _h_phistar_mu_bare, weight); } - void fillPlots(const ZFinder& zfind, Histo1DPtr hist, BinnedHistogram& binnedHist, double weight) { + void fillPlots(const ZFinder& zfind, Histo1DPtr hist, BinnedHistogram& binnedHist, double weight) { if (zfind.bosons().size() != 1) return; Particles leptons = zfind.constituents(cmpMomByPt); const FourMomentum lminus = leptons[0].charge() < 0 ? leptons[0].momentum() : leptons[1].momentum(); const FourMomentum lplus = leptons[0].charge() < 0 ? leptons[1].momentum() : leptons[0].momentum(); const double phi_acop = M_PI - deltaPhi(lminus, lplus); const double costhetastar = tanh((lminus.eta()-lplus.eta())/2.0); const double sin2thetastar = (costhetastar <= 1) ? 1.0 - sqr(costhetastar) : 0; const double phistar = tan(phi_acop/2.0) * sqrt(sin2thetastar); hist->fill(phistar, weight); binnedHist.fill(zfind.bosons()[0].absrap(), phistar, weight); } /// Normalise histograms etc., after the run void finalize() { normalize(_hist_zphistar_el_dressed); normalize(_hist_zphistar_el_bare); normalize(_hist_zphistar_mu_dressed); normalize(_hist_zphistar_mu_bare); foreach (Histo1DPtr hist, _h_phistar_mu_dressed.histos()) { normalize(hist); } foreach (Histo1DPtr hist, _h_phistar_mu_bare.histos()) { normalize(hist); } foreach (Histo1DPtr hist, _h_phistar_el_bare.histos()) { normalize(hist); } foreach (Histo1DPtr hist, _h_phistar_el_dressed.histos()) { normalize(hist); } } //@} private: - BinnedHistogram _h_phistar_mu_dressed; - BinnedHistogram _h_phistar_mu_bare; - BinnedHistogram _h_phistar_el_dressed; - BinnedHistogram _h_phistar_el_bare; + BinnedHistogram _h_phistar_mu_dressed; + BinnedHistogram _h_phistar_mu_bare; + BinnedHistogram _h_phistar_el_dressed; + BinnedHistogram _h_phistar_el_bare; Histo1DPtr _hist_zphistar_el_dressed; Histo1DPtr _hist_zphistar_el_bare; Histo1DPtr _hist_zphistar_mu_dressed; Histo1DPtr _hist_zphistar_mu_bare; Histo1DPtr _hist_zphistar_el_bare_1; Histo1DPtr _hist_zphistar_el_bare_2; Histo1DPtr _hist_zphistar_el_bare_3; Histo1DPtr _hist_zphistar_el_dressed_1; Histo1DPtr _hist_zphistar_el_dressed_2; Histo1DPtr _hist_zphistar_el_dressed_3; Histo1DPtr _hist_zphistar_mu_bare_1; Histo1DPtr _hist_zphistar_mu_bare_2; Histo1DPtr _hist_zphistar_mu_bare_3; Histo1DPtr _hist_zphistar_mu_dressed_1; Histo1DPtr _hist_zphistar_mu_dressed_2; Histo1DPtr _hist_zphistar_mu_dressed_3; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I1204784); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I943401.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I943401.cc rename from analyses/pluginATLAS/ATLAS_2012_I943401.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I943401.cc --- a/analyses/pluginATLAS/ATLAS_2012_I943401.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I943401.cc @@ -1,457 +1,456 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { class ATLAS_2012_I943401 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_I943401() : Analysis("ATLAS_2012_I943401") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // projection to find the electrons IdentifiedFinalState elecs(Cuts::abseta < 2.47 && Cuts::pT > 20*GeV); elecs.acceptIdPair(PID::ELECTRON); declare(elecs, "elecs"); // projection to find the muons IdentifiedFinalState muons(Cuts::abseta < 2.4 && Cuts::pT > 10*GeV); muons.acceptIdPair(PID::MUON); declare(muons, "muons"); // jet finder VetoedFinalState vfs; vfs.addVetoPairId(PID::MUON); declare(FastJets(vfs, FastJets::ANTIKT, 0.4), "AntiKtJets04"); // all tracks (to do deltaR with leptons) declare(ChargedFinalState(Cuts::abseta < 3 && Cuts::pT > 0.5*GeV), "cfs"); // for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.5), "vfs"); // book histograms // counts in signal regions book(_count_OS_SR1 ,"count_OS_SR1", 1, 0., 1.); book(_count_OS_SR2 ,"count_OS_SR2", 1, 0., 1.); book(_count_OS_SR3 ,"count_OS_SR3", 1, 0., 1.); book(_count_SS_SR1 ,"count_SS_SR1", 1, 0., 1.); book(_count_SS_SR2 ,"count_SS_SR2", 1, 0., 1.); book(_count_FS_SR1 ,"count_FS_SR1", 1, 0., 1.); book(_count_FS_SR2 ,"count_FS_SR2", 1, 0., 1.); book(_count_FS_SR3 ,"count_FS_SR3", 1, 0., 1.); // histograms from paper book(_hist_mll_SS_D , 1,1,1); book(_hist_mll_SS_B , 1,1,2); book(_hist_eTmiss_SS_D , 2,1,1); book(_hist_eTmiss_SS_B , 2,1,2); book(_hist_mll_SS_2Jet_D , 3,1,1); book(_hist_mll_SS_2Jet_B , 3,1,2); book(_hist_njet_SS_D , 5,1,1); book(_hist_njet_SS_B , 5,1,2); book(_hist_pT_j1_SS_D , 6,1,1); book(_hist_pT_j1_SS_B , 6,1,2); book(_hist_pT_j2_SS_D , 7,1,1); book(_hist_pT_j2_SS_B , 7,1,2); book(_hist_pT_l1_SS_D , 8,1,1); book(_hist_pT_l1_SS_B , 8,1,2); book(_hist_pT_l2_SS_D , 9,1,1); book(_hist_pT_l2_SS_B , 9,1,2); book(_hist_mll_OS_D ,10,1,1); book(_hist_mll_OS_B ,10,1,2); book(_hist_eTmiss_OS_D ,11,1,1); book(_hist_eTmiss_OS_B ,11,1,2); book(_hist_eTmiss_3Jet_OS_D ,12,1,1); book(_hist_eTmiss_3Jet_OS_B ,12,1,2); book(_hist_eTmiss_4Jet_OS_D ,13,1,1); book(_hist_eTmiss_4Jet_OS_B ,13,1,2); book(_hist_njet_OS_D ,14,1,1); book(_hist_njet_OS_B ,14,1,2); book(_hist_pT_j1_OS_D ,15,1,1); book(_hist_pT_j1_OS_B ,15,1,2); book(_hist_pT_j2_OS_D ,16,1,1); book(_hist_pT_j2_OS_B ,16,1,2); book(_hist_pT_l1_OS_D ,17,1,1); book(_hist_pT_l1_OS_B ,17,1,2); book(_hist_pT_l2_OS_D ,18,1,1); book(_hist_pT_l2_OS_B ,18,1,2); //???? // // } /// Perform the event analysis void analyze(const Event& event) { // event weight const double weight = 1.0; // get the jet candidates Jets cand_jets; foreach (const Jet& jet, apply(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { if ( fabs( jet.eta() ) < 2.8 ) { cand_jets.push_back(jet); } } // electron candidates Particles cand_e = apply(event, "elecs").particlesByPt(); // Discard jets that overlap with electrons Jets recon_jets; foreach ( const Jet& jet, cand_jets ) { bool away_from_e = true; foreach ( const Particle& e, cand_e ) { if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { away_from_e = false; break; } } if ( away_from_e ) recon_jets.push_back( jet ); } // get the charged tracks for isolation Particles chg_tracks = apply(event, "cfs").particles(); // Reconstructed electrons Particles recon_e; foreach ( const Particle& e, cand_e ) { // check not near a jet bool e_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { e_near_jet = true; break; } } if ( e_near_jet ) continue; // check the isolation double pTinCone = -e.pT(); foreach ( const Particle& track, chg_tracks ) { if ( deltaR(e.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 0.1*e.perp() ) recon_e.push_back(e); } // Reconstructed Muons Particles recon_mu; Particles cand_mu = apply(event,"muons").particlesByPt(); foreach ( const Particle& mu, cand_mu ) { // check not near a jet bool mu_near_jet = false; foreach ( const Jet& jet, recon_jets ) { if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { mu_near_jet = true; break; } } if ( mu_near_jet ) continue; // isolation double pTinCone = -mu.pT(); foreach ( const Particle& track, chg_tracks ) { if ( deltaR(mu.momentum(),track.momentum()) < 0.2 ) pTinCone += track.pT(); } if ( pTinCone < 1.8*GeV ) recon_mu.push_back(mu); } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle& p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); // ATLAS calo problem if(rand()/static_cast(RAND_MAX)<=0.42) { foreach ( const Particle& e, recon_e ) { double eta = e.eta(); double phi = e.azimuthalAngle(MINUSPI_PLUSPI); if (inRange(eta, -0.1, 1.5) && inRange(phi, -0.9, -0.5)) vetoEvent; } foreach ( const Jet& jet, recon_jets ) { double eta = jet.rapidity(); double phi = jet.azimuthalAngle(MINUSPI_PLUSPI); if (jet.pT() > 40*GeV && inRange(eta, -0.1, 1.5) && inRange(phi, -0.9, -0.5)) vetoEvent; } } // Exactly two leptons for each event if ( recon_mu.size() + recon_e.size() != 2) vetoEvent; // two electrons highest pT > 25 Particles recon_leptons; if (recon_e.size()==2 && recon_e[0].pT()>25*GeV) { recon_leptons = recon_e; } // two muons highest pT > 20 else if (recon_mu.size()==2 && recon_mu[0].pT() > 20*GeV) { recon_leptons = recon_mu; } else if (recon_e.size()==1 && recon_mu.size()==1 && (recon_e[0].pT() > 25*GeV || recon_mu[0].pT() > 20*GeV )) { if (recon_mu[0].pT() < recon_e[0].pT()) { recon_leptons.push_back(recon_e [0]); recon_leptons.push_back(recon_mu[0]); } else { recon_leptons.push_back(recon_mu[0]); recon_leptons.push_back(recon_e [0]); } } // fails trigger else vetoEvent; double mll = (recon_leptons[0].momentum()+recon_leptons[1].momentum()).mass(); // lepton pair mass > 12. if (mll < 12*GeV) vetoEvent; // same sign or opposite sign event int sign = recon_leptons[0].pid()*recon_leptons[1].pid(); // same sign leptons if(sign>0) { _hist_mll_SS_D ->fill(mll ,weight); _hist_mll_SS_B ->fill(mll ,weight); _hist_eTmiss_SS_D->fill(eTmiss,weight); _hist_eTmiss_SS_B->fill(eTmiss,weight); if(recon_jets.size()>=2) { _hist_mll_SS_2Jet_D ->fill(mll ,weight); _hist_mll_SS_2Jet_B ->fill(mll ,weight); } _hist_njet_SS_D ->fill(recon_jets.size(),weight); _hist_njet_SS_B ->fill(recon_jets.size(),weight); if(!recon_jets.empty()) { _hist_pT_j1_SS_D->fill(recon_jets[0].perp(),weight); _hist_pT_j1_SS_B->fill(recon_jets[0].perp(),weight); } if(recon_jets.size()>2) { _hist_pT_j2_SS_D->fill(recon_jets[1].perp(),weight); _hist_pT_j2_SS_B->fill(recon_jets[1].perp(),weight); } _hist_pT_l1_SS_D->fill(recon_leptons[0].perp(),weight); _hist_pT_l1_SS_B->fill(recon_leptons[0].perp(),weight); _hist_pT_l2_SS_D->fill(recon_leptons[1].perp(),weight); _hist_pT_l2_SS_B->fill(recon_leptons[1].perp(),weight); // SS-SR1 if(eTmiss>100.) { _count_SS_SR1->fill(0.5,weight); } // SS-SR2 if(eTmiss>80. && recon_jets.size()>=2 && recon_jets[1].perp()>50.) { _count_SS_SR2->fill(0.5,weight); } } // opposite sign else { _hist_mll_OS_D->fill(mll ,weight); _hist_mll_OS_B->fill(mll ,weight); _hist_eTmiss_OS_D->fill(eTmiss,weight); _hist_eTmiss_OS_B->fill(eTmiss,weight); if(recon_jets.size()>=3){ _hist_eTmiss_3Jet_OS_D->fill(eTmiss,weight); _hist_eTmiss_3Jet_OS_B->fill(eTmiss,weight); } if(recon_jets.size()>=4){ _hist_eTmiss_4Jet_OS_D->fill(eTmiss,weight); _hist_eTmiss_4Jet_OS_B->fill(eTmiss,weight); } _hist_njet_OS_D->fill(recon_jets.size(),weight); _hist_njet_OS_B->fill(recon_jets.size(),weight); if(!recon_jets.empty()) { _hist_pT_j1_OS_D->fill(recon_jets[0].perp(),weight); _hist_pT_j1_OS_B->fill(recon_jets[0].perp(),weight); } if(recon_jets.size()>2) { _hist_pT_j2_OS_D->fill(recon_jets[1].perp(),weight); _hist_pT_j2_OS_B->fill(recon_jets[1].perp(),weight); } _hist_pT_l1_OS_D->fill(recon_leptons[0].perp(),weight); _hist_pT_l1_OS_B->fill(recon_leptons[0].perp(),weight); _hist_pT_l2_OS_D->fill(recon_leptons[1].perp(),weight); _hist_pT_l2_OS_B->fill(recon_leptons[1].perp(),weight); // different signal regions // OS-SR1 if(eTmiss>250.) { _count_OS_SR1->fill(0.5,weight); } // OS-SR2 if(eTmiss>220. && recon_jets.size()>=3 && recon_jets[0].perp()>80. && recon_jets[2].perp()>40.) { _count_OS_SR2->fill(0.5,weight); } // OS-SR3 if(eTmiss>100. && recon_jets.size()>=4 && recon_jets[0].perp()>100. && recon_jets[3].perp()>70.) { _count_OS_SR3->fill(0.5,weight); } // same flavour analysis static const double beta = 0.75; static const double tau_e = 0.96; static const double tau_mu = 0.816; double fs_weight = weight; if (recon_leptons[0].abspid() == PID::ELECTRON && recon_leptons[1].abspid() == PID::ELECTRON) { fs_weight /= beta*(1.-sqr(1.-tau_e)); } else if (recon_leptons[0].abspid() == PID::MUON && recon_leptons[1].abspid()==PID::MUON) { fs_weight *= beta/(1.-sqr(1.-tau_mu)); } else { fs_weight /= -(1.-(1.-tau_e)*(1.-tau_mu)); } // FS-SR1 if(eTmiss>80.&& (mll<80.||mll>100.)) { _count_FS_SR1->fill(0.5,fs_weight); } // FS-SR2 if(eTmiss>80.&&recon_jets.size()>=2) { _count_FS_SR2->fill(0.5,fs_weight); } // FS-SR3 if(eTmiss>250.) { _count_FS_SR3->fill(0.5,fs_weight); } } } //@} void finalize() { double norm = crossSection()/femtobarn*1.04/sumOfWeights(); // event counts scale(_count_OS_SR1,norm); scale(_count_OS_SR2,norm); scale(_count_OS_SR3,norm); scale(_count_SS_SR1,norm); scale(_count_SS_SR2,norm); scale(_count_FS_SR1,norm); scale(_count_FS_SR2,norm); scale(_count_FS_SR3,norm); // histograms scale(_hist_mll_SS_D ,norm*20.); scale(_hist_mll_SS_B ,norm*20.); scale(_hist_eTmiss_SS_D ,norm*20.); scale(_hist_eTmiss_SS_B ,norm*20.); scale(_hist_mll_SS_2Jet_D,norm*50.); scale(_hist_mll_SS_2Jet_B,norm*50.); scale(_hist_njet_SS_D ,norm ); scale(_hist_njet_SS_B ,norm ); scale(_hist_pT_j1_SS_D ,norm*20.); scale(_hist_pT_j1_SS_B ,norm*20.); scale(_hist_pT_j2_SS_D ,norm*20.); scale(_hist_pT_j2_SS_B ,norm*20.); scale(_hist_pT_l1_SS_D ,norm*5. ); scale(_hist_pT_l1_SS_B ,norm*5. ); scale(_hist_pT_l2_SS_D ,norm*5. ); scale(_hist_pT_l2_SS_B ,norm*5. ); scale(_hist_mll_OS_D ,norm*10.); scale(_hist_mll_OS_B ,norm*10.); scale(_hist_eTmiss_OS_D ,norm*10.); scale(_hist_eTmiss_OS_B ,norm*10.); scale(_hist_eTmiss_3Jet_OS_D,norm*10.); scale(_hist_eTmiss_3Jet_OS_B,norm*10.); scale(_hist_eTmiss_4Jet_OS_D,norm*10.); scale(_hist_eTmiss_4Jet_OS_B,norm*10.); scale(_hist_njet_OS_D ,norm ); scale(_hist_njet_OS_B ,norm ); scale(_hist_pT_j1_OS_D ,norm*20.); scale(_hist_pT_j1_OS_B ,norm*20.); scale(_hist_pT_j2_OS_D ,norm*20.); scale(_hist_pT_j2_OS_B ,norm*20.); scale(_hist_pT_l1_OS_D ,norm*20.); scale(_hist_pT_l1_OS_B ,norm*20.); scale(_hist_pT_l2_OS_D ,norm*20.); scale(_hist_pT_l2_OS_B ,norm*20.); } private: /// @name Histograms //@{ Histo1DPtr _count_OS_SR1; Histo1DPtr _count_OS_SR2; Histo1DPtr _count_OS_SR3; Histo1DPtr _count_SS_SR1; Histo1DPtr _count_SS_SR2; Histo1DPtr _count_FS_SR1; Histo1DPtr _count_FS_SR2; Histo1DPtr _count_FS_SR3; Histo1DPtr _hist_mll_SS_D; Histo1DPtr _hist_mll_SS_B; Histo1DPtr _hist_eTmiss_SS_D; Histo1DPtr _hist_eTmiss_SS_B; Histo1DPtr _hist_mll_SS_2Jet_D; Histo1DPtr _hist_mll_SS_2Jet_B; Histo1DPtr _hist_njet_SS_D; Histo1DPtr _hist_njet_SS_B; Histo1DPtr _hist_pT_j1_SS_D; Histo1DPtr _hist_pT_j1_SS_B; Histo1DPtr _hist_pT_j2_SS_D; Histo1DPtr _hist_pT_j2_SS_B; Histo1DPtr _hist_pT_l1_SS_D; Histo1DPtr _hist_pT_l1_SS_B; Histo1DPtr _hist_pT_l2_SS_D; Histo1DPtr _hist_pT_l2_SS_B; Histo1DPtr _hist_mll_OS_D; Histo1DPtr _hist_mll_OS_B; Histo1DPtr _hist_eTmiss_OS_D; Histo1DPtr _hist_eTmiss_OS_B; Histo1DPtr _hist_eTmiss_3Jet_OS_D; Histo1DPtr _hist_eTmiss_3Jet_OS_B; Histo1DPtr _hist_eTmiss_4Jet_OS_D; Histo1DPtr _hist_eTmiss_4Jet_OS_B; Histo1DPtr _hist_njet_OS_D ; Histo1DPtr _hist_njet_OS_B ; Histo1DPtr _hist_pT_j1_OS_D; Histo1DPtr _hist_pT_j1_OS_B; Histo1DPtr _hist_pT_j2_OS_D; Histo1DPtr _hist_pT_j2_OS_B; Histo1DPtr _hist_pT_l1_OS_D; Histo1DPtr _hist_pT_l1_OS_B; Histo1DPtr _hist_pT_l2_OS_D; Histo1DPtr _hist_pT_l2_OS_B; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I943401); } diff --git a/analyses/pluginATLAS/ATLAS_2012_I946427.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2012_I946427.cc rename from analyses/pluginATLAS/ATLAS_2012_I946427.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2012_I946427.cc --- a/analyses/pluginATLAS/ATLAS_2012_I946427.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2012_I946427.cc @@ -1,141 +1,140 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/VisibleFinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @author Peter Richardson class ATLAS_2012_I946427 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2012_I946427() : Analysis("ATLAS_2012_I946427") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // photons IdentifiedFinalState photonfs(Cuts::abseta < 1.81 && Cuts::pT > 25*GeV); photonfs.acceptId(PID::PHOTON); declare(photonfs, "Photon"); // FinalState fs; declare(fs, "FS"); // Used for pTmiss declare(VisibleFinalState(Cuts::abseta < 4.9),"vfs"); // Book histograms book(_count_SR ,"count_SR", 1, 0., 1.); book(_hist_ET_photon ,"hist_ET_photon", 48 , 20., 500.); book(_hist_met ,"hist_met" , 100, 0., 500.); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; // require at least 2 photons in final state Particles photons = apply(event, "Photon").particlesByPt(); if (photons.size() < 2) { vetoEvent; } // Loop over photons and fill vector of isolated ones Particles fs = apply(event, "FS").particles(); Particles isolated_photons; foreach (const Particle& photon, photons) { // remove photons in crack double eta_P = photon.eta(); if (fabs(eta_P)>=1.37 && fabs(eta_P)<1.52) continue; double phi_P = photon.phi(); FourMomentum mom_in_EtCone = -photon.momentum(); foreach (const Particle& p, fs) { // check if it's in the cone of .2 if (deltaR(eta_P, phi_P, p.eta(), p.phi()) >= 0.2) continue; mom_in_EtCone += p.momentum(); } // apply isolation if(mom_in_EtCone.Et()>5.) continue; // add photon to list of isolated ones isolated_photons.push_back(photon); } // need two isolated photons if(isolated_photons.size() < 2 ) { vetoEvent; } // pTmiss Particles vfs_particles = apply(event, "vfs").particles(); FourMomentum pTmiss; foreach ( const Particle & p, vfs_particles ) { pTmiss -= p.momentum(); } double eTmiss = pTmiss.pT(); _hist_ET_photon->fill(isolated_photons[0].Et(),weight); _hist_met ->fill(eTmiss ,weight); if(eTmiss>125.) _count_SR->fill(0.5,weight); } void finalize() { double norm = crossSection()/femtobarn*1.07/sumOfWeights(); // these are number of events at 1.07fb^-1 per 10 GeV scale( _hist_ET_photon, 10. * norm ); // these are number of events at 1.07fb^-1 per 5 GeV scale( _hist_met, 5. * norm ); // these are number of events at 1.07fb^-1 scale(_count_SR,norm); } //@} private: Histo1DPtr _count_SR; Histo1DPtr _hist_ET_photon; Histo1DPtr _hist_met; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2012_I946427); } diff --git a/analyses/pluginATLAS/ATLAS_2014_I1268975.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2014_I1268975.cc rename from analyses/pluginATLAS/ATLAS_2014_I1268975.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2014_I1268975.cc --- a/analyses/pluginATLAS/ATLAS_2014_I1268975.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2014_I1268975.cc @@ -1,109 +1,109 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// Jet mass as a function of ystar class ATLAS_2014_I1268975 : public Analysis { public: /// Constructor ATLAS_2014_I1268975() : Analysis("ATLAS_2014_I1268975") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { const FinalState fs; declare(fs,"FinalState"); FastJets fj04(fs, FastJets::ANTIKT, 0.4); fj04.useInvisibles(); declare(fj04, "AntiKT04"); FastJets fj06(fs, FastJets::ANTIKT, 0.6); fj06.useInvisibles(); declare(fj06, "AntiKT06"); double ystarbins[] = { 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0}; size_t massDsOffset(0); for (size_t alg = 0; alg < 2; ++alg) { for (size_t i = 0; i < 6; ++i) { Histo1DPtr tmp; - _mass[alg].addHistogram(ystarbins[i], ystarbins[i+1], book(tmp, 1 + massDsOffset, 1, i+1)); + _mass[alg].add(ystarbins[i], ystarbins[i+1], book(tmp, 1 + massDsOffset, 1, i+1)); } massDsOffset += 1; } } /// Perform the per-event analysis void analyze(const Event& event) { Jets jetAr[2]; jetAr[AKT4] = apply(event, "AntiKT04").jetsByPt(50*GeV); jetAr[AKT6] = apply(event, "AntiKT06").jetsByPt(50*GeV); // Loop over jet "radii" used in analysis for (size_t alg = 0; alg < 2; ++alg) { // Identify dijets vector leadjets; foreach (const Jet& jet, jetAr[alg]) { if (jet.absrap() < 3.0 && leadjets.size() < 2) { if (leadjets.empty() && jet.pT() < 100*GeV) continue; leadjets.push_back(jet.momentum()); } } // Make sure we have a leading jet with pT > 100 GeV and a second to leading jet with pT > 50 GeV if (leadjets.size() < 2) { MSG_DEBUG("Could not find two suitable leading jets"); continue; } const double y1 = leadjets[0].rapidity(); const double y2 = leadjets[1].rapidity(); const double ystar = fabs(y1-y2) / 2.; const double m = (leadjets[0] + leadjets[1]).mass(); // Fill mass histogram _mass[alg].fill(ystar, m/TeV, 1.0); } } /// Normalise histograms etc., after the run void finalize() { for (size_t alg = 0; alg < 2; ++alg) { _mass[alg].scale(crossSectionPerEvent()/picobarn, this); } } //@} private: // Data members like post-cuts event weight counters go here enum Alg { AKT4=0, AKT6=1 }; /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _mass[2]; + BinnedHistogram _mass[2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2014_I1268975); } diff --git a/analyses/pluginATLAS/ATLAS_2014_I1300647.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2014_I1300647.cc rename from analyses/pluginATLAS/ATLAS_2014_I1300647.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2014_I1300647.cc --- a/analyses/pluginATLAS/ATLAS_2014_I1300647.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2014_I1300647.cc @@ -1,134 +1,134 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Tools/BinnedHistogram.hh" /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder... namespace Rivet { class ATLAS_2014_I1300647 : public Analysis { public: /// Constructor ATLAS_2014_I1300647() : Analysis("ATLAS_2014_I1300647") { } public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { FinalState fs; ZFinder zfinder_dressed_el(fs, Cuts::abseta<2.4 && Cuts::pT>20.0*GeV, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.1); declare(zfinder_dressed_el, "ZFinder_dressed_el"); ZFinder zfinder_bare_el(fs, Cuts::abseta<2.4 && Cuts::pT>20.0*GeV, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.0); declare(zfinder_bare_el, "ZFinder_bare_el"); ZFinder zfinder_dressed_mu(fs, Cuts::abseta<2.4 && Cuts::pT>20.0*GeV, PID::MUON, 66.0*GeV, 116.0*GeV, 0.1); declare(zfinder_dressed_mu, "ZFinder_dressed_mu"); ZFinder zfinder_bare_mu(fs, Cuts::abseta<2.4 && Cuts::pT>20.0*GeV, PID::MUON, 66.0*GeV, 116.0*GeV, 0.0); declare(zfinder_bare_mu, "ZFinder_bare_mu"); // Book histograms book(_hist_zpt_el_dressed ,1, 1, 1); // electron "dressed" book(_hist_zpt_mu_dressed ,1, 1, 2); // muon "dressed" book(_hist_zpt_el_bare ,1, 2, 1); // electron "bare" book(_hist_zpt_mu_bare ,1, 2, 2); // muon "bare" //double-differential plots - {Histo1DPtr tmp; _h_zpt_el_mu_dressed.addHistogram(0.0, 1.0, book(tmp, 3, 1, 2));} - {Histo1DPtr tmp; _h_zpt_el_mu_dressed.addHistogram(1.0, 2.0, book(tmp, 3, 1, 4));} - {Histo1DPtr tmp; _h_zpt_el_mu_dressed.addHistogram(2.0, 2.4, book(tmp, 3, 1, 6));} + {Histo1DPtr tmp; _h_zpt_el_mu_dressed.add(0.0, 1.0, book(tmp, 3, 1, 2));} + {Histo1DPtr tmp; _h_zpt_el_mu_dressed.add(1.0, 2.0, book(tmp, 3, 1, 4));} + {Histo1DPtr tmp; _h_zpt_el_mu_dressed.add(2.0, 2.4, book(tmp, 3, 1, 6));} } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; const ZFinder& zfinder_dressed_el = apply(event, "ZFinder_dressed_el"); const ZFinder& zfinder_bare_el = apply(event, "ZFinder_bare_el"); const ZFinder& zfinder_dressed_mu = apply(event, "ZFinder_dressed_mu"); const ZFinder& zfinder_bare_mu = apply(event, "ZFinder_bare_mu"); FillPlots1d(zfinder_dressed_el, _hist_zpt_el_dressed, weight); FillPlots1d(zfinder_bare_el, _hist_zpt_el_bare, weight); FillPlots1d(zfinder_dressed_mu, _hist_zpt_mu_dressed, weight); FillPlots1d(zfinder_bare_mu, _hist_zpt_mu_bare, weight); FillPlots3d(zfinder_dressed_el, _h_zpt_el_mu_dressed, weight); FillPlots3d(zfinder_dressed_mu, _h_zpt_el_mu_dressed, weight); } void FillPlots1d(const ZFinder& zfinder, Histo1DPtr hist, double weight) { if(zfinder.bosons().size() != 1) return; const FourMomentum pZ = zfinder.bosons()[0].momentum(); hist->fill(pZ.pT()/GeV, weight); return; } - void FillPlots3d(const ZFinder& zfinder, BinnedHistogram& binnedHist, double weight) { + void FillPlots3d(const ZFinder& zfinder, BinnedHistogram& binnedHist, double weight) { if(zfinder.bosons().size() != 1) return; const FourMomentum pZ = zfinder.bosons()[0].momentum(); binnedHist.fill(pZ.rapidity(), pZ.pT()/GeV, weight); return; } /// Normalise histograms etc., after the run void finalize() { normalize(_hist_zpt_el_dressed); normalize(_hist_zpt_el_bare); normalize(_hist_zpt_mu_dressed); normalize(_hist_zpt_mu_bare); foreach (Histo1DPtr hist, _h_zpt_el_mu_dressed.histos()) { normalize(hist); } } //@} private: // Data members like post-cuts event weight counters go here private: /// @name Histograms //@{ - BinnedHistogram _h_zpt_el_mu_dressed; + BinnedHistogram _h_zpt_el_mu_dressed; Histo1DPtr _hist_zpt_el_dressed; Histo1DPtr _hist_zpt_el_bare; Histo1DPtr _hist_zpt_mu_dressed; Histo1DPtr _hist_zpt_mu_bare; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2014_I1300647); } diff --git a/analyses/pluginATLAS/ATLAS_2014_I1307243.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2014_I1307243.cc rename from analyses/pluginATLAS/ATLAS_2014_I1307243.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2014_I1307243.cc --- a/analyses/pluginATLAS/ATLAS_2014_I1307243.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2014_I1307243.cc @@ -1,246 +1,246 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// @brief ATLAS azimuthal decorrelation with jet veto analysis /// @author James Robinson class ATLAS_2014_I1307243 : public Analysis { public: /// Constructor ATLAS_2014_I1307243() : Analysis("ATLAS_2014_I1307243"), _fiducialRegions{2010, 2011}, _vetoScale{20*GeV, 30*GeV}, _yFiducial{4.4, 2.4}, _gapCategories{"inclusive", "gap"}, _dy_max(8), _nEventsInAcceptance(0), _sumOfAcceptedWeights(0.) { } /// Book histograms and initialise projections before the run void init() { /// Initialise and register projections here FinalState fs; FastJets fastJets(fs, FastJets::ANTIKT, 0.6); fastJets.useInvisibles(true); declare(fastJets, "AntiKt6JetsWithInvisibles"); /// Book histograms foreach (const string& gapCategory, _gapCategories ) { const int gapCategoryOffset = (gapCategory == "inclusive") ? 0 : 1; // Temporary inclusive and gap histograms book(_h_tmp_events_dy[gapCategory] ,1, 1, 1); _h_tmp_events_dy[gapCategory]->setPath("/TMP/" + toString(gapCategory) + "_events_dy"); book(_h_tmp_events_pTbar[gapCategory] ,2, 1, 1); _h_tmp_events_pTbar[gapCategory]->setPath("/TMP/" + toString(gapCategory) + "_events_pTbar"); // Azimuthal moment histograms book(_h_profiled_cosDeltaPhi_dy[gapCategory] , 5+4*gapCategoryOffset, 1, 1); book(_h_profiled_cosDeltaPhi_pTbar[gapCategory] , 6+4*gapCategoryOffset, 1, 1); book(_h_C2C1_dy[gapCategory] , 7+4*gapCategoryOffset, 1, 1, false); book(_h_C2C1_pTbar[gapCategory] , 8+4*gapCategoryOffset, 1, 1, false); book(_h_profiled_cosTwoDeltaPhi_dy[gapCategory] ,37+2*gapCategoryOffset, 1, 1); book(_h_profiled_cosTwoDeltaPhi_pTbar[gapCategory] ,38+2*gapCategoryOffset, 1, 1); // Gap fraction vs. Q0 and cross-section in dy slices for (size_t dyLow = 0; dyLow < _dy_max; ++dyLow ) { Histo1DPtr _h_tmp_events_Q0_single_dySlice; book(_h_tmp_events_Q0_single_dySlice , 29+dyLow, 1, 1); _h_tmp_events_Q0_single_dySlice->setPath("/TMP/" + toString(gapCategory) + "_events_dySlice_" + toString(dyLow) + "_" + toString(dyLow+1) + "_Q0"); - _h_tmp_events_Q0_dySlices[gapCategory].addHistogram( dyLow, dyLow+1, _h_tmp_events_Q0_single_dySlice ); + _h_tmp_events_Q0_dySlices[gapCategory].add( dyLow, dyLow+1, _h_tmp_events_Q0_single_dySlice ); Histo1DPtr tmp; - _h_crossSection_dphi_dySlices[gapCategory].addHistogram( dyLow, dyLow+1, book(tmp, 13+(_dy_max*gapCategoryOffset)+dyLow, 1, 1)); + _h_crossSection_dphi_dySlices[gapCategory].add( dyLow, dyLow+1, book(tmp, 13+(_dy_max*gapCategoryOffset)+dyLow, 1, 1)); } } // Number of jets in rapidity interval book(_h_profiled_nJets_rapidity_interval_dy , 3, 1, 1); book(_h_profiled_nJets_rapidity_interval_pTbar , 4, 1, 1); } /// Perform the per-event analysis void analyze(const Event& event) { // Get the event weight const double weight( 1.0 ); bool eventAccepted( false ); for (int iFiducialRegion = 0; iFiducialRegion < 2; ++iFiducialRegion ) { // Retrieve all anti-kt R=0.6 jets above _pTMin and inside |_yFiducial| const Jets akt6Jets = apply(event, "AntiKt6JetsWithInvisibles").jetsByPt( Cuts::absrap < _yFiducial.at(iFiducialRegion) ); // If there are fewer than 2 jets then bail if ( akt6Jets.size() < 2 ) { vetoEvent; } // Require jets to be above {60, 50} GeV if ( akt6Jets.at(0).momentum().pT() < 60.*GeV || akt6Jets.at(1).momentum().pT() < 50.*GeV ) { vetoEvent; } // Identify gap boundaries double yMin( std::min( akt6Jets.at(0).momentum().rapidity(), akt6Jets.at(1).momentum().rapidity() ) ); double yMax( std::max( akt6Jets.at(0).momentum().rapidity(), akt6Jets.at(1).momentum().rapidity() ) ); // Determine azimuthal decorrelation quantities const double dy( yMax - yMin ); const double dphi( mapAngle0ToPi( akt6Jets.at(0).momentum().phi() - akt6Jets.at(1).momentum().phi() ) ); const double pTbar( (akt6Jets.at(0).momentum().pT() + akt6Jets.at(1).momentum().pT())/2.0 ); // Impose minimum dy for the 2011 phase space if ( _fiducialRegions.at(iFiducialRegion) == 2011 && dy < 1.0 ) { vetoEvent; } // Construct gap candidates sample Jets gapCandidates; foreach( const Jet &j, akt6Jets ) { if ( inRange( j.momentum().rapidity(), yMin, yMax, OPEN, OPEN ) ) { gapCandidates.push_back( j ); } } // Determine gap quantities unsigned int nJets_rapidity_interval( 0 ); double maximumGapQ0( 0. ); foreach( const Jet &jet, gapCandidates ) { const double pT( jet.momentum().pT() ); if ( pT > _vetoScale.at(iFiducialRegion) ) { ++nJets_rapidity_interval; } if ( pT > maximumGapQ0 ) { maximumGapQ0 = pT; } } // Fill histograms if ( weight < 0.0 ) { MSG_DEBUG( "Negative weight " << weight << "found!" ); } fillHistograms( _fiducialRegions.at(iFiducialRegion), dy, pTbar, dphi, nJets_rapidity_interval, maximumGapQ0, weight ); eventAccepted = true; } // Count number of accepted events if ( eventAccepted ) { _nEventsInAcceptance++; _sumOfAcceptedWeights += weight; } return; } void fillHistograms( const unsigned int &fiducialRegion, const double &dy, const double &pTbar, const double &dphi, const double &nJets_rapidity_interval, const double &maximumGapQ0, const double &weight) { // Determine gap category vector eventGapCategories{{"inclusive"}}; if ( nJets_rapidity_interval == 0 ) { eventGapCategories += string("gap"); } // Fill histograms relevant for comparison with 2010 data if ( fiducialRegion == _fiducialRegions.at(0) ) { // Fill inclusive and gap histograms foreach( const string &gapCategory, eventGapCategories ) { _h_tmp_events_dy[gapCategory]->fill( dy, weight ); _h_crossSection_dphi_dySlices[gapCategory].fill( dy, dphi / M_PI, weight ); _h_profiled_cosDeltaPhi_dy[gapCategory]->fill( dy, cos(M_PI - dphi), weight ); _h_profiled_cosTwoDeltaPhi_dy[gapCategory]->fill( dy, cos(2.0 * dphi), weight ); } // Fill profiled nJets_rapidity_interval _h_profiled_nJets_rapidity_interval_dy->fill( dy, nJets_rapidity_interval, weight ); // Fill Q0 histograms - can fill multiple points per event foreach( const YODA::HistoBin1D Q0_bin, _h_tmp_events_Q0_dySlices["inclusive"].histos().at(0)->bins() ) { const double Q0( Q0_bin.xMid() ); _h_tmp_events_Q0_dySlices["inclusive"].fill(dy, Q0, weight); if ( maximumGapQ0 <= Q0 ) { _h_tmp_events_Q0_dySlices["gap"].fill(dy, Q0, weight); } } // Fill histograms relevant for comparison with 2011 data } else if ( fiducialRegion == _fiducialRegions.at(1) ) { // Fill inclusive and gap histograms foreach( const string &gapCategory, eventGapCategories ) { _h_tmp_events_pTbar[gapCategory]->fill( pTbar, weight ); _h_profiled_cosDeltaPhi_pTbar[gapCategory]->fill( pTbar, cos(M_PI - dphi), weight ); _h_profiled_cosTwoDeltaPhi_pTbar[gapCategory]->fill( pTbar, cos(2.0 * dphi), weight ); } // Fill profiled nJets_rapidity_interval _h_profiled_nJets_rapidity_interval_pTbar->fill( pTbar, nJets_rapidity_interval, weight ); } return; } /// Normalise histograms etc., after the run void finalize() { // Normalise cross-section plots to correct cross-section const double xs_pb( crossSection()/picobarn ); const double nEventsGenerated( sumOfWeights() ); double xs_norm_factor( xs_pb/nEventsGenerated ); const double ySpan(1); // all dy spans are 1 foreach (const string& gapCategory, _gapCategories ) { _h_crossSection_dphi_dySlices[gapCategory].scale(xs_norm_factor/ySpan/M_PI, this); } // Create C2/C1 scatter from profiles foreach (const string& gapCategory, _gapCategories ) { divide( _h_profiled_cosTwoDeltaPhi_dy[gapCategory], _h_profiled_cosDeltaPhi_dy[gapCategory], _h_C2C1_dy[gapCategory] ); divide( _h_profiled_cosTwoDeltaPhi_pTbar[gapCategory], _h_profiled_cosDeltaPhi_pTbar[gapCategory], _h_C2C1_pTbar[gapCategory] ); } // Fill simple gap fractions Scatter2DPtr h_gap_fraction_dy; book(h_gap_fraction_dy, 1, 1, 1); Scatter2DPtr h_gap_fraction_pTbar; book(h_gap_fraction_pTbar, 2, 1, 1, false); Rivet::Analysis::efficiency( *_h_tmp_events_dy["gap"], *_h_tmp_events_dy["inclusive"], h_gap_fraction_dy ); Rivet::Analysis::efficiency( *_h_tmp_events_pTbar["gap"], *_h_tmp_events_pTbar["inclusive"], h_gap_fraction_pTbar ); // Register and fill Q0 gap fractions for (unsigned int dyLow = 0; dyLow < _dy_max; ++dyLow ) { Scatter2DPtr h_gap_fraction_Q0; book(h_gap_fraction_Q0, 29+dyLow, 1, 1, false); Rivet::Analysis::efficiency( *_h_tmp_events_Q0_dySlices["gap"].histos().at(dyLow), *_h_tmp_events_Q0_dySlices["inclusive"].histos().at(dyLow), h_gap_fraction_Q0 ); } /// Print summary information MSG_INFO( "Cross-Section/pb : " << xs_pb ); MSG_INFO( "Sum of weights : " << sumOfWeights() << " (" << _sumOfAcceptedWeights << " accepted)" ); MSG_INFO( "nEvents : " << numEvents() << " (" << _nEventsInAcceptance << " accepted)" ); MSG_INFO( "Normalisation factor : " << xs_norm_factor ); } private: /// Member variables vector _fiducialRegions; vector _vetoScale, _yFiducial; vector _gapCategories; unsigned int _dy_max; unsigned int _nEventsInAcceptance; double _sumOfAcceptedWeights; /// Histograms // Number of events : gap and non-gap : necessary input for gap fractions but not saved as output map _h_tmp_events_dy; map _h_tmp_events_pTbar; - map > _h_tmp_events_Q0_dySlices; + map _h_tmp_events_Q0_dySlices; // Number of jets in rapidity interval Profile1DPtr _h_profiled_nJets_rapidity_interval_dy; Profile1DPtr _h_profiled_nJets_rapidity_interval_pTbar; // Azimuthal moment histograms map _h_profiled_cosDeltaPhi_dy; map _h_profiled_cosDeltaPhi_pTbar; map _h_profiled_cosTwoDeltaPhi_dy; map _h_profiled_cosTwoDeltaPhi_pTbar; map _h_C2C1_dy; map _h_C2C1_pTbar; // Cross-section vs. #Delta#phi - map > _h_crossSection_dphi_dySlices; + map _h_crossSection_dphi_dySlices; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2014_I1307243); } diff --git a/analyses/pluginATLAS/ATLAS_2014_I1325553.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2014_I1325553.cc rename from analyses/pluginATLAS/ATLAS_2014_I1325553.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2014_I1325553.cc --- a/analyses/pluginATLAS/ATLAS_2014_I1325553.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2014_I1325553.cc @@ -1,107 +1,107 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// Jet mass as a function of ystar class ATLAS_2014_I1325553 : public Analysis { public: /// Constructor ATLAS_2014_I1325553() : Analysis("ATLAS_2014_I1325553") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { const FinalState fs; declare(fs,"FinalState"); FastJets fj04(fs, FastJets::ANTIKT, 0.4); fj04.useInvisibles(); declare(fj04, "AntiKT04"); FastJets fj06(fs, FastJets::ANTIKT, 0.6); fj06.useInvisibles(); declare(fj06, "AntiKT06"); double ybins[] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0}; size_t ptDsOffset(0); for (size_t alg = 0; alg < 2; ++alg) { for (size_t i = 0; i < 6; ++i) { Histo1DPtr tmp; - _pt[alg].addHistogram(ybins[i], ybins[i + 1], book(tmp, 1 + ptDsOffset, 1, i + 1)); + _pt[alg].add(ybins[i], ybins[i + 1], book(tmp, 1 + ptDsOffset, 1, i + 1)); } ptDsOffset += 1; } } /// Perform the per-event analysis void analyze(const Event& event) { Jets jetAr[2]; jetAr[AKT4] = apply(event, "AntiKT04").jetsByPt(Cuts::pT > 100*GeV && Cuts::absrap < 3.0); jetAr[AKT6] = apply(event, "AntiKT06").jetsByPt(Cuts::pT > 100*GeV && Cuts::absrap < 3.0); // Loop over jet "radii" used in analysis for (size_t alg = 0; alg < 2; ++alg) { // fill the 1D pt histograms with all the jets passing the cuts foreach (const Jet& jet, jetAr[alg]) { const double absrap = jet.absrap(); if (absrap < 3.0) { const double pt = jet.pT(); if (pt/GeV > 100*GeV) { _pt[alg].fill(absrap, pt/GeV, 1.0); } } } } } /// Normalise histograms etc., after the run void finalize() { /// Print summary info const double xs_pb( crossSection() / picobarn ); const double sumW( sumOfWeights() ); const double xs_norm_factor( 0.5*xs_pb / sumW ); MSG_INFO( "Cross-Section/pb : " << xs_pb ); MSG_INFO( "Sum of weights : " << sumW ); MSG_INFO( "nEvents : " << numEvents() ); for (size_t alg = 0; alg < 2; ++alg) { _pt[alg].scale(xs_norm_factor, this); } } //@} private: // Data members like post-cuts event weight counters go here enum Alg { AKT4=0, AKT6=1 }; /// The inclusive jet spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above) - BinnedHistogram _pt[2]; + BinnedHistogram _pt[2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2014_I1325553); } diff --git a/analyses/pluginATLAS/ATLAS_2014_I1326641.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2014_I1326641.cc rename from analyses/pluginATLAS/ATLAS_2014_I1326641.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2014_I1326641.cc --- a/analyses/pluginATLAS/ATLAS_2014_I1326641.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2014_I1326641.cc @@ -1,121 +1,121 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class ATLAS_2014_I1326641 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor ATLAS_2014_I1326641() : Analysis("ATLAS_2014_I1326641") { setNeedsCrossSection(true); } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { //std::cout << " HELLO ANALYSIS : init " << std::endl; const FinalState fs; FastJets fj04(fs, FastJets::ANTIKT, 0.4); fj04.useInvisibles(); declare(fj04, "AntiKT04"); FastJets fj06(fs, FastJets::ANTIKT, 0.6); fj06.useInvisibles(); declare(fj06, "AntiKT06"); double ystarBins[] = { 0.0, 2.0, 4.0, 6.0, 8.0, 10.0 }; size_t massDsOffset(0); for (size_t alg = 0; alg < 2; ++alg) { for (size_t i = 0; i < 5; ++i) { Histo1DPtr tmp; - h_trijet_Mass[alg].addHistogram(ystarBins[i], ystarBins[i+1], book(tmp, 1 + massDsOffset, 1, 1)); + h_trijet_Mass[alg].add(ystarBins[i], ystarBins[i+1], book(tmp, 1 + massDsOffset, 1, 1)); massDsOffset += 1; } } } /// Perform the per-event analysis void analyze(const Event& event) { Jets jetAr[2]; jetAr[AKT4] = apply(event, "AntiKT04").jetsByPt(Cuts::pT > 50*GeV); jetAr[AKT6] = apply(event, "AntiKT06").jetsByPt(Cuts::pT > 50*GeV); const size_t nJets = 3; double ptCut[nJets] = { 150., 100., 50.}; // Loop over jet "radii" used in analysis for (size_t alg = 0; alg < 2; ++alg) { // Identify 3jets vector leadJets; foreach (const Jet& jet, jetAr[alg]) { if (jet.absrap() < 3.0 && leadJets.size() < nJets){ int filledJets = leadJets.size(); if (jet.pT() < ptCut[filledJets]) continue; leadJets.push_back(jet.momentum()); } } if (leadJets.size() < nJets) { MSG_DEBUG("Could not find three suitable leading jets"); continue; } const double y1 = leadJets[0].rapidity(); const double y2 = leadJets[1].rapidity(); const double y3 = leadJets[2].rapidity(); const double yStar = fabs(y1-y2) + fabs(y2-y3) + fabs(y1-y3); const double m = (leadJets[0] + leadJets[1] + leadJets[2]).mass(); h_trijet_Mass[alg].fill(yStar, m, 1.0); } } /// Normalise histograms etc., after the run void finalize() { //const double sf( 0.5 * crossSection() / sumOfWeights() ); const double sf( crossSection() / sumOfWeights() ); for (size_t alg = 0; alg < 2; ++alg) { h_trijet_Mass[alg].scale(sf, this); } } //@} private: // Data members like post-cuts event weight counters go here enum Alg { AKT4=0, AKT6=1 }; private: // The 3 jets mass spectrum for anti-kt 4 and anti-kt 6 jets (array index is jet type from enum above) - BinnedHistogram h_trijet_Mass[2]; + BinnedHistogram h_trijet_Mass[2]; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2014_I1326641); } diff --git a/analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc rename from analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc --- a/analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2016_CONF_2016_092.cc @@ -1,61 +1,61 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// Inclusive jet cross sections using early 13 TeV data /// @author Stefan von Buddenbrock class ATLAS_2016_CONF_2016_092 : public Analysis { public: /// Constructor DEFAULT_RIVET_ANALYSIS_CTOR(ATLAS_2016_CONF_2016_092); /// Bookings void init() { // Define the jets FastJets antiKT04Jets(FinalState(Cuts::open()), FastJets::ANTIKT, 0.4); antiKT04Jets.useInvisibles(); declare(antiKT04Jets, "antiKT04Jets"); // Book histograms const double y_bins[] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0}; for (size_t i = 0; i < 6; i++) { Histo1DPtr tmp; - _h_pT.addHistogram(y_bins[i], y_bins[i+1], book(tmp, i+1, 1, 1)); + _h_pT.add(y_bins[i], y_bins[i+1], book(tmp, i+1, 1, 1)); } } /// Per-event analysis void analyze(const Event& event) { const Jets& jets = apply(event, "antiKT04Jets") .jetsByPt(Cuts::pT > 100*GeV && Cuts::absrap < 3.0); for (const Jet& j : jets) _h_pT.fill(j.absrap(), j.pT()/GeV, 1.0); } /// Post-run scaling void finalize() { // Divide by 2 to only get positive rapidity values _h_pT.scale(0.5*crossSection()/picobarn/sumOfWeights(), this); } /// Histograms - BinnedHistogram _h_pT; + BinnedHistogram _h_pT; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2016_CONF_2016_092); } diff --git a/analyses/pluginATLAS/ATLAS_2016_I1467454.cc.binnedhisto b/analyses/pluginATLAS/ATLAS_2016_I1467454.cc rename from analyses/pluginATLAS/ATLAS_2016_I1467454.cc.binnedhisto rename to analyses/pluginATLAS/ATLAS_2016_I1467454.cc --- a/analyses/pluginATLAS/ATLAS_2016_I1467454.cc.binnedhisto +++ b/analyses/pluginATLAS/ATLAS_2016_I1467454.cc @@ -1,107 +1,107 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// @brief High-mass Drell-Yan at 8 TeV class ATLAS_2016_I1467454 : public Analysis { public: /// Constructor ATLAS_2016_I1467454(const string& name="ATLAS_2016_I1467454") : Analysis(name) { _mode = 0; // use electron channel by default } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { const FinalState fs; Cut cuts = Cuts::abseta < 2.5 && Cuts::pT > 30*GeV; ZFinder zfinder(fs, cuts, _mode? PID::MUON : PID::ELECTRON, 116*GeV, 1500*GeV, 0.1); declare(zfinder, "ZFinder"); size_t ch = _mode? 11 : 0; // offset book(_hist_mll, 18 + ch, 1, 1); vector mll_bins = { 116., 150., 200., 300., 500., 1500. }; for (size_t i = 0; i < (mll_bins.size() - 1); ++i) { - {Histo1DPtr tmp; _hist_rap.addHistogram( mll_bins[i], mll_bins[i+1], book(tmp, 19 + ch + i, 1, 1));} - {Histo1DPtr tmp; _hist_deta.addHistogram(mll_bins[i], mll_bins[i+1], book(tmp, 24 + ch + i, 1, 1));} + {Histo1DPtr tmp; _hist_rap.add( mll_bins[i], mll_bins[i+1], book(tmp, 19 + ch + i, 1, 1));} + {Histo1DPtr tmp; _hist_deta.add(mll_bins[i], mll_bins[i+1], book(tmp, 24 + ch + i, 1, 1));} } } /// Perform the per-event analysis void analyze(const Event& event) { const ZFinder& zfinder = apply(event, "ZFinder"); if (zfinder.bosons().size() != 1) vetoEvent; const Particle& z0 = zfinder.bosons()[0]; const Particle& el1 = zfinder.particles()[0]; const Particle& el2 = zfinder.particles()[1]; if (el1.pT() > 40*GeV || el2.pT() > 40*GeV) { const double mass = z0.mass(); const double weight = 1.0; _hist_mll->fill(mass/GeV, weight); _hist_rap. fill(mass/GeV, z0.absrap(), weight); _hist_deta.fill(mass/GeV, deltaEta(el1,el2), weight); } } /// Normalise histograms etc., after the run void finalize() { const double sf = crossSection()/sumOfWeights(); scale(_hist_mll, sf); _hist_rap.scale(sf*0.5, this); _hist_deta.scale(sf*0.5, this); } //@} /// Choose to work in electron or muon mode size_t _mode; /// @name Histograms //@{ Histo1DPtr _hist_mll; - BinnedHistogram _hist_rap, _hist_deta; + BinnedHistogram _hist_rap, _hist_deta; //@} }; /// High-mass Drell-Yan at 8 TeV, electron channel struct ATLAS_2016_I1467454_EL : public ATLAS_2016_I1467454 { ATLAS_2016_I1467454_EL() : ATLAS_2016_I1467454("ATLAS_2016_I1467454_EL") { _mode = 0; } }; /// High-mass Drell-Yan at 8 TeV, muon channel struct ATLAS_2016_I1467454_MU : public ATLAS_2016_I1467454 { ATLAS_2016_I1467454_MU() : ATLAS_2016_I1467454("ATLAS_2016_I1467454_MU") { _mode = 1; } }; DECLARE_RIVET_PLUGIN(ATLAS_2016_I1467454); DECLARE_RIVET_PLUGIN(ATLAS_2016_I1467454_EL); DECLARE_RIVET_PLUGIN(ATLAS_2016_I1467454_MU); } diff --git a/analyses/pluginCDF/CDF_1996_S3418421.cc.binnedhisto b/analyses/pluginCDF/CDF_1996_S3418421.cc rename from analyses/pluginCDF/CDF_1996_S3418421.cc.binnedhisto rename to analyses/pluginCDF/CDF_1996_S3418421.cc --- a/analyses/pluginCDF/CDF_1996_S3418421.cc.binnedhisto +++ b/analyses/pluginCDF/CDF_1996_S3418421.cc @@ -1,95 +1,95 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief CDF dijet angular distributions class CDF_1996_S3418421 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor CDF_1996_S3418421() : Analysis("CDF_1996_S3418421") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { FinalState fs(-4.2, 4.2); declare(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets"); - {Histo1DPtr tmp; _h_chi.addHistogram(241.0, 300.0, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi.addHistogram(300.0, 400.0, book(tmp, 1, 1, 2));} - {Histo1DPtr tmp; _h_chi.addHistogram(400.0, 517.0, book(tmp, 1, 1, 3));} - {Histo1DPtr tmp; _h_chi.addHistogram(517.0, 625.0, book(tmp, 1, 1, 4));} - {Histo1DPtr tmp; _h_chi.addHistogram(625.0,1800.0, book(tmp, 1, 1, 5));} + {Histo1DPtr tmp; _h_chi.add(241.0, 300.0, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi.add(300.0, 400.0, book(tmp, 1, 1, 2));} + {Histo1DPtr tmp; _h_chi.add(400.0, 517.0, book(tmp, 1, 1, 3));} + {Histo1DPtr tmp; _h_chi.add(517.0, 625.0, book(tmp, 1, 1, 4));} + {Histo1DPtr tmp; _h_chi.add(625.0,1800.0, book(tmp, 1, 1, 5));} book(_h_ratio, 2, 1, 1); book(_htmp_chi_above_25 ,"TMP/chiabove25", refData(2, 1, 1)); book(_htmp_chi_below_25 ,"TMP/chibelow25", refData(2, 1, 1)); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Jets jets = apply(event, "Jets").jetsByPt(50.0*GeV); if (jets.size() < 2) vetoEvent; const FourMomentum jet1 = jets[0].momentum(); const FourMomentum jet2 = jets[1].momentum(); const double eta1 = jet1.eta(); const double eta2 = jet2.eta(); const double chi = exp(fabs(eta1 - eta2)); if (fabs(eta2) > 2.0 || fabs(eta1) > 2.0 || chi > 5.0) vetoEvent; double m = FourMomentum(jet1 + jet2).mass(); _h_chi.fill(m, chi, weight); // Fill ratio numerator or denominator depending on chi value ((chi > 2.5) ? _htmp_chi_above_25 : _htmp_chi_below_25)->fill(m/GeV, weight); } /// Normalise histograms etc., after the run void finalize() { foreach (Histo1DPtr hist, _h_chi.histos()) { normalize(hist); } divide(_htmp_chi_below_25, _htmp_chi_above_25, _h_ratio); } //@} private: /// @name Histograms //@{ - BinnedHistogram _h_chi; + BinnedHistogram _h_chi; Histo1DPtr _htmp_chi_above_25, _htmp_chi_below_25; Scatter2DPtr _h_ratio; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CDF_1996_S3418421); } diff --git a/analyses/pluginCDF/CDF_2001_S4517016.cc.binnedhisto b/analyses/pluginCDF/CDF_2001_S4517016.cc rename from analyses/pluginCDF/CDF_2001_S4517016.cc.binnedhisto rename to analyses/pluginCDF/CDF_2001_S4517016.cc --- a/analyses/pluginCDF/CDF_2001_S4517016.cc.binnedhisto +++ b/analyses/pluginCDF/CDF_2001_S4517016.cc @@ -1,83 +1,83 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief CDF two-jet triply-differential cross-section class CDF_2001_S4517016 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor CDF_2001_S4517016() : Analysis("CDF_2001_S4517016") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { FinalState fs(-4.2, 4.2); declare(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets"); - {Histo1DPtr tmp; _h_ET.addHistogram(0.1, 0.7, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_ET.addHistogram(0.7, 1.4, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_ET.addHistogram(1.4, 2.1, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_ET.addHistogram(2.1, 3.0, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_ET.add(0.1, 0.7, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_ET.add(0.7, 1.4, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_ET.add(1.4, 2.1, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_ET.add(2.1, 3.0, book(tmp, 4, 1, 1));} } /// Perform the per-event analysis void analyze(const Event& event) { Jets jets = apply(event, "Jets").jets(Cuts::Et > 10*GeV, cmpMomByEt); if (jets.size() < 2) vetoEvent; FourMomentum jet1 = jets[0].momentum(); FourMomentum jet2 = jets[1].momentum(); double eta1 = jet1.abseta(); double eta2 = jet2.abseta(); double ET1 = jet1.Et(); double ET2 = jet2.Et(); if (!inRange(eta1, 0.1, 0.7) || ET1 < 40.0*GeV) vetoEvent; if (!inRange(eta2, 0.1, 3.0)) vetoEvent; _h_ET.fill(eta2, ET1); if (eta2<0.7 && ET2>40.0*GeV) _h_ET.fill(eta1, ET2); } /// Normalise histograms etc., after the run void finalize() { const double deta1 = 1.2; _h_ET.scale(crossSection()/nanobarn/sumOfWeights()/deta1 / 2.0, this); } //@} private: /// @name Histograms //@{ - BinnedHistogram _h_ET; + BinnedHistogram _h_ET; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CDF_2001_S4517016); } diff --git a/analyses/pluginCDF/CDF_2007_S7057202.cc.binnedhisto b/analyses/pluginCDF/CDF_2007_S7057202.cc rename from analyses/pluginCDF/CDF_2007_S7057202.cc.binnedhisto rename to analyses/pluginCDF/CDF_2007_S7057202.cc --- a/analyses/pluginCDF/CDF_2007_S7057202.cc.binnedhisto +++ b/analyses/pluginCDF/CDF_2007_S7057202.cc @@ -1,79 +1,79 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief CDF inclusive jet cross-section using the \f$ k_\perp \f$ algorithm class CDF_2007_S7057202 : public Analysis { public: CDF_2007_S7057202() : Analysis("CDF_2007_S7057202") { } void init() { // Set up projections const FinalState fs; declare(FastJets(fs, FastJets::KT, 0.5), "JetsD05"); declare(FastJets(fs, FastJets::KT, 0.7), "JetsD07"); declare(FastJets(fs, FastJets::KT, 1.0), "JetsD10"); // Book histos - {Histo1DPtr tmp; _binnedHistosD07.addHistogram( 0, 0.1, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _binnedHistosD07.addHistogram(0.1, 0.7, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _binnedHistosD07.addHistogram(0.7, 1.1, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _binnedHistosD07.addHistogram(1.1, 1.6, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _binnedHistosD07.addHistogram(1.6, 2.1, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _binnedHistosD07.add( 0, 0.1, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _binnedHistosD07.add(0.1, 0.7, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _binnedHistosD07.add(0.7, 1.1, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _binnedHistosD07.add(1.1, 1.6, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _binnedHistosD07.add(1.6, 2.1, book(tmp, 5, 1, 1));} book(_histoD05 ,6, 1, 1); book(_histoD10 ,7, 1, 1); } void analyze(const Event& event) { const double weight = 1.0; foreach (const Jet& jet, apply(event, "JetsD07").jets(Cuts::pT > 54*GeV)) _binnedHistosD07.fill(jet.absrap(), jet.pT(), weight); foreach (const Jet& jet, apply(event, "JetsD05").jets(Cuts::pT > 54*GeV)) if (inRange(jet.absrap(), 0.1, 0.7)) _histoD05->fill(jet.pT(), weight); foreach (const Jet& jet, apply(event, "JetsD10").jets(Cuts::pT > 54*GeV)) if (inRange(jet.absrap(), 0.1, 0.7)) _histoD10->fill(jet.pT(), weight); } // Normalise histograms to cross-section void finalize() { const double xSec = crossSectionPerEvent()/nanobarn; scale(_histoD05, xSec); scale(_histoD10, xSec); // scale to xSec/yBinWidth and take into account the double yBinWidth due // to the absolute value of y _binnedHistosD07.scale(xSec/2.0, this); } private: - BinnedHistogram _binnedHistosD07; + BinnedHistogram _binnedHistosD07; // Single histogram for the \f$R=0.5\f$ \f$k_\perp\f$ jets Histo1DPtr _histoD05; // Single histogram for the \f$R=1.0\f$ \f$k_\perp\f$ jets Histo1DPtr _histoD10; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CDF_2007_S7057202); } diff --git a/analyses/pluginCDF/CDF_2008_S7828950.cc.binnedhisto b/analyses/pluginCDF/CDF_2008_S7828950.cc rename from analyses/pluginCDF/CDF_2008_S7828950.cc.binnedhisto rename to analyses/pluginCDF/CDF_2008_S7828950.cc --- a/analyses/pluginCDF/CDF_2008_S7828950.cc.binnedhisto +++ b/analyses/pluginCDF/CDF_2008_S7828950.cc @@ -1,68 +1,68 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief CDF Run II inclusive jet cross-section using the Midpoint algorithm. /// /// The analysis includes 1.1fb^-1 of CDF data and is the first with a /// cone algorithm to include the forward region of the detector. /// arXiv:0807.2204 to be published in PRD class CDF_2008_S7828950 : public Analysis { public: /// Constructor CDF_2008_S7828950() : Analysis("CDF_2008_S7828950") { } /// @name Analysis methods //@{ // Book histos and set counters for number of events passed in each one void init() { const FinalState fs; declare(FastJets(fs, FastJets::CDFMIDPOINT, 0.7), "JetsM07"); - {Histo1DPtr tmp; _binnedHistosR07.addHistogram( 0, 0.1, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _binnedHistosR07.addHistogram(0.1, 0.7, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _binnedHistosR07.addHistogram(0.7, 1.1, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _binnedHistosR07.addHistogram(1.1, 1.6, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _binnedHistosR07.addHistogram(1.6, 2.1, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _binnedHistosR07.add( 0, 0.1, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _binnedHistosR07.add(0.1, 0.7, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _binnedHistosR07.add(0.7, 1.1, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _binnedHistosR07.add(1.1, 1.6, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _binnedHistosR07.add(1.6, 2.1, book(tmp, 5, 1, 1));} } // Do the analysis void analyze(const Event& event) { foreach (const Jet& jet, apply(event, "JetsM07").jets(Cuts::pT > 62*GeV)) { _binnedHistosR07.fill(jet.absrap(), jet.pT(), 1.0); } } // Normalise histograms to cross-section void finalize() { _binnedHistosR07.scale(crossSection()/nanobarn/sumOfWeights()/2.0, this); } //@} private: /// Histograms in different eta regions - BinnedHistogram _binnedHistosR07; + BinnedHistogram _binnedHistosR07; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CDF_2008_S7828950); } diff --git a/analyses/pluginCMS/CMS_2011_S8950903.cc.binnedhisto b/analyses/pluginCMS/CMS_2011_S8950903.cc rename from analyses/pluginCMS/CMS_2011_S8950903.cc.binnedhisto rename to analyses/pluginCMS/CMS_2011_S8950903.cc --- a/analyses/pluginCMS/CMS_2011_S8950903.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2011_S8950903.cc @@ -1,60 +1,60 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { // CMS azimuthal decorrelations class CMS_2011_S8950903 : public Analysis { public: CMS_2011_S8950903() : Analysis("CMS_2011_S8950903") {} void init() { FinalState fs; FastJets akt(fs, FastJets::ANTIKT, 0.5); declare(akt, "antikT"); - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 80., 110., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(110., 140., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(140., 200., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(200., 300., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram(300., 7000., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 80., 110., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add(110., 140., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add(140., 200., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add(200., 300., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add(300., 7000., book(tmp, 5, 1, 1));} } void analyze(const Event & event) { const double weight = 1.0; const Jets& jets = apply(event, "antikT").jetsByPt(); if (jets.size() < 2) vetoEvent; if (fabs(jets[0].eta()) > 1.1 || jets[0].pT() < 80.) vetoEvent; if (fabs(jets[1].eta()) > 1.1 || jets[1].pT() < 30.) vetoEvent; double dphi = deltaPhi(jets[0].momentum(), jets[1].phi()); _h_deltaPhi.fill(jets[0].pT(), dphi, weight); } void finalize() { foreach (Histo1DPtr histo, _h_deltaPhi.histos()) { normalize(histo, 1.); } } private: - BinnedHistogram _h_deltaPhi; + BinnedHistogram _h_deltaPhi; }; // This global object acts as a hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2011_S8950903); } diff --git a/analyses/pluginCMS/CMS_2011_S8968497.cc.binnedhisto b/analyses/pluginCMS/CMS_2011_S8968497.cc rename from analyses/pluginCMS/CMS_2011_S8968497.cc.binnedhisto rename to analyses/pluginCMS/CMS_2011_S8968497.cc --- a/analyses/pluginCMS/CMS_2011_S8968497.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2011_S8968497.cc @@ -1,66 +1,66 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class CMS_2011_S8968497 : public Analysis { public: CMS_2011_S8968497() : Analysis("CMS_2011_S8968497") { } void init() { FinalState fs; FastJets antikt(fs, FastJets::ANTIKT, 0.5); declare(antikt, "ANTIKT"); - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(2200., 7000., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1800., 2200., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1400., 1800., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1100., 1400., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 850., 1100., book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 650., 850., book(tmp, 6, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 500., 650., book(tmp, 7, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 350., 500., book(tmp, 8, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 250., 350., book(tmp, 9, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(2200., 7000., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1800., 2200., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1400., 1800., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1100., 1400., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 850., 1100., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 650., 850., book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 500., 650., book(tmp, 7, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 350., 500., book(tmp, 8, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 250., 350., book(tmp, 9, 1, 1));} } void analyze(const Event& event) { const double weight = 1.0; const Jets& jets = apply(event, "ANTIKT").jetsByPt(); if (jets.size() < 2) vetoEvent; FourMomentum j0(jets[0].momentum()); FourMomentum j1(jets[1].momentum()); double y0 = j0.rapidity(); double y1 = j1.rapidity(); if (fabs(y0+y1)/2. > 1.11) vetoEvent; double mjj = FourMomentum(j0+j1).mass(); double chi = exp(fabs(y0-y1)); if(chi<16.) _h_chi_dijet.fill(mjj, chi, weight); } void finalize() { foreach (Histo1DPtr hist, _h_chi_dijet.histos()) { normalize(hist); } } private: - BinnedHistogram _h_chi_dijet; + BinnedHistogram _h_chi_dijet; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2011_S8968497); } diff --git a/analyses/pluginCMS/CMS_2011_S9086218.cc.binnedhisto b/analyses/pluginCMS/CMS_2011_S9086218.cc rename from analyses/pluginCMS/CMS_2011_S9086218.cc.binnedhisto rename to analyses/pluginCMS/CMS_2011_S9086218.cc --- a/analyses/pluginCMS/CMS_2011_S9086218.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2011_S9086218.cc @@ -1,57 +1,57 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { // Inclusive jet pT class CMS_2011_S9086218 : public Analysis { public: // Constructor CMS_2011_S9086218() : Analysis("CMS_2011_S9086218") {} // Book histograms and initialize projections: void init() { const FinalState fs; // Initialize the projectors: declare(FastJets(fs, FastJets::ANTIKT, 0.5),"Jets"); // Book histograms: - {Histo1DPtr tmp; _hist_sigma.addHistogram(0.0, 0.5, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _hist_sigma.addHistogram(0.5, 1.0, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _hist_sigma.addHistogram(1.0, 1.5, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _hist_sigma.addHistogram(1.5, 2.0, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _hist_sigma.addHistogram(2.0, 2.5, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _hist_sigma.addHistogram(2.5, 3.0, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(0.0, 0.5, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(0.5, 1.0, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(1.0, 1.5, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(1.5, 2.0, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(2.0, 2.5, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _hist_sigma.add(2.5, 3.0, book(tmp, 6, 1, 1));} } // Analysis void analyze(const Event &event) { const double weight = 1.0; const FastJets& fj = apply(event,"Jets"); const Jets& jets = fj.jets(Cuts::ptIn(18*GeV, 1100.0*GeV) && Cuts::absrap < 4.7); // Fill the relevant histograms: foreach(const Jet& j, jets) { _hist_sigma.fill(j.absrap(), j.pT(), weight); } } // Finalize void finalize() { _hist_sigma.scale(crossSection()/sumOfWeights()/2.0, this); } private: - BinnedHistogram _hist_sigma; + BinnedHistogram _hist_sigma; }; // This global object acts as a hook for the plugin system. DECLARE_RIVET_PLUGIN(CMS_2011_S9086218); } diff --git a/analyses/pluginCMS/CMS_2011_S9088458.cc.binnedhisto b/analyses/pluginCMS/CMS_2011_S9088458.cc rename from analyses/pluginCMS/CMS_2011_S9088458.cc.binnedhisto rename to analyses/pluginCMS/CMS_2011_S9088458.cc --- a/analyses/pluginCMS/CMS_2011_S9088458.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2011_S9088458.cc @@ -1,63 +1,62 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// CMS ratio of 3-jet to 2-jet cross-sections class CMS_2011_S9088458 : public Analysis { public: CMS_2011_S9088458() : Analysis("CMS_2011_S9088458") { } void init() { FinalState fs; FastJets akt(fs, FastJets::ANTIKT, 0.5); declare(akt, "antikT"); book(_h_tmp_dijet , "TMP/dijet", refData(1, 1, 1)); book(_h_tmp_trijet, "TMP/trijet", refData(1, 1, 1)); book(_h_r32, 1, 1, 1); } void analyze(const Event & event) { const double weight = 1.0; Jets highpT_jets; double HT = 0; foreach(const Jet & jet, apply(event, "antikT").jetsByPt(50.0*GeV)) { if (jet.abseta() < 2.5) { highpT_jets.push_back(jet); HT += jet.pT(); } } if (highpT_jets.size() < 2) vetoEvent; if (highpT_jets.size() >= 2) _h_tmp_dijet->fill(HT/TeV, weight); if (highpT_jets.size() >= 3) _h_tmp_trijet->fill(HT/TeV, weight); } void finalize() { divide(_h_tmp_trijet, _h_tmp_dijet, _h_r32); } private: Histo1DPtr _h_tmp_dijet, _h_tmp_trijet; Scatter2DPtr _h_r32; }; // A hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2011_S9088458); } diff --git a/analyses/pluginCMS/CMS_2012_I1090423.cc.binnedhisto b/analyses/pluginCMS/CMS_2012_I1090423.cc rename from analyses/pluginCMS/CMS_2012_I1090423.cc.binnedhisto rename to analyses/pluginCMS/CMS_2012_I1090423.cc --- a/analyses/pluginCMS/CMS_2012_I1090423.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2012_I1090423.cc @@ -1,67 +1,67 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class CMS_2012_I1090423 : public Analysis { public: CMS_2012_I1090423() : Analysis("CMS_2012_I1090423") { } void init() { FinalState fs; FastJets antikt(fs, FastJets::ANTIKT, 0.5); declare(antikt, "ANTIKT"); - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(3000, 7000, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(2400, 3000, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1900, 2400, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1500, 1900, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1200, 1500, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1000, 1200, book(tmp, 6, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 800, 1000, book(tmp, 7, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 600, 800, book(tmp, 8, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram( 400, 600, book(tmp, 9, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(3000, 7000, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(2400, 3000, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1900, 2400, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1500, 1900, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1200, 1500, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1000, 1200, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 800, 1000, book(tmp, 7, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 600, 800, book(tmp, 8, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add( 400, 600, book(tmp, 9, 1, 1));} } void analyze(const Event& event) { const Jets& jets = apply(event, "ANTIKT").jetsByPt(); if (jets.size() < 2) vetoEvent; const double y0 = jets[0].rapidity(); const double y1 = jets[1].rapidity(); if (fabs(y0+y1)/2 > 1.11) vetoEvent; const double chi = exp(fabs(y0-y1)); if (chi > 16) vetoEvent; const FourMomentum jj = jets[0].momentum() + jets[1].momentum(); _h_chi_dijet.fill(jj.mass(), chi, 1.0); } void finalize() { foreach (Histo1DPtr hist, _h_chi_dijet.histos()) { normalize(hist); } } private: - BinnedHistogram _h_chi_dijet; + BinnedHistogram _h_chi_dijet; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2012_I1090423); } diff --git a/analyses/pluginCMS/CMS_2012_I1102908.cc.binnedhisto b/analyses/pluginCMS/CMS_2012_I1102908.cc rename from analyses/pluginCMS/CMS_2012_I1102908.cc.binnedhisto rename to analyses/pluginCMS/CMS_2012_I1102908.cc --- a/analyses/pluginCMS/CMS_2012_I1102908.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2012_I1102908.cc @@ -1,89 +1,88 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include namespace Rivet { /// @cond inline double _invert(double x) { return (x > 0) ? 1/x : 0; } /// @endcond /// @brief CMS inclusive and exclusive dijet production ratio at large rapidity intervals class CMS_2012_I1102908 : public Analysis { public: CMS_2012_I1102908() : Analysis("CMS_2012_I1102908") { } void init() { // Projections declare(FastJets(FinalState(), FastJets::ANTIKT, 0.5), "antikT"); // Histograms /// @todo Can we manage to only register these as they are "really" created in the finalize()? book(_h_dijet_ratio , 1, 1, 1); book(_h_MN_dijet_ratio, 2, 1, 1); // Temporary histograms (directly instantiated) book(_h_DeltaY_exclusive ,"TMP/excl",refData(1, 1, 1)); book(_h_DeltaY_inclusive ,"TMP/incl",refData(1, 1, 1)); book(_h_DeltaY_MN ,"TMP/YMN",refData(1, 1, 1)); } void analyze(const Event & event) { const double weight = 1.0; // Jets with pT > 35.0, -4.7 < y < 4.7 const JetAlg& jet_alg = apply(event, "antikT"); const Jets& jets = jet_alg.jets(Cuts::pT > 35*GeV && Cuts::absrap < 4.7); // Veto event if number of jets less than 2 if (jets.size() < 2) return; // Loop over jet pairs double deltaY_MN = 0.0; for (size_t ij1 = 0; ij1 < jets.size(); ++ij1) { for (size_t ij2 = ij1 + 1; ij2 < jets.size(); ++ij2) { const double deltaY = fabs(jets[ij1].rapidity() - jets[ij2].rapidity()); // Exclusive dijet case: if (jets.size() == 2) _h_DeltaY_exclusive->fill(deltaY, weight); // Inclusive jets case: _h_DeltaY_inclusive->fill(deltaY, weight); // Mueller-Navelet: if (deltaY > deltaY_MN) deltaY_MN = deltaY; } } _h_DeltaY_MN->fill(deltaY_MN, weight); } void finalize() { *_h_dijet_ratio = YODA::efficiency(*_h_DeltaY_exclusive, *_h_DeltaY_inclusive); *_h_MN_dijet_ratio = YODA::efficiency(*_h_DeltaY_exclusive, *_h_DeltaY_MN); transformY(*_h_dijet_ratio, _invert); transformY(*_h_MN_dijet_ratio, _invert); } private: /// @name Histograms //@{ Scatter2DPtr _h_dijet_ratio, _h_MN_dijet_ratio; Histo1DPtr _h_DeltaY_inclusive, _h_DeltaY_exclusive, _h_DeltaY_MN; //@} }; DECLARE_RIVET_PLUGIN(CMS_2012_I1102908); } diff --git a/analyses/pluginCMS/CMS_2013_I1122847.cc.binnedhisto b/analyses/pluginCMS/CMS_2013_I1122847.cc rename from analyses/pluginCMS/CMS_2013_I1122847.cc.binnedhisto rename to analyses/pluginCMS/CMS_2013_I1122847.cc --- a/analyses/pluginCMS/CMS_2013_I1122847.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2013_I1122847.cc @@ -1,199 +1,198 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ZFinder.hh" -#include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class CMS_2013_I1122847 : public Analysis { public: /// Constructor CMS_2013_I1122847() : Analysis("CMS_2013_I1122847") {} /// Book histograms and initialise projections before the run void init() { FinalState fs; Cut cuts_mu = Cuts::abseta < 2.4 && Cuts::pT > 20*GeV; ZFinder zfinder_mu(fs, cuts_mu, PID::MUON, 40.0*GeV, MAXDOUBLE, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); declare(zfinder_mu, "zfinder_mu"); Cut cuts_el = (Cuts::pT >= 20*GeV && Cuts::abseta < 2.4 && !Cuts::absetaIn(1.447, 1.57)); ZFinder zfinder_el(fs, cuts_el, PID::ELECTRON, 40.0*GeV, MAXDOUBLE, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); declare(zfinder_el, "zfinder_el"); /// Histograms // dimuon book(_hist_mm_100_num, "TMP/mm_100_num", refData(1, 1, 1)); book(_hist_mm_125_num, "TMP/mm_125_num", refData(1, 1, 2)); book(_hist_mm_150_num, "TMP/mm_150_num", refData(1, 1, 3)); book(_hist_mm_240_num, "TMP/mm_240_num", refData(1, 1, 4)); book(_hist_mm_100_den, "TMP/mm_100_den", refData(1, 1, 1)); book(_hist_mm_125_den, "TMP/mm_125_den", refData(1, 1, 2)); book(_hist_mm_150_den, "TMP/mm_150_den", refData(1, 1, 3)); book(_hist_mm_240_den, "TMP/mm_240_den", refData(1, 1, 4)); // Dielectron book(_hist_ee_100_num, "TMP/ee_100_num", refData(2, 1, 1)); book(_hist_ee_125_num, "TMP/ee_125_num", refData(2, 1, 2)); book(_hist_ee_150_num, "TMP/ee_150_num", refData(2, 1, 3)); book(_hist_ee_240_num, "TMP/ee_240_num", refData(2, 1, 4)); book(_hist_ee_100_den, "TMP/ee_100_den", refData(2, 1, 1)); book(_hist_ee_125_den, "TMP/ee_125_den", refData(2, 1, 2)); book(_hist_ee_150_den, "TMP/ee_150_den", refData(2, 1, 3)); book(_hist_ee_240_den, "TMP/ee_240_den", refData(2, 1, 4)); // Dilepton book(_hist_ll_100_num, "TMP/ll_100_num", refData(3, 1, 1)); book(_hist_ll_125_num, "TMP/ll_125_num", refData(3, 1, 2)); book(_hist_ll_150_num, "TMP/ll_150_num", refData(3, 1, 3)); book(_hist_ll_240_num, "TMP/ll_240_num", refData(3, 1, 4)); book(_hist_ll_100_den, "TMP/ll_100_den", refData(3, 1, 1)); book(_hist_ll_125_den, "TMP/ll_125_den", refData(3, 1, 2)); book(_hist_ll_150_den, "TMP/ll_150_den", refData(3, 1, 3)); book(_hist_ll_240_den, "TMP/ll_240_den", refData(3, 1, 4)); } double cosThetaCS(const Particle& l1, const Particle& l2) { const FourMomentum mom1 = l1.mom(); const FourMomentum mom2 = l2.mom(); const FourMomentum mom12 = mom1 + mom2; const double Q = mom12.mass(); const double QT = mom12.pT(); const double QZ = mom12.pz(); /// @todo Why include factors of sqrt2 which then get immediately multiplied then divided out? const double sqrt2 = sqrt(2.0); /// @todo Can be done more nicely via PID-ordered references to mom1, mom2 const double P1p = ((l1.pid() > 0) ? (mom1.E() + mom1.pz()) : (mom2.E() + mom2.pz())) / sqrt2; const double P1m = ((l1.pid() > 0) ? (mom1.E() - mom1.pz()) : (mom2.E() - mom2.pz())) / sqrt2; const double P2p = ((l1.pid() > 0) ? (mom2.E() + mom2.pz()) : (mom1.E() + mom1.pz())) / sqrt2; const double P2m = ((l1.pid() > 0) ? (mom2.E() - mom2.pz()) : (mom1.E() - mom1.pz())) / sqrt2; const double cosThetaCS = sign(QZ) * (2 / (Q * add_quad(Q, QT))) * (P1p*P2m - P1m*P2p); return cosThetaCS; } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; const ZFinder& zfinder_el = apply(event, "zfinder_el"); if (zfinder_el.bosons().size() > 0) { const Particle& z = zfinder_el.bosons()[0]; const Particle& l1 = zfinder_el.constituents()[0]; const Particle& l2 = zfinder_el.constituents()[1]; // Prepare variables for filling const double rap = z.absrap(); const double costhetacs = cosThetaCS(l1, l2); const double sgn = sign(costhetacs); // Fill the histograms if (rap < 1.0) { _hist_ee_100_num->fill(z.mass(), weight * sgn); _hist_ll_100_num->fill(z.mass(), weight * sgn); _hist_ee_100_den->fill(z.mass(), weight); _hist_ll_100_den->fill(z.mass(), weight); } else if (rap < 1.25) { _hist_ee_125_num->fill(z.mass(), weight * sgn); _hist_ll_125_num->fill(z.mass(), weight * sgn); _hist_ee_125_den->fill(z.mass(), weight); _hist_ll_125_den->fill(z.mass(), weight); } else if (rap < 1.50) { _hist_ee_150_num->fill(z.mass(), weight * sgn); _hist_ll_150_num->fill(z.mass(), weight * sgn); _hist_ee_150_den->fill(z.mass(), weight); _hist_ll_150_den->fill(z.mass(), weight); } else if (rap < 2.40) { _hist_ee_240_num->fill(z.mass(), weight * sgn); _hist_ll_240_num->fill(z.mass(), weight * sgn); _hist_ee_240_den->fill(z.mass(), weight); _hist_ll_240_den->fill(z.mass(), weight); } } const ZFinder& zfinder_mu = apply(event, "zfinder_mu"); if (zfinder_mu.bosons().size() > 0) { const Particle& z = zfinder_mu.bosons()[0]; const Particle& l1 = zfinder_mu.constituents()[0]; const Particle& l2 = zfinder_mu.constituents()[1]; // Prepare variables for filling const double rap = z.absrap(); const double costhetacs = cosThetaCS(l1, l2); const double sgn = sign(costhetacs); // Fill the histograms if (rap < 1.0) { _hist_mm_100_num->fill(z.mass(), weight * sgn); _hist_ll_100_num->fill(z.mass(), weight * sgn); _hist_mm_100_den->fill(z.mass(), weight); _hist_ll_100_den->fill(z.mass(), weight); } else if (rap < 1.25) { _hist_mm_125_num->fill(z.mass(), weight * sgn); _hist_ll_125_num->fill(z.mass(), weight * sgn); _hist_mm_125_den->fill(z.mass(), weight); _hist_ll_125_den->fill(z.mass(), weight); } else if (rap < 1.50) { _hist_mm_150_num->fill(z.mass(), weight * sgn); _hist_ll_150_num->fill(z.mass(), weight * sgn); _hist_mm_150_den->fill(z.mass(), weight); _hist_ll_150_den->fill(z.mass(), weight); } else if (rap < 2.40) { _hist_mm_240_num->fill(z.mass(), weight * sgn); _hist_ll_240_num->fill(z.mass(), weight * sgn); _hist_mm_240_den->fill(z.mass(), weight); _hist_ll_240_den->fill(z.mass(), weight); } } } /// Normalise histograms etc., after the run void finalize() { {Scatter2DPtr s2d; divide(_hist_mm_100_num, _hist_mm_100_den, book(s2d, 1, 1, 1));} {Scatter2DPtr s2d; divide(_hist_mm_125_num, _hist_mm_125_den, book(s2d, 1, 1, 2));} {Scatter2DPtr s2d; divide(_hist_mm_150_num, _hist_mm_150_den, book(s2d, 1, 1, 3));} {Scatter2DPtr s2d; divide(_hist_mm_240_num, _hist_mm_240_den, book(s2d, 1, 1, 4));} {Scatter2DPtr s2d; divide(_hist_ee_100_num, _hist_ee_100_den, book(s2d, 2, 1, 1));} {Scatter2DPtr s2d; divide(_hist_ee_125_num, _hist_ee_125_den, book(s2d, 2, 1, 2));} {Scatter2DPtr s2d; divide(_hist_ee_150_num, _hist_ee_150_den, book(s2d, 2, 1, 3));} {Scatter2DPtr s2d; divide(_hist_ee_240_num, _hist_ee_240_den, book(s2d, 2, 1, 4));} {Scatter2DPtr s2d; divide(_hist_ll_100_num, _hist_ll_100_den, book(s2d, 3, 1, 1));} {Scatter2DPtr s2d; divide(_hist_ll_125_num, _hist_ll_125_den, book(s2d, 3, 1, 2));} {Scatter2DPtr s2d; divide(_hist_ll_150_num, _hist_ll_150_den, book(s2d, 3, 1, 3));} {Scatter2DPtr s2d; divide(_hist_ll_240_num, _hist_ll_240_den, book(s2d, 3, 1, 4));} } private: /// Histograms Histo1DPtr _hist_ee_100_num, _hist_ee_125_num, _hist_ee_150_num, _hist_ee_240_num; Histo1DPtr _hist_ee_100_den, _hist_ee_125_den, _hist_ee_150_den, _hist_ee_240_den; Histo1DPtr _hist_mm_100_num, _hist_mm_125_num, _hist_mm_150_num, _hist_mm_240_num; Histo1DPtr _hist_mm_100_den, _hist_mm_125_den, _hist_mm_150_den, _hist_mm_240_den; Histo1DPtr _hist_ll_100_num, _hist_ll_125_num, _hist_ll_150_num, _hist_ll_240_num; Histo1DPtr _hist_ll_100_den, _hist_ll_125_den, _hist_ll_150_den, _hist_ll_240_den; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2013_I1122847); } diff --git a/analyses/pluginCMS/CMS_2013_I1208923.cc.binnedhisto b/analyses/pluginCMS/CMS_2013_I1208923.cc rename from analyses/pluginCMS/CMS_2013_I1208923.cc.binnedhisto rename to analyses/pluginCMS/CMS_2013_I1208923.cc --- a/analyses/pluginCMS/CMS_2013_I1208923.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2013_I1208923.cc @@ -1,79 +1,79 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { // This analysis is a derived from the class Analysis: class CMS_2013_I1208923 : public Analysis { public: // Constructor CMS_2013_I1208923() : Analysis("CMS_2013_I1208923") { //setNeedsCrossSection(true); } // Book histograms and initialize projections: void init() { const FinalState fs; declare(fs, "FS"); // Initialize the projections declare(FastJets(fs, FastJets::ANTIKT, 0.7), "Jets"); // Book histograms - {Histo1DPtr tmp; _h_sigma.addHistogram(0.0, 0.5, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_sigma.addHistogram(0.5, 1.0, book(tmp, 1, 1, 2));} - {Histo1DPtr tmp; _h_sigma.addHistogram(1.0, 1.5, book(tmp, 1, 1, 3));} - {Histo1DPtr tmp; _h_sigma.addHistogram(1.5, 2.0, book(tmp, 1, 1, 4));} - {Histo1DPtr tmp; _h_sigma.addHistogram(2.0, 2.5, book(tmp, 1, 1, 5));} + {Histo1DPtr tmp; _h_sigma.add(0.0, 0.5, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_sigma.add(0.5, 1.0, book(tmp, 1, 1, 2));} + {Histo1DPtr tmp; _h_sigma.add(1.0, 1.5, book(tmp, 1, 1, 3));} + {Histo1DPtr tmp; _h_sigma.add(1.5, 2.0, book(tmp, 1, 1, 4));} + {Histo1DPtr tmp; _h_sigma.add(2.0, 2.5, book(tmp, 1, 1, 5));} - {Histo1DPtr tmp; _h_invMass.addHistogram(0.0, 0.5, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_invMass.addHistogram(0.5, 1.0, book(tmp, 2, 1, 2));} - {Histo1DPtr tmp; _h_invMass.addHistogram(1.0, 1.5, book(tmp, 2, 1, 3));} - {Histo1DPtr tmp; _h_invMass.addHistogram(1.5, 2.0, book(tmp, 2, 1, 4));} - {Histo1DPtr tmp; _h_invMass.addHistogram(2.0, 2.5, book(tmp, 2, 1, 5));} + {Histo1DPtr tmp; _h_invMass.add(0.0, 0.5, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_invMass.add(0.5, 1.0, book(tmp, 2, 1, 2));} + {Histo1DPtr tmp; _h_invMass.add(1.0, 1.5, book(tmp, 2, 1, 3));} + {Histo1DPtr tmp; _h_invMass.add(1.5, 2.0, book(tmp, 2, 1, 4));} + {Histo1DPtr tmp; _h_invMass.add(2.0, 2.5, book(tmp, 2, 1, 5));} } // Analysis void analyze(const Event &event) { const double weight = 1.0; const FastJets &fJets = apply(event, "Jets"); // Fill the jet pT spectra const Jets& jets = fJets.jetsByPt(Cuts::pt>100.*GeV && Cuts::absrap <2.5); foreach (const Jet &j, jets) { _h_sigma.fill(fabs(j.momentum().rapidity()), j.momentum().pT() / GeV, weight); } // Require two jets const Jets& dijets = fJets.jetsByPt(Cuts::pt>30.*GeV && Cuts::absrap < 2.5); if (dijets.size() > 1) { if (dijets[0].momentum().pT() / GeV > 60.) { // Fill the invariant mass histogram double ymax = max(dijets[0].momentum().absrapidity(), dijets[1].momentum().absrapidity()); double invMass = FourMomentum(dijets[0].momentum() + dijets[1].momentum()).mass(); _h_invMass.fill(fabs(ymax), invMass, weight); } } } // Scale histograms by the production cross section void finalize() { _h_sigma.scale( crossSection() / sumOfWeights() / 2.0, this); _h_invMass.scale(crossSection() / sumOfWeights() / 2.0, this); } private: - BinnedHistogram _h_sigma; - BinnedHistogram _h_invMass; + BinnedHistogram _h_sigma; + BinnedHistogram _h_invMass; }; // This global object acts as a hook for the plugin system. DECLARE_RIVET_PLUGIN(CMS_2013_I1208923); } diff --git a/analyses/pluginCMS/CMS_2013_I1209721.cc.binnedhisto b/analyses/pluginCMS/CMS_2013_I1209721.cc rename from analyses/pluginCMS/CMS_2013_I1209721.cc.binnedhisto rename to analyses/pluginCMS/CMS_2013_I1209721.cc --- a/analyses/pluginCMS/CMS_2013_I1209721.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2013_I1209721.cc @@ -1,174 +1,173 @@ #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Projections/Thrust.hh" namespace Rivet { /// CMS Z+jets delta(phi) and jet thrust measurement at 7 TeV class CMS_2013_I1209721 : public Analysis { public: CMS_2013_I1209721() : Analysis("CMS_2013_I1209721") { } /// Book projections and histograms void init() { // Full final state const FinalState fs(-5.0,5.0); declare(fs, "FS"); // Z finders for electrons and muons Cut cuts = Cuts::abseta < 2.4 && Cuts::pT > 20*GeV; const ZFinder zfe(fs, cuts, PID::ELECTRON, 71*GeV, 111*GeV); const ZFinder zfm(fs, cuts, PID::MUON, 71*GeV, 111*GeV); declare(zfe, "ZFE"); declare(zfm, "ZFM"); // Jets const FastJets jets(fs, FastJets::ANTIKT, 0.5); declare(jets, "JETS"); // Book histograms from data for (size_t i = 0; i < 2; ++i) { book(_histDeltaPhiZJ1_1[i] ,1+i*9, 1, 1); book(_histDeltaPhiZJ1_2[i] ,2+i*9, 1, 1); book(_histDeltaPhiZJ1_3[i] ,4+i*9, 1, 1); book(_histDeltaPhiZJ2_3[i] ,5+i*9, 1, 1); book(_histDeltaPhiZJ3_3[i] ,3+i*9, 1, 1); book(_histDeltaPhiJ1J2_3[i] ,6+i*9, 1, 1); book(_histDeltaPhiJ1J3_3[i] ,7+i*9, 1, 1); book(_histDeltaPhiJ2J3_3[i] ,8+i*9, 1, 1); book(_histTransvThrust[i] ,9+i*9, 1, 1); } } void analyze(const Event& event) { const double weight = 1.0; // Apply the Z finders const ZFinder& zfe = apply(event, "ZFE"); const ZFinder& zfm = apply(event, "ZFM"); // Choose the Z candidate (there must be one) if (zfe.empty() && zfm.empty()) vetoEvent; const ParticleVector& z = !zfm.empty() ? zfm.bosons() : zfe.bosons(); const ParticleVector& leptons = !zfm.empty() ? zfm.constituents() : zfe.constituents(); // Determine whether we are in the boosted regime const bool is_boosted = (z[0].pT() > 150*GeV); // Build the jets const FastJets& jetfs = apply(event, "JETS"); const Jets& jets = jetfs.jetsByPt(Cuts::pT > 50*GeV && Cuts::abseta < 2.5); // Clean the jets against the lepton candidates, as in the paper, with a deltaR cut of 0.4 against the clustered leptons vector cleanedJets; for (size_t i = 0; i < jets.size(); ++i) { bool isolated = true; for (size_t j = 0; j < 2; ++j) { if (deltaR(leptons[j], jets[i]) < 0.4) { isolated = false; break; } } if (isolated) cleanedJets.push_back(&jets[i]); } // Require at least 1 jet const unsigned int Njets = cleanedJets.size(); if (Njets < 1) vetoEvent; // Now compute the thrust // Collect Z and jets transverse momenta to calculate transverse thrust vector momenta; momenta.clear(); Vector3 mom = z[0].p3(); mom.setZ(0); momenta.push_back(mom); for (size_t i = 0; i < cleanedJets.size(); ++i) { Vector3 mj = cleanedJets[i]->momentum().p3(); mj.setZ(0); momenta.push_back(mj); } if (momenta.size() <= 2){ // We need to use a ghost so that Thrust.calc() doesn't return 1. momenta.push_back(Vector3(0.0000001,0.0000001,0.)); } Thrust thrust; thrust.calc(momenta); const double T = thrust.thrust(); FILLx2(_histTransvThrust, is_boosted, log(max(1-T, 1e-6)), weight); const double dphiZJ1 = deltaPhi(z[0], *cleanedJets[0]); FILLx2(_histDeltaPhiZJ1_1, is_boosted, dphiZJ1, weight); if (Njets > 1) { FILLx2(_histDeltaPhiZJ1_2, is_boosted, dphiZJ1, weight); if (Njets > 2) { FILLx2(_histDeltaPhiZJ1_3, is_boosted, dphiZJ1, weight); FILLx2(_histDeltaPhiZJ2_3, is_boosted, deltaPhi(z[0], *cleanedJets[1]), weight); FILLx2(_histDeltaPhiZJ3_3, is_boosted, deltaPhi(z[0], *cleanedJets[2]), weight); FILLx2(_histDeltaPhiJ1J2_3, is_boosted, deltaPhi(*cleanedJets[0], *cleanedJets[1]), weight); FILLx2(_histDeltaPhiJ1J3_3, is_boosted, deltaPhi(*cleanedJets[0], *cleanedJets[2]), weight); FILLx2(_histDeltaPhiJ2J3_3, is_boosted, deltaPhi(*cleanedJets[1], *cleanedJets[2]), weight); } } } /// Normalizations /// @note Most of these data normalizations neglect the overflow bins void finalize() { for (size_t i = 0; i < 2; ++i) { normalize(_histDeltaPhiZJ1_1[i], 1, false); normalize(_histDeltaPhiZJ1_2[i], 1, false); normalize(_histDeltaPhiZJ1_3[i], 1, false); normalize(_histDeltaPhiZJ2_3[i], 1, false); normalize(_histDeltaPhiZJ3_3[i], 1, false); normalize(_histDeltaPhiJ1J2_3[i], 1, false); normalize(_histDeltaPhiJ1J3_3[i], 1, false); normalize(_histDeltaPhiJ2J3_3[i], 1, false); normalize(_histTransvThrust[i]); } } private: // Define a helper to appropriately fill both unboosted and boosted histo versions void FILLx2(Histo1DPtr* HNAME, bool is_boosted, double VAL, double weight) { double x = VAL; for (size_t i = 0; i < 2; ++i) { if (i == 0 || is_boosted) HNAME[i]->fill(x, weight); } } // Arrays of unboosted/boosted histos Histo1DPtr _histDeltaPhiZJ1_1[2]; Histo1DPtr _histDeltaPhiZJ1_2[2]; Histo1DPtr _histDeltaPhiZJ1_3[2]; Histo1DPtr _histDeltaPhiZJ2_3[2]; Histo1DPtr _histDeltaPhiZJ3_3[2]; Histo1DPtr _histDeltaPhiJ1J2_3[2]; Histo1DPtr _histDeltaPhiJ1J3_3[2]; Histo1DPtr _histDeltaPhiJ2J3_3[2]; Histo1DPtr _histTransvThrust[2]; }; DECLARE_RIVET_PLUGIN(CMS_2013_I1209721); } diff --git a/analyses/pluginCMS/CMS_2013_I1258128.cc.binnedhisto b/analyses/pluginCMS/CMS_2013_I1258128.cc rename from analyses/pluginCMS/CMS_2013_I1258128.cc.binnedhisto rename to analyses/pluginCMS/CMS_2013_I1258128.cc --- a/analyses/pluginCMS/CMS_2013_I1258128.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2013_I1258128.cc @@ -1,168 +1,167 @@ #include "Rivet/Analysis.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Projections/Thrust.hh" #include "Rivet/Projections/LeadingParticlesFinalState.hh" namespace Rivet { /// CMS Z rapidity measurement class CMS_2013_I1258128 : public Analysis { public: // Constructor CMS_2013_I1258128() : Analysis("CMS_2013_I1258128") { } void init() { // Full final state const FinalState fs(Cuts::abseta < 5); declare(fs, "FS"); // Z finders for electrons and muons Cut cuts = Cuts::abseta < 2.1 && Cuts::pT > 20*GeV; const ZFinder zfe(fs, cuts, PID::ELECTRON, 76*GeV, 106*GeV); const ZFinder zfm(fs, cuts, PID::MUON, 76*GeV, 106*GeV); declare(zfe, "ZFE"); declare(zfm, "ZFM"); // Try to get the leading photon LeadingParticlesFinalState photonfs(FinalState(-2.5, 2.5, 40.0*GeV)); photonfs.addParticleId(PID::PHOTON); declare(photonfs, "LeadingPhoton"); // Jets const FastJets jets(fs, FastJets::ANTIKT, 0.5); declare(jets, "JETS"); // Histograms book(_hist1YZ ,1, 1, 1); book(_hist1YJet ,2, 1, 1); book(_hist1YSum ,3, 1, 1); book( _hist1YDif ,4, 1, 1); book( _hist2YPhoton ,5, 1, 1); book( _hist2YJet ,6, 1, 1); book( _hist2YSum ,7, 1, 1); book( _hist2YDif ,8, 1, 1); } void makeZCut(const Event& event) { // Apply the Z finders and veto if no Z found const ZFinder& zfe = apply(event, "ZFE"); const ZFinder& zfm = apply(event, "ZFM"); if (zfe.empty() && zfm.empty()) vetoEvent; // Choose the Z candidate const ParticleVector& z = (!zfm.empty()) ? zfm.bosons() : zfe.bosons(); const ParticleVector& clusteredConstituents = (!zfm.empty()) ? zfm.constituents() : zfe.constituents(); // Insist that the Z is in a high-pT (boosted) regime if (z[0].pT() < 40*GeV) return; // Build the jets const FastJets& jetfs = apply(event, "JETS"); Jets jets = jetfs.jetsByPt(Cuts::pT > 30*GeV && Cuts::abseta < 2.4); if (jets.empty()) return; // Clean the jets against the lepton candidates with a DeltaR cut of 0.5 vector cleanedJets; foreach (const Jet& j, jets) { bool isolated = true; foreach (const Particle& p, clusteredConstituents) { if (deltaR(p, j) < 0.5) { isolated = false; break; } } if (isolated) cleanedJets.push_back(&j); } // Require exactly 1 isolated jet if (cleanedJets.size() != 1) return; // Fill histos const double weight = 1.0; const double yz = z[0].rapidity(); const double yjet = cleanedJets[0]->momentum().rapidity(); _hist1YZ->fill(fabs(yz), weight); _hist1YJet->fill(fabs(yjet), weight); _hist1YSum->fill(0.5*fabs(yz + yjet), weight); _hist1YDif->fill(0.5*fabs(yz - yjet), weight); } void makePhotonCut(const Event& event) { // Get the photon const FinalState& photonfs = apply(event, "LeadingPhoton"); if (photonfs.particles().size() < 1) return; const Particle& photon = photonfs.particles().front(); if (photon.pT() < 40*GeV) return; if (fabs(photon.eta()) > 1.4442 ) return; // Build the jets const FastJets& jetfs = apply(event, "JETS"); Jets jets = jetfs.jetsByPt(Cuts::pT > 30*GeV && Cuts::abseta < 2.4); if (jets.empty()) return; // Clean the jets against the photon candidate with a DeltaR cut of 0.5 vector cleanedJets; foreach (const Jet& j, jets) if (deltaR(photon, j) > 0.5) cleanedJets.push_back(&j); // Require exactly 1 jet if (cleanedJets.size() != 1) return; // Fill histos const double weight = 1.0; const double ypho = photon.rapidity(); const double yjet = cleanedJets[0]->momentum().rapidity(); _hist2YPhoton->fill(fabs(ypho), weight); _hist2YJet->fill(fabs(yjet), weight); _hist2YSum->fill(0.5*fabs(ypho + yjet), weight); _hist2YDif->fill(0.5*fabs(ypho - yjet), weight); } void analyze(const Event& event) { makeZCut(event); makePhotonCut(event); } void finalize() { normalizeByContents(_hist1YZ); normalizeByContents(_hist1YJet); normalizeByContents(_hist1YSum); normalizeByContents(_hist1YDif); normalizeByContents(_hist2YPhoton); normalizeByContents(_hist2YJet); normalizeByContents(_hist2YSum); normalizeByContents(_hist2YDif); } // The CMS normalization in this analysis is that the sum over bin contents // is equal to 1. This function normalizes to area = area*bin_width. / // @note This is a strange definition... why? void normalizeByContents(Histo1DPtr h) { normalize(h, h->bin(0).xWidth()); } private: Histo1DPtr _hist1YZ, _hist1YJet, _hist1YSum, _hist1YDif; Histo1DPtr _hist2YPhoton, _hist2YJet, _hist2YSum, _hist2YDif; }; // Plugin system hook DECLARE_RIVET_PLUGIN(CMS_2013_I1258128); } diff --git a/analyses/pluginCMS/CMS_2015_I1327224.cc.binnedhisto b/analyses/pluginCMS/CMS_2015_I1327224.cc rename from analyses/pluginCMS/CMS_2015_I1327224.cc.binnedhisto rename to analyses/pluginCMS/CMS_2015_I1327224.cc --- a/analyses/pluginCMS/CMS_2015_I1327224.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2015_I1327224.cc @@ -1,60 +1,60 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class CMS_2015_I1327224 : public Analysis { public: DEFAULT_RIVET_ANALYSIS_CTOR(CMS_2015_I1327224); void init() { FinalState fs; FastJets antikt(fs, FastJets::ANTIKT, 0.5); declare(antikt, "ANTIKT"); - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(4200., 8000., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(3600., 4200., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(3000., 3600., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(2400., 3000., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1900., 2400., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(4200., 8000., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(3600., 4200., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(3000., 3600., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(2400., 3000., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1900., 2400., book(tmp, 5, 1, 1));} } void analyze(const Event& event) { const double weight = 1.0; const Jets& jets = apply(event, "ANTIKT").jetsByPt(); if (jets.size() < 2) vetoEvent; FourMomentum j0(jets[0].momentum()); FourMomentum j1(jets[1].momentum()); double y0 = j0.rapidity(); double y1 = j1.rapidity(); if (fabs(y0 + y1) / 2. > 1.11) vetoEvent; double mjj = FourMomentum(j0 + j1).mass(); if (mjj/GeV <1900) vetoEvent; double chi = exp(fabs(y0 - y1)); if (chi >= 16.) vetoEvent; // Fill the histogram _h_chi_dijet.fill(mjj/GeV, chi, weight); } void finalize() { foreach (Histo1DPtr hist, _h_chi_dijet.histos()) { normalize(hist); } } private: - BinnedHistogram _h_chi_dijet; + BinnedHistogram _h_chi_dijet; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2015_I1327224); } diff --git a/analyses/pluginCMS/CMS_2016_I1421646.cc.binnedhisto b/analyses/pluginCMS/CMS_2016_I1421646.cc rename from analyses/pluginCMS/CMS_2016_I1421646.cc.binnedhisto rename to analyses/pluginCMS/CMS_2016_I1421646.cc --- a/analyses/pluginCMS/CMS_2016_I1421646.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2016_I1421646.cc @@ -1,61 +1,61 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// CMS azimuthal decorrelations at 8 TeV class CMS_2016_I1421646 : public Analysis { public: DEFAULT_RIVET_ANALYSIS_CTOR(CMS_2016_I1421646); /// Book projections and histograms void init() { FastJets akt(FinalState(), FastJets::ANTIKT, 0.7); addProjection(akt, "antikT"); - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 200., 300., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 300., 400., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 400., 500., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 500., 700., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 700., 900., book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 900., 1100., book(tmp, 6, 1, 1));} - {Histo1DPtr tmp; _h_deltaPhi.addHistogram( 1100., 4000., book(tmp, 7, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 200., 300., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 300., 400., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 400., 500., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 500., 700., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 700., 900., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 900., 1100., book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_deltaPhi.add( 1100., 4000., book(tmp, 7, 1, 1));} } /// Per-event analysis void analyze(const Event & event) { const Jets& jets = apply(event, "antikT").jetsByPt(Cuts::absrap < 2.5 && Cuts::pT > 100*GeV); if (jets.size() < 2) vetoEvent; if (jets[0].pT() < 200*GeV) vetoEvent; const double dphi = deltaPhi(jets[0].phi(), jets[1].phi()); _h_deltaPhi.fill(jets[0].pT(), dphi, 1.0); } /// Scale histograms void finalize() { for (Histo1DPtr histo : _h_deltaPhi.histos()) normalize(histo); } private: - BinnedHistogram _h_deltaPhi; + BinnedHistogram _h_deltaPhi; }; // A hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2016_I1421646); } diff --git a/analyses/pluginCMS/CMS_2016_I1459051.cc.binnedhisto b/analyses/pluginCMS/CMS_2016_I1459051.cc rename from analyses/pluginCMS/CMS_2016_I1459051.cc.binnedhisto rename to analyses/pluginCMS/CMS_2016_I1459051.cc --- a/analyses/pluginCMS/CMS_2016_I1459051.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2016_I1459051.cc @@ -1,95 +1,95 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// Inclusive jet pT at 13 TeV class CMS_2016_I1459051 : public Analysis { public: /// Constructor DEFAULT_RIVET_ANALYSIS_CTOR(CMS_2016_I1459051); /// Book histograms and initialize projections: void init() { // Initialize the projections const FinalState fs; declare(FastJets(fs, FastJets::ANTIKT, 0.4), "JetsAK4"); declare(FastJets(fs, FastJets::ANTIKT, 0.7), "JetsAK7"); // Book sets of histograms, binned in absolute rapidity // AK7 - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(0.0, 0.5, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(0.5, 1.0, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(1.0, 1.5, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(1.5, 2.0, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(2.0, 2.5, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK7.addHistogram(2.5, 3.0, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(0.0, 0.5, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(0.5, 1.0, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(1.0, 1.5, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(1.5, 2.0, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(2.0, 2.5, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK7.add(2.5, 3.0, book(tmp, 6, 1, 1));} book(_hist_sigmaAK7Forward, 7, 1, 1); // AK4 - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(0.0, 0.5, book(tmp, 8, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(0.5, 1.0, book(tmp, 9, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(1.0, 1.5, book(tmp, 10, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(1.5, 2.0, book(tmp, 11, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(2.0, 2.5, book(tmp, 12, 1, 1));} - {Histo1DPtr tmp; _hist_sigmaAK4.addHistogram(2.5, 3.0, book(tmp, 13, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(0.0, 0.5, book(tmp, 8, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(0.5, 1.0, book(tmp, 9, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(1.0, 1.5, book(tmp, 10, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(1.5, 2.0, book(tmp, 11, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(2.0, 2.5, book(tmp, 12, 1, 1));} + {Histo1DPtr tmp; _hist_sigmaAK4.add(2.5, 3.0, book(tmp, 13, 1, 1));} book(_hist_sigmaAK4Forward, 14, 1, 1); } /// Per-event analysis void analyze(const Event &event) { const double weight = 1.0; // AK4 jets const FastJets& fjAK4 = applyProjection(event, "JetsAK4"); const Jets& jetsAK4 = fjAK4.jets(Cuts::ptIn(114*GeV, 2200.0*GeV) && Cuts::absrap < 4.7); for (const Jet& j : jetsAK4) { _hist_sigmaAK4.fill(j.absrap(), j.pT(), weight); if (inRange(j.absrap(), 3.2, 4.7)) _hist_sigmaAK4Forward->fill(j.pT(), weight); } // AK7 jets const FastJets& fjAK7 = applyProjection(event, "JetsAK7"); const Jets& jetsAK7 = fjAK7.jets(Cuts::ptIn(114*GeV, 2200.0*GeV) && Cuts::absrap < 4.7); for (const Jet& j : jetsAK7) { _hist_sigmaAK7.fill(j.absrap(), j.pT(), weight); if (inRange(j.absrap(), 3.2, 4.7)) _hist_sigmaAK7Forward->fill(j.pT(), weight); } } // Finalize void finalize() { /// @todo What is the cross-section unit? _hist_sigmaAK4.scale(crossSection()/sumOfWeights()/2.0, this); _hist_sigmaAK7.scale(crossSection()/sumOfWeights()/2.0, this); scale(_hist_sigmaAK4Forward,crossSection()/sumOfWeights()/3.0); scale(_hist_sigmaAK7Forward,crossSection()/sumOfWeights()/3.0); } /// @name Histograms //@{ - BinnedHistogram _hist_sigmaAK4; - BinnedHistogram _hist_sigmaAK7; + BinnedHistogram _hist_sigmaAK4; + BinnedHistogram _hist_sigmaAK7; Histo1DPtr _hist_sigmaAK4Forward; Histo1DPtr _hist_sigmaAK7Forward; //@} }; // This global object acts as a hook for the plugin system. DECLARE_RIVET_PLUGIN(CMS_2016_I1459051); } diff --git a/analyses/pluginCMS/CMS_2017_I1519995.cc.binnedhisto b/analyses/pluginCMS/CMS_2017_I1519995.cc rename from analyses/pluginCMS/CMS_2017_I1519995.cc.binnedhisto rename to analyses/pluginCMS/CMS_2017_I1519995.cc --- a/analyses/pluginCMS/CMS_2017_I1519995.cc.binnedhisto +++ b/analyses/pluginCMS/CMS_2017_I1519995.cc @@ -1,59 +1,59 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// Search for new physics with dijet angular distributions in proton-proton collisions at sqrt{(s) = 13 TeV class CMS_2017_I1519995 : public Analysis { public: DEFAULT_RIVET_ANALYSIS_CTOR(CMS_2017_I1519995); /// Book projections and histograms void init() { FastJets antikt(FinalState(), FastJets::ANTIKT, 0.4); declare(antikt, "ANTIKT"); - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(4800., 8000., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(4200., 4800., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(3600., 4200., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(3000., 3600., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(2400., 3000., book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1900., 2400., book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(4800., 8000., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(4200., 4800., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(3600., 4200., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(3000., 3600., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(2400., 3000., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1900., 2400., book(tmp, 6, 1, 1));} } /// Per-event analysis void analyze(const Event& event) { const Jets& jets = apply(event, "ANTIKT").jetsByPt(); if (jets.size() < 2) vetoEvent; const FourMomentum j0(jets[0].mom()), j1(jets[1].mom()); if (fabs(j0.rap()+j1.rap())/2 > 1.11) vetoEvent; const double mjj = (j0+j1).mass(); const double chi = exp(fabs(j0.rap()-j1.rap())); if (chi < 16) _h_chi_dijet.fill(mjj/GeV, chi, 1.0); } /// Normalize histograms void finalize() { for (Histo1DPtr hist : _h_chi_dijet.histos()) normalize(hist); } private: - BinnedHistogram _h_chi_dijet; + BinnedHistogram _h_chi_dijet; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2017_I1519995); } diff --git a/analyses/pluginD0/D0_1996_S3324664.cc.binnedhisto b/analyses/pluginD0/D0_1996_S3324664.cc rename from analyses/pluginD0/D0_1996_S3324664.cc.binnedhisto rename to analyses/pluginD0/D0_1996_S3324664.cc --- a/analyses/pluginD0/D0_1996_S3324664.cc.binnedhisto +++ b/analyses/pluginD0/D0_1996_S3324664.cc @@ -1,102 +1,102 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/FinalState.hh" namespace Rivet { /// @brief D0 azimuthal correlation of jets widely separated in rapidity class D0_1996_S3324664 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor D0_1996_S3324664() : Analysis("D0_1996_S3324664") { } /// @name Analysis methods //@{ void init() { const FinalState fs; declare(fs, "FS"); /// @todo Use correct jet algorithm declare(FastJets(fs, FastJets::D0ILCONE, 0.7), "ConeJets"); book(_h_deta ,1, 1, 1); - {Histo1DPtr tmp; _h_dphi.addHistogram(0.0, 2.0, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_dphi.addHistogram(2.0, 4.0, book(tmp, 2, 1, 2));} - {Histo1DPtr tmp; _h_dphi.addHistogram(4.0, 6.0, book(tmp, 2, 1, 3));} + {Histo1DPtr tmp; _h_dphi.add(0.0, 2.0, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_dphi.add(2.0, 4.0, book(tmp, 2, 1, 2));} + {Histo1DPtr tmp; _h_dphi.add(4.0, 6.0, book(tmp, 2, 1, 3));} book(_h_cosdphi_deta ,3, 1, 1); } void analyze(const Event& event) { const double weight = 1.0; Jets jets = apply(event, "ConeJets").jets(Cuts::Et > 20*GeV && Cuts::abseta<3, cmpMomByEt); if (jets.size() < 2) vetoEvent; FourMomentum minjet = jets[0].momentum(); FourMomentum maxjet = jets[1].momentum(); double mineta = minjet.eta(); double maxeta = maxjet.eta(); foreach (const Jet& jet, jets) { double eta = jet.eta(); if (eta < mineta) { minjet = jet.momentum(); mineta = eta; } else if (eta > maxeta) { maxjet = jet.momentum(); maxeta = eta; } } if (minjet.Et() < 50*GeV && maxjet.Et() < 50.0*GeV) vetoEvent; double deta = maxjet.eta()-minjet.eta(); double dphi = mapAngle0To2Pi(maxjet.phi()-minjet.phi()); _h_deta->fill(deta, weight); _h_dphi.fill(deta, 1.0-dphi/M_PI, weight); _h_cosdphi_deta->fill(deta, cos(M_PI-dphi), weight); } void finalize() { // Normalised to #events normalize(_h_deta, 8830.); // fixed norm OK // Normalied to 1/(4pi) foreach (Histo1DPtr histo, _h_dphi.histos()) { normalize(histo, 1./(4.*M_PI)); } } //@} private: /// @name Histograms //@{ Histo1DPtr _h_deta; - BinnedHistogram _h_dphi; + BinnedHistogram _h_dphi; Profile1DPtr _h_cosdphi_deta; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_1996_S3324664); } diff --git a/analyses/pluginD0/D0_2009_S8320160.cc.binnedhisto b/analyses/pluginD0/D0_2009_S8320160.cc rename from analyses/pluginD0/D0_2009_S8320160.cc.binnedhisto rename to analyses/pluginD0/D0_2009_S8320160.cc --- a/analyses/pluginD0/D0_2009_S8320160.cc.binnedhisto +++ b/analyses/pluginD0/D0_2009_S8320160.cc @@ -1,94 +1,94 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief D0 dijet angular distributions class D0_2009_S8320160 : public Analysis { public: /// @name Construction //@{ /// Constructor D0_2009_S8320160() : Analysis("D0_2009_S8320160") { } //@} /// @name Analysis methods //@{ // Book histograms void init() { FinalState fs; FastJets conefinder(fs, FastJets::D0ILCONE, 0.7); declare(conefinder, "ConeFinder"); - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(250., 300., book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(300., 400., book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(400., 500., book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(500., 600., book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(600., 700., book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(700., 800., book(tmp, 6, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(800., 900., book(tmp, 7, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(900.,1000., book(tmp, 8, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1000.,1100.,book(tmp, 9, 1, 1));} - {Histo1DPtr tmp; _h_chi_dijet.addHistogram(1100.,1960, book(tmp, 10, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(250., 300., book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(300., 400., book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(400., 500., book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(500., 600., book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(600., 700., book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(700., 800., book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(800., 900., book(tmp, 7, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(900.,1000., book(tmp, 8, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1000.,1100.,book(tmp, 9, 1, 1));} + {Histo1DPtr tmp; _h_chi_dijet.add(1100.,1960, book(tmp, 10, 1, 1));} } /// Do the analysis void analyze(const Event & e) { const double weight = 1.0; const Jets& jets = apply(e, "ConeFinder").jetsByPt(); if (jets.size() < 2) vetoEvent; FourMomentum j0(jets[0].momentum()); FourMomentum j1(jets[1].momentum()); double y0 = j0.rapidity(); double y1 = j1.rapidity(); if (fabs(y0+y1)>2) vetoEvent; double mjj = FourMomentum(j0+j1).mass(); double chi = exp(fabs(y0-y1)); if(chi<16.) _h_chi_dijet.fill(mjj, chi, weight); } /// Finalize void finalize() { foreach (Histo1DPtr hist, _h_chi_dijet.histos()) { normalize(hist); } } //@} private: /// @name Histograms //@{ - BinnedHistogram _h_chi_dijet; + BinnedHistogram _h_chi_dijet; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_2009_S8320160); } diff --git a/analyses/pluginD0/D0_2010_S8566488.cc.binnedhisto b/analyses/pluginD0/D0_2010_S8566488.cc rename from analyses/pluginD0/D0_2010_S8566488.cc.binnedhisto rename to analyses/pluginD0/D0_2010_S8566488.cc --- a/analyses/pluginD0/D0_2010_S8566488.cc.binnedhisto +++ b/analyses/pluginD0/D0_2010_S8566488.cc @@ -1,89 +1,89 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { /// @brief D0 dijet invariant mass measurement class D0_2010_S8566488 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor D0_2010_S8566488() : Analysis("D0_2010_S8566488") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { FinalState fs; FastJets conefinder(fs, FastJets::D0ILCONE, 0.7); declare(conefinder, "ConeFinder"); - {Histo1DPtr tmp; _h_m_dijet.addHistogram(0.0, 0.4, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_m_dijet.addHistogram(0.4, 0.8, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_m_dijet.addHistogram(0.8, 1.2, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_m_dijet.addHistogram(1.2, 1.6, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_m_dijet.addHistogram(1.6, 2.0, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_m_dijet.addHistogram(2.0, 2.4, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(0.0, 0.4, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(0.4, 0.8, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(0.8, 1.2, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(1.2, 1.6, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(1.6, 2.0, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_m_dijet.add(2.0, 2.4, book(tmp, 6, 1, 1));} } /// Perform the per-event analysis void analyze(const Event& e) { const double weight = 1.0; const Jets& jets = apply(e, "ConeFinder").jetsByPt(40.0*GeV); if (jets.size() < 2) vetoEvent; FourMomentum j0(jets[0].momentum()); FourMomentum j1(jets[1].momentum()); double ymax = std::max(j0.absrap(), j1.absrap()); double mjj = FourMomentum(j0+j1).mass(); _h_m_dijet.fill(ymax, mjj/TeV, weight); } /// Normalise histograms etc., after the run void finalize() { _h_m_dijet.scale(crossSection()/sumOfWeights(), this); } //@} private: // Data members like post-cuts event weight counters go here private: /// @name Histograms //@{ - BinnedHistogram _h_m_dijet; + BinnedHistogram _h_m_dijet; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_2010_S8566488); } diff --git a/analyses/pluginD0/D0_2010_S8570965.cc.binnedhisto b/analyses/pluginD0/D0_2010_S8570965.cc rename from analyses/pluginD0/D0_2010_S8570965.cc.binnedhisto rename to analyses/pluginD0/D0_2010_S8570965.cc --- a/analyses/pluginD0/D0_2010_S8570965.cc.binnedhisto +++ b/analyses/pluginD0/D0_2010_S8570965.cc @@ -1,145 +1,145 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { /// @brief D0 direct photon pair production class D0_2010_S8570965 : public Analysis { public: D0_2010_S8570965() : Analysis("D0_2010_S8570965") { } void init() { FinalState fs; declare(fs, "FS"); IdentifiedFinalState ifs(Cuts::abseta < 0.9 && Cuts::pT > 20*GeV); ifs.acceptId(PID::PHOTON); declare(ifs, "IFS"); book(_h_M ,1, 1, 1); book(_h_pT ,2, 1, 1); book(_h_dPhi ,3, 1, 1); book(_h_costheta ,4, 1, 1); std::pair M_ranges[] = { std::make_pair(30.0, 50.0), std::make_pair(50.0, 80.0), std::make_pair(80.0, 350.0) }; for (size_t i = 0; i < 3; ++i) { Histo1DPtr a,b,c; - _h_pT_M.addHistogram(M_ranges[i].first, M_ranges[i].second, book(a, 5+3*i, 1, 1)); - _h_dPhi_M.addHistogram(M_ranges[i].first, M_ranges[i].second, book(b, 6+3*i, 1, 1)); - _h_costheta_M.addHistogram(M_ranges[i].first, M_ranges[i].second, book(c, 7+3*i, 1, 1)); + _h_pT_M.add(M_ranges[i].first, M_ranges[i].second, book(a, 5+3*i, 1, 1)); + _h_dPhi_M.add(M_ranges[i].first, M_ranges[i].second, book(b, 6+3*i, 1, 1)); + _h_costheta_M.add(M_ranges[i].first, M_ranges[i].second, book(c, 7+3*i, 1, 1)); } } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; Particles photons = apply(event, "IFS").particlesByPt(); if (photons.size() < 2 || (photons[0].pT() < 21.0*GeV)) { vetoEvent; } // Isolate photons with ET_sum in cone Particles isolated_photons; Particles fs = apply(event, "FS").particles(); foreach (const Particle& photon, photons) { double eta_P = photon.eta(); double phi_P = photon.phi(); double Etsum=0.0; foreach (const Particle& p, fs) { if (p.genParticle()->barcode() != photon.genParticle()->barcode() && deltaR(eta_P, phi_P, p.eta(), p.phi()) < 0.4) { Etsum += p.Et(); } } if (Etsum < 2.5*GeV) { isolated_photons.push_back(photon); } } if (isolated_photons.size() != 2) { vetoEvent; } std::sort(isolated_photons.begin(), isolated_photons.end(), cmpMomByPt); FourMomentum y1=isolated_photons[0].momentum(); FourMomentum y2=isolated_photons[1].momentum(); if (deltaR(y1, y2)<0.4) { vetoEvent; } FourMomentum yy=y1+y2; double Myy = yy.mass()/GeV; if (Myy<30.0 || Myy>350.0) { vetoEvent; } double pTyy = yy.pT()/GeV; if (Myyfill(Myy, weight); _h_pT->fill(pTyy, weight); _h_dPhi->fill(dPhiyy, weight); _h_costheta->fill(costhetayy, weight); _h_pT_M.fill(Myy, pTyy, weight); _h_dPhi_M.fill(Myy, dPhiyy, weight); _h_costheta_M.fill(Myy, costhetayy, weight); } void finalize() { scale(_h_M, crossSection()/sumOfWeights()); scale(_h_pT, crossSection()/sumOfWeights()); scale(_h_dPhi, crossSection()/sumOfWeights()); scale(_h_costheta, crossSection()/sumOfWeights()); _h_pT_M.scale(crossSection()/sumOfWeights(), this); _h_dPhi_M.scale(crossSection()/sumOfWeights(), this); _h_costheta_M.scale(crossSection()/sumOfWeights(), this); } private: Histo1DPtr _h_M; Histo1DPtr _h_pT; Histo1DPtr _h_dPhi; Histo1DPtr _h_costheta; - BinnedHistogram _h_pT_M; - BinnedHistogram _h_dPhi_M; - BinnedHistogram _h_costheta_M; + BinnedHistogram _h_pT_M; + BinnedHistogram _h_dPhi_M; + BinnedHistogram _h_costheta_M; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_2010_S8570965); } diff --git a/analyses/pluginD0/D0_2010_S8821313.cc.binnedhisto b/analyses/pluginD0/D0_2010_S8821313.cc rename from analyses/pluginD0/D0_2010_S8821313.cc.binnedhisto rename to analyses/pluginD0/D0_2010_S8821313.cc --- a/analyses/pluginD0/D0_2010_S8821313.cc.binnedhisto +++ b/analyses/pluginD0/D0_2010_S8821313.cc @@ -1,105 +1,105 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ZFinder.hh" namespace Rivet { class D0_2010_S8821313 : public Analysis { public: /// Constructor D0_2010_S8821313() : Analysis("D0_2010_S8821313") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { /// Initialise and register projections FinalState fs; Cut cuts = (Cuts::abseta < 1.1 || Cuts::absetaIn( 1.5, 3.0)) && Cuts::pT > 20*GeV; ZFinder zfinder_ee(fs, cuts, PID::ELECTRON, 70*GeV, 110*GeV, 0.2, ZFinder::CLUSTERNODECAY, ZFinder::TRACK); declare(zfinder_ee, "zfinder_ee"); ZFinder zfinder_mm(fs, Cuts::abseta < 2 && Cuts::pT > 15*GeV, PID::MUON, 70*GeV, 110*GeV, 0.0, ZFinder::NOCLUSTER, ZFinder::NOTRACK); declare(zfinder_mm, "zfinder_mm"); /// Book histograms here - {Histo1DPtr tmp; _h_phistar_ee.addHistogram(0.0, 1.0, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _h_phistar_ee.addHistogram(1.0, 2.0, book(tmp, 1, 1, 2));} - {Histo1DPtr tmp; _h_phistar_ee.addHistogram(2.0, 10.0,book(tmp, 1, 1, 3));} - {Histo1DPtr tmp; _h_phistar_mm.addHistogram(0.0, 1.0, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_phistar_mm.addHistogram(1.0, 2.0, book(tmp, 2, 1, 2));} + {Histo1DPtr tmp; _h_phistar_ee.add(0.0, 1.0, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _h_phistar_ee.add(1.0, 2.0, book(tmp, 1, 1, 2));} + {Histo1DPtr tmp; _h_phistar_ee.add(2.0, 10.0,book(tmp, 1, 1, 3));} + {Histo1DPtr tmp; _h_phistar_mm.add(0.0, 1.0, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_phistar_mm.add(1.0, 2.0, book(tmp, 2, 1, 2));} } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; const ZFinder& zfinder_ee = apply(event, "zfinder_ee"); if (zfinder_ee.bosons().size() == 1) { Particles ee = zfinder_ee.constituents(); std::sort(ee.begin(), ee.end(), cmpMomByPt); const FourMomentum& eminus = PID::threeCharge(ee[0].pid()) < 0 ? ee[0].momentum() : ee[1].momentum(); const FourMomentum& eplus = PID::threeCharge(ee[0].pid()) < 0 ? ee[1].momentum() : ee[0].momentum(); double phi_acop = M_PI - mapAngle0ToPi(eminus.phi() - eplus.phi()); double costhetastar = tanh((eminus.eta() - eplus.eta())/2); double sin2thetastar = 1 - sqr(costhetastar); if (sin2thetastar < 0) sin2thetastar = 0; const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar); const FourMomentum& zmom = zfinder_ee.bosons()[0].momentum(); _h_phistar_ee.fill(zmom.rapidity(), phistar, weight); } const ZFinder& zfinder_mm = apply(event, "zfinder_mm"); if (zfinder_mm.bosons().size() == 1) { Particles mm = zfinder_mm.constituents(); std::sort(mm.begin(), mm.end(), cmpMomByPt); const FourMomentum& mminus = PID::threeCharge(mm[0].pid()) < 0 ? mm[0].momentum() : mm[1].momentum(); const FourMomentum& mplus = PID::threeCharge(mm[0].pid()) < 0 ? mm[1].momentum() : mm[0].momentum(); double phi_acop = M_PI - mapAngle0ToPi(mminus.phi() - mplus.phi()); double costhetastar = tanh((mminus.eta() - mplus.eta())/2); double sin2thetastar = 1 - sqr(costhetastar); if (sin2thetastar < 0) sin2thetastar = 0; const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar); const FourMomentum& zmom = zfinder_mm.bosons()[0].momentum(); _h_phistar_mm.fill(zmom.rapidity(), phistar, weight); } } /// Normalise histograms etc., after the run void finalize() { foreach (Histo1DPtr hist, _h_phistar_ee.histos()) normalize(hist); foreach (Histo1DPtr hist, _h_phistar_mm.histos()) normalize(hist); } //@} private: /// @name Histograms //@{ - BinnedHistogram _h_phistar_ee; - BinnedHistogram _h_phistar_mm; + BinnedHistogram _h_phistar_ee; + BinnedHistogram _h_phistar_mm; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_2010_S8821313); } diff --git a/analyses/pluginD0/D0_2015_I1324946.cc.binnedhisto b/analyses/pluginD0/D0_2015_I1324946.cc rename from analyses/pluginD0/D0_2015_I1324946.cc.binnedhisto rename to analyses/pluginD0/D0_2015_I1324946.cc --- a/analyses/pluginD0/D0_2015_I1324946.cc.binnedhisto +++ b/analyses/pluginD0/D0_2015_I1324946.cc @@ -1,102 +1,101 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" -#include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/ZFinder.hh" namespace Rivet { class D0_2015_I1324946 : public Analysis { public: /// Constructor D0_2015_I1324946() : Analysis("D0_2015_I1324946") { } /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { FinalState fs; ZFinder zfinder_mm(fs, Cuts::abseta < 2 && Cuts::pT > 15*GeV, PID::MUON, 30*GeV, 500*GeV, 0.0, ZFinder::NOCLUSTER, ZFinder::NOTRACK); declare(zfinder_mm, "zfinder_mm"); book(_h_phistar_mm_peak_central ,1, 1, 1); book(_h_phistar_mm_peak_forward ,1, 1, 2); book(_h_phistar_mm_low_central ,2, 1, 1); book(_h_phistar_mm_low_forward ,2, 1, 2); book(_h_phistar_mm_high1 ,3, 1, 1); book(_h_phistar_mm_high2 ,4, 1, 1); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = 1.0; //70(event, "zfinder_mm"); if (zfinder_mm.bosons().size() == 1) { Particles mm = zfinder_mm.constituents(); std::sort(mm.begin(), mm.end(), cmpMomByPt); const FourMomentum& mminus = PID::threeCharge(mm[0].pid()) < 0 ? mm[0].momentum() : mm[1].momentum(); const FourMomentum& mplus = PID::threeCharge(mm[0].pid()) < 0 ? mm[1].momentum() : mm[0].momentum(); double phi_acop = M_PI - mapAngle0ToPi(mminus.phi() - mplus.phi()); double costhetastar = tanh((mminus.eta() - mplus.eta())/2); double sin2thetastar = 1 - sqr(costhetastar); if (sin2thetastar < 0) sin2thetastar = 0; const double phistar = tan(phi_acop/2) * sqrt(sin2thetastar); const FourMomentum& zmom = zfinder_mm.bosons()[0].momentum(); if (zmom.mass()<30*GeV || zmom.mass() >500*GeV) vetoEvent; if( zmom.mass()>70 && zmom.mass()<100 && zmom.absrap()<1.0) _h_phistar_mm_peak_central->fill(phistar, weight); if( zmom.mass()>70 && zmom.mass()<100 && zmom.absrap()>1.0 && zmom.absrap()<2.0) _h_phistar_mm_peak_forward->fill(phistar, weight); if( zmom.mass()>30 && zmom.mass()<60 && zmom.absrap()<1.0) _h_phistar_mm_low_central->fill(phistar, weight); if( zmom.mass()>30 && zmom.mass()<60 && zmom.absrap()>1.0 && zmom.absrap()<2.0) _h_phistar_mm_low_forward->fill(phistar, weight); if( zmom.mass()>160 && zmom.mass()<300) _h_phistar_mm_high1->fill(phistar, weight); if( zmom.mass()>300 && zmom.mass()<500) _h_phistar_mm_high2->fill(phistar, weight); } } /// Normalise histograms etc., after the run void finalize() { normalize(_h_phistar_mm_low_central); normalize(_h_phistar_mm_low_forward); normalize(_h_phistar_mm_peak_central); normalize(_h_phistar_mm_peak_forward); normalize(_h_phistar_mm_high1); normalize(_h_phistar_mm_high2); } //} //@} private: /// @name Histograms //@{ Histo1DPtr _h_phistar_mm_low_central; Histo1DPtr _h_phistar_mm_low_forward; Histo1DPtr _h_phistar_mm_peak_central; Histo1DPtr _h_phistar_mm_peak_forward; Histo1DPtr _h_phistar_mm_high1; Histo1DPtr _h_phistar_mm_high2; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(D0_2015_I1324946); } diff --git a/analyses/pluginLEP/OPAL_2004_I631361.cc.binnedhisto b/analyses/pluginLEP/OPAL_2004_I631361.cc rename from analyses/pluginLEP/OPAL_2004_I631361.cc.binnedhisto rename to analyses/pluginLEP/OPAL_2004_I631361.cc diff --git a/analyses/pluginLEP/OPAL_2004_I631361_qq.cc.binnedhisto b/analyses/pluginLEP/OPAL_2004_I631361_qq.cc rename from analyses/pluginLEP/OPAL_2004_I631361_qq.cc.binnedhisto rename to analyses/pluginLEP/OPAL_2004_I631361_qq.cc --- a/analyses/pluginLEP/OPAL_2004_I631361_qq.cc.binnedhisto +++ b/analyses/pluginLEP/OPAL_2004_I631361_qq.cc @@ -1,250 +1,241 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/HadronicFinalState.hh" #include "Rivet/Jet.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "fastjet/JetDefinition.hh" namespace fastjet { class P_scheme : public JetDefinition::Recombiner { public: std::string description() const {return "";} void recombine(const PseudoJet & pa, const PseudoJet & pb, PseudoJet & pab) const { PseudoJet tmp = pa + pb; double E = sqrt(tmp.px()*tmp.px() + tmp.py()*tmp.py() + tmp.pz()*tmp.pz()); pab.reset_momentum(tmp.px(), tmp.py(), tmp.pz(), E); } void preprocess(PseudoJet & p) const { double E = sqrt(p.px()*p.px() + p.py()*p.py() + p.pz()*p.pz()); p.reset_momentum(p.px(), p.py(), p.pz(), E); } ~P_scheme() { } }; } namespace Rivet { class OPAL_2004_I631361_qq : public Analysis { public: /// Constructor OPAL_2004_I631361_qq() : Analysis("OPAL_2004_I631361_qq"), _sumWEbin(7,0.) { } /// @name Analysis methods //@{ int getEbin(double E_glue) { int ih = -1; if (inRange(E_glue/GeV, 5.0, 5.5)) { ih = 0; } else if (inRange(E_glue/GeV, 5.5, 6.5)) { ih = 1; } else if (inRange(E_glue/GeV, 6.5, 7.5)) { ih = 2; } else if (inRange(E_glue/GeV, 7.5, 9.5)) { ih = 3; } else if (inRange(E_glue/GeV, 9.5, 13.0)) { ih = 4; } else if (inRange(E_glue/GeV, 13.0, 16.0)) { ih = 5; } else if (inRange(E_glue/GeV, 16.0, 20.0)) { ih = 6; } assert(ih >= 0); return ih; } /// Book histograms and initialise projections before the run void init() { const FinalState fs; addProjection(fs, "FS"); addProjection(HadronicFinalState(fs), "HFS"); const ChargedFinalState cfs; addProjection(cfs, "CFS"); addProjection(HadronicFinalState(cfs), "HCFS"); - Histo1DPtr tmp1; book(tmp1, 1,1,1); - _h_chMult.addHistogram(5.0, 5.5, tmp1); - Histo1DPtr tmp2; book(tmp2, 1,1,1); - _h_chMult.addHistogram(5.5, 6.5, tmp2); - Histo1DPtr tmp3; book(tmp3, 1,1,3); - _h_chMult.addHistogram(6.5, 7.5, tmp3); - Histo1DPtr tmp4; book(tmp4, 2,1,1); - _h_chMult.addHistogram(7.5, 9.5, tmp4); - Histo1DPtr tmp5; book(tmp5, 2,1,2); - _h_chMult.addHistogram(9.5, 13.0, tmp5); - Histo1DPtr tmp6; book(tmp6, 3,1,1); - _h_chMult.addHistogram(13.0, 16.0, tmp6); - Histo1DPtr tmp7; book(tmp7, 3,1,2); - _h_chMult.addHistogram(16.0, 20.0, tmp7); + {Histo1DPtr tmp; _h_chMult.add( 5.0, 5.5, book(tmp, 1,1,1));} + {Histo1DPtr tmp; _h_chMult.add( 5.5, 6.5, book(tmp, 1,1,2));} + {Histo1DPtr tmp; _h_chMult.add( 6.5, 7.5, book(tmp, 1,1,3));} + {Histo1DPtr tmp; _h_chMult.add( 7.5, 9.5, book(tmp, 2,1,1));} + {Histo1DPtr tmp; _h_chMult.add( 9.5, 13.0, book(tmp, 2,1,2));} + {Histo1DPtr tmp; _h_chMult.add(13.0, 16.0, book(tmp, 3,1,1));} + {Histo1DPtr tmp; _h_chMult.add(16.0, 20.0, book(tmp, 3,1,2));} - Histo1DPtr tmp8; book(tmp8, 5,1,1); - _h_chFragFunc.addHistogram(13.0, 16.0, tmp8); - Histo1DPtr tmp9; book(tmp9, 5,1,2); - _h_chFragFunc.addHistogram(16.0, 20.0, tmp9); + {Histo1DPtr tmp; _h_chFragFunc.add(13.0, 16.0, book(tmp, 5,1,1));} + {Histo1DPtr tmp; _h_chFragFunc.add(16.0, 20.0, book(tmp, 5,1,2));} } /// Perform the per-event analysis void analyze(const Event& event) { // cut on the number of charged particles const Particles& chParticles = applyProjection(event, "CFS").particles(); if(chParticles.size() < 5) vetoEvent; // cluster the jets const Particles& particles = applyProjection(event, "FS").particles(); fastjet::JetDefinition ee_kt_def(fastjet::ee_kt_algorithm, &p_scheme); PseudoJets pParticles; foreach(Particle p, particles) { PseudoJet temp = p.pseudojet(); if(p.fromBottom()) { temp.set_user_index(5); } pParticles.push_back(temp); } fastjet::ClusterSequence cluster(pParticles, ee_kt_def); // rescale energys to just keep the directions of the jets // and keep track of b tags PseudoJets pJets = sorted_by_E(cluster.exclusive_jets_up_to(3)); if(pJets.size() < 3) vetoEvent; array dirs; for(int i=0; i<3; i++) { dirs[i] = Vector3(pJets[i].px(),pJets[i].py(),pJets[i].pz()).unit(); } array bTagged; Jets jets; for(int i=0; i<3; i++) { double Ejet = sqrtS()*sin(angle(dirs[(i+1)%3],dirs[(i+2)%3])) / (sin(angle(dirs[i],dirs[(i+1)%3])) + sin(angle(dirs[i],dirs[(i+2)%3])) + sin(angle(dirs[(i+1)%3],dirs[(i+2)%3]))); jets.push_back(FourMomentum(Ejet,Ejet*dirs[i].x(),Ejet*dirs[i].y(),Ejet*dirs[i].z())); bTagged[i] = false; foreach(PseudoJet particle, pJets[i].constituents()) { if(particle.user_index() > 1 and !bTagged[i]) { bTagged[i] = true; } } } int QUARK1 = 0, QUARK2 = 1, GLUON = 2; if(jets[QUARK2].E() > jets[QUARK1].E()) swap(QUARK1, QUARK2); if(jets[GLUON].E() > jets[QUARK1].E()) swap(QUARK1, GLUON); if(!bTagged[QUARK2]) { if(!bTagged[GLUON]) vetoEvent; else swap(QUARK2, GLUON); } if(bTagged[GLUON]) vetoEvent; // exclude collinear or soft jets double k1 = jets[QUARK1].E()*min(angle(jets[QUARK1].momentum(),jets[QUARK2].momentum()), angle(jets[QUARK1].momentum(),jets[GLUON].momentum())); double k2 = jets[QUARK2].E()*min(angle(jets[QUARK2].momentum(),jets[QUARK1].momentum()), angle(jets[QUARK2].momentum(),jets[GLUON].momentum())); if(k1<8.0*GeV || k2<8.0*GeV) vetoEvent; double sqg = (jets[QUARK1].momentum()+jets[GLUON].momentum()).mass2(); double sgq = (jets[QUARK2].momentum()+jets[GLUON].momentum()).mass2(); double s = (jets[QUARK1].momentum()+jets[QUARK2].momentum()+jets[GLUON].momentum()).mass2(); double Eg = 0.5*sqrt(sqg*sgq/s); if(Eg < 5.0 || Eg > 20.0) { vetoEvent; } else if(Eg > 9.5) { //requirements for experimental reconstructability raise as energy raises if(!bTagged[QUARK1]) { vetoEvent; } } // all cuts applied, increment sum of weights const double weight = 1.0; _sumWEbin[getEbin(Eg)] += weight; // transform to frame with event in y-z and glue jet in z direction Matrix3 glueTOz(jets[GLUON].momentum().vector3(), Vector3(0,0,1)); Vector3 transQuark = glueTOz*jets[QUARK2].momentum().vector3(); Matrix3 quarksTOyz(Vector3(transQuark.x(), transQuark.y(), 0), Vector3(0,1,0)); // work out transformation to symmetric frame array x_cm; array x_cm_y; array x_cm_z; array x_pr; for(int i=0; i<3; i++) { x_cm[i] = 2*jets[i].E()/sqrt(s); Vector3 p_transf = quarksTOyz*glueTOz*jets[i].p3(); x_cm_y[i] = 2*p_transf.y()/sqrt(s); x_cm_z[i] = 2*p_transf.z()/sqrt(s); } x_pr[GLUON] = sqrt(4*(1-x_cm[QUARK1])*(1-x_cm[QUARK2])/(3+x_cm[GLUON])); x_pr[QUARK1] = x_pr[GLUON]/(1-x_cm[QUARK1]); x_pr[QUARK2] = x_pr[GLUON]/(1-x_cm[QUARK2]); double gamma = (x_pr[QUARK1] + x_pr[GLUON] + x_pr[QUARK2])/2; double beta_z = x_pr[GLUON]/(gamma*x_cm[GLUON]) - 1; double beta_y = (x_pr[QUARK2]/gamma - x_cm[QUARK2] - beta_z*x_cm_z[QUARK2])/x_cm_y[QUARK2]; LorentzTransform toSymmetric = LorentzTransform::mkObjTransformFromBeta(Vector3(0.,beta_y,beta_z)). postMult(quarksTOyz*glueTOz); FourMomentum transGlue = toSymmetric.transform(jets[GLUON].momentum()); double cutAngle = angle(toSymmetric.transform(jets[QUARK2].momentum()), transGlue)/2; int nCh = 0; foreach(const Particle& chP, chParticles ) { FourMomentum pSymmFrame = toSymmetric.transform(FourMomentum(chP.p3().mod(), chP.px(), chP.py(), chP.pz())); if(angle(pSymmFrame, transGlue) < cutAngle) { _h_chFragFunc.fill(Eg, pSymmFrame.E()*sin(cutAngle)/Eg, weight); nCh++; } } _h_chMult.fill(Eg, nCh, weight); } /// Normalise histograms etc., after the run void finalize() { for (Histo1DPtr hist : _h_chMult.histos()) { normalize(hist); } for (int i=0; i<2; i++) { if(!isZero(_sumWEbin[i+5])) { scale(_h_chFragFunc.histos()[i], 1./_sumWEbin[i+5]); } } } //@} private: // Data members like post-cuts event weight counters go here vector _sumWEbin; // p scheme jet definition fastjet::P_scheme p_scheme; /// @name Histograms //@{ - BinnedHistogram _h_chMult; - BinnedHistogram _h_chFragFunc; + BinnedHistogram _h_chMult; + BinnedHistogram _h_chFragFunc; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(OPAL_2004_I631361_qq); } diff --git a/analyses/pluginLHCb/LHCB_2011_I919315.cc.binnedhisto b/analyses/pluginLHCb/LHCB_2011_I919315.cc rename from analyses/pluginLHCb/LHCB_2011_I919315.cc.binnedhisto rename to analyses/pluginLHCb/LHCB_2011_I919315.cc --- a/analyses/pluginLHCb/LHCB_2011_I919315.cc.binnedhisto +++ b/analyses/pluginLHCb/LHCB_2011_I919315.cc @@ -1,96 +1,96 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Tools/BinnedHistogram.hh" #include "Rivet/Projections/UnstableFinalState.hh" namespace Rivet { class LHCB_2011_I919315 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor LHCB_2011_I919315() : Analysis("LHCB_2011_I919315") { } //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { declare(UnstableFinalState(), "UFS"); - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 2.44, 2.62, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 2.62, 2.80, book(tmp, 2, 1, 2));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 2.80, 2.98, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 2.98, 3.16, book(tmp, 3, 1, 2));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 3.16, 3.34, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 3.34, 3.52, book(tmp, 4, 1, 2));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 3.52, 3.70, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 3.70, 3.88, book(tmp, 5, 1, 2));} - {Histo1DPtr tmp; _h_Phi_pT_y.addHistogram( 3.88, 4.06, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 2.44, 2.62, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 2.62, 2.80, book(tmp, 2, 1, 2));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 2.80, 2.98, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 2.98, 3.16, book(tmp, 3, 1, 2));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 3.16, 3.34, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 3.34, 3.52, book(tmp, 4, 1, 2));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 3.52, 3.70, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 3.70, 3.88, book(tmp, 5, 1, 2));} + {Histo1DPtr tmp; _h_Phi_pT_y.add( 3.88, 4.06, book(tmp, 6, 1, 1));} book(_h_Phi_pT ,7, 1, 1); book(_h_Phi_y ,8, 1, 1); } /// Perform the per-event analysis void analyze (const Event& event) { const double weight = 1.0; const UnstableFinalState& ufs = apply (event, "UFS"); foreach (const Particle& p, ufs.particles()) { const PdgId id = p.abspid(); if (id == 333) { // id 333 = phi-meson double y = p.rapidity(); double pT = p.perp(); if (pT < 0.6*GeV || pT > 5.0*GeV || y < 2.44 || y > 4.06) { continue; } _h_Phi_y->fill (y, weight); _h_Phi_pT->fill (pT/MeV, weight); _h_Phi_pT_y.fill(y, pT/GeV, weight); } } } /// Normalise histograms etc., after the run void finalize() { double scale_factor = crossSectionPerEvent()/microbarn; scale (_h_Phi_y, scale_factor); scale (_h_Phi_pT, scale_factor); _h_Phi_pT_y.scale(scale_factor/1000., this); } //@} private: /// @name Histograms //@{ Histo1DPtr _h_Phi_y; Histo1DPtr _h_Phi_pT; - BinnedHistogram _h_Phi_pT_y; + BinnedHistogram _h_Phi_pT_y; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(LHCB_2011_I919315); } //@} diff --git a/analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.cc.binnedhisto b/analyses/pluginLHCf/LHCF_2012_I1115479.cc rename from analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.cc.binnedhisto rename to analyses/pluginLHCf/LHCF_2012_I1115479.cc --- a/analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.cc.binnedhisto +++ b/analyses/pluginLHCf/LHCF_2012_I1115479.cc @@ -1,64 +1,64 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/UnstableFinalState.hh" #include "Rivet/Tools/BinnedHistogram.hh" namespace Rivet { class LHCF_2012_I1115479 : public Analysis { public: LHCF_2012_I1115479() : Analysis("LHCF_2012_I1115479") { } public: void init() { declare(UnstableFinalState(),"UFS"); - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram( 8.9, 9.0, book(tmp, 1, 1, 1));} - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram( 9.0, 9.2, book(tmp, 2, 1, 1));} - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram( 9.2, 9.4, book(tmp, 3, 1, 1));} - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram( 9.4, 9.6, book(tmp, 4, 1, 1));} - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram( 9.6, 10.0, book(tmp, 5, 1, 1));} - {Histo1DPtr tmp; _binnedHistos_y_pT.addHistogram(10.0, 11.0, book(tmp, 6, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add( 8.9, 9.0, book(tmp, 1, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add( 9.0, 9.2, book(tmp, 2, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add( 9.2, 9.4, book(tmp, 3, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add( 9.4, 9.6, book(tmp, 4, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add( 9.6, 10.0, book(tmp, 5, 1, 1));} + {Histo1DPtr tmp; _binnedHistos_y_pT.add(10.0, 11.0, book(tmp, 6, 1, 1));} } void analyze(const Event& event) { const UnstableFinalState& ufs = apply(event, "UFS"); const double dphi = TWOPI; foreach (const Particle& p, ufs.particles()) { if (p.pid() == 111) { double pT = p.pT(); double y = p.rapidity(); if (pT > 0.6*GeV) continue; const double scaled_weight = 1.0/(dphi*pT/GeV); _binnedHistos_y_pT.fill(y, pT/GeV, scaled_weight); } } } void finalize() { _binnedHistos_y_pT.scale( 1./sumOfWeights() , this); } private: - BinnedHistogram _binnedHistos_y_pT; + BinnedHistogram _binnedHistos_y_pT; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(LHCF_2012_I1115479); } diff --git a/analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.info b/analyses/pluginLHCf/LHCF_2012_I1115479.info rename from analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.info rename to analyses/pluginLHCf/LHCF_2012_I1115479.info diff --git a/analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.plot b/analyses/pluginLHCf/LHCF_2012_I1115479.plot rename from analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.plot rename to analyses/pluginLHCf/LHCF_2012_I1115479.plot diff --git a/analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.yoda b/analyses/pluginLHCf/LHCF_2012_I1115479.yoda rename from analyses/binnedhistopluginLHCf/LHCF_2012_I1115479.yoda rename to analyses/pluginLHCf/LHCF_2012_I1115479.yoda