MaCh3  2.5.0
Reference Guide
FarDetectorCoreInfoStruct.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 = "";
56 
59 
61  std::vector<std::vector<std::string>> mc_files;
63  std::vector<std::string> spline_files;
64 
66  std::vector<OscChannelInfo> OscChannels;
67 
69  TH1 *DataHist = nullptr;
71  TH1* MCHist = nullptr;
73  TH1* W2Hist = nullptr;
74 };
75 
82 struct EventInfo {
86  EventInfo(EventInfo const &other) = delete;
88  EventInfo(EventInfo &&other) = default;
90  EventInfo& operator=(EventInfo const &other) = delete;
92  EventInfo& operator=(EventInfo &&other) = delete;
95 
97  std::vector<const M3::float_t*> total_weight_pointers;
98 
100  std::vector<const double*> KinVar;
102  std::vector<int> NomBin;
103 
106 
112  bool isNC = false;
113 
118 };
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.
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
Custom exception class used throughout MaCh3.
constexpr static const double _BAD_DOUBLE_
Default value used for double initialisation.
Definition: Core.h:53
constexpr static const int _BAD_INT_
Default value used for int initialisation.
Definition: Core.h:55
Stores info about each MC event used during reweighting routine.
int NominalSample
Nominal sample to which event is associated.
EventInfo & operator=(EventInfo const &other)=delete
Copy assignment operator (deleted).
EventInfo & operator=(EventInfo &&other)=delete
Move assignment operator (deleted).
int nupdgUnosc
PDG of neutrino before oscillation.
std::vector< int > NomBin
starting bins for each dimensions allowing to perform quick lookup
~EventInfo()
default destructor
double coszenith_true
Pointer to true cosine zenith.
EventInfo(EventInfo &&other)=default
Move constructor (defaulted to allow moving).
double enu_true
Pointer to true Neutrino Energy.
EventInfo(EventInfo const &other)=delete
Copy constructor (deleted to prevent copying).
std::vector< const M3::float_t * > total_weight_pointers
Pointers to weights like oscillation spline, normalisation etc.
int nupdg
PDG of neutrino after oscillation.
bool isNC
Is event NC or not.
std::vector< const double * > KinVar
The x_var and y_vars and beyond that you're binning in.
EventInfo()
Default constructor.
KS: Store info about used osc channels.
int InitPDG
PDG of initial flavour.
double ChannelIndex
In case experiment specific would like to have pointer to channel after using GetOscChannel,...
int FinalPDG
PDG of oscillated/final flavour.
std::string flavourName
Name of osc channel.
std::string flavourName_Latex
Fancy channel name (e.g., LaTeX formatted)
KS: Store info about MC sample.
TH1 * W2Hist
histogram used for plotting storing W2 distribution
TH1 * DataHist
histogram used for plotting storing data distribution
int nDimensions
Keep track of the dimensions of the sample binning.
std::vector< OscChannelInfo > OscChannels
Stores info about oscillation channel for a single sample.
~SampleInfo()
Destructor.
SampleInfo()=default
Default constructor.
std::vector< std::string > VarStr
the strings associated with the variables used for the binning e.g. "RecoNeutrinoEnergy"
std::string SampleTitle
the name of this sample e.g."muon-like"
std::vector< std::string > spline_files
names of spline files associated associated with this object
TH1 * MCHist
histogram used for plotting storing MC distribution
std::vector< std::vector< std::string > > mc_files
names of mc files associated associated with this object