|
[Rivet-svn] r1872 - trunk/srcblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Oct 6 11:40:46 BST 2009
Author: buckley Date: Tue Oct 6 11:40:46 2009 New Revision: 1872 Log: Work out AIDA path when reporting histo normalisation/scaling problems Modified: trunk/src/Analysis.cc Modified: trunk/src/Analysis.cc ============================================================================== --- trunk/src/Analysis.cc Tue Oct 6 11:05:12 2009 (r1871) +++ trunk/src/Analysis.cc Tue Oct 6 11:40:46 2009 (r1872) @@ -427,10 +427,11 @@ void Analysis::normalize(AIDA::IHistogram1D*& histo, const double norm) { if (!histo) { getLog() << Log::ERROR << "Failed to normalise histo=NULL in analysis " - << name() << "(norm=" << norm << ")" << endl; + << name() << "(norm=" << norm << ")" << endl; return; } - getLog() << Log::TRACE << "Normalizing histo " << histo->title() << " to " << norm << endl; + const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + getLog() << Log::TRACE << "Normalizing histo " << hpath << " to " << norm << endl; double oldintg = 0.0; int nBins = histo->axis().bins(); @@ -439,9 +440,7 @@ oldintg += histo->binHeight(iBin); // * histo->axis().binWidth(iBin); } if (oldintg == 0.0) { - /// @todo Writing the path would be much better than the title! But AIDA doesn't allow this. - getLog() << Log::WARN << "Histo '" << histo->title() - << "' has null integral during normalisation" << endl; + getLog() << Log::WARN << "Histo " << hpath << " has null integral during normalisation" << endl; return; } @@ -456,7 +455,8 @@ << name() << "(scale=" << scale << ")" << endl; return; } - getLog() << Log::TRACE << "Scaling histo " << histo->title() << endl; + const string hpath = tree().findPath(dynamic_cast<const AIDA::IManagedObject&>(*histo)); + getLog() << Log::TRACE << "Scaling histo " << hpath << endl; std::vector<double> x, y, ex, ey; for (size_t i = 0, N = histo->axis().bins(); i < N; ++i) { @@ -472,16 +472,14 @@ ey.push_back(histo->binError(i)*scale/(0.5*histo->axis().binWidth(i))); } - std::string path = - tree().findPath(dynamic_cast<AIDA::IManagedObject&>(*histo)); std::string title = histo->title(); std::string xtitle = histo->xtitle(); std::string ytitle = histo->ytitle(); tree().mkdir("/tmpnormalize"); - tree().mv(path, "/tmpnormalize"); + tree().mv(hpath, "/tmpnormalize"); - AIDA::IDataPointSet* dps = datapointsetFactory().createXY(path, title, x, y, ex, ey); + AIDA::IDataPointSet* dps = datapointsetFactory().createXY(hpath, title, x, y, ex, ey); dps->setXTitle(xtitle); dps->setYTitle(ytitle);
More information about the Rivet-svn mailing list |