Classes | Functions | Variables
jw Namespace Reference

Classes

class  CompNormSyst
 
class  IRescaledSigmaSyst
 
class  MECInitStateNPFracShift
 
class  NDPredGenerator
 
struct  Q3Q0Bin
 
class  TrivialPrediction
 

Functions

const ana::Var GetWeightFromShifts (const ana::SystShifts &sys_shifts)
 
const ana::Cut GetCutIsFitMEC (const bool isRHC)
 
std::string GetMECTuningDirectory ()
 
std::string GetNeutrinoTag (const bool isRHC)
 
std::string GetFitTag (const bool isRHC, const std::string shift_non_mec)
 
std::string GetMECWeightsFileName (const bool isRHC, const std::string shift_non_mec)
 
void LoadWeightsTunedNumuMEC (const std::string shift_non_mec)
 
ana::Cut Q3Q0CutFactory (float loQ3, float hiQ3, float loQ0, float hiQ0)
 

Variables

const std::map< int, std::string > NN_PAIR_NAMES
 
TH2D * hist_input_mec_weights_numu = NULL
 
const ana::Var kWeightTunedNumuMEC ([](const caf::SRProxy *sr){if(!ana::kIsDytmanMEC(sr)||!sr->mc.nu[0].iscc) return 1.0;if(sr->mc.nu[0].pdg!=14) return 1.0;if(hist_input_mec_weights_numu==NULL) throw std::runtime_error("FHC MEC true (q0,q3) weights histogram is NULL");double q0=ana::kTrueQ0(sr);double q3=ana::kTrueQ3(sr);if(q0< hist_input_mec_weights_numu->GetYaxis() ->GetXmin()|| q0 > hist_input_mec_weights_numu->GetYaxis() ->GetXmax()|| q3< hist_input_mec_weights_numu->GetXaxis() ->GetXmin()|| q3 > hist_input_mec_weights_numu->GetXaxis() ->GetXmax()) return 1.0;double weight=hist_input_mec_weights_numu->Interpolate(q3, q0);if(weight< 0) weight=0.0;return weight;})
 

Function Documentation

const ana::Cut jw::GetCutIsFitMEC ( const bool  isRHC)

Definition at line 68 of file mec_tuning.C.

References if(), ana::kIsDytmanMEC, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nu, and Munits::sr.

Referenced by mec_tuning().

69  {
70  const ana::Cut kIsFitMEC( [ isRHC ]( const caf::SRProxy * sr )
71  {
72  if ( !ana::kIsDytmanMEC( sr ) || !sr->mc.nu[0].iscc ) return false;
73  if ( !isRHC && sr->mc.nu[0].pdg == 14 ) return true;
74  else if ( isRHC && sr->mc.nu[0].pdg == -14 ) return true;
75  else return false;
76  });
77  return kIsFitMEC;
78  }
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:569
const Cut kIsDytmanMEC
Definition: TruthCuts.cxx:187
if(dump)
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:1981
static constexpr Double_t sr
Definition: Munits.h:164
std::string jw::GetFitTag ( const bool  isRHC,
const std::string  shift_non_mec 
)

Definition at line 94 of file mec_tuning.C.

References GetNeutrinoTag().

Referenced by GetMECWeightsFileName(), and mec_tuning().

95  {
96  std::string fit_tag = GetNeutrinoTag( isRHC );
97  if ( !shift_non_mec.empty() ) fit_tag += "_shift_non_mec_" + shift_non_mec;
98  return fit_tag;
99  }
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string GetNeutrinoTag(const bool isRHC)
Definition: mec_tuning.C:89
std::string jw::GetMECTuningDirectory ( )

Definition at line 84 of file mec_tuning.C.

References cet::getenv().

Referenced by LoadWeightsTunedNumuMEC(), and mec_tuning().

85  {
86  return Form( "/nova/ana/users/%s/mec_tuning", getenv( "USER" ) );
87  }
std::string getenv(std::string const &name)
std::string jw::GetMECWeightsFileName ( const bool  isRHC,
const std::string  shift_non_mec 
)

Definition at line 101 of file mec_tuning.C.

References GetFitTag().

Referenced by LoadWeightsTunedNumuMEC(), and mec_tuning().

102  {
103  return "mec_weights_" + GetFitTag( isRHC, shift_non_mec ) + ".root";
104  }
std::string GetFitTag(const bool isRHC, const std::string shift_non_mec)
Definition: mec_tuning.C:94
std::string jw::GetNeutrinoTag ( const bool  isRHC)

Definition at line 89 of file mec_tuning.C.

Referenced by GetFitTag(), and mec_tuning().

90  {
91  return isRHC ? "numubar" : "numu";
92  }
const ana::Var jw::GetWeightFromShifts ( const ana::SystShifts sys_shifts)

