MaCh3  2.5.1
Reference Guide
SampleInfo.h
Go to the documentation of this file.
1 #pragma once
2 #include <vector>
3 #include <string>
4 
6 
8 struct OscChannelInfo {
10  std::string flavourName;
12  std::string flavourName_Latex;
13 
15  int InitPDG;
17  int FinalPDG;
18 
20  double ChannelIndex;
21 };
22 
28 inline int GetOscChannel(const std::vector<OscChannelInfo>& OscChannel, const int InitFlav, const int FinalFlav) {
29  for (size_t i = 0; i < OscChannel.size(); ++i) {
30  if (InitFlav == OscChannel[i].InitPDG && FinalFlav == OscChannel[i].FinalPDG) {
31  return static_cast<int>(OscChannel[i].ChannelIndex);
32  }
33  }
34 
35  MACH3LOG_ERROR("Didn't find Osc channel for InitFlav = {}, FinalFlav = {}", InitFlav, FinalFlav);
36  throw MaCh3Exception(__FILE__, __LINE__);
37 }
38 
40 struct SampleInfo {
42  SampleInfo() = default;
43 
46  if(DataHist != nullptr) delete DataHist;
47  if(MCHist != nullptr) delete MCHist;
48  if(W2Hist != nullptr) delete W2Hist;
49  }
50 
52  std::vector<std::string> VarStr;
53 
55  std::string SampleTitle = "";
57  std::string SampleName = "";
58 
61 
63  std::vector<std::vector<std::string>> mc_files;
65  std::vector<std::string> spline_files;
66 
68  std::vector<OscChannelInfo> OscChannels;
69 
71  TH1 *DataHist = nullptr;
73  TH1* MCHist = nullptr;
75  TH1* W2Hist = nullptr;
76 };
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
int GetOscChannel(const std::vector< OscChannelInfo > &OscChannel, const int InitFlav, const int FinalFlav)
KS: Get Osc Channel Index based on initial and final PDG codes.
Definition: SampleInfo.h:28
Custom exception class used throughout MaCh3.
constexpr static const int _BAD_INT_
Default value used for int initialisation.
Definition: Core.h:55
KS: Store info about used osc channels.
Definition: SampleInfo.h:8
int InitPDG
PDG of initial flavour.
Definition: SampleInfo.h:15
double ChannelIndex
In case experiment specific would like to have pointer to channel after using GetOscChannel,...
Definition: SampleInfo.h:20
int FinalPDG
PDG of oscillated/final flavour.
Definition: SampleInfo.h:17
std::string flavourName
Name of osc channel.
Definition: SampleInfo.h:10
std::string flavourName_Latex
Fancy channel name (e.g., LaTeX formatted)
Definition: SampleInfo.h:12
KS: Store info about MC sample.
Definition: SampleInfo.h:40
TH1 * W2Hist
histogram used for plotting storing W2 distribution
Definition: SampleInfo.h:75
std::string SampleName
tag for sample used to easily set by which uncertainties should be affected
Definition: SampleInfo.h:57
TH1 * DataHist
histogram used for plotting storing data distribution
Definition: SampleInfo.h:71
int nDimensions
Keep track of the dimensions of the sample binning.
Definition: SampleInfo.h:60
std::vector< OscChannelInfo > OscChannels
Stores info about oscillation channel for a single sample.
Definition: SampleInfo.h:68
~SampleInfo()
Destructor.
Definition: SampleInfo.h:45
SampleInfo()=default
Default constructor.
std::vector< std::string > VarStr
the strings associated with the variables used for the binning e.g. "RecoNeutrinoEnergy"
Definition: SampleInfo.h:52
std::string SampleTitle
the name of this sample e.g."muon-like" used for printing
Definition: SampleInfo.h:55
std::vector< std::string > spline_files
names of spline files associated associated with this object
Definition: SampleInfo.h:65
TH1 * MCHist
histogram used for plotting storing MC distribution
Definition: SampleInfo.h:73
std::vector< std::vector< std::string > > mc_files
names of mc files associated associated with this object
Definition: SampleInfo.h:63