Public Member Functions | Private Member Functions | Private Attributes | List of all members
ana::MichelTaggingSyst2020 Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/3FlavorAna/Systs/MichelTaggingSyst.h"

Inheritance diagram for ana::MichelTaggingSyst2020:
ana::ISyst

Public Member Functions

 MichelTaggingSyst2020 ()
 
void Shift (double sigma, caf::SRProxy *sr, double &weight) const override
 Perform the systematic shift. More...
 
virtual const std::stringShortName () const final
 The name printed out to the screen. More...
 
virtual const std::stringLatexName () const final
 The name used on plots (ROOT's TLatex syntax) More...
 
virtual void TruthShift (double sigma, caf::SRNeutrinoProxy *nu, double &weight) const
 
virtual bool IsGenieReweight () const
 GENIE reweights can only provide +/-1,2sigma. More...
 

Private Member Functions

int Hash (caf::SRProxy *sr) const
 

Private Attributes

double fProbUP = .08
 
double fProbDO = .05
 
TRandom3 fMRnd
 

Detailed Description

Definition at line 10 of file MichelTaggingSyst.h.

Constructor & Destructor Documentation

ana::MichelTaggingSyst2020::MichelTaggingSyst2020 ( )
inline

Definition at line 13 of file MichelTaggingSyst.h.

References Hash(), Shift(), sigma(), sr, and ana::weight.

13 : ISyst("michel_tagging2020", "Michel Electrons Tagging Uncertainty") {}
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10

Member Function Documentation

int ana::MichelTaggingSyst2020::Hash ( caf::SRProxy sr) const
private

Definition at line 57 of file MichelTaggingSyst.cxx.

References caf::Proxy< caf::SRHeader >::cycle, caf::Proxy< caf::SRHeader >::evt, caf::Proxy< caf::StandardRecord >::hdr, makeTrainCVSamples::int, caf::Proxy< caf::SRHeader >::run, seed, caf::Proxy< caf::SRHeader >::subevt, caf::Proxy< caf::SRHeader >::subrun, and registry_explorer::v.

Referenced by ana::MichelTaggingSyst2018::MichelTaggingSyst2018(), MichelTaggingSyst2020(), Shift(), and ana::MichelTaggingSyst2018::Shift().

58  {
59  std::size_t seed = 0;
60  std::vector<unsigned int> evtNums {sr->hdr.run, sr->hdr.subrun, (unsigned int)(sr->hdr.cycle), sr->hdr.evt, sr->hdr.subevt};
61  for (auto v : evtNums)
62  seed ^= std::hash<unsigned int>{}(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
63  return seed;
64  }
caf::Proxy< unsigned int > subrun
Definition: SRProxy.h:254
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
caf::Proxy< unsigned int > run
Definition: SRProxy.h:248
caf::Proxy< short unsigned int > subevt
Definition: SRProxy.h:250
unsigned int seed
Definition: runWimpSim.h:102
caf::Proxy< int > cycle
Definition: SRProxy.h:230
caf::Proxy< unsigned int > evt
Definition: SRProxy.h:237
virtual bool ana::ISyst::IsGenieReweight ( ) const
inlinevirtualinherited

GENIE reweights can only provide +/-1,2sigma.

Reimplemented in ana::SummedSyst.

Definition at line 56 of file ISyst.h.

56 {return false;}
virtual const std::string& ana::ISyst::LatexName ( ) const
inlinefinalvirtualinherited

The name used on plots (ROOT's TLatex syntax)

Definition at line 30 of file ISyst.h.

References ana::ISyst::fLatexName, ana::ISyst::Shift(), sigma(), sr, and ana::weight.

Referenced by ana::PredictionInterp::DebugPlotColz(), GetGENIEShiftLabels(), ana::NuISyst::SaveTo(), SystsGENIEAna(), and WriteSystName().

30 {return fLatexName;}
std::string fLatexName
Definition: ISyst.h:60
void ana::MichelTaggingSyst2020::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
overridevirtual

Perform the systematic shift.

Override this function if your systematic depends on non-SRNeutrino quantities. If it is SRNeutrino-only, implement the other function, and let this default forward to you when necessary.

Parameters
sigmaNumber of sigma to shift record by
srThe record to inspect and alter
weightScale this weight for reweighting systematics

Reimplemented from ana::ISyst.

Definition at line 15 of file MichelTaggingSyst.cxx.

References std::abs(), om::cout, caf::Proxy< caf::SRSlcME >::deltat, caf::Proxy< caf::SRTrkME >::deltat, allTimeWatchdog::endl, fMRnd, fProbDO, fProbUP, Hash(), samweb_client.utility::hash, caf::Proxy< caf::StandardRecord >::me, caf::Proxy< caf::SRSlcME >::mid, caf::Proxy< caf::SRTrkME >::mid, caf::Proxy< caf::SRMichelE >::nkalman, caf::Proxy< caf::SRMichelE >::nslc, caf::Proxy< caf::SRParticleTruth >::pdg, PandAna.Demos.tute_pid_validation::slc, caf::Proxy< caf::SRMichelE >::slc, caf::Proxy< caf::SRMichelE >::trkkalman, caf::Proxy< caf::SRSlcME >::truth, and caf::Proxy< caf::SRTrkME >::truth.

Referenced by ana::MichelTaggingSyst2018::MichelTaggingSyst2018(), and MichelTaggingSyst2020().

16  {
17  if(sr->me.nslc != sr->me.slc.size()){
18  std::cout << "me.nslc (" << sr->me.nslc << ") does not match "
19  << "me.slc.size() (" << sr->me.slc.size() << ")..."
20  << std::endl;
21  }
22 
23  if(sr->me.nkalman != sr->me.trkkalman.size()){
24  std::cout << "me.nkalman (" << sr->me.nkalman << ") does not match "
25  << "me.trkkalman.size() (" << sr->me.trkkalman.size() << ")..."
26  << std::endl;
27  }
28 
29  // for the random numbers
30  int hash = Hash(sr);
31  fMRnd.SetSeed(hash);
32 
33  // are shifting the MEs UP or DOWN?
34  double fProb = (sigma >= 0) ? fProbUP : fProbDO;
35 
36  // force to pass/fail MID and deltat criteria in me.slc
37  for(caf::SRSlcMEProxy& slc: sr->me.slc){
38  if(std::abs(slc.truth.pdg) == 11 &&
39  fMRnd.Uniform() < std::abs(sigma*fProb)){
40  slc.mid = (sigma >= 0) ? 4.0 : -1.0;
41  if(slc.deltat <= 1200.) slc.deltat = 1201.;
42  }
43  }
44 
45  // force to pass/fail MID and deltat criteria in trkkalman
46  for(caf::SRTrkMEProxy& trk: sr->me.trkkalman){
47  if(std::abs(trk.truth.pdg) == 11 &&
48  fMRnd.Uniform() < std::abs(sigma*fProb)){
49  trk.mid = (sigma >= 0) ? 4.0 : -1.0;
50  if(trk.deltat <= 1200.) trk.deltat = 1201.;
51  }
52  }
53  }
Proxy for caf::SRSlcME.
Definition: SRProxy.h:658
caf::Proxy< size_t > nslc
Definition: SRProxy.h:716
caf::Proxy< std::vector< caf::SRTrkME > > trkkalman
Definition: SRProxy.h:721
caf::Proxy< std::vector< caf::SRSlcME > > slc
Definition: SRProxy.h:717
caf::Proxy< caf::SRParticleTruth > truth
Definition: SRProxy.h:698
caf::Proxy< float > deltat
Definition: SRProxy.h:692
caf::Proxy< caf::SRMichelE > me
Definition: SRProxy.h:2139
float abs(float number)
Definition: d0nt_math.hpp:39
caf::Proxy< float > deltat
Definition: SRProxy.h:670
Proxy for caf::SRTrkME.
Definition: SRProxy.h:680
Track finder for cosmic rays.
caf::Proxy< size_t > nkalman
Definition: SRProxy.h:715
caf::Proxy< float > mid
Definition: SRProxy.h:673
double sigma(TH1F *hist, double percentile)
OStream cout
Definition: OStream.cxx:6
caf::Proxy< caf::SRParticleTruth > truth
Definition: SRProxy.h:676
caf::Proxy< float > mid
Definition: SRProxy.h:695
int Hash(caf::SRProxy *sr) const
virtual const std::string& ana::ISyst::ShortName ( ) const
inlinefinalvirtualinherited
virtual void ana::ISyst::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
inlinevirtualinherited

For systematics that deal only with the neutrino truth and not any reconstruction/PID details. Systematics defined this way will work on nuTree-derived spectra too (e.g. denominators of efficiencies).

Reimplemented in demo::DemoSyst1, ana::BeamSyst, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, and ana::NOvARwgtSyst.

Definition at line 46 of file ISyst.h.

Referenced by ana::ISyst::Shift().

49  {
50  // Implement this function if your systematic depends only
51  // SRNeutrino. Left blank by default, since systematics using other
52  // information can do nothing sensible to the nuTree.
53  }

Member Data Documentation

TRandom3 ana::MichelTaggingSyst2020::fMRnd
mutableprivate

Definition at line 25 of file MichelTaggingSyst.h.

Referenced by Shift(), and ana::MichelTaggingSyst2018::Shift().

double ana::MichelTaggingSyst2020::fProbDO = .05
private

Definition at line 23 of file MichelTaggingSyst.h.

Referenced by Shift(), and ana::MichelTaggingSyst2018::Shift().

double ana::MichelTaggingSyst2020::fProbUP = .08
private

Definition at line 22 of file MichelTaggingSyst.h.

Referenced by Shift(), and ana::MichelTaggingSyst2018::Shift().


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