#include <UncertaintyHistogram.h>
Definition at line 24 of file UncertaintyHistogram.h.
◆ UncertaintyHistogram() [1/4]
◆ UncertaintyHistogram() [2/4]
◆ UncertaintyHistogram() [3/4]
◆ UncertaintyHistogram() [4/4]
Definition at line 50 of file UncertaintyHistogram.cxx.
63 m_histo =
dynamic_cast<TH1*
>(toCopy.m_histo->Clone());
67 throw std::runtime_error(
"Failed to copy histogram in UncertaintyHistogram copy constructor");
71 if (!toCopy.m_cachedProj.empty())
75 throw std::runtime_error(
"Failed to build projection cache in UncertaintyHistogram copy constructor");
◆ ~UncertaintyHistogram()
jet::UncertaintyHistogram::~UncertaintyHistogram |
( |
| ) |
|
|
virtual |
◆ cacheProjections()
StatusCode jet::UncertaintyHistogram::cacheProjections |
( |
| ) |
|
|
private |
Definition at line 322 of file UncertaintyHistogram.cxx.
328 return StatusCode::FAILURE;
334 ATH_MSG_FATAL(
"Unsupported histogram dimensionality for projection caching: " <<
m_histo->GetDimension());
335 return StatusCode::FAILURE;
342 return StatusCode::FAILURE;
350 if (
m_histo->GetDimension() == 1)
351 return StatusCode::SUCCESS;
356 if (
m_histo->GetDimension() == 1)
359 return StatusCode::FAILURE;
365 return StatusCode::FAILURE;
373 if (
m_histo->GetDimension() == 2)
376 TH2* localHist =
dynamic_cast<TH2*
>(
m_histo);
380 ATH_MSG_FATAL(
"Failed to convert histogram to a TH2, please check inputs: " <<
m_name.Data());
381 return StatusCode::FAILURE;
387 for (Long64_t
binY = 0;
binY < localHist->GetNbinsY()+1; ++
binY)
395 for (Long64_t
binX = 0;
binX < localHist->GetNbinsX()+1; ++
binX)
404 ATH_MSG_FATAL(
"Unexpected interpolation type, somehow escaped earlier checks: " <<
m_name.Data());
405 return StatusCode::FAILURE;
408 else if (
m_histo->GetDimension() == 3)
411 TH3* localHist =
dynamic_cast<TH3*
>(
m_histo);
414 ATH_MSG_FATAL(
"Failed to convert histogram to a TH3, please check inputs: " <<
m_name.Data());
415 return StatusCode::FAILURE;
422 for (Long64_t
binY = 0;
binY < localHist->GetNbinsY()+1; ++
binY)
424 for (Long64_t
binZ = 0;
binZ < localHist->GetNbinsZ()+1; ++
binZ)
434 for (Long64_t
binX = 0;
binX < localHist->GetNbinsX()+1; ++
binX)
436 for (Long64_t
binZ = 0;
binZ < localHist->GetNbinsZ()+1; ++
binZ)
446 ATH_MSG_FATAL(
"Unexpected interpolation type, somehow escaped earlier checks: " <<
m_name.Data());
447 return StatusCode::FAILURE;
454 return StatusCode::FAILURE;
462 hist->SetDirectory(
nullptr);
467 return StatusCode::SUCCESS;
◆ checkBoundaries()
double jet::UncertaintyHistogram::checkBoundaries |
( |
const TAxis * |
axis, |
|
|
const int |
numBins, |
|
|
const double |
valInput |
|
) |
| const |
|
private |
Definition at line 293 of file UncertaintyHistogram.cxx.
295 const static int maxNumWarn = 0;
296 static std::atomic<int> numWarn = 0;
302 float val = valInput;
303 const double lowVal =
axis->GetBinLowEdge(1);
304 const double highVal =
axis->GetBinLowEdge(numBins+1);
305 if (val < lowVal || val >= highVal)
307 if (
val != highVal && ++numWarn < maxNumWarn)
308 ATH_MSG_WARNING(Form(
"Variable value is %f, outside of the axis range of (%f,%f) for %s. "
310 <<
" (Only first " << maxNumWarn <<
" instances printed, this is " << numWarn <<
")");
314 val = lowVal>0 ? (1.0+1.e-4)*lowVal : (1.0-1.
e-4)*lowVal;
316 val = highVal>0 ? (1.0-1.e-4)*highVal : (1.0+1.
e-4)*highVal;
◆ checkBoundariesByBin()
double jet::UncertaintyHistogram::checkBoundariesByBin |
( |
const TAxis * |
axis, |
|
|
const int |
numBins, |
|
|
const double |
valInput |
|
) |
| const |
|
private |
◆ getHisto()
const TH1* jet::UncertaintyHistogram::getHisto |
( |
| ) |
const |
|
inline |
◆ getInterp()
◆ getName()
const TString& jet::UncertaintyHistogram::getName |
( |
| ) |
const |
|
inline |
◆ getNumDim()
int jet::UncertaintyHistogram::getNumDim |
( |
| ) |
const |
|
inline |
◆ getValue() [1/3]
double jet::UncertaintyHistogram::getValue |
( |
const double |
var1 | ) |
const |
◆ getValue() [2/3]
double jet::UncertaintyHistogram::getValue |
( |
const double |
var1, |
|
|
const double |
var2 |
|
) |
| const |
◆ getValue() [3/3]
double jet::UncertaintyHistogram::getValue |
( |
const double |
var1, |
|
|
const double |
var2, |
|
|
const double |
var3 |
|
) |
| const |
◆ initialize()
StatusCode jet::UncertaintyHistogram::initialize |
( |
TFile * |
histFile | ) |
|
|
virtual |
Reimplemented in jet::ValidityHistogram.
Definition at line 85 of file UncertaintyHistogram.cxx.
91 return StatusCode::FAILURE;
95 if (!histFile->IsOpen())
98 return StatusCode::FAILURE;
106 return StatusCode::FAILURE;
114 return StatusCode::FAILURE;
116 m_histo->SetDirectory(
nullptr);
124 return StatusCode::FAILURE;
130 return StatusCode::SUCCESS;
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ readHisto()
double jet::UncertaintyHistogram::readHisto |
( |
const double |
var1, |
|
|
const double |
var2 = 0 , |
|
|
const double |
var3 = 0 |
|
) |
| const |
|
private |
Definition at line 178 of file UncertaintyHistogram.cxx.
206 return m_histo->GetBinContent(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX));
233 return m_histo->GetBinContent(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX),
234 std::as_const(*m_histo).GetYaxis()->FindFixBin(valY));
259 return m_histo->GetBinContent(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX),
260 std::as_const(*m_histo).GetYaxis()->FindFixBin(valY),
261 std::as_const(*m_histo).GetZaxis()->FindFixBin(valZ));
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_cachedProj
std::vector< std::vector< std::unique_ptr<TH1> > > jet::UncertaintyHistogram::m_cachedProj |
|
private |
◆ m_histo
TH1* jet::UncertaintyHistogram::m_histo |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_interpolate
◆ m_isInit
bool jet::UncertaintyHistogram::m_isInit |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_name
const TString jet::UncertaintyHistogram::m_name |
|
private |
◆ m_nDim
int jet::UncertaintyHistogram::m_nDim |
|
private |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
The documentation for this class was generated from the following files:
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.