diff --git a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.cc b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.cc --- a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.cc +++ b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.cc @@ -1,160 +1,150 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VetoedFinalState.hh" namespace Rivet { /// Z + jets in pp at 13 TeV /// @note This base class contains a "mode" variable for combined, e, and mu channel derived classes class ATLAS_2015_CONF_2015_041 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor - ATLAS_2015_CONF_2015_041(string name="ATLAS_2015_CONF_2015_041") - : Analysis(name), - _weights(5, 0.0) - { - // This class uses the combined e+mu mode - _mode = 0; + ATLAS_2015_CONF_2015_041(const string name="ATLAS_2015_CONF_2015_041", size_t channel = 0, + const string ref_data="ATLAS_2015_CONF_2015_041") + : Analysis(name), _weights(5, 0.0) { + _mode = 0; // This class uses the combined e+mu mode + setRefDataName(ref_data); } //@} /// Book histograms and initialise projections before the run void init() { const FinalState fs; Cut cuts = (Cuts::pT > 25*GeV) & (Cuts::abseta < 2.5); ZFinder zfinder(fs, cuts, _mode? PID::MUON : PID::ELECTRON, 66*GeV, 116*GeV); declare(zfinder, "zfinder"); // Define veto FS in order to prevent Z-decay products entering the jet algorithm VetoedFinalState had_fs; had_fs.addVetoOnThisFinalState(zfinder); FastJets jets(had_fs, FastJets::ANTIKT, 0.4); jets.useInvisibles(true); declare(jets, "jets"); // individual channels _hNjets = bookHisto1D(1, 1, _mode + 1); _hNjetsRatio = bookScatter2D(2, 1, _mode + 1, true); // combination _hNjets_comb = bookHisto1D(1, 2, _mode + 1); _hNjetsRatio_comb = bookScatter2D(2, 2, _mode + 1, true); } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = event.weight(); const ZFinder& zfinder = apply(event, "zfinder"); const Particles& leptons = zfinder.constituents(); if (leptons.size() != 2) vetoEvent; Jets jets; foreach (Jet j, apply(event, "jets").jetsByPt(Cuts::pT > 30*GeV && Cuts::absrap < 2.5)) { bool keep = true; foreach(const Particle& l, leptons) keep &= deltaR(j, l) > 0.4; if (keep) jets += j; } size_t njets = jets.size(); for(size_t i = 0; i <= njets; ++i) { _hNjets->fill(i + 0.5, weight); _hNjets_comb->fill(i + 0.5, weight); } for (size_t i = 0; i < 5; ++i) { if (njets >= i) _weights[i] += weight; } } /// @name Ratio calculator util functions //@{ /// Calculate the ratio, being careful about div-by-zero double ratio(double a, double b) { return (b != 0) ? a/b : 0; } /// Calculate the ratio error, being careful about div-by-zero double ratio_err(double a, double b) { return (b != 0) ? sqrt(a/b*(1-a/b)/b) : 0; } //@} void finalize() { for (size_t i = 0; i < 4; ++i) { double n = _hNjets->bin(i + 1).sumW(); double dN = _hNjets->bin(i + 1).sumW2(); double d = _hNjets->bin(i).sumW(); double dD = _hNjets->bin(i).sumW2(); double r = safediv(n, d); double e = sqrt( safediv(r * (1 - r), d) ); if ( _hNjets->effNumEntries() != _hNjets->numEntries() ) { // use F. James's approximation for weighted events: e = sqrt( safediv((1 - 2 * r) * dN + r * r * dD, d * d) ); } _hNjetsRatio->point(i).setY(r, e); _hNjetsRatio_comb->point(i).setY(r, e); } scale(_hNjets, crossSectionPerEvent() ); scale(_hNjets_comb, crossSectionPerEvent() ); } //@} protected: size_t _mode; private: vector _weights; Scatter2DPtr _hNjetsRatio, _hNjetsRatio_comb; Histo1DPtr _hNjets, _hNjets_comb; }; class ATLAS_2015_CONF_2015_041_EL : public ATLAS_2015_CONF_2015_041 { public: - ATLAS_2015_CONF_2015_041_EL() - : ATLAS_2015_CONF_2015_041("ATLAS_2015_CONF_2015_041_EL") - { - _mode = 0; - } + ATLAS_2015_CONF_2015_041_EL() : ATLAS_2015_CONF_2015_041("ATLAS_2015_CONF_2015_041_EL", 0) { } }; class ATLAS_2015_CONF_2015_041_MU : public ATLAS_2015_CONF_2015_041 { public: - ATLAS_2015_CONF_2015_041_MU() - : ATLAS_2015_CONF_2015_041("ATLAS_2015_CONF_2015_041_MU") - { - _mode = 1; - } + ATLAS_2015_CONF_2015_041_MU() : ATLAS_2015_CONF_2015_041("ATLAS_2015_CONF_2015_041_MU", 1) { } }; - DECLARE_RIVET_PLUGIN(ATLAS_2015_CONF_2015_041); DECLARE_RIVET_PLUGIN(ATLAS_2015_CONF_2015_041_EL); DECLARE_RIVET_PLUGIN(ATLAS_2015_CONF_2015_041_MU); } diff --git a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.yoda b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.yoda --- a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.yoda +++ b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041.yoda @@ -1,53 +1,107 @@ BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d01-x01-y01 IsRef: 1 Path: /REF/ATLAS_2015_CONF_2015_041/d01-x01-y01 Title: ~ Type: Scatter2D --- # xval xerr- xerr+ yval yerr- yerr+ 5.000000e-01 5.000000e-01 5.000000e-01 7.267400e+02 6.736000e+01 6.736000e+01 1.500000e+00 5.000000e-01 5.000000e-01 1.141700e+02 1.144000e+01 1.144000e+01 2.500000e+00 5.000000e-01 5.000000e-01 2.662000e+01 2.850000e+00 2.850000e+00 3.500000e+00 5.000000e-01 5.000000e-01 5.750000e+00 6.800000e-01 6.800000e-01 4.500000e+00 5.000000e-01 5.000000e-01 1.370000e+00 2.200000e-01 2.200000e-01 END YODA_SCATTER2D_V2 BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d01-x02-y01 IsRef: 1 Path: /REF/ATLAS_2015_CONF_2015_041/d01-x02-y01 Title: ~ Type: Scatter2D --- # xval xerr- xerr+ yval yerr- yerr+ 5.000000e-01 5.000000e-01 5.000000e-01 7.275200e+02 7.330000e+01 7.330000e+01 1.500000e+00 5.000000e-01 5.000000e-01 1.124100e+02 1.337000e+01 1.337000e+01 2.500000e+00 5.000000e-01 5.000000e-01 2.594000e+01 3.590000e+00 3.590000e+00 3.500000e+00 5.000000e-01 5.000000e-01 5.990000e+00 8.900000e-01 8.900000e-01 4.500000e+00 5.000000e-01 5.000000e-01 1.780000e+00 4.300000e-01 4.300000e-01 END YODA_SCATTER2D_V2 BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d02-x01-y01 IsRef: 1 Path: /REF/ATLAS_2015_CONF_2015_041/d02-x01-y01 Title: ~ Type: Scatter2D --- # xval xerr- xerr+ yval yerr- yerr+ 1.500000e+00 5.000000e-01 5.000000e-01 1.580000e-01 6.000000e-03 6.000000e-03 2.500000e+00 5.000000e-01 5.000000e-01 2.330000e-01 7.000000e-03 7.000000e-03 3.500000e+00 5.000000e-01 5.000000e-01 2.170000e-01 1.100000e-02 1.100000e-02 4.500000e+00 5.000000e-01 5.000000e-01 2.400000e-01 2.800000e-02 2.800000e-02 END YODA_SCATTER2D_V2 BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d02-x02-y01 IsRef: 1 Path: /REF/ATLAS_2015_CONF_2015_041/d02-x02-y01 Title: ~ Type: Scatter2D --- # xval xerr- xerr+ yval yerr- yerr+ 1.500000e+00 5.000000e-01 5.000000e-01 1.550000e-01 7.000000e-03 7.000000e-03 2.500000e+00 5.000000e-01 5.000000e-01 2.310000e-01 9.000000e-03 9.000000e-03 3.500000e+00 5.000000e-01 5.000000e-01 2.310000e-01 1.700000e-02 1.700000e-02 4.500000e+00 5.000000e-01 5.000000e-01 2.980000e-01 3.800000e-02 3.800000e-02 END YODA_SCATTER2D_V2 + +BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d01-x01-y02 +IsRef: 1 +Path: /REF/ATLAS_2015_CONF_2015_041/d01-x01-y02 +Title: ~ +Type: Scatter2D +--- +# xval xerr- xerr+ yval yerr- yerr+ +5.000000e-01 5.000000e-01 5.000000e-01 7.267400e+02 6.736000e+01 6.736000e+01 +1.500000e+00 5.000000e-01 5.000000e-01 1.141700e+02 1.144000e+01 1.144000e+01 +2.500000e+00 5.000000e-01 5.000000e-01 2.662000e+01 2.850000e+00 2.850000e+00 +3.500000e+00 5.000000e-01 5.000000e-01 5.750000e+00 6.800000e-01 6.800000e-01 +4.500000e+00 5.000000e-01 5.000000e-01 1.370000e+00 2.200000e-01 2.200000e-01 +END YODA_SCATTER2D_V2 + +BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d01-x02-y02 +IsRef: 1 +Path: /REF/ATLAS_2015_CONF_2015_041/d01-x02-y02 +Title: ~ +Type: Scatter2D +--- +# xval xerr- xerr+ yval yerr- yerr+ +5.000000e-01 5.000000e-01 5.000000e-01 2.815000e+01 6.766000e+01 6.766000e+01 +1.500000e+00 5.000000e-01 5.000000e-01 1.420000e+01 1.238000e+01 1.238000e+01 +2.500000e+00 5.000000e-01 5.000000e-01 6.720000e+00 3.340000e+00 3.340000e+00 +3.500000e+00 5.000000e-01 5.000000e-01 4.600000e-01 8.900000e-01 8.900000e-01 +4.500000e+00 5.000000e-01 5.000000e-01 9.900000e-01 2.800000e-01 2.800000e-01 +END YODA_SCATTER2D_V2 + +BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d02-x01-y02 +IsRef: 1 +Path: /REF/ATLAS_2015_CONF_2015_041/d02-x01-y02 +Title: ~ +Type: Scatter2D +--- +# xval xerr- xerr+ yval yerr- yerr+ +1.500000e+00 5.000000e-01 5.000000e-01 1.580000e-01 6.000000e-03 6.000000e-03 +2.500000e+00 5.000000e-01 5.000000e-01 2.330000e-01 7.000000e-03 7.000000e-03 +3.500000e+00 5.000000e-01 5.000000e-01 2.170000e-01 1.100000e-02 1.100000e-02 +4.500000e+00 5.000000e-01 5.000000e-01 2.400000e-01 2.800000e-02 2.800000e-02 +END YODA_SCATTER2D_V2 + +BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041/d02-x02-y02 +IsRef: 1 +Path: /REF/ATLAS_2015_CONF_2015_041/d02-x02-y02 +Title: ~ +Type: Scatter2D +--- +# xval xerr- xerr+ yval yerr- yerr+ +1.500000e+00 5.000000e-01 5.000000e-01 1.570000e-01 8.000000e-03 8.000000e-03 +2.500000e+00 5.000000e-01 5.000000e-01 2.340000e-01 7.000000e-03 7.000000e-03 +3.500000e+00 5.000000e-01 5.000000e-01 2.040000e-01 1.300000e-02 1.300000e-02 +4.500000e+00 5.000000e-01 5.000000e-01 1.820000e-01 2.900000e-02 2.900000e-02 +END YODA_SCATTER2D_V2 diff --git a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_EL.yoda b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_EL.yoda deleted file mode 100644 --- a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_EL.yoda +++ /dev/null @@ -1,53 +0,0 @@ -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_EL/d01-x01-y01 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_EL/d01-x01-y01 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -5.000000e-01 5.000000e-01 5.000000e-01 7.267400e+02 6.736000e+01 6.736000e+01 -1.500000e+00 5.000000e-01 5.000000e-01 1.141700e+02 1.144000e+01 1.144000e+01 -2.500000e+00 5.000000e-01 5.000000e-01 2.662000e+01 2.850000e+00 2.850000e+00 -3.500000e+00 5.000000e-01 5.000000e-01 5.750000e+00 6.800000e-01 6.800000e-01 -4.500000e+00 5.000000e-01 5.000000e-01 1.370000e+00 2.200000e-01 2.200000e-01 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_EL/d01-x02-y01 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_EL/d01-x02-y01 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -5.000000e-01 5.000000e-01 5.000000e-01 7.275200e+02 7.330000e+01 7.330000e+01 -1.500000e+00 5.000000e-01 5.000000e-01 1.124100e+02 1.337000e+01 1.337000e+01 -2.500000e+00 5.000000e-01 5.000000e-01 2.594000e+01 3.590000e+00 3.590000e+00 -3.500000e+00 5.000000e-01 5.000000e-01 5.990000e+00 8.900000e-01 8.900000e-01 -4.500000e+00 5.000000e-01 5.000000e-01 1.780000e+00 4.300000e-01 4.300000e-01 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_EL/d02-x01-y01 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_EL/d02-x01-y01 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -1.500000e+00 5.000000e-01 5.000000e-01 1.580000e-01 6.000000e-03 6.000000e-03 -2.500000e+00 5.000000e-01 5.000000e-01 2.330000e-01 7.000000e-03 7.000000e-03 -3.500000e+00 5.000000e-01 5.000000e-01 2.170000e-01 1.100000e-02 1.100000e-02 -4.500000e+00 5.000000e-01 5.000000e-01 2.400000e-01 2.800000e-02 2.800000e-02 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_EL/d02-x02-y01 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_EL/d02-x02-y01 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -1.500000e+00 5.000000e-01 5.000000e-01 1.550000e-01 7.000000e-03 7.000000e-03 -2.500000e+00 5.000000e-01 5.000000e-01 2.310000e-01 9.000000e-03 9.000000e-03 -3.500000e+00 5.000000e-01 5.000000e-01 2.310000e-01 1.700000e-02 1.700000e-02 -4.500000e+00 5.000000e-01 5.000000e-01 2.980000e-01 3.800000e-02 3.800000e-02 -END YODA_SCATTER2D_V2 diff --git a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_MU.yoda b/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_MU.yoda deleted file mode 100644 --- a/analyses/pluginATLAS/ATLAS_2015_CONF_2015_041_MU.yoda +++ /dev/null @@ -1,53 +0,0 @@ -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_MU/d01-x01-y02 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_MU/d01-x01-y02 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -5.000000e-01 5.000000e-01 5.000000e-01 7.267400e+02 6.736000e+01 6.736000e+01 -1.500000e+00 5.000000e-01 5.000000e-01 1.141700e+02 1.144000e+01 1.144000e+01 -2.500000e+00 5.000000e-01 5.000000e-01 2.662000e+01 2.850000e+00 2.850000e+00 -3.500000e+00 5.000000e-01 5.000000e-01 5.750000e+00 6.800000e-01 6.800000e-01 -4.500000e+00 5.000000e-01 5.000000e-01 1.370000e+00 2.200000e-01 2.200000e-01 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_MU/d01-x02-y02 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_MU/d01-x02-y02 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -5.000000e-01 5.000000e-01 5.000000e-01 2.815000e+01 6.766000e+01 6.766000e+01 -1.500000e+00 5.000000e-01 5.000000e-01 1.420000e+01 1.238000e+01 1.238000e+01 -2.500000e+00 5.000000e-01 5.000000e-01 6.720000e+00 3.340000e+00 3.340000e+00 -3.500000e+00 5.000000e-01 5.000000e-01 4.600000e-01 8.900000e-01 8.900000e-01 -4.500000e+00 5.000000e-01 5.000000e-01 9.900000e-01 2.800000e-01 2.800000e-01 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_MU/d02-x01-y02 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_MU/d02-x01-y02 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -1.500000e+00 5.000000e-01 5.000000e-01 1.580000e-01 6.000000e-03 6.000000e-03 -2.500000e+00 5.000000e-01 5.000000e-01 2.330000e-01 7.000000e-03 7.000000e-03 -3.500000e+00 5.000000e-01 5.000000e-01 2.170000e-01 1.100000e-02 1.100000e-02 -4.500000e+00 5.000000e-01 5.000000e-01 2.400000e-01 2.800000e-02 2.800000e-02 -END YODA_SCATTER2D_V2 - -BEGIN YODA_SCATTER2D_V2 /REF/ATLAS_2015_CONF_2015_041_MU/d02-x02-y02 -IsRef: 1 -Path: /REF/ATLAS_2015_CONF_2015_041_MU/d02-x02-y02 -Title: ~ -Type: Scatter2D ---- -# xval xerr- xerr+ yval yerr- yerr+ -1.500000e+00 5.000000e-01 5.000000e-01 1.570000e-01 8.000000e-03 8.000000e-03 -2.500000e+00 5.000000e-01 5.000000e-01 2.340000e-01 7.000000e-03 7.000000e-03 -3.500000e+00 5.000000e-01 5.000000e-01 2.040000e-01 1.300000e-02 1.300000e-02 -4.500000e+00 5.000000e-01 5.000000e-01 1.820000e-01 2.900000e-02 2.900000e-02 -END YODA_SCATTER2D_V2