Public Member Functions | Public Attributes | List of all members
cmf::MetaData Struct Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/CovarianceMatrixFit/dataProducts/Structs.h"

Public Member Functions

 MetaData ()
 
 MetaData (bool const &mc, cmf::DetType_t const &det, cmf::FileType_t const &ft, cmf::SelectionType_t const &st, cmf::InteractionType_t const &it, std::string const &ep)
 
 MetaData (bool const &mc, cmf::DetType_t const &det, cmf::FileType_t const &ft, cmf::SelectionType_t const &st, cmf::InteractionType_t const &it, int const &ep)
 
long MCKey () const
 
long DetectorKey () const
 
long PeriodKey () const
 
long FileKey () const
 
long SelectionKey () const
 
long InteractionKey () const
 
long BeamTypeKey () const
 
long DetectorBeamSelectionKey () const
 
long Period () const
 
long Key () const
 
std::string PeriodString () const
 
std::string DetectorString () const
 
std::string ToString () const
 
std::string ToStringLatex () const
 
std::string DetectorFilePeriodString () const
 
bool IsNuMuSelected () const
 
bool IsNuMuQuantiles () const
 
bool IsNuESelected () const
 
bool IsNCSelected () const
 
bool IsCosmicMuon () const
 
bool IsRockMuon () const
 
cmf::BeamType_t BeamType () const
 
cmf::MetaDataLite LiteMD () const
 
bool operator== (MetaData const &other) const
 
bool operator< (MetaData const &other) const
 

Public Attributes

bool isMC
 
cmf::DetType_t detector
 
cmf::FileType_t fileType
 
cmf::SelectionType_t selectionType
 
cmf::InteractionType_t interactionType
 
long period
 

Detailed Description

Definition at line 95 of file Structs.h.

Constructor & Destructor Documentation

cmf::MetaData::MetaData ( )

Definition at line 86 of file Structs.cxx.

87  : isMC (false)
92  , period (0)
93  {}
cmf::DetType_t detector
Definition: Structs.h:114
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::FileType_t fileType
Definition: Structs.h:115
long period
Definition: Structs.h:118
cmf::InteractionType_t interactionType
Definition: Structs.h:117
cmf::MetaData::MetaData ( bool const &  mc,
cmf::DetType_t const &  det,
cmf::FileType_t const &  ft,
cmf::SelectionType_t const &  st,
cmf::InteractionType_t const &  it,
std::string const &  ep 
)

Definition at line 96 of file Structs.cxx.

References period, and cmf::PeriodStringToInt().

102  : isMC (mc)
103  , detector (det)
104  , fileType (ft)
105  , selectionType (st)
107  {
109  }
set< int >::iterator it
cmf::DetType_t detector
Definition: Structs.h:114
long PeriodStringToInt(std::string const &epochStr)
Definition: Structs.cxx:67
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::FileType_t fileType
Definition: Structs.h:115
long period
Definition: Structs.h:118
cmf::InteractionType_t interactionType
Definition: Structs.h:117
cmf::MetaData::MetaData ( bool const &  mc,
cmf::DetType_t const &  det,
cmf::FileType_t const &  ft,
cmf::SelectionType_t const &  st,
cmf::InteractionType_t const &  it,
int const &  ep 
)

Definition at line 112 of file Structs.cxx.

118  : isMC (mc)
119  , detector (det)
120  , fileType (ft)
121  , selectionType (st)
123  , period (ep)
124  {}
set< int >::iterator it
cmf::DetType_t detector
Definition: Structs.h:114
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::FileType_t fileType
Definition: Structs.h:115
long period
Definition: Structs.h:118
cmf::InteractionType_t interactionType
Definition: Structs.h:117

Member Function Documentation

cmf::BeamType_t cmf::MetaData::BeamType ( ) const

Definition at line 178 of file Structs.cxx.

References POTSpillRate::beam, LOG_DEBUG, period, PeriodString(), and cmf::PeriodToBeamType().

