ATLAS Offline Software
Loading...
Searching...
No Matches
jet::ValidityHistogram Class Reference

#include <ValidityHistogram.h>

Inheritance diagram for jet::ValidityHistogram:
Collaboration diagram for jet::ValidityHistogram:

Public Member Functions

 ValidityHistogram (const std::string &histName, const CompParametrization::TypeEnum parametrization, const float energyScale, const CompMassDef::TypeEnum massDef)
 ValidityHistogram (const TString &histName, const CompParametrization::TypeEnum parametrization, const float energyScale, const CompMassDef::TypeEnum massDef)
 ValidityHistogram (const char *histName, const CompParametrization::TypeEnum parametrization, const float energyScale, const CompMassDef::TypeEnum massDef)
 ValidityHistogram (const ValidityHistogram &toCopy)
virtual ~ValidityHistogram ()
virtual StatusCode initialize (TFile *histFile)
CompParametrization::TypeEnum getParam () const
bool getValidity (const xAOD::Jet &jet) const
const TString & getName () const
const TH1 * getHisto () const
Interpolate::TypeEnum getInterp () const
int getNumDim () const
double getValue (const double var1) const
double getValue (const double var1, const double var2) const
double getValue (const double var1, const double var2, const double var3) const
void setLevel (MSG::Level lvl)
 Change the current logging level.
Functions providing the same interface as AthMessaging
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.

Private Member Functions

StatusCode cacheProjections ()
double readHisto (const double var1, const double var2=0, const double var3=0) const
double checkBoundariesByBin (const TAxis *axis, const int numBins, const double valInput) const
double checkBoundaries (const TAxis *axis, const int numBins, const double valInput) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

bool m_isInit
const CompParametrization::TypeEnum m_param
const float m_energyScale
const CompMassDef::TypeEnum m_massDef
InfoHelperm_helper
const TString m_name
const Interpolate::TypeEnum m_interpolate
TH1 * m_histo
int m_nDim
std::vector< std::vector< std::unique_ptr< TH1 > > > m_cachedProj
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 18 of file ValidityHistogram.h.

Constructor & Destructor Documentation

◆ ValidityHistogram() [1/4]

jet::ValidityHistogram::ValidityHistogram ( const std::string & histName,
const CompParametrization::TypeEnum parametrization,
const float energyScale,
const CompMassDef::TypeEnum massDef )

Definition at line 280 of file ValidityHistogram.cxx.

282 , m_isInit(false)
283 , m_param(parametrization)
284 , m_energyScale(energyScale)
285 , m_massDef(massDef)
286 , m_helper(nullptr)
287{
288 ATH_MSG_DEBUG(Form("Creating ValidityHistogram named %s",getName().Data()));
289}
#define ATH_MSG_DEBUG(x)
@ Data
Definition BaseObject.h:11
const TString & getName() const
UncertaintyHistogram(const std::string &histName, const Interpolate::TypeEnum interpolate)
const CompMassDef::TypeEnum m_massDef
const CompParametrization::TypeEnum m_param

◆ ValidityHistogram() [2/4]

jet::ValidityHistogram::ValidityHistogram ( const TString & histName,
const CompParametrization::TypeEnum parametrization,
const float energyScale,
const CompMassDef::TypeEnum massDef )

Definition at line 291 of file ValidityHistogram.cxx.

292 : ValidityHistogram(std::string(histName.Data()),parametrization,energyScale,massDef)
293{ }
ValidityHistogram(const std::string &histName, const CompParametrization::TypeEnum parametrization, const float energyScale, const CompMassDef::TypeEnum massDef)

◆ ValidityHistogram() [3/4]

jet::ValidityHistogram::ValidityHistogram ( const char * histName,
const CompParametrization::TypeEnum parametrization,
const float energyScale,
const CompMassDef::TypeEnum massDef )

Definition at line 295 of file ValidityHistogram.cxx.

296 : ValidityHistogram(std::string(histName),parametrization,energyScale,massDef)
297{ }

◆ ValidityHistogram() [4/4]

jet::ValidityHistogram::ValidityHistogram ( const ValidityHistogram & toCopy)

Definition at line 299 of file ValidityHistogram.cxx.

