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

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

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

Public Member Functions

 MCVarVals ()
 
 MCVarVals (cmf::TruthVars const &tv, cmf::WeightVars const &wv)
 
 MCVarVals (cmf::TruthVars const &tv, cmf::WeightVars const &wv, cmf::SystVarColl const &gv)
 
float val_at (uint8_t const &varkey) const
 Access a Var by name. More...
 
std::map< float, float > SystVarWgts (uint8_t const &varkey) const
 
cmf::TruthVars const & TruthVars () const
 
cmf::WeightVars const & WeightVars () const
 
cmf::SystVarColl const & SystematicShifts () const
 

Private Attributes

cmf::TruthVars fTruthVars
 
cmf::WeightVars fWeightVars
 
cmf::SystVarColl fSystematicShifts
 

Friends

std::ostream & operator<< (std::ostream &o, cmf::MCVarVals const &mcvv)
 

Detailed Description

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

Definition at line 342 of file VarVals.h.

Constructor & Destructor Documentation

cmf::MCVarVals::MCVarVals ( )
inline

Definition at line 350 of file VarVals.h.

351  {}
cmf::MCVarVals::MCVarVals ( cmf::TruthVars const &  tv,
cmf::WeightVars const &  wv 
)
inline

Definition at line 353 of file VarVals.h.

355  : fTruthVars (tv)
356  , fWeightVars(wv)
357  {}
cmf::WeightVars fWeightVars
Definition: VarVals.h:346
cmf::TruthVars fTruthVars
Definition: VarVals.h:345
cmf::MCVarVals::MCVarVals ( cmf::TruthVars const &  tv,
cmf::WeightVars const &  wv,
cmf::SystVarColl const &  gv 
)
inline

Definition at line 359 of file VarVals.h.

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

362  : fTruthVars (tv)
363  , fWeightVars(wv)
364  , fSystematicShifts(gv)
365  {}
cmf::WeightVars fWeightVars
Definition: VarVals.h:346
cmf::SystVarColl fSystematicShifts
Definition: VarVals.h:347
cmf::TruthVars fTruthVars
Definition: VarVals.h:345

Member Function Documentation

cmf::SystVarColl const& cmf::MCVarVals::SystematicShifts ( ) const
inline

Definition at line 378 of file VarVals.h.

378 { return fSystematicShifts; }
cmf::SystVarColl fSystematicShifts
Definition: VarVals.h:347
std::map< float, float > cmf::MCVarVals::SystVarWgts ( uint8_t const &  varkey) const

Definition at line 53 of file VarVals.cxx.

References fSystematicShifts.

Referenced by cmf::ShifterAndWeighter::GENIESystWeight(), cmf::ShifterAndWeighter::MaCCQEReducedWeight(), cmf::ShifterAndWeighter::RPACCQEshapeEnhWeight(), and cmf::ShifterAndWeighter::RPACCQEshapeSuppWeight().

54  {
55  // get the values for this genie systematic
56  auto itr = std::find(fSystematicShifts.begin(), fSystematicShifts.end(), varKey);
57  std::vector<float> vals = (itr != fSystematicShifts.end()) ? itr->SigmasAsVec() : std::vector<float>({1, 1, 1, 1});
58  // for(auto const& itr : fSystematicShifts){
59  // if(itr.Type() == varKey) vals = itr.SigmasAsVec();
60  // }
61 
62  // if the -2 and +2 sigma values are the same, then they aren't meaningful so don't
63  // add them to the map and only return the -1, 0 and +1 sigma values
64  if(vals[0] == vals[3])
65  return std::move(std::map<float, float>({ {-1., vals[1]},
66  { 0., 1.},
67  { 1., vals[2]} }));
68 
69  return std::move(std::map<float, float>({ {-2., vals[0]},
70  {-1., vals[1]},
71  { 0., 1.},
72  { 1., vals[2]},
73  { 2., vals[3]} }));
74  }
cmf::SystVarColl fSystematicShifts
Definition: VarVals.h:347
cmf::TruthVars const& cmf::MCVarVals::TruthVars ( ) const
inline

Definition at line 376 of file VarVals.h.

376 { return fTruthVars; }
cmf::TruthVars fTruthVars
Definition: VarVals.h:345
float cmf::MCVarVals::val_at ( uint8_t const &  varkey) const

Access a Var by name.

Definition at line 18 of file VarVals.cxx.

References cmf::WeightVars::fDISvnCC1pi_Weight, cmf::WeightVars::fEmpiricalMEC_Weight, cmf::WeightVars::fEmpiricalMECtoGENIEQE_Weight, cmf::WeightVars::fEmpiricalMECtoGENIERES_Weight, cmf::WeightVars::fOtherDIS_Weight, cmf::WeightVars::fPPFXFluxCV_Weight, cmf::WeightVars::fRPACCQE_Weight, cmf::WeightVars::fRPARES_Weight, cmf::TruthVars::fTrueCCNC, cmf::TruthVars::fTrueE, cmf::TruthVars::fTrueHitNuc, cmf::TruthVars::fTrueIntMode, cmf::TruthVars::fTrueIntType, cmf::TruthVars::fTrueParentDecay, cmf::TruthVars::fTrueParentPDG, cmf::TruthVars::fTrueParentPT, cmf::TruthVars::fTrueParentPZ, cmf::TruthVars::fTrueParentTargetPDG, cmf::TruthVars::fTruePDG, cmf::TruthVars::fTruePDGOrig, fTruthVars, fWeightVars, cmf::WeightVars::fXSecCV2020_Weight, cmf::WeightVars::fXSecCVPPFX_Weight, cmf::kDISvnCC1pi_Weight, cmf::kEmpiricalMEC_Weight, cmf::kEmpiricalMECtoGENIEQE_Weight, cmf::kEmpiricalMECtoGENIERES_Weight, cmf::kOtherDIS_Weight, cmf::kPPFXFluxCVWgt, cmf::kRPACCQE_Weight, cmf::kRPARES_Weight, cmf::kTrueCCNC, cmf::kTrueE, cmf::kTrueHitNuc, cmf::kTrueIntMode, cmf::kTrueIntType, cmf::kTrueParentDecay, cmf::kTrueParentPDG, cmf::kTrueParentPT, cmf::kTrueParentPZ, cmf::kTrueParentTargetPDG, cmf::kTruePDG, cmf::kTruePDGOrig, cmf::kXSecCVPPFX_Weight, and cmf::kXSecCVWgt2020.

Referenced by cmf::ShifterAndWeighter::BeamSystWeight(), cmf::ShifterAndWeighter::COHScale2018Weight(), cmf::ShifterAndWeighter::CosmicMuNormWeight(), cmf::ShifterAndWeighter::CosmicOverlayNormWeight(), cmf::ShifterAndWeighter::DISvnCC1piWeight(), cmf::ShifterAndWeighter::FluxPCAWeight(), cmf::ShifterAndWeighter::GeniePCASystWeight(), cmf::ShifterAndWeighter::MECEnuShapeWeight(), cmf::ShifterAndWeighter::MECInitStateNPFracWeight(), cmf::ShifterAndWeighter::MECNormWeight(), cmf::ShifterAndWeighter::MECShapeWeight(), cmf::ShifterAndWeighter::NCNormWeight(), cmf::ShifterAndWeighter::NueAcceptBkg2018Weight(), cmf::ShifterAndWeighter::NueAcceptSignalKin2018Weight(), cmf::operator<<(), cmf::ShifterAndWeighter::OscillationWeightBinCenter(), cmf::ShifterAndWeighter::OscillationWeightTrueE(), cmf::ShifterAndWeighter::RadCorrNueBarWeight(), cmf::ShifterAndWeighter::RadCorrNueWeight(), cmf::ShifterAndWeighter::RPACCQEshapeEnhWeight(), cmf::ShifterAndWeighter::RPACCQEshapeSuppWeight(), cmf::ShifterAndWeighter::RPACCQEWeight(), cmf::ShifterAndWeighter::RPARESWeight(), cmf::ShifterAndWeighter::SecondClassCurrWeight(), cmf::ShifterAndWeighter::SumSmallXSec2017Weight(), cmf::ShifterAndWeighter::TauScaleSystWeight(), cmf::ShifterAndWeighter::UseMECWeight(), cmf::ShifterAndWeighter::Weight(), and cmf::ShifterAndWeighter::XSecCVPPFXWeight().

19  {
20  if (varkey == kTrueE ) return fTruthVars.fTrueE;
21  else if(varkey == kTruePDG ) return fTruthVars.fTruePDG;
22  else if(varkey == kTrueCCNC ) return fTruthVars.fTrueCCNC;
23  else if(varkey == kTrueIntType ) return fTruthVars.fTrueIntType;
24  else if(varkey == kTruePDGOrig ) return fTruthVars.fTruePDGOrig;
25  else if(varkey == kTrueParentPDG ) return fTruthVars.fTrueParentPDG;
26  else if(varkey == kTrueParentPT ) return fTruthVars.fTrueParentPT;
27  else if(varkey == kTrueParentPZ ) return fTruthVars.fTrueParentPZ;
28  else if(varkey == kTrueParentDecay ) return fTruthVars.fTrueParentDecay;
29  else if(varkey == kTrueParentTargetPDG) return fTruthVars.fTrueParentTargetPDG;
30  else if(varkey == kTrueHitNuc ) return fTruthVars.fTrueHitNuc;
31  else if(varkey == kTrueIntMode ) return fTruthVars.fTrueIntMode;
32 
33  else if(varkey == kXSecCVPPFX_Weight ) return fWeightVars.fXSecCVPPFX_Weight;
34  else if(varkey == kRPACCQE_Weight ) return fWeightVars.fRPACCQE_Weight;
35  else if(varkey == kRPARES_Weight ) return fWeightVars.fRPARES_Weight;
36  else if(varkey == kDISvnCC1pi_Weight ) return fWeightVars.fDISvnCC1pi_Weight;
37  else if(varkey == kEmpiricalMEC_Weight ) return fWeightVars.fEmpiricalMEC_Weight;
40  else if(varkey == kOtherDIS_Weight ) return fWeightVars.fOtherDIS_Weight;
41  else if(varkey == kXSecCVWgt2020 ) return fWeightVars.fXSecCV2020_Weight;
42  else if(varkey == kPPFXFluxCVWgt ) return fWeightVars.fPPFXFluxCV_Weight;
43 
44  throw cet::exception("VarVals")
45  << "Key: "
46  << varkey
47  << " does not correspond to any variable";
48 
49  return std::numeric_limits<float>::lowest();
50  }
float fDISvnCC1pi_Weight
To be used for systematic evaluation ONLY.
Definition: VarVals.h:153
float fTruePDGOrig
true PDG of original neutrino
Definition: VarVals.h:50
float fEmpiricalMECtoGENIEQE_Weight
Ditto.
Definition: VarVals.h:155
float fEmpiricalMEC_Weight
Ditto.
Definition: VarVals.h:154
cmf::WeightVars fWeightVars
Definition: VarVals.h:346
float fPPFXFluxCV_Weight
For 2020 Ana, store weights seperately.
Definition: VarVals.h:159
float fTrueHitNuc
true hit nucleus
Definition: VarVals.h:56
float fTrueCCNC
true cc vs nc
Definition: VarVals.h:48
float fTrueParentDecay
true parent decay mode
Definition: VarVals.h:54
float fTruePDG
true PDG
Definition: VarVals.h:47
float fTrueParentPT
true p_T of neutrino parent
Definition: VarVals.h:52
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
float fEmpiricalMECtoGENIERES_Weight
Ditto.
Definition: VarVals.h:156
float fRPARES_Weight
To be used for systematic evaluation ONLY.
Definition: VarVals.h:152
float fTrueE
True nu energy.
Definition: VarVals.h:46
float fTrueParentPDG
true PDG of neutrino parent
Definition: VarVals.h:51
cmf::TruthVars fTruthVars
Definition: VarVals.h:345
float fRPACCQE_Weight
To be used for systematic evaluation ONLY.
Definition: VarVals.h:151
float fXSecCV2020_Weight
For 2020 Ana, store weights seperately.
Definition: VarVals.h:158
float fXSecCVPPFX_Weight
Was Tufts weight for SA.
Definition: VarVals.h:150
float fTrueParentPZ
true p_Z of neutrino parent
Definition: VarVals.h:53
float fOtherDIS_Weight
Ditto.
Definition: VarVals.h:157
float fTrueIntType
true interaction type
Definition: VarVals.h:49
float fTrueIntMode
true interaction mode
Definition: VarVals.h:57
float fTrueParentTargetPDG
true parent pdg code off the target
Definition: VarVals.h:55
cmf::WeightVars const& cmf::MCVarVals::WeightVars ( ) const
inline

