Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
cmf::DataVarVals Class Reference

Base container for the MC related Vars that constitute an event. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/CovarianceMatrixFit/core/VarVals.h"

Public Member Functions

 DataVarVals ()=default
 
 DataVarVals (cmf::DataVars const &dv)
 
float val_at (uint8_t const &varkey, cmf::MetaData const &md) const
 
void set_val_at (uint8_t const &varkey, float const &val)
 
cmf::DataVars const & DataVars () const
 

Private Member Functions

float NuRecoEVal (cmf::MetaData const &md) const
 

Private Attributes

cmf::DataVars fDataVars
 

Friends

std::ostream & operator<< (std::ostream &o, cmf::DataVarVals const &dvv)
 

Detailed Description

Base container for the MC related Vars that constitute an event.

Definition at line 383 of file VarVals.h.

Constructor & Destructor Documentation

cmf::DataVarVals::DataVarVals ( )
default
cmf::DataVarVals::DataVarVals ( cmf::DataVars const &  dv)
inline

Definition at line 394 of file VarVals.h.

References msf_helper::o, cmf::operator<<(), and febshutoff_auto::val.

395  : fDataVars(dv)
396  {}
cmf::DataVars fDataVars
Definition: VarVals.h:389

Member Function Documentation

cmf::DataVars const& cmf::DataVarVals::DataVars ( ) const
inline
float cmf::DataVarVals::NuRecoEVal ( cmf::MetaData const &  md) const
inlineprivate

Definition at line 207 of file VarVals.cxx.

References cmf::RecoEnergy().

208  {
211  md);
212  }
cmf::DataVars fDataVars
Definition: VarVals.h:389
static float RecoEnergy(float leptonicEnergy, float hadronicEnergy, cmf::MetaData const &md)
Definition: VarVals.h:453
float fHad_RecoE
Definition: VarVals.h:127
float fLep_RecoE
Definition: VarVals.h:128
void cmf::DataVarVals::set_val_at ( uint8_t const &  varkey,
float const &  val 
)

Definition at line 189 of file VarVals.cxx.

References cmf::KeyToVarName(), cmf::kFake_Weight, cmf::kHad_RecoE, cmf::kLep_RecoE, cmf::kLep_RecoE_MCFrac, cmf::kNuE_CVN, cmf::kNuE_NumMichel, cmf::kRecoQ2, LOG_DEBUG, and febshutoff_auto::val.

Referenced by cmf::CAFToEventList::FillDataVarVals().

191  {
192  if (varkey == kNuE_CVN ) fDataVars.fNuE_CVN = val;
193  else if(varkey == kNuE_NumMichel ) fDataVars.fNuE_NumMichel = val;
194  else if(varkey == kHad_RecoE ) fDataVars.fHad_RecoE = val;
195  else if(varkey == kLep_RecoE ) fDataVars.fLep_RecoE = val;
196  else if(varkey == kLep_RecoE_MCFrac) fDataVars.fLep_RecoE_MCFrac = val;
197  else if(varkey == kRecoQ2 ) fDataVars.fRecoQ2 = val;
198  else if(varkey == kFake_Weight ) fDataVars.fFake_Weight = val;
199  else
200  LOG_DEBUG("DataVarVals")
201  << "unable to set Data var "
202  << cmf::KeyToVarName(varkey)
203  << " because the key is unknown";
204  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:131
float fRecoQ2
reconstructed Q^2
Definition: VarVals.h:130
float fNuE_CVN
Definition: VarVals.h:125
float fLep_RecoE_MCFrac
fraction of leptonic energy in muon catcher
Definition: VarVals.h:129
cmf::DataVars fDataVars
Definition: VarVals.h:389
float fNuE_NumMichel
Definition: VarVals.h:126
float fHad_RecoE
Definition: VarVals.h:127
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:654
float fLep_RecoE
Definition: VarVals.h:128
float cmf::DataVarVals::val_at ( uint8_t const &  varkey,
cmf::MetaData const &  md 
) const

Access a Var by name. Throws if the var doesn't exist

Definition at line 173 of file VarVals.cxx.

References cmf::kFake_Weight, cmf::kHad_RecoE, cmf::kLep_RecoE, cmf::kLep_RecoE_MCFrac, cmf::kNu_RecoE, cmf::kNuE_CVN, cmf::kNuE_NumMichel, and cmf::kRecoQ2.

Referenced by cmf::ShifterAndWeighter::CalibSystWeight(), cmf::EventListManipulator::FillEventList(), cmf::ShifterAndWeighter::GeniePCASystWeight(), cmf::ShifterAndWeighter::NueAcceptSignalKin2018Weight(), cmf::operator<<(), and cmf::ShifterAndWeighter::ShiftForParameter().

175  {
176  if (varkey == kNuE_CVN ) return fDataVars.fNuE_CVN;
177  else if(varkey == kNuE_NumMichel ) return fDataVars.fNuE_NumMichel;
178  else if(varkey == kHad_RecoE ) return fDataVars.fHad_RecoE;
179  else if(varkey == kLep_RecoE ) return fDataVars.fLep_RecoE;
180  else if(varkey == kLep_RecoE_MCFrac) return fDataVars.fLep_RecoE_MCFrac;
181  else if(varkey == kRecoQ2 ) return fDataVars.fRecoQ2;
182  else if(varkey == kFake_Weight ) return fDataVars.fFake_Weight;
183  else if(varkey == kNu_RecoE ) return this->NuRecoEVal(md);
184 
185  return std::numeric_limits<float>::lowest();
186  }
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:131
float fRecoQ2
reconstructed Q^2
Definition: VarVals.h:130
float fNuE_CVN
Definition: VarVals.h:125
float fLep_RecoE_MCFrac
fraction of leptonic energy in muon catcher
Definition: VarVals.h:129
cmf::DataVars fDataVars
Definition: VarVals.h:389
float fNuE_NumMichel
Definition: VarVals.h:126
float fHad_RecoE
Definition: VarVals.h:127
float NuRecoEVal(cmf::MetaData const &md) const
Definition: VarVals.cxx:207
float fLep_RecoE
Definition: VarVals.h:128

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
cmf::DataVarVals const &  dvv 
)
friend

Definition at line 215 of file VarVals.cxx.

216  {
217  cmf::MetaData numumd;
218  cmf::MetaData nuemd;
219 
220  numumd.isMC = false;
221  nuemd .isMC = false;
224 
225  o << "Event Data related variables are: "
226  << "\n\t" << cmf::KeyToVarName(cmf::kNuE_CVN) << " " << dvv.val_at(cmf::kNuE_CVN, nuemd )
227  << "\n\t" << cmf::KeyToVarName(cmf::kNuE_NumMichel) << " " << dvv.val_at(cmf::kNuE_NumMichel, nuemd )
228  << "\n\t" << cmf::KeyToVarName(cmf::kHad_RecoE) << " " << dvv.val_at(cmf::kHad_RecoE, nuemd )
229  << "\n\t" << cmf::KeyToVarName(cmf::kLep_RecoE) << " " << dvv.val_at(cmf::kLep_RecoE, nuemd )
230  << "\n\t" << cmf::KeyToVarName(cmf::kLep_RecoE_MCFrac) << " " << dvv.val_at(cmf::kLep_RecoE_MCFrac, numumd)
231  << "\n\t" << cmf::KeyToVarName(cmf::kNu_RecoE ) << " nue " << dvv.val_at(cmf::kNu_RecoE, nuemd )
232  << "\n\t" << cmf::KeyToVarName(cmf::kNu_RecoE ) << " numu " << dvv.val_at(cmf::kNu_RecoE, numumd)
233  << "\n\t" << cmf::KeyToVarName(cmf::kFake_Weight) << " " << dvv.val_at(cmf::kFake_Weight, nuemd )
234  << std::endl;
235 
236  return o;
237  }
cmf::SelectionType_t selectionType
Definition: Structs.h:116
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:654

Member Data Documentation

cmf::DataVars cmf::DataVarVals::fDataVars
private

Definition at line 389 of file VarVals.h.


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