300 : UncertaintyHistogram(toCopy)
301 , m_isInit(toCopy.m_isInit)
302 , m_param(toCopy.m_param)
303 , m_energyScale(toCopy.m_energyScale)
304 , m_massDef(toCopy.m_massDef)
305 , m_helper(nullptr)
306{
307 ATH_MSG_DEBUG("Creating copy of ValidityHistogram named " << getName().Data());
308 m_helper = toCopy.m_helper->clone();
309}

◆ ~ValidityHistogram()

jet::ValidityHistogram::~ValidityHistogram ( )
virtual

Definition at line 311 of file ValidityHistogram.cxx.

Member Function Documentation

◆ cacheProjections()

StatusCode jet::UncertaintyHistogram::cacheProjections ( )
privateinherited

Definition at line 322 of file UncertaintyHistogram.cxx.

323{
324 // Ensure the histogram exists
325 if (!m_histo)
326 {
327 ATH_MSG_FATAL("Cannot cache histogram as it doesn't exist: " << m_name.Data());
328 return StatusCode::FAILURE;
329 }
330
331 // Ensure the number of dimensions is sane
332 if (m_histo->GetDimension() < 1 || m_histo->GetDimension() > 3)
333 {
334 ATH_MSG_FATAL("Unsupported histogram dimensionality for projection caching: " << m_histo->GetDimension());
335 return StatusCode::FAILURE;
336 }
337
338 // Ensure the cache doesn't already exist
339 if (!m_cachedProj.empty())
340 {
341 ATH_MSG_FATAL("Cannot cache histogram as the cache is non-empty: " << m_name.Data());
342 return StatusCode::FAILURE;
343 }
344
345 // Protect vs Interpolate
346 switch (m_interpolate)
347 {
349 // Simple case of 1D
350 if (m_histo->GetDimension() == 1)
351 return StatusCode::SUCCESS;
352 break;
353
355 // Failure case of 1D
356 if (m_histo->GetDimension() == 1)
357 {
358 ATH_MSG_FATAL("Cannot project in Y for a 1D histogram: " << m_name.Data());
359 return StatusCode::FAILURE;
360 }
361 break;
362
363 default:
364 ATH_MSG_FATAL("The interpolation type is not supported for caching: " << m_name.Data());
365 return StatusCode::FAILURE;
366 }
367
368 // If we got here, then the request makes sense
369 // Start the projections
370 // Intentionally include underflow and overflow bins
371 // This keeps the same indexing scheme as root
372 // Avoids confusion and problems later at cost of a small amount of RAM
373 if (m_histo->GetDimension() == 2)
374 {
375 // Prepare to cache
376 TH2* localHist = dynamic_cast<TH2*>(m_histo);
377 m_cachedProj.resize(1); // 2D is a single slice of 3D
378 if (!localHist)
379 {
380 ATH_MSG_FATAL("Failed to convert histogram to a TH2, please check inputs: " << m_name.Data());
381 return StatusCode::FAILURE;
382 }
383
384 // Create the projections
386 {
387 for (Long64_t binY = 0; binY < localHist->GetNbinsY()+1; ++binY)
388 {
389 // Single bin of Y, interpolate across X
390 m_cachedProj.at(0).emplace_back(localHist->ProjectionX(Form("projx_%lld",binY),binY,binY));
391 }
392 }
394 {
395 for (Long64_t binX = 0; binX < localHist->GetNbinsX()+1; ++binX)
396 {
397 // Single bin of X, interpolate across Y
398 m_cachedProj.at(0).emplace_back(localHist->ProjectionY(Form("projy_%lld",binX),binX,binX));
399 }
400 }
401 else
402 {
403 // We shouldn't make it here due to earlier checks
404 ATH_MSG_FATAL("Unexpected interpolation type, somehow escaped earlier checks: " << m_name.Data());
405 return StatusCode::FAILURE;
406 }
407 }
408 else if (m_histo->GetDimension() == 3)
409 {
410 // Prepare to cache
411 TH3* localHist = dynamic_cast<TH3*>(m_histo);
412 if (!localHist)
413 {
414 ATH_MSG_FATAL("Failed to convert histogram to a TH3, please check inputs: " << m_name.Data());
415 return StatusCode::FAILURE;
416 }
417
418 // Create the projections
420 {
421 m_cachedProj.resize(localHist->GetNbinsY()+1); // 3D is a full double-index scan
422 for (Long64_t binY = 0; binY < localHist->GetNbinsY()+1; ++binY)
423 {
424 for (Long64_t binZ = 0; binZ < localHist->GetNbinsZ()+1; ++binZ)
425 {
426 // Single bin of Y-Z, interpolate across X
427 m_cachedProj.at(binY).emplace_back(localHist->ProjectionX(Form("projx_%lld_%lld",binY,binZ),binY,binY,binZ,binZ));
428 }
429 }
430 }
432 {
433 m_cachedProj.resize(localHist->GetNbinsX()+1); // 3D is a full double-index scan
434 for (Long64_t binX = 0; binX < localHist->GetNbinsX()+1; ++binX)
435 {
436 for (Long64_t binZ = 0; binZ < localHist->GetNbinsZ()+1; ++binZ)
437 {
438 // Single bin of X-Z, interpolate across Y
439 m_cachedProj.at(binX).emplace_back(localHist->ProjectionY(Form("projy_%lld_%lld",binX,binZ),binX,binX,binZ,binZ));
440 }
441 }
442 }
443 else
444 {
445 // We shouldn't make it here due to earlier checks
446 ATH_MSG_FATAL("Unexpected interpolation type, somehow escaped earlier checks: " << m_name.Data());
447 return StatusCode::FAILURE;
448 }
449 }
450 else
451 {
452 // We shouldn't make it here due to earlier checks
453 ATH_MSG_FATAL("Unexpected dimensionality: " << m_histo->GetDimension());
454 return StatusCode::FAILURE;
455 }
456
457 // Ensure that ROOT doesn't try to take posession of any of the projections
458 for (size_t index = 0; index < m_cachedProj.size(); ++index)
459 {
460 for (auto& hist : m_cachedProj.at(index))
461 {
462 hist->SetDirectory(nullptr);
463 }
464 }
465
466 // All done
467 return StatusCode::SUCCESS;
468}
#define ATH_MSG_FATAL(x)
std::vector< std::vector< std::unique_ptr< TH1 > > > m_cachedProj
const Interpolate::TypeEnum m_interpolate
str index
Definition DeMoScan.py:362
@ binX
Definition BinningType.h:47
@ binZ
Definition BinningType.h:49
@ binY
Definition BinningType.h:48

