MaCh3  2.2.3
Reference Guide
Public Member Functions | Public Attributes | List of all members
SampleInfo Struct Reference

KS: Store info about MC sample. More...

#include <Samples/FarDetectorCoreInfoStruct.h>

Collaboration diagram for SampleInfo:
[legend]

Public Member Functions

 SampleInfo ()=default
 Default constructor. More...
 
 ~SampleInfo ()
 Destructor. More...
 
void InitialiseHistograms ()
 Initialise histograms used for plotting. More...
 

Public Attributes

std::string XVarStr = ""
 the strings associated with the variables used for the X binning e.g. "RecoNeutrinoEnergy" More...
 
std::string YVarStr = ""
 the strings associated with the variables used for the Y binning e.g. "RecoNeutrinoEnergy" More...
 
std::string SampleTitle = ""
 the name of this sample e.g."muon-like" More...
 
int nDimensions = M3::_BAD_INT_
 Keep track of the dimensions of the sample binning. More...
 
TH1D * dathist = nullptr
 histogram used for plotting storing 1D data distribution More...
 
TH2D * dathist2d = nullptr
 histogram used for plotting storing 2D data distribution More...
 
TH1D * _hPDF1D = nullptr
 histogram used for plotting storing 1D MC distribution More...
 
TH2D * _hPDF2D = nullptr
 histogram used for plotting storing 2D MC distribution More...
 

Detailed Description

KS: Store info about MC sample.

Definition at line 40 of file FarDetectorCoreInfoStruct.h.

Constructor & Destructor Documentation

◆ SampleInfo()

SampleInfo::SampleInfo ( )
default

Default constructor.

◆ ~SampleInfo()

SampleInfo::~SampleInfo ( )
inline

Destructor.

Definition at line 45 of file FarDetectorCoreInfoStruct.h.

45  {
46  if(dathist != nullptr) delete dathist;
47  if(dathist2d != nullptr) delete dathist2d;
48  if(_hPDF1D != nullptr) delete _hPDF1D;
49  if(_hPDF2D != nullptr) delete _hPDF2D;
50  }
TH1D * _hPDF1D
histogram used for plotting storing 1D MC distribution
TH2D * _hPDF2D
histogram used for plotting storing 2D MC distribution
TH2D * dathist2d
histogram used for plotting storing 2D data distribution
TH1D * dathist
histogram used for plotting storing 1D data distribution

Member Function Documentation

◆ InitialiseHistograms()

void SampleInfo::InitialiseHistograms ( )
inline

Initialise histograms used for plotting.

Definition at line 74 of file FarDetectorCoreInfoStruct.h.

74  {
75  TString histname1d = (XVarStr).c_str();
76  TString histname2d = (XVarStr + "_" + YVarStr).c_str();
77  TString histtitle = SampleTitle;
78 
79  //The binning here is arbitrary, now we get info from cfg so the
80  //set1DBinning and set2Dbinning calls below will make the binning
81  //to be what we actually want
82  _hPDF1D = new TH1D("h" + histname1d + SampleTitle, histtitle, 1, 0, 1);
83  dathist = new TH1D("d" + histname1d + SampleTitle, histtitle, 1, 0, 1);
84  _hPDF2D = new TH2D("h" + histname2d + SampleTitle, histtitle, 1, 0, 1, 1, 0, 1);
85  dathist2d = new TH2D("d" + histname2d + SampleTitle, histtitle, 1, 0, 1, 1, 0, 1);
86 
87  _hPDF1D->GetXaxis()->SetTitle(XVarStr.c_str());
88  dathist->GetXaxis()->SetTitle(XVarStr.c_str());
89  _hPDF2D->GetXaxis()->SetTitle(XVarStr.c_str());
90  dathist2d->GetXaxis()->SetTitle(XVarStr.c_str());
91  }
std::string XVarStr
the strings associated with the variables used for the X binning e.g. "RecoNeutrinoEnergy"
std::string SampleTitle
the name of this sample e.g."muon-like"
std::string YVarStr
the strings associated with the variables used for the Y binning e.g. "RecoNeutrinoEnergy"

Member Data Documentation

◆ _hPDF1D

TH1D* SampleInfo::_hPDF1D = nullptr

histogram used for plotting storing 1D MC distribution

Definition at line 69 of file FarDetectorCoreInfoStruct.h.

◆ _hPDF2D

TH2D* SampleInfo::_hPDF2D = nullptr

histogram used for plotting storing 2D MC distribution

Definition at line 71 of file FarDetectorCoreInfoStruct.h.

◆ dathist

TH1D* SampleInfo::dathist = nullptr

histogram used for plotting storing 1D data distribution

Definition at line 64 of file FarDetectorCoreInfoStruct.h.

◆ dathist2d

TH2D* SampleInfo::dathist2d = nullptr

histogram used for plotting storing 2D data distribution

Definition at line 66 of file FarDetectorCoreInfoStruct.h.

◆ nDimensions

int SampleInfo::nDimensions = M3::_BAD_INT_

Keep track of the dimensions of the sample binning.

Definition at line 61 of file FarDetectorCoreInfoStruct.h.

◆ SampleTitle

std::string SampleInfo::SampleTitle = ""

the name of this sample e.g."muon-like"

Definition at line 58 of file FarDetectorCoreInfoStruct.h.

◆ XVarStr

std::string SampleInfo::XVarStr = ""

the strings associated with the variables used for the X binning e.g. "RecoNeutrinoEnergy"

Definition at line 53 of file FarDetectorCoreInfoStruct.h.

◆ YVarStr

std::string SampleInfo::YVarStr = ""

the strings associated with the variables used for the Y binning e.g. "RecoNeutrinoEnergy"

Definition at line 55 of file FarDetectorCoreInfoStruct.h.


The documentation for this struct was generated from the following file: