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/N21-04-21/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)
 
float RecoEnergy () const
 
float LogicalBin () const
 
float FakeWeight () const
 
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 270 of file VarVals.h.

Constructor & Destructor Documentation

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

Definition at line 281 of file VarVals.h.

References febshutoff_auto::val.

282  : fDataVars(dv)
283  {}
cmf::DataVars fDataVars
Definition: VarVals.h:276

Member Function Documentation

cmf::DataVars const& cmf::DataVarVals::DataVars ( ) const
inline
float cmf::DataVarVals::FakeWeight ( ) const
inline

Definition at line 295 of file VarVals.h.

References cmf::DataVars::fFake_Weight, msf_helper::o, and cmf::operator<<().

295 { return fDataVars.fFake_Weight; }
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:132
cmf::DataVars fDataVars
Definition: VarVals.h:276
float cmf::DataVarVals::LogicalBin ( ) const
inline

Definition at line 294 of file VarVals.h.

References cmf::DataVars::fRecoEBin.

Referenced by cmf::ShifterAndWeighter::FileSystWeight().

294 { return fDataVars.fRecoEBin; }
float fRecoEBin
logical energy bin
Definition: VarVals.h:133
cmf::DataVars fDataVars
Definition: VarVals.h:276
float cmf::DataVarVals::NuRecoEVal ( cmf::MetaData const &  md) const
inlineprivate

Definition at line 199 of file VarVals.cxx.

References cmf::RecoEnergy().

200  {
203  md);
204  }
cmf::DataVars fDataVars
Definition: VarVals.h:276
static float RecoEnergy(float leptonicEnergy, float hadronicEnergy, cmf::MetaData const &md)
Definition: VarVals.h:323
float fHad_RecoE
Definition: VarVals.h:128
float fLep_RecoE
Definition: VarVals.h:129
float cmf::DataVarVals::RecoEnergy ( ) const
inline

Definition at line 293 of file VarVals.h.

References cmf::DataVars::fNu_RecoE.

Referenced by cmf::ShifterAndWeighter::FileSystWeight().

293 { return fDataVars.fNu_RecoE; }
float fNu_RecoE
Definition: VarVals.h:127
cmf::DataVars fDataVars
Definition: VarVals.h:276
void cmf::DataVarVals::set_val_at ( uint8_t const &  varkey,
float const &  val 
)

Definition at line 179 of file VarVals.cxx.

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

Referenced by cmf::DSTToEventList::FillDataVarVals(), and cmf::CAFToEventList::FillDataVarVals().

181  {
182  if (varkey == kNuE_CVN ) fDataVars.fNuE_CVN = val;
183  else if(varkey == kNuE_NumMichel ) fDataVars.fNuE_NumMichel = val;
184  else if(varkey == kNu_RecoE ) fDataVars.fNu_RecoE = val;
185  else if(varkey == kHad_RecoE ) fDataVars.fHad_RecoE = val;
186  else if(varkey == kLep_RecoE ) fDataVars.fLep_RecoE = val;
187  else if(varkey == kLep_RecoE_MCFrac) fDataVars.fLep_RecoE_MCFrac = val;
188  else if(varkey == kRecoQ2 ) fDataVars.fRecoQ2 = val;
189  else if(varkey == kFake_Weight ) fDataVars.fFake_Weight = val;
190  else if(varkey == kRecoEnergyBin ) fDataVars.fRecoEBin = val;
191  else
192  MF_LOG_DEBUG("DataVarVals")
193  << "unable to set Data var "
194  << cmf::KeyToVarName(varkey)
195  << " because the key is unknown";
196  }
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:132
float fRecoQ2
reconstructed Q^2
Definition: VarVals.h:131
float fNuE_CVN
Definition: VarVals.h:125
float fNu_RecoE
Definition: VarVals.h:127
float fRecoEBin
logical energy bin
Definition: VarVals.h:133
float fLep_RecoE_MCFrac
fraction of leptonic energy in muon catcher
Definition: VarVals.h:130
cmf::DataVars fDataVars
Definition: VarVals.h:276
float fNuE_NumMichel
Definition: VarVals.h:126
#define MF_LOG_DEBUG(id)
float fHad_RecoE
Definition: VarVals.h:128
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:410
float fLep_RecoE
Definition: VarVals.h:129
float cmf::DataVarVals::val_at ( uint8_t const &  varkey,
cmf::MetaData const &  md 
) const

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