Definition at line 56 of file mec_tuning.C.

References ana::SystShifts::Shift(), Munits::sr, and weight.

Referenced by mec_tuning().

57  {
58  const ana::Var kWeightFromShifts( [ sys_shifts ]( const caf::SRProxy *sr )
59  {
60  caf::SRProxy* face_palm = const_cast<caf::SRProxy*>( sr );
61  double weight = 1.0;
62  sys_shifts.Shift( face_palm, weight );
63  return weight;
64  });
65  return kWeightFromShifts;
66  }
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
static constexpr Double_t sr
Definition: Munits.h:164
void Shift(caf::SRProxy *sr, double &weight) const
Definition: SystShifts.cxx:154
const Var weight
Definition: exporter_fd.C:34
void jw::LoadWeightsTunedNumuMEC ( const std::string  shift_non_mec)

Definition at line 111 of file mec_tuning.C.

References om::cout, allTimeWatchdog::endl, GetMECTuningDirectory(), GetMECWeightsFileName(), GetYaxis(), if(), ana::kIsDytmanMEC, ana::kTrueQ0, ana::kTrueQ3, kWeightTunedNumuMEC, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nu, Munits::sr, and weight.

Referenced by mec_tuning().

112  {
113  std::string numu_mec_weights_file_name = GetMECTuningDirectory() + "/" + GetMECWeightsFileName( false, shift_non_mec );
114  if ( gSystem->AccessPathName( numu_mec_weights_file_name.c_str() ) ) throw std::runtime_error( "FHC MEC weights file not found:\n" + numu_mec_weights_file_name );
115  std::cout << "Loading FHC MEC weights from file:\n" << numu_mec_weights_file_name << std::endl;
116  TFile* numu_mec_weights_file = new TFile( numu_mec_weights_file_name.c_str() );
117  hist_input_mec_weights_numu = (TH2D*)numu_mec_weights_file->Get( "numu_mec_weights_smoothed" );
118  }
std::string GetMECWeightsFileName(const bool isRHC, const std::string shift_non_mec)
Definition: mec_tuning.C:101
OStream cout
Definition: OStream.cxx:6
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string GetMECTuningDirectory()
Definition: mec_tuning.C:84
TH2D * hist_input_mec_weights_numu
ana::Cut jw::Q3Q0CutFactory ( float  loQ3,
float  hiQ3,
float  loQ0,
float  hiQ0 
)

Definition at line 152 of file mec_tuning.C.

References jw::Q3Q0Bin::hiQ0, ana::kTrueQ0, and ana::kTrueQ3.

Referenced by mec_tuning().

153  {
154  return std::move( ana::Cut ( [ loQ3, hiQ3, loQ0, hiQ0 ]( const caf::SRProxy * sr )
155  {
156  double q3 = ana::kTrueQ3( sr );
157  double q0 = ana::kTrueQ0( sr );
158  return q3 > loQ3 && q3 < hiQ3 && q0 > loQ0 && q0 < hiQ0;
159  }
160  ));
161  }
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const Var kTrueQ0
Definition: TruthVars.h:32
const Var kTrueQ3
Definition: TruthVars.h:38
static constexpr Double_t sr
Definition: Munits.h:164

Variable Documentation

TH2D* jw::hist_input_mec_weights_numu = NULL

Definition at line 110 of file mec_tuning.C.

Referenced by mec_tuning().

const ana::Var jw::kWeightTunedNumuMEC([](const caf::SRProxy *sr){if(!ana::kIsDytmanMEC(sr)||!sr->mc.nu[0].iscc) return 1.0;if(sr->mc.nu[0].pdg!=14) return 1.0;if(hist_input_mec_weights_numu==NULL) throw std::runtime_error("FHC MEC true (q0,q3) weights histogram is NULL");double q0=ana::kTrueQ0(sr);double q3=ana::kTrueQ3(sr);if(q0< hist_input_mec_weights_numu->GetYaxis() ->GetXmin()|| q0 > hist_input_mec_weights_numu->GetYaxis() ->GetXmax()|| q3< hist_input_mec_weights_numu->GetXaxis() ->GetXmin()|| q3 > hist_input_mec_weights_numu->GetXaxis() ->GetXmax()) return 1.0;double weight=hist_input_mec_weights_numu->Interpolate(q3, q0); if(weight< 0) weight=0.0;return weight;})
const std::map<int, std::string> jw::NN_PAIR_NAMES
Initial value:
{
{ 2000000200, "nn" },
{ 2000000201, "np" },
{ 2000000202, "pp" },
}

Definition at line 28 of file EHadVisMECpairs.C.

Referenced by EHadVisMECpairs().