MaCh3  2.4.2
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::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  const int* Target = 0;
99  const int* nupdg = 0;
101  const int* nupdgUnosc = 0;
102 
104  const double* rw_etru = &M3::_BAD_DOUBLE_;
106  const double* rw_truecz = &M3::_BAD_DOUBLE_;
107 
109  std::vector<const double*> norm_pointers;
110 
112  std::vector<const M3::float_t*> total_weight_pointers;
113 
115  std::vector<const double*> KinVar;
117  std::vector<int> NomBin;
118 
122  bool isNC = false;
123 
125  const double* mode = &M3::Unity_D;
126 };
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
constexpr static const double Unity_D
Some commonly used variables to which we set pointers to.
Definition: Core.h:59
Stores info about each MC event used during reweighting routine.
const int * nupdg
PDG of neutrino after oscillation.
int NominalSample
Nominal sample to which event is associated.
std::vector< const double * > norm_pointers
Pointers to normalisation weights which are being taken from Parameter Handler.
EventInfo & operator=(EventInfo const &other)=delete
Copy assignment operator (deleted).
EventInfo & operator=(EventInfo &&other)=delete
Move assignment operator (deleted).
std::vector< int > NomBin
starting bins for each dimensions allowing to perform quick lookup
~EventInfo()
default destructor
const double * mode
Pointer to MaCh3 mode.
EventInfo(EventInfo &&other)=default
Move constructor (defaulted to allow moving).
const double * rw_etru
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 etc.
bool isNC
Is event NC or not.
const int * Target
target the interaction was on
const int * nupdgUnosc
PDG of neutrino before oscillation.
std::vector< const double * > KinVar
The x_var and y_vars and beyond that you're binning in.
const double * rw_truecz
Pointer to true cosine zenith.
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 > mc_files
names of mc files associated associated with this object
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