Definition at line 161 of file VarVals.cxx.

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

Referenced by cmf::operator<<().

163  {
164  if (varkey == kNuE_CVN ) return fDataVars.fNuE_CVN;
165  else if(varkey == kNuE_NumMichel ) return fDataVars.fNuE_NumMichel;
166  else if(varkey == kNu_RecoE ) return fDataVars.fNu_RecoE;
167  else if(varkey == kHad_RecoE ) return fDataVars.fHad_RecoE;
168  else if(varkey == kLep_RecoE ) return fDataVars.fLep_RecoE;
169  else if(varkey == kLep_RecoE_MCFrac) return fDataVars.fLep_RecoE_MCFrac;
170  else if(varkey == kRecoQ2 ) return fDataVars.fRecoQ2;
171  else if(varkey == kFake_Weight ) return fDataVars.fFake_Weight;
172  else if(varkey == kCMF_RecoE ) return this->NuRecoEVal(md);
173  else if(varkey == kRecoEnergyBin ) return fDataVars.fRecoEBin;
174 
175  return std::numeric_limits<float>::lowest();
176  }
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:132
float fRecoQ2
reconstructed Q^2
Definition: VarVals.h:131
float fNuE_CVN
Definition: VarVals.h:125
float fNu_RecoE
Definition: VarVals.h:127
float fRecoEBin
logical energy bin
Definition: VarVals.h:133
float fLep_RecoE_MCFrac
fraction of leptonic energy in muon catcher
Definition: VarVals.h:130
cmf::DataVars fDataVars
Definition: VarVals.h:276
float fNuE_NumMichel
Definition: VarVals.h:126
float fHad_RecoE
Definition: VarVals.h:128
float NuRecoEVal(cmf::MetaData const &md) const
Definition: VarVals.cxx:199
float fLep_RecoE
Definition: VarVals.h:129

Friends And Related Function Documentation

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

Definition at line 207 of file VarVals.cxx.

208  {
209  cmf::MetaData numumd;
210  cmf::MetaData nuemd;
211 
212  numumd.isMC = false;
213  nuemd .isMC = false;
216 
217  o << "Event Data related variables are: "
218  << "\n\t" << cmf::KeyToVarName(cmf::kNuE_CVN) << " " << dvv.val_at(cmf::kNuE_CVN, nuemd )
219  << "\n\t" << cmf::KeyToVarName(cmf::kNuE_NumMichel) << " " << dvv.val_at(cmf::kNuE_NumMichel, nuemd )
220  << "\n\t" << cmf::KeyToVarName(cmf::kHad_RecoE) << " " << dvv.val_at(cmf::kHad_RecoE, nuemd )
221  << "\n\t" << cmf::KeyToVarName(cmf::kLep_RecoE) << " " << dvv.val_at(cmf::kLep_RecoE, nuemd )
222  << "\n\t" << cmf::KeyToVarName(cmf::kLep_RecoE_MCFrac) << " " << dvv.val_at(cmf::kLep_RecoE_MCFrac, numumd)
223  << "\n\t" << cmf::KeyToVarName(cmf::kNu_RecoE ) << " nue " << dvv.val_at(cmf::kNu_RecoE, nuemd )
224  << "\n\t" << cmf::KeyToVarName(cmf::kNu_RecoE ) << " numu " << dvv.val_at(cmf::kNu_RecoE, numumd)
225  << "\n\t" << cmf::KeyToVarName(cmf::kFake_Weight) << " " << dvv.val_at(cmf::kFake_Weight, nuemd )
226  << std::endl;
227 
228  return o;
229  }
cmf::SelectionType_t selectionType
Definition: Structs.h:116
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:410

Member Data Documentation

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

Definition at line 276 of file VarVals.h.


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