◆ checkBoundaries()

double jet::UncertaintyHistogram::checkBoundaries ( const TAxis * axis,
const int numBins,
const double valInput ) const
privateinherited

Definition at line 293 of file UncertaintyHistogram.cxx.

294{
295 const static int maxNumWarn = 0; //100
296 static std::atomic<int> numWarn = 0;
297
298 // Bins are structured for [lowEdge,highEdge)
299 // As such, do not need to worry about equality sign for low edge
300 // However, do need to check equality sign for high edge
301 // High edge is expected and supported (no warning needed)
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)
306 {
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. "
309 "Using closest valid value.",val,lowVal,highVal,getName().Data())
310 << " (Only first " << maxNumWarn << " instances printed, this is " << numWarn << ")");
311
312 // Watch for the boundary sign (controls the scale factor)
313 if (val < lowVal)
314 val = lowVal>0 ? (1.0+1.e-4)*lowVal : (1.0-1.e-4)*lowVal;
315 else
316 val = highVal>0 ? (1.0-1.e-4)*highVal : (1.0+1.e-4)*highVal;
317 }
318
319 return val;
320}
#define ATH_MSG_WARNING(x)

◆ checkBoundariesByBin()

double jet::UncertaintyHistogram::checkBoundariesByBin ( const TAxis * axis,
const int numBins,
const double valInput ) const
privateinherited

Definition at line 270 of file UncertaintyHistogram.cxx.

271{
272 double val = valInput;
273
274 // Root histogram binning:
275 // bin 0 = underflow bin
276 // bin 1 = first actual bin
277 // bin N = last actual bin
278 // bin N+1 = overflow bin
279 const int binIndex = axis->FindBin(valInput);
280 if (binIndex < 1)
281 val = axis->GetBinLowEdge(1);
282 else if (binIndex > numBins)
283 {
284 // Don't use the upper edge as floating point can make it roll into the next bin (which is overflow)
285 // Instead, use the last bin width to go slightly within the boundary
286 // An offset of 1.e-3*binWidth is negligible for physics as the values don't change fast, but above floating point precision
287 val = (1.-1.e-3)*axis->GetBinWidth(numBins)+axis->GetBinLowEdge(numBins);
288 }
289
290 return val;
291}
unsigned int binIndex(const T &val, const std::vector< T > &partitions)
general utility function to return bin index given a value and the upper endpoints of each bin

◆ getHisto()