Definition at line 377 of file VarVals.h.

377 { return fWeightVars; }
cmf::WeightVars fWeightVars
Definition: VarVals.h:346

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
cmf::MCVarVals const &  mcvv 
)
friend

Definition at line 77 of file VarVals.cxx.

78  {
79  o << "Event MC related variables are: "
80  << "\n\t" << cmf::KeyToVarName(cmf::kTrueE) << " " << mcvv.val_at(cmf::kTrueE )
81  << "\n\t" << cmf::KeyToVarName(cmf::kTruePDG) << " " << mcvv.val_at(cmf::kTruePDG )
82  << "\n\t" << cmf::KeyToVarName(cmf::kTrueCCNC) << " " << mcvv.val_at(cmf::kTrueCCNC )
83  << "\n\t" << cmf::KeyToVarName(cmf::kTrueIntType) << " " << mcvv.val_at(cmf::kTrueIntType )
84  << "\n\t" << cmf::KeyToVarName(cmf::kTruePDGOrig) << " " << mcvv.val_at(cmf::kTruePDGOrig )
85  << "\n\t" << cmf::KeyToVarName(cmf::kTrueParentPDG) << " " << mcvv.val_at(cmf::kTrueParentPDG )
86  << "\n\t" << cmf::KeyToVarName(cmf::kTrueParentPT) << " " << mcvv.val_at(cmf::kTrueParentPT )
87  << "\n\t" << cmf::KeyToVarName(cmf::kTrueParentPZ) << " " << mcvv.val_at(cmf::kTrueParentPZ )
88  << "\n\t" << cmf::KeyToVarName(cmf::kTrueParentDecay) << " " << mcvv.val_at(cmf::kTrueParentDecay )
89  << "\n\t" << cmf::KeyToVarName(cmf::kTrueParentTargetPDG) << " " << mcvv.val_at(cmf::kTrueParentTargetPDG)
90  << "\n\t" << cmf::KeyToVarName(cmf::kTrueHitNuc) << " " << mcvv.val_at(cmf::kTrueHitNuc )
91  << "\n\t" << cmf::KeyToVarName(cmf::kTrueIntMode) << " " << mcvv.val_at(cmf::kTrueIntMode )
92  << "\n\t" << cmf::KeyToVarName(cmf::kXSecCVPPFX_Weight) << " " << mcvv.val_at(cmf::kXSecCVPPFX_Weight )
93  << "\n\t" << cmf::KeyToVarName(cmf::kRPACCQE_Weight) << " " << mcvv.val_at(cmf::kRPACCQE_Weight )
94  << "\n\t" << cmf::KeyToVarName(cmf::kRPARES_Weight) << " " << mcvv.val_at(cmf::kRPARES_Weight )
95  << "\n\t" << cmf::KeyToVarName(cmf::kDISvnCC1pi_Weight) << " " << mcvv.val_at(cmf::kDISvnCC1pi_Weight )
96  << "\n\t" << cmf::KeyToVarName(cmf::kEmpiricalMEC_Weight) << " " << mcvv.val_at(cmf::kEmpiricalMEC_Weight)
99  << "\n\t" << cmf::KeyToVarName(cmf::kOtherDIS_Weight) << " " << mcvv.val_at(cmf::kOtherDIS_Weight )
100  << "\n\t and too many GENIE knobs to list"
101  << std::endl;
102 
103  return o;
104  }
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:654

Member Data Documentation

cmf::SystVarColl cmf::MCVarVals::fSystematicShifts
private

Definition at line 347 of file VarVals.h.

Referenced by SystVarWgts().

cmf::TruthVars cmf::MCVarVals::fTruthVars
private

Definition at line 345 of file VarVals.h.

Referenced by val_at().

cmf::WeightVars cmf::MCVarVals::fWeightVars
private

Definition at line 346 of file VarVals.h.

Referenced by val_at().


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