Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ana::NDExtrapBeamComponent Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/CAFAna/Extrap/NDExtrapBeamComponent.h"

Public Member Functions

 NDExtrapBeamComponent (SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &selection, const int beamParent, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
 
 NDExtrapBeamComponent (const NDExtrapBeamComponent &)=delete
 
NDExtrapBeamComponentoperator= (const NDExtrapBeamComponent &)=delete
 
 NDExtrapBeamComponent (NDExtrapBeamComponent &&)=default
 
NDExtrapBeamComponentoperator= (NDExtrapBeamComponent &&)=default
 
NDOscillatableSpectrum Component ()
 
virtual void SaveTo (TDirectory *dir, const std::string &name) const
 
 NDExtrapBeamComponent ()
 

Static Public Member Functions

static std::unique_ptr< NDExtrapBeamComponentLoadFrom (TDirectory *dir, const std::string &name)
 

Protected Attributes

std::unique_ptr< NDOscillatableSpectrumfNDOscSpecComp
 

Detailed Description

Definition at line 28 of file NDExtrapBeamComponent.h.

Constructor & Destructor Documentation

ana::NDExtrapBeamComponent::NDExtrapBeamComponent ( SpectrumLoaderBase loader,
const HistAxis axis,
const Cut selection,
const int  beamParent,
const SystShifts shiftMC = kNoShift,
const Var weight = kUnweighted 
)

Definition at line 19 of file NDExtrapBeamComponent.cxx.

References fNDOscSpecComp, ana::kIsKaon, ana::kIsMuon, and ana::kIsPion.

25  {
26  if(beamParent==Beam::BeamMode::kIsKaon)
27  {
28  NDExtrapBeamComponent::fNDOscSpecComp = std::unique_ptr<NDOscillatableSpectrum>
29  (new NDOscillatableSpectrum
30  (loader, axis, selection && kIsKaon, shiftMC, weight));
31  // NDExtrapBeamComponent::fCompSpec = std::unique_ptr<Spectrum>
32  // (new Spectrum
33  // (label, bins, loader, var, selection && kIsKaon, shiftMC, weight));
34  }
35  else if(beamParent==Beam::BeamMode::kIsPion)
36  {
37  NDExtrapBeamComponent::fNDOscSpecComp = std::unique_ptr<NDOscillatableSpectrum>
38  (new NDOscillatableSpectrum
39  (loader, axis, selection && kIsPion, shiftMC, weight));
40  // NDExtrapBeamComponent::fCompSpec = std::unique_ptr<Spectrum>
41  // (new Spectrum
42  // (label, bins, loader, var, selection && kIsPion, shiftMC, weight));
43  }
44  else if(beamParent==Beam::BeamMode::kIsMuon)
45  {
46  NDExtrapBeamComponent::fNDOscSpecComp = std::unique_ptr<NDOscillatableSpectrum>
47  (new NDOscillatableSpectrum
48  (loader, axis, selection && kIsMuon, shiftMC, weight));
49  // NDExtrapBeamComponent::fCompSpec = std::unique_ptr<Spectrum>
50  // (new Spectrum
51  // (label, bins, loader, var, selection && kIsMuon, shiftMC, weight));
52  }
53  }
const Var weight
std::unique_ptr< NDOscillatableSpectrum > fNDOscSpecComp
const Cut kIsKaon([](const caf::SRProxy *sr){return(abs(sr->mc.nu[0].beam.ptype)==321||sr->mc.nu[0].beam.ptype==310||sr->mc.nu[0].beam.ptype==311||sr->mc.nu[0].beam.ptype==130);})
Definition: TruthCuts.h:83
const Cut kIsMuon([](const caf::SRProxy *sr){return(abs(sr->mc.nu[0].beam.ptype)==13);})
Definition: TruthCuts.h:84
loader
Definition: demo0.py:10
const Cut kIsPion([](const caf::SRProxy *sr){return(abs(sr->mc.nu[0].beam.ptype)==211||sr->mc.nu[0].beam.ptype==111);})
Definition: TruthCuts.h:80
ana::NDExtrapBeamComponent::NDExtrapBeamComponent ( const NDExtrapBeamComponent )
delete
ana::NDExtrapBeamComponent::NDExtrapBeamComponent ( NDExtrapBeamComponent &&  )
default
ana::NDExtrapBeamComponent::NDExtrapBeamComponent ( )
inline

Definition at line 51 of file NDExtrapBeamComponent.h.

51 {};

Member Function Documentation

NDOscillatableSpectrum ana::NDExtrapBeamComponent::Component ( )

Definition at line 56 of file NDExtrapBeamComponent.cxx.

References fNDOscSpecComp.

57  {
59  }
std::unique_ptr< NDOscillatableSpectrum > fNDOscSpecComp
std::unique_ptr< NDExtrapBeamComponent > ana::NDExtrapBeamComponent::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 88 of file NDExtrapBeamComponent.cxx.

References ana::assert(), dir, and runNovaSAM::ret.

89  {
90  dir = dir->GetDirectory(name.c_str()); // switch to subdir
91  assert(dir);
92 
93  std::unique_ptr<NDExtrapBeamComponent> ret(new NDExtrapBeamComponent);
94 
95  ret->fNDOscSpecComp = ana::LoadFrom<NDOscillatableSpectrum>(dir, "ndoscspeccomp");
96  // ret->fNDOscSpecNue = ana::LoadFrom<NDOscillatableSpectrum>(dir, "ndoscspecnue");
97 
98  delete dir;
99 
100  return ret;
101  }
const XML_Char * name
Definition: expat.h:151
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
NDExtrapBeamComponent& ana::NDExtrapBeamComponent::operator= ( const NDExtrapBeamComponent )
delete
NDExtrapBeamComponent& ana::NDExtrapBeamComponent::operator= ( NDExtrapBeamComponent &&  )
default
void ana::NDExtrapBeamComponent::SaveTo ( TDirectory *  dir,
const std::string name 
) const
virtual

Definition at line 68 of file NDExtrapBeamComponent.cxx.

References dir, fNDOscSpecComp, and tmp.

69  {
70  TDirectory* tmp = gDirectory;
71 
72  dir = dir->mkdir(name.c_str()); // switch to subdir
73  dir->cd();
74 
75  TObjString("NDExtrapBeamComponent").Write("type");
76 
77  fNDOscSpecComp->SaveTo(dir, "ndoscspeccomp");
78  // fNDOscSpecNue->SaveTo(dir, "ndoscspecnue")
79 
80  dir->Write();
81  delete dir;;
82 
83  tmp->cd();
84  }
const XML_Char * name
Definition: expat.h:151
std::unique_ptr< NDOscillatableSpectrum > fNDOscSpecComp
Float_t tmp
Definition: plot.C:36
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

std::unique_ptr<NDOscillatableSpectrum> ana::NDExtrapBeamComponent::fNDOscSpecComp
protected

Definition at line 51 of file NDExtrapBeamComponent.h.

Referenced by Component(), NDExtrapBeamComponent(), and SaveTo().


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