const TH1 * jet::UncertaintyHistogram::getHisto ( ) const
inlineinherited

Definition at line 37 of file UncertaintyHistogram.h.

37{ return m_histo; }

◆ getInterp()

Interpolate::TypeEnum jet::UncertaintyHistogram::getInterp ( ) const
inlineinherited

Definition at line 38 of file UncertaintyHistogram.h.

38{ return m_interpolate; }

◆ getName()

const TString & jet::UncertaintyHistogram::getName ( ) const
inlineinherited

Definition at line 36 of file UncertaintyHistogram.h.

36{ return m_name; }

◆ getNumDim()

int jet::UncertaintyHistogram::getNumDim ( ) const
inlineinherited

Definition at line 39 of file UncertaintyHistogram.h.

◆ getParam()

CompParametrization::TypeEnum jet::ValidityHistogram::getParam ( ) const
inline

Definition at line 30 of file ValidityHistogram.h.

30{ return m_param; }

◆ getValidity()

bool jet::ValidityHistogram::getValidity ( const xAOD::Jet & jet) const

Definition at line 431 of file ValidityHistogram.cxx.

432{
433 if (!m_isInit)
434 {
435 ATH_MSG_ERROR("You must initialize the ValidityHistogram before calling getIsValid: " << getName().Data());
436 return false;
437 }
438
439 const double validity = m_helper->isValid(jet);
440 if (validity < 1.e-5 && validity > -1.e-5)
441 return false;
442 if (validity < 1+1.e-5 && validity > 1-1.e-5)
443 return true;
444
445 // Validity is neither 0 nor 1
446 ATH_MSG_ERROR("ValidityHistogram \"" << getName().Data() << "\" out of expected range: " << validity);
447 return false;
448}
#define ATH_MSG_ERROR(x)

◆ getValue() [1/3]

double jet::UncertaintyHistogram::getValue ( const double var1) const
inherited

Definition at line 141 of file UncertaintyHistogram.cxx.

142{
143 if (m_nDim != 1)
144 {
145 ATH_MSG_ERROR(Form("Wrong dimensionality - asked for 1D for a %dD histo (%s)",m_nDim,getName().Data()));
146 return false;
147 }
148 return readHisto(var1);
149}
double readHisto(const double var1, const double var2=0, const double var3=0) const

◆ getValue() [2/3]

double jet::UncertaintyHistogram::getValue ( const double var1,
const double var2 ) const
inherited

Definition at line 151 of file UncertaintyHistogram.cxx.

152{
153 if (m_nDim != 2)
154 {
155 ATH_MSG_ERROR(Form("Wrong dimensionality - asked for 2D for a %dD histo (%s)",m_nDim,getName().Data()));
156 return false;
157 }
158 return readHisto(var1,var2);
159}

◆ getValue() [3/3]

double jet::UncertaintyHistogram::getValue ( const double var1,
const double var2,
const double var3 ) const
inherited

Definition at line 161 of file UncertaintyHistogram.cxx.

162{
163 if (m_nDim != 3)
164 {
165 ATH_MSG_ERROR(Form("Wrong dimensionality - asked for 3D for a %dD histo (%s)",m_nDim,getName().Data()));
166 return false;
167 }
168 return readHisto(var1,var2,var3);
169}

◆ initialize()

StatusCode jet::ValidityHistogram::initialize ( TFile * histFile)
virtual

Reimplemented from jet::UncertaintyHistogram.

Definition at line 316 of file ValidityHistogram.cxx.

317{
318 // Ensure it wasn't already initialized
319 if (m_isInit)
320 {
321 ATH_MSG_ERROR("ValidityHistogram was already initialized: " << getName().Data());
322 return StatusCode::FAILURE;
323 }
324
325 // Initialize the base class
326 if (UncertaintyHistogram::initialize(histFile).isFailure())
327 return StatusCode::FAILURE;
328
329 // Ensure that the parametrization is sensible
330 switch (m_param)
331 {
333 ATH_MSG_ERROR("ValidityHistogram parametrization is UNKNOWN: " << getName().Data());
334 return StatusCode::FAILURE;
336 //1D
337 if (getNumDim() != 1)
338 {
339 ATH_MSG_ERROR("ValidityHistogram is " << getNumDim() << "D, but parametrization is 1D: " << CompParametrization::enumToString(m_param).Data());
340 return StatusCode::FAILURE;
341 }
342 break;
349 // 2D
350 if (getNumDim() != 2)
351 {
352 ATH_MSG_ERROR("ValidityHistogram is " << getNumDim() << "D, but parametrization is 2D: " << CompParametrization::enumToString(m_param).Data());
353 return StatusCode::FAILURE;
354 }
355 break;
362 // 3D
363 if (getNumDim() != 3)
364 {
365 ATH_MSG_ERROR("ValidityHistogram is " << getNumDim() << "D, but parametrization is 3D: " << CompParametrization::enumToString(m_param).Data());
366 return StatusCode::FAILURE;
367 }
368 break;
369 default:
370 ATH_MSG_ERROR("ValidityHistogram named \"" << getName().Data() << "\" had an unpexted parametrization: " << CompParametrization::enumToString(m_param).Data());
371 return StatusCode::FAILURE;
372 }
373
374 // Figure out which function helper we want once, right now, so we don't need to switch every time
375 switch (m_param)
376 {
378 m_helper = new InfoHelperPt(*this,m_energyScale);
379 break;
381 m_helper = new InfoHelperPtEta(*this,m_energyScale);
382 break;
384 m_helper = new InfoHelperPtAbsEta(*this,m_energyScale);
385 break;
387 m_helper = new InfoHelperPtAbsMass(*this,m_energyScale,m_massDef);
388 break;
390 m_helper = new InfoHelperPtMass(*this,m_energyScale,m_massDef);
391 break;
393 m_helper = new InfoHelperPtMassEta(*this,m_energyScale,m_massDef);
394 break;
396 m_helper = new InfoHelperPtMassAbsEta(*this,m_energyScale,m_massDef);
397 break;
399 m_helper = new InfoHelperPtAbsMassEta(*this,m_energyScale,m_massDef);
400 break;
402 m_helper = new InfoHelperPtAbsMassAbsEta(*this,m_energyScale,m_massDef);
403 break;
405 m_helper = new InfoHelpereLOGmOe(*this,m_energyScale,m_massDef);
406 break;
408 m_helper = new InfoHelpereLOGmOeEta(*this,m_energyScale,m_massDef);
409 break;
411 m_helper = new InfoHelpereLOGmOeAbsEta(*this,m_energyScale,m_massDef);
412 break;
413 default:
414 ATH_MSG_ERROR("ValidityHistogram named \"" << getName().Data() << "\" was not prepared to handle the provided parametrization: " << CompParametrization::enumToString(m_param).Data());
415 return StatusCode::FAILURE;
416 }
417
418 // Done
419 m_isInit = true;
420 return StatusCode::SUCCESS;
421}
virtual StatusCode initialize(TFile *histFile)
TString enumToString(const TypeEnum type)

◆ 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.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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.

49 {
50#ifndef XAOD_STANDALONE
51 return ::AthMessaging::msg();
52#else // not XAOD_STANDALONE
53 return m_msg;
54#endif // not XAOD_STANDALONE
55 }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level lvl) const
inherited

The standard message stream.

Parameters
lvlThe 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.

57 {
58#ifndef XAOD_STANDALONE
59 return ::AthMessaging::msg( lvl );
60#else // not XAOD_STANDALONE
61 m_msg << lvl;
62 return m_msg;
63#endif // not XAOD_STANDALONE
64 }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe 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.

41 {
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
47 }

◆ readHisto()

double jet::UncertaintyHistogram::readHisto ( const double var1,
const double var2 = 0,
const double var3 = 0 ) const
privateinherited

Definition at line 178 of file UncertaintyHistogram.cxx.

