MaCh3  2.5.1
Reference Guide
Functions
BinnedSplineHandler.cpp File Reference
#include "BinnedSplineHandler.h"
#include <memory>
#include "TROOT.h"
#include "TKey.h"
#include "TH3F.h"
Include dependency graph for BinnedSplineHandler.cpp:

Go to the source code of this file.

Functions

int GetSplineIndex (const std::vector< SplineIndex > &vec, const int sample, const int oscchan, const int syst, const int mode, const int var1bin, const int var2bin, const int var3bin)
 

Function Documentation

◆ GetSplineIndex()

int GetSplineIndex ( const std::vector< SplineIndex > &  vec,
const int  sample,
const int  oscchan,
const int  syst,
const int  mode,
const int  var1bin,
const int  var2bin,
const int  var3bin 
)
Todo:
KS: quoting Dan: I imagine all splines are loaded such that they are sequential in varbins etc. so we could optimise this finding function.

Definition at line 447 of file BinnedSplineHandler.cpp.

449  {
450 //****************************************
452  for (size_t i = 0; i < vec.size(); i++)
453  {
454  const auto& entry = vec[i];
455  if (entry.iSample == sample &&
456  entry.iOscChan == oscchan &&
457  entry.iSyst == syst &&
458  entry.iMode == mode &&
459  entry.iVar1 == var1bin &&
460  entry.iVar2 == var2bin &&
461  entry.iVar3 == var3bin)
462  {
463  return static_cast<int>(i);
464  }
465  }
466 
467  MACH3LOG_ERROR("Index not found! sample={} oscchan={} syst={} mode={} var1={} var2={} var3={}",
468  sample, oscchan, syst, mode, var1bin, var2bin, var3bin);
469  throw MaCh3Exception(__FILE__, __LINE__);
470 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
Custom exception class used throughout MaCh3.