Referenced by cmf::ShifterAndWeighter::BeamSystWeight(), cmf::GeniePCASyst::CalcGeniePCASystWeights(), cmf::CalibSyst::CalibSystRatio(), DetectorBeamSelectionKey(), cmf::EventListManipulator::FillTextFile(), cmf::ShifterAndWeighter::FluxPCAWeight(), cmf::ShifterAndWeighter::HornNormWeight(), cmf::PlotUtilities::MakeEnergySpectraFromBins(), cmf::ShifterAndWeighter::NueAcceptBkg2018Weight(), cmf::ShifterAndWeighter::NueAcceptSignalKin2018Weight(), cmf::RecoEnergy(), ToString(), and ToStringLatex().

179  {
180 
181  // NOvA Period and Epoch naming scheme from:
182  // https://cdcvs.fnal.gov/redmine/projects/novaart/wiki/Period_and_Epoch_Naming
184 
185  LOG_DEBUG("UnknownBeamType")
186  << "period : "
187  << period
188  << " Cannot identify beam type";
189 
190  return beam;
191  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::string PeriodString() const
Definition: Structs.h:162
static cmf::BeamType_t PeriodToBeamType(std::string const &str)
enum cmf::beam_type BeamType_t
long period
Definition: Structs.h:118
long cmf::MetaData::BeamTypeKey ( ) const
inline

Definition at line 126 of file Structs.h.

References cmf::BeamTypeKey().

126 { return cmf::BeamTypeKey(this->BeamType()); }
cmf::BeamType_t BeamType() const
Definition: Structs.cxx:178
static long BeamTypeKey(cmf::BeamType_t const &bt)
Definition: StaticFuncs.h:22
long cmf::MetaData::DetectorBeamSelectionKey ( ) const

Definition at line 194 of file Structs.cxx.

References BeamType(), detector, cmf::DetectorBeamSelectionTypesToKey(), and selectionType.

Referenced by cmf::FillSpectrumFromSingleList(), and makeInitialDecorrelatedErrorPlot().

195  {
197  }
cmf::DetType_t detector
Definition: Structs.h:114
static long DetectorBeamSelectionTypesToKey(cmf::DetType_t const &det, cmf::BeamType_t const &bt, cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:62
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::BeamType_t BeamType() const
Definition: Structs.cxx:178
std::string cmf::MetaData::DetectorFilePeriodString ( ) const
inline

Definition at line 168 of file Structs.h.

References cmf::cFileTypeStrings, and mkDefs::fileType.

169  {
170  return (this->DetectorString() +
172  this->PeriodString());
173  }
std::string PeriodString() const
Definition: Structs.h:162
std::string DetectorString() const
Definition: Structs.h:151
const std::string cFileTypeStrings[10]
Definition: Constants.h:163
cmf::FileType_t fileType
Definition: Structs.h:115
long cmf::MetaData::DetectorKey ( ) const
inline

Definition at line 121 of file Structs.h.

References cmf::DetectorTypeKey().

Referenced by Key().

121 { return cmf::DetectorTypeKey(detector); }
cmf::DetType_t detector
Definition: Structs.h:114
static long DetectorTypeKey(cmf::DetType_t const &det)
Definition: StaticFuncs.h:19
std::string cmf::MetaData::DetectorString ( ) const
inline

Definition at line 151 of file Structs.h.

References cmf::cDetType_Strings, runNovaSAM::detector, and elec2geo::pos.

Referenced by cmf::CalibSyst::CalibSystRatio(), cmf::EventListManipulator::FillTextFile(), cmf::PlotUtilities::MakeEnergySpectraFromBins(), ToString(), and cmf::EventListManipulator::UseEventsFromMetaData().

152  {
153  // for backwards compatibility with previously made files we will
154  // strip the "Det" off the name returned by the novadaq function
156  auto pos = name.find("Det");
157 
158  return (pos != std::string::npos) ? name.erase(pos, 3) : name;
159  }
const XML_Char * name
Definition: expat.h:151
cmf::DetType_t detector
Definition: Structs.h:114
const std::string cDetType_Strings[5]
Definition: Constants.h:592
long cmf::MetaData::FileKey ( ) const
inline

Definition at line 123 of file Structs.h.

References cmf::FileTypeKey().

Referenced by Key().

123 { return cmf::FileTypeKey(fileType); }
cmf::FileType_t fileType
Definition: Structs.h:115
static long FileTypeKey(cmf::FileType_t const &ft)
Definition: StaticFuncs.h:21
long cmf::MetaData::InteractionKey ( ) const
inline

Definition at line 125 of file Structs.h.

References cmf::InteractionTypeKey().

Referenced by Key().

static long InteractionTypeKey(cmf::InteractionType_t const &it)
Definition: StaticFuncs.h:24
cmf::InteractionType_t interactionType
Definition: Structs.h:117
bool cmf::MetaData::IsCosmicMuon ( ) const
inline
bool cmf::MetaData::IsNCSelected ( ) const
bool cmf::MetaData::IsNuESelected ( ) const
bool cmf::MetaData::IsNuMuQuantiles ( ) const

Definition at line 213 of file Structs.cxx.

References cmf::IsNuMuQuantiles(), and selectionType.

214  {
215  return cmf::IsNuMuQuantiles(this->selectionType);
216  }
static bool IsNuMuQuantiles(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:369
cmf::SelectionType_t selectionType
Definition: Structs.h:116
bool cmf::MetaData::IsNuMuSelected ( ) const
bool cmf::MetaData::IsRockMuon ( ) const
inline
long cmf::MetaData::Key ( ) const

Definition at line 200 of file Structs.cxx.

References DetectorKey(), FileKey(), InteractionKey(), MCKey(), PeriodKey(), and SelectionKey().

Referenced by IsNCSelected().

201  {
202  return ( this->MCKey() *
203  (this->DetectorKey() +
204  this->FileKey() +
205  this->SelectionKey() +
206  this->InteractionKey() +
207  this->PeriodKey()
208  )
209  );
210  }
long DetectorKey() const
Definition: Structs.h:121
long PeriodKey() const
Definition: Structs.h:122
long SelectionKey() const
Definition: Structs.h:124
long MCKey() const
Definition: Structs.h:120
long FileKey() const
Definition: Structs.h:123
long InteractionKey() const
Definition: Structs.h:125
cmf::MetaDataLite cmf::MetaData::LiteMD ( ) const

Definition at line 127 of file Structs.cxx.

References detector, Period(), and selectionType.

128  {
129  return MetaDataLite(this->detector, this->selectionType, this->Period());
130  }
long Period() const
Definition: Structs.h:128
cmf::DetType_t detector
Definition: Structs.h:114
cmf::SelectionType_t selectionType
Definition: Structs.h:116
long cmf::MetaData::MCKey ( ) const
inline

Definition at line 120 of file Structs.h.

Referenced by Key().

120 { return ((isMC) ? 1 : -1); }
bool cmf::MetaData::operator< ( MetaData const &  other) const

Referenced by IsNCSelected().

bool cmf::MetaData::operator== ( MetaData const &  other) const

Referenced by IsNCSelected().

long cmf::MetaData::Period ( ) const
inline
long cmf::MetaData::PeriodKey ( ) const
inline

Definition at line 122 of file Structs.h.

References cmf::PeriodKey().

Referenced by Key().

122 { return cmf::PeriodKey(period); }
static long PeriodKey(long const &ep)
Definition: StaticFuncs.h:20
long period
Definition: Structs.h:118
std::string cmf::MetaData::PeriodString ( ) const
inline
long cmf::MetaData::SelectionKey ( ) const
inline

Definition at line 124 of file Structs.h.

References cmf::SelectionTypeKey().

Referenced by Key().

static long SelectionTypeKey(cmf::SelectionType_t const &st)
Definition: StaticFuncs.h:23
cmf::SelectionType_t selectionType
Definition: Structs.h:116
std::string cmf::MetaData::ToString ( ) const

Definition at line 133 of file Structs.cxx.

References BeamType(), cmf::cBeamType_Strings, cmf::cFileTypeStrings, cmf::cInteractionType_Strings, cmf::cSelectionType_Strings, DetectorString(), fileType, interactionType, isMC, PeriodString(), selectionType, and string.

Referenced by cmf::EventListManipulator::Deserialize(), cmf::CAFToEventList::endJob(), cmf::EventListManipulator::ExtractFromFile(), cmf::EventListManipulator::FillEventList(), cmf::FillSpectrumFromSingleList(), cmf::CovarianceFitHelper::MakeDataMCCanv(), cmf::EventListManipulator::PeriodEventCap(), cmf::SerializeEventListColl(), cmf::ShifterAndWeighter::SetCurrentEvent(), and cmf::EventListManipulator::UseEventsFromMetaData().

134  {
135  std::string outType = (this->DetectorString() +
136  this->PeriodString() +
138 
139  if(this->isMC){
140  outType.insert(0, "MC");
141  outType += cmf::cFileTypeStrings[fileType];
142  }
143  else
144  outType.insert(0, "Data");
145 
147 
148  // this is not grouped with the other MC test to have the interaction type
149  // be the last thing in the string
150  if(this->isMC)
152 
153  return outType;
154  }
const std::string cSelectionType_Strings[12]
Definition: Constants.h:79
std::string PeriodString() const
Definition: Structs.h:162
std::string DetectorString() const
Definition: Structs.h:151
const std::string cInteractionType_Strings[11]
Definition: Constants.h:136
const std::string cFileTypeStrings[10]
Definition: Constants.h:163
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::FileType_t fileType
Definition: Structs.h:115
cmf::BeamType_t BeamType() const
Definition: Structs.cxx:178
cmf::InteractionType_t interactionType
Definition: Structs.h:117
const std::string cBeamType_Strings[4]
Definition: Constants.h:35
enum BeamMode string
std::string cmf::MetaData::ToStringLatex ( ) const

Definition at line 157 of file Structs.cxx.

References BeamType(), cmf::cBeamType_LatexStrings, cmf::cFileTypeStrings_Latex, cmf::cInteractionType_LatexStrings, cmf::cSelectionType_LatexStrings, detector, fileType, interactionType, isMC, cmf::kFARDET, cmf::kNEARDET, PeriodString(), selectionType, and string.

158  {
159  std::string outType("Data");
160  if(this->isMC){
161  outType = "MC";
162  outType += " " + cmf::cFileTypeStrings_Latex[fileType];
165  }
166  if(detector == cmf::kFARDET) outType += " FD";
167  if(detector == cmf::kNEARDET) outType += " ND";
168 
169  outType += this->PeriodString();
170 
171  outType += " " + cmf::cBeamType_LatexStrings[this->BeamType()];
172 
173  return outType;
174  }
cmf::DetType_t detector
Definition: Structs.h:114
std::string PeriodString() const
Definition: Structs.h:162
const std::string cFileTypeStrings_Latex[10]
Definition: Constants.h:174
const std::string cInteractionType_LatexStrings[11]
Definition: Constants.h:124
cmf::SelectionType_t selectionType
Definition: Structs.h:116
cmf::FileType_t fileType
Definition: Structs.h:115
cmf::BeamType_t BeamType() const
Definition: Structs.cxx:178
const std::string cBeamType_LatexStrings[4]
Definition: Constants.h:40
cmf::InteractionType_t interactionType
Definition: Structs.h:117
const std::string cSelectionType_LatexStrings[12]
Definition: Constants.h:92
enum BeamMode string

Member Data Documentation

cmf::DetType_t cmf::MetaData::detector
cmf::FileType_t cmf::MetaData::fileType
cmf::InteractionType_t cmf::MetaData::interactionType
bool cmf::MetaData::isMC
long cmf::MetaData::period
cmf::SelectionType_t cmf::MetaData::selectionType

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