179{
180 // Ensure the component was initialized
181 if (!m_isInit)
182 {
183 ATH_MSG_ERROR(Form("Component was not initialized (%s)",getName().Data()));
184 return JESUNC_ERROR_CODE;
185 }
186
187
188 // Ensure that the histogram exists
189 if (!m_histo)
190 {
191 ATH_MSG_ERROR(Form("Histogram to read is NULL (%s)",getName().Data()));
192 return JESUNC_ERROR_CODE;
193 }
194
195 // Check first dimension boundaries, always applicable
196 const double valX = checkBoundariesByBin(std::as_const(*m_histo).GetXaxis(),m_histo->GetNbinsX(),var1);
197 if (m_nDim == 1)
198 {
199 switch (m_interpolate)
200 {
203 return JetHelpers::Interpolate(m_histo,valX);
204
206 return m_histo->GetBinContent(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX));
207
208 default:
209 ATH_MSG_ERROR("Unsupported histogram interpolation type of \"" << Interpolate::enumToString(m_interpolate).Data() << " for 1D histogram named " << m_name.Data());
210 return JESUNC_ERROR_CODE;
211 }
212 }
213
214 // Check second dimension boundaries, if applicable
215 const double valY = checkBoundariesByBin(std::as_const(*m_histo).GetYaxis(),m_histo->GetNbinsY(),var2);
216 if (m_nDim == 2)
217 {
218 // We need a 2D histogram for the projection calls
219 switch (m_interpolate)
220 {
222 return JetHelpers::Interpolate(m_histo,valX,valY);
223
225 // Interpolate on the x projection for a given Y bin
226 return JetHelpers::Interpolate(m_cachedProj.at(0).at(std::as_const(*m_histo).GetYaxis()->FindFixBin(valY)).get(),valX);
227
229 // Interpolate on the y projection for a given X bin
230 return JetHelpers::Interpolate(m_cachedProj.at(0).at(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX)).get(),valY);
231
233 return m_histo->GetBinContent(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX),
234 std::as_const(*m_histo).GetYaxis()->FindFixBin(valY));
235
236 default:
237 ATH_MSG_ERROR("Unsupported histogram interpolation type of \"" << Interpolate::enumToString(m_interpolate).Data() << " for 1D histogram named " << m_name.Data());
238 return JESUNC_ERROR_CODE;
239 }
240 }
241
242 // Check third dimension boundaries, if applicable
243 const double valZ = checkBoundariesByBin(std::as_const(*m_histo).GetZaxis(),m_histo->GetNbinsZ(),var3);
244
245 switch (m_interpolate)
246 {
248 return JetHelpers::Interpolate(m_histo,valX,valY,valZ);
249
251 // Interpolate on the x projection for a given y,z bin
252 return JetHelpers::Interpolate(m_cachedProj.at(std::as_const(*m_histo).GetYaxis()->FindFixBin(valY)).at(std::as_const(*m_histo).GetZaxis()->FindFixBin(valZ)).get(),valX);
253
255 // Interpolate on the y projection for a given x,z bin
256 return JetHelpers::Interpolate(m_cachedProj.at(std::as_const(*m_histo).GetXaxis()->FindFixBin(valX)).at(std::as_const(*m_histo).GetZaxis()->FindFixBin(valZ)).get(),valY);
257
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));
262
263 default:
264 ATH_MSG_ERROR("Unsupported histogram interpolation type of \"" << Interpolate::enumToString(m_interpolate).Data() << " for 1D histogram named " << m_name.Data());
265 return JESUNC_ERROR_CODE;
266 }
267}
double checkBoundariesByBin(const TAxis *axis, const int numBins, const double valInput) const
double Interpolate(const TH1 *histo, const double x)
TString enumToString(const TypeEnum type)

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_cachedProj

std::vector< std::vector< std::unique_ptr<TH1> > > jet::UncertaintyHistogram::m_cachedProj
privateinherited

Definition at line 56 of file UncertaintyHistogram.h.

◆ m_energyScale

const float jet::ValidityHistogram::m_energyScale
private

Definition at line 39 of file ValidityHistogram.h.

◆ m_helper

InfoHelper* jet::ValidityHistogram::m_helper
private

Definition at line 41 of file ValidityHistogram.h.

◆ m_histo

TH1* jet::UncertaintyHistogram::m_histo
privateinherited

Definition at line 51 of file UncertaintyHistogram.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_interpolate

const Interpolate::TypeEnum jet::UncertaintyHistogram::m_interpolate
privateinherited

Definition at line 50 of file UncertaintyHistogram.h.

◆ m_isInit

bool jet::ValidityHistogram::m_isInit
private

Definition at line 37 of file ValidityHistogram.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_massDef

const CompMassDef::TypeEnum jet::ValidityHistogram::m_massDef
private

Definition at line 40 of file ValidityHistogram.h.

◆ 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
privateinherited

Definition at line 49 of file UncertaintyHistogram.h.

◆ m_nDim

int jet::UncertaintyHistogram::m_nDim
privateinherited

Definition at line 52 of file UncertaintyHistogram.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_param

const CompParametrization::TypeEnum jet::ValidityHistogram::m_param
private

Definition at line 38 of file ValidityHistogram.h.


The documentation for this class was generated from the following files: