Page MenuHomeHEPForge

No OneTemporary

diff --git a/src/AnalysisTools/MC_JetAnalysis.cc b/src/AnalysisTools/MC_JetAnalysis.cc
--- a/src/AnalysisTools/MC_JetAnalysis.cc
+++ b/src/AnalysisTools/MC_JetAnalysis.cc
@@ -1,181 +1,190 @@
// -*- C++ -*-
#include "Rivet/Analyses/MC_JetAnalysis.hh"
#include "Rivet/Projections/FastJets.hh"
namespace Rivet {
MC_JetAnalysis::MC_JetAnalysis(const string& name,
size_t njet,
const string& jetpro_name,
double jetptcut)
: Analysis(name), _njet(njet), _jetpro_name(jetpro_name), _jetptcut(jetptcut),
_h_pT_jet(njet),
_h_eta_jet(njet), _h_eta_jet_plus(njet), _h_eta_jet_minus(njet),
_h_rap_jet(njet), _h_rap_jet_plus(njet), _h_rap_jet_minus(njet),
_h_mass_jet(njet)
{
setNeedsCrossSection(true); // legitimate use, since a base class has no .info file!
}
// Book histograms
void MC_JetAnalysis::init() {
const double sqrts = sqrtS() ? sqrtS() : 14000.*GeV;
for (size_t i = 0; i < _njet; ++i) {
const string pTname = "jet_pT_" + to_str(i+1);
const double pTmax = 1.0/(double(i)+2.0) * sqrts/GeV/2.0;
const int nbins_pT = 100/(i+1);
if (pTmax > 10) { // Protection aginst logspace exception, needed for LEP
book(_h_pT_jet[i] ,pTname, logspace(nbins_pT, 10.0, pTmax));
}
const string massname = "jet_mass_" + to_str(i+1);
const double mmax = 100.0;
const int nbins_m = 100/(i+1);
book(_h_mass_jet[i] ,massname, logspace(nbins_m, 1.0, mmax));
const string etaname = "jet_eta_" + to_str(i+1);
book(_h_eta_jet[i] ,etaname, i > 1 ? 25 : 50, -5.0, 5.0);
- _h_eta_jet_plus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
- _h_eta_jet_minus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
+ book(_h_eta_jet_plus[i], "_" + etaname + "_plus", i > 1 ? 15 : 25, 0, 5);
+ book(_h_eta_jet_minus[i], "_" + etaname + "_minus", i > 1 ? 15 : 25, 0, 5);
const string rapname = "jet_y_" + to_str(i+1);
book(_h_rap_jet[i] ,rapname, i>1 ? 25 : 50, -5.0, 5.0);
- _h_rap_jet_plus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
- _h_rap_jet_minus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
+ book(_h_rap_jet_plus[i], "_" + rapname + "_plus", i > 1 ? 15 : 25, 0, 5);
+ book(_h_rap_jet_minus[i], "_" + rapname + "_minus", i > 1 ? 15 : 25, 0, 5);
for (size_t j = i+1; j < min(size_t(3), _njet); ++j) {
const std::pair<size_t, size_t> ij = std::make_pair(i, j);
string detaname = "jets_deta_" + to_str(i+1) + to_str(j+1);
- _h_deta_jets.insert(make_pair(ij, bookHisto1D(detaname, 25, -5.0, 5.0)));
+ Histo1DPtr tmpeta;
+ book(tmpeta, detaname, 25, -5.0, 5.0);
+ _h_deta_jets.insert(make_pair(ij, tmpeta));
string dphiname = "jets_dphi_" + to_str(i+1) + to_str(j+1);
- _h_dphi_jets.insert(make_pair(ij, bookHisto1D(dphiname, 25, 0.0, M_PI)));
+ Histo1DPtr tmpphi;
+ book(tmpphi, dphiname, 25, 0.0, M_PI);
+ _h_dphi_jets.insert(make_pair(ij, tmpphi));
string dRname = "jets_dR_" + to_str(i+1) + to_str(j+1);
- _h_dR_jets.insert(make_pair(ij, bookHisto1D(dRname, 25, 0.0, 5.0)));
+ Histo1DPtr tmpR;
+ book(tmpR, dRname, 25, 0.0, 5.0);
+ _h_dR_jets.insert(make_pair(ij, tmpR));
}
}
book(_h_jet_multi_exclusive ,"jet_multi_exclusive", _njet+3, -0.5, _njet+3-0.5);
book(_h_jet_multi_inclusive ,"jet_multi_inclusive", _njet+3, -0.5, _njet+3-0.5);
- _h_jet_multi_ratio = bookScatter2D("jet_multi_ratio");
+ book(_h_jet_multi_ratio, "jet_multi_ratio");
book(_h_jet_HT ,"jet_HT", logspace(50, _jetptcut, sqrts/GeV/2.0));
- _h_mjj_jets = bookHisto1D("jets_mjj", 40, 0.0, sqrts/GeV/2.0);
+ book(_h_mjj_jets, "jets_mjj", 40, 0.0, sqrts/GeV/2.0);
}
// Do the analysis
void MC_JetAnalysis::analyze(const Event & e) {
- const double weight = 1.0;
const Jets& jets = apply<FastJets>(e, _jetpro_name).jetsByPt(_jetptcut);
for (size_t i = 0; i < _njet; ++i) {
if (jets.size() < i+1) continue;
- _h_pT_jet[i]->fill(jets[i].pT()/GeV, weight);
+ _h_pT_jet[i]->fill(jets[i].pT()/GeV);
// Check for numerical precision issues with jet masses
double m2_i = jets[i].mass2();
if (m2_i < 0) {
if (m2_i < -1e-4) {
MSG_WARNING("Jet mass2 is negative: " << m2_i << " GeV^2. "
<< "Truncating to 0.0, assuming numerical precision is to blame.");
}
m2_i = 0.0;
}
// Jet mass
- _h_mass_jet[i]->fill(sqrt(m2_i)/GeV, weight);
+ _h_mass_jet[i]->fill(sqrt(m2_i)/GeV);
// Jet eta
const double eta_i = jets[i].eta();
- _h_eta_jet[i]->fill(eta_i, weight);
- (eta_i > 0.0 ? _h_eta_jet_plus : _h_eta_jet_minus)[i]->fill(fabs(eta_i), weight);
+ _h_eta_jet[i]->fill(eta_i);
+ (eta_i > 0.0 ? _h_eta_jet_plus : _h_eta_jet_minus)[i]->fill(fabs(eta_i));
// Jet rapidity
const double rap_i = jets[i].rapidity();
- _h_rap_jet[i]->fill(rap_i, weight);
- (rap_i > 0.0 ? _h_rap_jet_plus : _h_rap_jet_minus)[i]->fill(fabs(rap_i), weight);
+ _h_rap_jet[i]->fill(rap_i);
+ (rap_i > 0.0 ? _h_rap_jet_plus : _h_rap_jet_minus)[i]->fill(fabs(rap_i));
// Inter-jet properties
for (size_t j = i+1; j < min(size_t(3),_njet); ++j) {
if (jets.size() < j+1) continue;
std::pair<size_t, size_t> ij = std::make_pair(i, j);
double deta = jets[i].eta()-jets[j].eta();
double dphi = deltaPhi(jets[i].momentum(),jets[j].momentum());
double dR = deltaR(jets[i].momentum(), jets[j].momentum());
- _h_deta_jets[ij]->fill(deta, weight);
- _h_dphi_jets[ij]->fill(dphi, weight);
- _h_dR_jets[ij]->fill(dR, weight);
+ _h_deta_jets[ij]->fill(deta);
+ _h_dphi_jets[ij]->fill(dphi);
+ _h_dR_jets[ij]->fill(dR);
}
}
// Multiplicities
- _h_jet_multi_exclusive->fill(jets.size(), weight);
+ _h_jet_multi_exclusive->fill(jets.size());
for (size_t i = 0; i < _njet+2; ++i) {
if (jets.size() >= i) {
- _h_jet_multi_inclusive->fill(i, weight);
+ _h_jet_multi_inclusive->fill(i);
}
}
// HT
double HT = 0.0;
foreach (const Jet& jet, jets) {
HT += jet.pT();
}
- _h_jet_HT->fill(HT, weight);
+ _h_jet_HT->fill(HT);
// mjj
if (jets.size() > 1) {
double mjj = (jets[0].momentum() + jets[1].momentum()).mass();
- _h_mjj_jets->fill(mjj, weight);
+ _h_mjj_jets->fill(mjj);
}
}
// Finalize
void MC_JetAnalysis::finalize() {
+ const double scaling = crossSection()/sumOfWeights();
for (size_t i = 0; i < _njet; ++i) {
- scale(_h_pT_jet[i], crossSection()/sumOfWeights());
- scale(_h_mass_jet[i], crossSection()/sumOfWeights());
- scale(_h_eta_jet[i], crossSection()/sumOfWeights());
- scale(_h_rap_jet[i], crossSection()/sumOfWeights());
+ scale(_h_pT_jet[i], scaling);
+ scale(_h_mass_jet[i], scaling);
+ scale(_h_eta_jet[i], scaling);
+ scale(_h_rap_jet[i], scaling);
// Create eta/rapidity ratio plots
- divide(*_h_eta_jet_plus[i], *_h_eta_jet_minus[i], bookScatter2D("jet_eta_pmratio_" + to_str(i+1)));
- divide(*_h_rap_jet_plus[i], *_h_rap_jet_minus[i], bookScatter2D("jet_y_pmratio_" + to_str(i+1)));
+ Scatter2DPtr tmpeta, tmprap;
+ book(tmpeta, "jet_eta_pmratio_" + to_str(i+1));
+ book(tmprap, "jet_y_pmratio_" + to_str(i+1));
+ divide(*_h_eta_jet_plus[i], *_h_eta_jet_minus[i], tmpeta);
+ divide(*_h_rap_jet_plus[i], *_h_rap_jet_minus[i], tmprap);
}
// Scale the d{eta,phi,R} histograms
typedef map<pair<size_t, size_t>, Histo1DPtr> HistMap;
- foreach (HistMap::value_type& it, _h_deta_jets) scale(it.second, crossSection()/sumOfWeights());
- foreach (HistMap::value_type& it, _h_dphi_jets) scale(it.second, crossSection()/sumOfWeights());
- foreach (HistMap::value_type& it, _h_dR_jets) scale(it.second, crossSection()/sumOfWeights());
+ for (HistMap::value_type& it : _h_deta_jets) scale(it.second, scaling);
+ for (HistMap::value_type& it : _h_dphi_jets) scale(it.second, scaling);
+ for (HistMap::value_type& it : _h_dR_jets) scale(it.second, scaling);
// Fill inclusive jet multi ratio
int Nbins = _h_jet_multi_inclusive->numBins();
for (int i = 0; i < Nbins-1; ++i) {
_h_jet_multi_ratio->addPoint(i+1, 0, 0.5, 0);
if (_h_jet_multi_inclusive->bin(i).sumW() > 0.0) {
const double ratio = _h_jet_multi_inclusive->bin(i+1).sumW()/_h_jet_multi_inclusive->bin(i).sumW();
const double relerr_i = _h_jet_multi_inclusive->bin(i).relErr();
const double relerr_j = _h_jet_multi_inclusive->bin(i+1).relErr();
const double err = ratio * (relerr_i + relerr_j);
_h_jet_multi_ratio->point(i).setY(ratio, err);
}
}
- scale(_h_jet_multi_exclusive, crossSection()/sumOfWeights());
- scale(_h_jet_multi_inclusive, crossSection()/sumOfWeights());
- scale(_h_jet_HT, crossSection()/sumOfWeights());
- scale(_h_mjj_jets, crossSection()/sumOfWeights());
+ scale(_h_jet_multi_exclusive, scaling);
+ scale(_h_jet_multi_inclusive, scaling);
+ scale(_h_jet_HT, scaling);
+ scale(_h_mjj_jets, scaling);
}
}
diff --git a/src/AnalysisTools/MC_JetSplittings.cc b/src/AnalysisTools/MC_JetSplittings.cc
--- a/src/AnalysisTools/MC_JetSplittings.cc
+++ b/src/AnalysisTools/MC_JetSplittings.cc
@@ -1,93 +1,93 @@
// -*- C++ -*-
#include "Rivet/Analyses/MC_JetSplittings.hh"
#include "Rivet/Projections/FastJets.hh"
namespace Rivet {
MC_JetSplittings::MC_JetSplittings(const string& name,
size_t njet,
const string& jetpro_name)
: Analysis(name), m_njet(njet), m_jetpro_name(jetpro_name),
_h_log10_d(njet), _h_log10_R(njet+1)
{
setNeedsCrossSection(true); // legitimate use, since a base class has no .info file!
}
// Book histograms
void MC_JetSplittings::init() {
const double sqrts = sqrtS() ? sqrtS() : 14000.*GeV;
for (size_t i = 0; i < m_njet; ++i) {
string dname = "log10_d_" + to_str(i) + to_str(i+1);
book(_h_log10_d[i] ,dname, 100, 0.2, log10(0.5*sqrts/GeV));
string Rname = "log10_R_" + to_str(i);
- _h_log10_R[i] = bookScatter2D(Rname, 50, 0.2, log10(0.5*sqrts/GeV));
+ book(_h_log10_R[i], Rname, 50, 0.2, log10(0.5*sqrts/GeV));
}
string Rname = "log10_R_" + to_str(m_njet);
- _h_log10_R[m_njet] = bookScatter2D(Rname, 50, 0.2, log10(0.5*sqrts/GeV));
+ book(_h_log10_R[m_njet], Rname, 50, 0.2, log10(0.5*sqrts/GeV));
}
// Do the analysis
void MC_JetSplittings::analyze(const Event & e) {
const double weight = 1.0;
const FastJets& jetpro = apply<FastJets>(e, m_jetpro_name);
const auto seq = jetpro.clusterSeq();
if (!seq) vetoEvent; //< the cseq is the whole point in this sort of analysis!!
// Jet resolutions and integrated jet rates
double previous_dij = 10.0;
for (size_t i = 0; i < min(m_njet,(size_t)seq->n_particles()); ++i) {
const double d_ij2 = seq->exclusive_dmerge_max(i);
if (d_ij2 <= 0) continue; ///< @todo Is < 0 possible? Feels like no; I should check ;-)
// Jet resolution i -> j
const double d_ij = log10(sqrt(d_ij2));
// Fill differential jet resolution
_h_log10_d[i]->fill(d_ij, weight);
// Fill integrated jet resolution
for (size_t ibin = 0; ibin < _h_log10_R[i]->numPoints(); ++ibin) {
Point2D& dp = _h_log10_R[i]->point(ibin);
if (dp.x() > d_ij && dp.x() < previous_dij) {
dp.setY(dp.y() + weight);
}
}
previous_dij = d_ij;
}
// One remaining integrated jet resolution
for (size_t ibin = 0; ibin<_h_log10_R[m_njet]->numPoints(); ++ibin) {
Point2D & dp = _h_log10_R[m_njet]->point(ibin);
if (dp.x() < previous_dij) {
dp.setY(dp.y() + weight);
}
}
}
// Finalize
void MC_JetSplittings::finalize() {
const double xsec_unitw = crossSection()/picobarn/sumOfWeights();
for (size_t i = 0; i < m_njet; ++i) {
scale(_h_log10_d[i], xsec_unitw);
for (size_t ibin = 0; ibin<_h_log10_R[i]->numPoints(); ++ibin) {
Point2D& dp = _h_log10_R[i]->point(ibin);
dp.setY(dp.y()*xsec_unitw);
}
}
for (size_t ibin = 0; ibin < _h_log10_R[m_njet]->numPoints(); ++ibin) {
Point2D& dp =_h_log10_R[m_njet]->point(ibin);
dp.setY(dp.y()*xsec_unitw);
}
}
}
diff --git a/src/AnalysisTools/MC_ParticleAnalysis.cc b/src/AnalysisTools/MC_ParticleAnalysis.cc
--- a/src/AnalysisTools/MC_ParticleAnalysis.cc
+++ b/src/AnalysisTools/MC_ParticleAnalysis.cc
@@ -1,158 +1,167 @@
// -*- C++ -*-
#include "Rivet/Analyses/MC_ParticleAnalysis.hh"
namespace Rivet {
MC_ParticleAnalysis::MC_ParticleAnalysis(const string& name,
size_t nparticles,
const string& particle_name)
: Analysis(name),
_nparts(nparticles), _pname(particle_name),
_h_pt(nparticles),
_h_eta(nparticles), _h_eta_plus(nparticles), _h_eta_minus(nparticles),
_h_rap(nparticles), _h_rap_plus(nparticles), _h_rap_minus(nparticles)
{
setNeedsCrossSection(true); // legitimate use, since a base class has no .info file!
}
// Book histograms
void MC_ParticleAnalysis::init() {
for (size_t i = 0; i < _nparts; ++i) {
const string ptname = _pname + "_pt_" + to_str(i+1);
const double ptmax = 1.0/(double(i)+2.0) * (sqrtS()>0.?sqrtS():14000.)/GeV/2.0;
const int nbins_pt = 100/(i+1);
book(_h_pt[i] ,ptname, logspace(nbins_pt, 1.0, ptmax));
const string etaname = _pname + "_eta_" + to_str(i+1);
book(_h_eta[i] ,etaname, i > 1 ? 25 : 50, -5.0, 5.0);
- _h_eta_plus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
- _h_eta_minus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
+ book(_h_eta_plus[i], "_" + etaname + "_plus", i > 1 ? 15 : 25, 0, 5);
+ book(_h_eta_minus[i], "_" + etaname + "_minus", i > 1 ? 15 : 25, 0, 5);
const string rapname = _pname + "_y_" + to_str(i+1);
book(_h_rap[i] ,rapname, i > 1 ? 25 : 50, -5.0, 5.0);
- _h_rap_plus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
- _h_rap_minus[i].reset(new Histo1D(i > 1 ? 15 : 25, 0, 5));
+ book(_h_rap_plus[i], "_" + rapname + "_plus", i > 1 ? 15 : 25, 0, 5);
+ book(_h_rap_minus[i], "_" + rapname + "_minus", i > 1 ? 15 : 25, 0, 5);
for (size_t j = i+1; j < min(size_t(3), _nparts); ++j) {
const pair<size_t, size_t> ij = std::make_pair(i, j);
string detaname = _pname + "s_deta_" + to_str(i+1) + to_str(j+1);
- _h_deta.insert(make_pair(ij, bookHisto1D(detaname, 25, -5.0, 5.0)));
+ Histo1DPtr tmpeta;
+ book(tmpeta, detaname, 25, -5.0, 5.0);
+ _h_deta.insert(make_pair(ij, tmpeta));
string dphiname = _pname + "s_dphi_" + to_str(i+1) + to_str(j+1);
- _h_dphi.insert(make_pair(ij, bookHisto1D(dphiname, 25, 0.0, M_PI)));
+ Histo1DPtr tmpphi;
+ book(tmpphi, dphiname, 25, 0.0, M_PI);
+ _h_dphi.insert(make_pair(ij, tmpphi));
string dRname = _pname + "s_dR_" + to_str(i+1) + to_str(j+1);
- _h_dR.insert(make_pair(ij, bookHisto1D(dRname, 25, 0.0, 5.0)));
+ Histo1DPtr tmpR;
+ book(tmpR, dRname, 25, 0.0, 5.0);
+ _h_dR.insert(make_pair(ij, tmpR));
}
}
book(_h_multi_exclusive ,_pname + "_multi_exclusive", _nparts+3, -0.5, _nparts+3-0.5);
book(_h_multi_inclusive ,_pname + "_multi_inclusive", _nparts+3, -0.5, _nparts+3-0.5);
- _h_multi_ratio = bookScatter2D(_pname + "_multi_ratio");
+ book(_h_multi_ratio, _pname + "_multi_ratio");
book(_h_multi_exclusive_prompt ,_pname + "_multi_exclusive_prompt", _nparts+3, -0.5, _nparts+3-0.5);
book(_h_multi_inclusive_prompt ,_pname + "_multi_inclusive_prompt", _nparts+3, -0.5, _nparts+3-0.5);
- _h_multi_ratio_prompt = bookScatter2D(_pname + "_multi_ratio_prompt");
+ book(_h_multi_ratio_prompt, _pname + "_multi_ratio_prompt");
}
// Do the analysis
void MC_ParticleAnalysis::_analyze(const Event& event, const Particles& particles) {
- const double weight = 1.0;
Particles promptparticles;
foreach (const Particle& p, particles)
if (!p.fromDecay()) promptparticles += p;
for (size_t i = 0; i < _nparts; ++i) {
if (particles.size() < i+1) continue;
- _h_pt[i]->fill(particles[i].pt()/GeV, weight);
+ _h_pt[i]->fill(particles[i].pt()/GeV);
// Eta
const double eta_i = particles[i].eta();
- _h_eta[i]->fill(eta_i, weight);
- (eta_i > 0.0 ? _h_eta_plus : _h_eta_minus)[i]->fill(fabs(eta_i), weight);
+ _h_eta[i]->fill(eta_i);
+ (eta_i > 0.0 ? _h_eta_plus : _h_eta_minus)[i]->fill(fabs(eta_i));
// Rapidity
const double rap_i = particles[i].rapidity();
- _h_rap[i]->fill(rap_i, weight);
- (rap_i > 0.0 ? _h_rap_plus : _h_rap_minus)[i]->fill(fabs(rap_i), weight);
+ _h_rap[i]->fill(rap_i);
+ (rap_i > 0.0 ? _h_rap_plus : _h_rap_minus)[i]->fill(fabs(rap_i));
// Inter-particle properties
for (size_t j = i+1; j < min(size_t(3),_nparts); ++j) {
if (particles.size() < j+1) continue;
std::pair<size_t, size_t> ij = std::make_pair(i, j);
double deta = particles[i].eta() - particles[j].eta();
double dphi = deltaPhi(particles[i].momentum(), particles[j].momentum());
double dR = deltaR(particles[i].momentum(), particles[j].momentum());
- _h_deta[ij]->fill(deta, weight);
- _h_dphi[ij]->fill(dphi, weight);
- _h_dR[ij]->fill(dR, weight);
+ _h_deta[ij]->fill(deta);
+ _h_dphi[ij]->fill(dphi);
+ _h_dR[ij]->fill(dR);
}
}
// Multiplicities
- _h_multi_exclusive->fill(particles.size(), weight);
- _h_multi_exclusive_prompt->fill(promptparticles.size(), weight);
+ _h_multi_exclusive->fill(particles.size());
+ _h_multi_exclusive_prompt->fill(promptparticles.size());
for (size_t i = 0; i < _nparts+2; ++i) {
- if (particles.size() >= i) _h_multi_inclusive->fill(i, weight);
- if (promptparticles.size() >= i) _h_multi_inclusive_prompt->fill(i, weight);
+ if (particles.size() >= i) _h_multi_inclusive->fill(i);
+ if (promptparticles.size() >= i) _h_multi_inclusive_prompt->fill(i);
}
}
// Finalize
void MC_ParticleAnalysis::finalize() {
+ const double scaling = crossSection()/sumOfWeights();
for (size_t i = 0; i < _nparts; ++i) {
- scale(_h_pt[i], crossSection()/sumOfWeights());
- scale(_h_eta[i], crossSection()/sumOfWeights());
- scale(_h_rap[i], crossSection()/sumOfWeights());
+ scale(_h_pt[i], scaling);
+ scale(_h_eta[i], scaling);
+ scale(_h_rap[i], scaling);
// Create eta/rapidity ratio plots
- divide(*_h_eta_plus[i], *_h_eta_minus[i], bookScatter2D(_pname + "_eta_pmratio_" + to_str(i+1)));
- divide(*_h_rap_plus[i], *_h_rap_minus[i], bookScatter2D(_pname + "_y_pmratio_" + to_str(i+1)));
+ Scatter2DPtr tmpeta, tmprap;
+ book(tmpeta, _pname + "_eta_pmratio_" + to_str(i+1));
+ book(tmprap, _pname + "_y_pmratio_" + to_str(i+1));
+ divide(*_h_eta_plus[i], *_h_eta_minus[i], tmpeta);
+ divide(*_h_rap_plus[i], *_h_rap_minus[i], tmprap);
}
// Scale the d{eta,phi,R} histograms
typedef map<pair<size_t, size_t>, Histo1DPtr> HistMap;
- foreach (HistMap::value_type& it, _h_deta) scale(it.second, crossSection()/sumOfWeights());
- foreach (HistMap::value_type& it, _h_dphi) scale(it.second, crossSection()/sumOfWeights());
- foreach (HistMap::value_type& it, _h_dR) scale(it.second, crossSection()/sumOfWeights());
+ for (HistMap::value_type& it : _h_deta) scale(it.second, scaling);
+ for (HistMap::value_type& it : _h_dphi) scale(it.second, scaling);
+ for (HistMap::value_type& it : _h_dR) scale(it.second, scaling);
// Fill inclusive multi ratios
for (size_t i = 0; i < _h_multi_inclusive->numBins()-1; ++i) {
_h_multi_ratio->addPoint(i+1, 0, 0.5, 0);
if (_h_multi_inclusive->bin(i).sumW() > 0.0) {
const double ratio = _h_multi_inclusive->bin(i+1).sumW() / _h_multi_inclusive->bin(i).sumW();
const double relerr_i = _h_multi_inclusive->bin(i).relErr();
const double relerr_j = _h_multi_inclusive->bin(i+1).relErr();
const double err = ratio * (relerr_i + relerr_j);
_h_multi_ratio->point(i).setY(ratio, err);
}
}
for (size_t i = 0; i < _h_multi_inclusive_prompt->numBins()-1; ++i) {
_h_multi_ratio_prompt->addPoint(i+1, 0, 0.5, 0);
if (_h_multi_inclusive_prompt->bin(i).sumW() > 0.0) {
const double ratio = _h_multi_inclusive_prompt->bin(i+1).sumW() / _h_multi_inclusive_prompt->bin(i).sumW();
const double relerr_i = _h_multi_inclusive_prompt->bin(i).relErr();
const double relerr_j = _h_multi_inclusive_prompt->bin(i+1).relErr();
const double err = ratio * (relerr_i + relerr_j);
_h_multi_ratio_prompt->point(i).setY(ratio, err);
}
}
- scale(_h_multi_exclusive, crossSection()/sumOfWeights());
- scale(_h_multi_exclusive_prompt, crossSection()/sumOfWeights());
- scale(_h_multi_inclusive, crossSection()/sumOfWeights());
- scale(_h_multi_inclusive_prompt, crossSection()/sumOfWeights());
+ scale(_h_multi_exclusive, scaling);
+ scale(_h_multi_exclusive_prompt, scaling);
+ scale(_h_multi_inclusive, scaling);
+ scale(_h_multi_inclusive_prompt, scaling);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 7:33 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805845
Default Alt Text
(21 KB)

Event Timeline