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

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/CAFAna/Vars/Vars.h"

Public Member Functions

 GetWtMinervaND ()
 
double operator() (const caf::SRProxy *sr) const
 

Protected Member Functions

void InitializeMinervaND () const
 

Protected Attributes

TH1D * fRatiosm [4] = {0}
 

Detailed Description

Definition at line 110 of file Vars.h.

Constructor & Destructor Documentation

ana::GetWtMinervaND::GetWtMinervaND ( )
inline

Definition at line 113 of file Vars.h.

References InitializeMinervaND(), operator()(), and sr.

113 { }

Member Function Documentation

void ana::GetWtMinervaND::InitializeMinervaND ( ) const
protected

Definition at line 186 of file Vars.cxx.

References om::cerr, allTimeWatchdog::endl, fin, ana::FindCAFAnaDir(), plot_validation_datamc::fname, fRatiosm, and string.

Referenced by GetWtMinervaND(), and operator()().

186  {
187  if(fRatiosm[0]) return;
188  std::string fname = FindCAFAnaDir()+"/data/beam/MinervaFluxWtfromLeo.root";
189  TFile fin(fname.c_str(), "read");
190  if(fin.IsZombie()) {
191  std::cerr << "Could not open " << fname << std::endl;
192  return;
193  }
194  fRatiosm[0] = (TH1D*)fin.Get("NDnumu")->Clone();
195  fRatiosm[0]->SetDirectory(0);
196  fRatiosm[1] = (TH1D*)fin.Get("NDanumu")->Clone();
197  fRatiosm[1]->SetDirectory(0);
198  fRatiosm[2] = (TH1D*)fin.Get("NDnue")->Clone();
199  fRatiosm[2]->SetDirectory(0);
200  fRatiosm[3] = (TH1D*)fin.Get("NDanue")->Clone();
201  fRatiosm[3]->SetDirectory(0);
202  }
TString fin
Definition: Style.C:24
OStream cerr
Definition: OStream.cxx:7
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
TH1D * fRatiosm[4]
Definition: Vars.h:117
enum BeamMode string
double ana::GetWtMinervaND::operator() ( const caf::SRProxy sr) const

Definition at line 158 of file Vars.cxx.

References caf::Proxy< caf::SRHeader >::det, fRatiosm, caf::Proxy< caf::StandardRecord >::hdr, InitializeMinervaND(), caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and ana::weight.

Referenced by GetWtMinervaND(), ana::GetWtMippNA49NOvAFD::GetWtMippNA49NOvAFD(), and ana::GetWtMippNA49NOvAND::GetWtMippNA49NOvAND().

159  {
161  if(sr->hdr.det!=1 || sr->mc.nnu==0) return 1;
162 
163  double te = sr->mc.nu[0].E;
164  float weight = 1;
165  if(sr->mc.nu[0].pdgorig == 14) { // weights taken from Leo ratio plots
166  if(te < 10){weight = fRatiosm[0]->Interpolate(te);}
167  else {weight = 1;}
168  }
169  else if(sr->mc.nu[0].pdgorig == -14) {
170  if(te < 10) {weight = fRatiosm[1]->Interpolate(te);}
171  else {weight = 1;}
172  }
173  else if(sr->mc.nu[0].pdgorig == 12) {
174  if(te < 10) {weight = fRatiosm[2]->Interpolate(te);}
175  else {weight = 1;}
176  }
177  else if(sr->mc.nu[0].pdgorig == -12) {
178  if(te < 10) {weight = fRatiosm[3]->Interpolate(te);}
179  else {weight = 1;}
180  }
181  else weight = 1;
182  //std::cout<<"energy: "<<te<<" weight "<<weight<<std::endl;
183  return weight;
184  }
void InitializeMinervaND() const
Definition: Vars.cxx:186
const Var weight
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
TH1D * fRatiosm[4]
Definition: Vars.h:117
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:232

Member Data Documentation

TH1D* ana::GetWtMinervaND::fRatiosm[4] = {0}
mutableprotected

Definition at line 117 of file Vars.h.

Referenced by InitializeMinervaND(), and operator()().


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